Index: sm/LICENSE
===================================================================
--- /issm/LICENSE	(revision 28275)
+++ 	(revision )
@@ -1,28 +1,0 @@
-Copyright (c) 2002-2011, California Institute of Technology.
-All rights reserved.  Based on Government Sponsored Research under contracts
-NAS7-1407 and/or NAS7-03001.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-    1. Redistributions of source code must retain the above copyright notice,
-       this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-       notice, this list of conditions and the following disclaimer in the
-       documentation and/or other materials provided with the distribution.
-    3. Neither the name of the California Institute of Technology (Caltech),
-       its operating division the Jet Propulsion Laboratory (JPL), the National
-       Aeronautics and Space Administration (NASA), nor the names of its
-       contributors may be used to endorse or promote products derived from
-       this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE CALIFORNIA INSTITUTE OF TECHNOLOGY BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index: /issm/trunk/COPYING
===================================================================
--- /issm/trunk/COPYING	(revision 1)
+++ /issm/trunk/COPYING	(revision 1)
@@ -0,0 +1,1 @@
+link /u/wilkes-r1b/larour/Bin/automake/share/automake-1.10/COPYING
Index: /issm/trunk/ChangeLog
===================================================================
--- /issm/trunk/ChangeLog	(revision 1)
+++ /issm/trunk/ChangeLog	(revision 1)
@@ -0,0 +1,2499 @@
+2009-04-22 17:03  seroussi
+
+	* test/Verification/: test1_icesheet_noicefront/Front.exp,
+	  test2_icesheet_icefront/Square.par,
+	  test3_iceshelf_icefront/Square.par,
+	  test4_icesheet_noicefront_3d/Front.exp,
+	  test5_icesheet_icefront_3d/Square.par,
+	  test6_iceshelf_icefront_3d/Square.par,
+	  test7_penalties_iceshelf_3d/Square.par,
+	  test8_icesheet_noicefront_stokes/Front.exp,
+	  test9_icesheet_icefront_stokes/Square.par,
+	  test10_iceshelf_icefront_stokes/Square.par,
+	  test11_penalties_iceshelf_allmodels/Square.par,
+	  test_cielo/Square.par: simplified Square.par in tests
+
+2009-04-22 16:00  seroussi
+
+	* src/m/classes/@model/model.m: minor
+
+2009-04-22 11:56  jschierm
+
+	* src/m/classes/public/displayqmu.m: Still trying to get displayqmu
+	  right.
+
+2009-04-22 09:57  jschierm
+
+	* src/m/classes/: @model/model.m, public/displayqmu.m: Slight
+	  changes in model class for qmu defaults..
+
+2009-04-22 09:26  morlighe
+
+	* src/m/classes/public/: plugdata.m, plugvelocities.m: minor
+
+2009-04-22 07:46  seroussi
+
+	* test/Verification/test5_icesheet_icefront_3d/: Square.par,
+	  archive_melting.mat, archive_melting_transient.mat,
+	  archive_pattyn.mat, archive_temperature.mat,
+	  archive_temperature_transient.mat, archive_thickness.mat: new
+	  archives for test5 with default parameters
+
+2009-04-22 07:24  seroussi
+
+	* test/Verification/test9_icesheet_icefront_stokes/:
+	  archive_melting.mat, archive_stokes.mat, archive_temperature.mat:
+	  test9 updated archives with default parameters
+
+2009-04-21 17:03  morlighe
+
+	* src/m/utils/BC/: SetIceSheetBC.m, SetIceShelfBC.m,
+	  SetMarineIceSheetBC.m: Added 2 other BC creation routines
+
+2009-04-21 16:53  seroussi
+
+	* test/Verification/test8_icesheet_noicefront_stokes/:
+	  archive_melting.mat, archive_stokes.mat, archive_temperature.mat:
+	  test8 updated archives with default parameters
+
+2009-04-21 16:50  seroussi
+
+	* test/Verification/test7_penalties_iceshelf_3d/:
+	  archive_melting.mat, archive_temperature.mat,
+	  archive_velocity.mat: test7 updated archives with default
+	  parameters
+
+2009-04-21 16:49  seroussi
+
+	* test/Verification/test6_iceshelf_icefront_3d/:
+	  archive_melting.mat, archive_melting_transient.mat,
+	  archive_pattyn.mat, archive_temperature.mat,
+	  archive_temperature_transient.mat, archive_thickness.mat: test6
+	  updated archives with default parameters
+
+2009-04-21 16:49  seroussi
+
+	* test/Verification/test4_icesheet_noicefront_3d/:
+	  archive_hutter.mat, archive_melting.mat, archive_pattyn.mat,
+	  archive_temperature.mat: test4 updated archives with default
+	  parameters
+
+2009-04-21 16:47  seroussi
+
+	* test/Verification/test3_iceshelf_icefront/: archive_acc.mat,
+	  archive_ice.mat, archive_macayeal.mat, archive_thickness.mat:
+	  test3 archives with default parameters
+
+2009-04-21 16:45  seroussi
+
+	* test/Verification/test3_iceshelf_icefront/Square.par: minor
+
+2009-04-21 16:18  morlighe
+
+	* src/m/classes/public/plugvelocities.m: minor
+
+2009-04-21 16:11  seroussi
+
+	* src/m/classes/public/ismodelselfconsistent.m: minor
+
+2009-04-21 16:09  morlighe
+
+	* src/m/classes/public/parameterize.m: better error message
+
+2009-04-21 15:52  jschierm
+
+	* src/m/classes/: @model/model.m, public/displayqmu.m: Elimination
+	  of qmu parameters that will be contained within qmu_params
+	  structure.
+
+2009-04-21 15:36  morlighe
+
+	* src/m/classes/public/: plugdata.m, plugvelocities.m: Added 2
+	  useful routines to load data and plug them onto the model easily
+	  (cf Eric Rignot's comments)
+
+2009-04-21 15:23  jschierm
+
+	* src/m/solutions/dakota/: dakota_in_data.m, dakota_in_write.m,
+	  dakota_m_write.m, setupdesign/QmuSetupDesign.m,
+	  setupdesign/setupdrag.m, setupdesign/setupgravity.m,
+	  setupdesign/setupheatcapacity.m, setupdesign/setuprhoice.m,
+	  setupdesign/setuprhowater.m, setupdesign/setupriftsfriction.m,
+	  setupdesign/setupthermalconductivity.m,
+	  setupdesign/setupthickness.m,
+	  updatefunctions/QmuUpdateFunctions.m,
+	  updatefunctions/updatedrag.m, updatefunctions/updategravity.m,
+	  updatefunctions/updateheatcapacity.m,
+	  updatefunctions/updaterho_ice.m,
+	  updatefunctions/updaterho_water.m,
+	  updatefunctions/updateriftsfriction.m,
+	  updatefunctions/updatethermalconductivity.m,
+	  updatefunctions/updatethickness.m: Addition of varargin so that
+	  ISSM can pass model and other data transparently through Dakota
+	  scripts to QmuSetupDesign and QmuUpdateFunctions.
+
+2009-04-21 15:01  seroussi
+
+	* src/m/classes/public/ismodelselfconsistent.m: minor typo
+
+2009-04-21 14:58  seroussi
+
+	* test/Verification/test11_penalties_iceshelf_allmodels/:
+	  Square.par, archive_melting.mat, archive_temperature.mat,
+	  archive_velocity.mat: test11 archives + beginning of Square.par
+
+2009-04-21 14:58  seroussi
+
+	* test/Verification/test10_iceshelf_icefront_stokes/: Square.par,
+	  archive_melting.mat, archive_stokes.mat, archive_temperature.mat:
+	  test10 archives + beginning of Square.par
+
+2009-04-21 14:56  seroussi
+
+	* test/Verification/: test3_iceshelf_icefront/Square.par,
+	  test5_icesheet_icefront_3d/Square.par,
+	  test6_iceshelf_icefront_3d/Square.par,
+	  test7_penalties_iceshelf_3d/Square.par,
+	  test9_icesheet_icefront_stokes/Square.par: beginning of
+	  Square.par
+
+2009-04-21 14:55  seroussi
+
+	* test/Verification/test2_icesheet_icefront/: Square.par,
+	  archive_acc.mat, archive_hutter.mat, archive_ice.mat,
+	  archive_macayeal.mat, archive_thickness.mat: test2 archives +
+	  beginning of Square.par
+
+2009-04-21 14:55  seroussi
+
+	* test/Verification/test1_icesheet_noicefront/: archive_acc.mat,
+	  archive_hutter.mat, archive_ice.mat, archive_macayeal.mat: test1
+	  archives
+
+2009-04-21 14:34  jschierm
+
+	* src/m/solutions/dakota/: dakota_in_data.m, dakota_in_write.m,
+	  dakota_m_write.m, setupdesign/QmuSetupDesign.m,
+	  setupdesign/setupdrag.m, setupdesign/setupgravity.m,
+	  setupdesign/setupheatcapacity.m, setupdesign/setuprhoice.m,
+	  setupdesign/setuprhowater.m, setupdesign/setupriftsfriction.m,
+	  setupdesign/setupthermalconductivity.m,
+	  setupdesign/setupthickness.m,
+	  updatefunctions/QmuUpdateFunctions.m,
+	  updatefunctions/updatedrag.m, updatefunctions/updategravity.m,
+	  updatefunctions/updateheatcapacity.m,
+	  updatefunctions/updaterho_ice.m,
+	  updatefunctions/updaterho_water.m,
+	  updatefunctions/updateriftsfriction.m,
+	  updatefunctions/updatethermalconductivity.m,
+	  updatefunctions/updatethickness.m: Removal of model class so that
+	  Dakota and ISSM scripts are independent.
+
+2009-04-21 14:06  morlighe
+
+	* src/m/classes/public/ismodelselfconsistent.m:
+	  Ismodelselfconsistent rewritten
+
+2009-04-21 13:37  seroussi
+
+	* src/m/utils/UpdateArchive/updatearchive.m: to fit the new names
+
+2009-04-21 13:28  seroussi
+
+	* test/Verification/: test1_icesheet_noicefront/Square.par,
+	  test4_icesheet_noicefront_3d/Square.par,
+	  test8_icesheet_noicefront_stokes/Square.par: cosmetics
+
+2009-04-21 12:27  morlighe
+
+	* src/m/classes/public/parameterize.m: Fixed parameter file error
+	  message
+
+2009-04-21 12:03  seroussi
+
+	* test/Verification/test8_icesheet_noicefront_stokes/: Square.par,
+	  runme.m: simplified Square.par for IceSheet test 8
+
+2009-04-21 12:02  seroussi
+
+	* test/Verification/test4_icesheet_noicefront_3d/: Square.par,
+	  runme.m: simplified Sqaure.par for test4
+
+2009-04-21 12:01  seroussi
+
+	* test/Verification/test1_icesheet_noicefront/: Square.par,
+	  runme.m: simplified Square.par test1
+
+2009-04-21 11:54  seroussi
+
+	* src/m/classes/public/ismodelselfconsistent.m: precised some
+	  checks depending on solutiontype
+
+2009-04-21 11:53  seroussi
+
+	* src/m/utils/BC/SetIceSheetBC.m: set melting and accumulation to
+	  zeros if nothing specified
+
+2009-04-21 11:21  jschierm
+
+	* src/m/classes/: @continuous_design/continuous_design.m,
+	  @continuous_design/display.m,
+	  @continuous_state/continuous_state.m,
+	  @least_squares_term/least_squares_term.m,
+	  @normal_uncertain/normal_uncertain.m,
+	  @objective_function/objective_function.m,
+	  @response_function/response_function.m,
+	  @linear_equality_constraint/linear_equality_constraint.m,
+	  @linear_inequality_constraint/linear_inequality_constraint.m,
+	  @nonlinear_equality_constraint/nonlinear_equality_constraint.m,
+	  @nonlinear_inequality_constraint/nonlinear_inequality_constraint.m:
+	  Set defaults to Dakota values but filter them out before writing.
+
+2009-04-21 10:54  seroussi
+
+	* src/m/classes/public/ismodelselfconsistent.m: optimized
+	  ismodelselfconsistent depending on package, solutiontype
+
+2009-04-21 10:53  seroussi
+
+	* src/m/utils/BC/SetIceSheetBC.m: new routine to create IceSheetBC
+
+2009-04-21 09:43  jschierm
+
+	* src/m/utils/Array/allequal.m: Function to return empty array if
+	  all array elements are equal to given value.
+
+2009-04-20 17:34  morlighe
+
+	* src/m/classes/@model/model.m: Added some initial values in model
+
+2009-04-20 10:28  morlighe
+
+	* src/m/classes/public/plot/plot_streamlines.m: minor
+
+2009-04-20 10:24  morlighe
+
+	* src/m/classes/public/plot/: applyoptions.m, parse_options.m,
+	  plot_streamlines.m, plotdoc.m: Added streamlines plot options,
+	  still some bugs due to tsearch matlab function
+
+2009-04-20 09:57  seroussi
+
+	* test/Validation/ISMIP/TestD/Square.par: minor typo
+
+2009-04-20 08:33  seroussi
+
+	* src/m/classes/public/plot/plot_basaldrag.m: possibility of doing
+	  sectionvalues on basal_drag
+
+2009-04-17 17:20  seroussi
+
+	* src/m/classes/public/plot/plotdoc.m: added capability in doc
+
+2009-04-17 17:19  seroussi
+
+	* src/m/classes/public/plot/plot_dealer.m: added basal_drag x or y
+	  in plot
+
+2009-04-17 17:18  seroussi
+
+	* src/m/classes/public/plot/plot_basaldrag.m: added x or y
+	  component in basal_drag
+
+2009-04-17 16:20  jschierm
+
+	* src/m/classes/: @model/model.m, public/displayqmu.m: Replacement
+	  of comments that got clobbered in previous commit (oops).
+
+2009-04-17 16:13  jschierm
+
+	* src/m/classes/: @model/model.m, public/displayqmu.m: Addition of
+	  qmu_method and qmu_params to model class.
+
+2009-04-17 10:25  jschierm
+
+	* src/m/solutions/dakota/: dakota_in_data.m, dakota_in_write.m:
+	  Implementation of linear constraints.
+
+2009-04-17 10:20  jschierm
+
+	* src/m/classes/@dakota_method/: dakota_method.m, display.m,
+	  dmeth_params_write.m: Implementation of linear constraints.
+
+2009-04-17 09:27  jschierm
+
+	* src/m/classes/: @continuous_design/continuous_design.m,
+	  @continuous_state/continuous_state.m,
+	  @least_squares_term/least_squares_term.m,
+	  @linear_equality_constraint/linear_equality_constraint.m,
+	  @linear_inequality_constraint/linear_inequality_constraint.m,
+	  @nonlinear_equality_constraint/nonlinear_equality_constraint.m,
+	  @nonlinear_inequality_constraint/nonlinear_inequality_constraint.m,
+	  @normal_uncertain/normal_uncertain.m,
+	  @objective_function/objective_function.m,
+	  @response_function/response_function.m: Change of method names
+	  from dvar_ and dresp_ to prop_
+
+2009-04-16 14:46  morlighe
+
+	* src/m/classes/public/plot/plot_tensor_principalaxis.m: better way
+	  of plotting principal axis
+
+2009-04-16 12:12  morlighe
+
+	* src/m/classes/public/plot/: plot_tensor_components.m,
+	  plot_tensor_principal.m, plot_tensor_principalaxis.m: better way
+	  to plot principal axis
+
+2009-04-16 12:06  seroussi
+
+	* test/Validation/EISMINT/MassConservation/runme.m: minor (wrong
+	  name)
+
+2009-04-16 12:05  seroussi
+
+	* test/Validation/EISMINT/MassConservation/CrossLine.exp: minor
+
+2009-04-16 11:57  morlighe
+
+	* src/m/solutions/ice/StrainRateCompute.m: minor
+
+2009-04-16 11:35  morlighe
+
+	* src/m/classes/public/plot/plot_tensor_principalaxis.m: Fixed bug
+	  in principal axis plots
+
+2009-04-16 11:08  morlighe
+
+	* src/m/classes/public/plot/: parse_options.m, plot_quiver.m,
+	  plot_quiver3.m, plot_quivervel.m, plot_tensor_principalaxis.m,
+	  plotdoc.m: Added density option for quiver plots (Thanks Ala)
+
+2009-04-16 10:39  morlighe
+
+	* doc/website/doc_html/about.html: Minor
+
+2009-04-16 08:56  seroussi
+
+	* src/m/classes/public/plot/plotdoc.m: wrong name of option
+
+2009-04-16 07:19  morlighe
+
+	* startup.m: status variable can be cleared (not needed in matlab
+	  workspace)
+
+2009-04-16 07:16  morlighe
+
+	* src/m/classes/public/reorder.m: added mesh reordering (to be used
+	  right after md=mesh(
+
+2009-04-16 07:11  morlighe
+
+	* src/m/classes/public/plot/plot_dealer.m: minor (avoid error
+	  message)
+
+2009-04-15 16:33  morlighe
+
+	* doc/website/doc_html/: about.html, documentation.html: minor
+
+2009-04-15 14:13  ala
+
+	* src/m/solutions/ice/StrainRateCompute.m: 1/a in principalvalues
+	  of stainrate
+
+2009-04-15 14:11  ala
+
+	* src/m/classes/public/solve.m: corrected typo problem
+
+2009-04-15 07:30  morlighe
+
+	* src/m/classes/public/plot/plot_contour.m: no error in contour if
+	  no contour found
+
+2009-04-15 07:21  morlighe
+
+	* src/m/solutions/macayeal/macayealcontrol.m: no plots if
+	  md.plot=0, use drawnow instead of pause(1)
+
+2009-04-14 16:14  morlighe
+
+	* test/Validation/ISMIP/: README, TestA/README: Minor
+
+2009-04-14 16:11  seroussi
+
+	* test/Validation/ISMIP/: README, description.pdf, results.pdf,
+	  TestA/Front.exp, TestA/README, TestA/Square.par, TestA/runme.m,
+	  TestB/Front.exp, TestB/README, TestB/Square.par, TestB/runme.m,
+	  TestC/Front.exp, TestC/README, TestC/Square.par, TestC/runme.m,
+	  TestD/Front.exp, TestD/README, TestD/Square.par, TestD/runme.m,
+	  TestE/Front.exp, TestE/README, TestE/Square.par, TestE/data.mat,
+	  TestE/data.txt, TestE/runme.m: added ISMIP_HOM tests
+
+2009-04-10 13:32  morlighe
+
+	* contributors.txt: added photo source
+
+2009-04-10 12:09  morlighe
+
+	* src/m/utils/Exp/manipulation/mergeprofiles.m: initialize tips
+	  just in case
+
+2009-04-10 12:05  morlighe
+
+	* src/m/utils/Exp/manipulation/mergeprofiles.m: Fixed bug again...
+
+2009-04-10 11:43  morlighe
+
+	* src/m/utils/Exp/manipulation/: cutarea.m, mergeprofiles.m,
+	  removeseveralpoints.m: Fixed some bugs
+
+2009-04-10 10:52  morlighe
+
+	* src/m/utils/Exp/expmaster.m: some bugs remaining
+
+2009-04-10 10:42  morlighe
+
+	* src/m/utils/Exp/manipulation/: addendprofile.m,
+	  addinsideprofile.m, closeprofile.m, cutarea.m, cutprofile.m,
+	  mergeprofiles.m, modifyposition.m, removepoints.m,
+	  removeprofile.m, removeseveralpoints.m: Minor
+
+2009-04-09 09:52  morlighe
+
+	* test/Validation/EISMINT/: README, description_EISMINT.pdf,
+	  shelf-descr.pdf, Diagnostic1/README, Diagnostic1/runme.m,
+	  Diagnostic2/README, Diagnostic2/runme.m, MassConservation/README,
+	  MassConservation/runme.m, Transient/README, Transient/runme.m:
+	  Minor
+
+2009-04-09 09:40  seroussi
+
+	* test/Validation/EISMINT/: README, shelf-descr.pdf,
+	  Diagnostic1/DomainOutline.exp, Diagnostic1/Front.exp,
+	  Diagnostic1/README, Diagnostic1/Square.par, Diagnostic1/runme.m,
+	  Diagnostic2/DomainOutline.exp, Diagnostic2/Front.exp,
+	  Diagnostic2/README, Diagnostic2/Square.par, Diagnostic2/runme.m,
+	  MassConservation/CrossLine.exp,
+	  MassConservation/DomainOutline.exp, MassConservation/Front.exp,
+	  MassConservation/README, MassConservation/Square.par,
+	  MassConservation/runme.m, Transient/DomainOutline.exp,
+	  Transient/Front.exp, Transient/README, Transient/Square.par,
+	  Transient/runme.m: Added EISMINT test for MacAyeal and
+	  prognostic2d
+
+2009-04-09 07:50  morlighe
+
+	* doc/website/doc_c/: createchtmldoc.sh, layoutissm.xml: minor
+	  changes
+
+2009-04-09 07:37  morlighe
+
+	* src/m/utils/Mesh/: meshmaker.m, squaremesh.m: Improved squaremesh
+
+2009-04-08 15:29  jschierm
+
+	* src/m/classes/: @linear_inequality_constraint/display.m,
+	  @linear_inequality_constraint/linear_inequality_constraint.m,
+	  @linear_equality_constraint/display.m,
+	  @linear_equality_constraint/linear_equality_constraint.m:
+	  Addition of linear constraint classes.
+
+2009-04-08 14:55  morlighe
+
+	* src/m/classes/public/plot/processdata.m: this way it is better
+
+2009-04-08 14:52  morlighe
+
+	* src/m/classes/public/plot/processdata.m: not needed
+
+2009-04-08 14:49  morlighe
+
+	* src/m/classes/public/plot/processdata.m: minor
+
+2009-04-08 14:23  seroussi
+
+	* src/m/utils/Mesh/meshmaker.m: better comments
+
+2009-04-08 14:16  seroussi
+
+	* src/m/utils/Mesh/meshmaker.m: added meshmaker for structerated
+	  sqaure mesh
+
+2009-04-08 13:50  morlighe
+
+	* doc/website/doc_html/: about.html: typo
+
+2009-04-08 13:35  morlighe
+
+	* src/m/classes/public/plot/plot_elementstype.m: fixed
+	  plot_elementstype when Stokes... Matlab crashes with alpha on
+	  patches now...
+
+2009-04-08 11:55  jschierm
+
+	* src/m/utils/Array/item2str.m: Addition of error checking.
+
+2009-04-08 11:51  morlighe
+
+	* doc/website/doc_c/: createchtmldoc.sh, doxygen.config,
+	  layoutissm.xml: Added issmlayout
+
+2009-04-08 11:32  jschierm
+
+	* src/m/classes/@dakota_method/: dakota_method.m,
+	  dmeth_params_write.m: Addition of method-independent parameters
+	  to dakota_method class.
+
+2009-04-08 11:01  morlighe
+
+	* doc/website/doc_c/createchtmldoc.sh: doxygen tabs are nicer
+
+2009-04-08 10:45  morlighe
+
+	* doc/website/doc_html/faq.html: minor
+
+2009-04-08 10:09  morlighe
+
+	* doc/website/doc_html/: about.html, style.css: minor
+
+2009-04-08 09:00  morlighe
+
+	* src/m/utils/Exp/: expmaster.m, manipulation/addcontour.m: Added
+	  addcontour
+
+2009-04-08 08:38  morlighe
+
+	* src/m/utils/Exp/expmaster.m: Fixed expmaster: now much much
+	  faster thanks to getframe
+
+2009-04-07 17:10  seroussi
+
+	* src/m/: classes/public/isresultconsistent.m,
+	  solutions/ice/ModelProcessorDiagnosticHoriz.m: generalised mpcs
+	  for periodic boundary conditions
+
+2009-04-07 17:08  seroussi
+
+	* src/m/classes/public/: SectionValues.m, plot/plot_section.m:
+	  Fixed Section plot
+
+2009-04-07 16:53  morlighe
+
+	* src/m/classes/public/plot/plot_section.m: test fix section plot
+
+2009-04-07 16:42  seroussi
+
+	* src/m/classes/public/SectionValues.m: to be continued
+
+2009-04-07 16:39  morlighe
+
+	* doc/index.html: Minor
+
+2009-04-07 16:07  morlighe
+
+	* doc/website/doc_html/style.css: improved menu
+
+2009-04-07 15:48  morlighe
+
+	* doc/: index.html, website/doc_html/about.html,
+	  website/doc_html/documentation.html,
+	  website/doc_html/download.html, website/doc_html/faq.html,
+	  website/doc_html/features.html,
+	  website/doc_html/installation.html, website/doc_html/style.css,
+	  website/doc_html/wiki.html: Minor
+
+2009-04-07 15:07  jschierm
+
+	* src/m/solutions/dakota/: dakota_in_data.m, dakota_in_write.m,
+	  dakota_m_write.m: Implementation of parameters in dakota_method
+	  class
+
+2009-04-07 14:45  jschierm
+
+	* src/m/classes/@dakota_method/: dakota_method.m, display.m,
+	  dmeth_params_merge.m, dmeth_params_write.m: Addition of
+	  method-dependent parameters into dakota_method class.
+
+2009-04-07 14:33  morlighe
+
+	* src/m/classes/public/thicknessevolution.m: Accelerated
+	  thicnessevolution
+
+2009-04-07 14:30  morlighe
+
+	* doc/website/doc_html/: download.html, style.css: Added download
+	  webpage
+
+2009-04-07 14:17  seroussi
+
+	* src/m/classes/public/plot/applyoptions.m: minor
+
+2009-04-07 14:04  seroussi
+
+	* src/m/classes/public/plot/plot_penalties.m: isnan returned an
+	  empty matrix instead of a boolean
+
+2009-04-07 13:59  seroussi
+
+	* src/m/classes/public/plot/applyoptions.m: minor
+
+2009-04-07 13:21  morlighe
+
+	* doc/index.html: minor
+
+2009-04-07 11:59  morlighe
+
+	* doc/: index.html, website/doc_html/about.html,
+	  website/doc_html/documentation.html,
+	  website/doc_html/download.html, website/doc_html/faq.html,
+	  website/doc_html/features.html,
+	  website/doc_html/installation.html, website/doc_html/style.css,
+	  website/doc_html/wiki.html: Added About us webpage
+
+2009-04-07 11:16  morlighe
+
+	* doc/: index.html, website/doc_html/installation.html,
+	  website/doc_html/style.css: completed installation page
+
+2009-04-07 10:49  seroussi
+
+	* src/m/classes/public/extrude.m: dirichlet value (thickness) for
+	  prognostic must be same on each layer
+
+2009-04-07 10:18  seroussi
+
+	* src/m/classes/public/plot/: plot_contour.m, processdata.m: fixed
+	  contour for 3d meshes (Thank you Mathieu)
+
+2009-04-07 10:03  seroussi
+
+	* src/m/classes/public/plot/applyoptions.m: minor typo
+
+2009-04-07 09:16  morlighe
+
+	* doc/: index.html, website/doc_html/about.html,
+	  website/doc_html/at_work.gif,
+	  website/doc_html/documentation.html,
+	  website/doc_html/download.html, website/doc_html/faq.html,
+	  website/doc_html/features.html,
+	  website/doc_html/installation.html, website/doc_html/wiki.html:
+	  prepared some webpages
+
+2009-04-07 08:38  morlighe
+
+	* src/m/classes/public/plot/: applyoptions.m, parse_options.m,
+	  plot_basaldrag.m, plot_boundaries.m, plot_dealer.m,
+	  plot_drivingstress.m, plot_elementnumbering.m, plot_quivervel.m,
+	  plot_section.m, plot_tensor_components.m,
+	  plot_tensor_principal.m, plot_tensor_principalaxis.m,
+	  plot_transient_movie.m, plot_unit.m, plotmodel.m, processdata.m:
+	  Split plot_unit into plot_dealer and plot_unit to be used by
+	  other special plots. Example: plot_tensor_comp 300 lines -> 79
+	  lines
+
+2009-04-07 08:28  seroussi
+
+	* test/Validation/RoundIceSheet/: runme.m, Circ.par: to match
+	  current version of the code
+
+2009-04-06 15:04  seroussi
+
+	* src/m/solutions/ice/ModelProcessorPrognostic.m: added dirichlet
+	  values for prognostic
+
+2009-04-06 14:47  jschierm
+
+	* src/m/solutions/dakota/qmu.m: Commented-out MPI statement.
+
+2009-04-06 14:44  jschierm
+
+	* src/m/solutions/dakota/dakota_in_write.m: Add the rest of the
+	  Dakota methods.
+
+2009-04-06 14:40  jschierm
+
+	* src/m/solutions/dakota/: dakota_in_data.m, dakota_in_params.m,
+	  dakota_in_write.m, dakota_m_write.m: Implement dakota_method
+	  class and add parametric study methods.
+
+2009-04-06 11:55  jschierm
+
+	* src/m/solutions/dakota/dakota_in_write.m: Removed find_string.m
+	  to separate utility.
+
+2009-04-06 11:54  jschierm
+
+	* src/m/solutions/dakota/dakota_in_parse.m: Parse optimization
+	  responses from Dakota .in file.
+
+2009-04-06 11:52  jschierm
+
+	* src/m/solutions/dakota/dakota_in_write.m: Output response levels
+	  only for nondeterministic methods.
+
+2009-04-06 11:43  jschierm
+
+	* src/m/solutions/dakota/setupdesign/: QmuSetupDesign.m,
+	  setuprhowater.m, setupgravity.m, setupheatcapacity.m,
+	  setupthermalconductivity.m: Add
+	  rho_water,heat_capacity,thermal_conductivity,and gravity to
+	  setupdesign.
+
+2009-04-06 11:36  jschierm
+
+	* src/m/classes/@dakota_method/: dakota_method.m, display.m:
+	  Implement dakota_method class to externalize methods for Dakota.
+
+2009-04-06 11:23  jschierm
+
+	* src/m/utils/Array/any2str.m: Utility to convert anything to a
+	  string.
+
+2009-04-06 11:21  jschierm
+
+	* src/m/utils/Array/find_string.m: Utility to find a string in a
+	  cell array (from dakota_in_write.m).
+
+2009-04-06 11:20  jschierm
+
+	* src/m/utils/Array/: item2str.m, string_cell.m, string_vec.m: More
+	  (and revised) utilities for displaying arrays.
+
+2009-04-06 10:29  morlighe
+
+	* src/m/solutions/dakota/: cielo_ice_script.sh, dakota_in_data.m,
+	  dakota_in_params.m, dakota_in_parse.m, dakota_in_write.m,
+	  dakota_m_write.m, dakota_out_parse.m, plot_boxplot.m,
+	  plot_hist_norm.m, plot_if_bars.m, plot_normdist_bars.m,
+	  plot_normplot.m, plot_prob_bars.m, plot_rlev_bars.m,
+	  plot_sampdist_bars.m, qmu.m, qmuname.m,
+	  responsefunctions/MaxAbsVx.m, responsefunctions/MaxAbsVy.m,
+	  responsefunctions/MaxVel.m, responsefunctions/MaxVx.m,
+	  responsefunctions/MaxVy.m, responsefunctions/MinVel.m,
+	  responsefunctions/MinVx.m, responsefunctions/MinVy.m,
+	  responsefunctions/QmuResponseValue.m,
+	  setupdesign/QmuSetupDesign.m, setupdesign/setupdrag.m,
+	  setupdesign/setuprhoice.m, setupdesign/setupriftsfriction.m,
+	  setupdesign/setupthickness.m,
+	  updatefunctions/QmuUpdateFunctions.m,
+	  updatefunctions/updatedrag.m, updatefunctions/updategravity.m,
+	  updatefunctions/updateheatcapacity.m,
+	  updatefunctions/updaterho_ice.m,
+	  updatefunctions/updaterho_water.m,
+	  updatefunctions/updateriftsfriction.m,
+	  updatefunctions/updatethermalconductivity.m,
+	  updatefunctions/updatethickness.m: readded dakota
+
+2009-04-06 08:40  morlighe
+
+	* doc/website/: doc_c/doxygenissm.css, doc_c/doxygenissm.css.bak,
+	  doc_c/headerissm.html, doc_c/tabsissm.css, doc_html/style.css,
+	  doc_m/template_issm/m2html.css: improved geneal layout (doc_c)
+
+2009-04-03 17:40  seroussi
+
+	* src/m/classes/public/plot/plot_transient_movie.m: model neede in
+	  apply_options
+
+2009-04-03 17:38  morlighe
+
+	* doc/website/doc_m/template_issm/master.tpl: better master index
+
+2009-04-03 17:31  seroussi
+
+	* src/m/utils/Nightly/nightlyrun.m: minor
+
+2009-04-03 17:29  morlighe
+
+	* doc/website/doc_m/creatematlabhtmldoc.sh: Minor
+
+2009-04-03 17:20  morlighe
+
+	* doc/website/: Makefile, doc_c/createchtmldoc.sh,
+	  doc_c/doxygen.config, doc_c/doxygenissm.css,
+	  doc_c/doxygenissm.css.bak, doc_c/footerissm.html,
+	  doc_c/headerissm.html, doc_c/headerissm.png, doc_c/logo_JPL.png,
+	  doc_c/logo_NASA.png, doc_c/tabsissm.css,
+	  doc_html/documentation.html, doc_html/headerissm.png,
+	  doc_html/logo_JPL.png, doc_html/logo_NASA.png,
+	  doc_html/style.css, doc_m/creatematlabhtmldoc.sh,
+	  doc_m/template_issm/alpha.png, doc_m/template_issm/c++.png,
+	  doc_m/template_issm/c.png, doc_m/template_issm/demoicon.gif,
+	  doc_m/template_issm/down.png, doc_m/template_issm/fortran.png,
+	  doc_m/template_issm/graph.tpl,
+	  doc_m/template_issm/headerissm.png, doc_m/template_issm/hp.png,
+	  doc_m/template_issm/left.png, doc_m/template_issm/linux.png,
+	  doc_m/template_issm/logo_JPL.png,
+	  doc_m/template_issm/logo_NASA.png,
+	  doc_m/template_issm/m2html.css, doc_m/template_issm/master.tpl,
+	  doc_m/template_issm/matlabicon.gif, doc_m/template_issm/mdir.tpl,
+	  doc_m/template_issm/mex.png, doc_m/template_issm/mfile.tpl,
+	  doc_m/template_issm/right.png, doc_m/template_issm/sgi.png,
+	  doc_m/template_issm/simulinkicon.gif,
+	  doc_m/template_issm/solaris.png, doc_m/template_issm/todo.tpl,
+	  doc_m/template_issm/up.png, doc_m/template_issm/windows.png,
+	  doc_m/template_issm/template_issm2/alpha.png,
+	  doc_m/template_issm/template_issm2/c++.png,
+	  doc_m/template_issm/template_issm2/c.png,
+	  doc_m/template_issm/template_issm2/demoicon.gif,
+	  doc_m/template_issm/template_issm2/down.png,
+	  doc_m/template_issm/template_issm2/fortran.png,
+	  doc_m/template_issm/template_issm2/graph.tpl,
+	  doc_m/template_issm/template_issm2/headerissm.png,
+	  doc_m/template_issm/template_issm2/hp.png,
+	  doc_m/template_issm/template_issm2/left.png,
+	  doc_m/template_issm/template_issm2/linux.png,
+	  doc_m/template_issm/template_issm2/logo_JPL.png,
+	  doc_m/template_issm/template_issm2/logo_NASA.png,
+	  doc_m/template_issm/template_issm2/m2html.css,
+	  doc_m/template_issm/template_issm2/master.tpl,
+	  doc_m/template_issm/template_issm2/matlabicon.gif,
+	  doc_m/template_issm/template_issm2/mdir.tpl,
+	  doc_m/template_issm/template_issm2/mex.png,
+	  doc_m/template_issm/template_issm2/mfile.tpl,
+	  doc_m/template_issm/template_issm2/right.png,
+	  doc_m/template_issm/template_issm2/sgi.png,
+	  doc_m/template_issm/template_issm2/simulinkicon.gif,
+	  doc_m/template_issm/template_issm2/solaris.png,
+	  doc_m/template_issm/template_issm2/todo.tpl,
+	  doc_m/template_issm/template_issm2/up.png,
+	  doc_m/template_issm/template_issm2/windows.png: Added website
+
+2009-04-03 17:18  morlighe
+
+	* doc/developperguide.pdf: no more developerguide
+
+2009-04-03 17:10  morlighe
+
+	* scripts/: archive.sh, createlinks.sh, eraselinks.sh,
+	  quickinstall.sh: Added some files
+
+2009-04-03 17:08  morlighe
+
+	* doc/index.html: Better documentation setup
+
+2009-04-03 17:07  morlighe
+
+	* doc/MakefileIce: Missing doc target
+
+2009-04-03 17:05  morlighe
+
+	* cron/linux_cronfile: New locations for cron jobs
+
+2009-04-03 17:04  morlighe
+
+	* etc/cielo.rc: New cielo.rc settings.
+
+2009-04-03 17:04  morlighe
+
+	* packages/list: Useless
+
+2009-04-03 17:01  morlighe
+
+	* MakefileIce, bin/MakefileIce, bin/cvs_empty_file: Added bin clean
+	  target
+
+2009-04-03 16:59  morlighe
+
+	* src/mex/MeshPartition/MeshPartition.c: Switched to x code
+	  framework
+
+2009-04-03 16:56  morlighe
+
+	* src/c/MeshPartitionx/: MeshPartition.h, MeshPartitionx.c,
+	  MeshPartitionx.h: MeshPartitionx: completed the x framework.
+	  Some left over from Cielo.
+
+2009-04-03 16:54  morlighe
+
+	* src/c/: ArgusContourToMeshx/MakefileIce, HoleFillerx/MakefileIce,
+	  IceDataInterpx/MakefileIce, MeshPartitionx/MakefileIce,
+	  Visux/MakefileIce: Fixed Bug
+
+2009-04-03 16:51  morlighe
+
+	* ChangeLogIce: change log for Ice
+
+2009-04-03 16:49  morlighe
+
+	* src/mex/ArgusContourToMesh/ArgusContourToMesh.c: reorg
+
+2009-04-03 16:45  morlighe
+
+	* etc/environment.sh, etc/environment_variables,
+	  src/c/ArgusContourToMeshx/ArgusContourToMeshx.c,
+	  src/c/ArgusContourToMeshx/Contour.c,
+	  src/c/ArgusContourToMeshx/Contour.h: reorg
+
+2009-04-03 16:44  morlighe
+
+	* INSTALL, INSTALLICE: moved INSTALL to INSTALLICE
+
+2009-04-03 16:43  morlighe
+
+	* README, READMEICE: moved REDME to READMEICE
+
+2009-04-03 16:42  morlighe
+
+	* src/c/ArgusContourToMeshx/: ArgusContourToMesh.h,
+	  ArgusContourToMeshx.h: reorg
+
+2009-04-03 16:40  morlighe
+
+	* doc/Makefile, src/c/ArgusContourToMeshx/Makefile,
+	  src/c/HoleFillerx/Makefile, src/c/IceDataInterpx/Makefile,
+	  src/c/MeshPartitionx/Makefile, src/c/Visux/Makefile,
+	  src/c/shared/TriMesh/Makefile: not needed anymore, automatically
+	  generated by autoconf
+
+2009-04-03 16:36  morlighe
+
+	* examples/Bumps/Bump1_surface_bed/DomainOutline.exp,
+	  examples/Bumps/Bump1_surface_bed/Front.exp,
+	  examples/Bumps/Bump1_surface_bed/Square.par,
+	  examples/Bumps/Bump1_surface_bed/runme.m,
+	  examples/Bumps/Bump2_bed/DomainOutline.exp,
+	  examples/Bumps/Bump2_bed/Front.exp,
+	  examples/Bumps/Bump2_bed/Square.par,
+	  examples/Bumps/Bump2_bed/runme.m,
+	  examples/SquareIceShelf/DomainOutline.exp,
+	  examples/SquareIceShelf/Front.exp,
+	  examples/SquareIceShelf/README,
+	  examples/SquareIceShelf/Shelf.exp,
+	  examples/SquareIceShelf/Square.par,
+	  examples/SquareIceShelf/square.model,
+	  test/Validation/MacAyealVsPattyn/test1_iceshelf/DomainOutline.exp,
+	  test/Validation/MacAyealVsPattyn/test1_iceshelf/Front.exp,
+	  test/Validation/MacAyealVsPattyn/test1_iceshelf/Pattyn.exp,
+	  test/Validation/MacAyealVsPattyn/test1_iceshelf/Shelf.exp,
+	  test/Validation/MacAyealVsPattyn/test1_iceshelf/Square.par,
+	  test/Validation/MacAyealVsPattyn/test1_iceshelf/runme.m,
+	  test/Validation/MacAyealVsPattyn/test2_icesheet/DomainOutline.exp,
+	  test/Validation/MacAyealVsPattyn/test2_icesheet/Front.exp,
+	  test/Validation/MacAyealVsPattyn/test2_icesheet/Pattyn.exp,
+	  test/Validation/MacAyealVsPattyn/test2_icesheet/Square.par,
+	  test/Validation/MacAyealVsPattyn/test2_icesheet/runme.m,
+	  test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/DomainOutline.exp,
+	  test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Front.exp,
+	  test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Pattyn.exp,
+	  test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Shelf.exp,
+	  test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Square.par,
+	  test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/runme.m,
+	  test/Validation/PattynStokes/test1_iceshelf/DomainOutline.exp,
+	  test/Validation/PattynStokes/test1_iceshelf/Front.exp,
+	  test/Validation/PattynStokes/test1_iceshelf/Shelf.exp,
+	  test/Validation/PattynStokes/test1_iceshelf/Square.par,
+	  test/Validation/PattynStokes/test1_iceshelf/runme.m,
+	  test/Validation/PattynStokes/test2_icesheet/DomainOutline.exp,
+	  test/Validation/PattynStokes/test2_icesheet/Front.exp,
+	  test/Validation/PattynStokes/test2_icesheet/Square.par,
+	  test/Validation/PattynStokes/test2_icesheet/runme.m,
+	  test/Validation/PattynStokes/test3_icesheet_iceshelf/DomainOutline.exp,
+	  test/Validation/PattynStokes/test3_icesheet_iceshelf/Front.exp,
+	  test/Validation/PattynStokes/test3_icesheet_iceshelf/Shelf.exp,
+	  test/Validation/PattynStokes/test3_icesheet_iceshelf/Square.par,
+	  test/Validation/PattynStokes/test3_icesheet_iceshelf/runme.m,
+	  test/Validation/RoundIceSheet/Circ.par,
+	  test/Validation/RoundIceSheet/CreateDomainOutline.m,
+	  test/Validation/RoundIceSheet/README,
+	  test/Validation/RoundIceSheet/runme.m,
+	  test/Validation/ThermalTests/Melting/DomainOutline.exp,
+	  test/Validation/ThermalTests/Melting/Front.exp,
+	  test/Validation/ThermalTests/Melting/Square.par,
+	  test/Validation/ThermalTests/Melting/runme.m,
+	  test/Validation/ThermalTests/Melting/thermalboundarycondition.m,
+	  test/Validation/ThermalTests/Simpleadvection/DomainOutline.exp,
+	  test/Validation/ThermalTests/Simpleadvection/Front.exp,
+	  test/Validation/ThermalTests/Simpleadvection/Square.par,
+	  test/Validation/ThermalTests/Simpleadvection/runme.m,
+	  test/Validation/ThermalTests/Simpleadvection/thermalboundarycondition.m,
+	  test/Validation/ThermalTests/Simpleconduction/DomainOutline.exp,
+	  test/Validation/ThermalTests/Simpleconduction/Front.exp,
+	  test/Validation/ThermalTests/Simpleconduction/Shelf.exp,
+	  test/Validation/ThermalTests/Simpleconduction/Square.par,
+	  test/Validation/ThermalTests/Simpleconduction/runme.m,
+	  test/Validation/ThermalTests/Simpleconduction/thermalboundarycondition.m,
+	  test/Validation/ThermalTests/Simplegeothermalflux/DomainOutline.exp,
+	  test/Validation/ThermalTests/Simplegeothermalflux/Front.exp,
+	  test/Validation/ThermalTests/Simplegeothermalflux/Square.par,
+	  test/Validation/ThermalTests/Simplegeothermalflux/runme.m,
+	  test/Validation/ThermalTests/Simplegeothermalflux/thermalboundarycondition.m,
+	  test/Verification/test10_iceshelf_icefront_stokes/DomainOutline.exp,
+	  test/Verification/test10_iceshelf_icefront_stokes/Front.exp,
+	  test/Verification/test10_iceshelf_icefront_stokes/Square.par,
+	  test/Verification/test10_iceshelf_icefront_stokes/archive_melting.mat,
+	  test/Verification/test10_iceshelf_icefront_stokes/archive_stokes.mat,
+	  test/Verification/test10_iceshelf_icefront_stokes/archive_temperature.mat,
+	  test/Verification/test10_iceshelf_icefront_stokes/runme.m,
+	  test/Verification/test10_iceshelf_icefront_stokes/updatearchive.m,
+	  test/Verification/test11_penalties_iceshelf_allmodels/DomainOutline.exp,
+	  test/Verification/test11_penalties_iceshelf_allmodels/Front.exp,
+	  test/Verification/test11_penalties_iceshelf_allmodels/Pattyn.exp,
+	  test/Verification/test11_penalties_iceshelf_allmodels/Square.par,
+	  test/Verification/test11_penalties_iceshelf_allmodels/Stokes.exp,
+	  test/Verification/test11_penalties_iceshelf_allmodels/archive_melting.mat,
+	  test/Verification/test11_penalties_iceshelf_allmodels/archive_temperature.mat,
+	  test/Verification/test11_penalties_iceshelf_allmodels/archive_velocity.mat,
+	  test/Verification/test11_penalties_iceshelf_allmodels/runme.m,
+	  test/Verification/test11_penalties_iceshelf_allmodels/updatearchive.m,
+	  test/Verification/test1_icesheet_noicefront/DomainOutline.exp,
+	  test/Verification/test1_icesheet_noicefront/Front.exp,
+	  test/Verification/test1_icesheet_noicefront/Square.par,
+	  test/Verification/test1_icesheet_noicefront/archive_acc.mat,
+	  test/Verification/test1_icesheet_noicefront/archive_hutter.mat,
+	  test/Verification/test1_icesheet_noicefront/archive_ice.mat,
+	  test/Verification/test1_icesheet_noicefront/archive_macayeal.mat,
+	  test/Verification/test1_icesheet_noicefront/runme.m,
+	  test/Verification/test1_icesheet_noicefront/updatearchive.m,
+	  test/Verification/test2_icesheet_icefront/DomainOutline.exp,
+	  test/Verification/test2_icesheet_icefront/Front.exp,
+	  test/Verification/test2_icesheet_icefront/Hutter.exp,
+	  test/Verification/test2_icesheet_icefront/Square.par,
+	  test/Verification/test2_icesheet_icefront/archive_acc.mat,
+	  test/Verification/test2_icesheet_icefront/archive_hutter.mat,
+	  test/Verification/test2_icesheet_icefront/archive_ice.mat,
+	  test/Verification/test2_icesheet_icefront/archive_macayeal.mat,
+	  test/Verification/test2_icesheet_icefront/archive_thickness.mat,
+	  test/Verification/test2_icesheet_icefront/runme.m,
+	  test/Verification/test2_icesheet_icefront/updatearchive.m,
+	  test/Verification/test3_iceshelf_icefront/DomainOutline.exp,
+	  test/Verification/test3_iceshelf_icefront/Front.exp,
+	  test/Verification/test3_iceshelf_icefront/Square.par,
+	  test/Verification/test3_iceshelf_icefront/archive_acc.mat,
+	  test/Verification/test3_iceshelf_icefront/archive_ice.mat,
+	  test/Verification/test3_iceshelf_icefront/archive_macayeal.mat,
+	  test/Verification/test3_iceshelf_icefront/archive_thickness.mat,
+	  test/Verification/test3_iceshelf_icefront/runme.m,
+	  test/Verification/test3_iceshelf_icefront/updatearchive.m,
+	  test/Verification/test4_icesheet_noicefront_3d/DomainOutline.exp,
+	  test/Verification/test4_icesheet_noicefront_3d/Front.exp,
+	  test/Verification/test4_icesheet_noicefront_3d/Square.par,
+	  test/Verification/test4_icesheet_noicefront_3d/archive_hutter.mat,
+	  test/Verification/test4_icesheet_noicefront_3d/archive_melting.mat,
+	  test/Verification/test4_icesheet_noicefront_3d/archive_pattyn.mat,
+	  test/Verification/test4_icesheet_noicefront_3d/archive_temperature.mat,
+	  test/Verification/test4_icesheet_noicefront_3d/runme.m,
+	  test/Verification/test4_icesheet_noicefront_3d/updatearchive.m,
+	  test/Verification/test5_icesheet_icefront_3d/DomainOutline.exp,
+	  test/Verification/test5_icesheet_icefront_3d/Front.exp,
+	  test/Verification/test5_icesheet_icefront_3d/Square.par,
+	  test/Verification/test5_icesheet_icefront_3d/archive_melting.mat,
+	  test/Verification/test5_icesheet_icefront_3d/archive_melting_transient.mat,
+	  test/Verification/test5_icesheet_icefront_3d/archive_pattyn.mat,
+	  test/Verification/test5_icesheet_icefront_3d/archive_temperature.mat,
+	  test/Verification/test5_icesheet_icefront_3d/archive_temperature_transient.mat,
+	  test/Verification/test5_icesheet_icefront_3d/archive_thickness.mat,
+	  test/Verification/test5_icesheet_icefront_3d/runme.m,
+	  test/Verification/test5_icesheet_icefront_3d/updatearchive.m,
+	  test/Verification/test6_iceshelf_icefront_3d/DomainOutline.exp,
+	  test/Verification/test6_iceshelf_icefront_3d/Front.exp,
+	  test/Verification/test6_iceshelf_icefront_3d/Square.par,
+	  test/Verification/test6_iceshelf_icefront_3d/archive_melting.mat,
+	  test/Verification/test6_iceshelf_icefront_3d/archive_melting_transient.mat,
+	  test/Verification/test6_iceshelf_icefront_3d/archive_pattyn.mat,
+	  test/Verification/test6_iceshelf_icefront_3d/archive_temperature.mat,
+	  test/Verification/test6_iceshelf_icefront_3d/archive_temperature_transient.mat,
+	  test/Verification/test6_iceshelf_icefront_3d/archive_thickness.mat,
+	  test/Verification/test6_iceshelf_icefront_3d/runme.m,
+	  test/Verification/test6_iceshelf_icefront_3d/updatearchive.m,
+	  test/Verification/test7_penalties_iceshelf_3d/DomainOutline.exp,
+	  test/Verification/test7_penalties_iceshelf_3d/Front.exp,
+	  test/Verification/test7_penalties_iceshelf_3d/Pattyn.exp,
+	  test/Verification/test7_penalties_iceshelf_3d/Square.par,
+	  test/Verification/test7_penalties_iceshelf_3d/archive_melting.mat,
+	  test/Verification/test7_penalties_iceshelf_3d/archive_temperature.mat,
+	  test/Verification/test7_penalties_iceshelf_3d/archive_velocity.mat,
+	  test/Verification/test7_penalties_iceshelf_3d/iceshelf.exp,
+	  test/Verification/test7_penalties_iceshelf_3d/runme.m,
+	  test/Verification/test7_penalties_iceshelf_3d/updatearchive.m,
+	  test/Verification/test8_icesheet_noicefront_stokes/DomainOutline.exp,
+	  test/Verification/test8_icesheet_noicefront_stokes/Front.exp,
+	  test/Verification/test8_icesheet_noicefront_stokes/Square.par,
+	  test/Verification/test8_icesheet_noicefront_stokes/archive_melting.mat,
+	  test/Verification/test8_icesheet_noicefront_stokes/archive_stokes.mat,
+	  test/Verification/test8_icesheet_noicefront_stokes/archive_temperature.mat,
+	  test/Verification/test8_icesheet_noicefront_stokes/runme.m,
+	  test/Verification/test8_icesheet_noicefront_stokes/updatearchive.m,
+	  test/Verification/test9_icesheet_icefront_stokes/DomainOutline.exp,
+	  test/Verification/test9_icesheet_icefront_stokes/Front.exp,
+	  test/Verification/test9_icesheet_icefront_stokes/Square.par,
+	  test/Verification/test9_icesheet_icefront_stokes/archive_melting.mat,
+	  test/Verification/test9_icesheet_icefront_stokes/archive_stokes.mat,
+	  test/Verification/test9_icesheet_icefront_stokes/archive_temperature.mat,
+	  test/Verification/test9_icesheet_icefront_stokes/runme.m,
+	  test/Verification/test9_icesheet_icefront_stokes/updatearchive.m,
+	  test/Verification/test_cielo/DomainOutline.exp,
+	  test/Verification/test_cielo/DomainOutlineRifts.exp,
+	  test/Verification/test_cielo/Front.exp,
+	  test/Verification/test_cielo/IceShelf.exp,
+	  test/Verification/test_cielo/Pattyn.exp,
+	  test/Verification/test_cielo/Rifts.exp,
+	  test/Verification/test_cielo/Square.par,
+	  test/Verification/test_cielo/control.mat,
+	  test/Verification/test_cielo/diagnostic_horiz_macayeal.mat,
+	  test/Verification/test_cielo/diagnostic_horiz_mixed.mat,
+	  test/Verification/test_cielo/diagnostic_horiz_pattyn.mat,
+	  test/Verification/test_cielo/diagnostic_horiz_rifts.mat,
+	  test/Verification/test_cielo/runme.m,
+	  test/Verification/test_cielo/thermalsteady.mat: Moved tests to
+	  test and examples
+
+2009-04-03 16:27  morlighe
+
+	* packages/: Makefile, README, list, dakota/Dakota_4_2.src.tar.gz,
+	  dakota/install.sh, doxygen/doxygen-1.5.8.src.tar.gz,
+	  doxygen/install.sh, gdal/GDALmake.opt.patch,
+	  gdal/gdal-1.6.0.tar.gz, gdal/install.sh, m2html/install.sh,
+	  m2html/m2html.m.patch, m2html/m2html.zip,
+	  metis/Makefile.in.patch, metis/install.sh,
+	  metis/metis-4.0.tar.gz, mpich2/Examples.Makefile.patch,
+	  mpich2/install.sh, mpich2/mpich2-1.0.2p1.tar.gz, mtoc/install.sh,
+	  mtoc/mtoc.tgz, petsc/install.sh, petsc/petsc-2.3.2-p3.tar.gz,
+	  qhull/install.sh, qhull/qhull-2003.1.tar.gz, slepc/install.sh,
+	  slepc/slepc-2.3.2.tgz, sowing/install.sh, sowing/sowing.tar.gz,
+	  suitesparse/SuiteSparse-3.2.0.tar.gz,
+	  suitesparse/SuiteSparse_install.patch, suitesparse/install.sh,
+	  triangle/install.sh, triangle/makefile,
+	  triangle/triangle.c.patch, triangle/triangle.zip: moved libs to
+	  packages
+
+2009-04-03 16:21  morlighe
+
+	* contributors.txt: blabla
+
+2009-04-03 16:10  morlighe
+
+	* src/m/classes/: @pentaelem/CreateKMatrix.mexa64,
+	  @pentaelem/CreatePVector.mexa64, @triaelem/CreateKMatrix.mexa64:
+	  Not needed
+
+2009-04-03 16:08  morlighe
+
+	* bin/cvs_empty_file: empty file needed
+
+2009-04-03 16:05  morlighe
+
+	* cron/nightlyrun.sh, doc/issmdoc.m, etc/Make_default_rules.mk,
+	  etc/config_linux64.mk, startup.m, bin/startup.m: reorg
+
+2009-04-03 16:01  morlighe
+
+	* Makefile.issm: gone
+
+2009-04-03 16:00  morlighe
+
+	* src/m/shared/: GaussPenta.m, GaussQuad.m, GaussSegment.m,
+	  GaussTetra.m, GaussTria.m, Getalpha2.m, Solver.m, hutterenum.m,
+	  macayealenum.m, noneenum.m, pattynenum.m, recover_input.m,
+	  stokesenum.m: reorg
+
+2009-04-03 15:55  morlighe
+
+	* src/m/: classes/@acceleratedtriaelem/CreateKMatrix.m,
+	  classes/@acceleratedtriaelem/CreatePVector.m,
+	  classes/@acceleratedtriaelem/acceleratedtriaelem.m,
+	  classes/@acceleratedtriaelem/display.m,
+	  classes/@acceleratedtriaelem/subsasgn.m,
+	  classes/@acceleratedtriaelem/subsref.m,
+	  classes/@beamelem/CreateKMatrix.m,
+	  classes/@beamelem/CreatePVector.m,
+	  classes/@beamelem/GetJacobian.m,
+	  classes/@beamelem/GetJacobianDeterminant.m,
+	  classes/@beamelem/GetJacobianInvert.m,
+	  classes/@beamelem/GetNodalFunctions.m,
+	  classes/@beamelem/GetNodalFunctionsDerivativesBasic.m,
+	  classes/@beamelem/GetNodalFunctionsDerivativesParams.m,
+	  classes/@beamelem/GetParameterValue.m,
+	  classes/@beamelem/beamelem.m, classes/@beamelem/display.m,
+	  classes/@beamelem/getgriddata.m, classes/@beamelem/subsasgn.m,
+	  classes/@beamelem/subsref.m,
+	  classes/@continuous_design/continuous_design.m,
+	  classes/@continuous_design/display.m,
+	  classes/@continuous_state/continuous_state.m,
+	  classes/@continuous_state/display.m,
+	  classes/@elemmatrix/AddElemMatrix.m,
+	  classes/@elemmatrix/display.m, classes/@elemmatrix/elemmatrix.m,
+	  classes/@elemmatrix/subsasgn.m, classes/@elemmatrix/subsref.m,
+	  classes/@elemvector/AddElemVector.m,
+	  classes/@elemvector/display.m, classes/@elemvector/elemvector.m,
+	  classes/@elemvector/subsasgn.m, classes/@elemvector/subsref.m,
+	  classes/@globalmatrix/AddElemMatrix.m,
+	  classes/@globalmatrix/display.m,
+	  classes/@globalmatrix/globalmatrix.m,
+	  classes/@globalmatrix/subsasgn.m,
+	  classes/@globalmatrix/subsref.m,
+	  classes/@globalvector/AddElemVector.m,
+	  classes/@globalvector/display.m,
+	  classes/@globalvector/globalvector.m,
+	  classes/@globalvector/subsasgn.m,
+	  classes/@globalvector/subsref.m,
+	  classes/@icefront/CreatePVector.m,
+	  classes/@icefront/PenaltyConstrain.m,
+	  classes/@icefront/PenaltyCreateKMatrix.m,
+	  classes/@icefront/PenaltyCreatePVector.m,
+	  classes/@icefront/display.m, classes/@icefront/icefront.m,
+	  classes/@icefront/subsasgn.m, classes/@icefront/subsref.m,
+	  classes/@least_squares_term/display.m,
+	  classes/@least_squares_term/least_squares_term.m,
+	  classes/@matice/GetViscosity2.m,
+	  classes/@matice/GetViscosity2d.m,
+	  classes/@matice/GetViscosity3d.m, classes/@matice/display.m,
+	  classes/@matice/matice.m, classes/@matice/subsasgn.m,
+	  classes/@matice/subsref.m, classes/@matpar/display.m,
+	  classes/@matpar/matpar.m, classes/@matpar/subsasgn.m,
+	  classes/@matpar/subsref.m, classes/@model/activaterepository.m,
+	  classes/@model/deletemodel.m, classes/@model/display.m,
+	  classes/@model/fieldcount.m, classes/@model/get.m,
+	  classes/@model/model.m, classes/@model/set.m,
+	  classes/@model/structtomodel.m, classes/@model/subsasgn.m,
+	  classes/@model/subsref.m, classes/@node/display.m,
+	  classes/@node/node.m, classes/@node/subsasgn.m,
+	  classes/@node/subsref.m,
+	  classes/@nonlinear_equality_constraint/display.m,
+	  classes/@nonlinear_equality_constraint/nonlinear_equality_constraint.m,
+	  classes/@nonlinear_inequality_constraint/display.m,
+	  classes/@nonlinear_inequality_constraint/nonlinear_inequality_constraint.m,
+	  classes/@normal_uncertain/display.m,
+	  classes/@normal_uncertain/normal_uncertain.m,
+	  classes/@objective_function/display.m,
+	  classes/@objective_function/objective_function.m,
+	  classes/@pengrid/CreatePVector.m,
+	  classes/@pengrid/PenaltyConstrain.m,
+	  classes/@pengrid/PenaltyCreateKMatrix.m,
+	  classes/@pengrid/PenaltyCreatePVector.m,
+	  classes/@pengrid/display.m, classes/@pengrid/pengrid.m,
+	  classes/@pengrid/subsasgn.m, classes/@pengrid/subsref.m,
+	  classes/@penpair/CreatePVector.m,
+	  classes/@penpair/PenaltyConstrain.m,
+	  classes/@penpair/PenaltyCreateKMatrix.m,
+	  classes/@penpair/PenaltyCreatePVector.m,
+	  classes/@penpair/display.m, classes/@penpair/penpair.m,
+	  classes/@penpair/subsasgn.m, classes/@penpair/subsref.m,
+	  classes/@pentaelem/CreateKMatrix.m,
+	  classes/@pentaelem/CreateKMatrix.mexa64,
+	  classes/@pentaelem/CreatePVector.m,
+	  classes/@pentaelem/CreatePVector.mexa64,
+	  classes/@pentaelem/DeviatoricStress.m,
+	  classes/@pentaelem/GetBStokes.m, classes/@pentaelem/GetB_advec.m,
+	  classes/@pentaelem/GetB_conduct.m,
+	  classes/@pentaelem/GetB_horiz.m, classes/@pentaelem/GetB_vert.m,
+	  classes/@pentaelem/GetBprimeStokes.m,
+	  classes/@pentaelem/GetBprime_advec.m,
+	  classes/@pentaelem/GetBprime_horiz.m,
+	  classes/@pentaelem/GetBprime_vert.m,
+	  classes/@pentaelem/GetJacobian.m,
+	  classes/@pentaelem/GetJacobianDeterminant.m,
+	  classes/@pentaelem/GetJacobianInvert.m,
+	  classes/@pentaelem/GetNodalFunctions.m,
+	  classes/@pentaelem/GetNodalFunctionsBubbleStokes.m,
+	  classes/@pentaelem/GetNodalFunctionsDerivativesBasic.m,
+	  classes/@pentaelem/GetNodalFunctionsDerivativesBasicStokes.m,
+	  classes/@pentaelem/GetNodalFunctionsDerivativesParams.m,
+	  classes/@pentaelem/GetNodalFunctionsDerivativesParamsStokes.m,
+	  classes/@pentaelem/GetNodalFunctionsStokes.m,
+	  classes/@pentaelem/GetParameterDerivativeValue.m,
+	  classes/@pentaelem/GetParameterValue.m,
+	  classes/@pentaelem/GetParameterValueStokes.m,
+	  classes/@pentaelem/GetStrainRate.m,
+	  classes/@pentaelem/GetStrainRateStokes.m,
+	  classes/@pentaelem/PentaCollapseIntoTriaMatrix.m,
+	  classes/@pentaelem/PentaCollapseIntoTriaVector.m,
+	  classes/@pentaelem/ReduceMatrixStokes.m,
+	  classes/@pentaelem/ReduceVectorStokes.m,
+	  classes/@pentaelem/StrainRate.m, classes/@pentaelem/Stress.m,
+	  classes/@pentaelem/StressBed.m,
+	  classes/@pentaelem/StressSurface.m,
+	  classes/@pentaelem/ViscousHeating.m,
+	  classes/@pentaelem/display.m, classes/@pentaelem/getgriddata.m,
+	  classes/@pentaelem/pentaelem.m, classes/@pentaelem/subsasgn.m,
+	  classes/@pentaelem/subsref.m,
+	  classes/@response_function/display.m,
+	  classes/@response_function/response_function.m,
+	  classes/@rgb/display.m, classes/@rgb/rgb.m,
+	  classes/@rgb/subsasgn.m, classes/@rgb/subsref.m,
+	  classes/@singelem/CreateKMatrix.m,
+	  classes/@singelem/CreatePVector.m, classes/@singelem/display.m,
+	  classes/@singelem/singelem.m, classes/@singelem/subsasgn.m,
+	  classes/@singelem/subsref.m, classes/@spc/display.m,
+	  classes/@spc/spc.m, classes/@spc/subsasgn.m,
+	  classes/@spc/subsref.m, classes/@tetraelem/GetJacobian.m,
+	  classes/@tetraelem/GetJacobianDeterminant.m,
+	  classes/@triaelem/CreateKMatrix.m,
+	  classes/@triaelem/CreateKMatrix.mexa64,
+	  classes/@triaelem/CreatePVector.m,
+	  classes/@triaelem/DeviatoricStress.m, classes/@triaelem/GetB.m,
+	  classes/@triaelem/GetB_prog.m, classes/@triaelem/GetBprime.m,
+	  classes/@triaelem/GetBprime_prog.m,
+	  classes/@triaelem/GetJacobian.m,
+	  classes/@triaelem/GetJacobianDeterminant.m,
+	  classes/@triaelem/GetJacobianInvert.m, classes/@triaelem/GetL.m,
+	  classes/@triaelem/GetLStokes.m,
+	  classes/@triaelem/GetLprimeStokes.m,
+	  classes/@triaelem/GetNodalFunctions.m,
+	  classes/@triaelem/GetNodalFunctionsDerivativesBasic.m,
+	  classes/@triaelem/GetNodalFunctionsDerivativesParams.m,
+	  classes/@triaelem/GetParameterDerivativeValue.m,
+	  classes/@triaelem/GetParameterValue.m,
+	  classes/@triaelem/GetStrainRate.m,
+	  classes/@triaelem/StrainRate.m, classes/@triaelem/Stress.m,
+	  classes/@triaelem/ViscousHeating.m, classes/@triaelem/display.m,
+	  classes/@triaelem/getgriddata.m, classes/@triaelem/subsasgn.m,
+	  classes/@triaelem/subsref.m, classes/@triaelem/triaelem.m,
+	  classes/public/BuildQueueingScript.m,
+	  classes/public/BuildQueueingScriptGeneric.m,
+	  classes/public/BuildQueueingScriptcosmos.m,
+	  classes/public/BuildQueueingScriptgemini.m,
+	  classes/public/DepthAverage.m, classes/public/LaunchQueueJob.m,
+	  classes/public/LaunchQueueJobGeneric.m,
+	  classes/public/LaunchQueueJobcosmos.m,
+	  classes/public/LaunchQueueJobgemini.m,
+	  classes/public/QueueJobPeek.m,
+	  classes/public/QueueJobPeekGeneric.m, classes/public/README,
+	  classes/public/ReadData.m, classes/public/SectionValues.m,
+	  classes/public/ThicknessCorrection.m, classes/public/WriteData.m,
+	  classes/public/addnote.m, classes/public/area.m,
+	  classes/public/averageconnectivity.m, classes/public/averaging.m,
+	  classes/public/balvel.m, classes/public/basalstress.m,
+	  classes/public/basevert.m, classes/public/buildoverlay.m,
+	  classes/public/buildoverlaycolorbar.m, classes/public/collapse.m,
+	  classes/public/deepcopy.m, classes/public/displaybc.m,
+	  classes/public/displaycontrol.m, classes/public/displayexppar.m,
+	  classes/public/displaymaterials.m, classes/public/displaymesh.m,
+	  classes/public/displayobservations.m,
+	  classes/public/displayparallel.m,
+	  classes/public/displayparameters.m, classes/public/displayqmu.m,
+	  classes/public/displayresults.m,
+	  classes/public/displaysolutionparameters.m,
+	  classes/public/domaintomesh.m, classes/public/drivingstress.m,
+	  classes/public/export.m, classes/public/extrude.m,
+	  classes/public/fieldcount.m, classes/public/geography.m,
+	  classes/public/ismodelselfconsistent.m,
+	  classes/public/isresultconsistent.m,
+	  classes/public/loadresultsfromcluster.m,
+	  classes/public/loadresultsfromdisk.m, classes/public/marshall.m,
+	  classes/public/mesh.m, classes/public/mesh2.m,
+	  classes/public/meshadaptation.m, classes/public/meshexprefine.m,
+	  classes/public/meshprocessrifts.m, classes/public/meshrefine.m,
+	  classes/public/model2ocmodel.m, classes/public/modelextract.m,
+	  classes/public/modelzoom.m, classes/public/parameterize.m,
+	  classes/public/parseresultsfromdisk.m, classes/public/peek.m,
+	  classes/public/plug.m, classes/public/preparerun.m,
+	  classes/public/printmodel.m, classes/public/project2d.m,
+	  classes/public/project3d.m, classes/public/radarpower.m,
+	  classes/public/recover_areas.m, classes/public/removeholes.m,
+	  classes/public/rifttipsrefine.m,
+	  classes/public/setelementstype.m, classes/public/shear2d.m,
+	  classes/public/shearnorm2d.m, classes/public/slope.m,
+	  classes/public/solve.m, classes/public/solveparallel.m,
+	  classes/public/solversettoasm.m,
+	  classes/public/solversettomumps.m,
+	  classes/public/solversettosor.m, classes/public/structtomodel.m,
+	  classes/public/thicknessevolution.m, classes/public/todo,
+	  classes/public/waitonlock.m, classes/public/plot/applyoptions.m,
+	  classes/public/plot/imagescnan.m,
+	  classes/public/plot/latlonoverlay.m,
+	  classes/public/plot/northarrow.m,
+	  classes/public/plot/parse_options.m,
+	  classes/public/plot/plot_basaldrag.m,
+	  classes/public/plot/plot_boundaries.m,
+	  classes/public/plot/plot_contour.m,
+	  classes/public/plot/plot_drivingstress.m,
+	  classes/public/plot/plot_elementnumbering.m,
+	  classes/public/plot/plot_elementstype.m,
+	  classes/public/plot/plot_gridnumbering.m,
+	  classes/public/plot/plot_highlightelements.m,
+	  classes/public/plot/plot_highlightgrids.m,
+	  classes/public/plot/plot_importancefactors.m,
+	  classes/public/plot/plot_mesh.m,
+	  classes/public/plot/plot_overlay.m,
+	  classes/public/plot/plot_penalties.m,
+	  classes/public/plot/plot_quiver.m,
+	  classes/public/plot/plot_quiver3.m,
+	  classes/public/plot/plot_quivervel.m,
+	  classes/public/plot/plot_riftpenetration.m,
+	  classes/public/plot/plot_riftrelvel.m,
+	  classes/public/plot/plot_riftvel.m,
+	  classes/public/plot/plot_sarpwr.m,
+	  classes/public/plot/plot_section.m,
+	  classes/public/plot/plot_segmentnumbering.m,
+	  classes/public/plot/plot_segmentonneumann.m,
+	  classes/public/plot/plot_tensor.m,
+	  classes/public/plot/plot_tensor_components.m,
+	  classes/public/plot/plot_tensor_principal.m,
+	  classes/public/plot/plot_tensor_principalaxis.m,
+	  classes/public/plot/plot_thermaltransient_results.m,
+	  classes/public/plot/plot_transient_movie.m,
+	  classes/public/plot/plot_transient_results.m,
+	  classes/public/plot/plot_unit.m,
+	  classes/public/plot/plotanalyse.m, classes/public/plot/plotdoc.m,
+	  classes/public/plot/plotmodel.m,
+	  classes/public/plot/processdata.m,
+	  classes/public/plot/processmesh.m,
+	  classes/public/plot/recover_plot_options.m,
+	  classes/public/plot/scaleruler.m, classes/public/plot/undoplot.m,
+	  solutions/ice/BuildGridSets.m, solutions/ice/CreateFemModel.m,
+	  solutions/ice/DeviatoricStressCompute.m,
+	  solutions/ice/DiagnosticSolutionType.m, solutions/ice/Dof.m,
+	  solutions/ice/GetNumberOfActiveElements.m,
+	  solutions/ice/HorizontalVelocityDepthAverage.m,
+	  solutions/ice/IceNormalizeconstraints.m,
+	  solutions/ice/IcePenaltyConstraints.m,
+	  solutions/ice/IceReducematrix.m,
+	  solutions/ice/IceReducematrixfromgtof.m,
+	  solutions/ice/IceReducerightside.m, solutions/ice/Loadresults.m,
+	  solutions/ice/Mergesolution_g.m, solutions/ice/ModelProcessor.m,
+	  solutions/ice/ModelProcessorDiagnosticBaseVert.m,
+	  solutions/ice/ModelProcessorDiagnosticHoriz.m,
+	  solutions/ice/ModelProcessorDiagnosticHutter.m,
+	  solutions/ice/ModelProcessorDiagnosticStokes.m,
+	  solutions/ice/ModelProcessorDiagnosticVert.m,
+	  solutions/ice/ModelProcessorMelting.m,
+	  solutions/ice/ModelProcessorPrognostic.m,
+	  solutions/ice/ModelProcessorSlopeCompute.m,
+	  solutions/ice/ModelProcessorThermal.m, solutions/ice/MpcGrids.m,
+	  solutions/ice/PartitioningVector.m,
+	  solutions/ice/PenaltySystemMatrices.m,
+	  solutions/ice/PressureElemCompute.m,
+	  solutions/ice/Reducevector_g.m,
+	  solutions/ice/SetStructureField.m, solutions/ice/SetupParams.m,
+	  solutions/ice/ShiftLayers.m, solutions/ice/SpcGrids.m,
+	  solutions/ice/StrainRateCompute.m,
+	  solutions/ice/StressBedCompute.m, solutions/ice/StressCompute.m,
+	  solutions/ice/StressSurfaceCompute.m,
+	  solutions/ice/SystemMatrices.m, solutions/ice/TimeStepping.m,
+	  solutions/ice/UpdateGeometry.m,
+	  solutions/ice/UpdateGridPosition.m, solutions/ice/UpdateMesh.m,
+	  solutions/ice/VelocityExtrude.m,
+	  solutions/ice/ViscousHeatingCompute.m, solutions/ice/debug.m,
+	  solutions/ice/debug2.m, solutions/ice/getdofcount.m,
+	  solutions/ice/huttercompute.m, solutions/ice/icediagnostic.m,
+	  solutions/ice/icediagnostic2d.m, solutions/ice/icediagnostic3d.m,
+	  solutions/ice/icediagnostic_core_linear.m,
+	  solutions/ice/icediagnostic_core_nonlinear.m,
+	  solutions/ice/icediagnostic_wrapper.m, solutions/ice/iceglobal.m,
+	  solutions/ice/icemelting_core.m, solutions/ice/iceparameters.m,
+	  solutions/ice/iceparameters_wrapper.m,
+	  solutions/ice/iceprognostic.m,
+	  solutions/ice/iceprognostic_core.m,
+	  solutions/ice/iceprognostic_wrapper.m,
+	  solutions/ice/icethermal.m, solutions/ice/icethermal_core.m,
+	  solutions/ice/icethermal_wrapper.m, solutions/ice/icetransient.m,
+	  solutions/ice/icetransient2d.m, solutions/ice/icetransient3d.m,
+	  solutions/ice/icetransient_wrapper.m,
+	  solutions/ice/slopecompute.m, solutions/macayeal/bar_maker.m,
+	  solutions/macayeal/buildicefrontnormal.m,
+	  solutions/macayeal/c_velfinder.m,
+	  solutions/macayeal/create_el2nod_matrices.m,
+	  solutions/macayeal/flowlaw.m, solutions/macayeal/grad_J_flow.m,
+	  solutions/macayeal/macayealcontrol.m,
+	  solutions/macayeal/macayealdiagnostic.m,
+	  solutions/macayeal/objectivefunction_C_flow.m,
+	  solutions/macayeal/setup_control.m, solutions/macayeal/shape.m,
+	  solutions/macayeal/shear.m, solutions/macayeal/stress.m,
+	  solutions/macayeal/visc_grad.m, solutions/macayeal/viscosity.m,
+	  utils/genpath_ice.m, utils/Antarctica/README,
+	  utils/Antarctica/antcreatewrappedmap.m,
+	  utils/Antarctica/antimread.m,
+	  utils/Antarctica/antlatlonoverlay.m, utils/Antarctica/antmovie.m,
+	  utils/Antarctica/antoutline.m, utils/Antarctica/antoverlay.m,
+	  utils/Antarctica/antoverlay2.m, utils/Antarctica/antscale.m,
+	  utils/Antarctica/antzoom.m, utils/Array/allempty.m,
+	  utils/Array/allnan.m, utils/Array/string_dim.m,
+	  utils/Array/string_vec.m, utils/Cluster/clusterreq.m,
+	  utils/Computation/runtime.m,
+	  utils/Computation/sparsity_compute.m,
+	  utils/Cracks/contour_icefront.m, utils/Cracks/contour_maker.m,
+	  utils/Cracks/exist_by_names.m, utils/Cracks/find_around.m,
+	  utils/Cracks/find_coord.m, utils/Cracks/find_coord_matrix.m,
+	  utils/Cracks/find_line.m, utils/Cracks/icefront_maker.m,
+	  utils/Cracks/index_builder.m, utils/Cracks/index_builder2.m,
+	  utils/Cracks/locate.m, utils/Cracks/margin_locator.m,
+	  utils/Cracks/mesh_creator_2d.m, utils/Cracks/meshdensitygen.m,
+	  utils/Cracks/names_function.m, utils/Cracks/perim_curve.m,
+	  utils/Cracks/void_fill.m, utils/Cracks/void_fill1d.m,
+	  utils/Cracks/void_fill_noxy.m, utils/DataProcessing/addtrack.m,
+	  utils/DataProcessing/data_processing_tool.fig,
+	  utils/DataProcessing/data_processing_tool.m, utils/Err/erfn.m,
+	  utils/Err/erfp.m, utils/Exp/expboxgen.m,
+	  utils/Exp/expconcatenate.m, utils/Exp/expcreatecircle.m,
+	  utils/Exp/expcreatecontour.m, utils/Exp/expcreateprofile.m,
+	  utils/Exp/expcut.m, utils/Exp/expdisp.m, utils/Exp/expdoc.m,
+	  utils/Exp/expgen.m, utils/Exp/explink.m, utils/Exp/expmaster.m,
+	  utils/Exp/expselect.m, utils/Exp/ginputquick.m,
+	  utils/Exp/zinput.m, utils/Exp/manipulation/addendprofile.m,
+	  utils/Exp/manipulation/addinsideprofile.m,
+	  utils/Exp/manipulation/addprofile.m,
+	  utils/Exp/manipulation/closeprofile.m,
+	  utils/Exp/manipulation/closestpoint.m,
+	  utils/Exp/manipulation/closestsegment.m,
+	  utils/Exp/manipulation/cutarea.m,
+	  utils/Exp/manipulation/cutprofile.m,
+	  utils/Exp/manipulation/mergeprofiles.m,
+	  utils/Exp/manipulation/modifyposition.m,
+	  utils/Exp/manipulation/removepoints.m,
+	  utils/Exp/manipulation/removeprofile.m,
+	  utils/Exp/manipulation/removeseveralpoints.m,
+	  utils/Exp/manipulation/undoplots.m,
+	  utils/Exp/readwrite/expread.m, utils/Exp/readwrite/expwrite.m,
+	  utils/Exp/readwrite/expwriteasvertices.m,
+	  utils/Exp/readwrite/newline.m, utils/Exp/readwrite/put_file.m,
+	  utils/Exp/readwrite/read_file.m, utils/Exp/readwrite/readfile.m,
+	  utils/Exp/readwrite/readline.m, utils/Exp/readwrite/writefile.m,
+	  utils/Find/locate.m, utils/Geometry/SegIntersect.m,
+	  utils/Geometry/find_point.m, utils/Hulls/inhull.m,
+	  utils/Hulls/insidehull.m, utils/Hulls/interval.m,
+	  utils/Hulls/intsecl.m, utils/Hulls/intsecpl.m,
+	  utils/Hulls/iscross.m, utils/Hulls/isinpoly.m,
+	  utils/Hulls/isinpolylarge.m, utils/Hulls/ispolygon.m,
+	  utils/Hulls/linechk.m, utils/ImageProcessing/gradient_perso.m,
+	  utils/ImageProcessing/im_resize.m,
+	  utils/ImageProcessing/mean_congrid.m,
+	  utils/ImageProcessing/rebin.m,
+	  utils/Interp/griddata_grid_to_mesh.m,
+	  utils/Interp/griddata_grid_to_mesh_completer.m,
+	  utils/Interp/griddata_grid_to_mesh_nan.m,
+	  utils/Interp/griddata_mesh_to_grid.m,
+	  utils/Interp/griddata_mesh_to_mesh.m,
+	  utils/Interp/griddata_mesh_to_mesh_3d.m,
+	  utils/Interp/griddata_nearest.m,
+	  utils/Interp/griddata_nearest_matrix.m,
+	  utils/Interp/griddata_nearest_nan.m,
+	  utils/Interp/griddata_nearest_vector.m,
+	  utils/Interp/griddata_perso.m, utils/LatLong/ll2xy.m,
+	  utils/LatLong/mapll.m, utils/LatLong/mapxy.m,
+	  utils/LatLong/xyscale_south.m, utils/Math/fixdec.m,
+	  utils/Meca/effective_value.m, utils/Meca/glen_coefficients.m,
+	  utils/Meca/lithostaticpressure.m, utils/Meca/paterson.m,
+	  utils/Meca/tau_principal.m, utils/Mesh/BuildAdaptedMesh.m,
+	  utils/Miscellaneous/create_region.m,
+	  utils/Miscellaneous/findarg.m, utils/Miscellaneous/round_ice.m,
+	  utils/Model/ProcessParallelParametersFromCieloRc.m,
+	  utils/Model/loadmodel.m, utils/Nightly/nightlyrun.m,
+	  utils/Nightly/nightlyruncielo.m, utils/Plot/squarezoom.m,
+	  utils/Shell/issmdir.m, utils/Sound/beep_ice.m,
+	  utils/String/discardnum.m, utils/String/logoutput.m,
+	  utils/String/strsplit.m, utils/UpdateArchive/updatearchive.m,
+	  utils/Visu/plot_results.m, utils/Visu/twofig.m, utils/Visu/vi.m,
+	  utils/Visu/vic.m, utils/Visu/vii.m, utils/Visu/vim.m,
+	  utils/Visu/vim3.m: reorg
+
+2009-04-03 15:43  morlighe
+
+	* src/: c/MakefileIce, perl/DiagnosticAlter.pl: reorg
+
+2009-04-03 15:42  morlighe
+
+	* src/c/shared/: MakefileIce, Exp/IsInPoly.c, Ice/Contour.c,
+	  Ice/Contour.h, Ice/CreateElemMatrix.c, Ice/CreateElemVector.c,
+	  Ice/GaussPenta.c, Ice/GaussSegment.c, Ice/GaussTria.c,
+	  Ice/GetBFromTemperature.c, Ice/GetParameterList.c,
+	  Ice/Getalpha2FromFrictionParameters.c, Ice/Ice.h,
+	  Ice/MatrixUtils.c, Ice/SetDofs.c, Ice/SharedPentaElem.c,
+	  Ice/SharedTriaElem.c, Ice/getgriddata.c, Ice/recover_input.c: Big
+	  reorg
+
+2009-04-03 15:39  morlighe
+
+	* src/mex/MakefileIce: big reorg
+
+2009-04-03 15:37  morlighe
+
+	* src/mex/: ArgusContourToMesh/ArgusContourToMesh.m,
+	  ArgusContourToMesh/Makefile, DataInterp/DataInterp.m,
+	  DataInterp/Makefile, HoleFiller/Makefile, MeshPartition/Makefile,
+	  SetStructureField/Makefile,
+	  SetStructureField/SetStructureField.c,
+	  SetStructureField/SetStructureField.h, TriMesh/Makefile,
+	  TriMeshProcessRifts/Makefile, TriMeshRefine/Makefile,
+	  Visu/Makefile, pentaelem/CreateKMatrix.c,
+	  pentaelem/CreateKMatrix.h, pentaelem/CreatePVector.c,
+	  pentaelem/CreatePVector.h, pentaelem/Makefile,
+	  triaelem/CreateKMatrix.c, triaelem/CreateKMatrix.h,
+	  triaelem/Makefile: Big Reorg
+
+2009-04-03 15:29  morlighe
+
+	* src/c/shared/sharedice.h: Missing file
+
+2009-03-18 12:06  larour
+
+	* MakefileIce: diverse.
+
+2009-03-18 12:05  larour
+
+	* MakefileIce: Moved Makefile to MakefileIce
+
+2009-03-18 12:04  larour
+
+	* src/MakefileIce: Missing links
+
+2009-03-18 12:02  larour
+
+	* src/c/: MakefileIce, ArgusContourToMeshx/ArgusContourToMesh.h,
+	  ArgusContourToMeshx/ArgusContourToMeshx.c,
+	  ArgusContourToMeshx/Contour.c, ArgusContourToMeshx/Contour.h,
+	  ArgusContourToMeshx/Makefile, HoleFillerx/HoleFiller.h,
+	  HoleFillerx/HoleFillerCrippen.c, HoleFillerx/HoleFillerx.c,
+	  HoleFillerx/Makefile, IceDataInterpx/DataInterp.h,
+	  IceDataInterpx/DataInterpx.c, IceDataInterpx/Makefile,
+	  MeshPartitionx/Makefile, MeshPartitionx/MeshPartition.h,
+	  MeshPartitionx/MeshPartitionx.c, Visux/Makefile, Visux/Visu.h,
+	  Visux/Visux.c, shared/MakefileIce, shared/Exp/ExpIce.h,
+	  shared/TriMesh/TriMesh.h: x code taken out of modules
+
+2009-03-18 11:57  larour
+
+	* src/mex/: DataInterp/DataInterp.c, DataInterp/DataInterp.h,
+	  DataInterp/DataInterpx.c, DataInterp/Makefile,
+	  HoleFiller/HoleFiller.c, MeshPartition/MeshPartition.c: Wrong
+	  header files
+
+2009-03-18 11:53  larour
+
+	* src/mex/: ArgusContourToMesh/ArgusContourToMesh.c,
+	  ArgusContourToMesh/ArgusContourToMesh.h,
+	  ArgusContourToMesh/ArgusContourToMeshx.c,
+	  ArgusContourToMesh/Contour.c, ArgusContourToMesh/Contour.h,
+	  ArgusContourToMesh/IsInPoly.c, ArgusContourToMesh/Makefile,
+	  HoleFiller/HoleFiller.h, HoleFiller/HoleFillerCrippen.c,
+	  HoleFiller/HoleFillerx.c, HoleFiller/Makefile,
+	  MeshPartition/Makefile, MeshPartition/MeshPartition.h,
+	  MeshPartition/MeshPartitionx.c, TriMesh/TriMesh.c,
+	  TriMeshProcessRifts/TriMeshProcessRifts.c,
+	  TriMeshRefine/TriMeshRefine.c, Visu/Makefile, Visu/Visu.c,
+	  Visu/Visu.h, Visu/Visux.c: Took out x code layer
+
+2009-03-18 11:06  larour
+
+	* etc/config_linux64.mk: [no log message]
+
+2009-03-18 11:05  larour
+
+	* etc/config_linux64.mk: Replaced ICE by ISSM_DIR
+
+2009-03-18 10:56  larour
+
+	* src/c/shared/TriMesh/GridInsideHole.c: minor.
+
+2009-03-18 10:38  morlighe
+
+	* scripts/archive.sh: fixed archive.sh
+
+2009-03-18 10:37  larour
+
+	* src/MakefileIce: Moved Makefile.issm to MakefileIce
+
+2009-03-18 10:36  larour
+
+	* src/mex/: Makefile, MakefileIce: Moved Makefile to MakefileIce
+
+2009-03-18 10:35  larour
+
+	* src/mex/: TriMesh/Makefile, TriMesh/TriMesh.c,
+	  TriMeshProcessRifts/Makefile,
+	  TriMeshProcessRifts/TriMeshProcessRifts.c,
+	  TriMeshRefine/Makefile, TriMeshRefine/TriMeshRefine.c: Now
+	  references sharedice.a library.
+
+2009-03-18 10:32  larour
+
+	* src/c/shared/: MakefileIce, Exp/DomainOutlineReadIce.c,
+	  Exp/ExpIce.h, TriMesh/AssociateSegmentToElement.c,
+	  TriMesh/GridInsideHole.c, TriMesh/Makefile,
+	  TriMesh/OrderSegments.c, TriMesh/SplitMeshForRifts.c,
+	  TriMesh/TriMesh.h, TriMesh/TriMeshUtils.c: Shared is not in
+	  shared/
+
+2009-03-18 10:32  morlighe
+
+	* archive.sh: moved to scripts
+
+2009-03-18 08:31  larour
+
+	* install.sh: Gone baby gone... Niac niac.
+
+2009-03-18 08:25  larour
+
+	* mailinglist, cron/mailinglist: Gone to cron
+
+2009-03-18 08:23  larour
+
+	* todo: Gone to Trash
+
+2009-03-18 08:23  larour
+
+	* startup.m, bin/startup.m: Moved to bin
+
+2009-03-18 08:09  larour
+
+	* startup.m: issmdir could not be found! (thanks Mathieu!)
+
+2009-03-18 08:03  larour
+
+	* scripts/archive.sh: Moved from root directory
+
+2009-03-18 07:50  larour
+
+	* cron/linux_cronfile: Updated Cron to cron
+
+2009-03-18 07:41  larour
+
+	* etc/environment_variables: Replaced Libs by libs.
+
+2009-03-18 07:21  larour
+
+	* src/pro/: bytscl.m, plot_cielo.pro: From Utils to pro/ for Idl
+	  utils
+
+2009-03-18 07:14  larour
+
+	* src/mex/: Makefile, ArgusContourToMesh/ArgusContourToMesh.c,
+	  ArgusContourToMesh/ArgusContourToMesh.h,
+	  ArgusContourToMesh/ArgusContourToMesh.m,
+	  ArgusContourToMesh/ArgusContourToMeshx.c,
+	  ArgusContourToMesh/Contour.c, ArgusContourToMesh/Contour.h,
+	  ArgusContourToMesh/IsInPoly.c, ArgusContourToMesh/Makefile,
+	  DataInterp/DataInterp.c, DataInterp/DataInterp.h,
+	  DataInterp/DataInterp.m, DataInterp/DataInterpx.c,
+	  DataInterp/Makefile, HoleFiller/HoleFiller.c,
+	  HoleFiller/HoleFiller.h, HoleFiller/HoleFillerCrippen.c,
+	  HoleFiller/HoleFillerx.c, HoleFiller/Makefile,
+	  MeshPartition/Makefile, MeshPartition/MeshPartition.c,
+	  MeshPartition/MeshPartition.h, MeshPartition/MeshPartitionx.c,
+	  TriMesh/Makefile, TriMesh/TriMesh.c,
+	  TriMeshProcessRifts/Makefile,
+	  TriMeshProcessRifts/TriMeshProcessRifts.c,
+	  TriMeshRefine/Makefile, TriMeshRefine/TriMeshRefine.c,
+	  Visu/Makefile, Visu/Visu.c, Visu/Visu.h, Visu/Visux.c:
+	  Modifications to run in new directory
+
+2009-03-18 06:57  larour
+
+	* etc/: config_linux32.mk, config_linux64.mk, config_mac.mk,
+	  mexopts_v5.sh, mexopts_v76.sh: New path etc/ to mex options file.
+
+2009-03-18 06:52  larour
+
+	* etc/environment.sh: New path to config.
+
+2009-03-18 06:45  larour
+
+	* doc/: Makefile, developperguide.pdf, theoryguide.pdf,
+	  userguide.pdf, theoryguide/Algorithm.png,
+	  theoryguide/Assembly.png, theoryguide/MINI.png,
+	  theoryguide/Makefile, theoryguide/TpmpMb.png,
+	  theoryguide/accumulation.png, theoryguide/barycentric_penta.png,
+	  theoryguide/barycentric_tria.png, theoryguide/bilanmass.png,
+	  theoryguide/friction_geometry.png, theoryguide/friction_kin.png,
+	  theoryguide/geometry3D.png, theoryguide/melting.png,
+	  theoryguide/meshpenalty.png, theoryguide/penalized_vel_2.png,
+	  theoryguide/penalized_vel_3.png, theoryguide/penalties1.png,
+	  theoryguide/pentaelem.png, theoryguide/prog1.png,
+	  theoryguide/prog2.png, theoryguide/progi.png,
+	  theoryguide/quadelem.png, theoryguide/schema1.png,
+	  theoryguide/schema4.png, theoryguide/schema5.png,
+	  theoryguide/segment.png, theoryguide/tetraelem.png,
+	  theoryguide/theoryguide.tex, theoryguide/thermal_loop.png,
+	  theoryguide/triaelem.png, userguide/Amery.png,
+	  userguide/Antarctica.png, userguide/Makefile,
+	  userguide/argus.png, userguide/argus_DO.png,
+	  userguide/argus_Front.png, userguide/argus_GL.png,
+	  userguide/argus_Islands.png, userguide/argus_map.png,
+	  userguide/contour.png, userguide/layers.png,
+	  userguide/userguide.tex: Moved Doc to doc
+
+2009-03-18 06:42  larour
+
+	* cron/: README, ice.sh, killingforeign.sh, linux_cronfile,
+	  nightlyrun.sh, tag.sh, testingforeign.sh: Moved Cron to cron
+
+2009-03-18 05:46  larour
+
+	* etc/: Make_default_rules.mk, README, cielo.rc, config_linux32.mk,
+	  config_linux64.mk, config_mac.mk, environment.sh,
+	  environment_variables, mexopts_mac.sh, mexopts_v5.sh,
+	  mexopts_v651.sh, mexopts_v704.sh, mexopts_v76.sh: Moved Etc to
+	  etc
+
+2009-03-17 18:56  larour
+
+	* Makefile, Makefile.issm: Moved Makefile to Makefile.issm to make
+	  room for Cielo makefile.
+
+2009-03-17 18:04  larour
+
+	* README: Diverse
+
+2009-03-17 18:02  larour
+
+	* INSTALL, README: some info
+
+2009-03-17 17:57  larour
+
+	* startup.m: More elegant way to recove ISSM_DIR
+
+2009-03-17 14:32  larour
+
+	* test/test.m: Gone: ignore
+
+2009-03-17 14:29  larour
+
+	* test/test.m: test dir: ignore
+
+2009-03-17 14:28  larour
+
+	* test.m: test: ignore
+
+2009-03-17 14:23  larour
+
+	* test.m: test: ignore
+
+2009-03-17 13:59  larour
+
+	* startup.m: SUITESPARSE moved to Libs/suitesparse
+
+2009-03-17 13:58  larour
+
+	* Makefile: Took out doxygen doc, now in Doc/developperguide/
+	  makefile.
+
+2009-03-17 13:56  larour
+
+	* doxygen.config: c html doc using doxygen, and matlab html doc
+	  using m2html
+
+2009-03-17 12:08  morlighe
+
+	* install.sh: metis is needed by MeshPartition module
+
+2009-03-17 11:55  morlighe
+
+	* install.sh: Added compilation of triangle
+
+2009-03-17 11:48  morlighe
+
+	* install.sh: Added an install.sh file to check that .bashrc is
+	  correclty configured and automated compilation
+
+2009-03-17 08:13  larour
+
+	* README: How to get ISSM to work
+
+2009-03-17 08:12  larour
+
+	* startup.m: Simpler startup file.
+
+2009-03-17 08:10  larour
+
+	* install.sh: Not needed anymore
+
+2009-03-17 07:41  larour
+
+	* Makefile: New modules framework
+
+2009-03-17 07:41  larour
+
+	* archive.sh: Naming
+
+2009-03-13 16:39  larour
+
+	* doxygen.config: Automatic documentation generation.
+
+2009-03-13 11:09  morlighe
+
+	* contributors.txt: added IsInpoly.c contrib
+
+2009-03-13 09:48  morlighe
+
+	* contributors.txt: not used anymore
+
+2009-03-11 17:06  morlighe
+
+	* contributors.txt: updated contributors
+
+2009-03-05 12:22  morlighe
+
+	* install.sh: change startup file first
+
+2009-03-02 16:40  morlighe
+
+	* startup.m: simplified startup.m with genpath_ice
+
+2009-03-02 09:43  larour
+
+	* startup.m: Added dakota directories.
+
+2009-02-28 21:55  larour
+
+	* startup.m: Added responsefunctions
+
+2009-02-24 10:07  morlighe
+
+	* install.sh: Added get number of CPUs and removes make -j 8 for
+	  the first make (compilation fails)
+
+2009-02-23 15:49  larour
+
+	* startup.m: Added Gdal path.
+
+2009-02-23 15:49  larour
+
+	* Makefile, install.sh: Include Gdal compilation.
+
+2009-02-17 13:53  morlighe
+
+	* startup.m: minor
+
+2009-02-17 13:52  morlighe
+
+	* todo: [no log message]
+
+2009-02-17 13:52  morlighe
+
+	* startup.m: Added missing directories in path
+
+2009-02-17 13:51  morlighe
+
+	* Makefile: Added HoleFiller, and Public target
+
+2009-02-17 12:51  larour
+
+	* todo: [no log message]
+
+2009-02-17 12:50  larour
+
+	* startup.m: Added missing directories in path
+
+2009-02-17 12:49  larour
+
+	* Makefile: Added HoleFiller, and Public target
+
+2009-02-11 10:52  morlighe
+
+	* todo: test
+
+2009-02-10 15:32  larour
+
+	* todo: Test4
+
+2009-02-10 15:31  larour
+
+	* todo: Test 3
+
+2009-02-10 15:21  larour
+
+	* todo: test
+
+2009-02-09 10:08  morlighe
+
+	* contributors.txt: minor
+
+2009-02-06 12:11  morlighe
+
+	* startup.m: Added HoleFiller Path
+
+2009-02-06 09:28  morlighe
+
+	* install.sh: Added a script to install everything automatically
+
+2009-02-05 17:41  morlighe
+
+	* todo: as usual
+
+2009-02-05 17:12  morlighe
+
+	* startup.m: bad startup
+
+2009-02-05 16:50  larour
+
+	* contributors.txt, startup.m, todo: Cleanup solutions
+
+2009-02-03 07:51  morlighe
+
+	* startup.m: plot must be added to startup file
+
+2009-02-02 08:15  larour
+
+	* todo: Mathieu?
+
+2009-01-27 09:30  larour
+
+	* contributors.txt: Added contributors list
+
+2009-01-27 09:28  larour
+
+	* Makefile: Added HoleFiller module
+
+2009-01-20 14:53  ala
+
+	* mailinglist: Added Ala's email address.
+
+2009-01-20 07:25  morlighe
+
+	* startup.m: new path is needed for cielo
+
+2009-01-20 07:09  larour
+
+	* mailinglist: Test, ignore
+
+2009-01-19 14:14  larour
+
+	* mailinglist: Test of VCS commit. Ignore.
+
+2009-01-19 14:14  larour
+
+	* mailinglist: Test of VCS commit. Ignore
+
+2009-01-19 11:05  larour
+
+	* Makefile: Replaced path to config from MexConfig to Etc
+
+2008-12-30 08:45  morlighe
+
+	* todo: Added some missing stuff from previous ice1
+
+2008-12-29 11:54  larour
+
+	* startup.m, todo: Some missing stuff from ice2
+
+2008-12-29 09:23  seroussi
+
+	* startup.m: Not needed
+
+2008-12-29 09:04  seroussi
+
+	* startup.m: test
+
+2008-12-29 08:16  morlighe
+
+	* todo: as usual
+
+2008-12-24 10:39  morlighe
+
+	* startup.m: antepenultimate test
+
+2008-12-24 10:28  morlighe
+
+	* startup.m: back
+
+2008-12-24 10:16  morlighe
+
+	* startup.m: check nightly run
+
+2008-12-24 10:13  seroussi
+
+	* mailinglist: removed change
+
+2008-12-24 07:40  seroussi
+
+	* mailinglist: to fix nightly runs and avoid 100 mails
+
+2008-12-22 09:27  morlighe
+
+	* todo: as usual
+
+2008-12-22 07:36  morlighe
+
+	* todo: as usual
+
+2008-12-05 11:33  morlighe
+
+	* todo: commit to be done later
+
+2008-11-18 13:55  morlighe
+
+	* todo: as usual
+
+2008-10-21 14:14  morlighe
+
+	* todo: as usual
+
+2008-10-14 09:02  morlighe
+
+	* todo: as usual
+
+2008-10-13 08:11  morlighe
+
+	* todo: as usual
+
+2008-10-13 08:03  morlighe
+
+	* todo: as usual
+
+2008-09-29 13:22  morlighe
+
+	* todo: as usual
+
+2008-09-26 16:55  larour
+
+	* startup.m: Added model to startup
+
+2008-09-26 10:16  morlighe
+
+	* todo: as usual
+
+2008-09-25 16:01  morlighe
+
+	* todo: as usual
+
+2008-09-25 09:30  seroussi
+
+	* todo: as usual
+
+2008-09-24 13:07  morlighe
+
+	* todo: as usual
+
+2008-09-24 10:52  larour
+
+	* todo: Simplified diagnostic solution
+
+2008-09-16 15:59  morlighe
+
+	* todo: as usual
+
+2008-09-15 12:30  morlighe
+
+	* todo: as usual
+
+2008-09-10 17:06  morlighe
+
+	* todo: to do tomorrow
+
+2008-09-10 16:57  morlighe
+
+	* todo: as usual
+
+2008-09-09 15:57  morlighe
+
+	* todo: as usual
+
+2008-09-09 13:31  morlighe
+
+	* todo: ice shelf basal velocity -> fixed
+
+2008-09-09 11:46  morlighe
+
+	* todo: As usual
+
+2008-09-09 07:46  morlighe
+
+	* todo: as usual
+
+2008-09-08 17:35  morlighe
+
+	* todo: Good luck!
+
+2008-09-08 09:23  seroussi
+
+	* startup.m: minor
+
+2008-09-08 09:22  seroussi
+
+	* startup.m: simplified projections project3d
+
+2008-09-08 08:38  morlighe
+
+	* todo: as usual
+
+2008-09-05 16:31  larour
+
+	* todo: as usual
+
+2008-09-05 15:53  larour
+
+	* todo: Improved transient and steady state thermal solution
+
+2008-09-04 14:21  morlighe
+
+	* todo: as usual
+
+2008-09-04 11:53  morlighe
+
+	* todo: As usual
+
+2008-09-03 16:56  morlighe
+
+	* todo: As usual
+
+2008-09-03 12:23  larour
+
+	* todo: Important
+
+2008-09-03 09:21  morlighe
+
+	* todo: as usual
+
+2008-09-02 16:38  larour
+
+	* todo: New transient solution
+
+2008-09-02 13:08  larour
+
+	* todo: New penalty approach to computation of melting in thermal
+	  solution
+
+2008-09-02 09:20  larour
+
+	* todo: As usual
+
+2008-08-30 07:12  larour
+
+	* todo: As usual
+
+2008-08-29 10:19  larour
+
+	* todo: as usual
+
+2008-08-28 17:05  seroussi
+
+	* todo: updated todo
+
+2008-08-27 13:36  larour
+
+	* todo: Implemented basal vertical velocity solution. Started
+	  thermal solution
+
+2008-08-26 17:10  larour
+
+	* todo: as usual
+
+2008-08-26 14:44  larour
+
+	* todo: Implemented and fixed bugs in vertical solution
+
+2008-08-26 10:54  larour
+
+	* todo: Implemented new 2d-3d modeling. Extended computations of
+	  velocities vertically
+
+2008-08-26 10:52  larour
+
+	* startup.m: Better path
+
+2008-08-25 09:54  larour
+
+	* startup.m: Took out the startup error
+
+2008-08-24 14:39  larour
+
+	* todo: as usual
+
+2008-08-21 17:42  larour
+
+	* startup.m: New startup
+
+2008-08-21 17:38  larour
+
+	* mailinglist: Added mailing list
+
+2008-08-07 10:39  morlighe
+
+	* startup.m: oups...
+
+2008-08-07 10:37  morlighe
+
+	* startup.m: Added a new field md.visualization. If 1:
+	  visualization of each iteration results in icecontrol
+
+2008-08-01 23:36  larour
+
+	* todo: As usual
+
+2008-08-01 12:09  larour
+
+	* startup.m: Public/
+
+2008-07-31 14:08  morlighe
+
+	* startup.m: Same convention for MacAyealdiagnostic and control
+	  (2nu -> nu)
+
+2008-07-25 17:10  larour
+
+	* todo: As usual
+
+2008-07-25 11:35  larour
+
+	* Makefile, todo: Added Makefiles to compiled shared and objects in
+	  'c' code
+
+2008-07-23 08:28  larour
+
+	* startup.m, todo: Missing MeshPartition path
+
+2008-07-21 15:11  larour
+
+	* Makefile: Addedd MeshPartition module.
+
+2008-07-03 22:05  larour
+
+	* todo: As usual
+
+2008-07-01 11:12  larour
+
+	* todo: Added cronjob capabilities
+
+2008-06-30 14:50  seroussi
+
+	* todo: Updated todo
+
+2008-06-30 11:40  larour
+
+	* Makefile: Separated Doc target from all target
+
+2008-06-26 16:17  larour
+
+	* startup.m: Added DataInterp to path
+
+2008-06-26 16:10  larour
+
+	* Makefile: Added DataInterp target
+
+2008-06-17 11:06  larour
+
+	* Makefile: Added top level Makefile to drive overall compilation
+
+2008-06-12 14:44  larour
+
+	* startup.m: Added ArgusContourToMesh module, to run  with
+	  parameterize.m
+
+2008-06-04 10:11  seroussi
+
+	* todo: Update todo
+
+2008-06-03 16:40  larour
+
+	* todo: Some more things to do.
+
+2008-06-03 16:40  larour
+
+	* startup.m: Took out objects from the ICE path, as the @grid class
+	  interferes with the graph2d/grid.m routine.
+
+2008-06-03 11:54  larour
+
+	* todo: Todo
+
+2008-06-03 10:43  larour
+
+	* archive.sh: New clean targets.
+
+2008-06-02 16:24  larour
+
+	* startup.m: Updated paths to solution scripts.
+
+2008-06-02 16:12  larour
+
+	* startup.m: Modified path to Triangle meshing modules.
+
+2008-05-30 11:32  larour
+
+	* todo: Additional task on square model.
+
+2008-05-30 11:18  larour
+
+	* todo: Added cholesky task.
+
+2008-05-30 10:47  larour
+
+	* todo: Todo file. Update as much as needed.
+
+2008-05-29 14:26  seroussi
+
+	* startup.m: Comment on lastwarn
+
+2008-05-29 14:07  morlighe
+
+	* startup.m: fixed problem with startup's warning message
+
+2008-05-29 12:16  larour
+
+	* startup.m: Updated startup.m file for new changes in names of
+	  solution sequences
+
+2008-05-29 11:57  larour
+
+	* startup.m: Improved startup file. Added missing Model in the Ice
+	  path.
+
+2008-05-29 11:54  larour
+
+	* startup.m: Improved startup file
+
+2008-05-29 11:50  larour
+
+	* startup.m: Improved startup file
+
+2008-05-29 11:45  larour
+
+	* startup.m: Improved startup file
+
+2008-05-29 11:42  larour
+
+	* startup.m: Improved startup file
+
+2008-05-29 10:06  morlighe
+
+	* startup.m: [no log message]
+
+2008-05-21 11:08  larour
+
+	* archive.sh: New tar creation routine.
+
+2008-05-21 10:53  larour
+
+	* startup.m: New shuffling of code architecture.
+
+2008-05-21 10:13  larour
+
+	* startup.m: Cleaned up startup file.
+
+2008-04-19 12:33  larour
+
+	* startup.m: Working out of tier3 now.
+
+2008-03-05 13:31  larour
+
+	* startup.m: Too many changes to explain
+
+2007-12-05 14:48  larour
+
+	* Makefile: Not needed for now.
+
+2007-12-05 14:45  larour
+
+	* startup.m: Added windows startup to the existing linux startup
+	  matlab script.
+
+2007-12-05 12:12  larour
+
+	* startup.m: Cleaned up a little bit. Only two paths to setup: for
+	  Cielo, and for Ice codes.
+
+2007-11-27 12:07  larour
+
+	* startup.m: New TriMesh modules, added path.
+
+2007-11-21 18:11  larour
+
+	* startup.m: Added MacAyealControlModel to the matlab path.
+
+2007-11-19 15:25  larour
+
+	* startup.m: Promoted tier3_ice to tier2_ice.
+
+2007-11-18 16:07  larour
+
+	* startup.m: This file should be symbolically linked to the matlab
+	  starting directory.
+
+2007-10-25 09:30  larour
+
+	* Makefile: Ice flow modeling
+
+2007-10-25 09:30  larour
+
+	* Makefile: Initial revision
+
Index: /issm/trunk/LICENSE
===================================================================
--- /issm/trunk/LICENSE	(revision 1)
+++ /issm/trunk/LICENSE	(revision 1)
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  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
+this service 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.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  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.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+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
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the 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.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE 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.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  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.
+
+  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
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <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 2 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, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision 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.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This 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 Library General
+Public License instead of this License.
Index: /issm/trunk/Makefile.am
===================================================================
--- /issm/trunk/Makefile.am	(revision 28275)
+++ /issm/trunk/Makefile.am	(revision 1)
@@ -1,5 +1,2 @@
-EXTRA_DIST = reconf scripts test m4 examples cron etc doc packages contributors.txt
-SUBDIRS = src
-bin_SCRIPTS= README.rtf
-
-ACLOCAL_AMFLAGS = -I m4
+EXTRA_DIST = reconf  scripts test INSTALLICE LICENSE m4 examples cron etc doc packages ChangeLogCielo ChangeLogIce contributors.txt run READMEICE startup.m startup.m startup.m startup.m  todo MakefileIce
+SUBDIRS = src bin
Index: /issm/trunk/Makefile.in
===================================================================
--- /issm/trunk/Makefile.in	(revision 1)
+++ /issm/trunk/Makefile.in	(revision 1)
@@ -0,0 +1,653 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
+	$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+	compile config.guess config.sub depcomp install-sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/issm_options.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLACSINCL = @BLACSINCL@
+BLACSLIB = @BLACSLIB@
+BLASLAPACKINCL = @BLASLAPACKINCL@
+BLASLAPACKLIB = @BLASLAPACKLIB@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLIBS = @FLIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MATLAB = @MATLAB@
+MATLABINCL = @MATLABINCL@
+MATLAB_MAJOR = @MATLAB_MAJOR@
+MATLAB_MINOR = @MATLAB_MINOR@
+MATLAB_VERSION = @MATLAB_VERSION@
+METISINCL = @METISINCL@
+METISLIB = @METISLIB@
+MEX = @MEX@
+MEXEXT = @MEXEXT@
+MEXLIB = @MEXLIB@
+MEXLINK = @MEXLINK@
+MKDIR_P = @MKDIR_P@
+MPIINCL = @MPIINCL@
+MPILIB = @MPILIB@
+MUMPSINCL = @MUMPSINCL@
+MUMPSLIB = @MUMPSLIB@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PETSCINCL = @PETSCINCL@
+PETSCLIB = @PETSCLIB@
+PLAPACKINCL = @PLAPACKINCL@
+PLAPACKLIB = @PLAPACKLIB@
+RANLIB = @RANLIB@
+SCALAPACKLIB = @SCALAPACKLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEPCINCL = @SLEPCINCL@
+SLEPCLIB = @SLEPCLIB@
+STRIP = @STRIP@
+TRIANGLEINCL = @TRIANGLEINCL@
+TRIANGLELIB = @TRIANGLELIB@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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@
+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@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = reconf  scripts test INSTALLICE LICENSE m4 examples cron etc doc packages ChangeLogCielo ChangeLogIce contributors.txt run READMEICE startup.m startup.m startup.m startup.m  todo MakefileIce
+SUBDIRS = src bin
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+	      cd $(srcdir) && $(AUTOMAKE) --gnu  \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in:  $(am__configure_deps) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	test -d $(distdir) || mkdir $(distdir)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r $(distdir)
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-lzma: distdir
+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lzma*) \
+	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && cd $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+	@cd $(distuninstallcheck_dir) \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-generic \
+	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+	dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
+	distclean-generic distclean-hdr distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html 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-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+	pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /issm/trunk/README
===================================================================
--- /issm/trunk/README	(revision 28275)
+++ /issm/trunk/README	(revision 1)
@@ -1,46 +1,68 @@
+------------------------------------------------------------------------------
+
+ISSM:
+Ice Sheet System Modeling: a framework for modeling ice flow on ice sheet/ice shelf
+systems using Finite Elemenent Analysis, and parallel technologies.
 
 ------------------------------------------------------------------------------
 
-ISSM
-Ice Sheet System Modeling: a framework for modeling ice flow on ice sheet/ice shelf
-systems using Finite Elemenent Analysis, and parallel technologies.
+Jet Propulsion Laboratory
 
-Email:   issm@jpl.nasa.gov
-Website: http://issm.jpl.nasa.gov/
+Eric          Larour (Project Lead)
+Mathieu       Morlighem
+Helene        Seroussi
+
+Email: eric.larour@jpl.nasa.gov
 
 ------------------------------------------------------------------------------
+License.
 
-License
+ISSM is distributed under the GNU General Public License.  It 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.  A copy of 
+this license is included in the LICENSE file, and is also available online 
+from http://www.gnu.org/copyleft/gpl.html.  Also refer to the COPYRIGHT file 
+for important U.S. Government legal notices.
 
-ISSM is California Institute of Technology Copyright, Distributed under BSD Three Clause License.
+The ISSM distribution contains libraries which are available separately
+under compatible licensing terms.  In particular, many of the libraries
+in methods and packages are available separately under the GNU General 
+Public License (GPL) or Lesser General Public License (LGPL).
 
+------------------------------------------------------------------------------
+Overview.
 
-Copyright (c) 2002-2018, California Institute of Technology.
-All rights reserved.  Based on Government Sponsored Research under contracts
-NAS7-1407 and/or NAS7-03001.
+More to come
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
+Refer to http://www.jpl.nasa.gov/ISSM/software.html for additional 
+information.
 
-1. Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. Neither the name of the California Institute of Technology (Caltech),
-   its operating division the Jet Propulsion Laboratory (JPL), the National
-   Aeronautics and Space Administration (NASA), nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
+------------------------------------------------------------------------------
+Distribution.
 
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE CALIFORNIA INSTITUTE OF TECHNOLOGY BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+The directories contained in this distribution include:
+
+examples            Example problems 
+
+packages            Other libraries 
+
+m4                  m4 macros used for supporting autoconf.
+
+doc                 The Users, Reference, and Developers Manuals are 
+                    maintained here.  Other references are available from
+                    the ISSM Web site (http://www.jpl.nasa.gov/ISSM).
+
+src                 The main source code repository for the ISSM system.
+
+test                Files for regression and unit testing of the ISSM system.
+
 ------------------------------------------------------------------------------
+Installation.
+
+The installation procedure uses a standard GNU installation based on autoconf.
+The basic steps are to invoke 'configure' to generate Makefiles for your 
+particular system and then invoke 'make' to compile the sources.  See the 
+INSTALL file for detailed instructions.
+
+------------------------------------------------------------------------------
Index: /issm/trunk/aclocal.m4
===================================================================
--- /issm/trunk/aclocal.m4	(revision 1)
+++ /issm/trunk/aclocal.m4	(revision 1)
@@ -0,0 +1,926 @@
+# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.10.2], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 4
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[# Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/issm_options.m4])
+m4_include([m4/matlab.m4])
Index: /issm/trunk/archive.sh
===================================================================
--- /issm/trunk/archive.sh	(revision 1)
+++ /issm/trunk/archive.sh	(revision 1)
@@ -0,0 +1,1 @@
+link scripts/archive.sh
Index: /issm/trunk/autom4te.cache/output.0
===================================================================
--- /issm/trunk/autom4te.cache/output.0	(revision 1)
+++ /issm/trunk/autom4te.cache/output.0	(revision 1)
@@ -0,0 +1,8744 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.63 for ISSM 1.0.
+@%:@
+@%:@ Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+@%:@ 
+@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+    
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIB@&t@OBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='ISSM'
+PACKAGE_TARNAME='issm'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='ISSM 1.0'
+PACKAGE_BUGREPORT='Eric Larour <eric.larour@jpl.nasa.gov>'
+
+ac_subst_vars='LTLIBOBJS
+LIB@&t@OBJS
+BLACSLIB
+BLACSINCL
+MUMPSLIB
+MUMPSINCL
+PLAPACKLIB
+PLAPACKINCL
+BLASLAPACKINCL
+BLASLAPACKLIB
+SCALAPACKLIB
+SLEPCLIB
+SLEPCINCL
+PETSCLIB
+PETSCINCL
+MPILIB
+MPIINCL
+METISLIB
+METISINCL
+TRIANGLELIB
+TRIANGLEINCL
+LARGEARRAYS_FALSE
+LARGEARRAYS_TRUE
+MATLAB_MINOR
+MATLAB_MAJOR
+MATLAB_VERSION
+MATLAB
+MEXLINK
+MEXLIB
+MEXEXT
+MEX
+MATLABINCL
+NOPARALLEL_FALSE
+NOPARALLEL_TRUE
+NOSERIAL_FALSE
+NOSERIAL_TRUE
+X_EXTRA_LIBS
+X_LIBS
+X_PRE_LIBS
+X_CFLAGS
+CPP
+XMKMF
+FLIBS
+ac_ct_F77
+FFLAGS
+F77
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+RANLIB
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+with_x
+enable_debugging
+with_serial
+with_parallel
+with_matlab_dir
+with_triangle_dir
+with_metis_dir
+with_mpi_lib
+with_mpi_include
+with_petsc_dir
+with_petsc_arch
+with_slepc_dir
+with_scalapack_dir
+with_blas_lapack_dir
+with_plapack_dir
+with_mumps_dir
+with_blacs_dir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+F77
+FFLAGS
+XMKMF
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+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 ISSM 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root @<:@DATAROOTDIR/doc/issm@:>@
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of ISSM 1.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-debugging      turn debug support on
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-x                use the X Window System
+  --with-serial = value   serial compilation.
+  --with-parallel = value parallel compilation.
+  --with-matlab-dir = DIR matlab root directory. necessary for serial build.
+  --with-matlab-dir=ARG   check for Matlab [yes]
+  --with-triangle-dir = DIR 
+                          triangle root directory. necessary for serial build
+  --with-metis-dir = DIR  metis root directory. necessary for serial build
+  --with-mpi-lib = otions mpi options, for ex: "-L$MPIROOT -lmpich
+  --with-mpi-include = DIR 
+                          mpi include directory, necessary for parallel build
+  --with-petsc-dir = DIR  petsc root directory, necessary for parallel build
+  --with-petsc-arch = DIR petsc arch , necessary for parallel build
+  --with-slepc-dir = DIR  slepc root directory
+  --with-scalapack-dir = DIR 
+                          scalapack root directory
+  --with-blas-lapack-dir = DIR 
+                          blas-lapack root directory
+  --with-plapack-dir = DIR 
+                          plapack root directory
+  --with-mumps-dir = DIR  mumps root directory
+  --with-blacs-dir = DIR  blacs root directory
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+ISSM configure 1.0
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+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 ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+@%:@@%:@ ------------------- @%:@@%:@
+@%:@@%:@ File substitutions. @%:@@%:@
+@%:@@%:@ ------------------- @%:@@%:@
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+$as_echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+am__api_version='1.10'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='issm'
+ VERSION='1.0'
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE "$PACKAGE"
+_ACEOF
+
+ 
+cat >>confdefs.h <<_ACEOF
+@%:@define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $@%:@ != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext 
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+@%:@ Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking; 
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ifort g77
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { $as_echo "$as_me:$LINENO: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in ifort g77
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+  G77=yes
+else
+  G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5
+$as_echo_n "checking how to get verbose linking output from $F77... " >&6; }
+if test "${ac_cv_prog_f77_v+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_v=
+# Try some options frequently used verbose output
+for ac_verb in -v -verbose --verbose -V -\#\#\#; do
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_verb"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+  # look for -l* and *.a constructs in the output
+  for ac_arg in $ac_f77_v_output; do
+     case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+          ac_cv_prog_f77_v=$ac_verb
+          break 2 ;;
+     esac
+  done
+done
+if test -z "$ac_cv_prog_f77_v"; then
+   { $as_echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5
+$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;}
+fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: WARNING: compilation failed" >&5
+$as_echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5
+$as_echo "$ac_cv_prog_f77_v" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for Fortran 77 libraries of $F77" >&5
+$as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; }
+if test "${ac_cv_f77_libs+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$FLIBS" != "x"; then
+  ac_cv_f77_libs="$FLIBS" # Let the user override the test.
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+
+ac_cv_f77_libs=
+
+# Save positional arguments (if any)
+ac_save_positional="$@"
+
+set X $ac_f77_v_output
+while test $@%:@ != 1; do
+  shift
+  ac_arg=$1
+  case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+        -bI:*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_arg; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+fi
+
+          ;;
+          # Ignore these flags.
+        -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*)
+          ;;
+        -lkernel32)
+          test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+          ;;
+        -[LRuYz])
+          # These flags, when seen by themselves, take an argument.
+          # We remove the space between option and argument and re-iterate
+          # unless we find an empty arg or a new option (starting with -)
+	  case $2 in
+	     "" | -*);;
+	     *)
+		ac_arg="$ac_arg$2"
+		shift; shift
+		set X $ac_arg "$@"
+		;;
+	  esac
+          ;;
+        -YP,*)
+          for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+              ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_j" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_arg="$ac_arg $ac_j"
+                               ac_cv_f77_libs="$ac_cv_f77_libs $ac_j"
+fi
+
+          done
+          ;;
+        -[lLR]*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+	-zallextract*| -zdefaultextract)
+	  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+	  ;;
+          # Ignore everything else.
+  esac
+done
+# restore positional arguments
+set X $ac_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+   "SunOS 5"*)
+      ac_ld_run_path=`$as_echo "$ac_f77_v_output" |
+                        sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+      test "x$ac_ld_run_path" != x &&
+        if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_ld_run_path; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path"
+fi
+      ;;
+esac
+fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_libs" >&5
+$as_echo "$ac_cv_f77_libs" >&6; }
+FLIBS="$ac_cv_f77_libs"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+  
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+{ $as_echo "$as_me:$LINENO: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+
+@%:@ Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x; 
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5
+$as_echo "$as_me: error: cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl dylib la dll; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl dylib la dll; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { $as_echo "$as_me:$LINENO: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define X_DISPLAY_MISSING 1
+_ACEOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+$as_echo_n "checking whether -R must be followed by a space... " >&6; }
+    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+    ac_xsave_c_werror_flag=$ac_c_werror_flag
+    ac_c_werror_flag=yes
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       X_LIBS="$X_LIBS -R$x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+	  X_LIBS="$X_LIBS -R $x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: result: neither works" >&5
+$as_echo "neither works" >&6; }
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    ac_c_werror_flag=$ac_xsave_c_werror_flag
+    LIBS=$ac_xsave_LIBS
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn Johnson says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And Karl Berry says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 XOpenDisplay ();
+int
+main ()
+{
+return XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+    fi
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_xsave_LIBS"
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to T.E. Dickey.
+    # The functions gethostbyname, getservbyname, and inet_addr are
+    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+    { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5
+$as_echo_n "checking for gethostbyname... " >&6; }
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname innocuous_gethostbyname
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname
+
+/* 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 gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gethostbyname || defined __stub___gethostbyname
+choke me
+#endif
+
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+$as_echo "$ac_cv_func_gethostbyname" >&6; }
+
+    if test $ac_cv_func_gethostbyname = no; then
+      { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_nsl_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+	{ $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_bsd_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
+$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
+if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+      fi
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says Simon Leinen: it contains gethostby*
+    # variants that don't use the name server (or something).  -lsocket
+    # must be given before -lnsl if both are needed.  We assume that
+    # if connect needs -lnsl, so does gethostbyname.
+    { $as_echo "$as_me:$LINENO: checking for connect" >&5
+$as_echo_n "checking for connect... " >&6; }
+if test "${ac_cv_func_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef connect
+
+/* 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 connect ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_connect || defined __stub___connect
+choke me
+#endif
+
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+$as_echo "$ac_cv_func_connect" >&6; }
+
+    if test $ac_cv_func_connect = no; then
+      { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+$as_echo_n "checking for connect in -lsocket... " >&6; }
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 connect ();
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_socket_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_socket_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+$as_echo "$ac_cv_lib_socket_connect" >&6; }
+if test "x$ac_cv_lib_socket_connect" = x""yes; then
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    { $as_echo "$as_me:$LINENO: checking for remove" >&5
+$as_echo_n "checking for remove... " >&6; }
+if test "${ac_cv_func_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define remove innocuous_remove
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef remove
+
+/* 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 remove ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_remove || defined __stub___remove
+choke me
+#endif
+
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+$as_echo "$ac_cv_func_remove" >&6; }
+
+    if test $ac_cv_func_remove = no; then
+      { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5
+$as_echo_n "checking for remove in -lposix... " >&6; }
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 remove ();
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_posix_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_posix_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
+$as_echo "$ac_cv_lib_posix_remove" >&6; }
+if test "x$ac_cv_lib_posix_remove" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    { $as_echo "$as_me:$LINENO: checking for shmat" >&5
+$as_echo_n "checking for shmat... " >&6; }
+if test "${ac_cv_func_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shmat innocuous_shmat
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shmat
+
+/* 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 shmat ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shmat || defined __stub___shmat
+choke me
+#endif
+
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+$as_echo "$ac_cv_func_shmat" >&6; }
+
+    if test $ac_cv_func_shmat = no; then
+      { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
+$as_echo_n "checking for shmat in -lipc... " >&6; }
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 shmat ();
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ipc_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ipc_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
+$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
+if test "x$ac_cv_lib_ipc_shmat" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
+$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 IceConnectionNumber ();
+int
+main ()
+{
+return IceConnectionNumber ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+  LDFLAGS=$ac_save_LDFLAGS
+
+fi
+
+
+ax_enable_matlab=
+
+@%:@ Check whether --with-matlab-dir was given.
+if test "${with_matlab_dir+set}" = set; then
+  withval=$with_matlab_dir; case $withval in
+  yes | no)
+    # Explicitly enable or disable Matlab but determine
+    # Matlab prefix automatically.
+    ax_enable_matlab=$withval
+    ;;
+  *)
+    # Enable Matlab and use ARG as the Matlab prefix.
+    # ARG must be an existing directory.
+    ax_enable_matlab=yes
+    MATLAB=`cd "${withval-/}" > /dev/null 2>&1 && pwd`
+    if test -z "$MATLAB" ; then
+	{ { $as_echo "$as_me:$LINENO: error: invalid value '$withval' for --with-matlab" >&5
+$as_echo "$as_me: error: invalid value '$withval' for --with-matlab" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    ;;
+esac
+fi
+
+if test x$ax_enable_matlab != xno ; then
+{ $as_echo "$as_me:$LINENO: checking for Matlab prefix" >&5
+$as_echo_n "checking for Matlab prefix... " >&6; }
+if test "${ax_cv_matlab+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "${MATLAB+set}" = set ; then
+    ax_cv_matlab=`cd "${MATLAB-/}" > /dev/null 2>&1 && pwd`
+else
+    ax_cv_matlab=
+    IFS=${IFS= 	} ; ax_ifs=$IFS ; IFS=:
+    for ax_dir in ${PATH-/opt/bin:/usr/local/bin:/usr/bin:/bin} ; do
+	if test -z "$ax_dir" ; then
+	    ax_dir=.
+	fi
+	if test -x "$ax_dir/matlab" ; then
+	    ax_dir=`echo "$ax_dir" | sed 's,/bin$,,'`
+	    # Directory sanity check.
+	    ax_cv_matlab=`cd "${ax_dir-/}" > /dev/null 2>&1 && pwd`
+	    if test -n "$ax_cv_matlab" ; then
+		break
+	    fi
+	fi
+    done
+    IFS=$ax_ifs
+fi
+if test -z "$ax_cv_matlab" ; then
+    ax_cv_matlab="not found"
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_matlab" >&5
+$as_echo "$ax_cv_matlab" >&6; }
+if test "$ax_cv_matlab" = "not found" ; then
+    unset MATLAB
+else
+    # Strip trailing dashes.
+    MATLAB=`echo "$ax_cv_matlab" | sed 's,/*$,,'`
+fi
+{ $as_echo "$as_me:$LINENO: checking whether to enable Matlab support" >&5
+$as_echo_n "checking whether to enable Matlab support... " >&6; }
+if test x$ax_enable_matlab != xno ; then
+    if test "${MATLAB+set}" = set && test -d "$MATLAB/extern/include" ; then
+	ax_enable_matlab=yes
+    elif test x$ax_enable_matlab = x ; then
+	ax_enable_matlab=no
+    else
+	# Fail if Matlab was explicitly enabled.
+	{ $as_echo "$as_me:$LINENO: result: failure" >&5
+$as_echo "failure" >&6; }
+	{ { $as_echo "$as_me:$LINENO: error: check your Matlab setup" >&5
+$as_echo "$as_me: error: check your Matlab setup" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_enable_matlab" >&5
+$as_echo "$ax_enable_matlab" >&6; }
+if test x$ax_enable_matlab = xyes ; then
+    
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_MATLAB 1
+_ACEOF
+
+fi
+fi
+
+
+
+		@%:@ Check whether --enable-debugging was given.
+if test "${enable_debugging+set}" = set; then
+  enableval=$enable_debugging; enable_debugging=$enableval
+else
+  enable_debugging=no
+fi
+
+	if test "x$enable_debugging" = xyes; then
+	 
+cat >>confdefs.h <<\_ACEOF
+@%:@define _DEBUG_ 1
+_ACEOF
+
+	fi
+
+		
+@%:@ Check whether --with-serial was given.
+if test "${with_serial+set}" = set; then
+  withval=$with_serial; SERIAL_VALUE=$withval
+else
+  SERIAL_VALUE="yes"
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for serial compilation" >&5
+$as_echo_n "checking for serial compilation... " >&6; }
+	 if test $SERIAL_VALUE = no; then
+  NOSERIAL_TRUE=
+  NOSERIAL_FALSE='#'
+else
+  NOSERIAL_TRUE='#'
+  NOSERIAL_FALSE=
+fi
+
+	{ $as_echo "$as_me:$LINENO: result: $SERIAL_VALUE" >&5
+$as_echo "$SERIAL_VALUE" >&6; } 
+	
+
+		
+@%:@ Check whether --with-parallel was given.
+if test "${with_parallel+set}" = set; then
+  withval=$with_parallel; PARALLEL_VALUE=$withval
+else
+  PARALLEL_VALUE="yes"
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for parallel compilation" >&5
+$as_echo_n "checking for parallel compilation... " >&6; }
+	 if test $PARALLEL_VALUE = no; then
+  NOPARALLEL_TRUE=
+  NOPARALLEL_FALSE='#'
+else
+  NOPARALLEL_TRUE='#'
+  NOPARALLEL_FALSE=
+fi
+
+	{ $as_echo "$as_me:$LINENO: result: $PARALLEL_VALUE" >&5
+$as_echo "$PARALLEL_VALUE" >&6; } 
+
+		if test "$SERIAL_VALUE" != "yes" ; then
+		if test "$PARALLEL_VALUE" != "yes"; then
+		{ { $as_echo "$as_me:$LINENO: error: cannot request --with-serial=no and --with-parallel=no at the same time!" >&5
+$as_echo "$as_me: error: cannot request --with-serial=no and --with-parallel=no at the same time!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+
+		
+@%:@ Check whether --with-matlab-dir was given.
+if test "${with_matlab_dir+set}" = set; then
+  withval=$with_matlab_dir; MATLAB_ROOT=$withval
+else
+  MATLAB_ROOT=""
+fi
+ 
+	
+	if test -d "$MATLAB_ROOT"; then
+
+		{ $as_echo "$as_me:$LINENO: checking for Matlab headers and libraries in $MATLAB_ROOT" >&5
+$as_echo_n "checking for Matlab headers and libraries in $MATLAB_ROOT... " >&6; }
+
+				HAVE_MATLAB=yes
+		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
+				MEXEXT=`$MATLAB_ROOT/bin/mexext`
+		MEXEXT=".$MEXEXT"
+		MEX=$MATLAB_ROOT/bin/mex
+
+				case "${host_os}" in
+			*linux*)
+			if test "${host_cpu}" = "x86_64";
+			then
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnxa64/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
+			else
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
+			fi
+			;;
+		esac
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MATLAB_ 1
+_ACEOF
+
+		
+		
+		
+		 
+		
+	
+		{ $as_echo "$as_me:$LINENO: result: $HAVE_MATLAB" >&5
+$as_echo "$HAVE_MATLAB" >&6; }
+	else
+		HAVE_MATLAB=no
+	fi
+
+	
+	if test $HAVE_MATLAB = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: --with-matlab-dir  missing. Matlab is needed to run ISSM serially!" >&5
+$as_echo "$as_me: error: --with-matlab-dir  missing. Matlab is needed to run ISSM serially!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+		if test $HAVE_MATLAB = yes; then
+
+		
+
+
+{ $as_echo "$as_me:$LINENO: checking for Matlab version" >&5
+$as_echo_n "checking for Matlab version... " >&6; }
+if test "${ax_cv_matlab_version+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "${MATLAB_VERSION+set}" = set ; then
+    ax_cv_matlab_version=$MATLAB_VERSION
+else
+    ax_cv_matlab_version=
+    # Loop over all known architectures.  The final dot covers
+    # Matlab R11 and Matlab V4 for Windows.
+    for ax_arch in alpha glnxa64 glnx86 hp700 hpux ibm_rs sgi sol2 win32 mac maci . ; do
+        for ax_exec_name in matlab$EXEEXT MATLAB ; do
+		ax_matlab_exec=$MATLAB/bin/$ax_arch/${ax_exec_name}
+		if test -f $ax_matlab_exec ; then
+	    		# For Matlab R12, the version number is stored in a
+	    		# shared library.
+	    		ax_matlab_exec_2=`find $MATLAB/bin/$ax_arch -type f -name libmwservices\* -print 2> /dev/null`
+	    		if test -n "$ax_matlab_exec_2" ; then
+				ax_cv_matlab_version=`strings $ax_matlab_exec_2 2> /dev/null | egrep '^\|build_version_\|@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^|build_version_|\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+				if test -n "$ax_cv_matlab_version" ; then
+		    			break
+				fi
+	    		fi
+	    		# For Matlab R11 and Matlab V4, the version number
+	    		# is stored in the executable program.
+	    		ax_cv_matlab_version=`strings $ax_matlab_exec 2> /dev/null | egrep '^@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+	    		if test -n "$ax_cv_matlab_version" ; then
+				break
+	    		fi
+		fi
+    	done
+	if test -n "$ax_cv_matlab_version" ; then
+		break
+	fi
+    done
+    if test -z "$ax_cv_matlab_version" ; then
+	ax_cv_matlab_version="not found"
+    fi
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_matlab_version" >&5
+$as_echo "$ax_cv_matlab_version" >&6; }
+case $ax_cv_matlab_version in
+  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
+    MATLAB_VERSION=$ax_cv_matlab_version
+    MATLAB_MAJOR=`echo $MATLAB_VERSION | sed -e 's/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/'`
+    MATLAB_MINOR=`echo $MATLAB_VERSION | sed -e 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
+    ;;
+  *)
+    if test x$ax_enable_matlab = xyes ; then
+	{ { $as_echo "$as_me:$LINENO: error: can not determine Matlab version number" >&5
+$as_echo "$as_me: error: can not determine Matlab version number" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    MATLAB_VERSION=
+    MATLAB_MAJOR=
+    MATLAB_MINOR=
+    ;;
+esac
+
+
+
+if test x$MATLAB_VERSION != x ; then
+    
+cat >>confdefs.h <<_ACEOF
+@%:@define MATLAB_MAJOR $MATLAB_MAJOR
+_ACEOF
+
+    
+cat >>confdefs.h <<_ACEOF
+@%:@define MATLAB_MINOR $MATLAB_MINOR
+_ACEOF
+
+fi
+
+		
+						largearrays=no
+		if test $MATLAB_MAJOR -ge 7; then 
+			if test $MATLAB_MINOR -ge 5; then 
+				if test "${host_cpu}" = "x86_64"; then
+					largearrays=yes
+				fi
+			fi
+		fi
+	fi
+	 if test x$largearrays = xyes; then
+  LARGEARRAYS_TRUE=
+  LARGEARRAYS_FALSE='#'
+else
+  LARGEARRAYS_TRUE='#'
+  LARGEARRAYS_FALSE=
+fi
+
+	
+		
+@%:@ Check whether --with-triangle-dir was given.
+if test "${with_triangle_dir+set}" = set; then
+  withval=$with_triangle_dir; TRIANGLE_ROOT=$withval
+else
+  TRIANGLE_ROOT=""
+fi
+ 
+	{ $as_echo "$as_me:$LINENO: checking for Triangle headers and libraries " >&5
+$as_echo_n "checking for Triangle headers and libraries ... " >&6; }
+	if test -d "$TRIANGLE_ROOT"; then
+
+
+				HAVE_TRIANGLE=yes
+		TRIANGLEINCL=-I$TRIANGLE_ROOT/
+		TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_TRIANGLE_ 1
+_ACEOF
+
+		
+		
+
+	else
+		HAVE_TRIANGLE=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_TRIANGLE" >&5
+$as_echo "$HAVE_TRIANGLE" >&6; }
+
+	{ $as_echo "$as_me:$LINENO: checking for triangle and parallel status" >&5
+$as_echo_n "checking for triangle and parallel status... " >&6; }
+	if test $HAVE_TRIANGLE = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: --with-triangle-dir  missing. Triangle is needed to run ISSM serially!" >&5
+$as_echo "$as_me: error: --with-triangle-dir  missing. Triangle is needed to run ISSM serially!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	{ $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+	
+		
+		
+@%:@ Check whether --with-metis-dir was given.
+if test "${with_metis_dir+set}" = set; then
+  withval=$with_metis_dir; METIS_ROOT=$withval
+else
+  METIS_ROOT=""
+fi
+
+
+	if test -d "$METIS_ROOT"; then
+
+		{ $as_echo "$as_me:$LINENO: checking for Metis headers and libraries in $METIS_ROOT" >&5
+$as_echo_n "checking for Metis headers and libraries in $METIS_ROOT... " >&6; }
+
+				HAVE_METIS=yes
+		METISINCL=-I"$METIS_ROOT/Lib"
+		METISLIB=-L"$METIS_ROOT/ -lmetis"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_METIS_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_METIS=no
+	fi
+
+	if test $HAVE_METIS = no; then
+	{ { $as_echo "$as_me:$LINENO: error: --with-metis-dir  missing. Metis is needed to run ISSM" >&5
+$as_echo "$as_me: error: --with-metis-dir  missing. Metis is needed to run ISSM" >&2;}
+   { (exit 1); exit 1; }; };
+	else
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_METIS" >&5
+$as_echo "$HAVE_METIS" >&6; }
+	fi
+
+		{ $as_echo "$as_me:$LINENO: checking for mpi..." >&5
+$as_echo_n "checking for mpi...... " >&6; }
+	
+@%:@ Check whether --with-mpi-lib was given.
+if test "${with_mpi_lib+set}" = set; then
+  withval=$with_mpi_lib; MPILIB=$withval
+else
+  MPILIB=""
+fi
+
+	
+	
+@%:@ Check whether --with-mpi-include was given.
+if test "${with_mpi_include+set}" = set; then
+  withval=$with_mpi_include; MPI_INCLUDE=$withval
+else
+  MPI_INCLUDE=""
+fi
+
+
+		if test -z "$MPILIB" ; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	else
+		if test -z "$MPI_INCLUDE" ; then
+			if test "$PARALLEL_VALUE" = "yes" ; then
+				{ { $as_echo "$as_me:$LINENO: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+			fi
+		else
+			HAVE_MPI=yes
+			MPIINCL=-I"$MPI_INCLUDE/"
+			
+			
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MPI_ 1
+_ACEOF
+
+			
+			
+		fi
+	fi
+	{ $as_echo "$as_me:$LINENO: result: done" >&5
+$as_echo "done" >&6; }
+
+		
+@%:@ Check whether --with-petsc-dir was given.
+if test "${with_petsc_dir+set}" = set; then
+  withval=$with_petsc_dir; PETSC_ROOT=$withval
+else
+  PETSC_ROOT=""
+fi
+
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ROOT" = "" ; then
+			{ { $as_echo "$as_me:$LINENO: error: missing --with-petsc-dir argument for parallel compilation!" >&5
+$as_echo "$as_me: error: missing --with-petsc-dir argument for parallel compilation!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	
+	
+@%:@ Check whether --with-petsc-arch was given.
+if test "${with_petsc_arch+set}" = set; then
+  withval=$with_petsc_arch; PETSC_ARCH=$withval
+else
+  PETSC_ARCH=""
+fi
+
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ARCH" = "" ; then
+			{ { $as_echo "$as_me:$LINENO: error: missing --with-petsc-arch argument for parallel compilation!" >&5
+$as_echo "$as_me: error: missing --with-petsc-arch argument for parallel compilation!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	
+	{ $as_echo "$as_me:$LINENO: checking for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH" >&5
+$as_echo_n "checking for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH... " >&6; }
+	
+	if test -d "$PETSC_ROOT"; then
+
+		if test -d "$PETSC_ROOT/bmake/$PETSC_ARCH"; then
+		
+			PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
+			PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+			                          
+
+
+			
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_PETSC_ 1
+_ACEOF
+
+			
+			
+
+			HAVE_PETSC=yes
+		else
+			HAVE_PETSC=no
+		fi
+	else
+		HAVE_PETSC=no
+	fi
+
+	if test $HAVE_PETSC = no; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	else
+		{ $as_echo "$as_me:$LINENO: result: $HAVE_PETSC" >&5
+$as_echo "$HAVE_PETSC" >&6; }
+	fi
+
+
+		
+@%:@ Check whether --with-slepc-dir was given.
+if test "${with_slepc_dir+set}" = set; then
+  withval=$with_slepc_dir; SLEPC_ROOT=$withval
+else
+  SLEPC_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Slepc headers and libraries in $SLEPC_ROOT" >&5
+$as_echo_n "checking for Slepc headers and libraries in $SLEPC_ROOT... " >&6; }
+	if test -d "$SLEPC_ROOT"; then
+
+
+				HAVE_SLEPC=yes
+		SLEPCINCL=-I"$SLEPC_ROOT/include"
+		SLEPCLIB=-L"$SLEPC_ROOT/lib/ -lslepc"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_SLEPC_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_SLEPC=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_SLEPC" >&5
+$as_echo "$HAVE_SLEPC" >&6; }
+	
+		
+@%:@ Check whether --with-scalapack-dir was given.
+if test "${with_scalapack_dir+set}" = set; then
+  withval=$with_scalapack_dir; SCALAPACK_ROOT=$withval
+else
+  SCALAPACK_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Scalapack headers and libraries in $SCALAPACK_ROOT" >&5
+$as_echo_n "checking for Scalapack headers and libraries in $SCALAPACK_ROOT... " >&6; }
+	if test -d "$SCALAPACK_ROOT"; then
+
+
+				HAVE_SCALAPACK=yes
+		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_SCALAPACK_ 1
+_ACEOF
+
+		
+	else
+		HAVE_SCALAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_SCALAPACK" >&5
+$as_echo "$HAVE_SCALAPACK" >&6; }
+
+		
+@%:@ Check whether --with-blas-lapack-dir was given.
+if test "${with_blas_lapack_dir+set}" = set; then
+  withval=$with_blas_lapack_dir; BLASLAPACK_ROOT=$withval
+else
+  BLASLAPACK_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT" >&5
+$as_echo_n "checking for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT... " >&6; }
+	if test -d "$BLASLAPACK_ROOT"; then
+
+
+				HAVE_BLASLAPACK=yes
+		BLASLAPACKINCL=""
+		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_BLASLAPACK_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_BLASLAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_BLASLAPACK" >&5
+$as_echo "$HAVE_BLASLAPACK" >&6; }
+
+
+		
+@%:@ Check whether --with-plapack-dir was given.
+if test "${with_plapack_dir+set}" = set; then
+  withval=$with_plapack_dir; PLAPACK_ROOT=$withval
+else
+  PLAPACK_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Plapack headers and libraries in $PLAPACK_ROOT" >&5
+$as_echo_n "checking for Plapack headers and libraries in $PLAPACK_ROOT... " >&6; }
+	if test -d "$PLAPACK_ROOT"; then
+
+
+				HAVE_PLAPACK=yes
+		PLAPACKINCL=-I"$PLAPACK_ROOT/INCLUDE"
+		PLAPACKLIB=-L"$PLAPACK_ROOT/ -lPLAPACK"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_PLAPACK_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_PLAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_PLAPACK" >&5
+$as_echo "$HAVE_PLAPACK" >&6; }
+
+		
+@%:@ Check whether --with-mumps-dir was given.
+if test "${with_mumps_dir+set}" = set; then
+  withval=$with_mumps_dir; MUMPS_ROOT=$withval
+else
+  MUMPS_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Mumps headers and libraries in $MUMPS_ROOT" >&5
+$as_echo_n "checking for Mumps headers and libraries in $MUMPS_ROOT... " >&6; }
+	if test -d "$MUMPS_ROOT"; then
+
+				HAVE_MUMPS=yes
+		MUMPSINCL=-I"$MUMPS_ROOT/include"
+		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps -lpord"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MUMPS_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_MUMPS=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_MUMPS" >&5
+$as_echo "$HAVE_MUMPS" >&6; }
+
+		
+@%:@ Check whether --with-blacs-dir was given.
+if test "${with_blacs_dir+set}" = set; then
+  withval=$with_blacs_dir; BLACS_ROOT=$withval
+else
+  BLACS_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Blacs headers and libraries in $BLACS_ROOT" >&5
+$as_echo_n "checking for Blacs headers and libraries in $BLACS_ROOT... " >&6; }
+	if test -d "$BLACS_ROOT"; then
+
+				HAVE_BLACS=yes
+		BLACSINCL=""
+		BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
+        
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_BLACS_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_BLACS=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_BLACS" >&5
+$as_echo "$HAVE_BLACS" >&6; }
+
+
+
+
+
+ac_config_files="$ac_config_files Makefile src/Makefile src/c/Makefile src/mex/Makefile bin/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIB@&t@OBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NOSERIAL_TRUE}" && test -z "${NOSERIAL_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"NOSERIAL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"NOSERIAL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NOPARALLEL_TRUE}" && test -z "${NOPARALLEL_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"NOPARALLEL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"NOPARALLEL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${LARGEARRAYS_TRUE}" && test -z "${LARGEARRAYS_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"LARGEARRAYS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"LARGEARRAYS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE] 
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE] 
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+ISSM config.status 1.0
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "src/c/Makefile") CONFIG_FILES="$CONFIG_FILES src/c/Makefile" ;;
+    "src/mex/Makefile") CONFIG_FILES="$CONFIG_FILES src/mex/Makefile" ;;
+    "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
+'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+  
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
Index: /issm/trunk/autom4te.cache/output.1
===================================================================
--- /issm/trunk/autom4te.cache/output.1	(revision 1)
+++ /issm/trunk/autom4te.cache/output.1	(revision 1)
@@ -0,0 +1,8744 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.63 for ISSM 1.0.
+@%:@
+@%:@ Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+@%:@ 
+@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+    
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIB@&t@OBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='ISSM'
+PACKAGE_TARNAME='issm'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='ISSM 1.0'
+PACKAGE_BUGREPORT='Eric Larour <eric.larour@jpl.nasa.gov>'
+
+ac_subst_vars='LTLIBOBJS
+LIB@&t@OBJS
+BLACSLIB
+BLACSINCL
+MUMPSLIB
+MUMPSINCL
+PLAPACKLIB
+PLAPACKINCL
+BLASLAPACKINCL
+BLASLAPACKLIB
+SCALAPACKLIB
+SLEPCLIB
+SLEPCINCL
+PETSCLIB
+PETSCINCL
+MPILIB
+MPIINCL
+METISLIB
+METISINCL
+TRIANGLELIB
+TRIANGLEINCL
+LARGEARRAYS_FALSE
+LARGEARRAYS_TRUE
+MATLAB_MINOR
+MATLAB_MAJOR
+MATLAB_VERSION
+MATLAB
+MEXLINK
+MEXLIB
+MEXEXT
+MEX
+MATLABINCL
+NOPARALLEL_FALSE
+NOPARALLEL_TRUE
+NOSERIAL_FALSE
+NOSERIAL_TRUE
+X_EXTRA_LIBS
+X_LIBS
+X_PRE_LIBS
+X_CFLAGS
+CPP
+XMKMF
+FLIBS
+ac_ct_F77
+FFLAGS
+F77
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+RANLIB
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+with_x
+enable_debugging
+with_serial
+with_parallel
+with_matlab_dir
+with_triangle_dir
+with_metis_dir
+with_mpi_lib
+with_mpi_include
+with_petsc_dir
+with_petsc_arch
+with_slepc_dir
+with_scalapack_dir
+with_blas_lapack_dir
+with_plapack_dir
+with_mumps_dir
+with_blacs_dir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+F77
+FFLAGS
+XMKMF
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+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 ISSM 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root @<:@DATAROOTDIR/doc/issm@:>@
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of ISSM 1.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-debugging      turn debug support on
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-x                use the X Window System
+  --with-serial = value   serial compilation.
+  --with-parallel = value parallel compilation.
+  --with-matlab-dir = DIR matlab root directory. necessary for serial build.
+  --with-matlab-dir=ARG   check for Matlab [yes]
+  --with-triangle-dir = DIR 
+                          triangle root directory. necessary for serial build
+  --with-metis-dir = DIR  metis root directory. necessary for serial build
+  --with-mpi-lib = otions mpi options, for ex: "-L$MPIROOT -lmpich
+  --with-mpi-include = DIR 
+                          mpi include directory, necessary for parallel build
+  --with-petsc-dir = DIR  petsc root directory, necessary for parallel build
+  --with-petsc-arch = DIR petsc arch , necessary for parallel build
+  --with-slepc-dir = DIR  slepc root directory
+  --with-scalapack-dir = DIR 
+                          scalapack root directory
+  --with-blas-lapack-dir = DIR 
+                          blas-lapack root directory
+  --with-plapack-dir = DIR 
+                          plapack root directory
+  --with-mumps-dir = DIR  mumps root directory
+  --with-blacs-dir = DIR  blacs root directory
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+ISSM configure 1.0
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+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 ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+@%:@@%:@ ------------------- @%:@@%:@
+@%:@@%:@ File substitutions. @%:@@%:@
+@%:@@%:@ ------------------- @%:@@%:@
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+$as_echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+am__api_version='1.10'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='issm'
+ VERSION='1.0'
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE "$PACKAGE"
+_ACEOF
+
+ 
+cat >>confdefs.h <<_ACEOF
+@%:@define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $@%:@ != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext 
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+@%:@ Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking; 
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ifort g77
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { $as_echo "$as_me:$LINENO: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in ifort g77
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+  G77=yes
+else
+  G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5
+$as_echo_n "checking how to get verbose linking output from $F77... " >&6; }
+if test "${ac_cv_prog_f77_v+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_v=
+# Try some options frequently used verbose output
+for ac_verb in -v -verbose --verbose -V -\#\#\#; do
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_verb"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+  # look for -l* and *.a constructs in the output
+  for ac_arg in $ac_f77_v_output; do
+     case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+          ac_cv_prog_f77_v=$ac_verb
+          break 2 ;;
+     esac
+  done
+done
+if test -z "$ac_cv_prog_f77_v"; then
+   { $as_echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5
+$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;}
+fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: WARNING: compilation failed" >&5
+$as_echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5
+$as_echo "$ac_cv_prog_f77_v" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for Fortran 77 libraries of $F77" >&5
+$as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; }
+if test "${ac_cv_f77_libs+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$FLIBS" != "x"; then
+  ac_cv_f77_libs="$FLIBS" # Let the user override the test.
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+
+ac_cv_f77_libs=
+
+# Save positional arguments (if any)
+ac_save_positional="$@"
+
+set X $ac_f77_v_output
+while test $@%:@ != 1; do
+  shift
+  ac_arg=$1
+  case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+        -bI:*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_arg; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+fi
+
+          ;;
+          # Ignore these flags.
+        -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*)
+          ;;
+        -lkernel32)
+          test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+          ;;
+        -[LRuYz])
+          # These flags, when seen by themselves, take an argument.
+          # We remove the space between option and argument and re-iterate
+          # unless we find an empty arg or a new option (starting with -)
+	  case $2 in
+	     "" | -*);;
+	     *)
+		ac_arg="$ac_arg$2"
+		shift; shift
+		set X $ac_arg "$@"
+		;;
+	  esac
+          ;;
+        -YP,*)
+          for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+              ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_j" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_arg="$ac_arg $ac_j"
+                               ac_cv_f77_libs="$ac_cv_f77_libs $ac_j"
+fi
+
+          done
+          ;;
+        -[lLR]*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+	-zallextract*| -zdefaultextract)
+	  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+	  ;;
+          # Ignore everything else.
+  esac
+done
+# restore positional arguments
+set X $ac_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+   "SunOS 5"*)
+      ac_ld_run_path=`$as_echo "$ac_f77_v_output" |
+                        sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+      test "x$ac_ld_run_path" != x &&
+        if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_ld_run_path; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path"
+fi
+      ;;
+esac
+fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_libs" >&5
+$as_echo "$ac_cv_f77_libs" >&6; }
+FLIBS="$ac_cv_f77_libs"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+  
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+{ $as_echo "$as_me:$LINENO: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+
+@%:@ Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x; 
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5
+$as_echo "$as_me: error: cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl dylib la dll; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl dylib la dll; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { $as_echo "$as_me:$LINENO: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define X_DISPLAY_MISSING 1
+_ACEOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+$as_echo_n "checking whether -R must be followed by a space... " >&6; }
+    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+    ac_xsave_c_werror_flag=$ac_c_werror_flag
+    ac_c_werror_flag=yes
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       X_LIBS="$X_LIBS -R$x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+	  X_LIBS="$X_LIBS -R $x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: result: neither works" >&5
+$as_echo "neither works" >&6; }
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    ac_c_werror_flag=$ac_xsave_c_werror_flag
+    LIBS=$ac_xsave_LIBS
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn Johnson says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And Karl Berry says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 XOpenDisplay ();
+int
+main ()
+{
+return XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+    fi
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_xsave_LIBS"
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to T.E. Dickey.
+    # The functions gethostbyname, getservbyname, and inet_addr are
+    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+    { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5
+$as_echo_n "checking for gethostbyname... " >&6; }
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname innocuous_gethostbyname
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname
+
+/* 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 gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gethostbyname || defined __stub___gethostbyname
+choke me
+#endif
+
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+$as_echo "$ac_cv_func_gethostbyname" >&6; }
+
+    if test $ac_cv_func_gethostbyname = no; then
+      { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_nsl_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+	{ $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_bsd_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
+$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
+if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+      fi
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says Simon Leinen: it contains gethostby*
+    # variants that don't use the name server (or something).  -lsocket
+    # must be given before -lnsl if both are needed.  We assume that
+    # if connect needs -lnsl, so does gethostbyname.
+    { $as_echo "$as_me:$LINENO: checking for connect" >&5
+$as_echo_n "checking for connect... " >&6; }
+if test "${ac_cv_func_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef connect
+
+/* 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 connect ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_connect || defined __stub___connect
+choke me
+#endif
+
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+$as_echo "$ac_cv_func_connect" >&6; }
+
+    if test $ac_cv_func_connect = no; then
+      { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+$as_echo_n "checking for connect in -lsocket... " >&6; }
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 connect ();
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_socket_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_socket_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+$as_echo "$ac_cv_lib_socket_connect" >&6; }
+if test "x$ac_cv_lib_socket_connect" = x""yes; then
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    { $as_echo "$as_me:$LINENO: checking for remove" >&5
+$as_echo_n "checking for remove... " >&6; }
+if test "${ac_cv_func_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define remove innocuous_remove
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef remove
+
+/* 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 remove ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_remove || defined __stub___remove
+choke me
+#endif
+
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+$as_echo "$ac_cv_func_remove" >&6; }
+
+    if test $ac_cv_func_remove = no; then
+      { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5
+$as_echo_n "checking for remove in -lposix... " >&6; }
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 remove ();
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_posix_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_posix_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
+$as_echo "$ac_cv_lib_posix_remove" >&6; }
+if test "x$ac_cv_lib_posix_remove" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    { $as_echo "$as_me:$LINENO: checking for shmat" >&5
+$as_echo_n "checking for shmat... " >&6; }
+if test "${ac_cv_func_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shmat innocuous_shmat
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shmat
+
+/* 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 shmat ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shmat || defined __stub___shmat
+choke me
+#endif
+
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+$as_echo "$ac_cv_func_shmat" >&6; }
+
+    if test $ac_cv_func_shmat = no; then
+      { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
+$as_echo_n "checking for shmat in -lipc... " >&6; }
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 shmat ();
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ipc_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ipc_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
+$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
+if test "x$ac_cv_lib_ipc_shmat" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
+$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 IceConnectionNumber ();
+int
+main ()
+{
+return IceConnectionNumber ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+  LDFLAGS=$ac_save_LDFLAGS
+
+fi
+
+
+ax_enable_matlab=
+
+@%:@ Check whether --with-matlab-dir was given.
+if test "${with_matlab_dir+set}" = set; then
+  withval=$with_matlab_dir; case $withval in
+  yes | no)
+    # Explicitly enable or disable Matlab but determine
+    # Matlab prefix automatically.
+    ax_enable_matlab=$withval
+    ;;
+  *)
+    # Enable Matlab and use ARG as the Matlab prefix.
+    # ARG must be an existing directory.
+    ax_enable_matlab=yes
+    MATLAB=`cd "${withval-/}" > /dev/null 2>&1 && pwd`
+    if test -z "$MATLAB" ; then
+	{ { $as_echo "$as_me:$LINENO: error: invalid value '$withval' for --with-matlab" >&5
+$as_echo "$as_me: error: invalid value '$withval' for --with-matlab" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    ;;
+esac
+fi
+
+if test x$ax_enable_matlab != xno ; then
+{ $as_echo "$as_me:$LINENO: checking for Matlab prefix" >&5
+$as_echo_n "checking for Matlab prefix... " >&6; }
+if test "${ax_cv_matlab+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "${MATLAB+set}" = set ; then
+    ax_cv_matlab=`cd "${MATLAB-/}" > /dev/null 2>&1 && pwd`
+else
+    ax_cv_matlab=
+    IFS=${IFS= 	} ; ax_ifs=$IFS ; IFS=:
+    for ax_dir in ${PATH-/opt/bin:/usr/local/bin:/usr/bin:/bin} ; do
+	if test -z "$ax_dir" ; then
+	    ax_dir=.
+	fi
+	if test -x "$ax_dir/matlab" ; then
+	    ax_dir=`echo "$ax_dir" | sed 's,/bin$,,'`
+	    # Directory sanity check.
+	    ax_cv_matlab=`cd "${ax_dir-/}" > /dev/null 2>&1 && pwd`
+	    if test -n "$ax_cv_matlab" ; then
+		break
+	    fi
+	fi
+    done
+    IFS=$ax_ifs
+fi
+if test -z "$ax_cv_matlab" ; then
+    ax_cv_matlab="not found"
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_matlab" >&5
+$as_echo "$ax_cv_matlab" >&6; }
+if test "$ax_cv_matlab" = "not found" ; then
+    unset MATLAB
+else
+    # Strip trailing dashes.
+    MATLAB=`echo "$ax_cv_matlab" | sed 's,/*$,,'`
+fi
+{ $as_echo "$as_me:$LINENO: checking whether to enable Matlab support" >&5
+$as_echo_n "checking whether to enable Matlab support... " >&6; }
+if test x$ax_enable_matlab != xno ; then
+    if test "${MATLAB+set}" = set && test -d "$MATLAB/extern/include" ; then
+	ax_enable_matlab=yes
+    elif test x$ax_enable_matlab = x ; then
+	ax_enable_matlab=no
+    else
+	# Fail if Matlab was explicitly enabled.
+	{ $as_echo "$as_me:$LINENO: result: failure" >&5
+$as_echo "failure" >&6; }
+	{ { $as_echo "$as_me:$LINENO: error: check your Matlab setup" >&5
+$as_echo "$as_me: error: check your Matlab setup" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_enable_matlab" >&5
+$as_echo "$ax_enable_matlab" >&6; }
+if test x$ax_enable_matlab = xyes ; then
+    
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_MATLAB 1
+_ACEOF
+
+fi
+fi
+
+
+
+		@%:@ Check whether --enable-debugging was given.
+if test "${enable_debugging+set}" = set; then
+  enableval=$enable_debugging; enable_debugging=$enableval
+else
+  enable_debugging=no
+fi
+
+	if test "x$enable_debugging" = xyes; then
+	 
+cat >>confdefs.h <<\_ACEOF
+@%:@define _DEBUG_ 1
+_ACEOF
+
+	fi
+
+		
+@%:@ Check whether --with-serial was given.
+if test "${with_serial+set}" = set; then
+  withval=$with_serial; SERIAL_VALUE=$withval
+else
+  SERIAL_VALUE="yes"
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for serial compilation" >&5
+$as_echo_n "checking for serial compilation... " >&6; }
+	 if test $SERIAL_VALUE = no; then
+  NOSERIAL_TRUE=
+  NOSERIAL_FALSE='#'
+else
+  NOSERIAL_TRUE='#'
+  NOSERIAL_FALSE=
+fi
+
+	{ $as_echo "$as_me:$LINENO: result: $SERIAL_VALUE" >&5
+$as_echo "$SERIAL_VALUE" >&6; } 
+	
+
+		
+@%:@ Check whether --with-parallel was given.
+if test "${with_parallel+set}" = set; then
+  withval=$with_parallel; PARALLEL_VALUE=$withval
+else
+  PARALLEL_VALUE="yes"
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for parallel compilation" >&5
+$as_echo_n "checking for parallel compilation... " >&6; }
+	 if test $PARALLEL_VALUE = no; then
+  NOPARALLEL_TRUE=
+  NOPARALLEL_FALSE='#'
+else
+  NOPARALLEL_TRUE='#'
+  NOPARALLEL_FALSE=
+fi
+
+	{ $as_echo "$as_me:$LINENO: result: $PARALLEL_VALUE" >&5
+$as_echo "$PARALLEL_VALUE" >&6; } 
+
+		if test "$SERIAL_VALUE" != "yes" ; then
+		if test "$PARALLEL_VALUE" != "yes"; then
+		{ { $as_echo "$as_me:$LINENO: error: cannot request --with-serial=no and --with-parallel=no at the same time!" >&5
+$as_echo "$as_me: error: cannot request --with-serial=no and --with-parallel=no at the same time!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+
+		
+@%:@ Check whether --with-matlab-dir was given.
+if test "${with_matlab_dir+set}" = set; then
+  withval=$with_matlab_dir; MATLAB_ROOT=$withval
+else
+  MATLAB_ROOT=""
+fi
+ 
+	
+	if test -d "$MATLAB_ROOT"; then
+
+		{ $as_echo "$as_me:$LINENO: checking for Matlab headers and libraries in $MATLAB_ROOT" >&5
+$as_echo_n "checking for Matlab headers and libraries in $MATLAB_ROOT... " >&6; }
+
+				HAVE_MATLAB=yes
+		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
+				MEXEXT=`$MATLAB_ROOT/bin/mexext`
+		MEXEXT=".$MEXEXT"
+		MEX=$MATLAB_ROOT/bin/mex
+
+				case "${host_os}" in
+			*linux*)
+			if test "${host_cpu}" = "x86_64";
+			then
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnxa64/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
+			else
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
+			fi
+			;;
+		esac
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MATLAB_ 1
+_ACEOF
+
+		
+		
+		
+		 
+		
+	
+		{ $as_echo "$as_me:$LINENO: result: $HAVE_MATLAB" >&5
+$as_echo "$HAVE_MATLAB" >&6; }
+	else
+		HAVE_MATLAB=no
+	fi
+
+	
+	if test $HAVE_MATLAB = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: --with-matlab-dir  missing. Matlab is needed to run ISSM serially!" >&5
+$as_echo "$as_me: error: --with-matlab-dir  missing. Matlab is needed to run ISSM serially!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+		if test $HAVE_MATLAB = yes; then
+
+		
+
+
+{ $as_echo "$as_me:$LINENO: checking for Matlab version" >&5
+$as_echo_n "checking for Matlab version... " >&6; }
+if test "${ax_cv_matlab_version+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "${MATLAB_VERSION+set}" = set ; then
+    ax_cv_matlab_version=$MATLAB_VERSION
+else
+    ax_cv_matlab_version=
+    # Loop over all known architectures.  The final dot covers
+    # Matlab R11 and Matlab V4 for Windows.
+    for ax_arch in alpha glnxa64 glnx86 hp700 hpux ibm_rs sgi sol2 win32 mac maci . ; do
+        for ax_exec_name in matlab$EXEEXT MATLAB ; do
+		ax_matlab_exec=$MATLAB/bin/$ax_arch/${ax_exec_name}
+		if test -f $ax_matlab_exec ; then
+	    		# For Matlab R12, the version number is stored in a
+	    		# shared library.
+	    		ax_matlab_exec_2=`find $MATLAB/bin/$ax_arch -type f -name libmwservices\* -print 2> /dev/null`
+	    		if test -n "$ax_matlab_exec_2" ; then
+				ax_cv_matlab_version=`strings $ax_matlab_exec_2 2> /dev/null | egrep '^\|build_version_\|@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^|build_version_|\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+				if test -n "$ax_cv_matlab_version" ; then
+		    			break
+				fi
+	    		fi
+	    		# For Matlab R11 and Matlab V4, the version number
+	    		# is stored in the executable program.
+	    		ax_cv_matlab_version=`strings $ax_matlab_exec 2> /dev/null | egrep '^@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+	    		if test -n "$ax_cv_matlab_version" ; then
+				break
+	    		fi
+		fi
+    	done
+	if test -n "$ax_cv_matlab_version" ; then
+		break
+	fi
+    done
+    if test -z "$ax_cv_matlab_version" ; then
+	ax_cv_matlab_version="not found"
+    fi
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_matlab_version" >&5
+$as_echo "$ax_cv_matlab_version" >&6; }
+case $ax_cv_matlab_version in
+  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
+    MATLAB_VERSION=$ax_cv_matlab_version
+    MATLAB_MAJOR=`echo $MATLAB_VERSION | sed -e 's/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/'`
+    MATLAB_MINOR=`echo $MATLAB_VERSION | sed -e 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
+    ;;
+  *)
+    if test x$ax_enable_matlab = xyes ; then
+	{ { $as_echo "$as_me:$LINENO: error: can not determine Matlab version number" >&5
+$as_echo "$as_me: error: can not determine Matlab version number" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    MATLAB_VERSION=
+    MATLAB_MAJOR=
+    MATLAB_MINOR=
+    ;;
+esac
+
+
+
+if test x$MATLAB_VERSION != x ; then
+    
+cat >>confdefs.h <<_ACEOF
+@%:@define MATLAB_MAJOR $MATLAB_MAJOR
+_ACEOF
+
+    
+cat >>confdefs.h <<_ACEOF
+@%:@define MATLAB_MINOR $MATLAB_MINOR
+_ACEOF
+
+fi
+
+		
+						largearrays=no
+		if test $MATLAB_MAJOR -ge 7; then 
+			if test $MATLAB_MINOR -ge 5; then 
+				if test "${host_cpu}" = "x86_64"; then
+					largearrays=yes
+				fi
+			fi
+		fi
+	fi
+	 if test x$largearrays = xyes; then
+  LARGEARRAYS_TRUE=
+  LARGEARRAYS_FALSE='#'
+else
+  LARGEARRAYS_TRUE='#'
+  LARGEARRAYS_FALSE=
+fi
+
+	
+		
+@%:@ Check whether --with-triangle-dir was given.
+if test "${with_triangle_dir+set}" = set; then
+  withval=$with_triangle_dir; TRIANGLE_ROOT=$withval
+else
+  TRIANGLE_ROOT=""
+fi
+ 
+	{ $as_echo "$as_me:$LINENO: checking for Triangle headers and libraries " >&5
+$as_echo_n "checking for Triangle headers and libraries ... " >&6; }
+	if test -d "$TRIANGLE_ROOT"; then
+
+
+				HAVE_TRIANGLE=yes
+		TRIANGLEINCL=-I$TRIANGLE_ROOT/
+		TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_TRIANGLE_ 1
+_ACEOF
+
+		
+		
+
+	else
+		HAVE_TRIANGLE=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_TRIANGLE" >&5
+$as_echo "$HAVE_TRIANGLE" >&6; }
+
+	{ $as_echo "$as_me:$LINENO: checking for triangle and parallel status" >&5
+$as_echo_n "checking for triangle and parallel status... " >&6; }
+	if test $HAVE_TRIANGLE = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: --with-triangle-dir  missing. Triangle is needed to run ISSM serially!" >&5
+$as_echo "$as_me: error: --with-triangle-dir  missing. Triangle is needed to run ISSM serially!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	{ $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+	
+		
+		
+@%:@ Check whether --with-metis-dir was given.
+if test "${with_metis_dir+set}" = set; then
+  withval=$with_metis_dir; METIS_ROOT=$withval
+else
+  METIS_ROOT=""
+fi
+
+
+	if test -d "$METIS_ROOT"; then
+
+		{ $as_echo "$as_me:$LINENO: checking for Metis headers and libraries in $METIS_ROOT" >&5
+$as_echo_n "checking for Metis headers and libraries in $METIS_ROOT... " >&6; }
+
+				HAVE_METIS=yes
+		METISINCL=-I"$METIS_ROOT/Lib"
+		METISLIB=-L"$METIS_ROOT/ -lmetis"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_METIS_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_METIS=no
+	fi
+
+	if test $HAVE_METIS = no; then
+	{ { $as_echo "$as_me:$LINENO: error: --with-metis-dir  missing. Metis is needed to run ISSM" >&5
+$as_echo "$as_me: error: --with-metis-dir  missing. Metis is needed to run ISSM" >&2;}
+   { (exit 1); exit 1; }; };
+	else
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_METIS" >&5
+$as_echo "$HAVE_METIS" >&6; }
+	fi
+
+		{ $as_echo "$as_me:$LINENO: checking for mpi..." >&5
+$as_echo_n "checking for mpi...... " >&6; }
+	
+@%:@ Check whether --with-mpi-lib was given.
+if test "${with_mpi_lib+set}" = set; then
+  withval=$with_mpi_lib; MPILIB=$withval
+else
+  MPILIB=""
+fi
+
+	
+	
+@%:@ Check whether --with-mpi-include was given.
+if test "${with_mpi_include+set}" = set; then
+  withval=$with_mpi_include; MPI_INCLUDE=$withval
+else
+  MPI_INCLUDE=""
+fi
+
+
+		if test -z "$MPILIB" ; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	else
+		if test -z "$MPI_INCLUDE" ; then
+			if test "$PARALLEL_VALUE" = "yes" ; then
+				{ { $as_echo "$as_me:$LINENO: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+			fi
+		else
+			HAVE_MPI=yes
+			MPIINCL=-I"$MPI_INCLUDE/"
+			
+			
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MPI_ 1
+_ACEOF
+
+			
+			
+		fi
+	fi
+	{ $as_echo "$as_me:$LINENO: result: done" >&5
+$as_echo "done" >&6; }
+
+		
+@%:@ Check whether --with-petsc-dir was given.
+if test "${with_petsc_dir+set}" = set; then
+  withval=$with_petsc_dir; PETSC_ROOT=$withval
+else
+  PETSC_ROOT=""
+fi
+
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ROOT" = "" ; then
+			{ { $as_echo "$as_me:$LINENO: error: missing --with-petsc-dir argument for parallel compilation!" >&5
+$as_echo "$as_me: error: missing --with-petsc-dir argument for parallel compilation!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	
+	
+@%:@ Check whether --with-petsc-arch was given.
+if test "${with_petsc_arch+set}" = set; then
+  withval=$with_petsc_arch; PETSC_ARCH=$withval
+else
+  PETSC_ARCH=""
+fi
+
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ARCH" = "" ; then
+			{ { $as_echo "$as_me:$LINENO: error: missing --with-petsc-arch argument for parallel compilation!" >&5
+$as_echo "$as_me: error: missing --with-petsc-arch argument for parallel compilation!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	
+	{ $as_echo "$as_me:$LINENO: checking for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH" >&5
+$as_echo_n "checking for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH... " >&6; }
+	
+	if test -d "$PETSC_ROOT"; then
+
+		if test -d "$PETSC_ROOT/bmake/$PETSC_ARCH"; then
+		
+			PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
+			PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+			                          
+
+
+			
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_PETSC_ 1
+_ACEOF
+
+			
+			
+
+			HAVE_PETSC=yes
+		else
+			HAVE_PETSC=no
+		fi
+	else
+		HAVE_PETSC=no
+	fi
+
+	if test $HAVE_PETSC = no; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	else
+		{ $as_echo "$as_me:$LINENO: result: $HAVE_PETSC" >&5
+$as_echo "$HAVE_PETSC" >&6; }
+	fi
+
+
+		
+@%:@ Check whether --with-slepc-dir was given.
+if test "${with_slepc_dir+set}" = set; then
+  withval=$with_slepc_dir; SLEPC_ROOT=$withval
+else
+  SLEPC_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Slepc headers and libraries in $SLEPC_ROOT" >&5
+$as_echo_n "checking for Slepc headers and libraries in $SLEPC_ROOT... " >&6; }
+	if test -d "$SLEPC_ROOT"; then
+
+
+				HAVE_SLEPC=yes
+		SLEPCINCL=-I"$SLEPC_ROOT/include"
+		SLEPCLIB=-L"$SLEPC_ROOT/lib/ -lslepc"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_SLEPC_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_SLEPC=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_SLEPC" >&5
+$as_echo "$HAVE_SLEPC" >&6; }
+	
+		
+@%:@ Check whether --with-scalapack-dir was given.
+if test "${with_scalapack_dir+set}" = set; then
+  withval=$with_scalapack_dir; SCALAPACK_ROOT=$withval
+else
+  SCALAPACK_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Scalapack headers and libraries in $SCALAPACK_ROOT" >&5
+$as_echo_n "checking for Scalapack headers and libraries in $SCALAPACK_ROOT... " >&6; }
+	if test -d "$SCALAPACK_ROOT"; then
+
+
+				HAVE_SCALAPACK=yes
+		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_SCALAPACK_ 1
+_ACEOF
+
+		
+	else
+		HAVE_SCALAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_SCALAPACK" >&5
+$as_echo "$HAVE_SCALAPACK" >&6; }
+
+		
+@%:@ Check whether --with-blas-lapack-dir was given.
+if test "${with_blas_lapack_dir+set}" = set; then
+  withval=$with_blas_lapack_dir; BLASLAPACK_ROOT=$withval
+else
+  BLASLAPACK_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT" >&5
+$as_echo_n "checking for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT... " >&6; }
+	if test -d "$BLASLAPACK_ROOT"; then
+
+
+				HAVE_BLASLAPACK=yes
+		BLASLAPACKINCL=""
+		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_BLASLAPACK_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_BLASLAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_BLASLAPACK" >&5
+$as_echo "$HAVE_BLASLAPACK" >&6; }
+
+
+		
+@%:@ Check whether --with-plapack-dir was given.
+if test "${with_plapack_dir+set}" = set; then
+  withval=$with_plapack_dir; PLAPACK_ROOT=$withval
+else
+  PLAPACK_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Plapack headers and libraries in $PLAPACK_ROOT" >&5
+$as_echo_n "checking for Plapack headers and libraries in $PLAPACK_ROOT... " >&6; }
+	if test -d "$PLAPACK_ROOT"; then
+
+
+				HAVE_PLAPACK=yes
+		PLAPACKINCL=-I"$PLAPACK_ROOT/INCLUDE"
+		PLAPACKLIB=-L"$PLAPACK_ROOT/ -lPLAPACK"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_PLAPACK_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_PLAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_PLAPACK" >&5
+$as_echo "$HAVE_PLAPACK" >&6; }
+
+		
+@%:@ Check whether --with-mumps-dir was given.
+if test "${with_mumps_dir+set}" = set; then
+  withval=$with_mumps_dir; MUMPS_ROOT=$withval
+else
+  MUMPS_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Mumps headers and libraries in $MUMPS_ROOT" >&5
+$as_echo_n "checking for Mumps headers and libraries in $MUMPS_ROOT... " >&6; }
+	if test -d "$MUMPS_ROOT"; then
+
+				HAVE_MUMPS=yes
+		MUMPSINCL=-I"$MUMPS_ROOT/include"
+		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps -lpord"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MUMPS_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_MUMPS=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_MUMPS" >&5
+$as_echo "$HAVE_MUMPS" >&6; }
+
+		
+@%:@ Check whether --with-blacs-dir was given.
+if test "${with_blacs_dir+set}" = set; then
+  withval=$with_blacs_dir; BLACS_ROOT=$withval
+else
+  BLACS_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Blacs headers and libraries in $BLACS_ROOT" >&5
+$as_echo_n "checking for Blacs headers and libraries in $BLACS_ROOT... " >&6; }
+	if test -d "$BLACS_ROOT"; then
+
+				HAVE_BLACS=yes
+		BLACSINCL=""
+		BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
+        
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_BLACS_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_BLACS=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_BLACS" >&5
+$as_echo "$HAVE_BLACS" >&6; }
+
+
+
+
+
+ac_config_files="$ac_config_files Makefile src/Makefile src/c/Makefile src/mex/Makefile bin/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIB@&t@OBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NOSERIAL_TRUE}" && test -z "${NOSERIAL_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"NOSERIAL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"NOSERIAL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NOPARALLEL_TRUE}" && test -z "${NOPARALLEL_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"NOPARALLEL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"NOPARALLEL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${LARGEARRAYS_TRUE}" && test -z "${LARGEARRAYS_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"LARGEARRAYS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"LARGEARRAYS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE] 
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE] 
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+ISSM config.status 1.0
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "src/c/Makefile") CONFIG_FILES="$CONFIG_FILES src/c/Makefile" ;;
+    "src/mex/Makefile") CONFIG_FILES="$CONFIG_FILES src/mex/Makefile" ;;
+    "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
+'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+  
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
Index: /issm/trunk/autom4te.cache/output.2
===================================================================
--- /issm/trunk/autom4te.cache/output.2	(revision 1)
+++ /issm/trunk/autom4te.cache/output.2	(revision 1)
@@ -0,0 +1,7444 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.63 for ISSM 1.0.
+@%:@
+@%:@ Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+@%:@ 
+@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+    
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIB@&t@OBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='ISSM'
+PACKAGE_TARNAME='issm'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='ISSM 1.0'
+PACKAGE_BUGREPORT='Eric Larour <eric.larour@jpl.nasa.gov>'
+
+ac_subst_vars='LTLIBOBJS
+LIB@&t@OBJS
+X_EXTRA_LIBS
+X_LIBS
+X_PRE_LIBS
+X_CFLAGS
+CPP
+XMKMF
+FLIBS
+ac_ct_F77
+FFLAGS
+F77
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+RANLIB
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+with_x
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+F77
+FFLAGS
+XMKMF
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+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 ISSM 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root @<:@DATAROOTDIR/doc/issm@:>@
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of ISSM 1.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-x                use the X Window System
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+ISSM configure 1.0
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+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 ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+@%:@@%:@ ------------------- @%:@@%:@
+@%:@@%:@ File substitutions. @%:@@%:@
+@%:@@%:@ ------------------- @%:@@%:@
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+$as_echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+am__api_version='1.10'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='issm'
+ VERSION='1.0'
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE "$PACKAGE"
+_ACEOF
+
+ 
+cat >>confdefs.h <<_ACEOF
+@%:@define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $@%:@ != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext 
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+@%:@ Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking; 
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ifort g77
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { $as_echo "$as_me:$LINENO: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in ifort g77
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+  G77=yes
+else
+  G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5
+$as_echo_n "checking how to get verbose linking output from $F77... " >&6; }
+if test "${ac_cv_prog_f77_v+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_v=
+# Try some options frequently used verbose output
+for ac_verb in -v -verbose --verbose -V -\#\#\#; do
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_verb"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+  # look for -l* and *.a constructs in the output
+  for ac_arg in $ac_f77_v_output; do
+     case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+          ac_cv_prog_f77_v=$ac_verb
+          break 2 ;;
+     esac
+  done
+done
+if test -z "$ac_cv_prog_f77_v"; then
+   { $as_echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5
+$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;}
+fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: WARNING: compilation failed" >&5
+$as_echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5
+$as_echo "$ac_cv_prog_f77_v" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for Fortran 77 libraries of $F77" >&5
+$as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; }
+if test "${ac_cv_f77_libs+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$FLIBS" != "x"; then
+  ac_cv_f77_libs="$FLIBS" # Let the user override the test.
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+
+ac_cv_f77_libs=
+
+# Save positional arguments (if any)
+ac_save_positional="$@"
+
+set X $ac_f77_v_output
+while test $@%:@ != 1; do
+  shift
+  ac_arg=$1
+  case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+        -bI:*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_arg; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+fi
+
+          ;;
+          # Ignore these flags.
+        -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*)
+          ;;
+        -lkernel32)
+          test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+          ;;
+        -[LRuYz])
+          # These flags, when seen by themselves, take an argument.
+          # We remove the space between option and argument and re-iterate
+          # unless we find an empty arg or a new option (starting with -)
+	  case $2 in
+	     "" | -*);;
+	     *)
+		ac_arg="$ac_arg$2"
+		shift; shift
+		set X $ac_arg "$@"
+		;;
+	  esac
+          ;;
+        -YP,*)
+          for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+              ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_j" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_arg="$ac_arg $ac_j"
+                               ac_cv_f77_libs="$ac_cv_f77_libs $ac_j"
+fi
+
+          done
+          ;;
+        -[lLR]*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+	-zallextract*| -zdefaultextract)
+	  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+	  ;;
+          # Ignore everything else.
+  esac
+done
+# restore positional arguments
+set X $ac_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+   "SunOS 5"*)
+      ac_ld_run_path=`$as_echo "$ac_f77_v_output" |
+                        sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+      test "x$ac_ld_run_path" != x &&
+        if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_ld_run_path; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path"
+fi
+      ;;
+esac
+fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_libs" >&5
+$as_echo "$ac_cv_f77_libs" >&6; }
+FLIBS="$ac_cv_f77_libs"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+  
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+{ $as_echo "$as_me:$LINENO: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+
+@%:@ Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x; 
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5
+$as_echo "$as_me: error: cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl dylib la dll; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl dylib la dll; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { $as_echo "$as_me:$LINENO: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define X_DISPLAY_MISSING 1
+_ACEOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+$as_echo_n "checking whether -R must be followed by a space... " >&6; }
+    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+    ac_xsave_c_werror_flag=$ac_c_werror_flag
+    ac_c_werror_flag=yes
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       X_LIBS="$X_LIBS -R$x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+	  X_LIBS="$X_LIBS -R $x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: result: neither works" >&5
+$as_echo "neither works" >&6; }
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    ac_c_werror_flag=$ac_xsave_c_werror_flag
+    LIBS=$ac_xsave_LIBS
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn Johnson says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And Karl Berry says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 XOpenDisplay ();
+int
+main ()
+{
+return XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+    fi
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_xsave_LIBS"
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to T.E. Dickey.
+    # The functions gethostbyname, getservbyname, and inet_addr are
+    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+    { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5
+$as_echo_n "checking for gethostbyname... " >&6; }
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname innocuous_gethostbyname
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname
+
+/* 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 gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gethostbyname || defined __stub___gethostbyname
+choke me
+#endif
+
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+$as_echo "$ac_cv_func_gethostbyname" >&6; }
+
+    if test $ac_cv_func_gethostbyname = no; then
+      { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_nsl_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+	{ $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_bsd_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
+$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
+if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+      fi
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says Simon Leinen: it contains gethostby*
+    # variants that don't use the name server (or something).  -lsocket
+    # must be given before -lnsl if both are needed.  We assume that
+    # if connect needs -lnsl, so does gethostbyname.
+    { $as_echo "$as_me:$LINENO: checking for connect" >&5
+$as_echo_n "checking for connect... " >&6; }
+if test "${ac_cv_func_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef connect
+
+/* 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 connect ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_connect || defined __stub___connect
+choke me
+#endif
+
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+$as_echo "$ac_cv_func_connect" >&6; }
+
+    if test $ac_cv_func_connect = no; then
+      { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+$as_echo_n "checking for connect in -lsocket... " >&6; }
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 connect ();
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_socket_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_socket_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+$as_echo "$ac_cv_lib_socket_connect" >&6; }
+if test "x$ac_cv_lib_socket_connect" = x""yes; then
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    { $as_echo "$as_me:$LINENO: checking for remove" >&5
+$as_echo_n "checking for remove... " >&6; }
+if test "${ac_cv_func_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define remove innocuous_remove
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef remove
+
+/* 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 remove ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_remove || defined __stub___remove
+choke me
+#endif
+
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+$as_echo "$ac_cv_func_remove" >&6; }
+
+    if test $ac_cv_func_remove = no; then
+      { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5
+$as_echo_n "checking for remove in -lposix... " >&6; }
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 remove ();
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_posix_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_posix_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
+$as_echo "$ac_cv_lib_posix_remove" >&6; }
+if test "x$ac_cv_lib_posix_remove" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    { $as_echo "$as_me:$LINENO: checking for shmat" >&5
+$as_echo_n "checking for shmat... " >&6; }
+if test "${ac_cv_func_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shmat innocuous_shmat
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shmat
+
+/* 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 shmat ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shmat || defined __stub___shmat
+choke me
+#endif
+
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+$as_echo "$ac_cv_func_shmat" >&6; }
+
+    if test $ac_cv_func_shmat = no; then
+      { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
+$as_echo_n "checking for shmat in -lipc... " >&6; }
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 shmat ();
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ipc_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ipc_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
+$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
+if test "x$ac_cv_lib_ipc_shmat" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
+$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 IceConnectionNumber ();
+int
+main ()
+{
+return IceConnectionNumber ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+  LDFLAGS=$ac_save_LDFLAGS
+
+fi
+
+ISSM_OPTIONS
+ac_config_files="$ac_config_files Makefile src/Makefile src/c/Makefile src/mex/Makefile bin/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIB@&t@OBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE] 
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE] 
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+ISSM config.status 1.0
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "src/c/Makefile") CONFIG_FILES="$CONFIG_FILES src/c/Makefile" ;;
+    "src/mex/Makefile") CONFIG_FILES="$CONFIG_FILES src/mex/Makefile" ;;
+    "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
+'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+  
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
Index: /issm/trunk/autom4te.cache/output.3
===================================================================
--- /issm/trunk/autom4te.cache/output.3	(revision 1)
+++ /issm/trunk/autom4te.cache/output.3	(revision 1)
@@ -0,0 +1,8552 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.63 for ISSM 1.0.
+@%:@
+@%:@ Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+@%:@ 
+@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+    
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIB@&t@OBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='ISSM'
+PACKAGE_TARNAME='issm'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='ISSM 1.0'
+PACKAGE_BUGREPORT='Eric Larour <eric.larour@jpl.nasa.gov>'
+
+ac_subst_vars='LTLIBOBJS
+LIB@&t@OBJS
+BLACSLIB
+BLACSINCL
+MUMPSLIB
+MUMPSINCL
+PLAPACKLIB
+PLAPACKINCL
+BLASLAPACKINCL
+BLASLAPACKLIB
+SCALAPACKLIB
+SLEPCLIB
+SLEPCINCL
+PETSCLIB
+PETSCINCL
+MPILIBS
+MPICC
+METISLIB
+METISINCL
+TRIANGLELIB
+TRIANGLEINCL
+LARGEARRAYS_FALSE
+LARGEARRAYS_TRUE
+MATLAB_MINOR
+MATLAB_MAJOR
+MATLAB_VERSION
+MATLAB
+MEXLINK
+MEXLIB
+MEXEXT
+MEX
+MATLABINCL
+NOPARALLEL_FALSE
+NOPARALLEL_TRUE
+NOSERIAL_FALSE
+NOSERIAL_TRUE
+X_EXTRA_LIBS
+X_LIBS
+X_PRE_LIBS
+X_CFLAGS
+CPP
+XMKMF
+FLIBS
+ac_ct_F77
+FFLAGS
+F77
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+RANLIB
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+with_x
+enable_debugging
+with_serial
+with_parallel
+with_matlab_dir
+with_triangle_dir
+with_metis_dir
+with_petsc_dir
+with_petsc_arch
+with_slepc_dir
+with_scalapack_dir
+with_blas_lapack_dir
+with_plapack_dir
+with_mumps_dir
+with_blacs_dir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+F77
+FFLAGS
+XMKMF
+CPP
+MPICC'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+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 ISSM 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root @<:@DATAROOTDIR/doc/issm@:>@
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of ISSM 1.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-debugging      turn debug support on
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-x                use the X Window System
+  --with-serial = value   serial compilation.
+  --with-parallel = value parallel compilation.
+  --with-matlab-dir = DIR matlab root directory. necessary for serial build.
+  --with-matlab-dir=ARG   check for Matlab [yes]
+  --with-triangle-dir = DIR 
+                          triangle root directory. necessary for serial build
+  --with-metis-dir = DIR  metis root directory. necessary for serial build
+  --with-petsc-dir = DIR  petsc root directory, necessary for parallel build
+  --with-petsc-arch = DIR petsc arch , necessary for parallel build
+  --with-slepc-dir = DIR  slepc root directory
+  --with-scalapack-dir = DIR 
+                          scalapack root directory
+  --with-blas-lapack-dir = DIR 
+                          blas-lapack root directory
+  --with-plapack-dir = DIR 
+                          plapack root directory
+  --with-mumps-dir = DIR  mumps root directory
+  --with-blacs-dir = DIR  blacs root directory
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+  CPP         C preprocessor
+  MPICC       MPI C compiler command
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+ISSM configure 1.0
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+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 ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+@%:@@%:@ ------------------- @%:@@%:@
+@%:@@%:@ File substitutions. @%:@@%:@
+@%:@@%:@ ------------------- @%:@@%:@
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+$as_echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+am__api_version='1.10'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='issm'
+ VERSION='1.0'
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE "$PACKAGE"
+_ACEOF
+
+ 
+cat >>confdefs.h <<_ACEOF
+@%:@define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $@%:@ != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext 
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+@%:@ Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking; 
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ifort g77
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { $as_echo "$as_me:$LINENO: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in ifort g77
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+  G77=yes
+else
+  G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5
+$as_echo_n "checking how to get verbose linking output from $F77... " >&6; }
+if test "${ac_cv_prog_f77_v+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_v=
+# Try some options frequently used verbose output
+for ac_verb in -v -verbose --verbose -V -\#\#\#; do
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_verb"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+  # look for -l* and *.a constructs in the output
+  for ac_arg in $ac_f77_v_output; do
+     case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+          ac_cv_prog_f77_v=$ac_verb
+          break 2 ;;
+     esac
+  done
+done
+if test -z "$ac_cv_prog_f77_v"; then
+   { $as_echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5
+$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;}
+fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: WARNING: compilation failed" >&5
+$as_echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5
+$as_echo "$ac_cv_prog_f77_v" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for Fortran 77 libraries of $F77" >&5
+$as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; }
+if test "${ac_cv_f77_libs+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$FLIBS" != "x"; then
+  ac_cv_f77_libs="$FLIBS" # Let the user override the test.
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+
+ac_cv_f77_libs=
+
+# Save positional arguments (if any)
+ac_save_positional="$@"
+
+set X $ac_f77_v_output
+while test $@%:@ != 1; do
+  shift
+  ac_arg=$1
+  case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+        -bI:*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_arg; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+fi
+
+          ;;
+          # Ignore these flags.
+        -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*)
+          ;;
+        -lkernel32)
+          test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+          ;;
+        -[LRuYz])
+          # These flags, when seen by themselves, take an argument.
+          # We remove the space between option and argument and re-iterate
+          # unless we find an empty arg or a new option (starting with -)
+	  case $2 in
+	     "" | -*);;
+	     *)
+		ac_arg="$ac_arg$2"
+		shift; shift
+		set X $ac_arg "$@"
+		;;
+	  esac
+          ;;
+        -YP,*)
+          for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+              ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_j" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_arg="$ac_arg $ac_j"
+                               ac_cv_f77_libs="$ac_cv_f77_libs $ac_j"
+fi
+
+          done
+          ;;
+        -[lLR]*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+	-zallextract*| -zdefaultextract)
+	  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+	  ;;
+          # Ignore everything else.
+  esac
+done
+# restore positional arguments
+set X $ac_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+   "SunOS 5"*)
+      ac_ld_run_path=`$as_echo "$ac_f77_v_output" |
+                        sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+      test "x$ac_ld_run_path" != x &&
+        if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_ld_run_path; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path"
+fi
+      ;;
+esac
+fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_libs" >&5
+$as_echo "$ac_cv_f77_libs" >&6; }
+FLIBS="$ac_cv_f77_libs"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+  
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+{ $as_echo "$as_me:$LINENO: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+
+@%:@ Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x; 
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5
+$as_echo "$as_me: error: cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl dylib la dll; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl dylib la dll; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { $as_echo "$as_me:$LINENO: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define X_DISPLAY_MISSING 1
+_ACEOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+$as_echo_n "checking whether -R must be followed by a space... " >&6; }
+    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+    ac_xsave_c_werror_flag=$ac_c_werror_flag
+    ac_c_werror_flag=yes
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       X_LIBS="$X_LIBS -R$x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+	  X_LIBS="$X_LIBS -R $x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: result: neither works" >&5
+$as_echo "neither works" >&6; }
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    ac_c_werror_flag=$ac_xsave_c_werror_flag
+    LIBS=$ac_xsave_LIBS
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn Johnson says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And Karl Berry says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 XOpenDisplay ();
+int
+main ()
+{
+return XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+    fi
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_xsave_LIBS"
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to T.E. Dickey.
+    # The functions gethostbyname, getservbyname, and inet_addr are
+    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+    { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5
+$as_echo_n "checking for gethostbyname... " >&6; }
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname innocuous_gethostbyname
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname
+
+/* 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 gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gethostbyname || defined __stub___gethostbyname
+choke me
+#endif
+
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+$as_echo "$ac_cv_func_gethostbyname" >&6; }
+
+    if test $ac_cv_func_gethostbyname = no; then
+      { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_nsl_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+	{ $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_bsd_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
+$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
+if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+      fi
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says Simon Leinen: it contains gethostby*
+    # variants that don't use the name server (or something).  -lsocket
+    # must be given before -lnsl if both are needed.  We assume that
+    # if connect needs -lnsl, so does gethostbyname.
+    { $as_echo "$as_me:$LINENO: checking for connect" >&5
+$as_echo_n "checking for connect... " >&6; }
+if test "${ac_cv_func_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef connect
+
+/* 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 connect ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_connect || defined __stub___connect
+choke me
+#endif
+
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+$as_echo "$ac_cv_func_connect" >&6; }
+
+    if test $ac_cv_func_connect = no; then
+      { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+$as_echo_n "checking for connect in -lsocket... " >&6; }
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 connect ();
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_socket_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_socket_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+$as_echo "$ac_cv_lib_socket_connect" >&6; }
+if test "x$ac_cv_lib_socket_connect" = x""yes; then
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    { $as_echo "$as_me:$LINENO: checking for remove" >&5
+$as_echo_n "checking for remove... " >&6; }
+if test "${ac_cv_func_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define remove innocuous_remove
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef remove
+
+/* 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 remove ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_remove || defined __stub___remove
+choke me
+#endif
+
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+$as_echo "$ac_cv_func_remove" >&6; }
+
+    if test $ac_cv_func_remove = no; then
+      { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5
+$as_echo_n "checking for remove in -lposix... " >&6; }
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 remove ();
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_posix_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_posix_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
+$as_echo "$ac_cv_lib_posix_remove" >&6; }
+if test "x$ac_cv_lib_posix_remove" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    { $as_echo "$as_me:$LINENO: checking for shmat" >&5
+$as_echo_n "checking for shmat... " >&6; }
+if test "${ac_cv_func_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shmat innocuous_shmat
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shmat
+
+/* 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 shmat ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shmat || defined __stub___shmat
+choke me
+#endif
+
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+$as_echo "$ac_cv_func_shmat" >&6; }
+
+    if test $ac_cv_func_shmat = no; then
+      { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
+$as_echo_n "checking for shmat in -lipc... " >&6; }
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 shmat ();
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ipc_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ipc_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
+$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
+if test "x$ac_cv_lib_ipc_shmat" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
+$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 IceConnectionNumber ();
+int
+main ()
+{
+return IceConnectionNumber ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+  LDFLAGS=$ac_save_LDFLAGS
+
+fi
+
+
+ax_enable_matlab=
+
+@%:@ Check whether --with-matlab-dir was given.
+if test "${with_matlab_dir+set}" = set; then
+  withval=$with_matlab_dir; case $withval in
+  yes | no)
+    # Explicitly enable or disable Matlab but determine
+    # Matlab prefix automatically.
+    ax_enable_matlab=$withval
+    ;;
+  *)
+    # Enable Matlab and use ARG as the Matlab prefix.
+    # ARG must be an existing directory.
+    ax_enable_matlab=yes
+    MATLAB=`cd "${withval-/}" > /dev/null 2>&1 && pwd`
+    if test -z "$MATLAB" ; then
+	{ { $as_echo "$as_me:$LINENO: error: invalid value '$withval' for --with-matlab" >&5
+$as_echo "$as_me: error: invalid value '$withval' for --with-matlab" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    ;;
+esac
+fi
+
+if test x$ax_enable_matlab != xno ; then
+{ $as_echo "$as_me:$LINENO: checking for Matlab prefix" >&5
+$as_echo_n "checking for Matlab prefix... " >&6; }
+if test "${ax_cv_matlab+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "${MATLAB+set}" = set ; then
+    ax_cv_matlab=`cd "${MATLAB-/}" > /dev/null 2>&1 && pwd`
+else
+    ax_cv_matlab=
+    IFS=${IFS= 	} ; ax_ifs=$IFS ; IFS=:
+    for ax_dir in ${PATH-/opt/bin:/usr/local/bin:/usr/bin:/bin} ; do
+	if test -z "$ax_dir" ; then
+	    ax_dir=.
+	fi
+	if test -x "$ax_dir/matlab" ; then
+	    ax_dir=`echo "$ax_dir" | sed 's,/bin$,,'`
+	    # Directory sanity check.
+	    ax_cv_matlab=`cd "${ax_dir-/}" > /dev/null 2>&1 && pwd`
+	    if test -n "$ax_cv_matlab" ; then
+		break
+	    fi
+	fi
+    done
+    IFS=$ax_ifs
+fi
+if test -z "$ax_cv_matlab" ; then
+    ax_cv_matlab="not found"
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_matlab" >&5
+$as_echo "$ax_cv_matlab" >&6; }
+if test "$ax_cv_matlab" = "not found" ; then
+    unset MATLAB
+else
+    # Strip trailing dashes.
+    MATLAB=`echo "$ax_cv_matlab" | sed 's,/*$,,'`
+fi
+{ $as_echo "$as_me:$LINENO: checking whether to enable Matlab support" >&5
+$as_echo_n "checking whether to enable Matlab support... " >&6; }
+if test x$ax_enable_matlab != xno ; then
+    if test "${MATLAB+set}" = set && test -d "$MATLAB/extern/include" ; then
+	ax_enable_matlab=yes
+    elif test x$ax_enable_matlab = x ; then
+	ax_enable_matlab=no
+    else
+	# Fail if Matlab was explicitly enabled.
+	{ $as_echo "$as_me:$LINENO: result: failure" >&5
+$as_echo "failure" >&6; }
+	{ { $as_echo "$as_me:$LINENO: error: check your Matlab setup" >&5
+$as_echo "$as_me: error: check your Matlab setup" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_enable_matlab" >&5
+$as_echo "$ax_enable_matlab" >&6; }
+if test x$ax_enable_matlab = xyes ; then
+    
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_MATLAB 1
+_ACEOF
+
+fi
+fi
+
+
+
+		@%:@ Check whether --enable-debugging was given.
+if test "${enable_debugging+set}" = set; then
+  enableval=$enable_debugging; enable_debugging=$enableval
+else
+  enable_debugging=no
+fi
+
+	if test "x$enable_debugging" = xyes; then
+	 
+cat >>confdefs.h <<\_ACEOF
+@%:@define _DEBUG_ 1
+_ACEOF
+
+	fi
+
+		
+@%:@ Check whether --with-serial was given.
+if test "${with_serial+set}" = set; then
+  withval=$with_serial; SERIAL_VALUE=$withval
+else
+  SERIAL_VALUE="yes"
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for serial compilation" >&5
+$as_echo_n "checking for serial compilation... " >&6; }
+	 if test $SERIAL_VALUE = no; then
+  NOSERIAL_TRUE=
+  NOSERIAL_FALSE='#'
+else
+  NOSERIAL_TRUE='#'
+  NOSERIAL_FALSE=
+fi
+
+	{ $as_echo "$as_me:$LINENO: result: $SERIAL_VALUE" >&5
+$as_echo "$SERIAL_VALUE" >&6; } 
+	
+
+		
+@%:@ Check whether --with-parallel was given.
+if test "${with_parallel+set}" = set; then
+  withval=$with_parallel; PARALLEL_VALUE=$withval
+else
+  PARALLEL_VALUE="yes"
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for parallel compilation" >&5
+$as_echo_n "checking for parallel compilation... " >&6; }
+	 if test $PARALLEL_VALUE = no; then
+  NOPARALLEL_TRUE=
+  NOPARALLEL_FALSE='#'
+else
+  NOPARALLEL_TRUE='#'
+  NOPARALLEL_FALSE=
+fi
+
+	{ $as_echo "$as_me:$LINENO: result: $PARALLEL_VALUE" >&5
+$as_echo "$PARALLEL_VALUE" >&6; } 
+
+		if test "$SERIAL_VALUE" != "yes" ; then
+		if test "$PARALLEL_VALUE" != "yes"; then
+		{ { $as_echo "$as_me:$LINENO: error: cannot request --with-serial=no and --with-parallel=no at the same time!" >&5
+$as_echo "$as_me: error: cannot request --with-serial=no and --with-parallel=no at the same time!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+
+		
+@%:@ Check whether --with-matlab-dir was given.
+if test "${with_matlab_dir+set}" = set; then
+  withval=$with_matlab_dir; MATLAB_ROOT=$withval
+else
+  MATLAB_ROOT=""
+fi
+ 
+	
+	if test -d "$MATLAB_ROOT"; then
+
+		{ $as_echo "$as_me:$LINENO: checking for Matlab headers and libraries in $MATLAB_ROOT" >&5
+$as_echo_n "checking for Matlab headers and libraries in $MATLAB_ROOT... " >&6; }
+
+				HAVE_MATLAB=yes
+		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
+				MEXEXT=`$MATLAB_ROOT/bin/mexext`
+		MEXEXT=".$MEXEXT"
+		MEX=$MATLAB_ROOT/bin/mex
+
+				case "${host_os}" in
+			*linux*)
+			if test "${host_cpu}" = "x86_64";
+			then
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnxa64/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
+			else
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
+			fi
+			;;
+		esac
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MATLAB_ 1
+_ACEOF
+
+		
+		
+		
+		 
+		
+	
+		{ $as_echo "$as_me:$LINENO: result: $HAVE_MATLAB" >&5
+$as_echo "$HAVE_MATLAB" >&6; }
+	else
+		HAVE_MATLAB=no
+	fi
+
+	
+	if test $HAVE_MATLAB = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: --with-matlab-dir  missing. Matlab is needed to run ISSM serially!" >&5
+$as_echo "$as_me: error: --with-matlab-dir  missing. Matlab is needed to run ISSM serially!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+		if test $HAVE_MATLAB = yes; then
+		
+
+
+{ $as_echo "$as_me:$LINENO: checking for Matlab version" >&5
+$as_echo_n "checking for Matlab version... " >&6; }
+if test "${ax_cv_matlab_version+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "${MATLAB_VERSION+set}" = set ; then
+    ax_cv_matlab_version=$MATLAB_VERSION
+else
+    ax_cv_matlab_version=
+    # Loop over all known architectures.  The final dot covers
+    # Matlab R11 and Matlab V4 for Windows.
+    for ax_arch in alpha glnxa64 glnx86 hp700 hpux ibm_rs sgi sol2 win32 mac maci . ; do
+        for ax_exec_name in matlab$EXEEXT MATLAB ; do
+		ax_matlab_exec=$MATLAB/bin/$ax_arch/${ax_exec_name}
+		if test -f $ax_matlab_exec ; then
+	    		# For Matlab R12, the version number is stored in a
+	    		# shared library.
+	    		ax_matlab_exec_2=`find $MATLAB/bin/$ax_arch -type f -name libmwservices\* -print 2> /dev/null`
+	    		if test -n "$ax_matlab_exec_2" ; then
+				ax_cv_matlab_version=`strings $ax_matlab_exec_2 2> /dev/null | egrep '^\|build_version_\|@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^|build_version_|\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+				if test -n "$ax_cv_matlab_version" ; then
+		    			break
+				fi
+	    		fi
+	    		# For Matlab R11 and Matlab V4, the version number
+	    		# is stored in the executable program.
+	    		ax_cv_matlab_version=`strings $ax_matlab_exec 2> /dev/null | egrep '^@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+	    		if test -n "$ax_cv_matlab_version" ; then
+				break
+	    		fi
+		fi
+    	done
+	if test -n "$ax_cv_matlab_version" ; then
+		break
+	fi
+    done
+    if test -z "$ax_cv_matlab_version" ; then
+	ax_cv_matlab_version="not found"
+    fi
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_matlab_version" >&5
+$as_echo "$ax_cv_matlab_version" >&6; }
+case $ax_cv_matlab_version in
+  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
+    MATLAB_VERSION=$ax_cv_matlab_version
+    MATLAB_MAJOR=`echo $MATLAB_VERSION | sed -e 's/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/'`
+    MATLAB_MINOR=`echo $MATLAB_VERSION | sed -e 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
+    ;;
+  *)
+    if test x$ax_enable_matlab = xyes ; then
+	{ { $as_echo "$as_me:$LINENO: error: can not determine Matlab version number" >&5
+$as_echo "$as_me: error: can not determine Matlab version number" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    MATLAB_VERSION=
+    MATLAB_MAJOR=
+    MATLAB_MINOR=
+    ;;
+esac
+
+
+
+if test x$MATLAB_VERSION != x ; then
+    
+cat >>confdefs.h <<_ACEOF
+@%:@define MATLAB_MAJOR $MATLAB_MAJOR
+_ACEOF
+
+    
+cat >>confdefs.h <<_ACEOF
+@%:@define MATLAB_MINOR $MATLAB_MINOR
+_ACEOF
+
+fi
+
+
+						largearrays=no
+		if test $MATLAB_MAJOR -ge 7; then 
+			if test $MATLAB_MINOR -ge 5; then 
+				if test "${host_cpu}" = "x86_64"; then
+					largearrays=yes
+				fi
+			fi
+		fi
+	fi
+	 if test x$largearrays = xyes; then
+  LARGEARRAYS_TRUE=
+  LARGEARRAYS_FALSE='#'
+else
+  LARGEARRAYS_TRUE='#'
+  LARGEARRAYS_FALSE=
+fi
+
+	
+		
+@%:@ Check whether --with-triangle-dir was given.
+if test "${with_triangle_dir+set}" = set; then
+  withval=$with_triangle_dir; TRIANGLE_ROOT=$withval
+else
+  TRIANGLE_ROOT=""
+fi
+ 
+	{ $as_echo "$as_me:$LINENO: checking for Triangle headers and libraries " >&5
+$as_echo_n "checking for Triangle headers and libraries ... " >&6; }
+	if test -d "$TRIANGLE_ROOT"; then
+
+
+				HAVE_TRIANGLE=yes
+		TRIANGLEINCL=-I$TRIANGLE_ROOT/
+		TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_TRIANGLE_ 1
+_ACEOF
+
+		
+		
+
+	else
+		HAVE_TRIANGLE=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_TRIANGLE" >&5
+$as_echo "$HAVE_TRIANGLE" >&6; }
+
+	{ $as_echo "$as_me:$LINENO: checking for triangle and parallel status" >&5
+$as_echo_n "checking for triangle and parallel status... " >&6; }
+	if test $HAVE_TRIANGLE = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: --with-triangle-dir  missing. Triangle is needed to run ISSM serially!" >&5
+$as_echo "$as_me: error: --with-triangle-dir  missing. Triangle is needed to run ISSM serially!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	{ $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+	
+		
+		
+@%:@ Check whether --with-metis-dir was given.
+if test "${with_metis_dir+set}" = set; then
+  withval=$with_metis_dir; METIS_ROOT=$withval
+else
+  METIS_ROOT=""
+fi
+
+
+	if test -d "$METIS_ROOT"; then
+
+		{ $as_echo "$as_me:$LINENO: checking for Metis headers and libraries in $METIS_ROOT" >&5
+$as_echo_n "checking for Metis headers and libraries in $METIS_ROOT... " >&6; }
+
+				HAVE_METIS=yes
+		METISINCL=-I"$METIS_ROOT/Lib"
+		METISLIB=-L"$METIS_ROOT/ -lmetis"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_METIS_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_METIS=no
+	fi
+
+	if test $HAVE_METIS = no; then
+	{ { $as_echo "$as_me:$LINENO: error: --with-metis-dir  missing. Metis is needed to run ISSM" >&5
+$as_echo "$as_me: error: --with-metis-dir  missing. Metis is needed to run ISSM" >&2;}
+   { (exit 1); exit 1; }; };
+	else
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_METIS" >&5
+$as_echo "$HAVE_METIS" >&6; }
+	fi
+
+				
+	
+ 
+
+	
+	
+	for ac_prog in mpicc hcc mpxlc_r mpxlc mpcc cmpicc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_MPICC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$MPICC"; then
+  ac_cv_prog_MPICC="$MPICC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_MPICC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+MPICC=$ac_cv_prog_MPICC
+if test -n "$MPICC"; then
+  { $as_echo "$as_me:$LINENO: result: $MPICC" >&5
+$as_echo "$MPICC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$MPICC" && break
+done
+test -n "$MPICC" || MPICC="$CC"
+
+	acx_mpi_save_CC="$CC"
+	CC="$MPICC"
+	
+
+
+if test x = x"$MPILIBS"; then
+	{ $as_echo "$as_me:$LINENO: checking for MPI_Init" >&5
+$as_echo_n "checking for MPI_Init... " >&6; }
+if test "${ac_cv_func_MPI_Init+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define MPI_Init to an innocuous variant, in case <limits.h> declares MPI_Init.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define MPI_Init innocuous_MPI_Init
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char MPI_Init (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef MPI_Init
+
+/* 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 MPI_Init ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_MPI_Init || defined __stub___MPI_Init
+choke me
+#endif
+
+int
+main ()
+{
+return MPI_Init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_MPI_Init=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_MPI_Init=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_MPI_Init" >&5
+$as_echo "$ac_cv_func_MPI_Init" >&6; }
+if test "x$ac_cv_func_MPI_Init" = x""yes; then
+  MPILIBS=" "
+fi
+
+fi
+
+if test x = x"$MPILIBS"; then
+	{ $as_echo "$as_me:$LINENO: checking for MPI_Init in -lmpi" >&5
+$as_echo_n "checking for MPI_Init in -lmpi... " >&6; }
+if test "${ac_cv_lib_mpi_MPI_Init+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmpi  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 MPI_Init ();
+int
+main ()
+{
+return MPI_Init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_mpi_MPI_Init=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_mpi_MPI_Init=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mpi_MPI_Init" >&5
+$as_echo "$ac_cv_lib_mpi_MPI_Init" >&6; }
+if test "x$ac_cv_lib_mpi_MPI_Init" = x""yes; then
+  MPILIBS="-lmpi"
+fi
+
+fi
+if test x = x"$MPILIBS"; then
+	{ $as_echo "$as_me:$LINENO: checking for MPI_Init in -lmpich" >&5
+$as_echo_n "checking for MPI_Init in -lmpich... " >&6; }
+if test "${ac_cv_lib_mpich_MPI_Init+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmpich  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 MPI_Init ();
+int
+main ()
+{
+return MPI_Init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_mpich_MPI_Init=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_mpich_MPI_Init=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mpich_MPI_Init" >&5
+$as_echo "$ac_cv_lib_mpich_MPI_Init" >&6; }
+if test "x$ac_cv_lib_mpich_MPI_Init" = x""yes; then
+  MPILIBS="-lmpich"
+fi
+
+fi
+
+if test x != x"$MPILIBS"; then
+	{ $as_echo "$as_me:$LINENO: checking for mpi.h" >&5
+$as_echo_n "checking for mpi.h... " >&6; }
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <mpi.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	MPILIBS=""
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+CC="$acx_mpi_save_CC"
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x = x"$MPILIBS"; then
+        { { $as_echo "$as_me:$LINENO: error: cannot provide --with-mpi-dir and --with-mpi-lib at the same time!" >&5
+$as_echo "$as_me: error: cannot provide --with-mpi-dir and --with-mpi-lib at the same time!" >&2;}
+   { (exit 1); exit 1; }; }
+        :
+else
+        
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MPI_ 1
+_ACEOF
+
+        :
+fi
+
+
+		
+@%:@ Check whether --with-petsc-dir was given.
+if test "${with_petsc_dir+set}" = set; then
+  withval=$with_petsc_dir; PETSC_ROOT=$withval
+else
+  PETSC_ROOT=""
+fi
+
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ROOT" = "" ; then
+			{ { $as_echo "$as_me:$LINENO: error: missing --with-petsc-dir argument for parallel compilation!" >&5
+$as_echo "$as_me: error: missing --with-petsc-dir argument for parallel compilation!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	
+	
+@%:@ Check whether --with-petsc-arch was given.
+if test "${with_petsc_arch+set}" = set; then
+  withval=$with_petsc_arch; PETSC_ARCH=$withval
+else
+  PETSC_ARCH=""
+fi
+
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ARCH" = "" ; then
+			{ { $as_echo "$as_me:$LINENO: error: missing --with-petsc-arch argument for parallel compilation!" >&5
+$as_echo "$as_me: error: missing --with-petsc-arch argument for parallel compilation!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	
+	{ $as_echo "$as_me:$LINENO: checking for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH" >&5
+$as_echo_n "checking for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH... " >&6; }
+	
+	if test -d "$PETSC_ROOT"; then
+
+		if test -d "$PETSC_ROOT/bmake/$PETSC_ARCH"; then
+		
+			PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
+			PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+			                          
+
+
+			
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_PETSC_ 1
+_ACEOF
+
+			
+			
+
+			HAVE_PETSC=yes
+		else
+			HAVE_PETSC=no
+		fi
+	else
+		HAVE_PETSC=no
+	fi
+
+	if test $HAVE_PETSC = no; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	else
+		{ $as_echo "$as_me:$LINENO: result: $HAVE_PETSC" >&5
+$as_echo "$HAVE_PETSC" >&6; }
+	fi
+
+
+		
+@%:@ Check whether --with-slepc-dir was given.
+if test "${with_slepc_dir+set}" = set; then
+  withval=$with_slepc_dir; SLEPC_ROOT=$withval
+else
+  SLEPC_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Slepc headers and libraries in $SLEPC_ROOT" >&5
+$as_echo_n "checking for Slepc headers and libraries in $SLEPC_ROOT... " >&6; }
+	if test -d "$SLEPC_ROOT"; then
+
+
+				HAVE_SLEPC=yes
+		SLEPCINCL=-I"$SLEPC_ROOT/include"
+		SLEPCLIB=-L"$SLEPC_ROOT/lib/ -lslepc"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_SLEPC_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_SLEPC=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_SLEPC" >&5
+$as_echo "$HAVE_SLEPC" >&6; }
+	
+		
+@%:@ Check whether --with-scalapack-dir was given.
+if test "${with_scalapack_dir+set}" = set; then
+  withval=$with_scalapack_dir; SCALAPACK_ROOT=$withval
+else
+  SCALAPACK_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Scalapack headers and libraries in $SCALAPACK_ROOT" >&5
+$as_echo_n "checking for Scalapack headers and libraries in $SCALAPACK_ROOT... " >&6; }
+	if test -d "$SCALAPACK_ROOT"; then
+
+
+				HAVE_SCALAPACK=yes
+		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_SCALAPACK_ 1
+_ACEOF
+
+		
+	else
+		HAVE_SCALAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_SCALAPACK" >&5
+$as_echo "$HAVE_SCALAPACK" >&6; }
+
+		
+@%:@ Check whether --with-blas-lapack-dir was given.
+if test "${with_blas_lapack_dir+set}" = set; then
+  withval=$with_blas_lapack_dir; BLASLAPACK_ROOT=$withval
+else
+  BLASLAPACK_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT" >&5
+$as_echo_n "checking for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT... " >&6; }
+	if test -d "$BLASLAPACK_ROOT"; then
+
+
+				HAVE_BLASLAPACK=yes
+		BLASLAPACKINCL=""
+		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_BLASLAPACK_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_BLASLAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_BLASLAPACK" >&5
+$as_echo "$HAVE_BLASLAPACK" >&6; }
+
+
+		
+@%:@ Check whether --with-plapack-dir was given.
+if test "${with_plapack_dir+set}" = set; then
+  withval=$with_plapack_dir; PLAPACK_ROOT=$withval
+else
+  PLAPACK_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Plapack headers and libraries in $PLAPACK_ROOT" >&5
+$as_echo_n "checking for Plapack headers and libraries in $PLAPACK_ROOT... " >&6; }
+	if test -d "$PLAPACK_ROOT"; then
+
+
+				HAVE_PLAPACK=yes
+		PLAPACKINCL=-I"$PLAPACK_ROOT/INCLUDE"
+		PLAPACKLIB=-L"$PLAPACK_ROOT/ -lPLAPACK"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_PLAPACK_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_PLAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_PLAPACK" >&5
+$as_echo "$HAVE_PLAPACK" >&6; }
+
+		
+@%:@ Check whether --with-mumps-dir was given.
+if test "${with_mumps_dir+set}" = set; then
+  withval=$with_mumps_dir; MUMPS_ROOT=$withval
+else
+  MUMPS_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Mumps headers and libraries in $MUMPS_ROOT" >&5
+$as_echo_n "checking for Mumps headers and libraries in $MUMPS_ROOT... " >&6; }
+	if test -d "$MUMPS_ROOT"; then
+
+				HAVE_MUMPS=yes
+		MUMPSINCL=-I"$MUMPS_ROOT/include"
+		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps -lpord"
+
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MUMPS_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_MUMPS=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_MUMPS" >&5
+$as_echo "$HAVE_MUMPS" >&6; }
+
+		
+@%:@ Check whether --with-blacs-dir was given.
+if test "${with_blacs_dir+set}" = set; then
+  withval=$with_blacs_dir; BLACS_ROOT=$withval
+else
+  BLACS_ROOT=""
+fi
+
+			  
+	{ $as_echo "$as_me:$LINENO: checking for Blacs headers and libraries in $BLACS_ROOT" >&5
+$as_echo_n "checking for Blacs headers and libraries in $BLACS_ROOT... " >&6; }
+	if test -d "$BLACS_ROOT"; then
+
+				HAVE_BLACS=yes
+		BLACSINCL=""
+		BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
+        
+		
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_BLACS_ 1
+_ACEOF
+
+		
+		
+	else
+		HAVE_BLACS=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_BLACS" >&5
+$as_echo "$HAVE_BLACS" >&6; }
+
+
+
+
+
+ac_config_files="$ac_config_files Makefile src/Makefile src/c/Makefile src/mex/Makefile bin/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIB@&t@OBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NOSERIAL_TRUE}" && test -z "${NOSERIAL_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"NOSERIAL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"NOSERIAL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NOPARALLEL_TRUE}" && test -z "${NOPARALLEL_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"NOPARALLEL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"NOPARALLEL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${LARGEARRAYS_TRUE}" && test -z "${LARGEARRAYS_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"LARGEARRAYS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"LARGEARRAYS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE] 
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE] 
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+ISSM config.status 1.0
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "src/c/Makefile") CONFIG_FILES="$CONFIG_FILES src/c/Makefile" ;;
+    "src/mex/Makefile") CONFIG_FILES="$CONFIG_FILES src/mex/Makefile" ;;
+    "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
+'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+  
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
Index: /issm/trunk/autom4te.cache/requests
===================================================================
--- /issm/trunk/autom4te.cache/requests	(revision 1)
+++ /issm/trunk/autom4te.cache/requests	(revision 1)
@@ -0,0 +1,314 @@
+# This file was generated.
+# It contains the lists of macros which have been traced.
+# It can be safely removed.
+
+@request = (
+             bless( [
+                      '0',
+                      1,
+                      [
+                        '/u/wilkes-r1b/larour/Bin/autoconf/share/autoconf'
+                      ],
+                      [
+                        '/u/wilkes-r1b/larour/Bin/autoconf/share/autoconf/autoconf/autoconf.m4f',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/amversion.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/auxdir.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/cond.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depout.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/init.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/install-sh.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/lead-dot.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/make.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/minuso.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/missing.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/mkdirp.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/runlog.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/sanity.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/strip.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/substnot.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/tar.m4',
+                        'm4/issm_options.m4',
+                        'm4/matlab.m4',
+                        'configure.ac'
+                      ],
+                      {
+                        'AX_MEXEXT' => 1,
+                        'AX_MEX_CONDITIONAL' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'AX_PATH_MEX' => 1,
+                        'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
+                        'AX_REQUIRE_MATLAB_VERSION' => 1,
+                        '_AM_SET_OPTION' => 1,
+                        'AC_DEFUN' => 1,
+                        'AM_PROG_MKDIR_P' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AX_DOT_MEXEXT' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AM_MISSING_HAS_RUN' => 1,
+                        'AM_MISSING_PROG' => 1,
+                        'AX_MATLAB' => 1,
+                        'AX_CC_MEX' => 1,
+                        'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AX_CXXFLAGS_WARN_ALL' => 1,
+                        'AC_DEFUN_ONCE' => 1,
+                        'AM_PROG_INSTALL_STRIP' => 1,
+                        '_m4_warn' => 1,
+                        'AX_MATLAB_SYS_ZLIB' => 1,
+                        'AM_SANITY_CHECK' => 1,
+                        'include' => 1,
+                        'AX_CFLAGS_WARN_ALL' => 1,
+                        '_AM_PROG_TAR' => 1,
+                        'ISSM_OPTIONS' => 1,
+                        'AX_MATLAB_VERSION' => 1,
+                        'AX_REQUIRE_MATLAB' => 1,
+                        'AM_AUX_DIR_EXPAND' => 1,
+                        'AM_DEP_TRACK' => 1,
+                        'AX_MEX_OPTIONS' => 1,
+                        'AM_CONFIG_HEADER' => 1,
+                        '_AM_SET_OPTIONS' => 1,
+                        'AM_RUN_LOG' => 1,
+                        '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AX_MATLAB_CONDITIONAL' => 1,
+                        '_AM_IF_OPTION' => 1,
+                        'CHECK_ZLIB' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
+                        'm4_pattern_allow' => 1,
+                        '_AM_AUTOCONF_VERSION' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        '_AM_MANGLE_OPTION' => 1,
+                        'AM_SET_LEADING_DOT' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AM_SET_DEPDIR' => 1,
+                        '_AM_DEPENDENCIES' => 1,
+                        'm4_include' => 1,
+                        'AM_PROG_INSTALL_SH' => 1,
+                        '_AC_AM_CONFIG_HEADER_HOOK' => 1,
+                        'AU_DEFUN' => 1,
+                        'AX_MATLAB_DIR' => 1,
+                        'AM_MAKE_INCLUDE' => 1
+                      }
+                    ], 'Autom4te::Request' ),
+             bless( [
+                      '1',
+                      1,
+                      [
+                        '/u/wilkes-r1b/larour/Bin/autoconf/share/autoconf'
+                      ],
+                      [
+                        '/u/wilkes-r1b/larour/Bin/autoconf/share/autoconf/autoconf/autoconf.m4f',
+                        'aclocal.m4',
+                        'configure.ac'
+                      ],
+                      {
+                        'AM_PROG_F77_C_O' => 1,
+                        '_LT_AC_TAGCONFIG' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'AC_INIT' => 1,
+                        'AC_CANONICAL_TARGET' => 1,
+                        '_AM_COND_IF' => 1,
+                        'AC_CONFIG_LIBOBJ_DIR' => 1,
+                        'AC_SUBST' => 1,
+                        'AC_CANONICAL_HOST' => 1,
+                        'AC_FC_SRCEXT' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AC_CONFIG_SUBDIRS' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'LT_CONFIG_LTDL_DIR' => 1,
+                        'AC_CONFIG_LINKS' => 1,
+                        'AC_REQUIRE_AUX_FILE' => 1,
+                        'LT_SUPPORTED_TAG' => 1,
+                        'm4_sinclude' => 1,
+                        'AM_MAINTAINER_MODE' => 1,
+                        'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
+                        '_m4_warn' => 1,
+                        'AM_PROG_CXX_C_O' => 1,
+                        '_AM_COND_ENDIF' => 1,
+                        'AM_ENABLE_MULTILIB' => 1,
+                        'AC_CONFIG_FILES' => 1,
+                        'include' => 1,
+                        'LT_INIT' => 1,
+                        'AM_GNU_GETTEXT' => 1,
+                        'AC_LIBSOURCE' => 1,
+                        'AM_PROG_FC_C_O' => 1,
+                        'AC_CANONICAL_BUILD' => 1,
+                        'AC_FC_FREEFORM' => 1,
+                        'AH_OUTPUT' => 1,
+                        'AC_CONFIG_AUX_DIR' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'm4_pattern_allow' => 1,
+                        'sinclude' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AC_CANONICAL_SYSTEM' => 1,
+                        'AC_CONFIG_HEADERS' => 1,
+                        'AC_DEFINE_TRACE_LITERAL' => 1,
+                        'm4_include' => 1,
+                        '_AM_COND_ELSE' => 1,
+                        'AC_SUBST_TRACE' => 1
+                      }
+                    ], 'Autom4te::Request' ),
+             bless( [
+                      '2',
+                      1,
+                      [
+                        '/u/wilkes-r1b/larour/Bin/autoconf/share/autoconf'
+                      ],
+                      [
+                        '/u/wilkes-r1b/larour/Bin/autoconf/share/autoconf/autoconf/autoconf.m4f',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/amversion.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/auxdir.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/cond.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depout.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/init.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/install-sh.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/lead-dot.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/make.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/minuso.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/missing.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/mkdirp.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/runlog.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/sanity.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/strip.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/substnot.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/tar.m4',
+                        'configure.ac'
+                      ],
+                      {
+                        'm4_pattern_forbid' => 1,
+                        'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
+                        '_AM_SET_OPTION' => 1,
+                        'AC_DEFUN' => 1,
+                        'AM_PROG_MKDIR_P' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AM_MISSING_HAS_RUN' => 1,
+                        'AM_MISSING_PROG' => 1,
+                        'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AC_DEFUN_ONCE' => 1,
+                        'AM_PROG_INSTALL_STRIP' => 1,
+                        '_m4_warn' => 1,
+                        'AM_SANITY_CHECK' => 1,
+                        'include' => 1,
+                        '_AM_PROG_TAR' => 1,
+                        'AM_AUX_DIR_EXPAND' => 1,
+                        'AM_DEP_TRACK' => 1,
+                        'AM_CONFIG_HEADER' => 1,
+                        '_AM_SET_OPTIONS' => 1,
+                        '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AM_RUN_LOG' => 1,
+                        '_AM_IF_OPTION' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
+                        'm4_pattern_allow' => 1,
+                        '_AM_AUTOCONF_VERSION' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        '_AM_MANGLE_OPTION' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AM_SET_LEADING_DOT' => 1,
+                        'AM_SET_DEPDIR' => 1,
+                        '_AM_DEPENDENCIES' => 1,
+                        'm4_include' => 1,
+                        'AM_PROG_INSTALL_SH' => 1,
+                        '_AC_AM_CONFIG_HEADER_HOOK' => 1,
+                        'AU_DEFUN' => 1,
+                        'AM_MAKE_INCLUDE' => 1
+                      }
+                    ], 'Autom4te::Request' ),
+             bless( [
+                      '3',
+                      1,
+                      [
+                        '/u/wilkes-r1b/larour/Bin/autoconf/share/autoconf'
+                      ],
+                      [
+                        '/u/wilkes-r1b/larour/Bin/autoconf/share/autoconf/autoconf/autoconf.m4f',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/amversion.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/auxdir.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/cond.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depout.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/init.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/install-sh.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/lead-dot.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/make.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/minuso.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/missing.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/mkdirp.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/runlog.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/sanity.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/strip.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/substnot.m4',
+                        '/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/tar.m4',
+                        'm4/acx_mpi.m4',
+                        'm4/issm_options.m4',
+                        'm4/matlab.m4',
+                        'configure.ac'
+                      ],
+                      {
+                        'AX_MEXEXT' => 1,
+                        'AX_MEX_CONDITIONAL' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'AX_PATH_MEX' => 1,
+                        'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
+                        'AX_REQUIRE_MATLAB_VERSION' => 1,
+                        '_AM_SET_OPTION' => 1,
+                        'AC_DEFUN' => 1,
+                        'AM_PROG_MKDIR_P' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AX_DOT_MEXEXT' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AM_MISSING_HAS_RUN' => 1,
+                        'AM_MISSING_PROG' => 1,
+                        'AX_MATLAB' => 1,
+                        'AX_CC_MEX' => 1,
+                        'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AX_CXXFLAGS_WARN_ALL' => 1,
+                        'AC_DEFUN_ONCE' => 1,
+                        'AM_PROG_INSTALL_STRIP' => 1,
+                        '_m4_warn' => 1,
+                        'AX_MATLAB_SYS_ZLIB' => 1,
+                        'AM_SANITY_CHECK' => 1,
+                        'include' => 1,
+                        'AX_CFLAGS_WARN_ALL' => 1,
+                        '_AM_PROG_TAR' => 1,
+                        'ISSM_OPTIONS' => 1,
+                        'AX_MATLAB_VERSION' => 1,
+                        'AX_REQUIRE_MATLAB' => 1,
+                        'AM_AUX_DIR_EXPAND' => 1,
+                        'AM_DEP_TRACK' => 1,
+                        'AX_MEX_OPTIONS' => 1,
+                        'AM_CONFIG_HEADER' => 1,
+                        '_AM_SET_OPTIONS' => 1,
+                        'AM_RUN_LOG' => 1,
+                        '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AX_MATLAB_CONDITIONAL' => 1,
+                        '_AM_IF_OPTION' => 1,
+                        'CHECK_ZLIB' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
+                        'm4_pattern_allow' => 1,
+                        '_AM_AUTOCONF_VERSION' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        '_AM_MANGLE_OPTION' => 1,
+                        'AM_SET_LEADING_DOT' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'ACX_MPI' => 1,
+                        'AM_SET_DEPDIR' => 1,
+                        '_AM_DEPENDENCIES' => 1,
+                        'm4_include' => 1,
+                        'AM_PROG_INSTALL_SH' => 1,
+                        '_AC_AM_CONFIG_HEADER_HOOK' => 1,
+                        'AU_DEFUN' => 1,
+                        'AX_MATLAB_DIR' => 1,
+                        'AM_MAKE_INCLUDE' => 1
+                      }
+                    ], 'Autom4te::Request' )
+           );
+
Index: /issm/trunk/autom4te.cache/traces.0
===================================================================
--- /issm/trunk/autom4te.cache/traces.0	(revision 1)
+++ /issm/trunk/autom4te.cache/traces.0	(revision 1)
@@ -0,0 +1,1888 @@
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/amversion.m4:20: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.10.2], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/amversion.m4:37: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/auxdir.m4:52: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/cond.m4:34: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4:132: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4:142: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4:158: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depout.m4:63: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [# Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depout.m4:77: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4:12: -1- AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4:12: -1- AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.])dnl
+AC_CONFIG_HEADERS($@)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/init.m4:103: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/init.m4:125: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/install-sh.m4:14: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/lead-dot.m4:21: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/make.m4:51: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/minuso.m4:35: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/missing.m4:17: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/missing.m4:35: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/mkdirp.m4:26: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/runlog.m4:17: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/sanity.m4:51: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/strip.m4:28: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/tar.m4:95: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+])
+m4trace:m4/issm_options.m4:393: -1- AC_DEFUN([ISSM_OPTIONS], [
+	dnl Debugging option check.
+	AC_ARG_ENABLE([debugging],AS_HELP_STRING([--enable-debugging],
+					 [turn debug support on]),
+		[enable_debugging=$enableval],[enable_debugging=no])
+	if test "x$enable_debugging" = xyes; then
+	 AC_DEFINE([_DEBUG_],[1],[Macro to enable debugging in Dakota.])
+	fi
+
+	dnl serial build?
+	AC_ARG_WITH([serial],
+			  AS_HELP_STRING([--with-serial = value],
+							 [serial compilation. ]),
+			  [SERIAL_VALUE=$withval],[SERIAL_VALUE="yes"])
+	AC_MSG_CHECKING(for serial compilation)
+	AM_CONDITIONAL([NOSERIAL], [test $SERIAL_VALUE = no])
+	AC_MSG_RESULT($SERIAL_VALUE) 
+	
+
+	dnl parallel build?
+	AC_ARG_WITH([parallel],
+			  AS_HELP_STRING([--with-parallel = value],
+							 [parallel compilation. ]),
+			  [PARALLEL_VALUE=$withval],[PARALLEL_VALUE="yes"])
+	AC_MSG_CHECKING(for parallel compilation)
+	AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
+	AC_MSG_RESULT($PARALLEL_VALUE) 
+
+	dnl: check that at least serial or parallel builds have been requested!
+	if test "$SERIAL_VALUE" != "yes" ; then
+		if test "$PARALLEL_VALUE" != "yes"; then
+		AC_MSG_ERROR([cannot request --with-serial=no and --with-parallel=no at the same time!])
+		fi
+	fi
+
+
+	dnl Matlab directory
+	AC_ARG_WITH([matlab-dir],
+			  AS_HELP_STRING([--with-matlab-dir = DIR],
+							 [matlab root directory. necessary for serial build.]),
+			 [MATLAB_ROOT=$withval],[MATLAB_ROOT=""]) 
+	
+	if test -d "$MATLAB_ROOT"; then
+
+		AC_MSG_CHECKING(for Matlab headers and libraries in $MATLAB_ROOT)
+
+		dnl defaults
+		HAVE_MATLAB=yes
+		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
+		dnl  use matlab provided mexext routine to test for extension
+		MEXEXT=`$MATLAB_ROOT/bin/mexext`
+		MEXEXT=".$MEXEXT"
+		MEX=$MATLAB_ROOT/bin/mex
+
+		dnl OS-dependent variables and checks
+		case "${host_os}" in
+			*linux*)
+			if test "${host_cpu}" = "x86_64";
+			then
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnxa64/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
+			else
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
+			fi
+			;;
+		esac
+
+		AC_DEFINE([_HAVE_MATLAB_],[1],[with Matlab in ISSM src])
+		AC_SUBST([MATLABINCL])
+		AC_SUBST([MEX])
+		AC_SUBST([MEXEXT])
+		AC_SUBST([MEXLIB]) 
+		AC_SUBST([MEXLINK])
+	
+		AC_MSG_RESULT($HAVE_MATLAB)
+	else
+		HAVE_MATLAB=no
+	fi
+
+	
+	if test $HAVE_MATLAB = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([--with-matlab-dir  missing. Matlab is needed to run ISSM serially!])
+		fi
+	fi
+
+	dnl get version number
+	if test $HAVE_MATLAB = yes; then
+
+		AX_MATLAB_VERSION
+		
+		dnl  if matlab version is 7.5 and more, and if platform is x86_64, then compile with largearray
+		dnl   default is no 
+		largearrays=no
+		if test $MATLAB_MAJOR -ge 7; then 
+			if test $MATLAB_MINOR -ge 5; then 
+				if test "${host_cpu}" = "x86_64"; then
+					largearrays=yes
+				fi
+			fi
+		fi
+	fi
+	AM_CONDITIONAL(LARGEARRAYS, test x$largearrays = xyes)
+	
+	dnl Triangle directory
+	AC_ARG_WITH([triangle-dir],
+			  AS_HELP_STRING([--with-triangle-dir = DIR], [triangle root directory. necessary for serial build]),
+			 [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT=""]) 
+	AC_MSG_CHECKING(for Triangle headers and libraries )
+	if test -d "$TRIANGLE_ROOT"; then
+
+
+		dnl defaults
+		HAVE_TRIANGLE=yes
+		TRIANGLEINCL=-I$TRIANGLE_ROOT/
+		TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+
+		AC_DEFINE([_HAVE_TRIANGLE_],[1],[with Triangle in ISSM src])
+		AC_SUBST([TRIANGLEINCL])
+		AC_SUBST([TRIANGLELIB])
+
+	else
+		HAVE_TRIANGLE=no
+	fi
+	AC_MSG_RESULT($HAVE_TRIANGLE)
+
+	AC_MSG_CHECKING(for triangle and parallel status)
+	if test $HAVE_TRIANGLE = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([--with-triangle-dir  missing. Triangle is needed to run ISSM serially!])
+		fi
+	fi
+	AC_MSG_RESULT(ok)
+	
+		
+	dnl Metis directory
+	AC_ARG_WITH([metis-dir],
+			  AS_HELP_STRING([--with-metis-dir = DIR],
+							 [metis root directory. necessary for serial build]),
+			  [METIS_ROOT=$withval],[METIS_ROOT=""])
+
+	if test -d "$METIS_ROOT"; then
+
+		AC_MSG_CHECKING(for Metis headers and libraries in $METIS_ROOT)
+
+		dnl defaults
+		HAVE_METIS=yes
+		METISINCL=-I"$METIS_ROOT/Lib"
+		METISLIB=-L"$METIS_ROOT/ -lmetis"
+
+		AC_DEFINE([_HAVE_METIS_],[1],[with Metis in ISSM src])
+		AC_SUBST([METISINCL])
+		AC_SUBST([METISLIB])
+	else
+		HAVE_METIS=no
+	fi
+
+	if test $HAVE_METIS = no; then
+	AC_MSG_ERROR([--with-metis-dir  missing. Metis is needed to run ISSM]);
+	else
+	AC_MSG_RESULT($HAVE_METIS)
+	fi
+
+	dnl Mpi options!
+	AC_MSG_CHECKING(for mpi...)
+	AC_ARG_WITH([mpi-lib],
+			  AS_HELP_STRING([--with-mpi-lib = otions],
+							 [mpi options, for ex: "-L$MPIROOT -lmpich]),
+			  [MPILIB=$withval],[MPILIB=""])
+	
+	AC_ARG_WITH([mpi-include],
+			  AS_HELP_STRING([--with-mpi-include = DIR],
+							 [mpi include directory, necessary for parallel build]),
+			  [MPI_INCLUDE=$withval],[MPI_INCLUDE=""])
+
+	dnl check that --with-mpi-include and --with-mpi-lib have been provided
+	if test -z "$MPILIB" ; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!])
+		fi
+	else
+		if test -z "$MPI_INCLUDE" ; then
+			if test "$PARALLEL_VALUE" = "yes" ; then
+				AC_MSG_ERROR([empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!])
+			fi
+		else
+			HAVE_MPI=yes
+			MPIINCL=-I"$MPI_INCLUDE/"
+			
+			AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
+			AC_SUBST([MPIINCL])
+			AC_SUBST([MPILIB])
+		fi
+	fi
+	AC_MSG_RESULT(done)
+
+	dnl Petsc directory and architecture
+	AC_ARG_WITH([petsc-dir],
+			  AS_HELP_STRING([--with-petsc-dir = DIR],
+							 [petsc root directory, necessary for parallel build]),
+			  [PETSC_ROOT=$withval],[PETSC_ROOT=""])
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ROOT" = "" ; then
+			AC_MSG_ERROR([missing --with-petsc-dir argument for parallel compilation!])
+		fi
+	fi
+	
+	AC_ARG_WITH([petsc-arch],
+			  AS_HELP_STRING([--with-petsc-arch = DIR],
+							 [petsc arch , necessary for parallel build]),
+			  [PETSC_ARCH=$withval],[PETSC_ARCH=""])
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ARCH" = "" ; then
+			AC_MSG_ERROR([missing --with-petsc-arch argument for parallel compilation!])
+		fi
+	fi
+	
+	AC_MSG_CHECKING(for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH)
+	
+	if test -d "$PETSC_ROOT"; then
+
+		if test -d "$PETSC_ROOT/bmake/$PETSC_ARCH"; then
+		
+			PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
+			PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+			                          
+
+
+			AC_DEFINE([_HAVE_PETSC_],[1],[with Petsc in ISSM src])
+			AC_SUBST([PETSCINCL])
+			AC_SUBST([PETSCLIB])
+
+			HAVE_PETSC=yes
+		else
+			HAVE_PETSC=no
+		fi
+	else
+		HAVE_PETSC=no
+	fi
+
+	if test $HAVE_PETSC = no; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!])
+		fi
+	else
+		AC_MSG_RESULT($HAVE_PETSC)
+	fi
+
+
+	dnl Slepc directory
+	AC_ARG_WITH([slepc-dir],
+			  AS_HELP_STRING([--with-slepc-dir = DIR],
+							 [slepc root directory]),
+			  [SLEPC_ROOT=$withval],[SLEPC_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Slepc headers and libraries in $SLEPC_ROOT)
+	if test -d "$SLEPC_ROOT"; then
+
+
+		dnl defaults
+		HAVE_SLEPC=yes
+		SLEPCINCL=-I"$SLEPC_ROOT/include"
+		SLEPCLIB=-L"$SLEPC_ROOT/lib/ -lslepc"
+
+		AC_DEFINE([_HAVE_SLEPC_],[1],[with Slepc in ISSM src])
+		AC_SUBST([SLEPCINCL])
+		AC_SUBST([SLEPCLIB])
+	else
+		HAVE_SLEPC=no
+	fi
+	AC_MSG_RESULT($HAVE_SLEPC)
+	
+	dnl Scalapack directory
+	AC_ARG_WITH([scalapack-dir],
+			  AS_HELP_STRING([--with-scalapack-dir = DIR],
+							 [scalapack root directory]),
+			  [SCALAPACK_ROOT=$withval],[SCALAPACK_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Scalapack headers and libraries in $SCALAPACK_ROOT)
+	if test -d "$SCALAPACK_ROOT"; then
+
+
+		dnl defaults
+		HAVE_SCALAPACK=yes
+		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+
+		AC_DEFINE([_HAVE_SCALAPACK_],[1],[with Scalapack in ISSM src])
+		AC_SUBST([SCALAPACKLIB])
+	else
+		HAVE_SCALAPACK=no
+	fi
+	AC_MSG_RESULT($HAVE_SCALAPACK)
+
+	dnl Blas-lapack directory
+	AC_ARG_WITH([blas-lapack-dir],
+			  AS_HELP_STRING([--with-blas-lapack-dir = DIR],
+							 [blas-lapack root directory]),
+			  [BLASLAPACK_ROOT=$withval],[BLASLAPACK_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT)
+	if test -d "$BLASLAPACK_ROOT"; then
+
+
+		dnl defaults
+		HAVE_BLASLAPACK=yes
+		BLASLAPACKINCL=""
+		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
+
+		AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with Scalapack in ISSM src])
+		AC_SUBST([BLASLAPACKLIB])
+		AC_SUBST([BLASLAPACKINCL])
+	else
+		HAVE_BLASLAPACK=no
+	fi
+	AC_MSG_RESULT($HAVE_BLASLAPACK)
+
+
+	dnl Plapack directory
+	AC_ARG_WITH([plapack-dir],
+			  AS_HELP_STRING([--with-plapack-dir = DIR],
+							 [plapack root directory]),
+			  [PLAPACK_ROOT=$withval],[PLAPACK_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Plapack headers and libraries in $PLAPACK_ROOT)
+	if test -d "$PLAPACK_ROOT"; then
+
+
+		dnl defaults
+		HAVE_PLAPACK=yes
+		PLAPACKINCL=-I"$PLAPACK_ROOT/INCLUDE"
+		PLAPACKLIB=-L"$PLAPACK_ROOT/ -lPLAPACK"
+
+		AC_DEFINE([_HAVE_PLAPACK_],[1],[with Plapack in ISSM src])
+		AC_SUBST([PLAPACKINCL])
+		AC_SUBST([PLAPACKLIB])
+	else
+		HAVE_PLAPACK=no
+	fi
+	AC_MSG_RESULT($HAVE_PLAPACK)
+
+	dnl Mumps directory
+	AC_ARG_WITH([mumps-dir],
+			  AS_HELP_STRING([--with-mumps-dir = DIR],
+							 [mumps root directory]),
+			  [MUMPS_ROOT=$withval],[MUMPS_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Mumps headers and libraries in $MUMPS_ROOT)
+	if test -d "$MUMPS_ROOT"; then
+
+		dnl defaults
+		HAVE_MUMPS=yes
+		MUMPSINCL=-I"$MUMPS_ROOT/include"
+		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps -lpord"
+
+		AC_DEFINE([_HAVE_MUMPS_],[1],[with Mumps in ISSM src])
+		AC_SUBST([MUMPSINCL])
+		AC_SUBST([MUMPSLIB])
+	else
+		HAVE_MUMPS=no
+	fi
+	AC_MSG_RESULT($HAVE_MUMPS)
+
+	dnl Blacs directory
+	AC_ARG_WITH([blacs-dir],
+			  AS_HELP_STRING([--with-blacs-dir = DIR],
+							 [blacs root directory]),
+			  [BLACS_ROOT=$withval],[BLACS_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Blacs headers and libraries in $BLACS_ROOT)
+	if test -d "$BLACS_ROOT"; then
+
+		dnl defaults
+		HAVE_BLACS=yes
+		BLACSINCL=""
+		BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
+        
+		AC_DEFINE([_HAVE_BLACS_],[1],[with Blacs in ISSM src])
+		AC_SUBST([BLACSINCL])
+		AC_SUBST([BLACSLIB])
+	else
+		HAVE_BLACS=no
+	fi
+	AC_MSG_RESULT($HAVE_BLACS)
+
+
+
+
+])
+m4trace:m4/matlab.m4:104: -1- AC_DEFUN([AX_CFLAGS_WARN_ALL], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic  % -Wall"       dnl   GCC
+   "-xstrconst % -v"          dnl Solaris C
+   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
+   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+   "-ansi -ansiE % -fullwarn" dnl IRIX
+   "+ESlit     % +w1"         dnl HP-UX C
+   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+   #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+   AC_TRY_COMPILE([],[return 0;],
+   [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+     .ok|.ok,*) m4_ifvaln($3,$3) ;;
+   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+   *) m4_ifvaln($3,$3,[
+   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+   fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+m4trace:m4/matlab.m4:147: -1- AC_DEFUN([AX_CXXFLAGS_WARN_ALL], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic  % -Wall"       dnl   GCC
+   "-xstrconst % -v"          dnl Solaris C
+   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
+   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+   "-ansi -ansiE % -fullwarn" dnl IRIX
+   "+ESlit     % +w1"         dnl HP-UX C
+   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+   #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+   AC_TRY_COMPILE([],[return 0;],
+   [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+     .ok|.ok,*) m4_ifvaln($3,$3) ;;
+   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+   *) m4_ifvaln($3,$3,[
+   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+   fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+m4trace:m4/matlab.m4:226: -1- AC_DEFUN([AX_MATLAB_DIR], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB_VERSION])
+AC_REQUIRE([AC_CANONICAL_HOST])
+ax_matlab_dir="\${datadir}/matlab"
+AC_ARG_WITH([matlab-dir], AC_HELP_STRING([--with-matlab-dir=ARG], [use ARG as the top-level installation directory for Matlab files [[$(datadir)/matlab]]]),
+[case $withval in
+  yes | no)
+    AC_MSG_ERROR([invalid value '$withval' for --with-matlab-dir])
+    ;;
+  *)
+    ax_matlab_dir=$withval
+    ;;
+esac])
+AC_MSG_CHECKING([for top-level installation directory for Matlab files])
+AC_MSG_RESULT([$ax_matlab_dir])
+matlabdir=$ax_matlab_dir
+AC_SUBST([matlabdir])
+matlabverdir="\${matlabdir}/$MATLAB_VERSION"
+AC_SUBST([matlabverdir])
+matlabarchdir="\${matlabverdir}/$host"
+AC_SUBST([matlabarchdir])
+matlabprivatedir="\${matlabdir}/private"
+AC_SUBST([matlabprivatedir])
+matlabprivateverdir="\${matlabverdir}/private"
+AC_SUBST([matlabprivateverdir])
+matlabprivatearchdir="\${matlabarchdir}/private"
+AC_SUBST([matlabprivatearchdir])
+])
+m4trace:m4/matlab.m4:323: -1- AC_DEFUN([AX_MATLAB_VERSION], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AX_MATLAB])
+AC_CACHE_CHECK([for Matlab version], [ax_cv_matlab_version],
+[if test "${MATLAB_VERSION+set}" = set ; then
+    ax_cv_matlab_version=$MATLAB_VERSION
+else
+    ax_cv_matlab_version=
+    # Loop over all known architectures.  The final dot covers
+    # Matlab R11 and Matlab V4 for Windows.
+    for ax_arch in alpha glnxa64 glnx86 hp700 hpux ibm_rs sgi sol2 win32 mac maci . ; do
+        for ax_exec_name in matlab$EXEEXT MATLAB ; do
+		ax_matlab_exec=$MATLAB/bin/$ax_arch/${ax_exec_name}
+		if test -f $ax_matlab_exec ; then
+	    		# For Matlab R12, the version number is stored in a
+	    		# shared library.
+	    		ax_matlab_exec_2=`find $MATLAB/bin/$ax_arch -type f -name libmwservices\* -print 2> /dev/null`
+	    		if test -n "$ax_matlab_exec_2" ; then
+				ax_cv_matlab_version=`strings $ax_matlab_exec_2 2> /dev/null | egrep '^\|build_version_\|@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^|build_version_|\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+				if test -n "$ax_cv_matlab_version" ; then
+		    			break
+				fi
+	    		fi
+	    		# For Matlab R11 and Matlab V4, the version number
+	    		# is stored in the executable program.
+	    		ax_cv_matlab_version=`strings $ax_matlab_exec 2> /dev/null | egrep '^@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+	    		if test -n "$ax_cv_matlab_version" ; then
+				break
+	    		fi
+		fi
+    	done
+	if test -n "$ax_cv_matlab_version" ; then
+		break
+	fi
+    done
+    if test -z "$ax_cv_matlab_version" ; then
+	ax_cv_matlab_version="not found"
+    fi
+fi])
+case $ax_cv_matlab_version in
+  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
+    MATLAB_VERSION=$ax_cv_matlab_version
+    MATLAB_MAJOR=`echo $MATLAB_VERSION | sed -e 's/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/'`
+    MATLAB_MINOR=`echo $MATLAB_VERSION | sed -e 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
+    ;;
+  *)
+    if test x$ax_enable_matlab = xyes ; then
+	AC_MSG_ERROR([can not determine Matlab version number])
+    fi
+    MATLAB_VERSION=
+    MATLAB_MAJOR=
+    MATLAB_MINOR=
+    ;;
+esac
+AC_SUBST([MATLAB_VERSION])
+AC_SUBST([MATLAB_MAJOR])
+AC_SUBST([MATLAB_MINOR])
+if test x$MATLAB_VERSION != x ; then
+    AC_DEFINE_UNQUOTED([MATLAB_MAJOR], [$MATLAB_MAJOR], [Define to the Matlab major version number.])
+    AC_DEFINE_UNQUOTED([MATLAB_MINOR], [$MATLAB_MINOR], [Define to the Matlab minor version number.])
+fi
+])
+m4trace:m4/matlab.m4:365: -1- AC_DEFUN([AX_REQUIRE_MATLAB_VERSION], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB_VERSION])
+if test x$MATLAB_VERSION = x ; then
+    AC_MSG_ERROR([can not determine Matlab version number])
+fi
+m4_if([$1], [], [],
+[AC_MSG_CHECKING([if Matlab version is sufficient])
+ax_version='$1'
+case $ax_version in
+  @<:@1-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@)
+    ax_major=$ax_version
+    ax_minor=''
+    ;;
+  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
+    ax_major=`echo $ax_version | sed 's/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/'`
+    ax_minor=`echo $ax_version | sed 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
+    ;;
+  *)
+    AC_MSG_RESULT([failure])
+    AC_MSG_NOTICE([report this bug to the responsible package maintainer])
+    AC_MSG_ERROR([invalid Matlab version number argument to AX_REQUIRE_MATLAB_VERSION])
+    ;;
+esac
+ax_ans=yes
+if test $MATLAB_MAJOR -eq $ax_major ; then
+    if test x$ax_minor != x && test $MATLAB_MINOR -lt $ax_minor ; then
+	ax_ans=no
+    fi
+elif test $MATLAB_MAJOR -lt $ax_major ; then
+    ax_ans=no
+fi
+AC_MSG_RESULT([$ax_ans])
+if test x$ax_ans = xno ; then
+    AC_MSG_ERROR([require Matlab version $ax_version or above])
+fi])
+])
+m4trace:m4/matlab.m4:469: -1- AC_DEFUN([AX_MATLAB], [dnl
+AC_PREREQ([2.50])
+ax_enable_matlab=
+AC_ARG_WITH([matlab-dir], AC_HELP_STRING([--with-matlab-dir=ARG], [check for Matlab [[yes]]]),
+[case $withval in
+  yes | no)
+    # Explicitly enable or disable Matlab but determine
+    # Matlab prefix automatically.
+    ax_enable_matlab=$withval
+    ;;
+  *)
+    # Enable Matlab and use ARG as the Matlab prefix.
+    # ARG must be an existing directory.
+    ax_enable_matlab=yes
+    MATLAB=`cd "${withval-/}" > /dev/null 2>&1 && pwd`
+    if test -z "$MATLAB" ; then
+	AC_MSG_ERROR([invalid value '$withval' for --with-matlab])
+    fi
+    ;;
+esac])
+if test x$ax_enable_matlab != xno ; then
+AC_CACHE_CHECK([for Matlab prefix], [ax_cv_matlab],
+[if test "${MATLAB+set}" = set ; then
+    ax_cv_matlab=`cd "${MATLAB-/}" > /dev/null 2>&1 && pwd`
+else
+    ax_cv_matlab=
+    IFS=${IFS= 	} ; ax_ifs=$IFS ; IFS=:
+    for ax_dir in ${PATH-/opt/bin:/usr/local/bin:/usr/bin:/bin} ; do
+	if test -z "$ax_dir" ; then
+	    ax_dir=.
+	fi
+	if test -x "$ax_dir/matlab" ; then
+	    ax_dir=`echo "$ax_dir" | sed 's,/bin$,,'`
+	    # Directory sanity check.
+	    ax_cv_matlab=`cd "${ax_dir-/}" > /dev/null 2>&1 && pwd`
+	    if test -n "$ax_cv_matlab" ; then
+		break
+	    fi
+	fi
+    done
+    IFS=$ax_ifs
+fi
+if test -z "$ax_cv_matlab" ; then
+    ax_cv_matlab="not found"
+fi])
+if test "$ax_cv_matlab" = "not found" ; then
+    unset MATLAB
+else
+    # Strip trailing dashes.
+    MATLAB=`echo "$ax_cv_matlab" | sed 's,/*$,,'`
+fi
+AC_MSG_CHECKING([whether to enable Matlab support])
+if test x$ax_enable_matlab != xno ; then
+    if test "${MATLAB+set}" = set && test -d "$MATLAB/extern/include" ; then
+	ax_enable_matlab=yes
+    elif test x$ax_enable_matlab = x ; then
+	ax_enable_matlab=no
+    else
+	# Fail if Matlab was explicitly enabled.
+	AC_MSG_RESULT([failure])
+	AC_MSG_ERROR([check your Matlab setup])
+    fi
+fi
+AC_MSG_RESULT([$ax_enable_matlab])
+if test x$ax_enable_matlab = xyes ; then
+    AC_DEFINE([HAVE_MATLAB], [1], [Define if you have Matlab.])
+fi
+fi
+AC_SUBST([MATLAB])
+])
+m4trace:m4/matlab.m4:481: -1- AC_DEFUN([AX_REQUIRE_MATLAB], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB])
+if test x$ax_enable_matlab = xno ; then
+    AC_MSG_ERROR([can not enable Matlab support])
+fi
+])
+m4trace:m4/matlab.m4:491: -1- AC_DEFUN([AX_MATLAB_CONDITIONAL], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB])
+AM_CONDITIONAL([MATLAB], [test x$ax_enable_matlab = xyes])
+])
+m4trace:m4/matlab.m4:551: -1- AC_DEFUN([AX_PATH_MEX], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB])
+AC_REQUIRE([AX_MEX_OPTIONS])
+AC_REQUIRE([AC_CANONICAL_HOST])
+if test "${MEX+set}" != set ; then
+    case $host_os in
+      *cygwin* | *mingw32*)
+	ax_list='mextool mex mex.bat'
+	;;
+      *)
+	ax_list='mex'
+	;;
+    esac
+    AC_PATH_PROGS([MEX], $ax_list, mex, $MATLAB/bin:$PATH)
+fi
+AC_SUBST([MEX])
+if test "${MEXFLAGS+set}" != set ; then
+    MEXFLAGS=-O
+fi
+AC_SUBST([MEXFLAGS])
+if test "${MEXLDADD+set}" != set ; then
+    MEXLDADD=
+fi
+AC_SUBST([MEXLDADD])
+])
+m4trace:m4/matlab.m4:625: -1- AC_DEFUN([AX_MEX_OPTIONS], [dnl
+AC_PREREQ([2.50])
+mex_options=yes
+AC_ARG_WITH([mex-options], AC_HELP_STRING([--with-mex-options=ARG], [use MEX options file ARG [[standard]]]),
+[mex_options=$withval])
+AC_MSG_CHECKING([for MEX options file handling])
+case $mex_options in
+  yes)
+    AC_MSG_RESULT([standard])
+    mexopts_sh=
+    ;;
+  no)
+    AC_MSG_RESULT([disabled])
+    mexopts_sh=$ac_aux_dir/noopts.sh
+    ;;
+  *)
+    AC_MSG_RESULT([enabled])
+    mexopts_sh=$mex_options
+    ;;
+esac
+if test -n "$mexopts_sh" ; then
+    AC_MSG_CHECKING([whether MEX options file exists])
+    if test -f "$mexopts_sh" ; then
+	AC_MSG_RESULT([yes])
+	# Canonicalize file name.
+	mexopts_sh_dir=`echo "$mexopts_sh" | sed 's,[[^/]]*$,,'`
+	mexopts_sh_dir=`cd "${mexopts_sh_dir-.}" && pwd`
+	mexopts_sh_name=`echo "$mexopts_sh" | sed 's,.*/,,'`
+	mexopts_sh="$mexopts_sh_dir/$mexopts_sh_name"
+    else
+	AC_MSG_RESULT([no])
+	AC_MSG_ERROR([$mexopts_sh: no such file])
+    fi
+    MEXOPTS="-f $mexopts_sh"
+else
+    MEXOPTS=
+fi
+AC_SUBST([mexopts_sh])
+AC_SUBST([MEXOPTS])
+])
+m4trace:m4/matlab.m4:711: -1- AC_DEFUN([AX_MEXEXT], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_PATH_MEX])
+AC_CACHE_CHECK([for MEX-file suffix], [ax_cv_mexext],
+[if test "${MEXEXT+set}" = set ; then
+    ax_cv_mexext="$MEXEXT"
+else
+    if test -x ${MATLAB}/bin/mexext ; then
+      ax_cv_mexext=`${MATLAB}/bin/mexext`
+    fi
+fi
+if test "x${ax_cv_mexext}" = "x" ; then
+    echo 'mexFunction () {}' > ax_c_test.c
+    $MEX $MEXOPTS $MEXFLAGS -output ax_c_test ax_c_test.c $MEXLDADD 2> /dev/null 1>&2
+    if test -f ax_c_test.dll ; then
+	ax_cv_mexext=dll
+    elif test -f ax_c_test.mex ; then
+	ax_cv_mexext=mex
+    elif test -f ax_c_test.mexaxp ; then
+	ax_cv_mexext=mexaxp
+    elif test -f ax_c_test.mexglx ; then
+	ax_cv_mexext=mexglx
+    elif test -f ax_c_test.mexa64 ; then
+	ax_cv_mexext=mexa64
+    elif test -f ax_c_test.mexmac ; then
+	ax_cv_mexext=mexmac
+    elif test -f ax_c_test.mexmaci ; then
+	ax_cv_mexext=mexmaci
+    elif test -f ax_c_test.mexhp7 ; then
+	ax_cv_mexext=mexhp7
+    elif test -f ax_c_test.mexhpux ; then
+	ax_cv_mexext=mexhpux
+    elif test -f ax_c_test.mexrs6 ; then
+	ax_cv_mexext=mexrs6
+    elif test -f ax_c_test.mexsg ; then
+	ax_cv_mexext=mexsg
+    elif test -f ax_c_test.mexsol ; then
+	ax_cv_mexext=mexsol
+    elif test -f ax_c_test.mexs64 ; then
+	ax_cv_mexext=mexs64
+    elif test -f ax_c_test.mexw32 ; then
+	ax_cv_mexext=mexw32
+    elif test -f ax_c_test.mexw64 ; then
+	ax_cv_mexext=mexw64
+    else
+	ax_cv_mexext=unknown
+    fi
+    rm -f ax_c_test*
+fi])
+MEXEXT="$ax_cv_mexext"
+AC_SUBST([MEXEXT])
+])
+m4trace:m4/matlab.m4:732: -1- AC_DEFUN([AX_DOT_MEXEXT], [dnl
+AC_REQUIRE([AX_MEXEXT])
+case $MEXEXT in
+  .*)
+    ;;
+  unknown)
+    ;;
+  *)
+    if test -n "$MEXEXT" ; then
+	MEXEXT=.$MEXEXT
+	AC_MSG_RESULT([setting MEX-file suffix to $MEXEXT])
+	AC_SUBST([MEXEXT])
+    fi
+    ;;
+esac
+])
+m4trace:m4/matlab.m4:947: -1- AC_DEFUN([AX_CC_MEX], [dnl
+AC_REQUIRE([AX_PATH_MEX])
+AC_REQUIRE([AX_DOT_MEXEXT])
+AC_LANG([C])
+
+dnl Source code for the test matlab C program
+ac_mex_source='[#include "mex.h"
+void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { return; }]'
+
+dnl Check that the test C program can be compiled with mex
+ac_exeext_save=$ac_exeext
+ac_exeext=$MEXEXT
+ac_link_save=$ac_link
+ac_link='$MEX $MEXOPTS $MEXFLAGS -output conftest$ac_exeext conftest.$ac_ext $MEXLDADD >&AS_MESSAGE_LOG_FD'
+AC_MSG_CHECKING([if mex works])
+AC_LINK_IFELSE([AC_LANG_SOURCE($ac_mex_source)],
+[AC_MSG_RESULT([yes])],
+[AC_MSG_RESULT([no])])
+
+dnl Try to figure out how mex compiles a C program
+ax_cv_mex_version=
+ac_cv_mex_cppflags=
+ac_cv_mex_includes=
+ac_cv_mex_cflags=
+ac_cv_mex_libs=
+ac_cv_mex_ldflags=
+
+dnl Variable that will be subsituted
+MEX_VERSION_C=
+MEX_LDFLAGS=
+MEX_CPPFLAGS=
+MEX_INCLUDES=
+MEX_CFLAGS=
+MEX_LIBS=
+MEX_LDFLAGS=
+
+AC_MSG_CHECKING([if mex -n works])
+ac_save_MEXOPTS=$MEXOPTS
+MEXOPTS="-n $MEXOPTS"
+AC_LANG_CONFTEST([AC_LANG_SOURCE($ac_mex_source)])
+(eval echo $as_me:__oline__: \"$ac_link\") >&AS_MESSAGE_LOG_FD
+ac_cv_mex_n_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1`
+ac_cv_mex_n_result=$?
+echo "$ac_cv_mex_n_output" >&AS_MESSAGE_LOG_FD
+MEXOPTS=$ac_save_MEXOPTS
+rm -f conftest*
+ac_exeext=$ac_exeext_save
+ac_link=$ac_link_save
+
+if test $ac_cv_mex_n_result -eq 0 ; then
+  ac_cv_mex_working=yes
+  AC_MSG_RESULT([$ac_cv_mex_working])
+
+  dnl Save positional arguments (if any)
+  ac_save_positional="$[@]"
+
+  set X $ac_cv_mex_n_output
+  while test $[@%:@] != 1; do
+    shift
+      ac_arg=$[1]
+      case $ac_arg in
+        *mexversion.c)
+          ax_cv_mex_version=$ac_arg
+          ;;
+        -pthread)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cflags, ,
+            ac_cv_mex_cflags="$ac_cv_mex_cflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;
+        -mt)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cflags, ,
+            ac_cv_mex_cflags="$ac_cv_mex_cflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;
+        -ansi)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          ;;
+        -D*)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          ;;
+        -I*)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_includes, ,
+            ac_cv_mex_includes="$ac_cv_mex_includes $ac_arg")
+          ;;
+        -f* | -O* | -xO* | -xlibmil )
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cflags, ,
+            ac_cv_mex_cflags="$ac_cv_mex_cflags $ac_arg")
+          ;;
+        -l*)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_libs, ,
+            ac_cv_mex_libs="$ac_cv_mex_libs $ac_arg")
+          ;;
+        -L)
+          # When -L is seen by itself, it takes an argument
+          # We remove the space between option and argument and re-iterate
+          # unless we find an empty arg or a new option (starting with -)
+          case $[2] in
+             "" | -*);;
+             *)
+             ac_arg="$ac_arg$[2]"
+             shift; shift
+             set X $ac_arg "$[@]"
+             ;;
+           esac
+           ;;
+        -L* | -Wl,* | -shared | -bundle | -G)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;
+        -undefined)
+          # the darwin linker undefined option takes and argument
+          ac_arg="$ac_arg $[2]"
+          shift
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;   
+          # ignore everything else
+      esac
+  done
+  
+  # restore positional arguments
+  set X $ac_save_positional; shift
+
+  MEX_VERSION_C=$ax_cv_mex_version
+
+  AC_MSG_CHECKING([for CPPFLAGS needed to build mex objects])
+  if test "x$ac_cv_mex_cppflags" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_CPPFLAGS=`echo $ac_cv_mex_cppflags | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_CPPFLAGS])
+  fi
+  AC_MSG_CHECKING([for INCLUDES needed to build mex objects])
+  if test "x$ac_cv_mex_includes" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_INCLUDES=`echo $ac_cv_mex_includes | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_INCLUDES])
+  fi
+  AC_MSG_CHECKING([for CFLAGS needed to build mex objects])
+  if test "x$ac_cv_mex_cflags" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_CFLAGS=`echo $ac_cv_mex_cflags | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_CFLAGS])
+  fi
+  AC_MSG_CHECKING([for LIBS needed to build mex objects])
+  if test "x$ac_cv_mex_libs" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_LIBS=`echo $ac_cv_mex_libs | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_LIBS])
+  fi
+  AC_MSG_CHECKING([for LDFLAGS needed to build mex objects])
+  if test "x$ac_cv_mex_ldflags" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_LDFLAGS=`echo $ac_cv_mex_ldflags | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_LDFLAGS])
+  fi
+else
+  ac_cv_mex_working=no
+  AC_MSG_RESULT([$ac_cv_mex_working])
+fi
+
+AC_SUBST(MEX_VERSION_C)
+AC_SUBST(MEX_CPPFLAGS)
+AC_SUBST(MEX_INCLUDES)
+AC_SUBST(MEX_CFLAGS)
+AC_SUBST(MEX_LIBS)
+AC_SUBST(MEX_LDFLAGS)
+
+])
+m4trace:m4/matlab.m4:958: -1- AC_DEFUN([AX_MEX_CONDITIONAL], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_CC_MEX])
+AM_CONDITIONAL(MEX, test x$ac_cv_mex_working = xyes)
+AM_CONDITIONAL(MEX_VERSION_C, test x$ax_cv_mex_version != x)
+])
+m4trace:m4/matlab.m4:1020: -1- AC_DEFUN([AX_MATLAB_SYS_ZLIB], [dnl
+AC_REQUIRE([AX_PATH_MEX])
+AC_LANG([C])
+
+ax_matlab_sys_zlib=
+
+if test x$ax_cv_mexext != xunknown && test x$ax_cv_mexext != x ; then
+  # Where should we search for libraries
+  ax_sys_lib_search_path="/lib /usr/lib /usr/local/lib"
+
+  # If this is a 64 bit link box look in the place where redhat keeps libs
+  if test x$ax_cv_mexext = xmexa64; then
+    ax_sys_lib_search_path="/lib64 /usr/lib64 /usr/local/lib64 $ax_sys_lib_search_path"
+  fi
+
+  # set the extension of the library we are looking for
+  if test x$ax_cv_mexext = xmexmac || test x$ax_cv_mexext = xmexmaci ; then
+    ax_zlib_lib_ext=".dylib"
+  else
+    ax_zlib_lib_ext=".a"
+  fi
+
+  for lib_path in $ax_sys_lib_search_path ; do
+    ax_matlab_search_zlib=$lib_path/libz$ax_zlib_lib_ext
+
+   AC_CHECK_FILE([$ax_matlab_search_zlib],
+     [
+       AC_MSG_CHECKING([for gzungetc in $ax_matlab_search_zlib])
+       ac_save_LIBS=$LIBS
+       LIBS="$ax_matlab_search_zlib $LIBS"
+       AC_LINK_IFELSE(
+         [ AC_LANG_PROGRAM( ,[[gzungetc();]]) ],
+         [ 
+           AC_MSG_RESULT([yes]) 
+           ax_matlab_sys_zlib=$ax_matlab_search_zlib
+         ],
+         [ AC_MSG_RESULT([no]) ]
+       )
+       LIBS=$ac_save_LIBS
+     ], )
+    
+    if test x$ax_matlab_sys_zlib != x ; then
+      break
+    fi
+  done
+fi
+
+MATLAB_SYS_ZIB=$ax_matlab_sys_zlib
+
+AC_SUBST([MATLAB_SYS_ZIB])
+
+])
+m4trace:m4/matlab.m4:1119: -1- AC_DEFUN([CHECK_ZLIB], [
+AC_ARG_WITH([zlib], [AS_HELP_STRING([--with-zlib=DIR], [root directory path of zlib installation (defaults to /usr/local or /usr if not found in /usr/local), --without-zlib to disable zlib usage completely])], [], [with_zlib=yes])
+
+if test "x$with_zlib" != xno ; then
+  if test "x$with_zlib" != xyes ; then
+    ZLIB_HOME=$with_zlib
+  else
+    # default locations
+    ZLIB_HOME=/usr/local
+    if test ! -f "${ZLIB_HOME}/include/zlib.h"
+    then
+      ZLIB_HOME=/usr
+    fi
+  fi
+
+  ZLIB_OLD_LDFLAGS=$LDFLAGS
+  ZLIB_OLD_CPPFLAGS=$LDFLAGS
+  LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+  CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+  AC_LANG_PUSH([C])
+  AC_CHECK_HEADERS([zlib.h])
+  AC_CHECK_LIB([z], [inflateEnd])
+  AC_LANG_POP([C])
+
+  if test "x$ac_cv_header_zlib_h" = "xyes" -a "x$ac_cv_lib_z_inflateEnd" = "xyes" ; then
+    AC_MSG_RESULT([zlib found in $ZLIB_HOME])
+    AC_SUBST([HAVE_LIBZ], [$ac_cv_lib_z_inflateEnd])
+  else
+    LDFLAGS="$ZLIB_OLD_LDFLAGS"
+    CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
+    AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib)
+  fi
+fi])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^SHELL$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PATH_SEPARATOR$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^exec_prefix$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^prefix$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^program_transform_name$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^bindir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sbindir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^libexecdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^datarootdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^datadir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sysconfdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sharedstatedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^localstatedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^includedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^oldincludedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^docdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^infodir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^htmldir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^dvidir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^pdfdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^psdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^libdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^localedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^mandir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^DEFS$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_C$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_N$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_T$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^build_alias$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^host_alias$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^target_alias$])
+m4trace:configure.ac:2: -1- AM_CONFIG_HEADER([config.h])
+m4trace:configure.ac:2: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.], [/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4:12: AM_CONFIG_HEADER is expanded from...
+configure.ac:2: the top level])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_cpu$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_vendor$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_os$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_cpu$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_vendor$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_os$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_cpu$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_vendor$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_os$])
+m4trace:configure.ac:4: -1- AM_INIT_AUTOMAKE
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.ac:4: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
+m4trace:configure.ac:4: -1- AM_AUTOMAKE_VERSION([1.10.2])
+m4trace:configure.ac:4: -1- _AM_AUTOCONF_VERSION([2.63])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__isrc$])
+m4trace:configure.ac:4: -1- _AM_SUBST_NOTMAKE([am__isrc])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^CYGPATH_W$])
+m4trace:configure.ac:4: -1- _AM_SET_OPTIONS([])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([no-define])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:4: -1- AM_SANITY_CHECK
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+m4trace:configure.ac:4: -1- AM_MISSING_HAS_RUN
+m4trace:configure.ac:4: -1- AM_AUX_DIR_EXPAND
+m4trace:configure.ac:4: -1- m4_pattern_allow([^ACLOCAL$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AUTOCONF], [autoconf])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOCONF$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOMAKE$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOHEADER$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^MAKEINFO$])
+m4trace:configure.ac:4: -1- AM_PROG_INSTALL_SH
+m4trace:configure.ac:4: -1- m4_pattern_allow([^install_sh$])
+m4trace:configure.ac:4: -1- AM_PROG_INSTALL_STRIP
+m4trace:configure.ac:4: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
+m4trace:configure.ac:4: -1- AM_PROG_MKDIR_P
+m4trace:configure.ac:4: -1- m4_pattern_allow([^MKDIR_P$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^mkdir_p$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AWK$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^SET_MAKE$])
+m4trace:configure.ac:4: -1- AM_SET_LEADING_DOT
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__leading_dot$])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([tar-ustar])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([tar-pax])
+m4trace:configure.ac:4: -1- _AM_PROG_TAR([v7])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AMTAR], [tar])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AMTAR$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__tar$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__untar$])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([no-dependencies])
+m4trace:configure.ac:5: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CFLAGS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^ac_ct_CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^EXEEXT$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^OBJEXT$])
+m4trace:configure.ac:6: -1- _AM_DEPENDENCIES([CC])
+m4trace:configure.ac:6: -1- AM_SET_DEPDIR
+m4trace:configure.ac:6: -1- m4_pattern_allow([^DEPDIR$])
+m4trace:configure.ac:6: -1- AM_OUTPUT_DEPENDENCY_COMMANDS
+m4trace:configure.ac:6: -1- AM_MAKE_INCLUDE
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__include$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__quote$])
+m4trace:configure.ac:6: -1- AM_DEP_TRACK
+m4trace:configure.ac:6: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEP_TRUE$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEP_FALSE$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CCDEPMODE$])
+m4trace:configure.ac:6: -1- AM_CONDITIONAL([am__fastdepCC], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXXFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^ac_ct_CXX$])
+m4trace:configure.ac:7: -1- _AM_DEPENDENCIES([CXX])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXXDEPMODE$])
+m4trace:configure.ac:7: -1- AM_CONDITIONAL([am__fastdepCXX], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
+m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE])
+m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^F77$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^FFLAGS$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^F77$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^ac_ct_F77$])
+m4trace:configure.ac:9: -1- m4_pattern_allow([^FLIBS$])
+m4trace:configure.ac:10: -1- AM_PROG_CC_C_O
+m4trace:configure.ac:10: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^XMKMF$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_DISPLAY_MISSING$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_CFLAGS$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_PRE_LIBS$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_LIBS$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_EXTRA_LIBS$])
+m4trace:configure.ac:12: -1- ISSM_OPTIONS
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_DEBUG_$])
+m4trace:configure.ac:12: -1- AM_CONDITIONAL([NOSERIAL], [test $SERIAL_VALUE = no])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^NOSERIAL_TRUE$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^NOSERIAL_FALSE$])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([NOSERIAL_TRUE])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([NOSERIAL_FALSE])
+m4trace:configure.ac:12: -1- AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^NOPARALLEL_TRUE$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^NOPARALLEL_FALSE$])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([NOPARALLEL_TRUE])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([NOPARALLEL_FALSE])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_MATLAB_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLABINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MEX$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MEXEXT$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MEXLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MEXLINK$])
+m4trace:configure.ac:12: -1- AX_MATLAB_VERSION
+m4trace:configure.ac:12: -1- AX_MATLAB
+m4trace:configure.ac:12: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+m4/matlab.m4:469: AX_MATLAB is expanded from...
+m4/matlab.m4:323: AX_MATLAB_VERSION is expanded from...
+m4/issm_options.m4:393: ISSM_OPTIONS is expanded from...
+configure.ac:12: the top level])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^HAVE_MATLAB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_VERSION$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_MAJOR$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_MINOR$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_MAJOR$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_MINOR$])
+m4trace:configure.ac:12: -1- AM_CONDITIONAL([LARGEARRAYS], [test x$largearrays = xyes])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^LARGEARRAYS_TRUE$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^LARGEARRAYS_FALSE$])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([LARGEARRAYS_TRUE])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([LARGEARRAYS_FALSE])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_TRIANGLE_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^TRIANGLEINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^TRIANGLELIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_METIS_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^METISINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^METISLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_MPI_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MPIINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MPILIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_PETSC_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^PETSCINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^PETSCLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_SLEPC_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^SLEPCINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^SLEPCLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_SCALAPACK_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^SCALAPACKLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_BLASLAPACK_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^BLASLAPACKLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^BLASLAPACKINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_PLAPACK_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^PLAPACKINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^PLAPACKLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_MUMPS_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MUMPSINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MUMPSLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_BLACS_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^BLACSINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^BLACSLIB$])
+m4trace:configure.ac:18: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.ac:18: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:18: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
+m4trace:configure.ac:18: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
Index: /issm/trunk/autom4te.cache/traces.1
===================================================================
--- /issm/trunk/autom4te.cache/traces.1	(revision 1)
+++ /issm/trunk/autom4te.cache/traces.1	(revision 1)
@@ -0,0 +1,636 @@
+m4trace:aclocal.m4:925: -1- m4_include([m4/issm_options.m4])
+m4trace:aclocal.m4:926: -1- m4_include([m4/matlab.m4])
+m4trace:configure.ac:1: -1- AC_INIT([ISSM], [1.0], [Eric Larour <eric.larour@jpl.nasa.gov>])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.ac:1: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([SHELL])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^SHELL$])
+m4trace:configure.ac:1: -1- AC_SUBST([PATH_SEPARATOR])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PATH_SEPARATOR$])
+m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_NAME])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_STRING])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:1: -1- AC_SUBST([exec_prefix], [NONE])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([exec_prefix])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^exec_prefix$])
+m4trace:configure.ac:1: -1- AC_SUBST([prefix], [NONE])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([prefix])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^prefix$])
+m4trace:configure.ac:1: -1- AC_SUBST([program_transform_name], [s,x,x,])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([program_transform_name])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^program_transform_name$])
+m4trace:configure.ac:1: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([bindir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^bindir$])
+m4trace:configure.ac:1: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([sbindir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sbindir$])
+m4trace:configure.ac:1: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([libexecdir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^libexecdir$])
+m4trace:configure.ac:1: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([datarootdir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^datarootdir$])
+m4trace:configure.ac:1: -1- AC_SUBST([datadir], ['${datarootdir}'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([datadir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^datadir$])
+m4trace:configure.ac:1: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([sysconfdir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sysconfdir$])
+m4trace:configure.ac:1: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([sharedstatedir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sharedstatedir$])
+m4trace:configure.ac:1: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([localstatedir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^localstatedir$])
+m4trace:configure.ac:1: -1- AC_SUBST([includedir], ['${prefix}/include'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([includedir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^includedir$])
+m4trace:configure.ac:1: -1- AC_SUBST([oldincludedir], ['/usr/include'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([oldincludedir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^oldincludedir$])
+m4trace:configure.ac:1: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
+				     ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
+				     ['${datarootdir}/doc/${PACKAGE}'])])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([docdir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^docdir$])
+m4trace:configure.ac:1: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([infodir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^infodir$])
+m4trace:configure.ac:1: -1- AC_SUBST([htmldir], ['${docdir}'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([htmldir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^htmldir$])
+m4trace:configure.ac:1: -1- AC_SUBST([dvidir], ['${docdir}'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([dvidir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^dvidir$])
+m4trace:configure.ac:1: -1- AC_SUBST([pdfdir], ['${docdir}'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([pdfdir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^pdfdir$])
+m4trace:configure.ac:1: -1- AC_SUBST([psdir], ['${docdir}'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([psdir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^psdir$])
+m4trace:configure.ac:1: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([libdir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^libdir$])
+m4trace:configure.ac:1: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([localedir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^localedir$])
+m4trace:configure.ac:1: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([mandir])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^mandir$])
+m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
+#undef PACKAGE_NAME])
+m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME])
+m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
+#undef PACKAGE_VERSION])
+m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING])
+m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT])
+m4trace:configure.ac:1: -1- AC_SUBST([DEFS])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([DEFS])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^DEFS$])
+m4trace:configure.ac:1: -1- AC_SUBST([ECHO_C])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([ECHO_C])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_C$])
+m4trace:configure.ac:1: -1- AC_SUBST([ECHO_N])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([ECHO_N])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_N$])
+m4trace:configure.ac:1: -1- AC_SUBST([ECHO_T])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([ECHO_T])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_T$])
+m4trace:configure.ac:1: -1- AC_SUBST([LIBS])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:1: -1- AC_SUBST([build_alias])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([build_alias])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^build_alias$])
+m4trace:configure.ac:1: -1- AC_SUBST([host_alias])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([host_alias])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^host_alias$])
+m4trace:configure.ac:1: -1- AC_SUBST([target_alias])
+m4trace:configure.ac:1: -1- AC_SUBST_TRACE([target_alias])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^target_alias$])
+m4trace:configure.ac:2: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.], [aclocal.m4:392: AM_CONFIG_HEADER is expanded from...
+configure.ac:2: the top level])
+m4trace:configure.ac:2: -1- AC_CONFIG_HEADERS([config.h])
+m4trace:configure.ac:3: -1- AC_CANONICAL_TARGET
+m4trace:configure.ac:3: -1- AC_CANONICAL_HOST
+m4trace:configure.ac:3: -1- AC_CANONICAL_BUILD
+m4trace:configure.ac:3: -1- AC_REQUIRE_AUX_FILE([config.sub])
+m4trace:configure.ac:3: -1- AC_REQUIRE_AUX_FILE([config.guess])
+m4trace:configure.ac:3: -1- AC_SUBST([build], [$ac_cv_build])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build$])
+m4trace:configure.ac:3: -1- AC_SUBST([build_cpu], [$[1]])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_cpu])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_cpu$])
+m4trace:configure.ac:3: -1- AC_SUBST([build_vendor], [$[2]])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_vendor])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_vendor$])
+m4trace:configure.ac:3: -1- AC_SUBST([build_os])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_os])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_os$])
+m4trace:configure.ac:3: -1- AC_SUBST([host], [$ac_cv_host])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host$])
+m4trace:configure.ac:3: -1- AC_SUBST([host_cpu], [$[1]])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_cpu])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_cpu$])
+m4trace:configure.ac:3: -1- AC_SUBST([host_vendor], [$[2]])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_vendor])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_vendor$])
+m4trace:configure.ac:3: -1- AC_SUBST([host_os])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_os])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_os$])
+m4trace:configure.ac:3: -1- AC_SUBST([target], [$ac_cv_target])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target$])
+m4trace:configure.ac:3: -1- AC_SUBST([target_cpu], [$[1]])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_cpu])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_cpu$])
+m4trace:configure.ac:3: -1- AC_SUBST([target_vendor], [$[2]])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_vendor])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_vendor$])
+m4trace:configure.ac:3: -1- AC_SUBST([target_os])
+m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_os])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_os$])
+m4trace:configure.ac:4: -1- AM_INIT_AUTOMAKE
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.ac:4: -1- AM_AUTOMAKE_VERSION([1.10.2])
+m4trace:configure.ac:4: -1- AC_REQUIRE_AUX_FILE([install-sh])
+m4trace:configure.ac:4: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.ac:4: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.ac:4: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([INSTALL_DATA])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.ac:4: -1- AC_SUBST([am__isrc], [' -I$(srcdir)'])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([am__isrc])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__isrc$])
+m4trace:configure.ac:4: -1- _AM_SUBST_NOTMAKE([am__isrc])
+m4trace:configure.ac:4: -1- AC_SUBST([CYGPATH_W])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([CYGPATH_W])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^CYGPATH_W$])
+m4trace:configure.ac:4: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([PACKAGE])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:4: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([VERSION])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:4: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:4: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
+#undef PACKAGE])
+m4trace:configure.ac:4: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:4: -1- AH_OUTPUT([VERSION], [/* Version number of package */
+#undef VERSION])
+m4trace:configure.ac:4: -1- AC_REQUIRE_AUX_FILE([missing])
+m4trace:configure.ac:4: -1- AC_SUBST([ACLOCAL])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([ACLOCAL])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^ACLOCAL$])
+m4trace:configure.ac:4: -1- AC_SUBST([AUTOCONF])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([AUTOCONF])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOCONF$])
+m4trace:configure.ac:4: -1- AC_SUBST([AUTOMAKE])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([AUTOMAKE])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOMAKE$])
+m4trace:configure.ac:4: -1- AC_SUBST([AUTOHEADER])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([AUTOHEADER])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOHEADER$])
+m4trace:configure.ac:4: -1- AC_SUBST([MAKEINFO])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([MAKEINFO])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^MAKEINFO$])
+m4trace:configure.ac:4: -1- AC_SUBST([install_sh])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([install_sh])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^install_sh$])
+m4trace:configure.ac:4: -1- AC_SUBST([STRIP])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([STRIP])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.ac:4: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
+m4trace:configure.ac:4: -1- AC_REQUIRE_AUX_FILE([install-sh])
+m4trace:configure.ac:4: -1- AC_SUBST([MKDIR_P])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([MKDIR_P])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^MKDIR_P$])
+m4trace:configure.ac:4: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([mkdir_p])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^mkdir_p$])
+m4trace:configure.ac:4: -1- AC_SUBST([AWK])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([AWK])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AWK$])
+m4trace:configure.ac:4: -1- AC_SUBST([SET_MAKE])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([SET_MAKE])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^SET_MAKE$])
+m4trace:configure.ac:4: -1- AC_SUBST([am__leading_dot])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([am__leading_dot])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__leading_dot$])
+m4trace:configure.ac:4: -1- AC_SUBST([AMTAR])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([AMTAR])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AMTAR$])
+m4trace:configure.ac:4: -1- AC_SUBST([am__tar])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([am__tar])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__tar$])
+m4trace:configure.ac:4: -1- AC_SUBST([am__untar])
+m4trace:configure.ac:4: -1- AC_SUBST_TRACE([am__untar])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__untar$])
+m4trace:configure.ac:5: -1- AC_SUBST([RANLIB])
+m4trace:configure.ac:5: -1- AC_SUBST_TRACE([RANLIB])
+m4trace:configure.ac:5: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.ac:6: -1- AC_SUBST([CC])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- AC_SUBST([CFLAGS])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CFLAGS])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CFLAGS$])
+m4trace:configure.ac:6: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LDFLAGS])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:6: -1- AC_SUBST([LIBS])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:6: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:6: -1- AC_SUBST([CC])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- AC_SUBST([CC])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- AC_SUBST([CC])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- AC_SUBST([CC])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ac_ct_CC])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^ac_ct_CC$])
+m4trace:configure.ac:6: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([EXEEXT])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^EXEEXT$])
+m4trace:configure.ac:6: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OBJEXT])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^OBJEXT$])
+m4trace:configure.ac:6: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([DEPDIR])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^DEPDIR$])
+m4trace:configure.ac:6: -1- AC_SUBST([am__include])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([am__include])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__include$])
+m4trace:configure.ac:6: -1- AC_SUBST([am__quote])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([am__quote])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__quote$])
+m4trace:configure.ac:6: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.ac:6: -1- AC_SUBST([AMDEP_TRUE])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([AMDEP_TRUE])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEP_TRUE$])
+m4trace:configure.ac:6: -1- AC_SUBST([AMDEP_FALSE])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([AMDEP_FALSE])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEP_FALSE$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
+m4trace:configure.ac:6: -1- AC_SUBST([AMDEPBACKSLASH])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([AMDEPBACKSLASH])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
+m4trace:configure.ac:6: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CCDEPMODE])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CCDEPMODE$])
+m4trace:configure.ac:6: -1- AM_CONDITIONAL([am__fastdepCC], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
+m4trace:configure.ac:6: -1- AC_SUBST([am__fastdepCC_TRUE])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
+m4trace:configure.ac:6: -1- AC_SUBST([am__fastdepCC_FALSE])
+m4trace:configure.ac:6: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
+m4trace:configure.ac:7: -1- AC_SUBST([CXX])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CXX])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.ac:7: -1- AC_SUBST([CXXFLAGS])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CXXFLAGS])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXXFLAGS$])
+m4trace:configure.ac:7: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([LDFLAGS])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:7: -1- AC_SUBST([LIBS])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:7: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:7: -1- AC_SUBST([CXX])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CXX])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.ac:7: -1- AC_SUBST([ac_ct_CXX])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([ac_ct_CXX])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^ac_ct_CXX$])
+m4trace:configure.ac:7: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CXXDEPMODE])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXXDEPMODE$])
+m4trace:configure.ac:7: -1- AM_CONDITIONAL([am__fastdepCXX], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
+m4trace:configure.ac:7: -1- AC_SUBST([am__fastdepCXX_TRUE])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
+m4trace:configure.ac:7: -1- AC_SUBST([am__fastdepCXX_FALSE])
+m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
+m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE])
+m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE])
+m4trace:configure.ac:8: -1- AC_SUBST([F77])
+m4trace:configure.ac:8: -1- AC_SUBST_TRACE([F77])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^F77$])
+m4trace:configure.ac:8: -1- AC_SUBST([FFLAGS])
+m4trace:configure.ac:8: -1- AC_SUBST_TRACE([FFLAGS])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^FFLAGS$])
+m4trace:configure.ac:8: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.ac:8: -1- AC_SUBST_TRACE([LDFLAGS])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:8: -1- AC_SUBST([LIBS])
+m4trace:configure.ac:8: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:8: -1- AC_SUBST([F77])
+m4trace:configure.ac:8: -1- AC_SUBST_TRACE([F77])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^F77$])
+m4trace:configure.ac:8: -1- AC_SUBST([ac_ct_F77])
+m4trace:configure.ac:8: -1- AC_SUBST_TRACE([ac_ct_F77])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^ac_ct_F77$])
+m4trace:configure.ac:9: -1- AC_SUBST([FLIBS])
+m4trace:configure.ac:9: -1- AC_SUBST_TRACE([FLIBS])
+m4trace:configure.ac:9: -1- m4_pattern_allow([^FLIBS$])
+m4trace:configure.ac:10: -1- AM_PROG_CC_C_O
+m4trace:configure.ac:10: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$])
+m4trace:configure.ac:10: -1- AH_OUTPUT([NO_MINUS_C_MINUS_O], [/* Define to 1 if your C compiler doesn\'t accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O])
+m4trace:configure.ac:10: -1- AC_REQUIRE_AUX_FILE([compile])
+m4trace:configure.ac:11: -1- AC_SUBST([XMKMF])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([XMKMF])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^XMKMF$])
+m4trace:configure.ac:11: -1- AC_SUBST([CPP])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CPP])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:11: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:11: -1- AC_SUBST([CPP])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CPP])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([X_DISPLAY_MISSING])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_DISPLAY_MISSING$])
+m4trace:configure.ac:11: -1- AH_OUTPUT([X_DISPLAY_MISSING], [/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING])
+m4trace:configure.ac:11: -1- AC_SUBST([X_CFLAGS])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([X_CFLAGS])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_CFLAGS$])
+m4trace:configure.ac:11: -1- AC_SUBST([X_PRE_LIBS])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([X_PRE_LIBS])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_PRE_LIBS$])
+m4trace:configure.ac:11: -1- AC_SUBST([X_LIBS])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([X_LIBS])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_LIBS$])
+m4trace:configure.ac:11: -1- AC_SUBST([X_EXTRA_LIBS])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([X_EXTRA_LIBS])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^X_EXTRA_LIBS$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_DEBUG_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_DEBUG_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_DEBUG_], [/* Macro to enable debugging in Dakota. */
+#undef _DEBUG_])
+m4trace:configure.ac:12: -1- AM_CONDITIONAL([NOSERIAL], [test $SERIAL_VALUE = no])
+m4trace:configure.ac:12: -1- AC_SUBST([NOSERIAL_TRUE])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([NOSERIAL_TRUE])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^NOSERIAL_TRUE$])
+m4trace:configure.ac:12: -1- AC_SUBST([NOSERIAL_FALSE])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([NOSERIAL_FALSE])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^NOSERIAL_FALSE$])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([NOSERIAL_TRUE])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([NOSERIAL_FALSE])
+m4trace:configure.ac:12: -1- AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
+m4trace:configure.ac:12: -1- AC_SUBST([NOPARALLEL_TRUE])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([NOPARALLEL_TRUE])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^NOPARALLEL_TRUE$])
+m4trace:configure.ac:12: -1- AC_SUBST([NOPARALLEL_FALSE])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([NOPARALLEL_FALSE])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^NOPARALLEL_FALSE$])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([NOPARALLEL_TRUE])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([NOPARALLEL_FALSE])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_MATLAB_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_MATLAB_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_MATLAB_], [/* with Matlab in ISSM src */
+#undef _HAVE_MATLAB_])
+m4trace:configure.ac:12: -1- AC_SUBST([MATLABINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MATLABINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLABINCL$])
+m4trace:configure.ac:12: -1- AC_SUBST([MEX])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MEX])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MEX$])
+m4trace:configure.ac:12: -1- AC_SUBST([MEXEXT])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MEXEXT])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MEXEXT$])
+m4trace:configure.ac:12: -1- AC_SUBST([MEXLIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MEXLIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MEXLIB$])
+m4trace:configure.ac:12: -1- AC_SUBST([MEXLINK])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MEXLINK])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MEXLINK$])
+m4trace:configure.ac:12: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+m4/matlab.m4:469: AX_MATLAB is expanded from...
+m4/matlab.m4:323: AX_MATLAB_VERSION is expanded from...
+m4/issm_options.m4:393: ISSM_OPTIONS is expanded from...
+configure.ac:12: the top level])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MATLAB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^HAVE_MATLAB$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([HAVE_MATLAB], [/* Define if you have Matlab. */
+#undef HAVE_MATLAB])
+m4trace:configure.ac:12: -1- AC_SUBST([MATLAB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MATLAB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB$])
+m4trace:configure.ac:12: -1- AC_SUBST([MATLAB_VERSION])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MATLAB_VERSION])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_VERSION$])
+m4trace:configure.ac:12: -1- AC_SUBST([MATLAB_MAJOR])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MATLAB_MAJOR])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_MAJOR$])
+m4trace:configure.ac:12: -1- AC_SUBST([MATLAB_MINOR])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MATLAB_MINOR])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_MINOR$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([MATLAB_MAJOR])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_MAJOR$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([MATLAB_MAJOR], [/* Define to the Matlab major version number. */
+#undef MATLAB_MAJOR])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([MATLAB_MINOR])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATLAB_MINOR$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([MATLAB_MINOR], [/* Define to the Matlab minor version number. */
+#undef MATLAB_MINOR])
+m4trace:configure.ac:12: -1- AM_CONDITIONAL([LARGEARRAYS], [test x$largearrays = xyes])
+m4trace:configure.ac:12: -1- AC_SUBST([LARGEARRAYS_TRUE])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([LARGEARRAYS_TRUE])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^LARGEARRAYS_TRUE$])
+m4trace:configure.ac:12: -1- AC_SUBST([LARGEARRAYS_FALSE])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([LARGEARRAYS_FALSE])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^LARGEARRAYS_FALSE$])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([LARGEARRAYS_TRUE])
+m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([LARGEARRAYS_FALSE])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_TRIANGLE_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_TRIANGLE_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_TRIANGLE_], [/* with Triangle in ISSM src */
+#undef _HAVE_TRIANGLE_])
+m4trace:configure.ac:12: -1- AC_SUBST([TRIANGLEINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([TRIANGLEINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^TRIANGLEINCL$])
+m4trace:configure.ac:12: -1- AC_SUBST([TRIANGLELIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([TRIANGLELIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^TRIANGLELIB$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_METIS_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_METIS_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_METIS_], [/* with Metis in ISSM src */
+#undef _HAVE_METIS_])
+m4trace:configure.ac:12: -1- AC_SUBST([METISINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([METISINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^METISINCL$])
+m4trace:configure.ac:12: -1- AC_SUBST([METISLIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([METISLIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^METISLIB$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_MPI_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_MPI_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_MPI_], [/* with Mpi in ISSM src */
+#undef _HAVE_MPI_])
+m4trace:configure.ac:12: -1- AC_SUBST([MPIINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MPIINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MPIINCL$])
+m4trace:configure.ac:12: -1- AC_SUBST([MPILIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MPILIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MPILIB$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_PETSC_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_PETSC_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_PETSC_], [/* with Petsc in ISSM src */
+#undef _HAVE_PETSC_])
+m4trace:configure.ac:12: -1- AC_SUBST([PETSCINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PETSCINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^PETSCINCL$])
+m4trace:configure.ac:12: -1- AC_SUBST([PETSCLIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PETSCLIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^PETSCLIB$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_SLEPC_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_SLEPC_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_SLEPC_], [/* with Slepc in ISSM src */
+#undef _HAVE_SLEPC_])
+m4trace:configure.ac:12: -1- AC_SUBST([SLEPCINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([SLEPCINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^SLEPCINCL$])
+m4trace:configure.ac:12: -1- AC_SUBST([SLEPCLIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([SLEPCLIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^SLEPCLIB$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_SCALAPACK_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_SCALAPACK_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_SCALAPACK_], [/* with Scalapack in ISSM src */
+#undef _HAVE_SCALAPACK_])
+m4trace:configure.ac:12: -1- AC_SUBST([SCALAPACKLIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([SCALAPACKLIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^SCALAPACKLIB$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_BLASLAPACK_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_BLASLAPACK_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_BLASLAPACK_], [/* with Scalapack in ISSM src */
+#undef _HAVE_BLASLAPACK_])
+m4trace:configure.ac:12: -1- AC_SUBST([BLASLAPACKLIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([BLASLAPACKLIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^BLASLAPACKLIB$])
+m4trace:configure.ac:12: -1- AC_SUBST([BLASLAPACKINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([BLASLAPACKINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^BLASLAPACKINCL$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_PLAPACK_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_PLAPACK_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_PLAPACK_], [/* with Plapack in ISSM src */
+#undef _HAVE_PLAPACK_])
+m4trace:configure.ac:12: -1- AC_SUBST([PLAPACKINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PLAPACKINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^PLAPACKINCL$])
+m4trace:configure.ac:12: -1- AC_SUBST([PLAPACKLIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PLAPACKLIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^PLAPACKLIB$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_MUMPS_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_MUMPS_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_MUMPS_], [/* with Mumps in ISSM src */
+#undef _HAVE_MUMPS_])
+m4trace:configure.ac:12: -1- AC_SUBST([MUMPSINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MUMPSINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MUMPSINCL$])
+m4trace:configure.ac:12: -1- AC_SUBST([MUMPSLIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MUMPSLIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MUMPSLIB$])
+m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([_HAVE_BLACS_])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_BLACS_$])
+m4trace:configure.ac:12: -1- AH_OUTPUT([_HAVE_BLACS_], [/* with Blacs in ISSM src */
+#undef _HAVE_BLACS_])
+m4trace:configure.ac:12: -1- AC_SUBST([BLACSINCL])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([BLACSINCL])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^BLACSINCL$])
+m4trace:configure.ac:12: -1- AC_SUBST([BLACSLIB])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([BLACSLIB])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^BLACSLIB$])
+m4trace:configure.ac:17: -1- AC_CONFIG_FILES([Makefile
+			src/Makefile
+			src/c/Makefile
+			src/mex/Makefile
+			bin/Makefile])
+m4trace:configure.ac:18: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
+m4trace:configure.ac:18: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.ac:18: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([LTLIBOBJS])
+m4trace:configure.ac:18: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([top_builddir])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([top_build_prefix])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([srcdir])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([abs_srcdir])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([top_srcdir])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([abs_top_srcdir])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([builddir])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([abs_builddir])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([abs_top_builddir])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([INSTALL])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([MKDIR_P])
Index: /issm/trunk/autom4te.cache/traces.2
===================================================================
--- /issm/trunk/autom4te.cache/traces.2	(revision 1)
+++ /issm/trunk/autom4te.cache/traces.2	(revision 1)
@@ -0,0 +1,717 @@
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/amversion.m4:20: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.10.2], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/amversion.m4:37: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/auxdir.m4:52: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/cond.m4:34: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4:132: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4:142: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4:158: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depout.m4:63: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [# Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depout.m4:77: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4:12: -1- AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4:12: -1- AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.])dnl
+AC_CONFIG_HEADERS($@)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/init.m4:103: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/init.m4:125: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/install-sh.m4:14: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/lead-dot.m4:21: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/make.m4:51: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/minuso.m4:35: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/missing.m4:17: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/missing.m4:35: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/mkdirp.m4:26: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/runlog.m4:17: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/sanity.m4:51: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/strip.m4:28: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/tar.m4:95: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^SHELL$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PATH_SEPARATOR$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^exec_prefix$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^prefix$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^program_transform_name$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^bindir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sbindir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^libexecdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^datarootdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^datadir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sysconfdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sharedstatedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^localstatedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^includedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^oldincludedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^docdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^infodir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^htmldir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^dvidir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^pdfdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^psdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^libdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^localedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^mandir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^DEFS$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_C$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_N$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_T$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^build_alias$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^host_alias$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^target_alias$])
+m4trace:configure.ac:2: -1- AM_CONFIG_HEADER([config.h])
+m4trace:configure.ac:2: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.], [/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4:12: AM_CONFIG_HEADER is expanded from...
+configure.ac:2: the top level])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_cpu$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_vendor$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_os$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_cpu$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_vendor$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_os$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_cpu$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_vendor$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_os$])
+m4trace:configure.ac:4: -1- AM_INIT_AUTOMAKE
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.ac:4: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
+m4trace:configure.ac:4: -1- AM_AUTOMAKE_VERSION([1.10.2])
+m4trace:configure.ac:4: -1- _AM_AUTOCONF_VERSION([2.63])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__isrc$])
+m4trace:configure.ac:4: -1- _AM_SUBST_NOTMAKE([am__isrc])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^CYGPATH_W$])
+m4trace:configure.ac:4: -1- _AM_SET_OPTIONS([])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([no-define])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:4: -1- AM_SANITY_CHECK
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+m4trace:configure.ac:4: -1- AM_MISSING_HAS_RUN
+m4trace:configure.ac:4: -1- AM_AUX_DIR_EXPAND
+m4trace:configure.ac:4: -1- m4_pattern_allow([^ACLOCAL$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AUTOCONF], [autoconf])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOCONF$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOMAKE$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOHEADER$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^MAKEINFO$])
+m4trace:configure.ac:4: -1- AM_PROG_INSTALL_SH
+m4trace:configure.ac:4: -1- m4_pattern_allow([^install_sh$])
+m4trace:configure.ac:4: -1- AM_PROG_INSTALL_STRIP
+m4trace:configure.ac:4: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
+m4trace:configure.ac:4: -1- AM_PROG_MKDIR_P
+m4trace:configure.ac:4: -1- m4_pattern_allow([^MKDIR_P$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^mkdir_p$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AWK$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^SET_MAKE$])
+m4trace:configure.ac:4: -1- AM_SET_LEADING_DOT
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__leading_dot$])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([tar-ustar])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([tar-pax])
+m4trace:configure.ac:4: -1- _AM_PROG_TAR([v7])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AMTAR], [tar])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AMTAR$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__tar$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__untar$])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([no-dependencies])
+m4trace:configure.ac:5: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CFLAGS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^ac_ct_CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^EXEEXT$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^OBJEXT$])
+m4trace:configure.ac:6: -1- _AM_DEPENDENCIES([CC])
+m4trace:configure.ac:6: -1- AM_SET_DEPDIR
+m4trace:configure.ac:6: -1- m4_pattern_allow([^DEPDIR$])
+m4trace:configure.ac:6: -1- AM_OUTPUT_DEPENDENCY_COMMANDS
+m4trace:configure.ac:6: -1- AM_MAKE_INCLUDE
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__include$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__quote$])
+m4trace:configure.ac:6: -1- AM_DEP_TRACK
+m4trace:configure.ac:6: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEP_TRUE$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEP_FALSE$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CCDEPMODE$])
+m4trace:configure.ac:6: -1- AM_CONDITIONAL([am__fastdepCC], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^F77$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^FFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^F77$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^ac_ct_F77$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^FLIBS$])
+m4trace:configure.ac:9: -1- AM_PROG_CC_C_O
+m4trace:configure.ac:9: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^XMKMF$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_DISPLAY_MISSING$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_CFLAGS$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_PRE_LIBS$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_LIBS$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_EXTRA_LIBS$])
+m4trace:configure.ac:17: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.ac:17: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:17: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
+m4trace:configure.ac:17: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
Index: /issm/trunk/autom4te.cache/traces.3
===================================================================
--- /issm/trunk/autom4te.cache/traces.3	(revision 1)
+++ /issm/trunk/autom4te.cache/traces.3	(revision 1)
@@ -0,0 +1,1964 @@
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/amversion.m4:20: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.10.2], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/amversion.m4:37: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/auxdir.m4:52: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/cond.m4:34: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4:132: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4:142: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depend.m4:158: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depout.m4:63: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [# Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/depout.m4:77: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4:12: -1- AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4:12: -1- AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.])dnl
+AC_CONFIG_HEADERS($@)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/init.m4:103: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/init.m4:125: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/install-sh.m4:14: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/lead-dot.m4:21: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/make.m4:51: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/minuso.m4:35: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/missing.m4:17: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/missing.m4:35: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/mkdirp.m4:26: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/runlog.m4:17: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/sanity.m4:51: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/strip.m4:28: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE])
+m4trace:/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/tar.m4:95: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+])
+m4trace:m4/acx_mpi.m4:181: -1- AC_DEFUN([ACX_MPI], [
+AC_PREREQ(2.50) dnl for AC_LANG_CASE
+
+AC_LANG_CASE([C], [
+	AC_REQUIRE([AC_PROG_CC])
+	AC_ARG_VAR(MPICC,[MPI C compiler command])
+	AC_CHECK_PROGS(MPICC, mpicc hcc mpxlc_r mpxlc mpcc cmpicc, $CC)
+	acx_mpi_save_CC="$CC"
+	CC="$MPICC"
+	AC_SUBST(MPICC)
+],
+[C++], [
+	AC_REQUIRE([AC_PROG_CXX])
+	AC_ARG_VAR(MPICXX,[MPI C++ compiler command])
+	AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++, $CXX)
+	acx_mpi_save_CXX="$CXX"
+	CXX="$MPICXX"
+	AC_SUBST(MPICXX)
+],
+[Fortran 77], [
+	AC_REQUIRE([AC_PROG_F77])
+	AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command])
+	AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc, $F77)
+	acx_mpi_save_F77="$F77"
+	F77="$MPIF77"
+	AC_SUBST(MPIF77)
+],
+[Fortran], [
+	AC_REQUIRE([AC_PROG_FC])
+	AC_ARG_VAR(MPIFC,[MPI Fortran compiler command])
+	AC_CHECK_PROGS(MPIFC, mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, $FC)
+	acx_mpi_save_FC="$FC"
+	FC="$MPIFC"
+	AC_SUBST(MPIFC)
+])
+
+if test x = x"$MPILIBS"; then
+	AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
+		[C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
+		[Fortran 77], [AC_MSG_CHECKING([for MPI_Init])
+			AC_LINK_IFELSE([AC_LANG_PROGRAM([],[      call MPI_Init])],[MPILIBS=" "
+				AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])],
+		[Fortran], [AC_MSG_CHECKING([for MPI_Init])
+			AC_LINK_IFELSE([AC_LANG_PROGRAM([],[      call MPI_Init])],[MPILIBS=" "
+				AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])])
+fi
+AC_LANG_CASE([Fortran 77], [
+	if test x = x"$MPILIBS"; then
+		AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"])
+	fi
+	if test x = x"$MPILIBS"; then
+		AC_CHECK_LIB(fmpich, MPI_Init, [MPILIBS="-lfmpich"])
+	fi
+],
+[Fortran], [
+	if test x = x"$MPILIBS"; then
+		AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"])
+	fi
+	if test x = x"$MPILIBS"; then
+		AC_CHECK_LIB(mpichf90, MPI_Init, [MPILIBS="-lmpichf90"])
+	fi
+])
+if test x = x"$MPILIBS"; then
+	AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"])
+fi
+if test x = x"$MPILIBS"; then
+	AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"])
+fi
+
+dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the
+dnl latter uses $CPP, not $CC (which may be mpicc).
+AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then
+	AC_MSG_CHECKING([for mpi.h])
+	AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
+		AC_MSG_RESULT(no)])
+fi],
+[C++], [if test x != x"$MPILIBS"; then
+	AC_MSG_CHECKING([for mpi.h])
+	AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
+		AC_MSG_RESULT(no)])
+fi],
+[Fortran 77], [if test x != x"$MPILIBS"; then
+	AC_MSG_CHECKING([for mpif.h])
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[      include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS=""
+		AC_MSG_RESULT(no)])
+fi],
+[Fortran], [if test x != x"$MPILIBS"; then
+	AC_MSG_CHECKING([for mpif.h])
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[      include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS=""
+		AC_MSG_RESULT(no)])
+fi])
+
+AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"],
+	[C++], [CXX="$acx_mpi_save_CXX"],
+	[Fortran 77], [F77="$acx_mpi_save_F77"],
+	[Fortran], [FC="$acx_mpi_save_FC"])
+
+AC_SUBST(MPILIBS)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x = x"$MPILIBS"; then
+        $2
+        :
+else
+        ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1])
+        :
+fi
+])
+m4trace:m4/issm_options.m4:363: -1- AC_DEFUN([ISSM_OPTIONS], [
+	dnl Debugging option check.
+	AC_ARG_ENABLE([debugging],AS_HELP_STRING([--enable-debugging],
+					 [turn debug support on]),
+		[enable_debugging=$enableval],[enable_debugging=no])
+	if test "x$enable_debugging" = xyes; then
+	 AC_DEFINE([_DEBUG_],[1],[Macro to enable debugging in Dakota.])
+	fi
+
+	dnl serial build?
+	AC_ARG_WITH([serial],
+			  AS_HELP_STRING([--with-serial = value],
+							 [serial compilation. ]),
+			  [SERIAL_VALUE=$withval],[SERIAL_VALUE="yes"])
+	AC_MSG_CHECKING(for serial compilation)
+	AM_CONDITIONAL([NOSERIAL], [test $SERIAL_VALUE = no])
+	AC_MSG_RESULT($SERIAL_VALUE) 
+	
+
+	dnl parallel build?
+	AC_ARG_WITH([parallel],
+			  AS_HELP_STRING([--with-parallel = value],
+							 [parallel compilation. ]),
+			  [PARALLEL_VALUE=$withval],[PARALLEL_VALUE="yes"])
+	AC_MSG_CHECKING(for parallel compilation)
+	AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
+	AC_MSG_RESULT($PARALLEL_VALUE) 
+
+	dnl: check that at least serial or parallel builds have been requested!
+	if test "$SERIAL_VALUE" != "yes" ; then
+		if test "$PARALLEL_VALUE" != "yes"; then
+		AC_MSG_ERROR([cannot request --with-serial=no and --with-parallel=no at the same time!])
+		fi
+	fi
+
+
+	dnl Matlab directory
+	AC_ARG_WITH([matlab-dir],
+			  AS_HELP_STRING([--with-matlab-dir = DIR],
+							 [matlab root directory. necessary for serial build.]),
+			 [MATLAB_ROOT=$withval],[MATLAB_ROOT=""]) 
+	
+	if test -d "$MATLAB_ROOT"; then
+
+		AC_MSG_CHECKING(for Matlab headers and libraries in $MATLAB_ROOT)
+
+		dnl defaults
+		HAVE_MATLAB=yes
+		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
+		dnl  use matlab provided mexext routine to test for extension
+		MEXEXT=`$MATLAB_ROOT/bin/mexext`
+		MEXEXT=".$MEXEXT"
+		MEX=$MATLAB_ROOT/bin/mex
+
+		dnl OS-dependent variables and checks
+		case "${host_os}" in
+			*linux*)
+			if test "${host_cpu}" = "x86_64";
+			then
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnxa64/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
+			else
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
+			fi
+			;;
+		esac
+
+		AC_DEFINE([_HAVE_MATLAB_],[1],[with Matlab in ISSM src])
+		AC_SUBST([MATLABINCL])
+		AC_SUBST([MEX])
+		AC_SUBST([MEXEXT])
+		AC_SUBST([MEXLIB]) 
+		AC_SUBST([MEXLINK])
+	
+		AC_MSG_RESULT($HAVE_MATLAB)
+	else
+		HAVE_MATLAB=no
+	fi
+
+	
+	if test $HAVE_MATLAB = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([--with-matlab-dir  missing. Matlab is needed to run ISSM serially!])
+		fi
+	fi
+
+	dnl get version number
+	if test $HAVE_MATLAB = yes; then
+		AX_MATLAB_VERSION
+
+		dnl  if matlab version is 7.5 and more, and if platform is x86_64, then compile with largearray
+		dnl   default is no 
+		largearrays=no
+		if test $MATLAB_MAJOR -ge 7; then 
+			if test $MATLAB_MINOR -ge 5; then 
+				if test "${host_cpu}" = "x86_64"; then
+					largearrays=yes
+				fi
+			fi
+		fi
+	fi
+	AM_CONDITIONAL(LARGEARRAYS, test x$largearrays = xyes)
+	
+	dnl Triangle directory
+	AC_ARG_WITH([triangle-dir],
+			  AS_HELP_STRING([--with-triangle-dir = DIR], [triangle root directory. necessary for serial build]),
+			 [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT=""]) 
+	AC_MSG_CHECKING(for Triangle headers and libraries )
+	if test -d "$TRIANGLE_ROOT"; then
+
+
+		dnl defaults
+		HAVE_TRIANGLE=yes
+		TRIANGLEINCL=-I$TRIANGLE_ROOT/
+		TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+
+		AC_DEFINE([_HAVE_TRIANGLE_],[1],[with Triangle in ISSM src])
+		AC_SUBST([TRIANGLEINCL])
+		AC_SUBST([TRIANGLELIB])
+
+	else
+		HAVE_TRIANGLE=no
+	fi
+	AC_MSG_RESULT($HAVE_TRIANGLE)
+
+	AC_MSG_CHECKING(for triangle and parallel status)
+	if test $HAVE_TRIANGLE = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([--with-triangle-dir  missing. Triangle is needed to run ISSM serially!])
+		fi
+	fi
+	AC_MSG_RESULT(ok)
+	
+		
+	dnl Metis directory
+	AC_ARG_WITH([metis-dir],
+			  AS_HELP_STRING([--with-metis-dir = DIR],
+							 [metis root directory. necessary for serial build]),
+			  [METIS_ROOT=$withval],[METIS_ROOT=""])
+
+	if test -d "$METIS_ROOT"; then
+
+		AC_MSG_CHECKING(for Metis headers and libraries in $METIS_ROOT)
+
+		dnl defaults
+		HAVE_METIS=yes
+		METISINCL=-I"$METIS_ROOT/Lib"
+		METISLIB=-L"$METIS_ROOT/ -lmetis"
+
+		AC_DEFINE([_HAVE_METIS_],[1],[with Metis in ISSM src])
+		AC_SUBST([METISINCL])
+		AC_SUBST([METISLIB])
+	else
+		HAVE_METIS=no
+	fi
+
+	if test $HAVE_METIS = no; then
+	AC_MSG_ERROR([--with-metis-dir  missing. Metis is needed to run ISSM]);
+	else
+	AC_MSG_RESULT($HAVE_METIS)
+	fi
+
+	dnl
+			
+	ACX_MPI(AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src]), AC_MSG_ERROR([cannot provide --with-mpi-dir and --with-mpi-lib at the same time!]))
+
+	dnl Petsc directory and architecture
+	AC_ARG_WITH([petsc-dir],
+			  AS_HELP_STRING([--with-petsc-dir = DIR],
+							 [petsc root directory, necessary for parallel build]),
+			  [PETSC_ROOT=$withval],[PETSC_ROOT=""])
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ROOT" = "" ; then
+			AC_MSG_ERROR([missing --with-petsc-dir argument for parallel compilation!])
+		fi
+	fi
+	
+	AC_ARG_WITH([petsc-arch],
+			  AS_HELP_STRING([--with-petsc-arch = DIR],
+							 [petsc arch , necessary for parallel build]),
+			  [PETSC_ARCH=$withval],[PETSC_ARCH=""])
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ARCH" = "" ; then
+			AC_MSG_ERROR([missing --with-petsc-arch argument for parallel compilation!])
+		fi
+	fi
+	
+	AC_MSG_CHECKING(for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH)
+	
+	if test -d "$PETSC_ROOT"; then
+
+		if test -d "$PETSC_ROOT/bmake/$PETSC_ARCH"; then
+		
+			PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
+			PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+			                          
+
+
+			AC_DEFINE([_HAVE_PETSC_],[1],[with Petsc in ISSM src])
+			AC_SUBST([PETSCINCL])
+			AC_SUBST([PETSCLIB])
+
+			HAVE_PETSC=yes
+		else
+			HAVE_PETSC=no
+		fi
+	else
+		HAVE_PETSC=no
+	fi
+
+	if test $HAVE_PETSC = no; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!])
+		fi
+	else
+		AC_MSG_RESULT($HAVE_PETSC)
+	fi
+
+
+	dnl Slepc directory
+	AC_ARG_WITH([slepc-dir],
+			  AS_HELP_STRING([--with-slepc-dir = DIR],
+							 [slepc root directory]),
+			  [SLEPC_ROOT=$withval],[SLEPC_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Slepc headers and libraries in $SLEPC_ROOT)
+	if test -d "$SLEPC_ROOT"; then
+
+
+		dnl defaults
+		HAVE_SLEPC=yes
+		SLEPCINCL=-I"$SLEPC_ROOT/include"
+		SLEPCLIB=-L"$SLEPC_ROOT/lib/ -lslepc"
+
+		AC_DEFINE([_HAVE_SLEPC_],[1],[with Slepc in ISSM src])
+		AC_SUBST([SLEPCINCL])
+		AC_SUBST([SLEPCLIB])
+	else
+		HAVE_SLEPC=no
+	fi
+	AC_MSG_RESULT($HAVE_SLEPC)
+	
+	dnl Scalapack directory
+	AC_ARG_WITH([scalapack-dir],
+			  AS_HELP_STRING([--with-scalapack-dir = DIR],
+							 [scalapack root directory]),
+			  [SCALAPACK_ROOT=$withval],[SCALAPACK_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Scalapack headers and libraries in $SCALAPACK_ROOT)
+	if test -d "$SCALAPACK_ROOT"; then
+
+
+		dnl defaults
+		HAVE_SCALAPACK=yes
+		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+
+		AC_DEFINE([_HAVE_SCALAPACK_],[1],[with Scalapack in ISSM src])
+		AC_SUBST([SCALAPACKLIB])
+	else
+		HAVE_SCALAPACK=no
+	fi
+	AC_MSG_RESULT($HAVE_SCALAPACK)
+
+	dnl Blas-lapack directory
+	AC_ARG_WITH([blas-lapack-dir],
+			  AS_HELP_STRING([--with-blas-lapack-dir = DIR],
+							 [blas-lapack root directory]),
+			  [BLASLAPACK_ROOT=$withval],[BLASLAPACK_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT)
+	if test -d "$BLASLAPACK_ROOT"; then
+
+
+		dnl defaults
+		HAVE_BLASLAPACK=yes
+		BLASLAPACKINCL=""
+		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
+
+		AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with Scalapack in ISSM src])
+		AC_SUBST([BLASLAPACKLIB])
+		AC_SUBST([BLASLAPACKINCL])
+	else
+		HAVE_BLASLAPACK=no
+	fi
+	AC_MSG_RESULT($HAVE_BLASLAPACK)
+
+
+	dnl Plapack directory
+	AC_ARG_WITH([plapack-dir],
+			  AS_HELP_STRING([--with-plapack-dir = DIR],
+							 [plapack root directory]),
+			  [PLAPACK_ROOT=$withval],[PLAPACK_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Plapack headers and libraries in $PLAPACK_ROOT)
+	if test -d "$PLAPACK_ROOT"; then
+
+
+		dnl defaults
+		HAVE_PLAPACK=yes
+		PLAPACKINCL=-I"$PLAPACK_ROOT/INCLUDE"
+		PLAPACKLIB=-L"$PLAPACK_ROOT/ -lPLAPACK"
+
+		AC_DEFINE([_HAVE_PLAPACK_],[1],[with Plapack in ISSM src])
+		AC_SUBST([PLAPACKINCL])
+		AC_SUBST([PLAPACKLIB])
+	else
+		HAVE_PLAPACK=no
+	fi
+	AC_MSG_RESULT($HAVE_PLAPACK)
+
+	dnl Mumps directory
+	AC_ARG_WITH([mumps-dir],
+			  AS_HELP_STRING([--with-mumps-dir = DIR],
+							 [mumps root directory]),
+			  [MUMPS_ROOT=$withval],[MUMPS_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Mumps headers and libraries in $MUMPS_ROOT)
+	if test -d "$MUMPS_ROOT"; then
+
+		dnl defaults
+		HAVE_MUMPS=yes
+		MUMPSINCL=-I"$MUMPS_ROOT/include"
+		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps -lpord"
+
+		AC_DEFINE([_HAVE_MUMPS_],[1],[with Mumps in ISSM src])
+		AC_SUBST([MUMPSINCL])
+		AC_SUBST([MUMPSLIB])
+	else
+		HAVE_MUMPS=no
+	fi
+	AC_MSG_RESULT($HAVE_MUMPS)
+
+	dnl Blacs directory
+	AC_ARG_WITH([blacs-dir],
+			  AS_HELP_STRING([--with-blacs-dir = DIR],
+							 [blacs root directory]),
+			  [BLACS_ROOT=$withval],[BLACS_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Blacs headers and libraries in $BLACS_ROOT)
+	if test -d "$BLACS_ROOT"; then
+
+		dnl defaults
+		HAVE_BLACS=yes
+		BLACSINCL=""
+		BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
+        
+		AC_DEFINE([_HAVE_BLACS_],[1],[with Blacs in ISSM src])
+		AC_SUBST([BLACSINCL])
+		AC_SUBST([BLACSLIB])
+	else
+		HAVE_BLACS=no
+	fi
+	AC_MSG_RESULT($HAVE_BLACS)
+
+
+
+
+])
+m4trace:m4/matlab.m4:104: -1- AC_DEFUN([AX_CFLAGS_WARN_ALL], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic  % -Wall"       dnl   GCC
+   "-xstrconst % -v"          dnl Solaris C
+   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
+   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+   "-ansi -ansiE % -fullwarn" dnl IRIX
+   "+ESlit     % +w1"         dnl HP-UX C
+   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+   #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+   AC_TRY_COMPILE([],[return 0;],
+   [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+     .ok|.ok,*) m4_ifvaln($3,$3) ;;
+   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+   *) m4_ifvaln($3,$3,[
+   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+   fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+m4trace:m4/matlab.m4:147: -1- AC_DEFUN([AX_CXXFLAGS_WARN_ALL], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic  % -Wall"       dnl   GCC
+   "-xstrconst % -v"          dnl Solaris C
+   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
+   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+   "-ansi -ansiE % -fullwarn" dnl IRIX
+   "+ESlit     % +w1"         dnl HP-UX C
+   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+   #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+   AC_TRY_COMPILE([],[return 0;],
+   [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+     .ok|.ok,*) m4_ifvaln($3,$3) ;;
+   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+   *) m4_ifvaln($3,$3,[
+   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+   fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+m4trace:m4/matlab.m4:226: -1- AC_DEFUN([AX_MATLAB_DIR], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB_VERSION])
+AC_REQUIRE([AC_CANONICAL_HOST])
+ax_matlab_dir="\${datadir}/matlab"
+AC_ARG_WITH([matlab-dir], AC_HELP_STRING([--with-matlab-dir=ARG], [use ARG as the top-level installation directory for Matlab files [[$(datadir)/matlab]]]),
+[case $withval in
+  yes | no)
+    AC_MSG_ERROR([invalid value '$withval' for --with-matlab-dir])
+    ;;
+  *)
+    ax_matlab_dir=$withval
+    ;;
+esac])
+AC_MSG_CHECKING([for top-level installation directory for Matlab files])
+AC_MSG_RESULT([$ax_matlab_dir])
+matlabdir=$ax_matlab_dir
+AC_SUBST([matlabdir])
+matlabverdir="\${matlabdir}/$MATLAB_VERSION"
+AC_SUBST([matlabverdir])
+matlabarchdir="\${matlabverdir}/$host"
+AC_SUBST([matlabarchdir])
+matlabprivatedir="\${matlabdir}/private"
+AC_SUBST([matlabprivatedir])
+matlabprivateverdir="\${matlabverdir}/private"
+AC_SUBST([matlabprivateverdir])
+matlabprivatearchdir="\${matlabarchdir}/private"
+AC_SUBST([matlabprivatearchdir])
+])
+m4trace:m4/matlab.m4:323: -1- AC_DEFUN([AX_MATLAB_VERSION], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AX_MATLAB])
+AC_CACHE_CHECK([for Matlab version], [ax_cv_matlab_version],
+[if test "${MATLAB_VERSION+set}" = set ; then
+    ax_cv_matlab_version=$MATLAB_VERSION
+else
+    ax_cv_matlab_version=
+    # Loop over all known architectures.  The final dot covers
+    # Matlab R11 and Matlab V4 for Windows.
+    for ax_arch in alpha glnxa64 glnx86 hp700 hpux ibm_rs sgi sol2 win32 mac maci . ; do
+        for ax_exec_name in matlab$EXEEXT MATLAB ; do
+		ax_matlab_exec=$MATLAB/bin/$ax_arch/${ax_exec_name}
+		if test -f $ax_matlab_exec ; then
+	    		# For Matlab R12, the version number is stored in a
+	    		# shared library.
+	    		ax_matlab_exec_2=`find $MATLAB/bin/$ax_arch -type f -name libmwservices\* -print 2> /dev/null`
+	    		if test -n "$ax_matlab_exec_2" ; then
+				ax_cv_matlab_version=`strings $ax_matlab_exec_2 2> /dev/null | egrep '^\|build_version_\|@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^|build_version_|\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+				if test -n "$ax_cv_matlab_version" ; then
+		    			break
+				fi
+	    		fi
+	    		# For Matlab R11 and Matlab V4, the version number
+	    		# is stored in the executable program.
+	    		ax_cv_matlab_version=`strings $ax_matlab_exec 2> /dev/null | egrep '^@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+	    		if test -n "$ax_cv_matlab_version" ; then
+				break
+	    		fi
+		fi
+    	done
+	if test -n "$ax_cv_matlab_version" ; then
+		break
+	fi
+    done
+    if test -z "$ax_cv_matlab_version" ; then
+	ax_cv_matlab_version="not found"
+    fi
+fi])
+case $ax_cv_matlab_version in
+  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
+    MATLAB_VERSION=$ax_cv_matlab_version
+    MATLAB_MAJOR=`echo $MATLAB_VERSION | sed -e 's/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/'`
+    MATLAB_MINOR=`echo $MATLAB_VERSION | sed -e 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
+    ;;
+  *)
+    if test x$ax_enable_matlab = xyes ; then
+	AC_MSG_ERROR([can not determine Matlab version number])
+    fi
+    MATLAB_VERSION=
+    MATLAB_MAJOR=
+    MATLAB_MINOR=
+    ;;
+esac
+AC_SUBST([MATLAB_VERSION])
+AC_SUBST([MATLAB_MAJOR])
+AC_SUBST([MATLAB_MINOR])
+if test x$MATLAB_VERSION != x ; then
+    AC_DEFINE_UNQUOTED([MATLAB_MAJOR], [$MATLAB_MAJOR], [Define to the Matlab major version number.])
+    AC_DEFINE_UNQUOTED([MATLAB_MINOR], [$MATLAB_MINOR], [Define to the Matlab minor version number.])
+fi
+])
+m4trace:m4/matlab.m4:365: -1- AC_DEFUN([AX_REQUIRE_MATLAB_VERSION], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB_VERSION])
+if test x$MATLAB_VERSION = x ; then
+    AC_MSG_ERROR([can not determine Matlab version number])
+fi
+m4_if([$1], [], [],
+[AC_MSG_CHECKING([if Matlab version is sufficient])
+ax_version='$1'
+case $ax_version in
+  @<:@1-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@)
+    ax_major=$ax_version
+    ax_minor=''
+    ;;
+  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
+    ax_major=`echo $ax_version | sed 's/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/'`
+    ax_minor=`echo $ax_version | sed 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
+    ;;
+  *)
+    AC_MSG_RESULT([failure])
+    AC_MSG_NOTICE([report this bug to the responsible package maintainer])
+    AC_MSG_ERROR([invalid Matlab version number argument to AX_REQUIRE_MATLAB_VERSION])
+    ;;
+esac
+ax_ans=yes
+if test $MATLAB_MAJOR -eq $ax_major ; then
+    if test x$ax_minor != x && test $MATLAB_MINOR -lt $ax_minor ; then
+	ax_ans=no
+    fi
+elif test $MATLAB_MAJOR -lt $ax_major ; then
+    ax_ans=no
+fi
+AC_MSG_RESULT([$ax_ans])
+if test x$ax_ans = xno ; then
+    AC_MSG_ERROR([require Matlab version $ax_version or above])
+fi])
+])
+m4trace:m4/matlab.m4:469: -1- AC_DEFUN([AX_MATLAB], [dnl
+AC_PREREQ([2.50])
+ax_enable_matlab=
+AC_ARG_WITH([matlab-dir], AC_HELP_STRING([--with-matlab-dir=ARG], [check for Matlab [[yes]]]),
+[case $withval in
+  yes | no)
+    # Explicitly enable or disable Matlab but determine
+    # Matlab prefix automatically.
+    ax_enable_matlab=$withval
+    ;;
+  *)
+    # Enable Matlab and use ARG as the Matlab prefix.
+    # ARG must be an existing directory.
+    ax_enable_matlab=yes
+    MATLAB=`cd "${withval-/}" > /dev/null 2>&1 && pwd`
+    if test -z "$MATLAB" ; then
+	AC_MSG_ERROR([invalid value '$withval' for --with-matlab])
+    fi
+    ;;
+esac])
+if test x$ax_enable_matlab != xno ; then
+AC_CACHE_CHECK([for Matlab prefix], [ax_cv_matlab],
+[if test "${MATLAB+set}" = set ; then
+    ax_cv_matlab=`cd "${MATLAB-/}" > /dev/null 2>&1 && pwd`
+else
+    ax_cv_matlab=
+    IFS=${IFS= 	} ; ax_ifs=$IFS ; IFS=:
+    for ax_dir in ${PATH-/opt/bin:/usr/local/bin:/usr/bin:/bin} ; do
+	if test -z "$ax_dir" ; then
+	    ax_dir=.
+	fi
+	if test -x "$ax_dir/matlab" ; then
+	    ax_dir=`echo "$ax_dir" | sed 's,/bin$,,'`
+	    # Directory sanity check.
+	    ax_cv_matlab=`cd "${ax_dir-/}" > /dev/null 2>&1 && pwd`
+	    if test -n "$ax_cv_matlab" ; then
+		break
+	    fi
+	fi
+    done
+    IFS=$ax_ifs
+fi
+if test -z "$ax_cv_matlab" ; then
+    ax_cv_matlab="not found"
+fi])
+if test "$ax_cv_matlab" = "not found" ; then
+    unset MATLAB
+else
+    # Strip trailing dashes.
+    MATLAB=`echo "$ax_cv_matlab" | sed 's,/*$,,'`
+fi
+AC_MSG_CHECKING([whether to enable Matlab support])
+if test x$ax_enable_matlab != xno ; then
+    if test "${MATLAB+set}" = set && test -d "$MATLAB/extern/include" ; then
+	ax_enable_matlab=yes
+    elif test x$ax_enable_matlab = x ; then
+	ax_enable_matlab=no
+    else
+	# Fail if Matlab was explicitly enabled.
+	AC_MSG_RESULT([failure])
+	AC_MSG_ERROR([check your Matlab setup])
+    fi
+fi
+AC_MSG_RESULT([$ax_enable_matlab])
+if test x$ax_enable_matlab = xyes ; then
+    AC_DEFINE([HAVE_MATLAB], [1], [Define if you have Matlab.])
+fi
+fi
+AC_SUBST([MATLAB])
+])
+m4trace:m4/matlab.m4:481: -1- AC_DEFUN([AX_REQUIRE_MATLAB], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB])
+if test x$ax_enable_matlab = xno ; then
+    AC_MSG_ERROR([can not enable Matlab support])
+fi
+])
+m4trace:m4/matlab.m4:491: -1- AC_DEFUN([AX_MATLAB_CONDITIONAL], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB])
+AM_CONDITIONAL([MATLAB], [test x$ax_enable_matlab = xyes])
+])
+m4trace:m4/matlab.m4:551: -1- AC_DEFUN([AX_PATH_MEX], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB])
+AC_REQUIRE([AX_MEX_OPTIONS])
+AC_REQUIRE([AC_CANONICAL_HOST])
+if test "${MEX+set}" != set ; then
+    case $host_os in
+      *cygwin* | *mingw32*)
+	ax_list='mextool mex mex.bat'
+	;;
+      *)
+	ax_list='mex'
+	;;
+    esac
+    AC_PATH_PROGS([MEX], $ax_list, mex, $MATLAB/bin:$PATH)
+fi
+AC_SUBST([MEX])
+if test "${MEXFLAGS+set}" != set ; then
+    MEXFLAGS=-O
+fi
+AC_SUBST([MEXFLAGS])
+if test "${MEXLDADD+set}" != set ; then
+    MEXLDADD=
+fi
+AC_SUBST([MEXLDADD])
+])
+m4trace:m4/matlab.m4:625: -1- AC_DEFUN([AX_MEX_OPTIONS], [dnl
+AC_PREREQ([2.50])
+mex_options=yes
+AC_ARG_WITH([mex-options], AC_HELP_STRING([--with-mex-options=ARG], [use MEX options file ARG [[standard]]]),
+[mex_options=$withval])
+AC_MSG_CHECKING([for MEX options file handling])
+case $mex_options in
+  yes)
+    AC_MSG_RESULT([standard])
+    mexopts_sh=
+    ;;
+  no)
+    AC_MSG_RESULT([disabled])
+    mexopts_sh=$ac_aux_dir/noopts.sh
+    ;;
+  *)
+    AC_MSG_RESULT([enabled])
+    mexopts_sh=$mex_options
+    ;;
+esac
+if test -n "$mexopts_sh" ; then
+    AC_MSG_CHECKING([whether MEX options file exists])
+    if test -f "$mexopts_sh" ; then
+	AC_MSG_RESULT([yes])
+	# Canonicalize file name.
+	mexopts_sh_dir=`echo "$mexopts_sh" | sed 's,[[^/]]*$,,'`
+	mexopts_sh_dir=`cd "${mexopts_sh_dir-.}" && pwd`
+	mexopts_sh_name=`echo "$mexopts_sh" | sed 's,.*/,,'`
+	mexopts_sh="$mexopts_sh_dir/$mexopts_sh_name"
+    else
+	AC_MSG_RESULT([no])
+	AC_MSG_ERROR([$mexopts_sh: no such file])
+    fi
+    MEXOPTS="-f $mexopts_sh"
+else
+    MEXOPTS=
+fi
+AC_SUBST([mexopts_sh])
+AC_SUBST([MEXOPTS])
+])
+m4trace:m4/matlab.m4:711: -1- AC_DEFUN([AX_MEXEXT], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_PATH_MEX])
+AC_CACHE_CHECK([for MEX-file suffix], [ax_cv_mexext],
+[if test "${MEXEXT+set}" = set ; then
+    ax_cv_mexext="$MEXEXT"
+else
+    if test -x ${MATLAB}/bin/mexext ; then
+      ax_cv_mexext=`${MATLAB}/bin/mexext`
+    fi
+fi
+if test "x${ax_cv_mexext}" = "x" ; then
+    echo 'mexFunction () {}' > ax_c_test.c
+    $MEX $MEXOPTS $MEXFLAGS -output ax_c_test ax_c_test.c $MEXLDADD 2> /dev/null 1>&2
+    if test -f ax_c_test.dll ; then
+	ax_cv_mexext=dll
+    elif test -f ax_c_test.mex ; then
+	ax_cv_mexext=mex
+    elif test -f ax_c_test.mexaxp ; then
+	ax_cv_mexext=mexaxp
+    elif test -f ax_c_test.mexglx ; then
+	ax_cv_mexext=mexglx
+    elif test -f ax_c_test.mexa64 ; then
+	ax_cv_mexext=mexa64
+    elif test -f ax_c_test.mexmac ; then
+	ax_cv_mexext=mexmac
+    elif test -f ax_c_test.mexmaci ; then
+	ax_cv_mexext=mexmaci
+    elif test -f ax_c_test.mexhp7 ; then
+	ax_cv_mexext=mexhp7
+    elif test -f ax_c_test.mexhpux ; then
+	ax_cv_mexext=mexhpux
+    elif test -f ax_c_test.mexrs6 ; then
+	ax_cv_mexext=mexrs6
+    elif test -f ax_c_test.mexsg ; then
+	ax_cv_mexext=mexsg
+    elif test -f ax_c_test.mexsol ; then
+	ax_cv_mexext=mexsol
+    elif test -f ax_c_test.mexs64 ; then
+	ax_cv_mexext=mexs64
+    elif test -f ax_c_test.mexw32 ; then
+	ax_cv_mexext=mexw32
+    elif test -f ax_c_test.mexw64 ; then
+	ax_cv_mexext=mexw64
+    else
+	ax_cv_mexext=unknown
+    fi
+    rm -f ax_c_test*
+fi])
+MEXEXT="$ax_cv_mexext"
+AC_SUBST([MEXEXT])
+])
+m4trace:m4/matlab.m4:732: -1- AC_DEFUN([AX_DOT_MEXEXT], [dnl
+AC_REQUIRE([AX_MEXEXT])
+case $MEXEXT in
+  .*)
+    ;;
+  unknown)
+    ;;
+  *)
+    if test -n "$MEXEXT" ; then
+	MEXEXT=.$MEXEXT
+	AC_MSG_RESULT([setting MEX-file suffix to $MEXEXT])
+	AC_SUBST([MEXEXT])
+    fi
+    ;;
+esac
+])
+m4trace:m4/matlab.m4:947: -1- AC_DEFUN([AX_CC_MEX], [dnl
+AC_REQUIRE([AX_PATH_MEX])
+AC_REQUIRE([AX_DOT_MEXEXT])
+AC_LANG([C])
+
+dnl Source code for the test matlab C program
+ac_mex_source='[#include "mex.h"
+void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { return; }]'
+
+dnl Check that the test C program can be compiled with mex
+ac_exeext_save=$ac_exeext
+ac_exeext=$MEXEXT
+ac_link_save=$ac_link
+ac_link='$MEX $MEXOPTS $MEXFLAGS -output conftest$ac_exeext conftest.$ac_ext $MEXLDADD >&AS_MESSAGE_LOG_FD'
+AC_MSG_CHECKING([if mex works])
+AC_LINK_IFELSE([AC_LANG_SOURCE($ac_mex_source)],
+[AC_MSG_RESULT([yes])],
+[AC_MSG_RESULT([no])])
+
+dnl Try to figure out how mex compiles a C program
+ax_cv_mex_version=
+ac_cv_mex_cppflags=
+ac_cv_mex_includes=
+ac_cv_mex_cflags=
+ac_cv_mex_libs=
+ac_cv_mex_ldflags=
+
+dnl Variable that will be subsituted
+MEX_VERSION_C=
+MEX_LDFLAGS=
+MEX_CPPFLAGS=
+MEX_INCLUDES=
+MEX_CFLAGS=
+MEX_LIBS=
+MEX_LDFLAGS=
+
+AC_MSG_CHECKING([if mex -n works])
+ac_save_MEXOPTS=$MEXOPTS
+MEXOPTS="-n $MEXOPTS"
+AC_LANG_CONFTEST([AC_LANG_SOURCE($ac_mex_source)])
+(eval echo $as_me:__oline__: \"$ac_link\") >&AS_MESSAGE_LOG_FD
+ac_cv_mex_n_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1`
+ac_cv_mex_n_result=$?
+echo "$ac_cv_mex_n_output" >&AS_MESSAGE_LOG_FD
+MEXOPTS=$ac_save_MEXOPTS
+rm -f conftest*
+ac_exeext=$ac_exeext_save
+ac_link=$ac_link_save
+
+if test $ac_cv_mex_n_result -eq 0 ; then
+  ac_cv_mex_working=yes
+  AC_MSG_RESULT([$ac_cv_mex_working])
+
+  dnl Save positional arguments (if any)
+  ac_save_positional="$[@]"
+
+  set X $ac_cv_mex_n_output
+  while test $[@%:@] != 1; do
+    shift
+      ac_arg=$[1]
+      case $ac_arg in
+        *mexversion.c)
+          ax_cv_mex_version=$ac_arg
+          ;;
+        -pthread)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cflags, ,
+            ac_cv_mex_cflags="$ac_cv_mex_cflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;
+        -mt)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cflags, ,
+            ac_cv_mex_cflags="$ac_cv_mex_cflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;
+        -ansi)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          ;;
+        -D*)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          ;;
+        -I*)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_includes, ,
+            ac_cv_mex_includes="$ac_cv_mex_includes $ac_arg")
+          ;;
+        -f* | -O* | -xO* | -xlibmil )
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cflags, ,
+            ac_cv_mex_cflags="$ac_cv_mex_cflags $ac_arg")
+          ;;
+        -l*)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_libs, ,
+            ac_cv_mex_libs="$ac_cv_mex_libs $ac_arg")
+          ;;
+        -L)
+          # When -L is seen by itself, it takes an argument
+          # We remove the space between option and argument and re-iterate
+          # unless we find an empty arg or a new option (starting with -)
+          case $[2] in
+             "" | -*);;
+             *)
+             ac_arg="$ac_arg$[2]"
+             shift; shift
+             set X $ac_arg "$[@]"
+             ;;
+           esac
+           ;;
+        -L* | -Wl,* | -shared | -bundle | -G)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;
+        -undefined)
+          # the darwin linker undefined option takes and argument
+          ac_arg="$ac_arg $[2]"
+          shift
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;   
+          # ignore everything else
+      esac
+  done
+  
+  # restore positional arguments
+  set X $ac_save_positional; shift
+
+  MEX_VERSION_C=$ax_cv_mex_version
+
+  AC_MSG_CHECKING([for CPPFLAGS needed to build mex objects])
+  if test "x$ac_cv_mex_cppflags" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_CPPFLAGS=`echo $ac_cv_mex_cppflags | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_CPPFLAGS])
+  fi
+  AC_MSG_CHECKING([for INCLUDES needed to build mex objects])
+  if test "x$ac_cv_mex_includes" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_INCLUDES=`echo $ac_cv_mex_includes | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_INCLUDES])
+  fi
+  AC_MSG_CHECKING([for CFLAGS needed to build mex objects])
+  if test "x$ac_cv_mex_cflags" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_CFLAGS=`echo $ac_cv_mex_cflags | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_CFLAGS])
+  fi
+  AC_MSG_CHECKING([for LIBS needed to build mex objects])
+  if test "x$ac_cv_mex_libs" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_LIBS=`echo $ac_cv_mex_libs | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_LIBS])
+  fi
+  AC_MSG_CHECKING([for LDFLAGS needed to build mex objects])
+  if test "x$ac_cv_mex_ldflags" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_LDFLAGS=`echo $ac_cv_mex_ldflags | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_LDFLAGS])
+  fi
+else
+  ac_cv_mex_working=no
+  AC_MSG_RESULT([$ac_cv_mex_working])
+fi
+
+AC_SUBST(MEX_VERSION_C)
+AC_SUBST(MEX_CPPFLAGS)
+AC_SUBST(MEX_INCLUDES)
+AC_SUBST(MEX_CFLAGS)
+AC_SUBST(MEX_LIBS)
+AC_SUBST(MEX_LDFLAGS)
+
+])
+m4trace:m4/matlab.m4:958: -1- AC_DEFUN([AX_MEX_CONDITIONAL], [dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_CC_MEX])
+AM_CONDITIONAL(MEX, test x$ac_cv_mex_working = xyes)
+AM_CONDITIONAL(MEX_VERSION_C, test x$ax_cv_mex_version != x)
+])
+m4trace:m4/matlab.m4:1020: -1- AC_DEFUN([AX_MATLAB_SYS_ZLIB], [dnl
+AC_REQUIRE([AX_PATH_MEX])
+AC_LANG([C])
+
+ax_matlab_sys_zlib=
+
+if test x$ax_cv_mexext != xunknown && test x$ax_cv_mexext != x ; then
+  # Where should we search for libraries
+  ax_sys_lib_search_path="/lib /usr/lib /usr/local/lib"
+
+  # If this is a 64 bit link box look in the place where redhat keeps libs
+  if test x$ax_cv_mexext = xmexa64; then
+    ax_sys_lib_search_path="/lib64 /usr/lib64 /usr/local/lib64 $ax_sys_lib_search_path"
+  fi
+
+  # set the extension of the library we are looking for
+  if test x$ax_cv_mexext = xmexmac || test x$ax_cv_mexext = xmexmaci ; then
+    ax_zlib_lib_ext=".dylib"
+  else
+    ax_zlib_lib_ext=".a"
+  fi
+
+  for lib_path in $ax_sys_lib_search_path ; do
+    ax_matlab_search_zlib=$lib_path/libz$ax_zlib_lib_ext
+
+   AC_CHECK_FILE([$ax_matlab_search_zlib],
+     [
+       AC_MSG_CHECKING([for gzungetc in $ax_matlab_search_zlib])
+       ac_save_LIBS=$LIBS
+       LIBS="$ax_matlab_search_zlib $LIBS"
+       AC_LINK_IFELSE(
+         [ AC_LANG_PROGRAM( ,[[gzungetc();]]) ],
+         [ 
+           AC_MSG_RESULT([yes]) 
+           ax_matlab_sys_zlib=$ax_matlab_search_zlib
+         ],
+         [ AC_MSG_RESULT([no]) ]
+       )
+       LIBS=$ac_save_LIBS
+     ], )
+    
+    if test x$ax_matlab_sys_zlib != x ; then
+      break
+    fi
+  done
+fi
+
+MATLAB_SYS_ZIB=$ax_matlab_sys_zlib
+
+AC_SUBST([MATLAB_SYS_ZIB])
+
+])
+m4trace:m4/matlab.m4:1119: -1- AC_DEFUN([CHECK_ZLIB], [
+AC_ARG_WITH([zlib], [AS_HELP_STRING([--with-zlib=DIR], [root directory path of zlib installation (defaults to /usr/local or /usr if not found in /usr/local), --without-zlib to disable zlib usage completely])], [], [with_zlib=yes])
+
+if test "x$with_zlib" != xno ; then
+  if test "x$with_zlib" != xyes ; then
+    ZLIB_HOME=$with_zlib
+  else
+    # default locations
+    ZLIB_HOME=/usr/local
+    if test ! -f "${ZLIB_HOME}/include/zlib.h"
+    then
+      ZLIB_HOME=/usr
+    fi
+  fi
+
+  ZLIB_OLD_LDFLAGS=$LDFLAGS
+  ZLIB_OLD_CPPFLAGS=$LDFLAGS
+  LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+  CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+  AC_LANG_PUSH([C])
+  AC_CHECK_HEADERS([zlib.h])
+  AC_CHECK_LIB([z], [inflateEnd])
+  AC_LANG_POP([C])
+
+  if test "x$ac_cv_header_zlib_h" = "xyes" -a "x$ac_cv_lib_z_inflateEnd" = "xyes" ; then
+    AC_MSG_RESULT([zlib found in $ZLIB_HOME])
+    AC_SUBST([HAVE_LIBZ], [$ac_cv_lib_z_inflateEnd])
+  else
+    LDFLAGS="$ZLIB_OLD_LDFLAGS"
+    CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
+    AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib)
+  fi
+fi])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^SHELL$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PATH_SEPARATOR$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^exec_prefix$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^prefix$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^program_transform_name$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^bindir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sbindir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^libexecdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^datarootdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^datadir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sysconfdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^sharedstatedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^localstatedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^includedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^oldincludedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^docdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^infodir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^htmldir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^dvidir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^pdfdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^psdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^libdir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^localedir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^mandir$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^DEFS$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_C$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_N$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_T$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^build_alias$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^host_alias$])
+m4trace:configure.ac:1: -1- m4_pattern_allow([^target_alias$])
+m4trace:configure.ac:2: -1- AM_CONFIG_HEADER([config.h])
+m4trace:configure.ac:2: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.], [/u/wilkes-r1b/larour/Bin/automake/share/aclocal-1.10/header.m4:12: AM_CONFIG_HEADER is expanded from...
+configure.ac:2: the top level])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_cpu$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_vendor$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^build_os$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_cpu$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_vendor$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^host_os$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_cpu$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_vendor$])
+m4trace:configure.ac:3: -1- m4_pattern_allow([^target_os$])
+m4trace:configure.ac:4: -1- AM_INIT_AUTOMAKE
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.ac:4: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
+m4trace:configure.ac:4: -1- AM_AUTOMAKE_VERSION([1.10.2])
+m4trace:configure.ac:4: -1- _AM_AUTOCONF_VERSION([2.63])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__isrc$])
+m4trace:configure.ac:4: -1- _AM_SUBST_NOTMAKE([am__isrc])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^CYGPATH_W$])
+m4trace:configure.ac:4: -1- _AM_SET_OPTIONS([])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([no-define])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:4: -1- AM_SANITY_CHECK
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+m4trace:configure.ac:4: -1- AM_MISSING_HAS_RUN
+m4trace:configure.ac:4: -1- AM_AUX_DIR_EXPAND
+m4trace:configure.ac:4: -1- m4_pattern_allow([^ACLOCAL$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AUTOCONF], [autoconf])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOCONF$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOMAKE$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AUTOHEADER$])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^MAKEINFO$])
+m4trace:configure.ac:4: -1- AM_PROG_INSTALL_SH
+m4trace:configure.ac:4: -1- m4_pattern_allow([^install_sh$])
+m4trace:configure.ac:4: -1- AM_PROG_INSTALL_STRIP
+m4trace:configure.ac:4: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
+m4trace:configure.ac:4: -1- AM_PROG_MKDIR_P
+m4trace:configure.ac:4: -1- m4_pattern_allow([^MKDIR_P$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^mkdir_p$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AWK$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^SET_MAKE$])
+m4trace:configure.ac:4: -1- AM_SET_LEADING_DOT
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__leading_dot$])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([tar-ustar])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([tar-pax])
+m4trace:configure.ac:4: -1- _AM_PROG_TAR([v7])
+m4trace:configure.ac:4: -1- AM_MISSING_PROG([AMTAR], [tar])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^AMTAR$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__tar$])
+m4trace:configure.ac:4: -1- m4_pattern_allow([^am__untar$])
+m4trace:configure.ac:4: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+m4trace:configure.ac:4: -2- _AM_MANGLE_OPTION([no-dependencies])
+m4trace:configure.ac:5: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CFLAGS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^ac_ct_CC$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^EXEEXT$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^OBJEXT$])
+m4trace:configure.ac:6: -1- _AM_DEPENDENCIES([CC])
+m4trace:configure.ac:6: -1- AM_SET_DEPDIR
+m4trace:configure.ac:6: -1- m4_pattern_allow([^DEPDIR$])
+m4trace:configure.ac:6: -1- AM_OUTPUT_DEPENDENCY_COMMANDS
+m4trace:configure.ac:6: -1- AM_MAKE_INCLUDE
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__include$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__quote$])
+m4trace:configure.ac:6: -1- AM_DEP_TRACK
+m4trace:configure.ac:6: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEP_TRUE$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEP_FALSE$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^CCDEPMODE$])
+m4trace:configure.ac:6: -1- AM_CONDITIONAL([am__fastdepCC], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
+m4trace:configure.ac:6: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
+m4trace:configure.ac:6: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^F77$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^FFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^F77$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^ac_ct_F77$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^FLIBS$])
+m4trace:configure.ac:9: -1- AM_PROG_CC_C_O
+m4trace:configure.ac:9: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^XMKMF$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_DISPLAY_MISSING$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_CFLAGS$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_PRE_LIBS$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_LIBS$])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^X_EXTRA_LIBS$])
+m4trace:configure.ac:11: -1- ISSM_OPTIONS
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_DEBUG_$])
+m4trace:configure.ac:11: -1- AM_CONDITIONAL([NOSERIAL], [test $SERIAL_VALUE = no])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^NOSERIAL_TRUE$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^NOSERIAL_FALSE$])
+m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([NOSERIAL_TRUE])
+m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([NOSERIAL_FALSE])
+m4trace:configure.ac:11: -1- AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^NOPARALLEL_TRUE$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^NOPARALLEL_FALSE$])
+m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([NOPARALLEL_TRUE])
+m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([NOPARALLEL_FALSE])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_MATLAB_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MATLABINCL$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MEX$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MEXEXT$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MEXLIB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MEXLINK$])
+m4trace:configure.ac:11: -1- AX_MATLAB_VERSION
+m4trace:configure.ac:11: -1- AX_MATLAB
+m4trace:configure.ac:11: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+m4/matlab.m4:469: AX_MATLAB is expanded from...
+m4/matlab.m4:323: AX_MATLAB_VERSION is expanded from...
+m4/issm_options.m4:363: ISSM_OPTIONS is expanded from...
+configure.ac:11: the top level])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^HAVE_MATLAB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MATLAB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MATLAB_VERSION$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MATLAB_MAJOR$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MATLAB_MINOR$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MATLAB_MAJOR$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MATLAB_MINOR$])
+m4trace:configure.ac:11: -1- AM_CONDITIONAL([LARGEARRAYS], [test x$largearrays = xyes])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^LARGEARRAYS_TRUE$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^LARGEARRAYS_FALSE$])
+m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([LARGEARRAYS_TRUE])
+m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([LARGEARRAYS_FALSE])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_TRIANGLE_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^TRIANGLEINCL$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^TRIANGLELIB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_METIS_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^METISINCL$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^METISLIB$])
+m4trace:configure.ac:11: -2- m4_pattern_allow([^_HAVE_MPI_$])
+m4trace:configure.ac:11: -1- ACX_MPI([
+cat >>confdefs.h <<\_ACEOF
+@%:@define _HAVE_MPI_ 1
+_ACEOF
+], [{ { $as_echo "$as_me:$LINENO: error: cannot provide --with-mpi-dir and --with-mpi-lib at the same time!" >&5
+$as_echo "$as_me: error: cannot provide --with-mpi-dir and --with-mpi-lib at the same time!" >&2;}
+   { (exit 1); exit 1; }; }])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MPICC$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MPICC$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MPICC$])
+m4trace:configure.ac:11: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2471: AC_TRY_COMPILE is expanded from...
+m4/acx_mpi.m4:181: ACX_MPI is expanded from...
+m4/issm_options.m4:363: ISSM_OPTIONS is expanded from...
+configure.ac:11: the top level])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MPILIBS$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_PETSC_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^PETSCINCL$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^PETSCLIB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_SLEPC_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^SLEPCINCL$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^SLEPCLIB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_SCALAPACK_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^SCALAPACKLIB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_BLASLAPACK_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^BLASLAPACKLIB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^BLASLAPACKINCL$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_PLAPACK_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^PLAPACKINCL$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^PLAPACKLIB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_MUMPS_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MUMPSINCL$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^MUMPSLIB$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^_HAVE_BLACS_$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^BLACSINCL$])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^BLACSLIB$])
+m4trace:configure.ac:17: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.ac:17: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:17: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
+m4trace:configure.ac:17: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
Index: /issm/trunk/bin/Makefile.in
===================================================================
--- /issm/trunk/bin/Makefile.in	(revision 1)
+++ /issm/trunk/bin/Makefile.in	(revision 1)
@@ -0,0 +1,346 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = bin
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/issm_options.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLACSINCL = @BLACSINCL@
+BLACSLIB = @BLACSLIB@
+BLASLAPACKINCL = @BLASLAPACKINCL@
+BLASLAPACKLIB = @BLASLAPACKLIB@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLIBS = @FLIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MATLAB = @MATLAB@
+MATLABINCL = @MATLABINCL@
+MATLAB_MAJOR = @MATLAB_MAJOR@
+MATLAB_MINOR = @MATLAB_MINOR@
+MATLAB_VERSION = @MATLAB_VERSION@
+METISINCL = @METISINCL@
+METISLIB = @METISLIB@
+MEX = @MEX@
+MEXEXT = @MEXEXT@
+MEXLIB = @MEXLIB@
+MEXLINK = @MEXLINK@
+MKDIR_P = @MKDIR_P@
+MPIINCL = @MPIINCL@
+MPILIB = @MPILIB@
+MUMPSINCL = @MUMPSINCL@
+MUMPSLIB = @MUMPSLIB@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PETSCINCL = @PETSCINCL@
+PETSCLIB = @PETSCLIB@
+PLAPACKINCL = @PLAPACKINCL@
+PLAPACKLIB = @PLAPACKLIB@
+RANLIB = @RANLIB@
+SCALAPACKLIB = @SCALAPACKLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEPCINCL = @SLEPCINCL@
+SLEPCLIB = @SLEPCLIB@
+STRIP = @STRIP@
+TRIANGLEINCL = @TRIANGLEINCL@
+TRIANGLELIB = @TRIANGLELIB@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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@
+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@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  bin/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  bin/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+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
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+	distclean-generic distdir dvi dvi-am html 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-info install-info-am 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-generic pdf pdf-am ps ps-am uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /issm/trunk/compile
===================================================================
--- /issm/trunk/compile	(revision 1)
+++ /issm/trunk/compile	(revision 1)
@@ -0,0 +1,1 @@
+link /u/wilkes-r1b/larour/Bin/automake/share/automake-1.10/compile
Index: /issm/trunk/config.guess
===================================================================
--- /issm/trunk/config.guess	(revision 1)
+++ /issm/trunk/config.guess	(revision 1)
@@ -0,0 +1,1 @@
+link /u/wilkes-r1b/larour/Bin/automake/share/automake-1.10/config.guess
Index: /issm/trunk/config.h.in
===================================================================
--- /issm/trunk/config.h.in	(revision 1)
+++ /issm/trunk/config.h.in	(revision 1)
@@ -0,0 +1,73 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if you have Matlab. */
+#undef HAVE_MATLAB
+
+/* Define to the Matlab major version number. */
+#undef MATLAB_MAJOR
+
+/* Define to the Matlab minor version number. */
+#undef MATLAB_MINOR
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING
+
+/* Macro to enable debugging in Dakota. */
+#undef _DEBUG_
+
+/* with Blacs in ISSM src */
+#undef _HAVE_BLACS_
+
+/* with Scalapack in ISSM src */
+#undef _HAVE_BLASLAPACK_
+
+/* with Matlab in ISSM src */
+#undef _HAVE_MATLAB_
+
+/* with Metis in ISSM src */
+#undef _HAVE_METIS_
+
+/* with Mpi in ISSM src */
+#undef _HAVE_MPI_
+
+/* with Mumps in ISSM src */
+#undef _HAVE_MUMPS_
+
+/* with Petsc in ISSM src */
+#undef _HAVE_PETSC_
+
+/* with Plapack in ISSM src */
+#undef _HAVE_PLAPACK_
+
+/* with Scalapack in ISSM src */
+#undef _HAVE_SCALAPACK_
+
+/* with Slepc in ISSM src */
+#undef _HAVE_SLEPC_
+
+/* with Triangle in ISSM src */
+#undef _HAVE_TRIANGLE_
Index: /issm/trunk/config.sub
===================================================================
--- /issm/trunk/config.sub	(revision 1)
+++ /issm/trunk/config.sub	(revision 1)
@@ -0,0 +1,1 @@
+link /u/wilkes-r1b/larour/Bin/automake/share/automake-1.10/config.sub
Index: /issm/trunk/configure
===================================================================
--- /issm/trunk/configure	(revision 1)
+++ /issm/trunk/configure	(revision 1)
@@ -0,0 +1,8744 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for ISSM 1.0.
+#
+# Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='ISSM'
+PACKAGE_TARNAME='issm'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='ISSM 1.0'
+PACKAGE_BUGREPORT='Eric Larour <eric.larour@jpl.nasa.gov>'
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+BLACSLIB
+BLACSINCL
+MUMPSLIB
+MUMPSINCL
+PLAPACKLIB
+PLAPACKINCL
+BLASLAPACKINCL
+BLASLAPACKLIB
+SCALAPACKLIB
+SLEPCLIB
+SLEPCINCL
+PETSCLIB
+PETSCINCL
+MPILIB
+MPIINCL
+METISLIB
+METISINCL
+TRIANGLELIB
+TRIANGLEINCL
+LARGEARRAYS_FALSE
+LARGEARRAYS_TRUE
+MATLAB_MINOR
+MATLAB_MAJOR
+MATLAB_VERSION
+MATLAB
+MEXLINK
+MEXLIB
+MEXEXT
+MEX
+MATLABINCL
+NOPARALLEL_FALSE
+NOPARALLEL_TRUE
+NOSERIAL_FALSE
+NOSERIAL_TRUE
+X_EXTRA_LIBS
+X_LIBS
+X_PRE_LIBS
+X_CFLAGS
+CPP
+XMKMF
+FLIBS
+ac_ct_F77
+FFLAGS
+F77
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+RANLIB
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+with_x
+enable_debugging
+with_serial
+with_parallel
+with_matlab_dir
+with_triangle_dir
+with_metis_dir
+with_mpi_lib
+with_mpi_include
+with_petsc_dir
+with_petsc_arch
+with_slepc_dir
+with_scalapack_dir
+with_blas_lapack_dir
+with_plapack_dir
+with_mumps_dir
+with_blacs_dir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+F77
+FFLAGS
+XMKMF
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+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 ISSM 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/issm]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of ISSM 1.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-debugging      turn debug support on
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-x                use the X Window System
+  --with-serial = value   serial compilation.
+  --with-parallel = value parallel compilation.
+  --with-matlab-dir = DIR matlab root directory. necessary for serial build.
+  --with-matlab-dir=ARG   check for Matlab [yes]
+  --with-triangle-dir = DIR
+                          triangle root directory. necessary for serial build
+  --with-metis-dir = DIR  metis root directory. necessary for serial build
+  --with-mpi-lib = otions mpi options, for ex: "-L$MPIROOT -lmpich
+  --with-mpi-include = DIR
+                          mpi include directory, necessary for parallel build
+  --with-petsc-dir = DIR  petsc root directory, necessary for parallel build
+  --with-petsc-arch = DIR petsc arch , necessary for parallel build
+  --with-slepc-dir = DIR  slepc root directory
+  --with-scalapack-dir = DIR
+                          scalapack root directory
+  --with-blas-lapack-dir = DIR
+                          blas-lapack root directory
+  --with-plapack-dir = DIR
+                          plapack root directory
+  --with-mumps-dir = DIR  mumps root directory
+  --with-blacs-dir = DIR  blacs root directory
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <Eric Larour <eric.larour@jpl.nasa.gov>>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+ISSM configure 1.0
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+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 ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+$as_echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+am__api_version='1.10'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='issm'
+ VERSION='1.0'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ifort g77
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { $as_echo "$as_me:$LINENO: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in ifort g77
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+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_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+  G77=yes
+else
+  G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5
+$as_echo_n "checking how to get verbose linking output from $F77... " >&6; }
+if test "${ac_cv_prog_f77_v+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_v=
+# Try some options frequently used verbose output
+for ac_verb in -v -verbose --verbose -V -\#\#\#; do
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_verb"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+  # look for -l* and *.a constructs in the output
+  for ac_arg in $ac_f77_v_output; do
+     case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+          ac_cv_prog_f77_v=$ac_verb
+          break 2 ;;
+     esac
+  done
+done
+if test -z "$ac_cv_prog_f77_v"; then
+   { $as_echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5
+$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;}
+fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: WARNING: compilation failed" >&5
+$as_echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5
+$as_echo "$ac_cv_prog_f77_v" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for Fortran 77 libraries of $F77" >&5
+$as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; }
+if test "${ac_cv_f77_libs+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$FLIBS" != "x"; then
+  ac_cv_f77_libs="$FLIBS" # Let the user override the test.
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+        s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+        s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+        s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+
+ac_cv_f77_libs=
+
+# Save positional arguments (if any)
+ac_save_positional="$@"
+
+set X $ac_f77_v_output
+while test $# != 1; do
+  shift
+  ac_arg=$1
+  case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+        -bI:*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_arg; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+fi
+
+          ;;
+          # Ignore these flags.
+        -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*)
+          ;;
+        -lkernel32)
+          test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+          ;;
+        -[LRuYz])
+          # These flags, when seen by themselves, take an argument.
+          # We remove the space between option and argument and re-iterate
+          # unless we find an empty arg or a new option (starting with -)
+	  case $2 in
+	     "" | -*);;
+	     *)
+		ac_arg="$ac_arg$2"
+		shift; shift
+		set X $ac_arg "$@"
+		;;
+	  esac
+          ;;
+        -YP,*)
+          for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+              ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_j" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_arg="$ac_arg $ac_j"
+                               ac_cv_f77_libs="$ac_cv_f77_libs $ac_j"
+fi
+
+          done
+          ;;
+        -[lLR]*)
+            ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+          ;;
+	-zallextract*| -zdefaultextract)
+	  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+	  ;;
+          # Ignore everything else.
+  esac
+done
+# restore positional arguments
+set X $ac_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+   "SunOS 5"*)
+      ac_ld_run_path=`$as_echo "$ac_f77_v_output" |
+                        sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+      test "x$ac_ld_run_path" != x &&
+        if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_ld_run_path; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path"
+fi
+      ;;
+esac
+fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_libs" >&5
+$as_echo "$ac_cv_f77_libs" >&6; }
+FLIBS="$ac_cv_f77_libs"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+{ $as_echo "$as_me:$LINENO: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x;
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5
+$as_echo "$as_me: error: cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl dylib la dll; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl dylib la dll; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { $as_echo "$as_me:$LINENO: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+
+cat >>confdefs.h <<\_ACEOF
+#define X_DISPLAY_MISSING 1
+_ACEOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+$as_echo_n "checking whether -R must be followed by a space... " >&6; }
+    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+    ac_xsave_c_werror_flag=$ac_c_werror_flag
+    ac_c_werror_flag=yes
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       X_LIBS="$X_LIBS -R$x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+	  X_LIBS="$X_LIBS -R $x_libraries"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: result: neither works" >&5
+$as_echo "neither works" >&6; }
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    ac_c_werror_flag=$ac_xsave_c_werror_flag
+    LIBS=$ac_xsave_LIBS
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn Johnson says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And Karl Berry says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 XOpenDisplay ();
+int
+main ()
+{
+return XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+    fi
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_xsave_LIBS"
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to T.E. Dickey.
+    # The functions gethostbyname, getservbyname, and inet_addr are
+    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+    { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5
+$as_echo_n "checking for gethostbyname... " >&6; }
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname innocuous_gethostbyname
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname
+
+/* 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 gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gethostbyname || defined __stub___gethostbyname
+choke me
+#endif
+
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+$as_echo "$ac_cv_func_gethostbyname" >&6; }
+
+    if test $ac_cv_func_gethostbyname = no; then
+      { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_nsl_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+	{ $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_bsd_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
+$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
+if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+      fi
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says Simon Leinen: it contains gethostby*
+    # variants that don't use the name server (or something).  -lsocket
+    # must be given before -lnsl if both are needed.  We assume that
+    # if connect needs -lnsl, so does gethostbyname.
+    { $as_echo "$as_me:$LINENO: checking for connect" >&5
+$as_echo_n "checking for connect... " >&6; }
+if test "${ac_cv_func_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef connect
+
+/* 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 connect ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_connect || defined __stub___connect
+choke me
+#endif
+
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+$as_echo "$ac_cv_func_connect" >&6; }
+
+    if test $ac_cv_func_connect = no; then
+      { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+$as_echo_n "checking for connect in -lsocket... " >&6; }
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 connect ();
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_socket_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_socket_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+$as_echo "$ac_cv_lib_socket_connect" >&6; }
+if test "x$ac_cv_lib_socket_connect" = x""yes; then
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    { $as_echo "$as_me:$LINENO: checking for remove" >&5
+$as_echo_n "checking for remove... " >&6; }
+if test "${ac_cv_func_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define remove innocuous_remove
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef remove
+
+/* 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 remove ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_remove || defined __stub___remove
+choke me
+#endif
+
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+$as_echo "$ac_cv_func_remove" >&6; }
+
+    if test $ac_cv_func_remove = no; then
+      { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5
+$as_echo_n "checking for remove in -lposix... " >&6; }
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 remove ();
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_posix_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_posix_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
+$as_echo "$ac_cv_lib_posix_remove" >&6; }
+if test "x$ac_cv_lib_posix_remove" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    { $as_echo "$as_me:$LINENO: checking for shmat" >&5
+$as_echo_n "checking for shmat... " >&6; }
+if test "${ac_cv_func_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shmat innocuous_shmat
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shmat
+
+/* 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 shmat ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shmat || defined __stub___shmat
+choke me
+#endif
+
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+$as_echo "$ac_cv_func_shmat" >&6; }
+
+    if test $ac_cv_func_shmat = no; then
+      { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
+$as_echo_n "checking for shmat in -lipc... " >&6; }
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 shmat ();
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ipc_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ipc_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
+$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
+if test "x$ac_cv_lib_ipc_shmat" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
+$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 IceConnectionNumber ();
+int
+main ()
+{
+return IceConnectionNumber ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+  LDFLAGS=$ac_save_LDFLAGS
+
+fi
+
+
+ax_enable_matlab=
+
+# Check whether --with-matlab-dir was given.
+if test "${with_matlab_dir+set}" = set; then
+  withval=$with_matlab_dir; case $withval in
+  yes | no)
+    # Explicitly enable or disable Matlab but determine
+    # Matlab prefix automatically.
+    ax_enable_matlab=$withval
+    ;;
+  *)
+    # Enable Matlab and use ARG as the Matlab prefix.
+    # ARG must be an existing directory.
+    ax_enable_matlab=yes
+    MATLAB=`cd "${withval-/}" > /dev/null 2>&1 && pwd`
+    if test -z "$MATLAB" ; then
+	{ { $as_echo "$as_me:$LINENO: error: invalid value '$withval' for --with-matlab" >&5
+$as_echo "$as_me: error: invalid value '$withval' for --with-matlab" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    ;;
+esac
+fi
+
+if test x$ax_enable_matlab != xno ; then
+{ $as_echo "$as_me:$LINENO: checking for Matlab prefix" >&5
+$as_echo_n "checking for Matlab prefix... " >&6; }
+if test "${ax_cv_matlab+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "${MATLAB+set}" = set ; then
+    ax_cv_matlab=`cd "${MATLAB-/}" > /dev/null 2>&1 && pwd`
+else
+    ax_cv_matlab=
+    IFS=${IFS= 	} ; ax_ifs=$IFS ; IFS=:
+    for ax_dir in ${PATH-/opt/bin:/usr/local/bin:/usr/bin:/bin} ; do
+	if test -z "$ax_dir" ; then
+	    ax_dir=.
+	fi
+	if test -x "$ax_dir/matlab" ; then
+	    ax_dir=`echo "$ax_dir" | sed 's,/bin$,,'`
+	    # Directory sanity check.
+	    ax_cv_matlab=`cd "${ax_dir-/}" > /dev/null 2>&1 && pwd`
+	    if test -n "$ax_cv_matlab" ; then
+		break
+	    fi
+	fi
+    done
+    IFS=$ax_ifs
+fi
+if test -z "$ax_cv_matlab" ; then
+    ax_cv_matlab="not found"
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_matlab" >&5
+$as_echo "$ax_cv_matlab" >&6; }
+if test "$ax_cv_matlab" = "not found" ; then
+    unset MATLAB
+else
+    # Strip trailing dashes.
+    MATLAB=`echo "$ax_cv_matlab" | sed 's,/*$,,'`
+fi
+{ $as_echo "$as_me:$LINENO: checking whether to enable Matlab support" >&5
+$as_echo_n "checking whether to enable Matlab support... " >&6; }
+if test x$ax_enable_matlab != xno ; then
+    if test "${MATLAB+set}" = set && test -d "$MATLAB/extern/include" ; then
+	ax_enable_matlab=yes
+    elif test x$ax_enable_matlab = x ; then
+	ax_enable_matlab=no
+    else
+	# Fail if Matlab was explicitly enabled.
+	{ $as_echo "$as_me:$LINENO: result: failure" >&5
+$as_echo "failure" >&6; }
+	{ { $as_echo "$as_me:$LINENO: error: check your Matlab setup" >&5
+$as_echo "$as_me: error: check your Matlab setup" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_enable_matlab" >&5
+$as_echo "$ax_enable_matlab" >&6; }
+if test x$ax_enable_matlab = xyes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MATLAB 1
+_ACEOF
+
+fi
+fi
+
+
+
+		# Check whether --enable-debugging was given.
+if test "${enable_debugging+set}" = set; then
+  enableval=$enable_debugging; enable_debugging=$enableval
+else
+  enable_debugging=no
+fi
+
+	if test "x$enable_debugging" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _DEBUG_ 1
+_ACEOF
+
+	fi
+
+
+# Check whether --with-serial was given.
+if test "${with_serial+set}" = set; then
+  withval=$with_serial; SERIAL_VALUE=$withval
+else
+  SERIAL_VALUE="yes"
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for serial compilation" >&5
+$as_echo_n "checking for serial compilation... " >&6; }
+	 if test $SERIAL_VALUE = no; then
+  NOSERIAL_TRUE=
+  NOSERIAL_FALSE='#'
+else
+  NOSERIAL_TRUE='#'
+  NOSERIAL_FALSE=
+fi
+
+	{ $as_echo "$as_me:$LINENO: result: $SERIAL_VALUE" >&5
+$as_echo "$SERIAL_VALUE" >&6; }
+
+
+
+# Check whether --with-parallel was given.
+if test "${with_parallel+set}" = set; then
+  withval=$with_parallel; PARALLEL_VALUE=$withval
+else
+  PARALLEL_VALUE="yes"
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for parallel compilation" >&5
+$as_echo_n "checking for parallel compilation... " >&6; }
+	 if test $PARALLEL_VALUE = no; then
+  NOPARALLEL_TRUE=
+  NOPARALLEL_FALSE='#'
+else
+  NOPARALLEL_TRUE='#'
+  NOPARALLEL_FALSE=
+fi
+
+	{ $as_echo "$as_me:$LINENO: result: $PARALLEL_VALUE" >&5
+$as_echo "$PARALLEL_VALUE" >&6; }
+
+		if test "$SERIAL_VALUE" != "yes" ; then
+		if test "$PARALLEL_VALUE" != "yes"; then
+		{ { $as_echo "$as_me:$LINENO: error: cannot request --with-serial=no and --with-parallel=no at the same time!" >&5
+$as_echo "$as_me: error: cannot request --with-serial=no and --with-parallel=no at the same time!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+
+
+# Check whether --with-matlab-dir was given.
+if test "${with_matlab_dir+set}" = set; then
+  withval=$with_matlab_dir; MATLAB_ROOT=$withval
+else
+  MATLAB_ROOT=""
+fi
+
+
+	if test -d "$MATLAB_ROOT"; then
+
+		{ $as_echo "$as_me:$LINENO: checking for Matlab headers and libraries in $MATLAB_ROOT" >&5
+$as_echo_n "checking for Matlab headers and libraries in $MATLAB_ROOT... " >&6; }
+
+				HAVE_MATLAB=yes
+		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
+				MEXEXT=`$MATLAB_ROOT/bin/mexext`
+		MEXEXT=".$MEXEXT"
+		MEX=$MATLAB_ROOT/bin/mex
+
+				case "${host_os}" in
+			*linux*)
+			if test "${host_cpu}" = "x86_64";
+			then
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnxa64/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
+			else
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
+			fi
+			;;
+		esac
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_MATLAB_ 1
+_ACEOF
+
+
+
+
+
+
+
+		{ $as_echo "$as_me:$LINENO: result: $HAVE_MATLAB" >&5
+$as_echo "$HAVE_MATLAB" >&6; }
+	else
+		HAVE_MATLAB=no
+	fi
+
+
+	if test $HAVE_MATLAB = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: --with-matlab-dir  missing. Matlab is needed to run ISSM serially!" >&5
+$as_echo "$as_me: error: --with-matlab-dir  missing. Matlab is needed to run ISSM serially!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+		if test $HAVE_MATLAB = yes; then
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for Matlab version" >&5
+$as_echo_n "checking for Matlab version... " >&6; }
+if test "${ax_cv_matlab_version+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "${MATLAB_VERSION+set}" = set ; then
+    ax_cv_matlab_version=$MATLAB_VERSION
+else
+    ax_cv_matlab_version=
+    # Loop over all known architectures.  The final dot covers
+    # Matlab R11 and Matlab V4 for Windows.
+    for ax_arch in alpha glnxa64 glnx86 hp700 hpux ibm_rs sgi sol2 win32 mac maci . ; do
+        for ax_exec_name in matlab$EXEEXT MATLAB ; do
+		ax_matlab_exec=$MATLAB/bin/$ax_arch/${ax_exec_name}
+		if test -f $ax_matlab_exec ; then
+	    		# For Matlab R12, the version number is stored in a
+	    		# shared library.
+	    		ax_matlab_exec_2=`find $MATLAB/bin/$ax_arch -type f -name libmwservices\* -print 2> /dev/null`
+	    		if test -n "$ax_matlab_exec_2" ; then
+				ax_cv_matlab_version=`strings $ax_matlab_exec_2 2> /dev/null | egrep '^\|build_version_\|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -1 | sed 's/^|build_version_|\([0-9]*\.[0-9]*\).*/\1/'`
+				if test -n "$ax_cv_matlab_version" ; then
+		    			break
+				fi
+	    		fi
+	    		# For Matlab R11 and Matlab V4, the version number
+	    		# is stored in the executable program.
+	    		ax_cv_matlab_version=`strings $ax_matlab_exec 2> /dev/null | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -1 | sed 's/^\([0-9]*\.[0-9]*\).*/\1/'`
+	    		if test -n "$ax_cv_matlab_version" ; then
+				break
+	    		fi
+		fi
+    	done
+	if test -n "$ax_cv_matlab_version" ; then
+		break
+	fi
+    done
+    if test -z "$ax_cv_matlab_version" ; then
+	ax_cv_matlab_version="not found"
+    fi
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_matlab_version" >&5
+$as_echo "$ax_cv_matlab_version" >&6; }
+case $ax_cv_matlab_version in
+  [1-9].[0-9] | [1-9][0-9].[0-9])
+    MATLAB_VERSION=$ax_cv_matlab_version
+    MATLAB_MAJOR=`echo $MATLAB_VERSION | sed -e 's/^\([0-9]*\)\.[0-9]*.*/\1/'`
+    MATLAB_MINOR=`echo $MATLAB_VERSION | sed -e 's/^[0-9]*\.\([0-9]*\).*/\1/'`
+    ;;
+  *)
+    if test x$ax_enable_matlab = xyes ; then
+	{ { $as_echo "$as_me:$LINENO: error: can not determine Matlab version number" >&5
+$as_echo "$as_me: error: can not determine Matlab version number" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    MATLAB_VERSION=
+    MATLAB_MAJOR=
+    MATLAB_MINOR=
+    ;;
+esac
+
+
+
+if test x$MATLAB_VERSION != x ; then
+
+cat >>confdefs.h <<_ACEOF
+#define MATLAB_MAJOR $MATLAB_MAJOR
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define MATLAB_MINOR $MATLAB_MINOR
+_ACEOF
+
+fi
+
+
+						largearrays=no
+		if test $MATLAB_MAJOR -ge 7; then
+			if test $MATLAB_MINOR -ge 5; then
+				if test "${host_cpu}" = "x86_64"; then
+					largearrays=yes
+				fi
+			fi
+		fi
+	fi
+	 if test x$largearrays = xyes; then
+  LARGEARRAYS_TRUE=
+  LARGEARRAYS_FALSE='#'
+else
+  LARGEARRAYS_TRUE='#'
+  LARGEARRAYS_FALSE=
+fi
+
+
+
+# Check whether --with-triangle-dir was given.
+if test "${with_triangle_dir+set}" = set; then
+  withval=$with_triangle_dir; TRIANGLE_ROOT=$withval
+else
+  TRIANGLE_ROOT=""
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for Triangle headers and libraries " >&5
+$as_echo_n "checking for Triangle headers and libraries ... " >&6; }
+	if test -d "$TRIANGLE_ROOT"; then
+
+
+				HAVE_TRIANGLE=yes
+		TRIANGLEINCL=-I$TRIANGLE_ROOT/
+		TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_TRIANGLE_ 1
+_ACEOF
+
+
+
+
+	else
+		HAVE_TRIANGLE=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_TRIANGLE" >&5
+$as_echo "$HAVE_TRIANGLE" >&6; }
+
+	{ $as_echo "$as_me:$LINENO: checking for triangle and parallel status" >&5
+$as_echo_n "checking for triangle and parallel status... " >&6; }
+	if test $HAVE_TRIANGLE = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: --with-triangle-dir  missing. Triangle is needed to run ISSM serially!" >&5
+$as_echo "$as_me: error: --with-triangle-dir  missing. Triangle is needed to run ISSM serially!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	{ $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+
+
+
+# Check whether --with-metis-dir was given.
+if test "${with_metis_dir+set}" = set; then
+  withval=$with_metis_dir; METIS_ROOT=$withval
+else
+  METIS_ROOT=""
+fi
+
+
+	if test -d "$METIS_ROOT"; then
+
+		{ $as_echo "$as_me:$LINENO: checking for Metis headers and libraries in $METIS_ROOT" >&5
+$as_echo_n "checking for Metis headers and libraries in $METIS_ROOT... " >&6; }
+
+				HAVE_METIS=yes
+		METISINCL=-I"$METIS_ROOT/Lib"
+		METISLIB=-L"$METIS_ROOT/ -lmetis"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_METIS_ 1
+_ACEOF
+
+
+
+	else
+		HAVE_METIS=no
+	fi
+
+	if test $HAVE_METIS = no; then
+	{ { $as_echo "$as_me:$LINENO: error: --with-metis-dir  missing. Metis is needed to run ISSM" >&5
+$as_echo "$as_me: error: --with-metis-dir  missing. Metis is needed to run ISSM" >&2;}
+   { (exit 1); exit 1; }; };
+	else
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_METIS" >&5
+$as_echo "$HAVE_METIS" >&6; }
+	fi
+
+		{ $as_echo "$as_me:$LINENO: checking for mpi..." >&5
+$as_echo_n "checking for mpi...... " >&6; }
+
+# Check whether --with-mpi-lib was given.
+if test "${with_mpi_lib+set}" = set; then
+  withval=$with_mpi_lib; MPILIB=$withval
+else
+  MPILIB=""
+fi
+
+
+
+# Check whether --with-mpi-include was given.
+if test "${with_mpi_include+set}" = set; then
+  withval=$with_mpi_include; MPI_INCLUDE=$withval
+else
+  MPI_INCLUDE=""
+fi
+
+
+		if test -z "$MPILIB" ; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	else
+		if test -z "$MPI_INCLUDE" ; then
+			if test "$PARALLEL_VALUE" = "yes" ; then
+				{ { $as_echo "$as_me:$LINENO: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+			fi
+		else
+			HAVE_MPI=yes
+			MPIINCL=-I"$MPI_INCLUDE/"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_MPI_ 1
+_ACEOF
+
+
+
+		fi
+	fi
+	{ $as_echo "$as_me:$LINENO: result: done" >&5
+$as_echo "done" >&6; }
+
+
+# Check whether --with-petsc-dir was given.
+if test "${with_petsc_dir+set}" = set; then
+  withval=$with_petsc_dir; PETSC_ROOT=$withval
+else
+  PETSC_ROOT=""
+fi
+
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ROOT" = "" ; then
+			{ { $as_echo "$as_me:$LINENO: error: missing --with-petsc-dir argument for parallel compilation!" >&5
+$as_echo "$as_me: error: missing --with-petsc-dir argument for parallel compilation!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+
+# Check whether --with-petsc-arch was given.
+if test "${with_petsc_arch+set}" = set; then
+  withval=$with_petsc_arch; PETSC_ARCH=$withval
+else
+  PETSC_ARCH=""
+fi
+
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ARCH" = "" ; then
+			{ { $as_echo "$as_me:$LINENO: error: missing --with-petsc-arch argument for parallel compilation!" >&5
+$as_echo "$as_me: error: missing --with-petsc-arch argument for parallel compilation!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+	{ $as_echo "$as_me:$LINENO: checking for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH" >&5
+$as_echo_n "checking for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH... " >&6; }
+
+	if test -d "$PETSC_ROOT"; then
+
+		if test -d "$PETSC_ROOT/bmake/$PETSC_ARCH"; then
+
+			PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
+			PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_PETSC_ 1
+_ACEOF
+
+
+
+
+			HAVE_PETSC=yes
+		else
+			HAVE_PETSC=no
+		fi
+	else
+		HAVE_PETSC=no
+	fi
+
+	if test $HAVE_PETSC = no; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			{ { $as_echo "$as_me:$LINENO: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	else
+		{ $as_echo "$as_me:$LINENO: result: $HAVE_PETSC" >&5
+$as_echo "$HAVE_PETSC" >&6; }
+	fi
+
+
+
+# Check whether --with-slepc-dir was given.
+if test "${with_slepc_dir+set}" = set; then
+  withval=$with_slepc_dir; SLEPC_ROOT=$withval
+else
+  SLEPC_ROOT=""
+fi
+
+
+	{ $as_echo "$as_me:$LINENO: checking for Slepc headers and libraries in $SLEPC_ROOT" >&5
+$as_echo_n "checking for Slepc headers and libraries in $SLEPC_ROOT... " >&6; }
+	if test -d "$SLEPC_ROOT"; then
+
+
+				HAVE_SLEPC=yes
+		SLEPCINCL=-I"$SLEPC_ROOT/include"
+		SLEPCLIB=-L"$SLEPC_ROOT/lib/ -lslepc"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_SLEPC_ 1
+_ACEOF
+
+
+
+	else
+		HAVE_SLEPC=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_SLEPC" >&5
+$as_echo "$HAVE_SLEPC" >&6; }
+
+
+# Check whether --with-scalapack-dir was given.
+if test "${with_scalapack_dir+set}" = set; then
+  withval=$with_scalapack_dir; SCALAPACK_ROOT=$withval
+else
+  SCALAPACK_ROOT=""
+fi
+
+
+	{ $as_echo "$as_me:$LINENO: checking for Scalapack headers and libraries in $SCALAPACK_ROOT" >&5
+$as_echo_n "checking for Scalapack headers and libraries in $SCALAPACK_ROOT... " >&6; }
+	if test -d "$SCALAPACK_ROOT"; then
+
+
+				HAVE_SCALAPACK=yes
+		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_SCALAPACK_ 1
+_ACEOF
+
+
+	else
+		HAVE_SCALAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_SCALAPACK" >&5
+$as_echo "$HAVE_SCALAPACK" >&6; }
+
+
+# Check whether --with-blas-lapack-dir was given.
+if test "${with_blas_lapack_dir+set}" = set; then
+  withval=$with_blas_lapack_dir; BLASLAPACK_ROOT=$withval
+else
+  BLASLAPACK_ROOT=""
+fi
+
+
+	{ $as_echo "$as_me:$LINENO: checking for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT" >&5
+$as_echo_n "checking for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT... " >&6; }
+	if test -d "$BLASLAPACK_ROOT"; then
+
+
+				HAVE_BLASLAPACK=yes
+		BLASLAPACKINCL=""
+		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_BLASLAPACK_ 1
+_ACEOF
+
+
+
+	else
+		HAVE_BLASLAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_BLASLAPACK" >&5
+$as_echo "$HAVE_BLASLAPACK" >&6; }
+
+
+
+# Check whether --with-plapack-dir was given.
+if test "${with_plapack_dir+set}" = set; then
+  withval=$with_plapack_dir; PLAPACK_ROOT=$withval
+else
+  PLAPACK_ROOT=""
+fi
+
+
+	{ $as_echo "$as_me:$LINENO: checking for Plapack headers and libraries in $PLAPACK_ROOT" >&5
+$as_echo_n "checking for Plapack headers and libraries in $PLAPACK_ROOT... " >&6; }
+	if test -d "$PLAPACK_ROOT"; then
+
+
+				HAVE_PLAPACK=yes
+		PLAPACKINCL=-I"$PLAPACK_ROOT/INCLUDE"
+		PLAPACKLIB=-L"$PLAPACK_ROOT/ -lPLAPACK"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_PLAPACK_ 1
+_ACEOF
+
+
+
+	else
+		HAVE_PLAPACK=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_PLAPACK" >&5
+$as_echo "$HAVE_PLAPACK" >&6; }
+
+
+# Check whether --with-mumps-dir was given.
+if test "${with_mumps_dir+set}" = set; then
+  withval=$with_mumps_dir; MUMPS_ROOT=$withval
+else
+  MUMPS_ROOT=""
+fi
+
+
+	{ $as_echo "$as_me:$LINENO: checking for Mumps headers and libraries in $MUMPS_ROOT" >&5
+$as_echo_n "checking for Mumps headers and libraries in $MUMPS_ROOT... " >&6; }
+	if test -d "$MUMPS_ROOT"; then
+
+				HAVE_MUMPS=yes
+		MUMPSINCL=-I"$MUMPS_ROOT/include"
+		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps -lpord"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_MUMPS_ 1
+_ACEOF
+
+
+
+	else
+		HAVE_MUMPS=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_MUMPS" >&5
+$as_echo "$HAVE_MUMPS" >&6; }
+
+
+# Check whether --with-blacs-dir was given.
+if test "${with_blacs_dir+set}" = set; then
+  withval=$with_blacs_dir; BLACS_ROOT=$withval
+else
+  BLACS_ROOT=""
+fi
+
+
+	{ $as_echo "$as_me:$LINENO: checking for Blacs headers and libraries in $BLACS_ROOT" >&5
+$as_echo_n "checking for Blacs headers and libraries in $BLACS_ROOT... " >&6; }
+	if test -d "$BLACS_ROOT"; then
+
+				HAVE_BLACS=yes
+		BLACSINCL=""
+		BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_BLACS_ 1
+_ACEOF
+
+
+
+	else
+		HAVE_BLACS=no
+	fi
+	{ $as_echo "$as_me:$LINENO: result: $HAVE_BLACS" >&5
+$as_echo "$HAVE_BLACS" >&6; }
+
+
+
+
+
+ac_config_files="$ac_config_files Makefile src/Makefile src/c/Makefile src/mex/Makefile bin/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NOSERIAL_TRUE}" && test -z "${NOSERIAL_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"NOSERIAL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"NOSERIAL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NOPARALLEL_TRUE}" && test -z "${NOPARALLEL_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"NOPARALLEL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"NOPARALLEL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${LARGEARRAYS_TRUE}" && test -z "${LARGEARRAYS_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"LARGEARRAYS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"LARGEARRAYS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ISSM $as_me 1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+ISSM config.status 1.0
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "src/c/Makefile") CONFIG_FILES="$CONFIG_FILES src/c/Makefile" ;;
+    "src/mex/Makefile") CONFIG_FILES="$CONFIG_FILES src/mex/Makefile" ;;
+    "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
+'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
Index: /issm/trunk/configure.ac
===================================================================
--- /issm/trunk/configure.ac	(revision 28275)
+++ /issm/trunk/configure.ac	(revision 1)
@@ -1,50 +1,19 @@
-# Process this file with autoconf to produce a configure script.
+AC_INIT(ISSM,[1.0], [Eric Larour <eric.larour@jpl.nasa.gov>])
+AM_CONFIG_HEADER(config.h)
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE
+AC_PROG_RANLIB
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_F77([ifort g77])
+AC_F77_LIBRARY_LDFLAGS
+AM_PROG_CC_C_O
+AC_PATH_XTRA
+ISSM_OPTIONS
+AC_CONFIG_FILES([Makefile
+			src/Makefile
+			src/c/Makefile
+			src/mex/Makefile
+			bin/Makefile])
+AC_OUTPUT
 
-#AUTOCONF
-AC_INIT([Ice-sheet and Sea-level System Model (ISSM)],[4.23],[https://issm.ess.uci.edu/forum/],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
-AC_CONFIG_AUX_DIR([./aux-config])	# Put config files in aux-config
-AC_CONFIG_MACRO_DIR([m4])			# m4 macros are located in m4
-m4_include([m4/issm_options.m4])
-
-#print header
-AC_MSG_NOTICE(============================================================================)
-AC_MSG_NOTICE(=      AC_PACKAGE_NAME AC_PACKAGE_VERSION configuration      =)
-AC_MSG_NOTICE(============================================================================)
-
-#Determine System type and OS
-AC_CANONICAL_TARGET
-
-#Compilers
-AC_PROG_CC([icc cl icl gcc])
-AC_PROG_CPP
-AC_PROG_CXX([icpc cl icl g++])
-AC_PROG_F77([ifort g77 gfortran])
-AC_PROG_FC([ifort gfortran])
-
-#AUTOMAKE
-#Initialize automake and declare foreign so that we don't need a ChangeLog, INSTALL, etc
-AM_INIT_AUTOMAKE([foreign])
-AC_CONFIG_HEADERS([./config.h])		# Config file must be config.h
-AM_SILENT_RULES([yes])				# Reduce compilation and linking output (comment this line out or set value to "no" for verbose output)
-AM_PROG_AR
-
-#Libtool
-LT_INIT([win32-dll])
-
-#Run issm_options.m4
-ISSM_OPTIONS
-
-#List all Makefiles
-AC_CONFIG_FILES([
-	Makefile
-	src/Makefile
-	src/c/Makefile
-	src/wrappers/Makefile
-	src/wrappers/python/Makefile
-	src/wrappers/matlab/Makefile
-	src/wrappers/javascript/Makefile
-	src/m/Makefile
-])
-
-#End of configure.ac
-AC_OUTPUT
Index: /issm/trunk/configure.sh
===================================================================
--- /issm/trunk/configure.sh	(revision 1)
+++ /issm/trunk/configure.sh	(revision 1)
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+./configure --prefix=/u/astrid1/larour/issm-1.0 --with-matlab-dir=/usr/local/pkgs/matlab-7.6/ --with-triangle-dir=/u/astrid1/larour/issm-1.0/packages/triangle/install --with-metis-dir=/u/astrid1/larour/issm-1.0/packages/metis/install --with-petsc-dir=/u/astrid1/larour/issm-1.0/packages/petsc/install --with-mpi-include=/u/astrid1/larour/issm-1.0/packages/mpich2/install/include  --with-mpi-lib="-L/u/astrid1/larour/issm-1.0/packages/mpich2/install/lib/ -lmpich" --with-petsc-arch=linux-gnu-amd64
+exit
+make -j 8 
+make install
Index: /issm/trunk/contributors.txt
===================================================================
--- /issm/trunk/contributors.txt	(revision 1)
+++ /issm/trunk/contributors.txt	(revision 1)
@@ -0,0 +1,12 @@
+We thank the following contributors for their help in making ISSM better!
+
+Robert Crippen, Jet Propulsion Laboratory.  robbert.crippen@jpl.nasa.gov
+HoleFiller routines to plug incomplete datasets. See HoleFiller module in src/m/matlab/utils
+
+SuiteSparse from Tim Davis, Assoc. Prof.Room E338 CSE Building
+P.O. Box 116120 University of Florida Gainesville, FL 32611-6120 352/392-1481 
+email: my last name AT cise.ufl.edu. 
+
+Point Inclusion in Polygon Test (pnpoly.c used in Utils/Arguscontourtomesh/IsInPoly.c)
+W. Randolph Franklin (WRF)
+http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
Index: /issm/trunk/cron/README
===================================================================
--- /issm/trunk/cron/README	(revision 1)
+++ /issm/trunk/cron/README	(revision 1)
@@ -0,0 +1,16 @@
+The Cron directory holds scripts that can be used to run 
+jobs periodically on *nix systems. 
+
+Just add an entry in the cron table to run the ice.sh script, 
+and all the scripts in this directory will be taken care of. 
+
+For example, if you add: 
+
+5 5 * * * cd $ICEHOME/Cron && ./ice.sh
+
+This will run all the scripts in the Cron directory, every day, at 5:05 am. 
+
+
+
+If users want to add their own scripts, just add the script to the Cron directory and
+add an entry in the ice.sh for this script.
Index: /issm/trunk/cron/ice.sh
===================================================================
--- /issm/trunk/cron/ice.sh	(revision 1)
+++ /issm/trunk/cron/ice.sh	(revision 1)
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+
+#Run tagging of ICE code
+./tag.sh
+
+#Run nightly run
+./nightlyrun.sh
Index: /issm/trunk/cron/killingforeign.sh
===================================================================
--- /issm/trunk/cron/killingforeign.sh	(revision 1)
+++ /issm/trunk/cron/killingforeign.sh	(revision 1)
@@ -0,0 +1,20 @@
+#!/bin/bash
+#This script will run anything popping up in the current directory, using the Cielo 
+#software. 
+
+#Get paths correctly setup
+source ~/.bash_profile
+
+#Ok, we are being launched by the cron job. We are going through all the files, detecting which 
+#ones have a .kill attached to them.  source the kill file.
+
+numberoffiles=`ls *.kill 2> /dev/null | wc -l`
+
+if [[ $numberoffiles != 0 ]]
+then
+	for i  in *.kill
+	do
+		name=`echo $i | sed 's/.kill//'`
+		source $name.kill
+	done
+fi
Index: /issm/trunk/cron/linux_cronfile
===================================================================
--- /issm/trunk/cron/linux_cronfile	(revision 1)
+++ /issm/trunk/cron/linux_cronfile	(revision 1)
@@ -0,0 +1,3 @@
+#05 0 * * * cd $HOME/Ice/ice1/cron/ && ./ice.sh
+*/5 * * * * cd $HOME/TestingForeign/ && source /u/wilkes-r1b/larour/Ice/ice1.proto/cron/testingforeign.sh
+*/5 * * * * cd $HOME/TestingForeign/ && source /u/wilkes-r1b/larour/Ice/ice1.proto/cron/killingforeign.sh
Index: /issm/trunk/cron/list
===================================================================
--- /issm/trunk/cron/list	(revision 1)
+++ /issm/trunk/cron/list	(revision 1)
@@ -0,0 +1,11 @@
+CVS
+ice.sh
+killingforeign.sh
+linux_cronfile
+list
+mailinglist
+Makefile.am
+nightlyrun.sh
+README
+tag.sh
+testingforeign.sh
Index: /issm/trunk/cron/mailinglist
===================================================================
--- /issm/trunk/cron/mailinglist	(revision 1)
+++ /issm/trunk/cron/mailinglist	(revision 1)
@@ -0,0 +1,2 @@
+#Mailing list for nightly runs
+MAILINGLIST="ala@jpl.nasa.gov eric.larour@jpl.nasa.gov mathieu.morlighem@jpl.nasa.gov helene.seroussi@jpl.nasa.gov"
Index: /issm/trunk/cron/nightlyrun.sh
===================================================================
--- /issm/trunk/cron/nightlyrun.sh	(revision 1)
+++ /issm/trunk/cron/nightlyrun.sh	(revision 1)
@@ -0,0 +1,74 @@
+#!/bin/bash
+#This bash script calls the nightlyrun.m matlab file to run our nightly test decks. 
+#It then processes the results and sends an email to the Ice developpers.
+
+#Some functions 
+function today_date {
+suffix=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'` 
+echo $suffix;
+}
+
+export ISSM_DIR="/home/seroussi/Ice/ice1/cron/ice1"
+
+ICE_RELEASE="ice1";
+ICE_REPOSITORY="/home/larour/Ice_Repository";
+
+#Figure out today's date
+today=`today_date`;
+host_name=`hostname`;
+
+#Erase code
+rm -rf $ICE_RELEASE
+
+#Fetch cvs code
+cvs -d $ICE_REPOSITORY co -P $ICE_RELEASE
+
+source $ISSM_DIR/etc/environment.sh
+
+#Go to the ice directory
+cd $ICE_RELEASE
+ICEDIR=`pwd`;
+
+#install ISSM
+cd scripts
+sh quickinstall.sh
+cd ..
+
+#Figure out mailing list
+source cron/mailinglist
+
+#Launch matlab and the nightly run script
+matlab -nodisplay  > ./nightly.log << EOF 
+startup
+nightlyrun;
+EOF
+
+#Process log for errors 
+cat nightly.log | grep ERROR > errors1.log
+cat nightly.log | grep SUCCESS > errors2.log
+cat errors1.log errors2.log > errors.log
+		
+#Mail
+ERRORS=`cat errors.log`
+if [ `expr length "$ERRORS"`  = "0" ]; then
+	for i in `echo $MAILINGLIST`
+		do
+			mail -s "Nightly runs of $ICE_RELEASE on: $host_name. Date:$today. DID NOT WORK CORRECTLY" $i < nightly.log
+		done
+else
+	for i in `echo $MAILINGLIST`
+		do  
+			mail -s "Nightly runs of $ICE_RELEASE on: $host_name. Date:$today." $i < errors.log
+		done
+fi
+
+#Erase log and error logs
+rm -rf nightly.log errors1.log errors2.log errors.log
+
+#Erase ice code
+cd ..
+rm -rf $ICE_RELEASE
+
+#back to old ISSM_DIR
+ISSM_DIR=$OLDISSM_DIR
+export ISSM_DIR
Index: /issm/trunk/cron/tag.sh
===================================================================
--- /issm/trunk/cron/tag.sh	(revision 1)
+++ /issm/trunk/cron/tag.sh	(revision 1)
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+release=ice1
+repository=/home/larour/Ice_Repository
+home=/home/seroussi
+current=`pwd`
+
+#Functions
+
+function today_date {
+suffix=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'` 
+echo $suffix;
+}
+
+#Date
+today=`today_date`;
+
+#Go to home directory
+cd $home
+
+#Erase to make a fresh tag;
+if [ -d $release ] 
+then
+	rm -rf $release
+fi
+
+#Fetch cvs release
+cvs -d $repository co -P $release 
+
+#Tag cvs
+cd $release
+cvs -d $repository tag -R $today 
+cd ../
+
+#Erase cvs release
+rm -rf "./$release"
+
+#Go back to current directory
+cd $current
Index: /issm/trunk/cron/testingforeign.sh
===================================================================
--- /issm/trunk/cron/testingforeign.sh	(revision 1)
+++ /issm/trunk/cron/testingforeign.sh	(revision 1)
@@ -0,0 +1,25 @@
+#!/bin/bash
+#This script will run anything popping up in the current directory, using the Cielo 
+#software. 
+
+#Get paths correctly setup
+source ~/.bash_profile
+
+#Ok, we are being launched by the cron job. We are going through all the files, detecting which 
+#ones have a .queue attached to them. For those files, check whether a .errlog and .outlog are already present.
+#If they are, skip this file, it is already being run. For the other ones, source the queue file.
+
+numberoffiles=`ls *.queue 2> /dev/null | wc -l`
+
+if [[ $numberoffiles != 0 ]]
+then
+	for i  in *.queue
+	do
+		name=`echo $i | sed 's/.queue//'`
+		if [ ! -e $name.outlog ]
+		then
+			#Launch "name" job
+			source $name.queue
+		fi
+	done
+fi
Index: /issm/trunk/depcomp
===================================================================
--- /issm/trunk/depcomp	(revision 1)
+++ /issm/trunk/depcomp	(revision 1)
@@ -0,0 +1,1 @@
+link /u/wilkes-r1b/larour/Bin/automake/share/automake-1.10/depcomp
Index: /issm/trunk/doc/developerguide/Makefile
===================================================================
--- /issm/trunk/doc/developerguide/Makefile	(revision 1)
+++ /issm/trunk/doc/developerguide/Makefile	(revision 1)
@@ -0,0 +1,13 @@
+#Makefile for developper guide 
+
+all: matlabhtml chtml
+
+matlabhtml:
+	rm -rf matlabhtml
+	./creatematlabhtmldoc.sh
+
+chtml:
+	./createhtmldoc.sh
+
+clean: 
+	rm -rf  chtml matlabhtml
Index: /issm/trunk/doc/developerguide/createhtmldoc.sh
===================================================================
--- /issm/trunk/doc/developerguide/createhtmldoc.sh	(revision 1)
+++ /issm/trunk/doc/developerguide/createhtmldoc.sh	(revision 1)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+#Go to root directory, because doxygen seems to have a problem running otherwise.
+cd $ISSM_DIR
+
+#Symlink the doxygen configuration file to root dir.
+ln -s "$ISSM_DIR/doc/developerguide/doxygen.config" ./doxygen.config
+
+#Run doxygen
+doxygen doxygen.config
+
+#Erase symlink
+rm doxygen.config
+
+#change index and put it in doc
+cd $ISSM_DIR/doc/
+cat developerguide/chtml/index.html  | sed -e "s/tabs.css/developerguide\/chtml\/tabs.css/g" | sed -e "s/doxygen.css/developerguide\/chtml\/doxygen.css/g" | sed -e "s/href=\"index.html/href=\"developerguide\/chtml\/index.html/g" | sed -e "s/annotated.html/developerguide\/chtml\/annotated.html/g" | sed -e "s/files.html/developerguide\/chtml\/files.html/g" > index.html
Index: /issm/trunk/doc/developerguide/creatematlabhtmldoc.sh
===================================================================
--- /issm/trunk/doc/developerguide/creatematlabhtmldoc.sh	(revision 1)
+++ /issm/trunk/doc/developerguide/creatematlabhtmldoc.sh	(revision 1)
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+#go to the main directory
+cd $ISSM_DIR
+
+#launch matlab
+matlab -nojvm << EOF
+%get ISSM_DIR, brief name
+[status,ISSM_DIR_BRIEF]=system('basename `pwd`');
+ISSM_DIR_BRIEF=ISSM_DIR_BRIEF(1:end-1); %skip the \n character
+if status~=0 | isempty(ISSM_DIR_BRIEF) | length(ISSM_DIR_BRIEF)==1,
+	error('startup error message: could not retrieve ISSM_DIR brief name');
+	end
+
+	cd ../
+
+	%Here are the subdirectories we want to go through:
+	mfiles={[ISSM_DIR_BRIEF '/src/m']};
+
+	%run m2html, and dump the documentation in ISSM_DIR/Doc/developerguide/m2htmldoc
+	m2html('htmldir',[ISSM_DIR '/doc/developerguide/matlabhtml'],'recursive','on','source','on','syntaxHighlighting','on','globalHypertextLinks','on','global','on','template','frame', 'index','menu','mFiles',mfiles);
+EOF
Index: /issm/trunk/doc/developerguide/doxygen.config
===================================================================
--- /issm/trunk/doc/developerguide/doxygen.config	(revision 1)
+++ /issm/trunk/doc/developerguide/doxygen.config	(revision 1)
@@ -0,0 +1,1510 @@
+# Doxyfile 1.5.8
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file 
+# that follow. The default is UTF-8 which is also the encoding used for all 
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
+# iconv built into libc) for the transcoding. See 
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           =  "ISSM"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = "1.0"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       =  doc/developerguide
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, 
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), 
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, 
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, 
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like regular Qt-style comments 
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
+# interpret the first line (until the first dot) of a Qt-style 
+# comment as the brief description. If set to NO, the comments 
+# will behave just like regular Qt-style comments (thus requiring 
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Java. For instance, namespaces will be presented as packages, qualified 
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
+# sources. Doxygen will then generate output that is tailored for 
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it parses. 
+# With this tag you can assign which parser to use for a given extension. 
+# Doxygen has a built-in mapping, but you can override or extend it using this tag. 
+# The format is ext=language, where ext is a file extension, and language is one of 
+# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 
+# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 
+# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 
+# use: inc=Fortran f=C
+
+EXTENSION_MAPPING      = 
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
+# to include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to 
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
+# Doxygen will parse them like normal C++ but will assume all classes use public 
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter 
+# and setter methods for a property. Setting this option to YES (the default) 
+# will make doxygen to replace the get and set methods by a property in the 
+# documentation. This will only work if the methods are indeed getting or 
+# setting a simple type. If this is not the case, or you want to show the 
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
+# is documented as struct, union, or enum with the name of the typedef. So 
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
+# with name TypeT. When disabled the typedef will appear as a member of a file, 
+# namespace, or class. And the struct will be named TypeS. This can typically 
+# be useful for C code in case the coding convention dictates that all compound 
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = YES
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 
+# determine which symbols to keep in memory and which to flush to disk. 
+# When the cache is full, less often used symbols will be written to disk. 
+# For small to medium size projects (<1000 input files) the default value is 
+# probably good enough. For larger projects a too small cache size can cause 
+# doxygen to be busy swapping symbols to and from disk most of the time 
+# causing a significant performance penality. 
+# If the system has enough physical memory increasing the cache will improve the 
+# performance by keeping more symbols in memory. Note that the value works on 
+# a logarithmic scale so increasing the size by one will rougly double the 
+# memory usage. The cache size is given by this formula: 
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be 
+# extracted and appear in the documentation as a namespace called 
+# 'anonymous_namespace{file}', where file will be replaced with the base 
+# name of the file that contains the anonymous namespace. By default 
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
+# hierarchy of group names into alphabetical order. If set to NO (the default) 
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
+# This will remove the Files entry from the Quick Index and from the 
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
+# Namespaces page. 
+# This will remove the Namespaces entry from the Quick Index 
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from 
+# the version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 
+# doxygen. The layout file controls the global structure of the generated output files 
+# in an output format independent way. The create the layout file that represents 
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a 
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name 
+# of the layout file.
+
+LAYOUT_FILE            = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  =  ./
+
+# This tag can be used to specify the character encoding of the source files 
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
+# also the default input encoding. Doxygen uses libiconv (or the iconv built 
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS          =  *.c *.h *.dox 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = */packages/* */tests/* */examples/*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the 
+# output. The symbol name can be a fully qualified name, a word, or if the 
+# wildcard * is used, a substring. Examples: ANamespace, AClass, 
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output. 
+# If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis. 
+# Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match. 
+# The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 
+# link to the source code. 
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = chtml
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
+# documentation will contain sections that can be hidden and shown after the 
+# page has loaded. For this to work a browser that supports 
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files 
+# will be generated that can be used as input for Apple's Xcode 3 
+# integrated development environment, introduced with OSX 10.5 (Leopard). 
+# To create a documentation set, doxygen will generate a Makefile in the 
+# HTML output directory. Running make will produce the docset in that 
+# directory and running "make install" will install the docset in 
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
+# it at startup. 
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
+# feed. A documentation feed provides an umbrella under which multiple 
+# documentation sets from a single provider (such as a company or product suite) 
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
+# should uniquely identify the documentation set bundle. This should be a 
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file 
+# content.
+
+CHM_INDEX_ENCODING     = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 
+# are set, an additional index file will be generated that can be used as input for 
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 
+# HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
+# be used to specify the file name of the resulting .qch file. 
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               = 
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = 
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 
+# For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   = 
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  = 
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 
+# filter section matches. 
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  = 
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
+# be used to specify the location of Qt's qhelpgenerator. 
+# If non-empty doxygen will try to run qhelpgenerator on the generated 
+# .qhp file.
+
+QHG_LOCATION           = 
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 
+# structure should be generated to display hierarchical information. 
+# If the tag value is set to FRAME, a side panel will be generated 
+# containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature. Other possible values 
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories, 
+# and Class Hierarchy pages using a tree view instead of an ordered list; 
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which 
+# disables this behavior completely. For backwards compatibility with previous 
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE 
+# respectively.
+
+GENERATE_TREEVIEW      = NONE
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# Use this tag to change the font size of Latex formulas included 
+# as images in the HTML documentation. The default is 10. Note that 
+# when you change the font size after a successful doxygen run you need 
+# to manually remove any form_*.png images from the HTML output directory 
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader. 
+# This is useful 
+# if you want to understand what is going on. 
+# On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#  
+# TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#  
+# TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links. 
+# Note that each tag file must have a unique name 
+# (where the name does NOT include the path) 
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see 
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
+# the mscgen tool resides. If left empty the tool is assumed to be found in the 
+# default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output 
+# directory and reference it in all dot files that doxygen generates. This 
+# font does not include all possible unicode characters however, so when you need 
+# these (or just want a differently looking font) you can specify the font name 
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font, 
+# which can be done by putting it in a standard location or by setting the 
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 
+# containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the output directory to look for the 
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a 
+# different font using DOT_FONTNAME you can set the path where dot 
+# can find it using this tag.
+
+DOT_FONTPATH           = 
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then 
+# doxygen will generate a call dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable call graphs 
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
+# doxygen will generate a caller dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable caller 
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include 
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif 
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen if the 
+# number of direct children of the root node in a graph is already larger than 
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that the size of a graph can be further restricted by 
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, because dot on Windows does not 
+# seem to support this out of the box. Warning: Depending on the platform used, 
+# enabling this option may lead to badly anti-aliased labels on the edges of 
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Options related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
Index: /issm/trunk/doc/index.html
===================================================================
--- /issm/trunk/doc/index.html	(revision 1)
+++ /issm/trunk/doc/index.html	(revision 1)
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>ISSM: ISSM Documentation</title>
+<link href="developerguide/chtml/tabs.css" rel="stylesheet" type="text/css">
+<link href="developerguide/chtml/doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.5.8 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="developerguide/chtml/index.html"><span>Main&nbsp;Page</span></a></li>
+      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
+      <li><a href="developerguide/chtml/annotated.html"><span>Data&nbsp;Structures</span></a></li>
+      <li><a href="developerguide/chtml/files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>ISSM Documentation</h1>
+<p>
+<h3 align="center">1.0 </h3>You can find several documentations of the Ice Sheet System Model (ISSM) code:<h2><a class="anchor" name="user">
+User Guide</a></h2>
+<ul>
+<li>You can download a <a href="userguide.pdf"><b>pdf</b></a> documentation to get you started.</li></ul>
+<h2><a class="anchor" name="theory">
+Theory guide:</a></h2>
+<ul>
+<li>You can download a theory guide <a href="theoryguide.pdf"><b>here</b></a> if you want to know more about the theory of ice sheet modeling and finite element.</li></ul>
+<h2><a class="anchor" name="api">
+Developer guide:</a></h2>
+You have also a documentation for the Matlab file <a href="developerguide/matlabhtml/index.html"><b>here</b></a><p>
+<dl class="author" compact><dt><b>Authors:</b></dt><dd>Eric Larour, Helene Seroussi and Mathieu Morlighem. </dd></dl>
+</div>
+<hr size="1"><address style="text-align: right;"><small>Generated on Mon Mar 30 16:30:43 2009 for ISSM by&nbsp;
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
+</body>
+</html>
Index: /issm/trunk/doc/issmdoc.m
===================================================================
--- /issm/trunk/doc/issmdoc.m	(revision 1)
+++ /issm/trunk/doc/issmdoc.m	(revision 1)
@@ -0,0 +1,18 @@
+%Quick documentation for ISSM
+
+%First get ISSM dir: 
+ISSM_DIR=issmdir;
+
+disp(sprintf('\n%s%s%s','  The following documentations are available in ',ISSM_DIR,'/doc/'));
+disp(sprintf('%s','	   userguide: how to use ISSM, quick tutorial'));
+disp(sprintf('%s','	   theoryguide: theory behind the ISSM models'));
+disp(sprintf('%s\n','	   developperguide: documented API and source code'));
+disp(sprintf('%s','  Example: how to create a square ice shelf'));
+disp(sprintf('%s','	   go to ',ISSM_DIR,'/examples/SquareIceshelf'));
+disp(sprintf('%s','	   md=model;                                %creates a new empty model structure'));
+disp(sprintf('%s','	   md=mesh(md,''DomainOutline.exp'',50000);   %creates a mesh of the domain outline with a resolution of 50000m'));
+disp(sprintf('%s','	   md=geography(md,''all'','''');               %defines the glacier system as an ice shelf (no island)'));
+disp(sprintf('%s','	   md=parameterize(md,''Square.par'');        %fills all the other fields of the model'));
+disp(sprintf('%s','	   md=setelementstype(md,''macayeal'',''all''); %defines all elements as MacAyeal''s'));
+disp(sprintf('%s','	   md=solve(md,''diagnostic'',''ice'');         %generate the velocity field of the ice shelf using the solver ICE'));
+disp(sprintf('%s','	   plotmodel(md,''data'',''vel'');              %displays the velocity (type plotdoc for plotmodel help)'));
Index: /issm/trunk/doc/mainpage.dox
===================================================================
--- /issm/trunk/doc/mainpage.dox	(revision 1)
+++ /issm/trunk/doc/mainpage.dox	(revision 1)
@@ -0,0 +1,16 @@
+/*! 
+*@mainpage ISSM Documentation
+* You can find several documentations of the Ice Sheet System Model (ISSM) code:
+*
+*\section user User Guide
+*- You can download a <a href="userguide.pdf"><b>pdf</b></a> documentation to get you started.
+*
+*\section theory Theory guide:
+*- You can download a theory guide <a href="theoryguide.pdf"><b>here</b></a> if you want to know more about the theory of ice sheet modeling and finite element.
+*
+*\section api Developer guide: 
+*You have also a documentation for the Matlab file <a href="developerguide/matlabhtml/index.html"><b>here</b></a>
+*
+*@authors Eric Larour, Helene Seroussi and Mathieu Morlighem.
+*/
+
Index: /issm/trunk/doc/theoryguide/Makefile
===================================================================
--- /issm/trunk/doc/theoryguide/Makefile	(revision 1)
+++ /issm/trunk/doc/theoryguide/Makefile	(revision 1)
@@ -0,0 +1,40 @@
+#Makefile for finite element formlations used in ice
+
+
+DEPENDENCIES= Algorithm.png \
+			  meshpenalty.png\
+			  bilanmass.png\
+			  Assembly.png\
+			  penalties1.png\
+			  accumulation.png \
+			  melting.png \
+			  friction_geometry.png \
+			  thermal_loop.png \
+			  geometry3D.png \
+			  schema4.png \
+			  triaelem.png \
+			  tetraelem.png\
+			  pentaelem.png\
+			  quadelem.png\
+			  segment.png\
+		          barycentric_tria.png \
+			  barycentric_penta.png \
+			  friction_kin.png\
+			  schema1.png  \
+			  schema5.png  \
+			  TpmpMb.png\
+			  MINI.png\
+			  penalized_vel_3.png\
+			  penalized_vel_2.png\
+			  theoryguide.tex   
+
+all: theoryguide.pdf
+
+theoryguide.pdf: $(DEPENDENCIES)
+
+	pdflatex theoryguide.tex
+	pdflatex theoryguide.tex
+	pdflatex theoryguide.tex
+
+clean: 
+	rm -rf *.dvi *.ps *.pdf *.toc *.log *.aux *.out
Index: /issm/trunk/doc/theoryguide/theoryguide.tex
===================================================================
--- /issm/trunk/doc/theoryguide/theoryguide.tex	(revision 1)
+++ /issm/trunk/doc/theoryguide/theoryguide.tex	(revision 1)
@@ -0,0 +1,6840 @@
+%%% Debut du preambule %%%
+
+\documentclass[letterpaper]{report}     % Classe du document
+\usepackage[T1]{fontenc}            % Encodage de sortie (l'encodage T1 convient mieux aux langues autres que l'Anglais)
+\usepackage{aeguill,aecompl}        % Fontes virtuelles (nuit aux recherches et aux copies de texte dans le document PDF) pour PDF:
+                                    % ameliore la qualite de la visualisation avec Acrobat Reader
+
+%\hypersetup{colorlinks=true,linkcolor=blue,citecolor=magenta}
+
+
+\title{ISSM documentation}
+\author{Larour, Morlighem, Seroussi, Khazendar}
+\date{2008}
+
+\usepackage{graphicx}                        % Inclusion d'images
+\usepackage{array, multirow}                 % Tableaux
+\usepackage{amsmath}                         % Mode mathematique
+\usepackage{amsfonts}                        % Polices mathematiques
+\usepackage{amssymb}                         % Symboles mathematiques
+\usepackage{makeidx}
+\usepackage{float}                           %Pour faire [H] sur les float
+\usepackage[left=3cm, right=3cm,
+                        top=2cm, bottom=2cm]{geometry}
+
+\usepackage{fancyhdr}
+\usepackage{subfig}
+\usepackage{longtable}
+\usepackage{cancel}
+
+\lhead{\leftmark{}} %en haut a gauche, titre de section
+\rhead{\thepage}   %en haut a droite, page
+\lfoot{NASA - Jet Propulsion Laboratory} %en bas a gauche
+\rfoot{\scriptsize{\today}} %en bas a droite
+\cfoot{ISSM Documentation} %en bas, au milieu
+\setcounter{tocdepth}{4}                     %pour afficher la table des matiere au niveau subsection
+\setcounter{secnumdepth}{4}
+
+
+\usepackage[plainpages=false]{hyperref}
+
+\hypersetup{% Links Options for the document%
+colorlinks=true,
+linkcolor=blue,
+urlcolor=blue,
+% anchorcolor=darkblue,
+citecolor=blue,
+plainpages=false,
+%PDF Options%
+pdftitle={Formulations},
+pdfauthor={Larour, Morlighem, Seroussi,Khazendar},
+pdfsubject={Numerical modelling of ice sheets}}
+\newcommand*{\BigO}[1]{\mathcal{O}\left( #1\right) }   %Big O landau notation
+
+\pagestyle{fancy}
+\bibliographystyle{plain}
+
+%%% Fin du preambule %%%
+\begin{document}
+%%Page de titre
+
+\thispagestyle{empty}
+
+\vspace{10cm}
+\begin{center}
+\bf \LARGE Ice Sheet System Model 2008\\  Theory Guide
+\end{center}
+
+\vspace{4cm}
+
+\begin{center}
+Authors:\\   
+\vspace{.5cm}
+{\bf \large \'Eric Larour$^{1}$} \\
+\smallskip
+{\bf \large Mathieu Morlighem$^{2,4}$} \\
+\smallskip
+{\bf \large H\'el\`ene Seroussi$^{2,4}$} \\
+\smallskip
+{\bf \large \'Eric Rignot$^{2,3}$} \\
+\vfill
+%\vspace{4.5cm}
+$^{1}$Division 35, Thermal and Cryogenics Section, \\
+Mechanical Division, MS 157-316.  \\
+Jet Propulsion Laboratory, 4800 Oak Grove Drive, Pasadena, CA 91109.\\
+\vspace{.2cm}
+$^{2}$Division 33, Radar Science and Enginnering Section, \\
+Communications, Tracking and Radar Division, MS 157-316.  \\
+Jet Propulsion Laboratory, 4800 Oak Grove Drive, Pasadena, CA 91109.\\
+\vspace{.2cm}
+$^{3}$University of California, Irvine\\
+Department of Earth System Science\\
+Croul Hall, Irvine, CA 92697-3100\\
+\vspace{.2cm}
+$^{4}$Laboratoire de M\'ecanique des sols, Structures et  mat\'eriaux (MSSMat)\\
+\'Ecole Centrale Paris, CNRS UMR 8579\\
+Grande Voie des Vignes, 92295 Châtenay-Malabry Cedex, FRANCE\\
+
+\vspace{0.5cm}
+\today
+\end{center}
+
+\cleardoublepage
+
+\begin{center}
+{\Large \bf Summary}
+\end{center}
+This manual explains ... 
+
+\vspace{1cm}
+Key-words : ICE, ice flow, finite elements, 2-D, 3-D, matlab
+
+\cleardoublepage
+
+%%Table of content
+%%%%%%%%%%%%%%%%%%%
+%\pagestyle{headings} %entete et pieds de pages par defaut
+
+
+\tableofcontents
+        
+\newpage
+
+%%Body
+%%%%%%%%%%%
+        \chapter*{Introduction}
+This document...
+\\
+\\
+\\
+KEYWORD: Models, weak formulation, Galerkin, finite element, gauss quadrature,Full stokes, ice sheet numerical finite element model,...
+
+\newpage
+\chapter{Physical basis}
+This chapter describes the principles of glacier mechanics. We introduce the constitutive relation of ice: Glen's flow law, as well as some basic concepts such as conservation of mass and momentum balance. These equations are used to deduce the three models used in $ISSM$ (Ice Sheet System Model). In a second part, the boundary conditions are presented. The last part is dedicated to a thermodynamic model that was also implemented in $ISSM$.
+
+\section{Notations and geometry}
+
+We consider an ice sheet extending into the ocean. The floating part is an ice shelf.
+Deformable subglacial till is present below the grounded ice. The geometry is described by the following scheme:
+\\
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=11cm]{schema1.png}
+\caption{Schematic cross section of the glacier}
+\label{schema1}
+\end{center}
+\end{figure}
+\vspace*{-0.4cm}
+\noindent
+The z axis is vertically pointing upward and the sea level is at $z=0$, the xy-plane is horizontal. We note:
+\begin{itemize}
+        \item[--] $H (x,y)$ glacier thickness
+                \vspace*{-0.9mm}
+        \item[--] $s(x,y)$  glacier's upper surface z coordinate
+                \vspace*{-0.9mm}
+        \item[--] $b(x,y)$ glacier's lower surface z coordinate 
+\end{itemize}
+\vspace*{0.4cm}
+Regarding kinematic quantities, we adopt the following notations:
+\begin{itemize}
+        \item[--] $\overrightarrow{v}(x,y,z)$ is the glacier velocity
+                \vspace*{-0.9mm}
+        \item[--] $u(x,y,z)$ velocity x-component
+                \vspace*{-0.9mm}
+        \item[--] $v(x,y,z)$ velocity y-component
+                \vspace*{-0.9mm}
+        \item[--] $w(x,y,z)$ velocity z-component
+                \vspace*{-0.9mm}
+        \item[--] $\varepsilon(x,y,z)$ strain tensor
+                \vspace*{-0.9mm}
+        \item[--] $\dot{\varepsilon}(x,y,z)$ strain rate tensor
+                \vspace*{-0.9mm}
+        \item[--] $\sigma (x,y,z)$ stress tensor
+\end{itemize}
+
+\newpage
+\section{Deformation Law}
+\subsection{Flow law}
+
+The deformation of ice involves the deviatoric stress tensor because hydrostatic pressure does not contribute to ice deformation. It only depends on shear (Hooke, 2005 \cite{Hooke2005} p13 and Paterson,1994 \cite{Paterson1994}). The deviatoric stress is:
+
+\begin{equation}
+\sigma '=\sigma-\frac{1}{3} Tr(\sigma)=\sigma + P \left[ I \right]
+\label{deviatoric stress}
+\end{equation}
+\\
+where $\sigma$ is the stress tensor and $P$ is the hydrostatic pressure\footnote{$\displaystyle Tr(\sigma)=\sum_i \sigma_{ii}$ is the stress trace}.The
+effective strain and the effective shear stress are defined as follows:
+
+\begin{equation}
+\dot{\varepsilon_{e}}= \frac{1}{\sqrt{2}} \left( \sum_{i,j=1..3}
+\dot{\varepsilon}_{ij}^{2}\right) ^{1/2}
+\qquad \qquad
+\sigma'_{e}= \frac{1}{\sqrt{2}} \left( \sum_{i,j=1..3} \sigma_{ij}'^{2}\right) ^{1/2}
+\label{epsilone1}
+\end{equation}
+\\
+where $\dot{\varepsilon}$ is the strain rate tensor. The most common flow law is Glen's flow law,
+based on John W. Glen's experiments (Glen, 1955 \cite{Glen1955}). He used the form:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\
+\displaystyle \dot{\varepsilon_{e}}=\left( \frac{\sigma'_{e}}{B}\right) ^{n} \\
+\\
+\hline
+\end{array}
+\end{equation}
+\\
+where $B$ is a viscosity parameter which increases as the ice becomes stiffer ($MPa.a^{\frac{1}{n}} $), $n$ is empirically determined(most studies have found that $ n\simeq 3 $, see Hooke, 2005 \cite{Hooke2005} p15 and Paterson, 1994 \cite{Paterson1994} p86) and is called flow law exponent.
+
+\subsection{Constitutive relation of ice}
+
+We consider that ice is an isotropic and incompressible material. This implies that the principal axes
+of the deviatoric stress $ \sigma' $ and the strain rate tensor $ \dot{\varepsilon} $
+coincide. The ice that constitutes glaciers is not isotropic and incompressible;
+but this approximation is a convenient starting point for calculations of glacier flow. If the principal axes of deviatoric stress and  strain rate coincide, the flow law becomes (Hooke, 2005 \cite{Hooke2005}, p269):
+
+\begin{equation}
+\dot{\varepsilon}= \frac{{\sigma'_{e}}^{n-1}}{B^n} \sigma '
+\end{equation}
+\\
+Then, combining Glen's flow law to eliminate $\sigma_{e}$, we obtain:
+
+\begin{equation}
+\dot{\varepsilon}= \frac{\dot{\varepsilon_{e}}^{\frac{n-1}{n}}}{B} \sigma '
+\end{equation}
+\\
+Following MacAyeal (MacAyeal, 1989 \cite{Macayeal1989}), we define the viscosity $\mu$ as:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\
+\displaystyle \mu= \frac{B}{2\left( \dot{\varepsilon_{e}}^{1-\frac{1}{n}}\right) }\\
+\\
+\hline
+\end{array}
+\label{visco}
+\end{equation}
+\\
+Then the constitutive relation for ice becomes:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\
+\displaystyle \sigma'=2\mu\dot{\varepsilon}\\
+\\
+\hline
+\end{array}
+\label{constitutive relation}
+\end{equation}
+
+\section{Local Conservation of Mass and Momentum}
+
+\subsection{Mass balance}
+The most general equation of local mass balance includes a production term $\dot{M}$. With $\rho$ the density of ice, the equation is:
+
+\begin{equation}
+\frac{\partial \rho}{\partial t} + div \left( \rho \overrightarrow{v}\right) = \dot{M}
+\end{equation}
+\\
+In a glacier, there is no production of mass locally (surface accumulation and basal melting are not involved in local mass balance, they are treated as boundary conditions). The ice is also treated as incompressible: $\rho$ is constant (Hooke, 2005 \cite{Hooke2005} p14). The previous equation
+can be rewritten as follows:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\
+div \left(\overrightarrow{v}\right) = 0\\
+\label{incompressibility}
+\\
+\hline
+\end{array}
+\end{equation}
+
+\subsection{Momentum balance}
+The fundamental equation of momentum conservation (with $\overrightarrow{g}$ the acceleration due to gravity):
+
+\begin{equation}
+\underline{Div}\left( \sigma \right) + \rho \overrightarrow{g} =  \rho\frac{d\overrightarrow{v}}{d t}
+\end{equation}
+\\
+For a glacier, the acceleration is small. Thus the acceleration term is negligible compared to the other terms: the ice is described by a quasi-static model (Paterson,1994 \cite{Paterson1994} p258).
+If we use the deviatoric stress defined in (\ref{deviatoric stress}), the momentum balance becomes:
+
+\begin{equation}
+\underline{Div}\left( \sigma ' \right) -\overrightarrow{grad}P+ \rho\overrightarrow{g} = 0
+\end{equation}
+\\
+using the constitutive relation (\ref{constitutive relation}) gives:
+
+\begin{equation}
+ \left\{ \begin{array}{l}
+                2 \underline{Div} \left(\mu\dot{\varepsilon}\right) -\overrightarrow{grad}P+ \rho\overrightarrow{g} = 0\\
+\\
+ \displaystyle           \mu= \frac{B}{2\left( \dot{\varepsilon_{e}}^{1-\frac{1}{n}}\right) }
+                 \end{array} \right.
+\end{equation}
+\\
+The momentum balance can hence be described by three different sets of equations that are strictly equivalent to each other:
+
+\subsubsection*{Momentum balance in terms of stress}
+
+\begin{equation}
+\begin{array}{| c c c|}
+\hline
+&&\\ &
+ \left\{ \begin{array}{l}
+\displaystyle                \frac{\partial{\sigma}_{xx}}{\partial x}+\frac{\partial {\sigma}_{xy}}{\partial y}+\frac{\partial {\sigma}_{xz}}{\partial z}=0\\
+\\
+\displaystyle              \frac{\partial{\sigma}_{yx}}{\partial x}+\frac{\partial {\sigma}_{yy}}{\partial y}+\frac{\partial {\sigma}_{yz}}{\partial z}=0\\
+\\
+\displaystyle               \frac{\partial{\sigma}_{zx}}{\partial x}+\frac{\partial {\sigma}_{zy}}{\partial y}+\frac{\partial {\sigma}_{zz}}{\partial z}- \rho g=0
+                 \end{array} \right. &\\
+&&\\
+\hline
+\end{array}
+\label{dynamics_stress}
+\end{equation}  
+
+\subsubsection*{Momentum balance in terms of deviatoric stress}
+             
+\begin{equation}
+\begin{array}{|c c c|}
+\hline
+&&\\&
+ \left\{ \begin{array}{l}
+\displaystyle                \frac{\partial{\sigma'}_{xx}}{\partial x}+\frac{\partial {\sigma'}_{xy}}{\partial y}+\frac{\partial {\sigma'}_{xz}}{\partial z}-\frac{\partial P}{\partial x}=0\\
+\\
+\displaystyle              \frac{\partial{\sigma'}_{yx}}{\partial x}+\frac{\partial {\sigma'}_{yy}}{\partial y}+\frac{\partial {\sigma'}_{yz}}{\partial z}-\frac{\partial P}{\partial y}=0\\
+\\
+\displaystyle               \frac{\partial{\sigma'}_{zx}}{\partial x}+\frac{\partial {\sigma'}_{zy}}{\partial y}+\frac{\partial {\sigma'}_{zz}}{\partial z}-\frac{\partial P}{\partial z}- \rho g=0
+                 \end{array} \right. & \\
+&&\\
+\hline
+\end{array}
+\label{dynamics_deviatoricstress}
+\end{equation}      
+
+\subsubsection*{Momentum balance in terms of strain rate} 
+         
+\begin{equation}
+\begin{array}{|c c c|}
+\hline
+&&\\&
+ \left\{ \begin{array}{l}
+\displaystyle                2\frac{\partial\mu\dot{\varepsilon}_{xx}}{\partial x}+2\frac{\partial \mu\dot{\varepsilon}_{xy}}{\partial y}+2\frac{\partial \mu\dot{\varepsilon}_{xz}}{\partial z}-\frac{\partial P}{\partial x}=0\\
+\\
+\displaystyle              2\frac{\partial\mu\dot{\varepsilon}_{yx}}{\partial x}+2\frac{\partial \mu\dot{\varepsilon}_{yy}}{\partial y}+2\frac{\partial \mu\dot{\varepsilon}_{yz}}{\partial z}-\frac{\partial P}{\partial y}=0\\
+\\
+\displaystyle               2\frac{\partial\mu\dot{\varepsilon}_{zx}}{\partial x}+2\frac{\partial \mu\dot{\varepsilon}_{zy}}{\partial y}+2\frac{\partial \mu\dot{\varepsilon}_{zz}}{\partial z}-\frac{\partial P}{\partial z} - \rho g=0\\
+
+                 \end{array} \right. & \\
+&&\\
+\hline
+\end{array}
+\label{dynamics_strainrate}
+\end{equation}
+
+\newpage
+\section{Time evolution of ice thickness}
+
+The thickness of ice varies in time because of: (1) basal melting, (2) surface accumulation and (3) the flow of the glacier itself.
+The mass balance of an ice column of section $dxdy$ and height $H$ between a time $t$ and $t+dt$ is:
+\vspace*{-3mm}
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=8cm]{bilanmass.png}
+\caption{Mass balance of an ice column}
+\label{bilan_mass2}
+\end{center}
+\end{figure}
+\begin{multline}
+m(t+dt)-m(t)=\underbrace{dy\int_{b(x)}^{s(x)}\rho u\left( x\right)  dt\;dz + dx\int_{b(y)}^{s(y)}\rho v\left( y\right) dt\;dz}_{Input\quad mass} 
++ \underbrace{\rho\dot{M}_s dxdydt}_{Accumulation}\\
+\underbrace{-dy\int_{b(x+dx)}^{s(x+dx)}\rho u\left( x+dx\right)  dt\;dz - dx\int_{b(y+dy)}^{s(y+dy)}\rho v\left( y+dy\right) dt\;dz}_{Output\quad mass}
+ - \underbrace{\rho\dot{M}_b dxdydt}_{Melting}
+\end{multline}
+\\
+where $\dot{M}_s$ is the local accumulation-ablation function at the surface ($m.a^{-1}$ ice equivalent, positive when accumulation) and  $\dot{M}_b$ is the local melting rate at the base of the glacier ($m.a^{-1}$ ice equivalent positive when melting).\\
+If one uses the relation of incompressibility:
+
+\begin{equation*}
+\begin{array}{r c l}
+\displaystyle \dfrac{m(t+dt)-m(t)}{\rho dx dy dt} = \dfrac{\partial H}{\partial t} & = &
+\displaystyle -\dfrac{1}{dx}\left( \int_{b(x+dx)}^{s(x+dx)}u\left( x+dx\right)  dz -\int_{b(x)}^{s(x)} u\left( x\right)  dz\right) \\
+\\
+&&
+\displaystyle -\dfrac{1}{dy}\left(\int_{b(y+dy)}^{s(y+dy)}v\left( y+dy\right) dz-\int_{b(y)}^{s(y)} v\left( y\right) dz \right) 
+ + \dot{M}_s - \dot{M}_b \\
+ \\
+\end{array}
+\end{equation*}
+We now introduce the depth-averaged velocity $\quad \displaystyle H\overline{u}=\int_b^s udz\quad$ and $\quad \displaystyle H\overline{v}=\int_b^s vdz$, and obtain:
+\vspace*{3mm}
+\begin{equation}
+\dfrac{\partial H}{\partial t}=-\dfrac{1}{dx}\left( \left( H\overline{u}\right) \left( x+dx\right)-\left( H\overline{u}\right)\left( x\right)\right) \\
+-\dfrac{1}{dy}\left(\left( H\overline{v}\right)\left( y+dy\right)-\left( H\overline{v}\right)\left( y\right)\right)
+ + \dot{M}_s - \dot{M}_b 
+\end{equation}
+\\
+The evolution of ice thickness is then written as :
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\
+\displaystyle \dfrac{\partial H}{\partial t} = - div \left( H 
+\left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] 
+\right)+ \dot{M}_s - \dot{M}_b\\
+\\
+\hline
+\end{array}  
+\label{prognosticequation}
+\end{equation}
+\newpage
+
+\section{Boundary Conditions}
+
+All the equations governing ice flow were described in the previous section. The mass conservation, the momentum balance and the constitutive relation of ice give a set of equations that describes completely the ice sheet system dynamics. But one needs boundary conditions to constrain these equations. There are many boundary conditions depending on the interface: ice/atmosphere boundary (air pressure), ice/ocean boundary (water pressure) and ice till boundary (friction). All these boundary conditions are described in this section.
+
+\subsection{Ice/Atmosphere boundary}
+The upper surface of the glacier can be viewed as a free surface (since the atmospheric pressure $P_0$ is negligible), the boundary condition is hence:
+
+\begin{equation}
+\sigma \overrightarrow{n} = \sigma' \overrightarrow{n} - P\overrightarrow{n} = P_0\overrightarrow{n}\simeq \overrightarrow{0}
+\label{iceatm}
+\end{equation}
+\\
+The upper surface of the glacier has the following equation : $ z-s \left( x,y,t\right)=0 $.
+The unit normal vector pointing outward from the glacier $\overrightarrow{n}$ is the gradient of the previous equation:
+
+\begin{equation}
+ \displaystyle 
+\overrightarrow{n}= \frac{1}{ \left(  \displaystyle  \left( \frac{\partial s}{\partial x} \right)^2 + \left( \frac{\partial s}{\partial y} \right)^2+1 \right)^{1/2} }
+\left( \begin{array}{c}
+\displaystyle                -\frac{\partial s}{\partial x}\\
+\\
+\displaystyle                 -\frac{\partial s}{\partial y}\\
+\\
+                1
+                \end{array} \right)
+\end{equation}
+
+
+	\subsection{Ice front boundary}
+Water applies a pressure on the ice front equal to $P_w= -\rho_w g z$:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=13cm]{schema4.png}
+\caption{Water pressure on the front of an ice shelf}
+\label{schema4}
+\end{center}
+\end{figure}
+The boundary condition is thus:
+
+\begin{equation}
+\label{icefrontBC}
+\sigma \overrightarrow{n} = \sigma' \overrightarrow{n} - P\overrightarrow{n} = -P_w\overrightarrow{n}
+\end{equation}
+
+
+\newpage
+
+\subsection{Ice/Water boundary}
+\label{dirichletvsneumann}
+The exact Ice/water boundary condition is a Neumann condition\footnote{A Neumann boundary condition specifies the values that the derivative of a solution is to take on the boundary of the domain}. Unfortunately, if one uses the incompressibility equation to deduce the vertical velocity (e.g. Pattyn), a Dirichlet boundary condition\footnote{A Dirichlet boundary condition specifies the values a solution needs to take on the boundary of the domain} is required. The only way to provide a Dirichlet boundary condition is to assume hydrostatic equilibrium. This gives an expression of the basal vertical velocity.
+						\subsubsection{Neumann boundary condition}
+
+The lower surface of the ice shelf in contact with water is subject to the pressure of the water $P_w=-\rho_w g b(x,y)$ where $\rho_w$ is the water density and $b(x,y)$ the glacier base:
+
+\begin{equation}
+\sigma \overrightarrow{n} = \sigma' \overrightarrow{n} - P\left[ I \right] \overrightarrow{n} = -P_w\overrightarrow{n}
+\end{equation}
+\\
+%The pressure of the ice at the base of the glacier is $P_i=\rho_i g H(x,y)$ where $\rho_i$ is the ice density and $H(x,y)$ is the ice thickness at this point. So we can write the boundary condition as:
+%
+%\begin{equation}
+%\sigma \overrightarrow{n} = \sigma' \overrightarrow{n} -  \rho_i g H(x,y) \overrightarrow{n} = \rho_w g b(x,y) \overrightarrow{n}
+%\end{equation}
+%\\
+When there is a hydrostatic equilibrium, the water and ice pressure are equal, the boundary condition becomes: 
+
+\begin{equation}
+ \sigma' \overrightarrow{n}  = \overrightarrow{0}
+\end{equation}
+\\
+The lower surface of the ice shelf verifies: $ z-b \left( x,y,t\right)=0 $. The unit normal vector pointing outward $\overrightarrow{n}$ is the opposite of the gradient of the previous equation:
+\begin{equation}
+\overrightarrow{n}= \frac{1}{\left(   \displaystyle  \left( \frac{\partial b}{\partial x} \right)^2 + \left( \frac{\partial b}{\partial y} \right)^2+1 \right)^{1/2}}
+\left( \begin{array}{c}
+\displaystyle \frac{\partial b}{\partial x}\\
+\\
+\displaystyle \frac{\partial b}{\partial y}\\
+\\
+ -1
+\end{array} \right)
+\end{equation}
+						\subsubsection{Dirichlet boundary condition assuming hydrostatic equilibrium}
+Using the Lagrangian derivative, the vertical basal velocity is:
+
+\begin{equation}
+w_b=\frac{d b}{d t}=\frac{\partial b}{\partial t}+ u_b \frac{\partial b}{\partial x}+v_b \frac{\partial b}{\partial y}
+\label{initialwb}
+\end{equation}
+\\
+The ice shelf lies on sea water. We do not have any kinematic information if we do not make any assumption. We suppose as a first order approximation that there is a hydrostatic equilibrium. This imposes:
+
+\begin{equation}
+\rho_i H = - \rho_w b
+\end{equation}
+\\
+where $H$ is the ice thickness and $b$ the vertical position of the bed $(b<0)$. If one differentiates this equation, given that $\rho_i$ and $\rho_w$ are constant, one finds :
+
+\begin{equation}
+\frac{\partial b }{\partial t } = - \frac{\rho_i }{\rho_w } \frac{\partial H}{\partial t}
+\end{equation}
+\\
+The mass balance of an ice column gives the local ice thickness evolution:
+
+\begin{equation}
+\dfrac{\partial H}{\partial t} = - div \left( H 
+\left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] 
+\right)+ \dot{M}_s - \dot{M}_b\\
+\label{prognosticequation}
+\end{equation}
+\\
+We then use the equation (\ref{prognosticequation}) to evaluate the evolution of the ice thickness with time. With no accumulation and melting, the basal vertical velocity (\ref{initialwb}) is:
+
+\begin{equation}
+w_b = u_b \frac{\partial b}{\partial x}+v_b \frac{\partial b}{\partial y} - \frac{\rho_i }{\rho_w } \left( - div \left( H \bar{u} \right) \right)
+\end{equation}
+\\
+Now let us consider the influence of accumulation and melting. If an accumulation of thickness $h$ appears on an ice shelf in hydrostatic equilibrium, it will sink by a height equal to $  \rho_i /\rho_w h$:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=12cm]{accumulation.png}
+\caption{Evolution of an ice shelf subjected to accumulation}
+\label{accumulation}
+\end{center}
+Same thing for melting: if a thickness $h$ melts at the ice shelf base in hydrostatic equilibrium, it will sink by a height equal to $( 1-\rho_i /\rho_w ) h$:
+\vspace*{-5mm}
+\end{figure}
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=12cm]{melting.png}
+\caption{Evolution of an ice shelf subjected to melting}
+\label{melting}
+\end{center}
+\end{figure}
+\vspace*{-3mm}
+\noindent One uses the derivative of the previous equations with respect to time. If there is accumulation at the ice surface, the ice will sink into water with a velocity equal to: 
+
+\begin{equation}
+w_b=- \frac{\rho_i }{\rho_w } \dot{M_a} 
+\end{equation}
+\\
+If ice melts at the bottom, the ice will sink with a velocity:
+
+\begin{equation}
+w_b=-\left( 1-\frac{\rho_i }{\rho_w } \right)  \dot{M_b}
+\end{equation}
+Eventually, the basal vertical velocity at ice/water interface is:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\ \displaystyle
+w_b = u_b \frac{\partial b}{\partial x}+v_b \frac{\partial b}{\partial y} - \frac{\rho_i }{\rho_w } \left( - div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right]  \right) \right) - \frac{\rho_i }{\rho_w } \dot{M_a} -\left(1- \frac{\rho_i }{\rho_w }\right)  \dot{M_b}\\
+\\
+\hline
+\end{array}
+\label{basalvelocity}
+\end{equation}
+\newpage
+
+	\subsection{Ice/Till interface}
+	The Ice/Till interface is constrained by two boundary conditions. The first one is a Neumann boundary condition describing basal drag (tangent to the interface) and the other one is a Dirichlet boundary condition constraining the vertical velocity.
+		\subsubsection{Dynamic boundary condition}
+		\label{frictionlawchapter}
+The basal friction given by Paterson\cite{Paterson1994} (p151) is: 
+
+\begin{equation}
+\Vert \overrightarrow{u_b}\Vert = K N_{eff}^{-q} \Vert \overrightarrow{\tau_b} \Vert^p
+\end{equation}
+\begin{itemize}
+\item[--] $\overrightarrow{u_b}$ is the velocity component, parallel to the bedrock surface $z=b(x,y)$ ($\overrightarrow{v}=\overrightarrow{u_b}+\left(\overrightarrow{v}.\overrightarrow{n} \right) \overrightarrow{n}$)
+\item[--] $N_{eff}=g ( \rho H(x,y) + \rho_w b(x,y))$ is the effective pressure at the base
+\item[--] $\overrightarrow{\tau_b}$ is the friction stress component, parallel to the bedrock surface  ($\sigma\overrightarrow{n}=\overrightarrow{\tau_b}+\left( \sigma\left( \overrightarrow{n}\right).\overrightarrow{n}\right)  \overrightarrow{n}$)
+\item[--] $K$, $q$ and $p$ are constants
+\end{itemize}
+\vspace*{-0.3cm}
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=8cm]{friction_geometry.png}
+\caption{Ice/Till interface geometry}
+\label{friction_geometry}
+\end{center}
+\end{figure}
+\vspace*{-0.4cm}
+This friction law may be written in vector form:
+
+\begin{equation}
+\overrightarrow{\tau_b} \quad  =  \quad -K^2 N_{eff}^r \|\overrightarrow{v} \|^{s-1}\overrightarrow{u_b} \quad \stackrel{def}{=} \quad -\alpha^2 \overrightarrow{u_b}
+\end{equation}
+\\
+with $r=q/p$ and $s=1/p$. We use $K^2$ to be sure that this quantity is positive (ie. stress opposes the motion).
+The unit normal vector $\overrightarrow{n}$ is:
+\begin{equation}
+\overrightarrow{n}= \frac{1}{\left(   \displaystyle  \left( \frac{\partial b}{\partial x} \right)^2 + \left( \frac{\partial z_b}{\partial y} \right)^2+1 \right)^{1/2}}
+\left( \begin{array}{c}
+\displaystyle -\frac{\partial b}{\partial x}\\
+\\
+\displaystyle -\frac{\partial b}{\partial y}\\
+\\
++1
+\end{array} \right)=
+\left( \begin{array}{c}
+n_x\\
+\\
+n_y\\
+\\
+n_z
+\end{array} \right)
+\end{equation}
+\\
+Several approximations can be made depending on the slope. They are despcribed in section \ref{Friction simplifications}.
+\newpage
+
+		\subsubsection{Kinematic boundary condition}
+There is also a kinematic boundary condition which constraints the vertical component of the glacier velocity $w_b$ at its base. The following scheme (Fig.\ref{friction_kin}) represents a point $M$ on the lower surface of the glacier at a time $t$ and $t+dt$ in the velocity plane (plane $(\overrightarrow{v}, \overrightarrow{e_z})$). The accumulation/ablation is not represented.
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=13cm]{friction_kin.png}
+\caption{vertical displacement of the glacier base}
+\label{friction_kin}
+\end{center}
+\end{figure}
+\vspace{-3mm} \noindent
+The vertical displacement of $M$ is due to:
+\begin{itemize}
+\item[--] The bedrock motion (isostatic adjustment): $b(t+dt)-b(t)$
+\item[--] The velocity of the glacier (the glacier is sliding and $M$ follows the bedrock geometry)
+\end{itemize}
+Therefore we have the following equation:
+
+\begin{equation}
+z_M(t+dt)-z_M(t)=w_M dt = \left(u \frac{\partial b}{\partial x}+v \frac{\partial b}{\partial y}\right)dt+b(t+dt)-b(t)
+\end{equation}
+\\
+And then one must add the melting rate $\dot{M}_b$ at the base:
+
+\begin{equation}
+z_M(t+dt)-z_M(t)=w_Mdt = \left(u_b \frac{\partial b}{\partial x}+v_b \frac{\partial b}{\partial y}\right)dt+b(t+dt)-b(t)-\dot{M}_b dt
+\end{equation}
+\\
+That gives us a constraint\footnote{usually the term $\displaystyle \frac{\partial b}{\partial t}$ is ignored} for the vertical component of the glacier velocity at its base\footnote{The expression of $w_b$ can also be found using the same approach as the ice/water boundary condition. The equation (\ref{initialwb}) is still true without melting or accumulation. Since ice is grounded, the accumulation $\dot{M}_s$ has no effect on $w_b$, whereas basal melting leads to a thinning of the ice sheet at a velocity equal to $ \displaystyle -\dot{M}_b$. If one adds this velocity to equation (\ref{initialwb}), one obtains the exact same equation as demonstrated here} $w_b$:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\
+\displaystyle
+w_b =\frac{\partial b}{\partial t}+ u_b \frac{\partial b}{\partial x}+v_b \frac{\partial b}{\partial y}-\dot{M}_b \\
+\\
+\hline
+\end{array}
+\end{equation}
+
+\newpage
+
+
+
+\subsection{Friction simplifications}
+\label{Friction simplifications}
+
+\subsubsection{Development of the boundary condition}
+
+We have the following equations:
+
+\begin{equation}
+\label{eq1}
+\overrightarrow{\tau_b}=-\alpha^2 u_b= -\alpha^2 \left( \overrightarrow{u}-\left(\overrightarrow{u}.\overrightarrow{n}\right)\overrightarrow{n} \right) 
+=-\alpha^2 \left( 
+\begin{array}{c}
+u\left( 1-{n_x}^2\right)-v n_x n_y -w n_x n_z\\
+\\
+-u n_x n_y +v\left( 1-{n_y}^2\right) -w n_y n_z\\
+\\
+-u n_x n_z-v n_y n_z +w\left( 1-{n_z}^2\right)
+\end{array}\right) 
+\end{equation}
+\\
+Finally, the exact boundary condition:
+
+\begin{equation}
+\overrightarrow{F}=\sigma \overrightarrow{n}=\overrightarrow{\tau_b} + \sigma_{nn} \overrightarrow{n}
+= \left(
+\begin{array}{c}
+-\alpha^2 u\left( 1-{n_x}^2\right)+\alpha^2 v n_x n_y +\alpha^2 w n_x n_z+\sigma_{nn}n_x\\
+\\
+\alpha^2 u n_x n_y -\alpha^2 v\left( 1-{n_y}^2\right) +\alpha^2 w n_y n_z+\sigma_{nn}n_y\\
+\\
+\alpha^2 u n_x n_z +\alpha^2 v n_y n_z -\alpha^2 w\left( 1-{n_z}^2\right)+\sigma_{nn}n_z
+\end{array}
+\right)
+\end{equation}
+\\
+with:
+
+\begin{equation}
+\sigma_{nn}  \stackrel{def}{=} 
+\sigma  \overrightarrow{n}  . \overrightarrow{n} = \sigma_{xx}{n_x}^2 + \sigma_{yy}{n_y}^2 + \sigma_{zz}{n_z}^2 
++ 2 \sigma_{xy}n_x n_y + 2 \sigma_{xz}n_z n_x + 2 \sigma_{yz}n_z n_y\\
+\end{equation}
+
+\subsubsection{Zero order}
+We can use a development of near zero order in $n_x$ and $n_y$ condering that the other terms have roughly the same order of magnitude\footnote{An adimensionnalization study not detailed here shows that the results of the following developments are consistent}. We consider that the normal vector is such as $n_x=n_y=0$ and $n_z=-1$. So we have $\sigma_{nn}=\sigma_{zz}+\mathcal{O}(n_x,n_y)$\\
+\\
+So the previous force becomes:
+
+
+\begin{equation}
+\label{friction0}
+\overrightarrow{F}
+=  \left(
+\begin{array}{c}
+-\alpha^2 u+\mathcal{O}(n_x,n_y)\\
+\\
+-\alpha^2 v+\mathcal{O}(n_x,n_y)\\
+\\
+\sigma_{zz}+\mathcal{O}(n_x,n_y)
+\end{array}
+\right)
+\end{equation}
+
+\subsubsection{First order}
+This relation doesn't consider the slope of the ice sheet base. That's why we will now use a first order development of the boundary condition to consider this slope. We neglect the terms composed with a product of $n_x$ or $n_y$. This imposes:
+\begin{equation}
+\begin{array}{c c l}
+{n_z}^2 & = & 1-{n_x}^2-{n_y}^2 = 1+ \mathcal{O}(n_x^2,n_y^2)\\
+\\
+\sigma_{nn}  & = & \sigma_{zz} + 2 \sigma_{xz}n_z n_x + 2 \sigma_{yz}n_z n_y+ \mathcal{O}(n_x^2,n_y^2)
+\end{array}
+\end{equation}
+\\
+The boundary condition becomes:
+
+\begin{equation}
+\label{friction1}
+\overrightarrow{F}
+= \left(
+\begin{array}{c}
+-\alpha^2 u +\alpha^2 w n_x n_z+\sigma_{zz}n_x+\mathcal{O}(n_x^2,n_y^2)\\
+\\
+-\alpha^2 v +\alpha^2 w n_y n_z+\sigma_{zz}n_y+\mathcal{O}(n_x^2,n_y^2)\\
+\\
+\alpha^2 u n_x n_z+\alpha^2 v n_y n_z+\sigma_{zz}n_z + 2 \sigma_{xz}n_x + 2 \sigma_{yz} n_y+\mathcal{O}(n_x^2,n_y^2)
+\end{array}
+\right)
+\end{equation}
+
+\newpage
+\section{Simplified ice flow models}
+\label{models}
+This section presents the three ice flow models that are implemented in $ISSM$, from the most complex to the simplest. They all use the set of equations described in the first part of this chapter (mass balance, momentum equilibrium and constitutive relation) but have different levels of assumptions to simplify this initial set of equations. The idea is that the simpler, the faster in terms of computational time, but the less precise in terms of physics.
+
+\subsection{Full Stokes Model}
+
+The full Stokes model consists in resolving equations (\ref{dynamics_strainrate}) without approximation. It is a 3d incompressible ice flow model. The pressure $P$ becomes a variable like the velocity $(u, v,w)$. The additional fourth equation comes from incompressibility (\ref{incompressibility}). The equations are:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\
+ \left\{ \begin{array}{l}
+\displaystyle                \frac{\partial}{\partial x} \left(  2 \mu \frac{\partial u}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial u}{\partial z} +\mu \frac{\partial w}{\partial x} \right)
+-\frac{\partial P}{\partial x}=0\\
+\\
+\displaystyle               \frac{\partial}{\partial x} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  2 \mu \frac{\partial v}{\partial y} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial v}{\partial z} +\mu \frac{\partial w}{\partial y} \right)
+-\frac{\partial P}{\partial y}=0\\            
+\\
+\displaystyle               \frac{\partial}{\partial x} \left(  \mu \frac{\partial u}{\partial z} +\mu \frac{\partial w}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  \mu \frac{\partial v}{\partial z} +\mu \frac{\partial w}{\partial y} \right)
++\frac{\partial}{\partial z} \left(  2 \mu \frac{\partial w}{\partial z} \right)
+-\frac{\partial P}{\partial z} - \rho g=0\\     
+                 \end{array} \right.
+                 \\
+                 \\
+\displaystyle \frac{\partial u}{\partial x}+\frac{\partial v}{\partial y}+\frac{\partial w}{\partial z}=0
+\\
+\\
+\hline
+\end{array}
+\label{full-stokes}
+\end{equation}
+
+
+\subsection{Pattyn's Higher-order 3d Model}
+
+Pattyn's model is described in Pattyn's 2003 paper \emph{A new three-dimensional higher-order thermomechanical ice sheet model} \cite{Pattyn2003}.
+It is a 3d model in which the vertical velocity is deduced from the horizontal components of velocity.
+The two main assumptions of this model are (1) the horizontal gradients of the vertical velocity are small compared to the vertical gradient of the horizontal velocity, and (2) the hydrostatic approximation in the vertical. This translates to:
+ 
+\begin{itemize}
+\item $\dfrac{\partial w}{\partial x}\ll \dfrac{\partial u}{\partial z}$
+\item $\dfrac{\partial w}{\partial y}\ll \dfrac{\partial v}{\partial z}$
+\item $\dfrac{\partial \sigma_{xz}}{\partial x} \ll \dfrac{\partial \sigma_{zz}}{\partial z}$
+\item $\dfrac{\partial \sigma_{yz}}{\partial y} \ll \dfrac{\partial \sigma_{zz}}{\partial z}$
+\\
+\end{itemize}
+With the second assumption, the third equation of (\ref{full-stokes}) is reduced to:
+
+\begin{equation}
+\frac{\partial}{\partial z} \left(  2 \mu \frac{\partial w}{\partial z} \right)-\frac{\partial P}{\partial z} - \rho g=0
+\end{equation}
+\\
+If we integrate this equation from $z$ to the surface $s$, we obtain:
+
+\begin{equation}
+P(s)-P(z)=2 \left. \mu \frac{\partial w}{\partial z}\right|_s-2 \left. \mu \frac{\partial w}{\partial z}\right|_z -\rho g \left( s-z\right)
+\end{equation}
+\\
+The boundary conditions at the ice/atmosphere interface (\ref{iceatm}) impose:
+
+\begin{equation}
+\sigma_{zz}(s)= 2 \left. \mu \frac{\partial w}{\partial z}\right|_s-P(s)\simeq 0
+\end{equation}
+\\
+Finally the pressure is:
+
+\begin{equation}
+P(z)=2 \mu \frac{\partial w}{\partial z}+\rho g \left( s-z\right)
+\end{equation}
+\\
+With this approximation, full Stokes equations (\ref{full-stokes}) become:
+
+\begin{equation}
+\begin{array}{c}
+ \left\{ \begin{array}{l}
+\displaystyle                \frac{\partial}{\partial x} \left(  2 \mu \frac{\partial u}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial u}{\partial z} -\mu \frac{\partial w}{\partial x} \right)
+= \rho g \dfrac{\partial s}{\partial x}\\
+\\
+\displaystyle               \frac{\partial}{\partial x} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  2 \mu \frac{\partial v}{\partial y} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial v}{\partial z} -\mu \frac{\partial w}{\partial y} \right)
+= \rho g \dfrac{\partial s}{\partial y}\\            
+\\
+\displaystyle               P(z)=2 \mu \frac{\partial w}{\partial z}+\rho g \left( s-z\right)\\     
+                 \end{array} \right.
+                 \\
+                 \\
+\displaystyle \frac{\partial u}{\partial x}+\frac{\partial v}{\partial y}+\frac{\partial w}{\partial z}=0
+\end{array}
+\end{equation}
+\\
+The second assumption simplifies the first two equations:
+
+\begin{equation}
+\begin{array}{c}
+ \left\{ \begin{array}{l}
+\displaystyle                \frac{\partial}{\partial x} \left(  2 \mu \frac{\partial u}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial u}{\partial z}\right)
+= \rho g \dfrac{\partial s}{\partial x}\\
+\\
+\displaystyle               \frac{\partial}{\partial x} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  2 \mu \frac{\partial v}{\partial y} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial v}{\partial z} \right)
+= \rho g \dfrac{\partial s}{\partial y}\\            
+\\
+\displaystyle               P(z)=2 \mu \frac{\partial w}{\partial z}+\rho g \left( s-z\right)\\     
+                 \end{array} \right.
+                 \\
+                 \\
+\displaystyle \frac{\partial u}{\partial x}+\frac{\partial v}{\partial y}+\frac{\partial w}{\partial z}=0
+\end{array}
+\end{equation}
+\\
+The vertical component of the velocity is deduced from the incompressibility equation\footnote{For ice shelves, we will assume hydrostatic equilibrium so that we can use a Dirichlet boundary condition at the ice shelf base for the vertical velocity computation (See section \ref{dirichletvsneumann})} that is integrated from $b$ to $z$. The equations of Pattyn's model become :
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\
+ \left\{ \begin{array}{l}
+\dfrac{\partial }{\partial x} \left(4 \mu \dfrac{\partial u}{\partial x} + 2 \mu \dfrac{\partial v}{\partial y} \right)+ \dfrac{\partial }{\partial y} \left(\mu \dfrac{\partial u}{\partial y} + \mu \dfrac{\partial v}{\partial x} \right) + \dfrac{\partial }{\partial z}\left( \mu \dfrac{\partial u}{\partial z}\right)= \rho g \dfrac{\partial s}{\partial x}\\
+\\
+\dfrac{\partial }{\partial x} \left( \mu \dfrac{\partial u}{\partial y} +  \mu \dfrac{\partial v}{\partial x} \right)+ \dfrac{\partial }{\partial y} \left(4 \mu \dfrac{\partial v}{\partial y} + 2 \mu \dfrac{\partial u}{\partial x} \right) + \dfrac{\partial }{\partial z}\left( \mu \dfrac{\partial v}{\partial z}\right)= \rho g \dfrac{\partial s}{\partial y}\\
+\\
+\displaystyle w\left( x,y,z\right)= w_b\left( x,y,z\right) - \int_{b(x,y)}^{z} \dfrac{\partial u}{\partial x} + \dfrac{\partial v}{\partial y} dz'
+                 \end{array} \right.
+\\
+\\
+\hline
+\end{array}
+\label{Pattyn equations}
+\end{equation}
+\newpage
+\subsection{MacAyeal's Shelfy-stream 2d model}
+\label{MAsection}
+MacAyeal's model is described in Douglas MacAyeal's 1989 paper \emph{Large-scale Ice Flow Over a Viscous Basal Sediment} \cite{Macayeal1989}.
+It is a 2d model, the horizontal components of the velocity are vertically integrated.
+The main assumption is that the basal drag associated with deforming basal sediment does not induce significant vertical
+gradients of the horizontal velocity. This drove him to make the following assumptions:
+
+\begin{itemize}
+\item $\displaystyle \dfrac{\partial u}{\partial z}=0$
+\item $\displaystyle \dfrac{\partial v}{\partial z}=0$
+\item $\dot{\varepsilon}_{xz}=0$
+\item $\dot{\varepsilon}_{yz}=0$
+\item bedrock slope assumed to be negligible
+\end{itemize}
+
+\noindent These assumptions are stronger than Pattyn's. Therefore, we can use Pattyn's higher order model equations (\ref{Pattyn equations}) as a starting point. If we use the first two assumptions, the first equations of Pattyn's model become:
+
+\begin{equation}
+ \left\{ \begin{array}{l}
+\displaystyle \dfrac{\partial }{\partial x} \left(4 \mu \dfrac{\partial u}{\partial x} + 2 \mu \dfrac{\partial v}{\partial y} \right)+ \dfrac{\partial }{\partial y} \left(\mu \dfrac{\partial u}{\partial y} + \mu \dfrac{\partial v}{\partial x} \right)  = \rho g \dfrac{\partial s}{\partial x}\\
+\\
+\displaystyle\dfrac{\partial }{\partial x} \left( \mu \dfrac{\partial u}{\partial y} +  \mu \dfrac{\partial v}{\partial x} \right)+ \dfrac{\partial }{\partial y} \left(4 \mu \dfrac{\partial v}{\partial y} + 2 \mu \dfrac{\partial u}{\partial x} \right)  = \rho g \dfrac{\partial s}{\partial y}\\
+                 \end{array} \right.
+\end{equation}
+\\
+One can integrate these equations from the bed $b(x,y)$ to the surface $s(x,y)$:
+
+\begin{equation}
+ \left\{ \begin{array}{l}
+\displaystyle \int_{b(x,y)}^{s(x,y)}\left(\dfrac{\partial }{\partial x} \left(4 \mu \dfrac{\partial u}{\partial x} + 2 \mu \dfrac{\partial v}{\partial y} \right)+ \dfrac{\partial }{\partial y} \left(\mu \dfrac{\partial u}{\partial y} + \mu \dfrac{\partial v}{\partial x} \right) + \dfrac{\partial }{\partial z}\left( \mu \dfrac{\partial u}{\partial z}\right)\right) dz= \rho g H \dfrac{\partial s}{\partial x}\\
+\\
+\displaystyle \int_{b(x,y)}^{s(x,y)}\left(\dfrac{\partial }{\partial x} \left( \mu \dfrac{\partial u}{\partial y} +  \mu \dfrac{\partial v}{\partial x} \right)+ \dfrac{\partial }{\partial y} \left(4 \mu \dfrac{\partial v}{\partial y} + 2 \mu \dfrac{\partial u}{\partial x} \right) + \dfrac{\partial }{\partial z}\left( \mu \dfrac{\partial v}{\partial z}\right)\right)  dz= \rho g H \dfrac{\partial s}{\partial y}\\
+                 \end{array} \right.
+\end{equation}
+\\
+We can use Leibniz integral rule\footnote{For a given scalar quantity $f(x,z)$, Leibniz integral rule is written:
+
+\begin{equation*}
+\dfrac{\partial}{\partial x} \int_{\alpha (x)}^{\beta (x)}f(x,z) dz = \int_{\alpha (x)}^{\beta (x)} \dfrac{\partial}{\partial x} f(x,z) dz + f(x,\beta (x)) \dfrac{\partial \beta (x)}{\partial x}- f(x,\alpha (x)) \dfrac{\partial \alpha (x)}{\partial x}
+\end{equation*}
+\\
+In our case, we use:
+
+\begin{equation*}
+\int_{\alpha (x)}^{\beta (x)} \dfrac{\partial}{\partial x} f(x,z) dz = \dfrac{\partial}{\partial x} \int_{\alpha (x)}^{\beta (x)}f(x,z) dz - f(x,\beta (x)) \dfrac{\partial \beta (x)}{\partial x}+ f(x,\alpha (x)) \dfrac{\partial \alpha (x)}{\partial x}
+\end{equation*}
+} which gives:
+
+\begin{multline}
+\dfrac{\partial }{\partial x} \int_{b(x,y)}^{s(x,y)}\left(4 \mu \dfrac{\partial u}{\partial x} + 2 \mu \dfrac{\partial v}{\partial y} \right) dz
++ \dfrac{\partial }{\partial y} \int_{b(x,y)}^{s(x,y)}\left(\mu \dfrac{\partial u}{\partial y} + \mu \dfrac{\partial v}{\partial x} \right) dz\\
+-\sigma'_{xx}(s)\dfrac{\partial s}{\partial x}-\sigma'_{xy}(s)\dfrac{\partial s}{\partial x}+\sigma'_{xz}(s)
++\sigma'_{xx}(b)\dfrac{\partial b}{\partial x}+\sigma'_{xy}(b)\dfrac{\partial b}{\partial x}-\sigma'_{xz}(b)
+= \rho g H \dfrac{\partial s}{\partial x}\label{MA1}
+\end{multline}
+\begin{multline}
+\dfrac{\partial }{\partial x} \int_{b(x,y)}^{s(x,y)}\left( \mu \dfrac{\partial u}{\partial y} +  \mu \dfrac{\partial v}{\partial x} \right)dz
++ \dfrac{\partial }{\partial y} \int_{b(x,y)}^{s(x,y)}\left(4 \mu \dfrac{\partial v}{\partial y} + 2 \mu \dfrac{\partial u}{\partial x} \right)dz\\
+-\sigma'_{yx}(s)\dfrac{\partial s}{\partial x}-\sigma'_{yy}(s)\dfrac{\partial s}{\partial x}+\sigma'_{yz}(s)
++\sigma'_{yx}(b)\dfrac{\partial b}{\partial x}+\sigma'_{yy}(b)\dfrac{\partial b}{\partial x}-\sigma'_{yz}(b)
+= \rho g H \dfrac{\partial s}{\partial y}\label{MA2}
+\end{multline}
+
+\noindent The boundary conditions at the ice/atmosphere interface (\ref{iceatm}) imposes:
+
+\begin{equation}
+\sigma'(s)\overrightarrow{n}=\overrightarrow{0}\\
+\end{equation}
+\\
+To the zero order (horizontal bedrock), the boundary conditions at the ice/till interface (\ref{friction0}) is:
+
+\begin{equation}
+\begin{array}{c}
+\left( \sigma'(b)\overrightarrow{n}\right)_x=\alpha^2 u\\
+\\
+\left( \sigma'(b)\overrightarrow{n}\right)_y=\alpha^2 v
+\end{array}
+\end{equation}
+\\
+Equation (\ref{MA1}) and (\ref{MA2}) become:
+
+\begin{equation}
+ \left\{ \begin{array}{l}
+\displaystyle \dfrac{\partial }{\partial x} \int_{b(x,y)}^{s(x,y)}\left(4 \mu \dfrac{\partial u}{\partial x} + 2 \mu \dfrac{\partial v}{\partial y} \right) dz
++ \dfrac{\partial }{\partial y} \int_{b(x,y)}^{s(x,y)}\left(\mu \dfrac{\partial u}{\partial y} + \mu \dfrac{\partial v}{\partial x} \right) dz
+= \rho g H \dfrac{\partial s}{\partial x}+\alpha^2 u\\
+\\
+\displaystyle \dfrac{\partial }{\partial x} \int_{b(x,y)}^{s(x,y)}\left( \mu \dfrac{\partial u}{\partial y} +  \mu \dfrac{\partial v}{\partial x} \right)dz
++ \dfrac{\partial }{\partial y} \int_{b(x,y)}^{s(x,y)}\left(4 \mu \dfrac{\partial v}{\partial y} + 2 \mu \dfrac{\partial u}{\partial x} \right)dz 
+= \rho g H \dfrac{\partial s}{\partial y}+\alpha^2 v\\
+                 \end{array} \right.
+\end{equation}
+\\
+MacAyeal's assumptions imply that velocities ($u$ and $v$) do not depend on $z$: there is no need to use Leibniz integral law here. We define the depth averaged viscosity as: $\displaystyle H\overline{\mu}=\int_b^s \mu dz$ so that finally we obtain:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\
+\left\{ \begin{array}{l}
+\displaystyle \frac{\partial}{\partial x} \left( 4H \bar{\mu} \frac{\partial u}{\partial x}+ 2H \bar{\mu}\frac{\partial v}{\partial y} \right)
++\frac{\partial}{\partial y}\left( H\bar{\mu}  \frac{\partial u}{\partial y}+H\bar{\mu}  \frac{\partial v}{\partial x}\right)
+=\rho g H \frac{\partial s}{\partial x} +\alpha^2 u\\
+\\
+\displaystyle \frac{\partial}{\partial y} \left( 4H \bar{\mu} \frac{\partial v}{\partial y}+2H \bar{\mu}\frac{\partial u}{\partial x}\right) 
++\frac{\partial}{\partial x}\left( H\bar{\mu}\frac{\partial u}{\partial y}+H\bar{\mu}  \frac{\partial v}{\partial x}\right)
+=\rho g H \frac{\partial s}{\partial y}+\alpha^2 v\\
+                 \end{array} \right.
+                 \\
+\\
+\hline
+\end{array}
+\end{equation}
+
+\newpage
+\section{Thermodynamic model}
+
+A thermal model is essential to predict an ice sheet system's evolution since it affects the flow. The viscosity parameter $B$ is highly temperature-dependent. Temperature also affects melting, which in turn affects the glacier geometry and sliding. It is hence needed in a comprehensive time evolution model.
+
+	\subsection{Local equation}
+	
+The most general energy balance (Hooke, 2005 \cite{Hooke2005} p117, Paterson, 1994 \cite{Paterson1994} p224) equation includes a conduction term and a source term (here due to viscous heating):
+
+\begin{equation}
+\dfrac{d \left( \rho c T\right) }{d t}= div \left( k \; \overrightarrow{grad}\: T\right) +\Phi  
+\end{equation}
+where:
+\begin{itemize}
+\item[--] $c$ ice heat capacity ($J kg\textsuperscript{-1} K\textsuperscript{-1}$)
+\item[--] $T$ ice temperature ($K$)
+\item[--] $k$ ice heat conductivity ($W m\textsuperscript{-1} K\textsuperscript{-1}$)
+\item[--] $\Phi$ viscous heating due to ice flow ($W m\textsuperscript{-3}$)
+\end{itemize}
+Advection appears when one takes the Eulerian version of the previous equations:
+
+\begin{equation}
+\dfrac{d \left( \rho c T\right)}{d t}= \dfrac{\partial \left( \rho c T\right)}{\partial t} + \overrightarrow{v}. \overrightarrow{grad}\left( \rho c T \right) 
+\end{equation}
+this gives:
+\begin{equation}
+\dfrac{\partial \left( \rho c T\right)}{\partial t}= -\overrightarrow{v}. \overrightarrow{grad}\left( \rho c T \right)
++ div \left( k \; \overrightarrow{grad}\: T\right) +\Phi
+\label{thermal1}   
+\end{equation}
+
+	\subsection{Simplifications}
+In $ISSM$, several assumptions are employed. The first one is that (1) the heat capacity and conductivity are constant, and (2) spatial and thermal dependence of $k$ and $c$ are neglected. These are classical assumptions (Hooke, 2005 \cite{Hooke2005} p117). Using the ice incompressibility, equation (\ref{thermal1}) becomes:
+\begin{equation}
+\dfrac{\partial T}{\partial t}= -\overrightarrow{v}. \overrightarrow{grad}\left( T \right)+ \dfrac{k}{ \rho c } \Delta T +\dfrac{\Phi}{ \rho c }
+\end{equation}
+\\
+The local heat transfer is thus a result of horizontal and vertical advection, conduction\footnote{In many thermal models, the horizontal advection is neglected (Paterson, 1994 \cite{Paterson1994} p216; Hooke, 2005 \cite{Hooke2005} p118). Horizontal conduction is often neglected as well (Hulbe, 1999 \cite{Hulbe1999}; Hooke, 2005 \cite{Hooke2005} p118). These assumptions are not employed here.}, and internal deformation heating:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline
+\\ \displaystyle
+\dfrac{\partial T}{\partial t}= -\left( u\dfrac{\partial T}{\partial x} +v\dfrac{\partial T}{\partial y}  +w\dfrac{\partial T}{\partial z} \right)+ \dfrac{k}{ \rho c }\left( \dfrac{\partial^2 T}{\partial x^2}+\dfrac{\partial^2 T}{\partial y^2}+\dfrac{\partial^2 T}{\partial z^2}\right)   +\dfrac{\Phi}{ \rho c }\\
+\\
+\hline
+\end{array}
+\label{thermalequation}
+\end{equation}
+
+	\subsection{Internal deformation heating}
+
+The viscous heating due to ice flow is 
+\begin{equation}
+\Phi=Tr\left( \sigma\dot{\varepsilon}\right)
+\end{equation}
+\\
+One can use the deviatoric stress tensor and use the incompressibility:
+
+\begin{equation}
+\Phi =Tr\left( \sigma'\dot{\varepsilon}-P\dot{\varepsilon} \right)= Tr\left( \sigma'\dot{\varepsilon}\right) -P \;Tr\left( \dot{\varepsilon} \right) =Tr\left( \sigma'\dot{\varepsilon}\right)
+\end{equation}
+We do not use this equation in $ISSM$. We use the effective strain rate $\dot{\varepsilon}_e $ and effective deviatoric stress $\sigma_e $ defined in (\ref{epsilone1}) to obtain:
+\begin{equation}
+\begin{array}{r l}
+\displaystyle \Phi^2 & \displaystyle
+= \left( Tr\left( \sigma'\dot{\varepsilon}\right)\right)^2
+= \left( \sum_{i,j} \sigma'_{ij} \dot{\varepsilon}_{ji} \right)^2
+= \left(\sum_{i,j} \sigma'_{ij} \dot{\varepsilon}_{ij} \right)^2
+= \left(\sum_{i,j} \sigma'_{ij} \dot{\varepsilon}_{ij} \right) \left(\sum_{k,l} \sigma'_{kl}\dot{\varepsilon}_{kl} \right)\\
+\\ & \displaystyle
+= \left(\sum_{i,j} 2 \mu \dot{\varepsilon}_{ij} \dot{\varepsilon}_{ij}\right) \left(  \sum_{k,l} \sigma'_{kl}\dfrac{1}{2 \mu}\sigma'_{kl}\right)
+= \sum_{i,j} \dot{\varepsilon}_{ij} ^2 \sum_{kl} {\sigma'_{kl}} ^2
+= 2 \dot{\varepsilon}_e^2 \;\; 2  {\sigma'_e }^2
+\end{array}
+\end{equation}
+\\
+In conclusion, $ISSM$ uses the following equation:
+
+\begin{equation}
+\Phi = 2\dot{\varepsilon}_e \sigma'_e = 4\mu \dot{\varepsilon}_e^2
+\end{equation}
+
+	\subsection{Thermal model boundary conditions}
+			\subsubsection*{Ice/Atmosphere interface}	
+On the upper surface, the temperature is imposed as the mean annual air temperature at the surface, $T_s$.
+
+			\subsubsection*{Ice/Water boundary}
+On the Ice/Water interface, there is an imposed flux, which depends on the temperature difference between the ice shelf surface $T_b$ and the ocean $T=T_{pmp}$:
+
+\begin{equation}
+k\left. \left( \overrightarrow{grad}\;T\right) \right|_b.\overrightarrow{n} \simeq -k \left. \dfrac{\partial T}{\partial z}\right| _{b}
+ =  -\rho_w c_{pM}\gamma\left(T_b-T_{pmp} \right) 
+\end{equation}
+With: 
+\begin{itemize}
+\item[--] $\overrightarrow{n}=( n_x, n_y, n_z)$ normal vector pointing outward
+\item[--] $c_{pM}$ mixed layer (see Holland, 1999 \cite{Holland1999} p5) specific heat capacity ($J kg\textsuperscript{-1} K\textsuperscript{-1}$)
+\item[--] $\gamma$ thermal exchange velocity ($ m s\textsuperscript{-1}$)
+\item[--] $T_{pmp}=273.15 - \beta P$ pressure melting point ($K$)(See Paterson \cite{Paterson1994} p212)
+\end{itemize}
+If the ocean temperature is above the ice shelf base temperature, the flux is positive (heat goes from the ocean to the ice shelf), whereas when the ice shelf base is warmer than the ocean, the flux is negative (heat goes from the ice shelf to the ocean).
+
+			\subsubsection*{Ice/Till boundary}
+The basal thermal boundary condition is supplied by a geothermal flux $G$ at the ice sheet bottom and the heat due to basal friction. When the pressure melting point is reached, an additional flux is generated:
+
+\begin{equation}
+k\left. \left( \overrightarrow{grad}\;T\right) \right| _b.\overrightarrow{n} \simeq \underbrace{-k \left. \dfrac{\partial T}{\partial z}\right| _{b}}_{Conduction}
+ =  \underbrace{G+\overrightarrow{\tau}_b . \overrightarrow{u}_b}_{Energy \; input}+ \underbrace{\rho L \dot{M}_b }_{Melting}
+\end{equation}
+\\
+Where $\overrightarrow{n}=( n_x, n_y, n_z)$ is the unit normal vector pointing outward and $L$ is the specific latent heat of fusion. The basal temperature in the ice mass is kept at the pressure melting point $T_{pmp}= 273.15 - \beta P$ (See Paterson \cite{Paterson1994} p212) whenever it is reached (Pattyn, 2003 \cite{Pattyn2003}). In other words, the boundary condition at the ice/till interface is an imposed flux. When this imposed flux generates ice temperatures above the pressure melting point, the boundary condition is changed into an imposed temperature $T_b=T_{pmp}$.
+
+	\subsection{Transformation of the basal boundary condition}
+\label{meltingsection}
+At the base, we impose a heat flux, and the temperature cannot exceed $T_{pmp}$. If the temperature reaches the pressure melting point, melting occurs. All these conditions can be summarized by the following equations:
+
+\begin{equation}
+\left\{ \begin{array}{l}
+\displaystyle -k \left. \dfrac{\partial T}{\partial z}\right| _b =G + \overrightarrow{\tau}_b . \overrightarrow{u}_b - \rho L\dot{M}_b  \\
+\\
+\displaystyle \dot{M}_b\left( T-T_{pmp}\right) =0 \\
+\\
+\displaystyle T-T_{pmp} \leq 0 \\
+\\
+\displaystyle \dot{M}_b \geq 0 \\
+                 \end{array} \right.
+\end{equation}
+\\
+The last three equations can be represented by the following graph:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=9cm]{TpmpMb.png}
+\caption{$\dot{M}_b$ as a function of $T-T_{pmp}$}
+\label{TpmpMb}
+\end{center}
+\end{figure}
+\noindent
+These equations are not used in $ISSM$ since they are introducing nonlinearities. To avoid that, we use a penalty method exactly as in contact mechanics (See Chapter \ref{chappenalty} for more details).
+
+\section*{Conclusion}
+We used the mass conservation, the momentum balance and Glen's flow law to deduce the system of equations that is governing ice flow. This system of equations constitutes the full Stokes equations. This model unfortunately requires huge computational resources in terms of computer memory and execution time: it is a 3d model that solves 4 unknowns ($u,v,w,P$). We also presented two other models: MacAyeal's shelfy-stream model and Frank Pattyn's higher-order model. Frank Pattyn uses still a 3d mesh but decorellates the horizontal velocity components from the vertical component. There are hence only 2 unknowns ($u,v$). Doug MacAyeal went further by vertically integrating the equations, neglecting vertical shear. These three models give three different refinement levels and require three different computational powers, which is priceless to model a continent such as Antarctica since one can use different models on different areas depending on the accuracy needed and the phenomena involved.
+
+\newpage
+\chapter{Dynamic Models Finite Element Formulation}
+\label{Appendix1}
+$ISSM$ uses finite element method to solve the equations described in the first chapter. This chapter explains how we built a finite element model for each solution. MacAyeal's model formulation is very detailed for those who are not very familiar with finite element method.
+For more details about finite element method,
+the reader is invited to consult Zienkiewicz \emph{The Finite Element Method, Fourth Edition}, 1994 \cite{Zienkiewicz1994}.
+    \section{MacAyeal's Shelfy-stream model}
+
+    \subsection{Geometry and notations}
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=11cm]{schema5.png}
+\caption{Geometry and notations}
+\label{schema5}
+\end{center}
+\end{figure}
+\vspace*{-0.4cm}
+We adopt the following notations:
+\begin{itemize}
+        \item[--] $\Omega$ is the open surface that constitutes the entire glacier system
+                        \vspace*{-0.9mm}
+        \item[--] $\partial\Omega$ are  points located at the boundary
+                        \vspace*{-0.9mm}
+        \item[--] $\Gamma$ are  points located at the ice front
+                        \vspace*{-0.9mm}
+        \item[--] $\Gamma_u=\partial\Omega\backslash\Gamma$ are all other points located at the boundary\\
+\end{itemize}
+
+        \subsection{Equations}
+
+The equations of MacAyeal's Shelfy-stream model are:
+
+\begin{equation}
+\label{FEMacAyealEq}
+\left\{ \begin{array}{l}
+\displaystyle \frac{\partial}{\partial x} \left( 2H \mu \left( 2\frac{\partial u}{\partial x}+\frac{\partial v}{\partial y}\right) \right)
++\frac{\partial}{\partial y}\left( H\mu \left( \frac{\partial u}{\partial y}+\frac{\partial v}{\partial x}\right) \right)
+-\rho g H \frac{\partial s}{\partial x} +\tau_x=0\\
+\\
+\displaystyle \frac{\partial}{\partial y} \left( 2H \mu \left( 2\frac{\partial v}{\partial y}+\frac{\partial u}{\partial x}\right) \right)
++\frac{\partial}{\partial x}\left( H\mu \left( \frac{\partial u}{\partial y}+\frac{\partial v}{\partial x}\right) \right)
+-\rho g H \frac{\partial s}{\partial y}+\tau_y=0\\
+                 \end{array} \right.
+\end{equation}
+\\
+At the ice front, the boundary condition is (\ref{icefrontBC}):
+
+\begin{equation}
+\sigma'  \overrightarrow{n} = \left( P-P_w\right) \overrightarrow{n}
+\end{equation}
+where:
+\begin{itemize}
+\item $P=\rho g \left( s-z\right) $ is the ice pressure
+\item $P=-\rho_w g z $ is the water pressure $\left( z\leq 0\right) $
+\end{itemize}
+MacAyeal's model uses vericaly integrated quantities, we must apply the verticaly-integrated form of the previous equation which is:
+
+\begin{equation}
+\sigma'  \overrightarrow{n} =\left( \int_b^s \rho g \left( s-z \right) dz+\int_b^0 \rho_w g z dz \right) \overrightarrow{n}  
+= \left( \dfrac{1}{2}\rho g H^2 -\dfrac{1}{2} \rho_w g b^2 \right) \overrightarrow{n}
+\end{equation}
+\\
+The boundary conditions are: a dynamic boundary condition (Neumann) at the ice front, a friction law on the ice sheet, and single point constraint (Dirichlet) on the other borders of the domain $\Omega$.
+It is more convenient to consider these specified velocities as nill. At the end of the process, the velocity field will be updated to take these constraints into account.
+
+\begin{equation}
+\left\{ \begin{array}{l l}
+\text{Ice Front } \Gamma_i: & \displaystyle \sigma'   \overrightarrow{n} = F \overrightarrow{n} =\left( \dfrac{1}{2}\rho g H^2 -\dfrac{1}{2}\rho_w g b^2\right) \overrightarrow{n}\\
+\\
+\text{Other  borders } \Gamma_u: & u=v=0\\
+\end{array} \right.
+\end{equation}
+\newpage
+        \subsection{Weak Formulation}
+
+Now that we have all the equations and boundary conditions, we  write the weak formulation to solve these equations
+using finite element. We define a kinematically admissible velocity field\footnote{$H^{1}(\Omega\cup\partial\Omega)$ is a Sobolev space that contains all the square-integrable functions defined on $\Omega\cup\partial\Omega$ that have a square-integrable first derivative 
+\begin{equation} 
+\int_{\Omega\cup\partial\Omega} \phi^2 d\Omega<\infty \text{ and }
+\int_{\Omega\cup\partial\Omega} \left( \dfrac{\partial \phi}{\partial x_i}\right) ^2 d\Omega<\infty 
+\end{equation}}\footnote{$\overrightarrow{\phi}$ is a 2d function and each of its component 
+$\left( \phi_x,\phi_y\right)$ is in $H^{1}(\Omega\cup\partial\Omega)$. Therefore 
+$\overrightarrow{\phi} \in \left( H^{1}(\Omega\cup\partial\Omega) \right)^2$ }
+ $\overrightarrow{\phi}$:
+\begin{equation}
+\overrightarrow{\phi}(x,y)\in\lbrace \left( H^{1}(\Omega\cup\partial\Omega) \right)^2 \quad \backslash\quad \overrightarrow{\phi}(x,y)=\overrightarrow{0}\qquad (x,y)\in\Gamma_u\rbrace
+\end{equation}
+\\
+For any function of this virtual field, we take the scalar product of the equations (\ref{FEMacAyealEq}) with $\overrightarrow{\phi}=\left(\phi_x,0 \right) $ and $\overrightarrow{\phi}=\left(0,\phi_y \right) $ that are 2 other kinematically admissible velocity fields, and integrate these products over the domain. Indeed, if $\overrightarrow{\phi}$ is a kinematically admissible velocity field, then $\overrightarrow{\phi_1}=\left(\phi_x,0 \right) $ and $\overrightarrow{\phi_2}=\left(0,\phi_y \right) $ are also two kinematically admissible velocity fields. This gives us:
+
+\begin{equation*}
+\iint_\Omega %double
+\left[ \frac{\partial}{\partial x} \left(2 H \mu \left( 2\frac{\partial u}{\partial x}+\frac{\partial v}{\partial y}\right) \right)\phi_x
++\frac{\partial}{\partial y}\left( H\mu \left( \frac{\partial u}{\partial y}+\frac{\partial v}{\partial x}\right) \right)\phi_x
+-\rho g H \frac{\partial s}{\partial x}\phi_x +\tau_x\phi_x \right]  d\Omega =0
+\end{equation*}
+
+\begin{equation*}
+\iint_\Omega %double
+\left[\frac{\partial}{\partial y} \left( 2H \mu \left( 2\frac{\partial v}{\partial y}+\frac{\partial u}{\partial x}\right) \right) \phi_y
++\frac{\partial}{\partial x}\left( H\mu \left( \frac{\partial u}{\partial y}+\frac{\partial v}{\partial x}\right) \right) \phi_y
+-\rho g H \frac{\partial s}{\partial y}\phi_y +\tau_y\phi_y \right]  d\Omega =0
+\end{equation*}
+\\
+One intergrates by parts the two first terms in order to merge in the force on the ice front $\Gamma$:
+
+\begin{multline}
+\iint_\Omega  %double
+ 2H \mu \left( 2\frac{\partial u}{\partial x}+\frac{\partial v}{\partial y}\right) \frac{\partial \phi_x}{\partial x}
++ H\mu \left( \frac{\partial u}{\partial y}+\frac{\partial v}{\partial x}\right)  \frac{\partial \phi_x }{\partial y} -\tau_x\phi_x d\Omega\\
+ =\int_\Gamma F n_x\phi_xd\Gamma -
+\iint_\Omega %double
+\rho g H \frac{\partial s}{\partial x}\phi_x d\Omega
+\label{FFU}
+\end{multline}
+\begin{multline}
+\iint_\Omega %double
+ 2 H \mu \left( 2\frac{\partial v}{\partial y}+\frac{\partial u}{\partial x}\right) \frac{\partial \phi_y}{\partial x}
++ H\mu \left( \frac{\partial u}{\partial y}+\frac{\partial v}{\partial x}\right)  \frac{\partial \phi_y}{\partial y}  -\tau_y\phi_yd\Omega \\
+=\int_\Gamma F n_y\phi_y d\Gamma -
+\iint_\Omega %double
+\rho g H \frac{\partial s}{\partial y}\phi_y d\Omega
+\label{FFV}
+\end{multline}
+
+        \subsection{Finite element discretisation, Galerkin method}
+
+The domain is meshed using triangles. There are a $nel$ elements and $nods$ grids. We use the nodal functions of each grid, which are continuous on the domain and affine on each element.
+We now project the unknows on the nodal functions:
+
+\begin{center}
+ $(\phi_i)_{1\leq i\leq nods}$
+\end{center}
+\begin{equation}
+\begin{array}{c}
+\displaystyle u\left( x,y\right) = \sum_{i=1}^{nods}u_{i}\phi_{i}\left( x,y\right) \\
+\\
+\displaystyle v\left( x,y\right) = \sum_{i=1}^{nods}v_{i}\phi_{i}\left( x,y\right)
+\end{array}
+\label{decomp}
+\end{equation}
+\\
+We build a vector $U$ that holds all the unknowns of the velocity field:
+
+\begin{equation}
+U=\left[ \begin{array}{c}
+u_{1}\\
+v_{1}\\
+...\\
+u_{nods}\\
+v_{nods}\\
+                 \end{array} \right]
+\end{equation}
+\\
+With this new field and with $\tau_x = -\alpha^2 u$, $\tau_y = -\alpha^2 v$, we have:
+\begin{center}
+ $\forall 1 \leq i \leq nods$
+\end{center}
+\begin{multline}
+\sum_{j=1}^{nods} \iint_\Omega  %double
+ 2H \mu \left( 2 u_{j} \frac{\partial \phi_{j}}{\partial x}+v_j \frac{\partial \phi_{j}}{\partial y}\right) \frac{\partial \phi_i}{\partial x}
++ H\mu \left( u_j \frac{\partial \phi_{j}}{\partial y}+v_j \frac{\partial \phi_{j}}{\partial x}\right)  \frac{\partial \phi_i }{\partial y} +\alpha^2 u_j\phi_j \phi_i d\Omega\\
+ =\int_\Gamma F n_x\phi_i d\Gamma -
+\iint_\Omega %double
+\rho g H \frac{\partial s}{\partial x}\phi_i d\Omega
+\end{multline}
+\begin{multline}
+\sum_{j=1}^{nods} \iint_\Omega %double
+ 2 H \mu \left( 2 v_j \frac{\partial \phi_{j}}{\partial y}+u_j \frac{\partial \phi_{j}}{\partial x}\right) \frac{\partial \phi_i}{\partial y}
++ H\mu \left( u_j\frac{\partial \phi_{j}}{\partial y}+v_j\frac{\partial \phi_{j}}{\partial x}\right)  \frac{\partial \phi_i}{\partial x}  +\alpha^2 v_j\phi_j\phi_id\Omega \\
+=\int_\Gamma F n_y\phi_i d\Gamma -
+\iint_\Omega %double
+\rho g H \frac{\partial s}{\partial y}\phi_i d\Omega
+\end{multline}
+By rearranging terms:
+\begin{center}
+ $\forall 1 \leq i \leq nods$
+\end{center}
+\begin{multline}
+\sum_{j=1}^{nods} \iint_\Omega  %double
+  \left( 4 H \mu \frac{\partial \phi_{j}}{\partial r} \frac{\partial \phi_i}{\partial r} 
+  + H \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial y} +\alpha^2 \phi_j \phi_i \right)  u_j
++ \left( 2 H \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial x} + 
+H \mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial y} \right) v_j  d\Omega\\
+ =\int_\Gamma F n_x\phi_i d\Gamma -
+\iint_\Omega %double
+\rho g H \frac{\partial s}{\partial x}\phi_i d\Omega
+\label{FFU2} 
+\end{multline}
+\begin{multline}
+\sum_{j=1}^{nods} \iint_\Omega  %double
+  \left( 2 H \mu \frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_i}{\partial y} 
+  + H \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial x} \right)  u_j
++ \left( 4 H \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial y} + 
+H \mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial x}+\alpha^2 \phi_j \phi_i  \right) v_j  d\Omega\\
+ =\int_\Gamma F n_y\phi_i d\Gamma -
+\iint_\Omega %double
+\rho g H \frac{\partial s}{\partial y}\phi_i d\Omega
+\label{FFV2} 
+\end{multline}
+\\
+We see the stiffness matrix $K$ and load vector $F$ appearing, so that the previous equation can be written in matrix form:
+\begin{equation}
+\left[ K \right] U =F 
+\label{FE}
+\end{equation} 
+\\
+or
+
+\begin{equation}
+\left[
+\begin{array}{c c c c} %K
+ & \vdots & \vdots & \\
+ \cdots & K_{2i-1,2j-1} &  K_{2i-1,2j} & \cdots\\
+ &&& \\
+  \cdots & K_{2i,2j-1} &  K_{2i,2j} & \cdots\\
+   & \vdots & \vdots & \\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+u_j\\
+\\
+v_j\\
+\vdots\\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %F
+\vdots \\
+F_{2j-1}\\
+\\
+F_{2j}\\
+\vdots\\
+\end{array}
+\right]
+\end{equation}
+\\
+We have the following expressions:
+
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+
+K_{2i-1,2j-1} &\displaystyle = 
+\iint_\Omega  %double
+  \left( 4 H \mu \frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_i}{\partial x} 
+  + H \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial y} +\alpha^2 \phi_j \phi_i \right) d\Omega\\
+
+\\
+
+\displaystyle
+K_{2i-1,2j} &\displaystyle = 
+\iint_\Omega  %double
+\left( 2 H \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial x} + 
+H \mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial y} \right) d\Omega \\
+
+\\
+
+\displaystyle
+K_{2i,2j-1} &\displaystyle = 
+\iint_\Omega  %double
+  \left( 2 H \mu \frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_i}{\partial y} 
+  + H \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial x} \right)  d\Omega\\
+  
+\\
+
+\displaystyle
+K_{2i,2j} &\displaystyle = 
+\iint_\Omega  %double
+\left( 4 H \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial y} + 
+H \mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial x}+\alpha^2 \phi_j \phi_i  \right)  d\Omega \\
+
+\\
+
+\displaystyle
+F_{2i-1} &\displaystyle =
+\int_\Gamma F n_x\phi_i d\Gamma -
+\iint_\Omega %double
+\rho g H \frac{\partial s}{\partial x}\phi_i d\Omega\\
+
+\\
+
+\displaystyle
+ F_{2i} & \displaystyle = 
+\int_\Gamma F n_y\phi_i d\Gamma -
+\iint_\Omega %double
+\rho g H \frac{\partial s}{\partial y}\phi_i d\Omega \\
+\end{array}
+\end{equation}
+\newpage
+        \subsection{Decomposition over the elements}
+        
+The integrals over $\Omega$ can be divided in several integrals over each elements. Remembering that the mesh contains $nel$ elements,equations (\ref{FFU2}) and (\ref{FFV2}) become: 
+\begin{center}
+ $\forall 1 \leq i \leq nods$
+\end{center}
+\begin{multline}
+\sum_{E=1}^{nel} \left( 
+\sum_{j=1}^{nods} \iint_E  %double
+  \left( 4 H \mu \frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_i}{\partial x} 
+  + H \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial y} +\alpha^2 \phi_j \phi_i \right)  u_j
++ \left( 2 H \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial x} + 
+H \mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial y} \right) v_j
+dS \right) \\
+ =\sum_{E=1}^{nel} \left(
+\int_{E \cup\Gamma} 
+F n_x\phi_i dl -
+\iint_E %double
+\rho g H \frac{\partial s}{\partial x}\phi_i dS  
+\right)
+\end{multline}
+\begin{multline}
+\sum_{E=1}^{nel} \left(
+\sum_{j=1}^{nods}  
+\iint_E %double
+ \left( 2 H \mu \frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_i}{\partial y} 
+  + H \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial x} \right)  u_j
++ \left( 4 H \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial y} + 
+H \mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial x}+\alpha^2 \phi_j \phi_i  \right) v_j
+ dS  \right) \\
+=\sum_{E=1}^{nel}\left(
+\int_{E \cup\Gamma} F n_y\phi_i dl -
+\iint_E %double
+\rho g H \frac{\partial s}{\partial y}\phi_i dS  
+\right)
+\end{multline}
+\\
+To compute the matrices $K$ and $F$, instead of calculating the integral over $\Omega$ directly, we will first integrate over each element $E$ 
+of the mesh to obtain several \emph{Elementary Matrices}, that will be assembled to get the final Stiffness matrix and load vector during the assembly process.\\
+\\
+The nodal functions are built so that $\forall 1\leq i \leq nods$:
+
+\begin{equation}
+\phi_i(N_j)=\delta_{ij}
+\end{equation}
+\\
+where $\delta_{ij}$ is the Kronecker symbol. The nodal function is equal to 1 at a node and 0 on every other nodes. So for one element $E$, the only nodal 
+functions that are useful in (\ref{FFU}) and (\ref{FFV}) (ie: do not give 0=0) are the nodal functions corresponding to the vertexes of the element.
+ Since the elements are triangle, there are only 3 nodal functions that need to be taken into account.\\
+\\
+One element $E$ gives 6 equations: we take 3 nodal functions for $\phi_i(x,y)$ (the nodal functions corresponding to the vertexes of $E$),
+and each $\phi_i$ gives 2 equations (one for the x-component, and one for the y-component). Therefore, an elementary stiffness matrix $K_E$ will be $6 \times 6$, and the elementary load vector will be of size $6$.
+\newpage
+        \subsection{Reference element and numerical integration}
+        
+Rather than calculating these integrals for each element, one uses a \emph{Reference Element} $\hat{E}$, and a transformation $\varphi$ that transforms the reference element to the element $E$ (See Fig.\ref{triangles}):
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{triaelem.png}
+\caption{Transformation from the reference triangle, to the current element of the mesh}
+\label{triangles}
+\end{center}
+\end{figure}
+For any function $f(x,y)$, the transformation verifies:
+
+\begin{equation}
+\iint_E f(x,y)dS = \iint_{\hat{E}} \hat{f}(r,s) \vert J \vert d\hat{S}
+\end{equation}
+\\
+Where $J$ is the Jacobian determinant of the $\varphi$. This Jacobian is calculated in section \ref{RE2D} and is constant over the element:
+
+\begin{equation}
+J=
+\left[
+\begin{array}{c c}
+\displaystyle 
+\frac{1}{2}\left( x_2-x_1 \right) & \displaystyle  \frac{\sqrt{3}}{6}\left(2x_3-x_1-x_2\right) \\
+\\
+\displaystyle 
+\frac{1}{2}\left( y_2- y_1\right)& \displaystyle  \frac{\sqrt{3}}{6}\left(2y_3-y_1-y_2\right)
+ \\
+\end{array}
+\right]
+\end{equation}
+\\
+Since $ISSM$ is a Matlab code, the integrals cannot be calculated directly. The numerical integration use a gaussian quadrature to approximate the integral as a weighted sum of function values at specified points (gaussian points) within the domain:
+
+\begin{equation}
+\iint_E f(x,y)dS = \iint_{\hat{E}} \hat{f}(r,s) \vert J\vert d\hat{S} \simeq \sum_{g=1}^{n} w_g \hat{f}(r_g,s_g)
+\end{equation}
+\\
+where $w_g$ are the quadrature rules weights and $(r_g,s_g)$ are the evaluation points, $g=1,2...,n$. The gauss quadrature is such that it makes the computed integral exact for all polynomials of a certain degree. All the integrals that appear in the stiffness matrix and load vector involve polynomials since nodal function are polynomials of degree 1. It is then easy to evaluate the degree of the polynomial to integrate (usually 2), and then find the gauss quadrature that gives an exact computed integral. 
+
+The integration points are given with their area coordinates (See Fig.\ref{triangles2}): 
+
+\begin{equation}
+\displaystyle (r_g,s_g)\equiv (\frac{A_1}{A_1+A_2+A_3},\frac{A_2}{A_1+A_2+A_3},\frac{A_3}{A_1+A_2+A_3})
+\end{equation}
+\\
+We use this system of coordinates because they have the following property:
+
+\begin{equation}
+1 \leq k \leq 3\quad \quad \frac{A_k}{A_1+A_2+A_3}=L_k(r_i,s_i)
+\end{equation}
+\\\begin{figure}[H]
+\begin{center}
+\includegraphics[width=8cm]{barycentric_tria.png} 
+\caption{Area coordinates}
+\label{triangles2}
+\end{center}
+\end{figure}
+
+The number of gaussian points depends on the order of integration. The order of integration can be computed from the polynomial degree $p$ that needs to be integrated. The formula is:
+
+\begin{equation}
+order=\frac{p+1}{2}
+\end{equation}
+\\
+Here, the degree of the polynome under the integral is $2$ (the drag implies the calculation of $\phi_j \phi_i$ whose degree is 2). The order of integration is hence 2 (the order must be an integer). For this order, $3$ gaussian points are required:
+
+\begin{center}
+\begin{tabular}{|l |c| c| c|}
+\hline
+&&&\\
+Gaussian point & 1 & 2 & 3 \\
+&&&\\
+\hline
+\hline
+&&&\\
+Weight & 0.577 & 0.577 & 0.577\\
+&&&\\
+\hline
+&&&\\
+Area coordinates &
+$
+\begin{array}{c}
+\displaystyle \frac{2}{3}\\
+\\
+\displaystyle \frac{1}{6}\\
+\\
+\displaystyle \frac{1}{6}\\
+\end{array}
+$
+&
+$
+\begin{array}{c}
+\displaystyle \frac{1}{6}\\
+\\
+\displaystyle \frac{2}{3}\\
+\\
+\displaystyle \frac{1}{6}\\
+\end{array}
+$
+&
+$
+\begin{array}{c}
+\displaystyle \frac{1}{6}\\
+\\
+\displaystyle \frac{1}{6}\\
+\\
+\displaystyle \frac{2}{3}\\
+\end{array}
+$
+\\
+&&&\\
+\hline
+\end{tabular}
+\end{center}
+\newpage
+        \subsection{Elementary stiffness matrix}
+To compute the elementary stiffness matrix, we first remove the basal drag, that will create a first elementary stiffness matrix $K1$, the basal drag will constitute another stiffness matrix $K2$. The elementary stiffness matrix will be the sum of $K1$ and $K2$ ($K_E=K1+K2$).
+
+        \subsubsection{Without basal drag}
+
+This matrix has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 3$ and  $1 \leq j \leq 3$ 
+\end{center}
+\begin{equation}
+\begin{array}{l c r}
+\displaystyle
+K1_{2i-1,2j-1} & = & \displaystyle 
+\iint_E  %double
+  \left( 4 H \mu \frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_i}{\partial x} 
+  + H \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial y}\right) d\Omega\\
+
+\\
+
+\displaystyle
+K1_{2i-1,2j}& = & \displaystyle  
+\iint_E  %double
+\left( 2 H \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial x} + 
+H \mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial y} \right) d\Omega \\
+
+\\
+
+\displaystyle
+K1_{2i,2j-1}& = & \displaystyle 
+\iint_E  %double
+  \left( 2 H \mu \frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_i}{\partial y} 
+  + H \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial x} \right)  d\Omega\\
+  
+\\
+
+\displaystyle
+K1_{2i,2j}& = & \displaystyle 
+\iint_E  %double
+\left( 4 H \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial y} + 
+H \mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial x} \right)  d\Omega \\
+\end{array}
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this matrix become:
+\begin{center}
+ $1 \leq i \leq 3$ and  $1 \leq j \leq 3$ 
+\end{center}
+\begin{equation*}
+\begin{array}{l l}
+\displaystyle
+K1_{2i-1,2j-1}&\displaystyle = 
+\iint_{\hat{E}}  %double
+  \left( 4 H \mu \frac{\partial L_{j}}{\partial \varphi_x(r,s)} \frac{\partial L_i}{\partial \varphi_x(r,s)} 
+  + H \mu \frac{\partial L_{j}}{\partial \varphi_y(r,s)} \frac{\partial L_i}{\partial \varphi_y(r,s)}\right) \vert J \vert d\hat{S}
+\\ \\ &
+\displaystyle \simeq
+\sum_{g=1}^3  w_g \left( 4 H \mu \frac{\partial L_{j}}{\partial \varphi_x(r,s)} \frac{\partial L_i}{\partial \varphi_x(r,s)} 
+  + H \mu \frac{\partial L_{j}}{\partial \varphi_y(r,s)} \frac{\partial L_i}{\partial \varphi_y(r,s)}\right) \vert J \vert  \\
+
+\\
+
+\displaystyle
+K1_{2i-1,2j} &\displaystyle = 
+\iint_{\hat{E}}  %double
+\left( 2 H \mu \frac{\partial L_{j}}{\partial \varphi_y(r,s)}\frac{\partial L_i }{\partial \varphi_x(r,s)} + 
+H \mu\frac{\partial L_{j}}{\partial \varphi_x(r,s)} \frac{\partial L_{i}}{\partial \varphi_y(r,s)} \right) \vert J \vert d\hat{S} 
+\\ \\ &
+\displaystyle \simeq
+\sum_{g=1}^3  w_g 
+\left( 2 H \mu \frac{\partial L_{j}}{\partial \varphi_y(r,s)}\frac{\partial L_i }{\partial \varphi_x(r,s)} + 
+H \mu\frac{\partial L_{j}}{\partial \varphi_x(r,s)} \frac{\partial L_{i}}{\partial \varphi_y(r,s)} \right) \vert J \vert
+\\
+
+\\
+
+\displaystyle
+K1_{2i,2j-1} & \displaystyle = 
+\iint_{\hat{E}}  %double
+  \left( 2 H \mu \frac{\partial L_{j}}{\partial \varphi_x(r,s)} \frac{\partial L_i}{\partial \varphi_y(r,s)} 
+  + H \mu \frac{\partial L_{j}}{\partial \varphi_y(r,s)} \frac{\partial L_i}{\partial \varphi_x(r,s)} \right)  \vert J \vert d\hat{S}
+\\ \\ &
+\displaystyle \simeq
+\sum_{g=1}^3  w_g 
+\left( 2 H \mu \frac{\partial L_{j}}{\partial \varphi_x(r,s)} \frac{\partial L_i}{\partial \varphi_y(r,s)} 
+  + H \mu \frac{\partial L_{j}}{\partial \varphi_y(r,s)} \frac{\partial L_i}{\partial \varphi_x(r,s)} \right)
+\vert J \vert
+\\
+
+\\
+
+\displaystyle
+K1_{2i,2j} & \displaystyle = 
+\iint_{\hat{E}}  %double
+\left( 4 H \mu \frac{\partial L_{j}}{\partial \varphi_y(r,s)}\frac{\partial L_i }{\partial \varphi_y(r,s)} + 
+H \mu\frac{\partial L_{j}}{\partial \varphi_x(r,s)} \frac{\partial L_{i}}{\partial \varphi_x(r,s)} \right)  \vert J \vert d\hat{S} 
+\\ \\ &
+\displaystyle \simeq
+\sum_{g=1}^3  w_g 
+\left( 4 H \mu \frac{\partial L_{j}}{\partial \varphi_y(r,s)}\frac{\partial L_i }{\partial \varphi_y(r,s)} + 
+H \mu\frac{\partial L_{j}}{\partial \varphi_x(r,s)} \frac{\partial L_{i}}{\partial \varphi_x(r,s)} \right)
+\vert J \vert
+\\
+\end{array}
+\end{equation*}
+\\
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K1= \sum_{g=1}^3 [B]^T[D][B']$ as follows\footnote{$\left[ I_n\right]$ is a common notation for an identity matrix of size $n\times n$}:
+\begin{center}
+$D=2 w_g H \mu \vert J \vert \left[ I_3\right]  $ 
+\end{center}
+\begin{equation}
+[B]^T=
+\left[
+\begin{array}{c c c}
+\displaystyle 
+\frac{\partial L_1}{\partial \varphi_x(r,s)} & 0 & \displaystyle  \frac{1}{2} \frac{\partial L_1}{\partial \varphi_y(r,s)} \\
+\\
+\displaystyle 
+0 &\displaystyle   \frac{\partial L_1}{\partial \varphi_y(r,s)} & \displaystyle  \frac{1}{2} \frac{\partial L_1}{\partial \varphi_x(r,s)} \\
+\\
+ \displaystyle 
+ \frac{\partial L_2}{\partial \varphi_x(r,s)} & 0 &\displaystyle   \frac{1}{2} \frac{\partial L_2}{\partial \varphi_y(r,s)} \\
+\\
+\displaystyle 
+0 &\displaystyle   \frac{\partial L_2}{\partial \varphi_y(r,s)} & \displaystyle  \frac{1}{2} \frac{\partial L_2}{\partial \varphi_x(r,s)}  \\
+\\
+\displaystyle 
+\frac{\partial L_3}{\partial \varphi_x(r,s)} & 0 &\displaystyle  \frac{1}{2} \frac{\partial L_3}{\partial \varphi_y(r,s)}  \\
+\\
+\displaystyle 
+0 &\displaystyle   \frac{\partial L_3}{\partial \varphi_y(r,s)} &\displaystyle   \frac{1}{2} \frac{\partial L_3}{\partial \varphi_x(r,s)} \\
+\\
+\end{array}
+\right]
+\end{equation}
+\begin{equation}
+[B']=
+\left[
+\begin{array}{c c c c c c}
+\displaystyle 
+2 \frac{\partial L_1}{\partial \varphi_x(r,s)} & \displaystyle   \frac{\partial L_1}{\partial \varphi_y(r,s)} 
+& \displaystyle 2\frac{\partial L_2}{\partial \varphi_x(r,s)} & \displaystyle   \frac{\partial L_2}{\partial \varphi_y(r,s)} 
+& \displaystyle  2\frac{\partial L_3}{\partial \varphi_x(r,s)} & \displaystyle  \frac{\partial L_3}{\partial \varphi_y(r,s)}\\
+\\
+\displaystyle   \frac{\partial L_1}{\partial \varphi_x(r,s)} &  \displaystyle  2\frac{\partial L_1}{\partial \varphi_y(r,s)} &
+\displaystyle   \frac{\partial L_2}{\partial \varphi_x(r,s)} &  \displaystyle  2\frac{\partial L_2}{\partial \varphi_y(r,s)} &
+\displaystyle    \frac{\partial L_3}{\partial \varphi_x(r,s)} & \displaystyle   2\frac{\partial L_3}{\partial \varphi_y(r,s)}\\
+  \\
+\displaystyle   \frac{\partial L_1}{\partial \varphi_y(r,s)} &  \displaystyle  \frac{\partial L_1}{\partial \varphi_x(r,s)} &
+\displaystyle   \frac{\partial L_2}{\partial \varphi_y(r,s)} &  \displaystyle  \frac{\partial L_2}{\partial \varphi_x(r,s)} &
+\displaystyle    \frac{\partial L_3}{\partial \varphi_y(r,s)} & \displaystyle  \frac{\partial L_3}{\partial \varphi_x(r,s)}\\  
+\end{array}
+\right]
+\end{equation}
+\\
+\emph{NB:} in $ISSM$ code, the factor $2$ in the $D$ matrix does not exist since the constitutive relation used is $\sigma'=\mu\varepsilon$ instead of $\sigma'=2\mu\varepsilon$. This changes the viscosity definition that must be multiplied by $2$.
+
+               \subsubsection{Computation of nodal function derivatives}
+               
+               
+The computation of $\displaystyle \frac{\partial L_i}{\partial \varphi_x(r,s)}$ and $\displaystyle \frac{\partial L_i}{\partial \varphi_y(r,s)}$ is done using the Jacobian of $\varphi$. We have:
+\begin{equation}
+\left[
+\begin{array}{c}
+\displaystyle 
+\frac{\partial L_i}{\partial \varphi_x(r,s)}\\
+\\
+\displaystyle 
+\frac{\partial L_i}{\partial \varphi_y(r,s)}
+\end{array}
+\right] = \left[
+\begin{array}{c c}
+\displaystyle 
+\frac{\partial r}{\partial \varphi_x(r,s)} & \displaystyle \frac{\partial s}{\partial \varphi_x(r,s)}\\
+\\
+\displaystyle 
+\frac{\partial r}{\partial \varphi_y(r,s)} & \displaystyle \frac{\partial s}{\partial \varphi_y(r,s)}\\
+\end{array}
+\right] 
+\left[
+\begin{array}{c}
+\displaystyle 
+\frac{\partial L_i}{\partial r}\\
+\\
+\displaystyle 
+\frac{\partial L_i}{\partial s}
+\end{array}
+\right] 
+\end{equation}
+\\
+The Jacobian of $\varphi$ is:
+
+\begin{equation}
+\left[ J_\varphi\right]=
+\left[
+\begin{array}{c c}
+\displaystyle 
+\frac{\partial \varphi_x }{\partial r} & \displaystyle  \frac{\partial \varphi_x }{\partial s} \\
+\\
+\displaystyle 
+\frac{\partial \varphi_y }{\partial r} & \displaystyle  \frac{\partial \varphi_y }{\partial s} \\
+\end{array}
+\right]
+\end{equation}
+\\
+We have: $\displaystyle \left[ J_\varphi\right] ^{-1}=\left[ J_{\varphi^{-1}}\right] $. This gives us:
+
+\begin{equation}
+\left[ J_\varphi\right] ^{-1}=
+\left[
+\begin{array}{c c}
+\displaystyle 
+\frac{\partial r}{\partial \varphi_x } & \displaystyle  \frac{\partial r }{\partial \varphi_y } \\
+\\
+\displaystyle 
+\frac{\partial s }{\partial \varphi_x } & \displaystyle  \frac{\partial s }{\partial \varphi_y } \\
+\end{array}
+\right]
+\end{equation}
+\\
+And finally, we obtain:
+
+\begin{equation}
+\left[
+\begin{array}{c}
+\displaystyle 
+\frac{\partial L_i}{\partial \varphi_x(r,s)}\\
+\\
+\displaystyle 
+\frac{\partial L_i}{\partial \varphi_y(r,s)}
+\end{array}
+\right] = \left( \left[
+J
+\right]^{-1} \right) ^{T}
+\left[
+\begin{array}{c}
+\displaystyle 
+\frac{\partial L_i}{\partial r}\\
+\\
+\displaystyle 
+\frac{\partial L_i}{\partial s}
+\end{array}
+\right] 
+\end{equation}
+
+       
+               \subsubsection{Basal drag}
+This matrix has the following shape:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+K_{2i-1,2j-1}= 
+\iint_E  %double
+\alpha^2 \phi_j \phi_i  d\Omega\\
+\\
+\displaystyle
+K_{2i-1,2j}= 0\\
+\\
+\displaystyle
+K_{2i,2j-1}= 0\\
+\\
+\displaystyle
+K_{2i,2j}= 
+\iint_E  %double
+\alpha^2 \phi_j \phi_i d\Omega \\
+\end{array}
+\end{equation}
+\\        
+Using the reference element $\hat{E}$ and the gaussian points, this matrix become:
+        
+        \begin{equation}
+\begin{array}{l l l}
+\displaystyle
+K_{2i-1,2j-1} & = \displaystyle 
+\iint_{\hat{E}}  %double
+\alpha^2 L_j(r,s) L_i(r,s)   \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+w_g \alpha^2 L_j(r_g,s_g) L_i(r_g,s_g)   \vert J \vert
+ \\
+\\
+\displaystyle
+K_{2i-1,2j} & = 0 &\\
+\\
+\displaystyle
+K_{2i,2j-1} & = 0 &\\
+\\
+\displaystyle
+K_{2i,2j} & = \displaystyle 
+\iint_{\hat{E}}  %double
+\alpha^2 L_j(r,s) L_i(r,s)  \vert J \vert d\hat{S} &
+\displaystyle \simeq
+\sum_{g=1}^3
+w_g \alpha^2 L_j(r_g,s_g) L_i(r_g,s_g)   \vert J \vert 
+ \\
+ \\
+\end{array}
+\end{equation}
+\\     
+The values $L_i(r_g,s_g)$ are equal to the component of the area coordinates (ie. for example $L_1(r_2,s_2)=1/6$). This matrix is calculated with three matrices: $\displaystyle K1=\sum_{g=1}^3 [L]^T[D_{drag}][L]$ as follows:
+\begin{equation}
+[L]=
+\left[
+\begin{array}{c c c c c c}
+\displaystyle 
+L_1 & 0 & L_2 & 0 & L_3 & 0 \\
+\\
+0 & L_1 & 0 & L_2 & 0 & L_3 \\
+\end{array}
+\right]
+\end{equation}
+and $D=w_g \alpha^2  \vert J \vert \left[ I_2\right]$
+
+\newpage
+        \subsection{Elementary load vector}
+To compute the elementary load vector, we first calculate the force due to the driving stress only, andthen we and to this vector the force on the ice front due to the water pressure.
+
+			\subsubsection{Driving stress}
+
+The elementary load vector due to driving stress has the following shape:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+F1_{2i-1}= -
+\iint_E %double
+\rho g H \frac{\partial s}{\partial x}\phi_i d\Omega\\
+
+\\
+
+\displaystyle
+ F1_{2i}= -
+\iint_E %double
+\rho g H \frac{\partial s}{\partial y}\phi_i dS \\
+\end{array}
+\end{equation}
+\\
+The slopes $\frac{\partial s}{\partial x}$ and $\frac{\partial s}{\partial y}$ are constant on the element. Using the reference element $\hat{E}$ and the gaussian points, this vector become:
+
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+F1_{2i-1}= -
+\iint_{\hat{E}} %double
+\rho g H \frac{\partial s}{\partial x}L_i(r,s) \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+ - w_g \rho g H \frac{\partial s}{\partial x} L_i(r_g,s_g)   \vert J \vert \\
+\\
+\displaystyle
+F1_{2i}= -
+\iint_{\hat{E}} %double
+\rho g H \frac{\partial s}{\partial y}L_i(r,s) \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+ - w_g \rho g H \frac{\partial s}{\partial y} L_i(r_g,s_g)   \vert J \vert \\
+\end{array}
+\end{equation}
+
+			\subsubsection{Ice front}
+The load on the ice front have the following shape:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+F2_{2i-1}=\int_{E \cup\Gamma}\left( \dfrac{1}{2}\rho g H^2 -\dfrac{1}{2}\rho_w g b^2\right)n_x\phi_i dl\\
+\\
+\displaystyle
+F2_{2i}=\int_{E \cup\Gamma} \left( \dfrac{1}{2}\rho g H^2 -\dfrac{1}{2}\rho_w g b^2\right)n_y\phi_i dl\\
+\end{array}
+\end{equation}
+\\
+Here, the reference element are segment. Using these reference elements $\hat{E}$ and the gaussian points, this vector become:
+
+\begin{equation*}
+\begin{array}{l l l}
+\displaystyle
+F2_{2i-1} & \displaystyle =\int_{\hat{E} \cup\Gamma} \left( \dfrac{1}{2}\rho g H^2 -\dfrac{1}{2}\rho_w g b^2\right)n_x L_i \vert J \vert  d\hat{l}
+&
+\displaystyle \simeq
+\sum_{g=1}^2
+w_g \left( \dfrac{1}{2}\rho g H(r_g)^2 -\dfrac{1}{2}\rho_w g b(r_g)^2\right)n_x L_i(r_g)   
+ \vert J \vert \\
+\\
+\displaystyle
+F2_{2i} & \displaystyle =\int_{\hat{E} \cup\Gamma} \left( \dfrac{1}{2}\rho g H^2 -\dfrac{1}{2}\rho_w g b^2\right)n_y L_i \vert J \vert d\hat{l}
+&
+\displaystyle \simeq
+\sum_{g=1}^2
+w_g \left( \dfrac{1}{2}\rho g H(r_g)^2 -\dfrac{1}{2}\rho_w g b(r_g)^2\right)n_y L_i(r_g)   
+ \vert J \vert 
+\end{array}
+\end{equation*}
+\newpage
+
+        \subsection{Assembly}
+Once an element stiffness matrix or a load vector is computed, it is plugged into the global stiffness matrix or global load vector. That step requires the knowledge of the global degrees of freedom. Indeed, each component of the element stiffness matrix or load vector is initially indexed by local degrees of freedom but each one of these local degrees of freedom is linked to a global degree of freedom. Once an elementary stiffness matrix is computed, each term is added to the corresponding term in the global stiffness matrix depending on the global degrees of freedom involved.\\
+\\
+Let us illustrate this process with Fig.\ref{Assembly}, there are 6 local degrees of freedom for a given triangle of the mesh (3 nodes and two degrees of freedom per node: one for $x$ and another for $y$). The local degree of freedom number $5$ correspond to a global degree of freedom number $809$, and the local degree of freedom number $1$ is the global degree of freedom number $12$. Therefore, the component $Ke_{1,5}$ of the element stiffness matrix must be added to $K_{12,809}$ of the global stiffness matrix.
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{Assembly.png}
+\caption{Assembly process}
+\label{Assembly}
+\end{center}
+\end{figure}
+After the assembly process, one obtains a global stiffness matrix whose size is $2nods \times 2nods$, but to build the weak formulation, we made the assumption that $\phi$ was kinematically admissible:
+
+\begin{equation}
+\overrightarrow{\phi}(x,y)\in\lbrace \left( H^{1}(\Omega\cup\partial\Omega) \right)^2 \quad \backslash\quad \overrightarrow{\phi}(x,y)=0\qquad (x,y)\in\Gamma_u\rbrace
+\end{equation}
+\\
+Therefore, all the nodal functions of the nods located on $\Gamma_u$ that we used to build the global stiffness matrix are not kinematically admissible. We must reduce the global stiffness matrix $K_{gg}$ to the final stiffness matrix $K_{ff}$ by erasing all the rows and columns related to these nodal functions.
+
+\newpage
+			\subsection{Resolution}
+We saw that the velocity on each node could be calculated with $U=K^{-1}F$, but we assumed that the specified velocity $U_s$ of the nodes located on $\Gamma_u$ was $0$. To take into account the fact that the constraint can be different than $0$, the velocity field is calculated as follows:
+
+\begin{equation}
+U_f = [K_{ff}]^{-1} \left(  F +K_{fs}U_s \right)
+\end{equation}
+\\
+Where $f$ stands for "free" and $s$ for "single point constraint". Then, we must add the single point constraints to the vector $U_f$ in order to have the velocity of all the nodes of the domain $U_g$.
+
+
+
+
+
+
+
+			\subsection{Summary}
+The computation of the velocity field is not linear since the viscosity depends directly on the solution. The following algorithm is used: an initial viscosity is assumed. Each elementary stiffness matrix and load vector is computed using gauss quadratures. They are then plugged into the global stiffness matrix and global load vector. The global stiffness matrix and load vector are reduced depending on the constraints (The velocity of a constrained node is not computed, the corresponding line and column in the stiffness matrix and load vector must be deleted). Then the velocity field is computed and compared to the one of the previous iteration (for the first iteration, there is no convergence test, a second iteration must be launched). If the convergence criterion is not fulfilled (ei. the results are too different from one another), a new iteration is computed, using the velocity field of the previous iteration to compute the viscosity.
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=16cm]{Algorithm.png}
+\caption{Schematic algorithm used by $ISSM$}
+\label{algorithm}
+\end{center}
+\end{figure}
+\newpage
+
+
+
+
+\section{Pattyn's Higher-order model}
+
+    \subsection{Geometry and notations}
+The glacier system is 3d. With the assumptions detailed in the first chapter, we only solve the problem for the horizontal components of velocity and deduce the vertical term from them using the incompressibility. \\
+
+\begin{center}
+\begin{figure}[H]
+\includegraphics[width=15cm]{geometry3D.png}
+\caption{Geometry and notations}
+\label{geometrypattyn}
+\end{figure}
+\end{center}
+We adopt the following notations:
+\begin{itemize}
+        \item[--] $\Omega$ is the open surface that constitutes the entire glacier system
+        \item[--] $\partial\Omega$ are the points located at the boundary
+        \item[--] $\Gamma_i$ are  points at the ice front (Ice/Water interface)
+        \item[--] $\Gamma_s$ are  points at the surface of the glacier (Ice/Atmosphere interface $z=s$)
+        \item[--] $\Gamma_b$ are  points at the interface between glacier and bedrock (Ice/Till interface $z=b$)
+        \item[--] $\Gamma_w$ are  points at the interface between glacier and water (Ice/Water interface $z=b$)
+        \item[--] $\Gamma_u=\partial\Omega\backslash\left(\Gamma_i\cup\Gamma_s\cup\Gamma_b\cup\Gamma_w\right)$ are all other points on the boundary\\
+\end{itemize}
+
+        \subsection{Equations}
+
+The equations of Pattyn's model are (\ref{Pattyn equations}):
+\begin{equation}
+ \left\{ \begin{array}{l}
+\dfrac{\partial }{\partial x} \left(4 \mu \dfrac{\partial u}{\partial x} + 2 \mu \dfrac{\partial v}{\partial y} \right)+ \dfrac{\partial }{\partial y} \left(\mu \dfrac{\partial u}{\partial y} + \mu \dfrac{\partial v}{\partial x} \right) + \dfrac{\partial }{\partial z}\left( \mu \dfrac{\partial u}{\partial z}\right)= \rho g \dfrac{\partial s}{\partial x}\\
+\\
+\dfrac{\partial }{\partial x} \left( \mu \dfrac{\partial u}{\partial y} +  \mu \dfrac{\partial v}{\partial x} \right)+ \dfrac{\partial }{\partial y} \left(4 \mu \dfrac{\partial v}{\partial y} + 2 \mu \dfrac{\partial u}{\partial x} \right) + \dfrac{\partial }{\partial z}\left( \mu \dfrac{\partial v}{\partial z}\right)= \rho g \dfrac{\partial s}{\partial y}\\
+                 \end{array} \right.
+\end{equation}
+\\
+The boundary conditions are: a dynamic boundary condition (Neumann) at the ice front, a friction law on the ice sheet, and single point constraint (Dirichlet) on the other borders of the domain $\Omega$.
+It is more convenient to consider these specified velocities as nill. At the end of the process, the velocity field will be updated to take these
+constraints into account.
+
+\begin{equation}
+\left\{ \begin{array}{l l}
+\text{Ice Front } \Gamma_i: & \displaystyle \sigma' \overrightarrow{n} = F_i \overrightarrow{n}=\left(\rho_i g \left( s-z\right) + \rho_w g \min\left( 0,z\right)  \right) \overrightarrow{n}\\
+\\
+\text{Upper surface } \Gamma_s: & \sigma' \left(  \overrightarrow{n}\right) =0\\
+\\
+\text{Ice sheet base } \Gamma_b: &  \left(\sigma' \left(  \overrightarrow{n}\right)\right)_x = - K^2 N_{eff}^r \|\overrightarrow{v} \|^{s-1} u=-\alpha^2 u\\
+\\
+& \left(\sigma' \left(  \overrightarrow{n}\right)\right)_y = - K^2 N_{eff}^r \|\overrightarrow{v} \|^{s-1}v=-\alpha^2 v\\
+
+\\
+\text{Ice shelf base } \Gamma_w: &  \sigma' \overrightarrow{n} = F_w \overrightarrow{n}= g \left(\rho_i h(x,y) + \rho_w g b(x,y)  \right) \overrightarrow{n}\\
+\\ 
+\text{Other  borders } \Gamma_u: & u=v=0\\
+\end{array} \right.
+\end{equation}
+For the boundary condition on the ice sheet base, we use $r=q/p$ and $s=1/p$ as explained in the first chapter (\ref{friction})
+
+\newpage
+        \subsection{Weak Formulation}
+
+Now that we have all the equations and boundary conditions, we  write the weak formulation to solve these equations
+using finite element. We define a kinematically admissible velocity field $\overrightarrow{\phi}$:
+
+\begin{equation}
+\overrightarrow{\phi}(x,y)\in\lbrace \left( H^{1}(\Omega\cup\partial\Omega) \right)^2 \quad \backslash\quad \overrightarrow{\phi}(x,y,z)=0\qquad (x,y,z)\in\Gamma_u\rbrace
+\end{equation}
+\\
+For any function of this virtual field, we take the scalar product of the equations with $\overrightarrow{\phi}=\left(\phi_x,0 \right) $ and $\overrightarrow{\phi}=\left(0,\phi_y \right) $ that are 2 other kinematically admissible velocity fields, and integrate these products over the domain to obtain:
+
+\begin{equation*}
+\iiint_\Omega %triple
+\left[ \frac{\partial}{\partial x} \left(4 \mu  \frac{\partial u}{\partial x}+2 \mu\frac{\partial v}{\partial y} \right)\phi_x
++\frac{\partial}{\partial y}  \left(\mu  \frac{\partial u}{\partial y}+ \mu \frac{\partial v}{\partial x} \right)\phi_x
++ \frac{\partial}{\partial z} \left( \mu \frac{\partial u}{\partial z}\right) \phi_x - \rho g \frac{\partial s}{\partial x}\phi_x  \right]  d\Omega =0
+\end{equation*}
+
+\begin{equation*}
+\iiint_\Omega %triple
+\left[\frac{\partial}{\partial y} \left( 4 \mu \frac{\partial v}{\partial y}+ 2 \mu \frac{\partial u}{\partial x} \right) \phi_y
++\frac{\partial}{\partial x}\left( \mu \frac{\partial u}{\partial y}+\mu \frac{\partial v}{\partial x} \right) \phi_y
++ \frac{\partial}{\partial z} \left( \mu \frac{\partial v}{\partial z}\right) \phi_y -\rho g  \frac{\partial s}{\partial y}\phi_y \right]  d\Omega =0
+\end{equation*}
+\\
+One intergrates by parts the first three terms in order to merge in the force on the ice front $\Gamma_i$, the interface with the bedrock $\Gamma_b$ (ice sheet base) and the interface with the water $\Gamma_w$ (ice shelf base):
+
+\begin{multline}
+\iiint_\Omega  %triple
+\left( 4 \mu \frac{\partial u}{\partial x}+2 \mu \frac{\partial v}{\partial y}\right) \frac{\partial \phi_x}{\partial x}
++  \left(\mu \frac{\partial u}{\partial y}+\mu \frac{\partial v}{\partial x}\right)  \frac{\partial \phi_x }{\partial y} 
++ \mu \frac{\partial u}{\partial z}  \frac{\partial \phi_x }{\partial z} d\Omega\\
+ =\iint_{\Gamma_i\cup \Gamma_b \cup \Gamma_w} F n_x\phi_xd\Gamma -
+\iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial x}\phi_x d\Omega
+\label{FFU Pattyn}
+\end{multline}
+\begin{multline}
+\iiint_\Omega  %triple
+\left( 4 \mu \frac{\partial v}{\partial y}+2 \mu \frac{\partial u}{\partial x}\right) \frac{\partial \phi_y}{\partial y}
++  \left(\mu \frac{\partial v}{\partial x}+\mu \frac{\partial u}{\partial y}\right)  \frac{\partial \phi_y }{\partial x} 
++ \mu \frac{\partial v}{\partial z}  \frac{\partial \phi_y }{\partial z} d\Omega\\
+ =\iint_{\Gamma_i\cup \Gamma_b \cup \Gamma_w}F n_y\phi_yd\Gamma -
+\iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial y}\phi_y d\Omega
+\label{FFV Pattyn}
+\end{multline}
+It is easier to put the basal friction at the left hand side of the equation since it is velocity dependant. The equations become:
+
+\begin{multline}
+\iiint_\Omega  %triple
+\left( 4 \mu \frac{\partial u}{\partial x}+2 \mu \frac{\partial v}{\partial y}\right) \frac{\partial \phi_x}{\partial x}
++  \left(\mu \frac{\partial u}{\partial y}+\mu \frac{\partial v}{\partial x}\right)  \frac{\partial \phi_x }{\partial y} 
++ \mu \frac{\partial u}{\partial z}  \frac{\partial \phi_x }{\partial z} d\Omega
++\iint_{\Gamma_b } \alpha^2 u \phi_xd\Gamma\\
+ =\iint_{\Gamma_i } F_i n_x\phi_x d\Gamma +
+\iint_{\Gamma_w }F_w n_x\phi_yx\Gamma -
+\iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial x}\phi_x d\Omega
+\end{multline}
+\begin{multline}
+\iiint_\Omega  %triple
+\left( 4 \mu \frac{\partial v}{\partial y}+2 \mu \frac{\partial u}{\partial x}\right) \frac{\partial \phi_y}{\partial y}
++  \left(\mu \frac{\partial v}{\partial x}+\mu \frac{\partial u}{\partial y}\right)  \frac{\partial \phi_y}{\partial x} 
++ \mu \frac{\partial v}{\partial z}  \frac{\partial \phi_y }{\partial z} d\Omega
++\iint_{\Gamma_b }\alpha^2 v \phi_y d\Gamma\\
+ =\iint_{\Gamma_i }F_i n_y\phi_yd\Gamma +
+\iint_{\Gamma_w }F_w n_y\phi_yd\Gamma -
+\iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial y}\phi_y d\Omega
+\end{multline}
+\newpage
+        \subsection{Finite element discretisation, Galerkin method}
+ The domain is meshed using pentahedrons. There are a $nel$ elements and $nods$ grids. We use the nodal functions of each grid, which are continuous on the domain and affine on each element.
+We now project the unknows $u$ and $v$ on the nodal functions:
+\begin{center}
+ $(\phi_i)_{1\leq i\leq nods}$
+\end{center}
+\begin{equation}
+\begin{array}{c}
+\displaystyle u\left( x,y,z\right) = \sum_{i=1}^{nods}u_{i}\phi_{i}\left( x,y,z\right) \\
+\\
+\displaystyle v\left( x,y,z\right) = \sum_{i=1}^{nods}v_{i}\phi_{i}\left( x,y,z\right) \\
+\end{array}
+\end{equation}
+\\
+We build a vector $U$ that holds all the unknows of the velocity field:
+
+\begin{equation}
+U=\left[ \begin{array}{c}
+u_{1}\\
+v_{1}\\
+...\\
+u_{nods}\\
+v_{nods}\\
+  \end{array} \right]
+\end{equation}
+\\
+With this new field, we  replace the component of the virtual function $\overrightarrow{\phi}$ by the nodal functions:
+\begin{center}
+ $\forall 1 \leq i \leq nods$
+\end{center}
+\begin{multline}
+\sum_{j=1}^{nods} 
+\iiint_\Omega  %triple
+ \left(  4 \mu u_j\frac{\partial \phi_j}{\partial x} + 2 \mu v_j\frac{\partial \phi_j}{\partial y}\right)\frac{\partial \phi_i}{\partial x}
++\left(  \mu u_j\frac{\partial \phi_j}{\partial y} +\mu v_j \frac{\partial \phi_j}{\partial x} \right)\frac{\partial \phi_i}{\partial y} 
++  \mu u_j\frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} 
+d\Omega
+\\
++\iint_{\Gamma_b} \alpha^2 u_j \phi_j \phi_i d\Gamma
+ =
+\iint_{\Gamma_i} F_i n_x\phi_i d\Gamma
++ \iint_{\Gamma_w} F_w n_x\phi_i d\Gamma
+- \iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial x} \phi_i d\Omega
+\end{multline}
+\begin{multline}
+\sum_{j=1}^{nods} 
+\iiint_\Omega %triple
+\left(  \mu u_j\frac{\partial \phi_j}{\partial y} +\mu v_j\frac{\partial \phi_j}{\partial x} \right)\frac{\partial \phi_i  }{\partial x} 
++\left(  4 \mu v_j\frac{\partial \phi_j}{\partial y} + 2 \mu u_j \frac{\partial \phi_i}{\partial x}\right)\frac{\partial \phi_i }{\partial y} 
++  \mu v_j\frac{\partial \phi_j}{\partial z}\frac{\partial \phi_i  }{\partial z}
+d\Omega
+\\
++\iint_{\Gamma_b} \alpha^2 v_j \phi_j \phi_i d\Gamma
+ =
+\iint_{\Gamma_i} F_i n_y\phi_i d\Gamma
++ \iint_{\Gamma_w} F_w n_y\phi_i d\Gamma
+- \iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial y} \phi_i d\Omega
+\end{multline}
+\\
+
+
+By rearranging terms:
+\begin{center}
+ $\forall 1 \leq i \leq nods$
+\end{center}
+\begin{multline}
+\sum_{j=1}^{nods} 
+\iiint_\Omega  %triple
+\left[
+ 4 \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ + \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} 
+\right] u_j
++
+\left[
+ 2 \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial x} 
+ + \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial y}
+\right] v_j d\Omega
+\\
++\iint_{\Gamma_b} \alpha^2 u_j \phi_j \phi_i d\Gamma
+ =
+\iint_{\Gamma_i} F_i n_x\phi_i d\Gamma +
+\iint_{\Gamma_w} F_w n_x\phi_i d\Gamma
+- \iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial x} \phi_i d\Omega 
+\end{multline}
+\begin{multline}
+\sum_{j=1}^{nods} 
+\iiint_\Omega %triple
+\left[
+  \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial x} 
+ + 2 \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial y}
+\right] u_j
++
+\left[
+   \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ +4\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} 
+\right] v_j d\Omega
+\\
++\iint_{\Gamma_b} \alpha^2 v_j \phi_j \phi_i d\Gamma
+ =
+\iint_{\Gamma_i} F_i n_y\phi_i d\Gamma +
+\iint_{\Gamma_w} F_w n_y\phi_i d\Gamma
+- \iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial y} \phi_i d\Omega 
+\end{multline}
+\\
+We see the stiffness matrix $K$ and load vector $F$ appearing, so that the previous equations can be written as a matrix form:
+
+\begin{equation}
+\left[ K \right] U =F 
+\end{equation} 
+\\
+We use the following index:
+
+\begin{equation}
+\left[
+\begin{array}{c c c c} %K
+  & \vdots &\vdots &\\
+ \cdots & K_{2i-1,2j-1} & K_{2i-1,2j} & \cdots\\
+ \cdots & K_{2i,2j-1} &   K_{2i,2j} & \cdots\\
+  & \vdots &\vdots &\\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+u_j\\
+v_j\\
+\vdots\\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %F
+\vdots \\
+F_{2j-1}\\
+F_{2j}\\
+\vdots\\
+\end{array}
+\right]
+\end{equation}
+\\
+And  we have the following expressions for the stiffness matrix and the load vector :
+
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+
+K_{2i-1,2j-1} &\displaystyle = 
+\iiint_\Omega  %triple
+ 4 \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ + \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} 
+d\Omega
++\iint_{\Gamma_b} \alpha^2 u_j \phi_j \phi_i d\Gamma \\
+\\
+K_{2i-1,2j} &\displaystyle = 
+\iiint_\Omega  %triple
+ 2 \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial x} 
+ + \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial y}
+d\Omega\\
+\\
+K_{2i,2j-1} &\displaystyle = 
+\iiint_\Omega  %triple
+2 \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial y} 
++ \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial x}
+d\Omega\\
+\\
+K_{2i,2i} &\displaystyle = 
+\iiint_\Omega  %triple
+   \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ +4\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} 
+d\Omega
++\iint_{\Gamma_b} \alpha^2 v_j \phi_j \phi_i d\Gamma\\
+\\
+F_{2i-1} &\displaystyle = 
+\iint_{\Gamma_i} F_i n_x\phi_i d\Gamma +
+\iint_{\Gamma_w} F_w n_x\phi_i d\Gamma
+- \iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial x} \phi_i d\Omega \\
+\\
+F_{2i} &\displaystyle = 
+\iint_{\Gamma_i} F_i n_y\phi_i d\Gamma +
+\iint_{\Gamma_w} F_w n_y\phi_i d\Gamma
+- \iiint_\Omega %triple
+\rho g \frac{\partial s}{\partial y} \phi_i d\Omega \\
+\\
+\end{array}
+\end{equation}
+
+        \subsection{Decomposition over the elements and reference element}
+        The integrals over $\Omega$ can be divided in several integrals over each elements. To compute the matrices $K$ and $F$, instead of calculating the integral over $\Omega$ directly, we will first calculate the integrales over each element $E$ 
+of the mesh, that will give us several \emph{Element Matrices}, that will be plugged into the global matrices to get the final Stiffness matrix and load vector.\\
+\\
+One element $E$ gives 12 equations: we can take 6 nodal functions for $\phi_i(x,y,z)$ (the nodal functions corresponding to the vertexes of $E$, which is an pentahedron), each $\phi_i$ gives 2 equations (one for the x-component and one for the y-component). Therefore, an elementary stiffness matrix $K_E$ will be $12 \times 12$, and the elementary load vector will be of size $19$.
+
+Exactly as in MacAyeal's model,  rather than calculating these integrals for each element, one uses a \emph{Reference Element} $\hat{E}$, and a transformation $\varphi$ that transforms the reference element to the element $E$ (See Fig.\ref{hexa}):
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{pentaelem.png}
+\caption{Transformation from the reference element, to the current element of the pentahedral mesh}
+\label{hexa}
+\end{center}
+\end{figure}
+For any function $f(x,y,z)$, the transformation verifies:
+
+\begin{equation}
+\iiint_E f(x,y,z)dV = \iiint_{\hat{E}} \hat{f}(r,s,\zeta) \vert J \vert d\hat{V}
+\end{equation}
+\\
+Where $J$ is the Jacobian determinant of the $\varphi$ function.  This Jacobian is calculated in section \ref{RE3D}:
+
+\begin{equation}
+J=
+\left[
+\begin{array}{c c c}
+\displaystyle 
+\frac{\partial \varphi_x }{\partial r} & \displaystyle  \frac{\partial \varphi_x }{\partial s} &  \displaystyle  \frac{\partial \varphi_x }{\partial \zeta} \\
+\\
+\displaystyle 
+\frac{\partial \varphi_y }{\partial r} & \displaystyle  \frac{\partial \varphi_y }{\partial s} &  \displaystyle  \frac{\partial \varphi_y }{\partial \zeta}  \\
+\\
+\displaystyle 
+\frac{\partial \varphi_z }{\partial r} & \displaystyle  \frac{\partial \varphi_z }{\partial s} &  \displaystyle  \frac{\partial \varphi_z }{\partial \zeta}  \\
+\end{array}
+\right]
+\end{equation}
+\\
+with:
+
+\begin{equation*}
+\begin{array}{c l}
+\displaystyle 
+J_{11}= &  \displaystyle 
+ \frac{1}{4}\left( x_1-x_2-x_4+x_5 \right)+ \frac{1}{4}\left( -x_1+x_2-x_4+x_5 \right) \zeta \\
+\\
+J_{21}= &  \displaystyle 
+ \frac{1}{4}\left( y_1-y_2-y_4+y_5 \right)+ \frac{1}{4}\left( -y_1+y_2-y_4+y_5 \right) \zeta \\
+\\
+J_{31}= &    \displaystyle 
+ \frac{1}{4}\left( z_1-z_2-z_4+z_5 \right)+ \frac{1}{4}\left( -z_1+z_2-z_4+z_5 \right) \zeta \\
+\end{array}
+\end{equation*}
+\begin{equation}
+\begin{array}{c l}
+J_{12}= &  \displaystyle  
+\frac{\sqrt{3}}{12} \left( x_1+x_2-2 x_3- x_4- x_5+ 2 x_6 \right)+ \frac{\sqrt{3}}{12} \left( -x_1-x_2+ 2 x_3- x_4- x_5+2 x_6 \right)\zeta\\
+\\
+J_{22}= &  \displaystyle 
+\frac{\sqrt{3}}{12} \left( y_1+y_2-2 y_3- y_4- y_5+ 2 y_6 \right)+ \frac{\sqrt{3}}{12} \left( -y_1-y_2+ 2 y_3- y_4- y_5+2 y_6 \right)\zeta\\
+\\
+J_{32}= &  \displaystyle 
+\frac{\sqrt{3}}{12} \left( z_1+z_2-2 z_3- z_4- z_5+ 2 z_6 \right)+ \frac{\sqrt{3}}{12} \left( -z_1-z_2+ 2 z_3- z_4- z_5+2 z_6 \right)\zeta\\
+\end{array}
+\end{equation}
+\begin{equation*}
+\begin{array}{c l}
+J_{31}= &  \displaystyle  
+\frac{1}{4}\left( -x_1+x_2-x_4+x_5 \right) r
++ \frac{\sqrt{3}}{12} \left( -x_1-x_2+ 2 x_3- x_4- x_5+2 x_6 \right)s\\ 
+\\
+J_{32}= &  \displaystyle 
+\frac{1}{4}\left( -y_1+y_2-y_4+y_5 \right) r
++ \frac{\sqrt{3}}{12} \left( -y_1-y_2+ 2 y_3- y_4- y_5+2 y_6 \right)s\\ 
+\\
+J_{33}= &  \displaystyle 
+\frac{1}{4}\left( -z_1+z_2-z_4+z_5 \right) r
++ \frac{\sqrt{3}}{12} \left( -z_1-z_2+ 2 z_3- z_4- z_5+2 z_6 \right)s\\ 
+\\
+\end{array}
+\end{equation*}
+\\
+Now, we have all the tools to calculate the integrals over the reference element instead of the element itself.
+Since $ISSM$ is a Matlab code, the integrals cannot be calculated directly. The numerical integration uses a gaussian quadrature to approximate the integral as a weighted sum of function values at specified points (gaussian points) within the domain:
+
+\begin{equation}
+\iiint_E f(x,y,z)dV = \iint_{\hat{E}} \hat{f}(r,s,\zeta) \vert J\vert d\hat{V} \simeq \sum_{g=1}^{n} W_g \hat{f}(r_g,s_g,\zeta_g)
+\end{equation}
+\\
+where $W_i$ are the quadrature rules weights and $(r_g,s_g,\zeta_g)$ are the evaluation points, $g=1,2...,n$. The integration points are given with their area coordinates: 
+
+\begin{equation}
+\displaystyle (r_g,s_g,\zeta_g)\equiv (\frac{A_1}{A},\frac{A_2}{A},\frac{A_3}{A},\zeta_g)
+\end{equation}
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=9cm]{barycentric_penta.png} 
+\caption{Area coordinates}
+\end{center}
+\end{figure}
+
+The number of gaussian points depends on the order of integration. The order of integration can be computed from the polynomial degree $p$ that needs to be integrated. The formula is:
+
+\begin{equation}
+order=\frac{p+1}{2}
+\end{equation}
+\\
+Here, the degree of the polynome under the integral is $2$ (the drag implies the calculation of $\phi_j \phi_i$ whose degree is 2). The order of integration is hence 2 (the order must be an integer). For this order, $6$ gaussian points are required (See in $ISSM$ code $GaussPenta.m$ for more details).
+
+\newpage
+ \subsection{Elementary stiffness matrix}
+To compute the elementary stiffness matrix, we first remove the basal drag, that will create a first elementary stiffness matrix $K1$, the basal drag will constitute another stiffness matrix $K2$. The elementary stiffness matrix will be the sum of $K1$ and $K2$ ($K_E=K1+K2$).
+
+        \subsubsection{Without basal drag}
+
+This matrix has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+K1_{2i-1,2j-1}= 
+\iiint_E  %triple
+  \left( 4 \mu \frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_i}{\partial x} 
+  + \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial y}
+  + \mu \frac{\partial \phi_{j}}{\partial z} \frac{\partial \phi_i}{\partial z}\right)d\Omega\\
+
+\\
+
+\displaystyle
+K1_{2i-1,2j}= 
+\iiint_E  %triple
+\left( 2 \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial x} + 
+\mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial y} \right) d\Omega \\
+
+\\
+
+\displaystyle
+K1_{2i,2j-1}= 
+\iiint_E  %triple
+  \left( 2 \mu \frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_i}{\partial y} 
+  + \mu \frac{\partial \phi_{j}}{\partial y} \frac{\partial \phi_i}{\partial x} \right)  d\Omega\\
+  
+\\
+
+\displaystyle
+K1_{2i,2j}= 
+\iiint_E  %triple
+\left( 4 \mu \frac{\partial \phi_{j}}{\partial y}\frac{\partial \phi_i }{\partial y} + 
+\mu\frac{\partial \phi_{j}}{\partial x} \frac{\partial \phi_{i}}{\partial x} 
++ \mu\frac{\partial \phi_{j}}{\partial z} \frac{\partial \phi_{i}}{\partial z} \right)  d\Omega \\
+\end{array}
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this matrix becomes:
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\medskip
+\begin{equation*}
+\begin{array}{c l}
+\displaystyle
+K1_{2i-1,2j-1} & \displaystyle = 
+\iiint_{\hat{E}}  %triple
+  \left( 4  \mu \frac{\partial L_{j}}{\partial \varphi_x} \frac{\partial L_i}{\partial \varphi_x} 
+  +  \mu \frac{\partial L_{j}}{\partial \varphi_y} \frac{\partial L_i}{\partial \varphi_y}
+  +  \mu \frac{\partial L_{j}}{\partial \varphi_z} \frac{\partial L_i}{\partial \varphi_z} \right) \vert J \vert d\hat{V} \\
+  \\
+& \displaystyle \simeq
+\sum_{g=1}^6  W_g \left( 4  \mu \left.\frac{\partial L_{j}}{\partial \varphi_x}\right|_g \left.\frac{\partial L_i}{\partial \varphi_x} \right|_g
+  +  \mu \left.\frac{\partial L_{j}}{\partial \varphi_y}\right| _g \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g
+  +  \mu \left.\frac{\partial L_{j}}{\partial \varphi_z} \right|_g \left. \frac{\partial L_i}{\partial \varphi_z}\right|_g \right) \vert J_g \vert \\
+
+\\
+
+\displaystyle
+K1_{2i-1,2j} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 2  \mu \frac{\partial L_{j}}{\partial \varphi_y}\frac{\partial L_i }{\partial \varphi_x} + 
+ \mu\frac{\partial L_{j}}{\partial \varphi_x} \frac{\partial L_{i}}{\partial \varphi_y} \right) \vert J \vert d\hat{V} \\
+\\
+& \displaystyle \simeq
+\sum_{g=1}^6  W_g 
+\left( 2  \mu \left. \frac{\partial L_{j}}{\partial \varphi_y}\right|_g \left. \frac{\partial L_i }{\partial \varphi_x}\right|_g + 
+ \mu\left.\frac{\partial L_{j}}{\partial \varphi_x}\right|_g \left. \frac{\partial L_{i}}{\partial \varphi_y} \right|_g \right) \vert J_g \vert\\
+\\
+
+\\
+
+\displaystyle
+K1_{2i,2j-1} & \displaystyle = 
+\iiint_{\hat{E}}  %triple
+  \left( 2  \mu \frac{\partial L_{j}}{\partial \varphi_x} \frac{\partial L_i}{\partial \varphi_y} 
+  +  \mu \frac{\partial L_{j}}{\partial \varphi_y} \frac{\partial L_i}{\partial \varphi_x} \right)  \vert J \vert d\hat{V} \\
+  \\
+& \displaystyle \simeq
+\sum_{g=1}^6  W_g 
+\left( 2  \mu \left.\frac{\partial L_{j}}{\partial \varphi_x}\right|_g \left. \frac{\partial L_i}{\partial \varphi_y} \right|_g
+  +  \mu \left.\frac{\partial L_{j}}{\partial \varphi_y}\right|_g \left. \frac{\partial L_i}{\partial \varphi_x}\right|_g \right) \vert J_g \vert\\
+\\
+
+\\
+
+\displaystyle
+K1_{2i,2j} & \displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 4  \mu \frac{\partial L_{j}}{\partial \varphi_y}\frac{\partial L_i }{\partial \varphi_y} + 
+ \mu\frac{\partial L_{j}}{\partial \varphi_x} \frac{\partial L_{i}}{\partial \varphi_x} 
++  \mu\frac{\partial L_{j}}{\partial \varphi_z} \frac{\partial L_{i}}{\partial \varphi_z} \right)  \vert J \vert d\hat{V} \\
+\\
+& \displaystyle \simeq
+\sum_{g=1}^6  W_g 
+\left( 4  \mu \left.\frac{\partial L_{j}}{\partial \varphi_y}\right|_g \left.\frac{\partial L_i }{\partial \varphi_y}\right|_g + 
+ \mu\left.\frac{\partial L_{j}}{\partial \varphi_x}\right|_g \left. \frac{\partial L_{i}}{\partial \varphi_x}\right|_g 
++  \mu\left.\frac{\partial L_{j}}{\partial \varphi_z}\right|_g \left. \frac{\partial L_{i}}{\partial \varphi_z}\right|_g \right) \vert J_g \vert\\
+\\
+\end{array}
+\end{equation*}
+\\
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K1= \sum_{g=1}^6 [B]^T[D][B']$ as follows:
+
+\begin{equation}
+[B]=\left[\begin{array}{c c c c c c}
+B_1 & B_2 & B_3 & B_4 & B_5 & B_6
+\end{array}\right]
+\quad and \quad
+[B']=\left[\begin{array}{c c c c c c}
+B'_1 & B'_2 & B'_3 & B'_4 & B'_5 & B'_6
+\end{array}\right]
+\end{equation}
+\\
+with:
+
+\begin{equation}
+[B_i]=
+\left[
+\begin{array}{c c}
+\displaystyle 
+\left. \frac{\partial L_i}{\partial \varphi_x}\right|_g & 0\\
+\\
+\displaystyle 
+0 &\displaystyle   \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g \\
+\\
+\displaystyle 
+\frac{1}{2} \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g & \displaystyle \frac{1}{2} \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g \\
+\\
+\displaystyle 
+\frac{1}{2} \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g & 0\\
+\\
+\displaystyle 
+0 & \displaystyle \frac{1}{2} \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g \\
+\end{array}
+\right]\\
+\quad \quad
+[B'_i]=
+\left[
+\begin{array}{c c}
+\displaystyle 
+2 \left.\frac{\partial L_i}{\partial \varphi_x} \right|_g & \displaystyle  \left. \frac{\partial L_i}{\partial \varphi_y} \right|_g\\
+\\
+\displaystyle   \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g &  \displaystyle  2\left.\frac{\partial L_i}{\partial \varphi_y}\right|_g \\
+  \\
+\displaystyle   \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g &  \displaystyle  \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g\\  
+ \\
+\displaystyle   \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g &  0 \\  
+
+\displaystyle   0 &  \displaystyle  \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g \\  
+\end{array}
+\right]\\
+\end{equation}
+\\
+and $D=W_g 2 \mu \vert J_g \vert \left[I_5\right] $ 
+\\
+ \\
+\emph{NB:} in $ISSM$ code, the factor $2$ in the $D$ matrix does not exist since the constitutive relation used is $\sigma'=\mu\varepsilon$ instead of $\sigma'=2\mu\varepsilon$. This changes the viscosity definition that must be multiplied by $2$.      
+               \subsubsection{Basal drag}
+Basal drag get involved only for the nods on the ice/bedrock interface. Thus, only surface integrals are required. The elements are triangles and there are only 3 nodal functions to take into account. Therefore, the stiffness matrix that stands for basal drag is $6 \times 6$.\\
+The basal drag matrix has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 3$ and  $1 \leq j \leq 3$ 
+\end{center}
+\medskip
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+K_{2i-1,2j-1}= 
+\iint_{E\cap \Gamma_b}  %double
+ \alpha^2 \phi_j \phi_i  dS\\
+\\
+\displaystyle
+K_{2i-1,2j}= 0\\
+\\
+\displaystyle
+K_{2i,2j-1}= 0\\
+\\
+\displaystyle
+K_{2i,2j}= 
+\iint_{E \cap \Gamma_b}  %double
+\alpha^2 \phi_j \phi_i dS \\
+\end{array}
+\end{equation}
+\\        
+This time, the reference element are triangles, as in MacAyeal's model. Using the reference element $\hat{E}$ and the gaussian points, this matrix become:
+        
+        \begin{equation}
+\begin{array}{l l l}
+\displaystyle
+K_{2i-1,2j-1} & = 
+\displaystyle \iint_{\hat{E}\cap \hat{\Gamma_b}}  %double
+\alpha^2 L_j(r,s) L_i(r,s)   \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g \alpha^2 L_j(r_g,s_g) L_i(r_g,s_g)   \vert J_g \vert
+ \\
+\\
+\displaystyle
+K_{2i-1,2j} & = 0 &\\
+\\
+\displaystyle
+K_{2i,2j-1} & = 0 &\\
+\\
+\displaystyle
+K_{2i,2j} & = 
+\displaystyle \iint_{\hat{E}\cap \hat{\Gamma_b}}  %double
+\alpha^2 L_j(r,s) L_i(r,s)  \vert J \vert d\hat{S} &
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g \alpha^2 L_j(r_g,s_g) L_i(r_g,s_g)   \vert J_g \vert 
+ \\
+ \\
+\end{array}
+\end{equation}
+\\     
+This matrix is calculated with three matrices: $\displaystyle K1=\sum_{g=1}^3 [L]^T[D_{drag}][L]$ as follows:
+\begin{equation}
+[L]=
+\left[
+\begin{array}{c c c c c c c}
+\displaystyle 
+L_1(r_g,s_g) & 0 & L_2(r_g,s_g) & 0 &  L_3(r_g,s_g) & 0 \\
+\\
+0 & L_1(r_g,s_g) & 0 & L_2(r_g,s_g) &  0 & L_3(r_g,s_g) \\
+\end{array}
+\right]
+\end{equation}
+and $\left[D_{drag} \right]=W_g \alpha^2  \vert J_g \vert \left[ I_{6} \right]$
+
+
+ \subsection{Elementary load vector}
+To compute the elementary load vector, we first calculate the force due to the driving stress only, the water pressure only, and we then add these two terms.
+
+			\subsubsection{Driving stress}
+
+The elementary load vector due to driving stress has the following shape:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+F1_{2i-1}= -
+\iiint_{E} %triple
+\rho g \frac{\partial s}{\partial x}\phi_i d\Omega\\
+
+\\
+
+\displaystyle
+ F1_{2i}= -
+\iiint_E %triple
+\rho g \frac{\partial s}{\partial y}\phi_i d\Omega \\
+\end{array}
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector become:
+
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+F1_{2i-1}= -
+\iiint_{\hat{E}} %triple
+\rho g \frac{\partial s}{\partial x}L_i(r,s,\zeta) \vert J \vert d\hat{\Omega}
+&
+\displaystyle \simeq
+\sum_{g=1}^6
+ - W_g \rho g \frac{\partial s}{\partial x} L_i(r_g,s_g,\zeta_g)   \vert J_g \vert \\
+\\
+\displaystyle
+F1_{2i}= -
+\iiint_{\hat{E}} %triple
+\rho g \frac{\partial s}{\partial y}L_i(r,s,\zeta) \vert J \vert d\hat{\Omega}
+&
+\displaystyle \simeq
+\sum_{g=1}^6
+ - W_g \rho g \frac{\partial s}{\partial y} L_i(r_g,s_g,\zeta_g)   \vert J_g \vert \\
+\end{array}
+\end{equation}
+
+			\subsubsection{Ice front}
+The load on the ice front involves only the nodes on the ice/sea interface. As with basal drag, only surface integrals are required. The elements are quadrangle (See section\ref{RE2D2}). The load on the ice front have the following shape:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+F2_{2i-1}=\iint_{E \cap \Gamma_i} F_i n_x\phi_i dS\\
+\\
+\displaystyle
+F2_{2i}=\iint_{E \cap\Gamma_i} F_i n_y\phi_i dS\\
+\end{array}
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector become:
+
+\begin{equation}
+\begin{array}{l l l}
+\displaystyle
+F2_{2i-1} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_i}} \hat{F_i} n_x L_i \vert J \vert  d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^4
+W_g \left( \rho_i g\left(s-z \right)+\rho_w g \min\left( 0,z\right)     \right)n_x L_i(r_g,s_g,\zeta_g) \vert J_g \vert \\
+\\
+\displaystyle
+F2_{2i} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_i}} \hat{F_i} n_y L_i \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^4
+W_g \left( \rho_i  g\left(s-z \right)+\rho_w g \min\left( 0,z\right)     \right)n_y L_i(r_g,s_g,\zeta_g) \vert J_g \vert \\
+\end{array}
+\end{equation}
+
+			\subsubsection{Ice/water interface}
+The load on the ice/water interface involves only the nodes at the base on the iceshelf. As with basal drag and ice front, only surface integrals are required. The elements are triangles. The load on the ice shelf base have the following shape:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+F3_{2i-1}=\iint_{E \cap \Gamma_w} F_w n_x\phi_i dS\\
+\\
+\displaystyle
+F3_{2i}=\iint_{E \cap\Gamma_w} F_w n_y\phi_i dS\\
+\end{array}
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector become:
+
+\begin{equation}
+\begin{array}{l l l}
+\displaystyle
+F3_{2i-1} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_w}} \hat{F_w} n_x L_i \vert J \vert  d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g g\left( \rho_i h(r_g,s_g) + \rho_w b(r_g,s_g)     \right)n_x L_i(r_g,s_g) \vert J_g \vert \\
+\\
+\displaystyle
+F3_{2i} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_w}} \hat{F_w} n_y L_i \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g g\left( \rho_i h(r_g,s_g) + \rho_w b(r_g,s_g)     \right)n_y L_i(r_g,s_g) \vert J_g \vert \\
+\end{array}
+\end{equation}
+
+\newpage
+\section{Vertical Velocity computation}
+        \subsection{Equations}
+        
+In the first chapter, we saw that we used the incompressibility to calculate the vertical component of the velocity:
+
+\begin{equation}
+\dfrac{\partial w}{\partial z}=-\dfrac{\partial u}{\partial x}-\dfrac{\partial v}{\partial y}
+\label{verticalequation}
+\end{equation}
+\\
+The boundary condition on the lower surface is $w=w_b$ with (see (\ref{basalvelocity})):
+
+\begin{equation}
+w_b = u \frac{\partial b}{\partial x}+v \frac{\partial b}{\partial y} - \frac{\rho_w }{\rho_i } \left( - div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right) \right)
+\end{equation}
+
+
+				\subsection{Basal velocity formulation}
+
+						\subsubsection{Basal velocity weak formulation}
+As usual, We define a kinematically admissible velocity field $\phi$:
+
+\begin{equation}
+\phi(x,y,z)\in\lbrace H^{1}(\Omega\cup\partial\Omega) \rbrace
+\end{equation}
+\\									
+If one integrates the product of the equation (\ref{verticalequation}) by a kinematically admissible velocity field:						
+\begin{equation}
+\begin{array}{r c l}
+\displaystyle \iint_{\Gamma_b\cup\Gamma_w} w_b \phi d\Gamma &
+= &
+\displaystyle \iint_{\Gamma_b\cup\Gamma_w} u \frac{\partial b}{\partial x} \phi +v \frac{\partial b}{\partial y} \phi d\Gamma
++\iint_{\Gamma_b} -\dot{M_b} \phi d\Gamma \\
+\\
+&&
+\displaystyle +\iint_{\Gamma_w} - \frac{\rho_w }{\rho_i } \left( - div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right) \right) \phi  - \frac{\rho_w }{\rho_i } \dot{M_a} \phi +\left( \frac{\rho_w }{\rho_i } -1\right)  \dot{M_b} \phi d\Gamma
+\end{array}
+\end{equation}
+
+						\subsubsection{Elementary stiffness matrix and load vector}
+Following the same method as in the previous situations, we obtain the stiffness matrix as follows:
+
+\begin{equation}
+\begin{array}{l c l}
+\displaystyle K_{i,j} &\displaystyle = &
+\displaystyle \iint_{\Gamma_b\cup\Gamma_w} \phi_j \phi_i d\Gamma \\ 
+\\
+F_{i} &\displaystyle = & 
+\displaystyle \iint_{\Gamma_b\cup\Gamma_w} u \frac{\partial b}{\partial x} \phi_i +v \frac{\partial b}{\partial y} \phi_i d\Gamma
++\iint_{\Gamma_b} -\dot{M_b} \phi_i d\Gamma \\
+\\
+&& \displaystyle 
++\iint_{\Gamma_w} - \frac{\rho_w }{\rho_i } \left( - div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right) \right) \phi_i - \frac{\rho_w }{\rho_i } \dot{M_a} \phi_i +\left( \frac{\rho_w }{\rho_i } -1\right)  \dot{M_b} \phi_i d\Gamma
+\end{array}
+\end{equation}
+We now decompose these two matrices over the reference elements and use gaussian points for the integration :
+
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+\begin{array}{c l}
+\displaystyle
+K_{i,j} & \displaystyle = 
+\iint_{\hat{E}} L_j  L_i \vert J \vert d\hat{\Gamma}\\
+\\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g L_j(g) L_i(g) \vert J_g \vert 
+\end{array}
+\end{equation}
+\\
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K1= \sum_{g=1}^3 [B]^T[D][B]$ as follows:
+
+\begin{equation}
+[B]=\left[\begin{array}{c c c}
+B_1 & B_2 & B_3 
+\end{array}\right] \quad \text{and} \quad D=W_g \vert J_g \vert
+\end{equation}
+with:
+\begin{equation}
+B_i= L_i(g )
+\end{equation}\\
+
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\medskip
+\begin{equation}
+\begin{array}{l c l}
+\displaystyle
+F_{i} & \displaystyle = & \displaystyle
+\iint_{\hat{E}} u \frac{\partial b}{\partial x} L_i +v \frac{\partial b}{\partial y} L_i \vert J \vert d\hat{\Gamma}
++\iint_{\hat{E}\cap\Gamma_b} -\dot{M_b} L_i \vert J \vert d\Gamma \\
+\\
+&& \displaystyle 
++\iint_{\hat{E}\cap\Gamma_w} - \frac{\rho_w }{\rho_i } \left( - div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right) \right) L_i - \frac{\rho_w }{\rho_i } \dot{M_a} L_i +\left( \frac{\rho_w }{\rho_i } -1\right)  \dot{M_b} L_i  \vert J \vert d\Gamma\\
+\\
+& \displaystyle \simeq & \displaystyle
+\sum_{g=1}^3 u \frac{\partial b}{\partial x} L_i(g) +v \frac{\partial b}{\partial y} L_i (g) \vert J_g \vert 
++\underbrace{\sum_{g=1}^3 -\dot{M_b} L_i(g) \vert J_g \vert)}_{\text{ice shelf}}\\
+\\
+&& \displaystyle 
++\sum_{g=1}^3 - \frac{\rho_w }{\rho_i } \left( - div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right]\right) \right) L_i(g) - \frac{\rho_w }{\rho_i } \dot{M_a} L_i(g) +\underbrace{\left( \frac{\rho_w }{\rho_i } -1\right)  \dot{M_b} L_i(g)  \vert J_g \vert}_{\text{ice sheet}}
+\end{array}
+\end{equation}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        \subsection{Vertical velocity weak formulation}
+As usual, We define a kinematically admissible velocity field $\phi$:
+
+\begin{equation}
+\phi(x,y,z)\in\lbrace H^{1}(\Omega\cup\partial\Omega) \quad \backslash\quad \phi(x,y,z)=0\qquad (x,y,z)\in \Gamma_b \rbrace
+\end{equation}
+\\
+If one integrates the product of the equation (\ref{verticalequation}) by a kinematically admissible velocity field: 
+
+\begin{equation}
+\iiint_\Omega \dfrac{\partial w}{\partial z}\phi d\Omega 
+=
+- \iiint_\Omega 
+\dfrac{\partial u}{\partial x}\phi + \dfrac{\partial v}{\partial y}\phi d\Omega
+\end{equation}
+\\
+One can integrate by parts the left handside of the previous equation:
+
+\begin{equation}
+\iiint_\Omega w \dfrac{\partial \phi}{\partial z} d\Omega 
+=
+\iiint_\Omega 
+\dfrac{\partial u}{\partial x}\phi + \dfrac{\partial v}{\partial y}\phi d\Omega +
+\iiint_{\partial\Omega }
+w\phi n_z dS
+\end{equation}
+\\
+Where $\overrightarrow{n}=( n_x, n_y, n_z)$ is the unit normal vector pointing outward from the glacier. Since we work on a vertically extruded mesh, $n_z$ is equal to zero except on the upper and lower surface $\Gamma_b \cup \Gamma_s$. The function $\phi$ is cinematically admissible and is hence equal to zero on the lower surface $\Gamma_b$:
+
+\begin{equation}
+\iiint_\Omega w \dfrac{\partial \phi}{\partial z} d\Omega 
+=
+\iiint_\Omega 
+\dfrac{\partial u}{\partial x}\phi + \dfrac{\partial v}{\partial y}\phi d\Omega +
+\iint_{\Gamma_s}
+w\phi n_z dS
+\end{equation}
+\\
+The term $\displaystyle \iint_{ \Gamma_s} w\phi n_z dS$ is unknown. Therefore, we put it in the left handside of the weak formulation:
+
+\begin{equation}
+\iiint_\Omega w \dfrac{\partial \phi}{\partial z} d\Omega 
+-
+\iint_{\Gamma_s}
+w\phi n_z dS
+=
+\iiint_\Omega 
+\dfrac{\partial u}{\partial x}\phi + \dfrac{\partial v}{\partial y}\phi d\Omega
+\end{equation}
+
+        \subsection{Finite element discretisation, Galerkin method}
+The domain is meshed using pentahedrons. There are a $nel$ elements and $nods$ grids. We use the nodal functions of each grid, which are continuous on the domain and affine on each element.
+We now project the unknown $w$ on the nodal functions:
+\begin{center}
+ $(\phi_i)_{1\leq i\leq nods}$
+\end{center}
+\begin{equation}
+w\left( x,y,z\right) = \sum_{i=1}^{nods}w_{i}\phi_{i}\left( x,y,z\right) \\
+\end{equation}
+\\
+We build a vector $W$ that holds all the unknows of the velocity field:
+
+\begin{equation}
+U=\left[ \begin{array}{c}
+w_{1}\\
+...\\
+w_{nods}
+  \end{array} \right]
+\end{equation}
+\\
+With this new field, we  replace the component of the virtual function $\phi$ by the nodal functions:
+\begin{center}
+ $\forall 1 \leq i \leq nods$
+\end{center}
+\begin{equation}
+\sum_{j=1}^{nods} 
+\iiint_\Omega w_j \phi_j \dfrac{\partial \phi_i}{\partial z} d\Omega 
+-
+\iint_{\Gamma_s}
+w_j \phi_j\phi_i n_z dS
+=
+\iiint_\Omega 
+\dfrac{\partial u}{\partial x}\phi_i + \dfrac{\partial v}{\partial y}\phi_i d\Omega
+\end{equation}
+\\
+We see the stiffness matrix $K$ and load vector $F$ appearing, so that the previous equations can be written as a system matrix :
+
+\begin{equation}
+\left[ K \right] W =F 
+\end{equation} 
+\\
+We use the following index:
+
+\begin{equation}
+\left[
+\begin{array}{c c c} %K
+  & \vdots  &\\
+ \cdots & K & \cdots\\
+  & \vdots  &\\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+w_j\\
+\vdots\\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %F
+\vdots \\
+F_{j}\\
+\vdots\\
+\end{array}
+\right]
+\end{equation}
+\\
+And  we have the following expressions for the stiffness matrix and the load vector :
+
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+
+K_{i,j} &\displaystyle = 
+\iiint_\Omega \phi_j \dfrac{\partial \phi_i}{\partial z} d\Omega 
+-
+\iint_{\Gamma_s}
+\phi_j \phi_i n_z dS\\
+\\
+F_{i} &\displaystyle = 
+\iiint_\Omega 
+\dfrac{\partial u}{\partial x}\phi_i + \dfrac{\partial v}{\partial y}\phi_i d\Omega
+\end{array}
+\end{equation}
+
+
+ \subsection{Elementary stiffness matrix}
+To compute the elementary stiffness matrix, we first remove the integral over the upper surface, that will create a first elementary stiffness matrix $K1$, the upper surface integral will constitute another stiffness matrix $K2$. The elementary stiffness matrix will be the sum of $K1$ and $K2$ ($K_E=K1+K2$).
+
+        \subsubsection{Without the upper surface}
+
+This matrix has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+\displaystyle
+K1_{i,j}= 
+\iiint_E \phi_j \dfrac{\partial \phi_i}{\partial z} dV
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this matrix becomes:
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\medskip
+\begin{equation}
+\begin{array}{c l}
+\displaystyle
+K1_{i,j} & \displaystyle = 
+\iiint_{\hat{E}} L_j \dfrac{\partial L_i}{\partial \varphi_z} \vert J \vert d\hat{V}\\
+\\
+& \displaystyle \simeq
+\sum_{g=1}^6  W_g L_j(g) \left.\dfrac{\partial L_i}{\partial \varphi_z}\right| _g \vert J_g \vert 
+\end{array}
+\end{equation}
+\\
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K1= \sum_{g=1}^6 [B]^T[D][B']$ as follows:
+
+\begin{equation}
+[B]=\left[\begin{array}{c c c c c c}
+B_1 & B_2 & B_3 & B_4 & B_5 & B_6
+\end{array}\right]
+\quad \text{and} \quad
+[B']=\left[\begin{array}{c c c c c c}
+B'_1 & B'_2 & B'_3 & B'_4 & B'_5 & B'_6
+\end{array}\right]
+\end{equation}
+with:
+\begin{equation}
+B_i= \left.\dfrac{\partial L_i}{\partial \varphi_z}\right| _g 
+\quad \quad
+B'_i= L_i(g)
+\end{equation}
+\\
+and $D=W_g \vert J_g \vert$ 
+
+        \subsubsection{Upper surface integral}
+The upper surface involves only the three upper nods on the top of the upper pentahedrons of the mesh (which are the last three grids of the pentahedron grids lists). The elements are triangles and there are only 3 nodal functions to take into account. Therefore, this stiffness matrix is $3 \times 3$.\\
+The basal drag matrix has the following shape:
+
+\begin{center}
+ $4 \leq i \leq 6$ and  $4 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+\displaystyle
+K2_{i,j}= 
+-
+\iint_{E\cup\Gamma_s}
+\phi_j \phi_i n_z dS
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this matrix becomes:
+\begin{center}
+ $4 \leq i \leq 6$ and  $4 \leq j \leq 6$ 
+\end{center}
+\medskip
+\begin{equation}
+\begin{array}{c l}
+\displaystyle
+K2_{i,j} & \displaystyle = 
+-\iiint_{\hat{E}\cup \Gamma_s} L_j(g)Li(g) \vert J \vert d\hat{S}\\
+\\
+& \displaystyle \simeq
+-\sum_{g=1}^6  W_g L_j(g)L_i(g) \vert J_g \vert 
+\end{array}
+\end{equation}
+\\
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K1= \sum_{g=1}^6 [L]^T[D][L]$ as follows:
+
+\begin{equation}
+[L]=\left[\begin{array}{c c c}
+L_4 & L_5 & L_6
+\end{array}\right]
+\end{equation}
+\\
+with:
+
+\begin{equation}
+L_i= Li(g)
+\end{equation}
+\\
+and $D=-W_g \vert J_g \vert$ 
+
+ \subsection{Elementary load vector}
+The elementary load vector has the following shape:
+
+\begin{equation}
+F_{i} = 
+\iiint_E  \dfrac{\partial}{\partial x}\left( \sum_{k=1}^6 u_k \phi_k \right) \phi_i + \dfrac{\partial}{\partial y}\left( \sum_{k=1}^6 v_k \phi_k \right)\phi_i dV
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this matrix becomes:
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\medskip
+\begin{equation}
+\begin{array}{c l}
+\displaystyle
+F_{i} & \displaystyle = 
+\iiint_{\hat{E}}  \dfrac{\partial}{\partial \varphi_x}\left( \sum_{k=1}^6 u_k L_k \right)L_i 
++ \dfrac{\partial}{\partial \varphi_y} \left( \sum_{k=1}^6 v_k L_k \right)L_i d\hat{V}
+\\
+& \displaystyle \simeq
+\sum_{g=1}^6 \left(  \left.\dfrac{\partial}{\partial \varphi_x}\left( \sum_{k=1}^6 u_k L_k \right)\right| _gL_i(g) 
++ \left.\dfrac{\partial}{\partial \varphi_y} \left( \sum_{k=1}^6 v_k L_k \right)\right| _g L_i(g)\right) \vert J_g \vert 
+\end{array}
+\end{equation}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+\newpage
+   \section{Full Stokes Model}
+   \label{stokessection}
+
+    \subsection{Geometry and notations}
+ 
+The geometry is exactly the same as in Pattyn's model.
+        \subsection{Equations}
+        
+In the first chapter, we had:
+
+\begin{equation}
+\begin{array}{c}
+ \left\{ \begin{array}{l}
+\displaystyle                \frac{\partial}{\partial x} \left(  2 \mu \frac{\partial u}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial u}{\partial z} +\mu \frac{\partial w}{\partial x} \right)
+-\frac{\partial P}{\partial x}=0\\
+\\
+\displaystyle               \frac{\partial}{\partial x} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  2 \mu \frac{\partial v}{\partial y} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial v}{\partial z} +\mu \frac{\partial w}{\partial y} \right)
+-\frac{\partial P}{\partial y}=0\\            
+\\
+\displaystyle               \frac{\partial}{\partial x} \left(  \mu \frac{\partial u}{\partial z} +\mu \frac{\partial w}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  \mu \frac{\partial v}{\partial z} +\mu \frac{\partial w}{\partial y} \right)
++\frac{\partial}{\partial z} \left(  2 \mu \frac{\partial w}{\partial z} \right)
+-\frac{\partial P}{\partial z} - \rho g=0\\     
+                 \end{array} \right.
+                 \\
+                 \\
+\displaystyle \frac{\partial u}{\partial x}+\frac{\partial v}{\partial y}+\frac{\partial w}{\partial z}=0
+\end{array}
+\end{equation}
+\\
+The boundary conditions are:
+ a dynamic boundary condition (Neumann) at the ice front, a friction law on the ice sheet, and single point constraint (Dirichlet) on the other borders of the domain $\Omega$.
+Exactly as in Pattyn's formulation, it is more convenient to consider these specified velocities as nill. For the vertical basal velocity, we use a multiple points constraint. This process, similar to a pemalty method, is explained in section \ref{stokespenaltiessection}.
+
+\begin{equation}
+\left\{ \begin{array}{l l}
+\text{Ice Front } \Gamma_i: & \displaystyle \sigma \overrightarrow{n} = F_i \overrightarrow{n}= \rho_w g \min\left( 0,z\right)  \overrightarrow{n}\\
+\\
+\text{Upper surface } \Gamma_s: & \sigma \left(  \overrightarrow{n}\right) =0\\
+\\
+\text{Ice sheet base } \Gamma_b: & \left( \sigma \left(  \overrightarrow{n}\right)\right)_x  + p\;n_x= -K^2 N_{eff}^r \|\overrightarrow{v} \|^{s-1} u =-\alpha^2 u \\
+\\
+& \left( \sigma \left(  \overrightarrow{n}\right)\right)_y  + p\;n_y= -K^2 N_{eff}^r \|\overrightarrow{v} \|^{s-1} v =-\alpha^2 v \\
+\\
+& \displaystyle w=0\\
+\\ 
+\text{Ice shelf base } \Gamma_w: &  \sigma \overrightarrow{n} = F_w \overrightarrow{n}= \rho_w g b(x,y)  \overrightarrow{n}\\
+\\ 
+\text{Other  borders } \Gamma_u: & u=v=w=0\\
+\end{array} \right.
+\end{equation}
+
+        \subsection{Weak Formulation}
+
+we  write the weak formulation to solve these equations
+using finite element method. We define a kinematically admissible velocity field $\overrightarrow{\phi}$ and pressure field $P^*$ such that:
+
+\begin{equation}
+\overrightarrow{\phi}(x,y,z)\in\lbrace \left( H^{1}(\Omega\cup\partial\Omega) \right)^3 \quad \backslash\quad \overrightarrow{\phi}(x,y,z)=0\qquad (x,y,z)\in\Gamma_u\rbrace
+\end{equation}
+\begin{equation}
+P^*(x,y,z)\in H^{1}(\Omega\cup\partial\Omega)
+\end{equation}
+\\
+For any function of these virtual fields, one can take the scalar product of the equations with $\overrightarrow{\phi}=\left(\phi_x,0 ,0\right) $,  $\overrightarrow{\phi}=\left(0,\phi_y,0 \right) $ and $\overrightarrow{\phi}=\left(0,0,\phi_z \right) $ that are 3 other kinematically admissible velocity fields. One can also multiply the last equation by the virtual pressure field and integrate this product over the domain. This gives us:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle \iiint_\Omega %double
+\left[
+\frac{\partial}{\partial x} \left(  2 \mu \frac{\partial u}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial u}{\partial z} +\mu \frac{\partial w}{\partial x} \right)
+-\frac{\partial P}{\partial x}
+\right] \phi_x  d\Omega =0
+\\
+\\
+\displaystyle \iiint_\Omega %double
+\left[
+\frac{\partial}{\partial x} \left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  2 \mu \frac{\partial v}{\partial y} \right)
++\frac{\partial}{\partial z} \left(  \mu \frac{\partial v}{\partial z} +\mu \frac{\partial w}{\partial y} \right)
+-\frac{\partial P}{\partial y}
+\right] \phi_y  d\Omega =0
+\\
+\\
+\displaystyle \iiint_\Omega %double
+\left[
+\frac{\partial}{\partial x} \left(  \mu \frac{\partial u}{\partial z} +\mu \frac{\partial w}{\partial x} \right)
++\frac{\partial}{\partial y} \left(  \mu \frac{\partial v}{\partial z} +\mu \frac{\partial w}{\partial y} \right)
++\frac{\partial}{\partial z} \left(  2 \mu \frac{\partial w}{\partial z} \right)
+-\frac{\partial P}{\partial z} - \rho g
+\right] \phi_z  d\Omega =0
+\\
+\\
+\displaystyle \iiint_\Omega %double
+\left[
+-\frac{\partial u}{\partial x}-\frac{\partial v}{\partial y}-\frac{\partial w}{\partial z}
+\right] P^*  d\Omega =0
+\end{array}
+\end{equation}
+\\
+\emph{NB}: We change the sign of the incompressibility equation because otherwise the stiffness matrix wouldn't be symmetric.\\
+One intergrates by parts the first three equations in order to merge in the force on the ice front $\Gamma_i$ and the basal friction $\Gamma_b$:
+
+\begin{multline}
+\iiint_\Omega  %double
+\left[
+ \left(  2 \mu \frac{\partial u}{\partial x} \right)\frac{\partial \phi_x}{\partial x}
++\left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)\frac{\partial \phi_x}{\partial y} 
++\left(  \mu \frac{\partial u}{\partial z} +\mu \frac{\partial w}{\partial x} \right)\frac{\partial \phi_x}{\partial z} 
+-P\frac{\partial \phi_x}{\partial x}
+\right]   d\Omega
+\\
+ =
+\iint_{\Gamma_i\cup\Gamma_b} F n_x\phi_x d\Gamma
+\end{multline}
+\begin{multline}
+\iiint_\Omega %double
+\left[
+\left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)\frac{\partial \phi_y  }{\partial x} 
++\left(  2 \mu \frac{\partial v}{\partial y} \right)\frac{\partial \phi_y  }{\partial y} 
++ \left(  \mu \frac{\partial v}{\partial z} +\mu \frac{\partial w}{\partial y} \right)\frac{\partial \phi_y  }{\partial z}
+-P \frac{\partial \phi_y  }{\partial y}
+\right]d\Omega
+\\
+ =
+\iint_{\Gamma_i\cup\Gamma_b} F n_y\phi_y d\Gamma
+\end{multline}
+\begin{multline}
+\iiint_\Omega %double
+\left[
+\left(  \mu \frac{\partial u}{\partial z} +\mu \frac{\partial w}{\partial x} \right)\frac{\partial \phi_z  }{\partial x} 
++\left(  \mu \frac{\partial v}{\partial z} +\mu \frac{\partial w}{\partial y} \right)\frac{\partial \phi_z  }{\partial y} 
++\left(  2 \mu \frac{\partial w}{\partial z} \right)\frac{\partial \phi_z  }{\partial z} 
+-P\frac{\partial \phi_z   }{\partial z}
+\right]d\Omega 
+\\
+=
+\iint_{\Gamma_i} F n_z\phi_z d\Gamma
+-\iiint_\Omega %double
+\rho g \phi_z d\Omega
+\end{multline}
+\\
+It is easier to put the basal friction at the left hand side of the equation since it is velocity dependant. The first two equations become:
+
+\begin{multline}
+\iiint_\Omega  %double
+\left[
+ \left(  2 \mu \frac{\partial u}{\partial x} \right)\frac{\partial \phi_x}{\partial x}
++\left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)\frac{\partial \phi_x}{\partial y} 
++\left(  \mu \frac{\partial u}{\partial z} +\mu \frac{\partial w}{\partial x} \right)\frac{\partial \phi_x}{\partial z} 
+-P\frac{\partial \phi_x}{\partial x}
+\right]   d\Omega
+\\
+ + \iint_{\Gamma_b} \alpha^2 u \phi_x d\Gamma
+ =
+\iint_{\Gamma_i} F n_x\phi_x d\Gamma
+\end{multline}
+\begin{multline}
+\iiint_\Omega %double
+\left[
+\left(  \mu \frac{\partial u}{\partial y} +\mu \frac{\partial v}{\partial x} \right)\frac{\partial \phi_y  }{\partial x} 
++\left(  2 \mu \frac{\partial v}{\partial y} \right)\frac{\partial \phi_y  }{\partial y} 
++ \left(  \mu \frac{\partial v}{\partial z} +\mu \frac{\partial w}{\partial y} \right)\frac{\partial \phi_y  }{\partial z}
+-P \frac{\partial \phi_y  }{\partial y}
+\right]d\Omega
+\\
+ + \iint_{\Gamma_b} \alpha^2 v \phi_y d\Gamma
+ =
+\iint_{\Gamma_i} F n_y\phi_y d\Gamma
+\end{multline}
+\newpage
+        \subsection{Finite element discretisation, Galerkin method}
+
+The domain is meshed using MINI elements (See \ref{MINI} for more details). The pressure is evaluated on the pentahedron vertices ($nods$), and the velocity is evaluated on the same vertices and also in a grid located in the middle of each element ($nods+nel$). We use the nodal functions of each grid, which are continuous on the domain.\\
+We now project the velocities on the classical nodal functions $\phi_{j}$ and on the bubble function $\phi_{b_j}$, and the pressur on the classical nodal functions:
+
+\begin{equation}
+\begin{array}{c}
+\displaystyle u\left( x,y,z\right) = \sum_{i=1}^{nods}u_{i}\phi_{i}\left( x,y,z\right)+\sum_{j=1}^{nels}u_{j}\phi_{b_j}\left( x,y,z\right)
+= \sum_{j=1}^{nods+nels}u_{j}\phi_{j}\left( x,y,z\right) \\
+\\
+\displaystyle v\left( x,y,z\right) = \sum_{i=1}^{nods}v_{i}\phi_{i}\left( x,y,z\right)+\sum_{j=1}^{nels}v_{j}\phi_{b_j}\left( x,y,z\right) 
+= \sum_{j=1}^{nods+nels}v_{j}\phi_{j}\left( x,y,z\right) \\
+\\
+\displaystyle w\left( x,y,z\right) = \sum_{i=1}^{nods}w_{i}\phi_{i}\left( x,y,z\right)+\sum_{j=1}^{nels}w_{j}\phi_{b_j}\left( x,y,z\right)
+= \sum_{j=1}^{nods+nels}w_{j}\phi_{j}\left( x,y,z\right) \\
+\\
+\displaystyle P\left( x,y,z\right)=  \sum_{k=1}^{nods}P_{k}\phi_{k}\left( x,y,z\right)
+\end{array}
+\end{equation}
+\\
+The nodal functions $\phi_{i}$ are bubble functions if $i>nods$. We build a vector $W$ that holds all the unknows of the velocity  and pressure field (for the sake of simplicity, this vector holds the speed components first and then the pressure of each element. This is not exactly what is done in ICE since the stiffness matrix would be badly conditioned):
+:
+
+\begin{equation}
+W=\left[ \begin{array}{l}
+u_{1}\\
+v_{1}\\
+w_{1}\\
+\vdots\\
+w_{nods}\\
+P_{nods}\\
+\vdots\\
+P_{nods+nel}\\
+\end{array} \right]
+\end{equation}
+\\
+With these new unknows, one can replace the components of the virtual function $\overrightarrow{\phi}$ by any nodal functions (classical or bubble):
+\begin{center}
+ $\forall 1 \leq i \leq nods+nel$
+\end{center}
+\begin{multline}
+\sum_{j=1}^{nods+nel} 
+\iiint_\Omega  %double
+ \left(  2 \mu u_j\frac{\partial \phi_j}{\partial x} \right)\frac{\partial \phi_i}{\partial x}
++\left(  \mu u_j\frac{\partial \phi_j}{\partial y} +\mu v_j \frac{\partial \phi_j}{\partial x} \right)\frac{\partial \phi_i}{\partial y} 
++\left(  \mu u_j\frac{\partial \phi_j}{\partial z} +\mu w_j \frac{\partial \phi_j}{\partial x} \right)\frac{\partial \phi_i}{\partial z} 
+d\Omega
+\\
++ \sum_{j=1}^{nods+nel} \iint_{\Gamma_b}  \alpha^2 u_j \phi_j\phi_i d\Gamma
++ \sum_{k=1}^{nods} \iint_{\Gamma_b} P_k \phi_k\phi_i n_x d\Gamma
+-\sum_{k=1}^{nods}\iiint_\Omega 
+P_{k} \phi_k\frac{\partial \phi_i}{\partial x}
+d\Omega  
+ =
+\iint_{\Gamma_i} F n_x\phi_i d\Gamma
+\end{multline}
+\begin{multline}
+\sum_{j=1}^{nods+nel} 
+\iiint_\Omega %double
+\left(  \mu u_j\frac{\partial \phi_j}{\partial y} +\mu v_j\frac{\partial \phi_j}{\partial x} \right)\frac{\partial \phi_i  }{\partial x} 
++\left(  2 \mu v_j\frac{\partial \phi_j}{\partial y} \right)\frac{\partial \phi_i  }{\partial y} 
++ \left(  \mu v_j\frac{\partial \phi_j}{\partial z} +\mu w_j\frac{\partial \phi_j}{\partial y} \right)\frac{\partial \phi_i  }{\partial z}
+d\Omega
+\\
++ \sum_{j=1}^{nods+nel} \iint_{\Gamma_b} \alpha^2 v_j \phi_j\phi_i d\Gamma 
++ \sum_{k=1}^{nods} \iint_{\Gamma_b} P_k \phi_k\phi_i n_y d\Gamma 
+-\sum_{k=1}^{nods}\iiint_\Omega 
+P_{k} \phi_k\frac{\partial \phi_i}{\partial y}
+d\Omega 
+ =
+\iint_{\Gamma_i} F n_y\phi_i d\Gamma
+\end{multline}
+\begin{multline}
+\sum_{j=1}^{nods+nel} 
+\iiint_\Omega %double
+\left(  \mu u_j\frac{\partial \phi_j}{\partial z} +\mu w_j\frac{\partial \phi_j}{\partial x} \right)\frac{\partial \phi_i  }{\partial x} 
++\left(  \mu v_j\frac{\partial \phi_j }{\partial z} +\mu w_j\frac{\partial \phi_j}{\partial y} \right)\frac{\partial \phi_i  }{\partial y} 
++\left(  2 \mu w_j\frac{\partial \phi_j}{\partial z} \right)\frac{\partial \phi_i  }{\partial z} 
+d\Omega
+\\
+-\sum_{k=1}^{nods}\iiint_\Omega 
+P_{k} \phi_k\frac{\partial \phi_i}{\partial z}
+d\Omega 
+=
+\iint_{\Gamma_i} F n_z\phi_i d\Gamma
+-\iiint_\Omega %double
+\rho g \phi_i d\Omega
+\end{multline}
+\\
+By rearranging terms:
+\begin{center}
+ $\forall 1 \leq i \leq nods+nel$
+\end{center}
+\begin{multline}
+\sum_{j=1}^{nods+nel}
+u_j \left[
+\iiint_\Omega  %double
+ 2 \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ + \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} d\Omega
+ + \iint_{\Gamma_b} \alpha^2 \phi_j\phi_i d\Gamma 
+\right] 
++
+v_j \left[
+\iiint_\Omega  %double
+ \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial y} 
+d\Omega 
+\right]\\
++
+ w_j\left[
+ \iiint_\Omega  %double
+\mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial z} 
+d\Omega 
+\right]
++\sum_{k=1}^{nods} P_{k} 
+\left[\iint_{\Gamma_b}  \phi_k\phi_i n_x d\Gamma
+-\iiint_\Omega 
+\phi_k\frac{\partial \phi_i}{\partial x}
+d\Omega \right]
+ =
+\iint_{\Gamma_i} F n_x\phi_i d\Gamma
+\end{multline}
+\begin{multline}
+\sum_{j=1}^{nods+nel} 
+u_j \left[
+\iiint_\Omega %double
+  \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial x} 
+d\Omega \right] 
++
+v_j\left[
+\iiint_\Omega %double
+   \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ +2\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} d\Omega
+ + \iint_{\Gamma_b} \alpha^2 \phi_j\phi_i d\Gamma 
+\right] \\
++
+w_j\left[
+\iiint_\Omega %double
+\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial z} d\Omega
+\right]
++\sum_{k=1}^{nods} P_{k}
+\left[ \iint_{\Gamma_b} \phi_k\phi_i n_y d\Gamma
+- \iiint_\Omega 
+\phi_k\frac{\partial \phi_i}{\partial z}
+d\Omega \right]  
+ =
+\iint_{\Gamma_i} F n_y\phi_i d\Gamma
+\end{multline}
+\begin{multline}
+\sum_{j=1}^{nods+nel} 
+\iiint_\Omega %double
+u_j\left[
+\iiint_\Omega %double
+\mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial x} d\Omega
+\right] 
++
+ v_j\left[
+\iiint_\Omega %double
+\mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial y} d\Omega
+\right]\\
++
+ w_j \left[   
+\iiint_\Omega %double
+    \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ +  \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ +2 \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} d\Omega
+\right]
+-\sum_{k=1}^{nods} P_{k}\iiint_\Omega 
+\phi_k\frac{\partial \phi_i}{\partial y}
+d\Omega
+=
+\iint_{\Gamma_i} F n_z\phi_i d\Gamma
+-\iiint_\Omega %double
+\rho g \phi_i d\Omega
+\end{multline}
+\\
+And the incompressibility gives an additional equation, with $P^*=\phi_l\left( x,y,z\right)$ ($1\leq l\leq nods$, no bubble functions):
+\vspace*{-2mm}
+\begin{center}
+ $\forall 1 \leq l \leq nods $
+\end{center}
+\begin{equation}
+\displaystyle \sum_{j=1}^{nods+nel}  \iiint_\Omega %double
+\left[
+-\frac{\partial \phi_j}{\partial x}u_j-\frac{\partial \phi_j}{\partial y}v_j-\frac{\partial\phi_j }{\partial z}w_j
+\right] \phi_l d\Omega =0
+\end{equation}
+\\
+We see the stiffness matrix $K$ and load vector $F$ appearing, so that the previous equation can be written as follows:
+
+\begin{equation*}
+\left[
+\begin{array}{c c c c c c c} %K
+ & \vdots & \vdots &\vdots & &\vdots &\\
+ \cdots & K_{3i-2,3j-2} &  K_{3i-2,3j-1} &  K_{3i-2,3j} &\cdots &   K_{3i-2,3nods+k} & \cdots\\
+ &&&&& \\
+ \cdots & K_{3i-1,3j-2} &  K_{3i-1,3j-1} &  K_{3i-1,3j} &\cdots &   K_{3i-1,3nods+k} & \cdots\\
+ &&&&& \\
+  \cdots & K_{3i,3j-2} &  K_{3i,3j-1} &  K_{3i,3j} & \cdots &  K_{3i,3nods+k} & \cdots\\
+ & \vdots & \vdots &\vdots & &\vdots &\\
+  \cdots & K_{3nods+l,3j-2} &  K_{3nods+l,3j-1} &  K_{3nods+l,3j} &\cdots &   K_{3nods+l,3nods+k} & \cdots\\
+ & \vdots & \vdots &\vdots & &\vdots &\\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+u_j\\
+\\
+v_j\\
+\\
+w_j\\
+\vdots\\
+P_k\\
+\vdots\\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %F
+\vdots \\
+F_{3j-2}\\
+\\
+F_{3j-1}\\
+\\
+F_{3j}\\
+\vdots\\
+F_{3nods+k}\\
+\vdots\\
+\end{array}
+\right]
+\end{equation*}
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+K_{3i-2,3j-2} &\displaystyle = 
+\iiint_\Omega  %double
+ 2 \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ + \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} 
+d\Omega
+ + \iint_{\Gamma_b} \alpha^2 \phi_j\phi_i d\Gamma \\
+\\
+K_{3i-2,3j-1} &\displaystyle = 
+\iiint_\Omega  %double
+ \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial y} 
+d\Omega\\
+\\
+K_{3i-2,3j} &\displaystyle = 
+\iiint_\Omega  %double
+\mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial z} 
+d\Omega\\
+\\
+K_{3i-2,3nods+k} &\displaystyle = 
+\iint_{\Gamma_b} \phi_k\phi_i n_x d\Gamma
++\iiint_\Omega  %double
+-\phi_k\frac{\partial \phi_i}{\partial x}
+d\Omega\\
+\\
+\displaystyle
+K_{3i-1,3j-2} &\displaystyle = 
+\iiint_\Omega  %double
+\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial x} 
+d\Omega\\
+\\
+K_{3i-1,3j-1} &\displaystyle = 
+\iiint_\Omega  %double
+   \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ +2\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} 
+d\Omega
+ + \iint_{\Gamma_b} \alpha^2 \phi_j\phi_i d\Gamma \\
+\\
+K_{3i-1,3j} &\displaystyle = 
+\iiint_\Omega  %double
+\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial z} 
+d\Omega\\
+\\
+K_{3i-1,3nods+k} &\displaystyle = 
+\iint_{\Gamma_b} \phi_k\phi_i n_x d\Gamma
++
+\iiint_\Omega  %double
+-\phi_k\frac{\partial \phi_i}{\partial y}
+d\Omega\\
+\\
+\displaystyle
+K_{3i,3j-2} &\displaystyle = 
+\iiint_\Omega  %double
+\mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial x} 
+d\Omega\\
+\\
+K_{3i,3j-1} &\displaystyle = 
+\iiint_\Omega  %double
+\mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial y} 
+d\Omega\\
+\\
+K_{3i,3j} &\displaystyle = 
+\iiint_\Omega  %double
+    \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ +  \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ +2 \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z}
+d\Omega\\
+\\
+K_{3i,3nods+k} &\displaystyle = 
+\iiint_\Omega  %double
+-\phi_k\frac{\partial \phi_i}{\partial z}
+d\Omega\\
+\\
+\displaystyle
+K_{3nods+l,3j-2} &\displaystyle = 
+\iiint_\Omega %double
+-\frac{\partial \phi_j}{\partial x}\phi_l d\Omega\\
+\\
+K_{3nods+l,3j-1} &\displaystyle = 
+\iiint_\Omega %double
+-\frac{\partial \phi_j}{\partial y}\phi_l d\Omega\\
+\\
+K_{3nods+l,3j} &\displaystyle = 
+\iiint_\Omega %double
+-\frac{\partial \phi_j}{\partial z}\phi_l d\Omega\\
+\\
+K_{3nods+l,3nods+k} & =0\\
+\end{array}
+\end{equation}
+And the load vector has the following expression:
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+F_{3i-2} &\displaystyle = 
+\iint_{\Gamma_i} F n_x\phi_i d\Gamma\\
+\\
+F_{3i-1} &\displaystyle = 
+\iint_{\Gamma_i} F n_y\phi_i d\Gamma\\
+\\
+F_{3i} &\displaystyle = 
+\iint_{\Gamma_i} F n_z\phi_i d\Gamma
+-\iiint_\Omega %double
+\rho g \phi_i d\Omega\\
+\\
+F_{3nods+k} &\displaystyle = 0
+\end{array}
+\end{equation}
+\newpage
+        \subsection{Decomposition over the elements and reference element}
+See the same section for Pattyn's model.\\
+\\
+One element $E$ gives 19 equations: we can take 6 classical nodal functions for $\phi_i(x,y,z)$ (the nodal functions corresponding to the vertexes of $E$, which is an pentahedron), each $\phi_i$ gives 4 equations (one for the x-component, one for the y-component, one for the z-component and one for the pressure) and there are 3 additional equations using the grid in the middle of the pentahedron (3 compenents of the velocity). Therefore, an elementary stiffness matrix $K_E$ will be $27 \times 27$, and the elementary load vector will be of size $27$.
+
+\newpage
+        \subsection{Elementary stiffness matrix}
+        
+To compute the elementary stiffness matrix, we first remove the basal drag, that will create a first elementary stiffness matrix $K1$, the basal drag will constitute another stiffness matrix $K2$. The elementary stiffness matrix will be the sum of $K1$ and $K2$ ($K_E=K1+K2$).
+
+        \subsubsection{Without basal drag}
+
+This matrix has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 7$, $1 \leq j \leq 7$,  $1 \leq k \leq 6$ and $1 \leq l \leq 6$
+\end{center}
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+K_{3i-2,3j-2} &\displaystyle = 
+\iiint_E  %double
+ 2 \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ + \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} 
+d\Omega\\
+\\
+K_{3i-2,3j-1} &\displaystyle = 
+\iiint_E  %double
+ \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial y} 
+d\Omega\\
+\\
+K_{3i-2,3j} &\displaystyle = 
+\iiint_E  %double
+\mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial z} 
+d\Omega\\
+\\
+K_{3i-2,k} &\displaystyle = 
+\iiint_E  %double
+-\phi_k\frac{\partial \phi_i}{\partial x}
+d\Omega\\
+\end{array}
+\end{equation}
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+K_{3i-1,3j-2} &\displaystyle = 
+\iiint_E  %double
+\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial x} 
+d\Omega\\
+\\
+K_{3i-1,3j-1} &\displaystyle = 
+\iiint_E  %double
+   \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ +2\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ + \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z} 
+d\Omega\\
+\\
+K_{3i-1,3j} &\displaystyle = 
+\iiint_E  %double
+\mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial z} 
+d\Omega\\
+\\
+K_{3i-1,k} &\displaystyle = 
+\iiint_E  %double
+-\phi_k\frac{\partial \phi_i}{\partial y}
+d\Omega\\
+\end{array}
+\end{equation}
+\begin{equation}
+\begin{array}{l l}
+\displaystyle
+K_{3i,3j-2} &\displaystyle = 
+\iiint_E  %double
+\mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial x} 
+d\Omega\\
+\\
+K_{3i,3j-1} &\displaystyle = 
+\iiint_E  %double
+\mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial y} 
+d\Omega\\
+\\
+K_{3i,3j} &\displaystyle = 
+\iiint_E  %double
+    \mu \frac{\partial \phi_j}{\partial x} \frac{\partial \phi_i}{\partial x}
+ +  \mu \frac{\partial \phi_j}{\partial y} \frac{\partial \phi_i}{\partial y} 
+ +2 \mu \frac{\partial \phi_j}{\partial z} \frac{\partial \phi_i}{\partial z}
+d\Omega\\
+\\
+K_{3i,k} &\displaystyle = 
+\iiint_E  %double
+-\frac{\partial \phi_i}{\partial z}\phi_k
+d\Omega\\
+\\
+\displaystyle
+K_{l,3j-2} &\displaystyle = 
+\iiint_E %double
+-\frac{\partial \phi_j}{\partial x}\phi_l d\Omega\\
+\\
+K_{l,3j-1} &\displaystyle = 
+\iiint_E %double
+-\frac{\partial \phi_j}{\partial y}\phi_l d\Omega\\
+\\
+K_{l,3j} &\displaystyle = 
+\iiint_E %double
+-\frac{\partial \phi_j}{\partial z}\phi_l d\Omega\\
+\\
+K_{l,k} & =0\\
+\end{array}
+\end{equation}
+\\
+\newpage
+Using the reference element $\hat{E}$ and the gaussian points, this matrix becomes:
+\begin{center}
+ $1 \leq i \leq 7$, $1 \leq j \leq 7$,  $1 \leq k \leq 6$ and $1 \leq l \leq 6$
+\end{center}
+\medskip
+\begin{equation*}
+\begin{array}{c l}
+\displaystyle
+K1_{3i-2,3j-2} & \displaystyle = 
+\iiint_{\hat{E}}  %triple
+  \left( 
+ 2 \mu \frac{\partial L_j}{\partial \varphi_x} \frac{\partial L_i}{\partial \varphi_x}
+ + \mu \frac{\partial L_j}{\partial \varphi_y} \frac{\partial L_i}{\partial \varphi_y} 
+ + \mu \frac{\partial L_j}{\partial \varphi_z} \frac{\partial L_i}{\partial \varphi_z} 
+  \right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+ 2 \mu \left.\frac{\partial L_j}{\partial \varphi_x} \right|_g \left.\frac{\partial L_i}{\partial \varphi_x} \right|_g
+ + \mu \left.\frac{\partial L_j}{\partial \varphi_y} \right|_g \left.\frac{\partial L_i}{\partial \varphi_y} \right|_g 
++ \mu \left.\frac{\partial L_j}{\partial \varphi_z} \right|_g \left.\frac{\partial L_i}{\partial \varphi_z} \right|_g 
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K1_{3i-2,3j-1} & \displaystyle = 
+\iiint_{\hat{E}}  %triple
+  \left( 
+   \mu \frac{\partial L_j}{\partial \varphi_x} \frac{\partial L_i}{\partial \varphi_y} 
+  \right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+   \mu \left.\frac{\partial L_j}{\partial \varphi_x}\right|_g \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g 
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K1_{3i-2,3j} & \displaystyle = 
+\iiint_{\hat{E}}  %triple
+  \left( 
+\mu \frac{\partial L_j}{\partial \varphi_x} \frac{\partial L_i}{\partial \varphi_z} 
+  \right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+\mu \left.\frac{\partial L_j}{\partial \varphi_x}\right|_g \left.\frac{\partial L_i}{\partial \varphi_z} \right|_g
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K1_{3i-2,k} & \displaystyle = 
+\iiint_{\hat{E}}  %triple
+  \left( 
+-L_k\frac{\partial L_i}{\partial \varphi_x}
+  \right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+-L_k(g)\left.\frac{\partial L_i}{\partial \varphi_x}\right|_g
+\right) \vert J_g \vert \\
+\end{array}
+\end{equation*}
+\begin{equation*}
+\begin{array}{c l}
+\displaystyle
+K_{3i-1,3j-2} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+\mu \frac{\partial L_j}{\partial \varphi_y} \frac{\partial L_i}{\partial \varphi_x} 
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+  \mu \left.\frac{\partial L_j}{\partial \varphi_y}\right|_g \left.\frac{\partial L_i}{\partial \varphi_x} \right|_g
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{3i-1,3j-1} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+\mu \frac{\partial L_j}{\partial \varphi_x} \frac{\partial L_i}{\partial \varphi_x}
+ +2\mu \frac{\partial L_j}{\partial \varphi_y} \frac{\partial L_i}{\partial \varphi_y} 
+ + \mu \frac{\partial L_j}{\partial \varphi_z} \frac{\partial L_i}{\partial \varphi_z} 
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+   \mu \left.\frac{\partial L_j}{\partial \varphi_x}\right|_g \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g
+ +2\mu \left.\frac{\partial L_j}{\partial \varphi_y}\right|_g \left.\frac{\partial L_i}{\partial \varphi_y} \right|_g
++ \mu \left.\frac{\partial L_j}{\partial \varphi_z}\right|_g \left.\frac{\partial L_i}{\partial \varphi_z} \right|_g
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{3i-1,3j} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+\mu \frac{\partial L_j}{\partial \varphi_y} \frac{\partial L_i}{\partial \varphi_z}   
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+\mu \left.\frac{\partial L_j}{\partial \varphi_y}\right|_g \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g   
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{3i-1,k} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+-L_k\frac{\partial L_i}{\partial \varphi_y}
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+  -L_k(g)\left.\frac{\partial L_i}{\partial \varphi_y}\right|_g
+\right) \vert J_g \vert \\
+\end{array}
+\end{equation*}
+\begin{equation*}
+\begin{array}{c l}
+\displaystyle
+K_{3i,3j-2} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+  \mu \frac{\partial L_j}{\partial \varphi_z} \frac{\partial L_i}{\partial \varphi_x} 
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+  \mu \left.\frac{\partial L_j}{\partial \varphi_z}\right|_g \left.\frac{\partial L_i}{\partial \varphi_x} \right|_g
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{3i,3j-1} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+  \mu \frac{\partial L_j}{\partial \varphi_z} \frac{\partial L_i}{\partial \varphi_y} 
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+  \mu \left.\frac{\partial L_j}{\partial \varphi_z}\right|_g \left.\frac{\partial L_i}{\partial \varphi_y} \right|_g
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{3i,3j} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+    \mu \frac{\partial L_j}{\partial \varphi_x} \frac{\partial L_i}{\partial \varphi_x}
+ +  \mu \frac{\partial L_j}{\partial \varphi_y} \frac{\partial L_i}{\partial \varphi_y} 
+ +2 \mu \frac{\partial L_j}{\partial \varphi_z} \frac{\partial L_i}{\partial \varphi_z}
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+    \mu \left.\frac{\partial L_j}{\partial \varphi_x} \right|_g \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g
+ +  \mu \left.\frac{\partial L_j}{\partial \varphi_y}\right|_g \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g 
++2 \mu \left.\frac{\partial L_j}{\partial \varphi_z}\right|_g \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{3i,k} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+-L_k\frac{\partial L_i}{\partial \varphi_z}
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+-L_k(g)\left.\frac{\partial L_i}{\partial \varphi_z}\right|_g
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{l,3j-2} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+  -\frac{\partial L_j}{\partial \varphi_x} L_l
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+  -\left.\frac{\partial L_j}{\partial \varphi_x} \right|_g L_l(g)
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{l,3j-1} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+  -\frac{\partial L_j}{\partial \varphi_y}L_l
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+  -\left.\frac{\partial L_j}{\partial \varphi_y}\right|_g L_l(g)
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{l,3j} &\displaystyle = 
+\iiint_{\hat{E}}  %triple
+\left( 
+  -\frac{\partial L_j}{\partial \varphi_z} L_l
+\right) \vert J \vert d\hat{V} \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g \left( 
+  -\left.\frac{\partial L_j}{\partial \varphi_z}\right|_g L_l(g)
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+K_{l,k} &\displaystyle = 
+0 \\ \\
+& \displaystyle \simeq
+\sum_{g=1}^3 0 \\
+\end{array}
+\end{equation*}
+\newpage
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K1= \sum_{g=1}^3 [B]^T[D][B']$ as follows:
+\\
+\begin{equation*}
+[B]=\left[\begin{array}{c c c c c c c}
+B_1 & B_2 & B_3 & B_4 & B_5 & B_6 & B_b
+\end{array}\right]
+\quad \text{and} \quad
+[B']=\left[\begin{array}{c c c c c c c}
+B'_1 & B'_2 & B'_3 & B'_4 & B'_5 & B'_6 & B_b
+\end{array}\right]
+\end{equation*}
+\\
+with:
+\begin{equation*}
+[B_i]=\left[
+\begin{array}{c c c c}
+\displaystyle \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g & 0 & 0 & 0\\
+\\
+0 & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g & 0 & 0\\
+\\
+0 & 0 & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g & 0\\
+\\
+\displaystyle \frac{1}{2}\left.\frac{\partial L_i}{\partial \varphi_y}\right|_g & \displaystyle \frac{1}{2}\left.\frac{\partial L_i}{\partial \varphi_x}\right|_g  & 0 & 0\\
+\\
+\displaystyle \frac{1}{2}\left.\frac{\partial L_i}{\partial \varphi_z}\right|_g & 0 & \displaystyle \frac{1}{2}\left.\frac{\partial L_i}{\partial \varphi_x}\right|_g  & 0\\
+\\
+0 & \displaystyle \frac{1}{2}\left.\frac{\partial L_i}{\partial \varphi_z}\right|_g  & \displaystyle \frac{1}{2}\left.\frac{\partial L_i}{\partial \varphi_y}\right|_g  & 0\\
+\\
+0 & 0 & 0 & L_i(g)\\
+\\
+\displaystyle \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g  & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g  & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g & 0 \\
+\end{array}
+\right]\quad \text{and} \quad
+[B_b]=\left[
+\begin{array}{c c c}
+\displaystyle \left.\frac{\partial L_b}{\partial \varphi_x}\right|_g & 0 & 0\\
+\\
+0 & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_y}\right|_g & 0\\
+\\
+0 & 0 & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_z}\right|_g \\
+\\
+\displaystyle \frac{1}{2}\left.\frac{\partial L_b}{\partial \varphi_y}\right|_g & \displaystyle \frac{1}{2}\left.\frac{\partial L_b}{\partial \varphi_x}\right|_g  & 0 \\
+\\
+\displaystyle \frac{1}{2}\left.\frac{\partial L_b}{\partial \varphi_z}\right|_g & 0 & \displaystyle \frac{1}{2}\left.\frac{\partial L_b}{\partial \varphi_x}\right|_g  \\
+\\
+0 & \displaystyle \frac{1}{2}\left.\frac{\partial L_b}{\partial \varphi_z}\right|_g  & \displaystyle \frac{1}{2}\left.\frac{\partial L_b}{\partial \varphi_y}\right|_g  \\
+\\
+0 & 0 & 0 \\
+\\
+\displaystyle \left.\frac{\partial L_b}{\partial \varphi_x}\right|_g  & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_y}\right|_g  & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_z}\right|_g \\
+\end{array}
+\right]
+\end{equation*}\\
+\\
+\begin{equation*}
+[B_i']=
+\left[
+\begin{array}{c c c c}
+\displaystyle \quad \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g & 0 &  0 & 0\\
+\\
+0 & \displaystyle \quad\left.\frac{\partial L_i}{\partial \varphi_y}\right|_g & 0& 0\\
+\\
+0 & 0 & \displaystyle \quad\left.\frac{\partial L_i}{\partial \varphi_z}\right|_g & 0\\
+\\
+\displaystyle \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g  & 0& 0\\
+\\
+\displaystyle \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g  & 0 & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g & 0\\
+\\
+0 & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g & 0\\
+\\
+\displaystyle \left.\frac{\partial L_i}{\partial \varphi_x}\right|_g  & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_y}\right|_g  & \displaystyle \left.\frac{\partial L_i}{\partial \varphi_z}\right|_g & 0 \\
+\\
+0 & 0 & 0 & L_i(g)\\
+\\
+\end{array}
+\right]\quad \text{and} \quad
+[B_b']=\left[
+\begin{array}{c c c c}
+\displaystyle \quad\left.\frac{\partial L_b}{\partial \varphi_x}\right|_g & 0 & 0 \\
+\\
+0 & \displaystyle \quad\left.\frac{\partial L_b}{\partial \varphi_y}\right|_g & 0\\
+\\
+0 & 0 &\displaystyle \quad \left.\frac{\partial L_b}{\partial \varphi_z}\right|_g \\
+\\
+\displaystyle \left.\frac{\partial L_b}{\partial \varphi_y}\right|_g & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_x}\right|_g  & 0\\
+\\
+\displaystyle \left.\frac{\partial L_b}{\partial \varphi_z}\right|_g  & 0 & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_x}\right|_g\\
+\\
+0 & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_z}\right|_g & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_y}\right|_g\\
+\\
+\displaystyle \left.\frac{\partial L_b}{\partial \varphi_x}\right|_g  & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_y}\right|_g  & \displaystyle \left.\frac{\partial L_b}{\partial \varphi_z}\right|_g \\
+\\
+0 & 0 & 0\\
+\end{array}
+\right]
+\end{equation*}
+and 
+\begin{equation}
+\displaystyle D=W_g \vert J_g \vert \left[
+\begin{array}{c c c c c c c c}
+\displaystyle 2\mu & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
+\\
+0 & \displaystyle 2\mu & 0 & 0 & 0 & 0 & 0 & 0\\
+\\
+0 & 0 & \displaystyle 2\mu & 0 & 0 & 0 & 0 & 0\\
+\\
+0 & 0 & 0 & \displaystyle 2\mu & 0 & 0 & 0 & 0\\
+\\
+0 & 0 & 0 & 0 & \displaystyle 2\mu & 0 & 0 & 0\\
+\\
+0 & 0 & 0 & 0 & 0 & \displaystyle 2\mu & 0 & 0\\
+\\
+0 & 0 & 0 & 0 & 0 & 0 & \displaystyle -1 & 0\\
+\\
+0 & 0 & 0 & 0 & 0 & 0 & 0 & \displaystyle -1\\
+\end{array}
+\right] \end{equation} 
+\\\emph{NB:} in $ISSM$ code, the factor $2$ in the $D$ matrix does not exist since the constitutive relation used is $\sigma'=\mu\varepsilon$ instead of $\sigma'=2\mu\varepsilon$. This changes the viscosity definition that must be multiplied by $2$. 
+
+	\subsubsection{Basal drag}
+As with Pattyn's, the elements are triangles and there are only 3 nodal functions to take into account. Therefore, the stiffness matrix that stands for basal drag is $9 \times 9$.\\
+The basal drag stiffness matrix is such that:
+\begin{center}
+ $1 \leq i \leq 3$, $1 \leq j \leq 3$ and  $1 \leq k \leq 3$ 
+\end{center}
+\begin{equation}
+\begin{array}{l c c}
+\displaystyle
+K_{3i-2,3j-2} &\displaystyle = &\displaystyle \iint_{E\cap \Gamma_b} \alpha^2 \phi_j\phi_i d\Gamma \\
+\\
+\displaystyle K_{3i-1,3j-1} &\displaystyle = &\displaystyle \iint_{E\cap \Gamma_b} \alpha^2 \phi_j\phi_i d\Gamma \\
+\\
+\displaystyle K_{3i-2,k} &\displaystyle = &\displaystyle \iint_{E\cap \Gamma_b} \phi_k\phi_i n_x d\Gamma \\
+\\
+\displaystyle K_{3i-1,k} &\displaystyle = &\displaystyle \iint_{E\cap \Gamma_b} \phi_k\phi_i n_y d\Gamma \\
+\end{array}
+\end{equation}
+\\ 
+The other terms are equal to zero.\\
+\\       
+Using the reference element $\hat{E}$ and the gaussian points, this matrix become:
+        
+        \begin{equation}
+\begin{array}{l l l}
+\displaystyle
+K_{3i-2,3j-2} & = 
+\displaystyle \iint_{\hat{E}\cap \hat{\Gamma_b}}  %double
+\alpha^2 L_j(r,s) L_i(r,s)   \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g \alpha^2 L_j(r_g,s_g) L_i(r_g,s_g)   \vert J_g \vert
+ \\
+\\
+\displaystyle
+K_{3i-1,3j-1} & = 
+\displaystyle \iint_{\hat{E}\cap \hat{\Gamma_b}}  %double
+\alpha^2 L_j(r,s) L_i(r,s)  \vert J \vert d\hat{S} &
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g \alpha^2 L_j(r_g,s_g) L_i(r_g,s_g)   \vert J_g \vert 
+ \\
+ \\
+ \displaystyle
+K_{3i-2,k} & = 
+\displaystyle \iint_{\hat{E}\cap \hat{\Gamma_b}}  %double
+ L_k(r,s) L_i(r,s)  \vert J \vert  n_x d\hat{S} &
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g  L_k(r_g,s_g) L_i(r_g,s_g) \vert J_g \vert  n_x 
+ \\
+ \\
+ \displaystyle
+K_{3i-1,k} & = 
+\displaystyle \iint_{\hat{E}\cap \hat{\Gamma_b}}  %double
+ L_k(r,s) L_i(r,s)  \vert J \vert n_y d\hat{S} &
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g  L_k(r_g,s_g) L_i(r_g,s_g) \vert J_g \vert n_y
+ \\
+ \\
+\end{array}
+\end{equation}
+\\     
+This matrix is calculated with three matrices: $\displaystyle K2=\sum_{g=1}^3 [L]^T[D_{drag}][L']$ as follows:
+\\
+\begin{equation*}
+[L]=\left[\begin{array}{c c c}
+L_1 & L_2 & L_3 
+\end{array}\right]
+\quad \text{and} \quad
+[L']=\left[\begin{array}{c c c}
+L'_1 & L'_2 & L'_3
+\end{array}\right]
+\end{equation*}
+\\
+with:
+\begin{equation*}
+[L_i]=
+\left[
+\begin{array}{c c c c}
+\displaystyle 
+L_i(r_g,s_g) & 0 & 0 & 0 \\
+\\
+0 & L_i(r_g,s_g) & 0 & 0 \\
+\\
+L_i(r_g,s_g) & 0 & 0 & 0 \\
+\\
+0 & L_i(r_g,s_g) & 0 & 0 \\
+\\
+\end{array}
+\right]\quad \text{and} \quad
+[L'_i]=
+\left[
+\begin{array}{c c c c}
+\displaystyle 
+L_i(r_g,s_g) & 0 & 0 & 0  \\
+\\
+0 & L_i(r_g,s_g) & 0 & 0 \\
+\\
+0 & 0 & 0 & L_i(r_g,s_g) \\
+\\
+0 & 0 & 0 & L_i(r_g,s_g) \\
+\end{array}
+\right]
+\end{equation*}
+and 
+\begin{equation}
+\displaystyle D=W_g \vert J_g \vert \left[
+\begin{array}{c c c c c}
+\displaystyle \alpha^2 & 0 & 0 & 0 \\
+\\
+0 & \displaystyle \alpha^2 & 0 & 0 \\
+\\
+0 & 0 & \displaystyle n_x & 0 \\
+\\
+0 & 0 & 0 & \displaystyle n_y \\
+\end{array}
+\right] \end{equation} 
+
+
+ \subsection{Elementary load vector}
+To compute the elementary load vector, we first calculate the force due to the driving stress only, the water pressure only, and we then add these two terms.
+			\subsubsection{Driving stress}
+
+The elementary load vector due to driving stress has the following shape:
+
+\begin{equation}
+F1_{3i}= -\iiint_\Omega \rho g \phi_i d\Omega
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector become:
+
+\begin{equation}
+F1_{3i}= -
+\iiint_{\hat{E}} %triple
+\rho g L_i(r,s,\zeta) \vert J \vert d\hat{\Omega}
+\simeq
+\sum_{g=1}^6
+ - W_g \rho g \L_i(r_g,s_g,\zeta_g)   \vert J_g \vert
+\end{equation}
+
+			\subsubsection{Ice front}
+The load on the ice front involves only the nodes on the ice/sea interface. As with basal drag, only surface integrals are required. The elements are quadrangle (See section\ref{RE2D2}). The load on the ice front have the following shape:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+F2_{3i-2}=\iint_{E \cap \Gamma_i} F_in_x\phi_i dS\\
+\\
+\displaystyle
+F2_{3i-1}=\iint_{E \cap\Gamma_i} F_in_y\phi_i dS\\
+\\
+\displaystyle
+F2_{3i}=\iint_{E \cap\Gamma_i} F_in_z\phi_i dS
+\end{array}
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector become:
+
+\begin{equation}
+\begin{array}{l l l}
+\displaystyle
+F2_{3i-2} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_i}} \hat{F_i}n_x L_i \vert J \vert  d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^4
+W_g \rho_w g \min\left( 0,z\right) n_x L_i(r_g,s_g,\zeta_g) \vert J_g \vert \\
+\\
+\displaystyle
+F2_{3i-1} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_i}} \hat{F_i}n_y L_i \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^4
+W_g \rho_w g \min\left( 0,z\right) n_y L_i(r_g,s_g,\zeta_g) \vert J_g \vert \\
+\\
+\displaystyle
+F2_{3i} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_i}} \hat{F_i}n_z L_i \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^4
+W_g \rho_w g \min\left( 0,z\right)n_z L_i(r_g,s_g,\zeta_g) \vert J_g \vert
+\end{array}
+\end{equation}
+
+			\subsubsection{Ice/water interface}
+The load on the ice/water interface involves only the nodes at the base on the iceshelf. As with basal drag and ice front, only surface integrals are required. The elements are triangles. The load on the ice shelf base have the following shape:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+F3_{3i-2}=\iint_{E \cap \Gamma_w} F_wn_x\phi_i dS\\
+\\
+\displaystyle
+F3_{3i-1}=\iint_{E \cap\Gamma_w} F_wn_y\phi_i dS\\
+\\
+\displaystyle
+F3_{3i}=\iint_{E \cap\Gamma_w} F_wn_z\phi_i dS
+\end{array}
+\end{equation}
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector become:
+
+\begin{equation}
+\begin{array}{l l l}
+\displaystyle
+F3_{2i-1} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_w}} \hat{F_w} n_x L_i \vert J \vert  d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g \rho_w g b(r_g,s_g)  n_x L_i(r_g,s_g) \vert J_g \vert \\
+\\
+\displaystyle
+F3_{2i} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_w}} \hat{F_w} n_y L_i \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g \rho_w g b(r_g,s_g) n_y L_i(r_g,s_g) \vert J_g \vert \\
+\\
+\displaystyle
+F3_{2i} & \displaystyle =\iint_{\hat{E} \hat{\cup\Gamma_w}} \hat{F_w} n_y L_i \vert J \vert d\hat{S}
+&
+\displaystyle \simeq
+\sum_{g=1}^3
+W_g  \rho_w g b(r_g,s_g)  n_y L_i(r_g,s_g) \vert J_g \vert 
+\end{array}
+\end{equation}
+\newpage
+
+	\subsection{Collapsing of the seventh grid}
+In order to use the same mesh for all the 3d models, we have to get rid of the grid located on the middle of the pentahedron. To do so, we have to collapse this grid and reduce the elementary matrix and load vector to the first six grids. \\
+\\
+The elementary equation before collapsing is:
+
+\begin{equation}
+\left[\begin{array}{c c c|c}
+&&&\\
+&K_{ii}&&K_{ib}\\
+&&&\\
+\hline
+&K_{bi}&&K_{bb}
+\end{array}\right]
+\left[\begin{array}{c}
+\\
+W_{i}\\
+\\
+\hline
+W_{b}
+\end{array}\right]
+=
+\left[\begin{array}{c}
+\\
+F_{i}\\
+\\
+\hline
+F_{b}
+\end{array}\right]
+\end{equation}
+\\
+where index $b$ relates to the seventh grid and index $i$ refers to the first six grids. $W$ contains all the unknows of the element, ie $u$, $v$, $w$, and $p$. So that $W_{i}$ has 24 components and $W_{b}$ has 3 components (there is no pressure on the seventh grid).\\
+\\
+We separate this system of equations in two parts as follows:
+
+\begin{equation}
+\left\{\begin{array}{c}
+K_{ii}W_i+K_{ib}W_b=F_i\\
+\\
+K_{bi}W_i+K_{bb}W_b=F_b
+\end{array}\right.
+\end{equation}
+\\
+The second equation gives us $W_b=K_{bb}^{-1}\left(F_b-K_{bi}W_i\right)$ so that we can replace $W_b$ on the first equation. We now have a linear system on the first six grids. So we do solve the system on these six grids and use the same mesh as in the other 3d computations.\\
+\\
+The system to solve becomes:
+
+\begin{equation}
+\begin{array}{|c|}
+\hline 
+\\
+\displaystyle \left(K_{ii}-K_{ib}K_{bb}^{-1}K_{bi}\right)W_i=F_i-K_{ib}K_{bb}^{-1}F_b\\
+\\
+\hline
+\end{array}
+\end{equation}
+
+\newpage
+\chapter{Thermal Model Finite Element Formulation}
+The thermal equation (\ref{thermalequation}) involves a transient term $\dfrac{\partial T}{\partial t}$. This term can be neglected if the glacier is considered in a steady state. If it is not the case, this term must be taken into account and finite differences time domain scheme is required.
+\section{Steady state}
+
+    \subsection{Geometry and notations}
+ 
+The geometry is exactly the same as in the 3d models. We adopt the following notations:
+\begin{itemize}
+        \item[--] $\Omega$ is the open surface that constitutes the entire glacier system
+        \item[--] $\partial\Omega$ are points located at the boundary
+        \item[--] $\Gamma_b$ are points at the interface between glacier and bedrock (Ice/Till interface $z=b$)
+        \item[--] $\Gamma_w$ are points at the interface between glacier and water.
+\end{itemize}
+
+        \subsection{Equations}
+        
+For a steady state, one can neglect $\dfrac{\partial T}{\partial t}$. Given this assumption, the thermal equation (\ref{thermalequation}) is reduced to:
+
+\begin{equation}
+u\dfrac{\partial T}{\partial x} +v\dfrac{\partial T}{\partial y}  +w\dfrac{\partial T}{\partial z} = \dfrac{k}{ \rho c }\left( \dfrac{\partial^2 T}{\partial x^2}+\dfrac{\partial^2 T}{\partial y^2}+\dfrac{\partial^2 T}{\partial z^2}\right)  +\dfrac{\Phi}{ \rho c }
+\end{equation}
+\\
+For the temperature computation, the melting is not taken into account. When the pressure melting point is reached, one will use penalty method to constrain this point to this temperature. Thus, the boundary conditions are limited to:
+an imposed flux (Neumann) at the base of the grouded part, an imposed temperature (Dirichlet) on the lower surface of the floating part. The sides of the domain $\Gamma_u \cup \Gamma_i$ are treated as zero-flux surfaces.
+It is more convenient to consider the imposed temperatures as nill. At the end of the process, the temperature field will be updated to take these
+constraints into account.
+
+\begin{equation}
+\left\{ \begin{array}{l l l }
+\text{Icesheet  base } \Gamma_b: & 
+\displaystyle \left. k \left( \overrightarrow{grad}\;T\right) \right| _b.\overrightarrow{n} =  G + \overrightarrow{\tau}_b . \overrightarrow{u}_b\\
+\\
+\text{Iceshelf  base } \Gamma_w: & 
+\displaystyle k\left. \left( \overrightarrow{grad}\;T\right) \right|_b.\overrightarrow{n} = -\rho_w c_{pM}\gamma\left(T_b-T_{pmp} \right) \\
+\\
+\text{Other  borders } \Gamma_u\cup \Gamma_i:& \displaystyle  \left( \overrightarrow{grad}\;T\right).\overrightarrow{n}=0
+\end{array} \right.
+\end{equation}
+        \subsection{Weak Formulation}
+
+we  write the weak formulation to solve the previous equation
+using finite element. One defines an admissible thermal field $\theta$ such that:
+
+\begin{equation}
+\theta(x,y,z)\in\lbrace \left( H^{1}(\Omega\cup\partial\Omega) \right) \quad \vert \quad \theta(x,y,z)=0\qquad (x,y,z)\in \partial \Omega \setminus \Gamma_b\rbrace
+\end{equation}
+\\
+For any virtual field as described above:
+
+\begin{equation}
+\iiint_\Omega 
+\left[
+u\dfrac{\partial T}{\partial x} +v\dfrac{\partial T}{\partial y}  +w\dfrac{\partial T}{\partial z} - \dfrac{k}{ \rho c } \left( \dfrac{\partial^2 T}{\partial x^2}+\dfrac{\partial^2 T}{\partial y^2}+\dfrac{\partial^2 T}{\partial z^2}\right) - \dfrac{\Phi}{ \rho c }
+\right] \theta  d\Omega =0
+\end{equation}
+\\
+One intergrates by parts the conduction term in order to use the boundary conditions:
+
+\begin{multline}
+\iiint_\Omega 
+\dfrac{k}{ \rho c } \left(\dfrac{\partial T}{\partial x}\dfrac{\partial \theta}{\partial x}+\dfrac{\partial T}{\partial y}\dfrac{\partial \theta}{\partial y} +\dfrac{\partial T}{\partial z}\dfrac{\partial \theta}{\partial z}\right) 
+d\Omega
+=
+\iiint_\Omega 
+\left[ 
+-  u\dfrac{\partial T}{\partial x} -v\dfrac{\partial T}{\partial y}  -w\dfrac{\partial T}{\partial z} + \dfrac{\Phi}{ \rho c }
+\right] \theta  d\Omega\\
+\\
++
+\iint_{\partial\Omega }
+\dfrac{k}{ \rho c } \left(\dfrac{\partial T}{\partial x}\theta n_x+\dfrac{\partial T}{\partial y}\theta n_y+ \dfrac{\partial T}{\partial z}\theta n_z\right) 
+dS
+\end{multline}
+\\
+Where $\overrightarrow{n}=( n_x, n_y, n_z)$ is the unit normal vector pointing outward from the glacier. Since $\theta$ is admissible, the last integrale is nill except on $\Gamma_b$, where one can use the boundary condition:
+
+\begin{multline}
+\iiint_\Omega 
+\dfrac{k}{ \rho c } \left(\dfrac{\partial T}{\partial x}\dfrac{\partial \theta}{\partial x}+\dfrac{\partial T}{\partial y}\dfrac{\partial \theta}{\partial y} +\dfrac{\partial T}{\partial z}\dfrac{\partial \theta}{\partial z}\right) 
+d\Omega
+=
+\iiint_\Omega
+\left[  
+-  u\dfrac{\partial T}{\partial x} -v\dfrac{\partial T}{\partial y}  -w\dfrac{\partial T}{\partial z}+ \dfrac{\Phi}{ \rho c }
+\right] \theta  d\Omega \\
+\\
++\iint_{\Gamma_w }\dfrac{\rho_w c_{pM}\gamma}{ \rho c } \left(T_{pmp} -T\right) \theta dS
++
+\iint_{\Gamma_b }
+\dfrac{1}{ \rho c } \left(G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) \theta
+dS
+\end{multline}
+\\
+By rearranging terms:
+
+\begin{multline}
+\iiint_\Omega 
+\dfrac{k}{ \rho c }\left(\dfrac{\partial T}{\partial x}\dfrac{\partial \theta}{\partial x}+\dfrac{\partial T}{\partial y}\dfrac{\partial \theta}{\partial y} +\dfrac{\partial T}{\partial z}\dfrac{\partial \theta}{\partial z}\right) 
+d\Omega
++
+\iiint_\Omega
+u\dfrac{\partial T}{\partial x}\theta +v\dfrac{\partial T}{\partial y}\theta  +w\dfrac{\partial T}{\partial z}\theta
+d\Omega \\
+\\
+=
+\iiint_\Omega
+\dfrac{\Phi}{ \rho c }
+\theta  d\Omega 
++\iint_{\Gamma_w }\dfrac{\rho_w c_{pM}\gamma}{ \rho c } \left(T_{pmp} -T\right) \theta dS
++
+\iint_{\Gamma_b }
+\dfrac{1}{ \rho c } \left(G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) \theta
+dS
+\end{multline}
+\\
+
+
+        \subsection{Finite element discretisation, Galerkin method}
+
+The domain is meshed using pentahedrons. There are a $nel$ elements and $nods$ grids. We use the nodal functions of each grid, which are continuous on the domain and affine on each element.
+We now project the unknown on the nodal functions:
+\begin{center}
+ $(\phi_i)_{1\leq i\leq nods}$
+\end{center}
+\begin{equation}
+T\left( x,y,z\right) = \sum_{i=1}^{nods}T_{i}\theta_{i}\left( x,y,z\right) \\
+\end{equation}
+\\
+We build a vector $T$ that holds all the unknowns:
+
+\begin{equation}
+T=\left[ \begin{array}{c}
+T_{1}\\
+...\\
+T_{nods}
+                 \end{array} \right]
+\end{equation}
+\\
+With this new field, we have the following equations:
+\begin{center}
+ $\forall 1 \leq i \leq nods$
+\end{center}
+\begin{multline}
+\sum_{j=1}^{nods}
+\iiint_\Omega 
+\dfrac{k}{ \rho c }\left(\dfrac{\partial T_j\theta_j}{\partial x}\dfrac{\partial \theta_i}{\partial x}+\dfrac{\partial T_j\theta_j}{\partial y}\dfrac{\partial \theta_i}{\partial y}+  \dfrac{\partial T_j\theta_j}{\partial z}\dfrac{\partial \theta_i}{\partial z}\right) 
+d\Omega
++
+\iiint_\Omega
+u\dfrac{\partial T_j\theta_j}{\partial x}\theta_i +v\dfrac{\partial T_j\theta_j}{\partial y}\theta_i  +w\dfrac{\partial T_j\theta_j}{\partial z}\theta_i
+d\Omega\\
+\\
+=
+\iiint_\Omega 
+ \dfrac{\Phi}{ \rho c }
+\theta_i  d\Omega 
++
+\iint_{\Gamma_w }
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c } \left(T_{pmp} -\sum_{j=1}^{nods}T_j \theta_j\right)\theta_i
+dS
++
+\iint_{\Gamma_b }
+\dfrac{1}{ \rho c } \left(G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) \theta_i
+dS
+\end{multline}
+\\
+One can extract $T_j$:
+
+\begin{multline*}
+\sum_{j=1}^{nods}\left[ 
+\iiint_\Omega 
+\dfrac{k}{ \rho c }\left(\dfrac{\partial \theta_j}{\partial x}\dfrac{\partial \theta_i}{\partial x}+\dfrac{\partial \theta_j}{\partial y}\dfrac{\partial \theta_i}{\partial y}+ \dfrac{\partial \theta_j}{\partial z}\dfrac{\partial \theta_i}{\partial z}\right) 
+d\Omega \right.  \\
+\\
+\left. 
++
+\iiint_\Omega
+u\dfrac{\partial \theta_j}{\partial x}\theta_i +v\dfrac{\partial \theta_j}{\partial y}\theta_i  +w\dfrac{\partial \theta_j}{\partial z}\theta_i
+d\Omega
++
+\iint_{\Gamma_w }
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c } \theta_j\theta_i
+dS \right] T_j\\
+\\
+=
+\iiint_\Omega
+\dfrac{\Phi}{ \rho c }
+\theta_i  d\Omega 
++
+\iint_{\Gamma_w }
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c }T_{pmp}\theta_i
+dS
++
+\iint_{\Gamma_b }
+\dfrac{1}{ \rho c } \left(G + \overrightarrow{\tau}_b . \overrightarrow{u}_b\right) \theta_i
+dS
+\end{multline*}
+\\
+We see the stiffness matrix $K$ and load vector $F$ appearing, so that the previous equations can be written as a system matrix :
+
+\begin{equation}
+\left[ K \right] T =F 
+\label{FET}
+\end{equation} 
+\\
+We use the following index:
+
+\begin{equation}
+\left[
+\begin{array}{c c c} %K
+  & \vdots &\\
+ \cdots & K_{ij} & \cdots\\
+  & \vdots &\\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+T_i\\
+\vdots\\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %F
+\vdots \\
+F_{i}\\
+\vdots\\
+\end{array}
+\right]
+\end{equation}
+\\
+And  we have the following expressions for the stiffness matrix and the load vector :
+
+\begin{equation}
+\begin{array}{l c l}
+\displaystyle
+K_{i,j} & = &\displaystyle  
+\iiint_\Omega 
+\dfrac{k}{ \rho c }\left(\dfrac{\partial \theta_j}{\partial x}\dfrac{\partial \theta_i}{\partial x}+\dfrac{\partial \theta_j}{\partial y}\dfrac{\partial \theta_i}{\partial y}+ \dfrac{\partial \theta_j}{\partial z}\dfrac{\partial \theta_i}{\partial z}\right) 
+d\Omega\\
+\\
+&& \displaystyle
++
+\iiint_\Omega
+u\dfrac{\partial \theta_j}{\partial x}\theta_i +v\dfrac{\partial \theta_j}{\partial y}\theta_i  +w\dfrac{\partial \theta_j}{\partial z}\theta_i
+d\Omega +
+\iint_{\Gamma_w }
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c } \theta_j\theta_i
+dS
+\\
+\\
+F_{i} &=&\displaystyle
+\iiint_\Omega
+\dfrac{\Phi}{ \rho c }
+\theta_i  d\Omega 
++
+\iint_{\Gamma_w }
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c } T_{pmp}\theta_i
+dS\\
+\\
+&& \displaystyle
++
+\iint_{\Gamma_b }
+\dfrac{1}{ \rho c } \left(G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) \theta_i
+dS\\
+\end{array}
+\end{equation}
+
+        \subsection{Decomposition over the elements and reference element}
+See same section in Pattyn's Model.
+One element $E$ gives 6 equations: we can take 6 nodal functions for $\theta_i(x,y,z)$ (the nodal functions corresponding to the vertexes of $E$, which is an pentahedron), each $\theta_i$ gives 1 equation. Therefore, an elementary stiffness matrix $K_E$ will be $6 \times 6$, and the elementary load vector will be of size $6$.
+\newpage
+        \subsection{Elementary stiffness matrix}
+The elementary stiffness matrix is divided into 3 matrices: one conduction stiffness matrix, one advection stiffness matrix, and one ocean/ice heat exchange stiffness matrix.
+
+   	     \subsubsection{Conduction stiffness matrix}
+This matrix has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+K1_{i,j}  = 
+\iiint_E
+\dfrac{k}{ \rho c }\left(\dfrac{\partial \theta_j}{\partial x}\dfrac{\partial \theta_i}{\partial x}+\dfrac{\partial \theta_j}{\partial y}\dfrac{\partial \theta_i}{\partial y}+ \dfrac{\partial \theta_j}{\partial z}\dfrac{\partial \theta_i}{\partial z}\right)
+dV
+\end{equation}  
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this matrix becomes:
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation*}
+\begin{array}{l c l}
+K1_{i,j} &=& \displaystyle 
+\iiint_{\hat{E}}  %triple
+  \left( 
+\dfrac{k}{ \rho c }\left(\dfrac{\partial L_j}{\partial \varphi_x}\dfrac{\partial L_i}{\partial \varphi_x}
++\dfrac{\partial L_j}{\partial \varphi_y}\dfrac{\partial L_i}{\partial \varphi_y}
++ \dfrac{\partial L_j}{\partial \varphi_z}\dfrac{\partial L_i}{\partial \varphi_z}\right) 
+  \right) \vert J \vert d\hat{V}  \\
+  \\
+  & \simeq &  \displaystyle 
+\sum_{g=1}^6  W_g \left( 
+\dfrac{k}{ \rho c }\left( \left.\dfrac{\partial L_j}{\partial \varphi_x} \right|_g \left.\dfrac{\partial L_i}{\partial \varphi_x} \right|_g
++ \left.\dfrac{\partial L_j}{\partial \varphi_y} \right|_g \left.\dfrac{\partial L_i}{\partial \varphi_y} \right|_g
++ \left.\dfrac{\partial L_j}{\partial \varphi_z} \right|_g \left.\dfrac{\partial L_i}{\partial \varphi_z} \right|_g\right) 
+\right) \vert J_g \vert
+\end{array}
+\end{equation*}
+
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K1= \sum_{g=1}^6 [B]^T[D][B]$ as follows:
+\\
+\begin{equation}
+[B]=\left[\begin{array}{c c c c c c}
+B_1 & B_2 & B_3 & B_4 & B_5 & B_6
+\end{array}\right]
+\end{equation}
+\\
+with:
+
+\begin{equation}
+B_i=\left[\begin{array}{c}
+\left.\dfrac{\partial L_i}{\partial \varphi_x}\right|_g\\
+\\
+\left.\dfrac{\partial L_i}{\partial \varphi_y}\right|_g\\
+\\
+\left.\dfrac{\partial L_i}{\partial \varphi_z}\right|_g 
+\end{array}\right]
+\end{equation}
+\\
+and 
+\begin{equation}
+\displaystyle D=  W_g \vert J_g \vert \dfrac{k}{ \rho c } \end{equation} 
+
+   	     \subsubsection{Advection stiffness matrix}
+This matrix has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+K2_{i,j}  = 
+\iiint_E
+u\dfrac{\partial \theta_j}{\partial x}\theta_i +v\dfrac{\partial \theta_j}{\partial y}\theta_i  +w\dfrac{\partial \theta_j}{\partial z}\theta_i
+dV
+\end{equation}  
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this matrix becomes:
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+\begin{array}{r c l}
+K2_{i,j} & = & \displaystyle
+\iiint_{\hat{E}}  %triple
+  \left( 
+u\dfrac{\partial L_j}{\partial \varphi_x}L_i +v\dfrac{\partial L_j}{\partial \varphi_y}L_i  +w\dfrac{\partial L_j}{\partial \varphi_z}L_i
+  \right) \vert J \vert d\hat{V}  \\
+  \\
+  & \simeq & \displaystyle
+\sum_{g=1}^6   W_g \left( 
+u\left(g \right) \left.\dfrac{\partial L_j}{\partial \varphi_x}\right|_g L_i\left(g \right) +v\left(g \right)\left.\dfrac{\partial L_j}{\partial \varphi_y}\right|_g  L_i \left(g \right) +w\left(g \right)\left.\dfrac{\partial L_j}{\partial \varphi_z}\right|_g L_i\left(g \right)
+\right) \vert J_g \vert
+\end{array}
+\end{equation}
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K2= \sum_{g=1}^6 [B]^T[D][B']$ as follows:
+
+\begin{equation}
+[B]=\left[\begin{array}{c c c c c c}
+B_1 & B_2 & B_3 & B_4 & B_5 & B_6
+\end{array}\right]
+\end{equation}
+\\
+with:
+
+\begin{equation}
+B_i=\left[\begin{array}{c}
+L_i(g)\\
+\\
+L_i(g)\\
+\\
+L_i(g)
+\end{array}\right]
+\quad
+B_i'=\left[\begin{array}{c}
+\left.\dfrac{\partial L_i}{\partial \varphi_x}\right|_g\\
+\\
+\left.\dfrac{\partial L_i}{\partial \varphi_y}\right|_g\\
+\\
+\left.\dfrac{\partial L_i}{\partial \varphi_z}\right|_g\\
+\end{array}\right]
+\end{equation}
+\\
+and 
+\begin{equation}
+\displaystyle D= W_g \vert J_g \vert
+\left[\begin{array}{c c c}
+\displaystyle \sum_{k=1}^6 u_k L_k(g) & 0 & 0 \\
+0 & \displaystyle \sum_{k=1}^6 v_k L_k(g)  & 0\\
+0 & 0 & \displaystyle \sum_{k=1}^6 w_k L_k(g) 
+\end{array}\right]  \end{equation} 
+
+			\subsubsection{Ocean/ice heat exchange}
+
+This elementary stiffness has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 3$ and  $1 \leq j \leq 3$ 
+\end{center}
+\begin{equation}
+K3_{i,j} = 
+\iint_{\Gamma_w \cap E }
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c }\theta_j\theta_i
+dS
+\end{equation} 
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector becomes:
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\begin{equation}
+\begin{array}{r c l}
+K3_{i,j} & = & \displaystyle
+\iint_{\Gamma_w \cap \hat{E} }
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c }L_j L_i
+\vert J \vert d\hat{S}\\
+\\
+& \simeq & \displaystyle
+\sum_{g=1}^3  W_g \vert J_g \vert 
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c }L_j(g)L_i(g)
+\end{array}
+\end{equation}
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K3= \sum_{g=1}^3 [B]^T[D][B]$ as follows:
+
+\begin{equation}
+[B]=\left[\begin{array}{c c c}
+B_1 & B_2 & B_3 
+\end{array}\right] \quad \text{and} \quad D= W_g \vert J_g \vert \dfrac{\rho_w c_{pM}\gamma}{ \rho c }
+\end{equation}
+with:
+\begin{equation}
+B_i=L_i(g)
+\end{equation}
+
+\newpage
+ \subsection{Elementary load vector}
+
+			\subsubsection{Deformational heating}
+			
+This elementary load vector has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\begin{equation}
+F_{i} = 
+\iiint_E
+\dfrac{\Phi}{ \rho c }
+\theta_i  d\Omega 
+dV
+\end{equation} 
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector becomes:
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\begin{equation}
+F_{i} = 
+\iiint_{\hat{E}}  %triple
+\dfrac{\Phi}{ \rho c } 
+ L_i  \vert J \vert d\hat{V}
+ = 
+\sum_{g=1}^6  W_g \vert J_g \vert 
+\dfrac{\Phi (g)}{ \rho c } 
+L_i(g)
+\end{equation}
+
+
+			\subsubsection{Basal heating}
+
+This elementary load vector has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\begin{equation}
+F_{i} = 
+\iint_{\Gamma_b \cap E }
+\dfrac{1}{ \rho c } \left( G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) \theta_i
+dS
+\end{equation} 
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector becomes:
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\begin{equation}
+\begin{array}{r c l}
+F_{i} & = & \displaystyle
+\iint_{\Gamma_b \cap \hat{E} }
+\dfrac{1}{ \rho c } \left( G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) L_i
+\vert J \vert d\hat{S}\\
+\\
+& \simeq & \displaystyle
+\sum_{g=1}^3  W_g \vert J_g \vert 
+\dfrac{1}{ \rho c } \left( G(g) + \overrightarrow{\tau}_b(g) . \overrightarrow{u}_b(g)\right) L_i(g)
+\end{array}
+\end{equation}
+Only the nodal functions assigned to the nodes on $\Gamma_b$ are involved.
+
+
+			\subsubsection{Ocean/ice heat exchange}
+
+This elementary load vector has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\begin{equation}
+F_{i} = 
+\iint_{\Gamma_w \cap E }
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c }T_{pmp}\theta_i
+dS
+\end{equation} 
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector becomes:
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\begin{equation}
+\begin{array}{r c l}
+F_{i} & = & \displaystyle
+\iint_{\Gamma_w \cap \hat{E} }
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c }T_{pmp} L_i
+\vert J \vert d\hat{S}\\
+\\
+& \simeq & \displaystyle
+\sum_{g=1}^3  W_g \vert J_g \vert 
+\dfrac{\rho_w c_{pM}\gamma}{ \rho c }T_{pmp}(g)L_i(g)
+\end{array}
+\end{equation}
+Only the nodal functions assigned to the nodes on $\Gamma_w$ are involved.
+
+\newpage
+\section{Transient}
+
+        \subsection{Equations}
+        
+This time, one cannot neglect $\dfrac{\partial T}{\partial t}$. The equation is the same as in the first chapter (\ref{thermalequation}):
+
+\begin{equation}
+\dfrac{\partial T}{\partial t}= -\left( u\dfrac{\partial T}{\partial x} +v\dfrac{\partial T}{\partial y}  +w\dfrac{\partial T}{\partial z} \right)+ \dfrac{k}{ \rho c }\left( \dfrac{\partial^2 T}{\partial x^2}+\dfrac{\partial^2 T}{\partial y^2}+\dfrac{\partial^2 T}{\partial z^2}\right)  +\dfrac{\Phi}{ \rho c }
+\end{equation}
+\\
+The boundary conditions are the same as in the previous chapter.
+
+        \subsection{Weak Formulation}
+
+The weak formulation is the same as in the previoous chapter with the transient term:
+
+\begin{multline}
+\iiint_\Omega 
+\dfrac{k}{ \rho c }\left(\dfrac{\partial T}{\partial x}\dfrac{\partial \theta}{\partial x}+\dfrac{\partial T}{\partial y}\dfrac{\partial \theta}{\partial y} +\dfrac{\partial T}{\partial z}\dfrac{\partial \theta}{\partial z}\right) 
+d\Omega
++
+\iiint_\Omega
+u\dfrac{\partial T}{\partial x}\theta +v\dfrac{\partial T}{\partial y}\theta  +w\dfrac{\partial T}{\partial z}\theta
+d\Omega \\
+\\
+=
+\iiint_\Omega
+\left(  
+-\dfrac{\partial T}{\partial t} + \dfrac{\Phi}{ \rho c }
+\right) \theta  d\Omega 
++
+\iint_{\Gamma_b }
+\dfrac{1}{ \rho c } \left(G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) \theta
+dS
+\end{multline}
+
+        \subsection{Finite difference scheme}
+To evaluate the transient term, one uses a finite differences time domain scheme. For a given time step $i$, the transient term is computed implicitly\footnote{an implicit method is much more stable for this kind of equation} as follow:
+
+\begin{equation}
+\left. \dfrac{\partial T}{\partial t}\right|_{i} =\dfrac{T_{i}-T_{i-1}}{\Delta t }
+\end{equation}
+\\
+Where $\Delta t$ is the time difference between $t_{i}$ and $t_{i-1}$. The weak formuation becomes:
+
+\begin{multline}
+\iiint_\Omega 
+\dfrac{k}{ \rho c }\left(\dfrac{\partial T_{i}}{\partial x}\dfrac{\partial \theta}{\partial x}+\dfrac{\partial T_{i}}{\partial y}\dfrac{\partial \theta}{\partial y} +\dfrac{\partial T_{i}}{\partial z}\dfrac{\partial \theta}{\partial z}\right) 
+d\Omega
++
+\iiint_\Omega
+u\dfrac{\partial T_{i}}{\partial x}\theta +v\dfrac{\partial T_{i}}{\partial y}\theta  +w\dfrac{\partial T_{i}}{\partial z}\theta
+d\Omega \\
+\\
+=
+\iiint_\Omega
+\left(  
+-\dfrac{T_{i}-T_{i-1}}{\Delta t } + \dfrac{\Phi}{ \rho c }
+\right) \theta  d\Omega 
++
+\iint_{\Gamma_b }
+\dfrac{1}{ \rho c } \left(G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) \theta
+dS
+\end{multline}
+\\
+By rearranging terms:
+
+\begin{multline}
+\iiint_\Omega
+T_{i}
+\theta  d\Omega 
++
+\Delta t \iiint_\Omega 
+\dfrac{k}{ \rho c }\left(\dfrac{\partial T_{i}}{\partial x}\dfrac{\partial \theta}{\partial x}+\dfrac{\partial T_{i}}{\partial y}\dfrac{\partial \theta}{\partial y} +\dfrac{\partial T_{i}}{\partial z}\dfrac{\partial \theta}{\partial z}\right) 
+d\Omega
++
+\Delta t \iiint_\Omega
+u\dfrac{\partial T_{i}}{\partial x}\theta +v\dfrac{\partial T_{i}}{\partial y}\theta  +w\dfrac{\partial T_{i}}{\partial z}\theta
+d\Omega \\
+\\
+=
+\iiint_\Omega 
+T_{i-1}\theta  d\Omega 
++
+\Delta t \iiint_\Omega
+\dfrac{\Phi}{ \rho c }
+\theta  d\Omega 
++
+\Delta t \iint_{\Gamma_b }
+\dfrac{1}{ \rho c } \left(G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) \theta
+dS
+\end{multline}
+\newpage
+        \subsection{Elementary stiffness matrix}
+The elementary stiffness matrix is very similar to the one of the steady state case: all the previous matrices are multiplied by $\Delta t$, and a transient term is added:
+
+   	     \subsubsection{Conduction stiffness matrix}
+This matrix has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+K1_{i,j}  = 
+\Delta t\iiint_E
+\dfrac{k}{ \rho c }\left(\dfrac{\partial \theta_j}{\partial x}\dfrac{\partial \theta_i}{\partial x}+\dfrac{\partial \theta_j}{\partial y}\dfrac{\partial \theta_i}{\partial y}+ \dfrac{\partial \theta_j}{\partial z}\dfrac{\partial \theta_i}{\partial z}\right)
+dV
+\end{equation}  
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this matrix becomes:
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation*}
+\begin{array}{l c l}
+K1_{i,j} &=& \displaystyle 
+\Delta t\iiint_{\hat{E}}  %triple
+  \left( 
+\dfrac{k}{ \rho c }\left(\dfrac{\partial L_j}{\partial \varphi_x}\dfrac{\partial L_i}{\partial \varphi_x}
++\dfrac{\partial L_j}{\partial \varphi_y}\dfrac{\partial L_i}{\partial \varphi_y}
++ \dfrac{\partial L_j}{\partial \varphi_z}\dfrac{\partial L_i}{\partial \varphi_z}\right) 
+  \right) \vert J \vert d\hat{V}  \\
+  \\
+  & \simeq &  \displaystyle 
+\sum_{g=1}^6  W_g \Delta t\left( 
+\dfrac{k}{ \rho c }\left( \left.\dfrac{\partial L_j}{\partial \varphi_x} \right|_g \left.\dfrac{\partial L_i}{\partial \varphi_x} \right|_g
++ \left.\dfrac{\partial L_j}{\partial \varphi_y} \right|_g \left.\dfrac{\partial L_i}{\partial \varphi_y} \right|_g
++ \left.\dfrac{\partial L_j}{\partial \varphi_z} \right|_g \left.\dfrac{\partial L_i}{\partial \varphi_z} \right|_g\right) 
+\right) \vert J_g \vert
+\end{array}
+\end{equation*}
+
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K1= \sum_{g=1}^6 [B]^T[D][B]$ as follows:
+\\
+\begin{equation}
+[B]=\left[\begin{array}{c c c c c c}
+B_1 & B_2 & B_3 & B_4 & B_5 & B_6
+\end{array}\right]
+\end{equation}
+\\
+with:
+
+\begin{equation}
+B_i=\left[\begin{array}{c}
+\left.\dfrac{\partial L_i}{\partial \varphi_x}\right|_g\\
+\\
+\left.\dfrac{\partial L_i}{\partial \varphi_y}\right|_g\\
+\\
+\left.\dfrac{\partial L_i}{\partial \varphi_z}\right|_g 
+\end{array}\right]
+\end{equation}
+\\
+and 
+\begin{equation}
+\displaystyle D=  W_g \vert J_g \vert \Delta t\dfrac{k}{ \rho c } \end{equation} 
+
+   	     \subsubsection{Advection stiffness matrix}
+This matrix has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+K2_{i,j}  = 
+\Delta t\iiint_E
+u\dfrac{\partial \theta_j}{\partial x}\theta_i +v\dfrac{\partial \theta_j}{\partial y}\theta_i  +w\dfrac{\partial \theta_j}{\partial z}\theta_i
+dV
+\end{equation}  
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this matrix becomes:
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\begin{equation}
+\begin{array}{r c l}
+K2_{i,j} & = & \displaystyle
+\Delta t\iiint_{\hat{E}}  %triple
+  \left( 
+u\dfrac{\partial L_j}{\partial \varphi_x}L_i +v\dfrac{\partial L_j}{\partial \varphi_y}L_i  +w\dfrac{\partial L_j}{\partial \varphi_z}L_i
+  \right) \vert J \vert d\hat{V}  \\
+  \\
+  & \simeq & \displaystyle
+\sum_{g=1}^6   W_g \Delta t\left( 
+u\left(g \right) \left.\dfrac{\partial L_j}{\partial \varphi_x}\right|_g L_i\left(g \right) +v\left(g \right)\left.\dfrac{\partial L_j}{\partial \varphi_y}\right|_g  L_i \left(g \right) +w\left(g \right)\left.\dfrac{\partial L_j}{\partial \varphi_z}\right|_g L_i\left(g \right)
+\right) \vert J_g \vert
+\end{array}
+\end{equation}
+\\
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K2= \sum_{g=1}^6 [B]^T[D][B']$ as follows:
+
+\begin{equation}
+[B]=\left[\begin{array}{c c c c c c}
+B_1 & B_2 & B_3 & B_4 & B_5 & B_6
+\end{array}\right]
+\end{equation}
+\\
+with:
+
+\begin{equation}
+B_i=\left[\begin{array}{c}
+L_i(g)\\
+\\
+L_i(g)\\
+\\
+L_i(g)
+\end{array}\right]
+\quad
+B_i'=\left[\begin{array}{c}
+\left.\dfrac{\partial L_i}{\partial \varphi_x}\right|_g\\
+\\
+\left.\dfrac{\partial L_i}{\partial \varphi_y}\right|_g\\
+\\
+\left.\dfrac{\partial L_i}{\partial \varphi_z}\right|_g\\
+\end{array}\right]
+\end{equation}
+\\
+and 
+\begin{equation}
+\displaystyle D= W_g \vert J_g \vert \Delta t
+\left[\begin{array}{c c c}
+\displaystyle \sum_{k=1}^6 u_k L_k(g) & 0 & 0 \\
+0 & \displaystyle \sum_{k=1}^6 v_k L_k(g)  & 0\\
+0 & 0 & \displaystyle \sum_{k=1}^6 w_k L_k(g) 
+\end{array}\right]  \end{equation} 
+
+			\subsubsection{Transient}
+
+The transient stiffness matrix has the following shape
+
+\begin{equation}
+K_{i,j}  = 
+\iint_{E} \theta_j \phi_i dV \\ 
+\end{equation}
+\\
+We now use gaussian points for the integration :
+
+\begin{center}
+ $1 \leq i \leq 6$ and  $1 \leq j \leq 6$ 
+\end{center}
+\medskip
+\begin{equation}
+\begin{array}{c l}
+\displaystyle
+K_{i,j} & \displaystyle = 
+\iint_{\hat{E}} L_j  L_i \vert J \vert d\hat{V}\\
+\\
+& \displaystyle \simeq
+\sum_{g=1}^6  W_g L_j(g) L_i(g) \vert J_g \vert 
+\end{array}
+\end{equation}
+\\
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K3= \sum_{g=1}^3 [B]^T[D][B]$ as follows:
+
+\begin{equation}
+[B]=\left[\begin{array}{c c c c c c}
+B_1 & B_2 & B_3 & B_4 & B_5 & B_6 
+\end{array}\right] \quad \text{and} \quad D=W_g \vert J_g \vert
+\end{equation}
+with:
+\begin{equation}
+B_i= L_i(g )
+\end{equation}\\
+\newpage
+ \subsection{Elementary load vector}
+
+			\subsubsection{Deformational heating}
+			
+This elementary load vector has the following shape:
+
+\begin{center}
+ $1 \leq j \leq 6$
+\end{center}
+\begin{equation}
+F_{j} = 
+\iiint_E
+\left(  
+-\dfrac{\partial T}{\partial t}+ \dfrac{\Phi}{ \rho c }
+\right) \theta_j  d\Omega 
+dV
+\end{equation} 
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector becomes:
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\begin{equation}
+F_{j} = 
+\iiint_{\hat{E}}  %triple
+\left( 
+-\dfrac{\partial T}{\partial t} 
++ \dfrac{\Phi}{ \rho c } 
+\right) L_j  \vert J \vert d\hat{V}
+ = 
+\sum_{g=1}^6  W_g \vert J_g \vert 
+\left(  
+-\left. \dfrac{\partial T}{\partial t}\right|_g
++ \dfrac{\Phi (g)}{ \rho c } 
+\right) L_j(g)
+\end{equation}
+
+
+			\subsubsection{Basal heating}
+
+This elementary load vector has the following shape:
+
+\begin{center}
+ $1 \leq i \leq 6$
+\end{center}
+\begin{equation}
+F_{j} = 
+\iint_{\Gamma_b \cap E }
+\dfrac{1}{ \rho c } \left( G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) \theta_j
+dS
+\end{equation} 
+\\
+Using the reference element $\hat{E}$ and the gaussian points, this vector becomes:
+\begin{center}
+ $1 \leq j \leq 6$
+\end{center}
+\begin{equation}
+\begin{array}{r c l}
+F_{j} & = & \displaystyle
+\iint_{\Gamma_b \cap \hat{E} }
+\dfrac{1}{ \rho c } \left( G + \overrightarrow{\tau}_b . \overrightarrow{u}_b \right) L_j
+\vert J \vert d\hat{S}\\
+\\
+& \simeq & \displaystyle
+\sum_{g=1}^3  W_g \vert J_g \vert 
+\dfrac{1}{ \rho c } \left( G(g) + \overrightarrow{\tau}_b(g) . \overrightarrow{u}_b(g)\right) L_j(g)
+\end{array}
+\end{equation}
+Only the nodal functions assigned to the nodes on $\Gamma_b$ are involved.
+
+			\subsubsection{Transient}
+			
+The transient load vector has the following shape\footnote{NB: $T_i$ stands for the time step $i$ temperature field}:
+
+\begin{equation}
+\displaystyle F_{j} =\iint_{E} T_i  \theta_j \vert J \vert dV
+\end{equation}
+\\
+We now use gaussian points for the integration :
+
+\begin{center}
+$1 \leq j \leq 6$ 
+\end{center}
+\medskip
+\begin{equation}
+\begin{array}{c l}
+\displaystyle
+F_{j} & \displaystyle = 
+\iint_{\hat{E}} T_i  L_j \vert J \vert d\hat{V}\\
+\\
+& \displaystyle \simeq
+\sum_{g=1}^6  W_g T_i(g) L_j(g)  \vert J_g \vert 
+\end{array}
+\end{equation}
+
+
+\newpage
+\chapter{Prognostic Finite Element Formulation}
+
+	\section{Introduction: presentation of the problem}
+	
+For transient computation, one uses a finite differences time domain scheme. For each time step, the velocity is computed as well as the temperature (taken as transient). But to compute the next time step, one needs to update the glacier's geometry: the thickness evolution is required. This is done thanks to equation (\ref{prognosticequation}):
+
+\begin{equation}
+\dfrac{\partial H}{\partial t} = - div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right)+ \dot{M}_s - \dot{M}_b
+\label{prog1}
+\end{equation}
+\\
+We implemented this model using an implicit finite difference approximation for time:
+
+\begin{equation}
+\dfrac{H\left(t_{i+1}\right) -H\left(t_{i}\right) }{\Delta t} \simeq - div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right)+ \dot{M}_s - \dot{M}_b
+\label{progBad}
+\end{equation}
+\\
+But doing so introduces a negative diffusion term that leads to unstable solutions. To avoid wiggly solutions, we use the classical technique of adding an  \emph{artificial diffusivity}. For a square ice shelf with an accumulation of 10 m/year it gives:
+\begin{figure}[H]
+  \centering \hspace*{-1cm}
+  \subfloat[Initial thickness]{\includegraphics[width=6.7cm]{progi.png}}  
+  \hspace*{-1cm}              
+  \subfloat[Final thickness]{\includegraphics[width=6.7cm]{prog2.png}}  
+  \hspace*{-1cm}
+  \subfloat[With artificial diffusivity]{\includegraphics[width=6.7cm]{prog1.png}}  
+\caption{Results of the prognostic model for a square ice shelf after 100 years}\label{prog}
+\end{figure}
+
+	\section{Why is the solution unstable?}
+	
+To make things simpler, we will consider a one-dimensional problem with a constant velocity $u$ with no melting and no accumulation:
+
+\begin{equation}
+\dfrac{\partial H}{\partial t}=-u\dfrac{\partial H}{\partial x}
+\label{prog2}
+\end{equation}
+\\
+With an implicit finite difference scheme for time, we are actually solving:
+
+\begin{equation}
+\dfrac{H\left(t_{i+1}\right) -H\left(t_{i}\right) }{\Delta t}
+=-u\dfrac{\partial H\left( t_i\right) }{\partial x}
+\label{prog3}
+\end{equation}
+\\
+A Taylor development to the order 2 gives:
+
+\begin{equation}
+\left.\dfrac{\partial H}{\partial t}\right|_{t_i}
+=\dfrac{H\left(t_{i+1}\right) -H\left(t_{i}\right) }{\Delta t} -\dfrac{\Delta t}{2}\left.\dfrac{\partial^2 H}{\partial t^2}\right|_{t_i} +\BigO{\Delta t^2}
+\label{taylor}
+\end{equation}
+\\
+Therefore, the exact solution of (\ref{prog2}) is:
+
+\begin{equation}
+\dfrac{H\left(t_{i+1}\right) -H\left(t_{i}\right) }{\Delta t} 
+= - u\dfrac{\partial H\left(t_i \right) }{\partial x}+\dfrac{\Delta t}{2}\left.\dfrac{\partial^2 H}{\partial t^2}\right|_{t_i} +\BigO{\Delta t^2}
+\label{prog4}
+\end{equation}
+\\
+But by solving (\ref{prog3}) only, we are actually neglecting the last term. By doing so, we are actually solving:
+
+\begin{equation}
+\dfrac{\partial H}{\partial t}
+=-u\dfrac{\partial H}{\partial x}\color{red} -\dfrac{\Delta t}{2}\dfrac{\partial^2 H}{\partial t^2}\color{black}
+\label{prog4}
+\end{equation}
+\\
+We have the following property (progressive waves equation):
+
+\begin{equation}
+\dfrac{\partial^2 H}{\partial t^2} 
+= \dfrac{\partial}{\partial t} \left( -u\dfrac{\partial H}{\partial x}\right)=u^2\dfrac{\partial^2 H}{\partial x^2}
+\end{equation}
+\\
+Therefore, the solution of (\ref{prog3}) is the same as the solution of the following diffusion equation in which the diffusion coefficient is negative:
+
+\begin{equation}
+\dfrac{\partial H}{\partial t}
+=-u\dfrac{\partial H}{\partial x}\color{red} -\dfrac{\Delta t}{2}u^2\dfrac{\partial^2 H}{\partial x^2}\color{black}
+\label{prog5}
+\end{equation}
+\\
+This negative diffusion term that leads to unstable solutions: progressive waves of $H$ (oscillations) are exponentially growing with time.
+
+	\section{Streamline upwind / Petrov Galerkin formulation}
+
+It can be shown that for finite differences, a cure for the unwanted wiggles is provided by use of upwind differences to approximate the convective term, which essentially introduces a truncation error having the form of a physical diffusion. This term is a "balancing-diffusion" that is counteracting the negative diffusion introduced by the truncation error. By so doing, the numerical solution will yield exact values at the nodes.
+In addition to directly adding a diffusion term, similar effects of stabilization can be achieved in finite difference through 
+According to Brooks and Hughes (1982), the artificial diffusion is only desirable and required in the direction of the
+flow vector. The schemes eliminated the crosswind diffusion, which unnecessarily overdiffuses. This technique is named the \emph{streamline upwind/Petrov-Galerkin} (SUPG) formulation.\\
+\\
+For finite elements, a conventional Galerkin finite element discretization is employed with the same additional artificial diffusion:
+
+\begin{equation}
+\dfrac{\partial H}{\partial t} = - div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right)+ \dot{M}_s - \dot{M}_b +div\left( \underline{\kappa}\; \overrightarrow{grad}H\right) 
+\label{prog2}
+\end{equation}
+\\
+where $\underline{\kappa}$ is a $2\times 2$ diffusivity tensor designed to diffuse along flowlines and minimize diffusion across flowlines. According to MacAyeal\cite{{Macayeal1997}} (p172), for a given element $E$ of the mesh it has the following expression:
+
+\begin{equation}
+\underline{\kappa}=\left(\dfrac{\sqrt{2Area(E)}}{2} \right) 
+\left[ 
+\begin{array}{c c}
+\displaystyle \dfrac{1}{3}\left| \sum_{i=1}^3 u_i\right| & 0\\
+0 & \displaystyle \dfrac{1}{3}\left| \sum_{i=1}^3 v_i\right| 
+\end{array}\right] =
+\left[ 
+\begin{array}{c c}
+\kappa_{xx} & 0\\
+0 & \kappa_{yy}
+\end{array}\right]
+\end{equation}
+\\
+where $\left( u_i v_i\right)$ are the nodal values of the depth averaged horizontal velocity components. The artificial diffusivity tensor is designed to give about the same damping as that which would be associated with upwind differencing if the finite-element mesh consisted of a 2d regular array of nodes similar to a finite difference grid. (The absolute value of the local velocity is used in defining $\underline{\kappa}$ to ensure the diffusivity will always be positive). The addition of artificial diffusion bumps the prognostic equation up to a higher order (two spatial derivatives instead of one are now involved), and this necessitates specifying additional boundary conditions. For our purposes, we might as well take $\overrightarrow{grad}H.\overrightarrow{n} = 0$ on all portions of $\partial \Omega$.
+
+        \section{Weak Formulation}
+Here, the domain $\Omega$ is a 2d domain (since $H$ only depends on $x$ and $y$). We define a kinematically admissible velocity field $\overrightarrow{\phi}$:
+
+\begin{equation}
+\phi(x,y)\in\lbrace H^{1}(\Omega\cup\partial\Omega)\rbrace
+\end{equation}
+\\
+For any function of this virtual field, we can take the product of the equation (\ref{prog2}) with $\phi$, and integrate this product over the domain. This gives us:
+
+\begin{equation}
+\iint_\Omega %triple
+\dfrac{\partial H}{\partial t}\phi + div \left( H \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right)\phi- \dot{M}_s\phi + \dot{M}_b\phi 
+-div\left( \underline{\kappa}\; \overrightarrow{grad}H_{i}\right) \phi
+d\Omega =0
+\end{equation}
+\\
+Exactly as in the transient thermal section,  one uses a finite differences time domain scheme to evaluate the transient term. For a given time step $n$, the transient term is computed implicitly\footnote{an implicit method is much more stable for this kind of equation} as follow:
+
+\begin{equation}
+\left. \dfrac{\partial H}{\partial t}\right|_{n} =\dfrac{H_{n}-H_{n-1}}{\Delta t }
+\end{equation}
+\\
+Where $\Delta t$ is the time difference between $t_{n}$ and $t_{n-1}$. The weak formuation becomes:
+
+\begin{equation}
+\iint_\Omega %triple
+ H_{i}\phi-H_{n-1}\phi + \Delta t\;div \left( H_{n} \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right)\phi- \Delta t\;\dot{M}_s\phi + \Delta t\;\dot{M}_b\phi 
+ -\Delta t\;div\left( \underline{\kappa}\; \overrightarrow{grad}H_{i}\right)\phi 
+d\Omega =0
+\end{equation}
+\\
+One can integrate by part the artifficial damping term:
+
+\begin{multline}
+\iint_\Omega %triple
+ H_{n}\phi + \Delta t\;div \left( H_{n} \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right)\phi 
++\Delta t\;\left(  \underline{\kappa}\; \overrightarrow{grad}H_{n}\right) .\overrightarrow{grad}\phi
+d\Omega =\\
+\iint_\Omega %triple
+H_{n-1}\phi+ \Delta t\;\dot{M}_s\phi - \Delta t\;\dot{M}_b\phi
+d\Omega
++
+\int_{\partial\Omega}
+\Delta t\; \left( \underline{\kappa}\; \overrightarrow{grad}H_{n}\right) .\overrightarrow{n}\phi dS
+d\Omega
+\end{multline}
+\\
+Using the boudary condition, the last term vanishes:
+
+\begin{equation}
+\iint_\Omega %triple
+ H_{n}\phi + \Delta t\;div \left( H_{n} \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right] \right)\phi 
++\Delta t\left(  \underline{\kappa}\; \overrightarrow{grad}H_{n}\right) .\overrightarrow{grad}\phi
+d\Omega =
+\iint_\Omega %triple
+H_{n-1}\phi+ \Delta t\dot{M}_s\phi - \Delta t\dot{M}_b\phi
+d\Omega
+\end{equation}
+
+					\section{Elementary stiffness matrix and load vector}
+Following the same method as in the previous chapters, we obtain the stiffness matrix as follows:
+
+\begin{equation}
+\begin{array}{l c l}
+\displaystyle K_{i,j} &\displaystyle = &
+\displaystyle \iint_{\Omega} 
+\phi_j \phi_i +\Delta t \;div \left( \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right]\phi_j \right)\phi_i
++\Delta t\left(\kappa_{xx}\dfrac{\partial \phi_j}{\partial x}\dfrac{\partial \phi_i}{\partial x}
++\kappa_{yy}\dfrac{\partial \phi_j}{\partial y}\dfrac{\partial \phi_i}{\partial y} \right) 
+d\Omega \\ 
+\\
+F_{i} &\displaystyle = & 
+\displaystyle \iint_\Omega %triple
+H_{n-1}\phi_i+ \Delta t\dot{M}_s\phi_i - \Delta t\dot{M}_b\phi_i
+d\Omega
+\end{array}
+\end{equation}
+\\
+We now decompose these two matrices over the reference elements and use gaussian points for the integration :
+
+\begin{center}
+ $1 \leq i \leq 3$ and  $1 \leq j \leq 3$ 
+\end{center}
+\medskip
+\begin{equation*}
+\begin{array}{c l}
+\displaystyle
+K_{i,j} & \displaystyle = 
+\iint_{\hat{E}}
+ L_j  L_i 
+ +\Delta t \;div \left( \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right]L_j \right)L_i
++\Delta t\left(\kappa_{xx}\dfrac{\partial L_j}{\partial x}\dfrac{\partial L_i}{\partial x}
++\kappa_{yy}\dfrac{\partial L_j}{\partial y}\dfrac{\partial L_i}{\partial y} \right)
+ \vert J \vert d\hat{S}\\
+\\
+& \displaystyle \simeq
+\sum_{g=1}^3  W_g\left( 
+\underbrace{L_j  L_i}_{K1} 
+ +\underbrace{\Delta t \;\left. div  \left( \left[ \begin{array}{c}
+\bar{u} \\
+\bar{v}
+\end{array}\right]L_j \right) \right|_g L_i(g )}_{K2} 
++\underbrace{\Delta t\left(\kappa_{xx}\left.\dfrac{\partial L_j}{\partial x}\right|_g\left.\dfrac{\partial L_i}{\partial x}\right|_g
++\kappa_{yy}\left.\dfrac{\partial L_j}{\partial y}\right|_g\left.\dfrac{\partial L_i}{\partial y}\right|_g \right)}_{K3} 
+\right) \vert J_g \vert \\
+\\
+\displaystyle
+F_{i} & \displaystyle =
+\iint_{\hat{E}} H_{n-1}L_i+ \Delta t\dot{M}_s L_i - \Delta t\dot{M}_b L_i
+\vert J \vert d\Gamma \\
+\\
+& \displaystyle \simeq 
+\sum_{g=1}^3 \left(  H_{n-1}L_i(g)+ \Delta t\dot{M}_s L_i(g) - \Delta t\dot{M}_b L_i(g)\right)  \vert J_g \vert \delta(icesheet)\\
+\end{array}
+\end{equation*}
+
+\subsection{First term $K1$}
+
+This elementary stiffness matrix is calculated with three matrices: $\displaystyle K1= \sum_{g=1}^3 [B]^T[D][B]$ as follows:
+\begin{equation}
+[B]=\left[\begin{array}{c c c}
+B_1 & B_2 & B_3 
+\end{array}\right]\quad \text{and} \quad D=W_g \vert J_g \vert
+\end{equation}
+with:
+\begin{equation}
+B_i= L_i(g )
+\end{equation}
+
+\subsection{Second term $K2$}
+
+The second elementary stiffness matrix is computed as follows: $\displaystyle K2= \sum_{g=1}^3 [B]^T[D][B]+[B]^T[D'][B']$
+
+\begin{equation}
+[B]=\left[\begin{array}{c c c}
+B_1 & B_2 & B_3 
+\end{array}\right]
+\quad 
+[B']=\left[\begin{array}{c c c}
+B_1' & B_2' & B_3' 
+\end{array}\right]
+\end{equation}
+
+\begin{equation}
+D=\Delta t \;W_g \vert J_g \vert
+\left[\begin{array}{c c}
+\left.\dfrac{ \partial \overline{u}}{\partial \varphi_x}\right|_g & 0\\
+0 &  \left. \dfrac{\partial \overline{v}}{\partial \varphi_y}\right|_g
+\end{array}\right]
+\quad \text{and} \quad
+D'=\Delta t \;W_g \vert J_g \vert
+\left[\begin{array}{c c}
+\overline{u}(g) & 0\\
+0 &  \overline{v}(g)
+\end{array}\right]
+\end{equation}
+\\
+with:
+\begin{equation}
+B_i=
+\left[ \begin{array}{c}
+ L_i(g) \\
+ L_i(g) 
+\end{array}\right] 
+\quad \text{and} \quad B_i'=
+\left[ \begin{array}{c}
+\left.\dfrac{ \partial L_i}{\partial \varphi_x}\right|_g \\
+ \left.\dfrac{ \partial L_i}{\partial \varphi_y}\right|_g
+\end{array}\right]
+\end{equation}
+
+\subsection{Third term $K3$}
+
+The third elementary stiffness matrix is computed with three matrices: $\displaystyle K3= \sum_{g=1}^3 [B]^T[D][B]$ as follows:
+
+\begin{equation}
+[B]=\left[\begin{array}{c c c }
+B_1 & B_2 & B_3 
+\end{array}\right]\quad \text{and} \quad D=\Delta t \;W_g \vert J_g \vert \underline{\kappa}
+\end{equation}
+with:
+\begin{equation}
+B_i= \left[\begin{array}{c }
+\left.\dfrac{ \partial L_i}{\partial \varphi_x}\right|_g \\
+ \left.\dfrac{ \partial L_i}{\partial \varphi_y}\right|_g
+\end{array}\right]
+\end{equation}
+
+	\section{A comment on $\Delta t$}
+
+According to MacAyeal\cite{{Macayeal1997}} (p175), the implicit time-stepping scheme suggests that the solution of the prognostic (mass balance) equation should be stable for any time-step size. In practice, the time-step size should be chosen so that all imaginary passive-tracer particles initially released at the nodal points (except those starting at ice-front nodes) remain confined by one single element throughout the time span $\left[t,t+\Delta t \right]$. In other words, it is best to choose a $\Delta t$ small enough so that the distance traveled by one of these imaginary passive-tracer particles
+will not exceed the mesh spacing. In circumstances where the velocity field of the ice shelf changes substantially through the time, it may be wise to
+consider adaptively modifying $\Delta t$ during the simulation. The time-step size should follow the rule:
+
+\begin{equation}
+\Delta t = \dfrac{\frac{\Delta L}{\sqrt{2}}}{2\max\left(v\right) }
+\end{equation}
+\\
+where $\Delta L$ is the nondimensional size of the finite-element mesh spacing (shortest distance between node points in the regular mesh). The idea of the above equation is that $\Delta t$ is just large enough so that the fastest moving passive-tracer particle will move half the distance along a diagonal trajectory across a typical triangular element.
+\newpage
+\chapter{Penalty Method}
+\label{chappenalty}
+\section{Introduction}
+
+Penalty method is a well known method which is often applied in finite element analysis of contact problems (See Wriggers \cite{Wriggers2002}). A penalty term, which can be interpreted as a spring with a very large stiffness, is added to the energy so that when a constraint is not fulfilled, the energy is much higher than it should be. Thanks to this penalized energy, a state that minimizes the energy is also a state that respects the constraints. Since finite element is a method that tries to minimize the energy of a system, the penalty forces the model to be properly constrained. In $ISSM$, penalties are used beween 2d and 3d meshes (horizontal velocities), bewteen 2d and 2d meshes (basal vertical velocity), bewteen 3d and 3d meshes (vertical velocity and temperature), and for melting.
+
+\section{Constraining velocities of two meshes}
+The first exemple of penalty used in $ISSM$ is between the 2d and the 3d model (to compute the horizontal velocity $\left(u,v \right) $). In the same mesh, one wants to compute the velocity field with a 2d model on one part of the mesh, and with a 3d model on the other. We start from a 2d mesh, the grids on the boundary between the 2d model and the 3d model are splitted into 2 grids. Then, the part of the mesh assigned to compute the 3d model is extruded into several layers in order to compute have a 3d mesh. For example, one can have the following geometry:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=11.5cm]{meshpenalty.png}
+\caption{Mesh of a system coupling a 2d and a 3d model}
+\end{center}
+\end{figure}
+Although two different models are used, one wants to have a continuous velocity between the two part of the mesh. The penalties applied here are used to constrain the velocity of the 2d grids (in red) at the models interface to a value equal to the one of all the grids vertically extruded of the 3d mesh (blue). 
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=11.5cm]{penalties1.png}
+\caption{Applied penalties at the models interface}
+\end{center}
+\end{figure}
+\noindent
+To ensure that, one adds penalties to the energy of the system: when the velocity of one of the 2d grid on the boundary is not the same as the corresponding 3d grids the energy must increase. Here, we have 10 red grids and for each red grid there are 10 blue grids (there are 10 layers). Therefore, there are 100 pair of grids and one wants the velocity of each grid to be the same as its pair. The penalized energy has the following expression (for the sake of simplicity, only one component is represented):
+
+\begin{equation}
+E=
+\left[ U\right] ^T \left[K \right] \left[U\right] +\left[U\right] ^T \left[F\right] 
++
+\color{red}\sum^{red\;grids}_{n=1}
+\color{black}\left( 
+\color{blue}\sum^{layers}_{l=1}
+\color{black}\kappa
+\left(\color{red}u_n\color{black}-\color{blue}u_{nl}\color{black} \right)^2
+\right) 
+\end{equation}
+\\
+Where $K$ and $F$ are the stiffness matrix and the load vetor of the system, $U$ is the velocity of the grids, and $\kappa$ is the penalty term: a very large number compared to $K_{ij}$ so that the energy of the system explode when one $\color{red}u_n$ is two far from its corresponding $\color{blue}u_{nl}$ (ie. when the velocities of the 2 grids belonging to the same pair of grids are not equal). From now on, we will explain the penalty method only for one pair of grids. The general case can be easily found by reproducing the following pattern for every pair of grids. The penalized energy is:
+
+\begin{equation}
+E=
+\left[ U\right] ^T \left[K \right] \left[U\right] +\left[U\right] ^T \left[F\right] 
++
+\kappa
+\left(\color{red}u_{red}\color{black}-\color{blue}u_{blue}\color{black} \right)^2
+\end{equation}
+\\
+We can transform this expression as follows:
+
+\begin{equation}
+E=
+\left[
+\begin{array}{c} %U
+\vdots \\
+u_j\\
+\vdots\\
+\end{array}
+\right]^T
+\left[
+\begin{array}{c c c} %K
+& \vdots &  \\
+\cdots & K_{ij} &  \cdots\\
+& \vdots & \\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+u_j\\
+\vdots\\
+\end{array}
+\right]
++\left[
+\begin{array}{c} %U
+\vdots \\
+u_j\\
+\vdots\\
+\end{array}
+\right]^T
+\left[
+\begin{array}{c} %U
+\vdots \\
+F_j\\
+\vdots\\
+\end{array}
+\right]
++
+\left[
+\begin{array}{c} %U
+\color{red}u_{red}\\
+\color{blue}u_{blue}\\
+\end{array}
+\right]^T
+\left[
+\begin{array}{c c} %K
+\kappa & -\kappa \\
+-\kappa & \kappa\\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\color{red}u_{red}\\
+\color{blue}u_{blue}\\
+\end{array}
+\right]
+\end{equation}
+\\
+Finally one can concatenate the stiffness matrix with the penalty matrix:
+
+\begin{equation}
+E=
+\left[
+\begin{array}{c} %U
+\vdots \\
+\color{red}u_{red}\\
+\vdots\\
+\color{blue}u_{blue}\\
+\vdots
+\end{array}
+\right]^T
+\left[
+\begin{array}{c c c c c} %K
+& \vdots & \vdots & \vdots & \\
+\cdots & K_{rr}+\kappa & \cdots & K_{rb}-\kappa & \cdots\\
+& \vdots & \vdots & \vdots& \\
+\cdots &  K_{br}-\kappa & \cdots & K_{bb}+\kappa & \cdots\\
+& \vdots & \vdots & \vdots &
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+\color{red}u_{red}\\
+\vdots\\
+\color{blue}u_{blue}\\
+\vdots
+\end{array}
+\right]+\left[
+\begin{array}{c} %U
+\vdots \\
+u_j\\
+\vdots\\
+\end{array}
+\right]^T
+\left[
+\begin{array}{c} %U
+\vdots \\
+F_j\\
+\vdots\\
+\end{array}
+\right]
+\end{equation}
+\\
+Given that energy, the linear system to solve is:
+
+\begin{equation}
+\begin{array}{|c c c|}
+\hline
+&&\\
+&\left[
+\begin{array}{c c c c c} %K
+& \vdots & \vdots & \vdots & \\
+\cdots & K_{rr}+\kappa & \cdots & K_{rb}-\kappa & \cdots\\
+& \vdots & \vdots & \vdots& \\
+\cdots &  K_{br}-\kappa & \cdots & K_{bb}+\kappa & \cdots\\
+& \vdots & \vdots & \vdots &
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+\color{red}u_{red}\\
+\vdots\\
+\color{blue}u_{blue}\\
+\vdots
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %U
+\vdots \\
+F_j\\
+\vdots\\
+\end{array}
+\right]&\\
+&&\\
+\hline
+\end{array}
+\end{equation}
+\\
+Since $\kappa$ is much larger that $K_{ij}$, the first equation that links $\color{red}u_{red}$ to $\color{blue}u_{blue}$:
+
+\begin{equation}
+\sum_{i=1}^{n}K_{ir}u_i +\kappa\left( \color{red}u_{red}\color{black}-\color{blue}u_{blue}\color{black}\right)=F_r
+\end{equation}
+\\
+To the zero order:
+
+\begin{equation}
+\kappa\left( \color{red}u_{red}\color{black}-\color{blue}u_{blue} \color{black}\right)=0 
+\hspace{1cm} \Longleftrightarrow \hspace{1cm} 
+\color{red}u_{red}\color{black} =\color{blue}u_{blue}\color{black}
+\end{equation}
+\\
+We see that the penalized stiffness matrix ensure that the velocities of the grids pair is the same. The exact same process is used between two 2d meshes (basal vertical velocity) and two 3d meshes (temperature or vertical velocity). The crucial step is to build the pairs of grids and then add penalties on the corresponding rows and clumns of the stiffness matrix.\\
+\\
+Here are the results for a square iceshelf. The upperview does not show any discontinuity in the velocity field:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=10cm]{penalized_vel_2.png}
+\caption{coupling between a 2d and a 3d model, upper view}
+\end{center}
+\end{figure}
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=10cm]{penalized_vel_3.png}
+\caption{coupling between a 2d and a 3d model, 3d view}
+\end{center}
+\end{figure}
+
+\section{Stokes model}
+\label{stokespenaltiessection}
+We have seen in section \ref{stokessection} that the boundary condition on ice/till interface for the vertical velocity was:
+\begin{equation}
+w=-\frac{\partial b}{\partial x}u-\frac{\partial b}{\partial y}v
+\end{equation}
+\\
+In order to apply this boundary condition, we use a penalty to connect the three components of the velocity.\\
+The equation of the penalty we have to add in the elementary matrix is:
+
+\begin{equation}
+\kappa \left( w+\frac{\partial b}{\partial x}u+\frac{\partial b}{\partial y}v\right)=0
+\end{equation}
+\\
+If we note $K$ the elementary stiffness matrix, and $F$ the elementary load vector , the system to solve with these penalties is:
+
+\begin{equation}
+\left[
+\begin{array}{c c c c c} %K
+& \vdots & \vdots & \vdots &  \\
+\cdots & K_{3i,3j-2}+\kappa\; n_x & K_{3i,3j-1}+\kappa\; n_y & K_{3i,3j}+\kappa  &  \cdots\\
+& \vdots & \vdots & \vdots & 
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+u_j\\
+v_j\\
+w_j\\
+\vdots\\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %U
+\vdots \\
+F_j\\
+\vdots
+\end{array}
+\right]\\
+\end{equation}
+\newpage
+\section{Thermal model}
+We have seen in section \ref{meltingsection} that the equation on the Ice/Till interface was:
+
+\begin{equation}
+\label{basalthermal}
+\left\{ \begin{array}{l}
+\displaystyle -k \left. \dfrac{\partial T}{\partial z}\right| _b =G + \overrightarrow{\tau}_b . \overrightarrow{u}_b - \rho L\dot{M}_b  \\
+\\
+\displaystyle \dot{M}_b\left( T-T_{pmp}\right) =0 \\
+\\
+\displaystyle T-T_{pmp} \leq 0 \\
+\\
+\displaystyle \dot{M}_b \geq 0 \\
+                 \end{array} \right.
+\end{equation}
+\\
+The third equation imposes the temperature to be below the pressure melting point $T_{pmp}$. One can use penalty to constrain the temperature. We will see that one can then use these penalties to deduce the melting rate.
+
+\subsection{Constraining temperature}
+The temperature of each grid must stay below the pressure melting point $T_{pmp}$. In the first step, it is assumed that the computed temperature is everywhere below $T_{pmp}$. The computed temperature is then compared to the pressure melting point. When a grid goes above $T_{pmp}$, one adds penalties in the stiffness matrix and in the load vector  to keep it at the pressure melting point as follows:
+
+\begin{equation}
+\begin{array}{|c c c|}
+\hline
+&&\\
+&
+\left[
+\begin{array}{c c c} %K
+& \vdots &  \\
+\cdots & K_{ij}+\kappa &  \cdots\\
+& \vdots & \\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+T_j\\
+\vdots\\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %U
+\vdots \\
+F_j+\kappa T_{pmp}\\
+\vdots\\
+\end{array}
+\right] &\\
+&&\\
+\hline
+\end{array}
+\end{equation}
+\\
+So that $T_j$ is constrained to $T_{pmp}$. One does that for all the grids above the pressure melting point. Then the temperature is computed again and compared to $T_{pmp}$. The grids above this temperature are the penalized, whereas those which were already penalized and present a temperature now below the pressure melting point are released. After several iterations, one finaly gets the temperature field.
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=11cm]{thermal_loop.png}
+\caption{Thermal Algotithm of $ISSM$}
+\end{center}
+\end{figure}
+
+\subsection{Basal melting}
+using the previous algorithm, one can solve the third equation of the system (\ref{basalthermal}). But the use of penalties allows also to compute melting. One a penalty is applied ($T$ reaches the pressure melting point), the system to solve is:
+
+\begin{equation}
+\left[
+\begin{array}{c c c} %K
+& \vdots &  \\
+\cdots & K_{ij} &  \cdots\\
+& \vdots & \\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+T_j\\
+\vdots\\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %U
+\vdots \\
+F_j+\kappa \left( T_{pmp}-T_j\right) \\
+\vdots\\
+\end{array}
+\right]
+\end{equation}
+\\
+We saw that the melting was not computed in the load vector. But one can use the previous load vector to deduce melting: the total load veclor (that includes basal melting) should have had the following expression:
+
+\begin{equation}
+\begin{array}{l c l}
+\displaystyle
+F_{j}^{tot} &=&\displaystyle
+\iiint_\Omega
+\left(  
+-\dfrac{\partial T}{\partial t} + \dfrac{\Phi}{ \rho c }
+\right) \theta_i  d\Omega 
++
+\iint_{\Gamma_b }
+\dfrac{1}{ \rho c } \left(G + \overrightarrow{\tau}_b . \overrightarrow{u}_b + \rho L\dot{M}_b\right) \theta_j
+dS\\
+\\
+&=&\displaystyle F_{j} +
+\dfrac{1}{ \rho c }\iint_{\Gamma_b }
+\rho L\dot{M}_b \theta_j
+dS\\
+\end{array}
+\end{equation}
+\\
+That gives a simple relation between the penalized load and basal melting:
+
+\begin{equation}
+\kappa \left( T_{pmp}-T_j\right)=
+\dfrac{L}{ c }\iint_{\Gamma_b } \dot{M}_b \theta_jdS
+\end{equation}
+\\
+We can use a 2d mesh (we are dealing with the glacier base only), to deduce $\dot{M}_{b_j}$:
+
+\begin{equation}
+\begin{array}{|c c c|}
+\hline
+&&\\
+&
+\left[
+\begin{array}{c c c} %K
+& \vdots &  \\
+\cdots & K'_{ij} &  \cdots\\
+& \vdots & \\
+\end{array}
+\right]
+\left[
+\begin{array}{c} %U
+\vdots \\
+\dot{M}_{b_j}\\
+\vdots\\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c} %U
+\vdots \\
+F'_j\\
+\vdots\\
+\end{array}
+\right]
+&\\
+&&\\
+\hline
+\end{array}
+\end{equation}
+\\
+with:
+
+\begin{equation}
+\begin{array}{|r c l|}
+\hline
+&&\\
+K'_{ij} & = & \displaystyle
+\dfrac{L}{c}\iint_{\Gamma_b }
+\theta_i\theta_j
+dS\\
+&&\\
+F'_{j} & = & \displaystyle
+\kappa \left( T_{pmp}-T_j\right)\\
+&&\\
+\hline
+\end{array}
+\end{equation}
+\\
+The grids where no penalty is applied (ie. the temperature is below the pressure melting point) are constrained to 0. Thanks to that we solved all the equations of the system (\ref{basalthermal}).
+
+\newpage
+\appendix
+\chapter{Reference Elements}
+In finite element models, rather than calculating the integrals for each element, one uses a \emph{Reference Element} $\hat{E}$, and a transformation $\varphi$ that transforms the reference element to the element $E$.
+
+	\section{One dimension, Segment}
+\label{RE1D}         
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{segment.png}
+\caption{Transformation from the reference segment, to the current segment of the mesh}
+\end{center}
+\end{figure}
+
+For any function $f(x)$, we have the following equation:
+
+\begin{equation}
+\int_E f(x)dx = \int_{\hat{E}} {f}(\varphi(r)) \vert  \varphi' \vert dr
+\end{equation}
+\\
+For the reference element $\hat{E}$, the nodal functions are:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle L_1(r)= -\frac{1}{2}r + \frac{1}{2}\\
+\\
+\displaystyle L_2(r)= \frac{1}{2}r + \frac{1}{2}\\
+\end{array}
+\end{equation}
+\\
+One can use these nodal functions to calculate the function $\varphi$:
+
+\begin{equation}
+\varphi(r)= x_1 L_1(r) +  x_2 L_2(r)\\
+\end{equation}
+So,
+\begin{equation}
+\varphi(r)= \frac{1}{2}\left( - x_1 + x_2\right) r +\frac{1}{2}\left( x_1+x_2\right)\\
+\end{equation}
+\\
+The derivative of $ \varphi$  is :
+\begin{equation}
+\varphi'(r)=\frac{1}{2} \left( -x_1 + x_2 \right)\\
+\end{equation}
+
+
+
+\newpage
+	\section{Two dimensions, Triangle}	 
+\label{RE2D}      
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{triaelem.png}
+\caption{Transformation from the reference triangle, to the current element of the mesh}
+\end{center}
+\end{figure}
+For any function $f(x,y)$, we have the following equation:
+
+\begin{equation}
+\iint_E f(x,y)dS = \iint_{\hat{E}} \hat{f}(r,s) \vert J \vert dS
+\end{equation}
+\\
+Where $J$ is the Jacobian determinant of the $\varphi$ function.
+For the reference element $\hat{E}$, the nodal functions are:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle L_1(r,s)= -\frac{1}{2}r -\frac{\sqrt{3}}{6}s + \frac{1}{3}\\
+\\
+\displaystyle L_2(r,s)= \frac{1}{2}r -\frac{\sqrt{3}}{6}s + \frac{1}{3}\\
+\\
+\displaystyle L_3(r,s)= \frac{\sqrt{3}}{3}s + \frac{1}{3}\\
+\end{array}
+\end{equation}
+\\
+One can use these nodal functions to calculate the function $\varphi$:
+
+\begin{equation}
+\varphi(r,s)=
+\left\lbrace
+\begin{array}{l l}
+\displaystyle x= & x_1 L_1(r,s) +  x_2 L_2(r,s) +  x_3 L_3(r,s)\\
+\\
+\displaystyle y= & y_1 L_1(r,s) +  y_2 L_2(r,s) +  y_3 L_3(r,s) \\
+\end{array}
+\right.
+\end{equation}
+So,
+\begin{equation}
+\varphi(r,s)=
+\left\lbrace
+\begin{array}{l}
+\displaystyle 
+x = \left( - \frac{1}{2}x_1 + \frac{1}{2} x_2\right) r 
++ \left(-\frac{\sqrt{3}}{6}x_1 -\frac{\sqrt{3}}{6}x_2+\frac{\sqrt{3}}{3}x_3\right) s 
++\frac{1}{6}\left( 2x_1+2x_2+x_3 \right)\\
+\\
+\displaystyle 
+y=\left( - \frac{1}{2}y_1 + \frac{1}{2} y_2\right) r 
++ \left(-\frac{\sqrt{3}}{6}y_1 -\frac{\sqrt{3}}{6}y_2+\frac{\sqrt{3}}{3}y_3\right) s 
++\frac{1}{6}\left( 2y_1+2y_2+y_3 \right)
+ \\
+\end{array}
+\right.
+\end{equation}
+\\
+The Jacobian of the  $\varphi$ function is now easily computable:
+
+\begin{equation}
+J=
+\left[
+\begin{array}{c c}
+\displaystyle 
+\frac{\partial \varphi_x }{\partial r} & \displaystyle  \frac{\partial \varphi_x }{\partial s} \\
+\\
+\displaystyle 
+\frac{\partial \varphi_y }{\partial r} & \displaystyle  \frac{\partial \varphi_y }{\partial s} \\
+\end{array}
+\right]
+=
+\left[
+\begin{array}{c c}
+\displaystyle 
+\frac{1}{2}\left( x_2-x_1 \right) & \displaystyle  \frac{\sqrt{3}}{6}\left(2x_3-x_1-x_2\right) \\
+\\
+\displaystyle 
+\frac{1}{2}\left( y_2- y_1\right)& \displaystyle  \frac{\sqrt{3}}{6}\left(2y_3-y_1-y_2\right)
+ \\
+\end{array}
+\right]
+\end{equation}
+
+
+
+\newpage
+	\section{Two dimensions, Squares}	 
+\label{RE2D2}      
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{quadelem.png}
+\caption{Transformation from the reference quadrangle, to the current element of the mesh}
+\end{center}
+\end{figure}
+For any function $f(x,y)$, we have the following equation:
+
+\begin{equation}
+\iint_E f(x,z)dS = \iint_{\hat{E}} \hat{f}(r,s) \vert J \vert dS
+\end{equation}
+\\
+Where $J$ is the Jacobian determinant of the $\varphi$ function.
+For the reference element $\hat{E}$, the nodal functions are:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle L_1(r,s)= -\frac{1}{4} \left(r+1\right)\left(s-1\right)\\ 
+\\
+\displaystyle L_2(r,s)= \frac{1}{4} \left(r-1\right)\left(s-1\right)\\
+\\
+\displaystyle L_3(r,s)= - \frac{1}{4} \left(r-1\right)\left(s+1\right)\\
+\\
+\displaystyle L_4(r,s)= \frac{1}{4} \left(r+1\right)\left(s+1\right)\\
+\end{array}
+\end{equation}
+\\
+One can use these nodal functions to calculate the function $\varphi$:
+
+\begin{equation}
+\varphi(r,s)=
+\left\lbrace
+\begin{array}{l l}
+\displaystyle x= & x_1 L_1(r,s) +  x_2 L_2(r,s) +  x_3 L_3(r,s) +  x_4 L_4(r,s)\\
+\\
+\displaystyle z= & z_1 L_1(r,s) +  z_2 L_2(r,s) +  z_3 L_3(r,s)  +  z_4 L_4(r,s)\\
+\end{array}
+\right.
+\end{equation}
+So,
+\begin{equation}
+\varphi(r,s)=
+\left\lbrace
+\begin{array}{r c l}
+\displaystyle 
+x & = &\displaystyle \frac{1}{4}\left(  -x_1 +  x_2 -  x_3 + x_4\right) rs 
++ \frac{1}{4}\left(x_1 -x_2-x_3 +x_4\right) r\\
+\\
+&& 
+\displaystyle + \frac{1}{4}\left(-x_1 -x_2+x_3+ x_4\right) s 
++ \frac{1}{4}\left(x_1 +x_2+x_3 + x_4\right) 
+\\
+\displaystyle
+\\ 
+z & = &\displaystyle \frac{1}{4}\left(  -z_1 +  z_2 -  z_3 + z_4\right) rs 
++ \frac{1}{4}\left(z_1 -z_2-z_3 +z_4\right) r\\
+\\
+&& 
+\displaystyle + \frac{1}{4}\left(-z_1 -z_2+z_3+ z_4\right) s 
++ \frac{1}{4}\left(z_1 +z_2+z_3 + z_4\right) 
+ \\
+\end{array}
+\right.
+\end{equation}
+\\
+The Jacobian of the  $\varphi$ function is now easily computable:
+
+\begin{equation}
+J=
+\left[
+\begin{array}{c c}
+\displaystyle 
+\frac{\partial \varphi_x }{\partial r} & \displaystyle  \frac{\partial \varphi_x }{\partial s} \\
+\\
+\displaystyle 
+\frac{\partial \varphi_y }{\partial r} & \displaystyle  \frac{\partial \varphi_y }{\partial s} \\
+\end{array}
+\right]
+\end{equation}
+\\
+\begin{equation}
+\begin{array}{c}
+\displaystyle J_{11}= 
+\frac{1}{4} \left(- x_1+x_2 - x_3 + x_4 \right) s + \frac{1}{4}\left(  x_1 -  x_2 - x_3 +x_4\right)\\
+\\
+\displaystyle J_{12}=  \frac{1}{4}\left(  -x_1 +  x_2 -  x_3 + x_4 \right) r + \frac{1}{4}\left( - x_1 - x_2 + x_3 + x_4 \right) \\ 
+\\
+\displaystyle J_{12}= 
+\frac{1}{4} \left(- z_1+z_2 - z_3 + z_4 \right) s + \frac{1}{4}\left(  z_1 -  z_2 - z_3 +z_4\right)\\
+\\
+\displaystyle J_{22}=  \frac{1}{4}\left(  -z_1 +  z_2 -  z_3 + z_4 \right) r + \frac{1}{4}\left( - z_1 - z_2 + z_3 + z_4 \right) \\ 
+\\
+\end{array}
+\end{equation}
+
+\newpage
+	\section{Three dimensions, tetrahedron}	
+\label{RE3D1}   
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{tetraelem.png}
+\caption{Transformation from the reference element, to the current pentahedron of the mesh}
+\end{center}
+\end{figure}
+For any function $f(x,y,z)$, the transformation verifies:
+
+\begin{equation}
+\iiint_E f(x,y,z)dV = \iiint_{\hat{E}} \hat{f}(r,s,\zeta) \vert J \vert d\hat{V}
+\end{equation}
+\\
+Where $J$ is the Jacobian determinant of the $\varphi$ function.
+For the reference element $\hat{E}$, the nodal functions are:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle L_1(r,s,\zeta)= \dfrac{1}{2}\left( 1-r-\dfrac{1}{\sqrt{3}}s-\dfrac{1}{\sqrt{6}}\zeta\right)\\
+\\
+\displaystyle L_2(r,s,\zeta)= \dfrac{1}{2}\left( 1+r-\dfrac{1}{\sqrt{3}}s-\dfrac{1}{\sqrt{6}}\zeta\right)\\
+\\
+\displaystyle L_3(r,s,\zeta)= \dfrac{1}{\sqrt{3}}\left( s-\dfrac{1}{\sqrt{8}}\zeta\right)\\
+\\
+\displaystyle L_4(r,s,\zeta)= \sqrt{\dfrac{3}{8}}\zeta\\
+\end{array}
+\end{equation}
+\\
+One can use these nodal functions to calculate the function $\varphi$:
+
+\begin{equation}
+\varphi(r,s)=
+\left\lbrace
+\begin{array}{l}
+\displaystyle x=\sum_{i=1}^4 x_i L_i(r,s,\zeta)\\
+\\
+\displaystyle y=\sum_{i=1}^4 y_i L_i(r,s,\zeta)\\
+\\
+\displaystyle z=\sum_{i=1}^4 z_i L_i(r,s,\zeta)\\
+\end{array}
+\right.
+\end{equation}
+For example, the first component of $\varphi(r,s,\zeta)$ is:
+\begin{equation*}
+\varphi_x(r,s,t)=
+\frac{1}{2}\left( x_1+x_2\right)
++ \frac{1}{2}\left( -x_1+x_2\right) r
++ \frac{1}{2\sqrt{3}} \left( -x_1-x_2+2 x_3\right)s
++ \frac{1}{2\sqrt{6}}\left( -x_1-x_2-x_3+x_4\right)\zeta
+\end{equation*}
+\\
+The 2 other components have exactly the same equation, except the the $x_i$ must be replaced by in turn $y_i$ and $z_i$.
+The Jacobian of the  $\varphi$ function is now easily computable:
+
+\begin{equation}
+J=
+\left[
+\begin{array}{c c c}
+\displaystyle 
+\frac{\partial \varphi_x }{\partial r} & \displaystyle  \frac{\partial \varphi_x }{\partial s} &  \displaystyle  \frac{\partial \varphi_x }{\partial \zeta} \\
+\\
+\displaystyle 
+\frac{\partial \varphi_y }{\partial r} & \displaystyle  \frac{\partial \varphi_y }{\partial s} &  \displaystyle  \frac{\partial \varphi_y }{\partial \zeta}  \\
+\\
+\displaystyle 
+\frac{\partial \varphi_z }{\partial r} & \displaystyle  \frac{\partial \varphi_z }{\partial s} &  \displaystyle  \frac{\partial \varphi_z }{\partial \zeta}  \\
+\end{array}
+\right]
+\end{equation}
+\\
+with:
+\begin{equation*}
+\begin{array}{l l l}
+\displaystyle 
+J_{11}= 
+ \frac{1}{2}\left( -x_1+x_2\right) &
+J_{21}=   \displaystyle 
+\frac{1}{2}\left( -y_1+y_2\right) &
+J_{31}=    \displaystyle 
+\frac{1}{2}\left( -z_1+z_2\right) \\
+\\
+J_{12}= \displaystyle  
+\frac{1}{2\sqrt{3}} \left( -x_1-x_2+2 x_3\right)&
+J_{22}=  \displaystyle 
+\frac{1}{2\sqrt{3}} \left( -y_1-y_2+2 y_3\right)&
+J_{32}=  \displaystyle 
+\frac{1}{2\sqrt{3}} \left( -z_1-z_2+2 z_3\right)\\
+\\
+J_{31}=  \displaystyle  
+\frac{1}{2\sqrt{6}}\left( -x_1-x_2-x_3+x_4\right))& 
+J_{32}=  \displaystyle 
+\frac{1}{2\sqrt{6}}\left( -x_1-y_2-x_3+y_4\right)& 
+J_{33}=  \displaystyle 
+\frac{1}{2\sqrt{6}}\left( -z_1-z_2-z_3+z_4\right)\\ 
+\end{array}
+\end{equation*}
+\newpage
+
+	
+	
+	
+\newpage
+	\section{Three dimensions, pentahedron}	
+\label{RE3D}   
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{pentaelem.png}
+\caption{Transformation from the reference element, to the current pentahedron of the mesh}
+\end{center}
+\end{figure}
+For any function $f(x,y,z)$, the transformation verifies:
+
+\begin{equation}
+\iiint_E f(x,y,z)dV = \iiint_{\hat{E}} \hat{f}(r,s,\zeta) \vert J \vert d\hat{V}
+\end{equation}
+\\
+Where $J$ is the Jacobian determinant of the $\varphi$ function.
+For the reference element $\hat{E}$, the nodal functions are:
+
+\begin{equation}
+\begin{array}{l}
+\displaystyle L_1(r,s,\zeta)= \left( -\frac{1}{2}r -\frac{\sqrt{3}}{6}s + \frac{1}{3}\right) \frac{1-\zeta}{2}\\
+\\
+\displaystyle L_2(r,s,\zeta)= \left(\frac{1}{2}r -\frac{\sqrt{3}}{6}s + \frac{1}{3}\right) \frac{1-\zeta}{2}\\
+\\
+\displaystyle L_3(r,s,\zeta)=\left( \frac{\sqrt{3}}{3}s + \frac{1}{3}\right) \frac{1-\zeta}{2}\\
+\\
+\displaystyle L_4(r,s,\zeta)= \left( -\frac{1}{2}r -\frac{\sqrt{3}}{6}s + \frac{1}{3}\right) \frac{\zeta+1}{2} \\
+\\
+\displaystyle L_5(r,s,\zeta)= \left(\frac{1}{2}r -\frac{\sqrt{3}}{6}s + \frac{1}{3}\right) \frac{\zeta+1}{2}\\
+\\
+\displaystyle L_6(r,s,\zeta)=\left( \frac{\sqrt{3}}{3}s + \frac{1}{3}\right) \frac{\zeta+1}{2}\\
+\end{array}
+\end{equation}
+\\
+One can use these nodal functions to calculate the function $\varphi$:
+
+\begin{equation}
+\varphi(r,s)=
+\left\lbrace
+\begin{array}{l}
+\displaystyle x=\sum_{i=1}^6 x_i L_i(r,s,\zeta)\\
+\\
+\displaystyle y=\sum_{i=1}^6 y_i L_i(r,s,\zeta)\\
+\\
+\displaystyle z=\sum_{i=1}^6 z_i L_i(r,s,\zeta)\\
+\end{array}
+\right.
+\end{equation}
+For example, the first component of $\varphi(r,s,\zeta)$ is:
+\begin{multline*}
+\varphi_x(r,s,t)=
+\frac{1}{6}\left( x_1+x_2+x_3+x_4+x_5+x_6 \right)
++ \frac{1}{4}\left( -x_1+x_2-x_4+x_5 \right) r \\
++ \frac{\sqrt{3}}{12} \left( -x_1-x_2+2 x_3- x_4- x_5+ 2 x_6 \right)s
++ \frac{1}{6}\left( -x_1-x_2-x_3+x_4+x_5+x_6 \right)\zeta\\ 
++ \frac{1}{4}\left( x_1-x_2-x_4+x_5 \right) r\zeta
++ \frac{\sqrt{3}}{12} \left( x_1+x_2- 2 x_3- x_4- x_5+2 x_6 \right)s\zeta\\ 
+\end{multline*}
+\\
+The 2 other components have exactly the same equation, except the the $x_i$ must be replaced by in turn $y_i$ and $z_i$.
+The Jacobian of the  $\varphi$ function is now easily computable:
+
+\begin{equation}
+J=
+\left[
+\begin{array}{c c c}
+\displaystyle 
+\frac{\partial \varphi_x }{\partial r} & \displaystyle  \frac{\partial \varphi_x }{\partial s} &  \displaystyle  \frac{\partial \varphi_x }{\partial \zeta} \\
+\\
+\displaystyle 
+\frac{\partial \varphi_y }{\partial r} & \displaystyle  \frac{\partial \varphi_y }{\partial s} &  \displaystyle  \frac{\partial \varphi_y }{\partial \zeta}  \\
+\\
+\displaystyle 
+\frac{\partial \varphi_z }{\partial r} & \displaystyle  \frac{\partial \varphi_z }{\partial s} &  \displaystyle  \frac{\partial \varphi_z }{\partial \zeta}  \\
+\end{array}
+\right]
+\end{equation}
+\\
+with:
+\begin{equation*}
+\begin{array}{c l}
+\displaystyle 
+J_{11}= &  \displaystyle 
+ \frac{1}{4}\left( -x_1+x_2-x_4+x_5 \right)+ \frac{1}{4}\left( x_1-x_2-x_4+x_5 \right) \zeta \\
+\\
+J_{21}= &  \displaystyle 
+ \frac{1}{4}\left( -y_1+y_2-y_4+y_5 \right)+ \frac{1}{4}\left( y_1-y_2-y_4+y_5 \right) \zeta \\
+\\
+J_{31}= &    \displaystyle 
+ \frac{1}{4}\left( -z_1+z_2-z_4+z_5 \right)+ \frac{1}{4}\left( z_1-z_2-z_4+z_5 \right) \zeta \\
+\end{array}
+\end{equation*}
+\begin{equation}
+\begin{array}{c l}
+J_{12}= &  \displaystyle  
+\frac{\sqrt{3}}{12} \left( -x_1-x_2+2 x_3- x_4- x_5+ 2 x_6 \right)+ \frac{\sqrt{3}}{12} \left( x_1+x_2- 2 x_3- x_4- x_5+2 x_6 \right)\zeta\\
+\\
+J_{22}= &  \displaystyle 
+\frac{\sqrt{3}}{12} \left( -y_1-y_2+2 y_3- y_4- y_5+ 2 y_6 \right)+ \frac{\sqrt{3}}{12} \left( y_1+y_2- 2 y_3- y_4- y_5+2 y_6 \right)\zeta\\
+\\
+J_{32}= &  \displaystyle 
+\frac{\sqrt{3}}{12} \left( -z_1-z_2+2 z_3- z_4- z_5+ 2 z_6 \right)+ \frac{\sqrt{3}}{12} \left( z_1+z_2 - 2 z_3- z_4- z_5+2 z_6 \right)\zeta\\
+\end{array}
+\end{equation}
+\begin{equation*}
+\begin{array}{c l}
+J_{13}= &  \displaystyle  
+\frac{1}{4}\left( x_1-x_2-x_4+x_5 \right) r
++ \frac{\sqrt{3}}{12} \left( x_1+x_2- 2 x_3- x_4- x_5+2 x_6 \right)s
++ \frac{1}{6}\left( -x_1-x_2-x_3+x_4+x_5+x_6 \right)\\ 
+\\
+J_{32}= &  \displaystyle 
+\frac{1}{4}\left( y_1-y_2-y_4+y_5 \right) r
++ \frac{\sqrt{3}}{12} \left( y_1+y_2- 2 y_3- y_4- y_5+2 y_6 \right)s
++ \frac{1}{6}\left( -y_1-y_2-y_3+y_4+y_5+y_6 \right)\\ 
+\\
+J_{33}= &  \displaystyle 
+\frac{1}{4}\left( z_1-z_2-z_4+z_5 \right) r
++ \frac{\sqrt{3}}{12} \left( z_1+z_2- 2 z_3- z_4- z_5+2 z_6 \right)s
++ \frac{1}{6}\left( -z_1-z_2-z_3+z_4+z_5+z_6 \right)\\ 
+\\
+\end{array}
+\end{equation*}
+\newpage
+	\section{MINI element}
+\label{MINI}   
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=8cm]{MINI.png}
+\caption{MINI element}
+\end{center}
+\end{figure}
+The MINI element is an extruded triangular element with continuous velocity and pressure approximations. Introduced by Arnold et al. (1984), the MINI element
+satisfies the LLB conditions (Ladyzhenskaya-Babuska-Brezzi, See Nowicki \cite{Nowicki2007} for more details), and therefore results in stable velocities and pressure.\\
+\\
+The MINI element is based on a extruded straight-sided triangular element (called P1-P1), which has a node at each vertex. In the MINI element, the pressure and velocity are approximated via
+
+\begin{equation}
+\begin{array}{r c l}
+P\left(x,y,z \right)  & = & \displaystyle \sum_{i=1}^6 P_j \phi_j\left(x,y,z \right) \\
+\\
+u\left(x,y,z \right)  & = & \displaystyle \sum_{i=1}^6 u_j \phi_j\left(x,y,z \right) +u_b \phi_b\left(x,y,z \right)  \\
+\\
+v\left(x,y,z \right)  & = & \displaystyle \sum_{i=1}^6 v_j \phi_j\left(x,y,z \right) +v_b \phi_b\left(x,y,z \right)  \\
+\\
+w\left(x,y,z \right)  & = & \displaystyle \sum_{i=1}^6 w_j \phi_j\left(x,y,z \right) +w_b \phi_b\left(x,y,z \right)
+\end{array}
+\end{equation}
+\\
+The $\phi_j$ functions has the same shape as in the pentahedron (\ref{RE3D}). Therefore, the transformation $\varphi$ that transforms the reference element to the element $E$ has exactly the same shape as inthe previous section (\ref{RE3D}).\\
+\\
+The nodal function $ \phi_b\left(x,y,z \right)$ is called bubble function. According to Nowicki \cite{Nowicki2007} and Guillem \cite{Guillen2005}, the bubble shape function in a reference element $ L_b\left(x,y,z \right)$ is:
+
+\begin{equation}
+L_b\left(x,y,z \right)=27\left( -\frac{1}{2}r -\frac{\sqrt{3}}{6}s + \frac{1}{3}\right)\left(\frac{1}{2}r -\frac{\sqrt{3}}{6}s + \frac{1}{3}\right)\left( \frac{\sqrt{3}}{3}s + \frac{1}{3}\right)\left( \zeta+1\right)\left(1- \zeta\right)
+\end{equation}
+\\
+$ \phi_b\left(x,y,z \right)$ is equal to 1 at the center of the element (due to the factor $27$), and vanishes at the element boundary.
+
+\newpage
+
+
+
+
+\chapter{Parameters and constants}
+
+\begin{center}
+\begin{longtable}{l l l l}
+\hline
+\hline
+\multicolumn{1}{c}{Parameter} & \multicolumn{1}{c}{Symbol} & \multicolumn{1}{c}{Unit} & \multicolumn{1}{c}{Value}\\
+\hline
+\\
+Glacier's lower surface z-coordinate & $b$ & m &\\
+Glen's flow law viscosity parameter & $B$ & MPa a\textsuperscript{1/n}\\
+Ice specific heat capacity & $c$ & J kg\textsuperscript{-1} K\textsuperscript{-1}  & 2093\\
+Mixed layer specific heat & $c_{pM}$ & J kg\textsuperscript{-1} K\textsuperscript{-1}  & 3974\\
+Acceleration due to gravity & $g$ & m s\textsuperscript{-1} & 9.81\\
+Geothermal heat flux & $G$ & W m\textsuperscript{-2} & $\sim$0.05\\
+Glacier's Height &$H$ & m &\\
+Ice thermal conductivity & $k$ & W m\textsuperscript{-1} K\textsuperscript{-1} & 2.4\\
+Basal drag parameter & $K$ & Pa\textsuperscript{$\frac{1-r}{2}$} s\textsuperscript{$\frac{s}{2}$} m\textsuperscript{$-\frac{s}{2}$} &\\
+Ice specific latent heat of fusion & $L$ & J kg\textsuperscript{-1} & 3.34 $\times$ 10\textsuperscript{5}\\
+Mass production term ($m/a$ ice equivalent) & $\dot{M}$ & m a\textsuperscript{-1} &\\
+Melting ($m/a$ ice equivalent) & $\dot{M}_b$ & m a\textsuperscript{-1} &\\
+Accumulation ($m/a$ ice equivalent) & $\dot{M}_s$ & m a\textsuperscript{-1} &\\
+Glen's flow law exponent & $n$ & dimensionless\\
+Normal vector x-component & $n_x$ & dimensionless &\\
+Normal vector y-component & $n_y$ & dimensionless &\\
+Normal vector z-component & $n_z$ & dimensionless &\\
+Normal vector pointing outward from the galcier & $\overrightarrow{n}$ & dimensionless &\\
+Effective pressure & $N_{eff}$ & Pa &\\
+Basal drag first exponent & $p$ & dimensionless &\\
+Ice pressure & $P$ & Pa &\\
+Atmosphere pressure & $P_{air}$ & Pa &\\
+Water pressure & $P_w$ & Pa &\\
+Basal drag second exponent & $q$ & dimensionless &\\
+Glacier's upper surface z-coordinate & $s$ & m &\\
+Ice temperature & $T$ & K &\\
+Glacier base temperature & $T_{b}$ & K &\\
+Pressure melting point & $T_{pmp}$ & K &\\
+Ice velocity x-component& $u$ & m s\textsuperscript{-1} &\\
+Depth averaged ice velocity x-component& $\overline{u}$ & m s\textsuperscript{-1} &\\
+Basal velocity x-component& $u_b$ & m s\textsuperscript{-1} &\\
+Basal velocity parallel to the bedrock surface & $\overrightarrow{u_b}$ & m s\textsuperscript{-1} &\\
+Ice velocity y-component& $v$ & m s\textsuperscript{-1} &\\
+Depth averaged ice velocity y-component& $\overline{v}$ & m s\textsuperscript{-1} &\\
+Basal velocity y-component& $v_b$ & m s\textsuperscript{-1} &\\
+Ice velocity &$\overrightarrow{v}$ & m s\textsuperscript{-1}  &\\
+Ice velocity z-component& $w$ & m s\textsuperscript{-1} &\\
+Basal velocity z-component& $w_b$ & m s\textsuperscript{-1} &\\
+First horizontal coordinate & $x$ & m &\\
+Second horizontal coordinate & $y$ & m &\\
+Vertical coordinate & $z$ & m &\\
+Rate of change of melting point with pressure & $\beta$ & K Pa\textsuperscript{-1} & 9.8 $\times$ 10\textsuperscript{-8}\\
+Thermal exchange velocity & $\gamma$ & m s\textsuperscript{-1} & $\sim$1.00 $\times$ 10\textsuperscript{-4}\\
+Strain tensor & $\varepsilon$ & dimensionless &\\
+Strain rate tensor & $\dot{\varepsilon}$ & s\textsuperscript{-1} &\\
+Effective strain rate tensor & $\dot{\varepsilon}_e $ & s\textsuperscript{-1} &\\
+Ice viscosity & $\mu$ & Pa s &\\
+Viscous heating & $\Phi$ & W m\textsuperscript{-3} &\\
+Ice density & $\rho$ & kg m\textsuperscript{-3} & 916\\
+Ice density & $\rho_i$ & kg m\textsuperscript{-3} & 916\\
+Water density & $\rho_w$ & kg m\textsuperscript{-3} & 1000\\
+Stress tensor & $\sigma$ & Pa &\\
+Deviatoric stress tensor & $\sigma'$ & Pa &\\
+Effective shear stress & $\sigma_e$ & Pa &\\
+Friction stress & $\overrightarrow{\tau_b}$ & Pa &\\
+\hline
+\end{longtable}
+\end{center}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+\newpage
+\begin{thebibliography}{99}
+
+\bibitem{Glen1955} \textsc{Glen} J. W.,\newblock \emph{The creep of polycrystalline ice}.  \newblock Proceedings of the Royal Society, London, 1955.
+  
+\bibitem{Guillen2005} \textsc{Guill\'en-Gonz\`alez} F., \textsc{Rodr\'iguez-G\'omez} D., \newblock \emph{Bubble finite elements for the primitive
+equations of the ocean}, Numerische Mathematik 101: 689-728, 2005.
+
+\bibitem{Holland1999} \textsc{Holland} D.M., \textsc{Jenkins} A., \newblock \emph{Modeling Thermodynamic Ice-Ocean Interactions at the Base of an Ice Shelf}.  \newblock J. Phys. Oceanogr., 29, 1787-1800, 1999.
+
+\bibitem{Hooke2005} \textsc{Hooke} Roger LeB.,  \newblock \emph{Principles of Glacier Mechanics}.  \newblock 2d                                                                                                  		Edition,Cambridge University Press, 2005.
+
+\bibitem{Hulbe1999} \textsc{Hulbe}, Christina L., \textsc{MacAyeal} Douglas  \newblock \emph{A new numerical model of coupled inland ice sheet, ice stream, and ice shelf flow and its application to the West Antarctique Ice Sheet}.  \newblock Journal of Geophysical Research, vol 104, B11, pages 25,349-25,366, November 10th, 1999.                                                                                                  		
+
+\bibitem{Larour2005} \textsc{Larour} \'Eric,  \newblock \emph{Mod\'elisation numerique du comportement des banquises 			flottantes, valid\'ee par imagerie satellitaire}.  \newblock Th\`ese de l'\'ecole doctorale de l'\'Ecole Centrale Paris, 2005.
+
+\bibitem{Macayeal1989} \textsc{MacAyeal} Douglas R.,  \newblock \emph{Large-scale Ice Flow Over a Viscous Basal Sediment: Theory and Application 
+}.  \newblock Journal of Geophysical Research-Solid Earth and Planets, 1989.
+
+\bibitem{Macayeal1997} \textsc{MacAyeal} Douglas R.,  \newblock \emph{EISMINT: Lessons in Ice-Sheet Modelling
+}. 21st May 1997.\\ \url{http://homepages.vub.ac.be/~phuybrec/pdf/MacAyeal.lessons.pdf}
+
+\bibitem{Nowicki2007} \textsc{Nowicki} Sophie M. J.,  \newblock \emph{Modelling the transition zone of marine ice sheets}, PhD Thesis of University College London, Centre for Polar Observation and Modelling Department of Space and Climate Physics, September 2007.
+
+\bibitem{Paterson1994} \textsc{Paterson} W. S. B.,  \newblock \emph{The Physics of glaciers}.  \newblock 3ieme 			Edition, Butterworth Heinemann, 1994.
+
+\bibitem{Pattyn2003} \textsc{Pattyn} F., \newblock \emph{A new three-dimensional higher-order thermomechanical ice sheet model: basic sensitivity, ice stream development and ice flow across subglacial lakes} \newblock Journal of Geophysical Research (Solid Earth), 2003
+
+\bibitem{Wriggers2002} \textsc{Wriggers} P., \newblock \emph{Computational Contact Mechanics} \newblock Springers 2d edition, 2002
+
+\bibitem{Zienkiewicz1994} \textsc{Zienkiewicz}, O.C. and \textsc{Taylor} R.L., \newblock \emph{The Finite Element Method} \newblock Fourth
+Edition. McGraw-Hill Book Company Europe. Berkshire England., 1994.
+\end{thebibliography}
+\end{document}
Index: /issm/trunk/doc/userguide/Makefile
===================================================================
--- /issm/trunk/doc/userguide/Makefile	(revision 1)
+++ /issm/trunk/doc/userguide/Makefile	(revision 1)
@@ -0,0 +1,23 @@
+#Makefile for ice documentation
+
+DEPENDENCIES=Amery.png  \
+			 Antarctica.png  \
+			 argus_DO.png  \
+			 argus_Front.png  \
+			 argus_GL.png  \
+			 argus_Islands.png  \
+			 argus_map.png  \
+			 argus.png  \
+			 contour.png  \
+			 layers.png  \
+			 userguide.tex
+
+all: userguide.pdf
+
+userguide.pdf:  $(DEPENDENCIES)
+	pdflatex userguide.tex
+	pdflatex userguide.tex
+	pdflatex userguide.tex
+
+clean: 
+	rm -rf *.dvi *.ps *.pdf *.toc *.log *.aux *.out
Index: /issm/trunk/doc/userguide/userguide.tex
===================================================================
--- /issm/trunk/doc/userguide/userguide.tex	(revision 1)
+++ /issm/trunk/doc/userguide/userguide.tex	(revision 1)
@@ -0,0 +1,1396 @@
+%%% Debut du preambule %%%
+
+\documentclass[letterpaper]{report}     % Classe du document
+\usepackage[T1]{fontenc}            % Encodage de sortie (l'encodage T1 convient mieux aux langues autres que l'Anglais)
+\usepackage{aeguill,aecompl}        % Fontes virtuelles (nuit aux recherches et aux copies de texte dans le document PDF) pour PDF:
+                                    % ameliore la qualite de la visualisation avec Acrobat Reader
+
+%\hypersetup{colorlinks=true,linkcolor=blue,citecolor=magenta}
+
+
+\title{ISSM documentation}
+\author{Larour, Morlighem, Seroussi, Khazendar}
+\date{2008}
+
+\usepackage{graphicx}                        % Inclusion d'images
+\usepackage{array, multirow}                 % Tableaux
+\usepackage{amsmath}                         % Mode mathematique
+\usepackage{amsfonts}                        % Polices mathematiques
+\usepackage{amssymb}                         % Symboles mathematiques
+\usepackage{makeidx}
+\usepackage{float}                           %Pour faire [H] sur les float
+\usepackage[left=3cm, right=3cm,
+                        top=2cm, bottom=2cm]{geometry}
+
+\usepackage{fancyhdr}
+
+\lhead{\leftmark{}} %en haut a gauche, titre de section
+\rhead{\thepage}   %en haut a droite, page
+\lfoot{NASA - Jet Propulsion Laboratory} %en bas a gauche
+\rfoot{\scriptsize{\today}} %en bas a droite
+\cfoot{ISSM Documentation} %en bas, au milieu
+\setcounter{tocdepth}{4}                     %pour afficher la table des matiere au niveau subsection
+\setcounter{secnumdepth}{4}
+
+
+\usepackage[plainpages=false]{hyperref}
+
+\hypersetup{% Links Options for the document%
+colorlinks=true,
+linkcolor=blue,
+urlcolor=blue,
+% anchorcolor=darkblue,
+citecolor=blue,
+plainpages=false,
+%PDF Options%
+pdftitle={Formulations},
+pdfauthor={Larour, Morlighem, Seroussi,Khazendar},
+pdfsubject={Numerical modelling of ice sheets}}
+
+\pagestyle{fancy}
+\bibliographystyle{plain}
+
+%%% Fin du preambule %%%
+\begin{document}
+%%Page de titre
+
+\thispagestyle{empty}
+
+\vspace{10cm}
+\begin{center}
+\bf \LARGE Ice Sheet System Model 2008\\ User Guide
+\end{center}
+
+\vspace{4cm}
+
+\begin{center}
+Authors:\\   
+\vspace{.5cm}
+{\bf \large \'Eric Larour$^{1}$} \\
+\smallskip
+{\bf \large Mathieu Morlighem$^{2,4}$} \\
+\smallskip
+{\bf \large H\'el\`ene Seroussi$^{2,4}$} \\
+\smallskip
+{\bf \large Ala Khazendar$^{2}$} \\
+\smallskip
+{\bf \large \'Eric Rignot$^{2,3}$} \\
+\vfill
+%\vspace{4.5cm}
+$^{1}$Division 35, Thermal and Cryogenics Section, \\
+Mechanical Division, MS 157-316.  \\
+Jet Propulsion Laboratory, 4800 Oak Grove Drive, Pasadena, CA 91109.\\
+\vspace{.2cm}
+$^{2}$Division 33, Radar Science and Enginnering Section, \\
+Communications, Tracking and Radar Division, MS 157-316.  \\
+Jet Propulsion Laboratory, 4800 Oak Grove Drive, Pasadena, CA 91109.\\
+\vspace{.2cm}
+$^{3}$University of California, Irvine\\
+Department of Earth System Science\\
+Croul Hall, Irvine, CA 92697-3100\\
+\vspace{.2cm}
+$^{4}$Laboratoire de M\'ecanique des sols, Structures et  mat\'eriaux (MSSMat)\\
+\'Ecole Centrale Paris, CNRS UMR 8579\\
+Grande Voie des Vignes, 92295 Châtenay-Malabry Cedex, FRANCE\\
+
+\vspace{0.5cm}
+\today
+\end{center}
+
+\cleardoublepage
+
+\begin{center}
+{\Large \bf Summary}
+\end{center}
+This manual explains how to use the ISSM code, capable of modeling ice flow 
+in 2d and 3d using finite elements. 
+
+\vspace{1cm}
+Key-words: ISSM, ice flow, finite elements, 2-D, 3-D, matlab
+
+\cleardoublepage
+\tableofcontents
+
+%\pagestyle{headings}
+%\chapter*{Introduction}
+%\markboth{CHAPTER 1: Introduction}{}
+%\vspace{.5in}
+
+\pagestyle{headings}
+\chapter{Installation}
+\markboth{CHAPTER 2: Installation}{}
+
+
+\vspace{.5in}
+
+\section{Fetching code from repository}  
+\label{Fetching_Code_From_Repository}
+
+$ISSM$ is actively managed using a code versioning  system called CVS. The code is stored in a repository, and can 
+be remotely fetched, modified, updated, and uploaded. This allows for multiple users to develop the code in an 
+organized way. In order to fetch a version of the code, users will need to install CVS on their machine. This versioning 
+system is available at the following address: \url{http://www.nongnu.org/cvs/}. 
+Once CVS, issue the following command:
+\begin{verbatim}> cvs -d useraccount@wilkes.jpl.nasa.gov:/home/larour/Ice_Repository  co -r ice2 -P ice1 \end{verbatim}
+This command will download the stable version of the code $ISSM$ named $ice2$ from the repository on the wilkes machine, located 
+in the $/home/larour/Ice_Repository$ directory, onto the current local directory (replace $useraccount$ by your user name on wilkes). Users are free to choose whichever location they want and to rename $ice1$.  Users should not forget the $-P$ option. Failing to do so would allow CVS to fetch empty directories. 
+This would result in a code structure not intended by the developers.
+
+\section{Setting up $ISSM$}  
+In the main directory of $ISSM$ (initially named $ice1$), open the file $install.sh$ and modify the configuration if you need to:
+\begin{itemize}
+\item $CONFIG="config\_linux32.mk"$ for a 32 bits linux OS, 
+\item $CONFIG="config\_linux64.mk"$ for a 64 bits linux OS,
+\item $CONFIG="config\_mac.mk"$ for Mac OS X
+\end{itemize}
+\noindent
+Once the configuration files are properly setup, users should type $sh install.sh$  at the top level directory ice1 to run the installation sequence (compiling $C$ routines and modifying the startup file).\medbreak
+\begin{verbatim}> sh  install.sh \end{verbatim} 
+
+\section{Code structure.}  
+\label{Code_Structure}
+
+$ISSM$ is a set of tools which can carry out various functions, all related to ice flow modeling. Its structure is apparent when 
+typing $ls\; -v$ at the command prompt.
+\begin{verbatim}CVS  CieloBindings  Cron  Doc  Etc  Makefile  Mesh  Model  Public  Solver  Tests  Trash
+Utils  archive.sh contributors.txt  install.sh  mailinglist  startup.m  todo\end{verbatim}
+The $CVS$ directory is proper to the versioning system. You can just ignore it. The startup.m file we already alluded to. 
+The code is mainly composed of a mesher (Mesh directory), a model structure (Model directory) to hold the mesh and other 
+input parameters to an ice flow model, and a solver (Solver directory) that works on the model itself. There is also a documentation
+(Doc directory) and a repository for old code (Trash directory). Finally, the Utils directory is a place holder for miscellaneous  
+code ranging from interpolation tools to display plotting routines, etc ...
+
+\pagestyle{headings}
+\chapter{Getting started}
+
+\markboth{CHAPTER 3: Getting started}{}
+
+
+\vspace{.5in}
+\section{Location of the $startup.m$ file}
+
+When matlab is launched, all the $ISSM$ tools need to be correctly located. This is done by the $startup.m$ file located in the $ice1$ directory.
+This file needs to be located in the starting directory of matlab, or in the directory where matlab will establish its root.
+
+\section{Creation of a model}  
+\label{Creation of a new model}
+To create a new model, you can type the following command in Matlab's Command window:
+\begin{verbatim}
+> md=model;
+\end{verbatim}
+That will create a new model named "md" whose class is "model". The structure of a model contains much information: the mesh, the boundary conditions, the materials' properties, the results of the runs, etc...\\
+\\
+When one creates a new model, all these fields are empty or $NaN$ (not a number), but "md" is ready to be used as a model. Type $md$ in the command window if you want Matlab to print the fields contained in $md$.\\
+\\
+One can add a note and/or a name to the model in order to remember easily what it deals with:
+\begin{verbatim}
+> md.name='PineIslandGlacier';
+> md=addnote(md,'Pine Island Glacier test 1, geometry of 1996');
+\end{verbatim}
+
+\section{Mesh and Geometry.}  
+\label{Mesh}
+
+\subsection{Required files.}  
+\label{required files}
+In order to set up properly the model, four files are required:
+\begin{itemize}
+\item A file that countains the coordinates of the domain outline, i.e. the domain one wishes to mesh: $DomainOutline.exp$. The contour must be closed and may contain holes.
+\item A file that contains the grounding line of the glacier: $Iceshelves.exp$. The contour must be closed and may contain holes.
+\item A file that contains the islands or ice rises in the ice shelf: $Islands.exp$. The contour must be closed and may contain holes.
+\item A file that contains all the properties of the ice, the constants used in the simulation and other parameters: $Parameters.par$.
+\end{itemize}
+Usually, the first 3 files (with an "exp" extension) come from ARGUS and have the following shape:
+\begin{verbatim}
+        ## Name:DomainOutline
+        ## Icon:0
+        # Points Count  Value
+        5 1.000000
+        # X pos Y pos
+        0 0
+        1000000 0
+        1000000 1000000
+        0 1000000
+        0 0
+\end{verbatim}
+The other file is a Matlab file that plugs all the parameters into the model $md$.
+
+\subsection{Meshing the domain}  
+\label{meshing the domain}
+To mesh the domain, you need the file 'DomainOutline.exp' from ARGUS as explained above. Once again, the contour described in this file must be closed and can contain holes if needed. Then the following command will create the mesh:
+\begin{verbatim}
+> md=mesh(md,'DomainOutline.exp',5000);
+\end{verbatim}
+The first argument is the model you are working on, the second argument is the file from ARGUS containing the Domain Outline, and the last argument is the density of the mesh (the mean distance between 2 grids).
+To see how the mesh looks like, one can type:
+\begin{verbatim}
+> plotmodel(md,'data','mesh')
+\end{verbatim}
+
+\section{Geography of the domain}  
+\label{geography of the domain}
+
+The solver will use two different boundary conditions depending on the nature of the ice. An ice shelf will slide on the water whereas there is friction between an ice sheet and the bedrock for the grounded ice. The model must contain this field that tells whether the element is on an ice shelf or on an ice sheet. The files used come from ARGUS\footnote{If the whole domain is an ice shelf, use $md=geography(md,'all','')$. If the whole domain is grounded, use $md=geography(md,'','')$.}. To add this information to the model, type the following command:
+\begin{verbatim}
+> md=geography(md,'Iceshelves.exp','Islands.exp');
+\end{verbatim}
+The first argument is the model and the two other arguments are the files containing the coordinates of the ice shelf included in the Domain Outline and the part of grounded ice included in the ice shelf part (Islands or ice rises). 
+
+\section{Parametrization of the model}  
+\label{parametrization of the model}
+To run a simulation, the solver needs many parameters: physical constants, number of iterations, relaxation constant, thickness and surface of the glacier, etc. All this information must be located in a file (The description of this file is given in Chapter \ref{parameterfile}). To plug all these data to the model, use the following command:
+\begin{verbatim}
+> md=parameterize(md,'Parameters.par');
+\end{verbatim}
+The first argument is the model, and the second argument between quotes is the file containing all the parameters' values.
+One can see chapter \ref{parameterfile} for more information on the parameter file.
+
+\section{Extrusion of the domain (optional)}  
+One can extrude the mesh, in order to use a 3 dimensional model (Pattyn's higher order model and Full Stokes model). This step is not mandatory if the user wants to keep a 2d model, skip this section. To extrude the mesh, type the following command:
+\begin{verbatim}
+> md=extrude(md,8,3);
+\end{verbatim}
+The first argument is the model ad usual. The second argument is the number of horizontal layers. A high number of layers gives a better precision for the simulations but creates more elements which require a longer computational time. Usually a number between 7 and 10 is a good balance. The third argument is called the extrusion exponent. Interesting things are happening near the bedrock usually and users might want to refine more the lower layers than the upper ones. An extrusion exponent of $1$ will create a mesh with layers vertically equally distributed. The higher the extrusion exponent, the more refined the base. An extrusion exponent of $3$ is generally enough.
+
+\section{Setting types of elements}  
+
+$ISSM$ has the capability to compute the flow of a glacier with 4 different models:
+\begin{itemize}
+\item Hutter's ice sheet model (2d and 3d)
+\item MacAyeal's shelfy stream model (2d and 3d)
+\item Pattyn's higher order model (3d: extruded mesh only)
+\item Full Stokes' model (3d: extruded mesh only)
+\end{itemize}
+\noindent
+The ice flow model is specified for each element of the mesh. To assign the models to the elements, as an example the following command can be used:
+\begin{verbatim}
+> md=setelementstype(md,'pattyn','Pattyn.exp','macayeal',md.elementoniceshelf,'fill','hutter');
+\end{verbatim}
+The routine $setelementstype$ works like $plotmodel$: it works with an even number of inputs (without counting $md$ itself). There are five possible options:
+$'hutter'$, $'macayeal'$, $'pattyn'$, $'stokes'$ and  $'fill'$. The first four options must be followed by one of the following argument:
+\begin{itemize}
+\item An ARGUS file containing a closed contour, the elements inside the contour will be assigned to the model given by the option. If user wants to assign the model to the elements outside the domain, add '~' to the name of the domain file (ex: '~Pattyn.exp').
+\item A vector of size $md.numberofelements$ holding 0, and 1 on the elements that the user had flagged. The model given by the option will be assigned to the elements flagged only.
+\item $'all'$ if the user wants to assign the model to all the elements
+\end{itemize}
+\noindent
+The last option $fill$ must be followed by the name of the model that the user wants the other elements (that have not been flagged by the other option) assigned to. All options are not required to be used. The previous example assigns the model of Pattyn for the element inside the contour $Pattyn.exp$, the model of  MacAyeal for the elements located on the ice shelf. The other elements are Hutter's elements. If the user wants to use MacAyeal's model only, type the following command:
+\begin{verbatim}
+> md=setelementstype(md,'macayeal','all');
+\end{verbatim}
+\pagestyle{headings}
+\chapter{Solving and plot of the simulations' results}
+
+\markboth{CHAPTER 4: Solving}{}
+
+
+\vspace{.5in}
+
+\section{Solver.} 
+\label{solver}
+To run a simulation, type the following command:
+\begin{verbatim}
+> md=solve(md,'diagnostic','ice');
+\end{verbatim}
+The first argument is the model, the second is the nature of the simulation one wants to run (it can be $'diagnostic'$, $'prognostic'$, $'thermalsteady$, $'thermaltransient'$, $'transient'$ $'control'$,  $'parameters'$ or  $'mesh2grid'$), and the last argument is the package the user wants to use to calculate the solution ($ice$ or $cielo$). If no solver is specified, the default solver is $'ice'$.
+\begin{itemize}
+\item If one runs a simulation using $'diagnostic'$, the solver will compute the velocity, the horizontal components only if the mesh is 2d, the three components if the mesh is 3d
+\item The $'prognostic'$ solution will compute the new thickness of the ice sheet system depending of the time step of the model and the velocity field that must be already computed. The time step is given by $md.dt$
+\item The $'thermalsteady'$ simulation will solve the thermal fields of the model, ie the temperature and melting. To do so one needs to create a 3d mesh and to compute the velocity first. It solves a stationary solution for thermal, ie $\frac{\partial T}{\partial t}=0$
+\item The $'thermaltransient'$ simulation will solve the thermal fields of the model with a temporal evolution. An initial temperature is needed to run a $'thermaltransient'$ computation.  One can precise the time step and number of iterations depends using $md.dt$ and $md.ndt$. All the intermediary results are saved in $md.thermaltransient_results$
+\item The $'transient'$ simulation will solve both velocity and thermal fields of the model with a temporal evolution. One can precise the time step and number of iterations depends using $md.dt$ and $md.ndt$. All the intermediary results are saved in $md.transient_results$
+\item The $'control'$ solution is a control method applied on the model Chapter \ref{controlmethods} a detailed description
+\end{itemize}
+You can compute additional fields with the $'parameters'$ solution, using $md.parameteroutput'$, such as $'stress'$, $'deviatoricstress'$, $'viscousheating'$, $'strainrate'$ or any combination of these fields given a a structure: 
+\begin{verbatim}
+> md.parameteroutput={'stress','deviatoricstress'};
+> md=solve(md,'parameters');
+\end{verbatim}
+
+\section{Plots} 
+\label{plots}
+
+\subsection{Generality} 
+Once the simulation has converged, there are many fields of the model that one can plot very easily with the plotmodel function of the ISSM code. plotmodel takes the model $md$ as first argument and then an even number of options (like $setelementstype$). To plot a given field, use the option $'data'$ followed by the field one wants to plot. For the thickness:
+\begin{verbatim}
+> plotmodel(md, 'data', 'thickness')
+\end{verbatim}
+or alternatively
+\begin{verbatim}
+> plotmodel(md, 'data', md.thickness)
+\end{verbatim}
+You can plot several fields in the same time but you have to add the argument 'data' before each field you want to plot:
+\begin{verbatim}
+> plotmodel(md, 'data', 'thickness','data','surface','data','vel','data','elements_type')
+\end{verbatim}
+Most of the fields can be plotted: thickness, nodes on ice shelf, x-component of the velocity, thickness and surface of the glacier, etc...
+
+\subsection{Graphics options}
+We saw in the previous section the option $'data'$. The option $'data'$ can be followed by:
+\begin{itemize}
+\item any field of the model structure
+\vspace*{-0.5em}
+\item $'boundaries'$: this will draw all the segment boundaries to the model, including rifts.
+\vspace*{-0.5em}
+\item $'deviatoricstress\_tensor'$: plot the components of the deviatoric stress tensor (tauxx, tauyy, tauzz, tauxy, tauxz, tauyz) if computed
+\vspace*{-0.5em}
+\item $'deviatoricstress\_principal'$: plot the deviatoric stress tensor principal axis and principal values
+\vspace*{-0.5em}
+\item $'deviatoricstress\_principalaxis1'$: arrow plot the first principal axis of the deviatoric stress tensor(replace 1 by 2 or 3 if needed)
+\vspace*{-0.5em}
+\item $'elements\_type'$: model used for each element
+\vspace*{-0.5em}
+\item $'elementnumbering'$: numbering of elements
+\vspace*{-0.5em}
+\item $'gridnumbering'$: numbering of grids
+\vspace*{-0.5em}
+\item $'highlight'$: highlights certain grids or elements when using 'gridnumbering' or 'elementnumbering' option
+\vspace*{-0.5em}
+\item $'mesh'$: draw mesh
+\vspace*{-0.5em}
+\item $'quiver'$: arrow plot of the velocity in 2d
+\vspace*{-0.5em}
+\item $'quiver3'$: arrow plot of the velocity in 3d
+\vspace*{-0.5em}
+\item $'quivervel'$: arrow plot of the velocity superimposed with its magnitude
+\vspace*{-0.5em}
+\item $'riftvel'$: velocities along rifts
+\vspace*{-0.5em}
+\item $'riftrelvel'$: relative velocities along rifts
+\vspace*{-0.5em}
+\item $'riftpenetration'$: penetration levels for a fault
+\vspace*{-0.5em}
+\item $'strainrate\_tensor'$: plot the components of the strain rate tensor (exx, eyy, ezz, exy, exz, eyz) if computed
+\vspace*{-0.5em}
+\item $'strainrate\_principal'$: plot the strain rate tensor principal axis and principal values)
+\vspace*{-0.5em}
+\item $'strainrate\_principalaxis1'$: arrow plot the first principal axis of the strain rate tensor (replace 1 by 2 or 3 if needed)
+\vspace*{-0.5em}
+\item $'stress\_tensor'$: plot the components of stress tensor (sxx,syy,szz,sxy,sxz,syz) if computed
+\vspace*{-0.5em}
+\item $'stress\_principal'$: plot the stress tensor principal axis and principal values)
+\vspace*{-0.5em}
+\item $'stress\_principalaxis1'$: arrow plot the first principal axis of the stress tensor (replace 1 by 2 or 3 if needed)
+\vspace*{-0.5em}
+\item $'transient\_results'$: this will display all the time steps of a transient run
+\vspace*{-0.5em}
+\item $'transient\_movie'$: this will display the time steps of a given field of a transient run
+\vspace*{-0.5em}
+\item $'thermaltransient\_results'$: this will display all the time steps of a thermal transient run
+\end{itemize}
+But there are other options such as:
+\begin{itemize}
+\item $'caxis'$: modify  colorbar range. (array of type $[a\quad b]$ where $b\leq a$)
+\vspace*{-0.5em}
+\item $'colorbar'$: add colorbar (string $'on'$ or $'off'$)
+\vspace*{-0.5em}
+\item $'colormap'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'wrapping'$: repeat $n$ times the colormap ($n$ must be an integer);
+\vspace*{-0.5em}
+\item $'edgecolor'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'fontsize'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'fontweight'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'resolution'$: resolution used by section value (array of type $[horizontal\_resolution vertical\_resolution]$) $horizontal\_resolution$ must be in meter, and $vertical\_resolution$ a number of layers
+\vspace*{-0.5em}
+\item $'showsection'$: show section used by 'sectionvalue' (string $'yes'$)
+\vspace*{-0.5em}
+\item $'sectionvalue'$: give the value of data on a profile given by an Argus file
+\vspace*{-0.5em}
+\item $'smooth'$: smooth element data (string $'yes'$)
+\vspace*{-0.5em}
+\item $'title'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'view'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'xlim'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'ylim'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'zlim'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'xlabel'$: same as standard matlab option
+\vspace*{-0.5em}
+\item $'ylabel'$: same as standard matlab option
+\end{itemize}
+Any options (except $'data'$) can be followed by $'\#i'$ where $'i'$ is the subplot number, or $'\#all'$ if applied to all plots. For example: to plot the velocity and the mesh at the same time, with a colorbar for both plots bot a 2d view for the mesh:
+\begin{verbatim}
+> plotmodel(md,'data','vel','data','mesh','view#2',3,'colorbar#all','on')
+\end{verbatim}
+
+\section{Saving the model} 
+\label{saving the model}
+One can save the model with all its fields so that the saved file contains all the information in the model, type the following command:
+\begin{verbatim}
+> save square.model md
+\end{verbatim}
+That will create a file $square.model$ made from the model md. To load this file, type:
+\begin{verbatim}
+> loadmodel square.model
+\end{verbatim}
+the loaded model will be named $md$.
+
+\pagestyle{headings}
+\chapter{Control Methods}
+\label{controlmethods}
+
+\markboth{CHAPTER 5: Control Methods}{}
+
+
+\vspace{.5in}
+$ISSM$ allows control method on the drag ($drag$) and the viscosity parameter ($B$) spatial distribution for 2d meshes, when an observed velocity field is known and plugged in $md.vx\_obs$, $md.vy\_obs$ and  $md.vel\_obs$ (See parameter file section for more details). This section explains how to launch a control method and which parameters must be tuned.
+\section{Misfits}
+
+The control methods can use different types of misfit. The misfit must be entered in $md.fit$. it can be \emph{Absolute}, \emph{Relative} or \emph{Logarithmic}.
+
+\subsection{Absolute misfit}
+
+ This is the classic way of calculating a misfit between a modeled and observed velocity field:
+ 
+\begin{equation}
+J=\iint_{\Omega\cup\partial\Omega} \dfrac{1}{2}\left( (u-u^{obs})^{2}+(v-v^{obs})^{2}\right) d\Omega
+\end{equation}
+\\
+where:
+\begin{itemize}
+\item [--] $u$: is the glacier modeled velocity projected on the x-axis
+\item [--] $v$: is the glacier modeled velocity projected on the y-axis
+\item [--] $u^{obs}$: is the glacier modeled velocity projected on the x-axis
+\item [--] $v^{obs}$: is the glacier modeled velocity projected on the y-axis
+\end{itemize}
+
+\subsection{Relative misfit}
+
+The relative misfit is defined as follows:
+ 
+\begin{equation}
+J=\iint_{\Omega\cup\partial\Omega} \dfrac{1}{2}\left( 
+\dfrac{\overline{vel}^2}{(u^{obs}+\varepsilon)^{2}}(u-u^{obs})^{2}
++\dfrac{\overline{vel}^2}{(v^{obs}+\varepsilon)^{2}}(v-v^{obs})^{2}\right) d\Omega
+\end{equation}
+\\
+where:
+\begin{itemize}
+\item [--] $u$: is the glacier modeled velocity projected on the x-axis
+\item [--] $v$: is the glacier modeled velocity projected on the y-axis
+\item [--] $u^{obs}$: is the glacier modeled velocity projected on the x-axis
+\item [--] $v^{obs}$: is the glacier modeled velocity projected on the y-axis
+\item [--] $\overline{vel}$: is an averaged velocity used for dimensional purposes, usually, one takes $md.meanvel=$ 1000 m/year (to be converted into m/s)
+\item [--] $\varepsilon$: is a minimum velocity used to avoid the observed velocity being equal to zero. One takes usually $md.eps=eps$ (Matlab's epsilon)
+\end{itemize}
+
+\subsection{Logarithmic misfit}
+
+The relative misfit is defined as follows:
+ 
+\begin{equation}
+J=\iint_{\Omega\cup\partial\Omega} 4 \;\overline{vel}^2\left( 
+ln\left(\dfrac{vel+\varepsilon}{vel^{obs}+\varepsilon} \right) \right)^2 d\Omega
+\end{equation}
+\\
+where:
+\begin{itemize}
+\item [--] $vel$: is the glacier modeled velocity
+\item [--] $vel^{obs}$: is the glacier modeled velocity
+\item [--] $\overline{vel}$: is an averaged velocity used for dimensional purposes, usually, one takes $md.meanvel=$ 1000 m/year (to be converted into m/s)
+\item [--] $\varepsilon$: is a minimum velocity used to avoid the observed velocity being equal to zero. One takes usually $md.eps=eps$ (Matlab's epsilon)
+\end{itemize}
+
+\section{Control Methods parameters}
+\subsection{Control type}
+One can choose which parameter to optimize. This is registered in $md.control\_type$ in a cell. For exemple, if one wants to optimize the viscosity parameter spatial distribution:
+\begin{verbatim}
+> md.control_type={'B'};
+\end{verbatim}
+If one wants to optimize several parameters such as $drag$ and $B$:
+\begin{verbatim}
+> md.control_type={'B','drag'};
+\end{verbatim}
+
+\subsection{Constraints}
+
+Usually, the viscosity or the drag are constrained. For example the viscosity can not be negative. To prevent the inversed parameters from being out of the physical range, enter the constraints values in $md.mincontrolconstraint$ and $md.maxcontrolconstraint$. If one does not wish to constrain the inverse parameters, enter NaN.\\
+\\
+For example, if one wants to optimize the $drag$ and the viscosity parameter $B$, with the following constraints:
+\begin{equation}
+ 0 \leq drag \quad \quad \quad 10\leq B\leq 10^9
+\end{equation}
+type:
+\begin{verbatim}
+> md.mincontrolconstraint=[0,10];
+> md.maxcontrolconstraint=[NaN,10^9];
+\end{verbatim}
+
+\subsection{optimization parameters}
+
+\subsubsection{$md.nsteps$}
+This is done a given number of times set in $md.nsteps$. For example, if one wants 100 iterations, type
+\begin{verbatim}
+> md.nsteps=100;
+\end{verbatim}
+The other control parameters ($md.optscal$, $md.fit$ and $md.maxiter$) must have a length equal to $md.nsteps$.
+
+\subsubsection{$md.optscal$}
+At each iteration, the routine evaluates the gradients of the misfit with respect to the inversed parameters spatial distribution and updates each parameter spatial distribution using a scalar as follows:
+
+\begin{equation}
+P^{new}=P^{old}+dimensionalscalar\times scalar\times \dfrac{\overrightarrow{gradient}}{\max (\overrightarrow{gradient}_i)}
+\end{equation}
+\\
+The scalar is calculated by a C routine and is constrained between 0 and 1. The dimensional scalar is a constant and must be entered in $md.optscal$. We recommand to use $10^8$ for the viscosity and $10$ for the drag. For example, if one inverses the drag and the viscosity: 
+\begin{verbatim}
+> md.optscal=[10*ones(md.nsteps,1) 10^8*ones(md.nsteps,1)];
+\end{verbatim}
+
+\subsubsection{$md.fit$}
+We aw that there were three possible misfits. A misfit of 0 is associated to an absolute misfit, 1 to a relative misfit and 2 to a logarithmic misfit. If one wants half logarithmic and half absolute, use the following command:
+\begin{verbatim}
+> md.misfit=[2*ones(floor(md.nsteps/2),1); 0*ones(ceil(md.nsteps/2),1)];
+\end{verbatim}
+
+\subsubsection{$md.tolx$ and $md.maxiter$}
+At each iteration, the routine search for a scalar between 0 and 20. It stops when the difference of the cost function between 2 scalars is less than $md.tolx$, or when it reaches a maximum number of iteration $md.maxiter$. We recommend :
+\begin{verbatim}
+> md.tolx=10^{-4};
+> md.maxiter=20*ones(md.nsteps,1);
+\end{verbatim}
+
+
+\section{Launching a control method}
+Control methods are not performed with the package $ice$ for computational time reasons. Only $CIELO$ has control methods implemented. To launch a control method, fill all the previous fields and type:
+\begin{verbatim}
+>  md=solve(md,'control','cielo');
+\end{verbatim}
+
+\pagestyle{headings}
+\chapter{Cluster computing}
+\label{cluster}
+
+\markboth{CHAPTER: cluster computing.}{}
+
+
+\vspace{.5in}
+$ISSM$ can use the $CIELO$ software to run in parallel on a cluster. This section shows how to use this capability.
+\section{Setting up the environment to use Cielo}
+
+We assume users have correctly setup $CIELO$ in the directory $CIELODIR$, on the cluster $CLUSTERNAME$. In order for $ISSM$ to recognize 
+the settings for this cluster, users should edit the file $cielo.rc$ found in the Etc/ directory of $ISSM$. This file list all the clusters 
+recognized by $CIELO$. Two fields in particular are of interest, $server\_codepath$, which should be $CIELODIR/server\_delivery$, and 
+$server\_executionpath$, which should be the name of a directory where the logs of the parallel computation will be dumped. Let's call it $TESTINGDIR$ 
+for now. Once those two paths are setup, $ISSM$ should be ready to be used with $CIELO$.
+
+\section{Using Cielo}
+Given a model md, users can check where the computation will occur by typing:
+
+\begin{verbatim}
+>  md.solpar
+\end{verbatim}
+
+A list of solution parameters will ensue. The part regarding use of a cluster is displayed here: 
+
+\begin{verbatim}
+'parallelisation'
+	cluster: astrid      (set to 'cluster_name' to run in cluster, 'none' to run serially)
+	np: 8      (number of CPUS requested on cluster)
+	'ice'
+		scheduler_configuration: local      (name of cluster configuration used from Parallel Matlab toolbox)
+	'cielo'
+		batch: 1      (is cluster running in batch mode (batch=1), or in client/server mode (batch=0, default)
+		exclusive: 0      (set to 1 if CPUS used are not to be shared with other users, 0 otherwise)
+		time: 10      (amount of time requested on cluster)
+		alloc_cleanup: 0      (allocation cleanup before starting a job, default 1)
+		queue:       (queue name)
+
+\end{verbatim}
+
+This indicates that the cluster being used is 'astrid', with 8 processors (np=8), in batch mode (batch=1). Those three parameters are needed to run 
+using cielo. 
+
+\begin{verbatim}
+md.cluster='wilkes';
+md.np=8;
+md.batch=1;
+\end{verbatim}
+
+Once those parameters are setup, users can use three solution sequences (for now): diagnostic\_horiz, control and thermalsteady.  The solution sequences 
+are called the same way, but specifying cielo as the computational engine.
+
+\begin{verbatim}
+md=solve(md,'diagnostic_horiz','cielo');
+\end{verbatim}
+
+Once the computation is over (check the logs in $TESTINGDIR$), users can load the results using: 
+
+\begin{verbatim}
+md=loadresultsfromcluster(md,'diagnostic_horiz');
+\end{verbatim}
+
+The following fields 'errlog' and 'outlog' in the model structure will hold the run logs.  If errlog is not empty, something probably went wrong.
+
+\section{Faq}
+
+\begin{verbatim}
+The following message  appears in the errlog file when launching my job in batch mode.
+mpdrun_wilkes.jpl.nasa.gov: cannot connect to local mpd (/tmp/mpd2.console_larour); possible causes:
+  1. no mpd is running on this host
+    2. an mpd is running but was started without a "console" (-n option)
+	~
+	~
+	~
+	~
+\end{verbatim}
+This message means that the MPI (Message Passing Interface) server, called mpd, is not running. Therefore, no parallel jobs can run on the 
+cluster. To solve this issue, just type, at the command prompt on the server side (if for example your cluster has 8 cpus): 
+\begin{verbatim}
+mpd --ncpus=8 & 
+\end{verbatim}
+This will laucn the MPI server to manage 8 cpus on the cluster. 
+
+
+
+\pagestyle{headings}
+\chapter{Rifts}
+\label{rifts}
+
+\markboth{CHAPTER 6: Rifts}{}
+
+
+\vspace{.5in}
+$ISSM$ allows simulation of rifts. This section explains how to create a model that includes rifts, and how to control their behaviour.
+\section{Rifts creation}
+
+Rifts can be included right between the phase where the mesh is created, and the phase where the geography is setup. Rifts that should be included in the model must be 
+present in an Argus type file. Each rift should be represented by an open loop set of points. Infinite numbers of rifts can be included, provided they do not interset 
+with the domain outline, or any other rift. This point is particularly important as there are no checks on intersections at the meshing phase. 
+For example, a file including two straight rifts could look like, Rifts.exp: 
+\begin{verbatim}
+## Name:Rift1
+## Icon:0
+# Points Count  Value
+2 1.000000
+# X pos Y pos
+0 0
+50000  0
+
+## Name:Rift2
+## Icon:0
+# Points Count  Value
+2 1.000000
+# X pos Y pos
+0 10000
+50000  10000
+
+\end{verbatim}
+this file includes two horizontal rifts of 50 km long, separated by 10 km. 
+
+In order to create a model with these rifts, one would do: 
+\begin{verbatim}
+> md=model;
+> md=mesh(md,'DomainOutline.exp','Rifts.exp',4000);
+> md=meshprocessrifts(md);
+> md=geography(md,'Iceshelves.exp','Islands.exp');
+> etc ...
+\end{verbatim}
+The rest of the process is similar. This will create a rifts structure in the model md. The rifts structure holds as many 
+members as there are rifts in Rifts.exp. The key fields in the rifts structure, are the fill and friction. 
+Fill can be either 1 (for water), 2 (for air) and 3 (for ice). Fill determines the pressure on each flank of the rifts that is being 
+applied. friction is a coefficient between the shear stress exerted on the rift flanks, and the differential tangential velocity between 
+both flanks. 
+
+\section{Rifts tip refining}
+
+Rifts in a mesh will not modify the type of meshing occuring during the mesh phase. To impact the mesh, one can use the riftstiprefine.m 
+routine. This routine will ensure that the rift tips are correctly refined, to take into account the tip stress singularity. Use of this routine 
+is as follows: 
+\begin{verbatim}
+> md=model;
+> md=mesh(md,'DomainOutline.exp','Rifts.exp',4001);
+> md=rifttipsrefine(md,2000,30000);
+> md=meshprocessrifts(md);
+> md=geography(md,'Iceshelves.exp','Islands.exp');
+> etc ...
+\end{verbatim}
+the first argument is the model, the second argument the tip area resolution, and the third is the size of the circle around the tips where 
+mesh refinement should occur. 
+
+\section{Rifts in parameter file}
+The structure rifts can be modified in any parameter file. We do not advise touching anything except the fill and friction for each one of the 
+rifts in the structure. For example, inclusion of the following lines in the parameter file should be enough: 
+\begin{verbatim}
+> for i=1:md.numrifts,
+>   md.rifts(i).fill=1 %include water in the rifts
+>   md.rifts(i).friction=10^11 %friction parameter sigma=10^11*dv_t
+> end
+\end{verbatim}
+Of course, different frictions and fill could be applied, according to the physics being captured. 
+
+\section{Solving for rifts}
+
+Rifts are only allowed when using MacAyeal type elements, in 2d meshes. For now, 3d meshes are not supported. Nothing is needed 
+to take rifts into account in the solve phase. A simple: 
+\begin{verbatim}
+> md=solve(md,'diagnostic','ice');
+\end{verbatim}
+will suffice. Bear in mind, rifts are handled using penalty methods, to ensure that penetration of rift flanks does not occur. This can be 
+very computationally expensive, as penalty methods tend to lead to zigzagging of contact. A stable set  of constraints strategy has been implemented, 
+which should guarantee convergence, but which can be slow.  Users should also try to minimize zigzagging by refining the mesh where 
+needed. In case zigzagging becomes too intense, locking of the zigzagging penalties will occur, which ensures convergence, but which can lead to 
+bad results in a physical sense. Detecting penalty locking should give users an idea on where to refine the mesh. 
+
+\section{Rifts plotting}
+
+Rifts can be plotted using the following special plots: 
+\begin{verbatim}
+> plotmodel(md,'data','riftpenetration','data','riftvel','data','riftrelvel');
+> end
+\end{verbatim}
+these three plots will give users a view of which parts of the rifts are opening, closing, at which relative speed, etc ...
+
+
+\pagestyle{headings}
+\chapter{Parameter file}
+\label{parameterfile}
+
+\markboth{CHAPTER 7: parameter file}{}
+
+
+\vspace{.5in}
+This chapter indicates all the fields the parameter file must contain. These fields are divided into five parts: material parameters, other physical parameters, boundary conditions, observations and solution parameters.
+One can type $md$ to see all the parameters that the model md contains.\\
+This file is created for a two dimensional mesh. The parameters will be automatically extruded if a part of the mesh is extruded. Number of elements, number of grids refer to the number of elements and grids in the two dimensional mesh.
+
+\section{Material parameters} 
+\label{material parameters}
+This section indicates all the fields of the model dealing with the material parameters.
+One must add all these fields in the parameter file. One can access to all these fields typing $md.mat$
+The list of all these fields is presented below:
+
+\begin{itemize}
+\item $md.rho\_ice$: ice density (in $kg/m^3$)
+\item $md.rho\_water$: water density (in $kg/m^3$)
+\item $md.heatcapacity$: ice heat capacity (in $J/kg/K$)
+\item $md.thermalconductivity$: ice thermal conductivity (in $W/m/K$)
+\item $md.beta$: depression of the melting point due to pressure (in $K/Pa$)
+\item $md.B$: viscosity parameter, given in $Pa/s^{\frac{1}{n}}$. This field must be an array of size the number of elements
+\item $md.n$: empirical constant of Glen's flow law. This field must be an array of size the number of elements
+\end{itemize}
+
+\section{Other physical parameters} 
+\label{other parameters}
+This section indicates all the fields of the model dealing with all the other physical and geometrical parameters
+
+\subsection{Physical parameters} 
+
+\begin{itemize}
+\item $md.g$:  constant of gravity (in $m/s^2$)
+\item $md.drag\_type$: type of drag for the basal friction. 0 for none, 1 for plastic and 2 for viscous
+\item $md.drag$: drag coefficent $k$ defined as 
+\begin{equation}
+\overrightarrow{\tau_b} = -k^2 N_{eff}^r \|\overrightarrow{v} \|^{s-1}\overrightarrow{u_b}
+\end{equation} 
+This field must be an array of size the number of grids. (see Theory guide p. 11)
+\item $md.p$: drag constant described above ($r=q/p$ and $s=1/p$). This field must be an array of size the number of elements
+\item $md.q$: drag constant described above ($r=q/p$ and $s=1/p$). This field must be an array of size the number of elements
+\end{itemize}
+
+\subsection{Geometrical parameters} 
+
+\begin{itemize}
+\item $md.surface$: height of the glacier surface (in $m$). This field must be an array of size the number of grids. The surface must be positive for the grids on ice shelf
+\item $md.thickness$: glacier thickness (in $m$). This field must be an array of size the number of grids. The thickness must be positive for every grid
+\item $md.firn\_layer$: firn thickness on top of the ice (in $m$). This field must be an array of size the number of grids. The thickness of firn must be positive for every grid
+\item $md.bed$: bed height of the ice (in $m$). This field must be an array of size the number of grids
+\end{itemize}
+
+\section{Boundary conditions} 
+\label{boundary conditions}
+This section indicates all the fields of the model dealing with all the boundary conditions.
+
+\subsection{Diagnostic parameters} 
+
+\begin{itemize}
+\item $md.gridondirichlet\_diag$: 1 if the grid has a dirichlet boundary condition and 0 else. This field must an array of size the number of grids
+\item $md.dirichletvalues\_diag$: value of the dirichlet boundary condition. This field must an array of size the number of grids
+\item $md.segmentonneumann\_diag$: matrix of 3 columns. Each line holds the characteristics of one segment located on a Neumann type boundary condition. The first column is the first grid number of the segment, the second column is the second grid number and the last column is the element number that holds the two previous grids.
+\item $md.neumannvalues\_diag$: value of the Neumann boundary condition (in $N$), NaN if there is only the water pressure. This field must an array of size the number of segments on the boundaries
+\end{itemize}
+
+\subsection{Prognostic parameters} 
+
+\begin{itemize}
+\item $md.gridondirichlet\_prog$: 1 if the grid has a Dirichlet boundary condition and 0 else. This field must an array of size the number of grids
+\item $md.dirichletvalues\_prog$:value of the Dirichlet boundary condition. This field must an array of size the number of grids
+\item $md.segmentonneumann\_prog$: matrix of 3 columns. Each line holds the characteristics of one segment located on a Neumann type boundary condition. The first column is the first grid number of the segment, the second column is the second grid number and the last column is the element number that holds the two previous grids.
+\item $md.neumannvalues\_prog$: value of the neumann boundary condition, NaN if there is only the water pressure. This field must an array of size the number of segments on the boundaries
+\item $md.segmentonneumann\_prog2$: matrix of 3 columns. Each line holds the characteristics of one segment located on a Neumann type boundary condition. The first column is the first grid number of the segment, the second column is the second grid number and the last column is the element number that holds the two previous grids.
+\item $md.neumannvalues\_prog2$: value of the Neumann boundary condition, NaN if there is free radiation. This field must an array of size the number of segments on the boundaries
+\end{itemize}
+
+\subsection{Thermal parameters} 
+
+\begin{itemize}
+\item $md.gridondirichlet\_thermal$: 1 if the grid has a thermal Dirichlet boundary condition and 0 else. This field must an array of size the number of grids
+\item $md.dirichletvalues\_thermal$: value of the thermal Dirichlet boundary condition (in $K$). This field must an array of size the number of grids
+\end{itemize}
+
+\section{Observations} 
+\label{observations}
+This section indicates all the fields of the model dealing with all the observations.
+
+\begin{itemize}
+\item $md.vx\_obs$: velocity field in the x direction (in $m/a$). This field must be an array of size the number of grids
+\item $md.vy\_obs$: velocity field in the y direction (in $m/a$). This field must be an array of size the number of grids
+\item $md.vel\_obs$: velocity field (norm of the velocity in $m/a$). This field must be an array of size the number of grids
+\item $md.observed\_temperatures$: field of surface temperatures of ice (in $K$). This field must be an array of size the number of grids
+\item $md.accumulation$: field of accumulation of snow (in $ m/a$). This field must be an array of size the number of grids
+\item $md.melting$: field of melting rate (in $ m/a$). This field must be an array of size the number of grids
+\item $md.geothermal\_flux$: field of geothermal flux (in $W/m^2$). This field must be an array of size the number of grids
+\end{itemize}
+
+\section{Solution parameters} 
+\label{solution parameters}
+This section indicates all the fields of the model dealing with all the solution parameters.
+
+\subsection{Parallelization parameters} 
+The list below deals with the parameters used for the parallelization of the code.
+
+\begin{itemize}
+\item $md.cluster$: indicates the name of the cluster one wants to use ('none' for the package 'ice')
+\item $md.bash$: indicates if the bash mode is activated (0 for the package 'ice', 1 for CIELO)
+\item $md.np$: number of CPUs to use for the cluster (8 for $wilkes$)
+\item $md.exclusive$: 1
+\item $md.time$: 1
+\end{itemize}
+
+\subsection{Statics parameters} 
+The list below deals with the parameters needed for a static solution.
+
+\begin{itemize}
+\item $md.eps\_rel$: relative velocity convergence criterion
+\item $md.eps\_abs$: absolute velocity convergence criterion (NaN if not desired)
+\item $md.penalty\_offest$: magnitude of penalty stiffness for contact problems: $\kappa=10^{penalty\_offest}\times max(abs(K))$ where $K$ is the initial stiffness matrix
+\item $md.lowmem$: field for memory. 0 unless you are running low on cluster memory, then 1
+\item $md.sparsity$: matrix sparsity
+\item $md.acceleration$: 1 if accelerated Mac Ayeal's solution, else 0 ($'ice'$ only)
+\item $md.debug$: 1 if user wants to print the detail of each non linear iteration.
+\end{itemize}
+
+\subsection{Dynamics parameters} 
+The list below deals with the parameters needed for a dynamic solution
+
+\begin{itemize}
+\item $md.dt$: time step in year
+\item $md.ndt$: time span in year
+\item $md.artificial\_diffusivity$: turn on or off the artificial viscosity for prognostic and transient solutions. This field must be 1 or 0
+\item $md.minh$: minimum thickness to avoid stiffness singularity.
+\end{itemize}
+
+\subsection{Control parameters} 
+The list below deals with the parameters needed for a control method
+
+\begin{itemize}
+\item $md.control_type$: list of parameters where inverse control is carried out, for example 'drag' or 'B'
+\item $md.fit$: type of fit for the control method. This field can be 'absolute', 'relative' or 'logarithmic'. The default value is 'absolute'
+\item $md.meanvel$: this constant is used for relative and logarithmic fits
+\item $md.epsvel$: minimum velocity used for relative and logarithmic fits
+\item $md.maxiter$: maximum iterations during one optimization search
+\item $md.nsteps$: number of optimization searches
+\item $md.optscal$: scaling factor on gradient during optimization
+\item $md.mincontrolconstraint$: list containting the minimum tolerated for the inversed parameters
+\item $md.maxcontrolconstraint$: list containting the maximum tolerated for the inversed parameters
+\end{itemize}
+
+
+\section{Example of parameter file} 
+\label{example of parameter file}
+
+Here is an example of a parameter file for a square ice shelf. We assume that the file $Front.exp$ already exists and is a closed contour holding the nodes in the ice front.\\
+The program $ArgusContourToMesh$ is a Matlab routine located in the directory $Utils$. It flags the grids or elements that are within a contour from an Argus contour and a mesh.
+\begin{verbatim}
+%Ok, start defining model parameters here
+
+%material parameters
+    md.g=9.8;
+    md.rho_ice=917;
+    md.rho_water=1023;
+    di=md.rho_ice/md.rho_water;
+    md.yts=365*24*3600;
+    md.heatcapacity=2009;
+    md.thermalconductivity=2.2; %W/mK
+    md.beta=9.8*10^-8;
+
+%Solution parameters
+    %parallelization
+    md.cluster='none';
+    md.np=2;
+    md.time=1;
+    md.exclusive=0;
+
+    %statics
+    md.lowmem=1;
+    md.eps_abs=10;
+    md.eps_rel=0.01;
+    md.penalty_offset=3;
+    md.penalty_melting=10^7;
+    if md.numberofgrids<1000000,
+    md.sparsity=.001;
+    else
+    md.sparsity=.0001;
+    end
+
+    %dynamics
+    md.dt=1*md.yts; %1 year
+    md.ndt=md.dt*10;
+    md.artificial_diffusivity=1;
+
+    %control
+    md.control_type={'drag'}; %'drag', 'B'
+    md.nsteps=5;
+    md.tolx=10^-4;
+    md.maxiter=20;
+    md.optscal=10;
+    md.fit='logarithmic'; %'absolute','relative','logarithmic'
+    md.meanvel=1000/md.yts; %1000 meters/year
+    md.epsvel=eps;
+
+%Geometry
+    disp('      creating thickness');
+    hmin=300;
+    hmax=1000;
+    ymin=min(md.y);
+    ymax=max(md.y);
+    md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+    md.firn_layer=10*ones(md.numberofgrids,1);
+    md.bed=-di*md.thickness;
+    md.surface=md.bed+md.thickness;
+
+    disp('      creating velocities');
+    md.vx_obs=zeros(md.numberofgrids,1);
+    md.vy_obs=zeros(md.numberofgrids,1);
+    md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+
+    disp('      creating drag');
+    md.drag_type=2; %0 none 1 plastic 2 viscous
+    md.drag=200*ones(md.numberofgrids,1); %q=1.
+    %Take care of iceshelves: no basal drag
+    pos=find(md.elementoniceshelf);
+    md.drag(md.elements(pos,:))=0;
+    md.p=ones(md.numberofelements,1);
+    md.q=ones(md.numberofelements,1);
+
+    disp('      creating temperature');
+    md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+    disp('      creating flow law paramter');
+    md.B=paterson(md.observed_temperature);
+    md.n=3*ones(md.numberofelements,1);
+
+    disp('      creating accumulation rates');
+    md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+    md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+%Boundary conditions:
+    disp('      boundary conditions for diagnostic model: ');
+    %Build gridonicefront, array of boundary grids belonging to the icefront:
+    gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node');
+    gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+    md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+    pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+    md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+    pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+    md.segmentonneumann_diag=md.segments(pos,:);
+    %dynamic boundary conditions (water pressure)
+    md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1);
+
+    disp('      boundary conditions for prognostic model: ');
+    md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+    md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+    pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+    md.segmentonneumann_prog=md.segments(pos,:);
+    md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+    md.neumannvalues_prog(:)=NaN; %free radiation
+
+    pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+    md.segmentonneumann_prog2=md.segments(pos,:);
+    md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+    md.neumannvalues_prog2(:)=NaN; %free radiation
+
+    disp('      boundary conditions for thermal model: ');
+    md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+    md.dirichletvalues_thermal=md.observed_temperature;
+    md.geothermalflux=zeros(md.numberofgrids,1);
+    pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3;%50 mW/m^2
+\end{verbatim}
+
+
+
+        \chapter{Example}
+This section gives the reader an example of simulation using $gdal$, $Argus$ and $ISSM$ to calculate the velocity field of Amery Glacier.
+
+\section{Radar Image}
+In order to build a proper domain outline, one needs an image of the glacier. This image is often a radar image that needs to be resized.
+The tools for accomplishing this feat are $gdal\_translate$ and $gdalwarp$, both part of the $GDAL$ suite of utilities (\url{www.gdal.org}).
+For this example we will be using the Antarctica mosaic LIMA, available on \url{http://lima.nasa.gov/}
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=10cm]{Antarctica.png}
+\caption{Original radar image}
+\label{Antarctica}
+\end{center}
+\end{figure}
+\noindent To know the original mosaic properties, type
+\begin{verbatim}
+> gdalinfo file.gif
+\end{verbatim}
+where $file.gif$ is the name of this mosaic. At the end of the properties, the coordinates of the corners are displayed:
+\begin{verbatim}
+   Corner Coordinates:
+   Upper Left  (-3174450.000,2406320.000)
+   Lower Left  (-3174450.000,-2816080.000)
+   Upper Right (2867150.000,2406320.000)
+   Lower Right (2867150.000,-2816080.000)
+   Center      (-153650.000,-204880.000)
+\end{verbatim}
+The first step is to determine the coordinates for the box of interest. In this case we will just pull out Amery Glacier. The bounding box is approximately 1549950, 951120 to 2259950, 554120 (upper left to lower right). To extract Amery from the mosaic, we use:
+\begin{verbatim}
+> gdal_translate -a_ullr 1549950 951120 2259950 554120 
+  -projwin 1549950 951120 2259950 554120 file.tif Amery.tif 
+\end{verbatim}
+The $-projwin$ option specifies the area one wants to clip out of the mosaic using the coordinate system. We also used the $-a\_ullr$ option to force the output image to have the bounding coordinates we want. The result is:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=10cm]{Amery.png}
+\caption{Amery Glacier}
+\label{Amery}
+\end{center}
+\end{figure}
+
+
+\section{Loading the image in $ARGUS\; ONE$}
+To build all the files required by $ISSM$, we use the software $ARGUS\; ONE$. The first step is to import the box coordinates of the radar image in $ARGUS$. To do so, we type a text file that holds the image corners coordinates. There are 5 points since $ARGUS$ requires a closed box:
+\begin{verbatim}
+   ## Name:
+   ## Icon:0
+   # Points Count Value
+   # X pos Y pos
+   1550000.000000 951000.000000
+   550000.000000 554000.000000
+   2260000.000000 554000.000000
+   2260000.000000 951000.000000
+   1550000.000000 951000.000000
+\end{verbatim}
+The extension of this file must be $.exp$. In this example, this file is named $Amery\_box.exp$. Then, open $ARGUS$, File/Import Domain Outline.../Text file and select $Amery\_box.exp$. The new box in Argus has exactly the coordinates of $Amery.tif$. Now, the image must be downloaded and placed in the box. Select $map$ in the \emph{Layers} window:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=4cm]{argus_map.png}
+\end{center}
+\end{figure}
+\noindent
+To download the image: File/Place Image... and select $Amery.tif$. Then, resize the image and move it to fit in the black frame.
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=13cm]{argus.png}
+\end{center}
+\end{figure}
+
+\section{Building the $DomainOutline.exp$ file}
+
+In the $Layers$ window, click on $Layers$, then $New$ and name it $DomainOutline$, and enter the value $1$ (The value needs to be different than $0$):
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=7cm]{layers.png}
+\end{center}
+\end{figure}
+\noindent
+Then click on $Done$ and select the icon $Contour$ on the left of the window:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=1cm]{contour.png}
+\end{center}
+\end{figure}
+\noindent
+Select the domain outline of the glacier (it must be a closed contour, do not take sea ice) and double click to end:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{argus_DO.png}
+\end{center}
+\end{figure}
+\noindent
+Then click on File/Export/Export DomainOutline... and save the file $DomainOutline.exp$.
+
+\section{Building the $Iceshelves.exp$ file}
+
+Repeat the previous step with a new layer named $Iceshelves$. In this step, one must know the position of the grouding line. The contour must be closed and include the ice shelf as follows:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{argus_GL.png}
+\end{center}
+\end{figure}
+
+
+\section{Building the $Islands.exp$ file}
+
+Skip this step if there is no island in the ice shelf part of the glacier. Repeat the previous step with a new layer named $Islands$. This layer holds several contours that stand for islands in the ice shelf:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{argus_Islands.png}
+\end{center}
+\end{figure}
+
+\section{Building the $Front.exp$ file (needed in Amery.par)}
+
+Repeat the previous step with a new layer named $Front$. In this step, the contour must be closed and include the ice front as follows:
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=15cm]{argus_Front.png}
+\end{center}
+\end{figure}
+
+
+\section{Building the $Amery.par$ parameter file}
+Here is just an example of $Amery.par$. Several data are needed (surface, thickness, surface temperature,...). The content of these files is not detailed here and the user will have to change the parts of the parameter file that refer to these data to fit his.
+\begin{verbatim}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Some hardcoded parameters for Amery%%%%%%%%%%
+
+%some parameterization for this parameter file :)
+package='ice';
+modeldatapath='/home/larour/ModelData';
+thicknesspath=[modeldatapath '/BedMap/gridded/thickness'];
+firnpath=[modeldatapath '/BroekeFirn1km/firn'];
+surfacepath=[modeldatapath '/BamberDEMAntarctica1km/surface_smooth30_lowslope'];
+thicknessiceshelvespath=[modeldatapath '/HartmutThicknessAntarctica/HartmutThickness'];
+mosaicpath=[modeldatapath '/RignotAntarcticaVelMosaicRampErsAlos/RignotAntVel'];
+temperaturepath=[modeldatapath '/GiovinettoZwallyTemperatures92/Giovinetto_Temperatures'];
+heatfluxpath=[modeldatapath '/HeatfluxAntarctica/RignotHeatFlux'];
+
+%material parameters
+    md.g=9.8;
+    md.rho_ice=917;
+    md.rho_water=1023;
+    di=md.rho_ice/md.rho_water;
+    md.yts=365*24*3600;
+    md.heatcapacity=2009;
+    md.thermalconductivity=2.2; %W/mK
+    md.beta=9.8*10^-8;
+
+%Solution parameters
+    %parallelization
+    md.cluster='cosmos';
+    md.exclusive=1;
+    md.batch=1;
+    md.alloc_cleanup=0;
+    md.np=10;
+    md.time=60;
+    md.connectivity=10;
+
+    %solver
+    md=solversettoasm(md);
+
+    %Set solver
+    %statics
+    md.eps_rel=.01; %1 per cent
+    md.eps_abs=10; %10 m/yr
+    md.penalty_offset=3;
+    md.lowmem=1;
+    md.sparsity=.001;
+
+    %dynamics
+    md.dt=100*md.yts; %1 year
+    md.ndt=md.dt*100;
+    md.artificial_diffusivity=1;
+
+    %control
+    md.control_type={'drag'};
+    md.nsteps=50;
+    md.tolx=10^-4;
+    md.maxiter=30*ones(md.nsteps,1);
+    md.optscal=500*ones(md.nsteps,1);
+    md.fit=2*ones(md.nsteps,1); %absolute fit
+    md.meanvel=1000/md.yts; %1000 meters/year
+    md.epsvel=eps;
+    md.debug=0;
+    md.plot=0;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+    disp('      reading bedmap thicknesses');
+    load(thicknesspath);
+    md.thickness=DataInterp(x_m,y_m,thickness,md.x,md.y,package); clear thickness
+
+    disp('      reading firn layer');
+    load(firnpath);
+    md.firn_layer=DataInterp(x_m,y_m,firn,md.x,md.y,package); clear firn
+
+    disp('      reading Bamber dem');
+    load(surfacepath);
+    md.surface=DataInterp(x_m,y_m,antarctica_surface,md.x,md.y,package);
+    clear antarctica_surface
+
+    minsurf=1;
+    pos=find(isnan(md.surface) | (md.surface<=0));
+    md.surface(pos)=minsurf;
+    pos=find(isnan(md.thickness) | (md.thickness<=0));
+    md.thickness(pos)=minsurf/(1-di);
+    md.bed=md.surface-md.thickness;
+
+    disp('      reading ice thickness over ice shelves, from Hartmut');
+    load(thicknessiceshelvespath);
+    iceshelf_thickness=DataInterp(x_m,y_m,hartmut_thickness,md.x,md.y,package);
+    clear hartmut_thickness
+
+    pos=find((md.gridoniceshelf) & (iceshelf_thickness~=0));
+    md.thickness(pos)=iceshelf_thickness(pos);
+    md.bed(pos)=-di*md.thickness(pos);
+    md.surface(pos)=(1-di)*md.thickness(pos);
+    clear iceshelf_thickness
+
+    disp('      reading velocities from Rignot');
+    load(mosaicpath);
+    posting=1000; x1=max(md.x);x0=min(md.x);y1=max(md.y);y0=min(md.y);
+    i0=round((x0-x_m(1))/posting)-1; i1=round((x1-x_m(1))/posting)+1;
+    j0=round((y0-y_m(1))/posting)-1; j1=round((y1-y_m(1))/posting)+1;
+    x_m=x_m(i0:i1); y_m=y_m(j0:j1);
+    vx=vx(j0:(j1-1),i0:(i1-1));
+    vy=vy(j0:(j1-1),i0:(i1-1));
+
+    md.vx_obs=DataInterp(x_m,y_m,vx,md.x,md.y,package); clear vx
+    md.vy_obs=DataInterp(x_m,y_m,vy,md.x,md.y,package); clear vy
+    md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+
+    %drag md.drag or stress
+    md.drag_type=2; %0 none 1 plastic 2 viscous
+    md.drag=300*ones(md.numberofgrids,1); %q=1.
+
+    %Take care of iceshelves: no drag md.drag
+    pos=find(md.elementoniceshelf);
+    md.drag(md.elements(pos,:))=0;
+    md.p=ones(md.numberofelements,1);
+    md.q=ones(md.numberofelements,1);
+
+    %Load md.temperature from Giovinetto:
+    disp('      loading temperature');
+    load(temperaturepath);
+    md.temperature=griddata(xt,yt,Ts92,md.x,md.y); clear Ts92
+
+    %flow law
+    disp('      creating flow law paramters');
+    md.n=3*ones(md.numberofelements,1);
+    md.B=paterson(md.temperature);
+
+    disp('      creating accumulation rates');
+    md.accumulation=ones(md.numberofgrids,1); %1m/a
+    md.melting=0.1*ones(md.numberofgrids,1); %.1m/a
+
+    %Deal with boundary conditions:
+    disp('      boundary conditions for diagnostic model');
+    gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node');
+    gridonicefront=double(md.gridonboundary & gridinsideicefront);
+    md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+    pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+    md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+  
+    pos=find(md.gridoniceshelf(md.segments(:,1)) | md.gridoniceshelf(md.segments(:,2)));
+    if ~isempty(pos),
+        md.segmentonneumann_diag=md.segments(pos,:);
+    else
+        md.segmentonneumann_diag={};
+    end
+    md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1);
+
+    disp('      boundary conditions for prognostic model');
+    md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+    md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+    pos=find(md.gridoniceshelf(md.segments(:,1)) | md.gridoniceshelf(md.segments(:,2)));
+    if ~isempty(pos),
+        md.segmentonneumann_prog=md.segments(pos,:);
+    else
+        md.segmentonneumann_prog={};
+    end
+    md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+    md.neumannvalues_prog(:)=NaN; %free radiation
+
+    pos=find(md.gridoniceshelf(md.segments(:,1)) | md.gridoniceshelf(md.segments(:,2)));
+    if ~isempty(pos),
+        md.segmentonneumann_prog2=md.segments(pos,:);
+    else
+        md.segmentonneumann_prog2={};
+    end
+    md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+    md.neumannvalues_prog2(:)=NaN; %free radiation
+
+    disp('      thermal model');
+    md.melting=zeros(md.numberofgrids,1);
+    md.observed_temperature=md.temperature;
+    disp('      watch out: screwing up thermal parameterization on purpose!');
+    md.gridondirichlet_thermal=ones(md.numberofgrids,1);
+    md.gridondirichlet_thermal(1)=0;
+    md.dirichletvalues_thermal=md.temperature;
+
+    disp('      reading geothermal flux');
+    load(heatfluxpath);
+    md.geothermalflux=DataInterp(x_m,y_m,heatflux_Antarctica,md.x,md.y,package);
+    pos=find(md.geothermalflux==0);md.geothermalflux(pos)=80;
+    md.geothermalflux=md.geothermalflux/1000; %map is given in mW/m^2, we need it in W/m^2
+\end{verbatim}
+
+\section{Launching a 2d simulation}
+Once the four files $DomainOutline.exp$, $GroundingLine.exp$, $Islands.exp$, $Front.exp$ and $Amery.par$ are in the same directory, launch $Matlab$. The first thing to be done is to create a model:
+\begin{verbatim}
+> md=model;
+\end{verbatim}
+Then one can mesh the entire domain outline. The refinement is $4000m$ here:
+\begin{verbatim}
+> md=mesh(md,'DomainOutline.exp',4000);
+\end{verbatim}
+Load the geography of the model (To determine which part of the model is on the ice shelf, on the ice sheet or on the ice front). If there is no island, the third argument must be $''$.
+\begin{verbatim}
+> md=geography(md,'Iceshelves.exp','Islands.exp');
+\end{verbatim}
+The parameters can now be loaded (the file $Front.exp$ is required for this step)
+\begin{verbatim}
+> md=parameterize(md,'Amery.par');
+\end{verbatim}
+The model is now ready to be extruded (10 layers, and an extrusion exponent of 3):
+\begin{verbatim}
+> md=extrude(md,10,3);
+\end{verbatim}
+Last step: assigning the models to the elements (here, MacAyeal on the ice shelf and Pattyn for the grounded ice)
+\begin{verbatim}
+> md=setelementstype(md,'MacAyeal',md.elementoniceshelf,'fill','Pattyn');
+\end{verbatim}
+Then, one can launch a diagnostic:
+\begin{verbatim}
+> md=solve(md,'diagnostic','ice');
+\end{verbatim}
+Once it has ended, one can plot the velovity field
+\begin{verbatim}
+> plotmodel(md,'data','vel');
+\end{verbatim}
+
+\section{Control method on the viscosity parameter spatial distribution}
+One can optimize the viscosity parameter spatial distribution in order to be closer to an observed velocity field. The first things to do are to plug the observed velocity field (here named $vxobs,vyobs,velobs$) into the model:
+\begin{verbatim}
+>md.obs_vx=vxobs;
+>md.obs_vy=vyobs;
+>md.obs_vel=velobs;
+\end{verbatim}
+Then one can type the following command to setup the model (See control method section \ref{controlmethods} for more details):
+\begin{verbatim}
+> md.control_type={'B'};
+> md.nsteps=100;
+> md.misfit=[2*ones(floor(md.nsteps/2),1); 0*ones(ceil(md.nsteps/2),1)]
+> md.optscal=[2*10^7*ones(floor(md.nsteps/2),1); 10^7*ones(ceil(md.nsteps/2),1)];
+> md.mincontrolconstraint=10;
+> md.maxcontrolconstraint=10^9;
+\end{verbatim}
+Then, one can launch a simulation on CIELO (provided that the fields related to parallelization are correctly filled):
+\begin{verbatim}
+> md=solve(md,'control','cielo');
+\end{verbatim}
+
+\end{document}
Index: /issm/trunk/etc/Make_build_err_usage_targets.mk
===================================================================
--- /issm/trunk/etc/Make_build_err_usage_targets.mk	(revision 1)
+++ /issm/trunk/etc/Make_build_err_usage_targets.mk	(revision 1)
@@ -0,0 +1,27 @@
+
+# Make_build_err_usage_targets.mk
+
+.PHONY: print_build_info
+print_build_info:
+	@echo 'makeflags = $(MAKEFLAGS)';
+	@echo 'version   = $(version)';
+	@echo 'platform  = $(platform)';
+	@echo 'compiler  = $(compiler)';
+	@echo 'supported = $(supported)';
+	@echo 'MBIN      = $(MBIN)';
+	@echo 'MEX       = $(MEX)';
+	@echo 'MINCLUDE  = $(MINCLUDE)';
+	@echo 'MOPTS     = $(MOPTS)';
+
+.PHONY: err
+err: ; $(error $(ERR))
+
+.PHONY: usage
+usage:
+	@echo make VER=n PLATFORM=xxx COMPILER=xxx MPILAUNCH=xxx
+	@echo where:
+	@echo 'VER      - target Matlab version; 5, 6, or 7 (defalt=5)'
+	@echo 'PLATFORM - target platform; sun, osx, linux or windows (default=sun)'
+	@echo 'COMPILER - either cc, gcc or (if windows) borland'
+	@echo '           (default cc for sun, gcc for linux, borland for windows)'
+	@echo 'MPILAUNCH -launching process for cielod server: either mpi, or bsub.
Index: /issm/trunk/etc/Make_config.mk
===================================================================
--- /issm/trunk/etc/Make_config.mk	(revision 1)
+++ /issm/trunk/etc/Make_config.mk	(revision 1)
@@ -0,0 +1,132 @@
+
+#
+# Make_config.mk
+#
+
+ifeq ($(MAKELEVEL),0)
+
+   # command-line args, defaults:
+
+   ifdef PARALLEL
+      parallel = $(PARALLEL)
+   else
+      parallel = 0
+   endif 
+
+   ifdef COMPILER
+      compiler = $(COMPILER)
+   endif 
+
+   ifdef THREAD
+      thread = $(THREAD)
+   endif 
+  
+   supported = no
+
+   # branch accordingly:
+   ifeq (lin,$(findstring lin,$(ISSM_ARCH)))
+   supported = yes 
+	   ifeq ($(parallel),1)
+	   OBJ_EXT = bo
+	   LIB_EXT = ba
+	   else
+	   OBJ_EXT = o
+	   LIB_EXT = a
+	   endif 
+   endif
+
+   
+   ifeq ($(compiler),icc)
+   CC        = icc
+   CFLAGS  += -static #needed for any intel compilation.
+   else 
+   CC        = gcc
+   endif 
+   
+   #64 bits
+   ifeq ($(parallel),1)
+   CFLAGS   += -D_LINUX_   -D__GCC4BUILD__ 
+   else
+   CFLAGS   += -D_LINUX_   -D__GCC4BUILD__  -largeArrayDims
+   endif
+
+   #Matlab
+   MEX      = $(MATLAB_DIR)/bin/mex
+   MINCLUDE = $(MATLAB_DIR)/extern/include 
+   ifeq (64,$(findstring 64,$(ISSM_ARCH)))
+   MEX_EXT   = mexa64
+   endif
+   CFLAGS  += -DMATLAB 
+   CFLAGS  += -I$(MINCLUDE) 
+   MOPTS    += -f $(ISSM_DIR)/etc/mexopts_v76.sh -V5 -D_LINUX_ 
+
+   #Memory manager 
+   ifeq ($(memmgr),1)
+   CFLAGS  += -D_MEMMGR_
+   endif 
+   
+   
+   #METIS
+   CFLAGS += -I$(METIS_DIR)/Lib
+   COMPUTLIBS += -L$(METIS_DIR) -lmetis
+   
+   #QHULL
+   CFLAGS += -I$(QHULL_DIR)/include/qhull
+   COMPUTLIBS += -L$(QHULL_DIR)/lib -lqhull
+   
+   #PETSC
+   CFLAGS   += -I$(PETSC_DIR) -I$(PETSC_DIR)/include/ -I$(PETSC_DIR)/bmake/$(PETSC_ARCH) 
+   CFLAGS   += -D_PETSC_ 
+   COMPUTLIBS+= -L$(PETSC_DIR)/lib/$(PETSC_ARCH)  -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts
+
+   # activate thread compilation if necessary.
+   ifeq ($(thread),yes)
+	   CFLAGS   += -D_THREAD_
+   endif 
+   
+   #define delivery directory
+   DELIVERY=$(ISSM_DIR)/bin
+
+ifeq ($(parallel),1)
+
+	#Undefine matlab if already defined. 
+	CFLAGS+= -UMATLAB
+
+	#Add some strict compiling 
+	CFLAGS  += -Werror-implicit-function-declaration -fno-strict-aliasing -funroll-loops
+
+	#Optimization
+	CFLAGS +=  -g3 -O3 
+
+	#Parallel flags
+	CFLAGS += -D_PARALLEL_ 
+
+	#MPI
+	CC=$(MPI_DIR)/bin/mpicc
+	CFLAGS +=  -I$(MPI_DIR)/include
+	COMPUTLIBS += -L$(MPI_DIR)/lib -lfmpich -lmpich  -lmpichcxx 	
+
+	#LAPACK and BLAS 
+	COMPUTLIBS += -L$(LAPACK_DIR) -lflapack 
+	COMPUTLIBS += -L$(BLAS_DIR) -lfblas 
+
+	#SLEPC 
+	CFLAGS += -I$(SLEPC_DIR)/include
+	COMPUTLIBS += -L$(SLEPC_DIR)/lib/$(SLEPC_ARCH) -lslepc
+
+	#SCALAPACK
+	COMPUTLIBS += -L$(SCALAPACK_DIR) -lscalapack
+
+	#BLACS
+	COMPUTLIBS += -L$(BLACS_DIR) 
+
+	#PLAPACK Definitions.
+	CFLAGS += -I$(PLAPACK_DIR)/INCLUDE -I$(PETSC_DIR)/src/mat/impls/dense/mpi/plapack/
+	COMPUTLIBS += -L$(PLAPACK_DIR)/$(PETSC_ARCH) -lPLAPACK
+
+	#Extra definitions
+	COMPUTLIBS += -lnsl -lrt -L/usr/X11R6/lib -lX11  
+
+endif 
+
+endif
Index: /issm/trunk/etc/Make_default_rules.mk
===================================================================
--- /issm/trunk/etc/Make_default_rules.mk	(revision 1)
+++ /issm/trunk/etc/Make_default_rules.mk	(revision 1)
@@ -0,0 +1,41 @@
+
+# pattern rules for windows:
+
+ifeq ($(OBJ_EXT),win)
+
+%.obj : %.c
+	$(CC) -c $(CFLAGS) -o $@  $< 
+
+%.sobj : %.c
+	$(CC) -c $(CFLAGS) -o $@  $< 
+
+%.bobj : %.c
+	$(CC) -c $(CFLAGS) -o $@  $< 
+endif
+
+# pattern rules for linux64:
+
+ifeq ($(PLATFORM),lin64)
+
+%.o : %.c
+	$(CC) -c -fPIC $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+
+%.so : %.c
+	$(CC) -c -fPIC $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+
+%.bo : %.c
+	$(CC) -c -fPIC $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+endif
+
+# pattern rules for linux:
+ifeq ($(PLATFORM),lin)
+%.o : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+
+%.so : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+	
+%.bo : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+endif
+
Index: /issm/trunk/etc/README
===================================================================
--- /issm/trunk/etc/README	(revision 1)
+++ /issm/trunk/etc/README	(revision 1)
@@ -0,0 +1,25 @@
+This directory holds configuration files needed by various makefiles 
+across the ICE code to compile "C" code.  For this code to compile correctly, 
+ICE needs to know which type of OS the user is running, and pick up 
+the correct configuration file. By default, ICE will look for the 
+config.mk file in the MexConfig directory. If this file does not 
+point to the correct OS dependent configuration file, the compilation 
+will fail.
+
+Users should therefore identify their OS configuration file in the 
+set of configuration files present in the MexConfig directory (
+ex: config_linux.mk for a 32 bits linux OS, config_linux64.mk 
+for a 64 bits linux OS, etc ...) and rename this file to config.mk
+
+For ex, on a linux 32 bits platform, in the MexConfig directory, 
+find the linux 32 bits configuration file, and type: 
+
+cp ./config_linux32.mk ./config.mk
+
+Users familiar with symbolic linking can also try: 
+
+ln -s  ./config_linux32.mk ./config.mk
+
+The rest of the files in this directory are related to matlab compiler settings 
+that have been tweaked for platform compatibility purposes. Users should not 
+modify them, unless familiar with the 'mex' compiler.
Index: /issm/trunk/etc/cielo.rc
===================================================================
--- /issm/trunk/etc/cielo.rc	(revision 1)
+++ /issm/trunk/etc/cielo.rc	(revision 1)
@@ -0,0 +1,73 @@
+begin
+
+#This file sets default platform settings used by Cielo. 
+#This file should always start with begin, and end with end. 
+#Comments start with #. 
+
+#The syntax to add a computational server is the following: 
+#server_name=foobar
+#server_ip=127.0.0.1
+#server_port=1025
+#server_tunneling=yes:1025
+
+#Just uncomment the 4 lines above if you want to add a server 
+#with hostname foobar, ip 127.0.0.1, listening on port 1025 and 
+#using ssh tunneling on local port 1025. 
+#The server_name can be of any form, provided it's a string. Using 
+#the network hostname is good practice.
+#The server_ip needs to be of the format a.b.c.d where a,b,c,d are 
+#numbers from 0 to 255. 
+#The server_port is any valid port number on the current platform (usually, 
+#using ports 1025 and higher is good practice, as those ports 
+#are dedicated for users).
+#server_tunneling can be either yes, or no. It sets the ssh tunneling option
+#for secure connections. If set to yes, it needs to be followed by the 
+#local port that is ssh tunneled to the server port. Don't forget the semi colon.
+#Final remark on including server settings: do not include spaces 
+#between a field, the '=' sign and its value. Do not also include trailing spaces
+#at the end of a line.
+
+server_name=cosmos
+server_ip=128.149.134.43
+server_port=1025
+server_tunneling=yes:1025
+server_codepath=/home/larour/tier2_ice/server_delivery
+server_executionpath=/scratch/larour/Testing/AGU_2008
+
+server_name=mustang
+server_ip=128.149.26.108
+server_port=1030
+server_tunneling=no
+server_codepath=/proj/ice/larour/Ice/tier2_ice/server_delivery
+server_executionpath=/proj/ice/larour/Testing_ice/Execution
+
+server_name=metro
+server_ip=128.149.26.85
+server_port=1025
+server_tunneling=no
+server_codepath=/home/larour/Ice/tier2_ice/server_delivery
+server_executionpath=/home/larour/Testing/Execution
+
+server_name=wilkes
+server_ip=137.79.160.187
+server_port=1025
+server_tunneling=no
+server_codepath=/u/wilkes-r1b/larour/Ice/ice1.proto/bin
+server_executionpath=/home/larour/Testing/Execution
+
+server_name=astrid
+server_ip=137.79.160.65
+server_port=1025
+server_tunneling=no
+server_codepath=/u/astrid1/larour/issm-1.0/bin
+server_executionpath=/home/larour/Testing/Execution
+
+server_name=gemini
+server_ip=128.149.134.21
+server_port=1025
+server_tunneling=no
+server_codepath=/home/larour/issm/bin
+server_executionpath=/home/larour/Testing/Execution
+
+
+end
Index: /issm/trunk/etc/config.mk
===================================================================
--- /issm/trunk/etc/config.mk	(revision 1)
+++ /issm/trunk/etc/config.mk	(revision 1)
@@ -0,0 +1,1 @@
+link config_linux64.mk
Index: /issm/trunk/etc/config_linux32.mk
===================================================================
--- /issm/trunk/etc/config_linux32.mk	(revision 1)
+++ /issm/trunk/etc/config_linux32.mk	(revision 1)
@@ -0,0 +1,25 @@
+#
+# Make_config.mk
+#
+   
+# run only if top-level make:
+ifeq ($(MAKELEVEL),0)
+
+#Update the following locations 
+ICEROOT=/proj/tpfimos/larour/Ice/ice1
+MATLABROOT=/usr/local/matlab
+MEX_EXT= mexglx
+
+OBJ_EXT   = o
+LIB_EXT   = a
+MROOT     = $(MATLABROOT)
+MBIN     = $(MROOT)/bin
+MOPTS    += -f $(ICEROOT)/etc/mexopts_v704.sh -V5
+CC        = gcc
+CFLAGS   += -D_LINUX_ -O3
+MEX      = $(MBIN)/mex
+MINCLUDE = $(MROOT)/extern/include
+CFLAGS  += -I$(MINCLUDE) -DMATLAB 
+
+endif
+
Index: /issm/trunk/etc/config_linux64.mk
===================================================================
--- /issm/trunk/etc/config_linux64.mk	(revision 1)
+++ /issm/trunk/etc/config_linux64.mk	(revision 1)
@@ -0,0 +1,27 @@
+#
+# Make_config.mk
+#
+#Update the following settings
+
+ifeq ($(MAKELEVEL),0)
+   
+
+	#Extensions
+	MEX_EXT   = mexa64
+	OBJ_EXT   = o
+	LIB_EXT   = a
+
+	#Matlab
+	MROOT     = $(MATLAB_DIR)
+	MBIN     = $(MROOT)/bin
+	MEX      = $(MBIN)/mex
+	MINCLUDE = $(MROOT)/extern/include
+	MOPTS    += -f $(ISSM_DIR)/etc/mexopts_v704.sh  -V5  -DMATLAB -D_HAVE_MATLAB_
+
+	#C
+	CC        = gcc
+	CFLAGS   += -D_LINUX_  -fPIC -I$(MINCLUDE) -DMATLAB  -D_HAVE_MATLAB_ -std=c99  -O3 -I/usr/X11R6/include -L/usr/X11R6/lib -I$(ISSM_DIR)/packages/triangle/install -I$(ISSM_DIR)/packages/metis/install/Lib
+
+	#Delivery location
+	DELIVERY = $(ISSM_DIR)/bin
+endif
Index: /issm/trunk/etc/config_mac.mk
===================================================================
--- /issm/trunk/etc/config_mac.mk	(revision 1)
+++ /issm/trunk/etc/config_mac.mk	(revision 1)
@@ -0,0 +1,25 @@
+#
+# Make_config.mk
+#
+   
+# run only if top-level make:
+ifeq ($(MAKELEVEL),0)
+
+#Update the following locations 
+ICEROOT=/Users/larour/JPL/ice1
+MATLABROOT=/Applications/MATLAB_R2008a/
+MEX_EXT= mexmaci
+
+OBJ_EXT   = o
+LIB_EXT   = a
+MROOT     = $(MATLABROOT)
+MBIN     = $(MROOT)/bin
+MOPTS    += -f $(ICEROOT)/etc/mexopts_mac.sh
+CC        = gcc
+CFLAGS   += -D_LINUX_  -O3
+MEX      = $(MBIN)/mex
+MINCLUDE = $(MROOT)/extern/include
+CFLAGS  += -I$(MINCLUDE) -DMATLAB 
+
+endif
+
Index: sm/trunk/etc/environment.csh
===================================================================
--- /issm/trunk/etc/environment.csh	(revision 28275)
+++ 	(revision )
@@ -1,247 +1,0 @@
-# Modifies path-related envrionment variables based on which external packages
-# have been installed.
-#
-# ISSM_DIR and ISSM_ARCH should have been defined already in your shell
-# settings file (i.e. .bashrc, .cshrc).
-#
-# TODO:
-# - Condition all path modifications on existence of external package 'install'
-#	directory
-#
-
-# Silence `<command>: no match`
-set nonomatch=1
-
-setenv PATH "{$PATH}:{$ISSM_DIR}/aux-config"
-setenv PATH "{$PATH}:{$ISSM_DIR}/scripts"
-
-set ISSM_EXT_DIR="{$ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
-
-#########################
-# Command-line utilities
-#########################
-set SSH_ROOT="{$ISSM_EXT_DIR}/ssh"
-if ( -d {$SSH_ROOT} ) then
-	setenv PATH "{$PATH}:{$SSH_ROOT}"
-endif
-
-#############################
-# Build systems
-#############################
-set AUTOTOOLS_ROOT="{$ISSM_EXT_DIR}/autotools/install"
-setenv PATH "{$AUTOTOOLS_ROOT}/bin:{$PATH}"
-
-set CMAKE_ROOT="{$ISSM_EXT_DIR}/cmake/install"
-setenv PATH "{$CMAKE_ROOT}/bin:{$PATH}"
-
-#############################
-# Libraries / binaries
-#############################
-set MPI_ROOT="{$ISSM_EXT_DIR}/mpich/install"
-if ( -d {$MPI_ROOT} ) then
-	setenv MPI_DIR {$MPI_ROOT}
-	setenv MPI_HOME {$MPI_ROOT} # Used in installation of Dakota
-	setenv MPI_INC_DIR {$MPI_ROOT}/include
-	setenv PATH "{$MPI_ROOT}/bin:{$PATH}"
-	setenv CPATH "{$MPI_ROOT}/include:{$CPATH}"
-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$MPI_ROOT}/lib"
-endif
-
-# NOTE: Check *must* come before PETSc as we prefer packages installed via 
-# 		PETSc
-#
-set ZLIB_ROOT="{$ISSM_EXT_DIR}/zlib/install"
-if ( -d {$ZLIB_ROOT} ) then
-	setenv ZLIB_ROOT {$ZLIB_ROOT} # Used in installation of NetCDF, GDAL, GMT
-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$LD_LIBRARY_PATH}/lib"
-endif
-
-set PETSC_ROOT="{$ISSM_EXT_DIR}/petsc/install"
-if ( -d {$PETSC_ROOT} ) then
-	setenv PETSC_ROOT {$PETSC_ROOT}
-	setenv LD_LIBRARY_PATH {$PETSC_ROOT}/lib:{$LD_LIBRARY_PATH}
-
-	# In case we have installed certain external packages via PETSc
-	#
-
-	# BLAS
-	if ( `find {$PETSC_ROOT}/lib -name libblas.*` != "" || `find {$PETSC_ROOT}/lib -name libfblas.*` != "" ) then
-		setenv BLAS_ROOT "{$PETSC_ROOT}" # Used in installation of Dakota, GMT
-	endif
-
-	# HDF5
-	if ( `find {$PETSC_ROOT}/lib -name libhdf5.*` != "" ) then
-		setenv HDF5_ROOT "{$PETSC_ROOT}" # Used in installation of NetCDF, GDAL
-		setenv CPATH {$CPATH}:{$PETSC_ROOT}/include
-		setenv LIBRARY_PATH {$LIBRARY_PATH}:{$PETSC_ROOT}/lib
-		setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$PETSC_ROOT}/lib
-		setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib
-	endif
-
-	# LAPACK
-	if ( `find {$PETSC_ROOT}/lib -name liblapack.*` != "" || `find {$PETSC_ROOT}/lib -name libflapack.*` != "" ) then
-		setenv LAPACK_ROOT "{$PETSC_ROOT}" # Used in installation of Dakota, GMT
-	endif
-
-	# METIS
-	if ( `find {$PETSC_ROOT}/lib -name libmetis.*` != "" ) then
-		setenv METIS_ROOT "{$PETSC_ROOT}" # Used in installation of Gmsh
-	endif
-
-	# MPICH
-	if ( -f "{$PETSC_ROOT}/bin/mpiexec" ) then
-		set MPI_ROOT={$PETSC_ROOT}
-		setenv MPI_DIR {$MPI_ROOT}
-		setenv MPI_HOME {$MPI_ROOT} # Used in installation of Dakota
-		setenv MPI_INC_DIR {$MPI_ROOT}/include
-		setenv PATH {$MPI_ROOT}/bin:{$PATH}
-		setenv CPATH {$MPI_ROOT}/include:{$CPATH}
-		setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$MPI_ROOT}/lib
-	endif
-
-	# ZLIB
-	if ( `find {$PETSC_ROOT}/lib -name libz.*` != "" ) then
-		setenv ZLIB_ROOT "{$PETSC_ROOT}" # Used in installation of NetCDF, GDAL
-		setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib
-	endif
-endif
-
-set SCOTCH_ROOT="{$ISSM_EXT_DIR}/scotch/install"
-if ( -d {$SCOTCH_ROOT} ) then
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SCOTCH_ROOT}/lib
-endif
-
-set SLEPC_ROOT="{$ISSM_EXT_DIR}/slepc/install"
-if ( -d {$SLEPC_ROOT} ) then
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SLEPC_ROOT}/lib
-endif
-
-set TAO_ROOT="{$ISSM_EXT_DIR}/tao/install"
-if ( -d {$TAO_ROOT} ) then
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$TAO_ROOT}/lib
-endif
-
-set DAKOTA_ROOT="{$ISSM_EXT_DIR}/dakota/install"
-if ( -d {$DAKOTA_ROOT} ) then
-	setenv PATH {$PATH}:{$DAKOTA_ROOT}/bin
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$DAKOTA_ROOT}/lib
-	setenv DYLD_LIBRARY_PATH {$DAKOTA_ROOT}/lib:{$DYLD_LIBRARY_PATH}
-endif
-
-set MERCURIAL_ROOT="{$ISSM_EXT_DIR}/mercurial/install"
-if ( -d {$MERCURIAL_ROOT} ) then
-	setenv PYTHONPATH {$PYTHONPATH}:{$MERCURIAL_ROOT}/mercurial/pure
-	setenv PATH {$PATH}:{$MERCURIAL_ROOT}
-endif
-
-set BOOST_ROOT="{$ISSM_EXT_DIR}/boost/install"
-if ( -d {$BOOST_ROOT} ) then
-	setenv BOOST_ROOT {$BOOST_ROOT} # Used in installation of Dakota
-	setenv BOOST_DIR {$BOOST_ROOT}
-	setenv BOOSTROOT {$BOOST_ROOT}
-	setenv LIBRARY_PATH {$BOOST_ROOT}/lib:{$LIBRARY_PATH}
-	setenv LD_LIBRARY_PATH {$BOOST_ROOT}/lib:{$LD_LIBRARY_PATH}
-	setenv DYLD_LIBRARY_PATH {$BOOST_ROOT}/lib:{$DYLD_LIBRARY_PATH}
-	setenv PATH {$BOOST_ROOT}/bin:{$PATH}
-endif
-
-set GSL_ROOT="{$ISSM_EXT_DIR}/gsl/install"
-if ( -d {$GSL_ROOT} ) then
-	setenv GSL_HOME {$GSL_ROOT} # Used in installation of Dakota
-	setenv GSL_ROOT {$GSL_ROOT}
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_ROOT}/lib
-	setenv DYLD_LIBRARY_PATH {$GSL_ROOT}/lib:{$DYLD_LIBRARY_PATH}
-endif
-
-set NETCDF_ROOT="{$ISSM_EXT_DIR}/netcdf/install"
-if ( -d {$NETCDF_ROOT} ) then
-	setenv NETCDF_ROOT "{$NETCDF_ROOT}" # Used in installation of GDAL, GMT
-	setenv PATH {$PATH}:{$NETCDF_ROOT}/bin
-	setenv CPATH {$CPATH}:{$NETCDF_ROOT}/include
-	setenv LIBRARY_PATH {$LIBRARY_PATH}:{$NETCDF_ROOT}/lib
-	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib
-endif
-
-set CURL_ROOT="{$ISSM_EXT_DIR}/curl/install"
-if ( -d {$CURL_ROOT} ) then
-	setenv CURL_ROOT "{$CURL_ROOT}" # Used in installation of NetCDF, GDAL, GMT
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$CURL_ROOT}/lib
-	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$CURL_ROOT}/lib
-	setenv PATH {$PATH}:{$CURL_ROOT}/bin
-endif
-
-set HDF5_ROOT="{$ISSM_EXT_DIR}/hdf5/install"
-if ( -d {$HDF5_ROOT} ) then
-	setenv HDF5_ROOT "{$HDF5_ROOT}" # Used in installation of NetCDF, GDAL
-	setenv CPATH {$CPATH}:{$HDF5_ROOT}/include
-	setenv LIBRARY_PATH {$LIBRARY_PATH}:{$HDF5_ROOT}/lib
-	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$HDF5_ROOT}/lib
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$HDF5_ROOT}/lib
-endif
-
-set SQLITE_ROOT="{$ISSM_EXT_DIR}/sqlite/install"
-if ( -d {$SQLITE_ROOT} ) then
-	setenv PATH {$PATH}:{$SQLITE_ROOT}/bin
-	setenv LIBRARY_PATH {$LIBRARY_PATH}:{$SQLITE_ROOT}/lib
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SQLITE_ROOT}/lib
-endif
-
-set PROJ_ROOT="{$ISSM_EXT_DIR}/proj/install"
-if ( -d {$PROJ_ROOT} ) then
-	setenv PROJ_ROOT "${PROJ_ROOT}" # Used in installation of GDAL
-	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$PROJ_ROOT}/lib
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$PROJ_ROOT}/lib
-endif
-
-set GDAL_ROOT="{$ISSM_EXT_DIR}/gdal/install"
-if ( -d {$GDAL_ROOT} ) then
-	setenv GDAL_ROOT "{$GDAL_ROOT}" # Used in installation of GMT
-	setenv PATH {$GDAL_ROOT}/bin:{$PATH}
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GDAL_ROOT}/lib
-endif
-
-set GSHHG_ROOT="{$ISSM_EXT_DIR}/gshhg/install"
-if ( -d {$GSHHG_ROOT} ) then
-	setenv GSHHG_ROOT "{$GSHHG_ROOT}" # Used in installation of GMT
-endif
-
-set GMT_ROOT="{$ISSM_EXT_DIR}/gmt/install"
-if ( -d {$GMT_ROOT} ) then
-	setenv PATH {$GMT_ROOT}/bin:{$PATH}
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GMT_ROOT}/lib
-	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$GMT_ROOT}/lib
-endif
-
-set GMSH_ROOT="{$ISSM_EXT_DIR}/gmsh/install"
-if ( -d {$GMSH_ROOT} ) then
-	setenv PATH {$GMSH_ROOT}/bin:{$PATH}
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GMSH_ROOT}/lib
-	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$GMSH_ROOT}/lib
-endif
-
-set TRIANGLE_ROOT="{$ISSM_EXT_DIR}/triangle/install"
-if ( -d {$TRIANGLE_ROOT} ) then
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib
-	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib
-endif
-
-set YAMS_ROOT="{$ISSM_EXT_DIR}/yams/install"
-if ( -d {$YAMS_ROOT} ) then
-	setenv PATH {$PATH}:{$YAMS_ROOT}
-endif
-
-set VALGRIND_ROOT="{$ISSM_EXT_DIR}/valgrind/install"
-if ( -d {$VALGRIND_ROOT} ) then
-	setenv PATH {$VALGRIND_ROOT}/bin:{$PATH}
-endif
-
-set DOXYGEN_ROOT="{$ISSM_EXT_DIR}/doxygen/install"
-if ( -d {$DOXYGEN_ROOT} ) then
-	setenv PATH {$DOXYGEN_ROOT}/bin:{$PATH}
-endif
-
-set SHELL2JUNIT_ROOT="{$ISSM_EXT_DIR}/shell2junit/install"
-if ( -d {$SHELL2JUNIT_ROOT} ) then
-	setenv PATH {$PATH}:{$SHELL2JUNIT_ROOT}/install
-endif
Index: /issm/trunk/etc/environment.sh
===================================================================
--- /issm/trunk/etc/environment.sh	(revision 28275)
+++ /issm/trunk/etc/environment.sh	(revision 1)
@@ -1,688 +1,77 @@
-# Modifies path-related environment variables based on which external packages
-# have been installed.
-#
-# ISSM_DIR and ISSM_ARCH should have been defined already in your shell
-# settings file (i.e. .bashrc, .cshrc).
-#
-# TODO:
-# - Condition all path modifications on existence of external package 'install'
-#	directory
-#
+#ISSM_DIR and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
 
-if [[ -n "$ZSH_VERSION" ]]; then
-	# Silence `zsh: no matches found: <file>`
-	setopt +o nomatch 1> /dev/null 2>&1
-fi
+source $ISSM_DIR/etc/environment_variables
 
-## Functions
-#
-c_include_path_append(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${C_INCLUDE_PATH}" ]; then
-			export C_INCLUDE_PATH="${1}"
-		elif [[ ":${C_INCLUDE_PATH}:" != *":${1}:"* ]]; then
-			export C_INCLUDE_PATH="${C_INCLUDE_PATH}:${1}"
-		fi
-	fi
-} #}}}
-c_include_path_prepend(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${C_INCLUDE_PATH}" ]; then
-			export C_INCLUDE_PATH="${1}"
-		elif [[ ":${C_INCLUDE_PATH}:" != *":${1}:"* ]]; then
-			export C_INCLUDE_PATH="${1}:${C_INCLUDE_PATH}"
-		fi
-	fi
-} #}}}
+#MPI
+export MPI_DIR
+PATH="$PATH:$MPI_DIR/bin"
+export LD_LIBRARY_PATH="$MPI_DIR/lib"
+export LD_RUN_PATH="$MPI_DIR/lib"
+export MANPATH="$MANPATH:$MPI_DIR/man"
 
-cpath_append(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${CPATH}" ]; then
-			export CPATH="${1}"
-		elif [[ ":${CPATH}:" != *":${1}:"* ]]; then
-			export CPATH="${CPATH}:${1}"
-		fi
-	fi
-} #}}}
-cpath_prepend(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${CPATH}" ]; then
-			export CPATH="${1}"
-		elif [[ ":${CPATH}:" != *":${1}:"* ]]; then
-			export CPATH="${1}:${CPATH}"
-		fi
-	fi
-} #}}}
+#PETSC
+export PETSC_DIR
+export PETSC_ARCH
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PETSC_DIR/lib/$PETSC_ARCH"
+export LD_RUN_PATH="$LD_RUN_PATH:$PETSC_DIR/lib/$PETSC_ARCH"
 
-cplus_include_path_append(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${CPLUS_INCLUDE_PATH}" ]; then
-			export CPLUS_INCLUDE_PATH="${1}"
-		elif [[ ":${CPLUS_INCLUDE_PATH}:" != *":${1}:"* ]]; then
-			export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:${1}"
-		fi
-	fi
-} #}}}
-cplus_include_path_prepend(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${CPLUS_INCLUDE_PATH}" ]; then
-			export CPLUS_INCLUDE_PATH="${1}"
-		elif [[ ":${CPLUS_INCLUDE_PATH}:" != *":${1}:"* ]]; then
-			export CPLUS_INCLUDE_PATH="${1}:${CPLUS_INCLUDE_PATH}"
-		fi
-	fi
-} #}}}
+#SLEPC
+export SLEPC_DIR
+export SLEPC_ARCH
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SLEPC_DIR/lib/$PETSC_ARCH"
+export LD_RUN_PATH="$LD_RUN_PATH:$SLEPC_DIR/lib/$PETSC_ARCH"
 
-dyld_library_path_append(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${DYLD_LIBRARY_PATH}" ]; then
-			export DYLD_LIBRARY_PATH="${1}"
-		elif [[ ":${DYLD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
-			export DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${1}"
-		fi
-		if [ -z "${LD_RUN_PATH}" ]; then
-			export LD_RUN_PATH=$1
-		elif [[ ":${LD_RUN_PATH}:" != *":${1}:"* ]]; then
-			export LD_RUN_PATH="${LD_RUN_PATH}:${1}"
-		fi
-	fi
-} #}}}
-dyld_library_path_prepend(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${DYLD_LIBRARY_PATH}" ]; then
-			export DYLD_LIBRARY_PATH="${1}"
-		elif [[ ":${DYLD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
-			export DYLD_LIBRARY_PATH="${1}:${DYLD_LIBRARY_PATH}"
-		fi
-		if [ -z "${LD_RUN_PATH}" ]; then
-			export LD_RUN_PATH="${1}"
-		elif [[ ":${LD_RUN_PATH}:" != *":${1}:"* ]]; then
-			export LD_RUN_PATH="${1}:${LD_RUN_PATH}"
-		fi
-	fi
-} #}}}
+#Dakota
+export DAKOTA_DIR
+PATH="$PATH:$DAKOTA_DIR/bin"
+export MANPATH="$MANPATH:$MPI_DIR/man:$DAKOTA_DIR/docs/man:$DAKOTA_DIR/docs/man-ref"
 
-ld_library_path_append(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${LD_LIBRARY_PATH}" ]; then
-			export LD_LIBRARY_PATH="${1}"
-		elif [[ ":${LD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
-			export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${1}"
-		fi
-		if [ -z "${LD_RUN_PATH}" ]; then
-			export LD_RUN_PATH="${1}"
-		elif [[ ":${LD_RUN_PATH}:" != *":$1:"* ]]; then
-			export LD_RUN_PATH="${LD_RUN_PATH}:${1}"
-		fi
-	fi
-} #}}}
-ld_library_path_prepend(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${LD_LIBRARY_PATH}" ]; then
-			export LD_LIBRARY_PATH="${1}"
-		elif [[ ":${LD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
-			export LD_LIBRARY_PATH="${1}:${LD_LIBRARY_PATH}"
-		fi
-		if [ -z "${LD_RUN_PATH}" ]; then
-			export LD_RUN_PATH="${1}"
-		elif [[ ":${LD_RUN_PATH}:" != *":${1}:"* ]]; then
-			export LD_RUN_PATH="${1}:${LD_RUN_PATH}"
-		fi
-	fi
-} #}}}
+#Qhull
+export QHULL_DIR
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QHULL_DIR/lib"
+export LD_RUN_PATH="$LD_RUN_PATH:$QHULL_DIR/lib"
 
-library_path_append(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${LIBRARY_PATH}" ]; then
-			export LIBRARY_PATH="${1}"
-		elif [[ ":${LIBRARY_PATH}:" != *":$1:"* ]]; then
-			export LIBRARY_PATH="${LIBRARY_PATH}:${1}"
-		fi
-	fi
-} #}}}
-library_path_prepend(){ #{{{
-	if [ -d "${1}" ]; then
-		if [ -z "${LIBRARY_PATH}" ]; then
-			export LIBRARY_PATH="${1}"
-		elif [[ ":${LIBRARY_PATH}:" != *":$1:"* ]]; then
-			export LIBRARY_PATH="${1}:${LIBRARY_PATH}"
-		fi
-	fi
-} #}}}
+#Doxygen
+export DOXYGEN_DIR
+MANPATH="$MANPATH:$DOXYGEN_DIR/man"
+PATH="$PATH:$DOXYGEN_DIR/bin"
 
-path_append(){ #{{{
-	if [ -d "${1}" ] && [[ ":${PATH}:" != *":${1}:"* ]]; then
-		PATH_IN="${1}"
-		if [[ "${ISSM_ARCH}" == "cygwin-intel" ]]; then
-			PATH_IN=`cygpath -u "${1}"`
-		fi
-		export PATH="${PATH}:${PATH_IN}"
-	fi
-} #}}}
-path_prepend(){ #{{{
-	if [ -d "${1}" ] && [[ ":${PATH}:" != *":${1}:"* ]]; then
-		PATH_IN="${1}"
-		if [[ "${ISSM_ARCH}" == "cygwin-intel" ]]; then
-			PATH_IN=`cygpath -u "${1}"`
-		fi
-		export PATH="${PATH_IN}:${PATH}"
-	fi
-} #}}}
+#MTOC
+export MTOC_DIR
+PATH="$PATH:$MTOC_DIR"
 
-path_append "${ISSM_DIR}/aux-config"
-path_append "${ISSM_DIR}/scripts"
+#MATLAB
+export MATLAB_DIR
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MATLAB_DIR/bin/glnxa64"
+export LD_RUN_PATH="$LD_RUN_PATH:$MATLAB_DIR/bin/glnxa64"
+PATH="$PATH:$MATLAB_DIR/bin"
 
-# Default path to external packages. Redefine this constant if they are 
-# installed to a different directory. Alternatively, export it on the command 
-# line or in a profile initialization file (that is why we check here if it is 
-# set already).
-#
-if [ -z "${ISSM_EXT_DIR+x}" ]; then
-	export ISSM_EXT_DIR="${ISSM_DIR}/externalpackages"
-fi
+#TRIANGLE
+export TRIANGLE_DIR
 
-#######################
-# OS-specific handling
-#######################
+#METIS
+export METIS_DIR
+	
+#BLAS
+export BLAS_DIR
 
-MINGW=0
-if [[ $(uname -s) == MINGW* ]]; then
-	MINGW=1
-	MSMPI_ROOT="${ISSM_EXT_DIR}/msmpi/install"
-	if [ -d "${MSMPI_ROOT}" ]; then
-		export MSMPI_ROOT # Used in installation of ParMETIS, ScaLAPACK
-		cpath_prepend "${MSMPI_ROOT}/include"
-		library_path_prepend "${MSMPI_ROOT}/lib"
-	fi
+#LAPACK
+export LAPACK_DIR
 
-	MPIEXEC_DIR=$(cygpath -u $(cygpath -ms "/c/Program Files/Microsoft MPI/Bin"))
-	if [ -d "${MPIEXEC_DIR}" ]; then
-		export MPIEXEC_DIR
-		path_append "${MPIEXEC_DIR}"
-	fi
+#SCALAPACK
+export SCALAPACK_DIR
 
-	path_prepend "${ISSM_DIR}/bin" # Allows dynamic loader to find DLLs
-fi
+#PLAPACK
+export PLAPACK_DIR
 
-# Windows compilers
-if [[ "${ISSM_ARCH}" == "cygwin-intel" ]]; then
-	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
-fi
+#BLACS
+export BLACS_DIR
 
-#########################
-# Command-line utilities
-#########################
-SSH_ROOT="${ISSM_EXT_DIR}/ssh"
-if [ -d "${SSH_ROOT}" ]; then
-	path_append "${SSH_ROOT}"
-fi
+#SOWING
+export SOWING_DIR
+PATH="$PATH:$SOWING_DIR/bin"
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SOWING_DIR/lib"
+export LD_RUN_PATH="$LD_RUN_PATH:$SOWING_DIR/lib"
+export MANPATH="$MANPATH:$SOWING_DIR/man"
 
-SVN_ROOT="${ISSM_EXT_DIR}/svn/install"
-if [ -d "${SVN_ROOT}" ]; then
-	path_prepend "${SVN_ROOT}/bin"
-	ld_library_path_append "${SVN_ROOT}/lib"
-fi
 
-GIT_ROOT="${ISSM_EXT_DIR}/git/install"
-if [ -d "${GIT_ROOT}" ]; then
-	path_prepend "${GIT_ROOT}/bin"
-fi
-
-#############################
-# Compilers / runtime / SDKs
-#############################
-export ANDROID_DIR="${ISSM_EXT_DIR}/android"
-
-export ANDROID_NDK_DIR="$ANDROID_DIR/android-ndk/install"
-path_append "$ANDROID_NDK_DIR/arm-linux-android-install/bin"
-
-export ANDROID_SDK_ROOT="$ANDROID_DIR/android-sdk/install"
-path_append "$ANDROID_SDK_ROOT/"
-
-EMSCRIPTEN_ROOT="${ISSM_EXT_DIR}/emscripten/install"
-if [ -d ${EMSCRIPTEN_ROOT} ]; then
-	export EMSCRIPTEN_ROOT # Used in JavaScript build in installation of GSL, Triangle
-fi
-
-JVM_ROOT="/usr/local/gcc/4.3.2/lib64/gcj-4.3.2-9/"
-ld_library_path_append "${JVM_ROOT}"
-
-#############################
-# IDEs
-#############################
-ECLIPSE_ROOT="${ISSM_EXT_DIR}/eclipse/install"
-path_append "${ECLIPSE_ROOT}"
-
-#############################
-# Build systems
-#############################
-AUTOTOOLS_ROOT="${ISSM_EXT_DIR}/autotools/install"
-path_prepend "${AUTOTOOLS_ROOT}/bin"
-
-CMAKE_ROOT="${ISSM_EXT_DIR}/cmake/install"
-path_prepend "${CMAKE_ROOT}/bin"
-
-GMAKE_ROOT="${ISSM_EXT_DIR}/gmake/install"
-path_prepend "${GMAKE_ROOT}/bin"
-
-#############################
-# Packagers
-#############################
-PACKAGEMAKER_ROOT="${ISSM_EXT_DIR}/packagemaker/install"
-path_append "${PACKAGEMAKER_ROOT}"
-
-#############################
-# Libraries / binaries
-#############################
-MPI_ROOT_TEMP="${ISSM_EXT_DIR}/mpich/install"
-if [ -d "${MPI_ROOT_TEMP}" ]; then
-	export MPI_DIR=${MPI_ROOT_TEMP}
-	export MPI_HOME=${MPI_ROOT_TEMP} # Used in installation of Dakota
-	export MPI_INC_DIR="${MPI_ROOT_TEMP}/include"
-	path_prepend "${MPI_ROOT_TEMP}/bin"
-	cpath_prepend "${MPI_ROOT_TEMP}/include"
-	ld_library_path_append "${MPI_ROOT_TEMP}/lib"
-fi
-
-# NOTE: The following checks *must* come before PETSc as we prefer packages 
-#		installed via PETSc
-#
-BLAS_ROOT="${ISSM_EXT_DIR}/blas/install"
-if [ -d "${BLAS_ROOT}" ]; then
-	export BLAS_ROOT # Used in installation of LAPACK, ScaLAPACK, PETSc
-	library_path_append "${BLAS_ROOT}/lib"
-	ld_library_path_append "${BLAS_ROOT}/lib"
-
-	if [[ ${MINGW} -eq 1 ]]; then
-		path_append "${BLAS_ROOT}/lib" # Allows dynamic loader to find DLLs
-	fi
-fi
-
-HDF5_ROOT="${ISSM_EXT_DIR}/hdf5/install"
-if [ -d "${HDF5_ROOT}" ]; then
-	export HDF5_ROOT # Used in installation of NetCDF, GDAL
-	cpath_append "${HDF5_ROOT}/include"
-	library_path_append "${HDF5_ROOT}/lib"
-	dyld_library_path_append "${HDF5_ROOT}/lib"
-	ld_library_path_append "${HDF5_ROOT}/lib"
-fi
-
-LAPACK_ROOT="${ISSM_EXT_DIR}/lapack/install"
-if [ -d "${LAPACK_ROOT}" ]; then
-	export LAPACK_ROOT # Used in installation of ScaLAPACK, MUMPS, PETSc
-	library_path_append "${LAPACK_ROOT}/lib"
-	ld_library_path_append "${LAPACK_ROOT}/lib"
-
-	if [[ ${MINGW} -eq 1 ]]; then
-		path_append "${LAPACK_ROOT}/lib" # Allows dynamic loader to find DLLs
-	fi
-
-	if ls ${LAPACK_ROOT}/lib/libblas.* 1> /dev/null 2>&1; then
-		export BLAS_ROOT="${LAPACK_ROOT}"
-	fi
-fi
-
-METIS_ROOT="${ISSM_EXT_DIR}/metis/install"
-if [ -d "${METIS_ROOT}" ]; then
-	export METIS_ROOT # Used in installation of ParMETIS, Gmsh, PETSc
-	library_path_prepend "${METIS_ROOT}/lib"
-	ld_library_path_prepend "${METIS_ROOT}/lib"
-
-	if [[ ${MINGW} -eq 1 ]]; then
-		path_append "${METIS_ROOT}/lib" # Allows dynamic loader to find DLLs
-	fi
-fi
-
-MUMPS_ROOT="${ISSM_EXT_DIR}/mumps/install"
-if [ -d "${MUMPS_ROOT}" ]; then
-	export MUMPS_ROOT # Used in installation of PETSc
-	library_path_append "${MUMPS_ROOT}/lib"
-
-	if [[ ${MINGW} -eq 1 ]]; then
-		path_append "${MUMPS_ROOT}/lib" # Allows dynamic loader to find DLLs
-	fi
-fi
-
-PARMETIS_ROOT="${ISSM_EXT_DIR}/parmetis/install"
-if [ -d "${PARMETIS_ROOT}" ]; then
-	export PARMETIS_ROOT # Used in installation of MUMPS, PETSc
-	library_path_prepend "${PARMETIS_ROOT}/lib"
-	ld_library_path_prepend "${PARMETIS_ROOT}/lib"
-
-	if [[ ${MINGW} -eq 1 ]]; then
-		path_append "${PARMETIS_ROOT}/lib" # Allows dynamic loader to find DLLs
-	fi
-fi
-
-QD_ROOT="${ISSM_EXT_DIR}/qd/install"
-if [ -d "${QD_ROOT}" ]; then
-	export QD_ROOT # Used in installation of MPLAPACK
-	library_path_prepend "${QD_ROOT}/lib"
-	ld_library_path_prepend "${QD_ROOT}/lib"
-fi
-
-SCALAPACK_ROOT="${ISSM_EXT_DIR}/scalapack/install"
-if [ -d "${SCALAPACK_ROOT}" ]; then
-	export SCALAPACK_ROOT # Used in installation of MUMPS, PETSc
-	library_path_append "${SCALAPACK_ROOT}/lib"
-
-	if [[ ${MINGW} -eq 1 ]]; then
-		path_append "${SCALAPACK_ROOT}/lib" # Allows dynamic loader to find DLLs
-	fi
-fi
-
-ZLIB_ROOT="${ISSM_EXT_DIR}/zlib/install"
-if [ -d "${ZLIB_ROOT}" ]; then
-	export ZLIB_ROOT # Used in installation of NetCDF, GDAL, GMT
-	ld_library_path_append "${ZLIB_ROOT}/lib"
-fi
-
-PETSC_ROOT="${ISSM_EXT_DIR}/petsc/install"
-if [ -d "${PETSC_ROOT}" ]; then
-	export PETSC_ROOT # Used in installation of Gmsh
-	cpath_prepend "${PETSC_ROOT}/include"
-	library_path_prepend "${PETSC_ROOT}/lib"
-	ld_library_path_prepend "${PETSC_ROOT}/lib"
-
-	if [[ ${MINGW} -eq 1 ]]; then
-		path_append "${PETSC_ROOT}/lib" # Allows dynamic loader to find DLLs
-	fi
-
-	# In case we have installed certain external packages via PETSc
-	#
-
-	# BLAS
-	if ls ${PETSC_ROOT}/lib/libblas.* 1> /dev/null 2>&1 || ls ${PETSC_ROOT}/lib/libfblas.* 1> /dev/null 2>&1; then
-		export BLAS_ROOT="${PETSC_ROOT}" # Used in installation of Dakota, GMT
-	fi
-
-	# HDF5
-	if ls ${PETSC_ROOT}/lib/libhdf5.* 1> /dev/null 2>&1; then
-		export HDF5_ROOT="${PETSC_ROOT}" # Used in installation of NetCDF, GDAL
-		cpath_append "${PETSC_ROOT}/include"
-		library_path_append "${PETSC_ROOT}/lib"
-		dyld_library_path_append "${PETSC_ROOT}/lib"
-		ld_library_path_append "${PETSC_ROOT}/lib"
-	fi
-
-	# LAPACK
-	if ls ${PETSC_ROOT}/lib/liblapack.* 1> /dev/null 2>&1 || ls ${PETSC_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
-		export LAPACK_ROOT="${PETSC_ROOT}" # Used in installation of Dakota, GMT
-	fi
-
-	# METIS
-	if ls ${PETSC_ROOT}/lib/libmetis.* 1> /dev/null 2>&1; then
-		export METIS_ROOT="${PETSC_ROOT}" # Used in installation of Gmsh
-	fi
-
-	# MPICH
-	if [ -f "${PETSC_ROOT}/bin/mpiexec" ]; then
-		MPI_ROOT=${PETSC_ROOT}
-		export MPI_DIR=${MPI_ROOT}
-		export MPI_HOME=${MPI_ROOT} # Used in installation of Dakota
-		export MPI_INC_DIR="${MPI_ROOT}/include"
-		path_prepend "${MPI_ROOT}/bin"
-		cpath_prepend "${MPI_ROOT}/include"
-		ld_library_path_append "${MPI_ROOT}/lib"
-	fi
-
-	# ZLIB
-	if ls ${PETSC_ROOT}/lib/libz.* 1> /dev/null 2>&1; then
-		export ZLIB_ROOT="${PETSC_ROOT}" # Used in installation of NetCDF, GDAL
-		ld_library_path_append "${PETSC_ROOT}/lib"
-	fi
-fi
-
-MPLAPACK_ROOT="${ISSM_EXT_DIR}/mplapack/install"
-if [ -d "${MPLAPACK_ROOT}" ]; then
-	cplus_include_path_prepend "${MPLAPACK_ROOT}/include"
-	cplus_include_path_prepend "${MPLAPACK_ROOT}/include/mplapack"
-	library_path_prepend "${MPLAPACK_ROOT}/lib"
-	ld_library_path_prepend "${MPLAPACK_ROOT}/lib"
-fi
-
-SCOTCH_ROOT="${ISSM_EXT_DIR}/scotch/install"
-ld_library_path_append "${SCOTCH_ROOT}/lib"
-
-SLEPC_ROOT="${ISSM_EXT_DIR}/slepc/install"
-ld_library_path_append "${SLEPC_ROOT}/lib"
-
-TAO_ROOT="${ISSM_EXT_DIR}/tao/install"
-ld_library_path_append "${TAO_ROOT}/lib"
-
-BOOST_ROOT="${ISSM_EXT_DIR}/boost/install"
-if [ -d "${BOOST_ROOT}" ]; then
-	export BOOST_ROOT # Used in installation of Dakota
-	export BOOST_DIR=${BOOST_ROOT}
-	export BOOSTROOT=${BOOST_ROOT}
-	path_append "${BOOST_ROOT}/bin"
-	library_path_prepend "${BOOST_ROOT}/lib"
-	ld_library_path_prepend "${BOOST_ROOT}/lib"
-	dyld_library_path_prepend "${BOOST_ROOT}/lib"
-fi
-
-DAKOTA_ROOT="${ISSM_EXT_DIR}/dakota/install"
-if [ -d "${DAKOTA_ROOT}" ]; then
-	path_append "${DAKOTA_ROOT}/bin"
-	ld_library_path_prepend "${DAKOTA_ROOT}/lib"
-	dyld_library_path_prepend "${DAKOTA_ROOT}/lib"
-fi
-
-NCO_ROOT="${ISSM_EXT_DIR}/nco/install/bin"
-path_prepend "${NCO_ROOT}/bin"
-
-CPPCHECK_ROOT="${ISSM_EXT_DIR}/cppcheck/install"
-path_append "${CPPCHECK_ROOT}/bin"
-
-MERCURIAL_ROOT="${ISSM_EXT_DIR}/mercurial/install"
-if [ -d "${MERCURIAL_ROOT}" ]; then
-	export PYTHONPATH="${PYTHONPATH}:${MERCURIAL_ROOT}/mercurial/pure/"
-	path_append "${MERCURIAL_ROOT}"
-fi
-
-GSL_ROOT="${ISSM_EXT_DIR}/gsl/install"
-if [ -d "${GSL_ROOT}" ]; then
-	export GSL_HOME="${GSL_ROOT}" # Used in installation of Dakota
-	cpath_prepend "${GSL_ROOT}/include"
-	ld_library_path_append "${GSL_ROOT}/lib"
-fi
-
-NETCDF_ROOT="${ISSM_EXT_DIR}/netcdf/install"
-if [ -d "${NETCDF_ROOT}" ]; then
-	export NETCDF_ROOT # Used in installation of GDAL, GMT
-	path_prepend "${NETCDF_ROOT}/bin"
-	cpath_prepend "${NETCDF_ROOT}/include"
-	library_path_prepend "${NETCDF_ROOT}/lib"
-	dyld_library_path_prepend "${NETCDF_ROOT}/lib"
-	ld_library_path_prepend "${NETCDF_ROOT}/lib"
-fi
-
-NETCDF_CXX_ROOT="${ISSM_EXT_DIR}/netcdf-cxx/install"
-if [ -d "${NETCDF_CXX_ROOT}" ]; then
-	ld_library_path_append "${NETCDF_CXX_ROOT}/lib"
-fi
-
-NETCDF_PYTHON_ROOT="${ISSM_EXT_DIR}/netcdf-python/install"
-if [ -d "${NETCDF_PYTHON_ROOT}" ]; then
-	if [ -d "${NETCDF_PYTHON_ROOT}/lib/python2.7/site-packages" ]; then
-		ld_library_path_append "${NETCDF_PYTHON_ROOT}/lib/python2.7/site-packages"
-	fi
-fi
-
-CURL_ROOT="${ISSM_EXT_DIR}/curl/install"
-if [ -d "${CURL_ROOT}" ]; then
-	export CURL_ROOT # Used in installation of NetCDF, GDAL, GMT
-	cpath_prepend "${CURL_ROOT}/include"
-	ld_library_path_prepend "${CURL_ROOT}/lib"
-	dyld_library_path_prepend "${CURL_ROOT}/lib"
-	path_append "${CURL_ROOT}/bin"
-fi
-
-SQLITE_ROOT="${ISSM_EXT_DIR}/sqlite/install"
-if [ -d "${SQLITE_ROOT}" ]; then
-	export SQLITE_ROOT # Used in installation of GDAL
-	path_prepend "${SQLITE_ROOT}/bin"
-	cpath_prepend "${SQLITE_ROOT}/include"
-	library_path_prepend "${SQLITE_ROOT}/lib"
-	ld_library_path_prepend "${SQLITE_ROOT}/lib"
-fi
-
-LIBTIFF_ROOT="${ISSM_EXT_DIR}/libtiff/install"
-if [ -d "${LIBTIFF_ROOT}" ]; then
-	dyld_library_path_append "${LIBTIFF_ROOT}/install/libtiff"
-	ld_library_path_append "${LIBTIFF_ROOT}/install/libtiff"
-fi
-
-PROJ_ROOT="${ISSM_EXT_DIR}/proj/install"
-if [ -d "${PROJ_ROOT}" ]; then
-	export PROJ_ROOT # Used in installation of GDAL
-	path_append "${PROJ_ROOT}/bin"
-	dyld_library_path_append "${PROJ_ROOT}/lib"
-	ld_library_path_append "${PROJ_ROOT}/lib"
-fi
-
-GDAL_ROOT="${ISSM_EXT_DIR}/gdal/install"
-if [ -d "${GDAL_ROOT}" ]; then
-	export GDAL_ROOT # Used in installation of GMT
-	path_prepend "${GDAL_ROOT}/bin"
-	ld_library_path_append "${GDAL_ROOT}/lib"
-fi
-
-GSHHG_ROOT="${ISSM_EXT_DIR}/gshhg/install"
-if [ -d "${GSHHG_ROOT}" ]; then
-	export GSHHG_ROOT # Used in installation of GMT
-fi
-
-GMT_ROOT="${ISSM_EXT_DIR}/gmt/install"
-if [ -d "${GMT_ROOT}" ]; then
-	path_prepend "${GMT_ROOT}/bin"
-	ld_library_path_append "${GMT_ROOT}/lib"
-	dyld_library_path_append "${GMT_ROOT}/lib"
-fi
-
-GMSH_ROOT="${ISSM_EXT_DIR}/gmsh/install"
-if [ -d "${GMSH_ROOT}" ]; then
-	path_prepend "${GMSH_ROOT}/bin"
-	ld_library_path_append "${GMSH_ROOT}/lib"
-	dyld_library_path_append "${GMSH_ROOT}/lib"
-fi
-
-TRIANGLE_ROOT="${ISSM_EXT_DIR}/triangle/install"
-if [ -d "${TRIANGLE_ROOT}" ]; then
-	ld_library_path_append "${TRIANGLE_ROOT}/lib"
-	dyld_library_path_append "${TRIANGLE_ROOT}/lib"
-
-	if [[ ${MINGW} -eq 1 ]]; then
-		path_append "${TRIANGLE_ROOT}/lib" # Allows dynamic loader to find DLLs
-	fi
-fi
-
-ANGELROOT="${ISSM_EXT_DIR}/angel/angel"
-if [ -d "${ANGELROOT}" ]; then
-	export ANGELROOT
-fi
-
-OPENANALYSISROOT="${ISSM_EXT_DIR}/openanalysis/install"
-if [ -d "${OPENANALYSISROOT}" ]; then
-	export OPENANALYSISROOT
-	ld_library_path_append "${OPENANALYSISROOT}/lib"
-fi
-
-BBFTP_ROOT="${ISSM_EXT_DIR}/bbftp/install"
-path_append "${BBFTP_ROOT}/bin"
-
-ADIC_ROOT="${ISSM_EXT_DIR}/adic/install"
-path_append "${ADIC_ROOT}/bin"
-ld_library_path_append "${ADIC_ROOT}/lib"
-
-COLPACK_ROOT="${ISSM_EXT_DIR}/colpack/install"
-ld_library_path_append "${COLPACK_ROOT}/lib"
-
-APPSCAN_ROOT="${ISSM_EXT_DIR}/appscan/install"
-path_append "${APPSCAN_ROOT}/bin"
-
-RATS_ROOT="${ISSM_EXT_DIR}/rats/install"
-path_append "${RATS_ROOT}/bin"
-
-DYSON_ROOT="${ISSM_EXT_DIR}/dyson/"
-path_append "${DYSON_ROOT}"
-
-SHAPELIB_ROOT="${ISSM_EXT_DIR}/shapelib/install"
-path_append "${SHAPELIB_ROOT}/exec"
-
-CCCL_ROOT="${ISSM_EXT_DIR}/cccl/install"
-path_append "${CCCL_ROOT}/bin"
-
-MODELE_ROOT="${ISSM_EXT_DIR}/modelE/install"
-path_append "${MODELE_ROOT}/src/exec"
-
-NCVIEW_ROOT="${ISSM_EXT_DIR}/ncview/install"
-path_append "${NCVIEW_ROOT}"
-
-TCLX_ROOT="${ISSM_EXT_DIR}/tclx/install/lib/tclx8.4"
-ld_library_path_append "${TCLX_ROOT}"
-
-ASPELL_ROOT="${ISSM_EXT_DIR}/aspell/install"
-path_append "${ASPELL_ROOT}/bin"
-
-ESMF_ROOT="${ISSM_EXT_DIR}/esmf/install"
-if [ -d "${ESMF_ROOT}" ]; then
-	path_prepend "${ESMF_ROOT}/bin"
-	ld_library_path_append "${ESMF_ROOT}/lib/libO/Linux.gfortran.64.mpich.default/"
-fi
-
-CVS_ROOT="${ISSM_EXT_DIR}/cvs/install"
-path_prepend "${CVS_ROOT}/bin"
-
-APR_ROOT="${ISSM_EXT_DIR}/apr/install"
-path_append "${APR_ROOT}/bin"
-ld_library_path_append "${APR_ROOT}/lib"
-
-APR_UTIL_ROOT="${ISSM_EXT_DIR}/apr-util/install"
-path_prepend "${APR_UTIL_ROOT}/bin"
-ld_library_path_append "${APR_UTIL_ROOT}/lib"
-
-YAMS_ROOT="${ISSM_EXT_DIR}/yams/install"
-path_append "${YAMS_ROOT}"
-
-SWIG_ROOT="${ISSM_EXT_DIR}/swig/install"
-path_append "${SWIG_ROOT}"
-
-INISHELL_ROOT="${ISSM_EXT_DIR}/inishell/install"
-path_append "${INISHELL_ROOT}"
-
-EXPAT_ROOT="${ISSM_EXT_DIR}/expat/install"
-ld_library_path_prepend "${EXPAT_ROOT}"
-dyld_library_path_prepend "${EXPAT_ROOT}"
-
-NEOPZ_ROOT="${ISSM_EXT_DIR}/neopz/install"
-if [ -d "${NEOPZ_ROOT}" ]; then
-	export REFPATTERNDIR="${NEOPZ_ROOT}/include/refpatterns"
-fi
-
-XERCESROOT="${ISSM_EXT_DIR}/xerces/install"
-if [ -d "${XERCESROOT}" ]; then
-	export XERCESROOT
-	export XERCESCROOT="${ISSM_EXT_DIR}/xerces/src"
-fi
-
-XAIFBOOSTERROOT="${ISSM_EXT_DIR}/xaifbooster"
-XAIF_ROOT="${XAIFBOOSTERROOT}/xaifBooster"
-if [ -d "${XAIF_ROOT}" ]; then
-	export XAIFBOOSTERROOT
-	export XAIF_DIR="${XAIF_ROOT}"
-	export XAIFBOOSTER_HOME="${XAIF_ROOT}"
-	export PLATFORM="x86-Linux"
-fi
-
-VALGRIND_ROOT="${ISSM_DIR}/externalpackages/valgrind/install"
-if [ -d "${VALGRIND_ROOT="${ISSM_DIR}/valgrind/install"
-}" ]; then
-	path_prepend "${VALGRIND_ROOT}/bin"
-fi
-
-DOXYGEN_ROOT="${ISSM_EXT_DIR}/doxygen/install"
-path_prepend "${DOXYGEN_ROOT}/bin"
-
-SHELL2JUNIT_ROOT="${ISSM_EXT_DIR}/shell2junit/install"
-path_append "${SHELL2JUNIT_ROOT}"
Index: /issm/trunk/etc/environment_variables
===================================================================
--- /issm/trunk/etc/environment_variables	(revision 1)
+++ /issm/trunk/etc/environment_variables	(revision 1)
@@ -0,0 +1,56 @@
+#
+#
+#This routine can only be run if the ISSM_DIR variable has been correctly set!
+#
+#
+
+
+#MATLAB
+MATLAB_DIR="/usr/local/pkgs/matlab-7.6/"
+
+#MPI
+MPI_DIR="$ISSM_DIR/packages/mpich2/install"
+
+#PETSC
+PETSC_DIR="$ISSM_DIR/packages/petsc/install"
+PETSC_ARCH="linux-gnu-amd64"
+
+#SLEPC
+SLEPC_DIR="$ISSM_DIR/packages/slepc/install"
+SLEPC_ARCH="linux-gnu-amd64"
+
+#Dakota
+DAKOTA_DIR="$ISSM_DIR/packages/dakota/install"
+
+#Qhull
+QHULL_DIR="$ISSM_DIR/packages/qhull/install"
+
+#Doxygen
+DOXYGEN_DIR="$ISSM_DIR/packages/doxygen/install"
+
+#MTOC
+MTOC_DIR="$ISSM_DIR/packages/mtoc/install"
+
+#Triangle
+TRIANGLE_DIR="$ISSM_DIR/packages/triangle/install"
+
+#METIS
+METIS_DIR="$ISSM_DIR/packages/metis/install"
+
+#BLAS
+BLAS_DIR="$ISSM_DIR/packages/petsc/install/externalpackages/fblaslapack"
+
+#LAPACK
+LAPACK_DIR="$ISSM_DIR/packages/petsc/install/externalpackages/fblaslapack/$PETSC_ARCH"
+
+#SCALAPACK
+SCALAPACK_DIR="$ISSM_DIR/packages/petsc/install/externalpackages/SCALAPACK/$PETSC_ARCH"
+
+#PLAPACK
+PLAPACK_DIR="$ISSM_DIR/packages/petsc/install/externalpackages/PLAPACKR32"
+
+#BLACS
+BLACS_DIR="$ISSM_DIR/packages/petsc/install/externalpackages/blacs-dev/$PETSC_ARCH"
+
+#sowing
+SOWING_DIR="$ISSM_DIR/packages/sowing/install"
Index: /issm/trunk/etc/mexopts_mac.sh
===================================================================
--- /issm/trunk/etc/mexopts_mac.sh	(revision 1)
+++ /issm/trunk/etc/mexopts_mac.sh	(revision 1)
@@ -0,0 +1,357 @@
+#
+# mexopts.sh	Shell script for configuring MEX-file creation script,
+#               mex.  These options were tested with the specified compiler.
+#
+# usage:        Do not call this file directly; it is sourced by the
+#               mex shell script.  Modify only if you don't like the
+#               defaults after running mex.  No spaces are allowed
+#               around the '=' in the variable assignment.
+#
+# Note: For the version of system compiler supported with this release,
+#       refer to Technical Note 1601 at:
+#       http://www.mathworks.com/support/tech-notes/1600/1601.html
+#
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2007 The MathWorks, Inc.
+# $Revision: 1.1 $  $Date: 2009/03/18 12:46:35 $
+#----------------------------------------------------------------------------
+#
+    TMW_ROOT="$MATLAB"
+    MFLAGS=''
+    if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
+    else  
+        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
+    fi
+    case "$Arch" in
+        Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory.  The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+            MATLAB="$MATLAB"
+            ;;
+        glnx86)
+#----------------------------------------------------------------------------
+            RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc'
+            CFLAGS='-ansi -D_GNU_SOURCE'
+            CFLAGS="$CFLAGS -fPIC -pthread -m32"
+            CFLAGS="$CFLAGS  -fexceptions"
+            CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" 
+            CLIBS="$RPATH $MLIBS -lm"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+            CLIBS="$CLIBS -lstdc++"
+#           
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX='g++'
+            CXXFLAGS='-ansi -D_GNU_SOURCE'
+            CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64" 
+            CXXFLAGS="$CXXFLAGS -fPIC -pthread"
+            CXXLIBS="$RPATH $MLIBS -lm"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#
+            # FortrankeyName: g95
+            # FortrankeyManufacturer: GNU
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+            FC='g95'
+            FFLAGS='-fexceptions'
+            FFLAGS="$FFLAGS -fPIC"
+            FLIBS="$RPATH $MLIBS -lm"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexglx'
+            LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        glnxa64)
+#----------------------------------------------------------------------------
+            RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc'
+            CFLAGS='-ansi -D_GNU_SOURCE'
+            CFLAGS="$CFLAGS  -fexceptions"
+            CFLAGS="$CFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+            CLIBS="$RPATH $MLIBS -lm"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+            CLIBS="$CLIBS -lstdc++"
+#
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX='g++'
+            CXXFLAGS='-ansi -D_GNU_SOURCE'
+            CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+            CXXLIBS="$RPATH $MLIBS -lm"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+            # FortrankeyName: g95
+            # FortrankeyManufacturer: GNU
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+#
+            FC='g95'
+            FFLAGS='-fexceptions'
+            FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
+            FLIBS="$RPATH $MLIBS -lm"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexa64'
+            LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        sol64)
+#----------------------------------------------------------------------------
+            # StorageVersion: 1.0
+            # CkeyName: Sun Studio
+            # CkeyManufacturer: Sun
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='cc -xarch=v9a'
+            CFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+            CFLAGS="$CFLAGS -KPIC"
+            CLIBS="$MLIBS -lm"
+            CLIBS="$CLIBS -lc"
+            COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+            CDEBUGFLAGS='-xs -g'
+#           
+            # C++keyName: Sun Studio
+            # C++keyManufacturer: Sun
+            # C++keyLanguage: C++
+            # C++keyVersion:
+            CXX='CC -xarch=v9a -compat=5'
+            CCV=`CC -xarch=v9a -V 2>&1`
+            version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+            if [ "$version" = "4" ]; then
+                    echo "SC5.0 or later C++ compiler is required"
+            fi
+            CXXFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -library=stlport4,Crun'
+            CXXFLAGS="$CXXFLAGS -D_POSIX_C_SOURCE=199506L -mt"
+            CXXFLAGS="$CXXFLAGS -KPIC -norunpath"
+            CXXLIBS="$MLIBS -lm"
+            CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+            CXXDEBUGFLAGS='-xs -g'
+#
+            # FortrankeyName: Sun Studio
+            # FortrankeyManufacturer: Sun
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion:
+            FC='f90 -xarch=v9a'
+            FFLAGS='-dalign'
+            FFLAGS="$FFLAGS -KPIC -mt"
+            FLIBS="$MLIBS -lfui -lfsu -lsunmath -lm -lc"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-xs -g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexs64'
+            LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-xs -g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        mac)
+#----------------------------------------------------------------------------
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc-4.0'
+            CFLAGS='-fno-common -no-cpp-precomp'
+            CFLAGS="$CFLAGS"
+            CLIBS="$MLIBS"
+            COPTIMFLAGS='-O3 -fno-loop-optimize -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            CLIBS="$CLIBS -lstdc++"
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX=g++-4.0
+            CXXFLAGS='-fno-common -no-cpp-precomp -fexceptions -arch ppc'
+            CXXLIBS="$MLIBS -lstdc++"
+            CXXOPTIMFLAGS='-O3 -fno-loop-optimize -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+            # FortrankeyName: g95
+            # FortrankeyManufacturer: GNU
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+            FC='g95'
+            FFLAGS='-fexceptions'
+            FC_LIBDIR=`$FC -print-file-name=libf95.a 2>&1 | sed -n '1s/\/*libf95\.a//p'`
+            FLIBS="$MLIBS -L$FC_LIBDIR -lf95"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$CC"
+            LDEXTENSION='.mexmac'
+            LDFLAGS='-Wl,-flat_namespace -undefined suppress'
+            LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        maci)
+#----------------------------------------------------------------------------
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc-4.0'
+            CFLAGS='-fno-common -no-cpp-precomp'
+            CFLAGS="$CFLAGS  -fexceptions"
+            CLIBS="$MLIBS"
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            CLIBS="$CLIBS -lstdc++"
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX=g++-4.0
+            CXXFLAGS='-fno-common -no-cpp-precomp -fexceptions -arch i386'
+            CXXLIBS="$MLIBS -lstdc++"
+            CXXOPTIMFLAGS='-O3 -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+            # FortrankeyName: g95
+            # FortrankeyManufacturer: GNU
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+            FC='g95'
+            FFLAGS='-fexceptions'
+            FC_LIBDIR=`$FC -print-file-name=libf95.a 2>&1 | sed -n '1s/\/*libf95\.a//p'`
+            FLIBS="$MLIBS -L$FC_LIBDIR -lf95"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$CC"
+            LDEXTENSION='.mexmaci'
+            LDFLAGS='-Wl,-flat_namespace -undefined suppress'
+            LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        maci64)
+#----------------------------------------------------------------------------
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc-4.0'
+            CFLAGS='-fno-common -no-cpp-precomp -fexceptions -arch x86_64'
+            CLIBS="$MLIBS -lstdc++"
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX=g++-4.0
+            CXXFLAGS='-fno-common -no-cpp-precomp -fexceptions -arch x86_64'
+            CXXLIBS="$MLIBS -lstdc++"
+            CXXOPTIMFLAGS='-O3 -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+            # FortrankeyName: Intel Fortran
+            # FortrankeyManufacturer: Intel
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+            FC='ifort'
+            FFLAGS=''
+            FC_LIBDIR=''
+            FLIBS="$MLIBS"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$CC"
+            LDEXTENSION='.mexmaci64'
+            LDFLAGS='-Wl,-twolevel_namespace -undefined error -arch x86_64'
+            LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+    esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+#     Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+#           CC="$CC"
+#           CFLAGS="$CFLAGS"
+#           COPTIMFLAGS="$COPTIMFLAGS"
+#           CDEBUGFLAGS="$CDEBUGFLAGS"
+#           CLIBS="$CLIBS"
+#
+#           FC="$FC"
+#           FFLAGS="$FFLAGS"
+#           FOPTIMFLAGS="$FOPTIMFLAGS"
+#           FDEBUGFLAGS="$FDEBUGFLAGS"
+#           FLIBS="$FLIBS"
+#
+#           LD="$LD"
+#           LDFLAGS="$LDFLAGS"
+#           LDOPTIMFLAGS="$LDOPTIMFLAGS"
+#           LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
Index: /issm/trunk/etc/mexopts_v5.sh
===================================================================
--- /issm/trunk/etc/mexopts_v5.sh	(revision 1)
+++ /issm/trunk/etc/mexopts_v5.sh	(revision 1)
@@ -0,0 +1,251 @@
+#
+#
+# mexopts_v5.sh:
+#
+#    modifications to mexopts.sh as follows:
+#
+#    solaris: added -v compiler flag for lint-type code checking
+#             (otherwise mex script treats -v as "verbose" request)
+#
+#    note: searching on "mexopts_v5.sh" will bring you to the changes
+# 
+#----------------------------------------------------------------------------
+#
+#
+# mexopts.sh   Shell script for configuring MEX-file creation script,
+#               mex.
+#
+# usage:        Do not call this file directly; it is sourced by the
+#               mex shell script.  Modify only if you don't like the
+#               defaults after running mex.  No spaces are allowed
+#               around the '=' in the variable assignment.
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEXfiles using the system ANSI compiler
+#
+# Copyright (c) 1984-1998 by The MathWorks, Inc.
+# All Rights Reserved.
+# $Revision: 1.2 $  $Date: 2009/03/18 13:57:38 $
+#----------------------------------------------------------------------------
+#
+    case "$Arch" in
+        Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory.  The cmex script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+            MATLAB="$MATLAB"
+            ;;
+        alpha)
+#----------------------------------------------------------------------------
+            CC='cc'
+            CFLAGS='-ieee -std1'
+            CLIBS=''
+            COPTIMFLAGS='-O2 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            FC='f77'
+            FFLAGS='-shared'
+            FLIBS='-lUfor -lfor -lFutil'
+            FOPTIMFLAGS='-O2'
+            FDEBUGFLAGS='-g'
+#
+            LD='ld'
+            LDFLAGS="-expect_unresolved '*' -shared -hidden -exported_symbol $ENTRYPOINT -exported_symbol mexVersion"
+            LDOPTIMFLAGS=''
+            LDDEBUGFLAGS=''
+#----------------------------------------------------------------------------
+            ;;
+        hp700)
+#----------------------------------------------------------------------------
+            CC='cc'
+#
+# Remove +DAportable from CFLAGS if you wish to optimize for target machine
+#
+            CFLAGS='+z -D_HPUX_SOURCE -Aa +DAportable'
+            CLIBS=''
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            FC='f77'
+            FFLAGS='+z +DAportable'
+            FLIBS=''
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD='ld'
+            LDFLAGS="-b +e $ENTRYPOINT +e mexVersion"
+            LDOPTIMFLAGS=''
+            LDDEBUGFLAGS=''
+#----------------------------------------------------------------------------
+            ;;
+        ibm_rs)
+#----------------------------------------------------------------------------
+            CC='cc'
+            CFLAGS='-qlanglvl=ansi'
+            CLIBS="-L$MATLAB/bin/$Arch -lmatlbmx -lm"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            FC='f77'
+            FFLAGS=''
+            FLIBS="$MATLAB/extern/lib/ibm_rs/fmex1.o -lm"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD='cc'
+            LDFLAGS="-bI:$MATLAB/extern/lib/ibm_rs/exp.ibm_rs -bE:$MATLAB/extern/lib/ibm_rs/$MAPFILE -bM:SRE -e $ENTRYPOINT"
+            LDOPTIMFLAGS='-s'
+            LDDEBUGFLAGS=''
+#----------------------------------------------------------------------------
+            ;;
+        lnx86)   # gcc version 2.7.2.1
+#----------------------------------------------------------------------------
+#
+# Default to libc5 based development (ie. RedHat4.2)
+#
+	    CC='gcc'
+            if [ -f /etc/redhat-release ]; then
+		OS=`cat /etc/redhat-release`
+		version=`expr "$OS" : '.*\([0-9][0-9]*\)\.'`
+#
+# Use this compiler for RedHat5.* systems
+#
+		if [ "$version" = "5" ]; then
+		    CC='i486-linuxlibc5-gcc'
+		fi
+	    elif [ -f /etc/debian_version ]; then
+	        OS=`cat /etc/debian_version`
+		version=`expr "$OS" : '.*\([0-9][0-9]*\)\.'`
+#
+# Use this compiler for Debian 2.* systems
+#
+		if [ "$version" = "2" ]; then
+		    CC='i486-linuxlibc1-gcc'
+		fi
+	    fi
+            CFLAGS=''
+            CLIBS=''
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+# These flags use f2c and gcc for building FORTRAN MEX-Files
+# The fort77 script invokes the f2c command transparently,
+# so it can be used like a real FORTRAN compiler.
+#
+            FC='fort77'
+            FFLAGS=''
+            FLIBS='-lf2c -Wl,--defsym,MAIN__=mexfunction_'
+#
+# Use these flags for the Absoft F77 Fortran Compiler
+#
+        #   FC='f77'
+        #   FFLAGS='-f -N1 -B24 -B108 -N90'
+        #   FLIBS='-lU77 -lV77 -lfio -lf77math'
+#
+            FOPTIMFLAGS='-O3'
+            FDEBUGFLAGS='-g'
+#
+            LD=$CC
+            LDFLAGS='-shared'
+            LDOPTIMFLAGS=''
+            LDDEBUGFLAGS=''
+#----------------------------------------------------------------------------
+            ;;
+        sgi)
+#----------------------------------------------------------------------------
+            CC='cc'
+            CFLAGS='-o32'
+            CLIBS=''
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            FC='f77'
+            FFLAGS='-o32'
+            FLIBS=''
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD='ld'
+            LDFLAGS="-o32 -shared -exported_symbol $ENTRYPOINT -exported_symbol mexVersion"
+            LDOPTIMFLAGS=''
+            LDDEBUGFLAGS=''
+            ;;
+#----------------------------------------------------------------------------
+        sgi64)
+#----------------------------------------------------------------------------
+            CC='cc'
+            CFLAGS='-64'
+            CLIBS=''
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            FC='f77'
+            FFLAGS='-64'
+            FLIBS=''
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD='ld'
+            LDFLAGS="-64 -shared -exported_symbol $ENTRYPOINT -exported_symbol mexVersion"
+            LDOPTIMFLAGS=''
+            LDDEBUGFLAGS=''
+            ;;
+#----------------------------------------------------------------------------
+        sol2)
+#----------------------------------------------------------------------------
+            CC='cc'
+#           mexopts_v5.sh change:
+            CFLAGS='-v -dalign -KPIC'
+#           was:
+#           CFLAGS='-dalign -KPIC'
+            CLIBS=''
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            FC='f77'
+            FFLAGS='-dalign -KPIC'
+            FLIBS='-lF77 -lM77 -lsunmath -lm -lmvec -lcx -lc -lf77compat -lfsu'
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+#           LD='/usr/ccs/bin/ld'
+            LD='cc'
+            LDFLAGS="-G -M $MATLAB/extern/lib/sol2/$MAPFILE"
+            LDOPTIMFLAGS=''
+            LDDEBUGFLAGS=''
+#----------------------------------------------------------------------------
+            ;;
+    esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+#     Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+#           CC="$CC"
+            CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
+#           COPTIMFLAGS="$COPTIMFLAGS"
+#           CDEBUGFLAGS="$CDEBUGFLAGS"
+#           CLIBS="$CLIBS"
+#
+#           FC="$FC"
+#           FFLAGS="$FFLAGS"
+#           FOPTIMFLAGS="$FOPTIMFLAGS"
+#           FDEBUGFLAGS="$FDEBUGFLAGS"
+#           FLIBS="$FLIBS"
+#
+#           LD="$LD"
+#           LDFLAGS="$LDFLAGS"
+#           LDOPTIMFLAGS="$LDOPTIMFLAGS"
+#           LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
Index: /issm/trunk/etc/mexopts_v651.sh
===================================================================
--- /issm/trunk/etc/mexopts_v651.sh	(revision 1)
+++ /issm/trunk/etc/mexopts_v651.sh	(revision 1)
@@ -0,0 +1,390 @@
+#
+#
+# mexopts_v651.sh:
+#
+#    modifications to mexopts.sh as follows:
+#
+#    solaris: added -v compiler flag for lint-type code checking
+#             (otherwise mex script treats -v as "verbose" request)
+#
+#    note: searching on "mexopts_v651.sh" will bring you to the changes
+# 
+#----------------------------------------------------------------------------
+#
+# mexopts.sh	Shell script for configuring MEX-file creation script,
+#               mex.  These options were tested with the specified compiler.
+#
+# usage:        Do not call this file directly; it is sourced by the
+#               mex shell script.  Modify only if you don't like the
+#               defaults after running mex.  No spaces are allowed
+#               around the '=' in the variable assignment.
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2000 The MathWorks, Inc.
+# $Revision: 1.1 $  $Date: 2009/03/18 12:46:35 $
+#----------------------------------------------------------------------------
+#
+    TMW_ROOT="$MATLAB"
+    MFLAGS=''
+    if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmatlb -lmat -lmwservices -lut -lm"
+    else  
+        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lm"
+    fi
+    case "$Arch" in
+        Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory.  The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+            MATLAB="$MATLAB"
+            ;;
+        alpha)
+#----------------------------------------------------------------------------
+#           cc -V | grep UNIX
+#           DEC C V5.9-008 on Digital UNIX V4.0 (Rev. 1229)
+#           Digital UNIX Compiler Driver 3.11
+            CC='cc'
+            CFLAGS='-shared -ieee -pthread -std1'
+            CLIBS="$MLIBS -lm"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+#           cxx -V
+#           Compaq C++ V6.2-024 for Digital UNIX V4.0F  (Rev. 1229)
+            CXX='cxx'
+            CXXFLAGS='-shared -ieee -pthread'
+            CXXLIBS="$MLIBS -lm"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           f77 -what
+#           Compaq Fortran 77 Driver V5.3-11
+#           Compaq Fortran 77 V5.3-189-449BB
+            FC='f77'
+            FFLAGS='-shared -fpe3 -pthread'
+            FLIBS="$MLIBS -lm"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDFLAGS="-pthread -shared -Wl,-expect_unresolved,'*',-hidden,-exported_symbol,$ENTRYPOINT,-exported_symbol,mexVersion,-exported_symbol,'__*'"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        hpux)
+#----------------------------------------------------------------------------
+#           what `which cc`
+#           HP92453-01 B.11.11.02 HP C Compiler
+#            $   Sep  8 2000 23:13:51 $
+            CC='cc'
+            CFLAGS='+Z +DA2.0 -D_POSIX_C_SOURCE=199506L -Wp,-H65535 -Ae'
+            CLIBS="$MLIBS -lm -lc"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+#           what `which aCC`
+#           HP aC++ B3910B A.03.30
+#           HP aC++ B3910B X.03.27 Language Support Library
+            CXX='aCC'
+            CXXFLAGS='-AA +Z +DA2.0 -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE'
+            CXXLIBS="$MLIBS -lm -lstd_v2 -lCsup_v2"
+            CXXOPTIMFLAGS='-O -DNDEBUG +Oconservative'
+            CXXDEBUGFLAGS='-g'
+#
+#           what `which f90`
+#          HP-UX f90 20001114 (140952)  B3907DB/B3909DB B.11.01.27
+#           HP F90 v2.4.10
+#            $ PATCH/11.00:PHCO_95167  Oct  1 1998 13:46:32 $
+            F90LIBDIR='/opt/fortran90/lib/pa2.0'
+            FC='f90'
+            FFLAGS='+Z +DA2.0'
+            FLIBS="$MLIBS -lm -L$F90LIBDIR -lF90 -lcl -lc -lisamstub"
+            FOPTIMFLAGS='-O +Oconservative'
+            FDEBUGFLAGS='-g'
+#
+            LDCXX="$COMPILER"
+            LDCXXFLAGS="-b -Wl,+e,$ENTRYPOINT,+e,mexVersion,+e,_shlInit"
+            LDCXXOPTIMFLAGS='-O'
+            LDCXXDEBUGFLAGS='-g'
+#
+            LD='ld'
+            LDFLAGS="-b +e $ENTRYPOINT +e mexVersion"
+            LDOPTIMFLAGS=''
+            LDDEBUGFLAGS=''
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        hp700)
+#----------------------------------------------------------------------------
+#           what `which cc`
+#           HP92453-01 A.10.32.30 HP C Compiler
+            CC='cc'
+#           Remove +DAportable from CFLAGS if you wish to optimize
+#           for target machine
+            CFLAGS='+Z -Ae +DAportable -Wp,-H65535'
+            CLIBS="$MLIBS -lc"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+#           what `which aCC`
+#           HP aC++ B3910B A.01.27
+#           HP aC++ B3910B A.01.19.02 Language Support Library
+            CXX='aCC'
+#           Remove +DAportable from CXXFLAGS if you wish to optimize
+#           for target machine
+            CXXFLAGS='-AA +Z -D_HPUX_SOURCE +DAportable'
+            CXXLIBS="$MLIBS -lstd_v2 -lCsup_v2"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           what `which f90`
+#            HP-UX f90 20010618 (003353)  B3907DB/B3909DB PHSS_23952 also  B.10.20.40
+#            HP F90 v2.5.1
+            F90LIBDIR='/opt/fortran90/lib'
+            FC='f90'
+            FFLAGS='+Z +DAportable'
+            FLIBS="$MLIBS -L$F90LIBDIR -lF90 -lcl -lc -lisamstub"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LDCXX="$COMPILER"
+            LDCXXFLAGS="-b -Wl,+e,$ENTRYPOINT,+e,mexVersion,+e,_shlInit,+e,errno"
+            LDCXXOPTIMFLAGS='-O'
+            LDCXXDEBUGFLAGS='-g'
+#
+            LD='ld'
+            LDFLAGS="-b +e $ENTRYPOINT +e mexVersion +e errno"
+            LDOPTIMFLAGS=''
+            LDDEBUGFLAGS=''
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        ibm_rs)
+#----------------------------------------------------------------------------
+#           lslpp -l | vacpp.cmp.core
+#           5.0.0.0  COMMITTED  IBM C and C++ Compilers
+            CC='cc'
+            CFLAGS='-D_THREAD_SAFE -D_ALL_SOURCE -qchars=signed -qlanglvl=ansi'
+            CLIBS="$MLIBS -lm "
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#           lslpp -l vacpp.cmp.core
+#           5.0.0.0  COMMITTED  IBM C and C++ Compilers
+            CXX='/usr/vacpp/bin/xlC'
+            CXXFLAGS='-D_THREAD_SAFE -D_ALL_SOURCE -qrtti=all'
+            CXXLIBS="$MLIBS -lm"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           lslpp -l xlfcmp
+#           7.1.0.0  COMMITTED  I XL Fortran Compiler
+            FC='f77'
+            FFLAGS=''
+            FLIBS="$MLIBS -lmat -lm"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LDCXX='/usr/vacpp/bin/makeC++SharedLib'
+            LDCXXFLAGS='-p 0'
+            LDCXXOPTIMFLAGS=''
+            LDCXXDEBUGFLAGS=''
+#
+            LD="$COMPILER"
+            LDFLAGS="-bE:$TMW_ROOT/extern/lib/$Arch/$MAPFILE -bM:SRE -bnoentry"
+            LDOPTIMFLAGS='-O -Wl,-s'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        glnx86)
+#----------------------------------------------------------------------------
+            RPATH="-Wl,--rpath-link,$TMW_ROOT/extern/lib/$Arch,--rpath-link,$TMW_ROOT/bin/$Arch"
+#           gcc -v
+#           gcc version 2.95.2 19991024 (release)
+            CC='gcc'
+            CFLAGS='-fPIC -ansi -D_GNU_SOURCE -pthread'
+            CLIBS="$RPATH $MLIBS -lm"
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#           
+#           g++ -v
+#           gcc version 2.95.2 19991024 (release)
+            CXX='g++'
+#           Add -fhandle-exceptions to CXXFLAGS to support exception handling
+            CXXFLAGS='-fPIC -ansi -D_GNU_SOURCE -pthread'
+            CXXLIBS="$RPATH $MLIBS -lm"
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           g77 -v -xf77-version 
+#           g77 version 2.95.2 19991024 (release) 
+#           (from FSF-g77 version 0.5.25 19991024 (release))
+#           NOTE: g77 is not thread safe
+            FC='g77'
+            FFLAGS='-fPIC'
+            FLIBS="$RPATH $MLIBS -lm"
+            FOPTIMFLAGS='-O3'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O3'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        sgi)
+#----------------------------------------------------------------------------
+#           cc -version
+#           MIPSpro Compilers: Version 7.3.1.2m
+            CC='cc'
+            CFLAGS='-n32 -signed -OPT:IEEE_NaN_inf=ON -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__ -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED'
+            CLIBS="-dont_warn_unused $MLIBS -lm -lc"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#           
+#           CC -version
+#           MIPSpro Compilers: Version 7.3.1.2m
+            CXX='CC'
+#           Add -exceptions to CXXFLAGS to support exception handling
+            CXXFLAGS='-n32 -OPT:IEEE_NaN_inf=ON -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__ -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED  -LANG:STD -ptused'
+            CXXLIBS="-dont_warn_unused $MLIBS -lm -lC -lCio"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           f77 -version
+#           MIPSpro Compilers: Version 7.3.1.2m
+            FC='f77'
+            FFLAGS='-n32 -OPT:IEEE_NaN_inf=ON'
+            FLIBS="-dont_warn_unused $MLIBS -lm"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDFLAGS="-n32 -shared -exported_symbol $ENTRYPOINT -exported_symbol mexVersion"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        sol2)
+#----------------------------------------------------------------------------
+#           cc -V
+#           WorkShop Compilers 5.0 98/12/15 C 5.0
+            CC='cc'
+#           mexopts_v651.sh change:
+            CFLAGS='-v -KPIC -dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+#           was:
+#           CFLAGS='-KPIC -dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+            CLIBS="$MLIBS -lm -lc"
+            COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#           
+#           CC -V
+#           WorkShop Compilers 5.0 98/12/15 C++ 5.0
+            CXX='CC -compat=5'
+            CCV=`CC -V 2>&1`
+            version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+            if [ "$version" = "4" ]; then
+                    echo "SC5.0 or later C++ compiler is required"
+            fi
+            CXXFLAGS='-KPIC -dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+            CXXLIBS="$MLIBS -lm -lCstd -lCrun"
+            CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           f77 -V
+#           WorkShop Compilers 5.0 99/09/16 FORTRAN 77 5.0 patch 107596-03
+            FC='f77'
+            FFLAGS='-KPIC -dalign -mt'
+            FLIBS="$MLIBS -lF77 -lM77 -lsunmath -lm -lcx -lc"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        mac)
+#----------------------------------------------------------------------------
+            CC='cc'
+            CFLAGS='-fno-common -traditional-cpp'
+
+            CLIBS="$MLIBS"
+
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+
+            if [ -f /usr/bin/g++2 ]; then
+            CXX=g++2
+            else
+            CXX=c++
+            fi
+            CXXFLAGS='-fno-common -traditional-cpp'
+            CXXLIBS="$MLIBS -lstdc++"
+            CXXOPTIMFLAGS='-O3 -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+            FC='f77'
+            FFLAGS='-f -N15 -N11 -s -Q51 -W'
+            ABSOFTLIBDIR=`which $FC | sed -n -e '1s|bin/'$FC'|lib|p'`
+            FLIBS="-L$ABSOFTLIBDIR -lfio -lf77math"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$CC"
+            LDFLAGS="-bundle -Wl,-flat_namespace -undefined suppress"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS='nmedit -s $TMW_ROOT/extern/lib/$Arch/$MAPFILE $mex_file'
+#----------------------------------------------------------------------------
+            ;;
+    esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+#     Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+#           CC="$CC"
+#           CFLAGS="$CFLAGS"
+#           COPTIMFLAGS="$COPTIMFLAGS"
+#           CDEBUGFLAGS="$CDEBUGFLAGS"
+#           CLIBS="$CLIBS"
+#
+#           FC="$FC"
+#           FFLAGS="$FFLAGS"
+#           FOPTIMFLAGS="$FOPTIMFLAGS"
+#           FDEBUGFLAGS="$FDEBUGFLAGS"
+#           FLIBS="$FLIBS"
+#
+#           LD="$LD"
+#           LDFLAGS="$LDFLAGS"
+#           LDOPTIMFLAGS="$LDOPTIMFLAGS"
+#           LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
Index: /issm/trunk/etc/mexopts_v704.sh
===================================================================
--- /issm/trunk/etc/mexopts_v704.sh	(revision 1)
+++ /issm/trunk/etc/mexopts_v704.sh	(revision 1)
@@ -0,0 +1,323 @@
+#
+#
+# mexopts_v704.sh:
+#
+#    modifications to mexopts.sh as follows:
+#
+#    solaris: added -v compiler flag for lint-type code checking
+#             (otherwise mex script treats -v as "verbose" request)
+#
+#    linux:   remove ansi c compilation requirement.
+# 
+#    note: searching on "mexopts_v704.sh" will bring you to the changes
+#
+#----------------------------------------------------------------------------
+#
+#
+# mexopts.sh	Shell script for configuring MEX-file creation script,
+#               mex.  These options were tested with the specified compiler.
+#
+# usage:        Do not call this file directly; it is sourced by the
+#               mex shell script.  Modify only if you don't like the
+#               defaults after running mex.  No spaces are allowed
+#               around the '=' in the variable assignment.
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2004 The MathWorks, Inc.
+# $Revision: 1.1 $  $Date: 2009/03/18 12:46:35 $
+#----------------------------------------------------------------------------
+#
+    TMW_ROOT="$MATLAB"
+    MFLAGS=''
+    if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
+    else  
+        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
+    fi
+    case "$Arch" in
+        Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory.  The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+            MATLAB="$MATLAB"
+            ;;
+        hpux)
+#----------------------------------------------------------------------------
+#           what `which cc`
+#           HP92453-01 B.11.11.06 HP C Compiler
+            CC='cc'
+            COMPFLAGS='-z +Z +DA2.0 -mt'
+            CFLAGS="-Ae $COMPFLAGS -Wp,-H65535"
+            CLIBS="$MLIBS -lm -lc"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+#           what `which aCC`
+#           HP aC++ B3910B A.03.37
+#           HP aC++ B3910B A.03.30 Language Support Library
+            CXX='aCC'
+            CXXFLAGS="$MCXXFLAGS -AA -D_HPUX_SOURCE $COMPFLAGS"
+            CXXLIBS="$MLIBS -lm -lstd_v2 -lCsup_v2"
+            CXXOPTIMFLAGS='-O -DNDEBUG +Oconservative'
+            CXXDEBUGFLAGS='-g'
+#
+#           what `which f90`
+#           HP-UX f90 20020606 (083554)  B3907DB/B3909DB B.11.01.60
+#           HP F90 v2.6
+#            $ PATCH/11.00:PHCO_95167  Oct  1 1998 13:46:32 $
+            F90LIBDIR='/opt/fortran90/lib/pa2.0'
+            FC='f90'
+            FFLAGS='+Z +DA2.0'
+            FLIBS="$MLIBS -lm -L$F90LIBDIR -lF90 -lcl -lc -lisamstub"
+            FOPTIMFLAGS='-O +Oconservative'
+            FDEBUGFLAGS='-g'
+#
+            if [ "$ffiles" = "1" ]; then
+            LD='cc'
+            else
+            LD="$COMPILER"
+            fi
+            LDEXTENSION='.mexhpux'
+            LDFLAGS="-b -Wl,+e,mexVersion,+e,mexFunction,+e,mexfunction,+e,mexLibrary,+e,_shlInit $COMPFLAGS"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        glnx86)
+#----------------------------------------------------------------------------
+            RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+#           gcc -v
+#           gcc version 3.2.3
+            CC='gcc'
+#           mexopts_v704.sh change:
+            CFLAGS='-fPIC -D_GNU_SOURCE -pthread -fexceptions -m32'
+#           was:
+#           CFLAGS='-fPIC -ansi -D_GNU_SOURCE -pthread -fexceptions -m32'
+            CLIBS="$RPATH $MLIBS -lm -lstdc++"
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#           
+#           g++ -v
+#           gcc version 3.2.3
+            CXX='g++'
+            CXXFLAGS='-fPIC -ansi -D_GNU_SOURCE -pthread '
+            CXXLIBS="$RPATH $MLIBS -lm"
+            CXXOPTIMFLAGS='-O3 -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           g77 -fversion
+#           GNU Fortran (GCC 3.2.3) 3.2.3 20030422 (release)
+#           NOTE: g77 is not thread safe
+            FC='g77'
+            FFLAGS='-fPIC -fexceptions'
+            FLIBS="$RPATH $MLIBS -lm -lstdc++"
+            FOPTIMFLAGS='-O3'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexglx'
+            LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O3'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        glnxi64)
+#----------------------------------------------------------------------------
+echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh glnxi64 12
+#----------------------------------------------------------------------------
+            ;;
+        glnxa64)
+#----------------------------------------------------------------------------
+            RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+#           gcc -v
+#           gcc version 3.2.3
+            CC='gcc'
+            CFLAGS='-fPIC -fno-omit-frame-pointer -std=c99 -D_GNU_SOURCE -pthread -fexceptions'
+            CLIBS="$RPATH $MLIBS -lm -lstdc++"
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#           
+#           g++ -v
+#           gcc version 3.2.3
+            CXX='g++'
+            CXXFLAGS='-fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread '
+            CXXLIBS="$RPATH $MLIBS -lm"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           g77 -fversion
+#           GNU Fortran (GCC 3.2.3) 3.2.3 20030422 (release)
+#           NOTE: g77 is not thread safe
+            FC='g77'
+            FFLAGS='-fPIC -fno-omit-frame-pointer -fexceptions'
+            FLIBS="$RPATH $MLIBS -lm -lstdc++"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexa64'
+            LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+			
+		x86_64)
+#----------------------------------------------------------------------------
+            RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+#           gcc -v
+#           gcc version 3.2.3
+            CC='gcc'
+            CFLAGS='-fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions -std=c100'
+            CLIBS="$RPATH $MLIBS -lm -lstdc++"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#           
+#           g++ -v
+#           gcc version 3.2.3
+            CXX='g++'
+            CXXFLAGS='-fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread '
+            CXXLIBS="$RPATH $MLIBS -lm"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           g77 -fversion
+#           GNU Fortran (GCC 3.2.3) 3.2.3 20030422 (release)
+#           NOTE: g77 is not thread safe
+            FC='g77'
+            FFLAGS='-fPIC -fno-omit-frame-pointer -fexceptions'
+            FLIBS="$RPATH $MLIBS -lm -lstdc++"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexa64'
+            LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+
+        sol2)
+#----------------------------------------------------------------------------
+#           cc -V
+#           Sun C 5.5 Patch 112760-06 2004/01/13
+            CC='cc'
+#           mexopts_v704.sh change:
+            CFLAGS='-v -KPIC -dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+#           was:
+#           CFLAGS='-KPIC -dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+            CLIBS="$MLIBS -lm -lc"
+            COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+            CDEBUGFLAGS='-xs -g'
+#           
+#           CC -V
+#           Sun C++ 5.5 Patch 113817-05 2004/01/13
+            CXX='CC -compat=5'
+            CCV=`CC -V 2>&1`
+            version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+            if [ "$version" = "4" ]; then
+                    echo "SC5.0 or later C++ compiler is required"
+            fi
+            CXXFLAGS='-KPIC -dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+            CXXLIBS="$MLIBS -lm -lCstd -lCrun"
+            CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+            CXXDEBUGFLAGS='-xs -g'
+#
+#           f90 -V
+#           Sun Fortran 95 7.1 Patch 112762-09 2004/01/26
+            FC='f90'
+            FFLAGS='-KPIC -dalign -mt'
+            FLIBS="$MLIBS -lfui -lfsu -lsunmath -lm -lc"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-xs -g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexsol'
+            LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-xs -g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        mac)
+#----------------------------------------------------------------------------
+#           gcc-3.3 -v
+#           gcc version 3.3 20030304 (Apple Computer, Inc. build 1435)
+            CC='gcc-3.3'
+            CFLAGS='-fno-common -no-cpp-precomp -fexceptions'
+            CLIBS="$MLIBS -lstdc++"
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+#           g++-3.3 -v
+#           gcc version 3.3 20030304 (Apple Computer, Inc. build 1435)
+            CXX=g++-3.3
+            CXXFLAGS='-fno-common -no-cpp-precomp -fexceptions'
+            CXXLIBS="$MLIBS -lstdc++"
+            CXXOPTIMFLAGS='-O3 -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#           f77 -V
+#           FORTRAN 77 Compiler 8.2a
+            FC='f77'
+            FFLAGS='-f -N15 -N11 -s -Q51 -W'
+            ABSOFTLIBDIR=`which $FC | sed -n -e '1s|bin/'$FC'|lib|p'`
+            FLIBS="-L$ABSOFTLIBDIR -lfio -lf77math"
+            FOPTIMFLAGS='-O -cpu:g4'
+            FDEBUGFLAGS='-g'
+#
+            LD="$CC"
+            LDEXTENSION='.mexmac'
+            LDFLAGS="-bundle -Wl,-flat_namespace -undefined suppress -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+    esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+#     Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+#           CC="$CC"
+#           CFLAGS="$CFLAGS"
+#           COPTIMFLAGS="$COPTIMFLAGS"
+#           CDEBUGFLAGS="$CDEBUGFLAGS"
+#           CLIBS="$CLIBS"
+#
+#           FC="$FC"
+#           FFLAGS="$FFLAGS"
+#           FOPTIMFLAGS="$FOPTIMFLAGS"
+#           FDEBUGFLAGS="$FDEBUGFLAGS"
+#           FLIBS="$FLIBS"
+#
+#           LD="$LD"
+#           LDFLAGS="$LDFLAGS"
+#           LDOPTIMFLAGS="$LDOPTIMFLAGS"
+#           LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
Index: /issm/trunk/etc/mexopts_v76.sh
===================================================================
--- /issm/trunk/etc/mexopts_v76.sh	(revision 1)
+++ /issm/trunk/etc/mexopts_v76.sh	(revision 1)
@@ -0,0 +1,367 @@
+#
+#
+# gccopts_v75.sh:
+#
+#    modifications to gccopts.sh as follows:
+#
+#       specify gcc version 4x,  added "-D__GCC4BUILD__"
+#       to act as flag in include/matlab_includes.h to identify whether or not
+#       mwIndex, mwSize have been defined.
+# 
+#    note: searching on "gccopts_v75.sh" will take you to the changes
+
+##
+# mexopts.sh	Shell script for configuring MEX-file creation script,
+#               mex.  These options were tested with the specified compiler.
+#
+# usage:        Do not call this file directly; it is sourced by the
+#               mex shell script.  Modify only if you don't like the
+#               defaults after running mex.  No spaces are allowed
+#               around the '=' in the variable assignment.
+#
+# Note: For the version of system compiler supported with this release,
+#       refer to Technical Note 1601 at:
+#       http://www.mathworks.com/support/tech-notes/1600/1601.html
+#
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2007 The MathWorks, Inc.
+# $Revision: 1.2 $  $Date: 2009/03/18 13:57:38 $
+#----------------------------------------------------------------------------
+#
+    TMW_ROOT="$MATLAB"
+    MFLAGS=''
+    if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
+    else  
+        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
+    fi
+    case "$Arch" in
+        Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory.  The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+            MATLAB="$MATLAB"
+            ;;
+        glnx86)
+#----------------------------------------------------------------------------
+            RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc'
+            CFLAGS='-ansi -D_GNU_SOURCE'
+            CFLAGS="$CFLAGS -fPIC -pthread -m32"
+            CFLAGS="$CFLAGS  -fexceptions"
+            CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" 
+            CLIBS="$RPATH $MLIBS -lm"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+            CLIBS="$CLIBS -lstdc++"
+#           
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX='g++'
+            CXXFLAGS='-ansi -D_GNU_SOURCE'
+            CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64" 
+            CXXFLAGS="$CXXFLAGS -fPIC -pthread"
+            CXXLIBS="$RPATH $MLIBS -lm"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+#
+            # FortrankeyName: g95
+            # FortrankeyManufacturer: GNU
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+            FC='g95'
+            FFLAGS='-fexceptions'
+            FFLAGS="$FFLAGS -fPIC"
+            FLIBS="$RPATH $MLIBS -lm"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexglx'
+            LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        glnxa64)
+#----------------------------------------------------------------------------
+            RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc'
+			CFLAGS='-fPIC -fno-omit-frame-pointer -std=c99 -D_GNU_SOURCE -pthread -fexceptions -D__GCC4BUILD__ -largeArrayDims' 
+            CLIBS="$RPATH $MLIBS -lm"
+            COPTIMFLAGS='-O -DNDEBUG'
+            CDEBUGFLAGS='-g'
+            CLIBS="$CLIBS -lstdc++"
+#
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX='g++'
+            CXXFLAGS='-ansi -D_GNU_SOURCE'
+            CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+            CXXLIBS="$RPATH $MLIBS -lm"
+            CXXOPTIMFLAGS='-O -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+            # FortrankeyName: g95
+            # FortrankeyManufacturer: GNU
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+#
+            FC='g95'
+            FFLAGS='-fexceptions'
+            FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
+            FLIBS="$RPATH $MLIBS -lm"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexa64'
+            LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        sol64)
+#----------------------------------------------------------------------------
+            # StorageVersion: 1.0
+            # CkeyName: Sun Studio
+            # CkeyManufacturer: Sun
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='cc -xarch=v9a'
+            CFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+            CFLAGS="$CFLAGS -KPIC"
+            CLIBS="$MLIBS -lm"
+            CLIBS="$CLIBS -lc"
+            COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+            CDEBUGFLAGS='-xs -g'
+#           
+            # C++keyName: Sun Studio
+            # C++keyManufacturer: Sun
+            # C++keyLanguage: C++
+            # C++keyVersion:
+            CXX='CC -xarch=v9a -compat=5'
+            CCV=`CC -xarch=v9a -V 2>&1`
+            version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+            if [ "$version" = "4" ]; then
+                    echo "SC5.0 or later C++ compiler is required"
+            fi
+            CXXFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -library=stlport4,Crun'
+            CXXFLAGS="$CXXFLAGS -D_POSIX_C_SOURCE=199506L -mt"
+            CXXFLAGS="$CXXFLAGS -KPIC -norunpath"
+            CXXLIBS="$MLIBS -lm"
+            CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+            CXXDEBUGFLAGS='-xs -g'
+#
+            # FortrankeyName: Sun Studio
+            # FortrankeyManufacturer: Sun
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion:
+            FC='f90 -xarch=v9a'
+            FFLAGS='-dalign'
+            FFLAGS="$FFLAGS -KPIC -mt"
+            FLIBS="$MLIBS -lfui -lfsu -lsunmath -lm -lc"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-xs -g'
+#
+            LD="$COMPILER"
+            LDEXTENSION='.mexs64'
+            LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-xs -g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        mac)
+#----------------------------------------------------------------------------
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc-4.0'
+            CFLAGS='-fno-common -no-cpp-precomp'
+            CFLAGS="$CFLAGS"
+            CLIBS="$MLIBS"
+            COPTIMFLAGS='-O3 -fno-loop-optimize -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            CLIBS="$CLIBS -lstdc++"
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX=g++-4.0
+            CXXFLAGS='-fno-common -no-cpp-precomp -fexceptions -arch ppc'
+            CXXLIBS="$MLIBS -lstdc++"
+            CXXOPTIMFLAGS='-O3 -fno-loop-optimize -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+            # FortrankeyName: g95
+            # FortrankeyManufacturer: GNU
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+            FC='g95'
+            FFLAGS='-fexceptions'
+            FC_LIBDIR=`$FC -print-file-name=libf95.a 2>&1 | sed -n '1s/\/*libf95\.a//p'`
+            FLIBS="$MLIBS -L$FC_LIBDIR -lf95"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$CC"
+            LDEXTENSION='.mexmac'
+            LDFLAGS='-Wl,-flat_namespace -undefined suppress'
+            LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        maci)
+#----------------------------------------------------------------------------
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc-4.0'
+            CFLAGS='-fno-common -no-cpp-precomp'
+            CFLAGS="$CFLAGS  -fexceptions"
+            CLIBS="$MLIBS"
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            CLIBS="$CLIBS -lstdc++"
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX=g++-4.0
+            CXXFLAGS='-fno-common -no-cpp-precomp -fexceptions -arch i386'
+            CXXLIBS="$MLIBS -lstdc++"
+            CXXOPTIMFLAGS='-O3 -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+            # FortrankeyName: g95
+            # FortrankeyManufacturer: GNU
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+            FC='g95'
+            FFLAGS='-fexceptions'
+            FC_LIBDIR=`$FC -print-file-name=libf95.a 2>&1 | sed -n '1s/\/*libf95\.a//p'`
+            FLIBS="$MLIBS -L$FC_LIBDIR -lf95"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$CC"
+            LDEXTENSION='.mexmaci'
+            LDFLAGS='-Wl,-flat_namespace -undefined suppress'
+            LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+        maci64)
+#----------------------------------------------------------------------------
+            # StorageVersion: 1.0
+            # CkeyName: GNU C
+            # CkeyManufacturer: GNU
+            # CkeyLanguage: C
+            # CkeyVersion:
+            CC='gcc-4.0'
+            CFLAGS='-fno-common -no-cpp-precomp -fexceptions -arch x86_64'
+            CLIBS="$MLIBS -lstdc++"
+            COPTIMFLAGS='-O3 -DNDEBUG'
+            CDEBUGFLAGS='-g'
+#
+            # C++keyName: GNU C++
+            # C++keyManufacturer: GNU
+            # C++keyLanguage: C++
+            # C++keyVersion: 
+            CXX=g++-4.0
+            CXXFLAGS='-fno-common -no-cpp-precomp -fexceptions -arch x86_64'
+            CXXLIBS="$MLIBS -lstdc++"
+            CXXOPTIMFLAGS='-O3 -DNDEBUG'
+            CXXDEBUGFLAGS='-g'
+#
+            # FortrankeyName: Intel Fortran
+            # FortrankeyManufacturer: Intel
+            # FortrankeyLanguage: Fortran
+            # FortrankeyVersion: 
+            FC='ifort'
+            FFLAGS=''
+            FC_LIBDIR=''
+            FLIBS="$MLIBS"
+            FOPTIMFLAGS='-O'
+            FDEBUGFLAGS='-g'
+#
+            LD="$CC"
+            LDEXTENSION='.mexmaci64'
+            LDFLAGS='-Wl,-twolevel_namespace -undefined error -arch x86_64'
+            LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+            LDOPTIMFLAGS='-O'
+            LDDEBUGFLAGS='-g'
+#
+            POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+            ;;
+    esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+#     Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+#           CC="$CC"
+#           CFLAGS="$CFLAGS"
+#           COPTIMFLAGS="$COPTIMFLAGS"
+#           CDEBUGFLAGS="$CDEBUGFLAGS"
+#           CLIBS="$CLIBS"
+#
+#           FC="$FC"
+#           FFLAGS="$FFLAGS"
+#           FOPTIMFLAGS="$FOPTIMFLAGS"
+#           FDEBUGFLAGS="$FDEBUGFLAGS"
+#           FLIBS="$FLIBS"
+#
+#           LD="$LD"
+#           LDFLAGS="$LDFLAGS"
+#           LDOPTIMFLAGS="$LDOPTIMFLAGS"
+#           LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
Index: /issm/trunk/etc/platforms/cosmos/Make_config.mk
===================================================================
--- /issm/trunk/etc/platforms/cosmos/Make_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/cosmos/Make_config.mk	(revision 1)
@@ -0,0 +1,235 @@
+
+#
+# Make_config.mk
+#
+
+
+ifeq ($(MAKELEVEL),0)
+
+   # run only if top-level make:
+   SHELL = /bin/sh
+
+   # command-line args, defaults:
+
+   ifdef VER
+      version = $(VER)
+   else
+      version = 5
+   endif
+
+   ifdef CLUSTER
+      cluster = $(CLUSTER)
+   else
+      cluster = 0
+   endif 
+
+   ifdef BATCH
+      batch = $(BATCH)
+   else
+      batch = 0
+   endif
+
+
+
+   ifdef PLATFORM
+      platform = $(PLATFORM)
+   else
+      platform = sun
+   endif
+
+   ifdef COMPILER
+      compiler = $(COMPILER)
+   endif 
+
+   ifdef COMPUTLIB
+      computlib = $(COMPUTLIB)
+   endif 
+
+   ifdef THREAD
+      thread = $(THREAD)
+   endif 
+
+   ifdef MEMORYMANAGER
+      memmgr = $(MEMORYMANAGER)
+   else
+      memmgr = 0
+   endif 
+
+   supported = no
+
+   # branch accordingly:
+
+   ifeq ($(version),5)
+      MROOT = /opt/cots/matlab/5.3.1
+      ifeq ($(platform),sun)
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+		 OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v5.sh
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),6)
+      MROOT = /opt/cots/matlab/6.5
+      MOPTS = -V5
+      ifeq ($(platform),sun)
+         supported = yes
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v651.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),7)
+      ifeq ($(platform),sun)
+         supported = yes
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT = mexsol
+         MROOT = /opt/cots/matlab/7.0.4
+         MOPTS  += -f ../mexopts_v704.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+      ifeq (lin,$(findstring lin,$(platform)))
+         supported = yes 
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT   = mexglx
+         MROOT     = /usr/local/matlab
+         MOPTS    += -f ../mexopts_v704.sh -V5
+         ifeq ($(compiler),icc)
+		 CC        = icc
+		 #CFLAGS  += -static #needed for any intel compilation.
+		 else
+		 CC        = gcc
+		 endif
+         CFLAGS   += -D_LINUX_ 
+		 PETSCROOT += /scratch/larour/libraries_tier2_ice/petsc-2.3.3-p15
+		 PETSCARCH += linux-gnu
+      endif
+      ifeq (win,$(findstring win,$(platform)))
+         ifeq ($(compiler),borland)
+            supported = yes
+			OBJ_EXT = obj
+            LIB_EXT   = LIB
+			ifeq ($(cluster),1)
+			OBJ_EXT = sobj
+            LIB_EXT   = sLIB
+			endif
+            ifeq ($(batch),1)
+			OBJ_EXT = bobj
+			LIB_EXT = bLIB
+			endif
+            MEX_EXT   = mexw32
+            #MROOT     = C:/MATLAB704
+            MROOT     = C:/MATLAB/R2006b
+            MBIN      = $(MROOT)/bin/win32
+            MEX       = $(MBIN)/mex.bat
+            MOPTS     = -f $(MBIN)/mexopts/bcc55opts.bat -V5
+            CC        = C:/Program\ Files/Borland/Cbuilder6/Bin/bcc32
+            CFLAGS   += -D_WIN_
+         endif
+      endif
+   endif
+
+   # if not yet assigned, set remaining defaults:
+
+   ifndef MBIN
+      MBIN     = $(MROOT)/bin
+   endif
+
+   ifndef MEX
+      MEX      = $(MBIN)/mex
+   endif
+
+   ifeq ($(cluster),0)
+	   ifndef MINCLUDE
+		  MINCLUDE = $(MROOT)/extern/include
+	   endif
+   endif
+
+   ifeq ($(memmgr),1)
+	   CFLAGS  += -D_MEMMGR_
+   endif
+
+
+   # for verbose build:
+   #MOPTS  += -v
+
+   CFLAGS  += -I$(MINCLUDE) 
+
+   CFLAGS  += -DMATLAB 
+
+   # define flags for computational libraries.
+   ifeq (metis,$(findstring metis,$(computlib)))
+		METISDIR=/scratch/larour/libraries_tier2_ice/metis-4.0/
+		CFLAGS += -I$(METISDIR)/Lib
+		COMPUTLIBS += -L$(METISDIR) -lmetis
+	endif
+
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+	   CFLAGS   += -I$(PETSCROOT) -I$(PETSCROOT)/include/ -I$(PETSCROOT)/bmake/$(PETSCARCH) 
+	   CFLAGS   += -D_PETSC_ 
+       COMPUTLIBS+= -L$(PETSCROOT)/lib/$(PETSCARCH)/ -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts
+   endif
+    
+   ifeq (standard,$(findstring standard,$(computlib)))
+	   CFLAGS   += -D_STANDARD_
+	   #No need to define COMPUTLIBS: we are using our "home" made routines.
+   endif
+   
+   # activate thread compilation if necessary.
+   ifeq ($(thread),yes)
+	   CFLAGS   += -D_THREAD_
+   endif
+
+   # gcc build
+   #GCCOPTS  = gccopts.sh
+   #CC       = gcc
+
+   #define libraries that need to be linked with all the mex modules
+   
+   ifeq ($(cluster),0) #we are building mex module only serially, not on a cluster on in batch mode
+   LIBS    = ../Cielo.$(LIB_EXT)
+   endif
+endif
Index: /issm/trunk/etc/platforms/cosmos/Make_server_config.mk
===================================================================
--- /issm/trunk/etc/platforms/cosmos/Make_server_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/cosmos/Make_server_config.mk	(revision 1)
@@ -0,0 +1,128 @@
+#Server Makefile configuration.
+   
+ifeq ($(cluster),1)
+
+	#Add some strict compiling 
+	#CFLAGS  += -Werror-implicit-function-declaration
+
+	#Undefine matlab if already defined. 
+	CFLAGS+= -UMATLAB
+
+	ifdef MPILAUNCH
+		mpilaunch = $(MPILAUNCH)
+	else
+		mpilaunch= mpi
+	endif
+
+	ifeq ($(mpilaunch),bsub)
+		CFLAGS   += -D_BSUB_
+	endif
+	ifeq ($(mpilaunch),mpi)
+		CFLAGS   += -D_MPI_
+	endif
+
+	#MPIIO flags: 
+	CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_USE_LUSTRE_
+	#CFLAGS += -D_FILE_OFFSET_BITS=64 
+
+	#Server flags
+	#CFLAGS += -fno-strict-aliasing -funroll-loops -g3 -D_SERVER_ -O3
+	CFLAGS += -fno-strict-aliasing  -D_SERVER_ -O3
+	#CFLAGS += -Wall
+
+	#Cluster flags: 
+	MPIROOT=/opt/mpich/gm/intel8.0
+	CC=$(MPIROOT)/bin/mpicc
+
+	CFLAGS +=  -D_CLUSTER_ -I$(MPIROOT)/include
+
+	COMPUTLIBS += -L$(MPIROOT)/lib -lfmpich -lmpich  
+
+	
+	#SLEPC Definitions
+	ifeq (slepc,$(findstring slepc,$(computlib)))
+		SLEPCDIR=/scratch/larour/libraries_tier2_ice/slepc-2.3.3
+		
+		CFLAGS += -I$(SLEPCDIR)/include
+
+		COMPUTLIBS += $(SLEPCDIR)/lib/$(PETSCARCH)/libslepc.a
+		#COMPUTLIBS += -L$(SLEPCDIR)/lib/$(PETSCARCH) -lslepc
+	endif
+
+	
+	#PLAPACK Definitions.
+	ifeq (plapack,$(findstring plapack,$(computlib)))
+		PLAPACKDIR=$(PETSCROOT)/externalpackages/PLAPACKR32
+		#We need also Petsc Plapack prototypes found in  $PETSCROOT)/src/mat/impls/dense/mpi/plapack/PLA_prototypes.h
+
+		CFLAGS += -I$(PLAPACKDIR)/INCLUDE -I$(PETSCROOT)/src/mat/impls/dense/mpi/plapack/
+
+		COMPUTLIBS += -L$(PLAPACKDIR)/$(PETSCARCH) -lPLAPACK
+	endif
+
+	#MUMPS Definitions.
+	ifeq (mumps,$(findstring mumps,$(computlib)))
+		MUMPSDIR=$(PETSCROOT)/externalpackages/MUMPS_4.7.3/
+
+		CFLAGS += -I$(MUMPSDIR)/include 
+
+		COMPUTLIBS += -L$(MUMPSDIR)/$(PETSCARCH)/lib -ldmumps -lcmumps -lpord
+	endif
+
+	#PETSC Definitions: 
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+		#LAPACK and BLAS definitions needed for MPI use of Petsc.
+		#FBLASLAPACKDIR=$(PETSCROOT)/externalpackages/fblaslapack/$(PETSCARCH)
+		#COMPUTLIBS += -L$(FBLASLAPACKDIR) -lflapack -lfblas 
+		FBLASLAPACKDIR=/opt/intel/mkl/8.0/lib/32
+		COMPUTLIBS += $(FBLASLAPACKDIR)/libmkl_lapack.a $(FBLASLAPACKDIR)/libmkl_ia32.a $(FBLASLAPACKDIR)/libmkl_def.so -L$(FBLASLAPACKDIR) -lguide -lpthread
+		#COMPUTLIBS += -Wl,-rpath,$(FBLASLAPACKDIR) -L$(FBLASLAPACKDIR) -lmkl_lapack32 -lmkl_def -lguide -lpthread
+	endif
+
+	#SCALAPACK Definitions
+	ifeq (scalapack,$(findstring scalapack,$(computlib)))
+		#SCALAPACKDIR=/home/larour/SCALAPACK
+		SCALAPACKDIR=$(PETSC_DIR)/externalpackages/SCALAPACK/linux-gnu
+		#We need BLACS to work with Scalapack
+		#BLACSDIR=/home/larour/BLACS/LIB
+		BLACSDIR=$(PETSC_DIR)/externalpackages/blacs-dev/linux-gnu
+	
+		COMPUTLIBS += -L$(SCALAPACKDIR) -lscalapack 
+		#COMPUTLIBS += $(BLACSDIR)/blacsF77init_MPI-LINUX-0.a $(BLACSDIR)/blacs_MPI-LINUX-0.a $(BLACSDIR)/blacsCinit_MPI-LINUX-0.a
+		COMPUTLIBS += -L$(BLACSDIR) -lblacs 
+
+	
+	
+	endif
+
+	#Metis definitions
+	METISDIR=/scratch/larour/libraries_tier2_ice/metis-4.0/
+	CFLAGS += -I$(METISDIR)/Lib
+	COMPUTLIBS += -L$(METISDIR) -lmetis
+
+	#Super lu
+	SUPERLUDIR=$(PETSC_DIR)/externalpackages/SuperLU_DIST_2.0-Jan_5_2006/$(PETSCARCH)/
+	COMPUTLIBS += -L$(SUPERLUDIR) -lsuperlu_dist_2.0
+
+	#Spooles
+	
+	SPOOLESDIR=$(PETSC_DIR)/externalpackages/spooles-2.2/$(PETSCARCH)
+	COMPUTLIBS += -L$(SPOOLESDIR) -lspooles
+	SPOOLESDIR2=$(PETSC_DIR)/externalpackages/spooles-2.2/$(PETSCARCH)/MPI/src
+	COMPUTLIBS += -L$(SPOOLESDIR2) -lspoolesMPI
+
+
+	#Extra definitions
+	#G2CDIR=/lib/ssa/gcc-lib/i386-redhat-linux-gnu/3.5-tree-ssa
+	#G2CDIR=/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/
+	FORTRANDIR=/opt/intel/compilers/ifort_8.0.046/lib 
+
+	#COMPUTLIBS += -lnsl -lrt -L/usr/X11R6/lib -lX11 -L$(G2CDIR) -lg2c -L$(FORTRANDIR) -lifcore  -lpetsc
+	COMPUTLIBS += -lnsl -lrt -L/usr/X11R6/lib -lX11 -L$(FORTRANDIR) -lifcore  -lpetsc  $(MPIROOT)/lib/libmpich.a
+	
+endif 
+
+ifeq ($(batch),1)
+#Add _BATCH_ flag to compilation
+CFLAGS+= -D_BATCH_
+endif
Index: /issm/trunk/etc/platforms/cosmos/modinit
===================================================================
--- /issm/trunk/etc/platforms/cosmos/modinit	(revision 1)
+++ /issm/trunk/etc/platforms/cosmos/modinit	(revision 1)
@@ -0,0 +1,3 @@
+module add intel_mkl80
+module add intel-ifort-compiler.8.1.019
+module add intel-icc-compiler.8.1.022
Index: /issm/trunk/etc/platforms/gemini/gnu/Make_config.mk
===================================================================
--- /issm/trunk/etc/platforms/gemini/gnu/Make_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/gemini/gnu/Make_config.mk	(revision 1)
@@ -0,0 +1,235 @@
+
+#
+# Make_config.mk
+#
+
+
+ifeq ($(MAKELEVEL),0)
+
+   # run only if top-level make:
+   SHELL = /bin/sh
+
+   # command-line args, defaults:
+
+   ifdef VER
+      version = $(VER)
+   else
+      version = 5
+   endif
+
+   ifdef CLUSTER
+      cluster = $(CLUSTER)
+   else
+      cluster = 0
+   endif 
+
+   ifdef BATCH
+      batch = $(BATCH)
+   else
+      batch = 0
+   endif
+
+
+
+   ifdef PLATFORM
+      platform = $(PLATFORM)
+   else
+      platform = sun
+   endif
+
+   ifdef COMPILER
+      compiler = $(COMPILER)
+   endif 
+
+   ifdef COMPUTLIB
+      computlib = $(COMPUTLIB)
+   endif 
+
+   ifdef THREAD
+      thread = $(THREAD)
+   endif 
+
+   ifdef MEMORYMANAGER
+      memmgr = $(MEMORYMANAGER)
+   else
+      memmgr = 0
+   endif 
+
+   supported = no
+
+   # branch accordingly:
+
+   ifeq ($(version),5)
+      MROOT = /opt/cots/matlab/5.3.1
+      ifeq ($(platform),sun)
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+		 OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v5.sh
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),6)
+      MROOT = /opt/cots/matlab/6.5
+      MOPTS = -V5
+      ifeq ($(platform),sun)
+         supported = yes
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v651.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),7)
+      ifeq ($(platform),sun)
+         supported = yes
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT = mexsol
+         MROOT = /opt/cots/matlab/7.0.4
+         MOPTS  += -f ../mexopts_v704.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+      ifeq (lin,$(findstring lin,$(platform)))
+         supported = yes 
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT   = mexglx
+         MROOT     = /usr/local/matlab
+         MOPTS    += -f ../mexopts_v704.sh -V5
+         ifeq ($(compiler),icc)
+		 CC        = icc
+		 #CFLAGS  += -static #needed for any intel compilation.
+		 else
+		 CC        = gcc
+		 endif
+         CFLAGS   += -D_LINUX_ 
+		 PETSCROOT += /home/larour/Libraries/petsc-2.3.2-p10
+		 PETSCARCH += linux-gnu-ia64
+      endif
+      ifeq (win,$(findstring win,$(platform)))
+         ifeq ($(compiler),borland)
+            supported = yes
+			OBJ_EXT = obj
+            LIB_EXT   = LIB
+			ifeq ($(cluster),1)
+			OBJ_EXT = sobj
+            LIB_EXT   = sLIB
+			endif
+            ifeq ($(batch),1)
+			OBJ_EXT = bobj
+			LIB_EXT = bLIB
+			endif
+            MEX_EXT   = mexw32
+            #MROOT     = C:/MATLAB704
+            MROOT     = C:/MATLAB/R2006b
+            MBIN      = $(MROOT)/bin/win32
+            MEX       = $(MBIN)/mex.bat
+            MOPTS     = -f $(MBIN)/mexopts/bcc55opts.bat -V5
+            CC        = C:/Program\ Files/Borland/Cbuilder6/Bin/bcc32
+            CFLAGS   += -D_WIN_
+         endif
+      endif
+   endif
+
+   # if not yet assigned, set remaining defaults:
+
+   ifndef MBIN
+      MBIN     = $(MROOT)/bin
+   endif
+
+   ifndef MEX
+      MEX      = $(MBIN)/mex
+   endif
+
+   ifeq ($(cluster),0)
+	   ifndef MINCLUDE
+		  MINCLUDE = $(MROOT)/extern/include
+	   endif
+   endif
+
+   ifeq ($(memmgr),1)
+	   CFLAGS  += -D_MEMMGR_
+   endif
+
+
+   # for verbose build:
+   #MOPTS  += -v
+
+   CFLAGS  += -I$(MINCLUDE) 
+
+   CFLAGS  += -DMATLAB 
+
+   # define flags for computational libraries.
+   ifeq (metis,$(findstring metis,$(computlib)))
+		METISDIR=/home/larour/Libraries/metis-4.0/
+		CFLAGS += -I$(METISDIR)/Lib
+		COMPUTLIBS += -L$(METISDIR) -lmetis
+	endif
+
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+	   CFLAGS   += -I$(PETSCROOT) -I$(PETSCROOT)/include/ -I$(PETSCROOT)/bmake/$(PETSCARCH) 
+	   CFLAGS   += -D_PETSC_ 
+       COMPUTLIBS+= -L$(PETSCROOT)/lib/$(PETSCARCH)/ -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts
+   endif
+    
+   ifeq (standard,$(findstring standard,$(computlib)))
+	   CFLAGS   += -D_STANDARD_
+	   #No need to define COMPUTLIBS: we are using our "home" made routines.
+   endif
+   
+   # activate thread compilation if necessary.
+   ifeq ($(thread),yes)
+	   CFLAGS   += -D_THREAD_
+   endif
+
+   # gcc build
+   #GCCOPTS  = gccopts.sh
+   #CC       = gcc
+
+   #define libraries that need to be linked with all the mex modules
+   
+   ifeq ($(cluster),0) #we are building mex module only serially, not on a cluster on in batch mode
+   LIBS    = ../Cielo.$(LIB_EXT)
+   endif
+endif
Index: /issm/trunk/etc/platforms/gemini/gnu/Make_server_config.mk
===================================================================
--- /issm/trunk/etc/platforms/gemini/gnu/Make_server_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/gemini/gnu/Make_server_config.mk	(revision 1)
@@ -0,0 +1,76 @@
+#Server Makefile configuration.
+   
+ifeq ($(cluster),1)
+
+	#Undefine matlab if already defined. 
+	CFLAGS+= -UMATLAB -D_CLUSTER_
+
+	ifdef MPILAUNCH
+		mpilaunch = $(MPILAUNCH)
+	else
+		mpilaunch= mpi
+	endif
+
+	ifeq ($(mpilaunch),bsub)
+		CFLAGS   += -D_BSUB_
+	endif
+	ifeq ($(mpilaunch),mpi)
+		CFLAGS   += -D_MPI_
+	endif
+
+	#MPIIO flags: 
+	CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_USE_LUSTRE_
+	#CFLAGS += -D_FILE_OFFSET_BITS=64 
+
+	#Server flags
+	CFLAGS += -fno-strict-aliasing  -D_SERVER_ -O3
+
+	#MPI
+	COMPUTLIBS += -lmpi
+
+	#SLEPC Definitions
+	ifeq (slepc,$(findstring slepc,$(computlib)))
+		SLEPCDIR=/home/larour/Libraries/slepc-2.3.2
+		CFLAGS += -I$(SLEPCDIR)/include
+		#COMPUTLIBS += -L$(SLEPCDIR)/lib/$(PETSCARCH) -lslepc
+	endif
+
+	
+	#PLAPACK Definitions.
+	ifeq (plapack,$(findstring plapack,$(computlib)))
+		PLAPACKDIR=$(PETSCROOT)/externalpackages/PLAPACKR32
+		CFLAGS += -I$(PLAPACKDIR)/INCLUDE -I$(PETSCROOT)/src/mat/impls/dense/mpi/plapack/
+		COMPUTLIBS += -L$(PLAPACKDIR)/$(PETSCARCH) -lPLAPACK
+	endif
+
+	#MUMPS Definitions.
+	ifeq (mumps,$(findstring mumps,$(computlib)))
+		MUMPSDIR=$(PETSCROOT)/externalpackages/MUMPS_4.6.3/
+		CFLAGS += -I$(MUMPSDIR)/include 
+		COMPUTLIBS += -L$(MUMPSDIR)/$(PETSCARCH)/lib -ldmumps -lcmumps -lpord
+	endif
+
+	#PETSC Definitions: 
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+		#LAPACK and BLAS definitions needed for MPI use of Petsc.
+		FBLASLAPACKDIR=$(PETSCROOT)/externalpackages/fblaslapack/$(PETSCARCH)
+		COMPUTLIBS += -L$(FBLASLAPACKDIR) -lflapack -lfblas 
+	endif
+
+	#SCALAPACK Definitions
+	ifeq (scalapack,$(findstring scalapack,$(computlib)))
+		SCALAPACKDIR=$(PETSC_DIR)/externalpackages/SCALAPACK/$(PETSC_ARCH)
+		BLACSDIR=$(PETSC_DIR)/externalpackages/blacs-dev/$(PETSC_ARCH)
+	
+		COMPUTLIBS += -L$(SCALAPACKDIR) -lscalapack  -L$(BLACSDIR) -lblacs 
+	endif
+
+	#Extra definitions
+	COMPUTLIBS += -L/usr/X11R6/lib -lX11  -lgfortran
+	
+endif 
+
+ifeq ($(batch),1)
+#Add _BATCH_ flag to compilation
+CFLAGS+= -D_BATCH_
+endif
Index: /issm/trunk/etc/platforms/gemini/intel/Make_config.mk
===================================================================
--- /issm/trunk/etc/platforms/gemini/intel/Make_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/gemini/intel/Make_config.mk	(revision 1)
@@ -0,0 +1,235 @@
+
+#
+# Make_config.mk
+#
+
+
+ifeq ($(MAKELEVEL),0)
+
+   # run only if top-level make:
+   SHELL = /bin/sh
+
+   # command-line args, defaults:
+
+   ifdef VER
+      version = $(VER)
+   else
+      version = 5
+   endif
+
+   ifdef CLUSTER
+      cluster = $(CLUSTER)
+   else
+      cluster = 0
+   endif 
+
+   ifdef BATCH
+      batch = $(BATCH)
+   else
+      batch = 0
+   endif
+
+
+
+   ifdef PLATFORM
+      platform = $(PLATFORM)
+   else
+      platform = sun
+   endif
+
+   ifdef COMPILER
+      compiler = $(COMPILER)
+   endif 
+
+   ifdef COMPUTLIB
+      computlib = $(COMPUTLIB)
+   endif 
+
+   ifdef THREAD
+      thread = $(THREAD)
+   endif 
+
+   ifdef MEMORYMANAGER
+      memmgr = $(MEMORYMANAGER)
+   else
+      memmgr = 0
+   endif 
+
+   supported = no
+
+   # branch accordingly:
+
+   ifeq ($(version),5)
+      MROOT = /opt/cots/matlab/5.3.1
+      ifeq ($(platform),sun)
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+		 OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v5.sh
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),6)
+      MROOT = /opt/cots/matlab/6.5
+      MOPTS = -V5
+      ifeq ($(platform),sun)
+         supported = yes
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v651.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),7)
+      ifeq ($(platform),sun)
+         supported = yes
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT = mexsol
+         MROOT = /opt/cots/matlab/7.0.4
+         MOPTS  += -f ../mexopts_v704.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+      ifeq (lin,$(findstring lin,$(platform)))
+         supported = yes 
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT   = mexglx
+         MROOT     = /usr/local/matlab
+         MOPTS    += -f ../mexopts_v704.sh -V5
+         ifeq ($(compiler),icc)
+		 CC        = icc
+		 #CFLAGS  += -static #needed for any intel compilation.
+		 else
+		 CC        = gcc
+		 endif
+         CFLAGS   += -D_LINUX_ 
+		 PETSCROOT += /home/larour/Libraries/petsc-2.3.2-p10-intel
+		 PETSCARCH += linux-gnu-ia64-intel
+      endif
+      ifeq (win,$(findstring win,$(platform)))
+         ifeq ($(compiler),borland)
+            supported = yes
+			OBJ_EXT = obj
+            LIB_EXT   = LIB
+			ifeq ($(cluster),1)
+			OBJ_EXT = sobj
+            LIB_EXT   = sLIB
+			endif
+            ifeq ($(batch),1)
+			OBJ_EXT = bobj
+			LIB_EXT = bLIB
+			endif
+            MEX_EXT   = mexw32
+            #MROOT     = C:/MATLAB704
+            MROOT     = C:/MATLAB/R2006b
+            MBIN      = $(MROOT)/bin/win32
+            MEX       = $(MBIN)/mex.bat
+            MOPTS     = -f $(MBIN)/mexopts/bcc55opts.bat -V5
+            CC        = C:/Program\ Files/Borland/Cbuilder6/Bin/bcc32
+            CFLAGS   += -D_WIN_
+         endif
+      endif
+   endif
+
+   # if not yet assigned, set remaining defaults:
+
+   ifndef MBIN
+      MBIN     = $(MROOT)/bin
+   endif
+
+   ifndef MEX
+      MEX      = $(MBIN)/mex
+   endif
+
+   ifeq ($(cluster),0)
+	   ifndef MINCLUDE
+		  MINCLUDE = $(MROOT)/extern/include
+	   endif
+   endif
+
+   ifeq ($(memmgr),1)
+	   CFLAGS  += -D_MEMMGR_
+   endif
+
+
+   # for verbose build:
+   #MOPTS  += -v
+
+   CFLAGS  += -I$(MINCLUDE) 
+
+   CFLAGS  += -DMATLAB 
+
+   # define flags for computational libraries.
+   ifeq (metis,$(findstring metis,$(computlib)))
+		METISDIR=/home/larour/Libraries/metis-4.0-intel/
+		CFLAGS += -I$(METISDIR)/Lib
+		COMPUTLIBS += -L$(METISDIR) -lmetis
+	endif
+
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+	   CFLAGS   += -I$(PETSCROOT) -I$(PETSCROOT)/include/ -I$(PETSCROOT)/bmake/$(PETSCARCH) 
+	   CFLAGS   += -D_PETSC_ 
+       COMPUTLIBS+= -L$(PETSCROOT)/lib/$(PETSCARCH)/ -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts
+   endif
+    
+   ifeq (standard,$(findstring standard,$(computlib)))
+	   CFLAGS   += -D_STANDARD_
+	   #No need to define COMPUTLIBS: we are using our "home" made routines.
+   endif
+   
+   # activate thread compilation if necessary.
+   ifeq ($(thread),yes)
+	   CFLAGS   += -D_THREAD_
+   endif
+
+   # gcc build
+   #GCCOPTS  = gccopts.sh
+   #CC       = gcc
+
+   #define libraries that need to be linked with all the mex modules
+   
+   ifeq ($(cluster),0) #we are building mex module only serially, not on a cluster on in batch mode
+   LIBS    = ../Cielo.$(LIB_EXT)
+   endif
+endif
Index: /issm/trunk/etc/platforms/gemini/intel/Make_server_config.mk
===================================================================
--- /issm/trunk/etc/platforms/gemini/intel/Make_server_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/gemini/intel/Make_server_config.mk	(revision 1)
@@ -0,0 +1,76 @@
+#Server Makefile configuration.
+   
+ifeq ($(cluster),1)
+
+	#Undefine matlab if already defined. 
+	CFLAGS+= -UMATLAB -D_CLUSTER_
+
+	ifdef MPILAUNCH
+		mpilaunch = $(MPILAUNCH)
+	else
+		mpilaunch= mpi
+	endif
+
+	ifeq ($(mpilaunch),bsub)
+		CFLAGS   += -D_BSUB_
+	endif
+	ifeq ($(mpilaunch),mpi)
+		CFLAGS   += -D_MPI_
+	endif
+
+	#MPIIO flags: 
+	CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_USE_LUSTRE_
+	#CFLAGS += -D_FILE_OFFSET_BITS=64 
+
+	#Server flags
+	CFLAGS += -fno-strict-aliasing  -D_SERVER_ -O3
+
+	#MPI
+	COMPUTLIBS += -lmpi
+
+	#SLEPC Definitions
+	ifeq (slepc,$(findstring slepc,$(computlib)))
+		SLEPCDIR=/home/larour/Libraries/slepc-2.3.2-intel
+		CFLAGS += -I$(SLEPCDIR)/include
+		#COMPUTLIBS += -L$(SLEPCDIR)/lib/$(PETSCARCH) -lslepc
+	endif
+
+	
+	#PLAPACK Definitions.
+	ifeq (plapack,$(findstring plapack,$(computlib)))
+		PLAPACKDIR=$(PETSCROOT)/externalpackages/PLAPACKR32
+		CFLAGS += -I$(PLAPACKDIR)/INCLUDE -I$(PETSCROOT)/src/mat/impls/dense/mpi/plapack/
+		COMPUTLIBS += -L$(PLAPACKDIR)/$(PETSCARCH) -lPLAPACK
+	endif
+
+	#MUMPS Definitions.
+	ifeq (mumps,$(findstring mumps,$(computlib)))
+		MUMPSDIR=$(PETSCROOT)/externalpackages/MUMPS_4.6.3/
+		CFLAGS += -I$(MUMPSDIR)/include 
+		COMPUTLIBS += -L$(MUMPSDIR)/$(PETSCARCH)/lib -ldmumps -lcmumps -lpord
+	endif
+
+	#PETSC Definitions: 
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+		#LAPACK and BLAS definitions needed for MPI use of Petsc.
+		FBLASLAPACKDIR=/opt/intel/mkl/9.1.023/lib/64
+		COMPUTLIBS += -L$(FBLASLAPACKDIR) -lmkl_lapack -lmkl -lguide 
+	endif
+
+	#SCALAPACK Definitions
+	ifeq (scalapack,$(findstring scalapack,$(computlib)))
+		SCALAPACKDIR=$(PETSC_DIR)/externalpackages/SCALAPACK/$(PETSC_ARCH)
+		BLACSDIR=$(PETSC_DIR)/externalpackages/blacs-dev/$(PETSC_ARCH)
+	
+		COMPUTLIBS += -L$(SCALAPACKDIR) -lscalapack  -L$(BLACSDIR) -lblacs 
+	endif
+
+	#Extra definitions
+	COMPUTLIBS += -L/usr/X11R6/lib -lX11  -L/opt/intel/fc/9.1.051/lib -lifcore
+	
+endif 
+
+ifeq ($(batch),1)
+#Add _BATCH_ flag to compilation
+CFLAGS+= -D_BATCH_
+endif
Index: /issm/trunk/etc/platforms/mustang/Make_config.mk
===================================================================
--- /issm/trunk/etc/platforms/mustang/Make_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/mustang/Make_config.mk	(revision 1)
@@ -0,0 +1,235 @@
+
+#
+# Make_config.mk
+#
+
+
+ifeq ($(MAKELEVEL),0)
+
+   # run only if top-level make:
+   SHELL = /bin/sh
+
+   # command-line args, defaults:
+
+   ifdef VER
+      version = $(VER)
+   else
+      version = 5
+   endif
+
+   ifdef CLUSTER
+      cluster = $(CLUSTER)
+   else
+      cluster = 0
+   endif 
+
+   ifdef BATCH
+      batch = $(BATCH)
+   else
+      batch = 0
+   endif
+
+
+
+   ifdef PLATFORM
+      platform = $(PLATFORM)
+   else
+      platform = sun
+   endif
+
+   ifdef COMPILER
+      compiler = $(COMPILER)
+   endif 
+
+   ifdef COMPUTLIB
+      computlib = $(COMPUTLIB)
+   endif 
+
+   ifdef THREAD
+      thread = $(THREAD)
+   endif 
+
+   ifdef MEMORYMANAGER
+      memmgr = $(MEMORYMANAGER)
+   else
+      memmgr = 0
+   endif 
+
+   supported = no
+
+   # branch accordingly:
+
+   ifeq ($(version),5)
+      MROOT = /opt/cots/matlab/5.3.1
+      ifeq ($(platform),sun)
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+		 OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v5.sh
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),6)
+      MROOT = /opt/cots/matlab/6.5
+      MOPTS = -V5
+      ifeq ($(platform),sun)
+         supported = yes
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v651.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),7)
+      ifeq ($(platform),sun)
+         supported = yes
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT = mexsol
+         MROOT = /opt/cots/matlab/7.0.4
+         MOPTS  += -f ../mexopts_v704.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+      ifeq (lin,$(findstring lin,$(platform)))
+         supported = yes 
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT   = mexglx
+         MROOT     = /usr/local/matlab
+         MOPTS    += -f ../mexopts_v704.sh -V5
+         ifeq ($(compiler),icc)
+		 CC        = icc
+		 CFLAGS  += -static #needed for any intel compilation.
+		 else
+		 CC        = gcc
+		 endif
+         CFLAGS   += -D_LINUX_ 
+		 PETSCROOT += /proj/ice/Libraries/linux/petsc-2.3.3-p15
+		 PETSCARCH += linux-gnu
+      endif
+      ifeq (win,$(findstring win,$(platform)))
+         ifeq ($(compiler),borland)
+            supported = yes
+			OBJ_EXT = obj
+            LIB_EXT   = LIB
+			ifeq ($(cluster),1)
+			OBJ_EXT = sobj
+            LIB_EXT   = sLIB
+			endif
+            ifeq ($(batch),1)
+			OBJ_EXT = bobj
+			LIB_EXT = bLIB
+			endif
+            MEX_EXT   = mexw32
+            #MROOT     = C:/MATLAB704
+            MROOT     = C:/MATLAB/R2006b
+            MBIN      = $(MROOT)/bin/win32
+            MEX       = $(MBIN)/mex.bat
+            MOPTS     = -f $(MBIN)/mexopts/bcc55opts.bat -V5
+            CC        = C:/Program\ Files/Borland/Cbuilder6/Bin/bcc32
+            CFLAGS   += -D_WIN_
+         endif
+      endif
+   endif
+
+   # if not yet assigned, set remaining defaults:
+
+   ifndef MBIN
+      MBIN     = $(MROOT)/bin
+   endif
+
+   ifndef MEX
+      MEX      = $(MBIN)/mex
+   endif
+
+   ifeq ($(cluster),0)
+	   ifndef MINCLUDE
+		  MINCLUDE = $(MROOT)/extern/include
+	   endif
+   endif
+
+   ifeq ($(memmgr),1)
+	   CFLAGS  += -D_MEMMGR_
+   endif
+
+
+   # for verbose build:
+   #MOPTS  += -v
+
+   CFLAGS  += -I$(MINCLUDE) 
+
+   CFLAGS  += -DMATLAB 
+
+   # define flags for computational libraries.
+   ifeq (metis,$(findstring metis,$(computlib)))
+		METISDIR=/proj/ice/Libraries/linux/metis-4.0-matlab/
+		CFLAGS += -I$(METISDIR)/Lib
+		COMPUTLIBS += -L$(METISDIR) -lmetis
+	endif
+
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+	   CFLAGS   += -I$(PETSCROOT) -I$(PETSCROOT)/include/ -I$(PETSCROOT)/bmake/$(PETSCARCH) 
+	   CFLAGS   += -D_PETSC_ 
+       COMPUTLIBS+= -L$(PETSCROOT)/lib/$(PETSCARCH)/ -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts
+   endif
+    
+   ifeq (standard,$(findstring standard,$(computlib)))
+	   CFLAGS   += -D_STANDARD_
+	   #No need to define COMPUTLIBS: we are using our "home" made routines.
+   endif
+   
+   # activate thread compilation if necessary.
+   ifeq ($(thread),yes)
+	   CFLAGS   += -D_THREAD_
+   endif
+
+   # gcc build
+   #GCCOPTS  = gccopts.sh
+   #CC       = gcc
+
+   #define libraries that need to be linked with all the mex modules
+   
+   ifeq ($(cluster),0) #we are building mex module only serially, not on a cluster on in batch mode
+   LIBS    = ../Cielo.$(LIB_EXT)
+   endif
+endif
Index: /issm/trunk/etc/platforms/mustang/Make_server_config.mk
===================================================================
--- /issm/trunk/etc/platforms/mustang/Make_server_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/mustang/Make_server_config.mk	(revision 1)
@@ -0,0 +1,91 @@
+#Server Makefile configuration.
+   
+ifeq ($(cluster),1)
+
+	#Add some strict compiling 
+	CFLAGS  += -Werror-implicit-function-declaration
+
+	#Undefine matlab if already defined. 
+	CFLAGS+= -UMATLAB
+
+	ifdef MPILAUNCH
+		mpilaunch = $(MPILAUNCH)
+	else
+		mpilaunch= mpi
+	endif
+
+	ifeq ($(mpilaunch),bsub)
+		CFLAGS   += -D_BSUB_
+	endif
+	ifeq ($(mpilaunch),mpi)
+		CFLAGS   += -D_MPI_
+	endif
+
+	#Server flags
+		CFLAGS += -fno-strict-aliasing -funroll-loops -g3 -D_SERVER_ -O3
+		#CFLAGS += -Wall
+
+	#Cluster flags: 
+	MPIROOT=/proj/ice/Libraries/linux/mpich2-gnu
+	CC=$(MPIROOT)/bin/mpicc
+
+	CFLAGS +=  -D_CLUSTER_ -I$(MPIROOT)/include
+
+	COMPUTLIBS += -L$(MPIROOT) -lfmpich -lmpich  -lmpichcxx 	
+
+	#PETSC Definitions: 
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+		#LAPACK and BLAS definitions needed for MPI use of Petsc.
+		FBLASLAPACKDIR=$(PETSCROOT)/externalpackages/fblaslapack/$(PETSCARCH)
+		COMPUTLIBS += -L$(FBLASLAPACKDIR) -lflapack -lfblas 
+	endif
+
+	#SLEPC Definitions
+	ifeq (slepc,$(findstring slepc,$(computlib)))
+		SLEPCDIR=/proj/ice/Libraries/linux/slepc-2.3.3
+		
+		CFLAGS += -I$(SLEPCDIR)/include
+
+		#COMPUTLIBS += -L$(SLEPCDIR)/lib/$(PETSCARCH) -lslepc
+	endif
+
+	#SCALAPACK Definitions
+	ifeq (scalapack,$(findstring scalapack,$(computlib)))
+		SCALAPACKDIR=/proj/ice/Libraries/linux/SCALAPACK/mpich2-gnu
+		#We need BLACS to work with Scalapack
+		BLACSDIR=/proj/ice/Libraries/linux/BLACS/LIB/mpich2-gnu
+		
+		COMPUTLIBS += -L$(SCALAPACKDIR) -lscalapack \
+					 -L$(BLACSDIR)  -lblacsF77init_MPI-LINUX-0 -lblacs_MPI-LINUX-0 -lblacsCinit_MPI-LINUX-0
+	endif
+
+	#PLAPACK Definitions.
+	ifeq (plapack,$(findstring plapack,$(computlib)))
+		PLAPACKDIR=$(PETSCROOT)/externalpackages/PLAPACKR32
+		#We need also Petsc Plapack prototypes found in  $PETSCROOT)/src/mat/impls/dense/mpi/plapack/PLA_prototypes.h
+
+		CFLAGS += -I$(PLAPACKDIR)/INCLUDE -I$(PETSCROOT)/src/mat/impls/dense/mpi/plapack/
+
+		COMPUTLIBS += -L$(PLAPACKDIR)/$(PETSCARCH) -lPLAPACK
+	endif
+
+	#Metis definitions
+	METISDIR=/proj/ice/Libraries/linux/metis-4.0/
+	CFLAGS += -I$(METISDIR)/Lib
+	COMPUTLIBS += -L$(METISDIR) -lmetis
+
+	#Extra definitions
+	COMPUTLIBS += -lnsl -lrt -L/usr/X11R6/lib -lX11 -lg2c -lpetsc
+
+	
+	COMPUTLIBS += -L/usr/local/g95/lib/gcc-lib/i686-pc-linux-gnu/4.0.3/ -lf95
+	#Fortran defintions in case using different compiler (absoft)
+	#FORTRAN_DIR=/opt/absoft/
+	#FORTRAN_LIBS= -lutil -lpthread -lfio -lU77 -lV77 -lf90math -lf77math -lf95math 
+	   
+endif 
+
+ifeq ($(batch),1)
+#Add _BATCH_ flag to compilation
+CFLAGS+= -D_BATCH_
+endif
Index: /issm/trunk/etc/platforms/wilkes/704/Make_config.mk
===================================================================
--- /issm/trunk/etc/platforms/wilkes/704/Make_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/wilkes/704/Make_config.mk	(revision 1)
@@ -0,0 +1,235 @@
+
+#
+# Make_config.mk
+#
+
+
+ifeq ($(MAKELEVEL),0)
+
+   # run only if top-level make:
+   SHELL = /bin/sh
+
+   # command-line args, defaults:
+
+   ifdef VER
+      version = $(VER)
+   else
+      version = 5
+   endif
+
+   ifdef CLUSTER
+      cluster = $(CLUSTER)
+   else
+      cluster = 0
+   endif 
+
+   ifdef BATCH
+      batch = $(BATCH)
+   else
+      batch = 0
+   endif
+
+
+
+   ifdef PLATFORM
+      platform = $(PLATFORM)
+   else
+      platform = sun
+   endif
+
+   ifdef COMPILER
+      compiler = $(COMPILER)
+   endif 
+
+   ifdef COMPUTLIB
+      computlib = $(COMPUTLIB)
+   endif 
+
+   ifdef THREAD
+      thread = $(THREAD)
+   endif 
+
+   ifdef MEMORYMANAGER
+      memmgr = $(MEMORYMANAGER)
+   else
+      memmgr = 0
+   endif 
+
+   supported = no
+
+   # branch accordingly:
+
+   ifeq ($(version),5)
+      MROOT = /opt/cots/matlab/5.3.1
+      ifeq ($(platform),sun)
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+		 OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v5.sh
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),6)
+      MROOT = /opt/cots/matlab/6.5
+      MOPTS = -V5
+      ifeq ($(platform),sun)
+         supported = yes
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v651.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),7)
+      ifeq ($(platform),sun)
+         supported = yes
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT = mexsol
+         MROOT = /opt/cots/matlab/7.0.4
+         MOPTS  += -f ../mexopts_v704.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+      ifeq (lin,$(findstring lin,$(platform)))
+         supported = yes 
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT   = mexa64
+         MROOT     = /usr/local/pkgs/matlab-7.4
+         MOPTS    += -f ../mexopts_v704.sh -V5
+         ifeq ($(compiler),icc)
+		 CC        = icc
+		 CFLAGS  += -static #needed for any intel compilation.
+		 else
+		 CC        = gcc
+		 endif
+         CFLAGS   += -D_LINUX_  
+		 PETSCROOT += /home/larour/Libs/petsc-2.3.2-p3
+		 PETSCARCH += linux-gnu-amd64
+      endif
+      ifeq (win,$(findstring win,$(platform)))
+         ifeq ($(compiler),borland)
+            supported = yes
+			OBJ_EXT = obj
+            LIB_EXT   = LIB
+			ifeq ($(cluster),1)
+			OBJ_EXT = sobj
+            LIB_EXT   = sLIB
+			endif
+            ifeq ($(batch),1)
+			OBJ_EXT = bobj
+			LIB_EXT = bLIB
+			endif
+            MEX_EXT   = mexw32
+            #MROOT     = C:/MATLAB704
+            MROOT     = C:/MATLAB/R2006b
+            MBIN      = $(MROOT)/bin/win32
+            MEX       = $(MBIN)/mex.bat
+            MOPTS     = -f $(MBIN)/mexopts/bcc55opts.bat -V5
+            CC        = C:/Program\ Files/Borland/Cbuilder6/Bin/bcc32
+            CFLAGS   += -D_WIN_
+         endif
+      endif
+   endif
+
+   # if not yet assigned, set remaining defaults:
+
+   ifndef MBIN
+      MBIN     = $(MROOT)/bin
+   endif
+
+   ifndef MEX
+      MEX      = $(MBIN)/mex
+   endif
+
+   ifeq ($(cluster),0)
+	   ifndef MINCLUDE
+		  MINCLUDE = $(MROOT)/extern/include
+	   endif
+   endif
+
+   ifeq ($(memmgr),1)
+	   CFLAGS  += -D_MEMMGR_
+   endif
+
+
+   # for verbose build:
+   #MOPTS  += -v
+
+   CFLAGS  += -I$(MINCLUDE) 
+
+   CFLAGS  += -DMATLAB 
+
+   # define flags for computational libraries.
+   ifeq (metis,$(findstring metis,$(computlib)))
+		METISDIR=/proj/tpfimos/larour/Libraries/linux/metis-4.0-matlab/
+		CFLAGS += -I$(METISDIR)/Lib
+		COMPUTLIBS += -L$(METISDIR) -lmetis
+	endif
+
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+	   CFLAGS   += -I$(PETSCROOT) -I$(PETSCROOT)/include/ -I$(PETSCROOT)/bmake/$(PETSCARCH) 
+	   CFLAGS   += -D_PETSC_ 
+       COMPUTLIBS+= -L$(PETSCROOT)/lib/$(PETSCARCH)/ -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts
+   endif
+    
+   ifeq (standard,$(findstring standard,$(computlib)))
+	   CFLAGS   += -D_STANDARD_
+	   #No need to define COMPUTLIBS: we are using our "home" made routines.
+   endif
+   
+   # activate thread compilation if necessary.
+   ifeq ($(thread),yes)
+	   CFLAGS   += -D_THREAD_
+   endif
+
+   # gcc build
+   #GCCOPTS  = gccopts.sh
+   #CC       = gcc
+
+   #define libraries that need to be linked with all the mex modules
+   
+   ifeq ($(cluster),0) #we are building mex module only serially, not on a cluster on in batch mode
+   LIBS    = ../Cielo.$(LIB_EXT)
+   endif
+endif
Index: /issm/trunk/etc/platforms/wilkes/704/Make_default_rules.mk
===================================================================
--- /issm/trunk/etc/platforms/wilkes/704/Make_default_rules.mk	(revision 1)
+++ /issm/trunk/etc/platforms/wilkes/704/Make_default_rules.mk	(revision 1)
@@ -0,0 +1,41 @@
+
+# pattern rules for windows:
+
+ifeq ($(OBJ_EXT),win)
+
+%.obj : %.c
+	$(CC) -c $(CFLAGS) -o $@  $< 
+
+%.sobj : %.c
+	$(CC) -c $(CFLAGS) -o $@  $< 
+
+%.bobj : %.c
+	$(CC) -c $(CFLAGS) -o $@  $< 
+endif
+
+# pattern rules for linux64:
+
+ifeq ($(PLATFORM),lin64)
+
+%.o : %.c
+	$(CC) -c -fPIC -largeArrayDims $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+
+%.so : %.c
+	$(CC) -c -fPIC -largeArrayDims $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+
+%.bo : %.c
+	$(CC) -c -fPIC -largeArrayDims $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+endif
+
+# pattern rules for linux:
+ifeq ($(PLATFORM),lin)
+%.o : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+
+%.so : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+	
+%.bo : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+endif
+
Index: /issm/trunk/etc/platforms/wilkes/704/Make_server_config.mk
===================================================================
--- /issm/trunk/etc/platforms/wilkes/704/Make_server_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/wilkes/704/Make_server_config.mk	(revision 1)
@@ -0,0 +1,92 @@
+#Server Makefile configuration.
+   
+ifeq ($(cluster),1)
+
+	#Add some strict compiling 
+	CFLAGS  += -Werror-implicit-function-declaration
+
+	#Undefine matlab if already defined. 
+	CFLAGS+= -UMATLAB
+
+	ifdef MPILAUNCH
+		mpilaunch = $(MPILAUNCH)
+	else
+		mpilaunch= mpi
+	endif
+
+	ifeq ($(mpilaunch),bsub)
+		CFLAGS   += -D_BSUB_
+	endif
+	ifeq ($(mpilaunch),mpi)
+		CFLAGS   += -D_MPI_
+	endif
+
+	#Server flags
+		CFLAGS += -fno-strict-aliasing -funroll-loops -g3 -D_SERVER_ -O3
+		#CFLAGS += -Wall
+
+	#Cluster flags: 
+	MPIROOT=/home/larour/Libs/mpich2-gnu
+	CC=$(MPIROOT)/bin/mpicc
+
+	CFLAGS +=  -D_CLUSTER_ -I$(MPIROOT)/include
+
+	COMPUTLIBS += -L$(MPIROOT) -lfmpich -lmpich  -lmpichcxx 	
+
+	#PETSC Definitions: 
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+		#LAPACK and BLAS definitions needed for MPI use of Petsc.
+		FBLASLAPACKDIR=$(PETSCROOT)/externalpackages/fblaslapack/$(PETSCARCH)
+		COMPUTLIBS += -L$(FBLASLAPACKDIR) -lflapack -lfblas 
+	endif
+
+	#SLEPC Definitions
+	ifeq (slepc,$(findstring slepc,$(computlib)))
+		SLEPCDIR=/home/larour/Libs/slepc-2.3.2
+		
+		CFLAGS += -I$(SLEPCDIR)/include
+
+		#COMPUTLIBS += -L$(SLEPCDIR)/lib/$(PETSCARCH) -lslepc
+	endif
+
+	#SCALAPACK Definitions
+	ifeq (scalapack,$(findstring scalapack,$(computlib)))
+		SCALAPACKDIR=/home/larour/Libs/SCALAPACK/mpich2-gnu
+		#We need BLACS to work with Scalapack
+		BLACSDIR=/proj/tpfimos/larour/Libraries/linux/BLACS/LIB/mpich2-gnu
+		
+		COMPUTLIBS += -L$(SCALAPACKDIR) -lscalapack \
+					 -L$(BLACSDIR)  -lblacsF77init_MPI-LINUX-0 -lblacs_MPI-LINUX-0 -lblacsCinit_MPI-LINUX-0
+	endif
+
+	#PLAPACK Definitions.
+	ifeq (plapack,$(findstring plapack,$(computlib)))
+		PLAPACKDIR=$(PETSCROOT)/externalpackages/PLAPACKR32
+		#We need also Petsc Plapack prototypes found in  $PETSCROOT)/src/mat/impls/dense/mpi/plapack/PLA_prototypes.h
+
+		CFLAGS += -I$(PLAPACKDIR)/INCLUDE -I$(PETSCROOT)/src/mat/impls/dense/mpi/plapack/
+
+		COMPUTLIBS += -L$(PLAPACKDIR)/$(PETSCARCH) -lPLAPACK
+	endif
+
+	#Metis definitions
+	METISDIR=/home/larour/Libs/metis-4.0/
+	CFLAGS += -I$(METISDIR)/Lib
+	COMPUTLIBS += -L$(METISDIR) -lmetis
+
+	#Extra definitions
+	#COMPUTLIBS += -lnsl -lrt -L/usr/X11R6/lib -lX11 -lg2c -lpetsc
+	COMPUTLIBS += -lnsl -lrt -L/usr/X11R6/lib -lX11  -lpetsc
+
+	
+	#COMPUTLIBS += -L/usr/local/g95/lib/gcc-lib/i686-pc-linux-gnu/4.0.3/ -lf95
+	#Fortran defintions in case using different compiler (absoft)
+	#FORTRAN_DIR=/opt/absoft/
+	#FORTRAN_LIBS= -lutil -lpthread -lfio -lU77 -lV77 -lf90math -lf77math -lf95math 
+	   
+endif 
+
+ifeq ($(batch),1)
+#Add _BATCH_ flag to compilation
+CFLAGS+= -D_BATCH_
+endif
Index: /issm/trunk/etc/platforms/wilkes/704/Makefile_shared
===================================================================
--- /issm/trunk/etc/platforms/wilkes/704/Makefile_shared	(revision 1)
+++ /issm/trunk/etc/platforms/wilkes/704/Makefile_shared	(revision 1)
@@ -0,0 +1,311 @@
+
+# Makefile for utils.a library,
+
+
+# make configuration:
+include ../Make_config.mk
+include ../Make_server_config.mk
+
+export
+
+# other local definitions:
+#CFLAGS  += -Werror-implicit-function-declaration
+
+ARFLAGS = cr
+
+
+VPATH   = ../db_ ../dbx_ \
+          AllocOps DofOps SetLogicMatrixOps setLogicMatrixOps \
+          MatlabLayer MatrixUtils Numerics Sparse SortAndSearch \
+          Marshalling Time StdMemOut ElementUtils clientserver Signals\
+		  Io
+
+
+HEADERS = imos.h \
+          imdbx.h 
+
+ifeq ($(cluster),0)
+OBJECTS=  ConnectionParameters.$(OBJ_EXT)\
+          CCSSparseMatrixAsMatlabSparse.$(OBJ_EXT)\
+          DataSetRefAddToGarbageCollector.$(OBJ_EXT)\
+          DataSetRefDeleteFromGarbageCollector.$(OBJ_EXT)\
+		  GetAnalysisTypeAsEnum.$(OBJ_EXT) \
+          ExistAndValidType.$(OBJ_EXT)\
+          mexFlush.$(OBJ_EXT)\
+		  CheckNumMatlabArguments.$(OBJ_EXT)
+endif
+
+OBJECTS += alloc.$(OBJ_EXT) \
+		  mxGetAssignedField.$(OBJ_EXT)\
+          MemoryManager.$(OBJ_EXT)\
+		  clientserver.$(OBJ_EXT)\
+		  cross.$(OBJ_EXT)\
+		  norm.$(OBJ_EXT)\
+		  ClientServerBoot.$(OBJ_EXT)\
+		  CsrSparseMatrix.$(OBJ_EXT)\
+          BinarySearch.$(OBJ_EXT) \
+          GetAnalysisTypeAsEnumFromString.$(OBJ_EXT) \
+		  GetDOFCount.$(OBJ_EXT) \
+          GetVectorbOrthogonalToVectora.$(OBJ_EXT) \
+          InitDofTree.$(OBJ_EXT) \
+          InsertionSort.$(OBJ_EXT) \
+          MarshallingUtils.$(OBJ_EXT)\
+          Merge.$(OBJ_EXT) \
+          nsscanf.$(OBJ_EXT) \
+          ParseSetListIntoSetLogicMatrix.$(OBJ_EXT) \
+          Partn.$(OBJ_EXT) \
+          effective_value.$(OBJ_EXT) \
+          Paterson.$(OBJ_EXT) \
+		  PrintfMacroExpand.$(OBJ_EXT)\
+          Quicksort.$(OBJ_EXT) \
+          QuicksortDoubleByInteger.$(OBJ_EXT) \
+          QuicksortIntegerByDouble.$(OBJ_EXT) \
+          QuicksortIntegerByInteger.$(OBJ_EXT) \
+          QuicksortTwoIntegersByInteger.$(OBJ_EXT) \
+          SetLogicMatrix.$(OBJ_EXT) \
+          SetUsetBitFromChar.$(OBJ_EXT) \
+          SparseMatrix.$(OBJ_EXT) \
+          SparseMatrixColumn.$(OBJ_EXT) \
+          SparseUtils.$(OBJ_EXT) \
+		  StdMemOutAdd.$(OBJ_EXT)\
+		  StdMemOutIsOpen.$(OBJ_EXT)\
+		  StdMemOutOpen.$(OBJ_EXT)\
+		  StdMemOutClose.$(OBJ_EXT)\
+          TokenstringIter.$(OBJ_EXT) \
+          UnsymmCrout.$(OBJ_EXT) \
+          ValidateDofSelections.$(OBJ_EXT)\
+		  WriteDataToDisk.$(OBJ_EXT)\
+          waitn.$(OBJ_EXT)\
+          waitms.$(OBJ_EXT)\
+		  Catch_Sigchld.$(OBJ_EXT)\
+		  Catch_Sigurg.$(OBJ_EXT)\
+		  Catch_Sigint.$(OBJ_EXT)\
+		  Catch_Sigio.$(OBJ_EXT)     \
+		  posix_signal.$(OBJ_EXT)
+	
+ifeq ($(cluster),1)
+OBJECTS+=   mxGetField.$(OBJ_EXT)\
+            mexGetArrayPtr.$(OBJ_EXT)\
+            Catch_Sigusr2.$(OBJ_EXT)\
+			EmptyErrorString.$(OBJ_EXT)            \
+			GetOwnershipBoundariesFromRange.$(OBJ_EXT)\
+			IsWorkspaceSynchronized.$(OBJ_EXT)     \
+			Mergesolvec.$(OBJ_EXT)\
+			Profiler.$(OBJ_EXT)                    \
+			Reducematrix.$(OBJ_EXT)         \
+			Reducevectorg.$(OBJ_EXT)         \
+			Reducematrixfromgtof.$(OBJ_EXT) \
+			Reducerightside.$(OBJ_EXT)\
+			SerialToVec.$(OBJ_EXT)                 \
+			SerialToVecNoBcast.$(OBJ_EXT)                 \
+			SetErrMsg.$(OBJ_EXT)                   \
+			SharedStack.$(OBJ_EXT)                 \
+			VectorPartition.$(OBJ_EXT)	               \
+			Wtime.$(OBJ_EXT)                       \
+			MPIDebug.$(OBJ_EXT)
+endif
+
+# additional Windows build objects:
+
+ifeq (win,$(findstring win,$(platform)))
+OBJECTS += strcasecmp.$(OBJ_EXT)
+endif
+
+
+ifeq (no,$(supported))
+ERR = unsupported combination of VER, PLATFORM, COMPILER
+all: print_build_info err
+else
+ifeq ($(cluster),0)
+all : print_build_info utils.$(LIB_EXT) 
+else
+all : print_build_info utils.$(LIB_EXT) 
+endif
+endif
+
+utils.$(LIB_EXT) : $(OBJECTS) 
+ifeq (win,$(findstring win,$(platform)))
+	echo $(OBJECTS) > utils.rsp
+	../rsp_formatter.pl utils.rsp
+	tlib /C utils @utils.rsp
+	rm utils.rsp
+else
+	$(AR) $(ARFLAGS) utils.$(LIB_EXT) $(OBJECTS)
+	ranlib utils.$(LIB_EXT)
+endif
+
+
+# Dynamic allocation:
+alloc.$(OBJ_EXT) : alloc.c alloc.h $(HEADERS)
+MemoryManager.$(OBJ_EXT) : MemoryManager.c MemoryManager.h $(HEADERS)
+
+# MatlabLayer:
+ExistAndValidType.$(OBJ_EXT)                    : ExistAndValidType.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+DataSetRefAddToGarbageCollector.$(OBJ_EXT)      : DataSetRefAddToGarbageCollector.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+DataSetRefDeleteFromGarbageCollector.$(OBJ_EXT) : DataSetRefDeleteFromGarbageCollector.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+mexFlush.$(OBJ_EXT)                             : mexFlush.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+CCSSparseMatrixAsMatlabSparse.$(OBJ_EXT)        : CCSSparseMatrixAsMatlabSparse.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+ConnectionParameters.$(OBJ_EXT) : ConnectionParameters.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+CheckNumMatlabArguments.$(OBJ_EXT) : CheckNumMatlabArguments.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+GetAnalysisTypeAsEnum.$(OBJ_EXT)                : GetAnalysisTypeAsEnum.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+
+
+
+
+# DofOps:
+GetDOFCount.$(OBJ_EXT) : GetDOFCount.c $(HEADERS)
+InitDofTree.$(OBJ_EXT) : InitDofTree.c $(HEADERS)
+SetUsetBitFromChar.$(OBJ_EXT)   : SetUsetBitFromChar.c $(HEADERS)
+ValidateDofSeletions.$(OBJ_EXT) : ValidateDofSelections.c $(HEADERS)
+
+# Element utilities
+Paterson.$(OBJ_EXT) : Paterson.c $(HEADERS)
+effective_value.$(OBJ_EXT) : effective_value.c $(HEADERS)
+
+# Matrix Utilities:
+#RowToColumnOrder.$(OBJ_EXT) : RowToColumnOrder.c $(HEADERS)
+Merge.$(OBJ_EXT) : Merge.c $(HEADERS)
+Partn.$(OBJ_EXT) : Partn.c $(HEADERS)
+
+# Sparse:
+SparseMatrix.$(OBJ_EXT)       : SparseMatrix.c       Sparse.h $(HEADERS)
+SparseMatrixColumn.$(OBJ_EXT) : SparseMatrixColumn.c Sparse.h $(HEADERS)
+SparseUtils.$(OBJ_EXT)        : SparseUtils.c        Sparse.h $(HEADERS)
+CsrSparseMatrix.$(OBJ_EXT)    : CsrSparseMatrix.c    CsrSparseMatrix.h $(HEADERS)
+
+# SetLogicMatrixOps:
+ParseSetListIntoSetLogicMatrix.$(OBJ_EXT) : ParseSetListIntoSetLogicMatrix.c SetLogicMatrix.h $(HEADERS)
+SetLogicMatrix.$(OBJ_EXT)  : SetLogicMatrix.c SetLogicMatrix.h $(HEADERS)
+TokenstringIter.$(OBJ_EXT) : TokenstringIter.c SetLogicMatrix.h $(HEADERS)
+
+# string handling:
+nsscanf.$(OBJ_EXT) : nsscanf.c $(HEADERS)
+strcasecmp.$(OBJ_EXT) : strcasecmp.c $(HEADERS)
+
+#ReallocateArray.$(OBJ_EXT) : ReallocateArray.c $(HEADERS)
+
+# Numerics:
+GetVectorbOrthogonalToVectora.$(OBJ_EXT) : GetVectorbOrthogonalToVectora.c $(HEADERS)
+UnsymmCrout.$(OBJ_EXT)     : UnsymmCrout.c   UnsymmCrout.h $(HEADERS)
+norm.$(OBJ_EXT)     : norm.c   $(HEADERS)
+
+# SortAndSearch:
+# (note: on linux, override implicit rules to include conformance to the c99 standard
+# to allow log2() function usage in Quicksort routines)
+BinarySearch.$(OBJ_EXT)              : BinarySearch.c              $(HEADERS)
+InsertionSort.$(OBJ_EXT)             : InsertionSort.c             $(HEADERS)
+
+
+ifeq ($(cluster),0)
+Quicksort.$(OBJ_EXT)                 : Quicksort.c                 $(HEADERS)
+QuicksortDoubleByInteger.$(OBJ_EXT)  : QuicksortDoubleByInteger.c  $(HEADERS)
+QuicksortIntegerByDouble.$(OBJ_EXT)  : QuicksortIntegerByDouble.c  $(HEADERS)
+else
+
+Quicksort.$(OBJ_EXT)                 : Quicksort.c                 $(HEADERS)
+ifeq (lin,$(findstring lin,$(platform)))
+	$(CC) -c -std=c99 $(CFLAGS) $< -o Quicksort.$(OBJ_EXT)
+endif
+QuicksortDoubleByInteger.$(OBJ_EXT)  : QuicksortDoubleByInteger.c  $(HEADERS)
+ifeq (lin,$(findstring lin,$(platform)))
+	$(CC) -c -std=c99 $(CFLAGS) $< -o QuicksortDoubleByInteger.$(OBJ_EXT)
+endif
+QuicksortIntegerByDouble.$(OBJ_EXT)  : QuicksortIntegerByDouble.c  $(HEADERS)
+ifeq (lin,$(findstring lin,$(platform))) 
+	$(CC) -c -std=c99 $(CFLAGS) $< -o QuicksortIntegerByDouble.$(OBJ_EXT)
+endif
+
+endif
+
+# Marshalling 
+MarshallingUtils.$(OBJ_EXT): MarshallingUtils.c 
+
+# Time
+waitn.$(OBJ_EXT): waitn.c 
+waitms.$(OBJ_EXT): waitms.c 
+
+# STDMEMOUT
+StdMemOutAdd.$(OBJ_EXT): StdMemOutAdd.c 
+StdMemOutIsOpen.$(OBJ_EXT): StdMemOutIsOpen.c 
+StdMemOutOpen.$(OBJ_EXT): StdMemOutOpen.c 
+StdMemOutClose.$(OBJ_EXT): StdMemOutClose.c 
+
+
+#ParseSetRecordIntoSetLogicMatrix.$(OBJ_EXT) : ParseSetRecordIntoSetLogicMatrix.c $(HEADERS)
+#setLogicMatrix.$(OBJ_EXT)  : setLogicMatrix.c $(HEADERS)
+#tokenstringIter.$(OBJ_EXT) : tokenstringIter.c  $(HEADERS)
+
+#Printf macro expansion: 
+PrintfMacroExpand.$(OBJ_EXT): PrintfMacroExpand.c 
+
+#IO
+WriteDataToDisk.$(OBJ_EXT): WriteDataToDisk.c $(HEADERS)
+
+#Client/Server compilation
+ifeq ($(cluster),0)
+ClientServerBoot.$(OBJ_EXT) : ClientServerBoot.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+
+GetAnalysisTypeAsEnumFromString.$(OBJ_EXT)                : GetAnalysisTypeAsEnumFromString.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+	
+else
+ClientServerBoot.$(OBJ_EXT) : ClientServerBoot.c $(HEADERS)
+endif
+mxGetAssignedField.$(OBJ_EXT) : mxGetAssignedField.c $(HEADERS)
+mexGetArrayPtr.$(OBJ_EXT) : mexGetArrayPtr.c $(HEADERS)
+GetAnalysisTypeAsEnumFromString.$(OBJ_EXT)                : GetAnalysisTypeAsEnumFromString.c $(HEADERS)
+
+ifeq ($(cluster),1) #server objects
+EmptyErrorString.$(OBJ_EXT): EmptyErrorString.c
+mxGetField.$(OBJ_EXT) : mxGetField.c $(HEADERS)
+GetOwnershipBoundariesFromRange.$(OBJ_EXT): GetOwnershipBoundariesFromRange.c
+IsWorkspaceSynchronized.$(OBJ_EXT): IsWorkspaceSynchronized.c
+MatPartition.$(OBJ_EXT): MatrixUtils/MatPartition.c
+Mergesolvec.$(OBJ_EXT): MatrixUtils/Mergesolvec.c
+Profiler.$(OBJ_EXT): Time/Profiler.c
+Reducematrixfromgtof.$(OBJ_EXT): MatrixUtils/Reducematrixfromgtof.c
+Reducematrix.$(OBJ_EXT): MatrixUtils/Reducematrix.c
+Reducevectorg.$(OBJ_EXT): MatrixUtils/Reducevectorg.c
+Reducerightside.$(OBJ_EXT): MatrixUtils/Reducerightside.c
+SerialToVec.$(OBJ_EXT): MatrixUtils/SerialToVec.c
+SerialToVecNoBcast.$(OBJ_EXT): MatrixUtils/SerialToVecNoBcast.c
+SetErrMsg.$(OBJ_EXT): SetErrMsg.c
+SharedStack.$(OBJ_EXT): SharedStack.c
+VectorPartition.$(OBJ_EXT): VectorPartition.c
+Wtime.$(OBJ_EXT): Time/Wtime.c
+endif
+
+#clientserver
+clientserver.$(OBJ_EXT): clientserver/clientserver.c clientserver/clientserver.h
+
+#Signals
+Catch_Sigchld.$(OBJ_EXt): Signals/Catch_Sigchld.c $(HEADERS)
+Catch_Sigusr2.$(OBJ_EXt): Signals/Catch_Sigusr2.c $(HEADERS)
+Catch_Sigurg.$(OBJ_EXt): Signals/Catch_Sigurg.c $(HEADERS)
+Catch_Sigint.$(OBJ_EXT): Signals/Catch_Sigint.c
+posix_signal.$(OBJ_EXT): Signals/posix_signal.c
+
+#Default compilation rules
+include ../Make_build_err_usage_targets.mk
+include ../Make_default_rules.mk
+
+
+.PHONY : clean
+ifeq (no,$(supported))
+   ERR = unsupported combination of VER, PLATFORM, COMPILER
+   clean: print_build_info err
+else
+clean: print_build_info
+	@echo cleaning up files with extensions .$(LIB_EXT), .$(OBJ_EXT) and .$(MEX_EXT) ...
+	-rm -f ./*.$(LIB_EXT) ./*.$(OBJ_EXT) ./*.$(MEX_EXT)
+endif
+
Index: /issm/trunk/etc/platforms/wilkes/76/Make_config.mk
===================================================================
--- /issm/trunk/etc/platforms/wilkes/76/Make_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/wilkes/76/Make_config.mk	(revision 1)
@@ -0,0 +1,237 @@
+
+#
+# Make_config.mk
+#
+
+
+ifeq ($(MAKELEVEL),0)
+
+   # run only if top-level make:
+   SHELL = /bin/sh
+
+   # command-line args, defaults:
+
+   ifdef VER
+      version = $(VER)
+   else
+      version = 5
+   endif
+
+   ifdef CLUSTER
+      cluster = $(CLUSTER)
+   else
+      cluster = 0
+   endif 
+
+   ifdef BATCH
+      batch = $(BATCH)
+   else
+      batch = 0
+   endif
+
+
+
+   ifdef PLATFORM
+      platform = $(PLATFORM)
+   else
+      platform = sun
+   endif
+
+   ifdef COMPILER
+      compiler = $(COMPILER)
+   endif 
+
+   ifdef COMPUTLIB
+      computlib = $(COMPUTLIB)
+   endif 
+
+   ifdef THREAD
+      thread = $(THREAD)
+   endif 
+
+   ifdef MEMORYMANAGER
+      memmgr = $(MEMORYMANAGER)
+   else
+      memmgr = 0
+   endif 
+
+   supported = no
+
+   # branch accordingly:
+
+   ifeq ($(version),5)
+      MROOT = /opt/cots/matlab/5.3.1
+      ifeq ($(platform),sun)
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+		 OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v5.sh
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),6)
+      MROOT = /opt/cots/matlab/6.5
+      MOPTS = -V5
+      ifeq ($(platform),sun)
+         supported = yes
+         supported = yes 
+         OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+		 ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+         MEX_EXT = mexsol
+         MOPTS  += -f ../mexopts_v651.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+   endif
+
+   ifeq ($(version),7)
+      ifeq ($(platform),sun)
+         supported = yes
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT = mexsol
+         MROOT = /opt/cots/matlab/7.0.4
+         MOPTS  += -f ../mexopts_v704.sh -V5
+         CFLAGS += -v
+		 CFLAGS += -D_SUN_
+      endif
+      ifeq (lin,$(findstring lin,$(platform)))
+         supported = yes 
+		 OBJ_EXT = o
+         LIB_EXT = a
+		 ifeq ($(cluster),1)
+         OBJ_EXT = so
+         LIB_EXT = sa
+		 endif
+         ifeq ($(batch),1)
+         OBJ_EXT = bo
+         LIB_EXT = ba
+		 endif
+		 MEX_EXT   = mexa64
+         #MROOT     = /usr/local/pkgs/matlab-7.4
+         MROOT     = /usr/local/pkgs/matlab-7.6
+         #MOPTS    += -f ../mexopts_v704.sh -V5
+         MOPTS    += -f ../mexopts_v76.sh -V5
+         ifeq ($(compiler),icc)
+		 CC        = icc
+		 CFLAGS  += -static #needed for any intel compilation.
+		 else
+		 CC        = gcc
+		 endif
+         CFLAGS   += -D_LINUX_   -D__GCC4BUILD__ -largeArrayDims
+		 PETSCROOT += /home/larour/Libs/petsc-2.3.2-p3
+		 PETSCARCH += linux-gnu-amd64
+      endif
+      ifeq (win,$(findstring win,$(platform)))
+         ifeq ($(compiler),borland)
+            supported = yes
+			OBJ_EXT = obj
+            LIB_EXT   = LIB
+			ifeq ($(cluster),1)
+			OBJ_EXT = sobj
+            LIB_EXT   = sLIB
+			endif
+            ifeq ($(batch),1)
+			OBJ_EXT = bobj
+			LIB_EXT = bLIB
+			endif
+            MEX_EXT   = mexw32
+            #MROOT     = C:/MATLAB704
+            MROOT     = C:/MATLAB/R2006b
+            MBIN      = $(MROOT)/bin/win32
+            MEX       = $(MBIN)/mex.bat
+            MOPTS     = -f $(MBIN)/mexopts/bcc55opts.bat -V5
+            CC        = C:/Program\ Files/Borland/Cbuilder6/Bin/bcc32
+            CFLAGS   += -D_WIN_
+         endif
+      endif
+   endif
+
+   # if not yet assigned, set remaining defaults:
+
+   ifndef MBIN
+      MBIN     = $(MROOT)/bin
+   endif
+
+   ifndef MEX
+      MEX      = $(MBIN)/mex
+   endif
+
+   ifeq ($(cluster),0)
+	   ifndef MINCLUDE
+		  MINCLUDE = $(MROOT)/extern/include
+	   endif
+   endif
+
+   ifeq ($(memmgr),1)
+	   CFLAGS  += -D_MEMMGR_
+   endif
+
+
+   # for verbose build:
+   #MOPTS  += -v
+
+   CFLAGS  += -I$(MINCLUDE) 
+
+   CFLAGS  += -DMATLAB 
+
+   # define flags for computational libraries.
+   ifeq (metis,$(findstring metis,$(computlib)))
+		METISDIR=/proj/tpfimos/larour/Libraries/linux/metis-4.0-matlab/
+		CFLAGS += -I$(METISDIR)/Lib
+		COMPUTLIBS += -L$(METISDIR) -lmetis
+	endif
+
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+	   CFLAGS   += -I$(PETSCROOT) -I$(PETSCROOT)/include/ -I$(PETSCROOT)/bmake/$(PETSCARCH) 
+	   CFLAGS   += -D_PETSC_ 
+       COMPUTLIBS+= -L$(PETSCROOT)/lib/$(PETSCARCH)/ -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts
+   endif
+    
+   ifeq (standard,$(findstring standard,$(computlib)))
+	   CFLAGS   += -D_STANDARD_
+	   #No need to define COMPUTLIBS: we are using our "home" made routines.
+   endif
+   
+   # activate thread compilation if necessary.
+   ifeq ($(thread),yes)
+	   CFLAGS   += -D_THREAD_
+   endif
+
+   # gcc build
+   #GCCOPTS  = gccopts.sh
+   #CC       = gcc
+
+   #define libraries that need to be linked with all the mex modules
+   
+   ifeq ($(cluster),0) #we are building mex module only serially, not on a cluster on in batch mode
+   LIBS    = ../Cielo.$(LIB_EXT)
+   endif
+endif
Index: /issm/trunk/etc/platforms/wilkes/76/Make_default_rules.mk
===================================================================
--- /issm/trunk/etc/platforms/wilkes/76/Make_default_rules.mk	(revision 1)
+++ /issm/trunk/etc/platforms/wilkes/76/Make_default_rules.mk	(revision 1)
@@ -0,0 +1,41 @@
+
+# pattern rules for windows:
+
+ifeq ($(OBJ_EXT),win)
+
+%.obj : %.c
+	$(CC) -c $(CFLAGS) -o $@  $< 
+
+%.sobj : %.c
+	$(CC) -c $(CFLAGS) -o $@  $< 
+
+%.bobj : %.c
+	$(CC) -c $(CFLAGS) -o $@  $< 
+endif
+
+# pattern rules for linux64:
+
+ifeq ($(PLATFORM),lin64)
+
+%.o : %.c
+	$(CC) -c -fPIC -largeArrayDims $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+
+%.so : %.c
+	$(CC) -c -fPIC -largeArrayDims $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+
+%.bo : %.c
+	$(CC) -c -fPIC -largeArrayDims $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+endif
+
+# pattern rules for linux:
+ifeq ($(PLATFORM),lin)
+%.o : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+
+%.so : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+	
+%.bo : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 
+endif
+
Index: /issm/trunk/etc/platforms/wilkes/76/Make_server_config.mk
===================================================================
--- /issm/trunk/etc/platforms/wilkes/76/Make_server_config.mk	(revision 1)
+++ /issm/trunk/etc/platforms/wilkes/76/Make_server_config.mk	(revision 1)
@@ -0,0 +1,92 @@
+#Server Makefile configuration.
+   
+ifeq ($(cluster),1)
+
+	#Add some strict compiling 
+	CFLAGS  += -Werror-implicit-function-declaration
+
+	#Undefine matlab if already defined. 
+	CFLAGS+= -UMATLAB
+
+	ifdef MPILAUNCH
+		mpilaunch = $(MPILAUNCH)
+	else
+		mpilaunch= mpi
+	endif
+
+	ifeq ($(mpilaunch),bsub)
+		CFLAGS   += -D_BSUB_
+	endif
+	ifeq ($(mpilaunch),mpi)
+		CFLAGS   += -D_MPI_
+	endif
+
+	#Server flags
+		CFLAGS += -fno-strict-aliasing -funroll-loops -g3 -D_SERVER_ -O3
+		#CFLAGS += -Wall
+
+	#Cluster flags: 
+	MPIROOT=/home/larour/Libs/mpich2-gnu
+	CC=$(MPIROOT)/bin/mpicc
+
+	CFLAGS +=  -D_CLUSTER_ -I$(MPIROOT)/include
+
+	COMPUTLIBS += -L$(MPIROOT) -lfmpich -lmpich  -lmpichcxx 	
+
+	#PETSC Definitions: 
+	ifeq (petsc,$(findstring petsc,$(computlib)))
+		#LAPACK and BLAS definitions needed for MPI use of Petsc.
+		FBLASLAPACKDIR=$(PETSCROOT)/externalpackages/fblaslapack/$(PETSCARCH)
+		COMPUTLIBS += -L$(FBLASLAPACKDIR) -lflapack -lfblas 
+	endif
+
+	#SLEPC Definitions
+	ifeq (slepc,$(findstring slepc,$(computlib)))
+		SLEPCDIR=/home/larour/Libs/slepc-2.3.2
+		
+		CFLAGS += -I$(SLEPCDIR)/include
+
+		#COMPUTLIBS += -L$(SLEPCDIR)/lib/$(PETSCARCH) -lslepc
+	endif
+
+	#SCALAPACK Definitions
+	ifeq (scalapack,$(findstring scalapack,$(computlib)))
+		SCALAPACKDIR=/home/larour/Libs/SCALAPACK/mpich2-gnu
+		#We need BLACS to work with Scalapack
+		BLACSDIR=/proj/tpfimos/larour/Libraries/linux/BLACS/LIB/mpich2-gnu
+		
+		COMPUTLIBS += -L$(SCALAPACKDIR) -lscalapack \
+					 -L$(BLACSDIR)  -lblacsF77init_MPI-LINUX-0 -lblacs_MPI-LINUX-0 -lblacsCinit_MPI-LINUX-0
+	endif
+
+	#PLAPACK Definitions.
+	ifeq (plapack,$(findstring plapack,$(computlib)))
+		PLAPACKDIR=$(PETSCROOT)/externalpackages/PLAPACKR32
+		#We need also Petsc Plapack prototypes found in  $PETSCROOT)/src/mat/impls/dense/mpi/plapack/PLA_prototypes.h
+
+		CFLAGS += -I$(PLAPACKDIR)/INCLUDE -I$(PETSCROOT)/src/mat/impls/dense/mpi/plapack/
+
+		COMPUTLIBS += -L$(PLAPACKDIR)/$(PETSCARCH) -lPLAPACK
+	endif
+
+	#Metis definitions
+	METISDIR=/home/larour/Libs/metis-4.0/
+	CFLAGS += -I$(METISDIR)/Lib
+	COMPUTLIBS += -L$(METISDIR) -lmetis
+
+	#Extra definitions
+	#COMPUTLIBS += -lnsl -lrt -L/usr/X11R6/lib -lX11 -lg2c -lpetsc
+	COMPUTLIBS += -lnsl -lrt -L/usr/X11R6/lib -lX11  -lpetsc
+
+	
+	#COMPUTLIBS += -L/usr/local/g95/lib/gcc-lib/i686-pc-linux-gnu/4.0.3/ -lf95
+	#Fortran defintions in case using different compiler (absoft)
+	#FORTRAN_DIR=/opt/absoft/
+	#FORTRAN_LIBS= -lutil -lpthread -lfio -lU77 -lV77 -lf90math -lf77math -lf95math 
+	   
+endif 
+
+ifeq ($(batch),1)
+#Add _BATCH_ flag to compilation
+CFLAGS+= -D_BATCH_
+endif
Index: /issm/trunk/etc/platforms/wilkes/76/Makefile_shared
===================================================================
--- /issm/trunk/etc/platforms/wilkes/76/Makefile_shared	(revision 1)
+++ /issm/trunk/etc/platforms/wilkes/76/Makefile_shared	(revision 1)
@@ -0,0 +1,311 @@
+
+# Makefile for utils.a library,
+
+
+# make configuration:
+include ../Make_config.mk
+include ../Make_server_config.mk
+
+export
+
+# other local definitions:
+#CFLAGS  += -Werror-implicit-function-declaration
+
+ARFLAGS = cr
+
+
+VPATH   = ../db_ ../dbx_ \
+          AllocOps DofOps SetLogicMatrixOps setLogicMatrixOps \
+          MatlabLayer MatrixUtils Numerics Sparse SortAndSearch \
+          Marshalling Time StdMemOut ElementUtils clientserver Signals\
+		  Io
+
+
+HEADERS = imos.h \
+          imdbx.h 
+
+ifeq ($(cluster),0)
+OBJECTS=  ConnectionParameters.$(OBJ_EXT)\
+          CCSSparseMatrixAsMatlabSparse.$(OBJ_EXT)\
+          DataSetRefAddToGarbageCollector.$(OBJ_EXT)\
+          DataSetRefDeleteFromGarbageCollector.$(OBJ_EXT)\
+		  GetAnalysisTypeAsEnum.$(OBJ_EXT) \
+          ExistAndValidType.$(OBJ_EXT)\
+          mexFlush.$(OBJ_EXT)\
+		  CheckNumMatlabArguments.$(OBJ_EXT)
+endif
+
+OBJECTS += alloc.$(OBJ_EXT) \
+		  mxGetAssignedField.$(OBJ_EXT)\
+          MemoryManager.$(OBJ_EXT)\
+		  clientserver.$(OBJ_EXT)\
+		  cross.$(OBJ_EXT)\
+		  norm.$(OBJ_EXT)\
+		  ClientServerBoot.$(OBJ_EXT)\
+		  CsrSparseMatrix.$(OBJ_EXT)\
+          BinarySearch.$(OBJ_EXT) \
+          GetAnalysisTypeAsEnumFromString.$(OBJ_EXT) \
+		  GetDOFCount.$(OBJ_EXT) \
+          GetVectorbOrthogonalToVectora.$(OBJ_EXT) \
+          InitDofTree.$(OBJ_EXT) \
+          InsertionSort.$(OBJ_EXT) \
+          MarshallingUtils.$(OBJ_EXT)\
+          Merge.$(OBJ_EXT) \
+          nsscanf.$(OBJ_EXT) \
+          ParseSetListIntoSetLogicMatrix.$(OBJ_EXT) \
+          Partn.$(OBJ_EXT) \
+          effective_value.$(OBJ_EXT) \
+          Paterson.$(OBJ_EXT) \
+		  PrintfMacroExpand.$(OBJ_EXT)\
+          Quicksort.$(OBJ_EXT) \
+          QuicksortDoubleByInteger.$(OBJ_EXT) \
+          QuicksortIntegerByDouble.$(OBJ_EXT) \
+          QuicksortIntegerByInteger.$(OBJ_EXT) \
+          QuicksortTwoIntegersByInteger.$(OBJ_EXT) \
+          SetLogicMatrix.$(OBJ_EXT) \
+          SetUsetBitFromChar.$(OBJ_EXT) \
+          SparseMatrix.$(OBJ_EXT) \
+          SparseMatrixColumn.$(OBJ_EXT) \
+          SparseUtils.$(OBJ_EXT) \
+		  StdMemOutAdd.$(OBJ_EXT)\
+		  StdMemOutIsOpen.$(OBJ_EXT)\
+		  StdMemOutOpen.$(OBJ_EXT)\
+		  StdMemOutClose.$(OBJ_EXT)\
+          TokenstringIter.$(OBJ_EXT) \
+          UnsymmCrout.$(OBJ_EXT) \
+          ValidateDofSelections.$(OBJ_EXT)\
+		  WriteDataToDisk.$(OBJ_EXT)\
+          waitn.$(OBJ_EXT)\
+          waitms.$(OBJ_EXT)\
+		  Catch_Sigchld.$(OBJ_EXT)\
+		  Catch_Sigurg.$(OBJ_EXT)\
+		  Catch_Sigint.$(OBJ_EXT)\
+		  Catch_Sigio.$(OBJ_EXT)     \
+		  posix_signal.$(OBJ_EXT)
+	
+ifeq ($(cluster),1)
+OBJECTS+=   mxGetField.$(OBJ_EXT)\
+            mexGetArrayPtr.$(OBJ_EXT)\
+            Catch_Sigusr2.$(OBJ_EXT)\
+			EmptyErrorString.$(OBJ_EXT)            \
+			GetOwnershipBoundariesFromRange.$(OBJ_EXT)\
+			IsWorkspaceSynchronized.$(OBJ_EXT)     \
+			Mergesolvec.$(OBJ_EXT)\
+			Profiler.$(OBJ_EXT)                    \
+			Reducematrix.$(OBJ_EXT)         \
+			Reducevectorg.$(OBJ_EXT)         \
+			Reducematrixfromgtof.$(OBJ_EXT) \
+			Reducerightside.$(OBJ_EXT)\
+			SerialToVec.$(OBJ_EXT)                 \
+			SerialToVecNoBcast.$(OBJ_EXT)                 \
+			SetErrMsg.$(OBJ_EXT)                   \
+			SharedStack.$(OBJ_EXT)                 \
+			VectorPartition.$(OBJ_EXT)	               \
+			Wtime.$(OBJ_EXT)                       \
+			MPIDebug.$(OBJ_EXT)
+endif
+
+# additional Windows build objects:
+
+ifeq (win,$(findstring win,$(platform)))
+OBJECTS += strcasecmp.$(OBJ_EXT)
+endif
+
+
+ifeq (no,$(supported))
+ERR = unsupported combination of VER, PLATFORM, COMPILER
+all: print_build_info err
+else
+ifeq ($(cluster),0)
+all : print_build_info utils.$(LIB_EXT) 
+else
+all : print_build_info utils.$(LIB_EXT) 
+endif
+endif
+
+utils.$(LIB_EXT) : $(OBJECTS) 
+ifeq (win,$(findstring win,$(platform)))
+	echo $(OBJECTS) > utils.rsp
+	../rsp_formatter.pl utils.rsp
+	tlib /C utils @utils.rsp
+	rm utils.rsp
+else
+	$(AR) $(ARFLAGS) utils.$(LIB_EXT) $(OBJECTS)
+	ranlib utils.$(LIB_EXT)
+endif
+
+
+# Dynamic allocation:
+alloc.$(OBJ_EXT) : alloc.c alloc.h $(HEADERS)
+MemoryManager.$(OBJ_EXT) : MemoryManager.c MemoryManager.h $(HEADERS)
+
+# MatlabLayer:
+ExistAndValidType.$(OBJ_EXT)                    : ExistAndValidType.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+DataSetRefAddToGarbageCollector.$(OBJ_EXT)      : DataSetRefAddToGarbageCollector.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+DataSetRefDeleteFromGarbageCollector.$(OBJ_EXT) : DataSetRefDeleteFromGarbageCollector.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+mexFlush.$(OBJ_EXT)                             : mexFlush.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+CCSSparseMatrixAsMatlabSparse.$(OBJ_EXT)        : CCSSparseMatrixAsMatlabSparse.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+ConnectionParameters.$(OBJ_EXT) : ConnectionParameters.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+CheckNumMatlabArguments.$(OBJ_EXT) : CheckNumMatlabArguments.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+GetAnalysisTypeAsEnum.$(OBJ_EXT)                : GetAnalysisTypeAsEnum.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+
+
+
+
+# DofOps:
+GetDOFCount.$(OBJ_EXT) : GetDOFCount.c $(HEADERS)
+InitDofTree.$(OBJ_EXT) : InitDofTree.c $(HEADERS)
+SetUsetBitFromChar.$(OBJ_EXT)   : SetUsetBitFromChar.c $(HEADERS)
+ValidateDofSeletions.$(OBJ_EXT) : ValidateDofSelections.c $(HEADERS)
+
+# Element utilities
+Paterson.$(OBJ_EXT) : Paterson.c $(HEADERS)
+effective_value.$(OBJ_EXT) : effective_value.c $(HEADERS)
+
+# Matrix Utilities:
+#RowToColumnOrder.$(OBJ_EXT) : RowToColumnOrder.c $(HEADERS)
+Merge.$(OBJ_EXT) : Merge.c $(HEADERS)
+Partn.$(OBJ_EXT) : Partn.c $(HEADERS)
+
+# Sparse:
+SparseMatrix.$(OBJ_EXT)       : SparseMatrix.c       Sparse.h $(HEADERS)
+SparseMatrixColumn.$(OBJ_EXT) : SparseMatrixColumn.c Sparse.h $(HEADERS)
+SparseUtils.$(OBJ_EXT)        : SparseUtils.c        Sparse.h $(HEADERS)
+CsrSparseMatrix.$(OBJ_EXT)    : CsrSparseMatrix.c    CsrSparseMatrix.h $(HEADERS)
+
+# SetLogicMatrixOps:
+ParseSetListIntoSetLogicMatrix.$(OBJ_EXT) : ParseSetListIntoSetLogicMatrix.c SetLogicMatrix.h $(HEADERS)
+SetLogicMatrix.$(OBJ_EXT)  : SetLogicMatrix.c SetLogicMatrix.h $(HEADERS)
+TokenstringIter.$(OBJ_EXT) : TokenstringIter.c SetLogicMatrix.h $(HEADERS)
+
+# string handling:
+nsscanf.$(OBJ_EXT) : nsscanf.c $(HEADERS)
+strcasecmp.$(OBJ_EXT) : strcasecmp.c $(HEADERS)
+
+#ReallocateArray.$(OBJ_EXT) : ReallocateArray.c $(HEADERS)
+
+# Numerics:
+GetVectorbOrthogonalToVectora.$(OBJ_EXT) : GetVectorbOrthogonalToVectora.c $(HEADERS)
+UnsymmCrout.$(OBJ_EXT)     : UnsymmCrout.c   UnsymmCrout.h $(HEADERS)
+norm.$(OBJ_EXT)     : norm.c   $(HEADERS)
+
+# SortAndSearch:
+# (note: on linux, override implicit rules to include conformance to the c99 standard
+# to allow log2() function usage in Quicksort routines)
+BinarySearch.$(OBJ_EXT)              : BinarySearch.c              $(HEADERS)
+InsertionSort.$(OBJ_EXT)             : InsertionSort.c             $(HEADERS)
+
+
+ifeq ($(cluster),0)
+Quicksort.$(OBJ_EXT)                 : Quicksort.c                 $(HEADERS)
+QuicksortDoubleByInteger.$(OBJ_EXT)  : QuicksortDoubleByInteger.c  $(HEADERS)
+QuicksortIntegerByDouble.$(OBJ_EXT)  : QuicksortIntegerByDouble.c  $(HEADERS)
+else
+
+Quicksort.$(OBJ_EXT)                 : Quicksort.c                 $(HEADERS)
+ifeq (lin,$(findstring lin,$(platform)))
+	$(CC) -c -std=c99 $(CFLAGS) $< -o Quicksort.$(OBJ_EXT)
+endif
+QuicksortDoubleByInteger.$(OBJ_EXT)  : QuicksortDoubleByInteger.c  $(HEADERS)
+ifeq (lin,$(findstring lin,$(platform)))
+	$(CC) -c -std=c99 $(CFLAGS) $< -o QuicksortDoubleByInteger.$(OBJ_EXT)
+endif
+QuicksortIntegerByDouble.$(OBJ_EXT)  : QuicksortIntegerByDouble.c  $(HEADERS)
+ifeq (lin,$(findstring lin,$(platform))) 
+	$(CC) -c -std=c99 $(CFLAGS) $< -o QuicksortIntegerByDouble.$(OBJ_EXT)
+endif
+
+endif
+
+# Marshalling 
+MarshallingUtils.$(OBJ_EXT): MarshallingUtils.c 
+
+# Time
+waitn.$(OBJ_EXT): waitn.c 
+waitms.$(OBJ_EXT): waitms.c 
+
+# STDMEMOUT
+StdMemOutAdd.$(OBJ_EXT): StdMemOutAdd.c 
+StdMemOutIsOpen.$(OBJ_EXT): StdMemOutIsOpen.c 
+StdMemOutOpen.$(OBJ_EXT): StdMemOutOpen.c 
+StdMemOutClose.$(OBJ_EXT): StdMemOutClose.c 
+
+
+#ParseSetRecordIntoSetLogicMatrix.$(OBJ_EXT) : ParseSetRecordIntoSetLogicMatrix.c $(HEADERS)
+#setLogicMatrix.$(OBJ_EXT)  : setLogicMatrix.c $(HEADERS)
+#tokenstringIter.$(OBJ_EXT) : tokenstringIter.c  $(HEADERS)
+
+#Printf macro expansion: 
+PrintfMacroExpand.$(OBJ_EXT): PrintfMacroExpand.c 
+
+#IO
+WriteDataToDisk.$(OBJ_EXT): WriteDataToDisk.c $(HEADERS)
+
+#Client/Server compilation
+ifeq ($(cluster),0)
+ClientServerBoot.$(OBJ_EXT) : ClientServerBoot.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+
+GetAnalysisTypeAsEnumFromString.$(OBJ_EXT)                : GetAnalysisTypeAsEnumFromString.c $(HEADERS)
+	$(MEX) -c $(MOPTS) $(CFLAGS) $<
+	
+else
+ClientServerBoot.$(OBJ_EXT) : ClientServerBoot.c $(HEADERS)
+endif
+mxGetAssignedField.$(OBJ_EXT) : mxGetAssignedField.c $(HEADERS)
+mexGetArrayPtr.$(OBJ_EXT) : mexGetArrayPtr.c $(HEADERS)
+GetAnalysisTypeAsEnumFromString.$(OBJ_EXT)                : GetAnalysisTypeAsEnumFromString.c $(HEADERS)
+
+ifeq ($(cluster),1) #server objects
+EmptyErrorString.$(OBJ_EXT): EmptyErrorString.c
+mxGetField.$(OBJ_EXT) : mxGetField.c $(HEADERS)
+GetOwnershipBoundariesFromRange.$(OBJ_EXT): GetOwnershipBoundariesFromRange.c
+IsWorkspaceSynchronized.$(OBJ_EXT): IsWorkspaceSynchronized.c
+MatPartition.$(OBJ_EXT): MatrixUtils/MatPartition.c
+Mergesolvec.$(OBJ_EXT): MatrixUtils/Mergesolvec.c
+Profiler.$(OBJ_EXT): Time/Profiler.c
+Reducematrixfromgtof.$(OBJ_EXT): MatrixUtils/Reducematrixfromgtof.c
+Reducematrix.$(OBJ_EXT): MatrixUtils/Reducematrix.c
+Reducevectorg.$(OBJ_EXT): MatrixUtils/Reducevectorg.c
+Reducerightside.$(OBJ_EXT): MatrixUtils/Reducerightside.c
+SerialToVec.$(OBJ_EXT): MatrixUtils/SerialToVec.c
+SerialToVecNoBcast.$(OBJ_EXT): MatrixUtils/SerialToVecNoBcast.c
+SetErrMsg.$(OBJ_EXT): SetErrMsg.c
+SharedStack.$(OBJ_EXT): SharedStack.c
+VectorPartition.$(OBJ_EXT): VectorPartition.c
+Wtime.$(OBJ_EXT): Time/Wtime.c
+endif
+
+#clientserver
+clientserver.$(OBJ_EXT): clientserver/clientserver.c clientserver/clientserver.h
+
+#Signals
+Catch_Sigchld.$(OBJ_EXt): Signals/Catch_Sigchld.c $(HEADERS)
+Catch_Sigusr2.$(OBJ_EXt): Signals/Catch_Sigusr2.c $(HEADERS)
+Catch_Sigurg.$(OBJ_EXt): Signals/Catch_Sigurg.c $(HEADERS)
+Catch_Sigint.$(OBJ_EXT): Signals/Catch_Sigint.c
+posix_signal.$(OBJ_EXT): Signals/posix_signal.c
+
+#Default compilation rules
+include ../Make_build_err_usage_targets.mk
+include ../Make_default_rules.mk
+
+
+.PHONY : clean
+ifeq (no,$(supported))
+   ERR = unsupported combination of VER, PLATFORM, COMPILER
+   clean: print_build_info err
+else
+clean: print_build_info
+	@echo cleaning up files with extensions .$(LIB_EXT), .$(OBJ_EXT) and .$(MEX_EXT) ...
+	-rm -f ./*.$(LIB_EXT) ./*.$(OBJ_EXT) ./*.$(MEX_EXT)
+endif
+
Index: /issm/trunk/examples/Bumps/Bump1_surface_bed/DomainOutline.exp
===================================================================
--- /issm/trunk/examples/Bumps/Bump1_surface_bed/DomainOutline.exp	(revision 1)
+++ /issm/trunk/examples/Bumps/Bump1_surface_bed/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+0 1000000
+1000000 1000000
+1000000 0
+0 0
Index: /issm/trunk/examples/Bumps/Bump1_surface_bed/Front.exp
===================================================================
--- /issm/trunk/examples/Bumps/Bump1_surface_bed/Front.exp	(revision 1)
+++ /issm/trunk/examples/Bumps/Bump1_surface_bed/Front.exp	(revision 1)
@@ -0,0 +1,6 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+1 1.
+# X pos Y pos
+0 0
Index: /issm/trunk/examples/Bumps/Bump1_surface_bed/Square.par
===================================================================
--- /issm/trunk/examples/Bumps/Bump1_surface_bed/Square.par	(revision 1)
+++ /issm/trunk/examples/Bumps/Bump1_surface_bed/Square.par	(revision 1)
@@ -0,0 +1,126 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10; %m/yr
+	md.penalty_offset=4;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=500;
+	hmax=500;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness-50; %*10^(-4)*min(0,md.y-900000);;
+
+	%Add bumps to the ice sheet :
+	pos=find(sqrt((md.x-500000).^2+(md.y-500000).^2)<100000); %for a cicular bump
+	md.bed(pos)=md.bed(pos)+150*cos(pi/200000*(sqrt((md.y(pos)-500000).^2+(md.x(pos)-500000).^2))); %for a circular bump
+
+	md.surface=md.bed+md.thickness; %the surface follows the bed so the bump is transmitted to the surface
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=100*ones(md.numberofgrids,2)*[0,0;0,1];
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/examples/Bumps/Bump1_surface_bed/runme.m
===================================================================
--- /issm/trunk/examples/Bumps/Bump1_surface_bed/runme.m	(revision 1)
+++ /issm/trunk/examples/Bumps/Bump1_surface_bed/runme.m	(revision 1)
@@ -0,0 +1,48 @@
+% This file can be run to see the response to a bump on the bed of an ice sheet. The bump is not 
+% transmitted to the surface of the ice. The results of the three models are saved in order to be 
+% compared. The geometry is square and the ice sheet is flat. The velocity of the icesheet is 
+% 100 m/yr in one particular direction on every border. Just run this file in Matlab, i
+% with a properly setup Ice code. 
+% Take care to have the same density and number of layers to compare the results easily.
+
+% Create macayeal model;
+
+mdm=model;
+mdm=mesh(mdm,'DomainOutline.exp',150000);
+mdm=geography(mdm,'','');
+mdm=parameterize(mdm,'Square.par');
+mdm=extrude(mdm,6,3);
+mdm=setelementstype(mdm,'macayeal','all');
+
+%Compute solution with Ice model
+mdm=solve(mdm,'diagnostic','ice');
+
+save modelmacayeal mdm
+
+% Create pattyn model;
+
+mdp=model;
+mdp=mesh(mdp,'DomainOutline.exp',150000);
+mdp=geography(mdp,'','');
+mdp=parameterize(mdp,'Square.par');
+mdp=extrude(mdp,6,3);
+mdp=setelementstype(mdp,'pattyn','all');
+
+%Compute solution with Ice model
+mdp=solve(mdp,'diagnostic','ice');
+
+save modelpattyn mdp
+
+% Create stokes model;
+
+mds=model;
+mds=mesh(mds,'DomainOutline.exp',150000);
+mds=geography(mds,'','');
+mds=parameterize(mds,'Square.par');
+mds=extrude(mds,6,3);
+mds=setelementstype(mds,'pattyn','all','stokes','all');
+
+%Compute solution with Ice model
+mds=solve(mds,'diagnostic','ice');
+
+save modelstokes mds
Index: /issm/trunk/examples/Bumps/Bump2_bed/DomainOutline.exp
===================================================================
--- /issm/trunk/examples/Bumps/Bump2_bed/DomainOutline.exp	(revision 1)
+++ /issm/trunk/examples/Bumps/Bump2_bed/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+0 1000000
+1000000 1000000
+1000000 0
+0 0
Index: /issm/trunk/examples/Bumps/Bump2_bed/Front.exp
===================================================================
--- /issm/trunk/examples/Bumps/Bump2_bed/Front.exp	(revision 1)
+++ /issm/trunk/examples/Bumps/Bump2_bed/Front.exp	(revision 1)
@@ -0,0 +1,6 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+1 1.
+# X pos Y pos
+0 0
Index: /issm/trunk/examples/Bumps/Bump2_bed/Square.par
===================================================================
--- /issm/trunk/examples/Bumps/Bump2_bed/Square.par	(revision 1)
+++ /issm/trunk/examples/Bumps/Bump2_bed/Square.par	(revision 1)
@@ -0,0 +1,129 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10; %m/yr
+	md.penalty_offset=4;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=500;
+	hmax=500;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness-50; %*10^(-4)*min(0,md.y-900000);;
+
+	md.surface=md.bed+md.thickness;
+
+	%Add bumps to the ice sheet :
+	pos=find(sqrt((md.x-500000).^2+(md.y-500000).^2)<100000); %for a cicular bump
+	md.bed(pos)=md.bed(pos)+150*cos(pi/200000*(sqrt((md.y(pos)-500000).^2+(md.x(pos)-500000).^2))); %for a circular bump
+
+	%Change the thickness to follow the new bed
+	md.thickness=md.surface-md.bed;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=10*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=100*ones(md.numberofgrids,2)*[0,0;0,1];
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/examples/Bumps/Bump2_bed/runme.m
===================================================================
--- /issm/trunk/examples/Bumps/Bump2_bed/runme.m	(revision 1)
+++ /issm/trunk/examples/Bumps/Bump2_bed/runme.m	(revision 1)
@@ -0,0 +1,48 @@
+% This file can be run to see the response to a bump on the bed of an ice sheet. The bump is not 
+% transmitted to the surface of the ice. The results of the three models are saved in order to be 
+% compared. The geometry is square and the ice sheet is flat. The velocity of the icesheet is 
+% 100 m/yr in one particular direction on every border. Just run this file in Matlab, i
+% with a properly setup Ice code. 
+% Take care to have the same density and number of layers to compare the results easily.
+
+% Create macayeal model;
+
+mdm=model;
+mdm=mesh(mdm,'DomainOutline.exp',150000);
+mdm=geography(mdm,'','');
+mdm=parameterize(mdm,'Square.par');
+mdm=extrude(mdm,6,3);
+mdm=setelementstype(mdm,'macayeal','all');
+
+%Compute solution with Ice model
+mdm=solve(mdm,'diagnostic','ice');
+
+save modelmacayeal mdm
+
+% Create pattyn model;
+
+mdp=model;
+mdp=mesh(mdp,'DomainOutline.exp',150000);
+mdp=geography(mdp,'','');
+mdp=parameterize(mdp,'Square.par');
+mdp=extrude(mdp,6,3);
+mdp=setelementstype(mdp,'pattyn','all');
+
+%Compute solution with Ice model
+mdp=solve(mdp,'diagnostic','ice');
+
+save modelpattyn mdp
+
+% Create stokes model;
+
+mds=model;
+mds=mesh(mds,'DomainOutline.exp',150000);
+mds=geography(mds,'','');
+mds=parameterize(mds,'Square.par');
+mds=extrude(mds,6,3);
+mds=setelementstype(mds,'pattyn','all','stokes','all');
+
+%Compute solution with Ice model
+mds=solve(mds,'diagnostic','ice');
+
+save modelstokes mds
Index: sm/trunk/examples/README.txt
===================================================================
--- /issm/trunk/examples/README.txt	(revision 28275)
+++ 	(revision )
@@ -1,10 +1,0 @@
-To run the following examples, see the accompanying tutorials that can be found within the
-documentation tab on the ISSM webpages: https://issm.jpl.nasa.gov/documentation/tutorials/
-
-The tutorials were created to be parallel to lectures given,
-but the tutorials are up to date on their version of ISSM. If more help is
-needed see the User manual also found under the documentation tab
-(https://issm.jpl.nasa.gov/documentation/).
-
-Make sure to download the required datasets
-see https://issm.jpl.nasa.gov/documentation/tutorials/datasets/)
Index: /issm/trunk/examples/SquareIceShelf/Front.exp
===================================================================
--- /issm/trunk/examples/SquareIceShelf/Front.exp	(revision 28275)
+++ /issm/trunk/examples/SquareIceShelf/Front.exp	(revision 1)
@@ -1,10 +1,10 @@
-## Name:icefront
+## Name:
 ## Icon:0
-# Points Count  Value
-5 1.
-# X pos Y pos
--1000 999999
--1000 1100000
-1100000 1100000
-1100000 999999
--1000 999999
+# Points Count	Value
+5	1.
+# X pos	Y pos
+-1000 990000
+1001000  990000
+1001000  1001000
+-1000  1001000
+-1000 990000
Index: /issm/trunk/examples/SquareIceShelf/README
===================================================================
--- /issm/trunk/examples/SquareIceShelf/README	(revision 1)
+++ /issm/trunk/examples/SquareIceShelf/README	(revision 1)
@@ -0,0 +1,6 @@
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'Shelf.exp','');
+md=parameterize(md,'Square.par');
+md.acceleration=1;
+md=solve(md,'diagnostic','ice');
Index: /issm/trunk/examples/SquareIceShelf/Shelf.exp
===================================================================
--- /issm/trunk/examples/SquareIceShelf/Shelf.exp	(revision 1)
+++ /issm/trunk/examples/SquareIceShelf/Shelf.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:
+## Icon:0
+# Points Count	Value
+5	1.
+# X pos	Y pos
+-1000 00000
+1001000  00000
+1001000  1001000
+-1000  1001000
+-1000 00000
Index: /issm/trunk/examples/SquareIceShelf/Square.par
===================================================================
--- /issm/trunk/examples/SquareIceShelf/Square.par	(revision 28275)
+++ /issm/trunk/examples/SquareIceShelf/Square.par	(revision 1)
@@ -1,30 +1,125 @@
-%Start defining model parameters here
 
-disp('      creating thickness');
-hmin=300;
-hmax=1000;
-ymin=min(md.mesh.y);
-ymax=max(md.mesh.y);
-md.geometry.thickness = hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin);
-md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
-md.geometry.surface   = md.geometry.base+md.geometry.thickness;
+%Ok, start defining model parameters here
 
-disp('      creating drag');
-md.friction.coefficient=200*ones(md.mesh.numberofvertices,1);
-md.friction.coefficient(find(md.mask.ocean_levelset<0.))=0.;
-md.friction.p=ones(md.mesh.numberofelements,1);
-md.friction.q=ones(md.mesh.numberofelements,1);
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
 
-disp('      initial velocity');
-md.initialization.vx=zeros(md.mesh.numberofvertices,1);
-md.initialization.vy=zeros(md.mesh.numberofvertices,1);
-md.initialization.vz=zeros(md.mesh.numberofvertices,1);
-md.initialization.vel=zeros(md.mesh.numberofvertices,1);
+%Solution parameters
+	%parallelization 
+	md.cluster='no';
+	md.cluster_name='cosmos';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
 
-disp('      creating flow law parameter');
-md.materials.rheology_B=paterson((273-20)*ones(md.mesh.numberofvertices,1));
-md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
-md.damage.D=zeros(md.mesh.numberofvertices,1);
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
 
-disp('      creating boundary conditions');
-md=SetIceShelfBC(md,'Front.exp');
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: sm/trunk/examples/SquareIceShelf/Square.py
===================================================================
--- /issm/trunk/examples/SquareIceShelf/Square.py	(revision 28275)
+++ 	(revision )
@@ -1,32 +1,0 @@
-import numpy as np
-from paterson import paterson
-from SetIceShelfBC import SetIceShelfBC
-#Start defining model parameters here
-
-print('      creating thickness')
-hmin = 300
-hmax = 1000
-ymin = np.nanmin(md.mesh.y)
-ymax = np.nanmax(md.mesh.y)
-md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin)
-md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
-md.geometry.surface = md.geometry.base + md.geometry.thickness
-
-print('      creating drag')
-md.friction.coefficient = np.where(md.mask.ocean_levelset < 0., 0, 200)
-md.friction.p = np.ones((md.mesh.numberofelements))
-md.friction.q = np.ones((md.mesh.numberofelements))
-
-print('      initial velocity')
-md.initialization.vx = np.zeros((md.mesh.numberofvertices))
-md.initialization.vy = np.zeros((md.mesh.numberofvertices))
-md.initialization.vz = np.zeros((md.mesh.numberofvertices))
-md.initialization.vel = np.zeros((md.mesh.numberofvertices))
-
-print('      creating flow law parameter')
-md.materials.rheology_B = paterson((273 - 20) * np.ones((md.mesh.numberofvertices)))
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
-md.damage.D = np.zeros((md.mesh.numberofvertices))
-
-print('      creating boundary conditions')
-md = SetIceShelfBC(md, 'Front.exp')
Index: sm/trunk/examples/SquareIceShelf/runme.m
===================================================================
--- /issm/trunk/examples/SquareIceShelf/runme.m	(revision 28275)
+++ 	(revision )
@@ -1,7 +1,0 @@
-md=model;
-md=triangle(md,'DomainOutline.exp',100000);
-md=setmask(md,'all','');
-md=parameterize(md,'Square.par');
-md=setflowequation(md,'SSA','all');
-md.cluster=generic('name',oshostname,'np',2);
-md=solve(md,'Stressbalance');
Index: sm/trunk/examples/SquareIceShelf/runme.py
===================================================================
--- /issm/trunk/examples/SquareIceShelf/runme.py	(revision 28275)
+++ 	(revision )
@@ -1,16 +1,0 @@
-from model import *
-from triangle import triangle
-from setmask import setmask
-from parameterize import parameterize
-from setflowequation import setflowequation
-from generic import generic
-from socket import gethostname
-from solve import solve
-
-md = model()
-md = triangle(md, 'DomainOutline.exp', 100000)
-md = setmask(md, 'all', '')
-md = parameterize(md, 'Square.py')
-md = setflowequation(md, 'SSA', 'all')
-md.cluster = generic('name', gethostname(), 'np', 2)
-md = solve(md, 'Stressbalance')
Index: /issm/trunk/externalpackages/Makefile
===================================================================
--- /issm/trunk/externalpackages/Makefile	(revision 1)
+++ /issm/trunk/externalpackages/Makefile	(revision 1)
@@ -0,0 +1,29 @@
+all:  
+	cd metis && ./install.sh
+	cd triangle && ./install.shclean:  
+	cd mpich2 && ./install.sh
+	cd petsc && ./install.sh
+	cd slepc && ./install.sh
+	cd dakota && ./install.sh
+	cd doxygen && ./install.sh
+	cd gdal && ./install.sh
+	cd m2html && ./install.sh
+	cd mtoc && ./install.sh
+	cd suitesparse && ./install.sh
+	cd qhull && ./install.sh
+	cd netcdf && ./install.sh
+
+clean:
+	rm -rf dakota/install dakota/src
+	rm -rf doxygen/install doxygen/src
+	rm -rf gdal/install gdal/src
+	rm -rf m2html/install  m2html/src
+	rm -rf metis/install metis/src
+	rm -rf mpich2/install mpich2/src
+	rm -rf mtoc/install mtoc/src
+	rm -rf petsc/install petsc/src
+	rm -rf slepc/install slepc/src
+	rm -rf suitesparse/install suitesparse/src
+	rm -rf triangle/install triangle/src
+	rm -rf qhull/install qhull/src
+	rm -rf netcdf/install netcdf/src
Index: /issm/trunk/externalpackages/README
===================================================================
--- /issm/trunk/externalpackages/README	(revision 1)
+++ /issm/trunk/externalpackages/README	(revision 1)
@@ -0,0 +1,13 @@
+To install all the ISSM libraries:
+
+
+1/ source the ISSM_DIR/Etc/environment.sh file. This will set up all the necessary 
+environment variables in your shell.
+
+2/ type make, or go into each library folder and type install.sh . 
+We advise to do the latter, should any problems arise during the libraries compilation, 
+users will be able to spot the problematic library more easily. Just remember to compile 
+the libraries in the same order as the Makefile.
+
+3/ There is no guarantee the compilation will work on all systems. A lot of tweaking of the 
+install.sh files will probably be involved. Especially, the configuration part of the install.
Index: sm/trunk/externalpackages/dakota/install-4.2-altix64-cosmos.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-altix64-cosmos.sh	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf install 
-mkdir src install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
-
-#Untar 
-tar -zxvf  Dakota_4_3.src.tar.gz
-
-#Move Dakota to src directory
-mv Dakota/* src
-rm -rf Dakota
-
-#Apply patches
-patch src/src/ParallelLibrary.C configs/4.2/ParallelLibrary.C.patch
-patch src/src/ParallelLibrary.H configs/4.2/ParallelLibrary.H.patch
-patch src/src/NIDRProblemDescDB.C configs/4.2/NIDRProblemDescDB.C.patch
-patch src/src/NonDSampling.C configs/4.2/NonDSampling.C.patch
-patch src/src/NonDLocalReliability.C configs/4.2/NonDLocalReliability.C.patch
-patch src/src/NonDUnilevelRBDO.C configs/4.2/NonDUnilevelRBDO.C.patch    #  source not even used?
-#patch -R src/packages/Pecos/src/LHSDriver.cpp configs/4.2/LHSDriver.cpp.patch
-
-#Configure dakota
-cd src
-./configure \ 
-	--prefix="$ISSM_DIR/externalpackages/dakota/install" \
-	--without-graphics  \
-	--with-pic \
-	--disable-mpi \
-	--with-blas=/opt/intel/mkl/9.1.023/lib/64/libmkl.so \
-	--with-lapack=/opt/intel/mkl/9.1.023/lib/64/libmkl_lapack.so 
-cd ..
-
-#Before compiling, if running on 64 bits, we need to active fPIC compilation. Some packages 
-#do not register -fPIC in Dakota, which is a problem. Edit the faulty Makefiles and add the -fPIC 
-#flag to the compilation.
-cat ./src/methods/NCSUOpt/Makefile | sed 's/FFLAGS = -g -O2/FFLAGS = -g -O2 -fPIC/g' >  temp
-mv temp ./src/methods/NCSUOpt/Makefile
-
-cat ./src/methods/acro/packages/pebbl/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/pebbl/src/Makefile
-
-cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-nappspack/Makefile
-
-cat ./src/methods/hopspack/src-cddlib/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-cddlib/Makefile 
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile 
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile 
-
-cat ./src/methods/hopspack/src-conveyor/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-conveyor/Makefile 
-
-cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-appspack/Makefile 
-
-cat ./src/methods/acro/packages/colin/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/colin/src/Makefile
-
-cat ./src/methods/acro/packages/coliny/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/coliny/src/Makefile
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CFLAGS = -O2/CFLAGS = -O2 -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
-
-cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/packages/ampl/Makefile 
-
-#Compile and install dakota
-cd src 
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
-
-#Weird behaviour of Dakota: libamplsolver.a and amplsolver.a are not the same thing!
-cd install/lib
-mv libamplsolver.a libamplsolver.a.bak
-ln -s ../../src/packages/ampl/amplsolver.a ./libamplsolver.a
Index: sm/trunk/externalpackages/dakota/install-4.2-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-discover.sh	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src
-rm -rf install
-mkdir src install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
-
-#Untar 
-tar -zxvf  Dakota_4_3.src.tar.gz
-
-#Move Dakota to src directory
-mv Dakota/* src
-rm -rf Dakota
-
-#Apply patches
-patch src/src/ParallelLibrary.C configs/4.2/ParallelLibrary.C.patch
-patch src/src/ParallelLibrary.H configs/4.2/ParallelLibrary.H.patch
-patch src/src/NIDRProblemDescDB.C configs/4.2/NIDRProblemDescDB.C.patch
-patch src/src/NonDSampling.C configs/4.2/NonDSampling.C.patch
-patch src/src/NonDLocalReliability.C configs/4.2/NonDLocalReliability.C.patch
-patch src/src/NonDUnilevelRBDO.C configs/4.2/NonDUnilevelRBDO.C.patch    #  source not even used?
-#patch -R src/packages/Pecos/src/LHSDriver.cpp configs/4.2/LHSDriver.cpp.patch
-
-#Configure dakota
-cd src
-./configure \
---prefix="$ISSM_DIR/externalpackages/dakota/install/" \
---without-graphics  \
---with-pic \
---disable-mpi \
---with-blas="-L/usr/local/intel/mkl/10.1.2.024/lib/64 -lmkl_lapack -lmkl -lguide -lpthread" \
---with-lapack="-L/usr/local/intel/mkl/10.1.2.024/lib/64 -lmkl_lapack -lmkl -lguide -lpthread"
-cd ..
-
-#Before compiling, if running on 64 bits, we need to active fPIC compilation. Some packages 
-#do not register -fPIC in Dakota, which is a problem. Edit the faulty Makefiles and add the -fPIC 
-#flag to the compilation.
-cat ./src/methods/NCSUOpt/Makefile | sed 's/FFLAGS = -g -O2/FFLAGS = -g -O2 -fPIC/g' >  temp
-mv temp ./src/methods/NCSUOpt/Makefile
-
-cat ./src/methods/acro/packages/pebbl/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/pebbl/src/Makefile
-
-cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-nappspack/Makefile
-
-cat ./src/methods/hopspack/src-cddlib/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-cddlib/Makefile
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile
-
-cat ./src/methods/hopspack/src-conveyor/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-conveyor/Makefile
-
-cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-appspack/Makefile
-
-cat ./src/methods/acro/packages/colin/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/colin/src/Makefile
-
-cat ./src/methods/acro/packages/coliny/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/coliny/src/Makefile
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CFLAGS = -O2/CFLAGS = -O2 -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile
-
-cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/packages/ampl/Makefile
-
-#Compile and install dakota
-cd src
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
-
-#Weird behaviour of Dakota: libamplsolver.a and amplsolver.a are not the same thing!
-cd install/lib
-mv libamplsolver.a libamplsolver.a.bak
-ln -s ../../src/packages/ampl/amplsolver.a ./libamplsolver.a
Index: sm/trunk/externalpackages/dakota/install-4.2-linux64-cloud.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-linux64-cloud.sh	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf install 
-mkdir src install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
-
-#Untar 
-tar -zxvf  Dakota_4_3.src.tar.gz
-
-#Move Dakota to src directory
-mv Dakota/* src
-rm -rf Dakota
-
-#Apply patches
-patch src/src/ParallelLibrary.C configs/4.2/ParallelLibrary.C.patch
-patch src/src/ParallelLibrary.H configs/4.2/ParallelLibrary.H.patch
-patch src/src/NIDRProblemDescDB.C configs/4.2/NIDRProblemDescDB.C.patch
-patch src/src/NonDSampling.C configs/4.2/NonDSampling.C.patch
-patch src/src/NonDLocalReliability.C configs/4.2/NonDLocalReliability.C.patch
-patch src/src/NonDUnilevelRBDO.C configs/4.2/NonDUnilevelRBDO.C.patch    #  source not even used?
-#patch -R src/packages/Pecos/src/LHSDriver.cpp configs/4.2/LHSDriver.cpp.patch
-
-#Configure dakota
-cd src
-./configure \
-	--prefix="$ISSM_DIR/externalpackages/dakota/install" \
-	--without-graphics  \
-	--with-pic \
-	--disable-mpi \
-	--with-blas=/usr/lib/libblas.so \
-	--with-lapack=/usr/lib/liblapack.so
-cd ..
-
-#Before compiling, if running on 64 bits, we need to active fPIC compilation. Some packages 
-#do not register -fPIC in Dakota, which is a problem. Edit the faulty Makefiles and add the -fPIC 
-#flag to the compilation.
-cat ./src/methods/NCSUOpt/Makefile | sed 's/FFLAGS = -g -O2/FFLAGS = -g -O2 -fPIC/g' >  temp
-mv temp ./src/methods/NCSUOpt/Makefile
-
-cat ./src/methods/acro/packages/pebbl/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/pebbl/src/Makefile
-
-cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-nappspack/Makefile
-
-cat ./src/methods/hopspack/src-cddlib/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-cddlib/Makefile 
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile 
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile 
-
-cat ./src/methods/hopspack/src-conveyor/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-conveyor/Makefile 
-
-cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-appspack/Makefile 
-
-cat ./src/methods/acro/packages/colin/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/colin/src/Makefile
-
-cat ./src/methods/acro/packages/coliny/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/coliny/src/Makefile
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CFLAGS = -O2/CFLAGS = -O2 -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
-
-cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/packages/ampl/Makefile 
-
-#Compile and install dakota
-cd src 
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
-
-#Weird behaviour of Dakota: libamplsolver.a and amplsolver.a are not the same thing!
-cd install/lib
-mv libamplsolver.a libamplsolver.a.bak
-ln -s ../../src/packages/ampl/amplsolver.a ./libamplsolver.a
Index: sm/trunk/externalpackages/dakota/install-4.2-linux64-murdo.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-linux64-murdo.sh	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf install 
-mkdir src install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
-
-#Untar 
-tar -zxvf  Dakota_4_3.src.tar.gz
-
-#Move Dakota to src directory
-mv Dakota/* src
-rm -rf Dakota
-
-#Apply patches
-patch src/src/ParallelLibrary.C configs/4.2/ParallelLibrary.C.patch
-patch src/src/ParallelLibrary.H configs/4.2/ParallelLibrary.H.patch
-patch src/src/NIDRProblemDescDB.C configs/4.2/NIDRProblemDescDB.C.patch
-patch src/src/NonDSampling.C configs/4.2/NonDSampling.C.patch
-patch src/src/NonDLocalReliability.C configs/4.2/NonDLocalReliability.C.patch
-patch src/src/NonDUnilevelRBDO.C configs/4.2/NonDUnilevelRBDO.C.patch    #  source not even used?
-#patch -R src/packages/Pecos/src/LHSDriver.cpp configs/4.2/LHSDriver.cpp.patch
-
-#Configure dakota
-cd src
-./configure \
-	--prefix="$ISSM_DIR/externalpackages/dakota/install" \
-	--without-graphics  \
-	--with-pic \
-	--disable-mpi \
-	--with-blas=/usr/lib64/libblas.so.3.1.1 \
-	--with-lapack=/usr/lib64/liblapack.so.3.1.1
-cd ..
-
-#Before compiling, if running on 64 bits, we need to active fPIC compilation. Some packages 
-#do not register -fPIC in Dakota, which is a problem. Edit the faulty Makefiles and add the -fPIC 
-#flag to the compilation.
-cat ./src/methods/NCSUOpt/Makefile | sed 's/FFLAGS = -g -O2/FFLAGS = -g -O2 -fPIC/g' >  temp
-mv temp ./src/methods/NCSUOpt/Makefile
-
-cat ./src/methods/acro/packages/pebbl/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/pebbl/src/Makefile
-
-cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-nappspack/Makefile
-
-cat ./src/methods/hopspack/src-cddlib/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-cddlib/Makefile 
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile 
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile 
-
-cat ./src/methods/hopspack/src-conveyor/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-conveyor/Makefile 
-
-cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-appspack/Makefile 
-
-cat ./src/methods/acro/packages/colin/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/colin/src/Makefile
-
-cat ./src/methods/acro/packages/coliny/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/coliny/src/Makefile
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CFLAGS = -O2/CFLAGS = -O2 -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
-
-cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/packages/ampl/Makefile 
-
-#Compile and install dakota
-cd src 
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
-
-#Weird behaviour of Dakota: libamplsolver.a and amplsolver.a are not the same thing!
-cd install/lib
-mv libamplsolver.a libamplsolver.a.bak
-ln -s ../../src/packages/ampl/amplsolver.a ./libamplsolver.a
Index: sm/trunk/externalpackages/dakota/install-4.2-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-macosx64.sh	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf install 
-mkdir src install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
-
-#Untar 
-tar -zxvf  Dakota_4_3.src.tar.gz
-
-#Move Dakota to src directory
-mv Dakota/* src
-rm -rf Dakota
-
-#Apply patches
-patch src/src/ParallelLibrary.C configs/4.2/ParallelLibrary.C.patch
-patch src/src/ParallelLibrary.H configs/4.2/ParallelLibrary.H.patch
-patch src/src/NIDRProblemDescDB.C configs/4.2/NIDRProblemDescDB.C.patch
-patch src/src/NonDSampling.C configs/4.2/NonDSampling.C.patch
-patch src/src/NonDLocalReliability.C configs/4.2/NonDLocalReliability.C.patch
-patch src/src/NonDUnilevelRBDO.C configs/4.2/NonDUnilevelRBDO.C.patch    #  source not even used?
-#patch -R src/packages/Pecos/src/LHSDriver.cpp configs/4.2/LHSDriver.cpp.patch
-
-#Configure dakota
-cd src
-./configure \
-   --prefix="$ISSM_DIR/externalpackages/dakota/install" \
-   --without-graphics  \
-   --with-pic \
-   --disable-mpi \
-   --with-blas="-L$ISSM_DIR/externalpackages/petsc/install/lib -lfblas " \
-   --with-lapack="-L$ISSM_DIR/externalpackages/petsc/install/lib -lflapack "
-cd ..
-
-#Before compiling, if running on 64 bits, we need to active fPIC compilation. Some packages 
-#do not register -fPIC in Dakota, which is a problem. Edit the faulty Makefiles and add the -fPIC 
-#flag to the compilation.
-cat ./src/methods/NCSUOpt/Makefile | sed 's/FFLAGS = -g -O2/FFLAGS = -g -O2 -fPIC/g' >  temp
-mv temp ./src/methods/NCSUOpt/Makefile
-
-cat ./src/methods/acro/packages/pebbl/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/pebbl/src/Makefile
-
-cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-nappspack/Makefile
-
-cat ./src/methods/hopspack/src-cddlib/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-cddlib/Makefile 
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile 
-
-cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-shared/Makefile 
-
-cat ./src/methods/hopspack/src-conveyor/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/methods/hopspack/src-conveyor/Makefile 
-
-cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
-mv temp ./src/methods/hopspack/src-appspack/Makefile 
-
-cat ./src/methods/acro/packages/colin/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/colin/src/Makefile
-
-cat ./src/methods/acro/packages/coliny/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp ./src/methods/acro/packages/coliny/src/Makefile
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CFLAGS = -O2/CFLAGS = -O2 -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
-
-cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CFLAGS = -O2 -fpermissive -fPIC/g' > temp
-mv temp  ./src/methods/acro/packages/tpl/3po/Makefile 
-
-cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2 -D_NONSTD_SOURCE/CFLAGS = -g -O2 -fPIC/g' > temp
-mv temp  ./src/packages/ampl/Makefile 
-
-#Compile and install dakota
-cd src 
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
-
-#Weird behaviour of Dakota: libamplsolver.a and amplsolver.a are not the same thing!
-cd install/lib
-mv libamplsolver.a libamplsolver.a.bak
-ln -s ../../src/packages/ampl/amplsolver.a ./libamplsolver.a
Index: sm/trunk/externalpackages/dakota/install-5.2-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.2-discover.sh	(revision 28275)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src
-rm -rf install
-mkdir src install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
-
-#Untar 
-tar -zxvf Dakota_5_2.src.tar.gz
-
-#Move Dakota to src directory
-mv Dakota/* src
-rm -rf Dakota
-
-#Apply patches
-patch src/src/ParallelLibrary.C configs/5.2/ParallelLibrary.C.patch
-patch src/src/ParallelLibrary.H configs/5.2/ParallelLibrary.H.patch
-#patch src/src/NIDRProblemDescDB.C configs/5.2/NIDRProblemDescDB.C.patch    #  causes segfault in 5.2
-patch src/src/NonDSampling.C configs/5.2/NonDSampling.C.patch
-patch src/src/NonDLocalReliability.C configs/5.2/NonDLocalReliability.C.patch
-patch src/src/NonDUnilevelRBDO.C configs/5.2/NonDUnilevelRBDO.C.patch    #  source not even used?
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.2/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd src
-./configure \
---prefix="$ISSM_DIR/externalpackages/dakota/install/" \
---without-graphics  \
---with-pic \
---disable-mpi \
---with-plugin \
---with-blas="-L/usr/local/intel/mkl/10.1.2.024/lib/64 -lmkl_lapack -lmkl -lguide -lpthread" \
---with-lapack="-L/usr/local/intel/mkl/10.1.2.024/lib/64 -lmkl_lapack -lmkl -lguide -lpthread"
-
-cd ..
-
-#Compile and install dakota
-cd src
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-5.2-linux64-caladan.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.2-linux64-caladan.sh	(revision 28275)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf install 
-mkdir src install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
-
-#Untar 
-tar -zxvf Dakota_5_2.src.tar.gz
-
-#Move Dakota to src directory
-mv Dakota/* src
-rm -rf Dakota
-
-#Apply patches
-patch src/src/ParallelLibrary.C configs/5.2/ParallelLibrary.C.patch
-patch src/src/ParallelLibrary.H configs/5.2/ParallelLibrary.H.patch
-patch src/src/NonDSampling.C configs/5.2/NonDSampling.C.patch
-patch src/src/NonDLocalReliability.C configs/5.2/NonDLocalReliability.C.patch
-patch src/src/NonDUnilevelRBDO.C configs/5.2/NonDUnilevelRBDO.C.patch    #  source not even used?
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.2/pecos_global_defs.hpp.patch
-patch src/packages/teuchos/src/Teuchos_ConfigDefs.hpp configs/5.2/Teuchos_ConfigDefs.hpp.patch
-
-#Configure dakota
-cd src
-./configure \
-	--prefix="$ISSM_DIR/externalpackages/dakota/install" \
-	--without-graphics  \
-	--with-pic \
-	--disable-mpi \
-	--with-blas="$ISSM_DIR/externalpackages/petsc/install/lib/libfblas.a" \
-	--with-lapack="$ISSM_DIR/externalpackages/petsc/install/lib/libflapack.a"
-
-#Compile and install dakota
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-5.2-linux64-larsen.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.2-linux64-larsen.sh	(revision 28275)
+++ 	(revision )
@@ -1,49 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf install 
-mkdir src install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
-
-#Untar 
-tar -zxvf Dakota_5_2.src.tar.gz
-
-#Move Dakota to src directory
-mv Dakota/* src
-rm -rf Dakota
-
-#Apply patches
-patch src/src/ParallelLibrary.C configs/5.2/ParallelLibrary.C.patch
-patch src/src/ParallelLibrary.H configs/5.2/ParallelLibrary.H.patch
-patch src/src/NonDSampling.C configs/5.2/NonDSampling.C.patch
-patch src/src/NonDLocalReliability.C configs/5.2/NonDLocalReliability.C.patch
-patch src/src/NonDUnilevelRBDO.C configs/5.2/NonDUnilevelRBDO.C.patch    #  source not even used?
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.2/pecos_global_defs.hpp.patch
-patch src/packages/teuchos/src/Teuchos_ConfigDefs.hpp configs/5.2/Teuchos_ConfigDefs.hpp.patch
-
-#Configure dakota
-cd src
-./configure \
-	--prefix="$ISSM_DIR/externalpackages/dakota/install" \
-	--without-graphics  \
-	--with-pic \
-	--disable-mpi \
-	--with-plugin \
-	--with-blas="$ISSM_DIR/externalpackages/petsc/install/lib/libfblas.a" \
-	--with-lapack="$ISSM_DIR/externalpackages/petsc/install/lib/libflapack.a"
-
-#Compile and install dakota
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-5.2-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.2-macosx64.sh	(revision 28275)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf install 
-mkdir src install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
-
-#Untar 
-tar -zxvf Dakota_5_2.src.tar.gz
-
-#Move Dakota to src directory
-mv Dakota/* src
-rm -rf Dakota
-
-#Apply patches
-patch src/src/ParallelLibrary.C configs/5.2/ParallelLibrary.C.patch
-patch src/src/ParallelLibrary.H configs/5.2/ParallelLibrary.H.patch
-#patch src/src/NIDRProblemDescDB.C configs/5.2/NIDRProblemDescDB.C.patch    #  causes segfault in 5.2
-patch src/src/NonDSampling.C configs/5.2/NonDSampling.C.patch
-patch src/src/NonDLocalReliability.C configs/5.2/NonDLocalReliability.C.patch
-patch src/src/NonDUnilevelRBDO.C configs/5.2/NonDUnilevelRBDO.C.patch    #  source not even used?
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.2/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd src
-./configure \
-	--prefix="$ISSM_DIR/externalpackages/dakota/install" \
-	--without-graphics  \
-	--with-pic \
-	--disable-mpi \
-	--with-plugin \
-	--with-blas="-L$ISSM_DIR/externalpackages/petsc/install/lib -lfblas " \
-	--with-lapack="-L$ISSM_DIR/externalpackages/petsc/install/lib -lflapack "
-cd ..
-
-#Compile and install dakota
-cd src 
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-5.3.1-linux64-caladan.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-linux64-caladan.sh	(revision 28275)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-5.3.1-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-5.3.1.src/* src
-rm -rf dakota-5.3.1.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/5.3.1/BuildDakotaCustom.cmake.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/5.3.1/DakotaDev.cmake.patch
-#patch $DAK_SRC/CMakeLists.txt configs/5.3.1/CMakeLists.txt.patch
-
-#Apply patches
-patch src/src/ParallelLibrary.cpp configs/5.3.1/ParallelLibrary.cpp.patch
-patch src/src/ParallelLibrary.hpp configs/5.3.1/ParallelLibrary.hpp.patch
-patch src/src/NonDSampling.cpp configs/5.3.1/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/5.3.1/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.3.1/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd $DAK_BUILD
-cmake -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC -DBLAS_LIBS=$ISSM_DIR/externalpackages/petsc/install/lib/libfblas.a -DLAPACK_LIBS=$ISSM_DIR/externalpackages/petsc/install/lib/libflapack.a
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-5.3.1-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-linux64.sh	(revision 28275)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-5.3.1-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-5.3.1.src/* src
-rm -rf dakota-5.3.1.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/5.3.1/BuildDakotaCustom.cmake.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/5.3.1/DakotaDev.cmake.patch
-#patch $DAK_SRC/CMakeLists.txt configs/5.3.1/CMakeLists.txt.patch
-
-#Apply patches
-patch src/src/ParallelLibrary.cpp configs/5.3.1/ParallelLibrary.cpp.patch
-patch src/src/ParallelLibrary.hpp configs/5.3.1/ParallelLibrary.hpp.patch
-patch src/src/NonDSampling.cpp configs/5.3.1/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/5.3.1/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.3.1/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd $DAK_BUILD
-cmake -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-5.3.1-lonestar.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-lonestar.sh	(revision 28275)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-5.3.1-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-5.3.1.src/* src
-rm -rf dakota-5.3.1.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/5.3.1/BuildDakotaCustom.cmake.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/5.3.1/DakotaDev.cmake.patch
-patch $DAK_SRC/CMakeLists.txt configs/5.3.1/CMakeLists.txt.lonestar.patch
-
-#Apply patches
-patch src/src/ParallelLibrary.cpp configs/5.3.1/ParallelLibrary.cpp.patch
-patch src/src/ParallelLibrary.hpp configs/5.3.1/ParallelLibrary.hpp.patch
-patch src/src/NonDSampling.cpp configs/5.3.1/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/5.3.1/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.3.1/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd $DAK_BUILD
-cmake -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-5.3.1-macosx64-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64-snowleopard.sh	(revision 28275)
+++ 	(revision )
@@ -1,62 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-5.3.1-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-5.3.1.src/* src
-rm -rf dakota-5.3.1.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/5.3.1/BuildDakotaCustom.cmake.mac.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/5.3.1/DakotaDev.cmake.patch
-
-#Apply patches
-patch src/src/ParallelLibrary.cpp configs/5.3.1/ParallelLibrary.cpp.patch
-patch src/src/ParallelLibrary.hpp configs/5.3.1/ParallelLibrary.hpp.patch
-patch src/src/NonDSampling.cpp configs/5.3.1/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/5.3.1/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.3.1/pecos_global_defs.hpp.patch
-
-export BOOST_ROOT=$ISSM_DIR/externalpackages/boost/install
-
-#Configure dakota
-# Set your local gcc compiler here
-cd $DAK_BUILD
-cmake -DBoost_NO_BOOST_CMAKE=TRUE \
-    -DBoost_NO_SYSTEM_PATHS=TRUE \
-    -DBOOST_ROOT:PATHNAME=$BOOST_ROOT \
-    -DBoost_LIBRARY_DIRS:FILEPATH=${BOOST_ROOT}/lib \
-	 -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_CC_COMPILER=/usr/bin/gcc \
-	 -DCMAKE_Fortran_COMPILER=/usr/local/gfortran/bin/x86_64-apple-darwin10-gfortran \
-    -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
-
-#-DCMAKE_CXX_COMPILER=/usr/local/gfortran/bin/x86_64-apple-darwin10-g++ -DCMAKE_Fortran_COMPILER=/usr/local/gfortran/bin/x86_64-apple-darwin10-gfortran
-
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-5.3.1-macosx64-yosemite.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64-yosemite.sh	(revision 28275)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-5.3.1-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-5.3.1.src/* src
-rm -rf dakota-5.3.1.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/5.3.1/BuildDakotaCustom.cmake.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/5.3.1/DakotaDev.cmake.patch
-patch $DAK_SRC/CMakeLists.txt configs/5.3.1/CMakeLists.txt.patch
-
-#Apply patches
-patch src/src/ParallelLibrary.cpp configs/5.3.1/ParallelLibrary.cpp.patch
-patch src/src/ParallelLibrary.hpp configs/5.3.1/ParallelLibrary.hpp.patch
-patch src/src/NonDSampling.cpp configs/5.3.1/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/5.3.1/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.3.1/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd $DAK_BUILD
-cmake -D CMAKE_C_COMPILER=/usr/local/gfortran/bin/gcc -D CMAKE_CXX_COMPILER=/usr/local/gfortran/bin/g++ -D CMAKE_Fortran_COMPILER=/usr/local/gfortran/bin/gfortran -D LDFLAGS="-std=gnu++0x" -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-5.3.1-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64.sh	(revision 28275)
+++ 	(revision )
@@ -1,62 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-5.3.1-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-5.3.1.src/* src
-rm -rf dakota-5.3.1.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/5.3.1/BuildDakotaCustom.cmake.mac.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/5.3.1/DakotaDev.cmake.patch
-patch $DAK_SRC/CMakeLists.txt configs/5.3.1/CMakeLists.txt.patch
-
-#Apply patches
-patch src/src/ParallelLibrary.cpp configs/5.3.1/ParallelLibrary.cpp.patch
-patch src/src/ParallelLibrary.hpp configs/5.3.1/ParallelLibrary.hpp.patch
-patch src/src/NonDSampling.cpp configs/5.3.1/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/5.3.1/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.3.1/pecos_global_defs.hpp.patch
-
-export BOOST_ROOT=$ISSM_DIR/externalpackages/boost/install
-
-#Configure dakota
-# Set your local gcc compiler here
-cd $DAK_BUILD
-cmake -DBoost_NO_BOOST_CMAKE=TRUE \
-    -DBoost_NO_SYSTEM_PATHS=TRUE \
-    -DBOOST_ROOT:PATHNAME=$BOOST_ROOT \
-    -DBoost_LIBRARY_DIRS:FILEPATH=${BOOST_ROOT}/lib \
-	 -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CC_COMPILER=gcc \
-    -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
-
-#-DCMAKE_CXX_COMPILER=/usr/local/gfortran/bin/x86_64-apple-darwin10-g++ -DCMAKE_Fortran_COMPILER=/usr/local/gfortran/bin/x86_64-apple-darwin10-gfortran
-
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-6.2-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-discover.sh	(revision 28275)
+++ 	(revision )
@@ -1,64 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-6.2-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-6.2.0.src/* src
-rm -rf dakota-6.2.0.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.discover.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
-patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.discover20.patch
-
-#Apply patches
-patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd $DAK_BUILD
-
-cmake -D CMAKE_C_COMPILER=mpicc \
-	-D CMAKE_CXX_COMPILER=mpicxx \
-	-D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
-	-DCMAKE_CXX_FLAGS="-lstdc++ -lirc -lsvml -limf" \
-	-DBUILD_SHARED_LIBS=ON \
-	-DBUILD_STATIC_LIBS=OFF \
-	-DBoost_NO_BOOST_CMAKE=TRUE \
-	-DHAVE_ACRO=OFF \
-	-DHAVE_JEGA=OFF \
-	-DHAVE_QUESO=ON \
-	-DDAKOTA_HAVE_GSL=ON \
-	-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
-	-C $DAK_SRC/cmake/DakotaDev.cmake \
-	$DAK_SRC
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-6.2-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-linux-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,94 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="6.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
-
-# Find libgfortran and libgcc so we do not have to hardcode them
-#
-# TODO:
-# - Move this to etc/environment.sh
-# - Test if -static-libgfortran flag will avoid all of this.
-# - Otherwise, refactor this to work with other gfortran installations.
-#
-echo "Finding libgfortran..."
-LIBGFORTRAN=$(find /usr -name libgfortran* 2>/dev/null | egrep -n libgfortran.a | sed "s/[0-9]*://g" | head -1)
-LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
-LIBGCC=$(find ${LIBGFORTRAN_ROOT} -name libgcc* 2>/dev/null | egrep -n libgcc.a | sed "s/[0-9]*://g" | head -1)
-
-## Environment
-#
-export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
-export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
-export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
-export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack -L/usr/lib/x86_64-linux-gnu ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-
-# Cleanup
-rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-
-# Download source
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
-
-# Unpack source
-tar -zxvf dakota-${VER}-public-src.tar.gz
-
-# Move source to 'src' directory
-mv dakota-${VER}.0.src/* ${DAK_SRC}
-rm -rf dakota-${VER}.0.src
-
-# Copy customized source and configuration files to 'src' directory
-cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
-cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
-cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
-cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
-cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
-
-# Copy customized source and configuration files specific to Linux to 'src' directory
-cp configs/${VER}/linux/cmake/BuildDakotaCustom.cmake ${DAK_SRC}/cmake
-cp configs/${VER}/linux/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
-
-# Disable requirement of Python 2 for TriBITS
-sed -i'' -e 's|SET(PythonInterp_FIND_VERSION|#SET(PythonInterp_FIND_VERSION|' ${DAK_SRC}/packages/teuchos/cmake/tribits/package_arch/TribitsFindPythonInterp.cmake
-
-# Configure
-cd ${DAK_BUILD}
-cmake \
-	-DBUILD_SHARED_LIBS=OFF \
-	-DBUILD_STATIC_LIBS=ON \
-	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
-	-DCMAKE_C_FLAGS="-fPIC -Wno-error=implicit-function-declaration" \
-	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
-	-DCMAKE_CXX_FLAGS="-fPIC" \
-	-DCMAKE_CXX_STANDARD="11" \
-	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
-	-DBoost_NO_BOOST_CMAKE=TRUE \
-	-DHAVE_ACRO=OFF \
-	-DHAVE_JEGA=OFF \
-	-DHAVE_QUESO=ON \
-	-DDAKOTA_HAVE_GSL=ON \
-	-C${DAK_SRC}/cmake/BuildDakotaCustom.cmake \
-	-C${DAK_SRC}/cmake/DakotaDev.cmake \
-	${DAK_SRC}
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-
-cd ${DAK_INSTALL}
-
-# Comment out definition of HAVE_MPI in Teuchos config header file in order to
-# avoid conflict with our definition
-sed -i -e "s/#define HAVE_MPI/\/* #define HAVE_MPI *\//g" include/Teuchos_config.h
Index: sm/trunk/externalpackages/dakota/install-6.2-linux.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-linux.sh	(revision 28275)
+++ 	(revision )
@@ -1,90 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="6.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
-
-# Find libgfortran so that we do not have to hardcode it.
-#
-# TODO:
-# - Move this to etc/environment.sh
-#
-echo "Finding libgfortran..."
-LIBGFORTRAN=$(find /usr -name libgfortran* 2>/dev/null | egrep -n libgfortran.a | sed "s/[0-9]*://g" | head -1)
-LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
-
-## Environment
-#
-export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
-export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
-export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
-export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-
-# Cleanup
-rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-
-# Download source
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
-
-# Unpack source
-tar -zxvf dakota-${VER}-public-src.tar.gz
-
-# Move source to 'src' directory
-mv dakota-${VER}.0.src/* ${DAK_SRC}
-rm -rf dakota-${VER}.0.src
-
-# Copy customized source and configuration files to 'src' directory
-cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
-cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
-cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
-cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
-cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
-
-# Copy customized source and configuration files specific to Linux to 'src' directory
-cp configs/${VER}/linux/cmake/BuildDakotaCustom.cmake ${DAK_SRC}/cmake
-cp configs/${VER}/linux/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
-
-# Disable requirement of Python 2 for TriBITS
-sed -i'' -e 's|SET(PythonInterp_FIND_VERSION|#SET(PythonInterp_FIND_VERSION|' ${DAK_SRC}/packages/teuchos/cmake/tribits/package_arch/TribitsFindPythonInterp.cmake
-
-# Configure
-cd ${DAK_BUILD}
-cmake \
-	-DBUILD_SHARED_LIBS=ON \
-	-DBUILD_STATIC_LIBS=OFF \
-	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
-	-DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" \
-	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
-	-DCMAKE_CXX_STANDARD="11" \
-	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
-	-DBoost_NO_BOOST_CMAKE=TRUE \
-	-DHAVE_ACRO=OFF \
-	-DHAVE_JEGA=OFF \
-	-DHAVE_QUESO=ON \
-	-DDAKOTA_HAVE_GSL=ON \
-	-C${DAK_SRC}/cmake/BuildDakotaCustom.cmake \
-	-C${DAK_SRC}/cmake/DakotaDev.cmake \
-	${DAK_SRC}
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-
-cd ${DAK_INSTALL}
-
-# Comment out definition of HAVE_MPI in Teuchos config header file in order to
-# avoid conflict with our definition
-sed -i -e "s/#define HAVE_MPI/\/* #define HAVE_MPI *\//g" include/Teuchos_config.h
Index: sm/trunk/externalpackages/dakota/install-6.2-lonestar.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-lonestar.sh	(revision 28275)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-6.2-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-6.2.0.src/* src
-rm -rf dakota-6.2.0.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-export MPIHOME=/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/
-
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
-patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.lonestar.patch
-
-#Apply patches
-patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
-patch src/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp configs/6.2/NKM_KrigingModel.patch
-patch src/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp configs/6.2/MainEffectsExcelOutput.patch
-patch src/src/DakotaInterface.cpp configs/6.2/DakotaInterface.patch
-
-#Configure dakota
-cd $DAK_BUILD
-
-cmake -D CMAKE_C_COMPILER=mpicc \
-	   -D CMAKE_CXX_COMPILER=mpicxx \
-	   -D CMAKE_Fortran_COMPILER=mpif77 \
-		-D MPIEXEC_EXECUTABLE=/opt/apps/tacc/bin/ibrun \
-		-DHAVE_ACRO=off \
-		-DHAVE_JEGA=off \
-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
-		-C $DAK_SRC/cmake/DakotaDev.cmake \
-		$DAK_SRC
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-6.2-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-mac-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,115 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="6.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
-
-# Find libgfortran and libgcc so we do not have to hardcode them
-#
-# TODO:
-# - Move this to etc/environment.sh
-# - Test if -static-libgfortran flag will avoid all of this.
-# - Otherwise, refactor this to work with other gfortran installations.
-#
-echo "Finding libgfortran..."
-LIBGFORTRAN=$(find /usr /opt -name libgfortran* 2>/dev/null | egrep -n libgfortran.a | egrep -v i386 | sed "s/[0-9]*://g" | head -1)
-LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
-LIBGCC=$(find ${LIBGFORTRAN_ROOT} -name libgcc* 2>/dev/null | egrep -n libgcc.a | egrep -v i386 | sed "s/[0-9]*://g" | head -1)
-
-## Environment
-#
-export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
-export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
-export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
-export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export LDFLAGS="-framework CoreFoundation"
-
-# Cleanup
-rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-
-# Download source
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
-
-# Unpack source
-tar -zxvf dakota-${VER}-public-src.tar.gz
-
-# Move source to 'src' directory
-mv dakota-${VER}.0.src/* ${DAK_SRC}
-rm -rf dakota-${VER}.0.src
-
-# Copy customized source and configuration files to 'src' directory
-cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
-cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
-cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
-cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
-cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
-
-# Copy customized source and configuration files specific to Mac to 'src' directory
-cp configs/${VER}/mac/cmake/BuildDakotaCustom.cmake ${DAK_SRC}/cmake
-cp configs/${VER}/mac/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
-cp configs/${VER}/mac/cmake/InstallDarwinDylibs.cmake ${DAK_SRC}/cmake
-
-# Uncomment to copy the following customized source files if using C99 or later 
-# standard. If uncommented, adding -Wno-error=implicit-function-declaration 
-# option to CFLAGS is not needed.
-# cp configs/${VER}/mac/static/packages/DDACE/include/xtndispatch.h ${DAK_SRC}/packages/DDACE/include
-# cp configs/${VER}/mac/static/packages/DDACE/src/Bose/Boselink.c ${DAK_SRC}/packages/DDACE/src/Bose
-# cp configs/${VER}/mac/static/packages/DDACE/src/Bose/construct.c ${DAK_SRC}/packages/DDACE/src/Bose
-# cp configs/${VER}/mac/static/packages/DDACE/src/Bose/galois.c ${DAK_SRC}/packages/DDACE/src/Bose
-# cp configs/${VER}/mac/static/packages/DDACE/src/Bose/gfields.c ${DAK_SRC}/packages/DDACE/src/Bose
-# cp configs/${VER}/mac/static/packages/DDACE/src/Bose/oa.c ${DAK_SRC}/packages/DDACE/src/Bose
-# cp configs/${VER}/mac/static/packages/nidr/nidr.c ${DAK_SRC}/packages/nidr
-# cp configs/${VER}/mac/static/packages/nidr/nidr-scanner.c ${DAK_SRC}/packages/nidr
-
-# Disable requirement of Python 2 for TriBITS
-sed -i'' -e 's|SET(PythonInterp_FIND_VERSION|#SET(PythonInterp_FIND_VERSION|' ${DAK_SRC}/packages/teuchos/cmake/tribits/package_arch/TribitsFindPythonInterp.cmake
-
-# Configure
-#
-# NOTE:
-# - The -w option has been added to CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, and 
-#	CMAKE_Fortran_FLAGS. This should be removed for more recent versions of 
-#	Dakota.
-#
-cd ${DAK_BUILD}
-cmake \
-	-DBUILD_SHARED_LIBS=OFF \
-	-DBUILD_STATIC_LIBS=ON \
-	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
-	-DCMAKE_C_FLAGS="-fPIC -Wno-error=implicit-function-declaration -w" \
-	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
-	-DCMAKE_CXX_FLAGS="-fPIC -fdelayed-template-parsing -w" \
-	-DCMAKE_CXX_STANDARD="11" \
-	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
-	-DCMAKE_Fortran_FLAGS="-fPIC -fallow-argument-mismatch -w" \
-	-DBoost_NO_BOOST_CMAKE=TRUE \
-	-DHAVE_ACRO=OFF \
-	-DHAVE_JEGA=OFF \
-	-DHAVE_QUESO=ON \
-	-DDAKOTA_HAVE_GSL=ON \
-	-C${DAK_SRC}/cmake/BuildDakotaCustom.cmake \
-	-C${DAK_SRC}/cmake/DakotaDev.cmake \
-	${DAK_SRC}
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-
-cd ${DAK_INSTALL}
-
-# Comment out definition of HAVE_MPI in Teuchos config header file in order to
-# avoid conflict with our definition
-sed -i -e "s/#define HAVE_MPI/\/* #define HAVE_MPI *\//g" include/Teuchos_config.h
Index: sm/trunk/externalpackages/dakota/install-6.2-mac.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-mac.sh	(revision 28275)
+++ 	(revision )
@@ -1,141 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="6.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
-
-# Find libgfortran so that we do not have to hardcode it.
-#
-# TODO:
-# - Move this to etc/environment.sh
-#
-echo "Finding libgfortran..."
-LIBGFORTRAN=$(find /usr /opt -name libgfortran* 2>/dev/null | egrep -n libgfortran.a | egrep -v i386 | sed "s/[0-9]*://g" | head -1)
-LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
-
-## Environment
-#
-export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
-export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
-export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
-export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export LDFLAGS="-framework CoreFoundation"
-
-# Cleanup
-rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-
-# Download source
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
-
-# Unpack source
-tar -zxvf dakota-${VER}-public-src.tar.gz
-
-# Move source to 'src' directory
-mv dakota-${VER}.0.src/* ${DAK_SRC}
-rm -rf dakota-${VER}.0.src
-
-# Copy customized source and configuration files to 'src' directory
-cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
-cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
-cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
-cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
-cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
-
-# Copy customized source and configuration files specific to Mac to 'src' directory
-cp configs/${VER}/mac/cmake/BuildDakotaCustom.cmake ${DAK_SRC}/cmake
-cp configs/${VER}/mac/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
-cp configs/${VER}/mac/cmake/InstallDarwinDylibs.cmake ${DAK_SRC}/cmake
-
-# Disable requirement of Python 2 for TriBITS
-sed -i'' -e 's|SET(PythonInterp_FIND_VERSION|#SET(PythonInterp_FIND_VERSION|' ${DAK_SRC}/packages/teuchos/cmake/tribits/package_arch/TribitsFindPythonInterp.cmake
-
-echo "Debug:"
-echo "GSL_HOME : ${GSL_HOME}"
-echo "CPATH : ${CPATH}"
-
-# Configure
-#
-# NOTE:
-# - The -w option has been added to CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, and 
-#	CMAKE_Fortran_FLAGS. This should be removed for more recent versions of 
-#	Dakota.
-#
-cd ${DAK_BUILD}
-cmake \
-	-DBUILD_SHARED_LIBS=ON \
-	-DBUILD_STATIC_LIBS=OFF \
-	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
-	-DCMAKE_C_FLAGS="-w" \
-	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
-	-DCMAKE_CXX_FLAGS="-fdelayed-template-parsing -w" \
-	-DCMAKE_CXX_STANDARD="11" \
-	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
-	-DBoost_NO_BOOST_CMAKE=TRUE \
-	-DHAVE_ACRO=OFF \
-	-DHAVE_JEGA=OFF \
-	-DHAVE_QUESO=ON \
-	-DDAKOTA_HAVE_GSL=ON \
-	-C${DAK_SRC}/cmake/BuildDakotaCustom.cmake \
-	-C${DAK_SRC}/cmake/DakotaDev.cmake \
-	${DAK_SRC}
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-
-cd ${DAK_INSTALL}
-
-# Comment out definition of HAVE_MPI in Teuchos config header file in order to
-# avoid conflict with our definition
-sed -i -e "s/#define HAVE_MPI/\/* #define HAVE_MPI *\//g" include/Teuchos_config.h
-
-# Set install_name for all shared libraries
-cd ${DAK_INSTALL}/lib
-for name in *.dylib; do
-	install_name_tool -id ${DAK_INSTALL}/lib/${name} ${name}
-done
-
-## Patch install names for certain libraries
-#
-# TODO: Figure out how to reconfigure source to apply these install names at 
-# 		compile time
-#
-install_name_tool -change libdakota_src_fortran.dylib ${DAK_INSTALL}/lib/libdakota_src_fortran.dylib libdakota_src.dylib
-install_name_tool -change liblhs_mod.dylib ${DAK_INSTALL}/lib/liblhs_mod.dylib liblhs.dylib
-install_name_tool -change liblhs_mods.dylib ${DAK_INSTALL}/lib/liblhs_mods.dylib liblhs.dylib
-install_name_tool -change liblhs_mod.dylib ${DAK_INSTALL}/lib/liblhs_mod.dylib liblhs_mods.dylib
-install_name_tool -change libteuchos.dylib ${DAK_INSTALL}/lib/libteuchos.dylib liboptpp.dylib
-install_name_tool -change libdfftpack.dylib ${DAK_INSTALL}/lib/libdfftpack.dylib libpecos.dylib
-install_name_tool -change liblhs.dylib ${DAK_INSTALL}/lib/liblhs.dylib libpecos.dylib
-install_name_tool -change liblhs_mod.dylib ${DAK_INSTALL}/lib/liblhs_mod.dylib libpecos.dylib
-install_name_tool -change liblhs_mods.dylib ${DAK_INSTALL}/lib/liblhs_mods.dylib libpecos.dylib
-install_name_tool -change libpecos_src.dylib ${DAK_INSTALL}/lib/libpecos_src.dylib libpecos.dylib
-install_name_tool -change libteuchos.dylib ${DAK_INSTALL}/lib/libteuchos.dylib libpecos.dylib
-install_name_tool -change libdfftpack.dylib ${DAK_INSTALL}/lib/libdfftpack.dylib libpecos_src.dylib
-install_name_tool -change liblhs.dylib ${DAK_INSTALL}/lib/liblhs.dylib libpecos_src.dylib
-install_name_tool -change liblhs_mod.dylib ${DAK_INSTALL}/lib/liblhs_mod.dylib libpecos_src.dylib
-install_name_tool -change liblhs_mods.dylib ${DAK_INSTALL}/lib/liblhs_mods.dylib libpecos_src.dylib
-install_name_tool -change libteuchos.dylib ${DAK_INSTALL}/lib/libteuchos.dylib libpecos_src.dylib
-install_name_tool -change libsurfpack_fortran.dylib ${DAK_INSTALL}/lib/libsurfpack_fortran.dylib libsurfpack.dylib
-
-## Add LIBGFORTRAN_ROOT to rpath for libraries that need it
-#
-# TODO: Figure out how to reconfigure source to add to rpath at compile time
-#
-install_name_tool -add_rpath ${LIBGFORTRAN_ROOT} libpecos.dylib
-install_name_tool -add_rpath ${LIBGFORTRAN_ROOT} libteuchos.dylib
-install_name_tool -add_rpath ${LIBGFORTRAN_ROOT} liboptpp.dylib
-
Index: sm/trunk/externalpackages/dakota/install-6.2-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-pleiades.sh	(revision 28275)
+++ 	(revision )
@@ -1,78 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="6.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
-
-## Environment
-#
-export BLAS_LIBS="-L/nasa/intel/Compiler/2018.3.222/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it; should upate to /nasa/intel/Compiler/2021.4.0/mkl/2021.4.0/lib/intel64
-export CXXFLAGS='-std=c++11'
-export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
-export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
-export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
-export LAPACK_LIBS="-L/nasa/intel/Compiler/2018.3.222/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it; should upate to /nasa/intel/Compiler/2021.4.0/mkl/2021.4.0/lib/intel64
-
-# Cleanup
-rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-
-# Download source
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
-
-# Unpack source
-tar -zxvf dakota-${VER}-public-src.tar.gz
-
-# Move source to 'src' directory
-mv dakota-${VER}.0.src/* ${DAK_SRC}
-rm -rf dakota-${VER}.0.src
-
-# Copy customized source and configuration files to 'src' directory
-cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
-cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
-cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
-cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
-cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
-
-# Copy customized source and configuration files specific to Linux to 'src' directory
-cp configs/${VER}/linux/cmake/BuildDakotaCustom.pleiades.cmake ${DAK_SRC}/cmake/BuildDakotaCustom.cmake
-cp configs/${VER}/linux/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
-
-# Configure
-cd ${DAK_BUILD}
-cmake \
-	-DBUILD_SHARED_LIBS=ON \
-	-DBUILD_STATIC_LIBS=OFF \
-	-DCMAKE_C_COMPILER=mpicc \
-	-DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" \
-	-DCMAKE_CXX_COMPILER=mpicxx \
-	-DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \
-	-DBoost_NO_BOOST_CMAKE=TRUE \
-	-DHAVE_ACRO=OFF \
-	-DHAVE_JEGA=OFF \
-	-DHAVE_QUESO=ON \
-	-DDAKOTA_HAVE_GSL=ON \
-	-C${DAK_SRC}/cmake/BuildDakotaCustom.cmake \
-	-C${DAK_SRC}/cmake/DakotaDev.cmake \
-	${DAK_SRC}
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-
-cd ${DAK_INSTALL}
-
-# Comment out definition of HAVE_MPI in Teuchos config header file in order to
-# avoid conflict with our definition
-sed -i -e "s/#define HAVE_MPI/\/* #define HAVE_MPI *\//g" include/Teuchos_config.h
Index: sm/trunk/externalpackages/dakota/install-6.2-pleiades_toss4.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-pleiades_toss4.sh	(revision 28275)
+++ 	(revision )
@@ -1,78 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="6.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
-
-## Environment
-#
-export BLAS_LIBS="-L/nasa/intel/Compiler/2018.3.222/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it; should upate to /nasa/intel/Compiler/2021.4.0/mkl/2021.4.0/lib/intel64
-export CXXFLAGS='-std=c++98'
-export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
-export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
-export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
-export LAPACK_LIBS="-L/nasa/intel/Compiler/2018.3.222/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it; should upate to /nasa/intel/Compiler/2021.4.0/mkl/2021.4.0/lib/intel64
-
-# Cleanup
-rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
-
-# Download source
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
-
-# Unpack source
-tar -zxvf dakota-${VER}-public-src.tar.gz
-
-# Move source to 'src' directory
-mv dakota-${VER}.0.src/* ${DAK_SRC}
-rm -rf dakota-${VER}.0.src
-
-# Copy customized source and configuration files to 'src' directory
-cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
-cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
-cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
-cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
-cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
-cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
-
-# Copy customized source and configuration files specific to Linux to 'src' directory
-cp configs/${VER}/linux/cmake/BuildDakotaCustom.pleiades.cmake ${DAK_SRC}/cmake/BuildDakotaCustom.cmake
-cp configs/${VER}/linux/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
-
-# Configure
-cd ${DAK_BUILD}
-cmake \
-	-DBUILD_SHARED_LIBS=ON \
-	-DBUILD_STATIC_LIBS=OFF \
-	-DCMAKE_C_COMPILER=mpicc \
-	-DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" \
-	-DCMAKE_CXX_COMPILER=mpicxx \
-	-DCMAKE_Fortran_COMPILER=gfortran \
-	-DBoost_NO_BOOST_CMAKE=TRUE \
-	-DHAVE_ACRO=OFF \
-	-DHAVE_JEGA=OFF \
-	-DHAVE_QUESO=ON \
-	-DDAKOTA_HAVE_GSL=ON \
-	-C${DAK_SRC}/cmake/BuildDakotaCustom.cmake \
-	-C${DAK_SRC}/cmake/DakotaDev.cmake \
-	${DAK_SRC}
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-
-cd ${DAK_INSTALL}
-
-# Comment out definition of HAVE_MPI in Teuchos config header file in order to
-# avoid conflict with our definition
-sed -i -e "s/#define HAVE_MPI/\/* #define HAVE_MPI *\//g" include/Teuchos_config.h
Index: sm/trunk/externalpackages/dakota/install-6.2-stallo.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-stallo.sh	(revision 28275)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-#$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-6.2-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-6.2.0.src/* src
-rm -rf dakota-6.2.0.src
-
-#Set up Dakota cmake variables and config
-#export PATH="/usr/bin":$PATH
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-export MPIHOME=/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/
-
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.stallo.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
-patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.stallo.patch
-
-#Apply patches
-patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
-patch src/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp configs/6.2/NKM_KrigingModel.patch
-patch src/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp configs/6.2/MainEffectsExcelOutput.patch
-patch src/src/DakotaInterface.cpp configs/6.2/DakotaInterface.patch
-
-#Configure dakota
-cd $DAK_BUILD
-
-cmake -D CMAKE_C_COMPILER=/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/bin64/mpicc \
-	   -D CMAKE_CXX_COMPILER=/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/bin64/mpicxx \
-	   -D CMAKE_Fortran_COMPILER=gfortran \
-		-DHAVE_ACRO=off \
-		-DHAVE_JEGA=off \
-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
-		-C $DAK_SRC/cmake/DakotaDev.cmake \
-		$DAK_SRC
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: /issm/trunk/externalpackages/dakota/install.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/dakota/install.sh	(revision 1)
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#Some cleanup
+rm -rf Dakota
+rm -rf src
+rm -rf install
+
+#Create src and install directories
+mkdir src install
+
+#version of doxygen
+version=`echo *.src.tar.gz | sed 's/\.src\.tar\.gz//g' | sed 's/Dakota_//g'`
+
+#Untar 
+tar -zxvf  Dakota_$version.src.tar.gz
+
+#Move Dakota to src directory
+mv Dakota/* src
+rm -rf Dakota
+
+#Configure dakota
+cd src
+./configure --prefix="$ISSM_DIR/packages/dakota/install" --without-graphics  --with-matlab=$MATLAB_DIR
+
+#Compile dakota
+make  -j $NUMCPUS
+
+#Install dakota
+make  install
Index: /issm/trunk/externalpackages/doxygen/install.sh
===================================================================
--- /issm/trunk/externalpackages/doxygen/install.sh	(revision 28275)
+++ /issm/trunk/externalpackages/doxygen/install.sh	(revision 1)
@@ -1,22 +1,32 @@
 #!/bin/bash
-set -eu
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of doxygen
+version=`echo *.src.tar.gz | sed 's/\.src\.tar\.gz//g' | sed 's/doxygen-//g'`
 
 #Some cleanup
-rm -rf install src
-mkdir install
+rm -rf src
+rm -rf install
+rm -rf doxygen-$version
 
-#Download latest version
-git clone https://github.com/doxygen/doxygen.git install
+#Create src and install directories
+mkdir src install
+
+#Untar 
+tar -zxvf  doxygen-$version.src.tar.gz
+
+#Move doxygen into src directory
+mv doxygen-$version/* src
+rm -rf doxygen-$version
 
 #Configure doxygen
-cd install 
-mkdir build
-cd build
-cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$ISSM_DIR/externalpackages/doxygen/install" ..
-if [ $# -eq 0 ]; then
-	make
-else
-	make -j $1
-fi
+cd src && ./configure --prefix "$ISSM_DIR/packages/doxygen/install"
 
-make install
+#Compile doxygen
+make  -j $NUMCPUS
+
+#Install doxygen
+make  install
+make install_docs
Index: /issm/trunk/externalpackages/gdal/GDALmake.opt.patch
===================================================================
--- /issm/trunk/externalpackages/gdal/GDALmake.opt.patch	(revision 1)
+++ /issm/trunk/externalpackages/gdal/GDALmake.opt.patch	(revision 1)
@@ -0,0 +1,5 @@
+225,226c225
+< #CURL_LIB	=	-L/usr/kerberos/lib64 -lcurl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -ldl -lidn -lssl -lcrypto -lz  
+< CURL_LIB	=	-L/usr/lib64 -lcurl /usr/lib64/libgssapi_krb5.so.2  /usr/lib64/libkrb5.so.3 /usr/lib64/libk5crypto.so.3 /usr/lib64/libssl3.so -lresolv -ldl -lidn   -lz  
+---
+> CURL_LIB	=	-L/usr/kerberos/lib64 -lcurl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -ldl -lidn -lssl -lcrypto -lz  
Index: sm/trunk/externalpackages/gdal/install-3-python-static.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-python-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## TODO
-#	- May want to supply path to Python instead of, effectively, using result of `which python`
-#
-
-## Constants
-#
-VER="3.5.3"
-
-## Environment
-#
-export CC=mpicc
-export CXXFLAGS="-std=c++11"
-export CXX=mpicxx
-export LIBS="-lsqlite3 -lhdf5_hl -lhdf5"
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf gdal-${VER}.tar.gz
-
-# Move source into 'src' directory
-mv gdal-${VER}/* src
-rm -rf gdal-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--enable-fast-install \
-	--disable-shared \
-	--without-ld-shared \
-	--enable-static \
-	--with-pic \
-	--with-python="python3" \
-	--with-curl="${CURL_ROOT}/bin/curl-config" \
-	--with-hdf5="${HDF5_ROOT}" \
-	--with-jpeg=internal \
-	--with-libz="${ZLIB_ROOT}" \
-	--with-netcdf="${NETCDF_ROOT}" \
-	--with-pcre=no \
-	--with-pg=no \
-	--with-png=internal \
-	--with-proj="${PROJ_ROOT}" \
-	--with-zstd=no
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/gdal/install-3-python.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-python.sh	(revision 28275)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## TODO
-#	- May want to supply path to Python instead of, effectively, using result of `which python`
-#
-
-## Constants
-#
-VER="3.5.3"
-
-## Environment
-#
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf gdal-${VER}.tar.gz
-
-# Move source into 'src' directory
-mv gdal-${VER}/* src
-rm -rf gdal-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--enable-fast-install \
-	--with-python="python3" \
-	--with-curl="${CURL_ROOT}/bin/curl-config" \
-	--with-hdf5="${HDF5_ROOT}" \
-	--with-libz="${ZLIB_ROOT}" \
-	--with-netcdf="${NETCDF_ROOT}" \
-	--with-proj="${PROJ_ROOT}"
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/gdal/install-3-static.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,62 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## TODO
-#	- May want to supply path to Python instead of, effectively, using result of `which python`
-#
-
-## Constants
-#
-VER="3.5.3"
-
-## Environment
-#
-export CC=mpicc
-export CXXFLAGS="-std=c++11"
-export CXX=mpicxx
-export LIBS="-lsqlite3 -lhdf5_hl -lhdf5"
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf gdal-${VER}.tar.gz
-
-# Move source into 'src' directory
-mv gdal-${VER}/* src
-rm -rf gdal-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--enable-fast-install \
-	--disable-shared \
-	--without-ld-shared \
-	--enable-static \
-	--with-pic \
-	--with-curl="${CURL_ROOT}/bin/curl-config" \
-	--with-hdf5="${HDF5_ROOT}" \
-	--with-jpeg=internal \
-	--with-libz="${ZLIB_ROOT}" \
-	--with-netcdf="${NETCDF_ROOT}" \
-	--with-pcre=no \
-	--with-pg=no \
-	--with-png=internal \
-	--with-proj="${PROJ_ROOT}" \
-	--with-zstd=no
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/gdal/install-3.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3.sh	(revision 28275)
+++ 	(revision )
@@ -1,43 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.5.3"
-
-## Environment
-#
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf gdal-${VER}.tar.gz
-
-# Move source into 'src' directory
-mv gdal-${VER}/* src
-rm -rf gdal-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--enable-fast-install \
-	--with-libz="${ZLIB_ROOT}" \
-	--with-netcdf="${NETCDF_ROOT}" \
-	--with-proj="${PROJ_ROOT}"
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: /issm/trunk/externalpackages/gdal/install.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/gdal/install.sh	(revision 1)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of gdal
+version=`echo *.tar.gz | sed 's/\.tar\.gz//g' | sed 's/gdal-//g'`
+
+#Some cleanup
+rm -rf src
+rm -rf install
+rm -rf gdal-$version
+
+#Create src and install directories
+mkdir src install
+
+#Untar 
+tar -zxvf  gdal-$version.tar.gz
+
+#Move gdal into src directory
+mv gdal-$version/* src
+rm -rf gdal-$version
+
+#Configure gdal
+cd src
+./configure --prefix="$ISSM_DIR/packages/gdal/install" --without-python --with-netcdf=no --with-jasper=no --without-ld-shared --with-unix-stdio-64=no
+
+#Patch GDALmake.opt
+patch -R GDALmake.opt ../GDALmake.opt.patch
+
+#Compile gdal
+make  -j $NUMCPUS
+
+#Install gdal
+make  install
Index: /issm/trunk/externalpackages/list
===================================================================
--- /issm/trunk/externalpackages/list	(revision 1)
+++ /issm/trunk/externalpackages/list	(revision 1)
@@ -0,0 +1,1 @@
+dakota, doxygen, gdal, m2html, metis, mpich2, mtoc, netcdf, petsc, qhull, slepc, sowing, suitesparse, triangle
Index: /issm/trunk/externalpackages/m2html/install.sh
===================================================================
--- /issm/trunk/externalpackages/m2html/install.sh	(revision 28275)
+++ /issm/trunk/externalpackages/m2html/install.sh	(revision 1)
@@ -1,21 +1,25 @@
 #!/bin/bash
-set -eu
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#m2html name
+name=`echo *.zip | sed 's/\.zip//g'`
 
 #Some cleanup
-rm -rf install m2html
+rm -rf install $name
+
+#Create src and install directories
 mkdir install
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/m2html.zip' 'm2html.zip'
+#uncompress
+unzip $name.zip
 
-#uncompress
-unzip m2html.zip
+#patch m2html (ignore CVS and SVN directories)
+cat $name/m2html.m  | sed -e "s/'.' '..'/'.' '..' 'CVS' '.svn'/g" > $name/m2html2.m
+mv $name/m2html2.m $name/m2html.m
 
 #move to install directory
-mv m2html/* install
-rm -rf m2html
+mv $name/* install
+rm -rf $name
 
-#patch m2html
-cd install
-patch m2html.m ../m2html.m.patch
-cd ..
Index: sm/trunk/externalpackages/m2html/m2html.m.patch
===================================================================
--- /issm/trunk/externalpackages/m2html/m2html.m.patch	(revision 28275)
+++ 	(revision )
@@ -1,114 +1,0 @@
-*** m2html.m	2011-08-12 10:57:45.000000000 -0700
---- install/m2html.m	2011-08-12 10:58:26.000000000 -0700
-***************
-*** 306,311 ****
---- 306,325 ----
-  	end
-  
-  	mdir = unique(mdirs);
-+ 
-+ 	%add root directories
-+ 	for i=1:length(mdir)
-+ 		path=strsplit(mdir{i},'/');
-+ 		string=path{1};
-+ 		mdir{end+1}=string;
-+ 		for j=2:length(path),
-+ 			string=[string '/' path{j}];
-+ 			mdir{end+1}=string;
-+ 		end
-+ 	end
-+ 
-+ 	mdir=unique(mdir);
-+ 
-  	if options.verbose,
-  		fprintf('Found %d unique Matlab directories.\n',length(mdir));
-  	end
-***************
-*** 423,429 ****
-  %- Set some template variables
-  tpl = set(tpl,'var','DATE',[datestr(now,8) ' ' datestr(now,1) ' ' ...
-  							datestr(now,13)]);
-! tpl = set(tpl,'var','MASTERPATH',       './');
-  tpl = set(tpl,'var','DIRS',    sprintf('%s ',mdir{:}));
-  
-  %- Print list of unique directories
---- 437,443 ----
-  %- Set some template variables
-  tpl = set(tpl,'var','DATE',[datestr(now,8) ' ' datestr(now,1) ' ' ...
-  							datestr(now,13)]);
-! tpl = set(tpl,'var','MASTERPATH',       '');
-  tpl = set(tpl,'var','DIRS',    sprintf('%s ',mdir{:}));
-  
-  %- Print list of unique directories
-***************
-*** 555,561 ****
-  	tpl = set(tpl,'var','subfold','');
-  	d = dir(mdir{i});
-  	d = {d([d.isdir]).name};
-! 	d = {d{~ismember(d,{'.' '..'})}};
-  	for j=1:length(d)
-  		if ismember(fullfile(mdir{i},d{j}),mdir)
-  			tpl = set(tpl,'var','SUBDIRECTORY',...
---- 569,575 ----
-  	tpl = set(tpl,'var','subfold','');
-  	d = dir(mdir{i});
-  	d = {d([d.isdir]).name};
-! 	d = {d{~ismember(d,{'.' '..' 'CVS' '.svn'})}};
-  	for j=1:length(d)
-  		if ismember(fullfile(mdir{i},d{j}),mdir)
-  			tpl = set(tpl,'var','SUBDIRECTORY',...
-***************
-*** 687,695 ****
-  % Path should look like:  ...;C:\WINNT\System32;...;C:\GraphViz\bin
-  % (Note that this should have been done automatically during GraphViz installation)
-  
-! 			eval(['!' dot_exec ' -Tcmap -Tpng ' mdotfile ...
-  				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.map']) ... 
-! 				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.png'])])
-  			% use '!' rather than 'system' for backward compability
-  		catch
-  			fprintf('failed.');
---- 701,709 ----
-  % Path should look like:  ...;C:\WINNT\System32;...;C:\GraphViz\bin
-  % (Note that this should have been done automatically during GraphViz installation)
-  
-! 			eval(['!' dot_exec ' -Tcmap -Tgif ' mdotfile ...
-  				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.map']) ... 
-! 				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.gif'])])
-  			% use '!' rather than 'system' for backward compability
-  		catch
-  			fprintf('failed.');
-***************
-*** 700,706 ****
-  		tpl = set(tpl,'var','INDEX',[options.indexFile options.extension]);
-  		tpl = set(tpl,'var','MASTERPATH', backtomaster(mdir{i}));
-  		tpl = set(tpl,'var','MDIR',       mdir{i});
-! 		tpl = set(tpl,'var','GRAPH_IMG',  [dotbase '.png']);
-  		fmap = openfile(fullfile(options.htmlDir,mdir{i},[dotbase '.map']),'r');
-  		tpl = set(tpl,'var','GRAPH_MAP',  fscanf(fmap,'%c'));
-  		fclose(fmap);
---- 714,720 ----
-  		tpl = set(tpl,'var','INDEX',[options.indexFile options.extension]);
-  		tpl = set(tpl,'var','MASTERPATH', backtomaster(mdir{i}));
-  		tpl = set(tpl,'var','MDIR',       mdir{i});
-! 		tpl = set(tpl,'var','GRAPH_IMG',  [dotbase '.gif']);
-  		fmap = openfile(fullfile(options.htmlDir,mdir{i},[dotbase '.map']),'r');
-  		tpl = set(tpl,'var','GRAPH_MAP',  fscanf(fmap,'%c'));
-  		fclose(fmap);
-***************
-*** 1032,1038 ****
-  			if recursive
-  				d = dir(mdirs{i});
-  				d = {d([d.isdir]).name};
-! 				d = {d{~ismember(d,{'.' '..'})}};
-  				for j=1:length(d)
-  					mfiles = getmfiles(cellstr(fullfile(mdirs{i},d{j})),...
-  									   mfiles,recursive);
---- 1046,1052 ----
-  			if recursive
-  				d = dir(mdirs{i});
-  				d = {d([d.isdir]).name};
-! 				d = {d{~ismember(d,{'.' '..' 'CVS' '.svn'})}};
-  				for j=1:length(d)
-  					mfiles = getmfiles(cellstr(fullfile(mdirs{i},d{j})),...
-  									   mfiles,recursive);
Index: /issm/trunk/externalpackages/merge/mergesort.c
===================================================================
--- /issm/trunk/externalpackages/merge/mergesort.c	(revision 1)
+++ /issm/trunk/externalpackages/merge/mergesort.c	(revision 1)
@@ -0,0 +1,196 @@
+/******************************************************************************
+* FILE: mergesort.c
+* DESCRIPTION:  
+*   The master task distributes an array to the workers in chunks, zero pads for equal load balancing
+*   The workers sort and return to the master, which does a final merge
+******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <mpi.h>
+
+
+
+#define N 100000
+#define MASTER 0		/* taskid of first task */
+
+void showVector(int *v, int n, int id);
+int * merge(int *A, int asize, int *B, int bsize);
+void swap(int *v, int i, int j);
+void m_sort(int *A, int min, int max);
+
+double startT, stopT;
+
+double startTime;
+
+/*function to print a vector*/
+void showVector(int *v, int n, int id)
+{
+	int i;
+	printf("%d: ",id);
+	for(i=0;i<n;i++)
+		printf("%d ",v[i]);
+	putchar('\n');
+}
+
+/*function to merge vectors*/
+int * merge(int *A, int asize, int *B, int bsize) {
+	int ai, bi, ci, i;
+	int *C;
+	int csize = asize+bsize;
+
+	ai = 0;
+	bi = 0;
+	ci = 0;
+
+	/* printf("asize=%d bsize=%d\n", asize, bsize); */
+
+	C = (int *)malloc(csize*sizeof(int));	/*the array can be statically allocated too*/
+	while ((ai < asize) && (bi < bsize)) {
+		if (A[ai] <= B[bi]) {
+			C[ci] = A[ai];
+			ci++; ai++;
+		} else {
+			C[ci] = B[bi];
+			ci++; bi++;
+		}
+	}
+
+	if (ai >= asize)						/*if A is shorter*/
+		for (i = ci; i < csize; i++, bi++)
+			C[i] = B[bi];
+	else if (bi >= bsize)					/*if B is shorter*/
+		for (i = ci; i < csize; i++, ai++)
+			C[i] = A[ai];
+
+	for (i = 0; i < asize; i++)				
+		A[i] = C[i];
+	for (i = 0; i < bsize; i++)
+		B[i] = C[asize+i];
+
+	/* showVector(C, csize, 0); */
+	return C;
+}
+
+void swap(int *v, int i, int j)
+{
+	int t;
+	t = v[i];
+	v[i] = v[j];
+	v[j] = t;
+}
+
+void m_sort(int *A, int min, int max)
+{
+	int *C;		/* dummy, just to fit the function */
+	int mid = (min+max)/2;
+	int lowerCount = mid - min + 1;
+	int upperCount = max - mid;
+
+	/* If the range consists of a single element, it's already sorted */
+	if (max == min) {
+		return;
+	} else {
+		/* Otherwise, sort the first half */
+		m_sort(A, min, mid);
+		/* Now sort the second half */
+		m_sort(A, mid+1, max);
+		/* Now merge the two halves */
+		C = merge(A + min, lowerCount, A + mid + 1, upperCount);
+	}
+}
+
+main(int argc, char **argv)
+{
+	int * data;
+	int * chunk;
+	int * other;
+	int m,n=N;
+	int id,p;
+	int s = 0;
+	int i;
+	int step;
+	MPI_Status status;
+
+	MPI_Init(&argc,&argv);
+	MPI_Comm_rank(MPI_COMM_WORLD,&id);
+	MPI_Comm_size(MPI_COMM_WORLD,&p);
+
+	startT = MPI_Wtime();
+	
+/**************************** master task ************************************/
+	if(id == MASTER)
+	{
+		int r;
+		srandom(MPI_Wtime());
+		s = n/p;
+		r = n%p;
+		data = (int *)malloc((n+s-r)*sizeof(int));
+		for(i=0;i<n;i++)
+			data[i] = random();
+		if(r!=0)
+		{
+			for(i=n;i<n+s-r;i++)
+				data[i]=0;
+			s=s+1;
+		}
+
+		MPI_Bcast(&s,1,MPI_INT,0,MPI_COMM_WORLD);
+		chunk = (int *)malloc(s*sizeof(int));
+		MPI_Scatter(data,s,MPI_INT,chunk,s,MPI_INT,0,MPI_COMM_WORLD);
+		m_sort(chunk, 0, s-1);
+		/* showVector(chunk, s, id); */
+	}
+
+/**************************** worker task ************************************/
+	else
+	{
+		MPI_Bcast(&s,1,MPI_INT,0,MPI_COMM_WORLD);
+		chunk = (int *)malloc(s*sizeof(int));
+		MPI_Scatter(data,s,MPI_INT,chunk,s,MPI_INT,0,MPI_COMM_WORLD);
+		m_sort(chunk, 0, s-1);
+		/* showVector(chunk, s, id);*/
+	}
+
+
+
+      /*data propagation in a tree fashion*/
+	step = 1;
+	while(step<p)
+	{
+		if(id%(2*step)==0)
+		{
+			if(id+step<p)
+			{
+				MPI_Recv(&m,1,MPI_INT,id+step,0,MPI_COMM_WORLD,&status);
+				other = (int *)malloc(m*sizeof(int));
+				MPI_Recv(other,m,MPI_INT,id+step,0,MPI_COMM_WORLD,&status);
+				chunk = merge(chunk,s,other,m);
+				s = s+m;
+			} 
+		}
+		else
+		{
+			int near = id-step;
+			MPI_Send(&s,1,MPI_INT,near,0,MPI_COMM_WORLD);
+			MPI_Send(chunk,s,MPI_INT,near,0,MPI_COMM_WORLD);
+			break;
+		}
+		step = step*2;
+	}
+
+	stopT = MPI_Wtime();
+	if(id==0)
+	{
+		FILE * fout;
+
+		printf("%d; %d processors; %f secs\n", s, p, (stopT-startT));
+
+		fout = fopen("result","w");
+		for(i=0;i<s;i++)
+			fprintf(fout,"%d\n",chunk[i]);
+		fclose(fout);
+	}
+	MPI_Finalize();
+}
Index: /issm/trunk/externalpackages/metis/Makefile.in.patch
===================================================================
--- /issm/trunk/externalpackages/metis/Makefile.in.patch	(revision 1)
+++ /issm/trunk/externalpackages/metis/Makefile.in.patch	(revision 1)
@@ -0,0 +1,4 @@
+6c6
+< OPTFLAGS = -O2 
+---
+> OPTFLAGS = -O2  -fPIC
Index: sm/trunk/externalpackages/metis/install-4.0-altix64.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-altix64.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/altix64/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-cosmos.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-cosmos.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/cosmos/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-discover.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-discover.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/discover/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-greenplanet.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-greenplanet.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/greenplanet/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-hoffman2.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-hoffman2.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/pleiades/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-linux64.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/linux64/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-macosx32.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-macosx32.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/macosx32/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-macosx64.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/macosx64/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-pleiades.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/pleiades/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-win10.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-win10.sh	(revision 28275)
+++ 	(revision )
@@ -1,25 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch -R Lib/Makefile ../configs/4.0/win7/Makefile.patch
-patch Makefile.in ../configs/4.0/win7/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-4.0-win32.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-win32.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install metis-4.0
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
-
-#Untar 
-tar -zxvf  metis-4.0.tar.gz
-
-#Move metis into install directory
-mv metis-4.0/* install
-rm -rf metis-4.0
-
-#Apply patches
-cd install 
-patch -p1 < ../metis-4.0.patch
-patch Makefile.in ../configs/4.0/win32/Makefile.in.patch
-
-#Compile
-make
Index: sm/trunk/externalpackages/metis/install-5-win-msys2-gcc.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-5-win-msys2-gcc.sh	(revision 28275)
+++ 	(revision )
@@ -1,68 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# TODO
-# - Move installation of GKlib to $PREFIX to Makefile instead of simply copying 
-#	it
-#
-
-## Constants
-#
-VER=5.1.0
-
-PREFIX="${ISSM_DIR}/externalpackages/metis/install"
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir ${PREFIX} src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/metis-${VER}.tar.gz" "metis-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf metis-$VER.tar.gz
-
-# Move source into 'src' directory
-mv metis-${VER}/* src
-rm -rf metis-${VER}
-
-# Copy customized source and configuration files to 'src' directory
-cp configs/5.1/win/msys2/Makefile src
-cp configs/5.1/win/msys2/gcc/GKlib/gk_arch.h src/GKlib
-cp configs/5.1/win/msys2/gcc/GKlib/gk_getopt.h src/GKlib
-
-# Configure
-cd src
-make config \
-	prefix=${PREFIX} \
-	shared=1 \
-	cc=/usr/bin/gcc \
-	cxx=/usr/bin/g++
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-
-# Install GKlib
-cp -R GKlib ${PREFIX}
-
-# Create link to shared version of library so that libtool can find it
-#
-# NOTE: MSYS2 needs to be run as administrator for this to work.
-#
-cd ${PREFIX}/lib
-ln -s ./msys-metis.dll ./libmetis.dll
-
-# Create link to lib directory (PETSc, by default, looks for libraries in 
-# lib64/ if it detects that 64-bit integers are being used)
-#
-# NOTE: MSYS2 needs to be run as administrator for this to work.
-#
-cd ${PREFIX}
-ln -s ./lib ./lib64
Index: sm/trunk/externalpackages/metis/install-5-win-msys2-mingw.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-5-win-msys2-mingw.sh	(revision 28275)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# TODO
-# - Move installation of GKlib to $PREFIX to Makefile instead of simply copying 
-#	it
-#
-
-## Constants
-#
-VER=5.1.0
-
-PREFIX="${ISSM_DIR}/externalpackages/metis/install"
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir ${PREFIX} src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/metis-${VER}.tar.gz" "metis-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf metis-$VER.tar.gz
-
-# Move source into 'src' directory
-mv metis-${VER}/* src
-rm -rf metis-${VER}
-
-# Copy customized source and configuration files to 'src' directory
-cp configs/5.1/win/msys2/Makefile src
-cp configs/5.1/win/msys2/GKlib/gk_arch.h src/GKlib
-cp configs/5.1/win/msys2/GKlib/gk_getopt.h src/GKlib
-
-# Configure
-cd src
-make config \
-	prefix=${PREFIX} \
-	shared=1 \
-	cc=/mingw64/bin/gcc \
-	cxx=/mingw64/bin/g++
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-
-# Install GKlib
-cp -R GKlib ${PREFIX}
-
-# Create link to lib directory (PETSc, by default, looks for libraries in 
-# lib64/ if it detects that 64-bit integers are being used)
-#
-# NOTE: MSYS2 needs to be run as administrator for this to work.
-#
-cd ${PREFIX}
-ln -s ./lib ./lib64
-
-# Create link to shared version of library so that libtool can find it
-cd ${PREFIX}/lib
-ln -s libmetis.so libmetis.dll
Index: sm/trunk/externalpackages/metis/install-5.0.1-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-5.0.1-linux64.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-#metis 5.0 should be used: srand48 and drand48 are being redefined in conflict to the stdlib equivalent functions.
-
-#Some cleanup
-rm -rf install metis-5.0.1
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-5.0.1.tar.gz' 'metis-5.0.1.tar.gz'
-
-#Untar 
-tar -zxvf  metis-5.0.1.tar.gz
-
-#Move metis into install directory
-mv metis-5.0.1/* install
-rm -rf metis-5.0.1
-
-#Apply patches
-cd install 
-
-#Compile metis
-make config prefix="$ISSM_DIR/externalpackages/metis/install"
-make install
Index: /issm/trunk/externalpackages/metis/install.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/metis/install.sh	(revision 1)
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of metis
+version=`echo *.tar.gz | sed 's/\.tar\.gz//g' | sed 's/metis-//g'`
+echo $version
+
+#Some cleanup
+rm -rf install metis-$version
+
+#Create install directories
+mkdir install
+
+#Untar 
+tar -zxvf  metis-$version.tar.gz
+
+#Move metis into install directory
+mv metis-$version/* install
+rm -rf metis-$version
+
+#Apply patch
+cd install 
+patch Makefile.in ../Makefile.in.patch
+
+#Compile metis
+make  -j $NUMCPUS
+
+#Patch proto.h
+patch Lib/proto.h ../proto.h.patch
+
Index: sm/trunk/externalpackages/metis/metis-4.0.patch
===================================================================
--- /issm/trunk/externalpackages/metis/metis-4.0.patch	(revision 28275)
+++ 	(revision )
@@ -1,237 +1,0 @@
-diff -crB install/Lib/kmetis.c install2/Lib/kmetis.c
-*** install/Lib/kmetis.c	1998-11-30 08:26:47.000000000 -0800
---- install2/Lib/kmetis.c	2011-06-08 15:47:33.911358942 -0700
-***************
-*** 66,72 ****
-      ctrl.dbglvl = options[OPTION_DBGLVL];
-    }
-    ctrl.optype = OP_KMETIS;
-!   ctrl.CoarsenTo = amax((*nvtxs)/(40*log2(*nparts)), 20*(*nparts));
-    ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
-  
-    InitRandom(-1);
---- 66,72 ----
-      ctrl.dbglvl = options[OPTION_DBGLVL];
-    }
-    ctrl.optype = OP_KMETIS;
-!   ctrl.CoarsenTo = amax((*nvtxs)/(40*log2_function(*nparts)), 20*(*nparts));
-    ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
-  
-    InitRandom(-1);
-diff -crB install/Lib/kvmetis.c install2/Lib/kvmetis.c
-*** install/Lib/kvmetis.c	1998-11-30 08:26:47.000000000 -0800
---- install2/Lib/kvmetis.c	2011-06-08 15:47:33.916358976 -0700
-***************
-*** 66,72 ****
-      ctrl.dbglvl = options[OPTION_DBGLVL];
-    }
-    ctrl.optype = OP_KVMETIS;
-!   ctrl.CoarsenTo = amax((*nvtxs)/(40*log2(*nparts)), 20*(*nparts));
-    ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
-  
-    InitRandom(-1);
---- 66,72 ----
-      ctrl.dbglvl = options[OPTION_DBGLVL];
-    }
-    ctrl.optype = OP_KVMETIS;
-!   ctrl.CoarsenTo = amax((*nvtxs)/(40*log2_function(*nparts)), 20*(*nparts));
-    ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
-  
-    InitRandom(-1);
-diff -crB install/Lib/Makefile install2/Lib/Makefile
-*** install/Lib/Makefile	1998-09-22 05:08:29.000000000 -0700
---- install2/Lib/Makefile	2011-06-08 15:19:00.551540482 -0700
-***************
-*** 6,31 ****
-  LD = $(CC) -L. 
-  
-  
-! OBJS = coarsen.o fm.o initpart.o match.o ccgraph.o memory.o \
-!        pmetis.o pqueue.o refine.o util.o timing.o debug.o \
-!        bucketsort.o graph.o stat.o kmetis.o kwayrefine.o \
-!        kwayfm.o balance.o ometis.o srefine.o sfm.o separator.o \
-!        mincover.o mmd.o mesh.o meshpart.o frename.o fortran.o \
-!        myqsort.o compress.o parmetis.o estmem.o \
-!        mpmetis.o mcoarsen.o mmatch.o minitpart.o mbalance.o \
-!        mrefine.o mutil.o mfm.o mkmetis.o mkwayrefine.o mkwayfmh.o \
-!        mrefine2.o minitpart2.o mbalance2.o mfm2.o \
-!        kvmetis.o kwayvolrefine.o kwayvolfm.o subdomains.o
-  
-! .c.o:
-! 	$(CC) $(CFLAGS) -c $*.c
-  
-! ../libmetis.a: $(OBJS)
-  	$(AR) $@ $(OBJS)
-  	$(RANLIB) $@
-  
-  clean:
-! 	rm -f *.o
-  
-  realclean:
-! 	rm -f *.o ; rm -f ../libmetis.a
---- 6,31 ----
-  LD = $(CC) -L. 
-  
-  
-! OBJS = coarsen.$(OBJ_EXT) fm.$(OBJ_EXT) initpart.$(OBJ_EXT) match.$(OBJ_EXT) ccgraph.$(OBJ_EXT) memory.$(OBJ_EXT) \
-!        pmetis.$(OBJ_EXT) pqueue.$(OBJ_EXT) refine.$(OBJ_EXT) util.$(OBJ_EXT) timing.$(OBJ_EXT) debug.$(OBJ_EXT) \
-!        bucketsort.$(OBJ_EXT) graph.$(OBJ_EXT) stat.$(OBJ_EXT) kmetis.$(OBJ_EXT) kwayrefine.$(OBJ_EXT) \
-!        kwayfm.$(OBJ_EXT) balance.$(OBJ_EXT) ometis.$(OBJ_EXT) srefine.$(OBJ_EXT) sfm.$(OBJ_EXT) separator.$(OBJ_EXT) \
-!        mincover.$(OBJ_EXT) mmd.$(OBJ_EXT) mesh.$(OBJ_EXT) meshpart.$(OBJ_EXT) frename.$(OBJ_EXT) fortran.$(OBJ_EXT) \
-!        myqsort.$(OBJ_EXT) compress.$(OBJ_EXT) parmetis.$(OBJ_EXT) estmem.$(OBJ_EXT) \
-!        mpmetis.$(OBJ_EXT) mcoarsen.$(OBJ_EXT) mmatch.$(OBJ_EXT) minitpart.$(OBJ_EXT) mbalance.$(OBJ_EXT) \
-!        mrefine.$(OBJ_EXT) mutil.$(OBJ_EXT) mfm.$(OBJ_EXT) mkmetis.$(OBJ_EXT) mkwayrefine.$(OBJ_EXT) mkwayfmh.$(OBJ_EXT) \
-!        mrefine2.$(OBJ_EXT) minitpart2.$(OBJ_EXT) mbalance2.$(OBJ_EXT) mfm2.$(OBJ_EXT) \
-!        kvmetis.$(OBJ_EXT) kwayvolrefine.$(OBJ_EXT) kwayvolfm.$(OBJ_EXT) subdomains.$(OBJ_EXT)
-  
-! %.$(OBJ_EXT) : %.c
-! 	$(CC) -c $(CFLAGS) -o $@ $<
-  
-! ../libmetis.$(LIB_EXT): $(OBJS)
-  	$(AR) $@ $(OBJS)
-  	$(RANLIB) $@
-  
-  clean:
-! 	rm -f *.$(OBJ_EXT)
-  
-  realclean:
-! 	rm -f *.$(OBJ_EXT) ; rm -f ../libmetis.$(LIB_EXT)
-diff -crB install/Lib/metis.h install2/Lib/metis.h
-*** install/Lib/metis.h	1998-11-30 08:26:50.000000000 -0800
---- install2/Lib/metis.h	2011-06-08 15:19:00.544540433 -0700
-***************
-*** 18,24 ****
---- 18,26 ----
-  #else
-  #include <malloc.h>
-  #endif
-+ #ifndef WIN32
-  #include <strings.h>
-+ #endif
-  #include <string.h>
-  #include <ctype.h>
-  #include <math.h>
-diff -crB install/Lib/mkmetis.c install2/Lib/mkmetis.c
-*** install/Lib/mkmetis.c	1998-11-30 08:26:48.000000000 -0800
---- install2/Lib/mkmetis.c	2011-06-08 15:47:33.921359010 -0700
-***************
-*** 47,53 ****
-      ctrl.dbglvl = options[OPTION_DBGLVL];
-    }
-    ctrl.optype = OP_KMETIS;
-!   ctrl.CoarsenTo = amax((*nvtxs)/(20*log2(*nparts)), 30*(*nparts));
-  
-    ctrl.nmaxvwgt = 1.5/(1.0*ctrl.CoarsenTo);
-  
---- 47,53 ----
-      ctrl.dbglvl = options[OPTION_DBGLVL];
-    }
-    ctrl.optype = OP_KMETIS;
-!   ctrl.CoarsenTo = amax((*nvtxs)/(20*log2_function(*nparts)), 30*(*nparts));
-  
-    ctrl.nmaxvwgt = 1.5/(1.0*ctrl.CoarsenTo);
-  
-diff -crB install/Lib/proto.h install2/Lib/proto.h
-*** install/Lib/proto.h	1998-11-30 08:26:50.000000000 -0800
---- install2/Lib/proto.h	2011-06-08 15:47:34.009359613 -0700
-***************
-*** 230,237 ****
---- 230,243 ----
-  void QUADNODALMETIS(int, int, idxtype *, idxtype *, idxtype *adjncy);
-  
-  /* meshpart.c */
-+ #ifdef __cplusplus
-+ extern "C" {
-+ #endif
-  void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
-  void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
-+ #ifdef __cplusplus
-+ }
-+ #endif
-  
-  /* mfm.c */
-  void MocFM_2WayEdgeRefine(CtrlType *, GraphType *, float *, int);
-***************
-*** 459,465 ****
-  void srand48(long);
-  int ispow2(int);
-  void InitRandom(int);
-! int log2(int);
-  
-  
-  
---- 465,471 ----
-  void srand48(long);
-  int ispow2(int);
-  void InitRandom(int);
-! int log2_function(int);
-  
-  
-  
-diff -crB install/Lib/rename.h install2/Lib/rename.h
-*** install/Lib/rename.h	1998-11-30 08:26:50.000000000 -0800
---- install2/Lib/rename.h	2011-06-08 15:47:34.014359647 -0700
-***************
-*** 410,416 ****
-  #define RandomPermute			__RandomPermute
-  #define ispow2				__ispow2
-  #define InitRandom			__InitRandom
-! #define log2				__log2
-  
-  
-  
---- 410,417 ----
-  #define RandomPermute			__RandomPermute
-  #define ispow2				__ispow2
-  #define InitRandom			__InitRandom
-! /* Correction bug Nadir SOUALEM*/
-! #define log2_function				__log2_function
-  
-  
-  
-diff -crB install/Lib/util.c install2/Lib/util.c
-*** install/Lib/util.c	1998-11-30 08:26:50.000000000 -0800
---- install2/Lib/util.c	2011-06-08 15:47:34.018359675 -0700
-***************
-*** 507,515 ****
-  }
-  
-  /*************************************************************************
-! * This function returns the log2(x)
-  **************************************************************************/
-! int log2(int a)
-  {
-    int i;
-  
---- 507,515 ----
-  }
-  
-  /*************************************************************************
-! * This function returns the log2_function(x)
-  **************************************************************************/
-! int log2_function(int a)
-  {
-    int i;
-  
-diff -crB install/Makefile install2/Makefile
-*** install/Makefile	1998-09-20 11:15:31.000000000 -0700
---- install2/Makefile	2011-06-08 15:19:00.511540204 -0700
-***************
-*** 2,9 ****
-  
-  default:
-  	(cd Lib ; make ) 
-! 	(cd Programs ; make ) 
-! 	(cd Test ; make ) 
-  
-  clean:
-  	(cd Lib ; make clean )
---- 2,9 ----
-  
-  default:
-  	(cd Lib ; make ) 
-! #	(cd Programs ; make ) 
-! #	(cd Test ; make ) 
-  
-  clean:
-  	(cd Lib ; make clean )
Index: /issm/trunk/externalpackages/metis/proto.h
===================================================================
--- /issm/trunk/externalpackages/metis/proto.h	(revision 1)
+++ /issm/trunk/externalpackages/metis/proto.h	(revision 1)
@@ -0,0 +1,505 @@
+/*
+ * Copyright 1997, Regents of the University of Minnesota
+ *
+ * proto.h
+ *
+ * This file contains header files
+ *
+ * Started 10/19/95
+ * George
+ *
+ * $Id: proto.h,v 1.1 1998/11/27 17:59:28 karypis Exp $
+ *
+ */
+
+/* balance.c */
+void Balance2Way(CtrlType *, GraphType *, int *, float);
+void Bnd2WayBalance(CtrlType *, GraphType *, int *);
+void General2WayBalance(CtrlType *, GraphType *, int *);
+
+/* bucketsort.c */
+void BucketSortKeysInc(int, int, idxtype *, idxtype *, idxtype *);
+
+/* ccgraph.c */
+void CreateCoarseGraph(CtrlType *, GraphType *, int, idxtype *, idxtype *);
+void CreateCoarseGraphNoMask(CtrlType *, GraphType *, int, idxtype *, idxtype *);
+void CreateCoarseGraph_NVW(CtrlType *, GraphType *, int, idxtype *, idxtype *);
+GraphType *SetUpCoarseGraph(GraphType *, int, int);
+void ReAdjustMemory(GraphType *, GraphType *, int);
+
+/* coarsen.c */
+GraphType *Coarsen2Way(CtrlType *, GraphType *);
+
+/* compress.c */
+void CompressGraph(CtrlType *, GraphType *, int, idxtype *, idxtype *, idxtype *, idxtype *);
+void PruneGraph(CtrlType *, GraphType *, int, idxtype *, idxtype *, idxtype *, float);
+
+/* debug.c */
+int ComputeCut(GraphType *, idxtype *);
+int CheckBnd(GraphType *);
+int CheckBnd2(GraphType *);
+int CheckNodeBnd(GraphType *, int);
+int CheckRInfo(RInfoType *);
+int CheckNodePartitionParams(GraphType *);
+int IsSeparable(GraphType *);
+
+/* estmem.c */
+void METIS_EstimateMemory(int *, idxtype *, idxtype *, int *, int *, int *);
+void EstimateCFraction(int, idxtype *, idxtype *, float *, float *);
+int ComputeCoarseGraphSize(int, idxtype *, idxtype *, int, idxtype *, idxtype *, idxtype *);
+
+/* fm.c */
+void FM_2WayEdgeRefine(CtrlType *, GraphType *, int *, int);
+
+/* fortran.c */
+void Change2CNumbering(int, idxtype *, idxtype *);
+void Change2FNumbering(int, idxtype *, idxtype *, idxtype *);
+void Change2FNumbering2(int, idxtype *, idxtype *);
+void Change2FNumberingOrder(int, idxtype *, idxtype *, idxtype *, idxtype *);
+void ChangeMesh2CNumbering(int, idxtype *);
+void ChangeMesh2FNumbering(int, idxtype *, int, idxtype *, idxtype *);
+void ChangeMesh2FNumbering2(int, idxtype *, int, int, idxtype *, idxtype *);
+
+/* frename.c */
+void METIS_PARTGRAPHRECURSIVE(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void metis_partgraphrecursive(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void metis_partgraphrecursive_(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void metis_partgraphrecursive__(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void METIS_WPARTGRAPHRECURSIVE(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+void metis_wpartgraphrecursive(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+void metis_wpartgraphrecursive_(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+void metis_wpartgraphrecursive__(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+void METIS_PARTGRAPHKWAY(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void metis_partgraphkway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void metis_partgraphkway_(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void metis_partgraphkway__(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void METIS_WPARTGRAPHKWAY(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+void metis_wpartgraphkway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+void metis_wpartgraphkway_(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+void metis_wpartgraphkway__(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+void METIS_EDGEND(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void metis_edgend(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void metis_edgend_(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void metis_edgend__(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void METIS_NODEND(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void metis_nodend(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void metis_nodend_(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void metis_nodend__(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void METIS_NODEWND(int *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void metis_nodewnd(int *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void metis_nodewnd_(int *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void metis_nodewnd__(int *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void METIS_PARTMESHNODAL(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+void metis_partmeshnodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+void metis_partmeshnodal_(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+void metis_partmeshnodal__(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+void METIS_PARTMESHDUAL(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+void metis_partmeshdual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+void metis_partmeshdual_(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+void metis_partmeshdual__(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+void METIS_MESHTONODAL(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void metis_meshtonodal(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void metis_meshtonodal_(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void metis_meshtonodal__(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void METIS_MESHTODUAL(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void metis_meshtodual(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void metis_meshtodual_(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void metis_meshtodual__(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void METIS_ESTIMATEMEMORY(int *, idxtype *, idxtype *, int *, int *, int *);
+void metis_estimatememory(int *, idxtype *, idxtype *, int *, int *, int *);
+void metis_estimatememory_(int *, idxtype *, idxtype *, int *, int *, int *);
+void metis_estimatememory__(int *, idxtype *, idxtype *, int *, int *, int *);
+void METIS_MCPARTGRAPHRECURSIVE(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void metis_mcpartgraphrecursive(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void metis_mcpartgraphrecursive_(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void metis_mcpartgraphrecursive__(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void METIS_MCPARTGRAPHKWAY(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+void metis_mcpartgraphkway(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+void metis_mcpartgraphkway_(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+void metis_mcpartgraphkway__(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+void METIS_PARTGRAPHVKWAY(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void metis_partgraphvkway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void metis_partgraphvkway_(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void metis_partgraphvkway__(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void METIS_WPARTGRAPHVKWAY(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+void metis_wpartgraphvkway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+void metis_wpartgraphvkway_(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+void metis_wpartgraphvkway__(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+
+/* graph.c */
+void SetUpGraph(GraphType *, int, int, int, idxtype *, idxtype *, idxtype *, idxtype *, int);
+void SetUpGraphKway(GraphType *, int, idxtype *, idxtype *);
+void SetUpGraph2(GraphType *, int, int, idxtype *, idxtype *, float *, idxtype *);
+void VolSetUpGraph(GraphType *, int, int, int, idxtype *, idxtype *, idxtype *, idxtype *, int);
+void RandomizeGraph(GraphType *);
+int IsConnectedSubdomain(CtrlType *, GraphType *, int, int);
+int IsConnected(CtrlType *, GraphType *, int);
+int IsConnected2(GraphType *, int);
+int FindComponents(CtrlType *, GraphType *, idxtype *, idxtype *);
+
+/* initpart.c */
+void Init2WayPartition(CtrlType *, GraphType *, int *, float);
+void InitSeparator(CtrlType *, GraphType *, float);
+void GrowBisection(CtrlType *, GraphType *, int *, float);
+void GrowBisectionNode(CtrlType *, GraphType *, float);
+void RandomBisection(CtrlType *, GraphType *, int *, float);
+
+/* kmetis.c */
+void METIS_PartGraphKway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void METIS_WPartGraphKway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+int MlevelKWayPartitioning(CtrlType *, GraphType *, int, idxtype *, float *, float);
+
+/* kvmetis.c */
+void METIS_PartGraphVKway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void METIS_WPartGraphVKway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+int MlevelVolKWayPartitioning(CtrlType *, GraphType *, int, idxtype *, float *, float);
+
+/* kwayfm.c */
+void Random_KWayEdgeRefine(CtrlType *, GraphType *, int, float *, float, int, int);
+void Greedy_KWayEdgeRefine(CtrlType *, GraphType *, int, float *, float, int);
+void Greedy_KWayEdgeBalance(CtrlType *, GraphType *, int, float *, float, int);
+
+/* kwayrefine.c */
+void RefineKWay(CtrlType *, GraphType *, GraphType *, int, float *, float);
+void AllocateKWayPartitionMemory(CtrlType *, GraphType *, int);
+void ComputeKWayPartitionParams(CtrlType *, GraphType *, int);
+void ProjectKWayPartition(CtrlType *, GraphType *, int);
+int IsBalanced(idxtype *, int, float *, float);
+void ComputeKWayBoundary(CtrlType *, GraphType *, int);
+void ComputeKWayBalanceBoundary(CtrlType *, GraphType *, int);
+
+/* kwayvolfm.c */
+void Random_KWayVolRefine(CtrlType *, GraphType *, int, float *, float, int, int);
+void Random_KWayVolRefineMConn(CtrlType *, GraphType *, int, float *, float, int, int);
+void Greedy_KWayVolBalance(CtrlType *, GraphType *, int, float *, float, int);
+void Greedy_KWayVolBalanceMConn(CtrlType *, GraphType *, int, float *, float, int);
+void KWayVolUpdate(CtrlType *, GraphType *, int, int, int, idxtype *, idxtype *, idxtype *);
+void ComputeKWayVolume(GraphType *, int, idxtype *, idxtype *, idxtype *);
+int ComputeVolume(GraphType *, idxtype *);
+void CheckVolKWayPartitionParams(CtrlType *, GraphType *, int);
+void ComputeVolSubDomainGraph(GraphType *, int, idxtype *, idxtype *);
+void EliminateVolSubDomainEdges(CtrlType *, GraphType *, int, float *);
+void EliminateVolComponents(CtrlType *, GraphType *, int, float *, float);
+
+/* kwayvolrefine.c */
+void RefineVolKWay(CtrlType *, GraphType *, GraphType *, int, float *, float);
+void AllocateVolKWayPartitionMemory(CtrlType *, GraphType *, int);
+void ComputeVolKWayPartitionParams(CtrlType *, GraphType *, int);
+void ComputeKWayVolGains(CtrlType *, GraphType *, int);
+void ProjectVolKWayPartition(CtrlType *, GraphType *, int);
+void ComputeVolKWayBoundary(CtrlType *, GraphType *, int);
+void ComputeVolKWayBalanceBoundary(CtrlType *, GraphType *, int);
+
+/* match.c */
+void Match_RM(CtrlType *, GraphType *);
+void Match_RM_NVW(CtrlType *, GraphType *);
+void Match_HEM(CtrlType *, GraphType *);
+void Match_SHEM(CtrlType *, GraphType *);
+
+/* mbalance.c */
+void MocBalance2Way(CtrlType *, GraphType *, float *, float);
+void MocGeneral2WayBalance(CtrlType *, GraphType *, float *, float);
+
+/* mbalance2.c */
+void MocBalance2Way2(CtrlType *, GraphType *, float *, float *);
+void MocGeneral2WayBalance2(CtrlType *, GraphType *, float *, float *);
+void SelectQueue3(int, float *, float *, int *, int *, PQueueType [MAXNCON][2], float *);
+
+/* mcoarsen.c */
+GraphType *MCCoarsen2Way(CtrlType *, GraphType *);
+
+/* memory.c */
+void AllocateWorkSpace(CtrlType *, GraphType *, int);
+void FreeWorkSpace(CtrlType *, GraphType *);
+int WspaceAvail(CtrlType *);
+idxtype *idxwspacemalloc(CtrlType *, int);
+void idxwspacefree(CtrlType *, int);
+float *fwspacemalloc(CtrlType *, int);
+void fwspacefree(CtrlType *, int);
+GraphType *CreateGraph(void);
+void InitGraph(GraphType *);
+void FreeGraph(GraphType *);
+
+/* mesh.c */
+void METIS_MeshToDual(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void METIS_MeshToNodal(int *, int *, idxtype *, int *, int *, idxtype *, idxtype *);
+void GENDUALMETIS(int, int, int, idxtype *, idxtype *, idxtype *adjncy);
+void TRINODALMETIS(int, int, idxtype *, idxtype *, idxtype *adjncy);
+void TETNODALMETIS(int, int, idxtype *, idxtype *, idxtype *adjncy);
+void HEXNODALMETIS(int, int, idxtype *, idxtype *, idxtype *adjncy);
+void QUADNODALMETIS(int, int, idxtype *, idxtype *, idxtype *adjncy);
+
+/* meshpart.c */
+extern "C" void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+extern "C" void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+
+/* mfm.c */
+void MocFM_2WayEdgeRefine(CtrlType *, GraphType *, float *, int);
+void SelectQueue(int, float *, float *, int *, int *, PQueueType [MAXNCON][2]);
+int BetterBalance(int, float *, float *, float *);
+float Compute2WayHLoadImbalance(int, float *, float *);
+void Compute2WayHLoadImbalanceVec(int, float *, float *, float *);
+
+/* mfm2.c */
+void MocFM_2WayEdgeRefine2(CtrlType *, GraphType *, float *, float *, int);
+void SelectQueue2(int, float *, float *, int *, int *, PQueueType [MAXNCON][2], float *);
+int IsBetter2wayBalance(int, float *, float *, float *);
+
+/* mincover.o */
+void MinCover(idxtype *, idxtype *, int, int, idxtype *, int *);
+int MinCover_Augment(idxtype *, idxtype *, int, idxtype *, idxtype *, idxtype *, int);
+void MinCover_Decompose(idxtype *, idxtype *, int, int, idxtype *, idxtype *, int *);
+void MinCover_ColDFS(idxtype *, idxtype *, int, idxtype *, idxtype *, int);
+void MinCover_RowDFS(idxtype *, idxtype *, int, idxtype *, idxtype *, int);
+
+/* minitpart.c */
+void MocInit2WayPartition(CtrlType *, GraphType *, float *, float);
+void MocGrowBisection(CtrlType *, GraphType *, float *, float);
+void MocRandomBisection(CtrlType *, GraphType *, float *, float);
+void MocInit2WayBalance(CtrlType *, GraphType *, float *);
+int SelectQueueoneWay(int, float *, float *, int, PQueueType [MAXNCON][2]);
+
+/* minitpart2.c */
+void MocInit2WayPartition2(CtrlType *, GraphType *, float *, float *);
+void MocGrowBisection2(CtrlType *, GraphType *, float *, float *);
+void MocGrowBisectionNew2(CtrlType *, GraphType *, float *, float *);
+void MocInit2WayBalance2(CtrlType *, GraphType *, float *, float *);
+int SelectQueueOneWay2(int, float *, PQueueType [MAXNCON][2], float *);
+
+/* mkmetis.c */
+void METIS_mCPartGraphKway(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+int MCMlevelKWayPartitioning(CtrlType *, GraphType *, int, idxtype *, float *);
+
+/* mkwayfmh.c */
+void MCRandom_KWayEdgeRefineHorizontal(CtrlType *, GraphType *, int, float *, int);
+void MCGreedy_KWayEdgeBalanceHorizontal(CtrlType *, GraphType *, int, float *, int);
+int AreAllHVwgtsBelow(int, float, float *, float, float *, float *);
+int AreAllHVwgtsAbove(int, float, float *, float, float *, float *);
+void ComputeHKWayLoadImbalance(int, int, float *, float *);
+int MocIsHBalanced(int, int, float *, float *);
+int IsHBalanceBetterFT(int, int, float *, float *, float *, float *);
+int IsHBalanceBetterTT(int, int, float *, float *, float *, float *);
+
+/* mkwayrefine.c */
+void MocRefineKWayHorizontal(CtrlType *, GraphType *, GraphType *, int, float *);
+void MocAllocateKWayPartitionMemory(CtrlType *, GraphType *, int);
+void MocComputeKWayPartitionParams(CtrlType *, GraphType *, int);
+void MocProjectKWayPartition(CtrlType *, GraphType *, int);
+void MocComputeKWayBalanceBoundary(CtrlType *, GraphType *, int);
+
+/* mmatch.c */
+void MCMatch_RM(CtrlType *, GraphType *);
+void MCMatch_HEM(CtrlType *, GraphType *);
+void MCMatch_SHEM(CtrlType *, GraphType *);
+void MCMatch_SHEBM(CtrlType *, GraphType *, int);
+void MCMatch_SBHEM(CtrlType *, GraphType *, int);
+float BetterVBalance(int, int, float *, float *, float *);
+int AreAllVwgtsBelowFast(int, float *, float *, float);
+
+/* mmd.c */
+void genmmd(int, idxtype *, idxtype *, idxtype *, idxtype *, int , idxtype *, idxtype *, idxtype *, idxtype *, int, int *);
+void mmdelm(int, idxtype *xadj, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, int, int);
+int  mmdint(int, idxtype *xadj, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *);
+void mmdnum(int, idxtype *, idxtype *, idxtype *);
+void mmdupd(int, int, idxtype *, idxtype *, int, int *, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, int, int *tag);
+
+/* mpmetis.c */
+void METIS_mCPartGraphRecursive(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
+void METIS_mCHPartGraphRecursive(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
+void METIS_mCPartGraphRecursiveInternal(int *, int *, idxtype *, idxtype *, float *, idxtype *, int *, int *, int *, idxtype *);
+void METIS_mCHPartGraphRecursiveInternal(int *, int *, idxtype *, idxtype *, float *, idxtype *, int *, float *, int *, int *, idxtype *);
+int MCMlevelRecursiveBisection(CtrlType *, GraphType *, int, idxtype *, float, int);
+int MCHMlevelRecursiveBisection(CtrlType *, GraphType *, int, idxtype *, float *, int);
+void MCMlevelEdgeBisection(CtrlType *, GraphType *, float *, float);
+void MCHMlevelEdgeBisection(CtrlType *, GraphType *, float *, float *);
+
+/* mrefine.c */
+void MocRefine2Way(CtrlType *, GraphType *, GraphType *, float *, float);
+void MocAllocate2WayPartitionMemory(CtrlType *, GraphType *);
+void MocCompute2WayPartitionParams(CtrlType *, GraphType *);
+void MocProject2WayPartition(CtrlType *, GraphType *);
+
+/* mrefine2.c */
+void MocRefine2Way2(CtrlType *, GraphType *, GraphType *, float *, float *);
+
+/* mutil.c */
+int AreAllVwgtsBelow(int, float, float *, float, float *, float);
+int AreAnyVwgtsBelow(int, float, float *, float, float *, float);
+int AreAllVwgtsAbove(int, float, float *, float, float *, float);
+float ComputeLoadImbalance(int, int, float *, float *);
+int AreAllBelow(int, float *, float *);
+
+/* myqsort.c */
+void iidxsort(int, idxtype *);
+void iintsort(int, int *);
+void ikeysort(int, KeyValueType *);
+void ikeyvalsort(int, KeyValueType *);
+
+/* ometis.c */
+void METIS_EdgeND(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void METIS_NodeND(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void METIS_NodeWND(int *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *); 
+void MlevelNestedDissection(CtrlType *, GraphType *, idxtype *, float, int);
+void MlevelNestedDissectionCC(CtrlType *, GraphType *, idxtype *, float, int);
+void MlevelNodeBisectionMultiple(CtrlType *, GraphType *, int *, float);
+void MlevelNodeBisection(CtrlType *, GraphType *, int *, float);
+void SplitGraphOrder(CtrlType *, GraphType *, GraphType *, GraphType *);
+void MMDOrder(CtrlType *, GraphType *, idxtype *, int);
+int SplitGraphOrderCC(CtrlType *, GraphType *, GraphType *, int, idxtype *, idxtype *);
+
+/* parmetis.c */
+void METIS_PartGraphKway2(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void METIS_WPartGraphKway2(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+void METIS_NodeNDP(int, idxtype *, idxtype *, int, int *, idxtype *, idxtype *, idxtype *);
+void MlevelNestedDissectionP(CtrlType *, GraphType *, idxtype *, int, int, int, idxtype *);
+void METIS_NodeComputeSeparator(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *); 
+void METIS_EdgeComputeSeparator(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *); 
+
+/* pmetis.c */
+void METIS_PartGraphRecursive(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *); 
+void METIS_WPartGraphRecursive(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *); 
+int MlevelRecursiveBisection(CtrlType *, GraphType *, int, idxtype *, float *, float, int);
+void MlevelEdgeBisection(CtrlType *, GraphType *, int *, float);
+void SplitGraphPart(CtrlType *, GraphType *, GraphType *, GraphType *);
+void SetUpSplitGraph(GraphType *, GraphType *, int, int);
+
+/* pqueue.c */
+void PQueueInit(CtrlType *ctrl, PQueueType *, int, int);
+void PQueueReset(PQueueType *);
+void PQueueFree(CtrlType *ctrl, PQueueType *);
+int PQueueGetSize(PQueueType *);
+int PQueueInsert(PQueueType *, int, int);
+int PQueueDelete(PQueueType *, int, int);
+int PQueueUpdate(PQueueType *, int, int, int);
+void PQueueUpdateUp(PQueueType *, int, int, int);
+int PQueueGetMax(PQueueType *);
+int PQueueSeeMax(PQueueType *);
+int PQueueGetKey(PQueueType *);
+int CheckHeap(PQueueType *);
+
+/* refine.c */
+void Refine2Way(CtrlType *, GraphType *, GraphType *, int *, float ubfactor);
+void Allocate2WayPartitionMemory(CtrlType *, GraphType *);
+void Compute2WayPartitionParams(CtrlType *, GraphType *);
+void Project2WayPartition(CtrlType *, GraphType *);
+
+/* separator.c */
+void ConstructSeparator(CtrlType *, GraphType *, float);
+void ConstructMinCoverSeparator0(CtrlType *, GraphType *, float);
+void ConstructMinCoverSeparator(CtrlType *, GraphType *, float);
+
+/* sfm.c */
+void FM_2WayNodeRefine(CtrlType *, GraphType *, float, int);
+void FM_2WayNodeRefineEqWgt(CtrlType *, GraphType *, int);
+void FM_2WayNodeRefine_OneSided(CtrlType *, GraphType *, float, int);
+void FM_2WayNodeBalance(CtrlType *, GraphType *, float);
+int ComputeMaxNodeGain(int, idxtype *, idxtype *, idxtype *);
+
+/* srefine.c */
+void Refine2WayNode(CtrlType *, GraphType *, GraphType *, float);
+void Allocate2WayNodePartitionMemory(CtrlType *, GraphType *);
+void Compute2WayNodePartitionParams(CtrlType *, GraphType *);
+void Project2WayNodePartition(CtrlType *, GraphType *);
+
+/* stat.c */
+void ComputePartitionInfo(GraphType *, int, idxtype *);
+void ComputePartitionInfoBipartite(GraphType *, int, idxtype *);
+void ComputePartitionBalance(GraphType *, int, idxtype *, float *);
+float ComputeElementBalance(int, int, idxtype *);
+
+/* subdomains.c */
+void Random_KWayEdgeRefineMConn(CtrlType *, GraphType *, int, float *, float, int, int);
+void Greedy_KWayEdgeBalanceMConn(CtrlType *, GraphType *, int, float *, float, int);
+void PrintSubDomainGraph(GraphType *, int, idxtype *);
+void ComputeSubDomainGraph(GraphType *, int, idxtype *, idxtype *);
+void EliminateSubDomainEdges(CtrlType *, GraphType *, int, float *);
+void MoveGroupMConn(CtrlType *, GraphType *, idxtype *, idxtype *, int, int, int, idxtype *);
+void EliminateComponents(CtrlType *, GraphType *, int, float *, float);
+void MoveGroup(CtrlType *, GraphType *, int, int, int, idxtype *, idxtype *);
+
+/* timing.c */
+void InitTimers(CtrlType *);
+void PrintTimers(CtrlType *);
+double seconds(void);
+
+/* util.c */
+void errexit(char *,...);
+#ifndef DMALLOC
+int *imalloc(int, char *);
+idxtype *idxmalloc(int, char *);
+float *fmalloc(int, char *);
+int *ismalloc(int, int, char *);
+idxtype *idxsmalloc(int, idxtype, char *);
+void *GKmalloc(int, char *);
+#endif
+/*void GKfree(void **,...); */
+int *iset(int n, int val, int *x);
+idxtype *idxset(int n, idxtype val, idxtype *x);
+float *sset(int n, float val, float *x);
+int iamax(int, int *);
+int idxamax(int, idxtype *);
+int idxamax_strd(int, idxtype *, int);
+int samax(int, float *);
+int samax2(int, float *);
+int idxamin(int, idxtype *);
+int samin(int, float *);
+int idxsum(int, idxtype *);
+int idxsum_strd(int, idxtype *, int);
+void idxadd(int, idxtype *, idxtype *);
+int charsum(int, char *);
+int isum(int, int *);
+float ssum(int, float *);
+float ssum_strd(int n, float *x, int);
+void sscale(int n, float, float *x);
+float snorm2(int, float *);
+float sdot(int n, float *, float *);
+void saxpy(int, float, float *, int, float *, int);
+void RandomPermute(int, idxtype *, int);
+double drand48();
+void srand48(long);
+int ispow2(int);
+void InitRandom(int);
+int log2(int);
+
+
+
+
+
+
+
+
+
+
+/***************************************************************
+* Programs Directory
+****************************************************************/
+
+/* io.c */
+void ReadGraph(GraphType *, char *, int *);
+void WritePartition(char *, idxtype *, int, int);
+void WriteMeshPartition(char *, int, int, idxtype *, int, idxtype *);
+void WritePermutation(char *, idxtype *, int);
+int CheckGraph(GraphType *);
+idxtype *ReadMesh(char *, int *, int *, int *);
+void WriteGraph(char *, int, idxtype *, idxtype *);
+
+/* smbfactor.c */
+void ComputeFillIn(GraphType *, idxtype *);
+idxtype ComputeFillIn2(GraphType *, idxtype *);
+int smbfct(int, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, int *, idxtype *, idxtype *, int *);
+
+
+/***************************************************************
+* Test Directory
+****************************************************************/
+void Test_PartGraph(int, idxtype *, idxtype *);
+int VerifyPart(int, idxtype *, idxtype *, idxtype *, idxtype *, int, int, idxtype *);
+int VerifyWPart(int, idxtype *, idxtype *, idxtype *, idxtype *, int, float *, int, idxtype *);
+void Test_PartGraphV(int, idxtype *, idxtype *);
+int VerifyPartV(int, idxtype *, idxtype *, idxtype *, idxtype *, int, int, idxtype *);
+int VerifyWPartV(int, idxtype *, idxtype *, idxtype *, idxtype *, int, float *, int, idxtype *);
+void Test_PartGraphmC(int, idxtype *, idxtype *);
+int VerifyPartmC(int, int, idxtype *, idxtype *, idxtype *, idxtype *, int, float *, int, idxtype *);
+void Test_ND(int, idxtype *, idxtype *);
+int VerifyND(int, idxtype *, idxtype *);
+
Index: /issm/trunk/externalpackages/metis/proto.h.patch
===================================================================
--- /issm/trunk/externalpackages/metis/proto.h.patch	(revision 1)
+++ /issm/trunk/externalpackages/metis/proto.h.patch	(revision 1)
@@ -0,0 +1,6 @@
+233,234c233,234
+< void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+< void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+---
+> extern "C" void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+> extern "C" void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
Index: /issm/trunk/externalpackages/mpich2/Examples.Makefile.patch
===================================================================
--- /issm/trunk/externalpackages/mpich2/Examples.Makefile.patch	(revision 1)
+++ /issm/trunk/externalpackages/mpich2/Examples.Makefile.patch	(revision 1)
@@ -0,0 +1,6 @@
+72,73c72,73
+< cpi: cpi.o   ../lib/lib${MPILIBNAME}.a
+< 	$(C_LINK) $(LDFLAGS) -o cpi cpi.o  -lm ${LIBS}
+---
+> cpi: cpi.o   ../lib/lib${MPILIBNAME}.a 
+> 	$(C_LINK) $(LDFLAGS) -o cpi cpi.o  -lm ${LIBS} ../lib/libmpich.la
Index: /issm/trunk/externalpackages/mpich2/install.sh
===================================================================
--- /issm/trunk/externalpackages/mpich2/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/mpich2/install.sh	(revision 1)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of mpich2
+version=`echo *.tar.gz | sed 's/\.tar\.gz//g' | sed 's/mpich2-//g'`
+
+#Some cleanup
+rm -rf src install mpich2-$version
+
+#Create src and install directories
+mkdir src install
+
+#Untar 
+tar -zxvf  mpich2-$version.tar.gz
+
+#Move mpich2 into src directory
+mv mpich2-$version/* src
+rm -rf mpich2-$version
+
+#Configure mpich2
+cd src
+./configure --prefix="$ISSM_DIR/packages/mpich2/install" --enable-sharedlibs=gcc --enable-f91=gfortran 
+
+#Apply Patch to examples
+cd examples
+patch Makefile ../../Examples.Makefile.patch
+
+#Compile mpich2
+cd ../
+make  -j $NUMCPUS
+
+#Install
+make install
Index: /issm/trunk/externalpackages/mtoc/install.sh
===================================================================
--- /issm/trunk/externalpackages/mtoc/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/mtoc/install.sh	(revision 1)
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of mtoc
+name=`echo *.tgz | sed 's/\.tgz//g'` 
+echo $name
+
+#Some cleanup
+rm -rf src install $name
+
+#Create src and install directories
+mkdir src install
+
+#Untar 
+tar -zxvf  $name.tgz
+
+#Move mtoc to src directory
+mv $name/* src/
+rm -rf $name
+
+#Compile mtoc
+cd src
+rm -rf mtoc mtoc.exe
+
+flex mtoc.l
+gcc -o ../install/mtoc lex.yy.c -lfl
Index: sm/trunk/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh	(revision 28275)
+++ 	(revision )
@@ -1,74 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Dependencies
-# - MPI implementation (for parallel I/O support)
-# - hdf5 (1.8.9 / 1.10.1 or later, for netCDF-4 support)
-# - zlib (1.2.5 or later, for netCDF-4 compression)
-# - curl (7.18.0 or later, for DAP remote access client support)
-#
-# Sources:
-# - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
-#
-# NOTE:
-# - Certain configuration tests fail if libraries are not supplied explicitly
-#
-# TODO:
-# - Compile and link curl statically (issue with DAP and system libs on macOS 
-#	with more restrictive Gatekeeper; see also --disable-dap option in 
-#	configuration)
-#
-
-# Constants
-#
-VER="4.7.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
-
-# Environment
-#
-export CC=mpicc
-export CPPFLAGS="-I${ZLIB_ROOT}/include"
-
-export ZLIB="${ZLIB_ROOT}/lib/libz.a"
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf netcdf-c-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Move source to 'src' directory
-mv netcdf-c-${VER}/* src
-rm -rf netcdf-c-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--disable-shared \
-	--disable-dependency-tracking \
-	--enable-fast-install \
-	--disable-doxygen \
-	--enable-netcdf4 \
-	--disable-dap \
-	--disable-examples \
-	--disable-filter-testing \
-	--disable-dap-remote-tests \
-	--enable-parallel-tests
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make check
-	make install
-else
-	make -j $1
-	make -j $1 check
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/netcdf/install-4.7-parallel-static.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-parallel-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,71 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Dependencies
-# - MPI implementation (for parallel I/O support)
-# - hdf5 (1.8.9 / 1.10.1 or later, for netCDF-4 support)
-# - zlib (1.2.5 or later, for netCDF-4 compression)
-# - curl (7.18.0 or later, for DAP remote access client support)
-#
-# Sources:
-# - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
-#
-# NOTE:
-# - Certain configuration tests fail if libraries are not supplied explicitly
-#
-# TODO:
-# - Compile and link curl statically (issue with DAP and system libs on macOS 
-#	with more restrictive Gatekeeper; see also --disable-dap option in 
-#	configuration)
-#
-
-# Constants
-#
-VER="4.7.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
-
-# Environment
-#
-export CC=mpicc
-export CPPFLAGS="-I${ZLIB_ROOT}/include"
-
-export ZLIB="${ZLIB_ROOT}/lib/libz.a"
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf netcdf-c-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Move source to 'src' directory
-mv netcdf-c-${VER}/* src
-rm -rf netcdf-c-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--disable-shared \
-	--disable-dependency-tracking \
-	--enable-fast-install \
-	--disable-doxygen \
-	--enable-netcdf4 \
-	--disable-dap \
-	--disable-testsets \
-	--disable-examples \
-	--disable-filter-testing
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/netcdf/install-4.7-parallel-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-parallel-with_tests.sh	(revision 28275)
+++ 	(revision )
@@ -1,64 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Dependencies
-# - MPI implementation (for parallel I/O support)
-# - hdf5 (1.8.9 / 1.10.1 or later, for netCDF-4 support)
-# - zlib (1.2.5 or later, for netCDF-4 compression)
-# - curl (7.18.0 or later, for DAP remote access client support)
-#
-# Sources:
-# - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
-#
-
-# Constants
-#
-VER="4.7.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
-
-# Environment
-#
-export CC=mpicc
-export CPPFLAGS="-I${HDF5_ROOT}/include -I${CURL_ROOT}/include -I${ZLIB_ROOT}/include"
-export LDFLAGS="-L${HDF5_ROOT}/lib -L${CURL_ROOT}/lib -L${ZLIB_ROOT}/lib"
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf netcdf-c-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Move source to 'src' directory
-mv netcdf-c-${VER}/* src
-rm -rf netcdf-c-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--disable-static \
-	--disable-dependency-tracking \
-	--enable-fast-install \
-	--disable-doxygen \
-	--enable-netcdf4 \
-	--disable-examples \
-	--disable-filter-testing \
-	--disable-dap-remote-tests \
-	--enable-parallel-tests
-
-# Compile, test, and install
-if [ $# -eq 0 ]; then
-	make
-	make check
-	make install
-else
-	make -j $1
-	make -j $1 check
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/netcdf/install-4.7-parallel.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-parallel.sh	(revision 28275)
+++ 	(revision )
@@ -1,61 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Dependencies
-# - MPI implementation (for parallel I/O support)
-# - hdf5 (1.8.9 / 1.10.1 or later, for netCDF-4 support)
-# - zlib (1.2.5 or later, for netCDF-4 compression)
-# - curl (7.18.0 or later, for DAP remote access client support)
-#
-# Sources:
-# - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
-#
-
-# Constants
-#
-VER="4.7.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
-
-# Environment
-#
-export CC=mpicc
-export CPPFLAGS="-I${HDF5_ROOT}/include -I${CURL_ROOT}/include -I${ZLIB_ROOT}/include"
-export LDFLAGS="-L${HDF5_ROOT}/lib -L${CURL_ROOT}/lib -L${ZLIB_ROOT}/lib"
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf netcdf-c-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Move source to 'src' directory
-mv netcdf-c-${VER}/* src
-rm -rf netcdf-c-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--disable-static \
-	--disable-dependency-tracking \
-	--enable-fast-install \
-	--disable-doxygen \
-	--enable-netcdf4 \
-	--disable-testsets \
-	--disable-examples \
-	--disable-filter-testing
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/netcdf/install-4.7-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-with_tests.sh	(revision 28275)
+++ 	(revision )
@@ -1,62 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Dependencies
-# - MPI implementation (for parallel I/O support)
-# - hdf5 (1.8.9 / 1.10.1 or later, for netCDF-4 support)
-# - zlib (1.2.5 or later, for netCDF-4 compression)
-# - curl (7.18.0 or later, for DAP remote access client support)
-#
-# Sources:
-# - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
-#
-
-# Constants
-#
-VER="4.7.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
-
-# Environment
-#
-export CPPFLAGS="-I${HDF5_ROOT}/include -I${CURL_ROOT}/include -I${ZLIB_ROOT}/include"
-export LDFLAGS="-L${HDF5_ROOT}/lib -L${CURL_ROOT}/lib -L${ZLIB_ROOT}/lib"
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf netcdf-c-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Move source to 'src' directory
-mv netcdf-c-${VER}/* src
-rm -rf netcdf-c-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--disable-static \
-	--disable-dependency-tracking \
-	--enable-fast-install \
-	--disable-doxygen \
-	--enable-netcdf4 \
-	--disable-filter-testing \
-	--disable-examples \
-	--disable-dap-remote-tests
-
-# Compile, test, and install
-if [ $# -eq 0 ]; then
-	make
-	make check
-	make install
-else
-	make
-	make -j $1 check
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/netcdf/install-4.7.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7.sh	(revision 28275)
+++ 	(revision )
@@ -1,59 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Dependencies
-# - MPI implementation (for parallel I/O support)
-# - hdf5 (1.8.9 / 1.10.1 or later, for netCDF-4 support)
-# - zlib (1.2.5 or later, for netCDF-4 compression)
-# - curl (7.18.0 or later, for DAP remote access client support)
-#
-# Sources:
-# - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
-#
-
-# Constants
-#
-VER="4.7.2"
-
-PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
-
-# Environment
-#
-export CPPFLAGS="-I${HDF5_ROOT}/include -I${CURL_ROOT}/include -I${ZLIB_ROOT}/include"
-export LDFLAGS="-L${HDF5_ROOT}/lib -L${CURL_ROOT}/lib -L${ZLIB_ROOT}/lib"
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf netcdf-c-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} src
-
-# Move source to 'src' directory
-mv netcdf-c-${VER}/* src
-rm -rf netcdf-c-${VER}
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--disable-static \
-	--disable-dependency-tracking \
-	--enable-fast-install \
-	--disable-doxygen \
-	--disable-testsets \
-	--disable-examples \
-	--enable-netcdf4
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: /issm/trunk/externalpackages/netcdf/install.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/netcdf/install.sh	(revision 1)
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of netcdf
+version=`echo *.tar.gz | sed 's/\.tar\.gz//g' | sed 's/netcdf-//g'`
+
+#Some cleanup
+rm -rf install netcdf-$version
+
+#Create install directories
+mkdir install
+
+#Untar 
+tar -zxvf  netcdf-$version.tar.gz
+
+#Move netcdf to install directory
+rm -rf install/*
+mv netcdf-$version/* install/
+rm -rf netcdf-$version
+
+#Configure netcdf
+cd install
+./configure  --prefix="$ISSM_DIR/packages/netcdf/install" 
+
+#Compile netcdf
+make  -j $NUMCPUS
+
+#Install
+make install
Index: sm/trunk/externalpackages/petsc/install-3.14-discover.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-discover.sh	(revision 28275)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.14.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./config/configure.py \
-	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--with-blas-lapack-dir="/usr/local/intel/oneapi/2021/mkl/2021.4.0/" \
-	--with-cc="/usr/local/intel/oneapi/2021/mpi/2021.4.0/bin/mpicc" \
-	--with-cxx="/usr/local/intel/oneapi/2021/mpi/2021.4.0/bin/mpicxx" \
-	--with-fc="/usr/local/intel/oneapi/2021/mpi/2021.4.0/bin/mpif90" \
-	--known-mpi-shared-libraries=1 \
-	--known-64-bit-blas-indices \
-	--known-mpi-long-double=1 \
-	--known-mpi-int64_t=1 \
-	--known-mpi-c-double-complex=1 \
-	--with-shared-libraries=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-greenplanet.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-greenplanet.sh	(revision 28275)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# WARNING: Make sure you have the right MPI
-
-## Constants
-#
-VER="3.14.0"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-#configure
-cd ${PETSC_DIR}
-./config/configure.py \
-	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-blas-lapack-dir="/sopt/INTEL/compilers_and_libraries_2018.3.222/linux/mkl/" \
-	--with-mpi-dir="/sopt/OpenMPI/3.1.2/intel-2018.3-slim/" \
-	--known-mpi-shared-libraries=1 \
-	--known-64-bit-blas-indices \
-	--known-mpi-long-double=1 \
-	--known-mpi-int64_t=1 \
-	--known-mpi-c-double-complex=1 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-batch=1  \
-	--with-shared-libraries=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-linux-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.14.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Cannot use --with-fpic option when compiling static libs,
-#
-#		Cannot determine compiler PIC flags if shared libraries is turned off
-#		Either run using --with-shared-libraries or --with-pic=0 and supply the
-#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
-#
-cd ${PETSC_DIR}
-./configure.py \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-shared-libraries=0 \
-	--CFLAGS="-fPIC" \
-	--CXXFLAGS="-fPIC" \
-	--FFLAGS="-fPIC" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1 \
-	--download-hdf5=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-linux.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-linux.sh	(revision 28275)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.14.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./config/configure.py \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1 \
-	--download-hdf5=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-mac-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,68 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.14.6"
-
-PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Modify source so that Python 3 can be used to compile PETSc
-sed -i'' 's|#!/usr/bin/env python|#!/usr/bin/env python3|g' ${PETSC_DIR}/config/configure.py
-
-# Modify source so that Python >= 3.9 can be used to compile PETSc
-sed -i'' 's|thread.isAlive|thread.is_alive|g' ${PETSC_DIR}/config/BuildSystem/script.py
-
-# Configure
-#
-# NOTE:
-# - Cannot use --with-fpic option when compiling static libs,
-#
-#		Cannot determine compiler PIC flags if shared libraries is turned off
-#		Either run using --with-shared-libraries or --with-pic=0 and supply the
-#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
-#
-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
-#	(may need to remove it for earlier versions not using the C99 standard).
-# - Added -static-libgfortran to all macOS static builds, but this will not 
-#	work out of the box on Linux.
-#
-cd ${PETSC_DIR}
-./config/configure.py \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-shared-libraries=0 \
-	--CFLAGS="-fPIC -Wno-error=implicit-function-declaration" \
-	--CXXFLAGS="-fPIC" \
-	--FFLAGS="-fPIC -static-libgfortran" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-mac-with-hdf5-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-mac-with-hdf5-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,69 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.14.6"
-
-PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Modify source so that Python 3 can be used to compile PETSc
-sed -i'' 's|#!/usr/bin/env python|#!/usr/bin/env python3|g' ${PETSC_DIR}/config/configure.py
-
-# Modify source so that Python >= 3.9 can be used to compile PETSc
-sed -i'' 's|thread.isAlive|thread.is_alive|g' ${PETSC_DIR}/config/BuildSystem/script.py
-
-# Configure
-#
-# NOTE:
-# - Cannot use --with-fpic option when compiling static libs,
-#
-#		Cannot determine compiler PIC flags if shared libraries is turned off
-#		Either run using --with-shared-libraries or --with-pic=0 and supply the
-#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
-#
-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
-#	(may need to remove it for earlier versions not using the C99 standard).
-# - Added -static-libgfortran to all macOS static builds, but this will not 
-#	work out of the box on Linux.
-#
-cd ${PETSC_DIR}
-./config/configure.py \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-shared-libraries=0 \
-	--CFLAGS="-fPIC -Wno-error=implicit-function-declaration" \
-	--CXXFLAGS="-fPIC" \
-	--FFLAGS="-fPIC -static-libgfortran" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1 \
-	--download-hdf5=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-mac-with-hdf5.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-mac-with-hdf5.sh	(revision 28275)
+++ 	(revision )
@@ -1,59 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.14.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Modify source so that Python 3 can be used to compile PETSc
-sed -i'' 's|#!/usr/bin/env python|#!/usr/bin/env python3|g' ${PETSC_DIR}/config/configure.py
-
-# Modify source so that Python >= 3.9 can be used to compile PETSc
-sed -i'' 's|thread.isAlive|thread.is_alive|g' ${PETSC_DIR}/config/BuildSystem/script.py
-
-# Configure
-#
-# NOTE:
-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
-#	(may need to remove it for earlier versions not using the C99 standard).
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--CFLAGS="-Wno-error=implicit-function-declaration" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1 \
-	--download-hdf5=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-mac.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-mac.sh	(revision 28275)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.14.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Modify source so that Python 3 can be used to compile PETSc
-sed -i'' 's|#!/usr/bin/env python|#!/usr/bin/env python3|g' ${PETSC_DIR}/config/configure.py
-
-# Modify source so that Python >= 3.9 can be used to compile PETSc
-sed -i'' 's|thread.isAlive|thread.is_alive|g' ${PETSC_DIR}/config/BuildSystem/script.py
-
-# Configure
-#
-# NOTE:
-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
-#	(may need to remove it for earlier versions not using the C99 standard).
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--CFLAGS="-Wno-error=implicit-function-declaration" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-pleiades.sh	(revision 28275)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.14.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./config/configure.py \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--CFLAGS="-g -O3" \
-	--CXXFLAGS="-g -O3" \
-	--FFLAGS="-g -O3" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--with-batch=1 \
-	--with-blas-lapack-dir="/nasa/intel/Compiler/2018.3.222/compilers_and_libraries_2018.3.222/linux/mkl" \
-	--with-scalapack-include=/nasa/intel/Compiler/2018.3.222/mkl/include \
-	--with-scalapack-lib="/nasa/intel/Compiler/2018.3.222/mkl/lib/intel64/libmkl_scalapack_lp64.so /nasa/intel/Compiler/2018.3.222/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.so" \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=0 \
-	--download-mumps=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-tetralith.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-tetralith.sh	(revision 28275)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.14.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./config/configure.py \
-	COPTFLAGS="-g -O2" CXXOPTFLAGS="-g -O2" FOPTFLAGS="-g -O2" \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--with-blas-lapack-dir="/software/sse/easybuild/prefix/software/imkl/2018.1.163-iimpi-2018a/mkl" \
-	--with-cc="/software/sse/easybuild/prefix/software/impi/2018.1.163-iccifort-2018.1.163-GCC-6.4.0-2.28/bin64/mpicc" \
-	--with-cxx="/software/sse/easybuild/prefix/software/impi/2018.1.163-iccifort-2018.1.163-GCC-6.4.0-2.28/bin64/mpicxx" \
-	--with-fc="/software/sse/easybuild/prefix/software/impi/2018.1.163-iccifort-2018.1.163-GCC-6.4.0-2.28/bin64/mpiifort" \
-	--known-mpi-shared-libraries=1 \
-	--known-64-bit-blas-indices \
-	--known-mpi-long-double=1 \
-	--known-mpi-int64_t=1 \
-	--known-mpi-c-double-complex=1 \
-	--with-shared-libraries=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,88 +1,0 @@
-#!/bin/bash
-set -u # NOTE: Do not set -e as it will cause this script to fail when there are errors in underlying Python scripts
-
-# NOTE:
-# - You must install various needed packages with,
-#
-#		pacman -S mingw-w64-x86_64-toolchain python
-#
-# - You must use MSYS2 MinGW 64-bit version of cmake to be able to install 
-#	external packages correctly,
-#
-#		pacman -R mingw-w64-x86_64-cmake
-#
-# Sources:
-# - https://gitlab.com/petsc/petsc/-/issues/820#note_487483240
-#
-
-## Constants
-#
-VER="3.14.6"
-
-MAKEFILE_GENERATOR='-G "MSYS Makefiles"'
-PETSC_ARCH="arch-mswin-c-opt"
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Patch source
-sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/python3|' ${PETSC_DIR}/config/configure.py
-sed -i 's|  chkusingwindowspython()|#  chkusingwindowspython()|' ${PETSC_DIR}/config/configure.py
-sed -i 's|(MAKEFLAGS)|(MAKEFLAGS:w=)|' ${PETSC_DIR}/makefile ${PETSC_DIR}/lib/petsc/conf/rules # Fix for issue with GNUMake 4.4.1 (https://gitlab.com/petsc/petsc/-/merge_requests/6140)
-
-# Configure
-# - Cannot use --with-fpic option when compiling static libs,
-#
-#		Cannot determine compiler PIC flags if shared libraries is turned off
-#		Either run using --with-shared-libraries or --with-pic=0 and supply the
-#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
-#
-# - Added -fallow-argument-mismatch option to FFLAGS in order to clear "Error: 
-#	Rank mismatch between actual argument at [...]"
-# - Added -fallow-invalid-boz option to FFLAGS in order to clear "Error: BOZ 
-#	literal constant at [...]"
-# - Argument to --with-mpi-include must be a list or it gets expanded 
-#	incorrectly
-#
-cd ${PETSC_DIR}
-./config/configure.py \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--PETSC_ARCH="${PETSC_ARCH}" \
-	--CFLAGS="-fPIC -Wl,-static -Wno-error=implicit-function-declaration" \
-	--CXXFLAGS="-fPIC -Wl,-static" \
-	--FFLAGS="-fPIC -Wl,-static -fallow-argument-mismatch -fallow-invalid-boz" \
-	--with-shared-libraries=0 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-proc-filesystem=0 \
-	--with-mpiexec="${MPIEXEC_DIR}/mpiexec.exe" \
-	--with-mpi-lib="-L${MSMPI_ROOT}/lib -lmsmpi" \
-	--with-mpi-include="${MSMPI_ROOT}/include" \
-	--download-fblaslapack=1 \
-	--download-metis=1 \
-	--download-metis-cmake-arguments="${MAKEFILE_GENERATOR}" \
-	--download-parmetis=1 \
-	--download-parmetis-cmake-arguments="${MAKEFILE_GENERATOR}" \
-	--download-scalapack=1 \
-	--download-scalapack-cmake-arguments="${MAKEFILE_GENERATOR}" \
-	--download-mumps=1
-
-# Compile and install
-make PETSC_DIR="${PETSC_DIR}" PETSC_ARCH="${PETSC_ARCH}" all
-make PETSC_DIR="${PETSC_DIR}" PETSC_ARCH="${PETSC_ARCH}" install
Index: sm/trunk/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 28275)
+++ 	(revision )
@@ -1,88 +1,0 @@
-#!/bin/bash
-set -u # NOTE: Do not set -e as it will cause this script to fail when there are errors in underlying Python scripts
-
-# NOTE:
-# - You must install various needed packages with,
-#
-#		pacman -S mingw-w64-x86_64-toolchain python
-#
-# - You must use MSYS2 MinGW 64-bit version of cmake to be able to install 
-#	external packages correctly,
-#
-#		pacman -R mingw-w64-x86_64-cmake
-#
-# Sources:
-# - https://gitlab.com/petsc/petsc/-/issues/820#note_487483240
-#
-
-## Constants
-#
-VER="3.14.6"
-
-MAKEFILE_GENERATOR='-G "MSYS Makefiles"'
-PETSC_ARCH="arch-mswin-c-opt"
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Patch source
-sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/python3|' ${PETSC_DIR}/config/configure.py
-sed -i 's|  chkusingwindowspython()|#  chkusingwindowspython()|' ${PETSC_DIR}/config/configure.py
-sed -i 's|(MAKEFLAGS)|(MAKEFLAGS:w=)|' ${PETSC_DIR}/makefile ${PETSC_DIR}/lib/petsc/conf/rules # Fix for issue with GNUMake 4.4.1 (https://gitlab.com/petsc/petsc/-/merge_requests/6140)
-
-# Configure
-# - Cannot use --with-fpic option when compiling static libs,
-#
-#		Cannot determine compiler PIC flags if shared libraries is turned off
-#		Either run using --with-shared-libraries or --with-pic=0 and supply the
-#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
-#
-# - Added -fallow-argument-mismatch option to FFLAGS in order to clear "Error: 
-#	Rank mismatch between actual argument at [...]"
-# - Added -fallow-invalid-boz option to FFLAGS in order to clear "Error: BOZ 
-#	literal constant at [...]"
-# - Argument to --with-mpi-include must be a list or it gets expanded 
-#	incorrectly
-#
-cd ${PETSC_DIR}
-./config/configure.py \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--PETSC_ARCH="${PETSC_ARCH}" \
-	--CFLAGS="-fPIC -Wno-error=implicit-function-declaration" \
-	--CXXFLAGS="-fPIC" \
-	--FFLAGS="-fPIC -fallow-argument-mismatch -fallow-invalid-boz" \
-	--with-shared-libraries=0 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-proc-filesystem=0 \
-	--with-mpiexec="${MPIEXEC_DIR}/mpiexec.exe" \
-	--with-mpi-lib="-L${MSMPI_ROOT}/lib -lmsmpi" \
-	--with-mpi-include="${MSMPI_ROOT}/include" \
-	--download-fblaslapack=1 \
-	--download-metis=1 \
-	--download-metis-cmake-arguments="${MAKEFILE_GENERATOR}" \
-	--download-parmetis=1 \
-	--download-parmetis-cmake-arguments="${MAKEFILE_GENERATOR}" \
-	--download-scalapack=1 \
-	--download-scalapack-cmake-arguments="${MAKEFILE_GENERATOR}" \
-	--download-mumps=1
-
-# Compile and install
-make PETSC_DIR="${PETSC_DIR}" PETSC_ARCH="${PETSC_ARCH}" all
-make PETSC_DIR="${PETSC_DIR}" PETSC_ARCH="${PETSC_ARCH}" install
Index: sm/trunk/externalpackages/petsc/install-3.15-babylon.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.15-babylon.sh	(revision 28275)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.15.3"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./config/configure.py \
-	--with-cc=icc --with-cxx=icpc --with-fc=ifort \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.15-discovery.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.15-discovery.sh	(revision 28275)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#!/bin/bash
-set -eu
-
-## Constants
-#
-VER="3.15.3"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./config/configure.py \
-	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-make-np=20 \
-	--with-blas-lapack-dir=$MKL_ROOT \
-	--with-mpi-dir="/optnfs/el7/mpich/3.3-intel19.3/" \
-	--known-mpi-shared-libraries=1 \
-	--known-mpi-long-double=1 \
-	--known-mpi-int64_t=1 \
-	--known-mpi-c-double-complex=1 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.15-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.15-pleiades.sh	(revision 28275)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.15.0"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables (look 
-#	for CONFIGURE_OPTIONS)
-#
-cd ${PETSC_DIR}
-./config/configure.py \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-blas-lapack-dir="/nasa/intel/Compiler/2018.3.222/compilers_and_libraries_2018.3.222/linux/mkl" \
-	--with-scalapack-include=/nasa/intel/Compiler/2018.3.222/mkl/include \
-	--with-scalapack-lib="/nasa/intel/Compiler/2018.3.222/mkl/lib/intel64/libmkl_scalapack_lp64.so /nasa/intel/Compiler/2018.3.222/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.so" \
-	--with-make-np=10 \
-	--known-mpi-shared-libraries=1 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-batch=1  \
-	--with-shared-libraries=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-mumps=1 \
-	--download-scalapack=0
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.16-linux.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.16-linux.sh	(revision 28275)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.16.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
-#	(may need to remove it for earlier versions not using the C99 standard).
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--CFLAGS="-Wno-error=implicit-function-declaration" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.16-mac.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.16-mac.sh	(revision 28275)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.16.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
-#	(may need to remove it for earlier versions not using the C99 standard).
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--CFLAGS="-Wno-error=implicit-function-declaration" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.16-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.16-pleiades.sh	(revision 28275)
+++ 	(revision )
@@ -1,55 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.16.6"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-
-# Configure
-#
-# NOTE:
-# - Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables (look 
-#	for CONFIGURE_OPTIONS)
-#
-cd ${PETSC_DIR}
-./config/configure.py \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-blas-lapack-dir="/nasa/intel/Compiler/2018.3.222/compilers_and_libraries_2018.3.222/linux/mkl" \
-	--with-scalapack-include=/nasa/intel/Compiler/2018.3.222/mkl/include \
-	--with-scalapack-lib="/nasa/intel/Compiler/2018.3.222/mkl/lib/intel64/libmkl_scalapack_lp64.so /nasa/intel/Compiler/2018.3.222/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.so" \
-	--with-make-np=10 \
-	--known-mpi-shared-libraries=1 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-batch=1  \
-	--with-shared-libraries=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-mumps=1 \
-	--download-scalapack=0
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.17-discovery.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.17-discovery.sh	(revision 28275)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#!/bin/bash
-set -eu
-
-## Constants
-#
-VER="3.17.4"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./config/configure.py \
-	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-make-np=20 \
-	--with-blas-lapack-dir=$MKL_ROOT \
-	--with-mpi-dir="/optnfs/el7/mpich/3.3-intel19.3/" \
-	--known-mpi-shared-libraries=1 \
-	--known-mpi-long-double=1 \
-	--known-mpi-int64_t=1 \
-	--known-mpi-c-double-complex=1 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.17-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.17-linux-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,57 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.17.4"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Cannot use --with-fpic option when compiling static libs,
-#
-#		Cannot determine compiler PIC flags if shared libraries is turned off
-#		Either run using --with-shared-libraries or --with-pic=0 and supply the
-#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-shared-libraries=0 \
-	--CFLAGS="-fPIC" \
-	--CXXFLAGS="-fPIC" \
-	--FFLAGS="-fPIC" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.17-linux.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.17-linux.sh	(revision 28275)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#!/bin/bash
-set -eu
-
-## Constants
-VER="3.17.4"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.17-mac-intel.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.17-mac-intel.sh	(revision 28275)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.17.4"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
-#	(may need to remove it for earlier versions not using the C99 standard).
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--CFLAGS="-Wno-error=implicit-function-declaration" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1
-
-# Compile and install
-make
-make install
-
Index: sm/trunk/externalpackages/petsc/install-3.17-mac-silicon-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.17-mac-silicon-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,57 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.17.4"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Cannot use --with-fpic option when compiling static libs,
-#
-#		Cannot determine compiler PIC flags if shared libraries is turned off
-#		Either run using --with-shared-libraries or --with-pic=0 and supply the
-#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-shared-libraries=0 \
-	--CFLAGS="-fPIC" \
-	--CXXFLAGS="-fPIC" \
-	--FFLAGS="-fPIC" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1 
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.17-mac-silicon.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.17-mac-silicon.sh	(revision 28275)
+++ 	(revision )
@@ -1,46 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.17.4"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1 
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.17-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.17-pleiades.sh	(revision 28275)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.17.4"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Options from,
-#
-# 		cat /nasa/petsc/3.14.5_toss3/lib/petsc/conf/petscvariables | grep CONF
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-blas-lapack-dir="/nasa/intel/Compiler/2018.3.222/compilers_and_libraries_2018.3.222/linux/mkl" \
-	--with-scalapack-include="/nasa/intel/Compiler/2018.3.222/mkl/include" \
-	--with-scalapack-lib="/nasa/intel/Compiler/2018.3.222/mkl/lib/intel64/libmkl_scalapack_lp64.so /nasa/intel/Compiler/2018.3.222/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.so" \
-	--CFLAGS="-g -O3" \
-	--CXXFLAGS="-g -O3" \
-	--FFLAGS="-g -O3" \
-	--with-make-np=10 \
-	--with-batch=1 \
-	--with-pic=1 \
-	--with-shared-libraries=1 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--download-make=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-mumps=1 
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.19-discovery.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.19-discovery.sh	(revision 28275)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#!/bin/bash
-set -eu
-
-## Constants
-#
-VER="3.19.1"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-cd ${PETSC_DIR}
-./config/configure.py \
-	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--with-make-np=20 \
-	--with-blas-lapack-dir=$MKL_ROOT \
-	--with-mpi-dir="/optnfs/el7/mpich/3.3-intel19.3/" \
-	--known-mpi-shared-libraries=1 \
-	--known-mpi-long-double=1 \
-	--known-mpi-int64_t=1 \
-	--known-mpi-c-double-complex=1 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1
-
-# Compile and install
-make
-make install
Index: sm/trunk/externalpackages/petsc/install-3.19-mac-intel.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.19-mac-intel.sh	(revision 28275)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.19.5"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
-#	(may need to remove it for earlier versions not using the C99 standard).
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--CFLAGS="-Wno-error=implicit-function-declaration" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--with-pic=1 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-cmake=1 \
-	--download-zlib=1
-
-# Compile and install
-make
-make install
-
Index: sm/trunk/externalpackages/petsc/install-3.20-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.20-pleiades.sh	(revision 28275)
+++ 	(revision )
@@ -1,56 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-VER="3.20.1"
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
-PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir -p ${PETSC_DIR}
-
-# Move source to $PETSC_DIR
-mv petsc-${VER}/* ${PETSC_DIR}
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE:
-# - Options from,
-#
-# 		cat /nasa/petsc/3.14.5_toss3/lib/petsc/conf/petscvariables | grep CONF
-#
-cd ${PETSC_DIR}
-./configure \
-	--prefix="${PREFIX}" \
-	--PETSC_DIR="${PETSC_DIR}" \
-	--CFLAGS="-g -O3" \
-	--CXXFLAGS="-g -O3" \
-	--FFLAGS="-g -O3" \
-	--with-make-np=10 \
-	--with-batch=1 \
-	--with-pic=1 \
-	--with-shared-libraries=1 \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--download-fblaslapack=1 \
-	--download-scalapack=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-mumps=1 
-
-# Compile and install
-make
-make install
Index: /issm/trunk/externalpackages/petsc/install.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/petsc/install.sh	(revision 1)
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of petsc
+version=`echo *.tar.gz | sed 's/\.tar\.gz//g' | sed 's/petsc-//g'`
+
+#Some cleanup
+rm -rf install petsc-$version
+
+#Create install directories
+mkdir install
+
+#Untar 
+tar -zxvf  petsc-$version.tar.gz
+
+#Move petsc to install directory
+rm -rf install/*
+mv petsc-$version/* install/
+rm -rf petsc-$version
+
+#Configure petsc
+cd install
+./config/configure.py  --prefix="$ISSM_DIR/packages/petsc/install" --with-mpi-dir=$ISSM_DIR/packages/mpich2/install --PETSC_ARCH=linux-gnu-amd64 --PETSC_DIR="$ISSM_DIR/packages/petsc/install" --with-fc=gfortran --with-debugging=0 --with-shared=1 --download-mumps=yes --download-scalapack=yes --download-blacs=yes --download-blas=yes --download-f-blas-lapack=yes --FFLAGS=-I$ISSM_DIR/packages/mpich2/install/include --download-plapack=yes
+
+#Compile petsc
+make  -j $NUMCPUS
+
+#Install
+make install
Index: /issm/trunk/externalpackages/qhull/install.sh
===================================================================
--- /issm/trunk/externalpackages/qhull/install.sh	(revision 28275)
+++ /issm/trunk/externalpackages/qhull/install.sh	(revision 1)
@@ -1,23 +1,32 @@
 #!/bin/bash
-set -eu
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of qhull
+version=`echo *.tar.gz | sed 's/\.tar\.gz//g' | sed 's/qhull-//g'`
 
 #Some cleanup
-rm -rf src install qhull-2003.1
+rm -rf src install qhull-$version
+
+#Create src and install directories
 mkdir src install
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/qhull-2003.1.tar.gz' 'qhull-2003.1.tar.gz'
-
 #Untar 
-tar -zxvf  qhull-2003.1.tar.gz
+tar -zxvf  qhull-$version.tar.gz
 
 #Move qhull to src directory
 rm -rf src/*
-mv qhull-2003.1/* src/
-rm -rf qhull-2003.1
+mv qhull-$version/* src/
+rm -rf qhull-$version
 
 #Configure qhull
 cd src
-./configure --prefix="$ISSM_DIR/externalpackages/qhull/install"
-make
-make install
+
+./configure --prefix="$ISSM_DIR/packages/qhull/install"
+
+#Compile qhull
+make  -j $NUMCPUS
+
+#Install qhull
+make  install
Index: /issm/trunk/externalpackages/slepc/install.sh
===================================================================
--- /issm/trunk/externalpackages/slepc/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/slepc/install.sh	(revision 1)
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of slepc
+version=`echo *.tgz | sed 's/\.tgz//g' | sed 's/slepc-//g'`
+
+#Some cleanup
+rm -rf install slepc-$version
+
+#Create install directories
+mkdir install
+
+#Untar 
+tar -zxvf  slepc-$version.tgz
+
+#Move slepc to install directory
+mv slepc-$version/* install/
+rm -rf slepc-$version
+
+#Make slepc
+cd install
+./config/configure.py
+make  -j $NUMCPUS
Index: /issm/trunk/externalpackages/sowing/install.sh
===================================================================
--- /issm/trunk/externalpackages/sowing/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/sowing/install.sh	(revision 1)
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+version=1.1.12
+
+#Some cleanup
+rm -rf src
+rm -rf install
+rm -rf sowing-$version
+
+#Create src and install directories
+mkdir src install
+
+#Untar 
+tar -zxvf  sowing.tar.gz
+
+#Move sowing into src directory
+mv sowing-$version/* src
+rm -rf sowing-$version
+
+#Configure sowing
+cd src && ./configure --prefix "$ISSM_DIR/packages/sowing/install"
+
+#Compile sowing
+make  -j $NUMCPUS
+
+#Install sowing
+make  install
Index: /issm/trunk/externalpackages/suitesparse/SuiteSparse_install.patch
===================================================================
--- /issm/trunk/externalpackages/suitesparse/SuiteSparse_install.patch	(revision 1)
+++ /issm/trunk/externalpackages/suitesparse/SuiteSparse_install.patch	(revision 1)
@@ -0,0 +1,375 @@
+1,2c1,4
+< function SuiteSparse_install (do_demo)
+< %SuiteSparse_install: compiles and installs all of SuiteSparse
+---
+> function SuiteSparse_install_ice (do_demo)
+> %SuiteSparse_install_ice: adaptation of SuiteSparse_install to the ICE code. 
+> %                         we only install CHOLMOD, and don't do the demo.
+> % compiles and installs all of SuiteSparse
+26d27
+< % SuiteSparseQR  sparse QR factorization
+42c43
+< %      SuiteSparse, SPQR, PATHTOOL, PATH.
+---
+> %      SuiteSparse, PATHTOOL, PATH.
+44c45
+< % Copyright 1990-2008, Timothy A. Davis.
+---
+> % Copyright 1990-2007, Timothy A. Davis.
+65,66c66,67
+<     fprintf ('SPQR, CHOLMOD, and KLU optionally use METIS 4.0.1.  Download\n') ;
+<     fprintf ('it from http://glaros.dtc.umn.edu/gkhome/views/metis\n');
+---
+>     fprintf ('CHOLMOD and KLU optionally use METIS 4.0.1.  Download it\n') ;
+>     fprintf ('from http://glaros.dtc.umn.edu/gkhome/views/metis\n');
+68d68
+<     input ('or hit enter to continue without METIS: ', 's') ;
+82,93c82,93
+< try
+<     cd ([SuiteSparse '/UMFPACK/MATLAB']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     umfpack_make
+< catch                                                                       %#ok
+<     try
+< 	fprintf ('Trying to install with lcc_lib/libmwlapack.lib instead\n') ;
+< 	umfpack_make ('lcc_lib/libmwlapack.lib') ;
+<     catch                                                                   %#ok
+< 	fprintf ('UMFPACK not installed\n') ;
+<     end
+< end
+---
+> %try
+> %    cd ([SuiteSparse '/UMFPACK/MATLAB']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    umfpack_make
+> %catch
+> %    try
+> %	fprintf ('Trying to install with lcc_lib/libmwlapack.lib instead\n') ;
+> %	umfpack_make ('lcc_lib/libmwlapack.lib') ;
+> %    catch
+> %	fprintf ('UMFPACK not installed\n') ;
+> %    end
+> %end
+105c105
+< catch                                                                       %#ok
+---
+> catch
+109,267c109,242
+< % compile and install AMD
+< try
+<     cd ([SuiteSparse '/AMD/MATLAB']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     amd_make
+< catch                                                                       %#ok
+<     fprintf ('AMD not installed\n') ;
+< end
+< 
+< % compile and install COLAMD
+< try
+<     cd ([SuiteSparse '/COLAMD/MATLAB']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     colamd_make
+< catch                                                                       %#ok
+<     fprintf ('COLAMD not installed\n') ;
+< end
+< 
+< % compile and install CCOLAMD
+< try
+<     cd ([SuiteSparse '/CCOLAMD/MATLAB']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     ccolamd_make
+< catch                                                                       %#ok
+<     fprintf ('CCOLAMD not installed\n') ;
+< end
+< 
+< % compile and install CAMD
+< try
+<     cd ([SuiteSparse '/CAMD/MATLAB']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     camd_make
+< catch                                                                       %#ok
+<     fprintf ('CAMD not installed\n') ;
+< end
+< 
+< % compile and install CXSparse and UFget
+< try
+<     cd ([SuiteSparse '/CXSparse/MATLAB/CSparse']) ;
+<     paths = add_to_path (paths, [SuiteSparse '/CXSparse/MATLAB/CSparse']) ;
+<     paths = add_to_path (paths, [SuiteSparse '/CXSparse/MATLAB/Demo']) ;
+<     if (v >= 7.0)
+< 	paths = add_to_path (paths, [SuiteSparse '/CXSparse/MATLAB/UFget']) ;
+< 	fprintf ('UFget installed successfully\n') ;
+<     else
+< 	fprintf ('UFget skipped; requires MATLAB 7.0 or later\n') ;
+<     end
+<     if (pc)
+< 	% Windows does not support ANSI C99 complex, which CXSparse requires
+< 	fprintf ('Compiling CXSparse without complex support\n') ;
+< 	cs_make (1, 0) ;
+<     else
+< 	cs_make (1) ;
+<     end
+< catch                                                                       %#ok
+<     fprintf ('CXSparse not installed\n') ;
+< end
+< 
+< % compile and install LDL
+< try
+<     cd ([SuiteSparse '/LDL/MATLAB']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     ldl_make
+< catch                                                                       %#ok
+<     fprintf ('LDL not installed\n') ;
+< end
+< 
+< % compile and install BTF
+< try
+<     cd ([SuiteSparse '/BTF/MATLAB']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     btf_make
+< catch                                                                       %#ok
+<     fprintf ('BTF not installed\n') ;
+< end
+< 
+< % compile and install KLU
+< try
+<     cd ([SuiteSparse '/KLU/MATLAB']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     klu_make (have_metis) ;
+< catch                                                                       %#ok
+<     fprintf ('KLU not installed\n') ;
+< end
+< 
+< % compile and install SSMULT
+< try
+<     cd ([SuiteSparse '/SSMULT']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     ssmult_make ;
+< catch                                                                       %#ok
+<     fprintf ('SSMULT not installed\n') ;
+< end
+< 
+< % compile and install UFcollection
+< try
+<     % do not try to compile with large-file I/O for MATLAB 6.5 or earlier
+<     cd ([SuiteSparse '/UFcollection']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     UFcollection_install (v < 7.0) ;
+< catch                                                                       %#ok
+<     fprintf ('UFcollection not installed\n') ;
+< end
+< 
+< % install LINFACTOR, MESHND, MATLAB_Tools/*
+< try
+<     cd ([SuiteSparse '/MESHND']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     if (v > 7.2)
+<         % LINFACTOR requires MATLAB 7.3 or later
+<         cd ([SuiteSparse '/LINFACTOR']) ;
+<         paths = add_to_path (paths, pwd) ;
+<         fprintf ('LINFACTOR installed\n') ;
+<     end
+<     cd ([SuiteSparse '/MATLAB_Tools/find_components']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     cd ([SuiteSparse '/MATLAB_Tools/GEE']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     cd ([SuiteSparse '/MATLAB_Tools/shellgui']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     cd ([SuiteSparse '/MATLAB_Tools/waitmex']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     cd ([SuiteSparse '/MATLAB_Tools/spok']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     mex spok.c spok_mex.c
+<     fprintf ('LINFACTOR, MESHND, MATLAB_Tools installed\n') ;
+< catch                                                                       %#ok
+<     fprintf ('LINFACTOR, MESHND, and/or MATLAB_Tools not installed\n') ;
+< end
+< 
+< % compile and install SuiteSparseQR
+< try
+<     if (pc)
+<         fprintf ('Note that SuiteSparseQR will not compile with the lcc\n') ;
+<         fprintf ('compiler provided with MATLAB on Windows\n') ;
+<     end
+<     cd ([SuiteSparse '/SPQR/MATLAB']) ;
+<     paths = add_to_path (paths, pwd) ;
+<     if (have_metis)
+<        spqr_make
+<     else
+<        spqr_make ('no metis') ;
+<     end
+< catch                                                                       %#ok
+<     disp (lasterr) ;                                                        %#ok
+<     fprintf ('SuiteSparseQR not installed\n') ;
+< end
+< 
+< % compile and install RBio (not on Windows ... no default Fortran compiler)
+< if (~pc)
+<     try
+< 	cd ([SuiteSparse '/RBio']) ;
+< 	RBmake
+< 	paths = add_to_path (paths, pwd) ;
+<     catch                                                                   %#ok
+< 	disp (lasterr) ;                                                    %#ok
+< 	fprintf ('RBio not installed (Fortran compiler required).\n') ;
+<     end
+< end
+---
+> %% compile and install AMD
+> %try
+> %    cd ([SuiteSparse '/AMD/MATLAB']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    amd_make
+> %catch
+> %    fprintf ('AMD not installed\n') ;
+> %end
+> %
+> %% compile and install COLAMD
+> %try
+> %    cd ([SuiteSparse '/COLAMD/MATLAB']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    colamd_make
+> %catch
+> %    fprintf ('COLAMD not installed\n') ;
+> %end
+> %
+> %% compile and install CCOLAMD
+> %try
+> %    cd ([SuiteSparse '/CCOLAMD/MATLAB']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    ccolamd_make
+> %catch
+> %    fprintf ('CCOLAMD not installed\n') ;
+> %end
+> %
+> %% compile and install CAMD
+> %try
+> %    cd ([SuiteSparse '/CAMD/MATLAB']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    camd_make
+> %catch
+> %    fprintf ('CAMD not installed\n') ;
+> %end
+> %
+> %% compile and install CXSparse and UFget
+> %try
+> %    cd ([SuiteSparse '/CXSparse/MATLAB/CSparse']) ;
+> %    paths = add_to_path (paths, [SuiteSparse '/CXSparse/MATLAB/CSparse']) ;
+> %    paths = add_to_path (paths, [SuiteSparse '/CXSparse/MATLAB/Demo']) ;
+> %    if (v >= 7.0)
+> %	paths = add_to_path (paths, [SuiteSparse '/CXSparse/MATLAB/UFget']) ;
+> %	fprintf ('UFget installed successfully\n') ;
+> %    else
+> %	fprintf ('UFget skipped; requires MATLAB 7.0 or later\n') ;
+> %    end
+> %    if (pc)
+> %	% Windows does not support ANSI C99 complex, which CXSparse requires
+> %	fprintf ('Compiling CXSparse without complex support\n') ;
+> %	cs_make (1, 0) ;
+> %    else
+> %	cs_make (1) ;
+> %    end
+> %catch
+> %    fprintf ('CXSparse not installed\n') ;
+> %end
+> %
+> %% compile and install LDL
+> %try
+> %    cd ([SuiteSparse '/LDL/MATLAB']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    ldl_make
+> %catch
+> %    fprintf ('LDL not installed\n') ;
+> %end
+> %
+> %% compile and install BTF
+> %try
+> %    cd ([SuiteSparse '/BTF/MATLAB']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    btf_make
+> %catch
+> %    fprintf ('BTF not installed\n') ;
+> %end
+> %
+> %% compile and install KLU
+> %try
+> %    cd ([SuiteSparse '/KLU/MATLAB']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    klu_make (have_metis) ;
+> %catch
+> %    fprintf ('KLU not installed\n') ;
+> %end
+> %
+> %% compile and install SSMULT
+> %try
+> %    cd ([SuiteSparse '/SSMULT']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    ssmult_install (0) ;
+> %catch
+> %    fprintf ('SSMULT not installed\n') ;
+> %end
+> %
+> %% compile and install UFcollection
+> %try
+> %    % do not try to compile with large-file I/O for MATLAB 6.5 or earlier
+> %    cd ([SuiteSparse '/UFcollection']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    UFcollection_install (v < 7.0) ;
+> %catch
+> %    fprintf ('UFcollection not installed\n') ;
+> %end
+> %
+> %% install LINFACTOR, MESHND, MATLAB_Tools/*
+> %try
+> %    cd ([SuiteSparse '/MESHND']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    if (v > 7.2)
+> %        % LINFACTOR requires MATLAB 7.3 or later
+> %        cd ([SuiteSparse '/LINFACTOR']) ;
+> %        paths = add_to_path (paths, pwd) ;
+> %        fprintf ('LINFACTOR installed\n') ;
+> %    end
+> %    cd ([SuiteSparse '/MATLAB_Tools/shellgui']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    cd ([SuiteSparse '/MATLAB_Tools/waitmex']) ;
+> %    paths = add_to_path (paths, pwd) ;
+> %    fprintf ('MESHND, MATLAB_Tools installed\n') ;
+> %catch
+> %    fprintf ('LINFACTOR, MESHND, or MATLAB_Tools not installed\n') ;
+> %end
+> %
+> %% compile and install RBio (not on Windows ... no default Fortran compiler)
+> %if (~pc)
+> %    try
+> %	cd ([SuiteSparse '/RBio']) ;
+> %	RBmake
+> %	paths = add_to_path (paths, pwd) ;
+> %    catch
+> %	disp (lasterr)
+> %	fprintf ('RBio not installed (Fortran compiler required).\n') ;
+> %    end
+> %end
+274,281c249,258
+< if (nargin < 1)
+<     % ask if demo should be run
+<     y = input ('Hit enter to run the SuiteSparse demo (or "n" to quit): ', 's') ;
+<     if (isempty (y))
+<         y = 'y' ;
+<     end
+<     do_demo = (y (1) ~= 'n') ;
+< end
+---
+> %if (nargin < 1)
+> %    % ask if demo should be run
+> %    y = input ('Hit enter to run the SuiteSparse demo (or "n" to quit): ', 's') ;
+> %    if (isempty (y))
+> %        y = 'y' ;
+> %    end
+> %    do_demo = (y (1) ~= 'n') ;
+> %end
+> 
+> do_demo=0; %we never run the demo in this adaptation to the ICE code.
+285c262
+<     catch                                                                   %#ok
+---
+>     catch
Index: /issm/trunk/externalpackages/suitesparse/install.sh
===================================================================
--- /issm/trunk/externalpackages/suitesparse/install.sh	(revision 1)
+++ /issm/trunk/externalpackages/suitesparse/install.sh	(revision 1)
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of SuiteSparse
+version=`echo *.tar.gz | sed 's/\.tar\.gz//g' | sed 's/SuiteSparse-//g'`
+
+#Some cleanup
+rm -rf install SuiteSparse-$version
+
+#Create install directories
+mkdir install
+
+#Untar 
+tar -zxvf  SuiteSparse-$version.tar.gz
+
+#Move SuiteSparse into install directory
+mv SuiteSparse/* install
+rm -rf SuiteSparse
+
+#Apply patch 
+cd install 
+cp SuiteSparse_install.m SuiteSparse_install_ice.m
+patch SuiteSparse_install_ice.m ../SuiteSparse_install.patch
+
+#Symlink metis-4.0 to where it is.
+ln -s ../../metis/install/   metis-4.0
+
+#Now compile using matlab
+matlab << EOF
+SuiteSparse_install_ice
+EOF
Index: sm/trunk/externalpackages/triangle/install-altix64.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-altix64.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup 
-rm -rf install triangle
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
-
-#Untar 
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
-
-#copy new makefile
-cp ../configs/altix64/configure.make ./
-cp ../makefile ./
-
-#Compile triangle
-make
-
-#Patch triangle.h
-patch triangle.h ../triangle.h.patch
Index: sm/trunk/externalpackages/triangle/install-android.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-android.sh	(revision 28275)
+++ 	(revision )
@@ -1,26 +1,0 @@
-#!/bin/bash
-set -eu
-
-source $ANDROID_DIR/android_aux.sh
-
-#Some cleanup 
-rm -rf install triangle
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
-
-#Untar 
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
-
-#copy new makefile
-cp ../configs/android/configure.make ./
-cp ../makefile ./
-
-#Compile triangle
-make
-
-#Patch triangle.h
-patch triangle.h ../triangle.h.patch
Index: sm/trunk/externalpackages/triangle/install-discover.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-discover.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/linux/configure.make src
-
-# Compile
-cd src
-make shared
-
-# Install
-cd ..
-cp src/libtriangle.* ${PREFIX}/lib
-cp src/triangle.h ${PREFIX}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-iosarmv7.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-iosarmv7.sh	(revision 28275)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#!/bin/bash
-set -eu
-
-host_triplet="armv7-apple-darwin14.0.0"
-
-#cleanup
-rm -rf install triangle
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
-
-#untar
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
-rm triangle.zip
-
-#copy new makefile
-cp ../configs/ios/configure.make ./
-cp ../makefile ./
-
-#compile triangle
-make
-
-#patch triangle.h
-patch triangle.h ../triangle.h.patch
Index: sm/trunk/externalpackages/triangle/install-iosarmv7s.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-iosarmv7s.sh	(revision 28275)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#!/bin/bash
-set -eu
-
-host_triplet="armv7s-apple-darwin14.0.0"
-
-#cleanup
-rm -rf install triangle
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
-
-#untar
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
-rm triangle.zip
-
-#copy new makefile
-cp ../configs/ios/configure.make ./
-cp ../makefile ./
-
-#compile triangle
-make
-
-#patch triangle.h
-patch triangle.h ../triangle.h.patch
Index: sm/trunk/externalpackages/triangle/install-iosi386.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-iosi386.sh	(revision 28275)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#!/bin/bash
-set -eu
-
-host_triplet="i386-apple-darwin13.1.0"
-
-#cleanup
-rm -rf install triangle
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
-
-#untar
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
-rm triangle.zip
-
-#copy new makefile
-cp ../configs/ios/configure.make ./
-cp ../makefile ./
-
-#compile triangle
-make
-
-#patch triangle.h
-patch triangle.h ../triangle.h.patch
Index: sm/trunk/externalpackages/triangle/install-linux-javascript.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-linux-javascript.sh	(revision 28275)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
-
-# Environment
-#
-export CC=emcc
-export CXX=em++
-export AR=emar
-export RANLIB=emranlib
-#export EMCC_DEBUG=1 # Uncomment to enable debugging
-
-# Source Emscripten environment
-source ${EMSCRIPTEN_ROOT}/emsdk_env.sh
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/share src
-
-# Download source
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/javascript/configure.make src
-cp configs/javascript/triangle.h src
-
-# Compile
-cd src
-make objects
-
-# Install
-cd ..
-cp src/triangle.o ${PREFIX}/share
-cp src/triangle.h ${PREFIX}/include
Index: sm/trunk/externalpackages/triangle/install-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-linux-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/linux/configure.make src
-
-# Compile
-cd src
-make static
-
-# Install
-cd ..
-cp src/libtriangle.* ${PREFIX}/lib
-cp src/triangle.h ${PREFIX}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-linux.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-linux.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/linux/configure.make src
-
-# Compile
-cd src
-make shared
-
-# Install
-cd ..
-cp src/libtriangle.* ${PREFIX}/lib
-cp src/triangle.h ${PREFIX}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-mac-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/mac/configure.make src
-
-# Compile
-cd src
-make static
-
-# Install
-cd ..
-cp src/libtriangle.* ${PREFIX}/lib
-cp src/triangle.h ${PREFIX}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-mac.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-mac.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/mac/configure.make src
-
-# Compile
-cd src
-make shared
-
-# Install
-cd ..
-cp src/libtriangle.* ${PREFIX}/lib
-cp src/triangle.h ${PREFIX}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-pleiades.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-INSTALL_DIR="install"
-
-# Cleanup
-rm -rf ${INSTALL_DIR} src
-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/linux/configure.make src
-
-# Compile
-cd src
-make shared
-
-# Install
-cd ..
-cp src/libtriangle.* ${INSTALL_DIR}/lib
-cp src/triangle.h ${INSTALL_DIR}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-win-msys2-gcc.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-win-msys2-gcc.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/win/msys2/gcc/configure.make src
-
-# Compile
-cd src
-make shared
-
-# Install
-cd ..
-cp src/libtriangle.* ${PREFIX}/lib
-cp src/triangle.h ${PREFIX}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-win-msys2-mingw-static.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-win-msys2-mingw-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/win/msys2/mingw64/configure.make src
-
-# Compile
-cd src
-make static
-
-# Install
-cd ..
-cp src/libtriangle.* ${PREFIX}/lib
-cp src/triangle.h ${PREFIX}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-win-msys2-mingw.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-win-msys2-mingw.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
-
-# Cleanup
-rm -rf ${PREFIX} src
-mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/win/msys2/mingw64/configure.make src
-
-# Compile
-cd src
-make shared
-
-# Install
-cd ..
-cp src/libtriangle.* ${PREFIX}/lib
-cp src/triangle.h ${PREFIX}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-win10.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-win10.sh	(revision 28275)
+++ 	(revision )
@@ -1,25 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup 
-rm -rf install triangle
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
-
-#Untar 
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
-
-#copy new makefile
-cp ../configs/win7/configure.make ./
-cp ../configs/win7/makefile ./
-
-#Compile triangle
-make
-
-#Patch triangle.h
-patch triangle.h ../triangle.h.patch
-cat triangle.h
Index: sm/trunk/externalpackages/triangle/install-win32.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-win32.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup 
-rm -rf install triangle
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
-
-#Untar 
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
-
-#copy new makefile
-cp ../configs/win32/configure.make ./
-cp ../makefile ./
-
-#Compile triangle
-make
-
-#Patch triangle.h
-patch triangle.h ../triangle.h.patch
Index: sm/trunk/externalpackages/triangle/install-windows-static.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-windows-static.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-INSTALL_DIR="install"
-
-# Cleanup
-rm -rf ${INSTALL_DIR} src
-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/windows/configure.make src
-
-# Compile
-cd src
-make static
-
-# Install
-cd ..
-cp src/libtriangle.* ${INSTALL_DIR}/lib
-cp src/triangle.h ${INSTALL_DIR}/include
-
-# Cleanup
-rm -rf src
Index: sm/trunk/externalpackages/triangle/install-windows.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-windows.sh	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-INSTALL_DIR="install"
-
-# Cleanup
-rm -rf ${INSTALL_DIR} src
-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
-
-# Unpack source
-unzip triangle.zip -d src
-
-# Copy customized source files to 'src' directory
-cp configs/makefile src
-cp configs/triangle.h src
-cp configs/windows/configure.make src
-
-# Compile
-cd src
-make shared
-
-# Install
-cd ..
-cp src/libtriangle.* ${INSTALL_DIR}/lib
-cp src/triangle.h ${INSTALL_DIR}/include
-
-# Cleanup
-rm -rf src
Index: /issm/trunk/externalpackages/triangle/install.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install.sh	(revision 28275)
+++ /issm/trunk/externalpackages/triangle/install.sh	(revision 1)
@@ -1,32 +1,31 @@
 #!/bin/bash
-set -eu
+
+#Get number of cpus on current platform
+NUMCPUS=`grep -c processor /proc/cpuinfo`;
+
+#version of triangle
+name=`echo *.zip | sed 's/\.zip//g'`
 
 #Some cleanup 
-rm -rf install src triangle
-mkdir install src ./src/m4
+rm -rf install $name
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
+#Create install directories
+mkdir install
 
 #Untar 
-cd src
-mkdir src
-cp ../triangle.zip ./
-unzip triangle.zip
+cd install
+cp ../$name.zip ./
+unzip $name.zip
 
-rm ./makefile
-mv ./*.c ./src
-mv ./*.h ./src
+#copy new makefile
+cp ../makefile ./
 
-cp ./../configs/libtool/configure.ac ./
-cp ./../configs/libtool/Makefile.am ./
-cp ./../configs/libtool/src/Makefile.am ./src/
+#Patch triangle.c 
+patch triangle.c ../triangle.c.patch
 
-autoreconf -ivf
-./configure --prefix="${HOME}/externalpackages/triangle/install" --disable-executables
-
-make 
-make install
+#Compile triangle
+make  -j $NUMCPUS
 
 #Patch triangle.h
-patch ${HOME}/externalpackages/triangle/install/include/triangle.h ${HOME}/externalpackages/triangle/triangle.h.patch
+patch triangle.h ../triangle.h.patch
+
Index: /issm/trunk/externalpackages/triangle/makefile
===================================================================
--- /issm/trunk/externalpackages/triangle/makefile	(revision 28275)
+++ /issm/trunk/externalpackages/triangle/makefile	(revision 1)
@@ -1,46 +1,20 @@
-include ./configure.make
+#Adaptation of Triangle makefile to compile only the triangle.c file, 
+#into a standalone library that can then be used to compile mex modules
 
-ifeq "$(origin CC)" "undefined"
-	CC = cc
-endif
+AR = ar
+CSWITCHES = $(CFLAGS)  -I/usr/X11R6/include -L/usr/X11R6/lib -I$(MATLAB_DIR)/extern/include -fPIC -I$(MATLAB_DIR)/include
+TRILIBDEFS = -DTRILIBRARY
 
-ifeq "$(origin AR)" "undefined"
-	AR = ar
-endif
+all: triangle.a
 
-ifeq "$(origin RANLIB)" "undefined"
-	RANLIB = ranlib
-endif
+OBJECTS=triangle.o
 
-SOURCES=triangle.c triangle.h
-OBJECTS=triangle.$(OBJ_EXT)
+triangle.a: $(OBJECTS)
+	ar cr  triangle.a $(OBJECTS)
+	ranlib triangle.a
 
-all: libtriangle.$(STATIC_LIB_EXT) libtriangle.$(SHARED_LIB_EXT)
-
-objects: $(OBJECTS)
-
-shared: libtriangle.$(SHARED_LIB_EXT)
-
-static: libtriangle.$(STATIC_LIB_EXT)
-
-triangle.$(OBJ_EXT): $(SOURCES)
+triangle.o: triangle.c triangle.h
 	$(CC) $(CSWITCHES) $(TRILIBDEFS) -c triangle.c
 
-libtriangle.a: $(OBJECTS)
-	$(AR) cr $@ $(OBJECTS)
-	$(RANLIB) $@
-
-libtriangle.dll: $(SOURCES)
-	$(CC) $(CSWITCHES) $(TRILIBDEFS) -shared -o $@ triangle.c
-
-libtriangle.dylib: $(OBJECTS)
-	$(CC) $(CSWITCHES) $(TRILIBDEFS) -dynamiclib -install_name ${PREFIX}/lib/$@ -o $@ triangle.c
-
-libtriangle.lib: $(OBJECTS)
-	lib -out:libtriangle.$(STATIC_LIB_EXT) $(OBJECTS)
-
-libtriangle.so: $(SOURCES)
-	$(CC) $(CSWITCHES) $(TRILIBDEFS) -shared -o $@ triangle.c
-
-clean:
-	rm -rf *.$(LIB_EXT) *.$(OBJ_EXT) *.LIB *.LST *.$(OBJ_EXT)bj *.BAK
+clean: 
+	rm -rf *.a *.o *.LIB *.LST *.obj *.BAK
Index: /issm/trunk/externalpackages/triangle/triangle.c.patch
===================================================================
--- /issm/trunk/externalpackages/triangle/triangle.c.patch	(revision 1)
+++ /issm/trunk/externalpackages/triangle/triangle.c.patch	(revision 1)
@@ -0,0 +1,164 @@
+0a1,10
+> /*Notes for the Ice code: 
+>  * to be able to compile Triangle within a mex function that can run within 
+>  * matlab, we had to change the allocation routine trimalloc, as well as the 
+>  * double precision activation in exactinit(); The rest is not changed. 
+>  * We also created the ice_makefile to compile Triangle into a library. */
+> #include <mat.h>
+> #include <matrix.h>
+> #define ANSI_DECLARATORS
+> #define NO_TIMER
+> 
+347a358
+> #ifndef _WIN_
+348a360
+> #endif
+641d652
+< 
+817a829,922
+> /*Some missing prototypes: */
+> int scale_expansion_zeroelim(int elen, REAL *e, REAL b, REAL *h);
+> int fast_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, REAL *h);
+> void poolzero(struct memorypool *pool);
+> int triunsuitable(vertex triorg, vertex tridest, vertex triapex, REAL area);
+> triangle *triangletraverse(struct mesh *m);
+> void pooldeinit(struct memorypool *pool);
+> void printtriangle(struct mesh *m, struct behavior *b, struct otri *t);
+> VOID *poolalloc(struct memorypool *pool);
+> void enqueuebadtriang(struct mesh *m, struct behavior *b,
+>                       struct badtriang *badtri);
+> void triangulatepolygon(struct mesh *m, struct behavior *b,
+>                         struct otri *firstedge, struct otri *lastedge,
+>                         int edgecount, int doflip, int triflaws);
+> void triangledealloc(struct mesh *m, triangle *dyingtriangle);
+> void unflip(struct mesh *m, struct behavior *b, struct otri *flipedge);
+> void vertexmedian(vertex *sortarray, int arraysize, int median, int axis);
+> REAL counterclockwiseadapt(vertex pa, vertex pb, vertex pc, REAL detsum);
+> REAL incircleadapt(vertex pa, vertex pb, vertex pc, vertex pd, REAL permanent);
+> void enqueuebadtri(struct mesh *m, struct behavior *b, struct otri *enqtri,
+>                    REAL minedge, vertex enqapex, vertex enqorg, vertex enqdest);
+> void alternateaxes(vertex *sortarray, int arraysize, int axis);
+> REAL incircleadapt(vertex pa, vertex pb, vertex pc, vertex pd, REAL permanent);
+> void maketriangle(struct mesh *m, struct behavior *b, struct otri *newotri);
+> REAL counterclockwise(struct mesh *m, struct behavior *b,
+>                       vertex pa, vertex pb, vertex pc);
+> vertex vertextraverse(struct mesh *m);
+> void mergehulls(struct mesh *m, struct behavior *b, struct otri *farleft,
+>                 struct otri *innerleft, struct otri *innerright,
+>                 struct otri *farright, int axis);
+> REAL incircle(struct mesh *m, struct behavior *b,
+>               vertex pa, vertex pb, vertex pc, vertex pd);
+> void poolrestart(struct memorypool *pool);
+> void trifree(VOID *memptr);
+> struct splaynode *splay(struct mesh *m, struct splaynode *splaytree,
+>                         vertex searchpoint, struct otri *searchtri);
+> void eventheapdelete(struct event **heap, int heapsize, int eventnum);
+> void eventheapdelete(struct event **heap, int heapsize, int eventnum);
+> void flip(struct mesh *m, struct behavior *b, struct otri *flipedge);
+> void check4deadevent(struct otri *checktri, struct event **freeevents,
+>                      struct event **eventheap, int *heapsize);
+> REAL orient3d(struct mesh *m, struct behavior *b,
+>               vertex pa, vertex pb, vertex pc, vertex pd,
+>               REAL aheight, REAL bheight, REAL cheight, REAL dheight);
+> REAL circletop(struct mesh *m, vertex pa, vertex pb, vertex pc, REAL ccwabc);
+> void poolinit(struct memorypool *pool, int bytecount, int itemcount,
+>               int firstitemcount, int alignment);
+> void eventheapinsert(struct event **heap, int heapsize, struct event *newevent);
+> int rightofhyperbola(struct mesh *m, struct otri *fronttri, vertex newsite);
+> void insertsubseg(struct mesh *m, struct behavior *b, struct otri *tri,
+>                   int subsegmark);
+> int scoutsegment(struct mesh *m, struct behavior *b, struct otri *searchtri,
+>                  vertex endpoint2, int newmark);
+> vertex getvertex(struct mesh *m, struct behavior *b, int number);
+> void internalerror();
+> unsigned long randomnation(unsigned int choices);
+> struct splaynode *splayinsert(struct mesh *m, struct splaynode *splayroot,
+>                               struct otri *newkey, vertex searchpoint);
+> void delaunayfixup(struct mesh *m, struct behavior *b,
+>                    struct otri *fixuptri, int leftside);
+> void traversalinit(struct memorypool *pool);
+> enum insertvertexresult insertvertex(struct mesh *m, struct behavior *b,
+>                                      vertex newvertex, struct otri *searchtri,
+>                                      struct osub *splitseg,
+>                                      int segmentflaws, int triflaws);
+> void conformingedge(struct mesh *m, struct behavior *b,
+>                     vertex endpoint1, vertex endpoint2, int newmark);
+> enum finddirectionresult finddirection(struct mesh *m, struct behavior *b,
+>                                        struct otri *searchtri,
+>                                        vertex searchpoint);
+> VOID *traverse(struct memorypool *pool);
+> void deletevertex(struct mesh *m, struct behavior *b, struct otri *deltri);
+> void pooldealloc(struct memorypool *pool, VOID *dyingitem);
+> int checkseg4encroach(struct mesh *m, struct behavior *b,
+>                       struct osub *testsubseg);
+> void badsubsegdealloc(struct mesh *m, struct badsubseg *dyingseg);
+> void vertexdealloc(struct mesh *m, vertex dyingvertex);
+> void vertexsort(vertex *sortarray, int arraysize);
+> void tallyencs(struct mesh *m, struct behavior *b);
+> void splittriangle(struct mesh *m, struct behavior *b,
+>                    struct badtriang *badtri);
+> subseg *subsegtraverse(struct mesh *m);
+> enum locateresult locate(struct mesh *m, struct behavior *b,
+>                          vertex searchpoint, struct otri *searchtri);
+> void writenodes(struct mesh *m, struct behavior *b, REAL **pointlist,
+>                 REAL **pointattriblist, int **pointmarkerlist);
+> void writevoronoi(struct mesh *m, struct behavior *b, REAL **vpointlist,
+>                   REAL **vpointattriblist, int **vpointmarkerlist,
+>                   int **vedgelist, int **vedgemarkerlist, REAL **vnormlist);
+> void writeneighbors(struct mesh *m, struct behavior *b, int **neighborlist);
+> void testtriangle(struct mesh *m, struct behavior *b, struct otri *testtri);
+> void triangleinit(struct mesh *m);
+> 
+> 
+1408a1514
+> void triexit(int status);
+1410d1515
+< #ifdef ANSI_DECLARATORS
+1412,1416d1516
+< #else /* not ANSI_DECLARATORS */
+< void triexit(status)
+< int status;
+< #endif /* not ANSI_DECLARATORS */
+< 
+1421c1521
+< #ifdef ANSI_DECLARATORS
+---
+> VOID *trimalloc(int size);
+1423,1427d1522
+< #else /* not ANSI_DECLARATORS */
+< VOID *trimalloc(size)
+< int size;
+< #endif /* not ANSI_DECLARATORS */
+< 
+1431c1526,1527
+<   memptr = (VOID *) malloc((unsigned int) size);
+---
+>   memptr = (VOID *) mxMalloc((unsigned int) size);
+>   //memptr = (VOID *) malloc((unsigned int) size);
+1447c1543,1544
+<   free(memptr);
+---
+>   //free(memptr);
+>   mxFree(memptr);
+3665,3670c3762,3767
+< void printtriangle(struct mesh *m, struct behavior *b, struct otri *t)
+< #else /* not ANSI_DECLARATORS */
+< void printtriangle(m, b, t)
+< struct mesh *m;
+< struct behavior *b;
+< struct otri *t;
+---
+> void printtriangle(struct mesh *m, struct behavior *b, struct otri *t){
+> //#else /* not ANSI_DECLARATORS */
+> //void printtriangle(m, b, t)
+> //struct mesh *m;
+> //struct behavior *b;
+> //struct otri *t;
+3673c3770
+< {
+---
+> //{
+4910c5007
+<   _FPU_SETCW(cword);
+---
+>   //_FPU_SETCW(cword); //taken care of by Matlab
Index: /issm/trunk/externalpackages/triangle/triangle.h
===================================================================
--- /issm/trunk/externalpackages/triangle/triangle.h	(revision 1)
+++ /issm/trunk/externalpackages/triangle/triangle.h	(revision 1)
@@ -0,0 +1,291 @@
+/*****************************************************************************/
+/*                                                                           */
+/*  (triangle.h)                                                             */
+/*                                                                           */
+/*  Include file for programs that call Triangle.                            */
+/*                                                                           */
+/*  Accompanies Triangle Version 1.6                                         */
+/*  July 28, 2005                                                            */
+/*                                                                           */
+/*  Copyright 1996, 2005                                                     */
+/*  Jonathan Richard Shewchuk                                                */
+/*  2360 Woolsey #H                                                          */
+/*  Berkeley, California  94705-1927                                         */
+/*  jrs@cs.berkeley.edu                                                      */
+/*                                                                           */
+/*****************************************************************************/
+
+/*****************************************************************************/
+/*                                                                           */
+/*  How to call Triangle from another program                                */
+/*                                                                           */
+/*                                                                           */
+/*  If you haven't read Triangle's instructions (run "triangle -h" to read   */
+/*  them), you won't understand what follows.                                */
+/*                                                                           */
+/*  Triangle must be compiled into an object file (triangle.o) with the      */
+/*  TRILIBRARY symbol defined (generally by using the -DTRILIBRARY compiler  */
+/*  switch).  The makefile included with Triangle will do this for you if    */
+/*  you run "make trilibrary".  The resulting object file can be called via  */
+/*  the procedure triangulate().                                             */
+/*                                                                           */
+/*  If the size of the object file is important to you, you may wish to      */
+/*  generate a reduced version of triangle.o.  The REDUCED symbol gets rid   */
+/*  of all features that are primarily of research interest.  Specifically,  */
+/*  the -DREDUCED switch eliminates Triangle's -i, -F, -s, and -C switches.  */
+/*  The CDT_ONLY symbol gets rid of all meshing algorithms above and beyond  */
+/*  constrained Delaunay triangulation.  Specifically, the -DCDT_ONLY switch */
+/*  eliminates Triangle's -r, -q, -a, -u, -D, -Y, -S, and -s switches.       */
+/*                                                                           */
+/*  IMPORTANT:  These definitions (TRILIBRARY, REDUCED, CDT_ONLY) must be    */
+/*  made in the makefile or in triangle.c itself.  Putting these definitions */
+/*  in this file (triangle.h) will not create the desired effect.            */
+/*                                                                           */
+/*                                                                           */
+/*  The calling convention for triangulate() follows.                        */
+/*                                                                           */
+/*      void triangulate(triswitches, in, out, vorout)                       */
+/*      char *triswitches;                                                   */
+/*      struct triangulateio *in;                                            */
+/*      struct triangulateio *out;                                           */
+/*      struct triangulateio *vorout;                                        */
+/*                                                                           */
+/*  `triswitches' is a string containing the command line switches you wish  */
+/*  to invoke.  No initial dash is required.  Some suggestions:              */
+/*                                                                           */
+/*  - You'll probably find it convenient to use the `z' switch so that       */
+/*    points (and other items) are numbered from zero.  This simplifies      */
+/*    indexing, because the first item of any type always starts at index    */
+/*    [0] of the corresponding array, whether that item's number is zero or  */
+/*    one.                                                                   */
+/*  - You'll probably want to use the `Q' (quiet) switch in your final code, */
+/*    but you can take advantage of Triangle's printed output (including the */
+/*    `V' switch) while debugging.                                           */
+/*  - If you are not using the `q', `a', `u', `D', `j', or `s' switches,     */
+/*    then the output points will be identical to the input points, except   */
+/*    possibly for the boundary markers.  If you don't need the boundary     */
+/*    markers, you should use the `N' (no nodes output) switch to save       */
+/*    memory.  (If you do need boundary markers, but need to save memory, a  */
+/*    good nasty trick is to set out->pointlist equal to in->pointlist       */
+/*    before calling triangulate(), so that Triangle overwrites the input    */
+/*    points with identical copies.)                                         */
+/*  - The `I' (no iteration numbers) and `g' (.off file output) switches     */
+/*    have no effect when Triangle is compiled with TRILIBRARY defined.      */
+/*                                                                           */
+/*  `in', `out', and `vorout' are descriptions of the input, the output,     */
+/*  and the Voronoi output.  If the `v' (Voronoi output) switch is not used, */
+/*  `vorout' may be NULL.  `in' and `out' may never be NULL.                 */
+/*                                                                           */
+/*  Certain fields of the input and output structures must be initialized,   */
+/*  as described below.                                                      */
+/*                                                                           */
+/*****************************************************************************/
+
+/*****************************************************************************/
+/*                                                                           */
+/*  The `triangulateio' structure.                                           */
+/*                                                                           */
+/*  Used to pass data into and out of the triangulate() procedure.           */
+/*                                                                           */
+/*                                                                           */
+/*  Arrays are used to store points, triangles, markers, and so forth.  In   */
+/*  all cases, the first item in any array is stored starting at index [0].  */
+/*  However, that item is item number `1' unless the `z' switch is used, in  */
+/*  which case it is item number `0'.  Hence, you may find it easier to      */
+/*  index points (and triangles in the neighbor list) if you use the `z'     */
+/*  switch.  Unless, of course, you're calling Triangle from a Fortran       */
+/*  program.                                                                 */
+/*                                                                           */
+/*  Description of fields (except the `numberof' fields, which are obvious): */
+/*                                                                           */
+/*  `pointlist':  An array of point coordinates.  The first point's x        */
+/*    coordinate is at index [0] and its y coordinate at index [1], followed */
+/*    by the coordinates of the remaining points.  Each point occupies two   */
+/*    REALs.                                                                 */
+/*  `pointattributelist':  An array of point attributes.  Each point's       */
+/*    attributes occupy `numberofpointattributes' REALs.                     */
+/*  `pointmarkerlist':  An array of point markers; one int per point.        */
+/*                                                                           */
+/*  `trianglelist':  An array of triangle corners.  The first triangle's     */
+/*    first corner is at index [0], followed by its other two corners in     */
+/*    counterclockwise order, followed by any other nodes if the triangle    */
+/*    represents a nonlinear element.  Each triangle occupies                */
+/*    `numberofcorners' ints.                                                */
+/*  `triangleattributelist':  An array of triangle attributes.  Each         */
+/*    triangle's attributes occupy `numberoftriangleattributes' REALs.       */
+/*  `trianglearealist':  An array of triangle area constraints; one REAL per */
+/*    triangle.  Input only.                                                 */
+/*  `neighborlist':  An array of triangle neighbors; three ints per          */
+/*    triangle.  Output only.                                                */
+/*                                                                           */
+/*  `segmentlist':  An array of segment endpoints.  The first segment's      */
+/*    endpoints are at indices [0] and [1], followed by the remaining        */
+/*    segments.  Two ints per segment.                                       */
+/*  `segmentmarkerlist':  An array of segment markers; one int per segment.  */
+/*                                                                           */
+/*  `holelist':  An array of holes.  The first hole's x and y coordinates    */
+/*    are at indices [0] and [1], followed by the remaining holes.  Two      */
+/*    REALs per hole.  Input only, although the pointer is copied to the     */
+/*    output structure for your convenience.                                 */
+/*                                                                           */
+/*  `regionlist':  An array of regional attributes and area constraints.     */
+/*    The first constraint's x and y coordinates are at indices [0] and [1], */
+/*    followed by the regional attribute at index [2], followed by the       */
+/*    maximum area at index [3], followed by the remaining area constraints. */
+/*    Four REALs per area constraint.  Note that each regional attribute is  */
+/*    used only if you select the `A' switch, and each area constraint is    */
+/*    used only if you select the `a' switch (with no number following), but */
+/*    omitting one of these switches does not change the memory layout.      */
+/*    Input only, although the pointer is copied to the output structure for */
+/*    your convenience.                                                      */
+/*                                                                           */
+/*  `edgelist':  An array of edge endpoints.  The first edge's endpoints are */
+/*    at indices [0] and [1], followed by the remaining edges.  Two ints per */
+/*    edge.  Output only.                                                    */
+/*  `edgemarkerlist':  An array of edge markers; one int per edge.  Output   */
+/*    only.                                                                  */
+/*  `normlist':  An array of normal vectors, used for infinite rays in       */
+/*    Voronoi diagrams.  The first normal vector's x and y magnitudes are    */
+/*    at indices [0] and [1], followed by the remaining vectors.  For each   */
+/*    finite edge in a Voronoi diagram, the normal vector written is the     */
+/*    zero vector.  Two REALs per edge.  Output only.                        */
+/*                                                                           */
+/*                                                                           */
+/*  Any input fields that Triangle will examine must be initialized.         */
+/*  Furthermore, for each output array that Triangle will write to, you      */
+/*  must either provide space by setting the appropriate pointer to point    */
+/*  to the space you want the data written to, or you must initialize the    */
+/*  pointer to NULL, which tells Triangle to allocate space for the results. */
+/*  The latter option is preferable, because Triangle always knows exactly   */
+/*  how much space to allocate.  The former option is provided mainly for    */
+/*  people who need to call Triangle from Fortran code, though it also makes */
+/*  possible some nasty space-saving tricks, like writing the output to the  */
+/*  same arrays as the input.                                                */
+/*                                                                           */
+/*  Triangle will not free() any input or output arrays, including those it  */
+/*  allocates itself; that's up to you.  You should free arrays allocated by */
+/*  Triangle by calling the trifree() procedure defined below.  (By default, */
+/*  trifree() just calls the standard free() library procedure, but          */
+/*  applications that call triangulate() may replace trimalloc() and         */
+/*  trifree() in triangle.c to use specialized memory allocators.)           */
+/*                                                                           */
+/*  Here's a guide to help you decide which fields you must initialize       */
+/*  before you call triangulate().                                           */
+/*                                                                           */
+/*  `in':                                                                    */
+/*                                                                           */
+/*    - `pointlist' must always point to a list of points; `numberofpoints'  */
+/*      and `numberofpointattributes' must be properly set.                  */
+/*      `pointmarkerlist' must either be set to NULL (in which case all      */
+/*      markers default to zero), or must point to a list of markers.  If    */
+/*      `numberofpointattributes' is not zero, `pointattributelist' must     */
+/*      point to a list of point attributes.                                 */
+/*    - If the `r' switch is used, `trianglelist' must point to a list of    */
+/*      triangles, and `numberoftriangles', `numberofcorners', and           */
+/*      `numberoftriangleattributes' must be properly set.  If               */
+/*      `numberoftriangleattributes' is not zero, `triangleattributelist'    */
+/*      must point to a list of triangle attributes.  If the `a' switch is   */
+/*      used (with no number following), `trianglearealist' must point to a  */
+/*      list of triangle area constraints.  `neighborlist' may be ignored.   */
+/*    - If the `p' switch is used, `segmentlist' must point to a list of     */
+/*      segments, `numberofsegments' must be properly set, and               */
+/*      `segmentmarkerlist' must either be set to NULL (in which case all    */
+/*      markers default to zero), or must point to a list of markers.        */
+/*    - If the `p' switch is used without the `r' switch, then               */
+/*      `numberofholes' and `numberofregions' must be properly set.  If      */
+/*      `numberofholes' is not zero, `holelist' must point to a list of      */
+/*      holes.  If `numberofregions' is not zero, `regionlist' must point to */
+/*      a list of region constraints.                                        */
+/*    - If the `p' switch is used, `holelist', `numberofholes',              */
+/*      `regionlist', and `numberofregions' is copied to `out'.  (You can    */
+/*      nonetheless get away with not initializing them if the `r' switch is */
+/*      used.)                                                               */
+/*    - `edgelist', `edgemarkerlist', `normlist', and `numberofedges' may be */
+/*      ignored.                                                             */
+/*                                                                           */
+/*  `out':                                                                   */
+/*                                                                           */
+/*    - `pointlist' must be initialized (NULL or pointing to memory) unless  */
+/*      the `N' switch is used.  `pointmarkerlist' must be initialized       */
+/*      unless the `N' or `B' switch is used.  If `N' is not used and        */
+/*      `in->numberofpointattributes' is not zero, `pointattributelist' must */
+/*      be initialized.                                                      */
+/*    - `trianglelist' must be initialized unless the `E' switch is used.    */
+/*      `neighborlist' must be initialized if the `n' switch is used.  If    */
+/*      the `E' switch is not used and (`in->numberofelementattributes' is   */
+/*      not zero or the `A' switch is used), `elementattributelist' must be  */
+/*      initialized.  `trianglearealist' may be ignored.                     */
+/*    - `segmentlist' must be initialized if the `p' or `c' switch is used,  */
+/*      and the `P' switch is not used.  `segmentmarkerlist' must also be    */
+/*      initialized under these circumstances unless the `B' switch is used. */
+/*    - `edgelist' must be initialized if the `e' switch is used.            */
+/*      `edgemarkerlist' must be initialized if the `e' switch is used and   */
+/*      the `B' switch is not.                                               */
+/*    - `holelist', `regionlist', `normlist', and all scalars may be ignored.*/
+/*                                                                           */
+/*  `vorout' (only needed if `v' switch is used):                            */
+/*                                                                           */
+/*    - `pointlist' must be initialized.  If `in->numberofpointattributes'   */
+/*      is not zero, `pointattributelist' must be initialized.               */
+/*      `pointmarkerlist' may be ignored.                                    */
+/*    - `edgelist' and `normlist' must both be initialized.                  */
+/*      `edgemarkerlist' may be ignored.                                     */
+/*    - Everything else may be ignored.                                      */
+/*                                                                           */
+/*  After a call to triangulate(), the valid fields of `out' and `vorout'    */
+/*  will depend, in an obvious way, on the choice of switches used.  Note    */
+/*  that when the `p' switch is used, the pointers `holelist' and            */
+/*  `regionlist' are copied from `in' to `out', but no new space is          */
+/*  allocated; be careful that you don't free() the same array twice.  On    */
+/*  the other hand, Triangle will never copy the `pointlist' pointer (or any */
+/*  others); new space is allocated for `out->pointlist', or if the `N'      */
+/*  switch is used, `out->pointlist' remains uninitialized.                  */
+/*                                                                           */
+/*  All of the meaningful `numberof' fields will be properly set; for        */
+/*  instance, `numberofedges' will represent the number of edges in the      */
+/*  triangulation whether or not the edges were written.  If segments are    */
+/*  not used, `numberofsegments' will indicate the number of boundary edges. */
+/*                                                                           */
+/*****************************************************************************/
+typedef double REAL;
+typedef void VOID;
+
+extern "C" struct triangulateio {
+  REAL *pointlist;                                               /* In / out */
+  REAL *pointattributelist;                                      /* In / out */
+  int *pointmarkerlist;                                          /* In / out */
+  int numberofpoints;                                            /* In / out */
+  int numberofpointattributes;                                   /* In / out */
+
+  int *trianglelist;                                             /* In / out */
+  REAL *triangleattributelist;                                   /* In / out */
+  REAL *trianglearealist;                                         /* In only */
+  int *neighborlist;                                             /* Out only */
+  int numberoftriangles;                                         /* In / out */
+  int numberofcorners;                                           /* In / out */
+  int numberoftriangleattributes;                                /* In / out */
+
+  int *segmentlist;                                              /* In / out */
+  int *segmentmarkerlist;                                        /* In / out */
+  int numberofsegments;                                          /* In / out */
+
+  REAL *holelist;                        /* In / pointer to array copied out */
+  int numberofholes;                                      /* In / copied out */
+
+  REAL *regionlist;                      /* In / pointer to array copied out */
+  int numberofregions;                                    /* In / copied out */
+
+  int *edgelist;                                                 /* Out only */
+  int *edgemarkerlist;            /* Not used with Voronoi diagram; out only */
+  REAL *normlist;                /* Used only with Voronoi diagram; out only */
+  int numberofedges;                                             /* Out only */
+};
+
+#ifdef ANSI_DECLARATORS
+extern "C" void triangulate(char *, struct triangulateio *, struct triangulateio *,
+                 struct triangulateio *);
+extern "C" void trifree(VOID *memptr);
+#else /* not ANSI_DECLARATORS */
+void triangulate();
+void trifree();
+#endif /* not ANSI_DECLARATORS */
Index: /issm/trunk/externalpackages/triangle/triangle.h.patch
===================================================================
--- /issm/trunk/externalpackages/triangle/triangle.h.patch	(revision 28275)
+++ /issm/trunk/externalpackages/triangle/triangle.h.patch	(revision 1)
@@ -1,12 +1,15 @@
-250a251,257
-> /*Patch for ISSM*/
-> #ifndef REAL
+249a250,251
 > typedef double REAL;
 > typedef void VOID;
-> #endif
-> /*End patch*/
-> 
-283c290
+251c253
+< struct triangulateio {
+---
+> extern "C" struct triangulateio {
+283c285
 < void triangulate(char *, struct triangulateio *, struct triangulateio *,
 ---
 > extern "C" void triangulate(char *, struct triangulateio *, struct triangulateio *,
+285c287
+< void trifree(VOID *memptr);
+---
+> extern "C" void trifree(VOID *memptr);
Index: sm/trunk/externalpackages/triangle/triangle.h.patch.js
===================================================================
--- /issm/trunk/externalpackages/triangle/triangle.h.patch.js	(revision 28275)
+++ 	(revision )
@@ -1,8 +1,0 @@
-250a251,257
-> /*Patch for ISSM*/
-> #ifndef REAL
-> typedef double REAL;
-> typedef void VOID;
-> #endif
-> /*End patch*/
-> 
Index: /issm/trunk/install-sh
===================================================================
--- /issm/trunk/install-sh	(revision 1)
+++ /issm/trunk/install-sh	(revision 1)
@@ -0,0 +1,1 @@
+link /u/wilkes-r1b/larour/Bin/automake/share/automake-1.10/install-sh
Index: sm/trunk/ltmain.sh
===================================================================
--- /issm/trunk/ltmain.sh	(revision 28275)
+++ 	(revision )
@@ -1,9655 +1,0 @@
-
-# libtool (GNU libtool) 2.4.2
-# Written by Gordon Matzigkeit <gord@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.
-# 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 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.
-#
-# 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.
-
-# 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@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
-
-# Be Bourne compatible
-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
-  # 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
-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
-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\"
-	fi"
-done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
-
-$lt_unset CDPATH
-
-
-# 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"
-
-
-
-: ${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.
-
-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
-
-
-# func_basename file
-func_basename ()
-{
-    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
-
-
-# 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
-
-
-# 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
-
-
-# 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,/*$,/,'
-
-# 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
-}
-
-# 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
-
-  # 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
-}
-
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-
-# 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
-
-# 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'
-
-# 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"
-
-# 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: }$*"
-}
-
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && 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_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
-}
-
-# 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
-
-    # bash bug again:
-    :
-}
-
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
-
-# 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"
-}
-help="Try \`$progname --help' for more information."  ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
-    $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# 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=
-
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
-
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
-      esac
-
-      # While some portion of DIR does not yet exist...
-      while test ! -d "$my_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"
-
-        # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
-
-        # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
-      done
-      my_dir_list=`$ECHO "$my_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
-        # try to create one of the directories concurrently.  Don't
-        # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
-      done
-      IFS="$save_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'"
-    fi
-}
-
-
-# func_mktempdir [string]
-# 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.
-func_mktempdir ()
-{
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
-
-    if test "$opt_dry_run" = ":"; then
-      # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
-    else
-
-      # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
-      if test ! -d "$my_tmpdir"; then
-        # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
-
-        save_mktempdir_umask=`umask`
-        umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_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'"
-    fi
-
-    $ECHO "$my_tmpdir"
-}
-
-
-# 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 ()
-{
-    case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
-      *)
-        func_quote_for_eval_unquoted_result="$1" ;;
-    esac
-
-    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
-}
-
-
-# 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 ()
-{
-    case $1 in
-      *[\\\`\"]*)
-	my_arg=`$ECHO "$1" | $SED \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        my_arg="$1" ;;
-    esac
-
-    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_quote_for_expand_result="$my_arg"
-}
-
-
-# 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-:}"
-
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
-
-    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_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 ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
-
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_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
-}
-
-# 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
-}
-
-
-# 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 $?
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    echo
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
-}
-
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
-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
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
-    $opt_debug
-
-    func_error "missing argument for $1."
-    exit_cmd=exit
-}
-
-
-# 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 ()
-{
-    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
-    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
-
-    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_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 ()
-{
-    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
-    my_sed_long_arg='1s/^--[^=]*=//'
-
-    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
-
-exit_cmd=:
-
-
-
-
-
-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
-
-# 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 ()
-{
-    eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell 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_quote_for_eval "${2}"
-    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
-
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-    func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
-
-
-# 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
-
-
-# func_lo2o object
-func_lo2o ()
-{
-    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
-
-
-# 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_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_config
-# Display the configuration for all the tags in this script.
-func_config ()
-{
-    re_begincf='^# ### BEGIN LIBTOOL'
-    re_endcf='^# ### END LIBTOOL'
-
-    # Default configuration.
-    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
-    # Now print the configurations for the tags.
-    for tagname in $taglist; do
-      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
-    done
-
-    exit $?
-}
-
-# func_features
-# Display the features supported by this script.
-func_features ()
-{
-    echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
-      echo "enable shared libraries"
-    else
-      echo "disable shared libraries"
-    fi
-    if test "$build_old_libs" = yes; then
-      echo "enable static libraries"
-    else
-      echo "disable static libraries"
-    fi
-
-    exit $?
-}
-
-# 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"
-
-  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
-
-  # 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
-}
-
-# 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
-$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
-$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
-$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
-
-    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
-
-
-
-# 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
-
-
-# Parse options once, thoroughly.  This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
-{
-  # 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
-
-  # Validate options:
-
-  # save first non-option argument
-  if test "$#" -gt 0; then
-    nonopt="$opt"
-    shift
-  fi
-
-  # preserve --debug
-  test "$opt_debug" = : || func_append preserve_args " --debug"
-
-  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"
-    fi
-
-    # Darwin sucks
-    eval std_shrext=\"$shrext_cmds\"
-
-    # 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
-
-    # 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
-}
-
-
-
-
-## ----------- ##
-##    Main.    ##
-## ----------- ##
-
-# func_lalib_p 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
-}
-
-# func_lalib_unsafe_p 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.
-func_lalib_unsafe_p ()
-{
-    lalib_p=no
-    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
-	for lalib_p_l in 1 2 3 4
-	do
-	    read lalib_p_line
-	    case "$lalib_p_line" in
-		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
-	    esac
-	done
-	exec 0<&5 5<&-
-    fi
-    test "$lalib_p" = yes
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
-    func_lalib_p "$1"
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
-    func_ltwrapper_exec_suffix=
-    case $1 in
-    *.exe) ;;
-    *) func_ltwrapper_exec_suffix=.exe ;;
-    esac
-    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-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_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
-    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
-    $opt_debug
-    save_ifs=$IFS; IFS='~'
-    for cmd in $1; do
-      IFS=$save_ifs
-      eval cmd=\"$cmd\"
-      func_show_eval "$cmd" "${2-:}"
-    done
-    IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# 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.
-func_source ()
-{
-    $opt_debug
-    case $1 in
-    */* | *\\*)	. "$1" ;;
-    *)		. "./$1" ;;
-    esac
-}
-
-
-# func_resolve_sysroot PATH
-# Replace a leading = in PATH with a sysroot.  Store the result into
-# func_resolve_sysroot_result
-func_resolve_sysroot ()
-{
-  func_resolve_sysroot_result=$1
-  case $func_resolve_sysroot_result in
-  =*)
-    func_stripname '=' '' "$func_resolve_sysroot_result"
-    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
-    ;;
-  esac
-}
-
-# func_replace_sysroot PATH
-# If PATH begins with the sysroot, replace it with = and
-# store the result into func_replace_sysroot_result.
-func_replace_sysroot ()
-{
-  case "$lt_sysroot:$1" in
-  ?*:"$lt_sysroot"*)
-    func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result="=$func_stripname_result"
-    ;;
-  *)
-    # Including no sysroot.
-    func_replace_sysroot_result=$1
-    ;;
-  esac
-}
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
-    $opt_debug
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-	func_append_quoted CC_quoted "$arg"
-      done
-      CC_expanded=`func_echo_all $CC`
-      CC_quoted_expanded=`func_echo_all $CC_quoted`
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-	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`"
-	    CC_quoted=
-	    for arg in $CC; do
-	      # Double-quote args containing other shell metacharacters.
-	      func_append_quoted CC_quoted "$arg"
-	    done
-	    CC_expanded=`func_echo_all $CC`
-	    CC_quoted_expanded=`func_echo_all $CC_quoted`
-	    case "$@ " in
-	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# 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'"
-#	else
-#	  func_verbose "using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# 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}\'
-    else
-      write_lobj=none
-    fi
-
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
-    else
-      write_oldobj=none
-    fi
-
-    $opt_dry_run || {
-      cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
-      $MV "${write_libobj}T" "${write_libobj}"
-    }
-}
-
-
-##################################################
-# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-##################################################
-
-# func_convert_core_file_wine_to_w32 ARG
-# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-# correctly configured wine environment available, with the winepath program
-# in $build's $PATH.
-#
-# ARG is the $build file name to be converted to w32 format.
-# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-# 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"
-  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
-    # command is not found, the shell will set an exit code of 127 and print
-    # *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
-      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$lt_sed_naive_backslashify"`
-    else
-      func_convert_core_file_wine_to_w32_result=
-    fi
-  fi
-}
-# end: func_convert_core_file_wine_to_w32
-
-
-# func_convert_core_path_wine_to_w32 ARG
-# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
-#
-# ARG is path to be converted from $build format to win32.
-# Result is available in $func_convert_core_path_wine_to_w32_result.
-# Unconvertible file (directory) names in ARG are skipped; if no directory names
-# are convertible, then the result may be empty.
-func_convert_core_path_wine_to_w32 ()
-{
-  $opt_debug
-  # unfortunately, winepath doesn't convert paths, only file names
-  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 -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"
-        else
-          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
-        fi
-      fi
-    done
-    IFS=$oldIFS
-  fi
-}
-# end: func_convert_core_path_wine_to_w32
-
-
-# func_cygpath ARGS...
-# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-# (2), returns the Cygwin file name or path in func_cygpath_result (input
-# file name or path is assumed to be in w32 format, as previously converted
-# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-# or path in func_cygpath_result (input file name or path is assumed to be in
-# Cygwin format). Returns an empty string on error.
-#
-# ARGS are passed to cygpath, with the last one being the file name or path to
-# be converted.
-#
-# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-# environment variable; do not put it in $PATH.
-func_cygpath ()
-{
-  $opt_debug
-  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
-    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
-    if test "$?" -ne 0; then
-      # on failure, ensure result is empty
-      func_cygpath_result=
-    fi
-  else
-    func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
-  fi
-}
-#end: func_cygpath
-
-
-# func_convert_core_msys_to_w32 ARG
-# Convert file name or path ARG from MSYS format to w32 format.  Return
-# result in func_convert_core_msys_to_w32_result.
-func_convert_core_msys_to_w32 ()
-{
-  $opt_debug
-  # 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"`
-}
-#end: func_convert_core_msys_to_w32
-
-
-# func_convert_file_check ARG1 ARG2
-# Verify that ARG1 (a file name in $build format) was converted to $host
-# format in ARG2. Otherwise, emit an error message, but continue (resetting
-# func_to_host_file_result to ARG1).
-func_convert_file_check ()
-{
-  $opt_debug
-  if test -z "$2" && test -n "$1" ; then
-    func_error "Could not determine host file name corresponding to"
-    func_error "  \`$1'"
-    func_error "Continuing, but uninstalled executables may not work."
-    # Fallback:
-    func_to_host_file_result="$1"
-  fi
-}
-# end func_convert_file_check
-
-
-# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-# Verify that FROM_PATH (a path in $build format) was converted to $host
-# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-# func_to_host_file_result to a simplistic fallback value (see below).
-func_convert_path_check ()
-{
-  $opt_debug
-  if test -z "$4" && test -n "$3"; then
-    func_error "Could not determine the host path corresponding to"
-    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.
-    if test "x$1" != "x$2"; then
-      lt_replace_pathsep_chars="s|$1|$2|g"
-      func_to_host_path_result=`echo "$3" |
-        $SED -e "$lt_replace_pathsep_chars"`
-    else
-      func_to_host_path_result="$3"
-    fi
-  fi
-}
-# end func_convert_path_check
-
-
-# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-# and appending REPL if ORIG matches BACKPAT.
-func_convert_path_front_back_pathsep ()
-{
-  $opt_debug
-  case $4 in
-  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
-    ;;
-  esac
-  case $4 in
-  $2 ) func_append func_to_host_path_result "$3"
-    ;;
-  esac
-}
-# end func_convert_path_front_back_pathsep
-
-
-##################################################
-# $build to $host FILE NAME CONVERSION FUNCTIONS #
-##################################################
-# 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.
-
-
-# func_to_host_file ARG
-# Converts the file name ARG from $build format to $host format. Return result
-# in func_to_host_file_result.
-func_to_host_file ()
-{
-  $opt_debug
-  $to_host_file_cmd "$1"
-}
-# end func_to_host_file
-
-
-# func_to_tool_file ARG LAZY
-# converts the file name ARG from $build format to toolchain format. Return
-# result in func_to_tool_file_result.  If the conversion in use is listed
-# in (the comma separated) LAZY, no conversion takes place.
-func_to_tool_file ()
-{
-  $opt_debug
-  case ,$2, in
-    *,"$to_tool_file_cmd",*)
-      func_to_tool_file_result=$1
-      ;;
-    *)
-      $to_tool_file_cmd "$1"
-      func_to_tool_file_result=$func_to_host_file_result
-      ;;
-  esac
-}
-# end func_to_tool_file
-
-
-# func_convert_file_noop ARG
-# Copy ARG to func_to_host_file_result.
-func_convert_file_noop ()
-{
-  func_to_host_file_result="$1"
-}
-# end func_convert_file_noop
-
-
-# func_convert_file_msys_to_w32 ARG
-# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_file_result.
-func_convert_file_msys_to_w32 ()
-{
-  $opt_debug
-  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"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_w32
-
-
-# func_convert_file_cygwin_to_w32 ARG
-# Convert file name ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_file_cygwin_to_w32 ()
-{
-  $opt_debug
-  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.
-    func_to_host_file_result=`cygpath -m "$1"`
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_cygwin_to_w32
-
-
-# func_convert_file_nix_to_w32 ARG
-# Convert file name ARG from *nix to w32 format.  Requires a wine environment
-# 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"
-  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"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_w32
-
-
-# func_convert_file_msys_to_cygwin ARG
-# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_file_msys_to_cygwin ()
-{
-  $opt_debug
-  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"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_cygwin
-
-
-# func_convert_file_nix_to_cygwin ARG
-# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
-# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
-# in func_to_host_file_result.
-func_convert_file_nix_to_cygwin ()
-{
-  $opt_debug
-  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"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_cygwin
-
-
-#############################################
-# $build to $host PATH CONVERSION FUNCTIONS #
-#############################################
-# 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.
-#
-# Path separators are also converted from $build format to $host format.  If
-# ARG begins or ends with a path separator character, it is preserved (but
-# converted to $host format) on output.
-#
-# All path conversion functions are named using the following convention:
-#   file name conversion function    : func_convert_file_X_to_Y ()
-#   path conversion function         : func_convert_path_X_to_Y ()
-# where, for any given $build/$host combination the 'X_to_Y' value is the
-# same.  If conversion functions are added for new $build/$host combinations,
-# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-# will break.
-
-
-# func_init_to_host_path_cmd
-# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-# appropriate value, based on the value of $to_host_file_cmd.
-to_host_path_cmd=
-func_init_to_host_path_cmd ()
-{
-  $opt_debug
-  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}"
-  fi
-}
-
-
-# func_to_host_path ARG
-# Converts the path ARG from $build format to $host format. Return result
-# in func_to_host_path_result.
-func_to_host_path ()
-{
-  $opt_debug
-  func_init_to_host_path_cmd
-  $to_host_path_cmd "$1"
-}
-# end func_to_host_path
-
-
-# func_convert_path_noop ARG
-# Copy ARG to func_to_host_path_result.
-func_convert_path_noop ()
-{
-  func_to_host_path_result="$1"
-}
-# end func_convert_path_noop
-
-
-# func_convert_path_msys_to_w32 ARG
-# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_path_result.
-func_convert_path_msys_to_w32 ()
-{
-  $opt_debug
-  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 ';.';
-    # and winepath ignores them completely.
-    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_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_msys_to_w32
-
-
-# func_convert_path_cygwin_to_w32 ARG
-# Convert path ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_path_cygwin_to_w32 ()
-{
-  $opt_debug
-  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_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_cygwin_to_w32
-
-
-# func_convert_path_nix_to_w32 ARG
-# Convert path ARG from *nix to w32 format.  Requires a wine environment and
-# 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"
-  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_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_nix_to_w32
-
-
-# func_convert_path_msys_to_cygwin ARG
-# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_path_msys_to_cygwin ()
-{
-  $opt_debug
-  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_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_msys_to_cygwin
-
-
-# func_convert_path_nix_to_cygwin ARG
-# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
-# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
-# func_to_host_file_result.
-func_convert_path_nix_to_cygwin ()
-{
-  $opt_debug
-  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 ';.', and winepath ignores them completely.
-    func_stripname : : "$1"
-    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_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_nix_to_cygwin
-
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
-    $opt_debug
-    # Get the compilation command and the source file.
-    base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
-    suppress_opt=yes
-    suppress_output=
-    arg_mode=normal
-    libobj=
-    later=
-    pie_flag=
-
-    for arg
-    do
-      case $arg_mode in
-      arg  )
-	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
-	arg_mode=normal
-	;;
-
-      target )
-	libobj="$arg"
-	arg_mode=normal
-	continue
-	;;
-
-      normal )
-	# Accept any command-line options.
-	case $arg in
-	-o)
-	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
-	  arg_mode=target
-	  continue
-	  ;;
-
-	-pie | -fpie | -fPIE)
-          func_append pie_flag " $arg"
-	  continue
-	  ;;
-
-	-shared | -static | -prefer-pic | -prefer-non-pic)
-	  func_append later " $arg"
-	  continue
-	  ;;
-
-	-no-suppress)
-	  suppress_opt=no
-	  continue
-	  ;;
-
-	-Xcompiler)
-	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
-	  continue      #  The current "srcfile" will either be retained or
-	  ;;            #  replaced later.  I would guess that would be a bug.
-
-	-Wc,*)
-	  func_stripname '-Wc,' '' "$arg"
-	  args=$func_stripname_result
-	  lastarg=
-	  save_ifs="$IFS"; IFS=','
-	  for arg in $args; do
-	    IFS="$save_ifs"
-	    func_append_quoted lastarg "$arg"
-	  done
-	  IFS="$save_ifs"
-	  func_stripname ' ' '' "$lastarg"
-	  lastarg=$func_stripname_result
-
-	  # Add the arguments to base_compile.
-	  func_append base_compile " $lastarg"
-	  continue
-	  ;;
-
-	*)
-	  # Accept the current argument as the source file.
-	  # The previous "srcfile" becomes the current argument.
-	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
-	  ;;
-	esac  #  case $arg
-	;;
-      esac    #  case $arg_mode
-
-      # Aesthetically quote the previous argument.
-      func_append_quoted base_compile "$lastarg"
-    done # for arg
-
-    case $arg_mode in
-    arg)
-      func_fatal_error "you must specify an argument for -Xcompile"
-      ;;
-    target)
-      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"
-      }
-      ;;
-    esac
-
-    # Recognize several different file suffixes.
-    # If the user specifies -o file.o, it is replaced with file.lo
-    case $libobj in
-    *.[cCFSifmso] | \
-    *.ada | *.adb | *.ads | *.asm | \
-    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
-      func_xform "$libobj"
-      libobj=$func_xform_result
-      ;;
-    esac
-
-    case $libobj in
-    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
-    *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
-      ;;
-    esac
-
-    func_infer_tag $base_compile
-
-    for arg in $later; do
-      case $arg in
-      -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
-	build_old_libs=no
-	continue
-	;;
-
-      -static)
-	build_libtool_libs=no
-	build_old_libs=yes
-	continue
-	;;
-
-      -prefer-pic)
-	pic_mode=yes
-	continue
-	;;
-
-      -prefer-non-pic)
-	pic_mode=no
-	continue
-	;;
-      esac
-    done
-
-    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_dirname_and_basename "$obj" "/" ""
-    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
-      removelist="$obj $lobj $libobj ${libobj}T"
-    else
-      removelist="$lobj $libobj ${libobj}T"
-    fi
-
-    # On Cygwin there's no "real" PIC flag so we must build both object types
-    case $host_os in
-    cygwin* | mingw* | pw32* | os2* | cegcc*)
-      pic_mode=default
-      ;;
-    esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; 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"
-    else
-      output_obj=
-      need_locks=no
-      lockfile=
-    fi
-
-    # 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
-      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
-      if test -f "$lockfile"; then
-	$ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-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
-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."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-      func_append removelist " $output_obj"
-      $ECHO "$srcfile" > "$lockfile"
-    fi
-
-    $opt_dry_run || $RM $removelist
-    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
-    srcfile=$func_to_tool_file_result
-    func_quote_for_eval "$srcfile"
-    qsrcfile=$func_quote_for_eval_result
-
-    # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
-      # Without this assignment, base_compile gets emptied.
-      fbsd_hideous_sh_bug=$base_compile
-
-      if test "$pic_mode" != no; then
-	command="$base_compile $qsrcfile $pic_flag"
-      else
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      fi
-
-      func_mkdir_p "$xdir$objdir"
-
-      if test -z "$output_obj"; then
-	# Place PIC objects in $objdir
-	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 &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$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
-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."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed, then go on to compile the next one
-      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	func_show_eval '$MV "$output_obj" "$lobj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-
-      # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; 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
-	# 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
-	func_append command " -o $obj"
-      fi
-
-      # Suppress compiler output if we already did a PIC compilation.
-      func_append command "$suppress_output"
-      func_show_eval_locale "$command" \
-        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$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
-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."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed
-      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	func_show_eval '$MV "$output_obj" "$obj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-    fi
-
-    $opt_dry_run || {
-      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
-      # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
-	removelist=$lockfile
-        $RM "$lockfile"
-      fi
-    }
-
-    exit $EXIT_SUCCESS
-}
-
-$opt_help || {
-  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
-    # We need to display help for each of the modes.
-    case $opt_mode in
-      "")
-        # Generic help is extracted from the usage comments
-        # at the start of this file.
-        func_help
-        ;;
-
-      clean)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-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
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      compile)
-      $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -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
-  -Wc,FLAG          pass FLAG directly to the compiler
-
-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'."
-        ;;
-
-      execute)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-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'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-        ;;
-
-      finish)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-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."
-        ;;
-
-      install)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
-  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-        ;;
-
-      link)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -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
-  -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
-                    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-                    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -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
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -shared           only do dynamic linking of libtool libraries
-  -shrext SUFFIX    override the standard shared library file extension
-  -static           do not do any dynamic linking of uninstalled libtool libraries
-  -static-libtool-libs
-                    do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-  -weak LIBNAME     declare that the target provides the LIBNAME interface
-  -Wc,FLAG
-  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
-  -Wl,FLAG
-  -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.
-
-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
-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 \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
-        ;;
-
-      uninstall)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-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
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      *)
-        func_fatal_help "invalid operation mode \`$opt_mode'"
-        ;;
-    esac
-
-    echo
-    $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
-    func_mode_help
-  else
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	func_mode_help
-      done
-    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	echo
-	func_mode_help
-      done
-    } |
-    sed '1d
-      /^When reporting/,/^Report/{
-	H
-	d
-      }
-      $x
-      /information about other modes/d
-      /more detailed .*MODE/d
-      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
-  fi
-  exit $?
-fi
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
-    $opt_debug
-    # The first argument is the command name.
-    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"
-
-      dir=
-      case $file in
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# 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"
-
-	# Read the libtool library.
-	dlname=
-	library_names=
-	func_source "$file"
-
-	# Skip this library if it cannot be dlopened.
-	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'"
-	  continue
-	fi
-
-	func_dirname "$file" "" "."
-	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'"
-	  fi
-	fi
-	;;
-
-      *.lo)
-	# Just add the directory containing the .lo file.
-	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
-	;;
-
-      *)
-	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"
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -* | *.la | *.lo ) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if func_ltwrapper_script_p "$file"; then
-	  func_source "$file"
-	  # Transform arg to wrapped name.
-	  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"
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      func_append_quoted args "$file"
-    done
-
-    if test "X$opt_dry_run" = Xfalse; then
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
-
-      # Restore saved environment variables
-      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-      do
-	eval "if test \"\${save_$lt_var+set}\" = set; then
-                $lt_var=\$save_$lt_var; export $lt_var
-	      else
-		$lt_unset $lt_var
-	      fi"
-      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
-    fi
-}
-
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
-    $opt_debug
-    libs=
-    libdirs=
-    admincmds=
-
-    for opt in "$nonopt" ${1+"$@"}
-    do
-      if test -d "$opt"; then
-	func_append libdirs " $opt"
-
-      elif test -f "$opt"; then
-	if func_lalib_unsafe_p "$opt"; then
-	  func_append libs " $opt"
-	else
-	  func_warning "\`$opt' is not a valid libtool archive"
-	fi
-
-      else
-	func_fatal_error "invalid argument \`$opt'"
-      fi
-    done
-
-    if test -n "$libs"; then
-      if test -n "$lt_sysroot"; then
-        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
-        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
-      else
-        sysroot_cmd=
-      fi
-
-      # Remove sysroot references
-      if $opt_dry_run; then
-        for lib in $libs; do
-          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 \
-	    > $tmpdir/tmp-la
-	  mv -f $tmpdir/tmp-la $lib
-	done
-        ${RM}r "$tmpdir"
-      fi
-    fi
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $opt_dry_run || eval "$cmds" || func_append admincmds "
-       $cmds"
-	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      echo "----------------------------------------------------------------------"
-      echo "Libraries have been installed in:"
-      for libdir in $libdirs; do
-	$ECHO "   $libdir"
-      done
-      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 "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 "     during execution"
-      fi
-      if test -n "$runpath_var"; then
-	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"
-      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'"
-      fi
-      echo
-
-      echo "See any operating system documentation about shared libraries for"
-      case $host in
-	solaris2.[6789]|solaris2.1[0-9])
-	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
-	  echo "pages."
-	  ;;
-	*)
-	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
-	  ;;
-      esac
-      echo "----------------------------------------------------------------------"
-    fi
-    exit $EXIT_SUCCESS
-}
-
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
-    $opt_debug
-    # 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 ||
-       # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac; then
-      # Aesthetically quote it.
-      func_quote_for_eval "$nonopt"
-      install_prog="$func_quote_for_eval_result "
-      arg=$1
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    func_quote_for_eval "$arg"
-    func_append install_prog "$func_quote_for_eval_result"
-    install_shared_prog=$install_prog
-    case " $install_prog " in
-      *[\\\ /]cp\ *) install_cp=: ;;
-      *) install_cp=false ;;
-    esac
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=no
-    stripme=
-    no_mode=:
-    for arg
-    do
-      arg2=
-      if test -n "$dest"; then
-	func_append files " $dest"
-	dest=$arg
-	continue
-      fi
-
-      case $arg in
-      -d) isdir=yes ;;
-      -f)
-	if $install_cp; then :; else
-	  prev=$arg
-	fi
-	;;
-      -g | -m | -o)
-	prev=$arg
-	;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
-	;;
-      *)
-	# 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
-	    arg2=$install_override_mode
-	    no_mode=false
-	  fi
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
-	;;
-      esac
-
-      # Aesthetically quote the argument.
-      func_quote_for_eval "$arg"
-      func_append install_prog " $func_quote_for_eval_result"
-      if test -n "$arg2"; then
-	func_quote_for_eval "$arg2"
-      fi
-      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"
-
-    if test -n "$install_override_mode" && $no_mode; then
-      if $install_cp; then :; else
-	func_quote_for_eval "$install_override_mode"
-	func_append install_shared_prog " -m $func_quote_for_eval_result"
-      fi
-    fi
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	func_fatal_help "no file or destination specified"
-      else
-	func_fatal_help "you must specify a destination"
-      fi
-    fi
-
-    # Strip any trailing slash from the destination.
-    func_stripname '' '/' "$dest"
-    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"
-      destname=
-    else
-      func_dirname_and_basename "$dest" "" "."
-      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"
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
-	  ;;
-	esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	func_append staticlibs " $file"
-	;;
-
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# 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"
-
-	library_names=
-	old_library=
-	relink_command=
-	func_source "$file"
-
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
-	  *" $libdir "*) ;;
-	  *) func_append current_libdirs " $libdir" ;;
-	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
-	  *" $libdir "*) ;;
-	  *) func_append future_libdirs " $libdir" ;;
-	  esac
-	fi
-
-	func_dirname "$file" "/" ""
-	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.
-	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # 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"
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
-	  else
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
-	  fi
-
-	  func_warning "relinking \`$file'"
-	  func_show_eval "$relink_command" \
-	    '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"
-	  shift
-
-	  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"
-	  case $host_os in
-	  cygwin* | mingw* | pw32* | cegcc*)
-	    case $realname in
-	    *.dll.a)
-	      tstripme=""
-	      ;;
-	    esac
-	    ;;
-	  esac
-	  if test -n "$tstripme" && test -n "$striplib"; then
-	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
-	  fi
-
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # 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
-	    do
-	      test "$linkname" != "$realname" \
-		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
-	    done
-	  fi
-
-	  # Do each command in the postinstall commands.
-	  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
-	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
-	# Maybe install the static library, too.
-	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
-	;;
-
-      *.lo)
-	# Install (i.e. copy) a libtool object.
-
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
-	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  func_lo2o "$destfile"
-	  staticdest=$func_lo2o_result
-	  ;;
-	*.$objext)
-	  staticdest="$destfile"
-	  destfile=
-	  ;;
-	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	test -n "$destfile" && \
-	  func_show_eval "$install_prog $file $destfile" 'exit $?'
-
-	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
-	  # Deduce the name of the old-style object file.
-	  func_lo2o "$file"
-	  staticobj=$func_lo2o_result
-	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
-	fi
-	exit $EXIT_SUCCESS
-	;;
-
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  func_basename "$file"
-	  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=""
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      func_stripname '' '.exe' "$file"
-	      file=$func_stripname_result
-	      stripped_ext=".exe"
-	    fi
-	    ;;
-	esac
-
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin* | *mingw*)
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      wrapper=$func_ltwrapper_scriptname_result
-	    else
-	      func_stripname '' '.exe' "$file"
-	      wrapper=$func_stripname_result
-	    fi
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if func_ltwrapper_script_p "$wrapper"; then
-	  notinst_deplibs=
-	  relink_command=
-
-	  func_source "$wrapper"
-
-	  # Check the variables that should have been set.
-	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
-
-	  finalize=yes
-	  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
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
-	    fi
-	  done
-
-	  relink_command=
-	  func_source "$wrapper"
-
-	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
-	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
-	        tmpdir=`func_mktempdir`
-		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
-	        # Replace the output file specification.
-	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
-
-	        $opt_silent || {
-	          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"
-		  $opt_dry_run || ${RM}r "$tmpdir"
-		  continue
-	        fi
-	        file="$outputname"
-	      else
-	        func_warning "cannot relink \`$file'"
-	      fi
-	    }
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
-
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    func_stripname '' '.exe' "$destfile"
-	    destfile=$func_stripname_result
-	    ;;
-	  esac
-	  ;;
-	esac
-	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
-	$opt_dry_run || if test -n "$outputname"; then
-	  ${RM}r "$tmpdir"
-	fi
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      func_basename "$file"
-      name="$func_basename_result"
-
-      # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
-      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-      tool_oldlib=$func_to_tool_file_result
-
-      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
-      fi
-
-      # Do each command in the postinstall commands.
-      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
-    done
-
-    test -n "$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'
-    else
-      exit $EXIT_SUCCESS
-    fi
-}
-
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# 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'`
-    my_dlsyms=
-
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-      if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
-      else
-	func_error "not configured to extract global symbols from dlpreopened files"
-      fi
-    fi
-
-    if test -n "$my_dlsyms"; then
-      case $my_dlsyms in
-      "") ;;
-      *.c)
-	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
-
-	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
-	# Parse the name list into a source file.
-	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 */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-#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
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT_DLSYM_CONST
-#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
-
-/* External symbol declarations for the compiler. */\
-"
-
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
-
-	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
-	  # Add our own program objects to the symbol list.
-	  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'"
-	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -n "$exclude_expsyms"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  if test -n "$export_symbols_regex"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  # Prepare the list of exported symbols
-	  if test -z "$export_symbols"; then
-	    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"'
-	      case $host in
-	      *cygwin* | *mingw* | *cegcc* )
-                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-	        ;;
-	      esac
-	    }
-	  else
-	    $opt_dry_run || {
-	      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
-	        *cygwin* | *mingw* | *cegcc* )
-	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-	          ;;
-	      esac
-	    }
-	  fi
-	fi
-
-	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
-	  func_basename "$dlprefile"
-	  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=""
-	        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
-	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename="$func_basename_result"
-	          else
-	            # no lafile. user explicitly requested -dlpreopen <import library>.
-	            $sharedlib_from_linklib_cmd "$dlprefile"
-	            dlprefile_dlbasename=$sharedlib_from_linklib_result
-	          fi
-	        fi
-	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename" ; then
-	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
-	          else
-	            func_warning "Could not compute DLL name from $name"
-	            eval '$ECHO ": $name " >> "$nlist"'
-	          fi
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
-	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
-	        }
-	      else # not an import lib
-	        $opt_dry_run || {
-	          eval '$ECHO ": $name " >> "$nlist"'
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	        }
-	      fi
-	    ;;
-	    *)
-	      $opt_dry_run || {
-	        eval '$ECHO ": $name " >> "$nlist"'
-	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	      }
-	    ;;
-          esac
-	done
-
-	$opt_dry_run || {
-	  # Make sure we have at least an empty file.
-	  test -f "$nlist" || : > "$nlist"
-
-	  if test -n "$exclude_expsyms"; then
-	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	    $MV "$nlist"T "$nlist"
-	  fi
-
-	  # Try sorting and uniquifying the output.
-	  if $GREP -v "^: " < "$nlist" |
-	      if sort -k 3 </dev/null >/dev/null 2>&1; then
-		sort -k 3
-	      else
-		sort +2
-	      fi |
-	      uniq > "$nlist"S; then
-	    :
-	  else
-	    $GREP -v "^: " < "$nlist" > "$nlist"S
-	  fi
-
-	  if test -f "$nlist"S; then
-	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
-	  else
-	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
-	  fi
-
-	  echo >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols.  */
-typedef struct {
-  const char *name;
-  void *address;
-} lt_dlsymlist;
-extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
-LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
-
-	  case $need_lib_prefix in
-	  no)
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  *)
-	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  esac
-	  echo >> "$output_objdir/$my_dlsyms" "\
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	} # !$opt_dry_run
-
-	pic_flag_for_symtable=
-	case "$compile_command " in
-	*" -static "*) ;;
-	*)
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
-	  *-*-hpux*)
-	    pic_flag_for_symtable=" $pic_flag"  ;;
-	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
-	    ;;
-	  esac
-	  ;;
-	esac
-	symtab_cflags=
-	for arg in $LTCFLAGS; do
-	  case $arg in
-	  -pie | -fpie | -fPIE) ;;
-	  *) func_append symtab_cflags " $arg" ;;
-	  esac
-	done
-
-	# Now compile the dynamic symbol file.
-	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"'
-
-	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
-	case $host in
-	*cygwin* | *mingw* | *cegcc* )
-	  if test -f "$output_objdir/$my_outputname.def"; then
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	  else
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  fi
-	  ;;
-	*)
-	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  ;;
-	esac
-	;;
-      *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
-	;;
-      esac
-    else
-      # We keep going just in case the user didn't refer to
-      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-      # really was required.
-
-      # Nullify the symbol file.
-      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
-      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
-    fi
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-# Despite the name, also deal with 64 bit binaries.
-func_win32_libid ()
-{
-  $opt_debug
-  win32_libid_type="unknown"
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    # 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 '
-	    1,100{
-		/ I /{
-		    s,.*,import,
-		    p
-		    q
-		}
-	    }'`
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
-    esac
-    ;;
-  esac
-  $ECHO "$win32_libid_type"
-}
-
-# func_cygming_dll_for_implib ARG
-#
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib ()
-{
-  $opt_debug
-  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-}
-
-# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-#
-# The is the core of a fallback implementation of a
-# platform-specific function to extract the name of the
-# DLL associated with the specified import library LIBNAME.
-#
-# SECTION_NAME is either .idata$6 or .idata$7, depending
-# on the platform and compiler that created the implib.
-#
-# Echos the name of the DLL associated with the
-# specified import library.
-func_cygming_dll_for_implib_fallback_core ()
-{
-  $opt_debug
-  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
-  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
-    $SED '/^Contents of section '"$match_literal"':/{
-      # Place marker at beginning of archive member dllname section
-      s/.*/====MARK====/
-      p
-      d
-    }
-    # These lines can sometimes be longer than 43 characters, but
-    # are always uninteresting
-    /:[	 ]*file format pe[i]\{,1\}-/d
-    /^In archive [^:]*:/d
-    # Ensure marker is printed
-    /^====MARK====/p
-    # Remove all lines with less than 43 characters
-    /^.\{43\}/!d
-    # From remaining lines, remove first 43 characters
-    s/^.\{43\}//' |
-    $SED -n '
-      # Join marker and all lines until next marker into a single line
-      /^====MARK====/ b para
-      H
-      $ b para
-      b
-      :para
-      x
-      s/\n//g
-      # Remove the marker
-      s/^====MARK====//
-      # Remove trailing dots and whitespace
-      s/[\. \t]*$//
-      # Print
-      /./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
-    # 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
-    # begins with a literal '.' or a single character followed by
-    # a '.'.
-    #
-    # Of those that remain, print the first one.
-    $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
-# import library ARG.
-#
-# This fallback implementation is for use when $DLLTOOL
-# does not support the --identify-strict option.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib_fallback ()
-{
-  $opt_debug
-  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
-    # ms-generated import library
-    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
-  else
-    # unknown
-    sharedlib_from_linklib_result=""
-  fi
-}
-
-
-# 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
-      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"
-	sleep 2
-      done
-    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
-      $opt_dry_run || rm -f "$lockfile"
-    fi
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
-    fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
-    $opt_debug
-    my_gentop="$1"; shift
-    my_oldlibs=${1+"$@"}
-    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" ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
-      my_xlib_u=$my_xlib
-      while :; do
-        case " $extracted_archives " in
-	*" $my_xlib_u "*)
-	  func_arith $extracted_serial + 1
-	  extracted_serial=$func_arith_result
-	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-	*) break ;;
-	esac
-      done
-      extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
-
-      func_mkdir_p "$my_xdir"
-
-      case $host in
-      *-darwin*)
-	func_verbose "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	$opt_dry_run || {
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
-	  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}"
-	      cd "$darwin_curdir"
-	      $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_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
-	      $LIPO -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    $RM -rf unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd $darwin_orig_dir
-	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	} # !$opt_dry_run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-	;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
-    done
-
-    func_extract_archives_result="$my_oldobjs"
-}
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable.  Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# 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
-# the $objdir directory.  This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
-	func_emit_wrapper_arg1=${1-no}
-
-	$ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-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
-  # 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
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variables:
-  generated_by_libtool_version='$macro_version'
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$ECHO are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    file=\"\$0\""
-
-    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
-    $ECHO "\
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-    ECHO=\"$qECHO\"
-  fi
-
-# 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
-# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
-# this pattern).
-#
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
-#
-# The first argument to this parsing function should be the
-# script's $0 value, followed by "$@".
-lt_option_debug=
-func_parse_lt_options ()
-{
-  lt_script_arg0=\$0
-  shift
-  for lt_opt
-  do
-    case \"\$lt_opt\" in
-    --lt-debug) lt_option_debug=1 ;;
-    --lt-dump-script)
-        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
-        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
-        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
-        cat \"\$lt_dump_D/\$lt_dump_F\"
-        exit 0
-      ;;
-    --lt-*)
-        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
-        exit 1
-      ;;
-    esac
-  done
-
-  # Print the debug banner immediately:
-  if test -n \"\$lt_option_debug\"; then
-    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
-  fi
-}
-
-# Used when --lt-debug. Prints its arguments to stdout
-# (redirection is the responsibility of the caller)
-func_lt_dump_args ()
-{
-  lt_dump_args_N=1;
-  for lt_arg
-  do
-    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
-    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
-  done
-}
-
-# Core function for launching the target application
-func_exec_program_core ()
-{
-"
-  case $host in
-  # Backslashes separate directories on plain windows
-  *-*-mingw | *-*-os2* | *-cegcc*)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-    ;;
-
-  *)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-    ;;
-  esac
-  $ECHO "\
-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-      exit 1
-}
-
-# A function to encapsulate launching the target application
-# Strips options in the --lt-* namespace from \$@ and
-# launches target application with the remaining arguments.
-func_exec_program ()
-{
-  case \" \$* \" in
-  *\\ --lt-*)
-    for lt_wr_arg
-    do
-      case \$lt_wr_arg in
-      --lt-*) ;;
-      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-      esac
-      shift
-    done ;;
-  esac
-  func_exec_program_core \${1+\"\$@\"}
-}
-
-  # Parse options
-  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
-  done
-
-  # Usually 'no', except on cygwin/mingw when embedded into
-  # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
-  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
-    # special case for '.'
-    if test \"\$thisdir\" = \".\"; then
-      thisdir=\`pwd\`
-    fi
-    # remove .libs from thisdir
-    case \"\$thisdir\" in
-    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
-    $objdir )   thisdir=. ;;
-    esac
-  fi
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
-	if test "$fast_install" = yes; 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\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
-    file=\"\$\$-\$program\"
-
-    if test ! -d \"\$progdir\"; then
-      $MKDIR \"\$progdir\"
-    else
-      $RM \"\$progdir/\$file\"
-    fi"
-
-	  $ECHO "\
-
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	$ECHO \"\$relink_command_output\" >&2
-	$RM \"\$progdir/\$file\"
-	exit 1
-      fi
-    fi
-
-    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $RM \"\$progdir/\$program\";
-      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $RM \"\$progdir/\$file\"
-  fi"
-	else
-	  $ECHO "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
-	fi
-
-	$ECHO "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# fixup the dll searchpath if we need to.
-	#
-	# Fix the DLL searchpath if we need to.  Do this before prepending
-	# to shlibpath, because on Windows, both are PATH and uninstalled
-	# libraries must come first.
-	if test -n "$dllsearchpath"; then
-	  $ECHO "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
-
-	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $ECHO "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
-
-    export $shlibpath_var
-"
-	fi
-
-	$ECHO "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-      func_exec_program \${1+\"\$@\"}
-    fi
-  else
-    # The program doesn't exist.
-    \$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
-  fi
-fi\
-"
-}
-
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
-	cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-*/
-EOF
-	    cat <<"EOF"
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-#  include <io.h>
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-/* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
-# ifdef __STRICT_ANSI__
-int _putenv (const char *);
-# endif
-#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) ... */
-#endif
-
-/* portability defines, excluding path handling macros */
-#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__)
-# define setmode _setmode
-# define stat    _stat
-# define chmod   _chmod
-# define getcwd  _getcwd
-# define putenv  _putenv
-#elif defined(__CYGWIN__)
-# define HAVE_SETENV
-# define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
-#endif
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-/* path handling portability macros */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-#if defined(LT_DEBUGWRAPPER)
-static int lt_debug = 1;
-#else
-static int lt_debug = 0;
-#endif
-
-const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-void lt_fatal (const char *file, int line, const char *message, ...);
-static const char *nonnull (const char *s);
-static const char *nonempty (const char *s);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-char **prepare_spawn (char **argv);
-void lt_dump_script (FILE *f);
-EOF
-
-	    cat <<EOF
-volatile 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
-              func_to_host_path "$temp_rpath"
-	      cat <<EOF
-const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * LIB_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test -n "$dllsearchpath"; then
-              func_to_host_path "$dllsearchpath:"
-	      cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test "$fast_install" = yes; then
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
-	    else
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
-	    fi
-
-
-	    cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX         "--lt-"
-
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
-
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int  newargc;
-  char *tmp_pathspec;
-  char *actual_cwrapper_path;
-  char *actual_cwrapper_name;
-  char *target_name;
-  char *lt_argv_zero;
-  intptr_t rval = 127;
-
-  int i;
-
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
-
-  /* very simple arg parsing; don't want to rely on getopt
-   * also, copy all non cwrapper options to newargz, except
-   * argz[0], which is handled differently
-   */
-  newargc=0;
-  for (i = 1; i < argc; i++)
-    {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
-	{
-EOF
-	    case "$host" in
-	      *mingw* | *cygwin* )
-		# make stdout use "unix" line endings
-		echo "          setmode(1,_O_BINARY);"
-		;;
-	      esac
-
-	    cat <<"EOF"
-	  lt_dump_script (stdout);
-	  return 0;
-	}
-      if (strcmp (argv[i], debug_opt) == 0)
-	{
-          lt_debug = 1;
-          continue;
-	}
-      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
-        {
-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-             namespace, but it is not one of the ones we know about and
-             have already dealt with, above (inluding dump-script), then
-             report an error. Otherwise, targets might begin to believe
-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-             namespace. The first time any user complains about this, we'll
-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-             or a configure.ac-settable value.
-           */
-          lt_fatal (__FILE__, __LINE__,
-		    "unrecognized %s option: '%s'",
-                    ltwrapper_option_prefix, argv[i]);
-        }
-      /* otherwise ... */
-      newargz[++newargc] = xstrdup (argv[i]);
-    }
-  newargz[++newargc] = NULL;
-
-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");
-EOF
-	    cat <<"EOF"
-  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
-
-  tmp_pathspec = find_executable (argv[0]);
-  if (tmp_pathspec == NULL)
-    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (before symlink chase) at: %s\n",
-		  tmp_pathspec);
-
-  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (after symlink chase) at: %s\n",
-		  actual_cwrapper_path);
-  XFREE (tmp_pathspec);
-
-  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
-  strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
-  /* wrapper name transforms */
-  strendzap (actual_cwrapper_name, ".exe");
-  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
-  XFREE (actual_cwrapper_name);
-  actual_cwrapper_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  /* target_name transforms -- use actual target program name; might have lt- prefix */
-  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
-  strendzap (target_name, ".exe");
-  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
-  XFREE (target_name);
-  target_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(main) libtool target name: %s\n",
-		  target_name);
-EOF
-
-	    cat <<EOF
-  newargz[0] =
-    XMALLOC (char, (strlen (actual_cwrapper_path) +
-		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
-  strcpy (newargz[0], actual_cwrapper_path);
-  strcat (newargz[0], "$objdir");
-  strcat (newargz[0], "/");
-EOF
-
-	    cat <<"EOF"
-  /* stop here, and copy so we don't have to do this twice */
-  tmp_pathspec = xstrdup (newargz[0]);
-
-  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
-  strcat (newargz[0], actual_cwrapper_name);
-
-  /* DO want the lt- prefix here if it exists, so use target_name */
-  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
-  XFREE (tmp_pathspec);
-  tmp_pathspec = NULL;
-EOF
-
-	    case $host_os in
-	      mingw*)
-	    cat <<"EOF"
-  {
-    char* p;
-    while ((p = strchr (newargz[0], '\\')) != NULL)
-      {
-	*p = '/';
-      }
-    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
-      {
-	*p = '/';
-      }
-  }
-EOF
-	    ;;
-	    esac
-
-	    cat <<"EOF"
-  XFREE (target_name);
-  XFREE (actual_cwrapper_path);
-  XFREE (actual_cwrapper_name);
-
-  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
-  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
-  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
-     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
-     because on Windows, both *_VARNAMEs are PATH but uninstalled
-     libraries must come first. */
-  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-
-  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
-		  nonnull (lt_argv_zero));
-  for (i = 0; i < newargc; i++)
-    {
-      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
-		      i, nonnull (newargz[i]));
-    }
-
-EOF
-
-	    case $host_os in
-	      mingw*)
-		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);
-  if (rval == -1)
-    {
-      /* failed to start process */
-      lt_debugprintf (__FILE__, __LINE__,
-		      "(main) failed to launch target \"%s\": %s\n",
-		      lt_argv_zero, nonnull (strerror (errno)));
-      return 127;
-    }
-  return rval;
-EOF
-		;;
-	      *)
-		cat <<"EOF"
-  execv (lt_argv_zero, newargz);
-  return rval; /* =127, but avoids unused variable warning */
-EOF
-		;;
-	    esac
-
-	    cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
-  void *p = (void *) malloc (num);
-  if (!p)
-    lt_fatal (__FILE__, __LINE__, "memory exhausted");
-
-  return p;
-}
-
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
-			  string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
-  const char *base;
-
-#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;
-#endif
-
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
-
-int
-check_executable (const char *path)
-{
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if ((stat (path, &st) >= 0)
-      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
-    return 1;
-  else
-    return 0;
-}
-
-int
-make_executable (const char *path)
-{
-  int rval = 0;
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if (stat (path, &st) >= 0)
-    {
-      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
-    }
-  return rval;
-}
-
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise
-   Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
-  int has_slash = 0;
-  const char *p;
-  const char *p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  int tmp_len;
-  char *concat_name;
-
-  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
-                  nonempty (wrapper));
-
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
-
-  /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable (concat_name))
-	return concat_name;
-      XFREE (concat_name);
-    }
-  else
-    {
-#endif
-      if (IS_DIR_SEPARATOR (wrapper[0]))
-	{
-	  concat_name = xstrdup (wrapper);
-	  if (check_executable (concat_name))
-	    return concat_name;
-	  XFREE (concat_name);
-	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-    }
-#endif
-
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-      {
-	has_slash = 1;
-	break;
-      }
-  if (!has_slash)
-    {
-      /* no slashes; search PATH */
-      const char *path = getenv ("PATH");
-      if (path != NULL)
-	{
-	  for (p = path; *p; p = p_next)
-	    {
-	      const char *q;
-	      size_t p_len;
-	      for (q = p; *q; q++)
-		if (IS_PATH_SEPARATOR (*q))
-		  break;
-	      p_len = q - p;
-	      p_next = (*q == '\0' ? q : q + 1);
-	      if (p_len == 0)
-		{
-		  /* empty path: current directory */
-		  if (getcwd (tmp, LT_PATHMAX) == NULL)
-		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-                              nonnull (strerror (errno)));
-		  tmp_len = strlen (tmp);
-		  concat_name =
-		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, tmp, tmp_len);
-		  concat_name[tmp_len] = '/';
-		  strcpy (concat_name + tmp_len + 1, wrapper);
-		}
-	      else
-		{
-		  concat_name =
-		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, p, p_len);
-		  concat_name[p_len] = '/';
-		  strcpy (concat_name + p_len + 1, wrapper);
-		}
-	      if (check_executable (concat_name))
-		return concat_name;
-	      XFREE (concat_name);
-	    }
-	}
-      /* not found in PATH; assume curdir */
-    }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-              nonnull (strerror (errno)));
-  tmp_len = strlen (tmp);
-  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
-
-  if (check_executable (concat_name))
-    return concat_name;
-  XFREE (concat_name);
-  return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
-  return xstrdup (pathspec);
-#else
-  char buf[LT_PATHMAX];
-  struct stat s;
-  char *tmp_pathspec = xstrdup (pathspec);
-  char *p;
-  int has_symlinks = 0;
-  while (strlen (tmp_pathspec) && !has_symlinks)
-    {
-      lt_debugprintf (__FILE__, __LINE__,
-		      "checking path component for symlinks: %s\n",
-		      tmp_pathspec);
-      if (lstat (tmp_pathspec, &s) == 0)
-	{
-	  if (S_ISLNK (s.st_mode) != 0)
-	    {
-	      has_symlinks = 1;
-	      break;
-	    }
-
-	  /* search backwards for last DIR_SEPARATOR */
-	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
-	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    p--;
-	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    {
-	      /* no more DIR_SEPARATORS left */
-	      break;
-	    }
-	  *p = '\0';
-	}
-      else
-	{
-	  lt_fatal (__FILE__, __LINE__,
-		    "error accessing file \"%s\": %s",
-		    tmp_pathspec, nonnull (strerror (errno)));
-	}
-    }
-  XFREE (tmp_pathspec);
-
-  if (!has_symlinks)
-    {
-      return xstrdup (pathspec);
-    }
-
-  tmp_pathspec = realpath (pathspec, buf);
-  if (tmp_pathspec == 0)
-    {
-      lt_fatal (__FILE__, __LINE__,
-		"could not follow symlinks for %s", pathspec);
-    }
-  return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
-  size_t len, patlen;
-
-  assert (str != NULL);
-  assert (pat != NULL);
-
-  len = strlen (str);
-  patlen = strlen (pat);
-
-  if (patlen <= len)
-    {
-      str += len - patlen;
-      if (strcmp (str, pat) == 0)
-	*str = '\0';
-    }
-  return str;
-}
-
-void
-lt_debugprintf (const char *file, int line, const char *fmt, ...)
-{
-  va_list args;
-  if (lt_debug)
-    {
-      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
-      va_start (args, fmt);
-      (void) vfprintf (stderr, fmt, args);
-      va_end (args);
-    }
-}
-
-static void
-lt_error_core (int exit_status, const char *file,
-	       int line, const char *mode,
-	       const char *message, va_list ap)
-{
-  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
-
-  if (exit_status >= 0)
-    exit (exit_status);
-}
-
-void
-lt_fatal (const char *file, int line, const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
-  va_end (ap);
-}
-
-static const char *
-nonnull (const char *s)
-{
-  return s ? s : "(null)";
-}
-
-static const char *
-nonempty (const char *s)
-{
-  return (s && !*s) ? "(empty)" : nonnull (s);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_setenv) setting '%s' to '%s'\n",
-                  nonnull (name), nonnull (value));
-  {
-#ifdef HAVE_SETENV
-    /* always make a copy, for consistency with !HAVE_SETENV */
-    char *str = xstrdup (value);
-    setenv (name, str, 1);
-#else
-    int len = strlen (name) + 1 + strlen (value) + 1;
-    char *str = XMALLOC (char, len);
-    sprintf (str, "%s=%s", name, value);
-    if (putenv (str) != EXIT_SUCCESS)
-      {
-        XFREE (str);
-      }
-#endif
-  }
-}
-
-char *
-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);
-      new_value = XMALLOC (char, add_len + orig_value_len + 1);
-      if (to_end)
-        {
-          strcpy (new_value, orig_value);
-          strcpy (new_value + orig_value_len, add);
-        }
-      else
-        {
-          strcpy (new_value, add);
-          strcpy (new_value + add_len, orig_value);
-        }
-    }
-  else
-    {
-      new_value = xstrdup (add);
-    }
-  return new_value;
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *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]))
-        {
-          new_value[len-1] = '\0';
-        }
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-EOF
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-
-/* Prepares an argument vector before calling spawn().
-   Note that spawn() does not by itself call the command interpreter
-     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
-      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-         GetVersionEx(&v);
-         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
-      }) ? "cmd.exe" : "command.com").
-   Instead it simply concatenates the arguments, separated by ' ', and calls
-   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
-   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
-   special way:
-   - Space and tab are interpreted as delimiters. They are not treated as
-     delimiters if they are surrounded by double quotes: "...".
-   - Unescaped double quotes are removed from the input. Their only effect is
-     that within double quotes, space and tab are treated like normal
-     characters.
-   - Backslashes not followed by double quotes are not special.
-   - But 2*n+1 backslashes followed by a double quote become
-     n backslashes followed by a double quote (n >= 0):
-       \" -> "
-       \\\" -> \"
-       \\\\\" -> \\"
- */
-#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-char **
-prepare_spawn (char **argv)
-{
-  size_t argc;
-  char **new_argv;
-  size_t i;
-
-  /* Count number of arguments.  */
-  for (argc = 0; argv[argc] != NULL; argc++)
-    ;
-
-  /* Allocate new argument vector.  */
-  new_argv = XMALLOC (char *, argc + 1);
-
-  /* Put quoted arguments into the new argument vector.  */
-  for (i = 0; i < argc; i++)
-    {
-      const char *string = argv[i];
-
-      if (string[0] == '\0')
-	new_argv[i] = xstrdup ("\"\"");
-      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
-	{
-	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
-	  size_t length;
-	  unsigned int backslashes;
-	  const char *s;
-	  char *quoted_string;
-	  char *p;
-
-	  length = 0;
-	  backslashes = 0;
-	  if (quote_around)
-	    length++;
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		length += backslashes + 1;
-	      length++;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    length += backslashes + 1;
-
-	  quoted_string = XMALLOC (char, length + 1);
-
-	  p = quoted_string;
-	  backslashes = 0;
-	  if (quote_around)
-	    *p++ = '"';
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		{
-		  unsigned int j;
-		  for (j = backslashes + 1; j > 0; j--)
-		    *p++ = '\\';
-		}
-	      *p++ = c;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    {
-	      unsigned int j;
-	      for (j = backslashes; j > 0; j--)
-		*p++ = '\\';
-	      *p++ = '"';
-	    }
-	  *p = '\0';
-
-	  new_argv[i] = quoted_string;
-	}
-      else
-	new_argv[i] = (char *) string;
-    }
-  new_argv[argc] = NULL;
-
-  return new_argv;
-}
-EOF
-		;;
-	    esac
-
-            cat <<"EOF"
-void lt_dump_script (FILE* f)
-{
-EOF
-	    func_emit_wrapper yes |
-	      $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/  fputs ("\1", f);/p
-g
-D'
-            cat <<"EOF"
-}
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_win32_import_lib_p ARG
-# True if ARG is an import lib, as indicated by $file_magic_cmd
-func_win32_import_lib_p ()
-{
-    $opt_debug
-    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
-    *import*) : ;;
-    *) false ;;
-    esac
-}
-
-# func_mode_link arg...
-func_mode_link ()
-{
-    $opt_debug
-    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
-      # 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
-      # 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.
-      allow_undefined=yes
-      ;;
-    *)
-      allow_undefined=yes
-      ;;
-    esac
-    libtool_args=$nonopt
-    base_compile="$nonopt $@"
-    compile_command=$nonopt
-    finalize_command=$nonopt
-
-    compile_rpath=
-    finalize_rpath=
-    compile_shlibpath=
-    finalize_shlibpath=
-    convenience=
-    old_convenience=
-    deplibs=
-    old_deplibs=
-    compiler_flags=
-    linker_flags=
-    dllsearchpath=
-    lib_search_path=`pwd`
-    inst_prefix_dir=
-    new_inherited_linker_flags=
-
-    avoid_version=no
-    bindir=
-    dlfiles=
-    dlprefiles=
-    dlself=no
-    export_dynamic=no
-    export_symbols=
-    export_symbols_regex=
-    generated=
-    libobjs=
-    ltlibs=
-    module=no
-    no_install=no
-    objs=
-    non_pic_objects=
-    precious_files_regex=
-    prefer_static_libs=no
-    preload=no
-    prev=
-    prevarg=
-    release=
-    rpath=
-    xrpath=
-    perm_rpath=
-    temp_rpath=
-    thread_safe=no
-    vinfo=
-    vinfo_number=no
-    weak_libs=
-    single_module="${wl}-single_module"
-    func_infer_tag $base_compile
-
-    # We need to know -static, to get the right output filenames.
-    for arg
-    do
-      case $arg in
-      -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not 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
-	    func_warning "complete static linking is impossible in this configuration"
-	  fi
-	  if test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	-static)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=built
-	  ;;
-	-static-libtool-libs)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	esac
-	build_libtool_libs=no
-	build_old_libs=yes
-	break
-	;;
-      esac
-    done
-
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
-    # Go through the arguments, transforming them on the way.
-    while test "$#" -gt 0; do
-      arg="$1"
-      shift
-      func_quote_for_eval "$arg"
-      qarg=$func_quote_for_eval_unquoted_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)
-	  func_append compile_command " @OUTPUT@"
-	  func_append finalize_command " @OUTPUT@"
-	  ;;
-	esac
-
-	case $prev in
-	bindir)
-	  bindir="$arg"
-	  prev=
-	  continue
-	  ;;
-	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
-	    # Add the symbol object into the linking commands.
-	    func_append compile_command " @SYMFILE@"
-	    func_append finalize_command " @SYMFILE@"
-	    preload=yes
-	  fi
-	  case $arg in
-	  *.la | *.lo) ;;  # We handle these cases below.
-	  force)
-	    if test "$dlself" = no; then
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  self)
-	    if test "$prev" = dlprefiles; then
-	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
-	      dlself=yes
-	    else
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  *)
-	    if test "$prev" = dlfiles; then
-	      func_append dlfiles " $arg"
-	    else
-	      func_append dlprefiles " $arg"
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  esac
-	  ;;
-	expsyms)
-	  export_symbols="$arg"
-	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
-	  prev=
-	  continue
-	  ;;
-	expsyms_regex)
-	  export_symbols_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	framework)
-	  case $host in
-	    *-*-darwin*)
-	      case "$deplibs " in
-		*" $qarg.ltframework "*) ;;
-		*) func_append deplibs " $qarg.ltframework" # this is fixed later
-		   ;;
-	      esac
-	      ;;
-	  esac
-	  prev=
-	  continue
-	  ;;
-	inst_prefix)
-	  inst_prefix_dir="$arg"
-	  prev=
-	  continue
-	  ;;
-	objectlist)
-	  if test -f "$arg"; then
-	    save_arg=$arg
-	    moreargs=
-	    for fil in `cat "$save_arg"`
-	    do
-#	      func_append moreargs " $fil"
-	      arg=$fil
-	      # A libtool-controlled object.
-
-	      # Check to see that this really is a libtool object.
-	      if func_lalib_unsafe_p "$arg"; then
-		pic_object=
-		non_pic_object=
-
-		# Read the .lo file
-		func_source "$arg"
-
-		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'"
-		fi
-
-		# Extract subdirectory from the argument.
-		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
-
-		if test "$pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
-
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		      func_append dlfiles " $pic_object"
-		      prev=
-		      continue
-		    else
-		      # If libtool objects are unsupported, then we need to preload.
-		      prev=dlprefiles
-		    fi
-		  fi
-
-		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
-		    # Preload the old-style object.
-		    func_append dlprefiles " $pic_object"
-		    prev=
-		  fi
-
-		  # A PIC object.
-		  func_append libobjs " $pic_object"
-		  arg="$pic_object"
-		fi
-
-		# Non-PIC object.
-		if test "$non_pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  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"
-		  fi
-		else
-		  # If the PIC object exists, use it instead.
-		  # $xdir was prepended to $pic_object above.
-		  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"
-
-		  func_lo2o "$arg"
-		  pic_object=$xdir$objdir/$func_lo2o_result
-		  non_pic_object=$xdir$func_lo2o_result
-		  func_append libobjs " $pic_object"
-		  func_append non_pic_objects " $non_pic_object"
-	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
-		fi
-	      fi
-	    done
-	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
-	  fi
-	  arg=$save_arg
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	release)
-	  release="-$arg"
-	  prev=
-	  continue
-	  ;;
-	rpath | xrpath)
-	  # We need an absolute path.
-	  case $arg in
-	  [\\/]* | [A-Za-z]:[\\/]*) ;;
-	  *)
-	    func_fatal_error "only absolute run-paths are allowed"
-	    ;;
-	  esac
-	  if test "$prev" = rpath; then
-	    case "$rpath " in
-	    *" $arg "*) ;;
-	    *) func_append rpath " $arg" ;;
-	    esac
-	  else
-	    case "$xrpath " in
-	    *" $arg "*) ;;
-	    *) func_append xrpath " $arg" ;;
-	    esac
-	  fi
-	  prev=
-	  continue
-	  ;;
-	shrext)
-	  shrext_cmds="$arg"
-	  prev=
-	  continue
-	  ;;
-	weak)
-	  func_append weak_libs " $arg"
-	  prev=
-	  continue
-	  ;;
-	xcclinker)
-	  func_append linker_flags " $qarg"
-	  func_append compiler_flags " $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xcompiler)
-	  func_append compiler_flags " $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xlinker)
-	  func_append linker_flags " $qarg"
-	  func_append compiler_flags " $wl$qarg"
-	  prev=
-	  func_append compile_command " $wl$qarg"
-	  func_append finalize_command " $wl$qarg"
-	  continue
-	  ;;
-	*)
-	  eval "$prev=\"\$arg\""
-	  prev=
-	  continue
-	  ;;
-	esac
-      fi # test -n "$prev"
-
-      prevarg="$arg"
-
-      case $arg in
-      -all-static)
-	if test -n "$link_static_flag"; then
-	  # See comment for -static flag below, for more details.
-	  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"
-	;;
-
-      -avoid-version)
-	avoid_version=yes
-	continue
-	;;
-
-      -bindir)
-	prev=bindir
-	continue
-	;;
-
-      -dlopen)
-	prev=dlfiles
-	continue
-	;;
-
-      -dlpreopen)
-	prev=dlprefiles
-	continue
-	;;
-
-      -export-dynamic)
-	export_dynamic=yes
-	continue
-	;;
-
-      -export-symbols | -export-symbols-regex)
-	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
-	  prev=expsyms
-	else
-	  prev=expsyms_regex
-	fi
-	continue
-	;;
-
-      -framework)
-	prev=framework
-	continue
-	;;
-
-      -inst-prefix-dir)
-	prev=inst_prefix
-	continue
-	;;
-
-      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
-      # so, if we see these flags be careful not to treat them like -L
-      -L[A-Z][A-Z]*:*)
-	case $with_gcc/$host in
-	no/*-*-irix* | /*-*-irix*)
-	  func_append compile_command " $arg"
-	  func_append finalize_command " $arg"
-	  ;;
-	esac
-	continue
-	;;
-
-      -L*)
-	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'"
-	  else
-	    func_fatal_error "need path for \`-L' option"
-	  fi
-	fi
-	func_resolve_sysroot "$func_stripname_result"
-	dir=$func_resolve_sysroot_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  absdir=`cd "$dir" && pwd`
-	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
-	  ;;
-	esac
-	case "$deplibs " in
-	*" -L$dir "* | *" $arg "*)
-	  # Will only happen for absolute or sysroot arguments
-	  ;;
-	*)
-	  # Preserve sysroot, but never include relative directories
-	  case $dir in
-	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
-	    *) func_append deplibs " -L$dir" ;;
-	  esac
-	  func_append lib_search_path " $dir"
-	  ;;
-	esac
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$dir:"*) ;;
-	  ::) dllsearchpath=$dir;;
-	  *) func_append dllsearchpath ":$dir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) func_append dllsearchpath ":$testbindir";;
-	  esac
-	  ;;
-	esac
-	continue
-	;;
-
-      -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # These systems don't actually have a C or math library (as such)
-	    continue
-	    ;;
-	  *-*-os2*)
-	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C and math libraries are in the System framework
-	    func_append deplibs " System.ltframework"
-	    continue
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  esac
-	elif test "X$arg" = "X-lc_r"; then
-	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	   # Do not include libc_r directly, use -pthread flag.
-	   continue
-	   ;;
-	 esac
-	fi
-	func_append deplibs " $arg"
-	continue
-	;;
-
-      -module)
-	module=yes
-	continue
-	;;
-
-      # Tru64 UNIX uses -model [arg] to determine the layout of C++
-      # classes, name mangling, and exception handling.
-      # Darwin uses the -arch flag to determine output architecture.
-      -model|-arch|-isysroot|--sysroot)
-	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=*)
-	func_append compiler_flags " $arg"
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-	case "$new_inherited_linker_flags " in
-	    *" $arg "*) ;;
-	    * ) func_append new_inherited_linker_flags " $arg" ;;
-	esac
-	continue
-	;;
-
-      -multi_module)
-	single_module="${wl}-multi_module"
-	continue
-	;;
-
-      -no-fast-install)
-	fast_install=no
-	continue
-	;;
-
-      -no-install)
-	case $host in
-	*-*-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"
-	  fast_install=no
-	  ;;
-	*) no_install=yes ;;
-	esac
-	continue
-	;;
-
-      -no-undefined)
-	allow_undefined=no
-	continue
-	;;
-
-      -objectlist)
-	prev=objectlist
-	continue
-	;;
-
-      -o) prev=output ;;
-
-      -precious-files-regex)
-	prev=precious_regex
-	continue
-	;;
-
-      -release)
-	prev=release
-	continue
-	;;
-
-      -rpath)
-	prev=rpath
-	continue
-	;;
-
-      -R)
-	prev=xrpath
-	continue
-	;;
-
-      -R*)
-	func_stripname '-R' '' "$arg"
-	dir=$func_stripname_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	=*)
-	  func_stripname '=' '' "$dir"
-	  dir=$lt_sysroot$func_stripname_result
-	  ;;
-	*)
-	  func_fatal_error "only absolute run-paths are allowed"
-	  ;;
-	esac
-	case "$xrpath " in
-	*" $dir "*) ;;
-	*) func_append xrpath " $dir" ;;
-	esac
-	continue
-	;;
-
-      -shared)
-	# The effects of -shared are defined in a previous loop.
-	continue
-	;;
-
-      -shrext)
-	prev=shrext
-	continue
-	;;
-
-      -static | -static-libtool-libs)
-	# The effects of -static are defined in a previous loop.
-	# We used to do the same as -all-static on platforms that
-	# didn't have a PIC flag, but the assumption that the effects
-	# would be equivalent was wrong.  It would break on at least
-	# Digital Unix and AIX.
-	continue
-	;;
-
-      -thread-safe)
-	thread_safe=yes
-	continue
-	;;
-
-      -version-info)
-	prev=vinfo
-	continue
-	;;
-
-      -version-number)
-	prev=vinfo
-	vinfo_number=yes
-	continue
-	;;
-
-      -weak)
-        prev=weak
-	continue
-	;;
-
-      -Wc,*)
-	func_stripname '-Wc,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  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"
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Wl,*)
-	func_stripname '-Wl,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  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"
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Xcompiler)
-	prev=xcompiler
-	continue
-	;;
-
-      -Xlinker)
-	prev=xlinker
-	continue
-	;;
-
-      -XCClinker)
-	prev=xcclinker
-	continue
-	;;
-
-      # -msg_* for osf cc
-      -msg_*)
-	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-
-      # Flags to be passed through unchanged, with rationale:
-      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
-      # -r[0-9][0-9]*        specify processor for the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
-      # +DA*, +DD*           enable 64-bit mode for the HP compiler
-      # -q*                  compiler args for the IBM compiler
-      # -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
-      # @file                GCC response files
-      # -tp=*                Portland pgcc target processor selection
-      # --sysroot=*          for sysroot support
-      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-      -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)
-        func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-        func_append compile_command " $arg"
-        func_append finalize_command " $arg"
-        func_append compiler_flags " $arg"
-        continue
-        ;;
-
-      # Some other compiler flag.
-      -* | +*)
-        func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-
-      *.$objext)
-	# A standard object.
-	func_append objs " $arg"
-	;;
-
-      *.lo)
-	# A libtool-controlled object.
-
-	# Check to see that this really is a libtool object.
-	if func_lalib_unsafe_p "$arg"; then
-	  pic_object=
-	  non_pic_object=
-
-	  # Read the .lo file
-	  func_source "$arg"
-
-	  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'"
-	  fi
-
-	  # Extract subdirectory from the argument.
-	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
-
-	  if test "$pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
-
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		func_append dlfiles " $pic_object"
-		prev=
-		continue
-	      else
-		# If libtool objects are unsupported, then we need to preload.
-		prev=dlprefiles
-	      fi
-	    fi
-
-	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
-	      # Preload the old-style object.
-	      func_append dlprefiles " $pic_object"
-	      prev=
-	    fi
-
-	    # A PIC object.
-	    func_append libobjs " $pic_object"
-	    arg="$pic_object"
-	  fi
-
-	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    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"
-	    fi
-	  else
-	    # If the PIC object exists, use it instead.
-	    # $xdir was prepended to $pic_object above.
-	    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"
-
-	    func_lo2o "$arg"
-	    pic_object=$xdir$objdir/$func_lo2o_result
-	    non_pic_object=$xdir$func_lo2o_result
-	    func_append libobjs " $pic_object"
-	    func_append non_pic_objects " $non_pic_object"
-	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
-	  fi
-	fi
-	;;
-
-      *.$libext)
-	# An archive.
-	func_append deplibs " $arg"
-	func_append old_deplibs " $arg"
-	continue
-	;;
-
-      *.la)
-	# A libtool-controlled library.
-
-	func_resolve_sysroot "$arg"
-	if test "$prev" = dlfiles; then
-	  # This library was specified with -dlopen.
-	  func_append dlfiles " $func_resolve_sysroot_result"
-	  prev=
-	elif test "$prev" = dlprefiles; then
-	  # The library was specified with -dlpreopen.
-	  func_append dlprefiles " $func_resolve_sysroot_result"
-	  prev=
-	else
-	  func_append deplibs " $func_resolve_sysroot_result"
-	fi
-	continue
-	;;
-
-      # Some other compiler argument.
-      *)
-	# 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"
-	;;
-      esac # arg
-
-      # Now actually substitute the argument into the commands.
-      if test -n "$arg"; then
-	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"
-
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
-      eval arg=\"$export_dynamic_flag_spec\"
-      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"
-
-    if test -n "$shlibpath_var"; then
-      # get the directories listed in $shlibpath_var
-      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\"
-
-    func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
-    func_to_tool_file "$output_objdir/"
-    tool_output_objdir=$func_to_tool_file_result
-    # Create the object directory.
-    func_mkdir_p "$output_objdir"
-
-    # Determine the type of output
-    case $output in
-    "")
-      func_fatal_help "you must specify an output file"
-      ;;
-    *.$libext) linkmode=oldlib ;;
-    *.lo | *.$objext) linkmode=obj ;;
-    *.la) linkmode=lib ;;
-    *) linkmode=prog ;; # Anything else should be a program.
-    esac
-
-    specialdeplibs=
-
-    libs=
-    # 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
-	case "$libs " in
-	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	esac
-      fi
-      func_append libs " $deplib"
-    done
-
-    if test "$linkmode" = lib; then
-      libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
-      # Compute libraries that are listed more than once in $predeps
-      # $postdeps and mark them as special (i.e., whose duplicates are
-      # not to be eliminated).
-      pre_post_deps=
-      if $opt_duplicate_compiler_generated_deps; then
-	for pre_post_dep in $predeps $postdeps; do
-	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
-	  esac
-	  func_append pre_post_deps " $pre_post_dep"
-	done
-      fi
-      pre_post_deps=
-    fi
-
-    deplibs=
-    newdependency_libs=
-    newlib_search_path=
-    need_relink=no # whether we're linking any uninstalled libtool libraries
-    notinst_deplibs= # not-installed libtool libraries
-    notinst_path= # paths that contain not-installed libtool libraries
-
-    case $linkmode in
-    lib)
-	passes="conv dlpreopen link"
-	for file in $dlfiles $dlprefiles; do
-	  case $file in
-	  *.la) ;;
-	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
-	    ;;
-	  esac
-	done
-	;;
-    prog)
-	compile_deplibs=
-	finalize_deplibs=
-	alldeplibs=no
-	newdlfiles=
-	newdlprefiles=
-	passes="conv scan dlopen dlpreopen link"
-	;;
-    *)  passes="conv"
-	;;
-    esac
-
-    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
-	## 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"
-      fi
-
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
-	deplibs=
-      fi
-      if test "$linkmode" = prog; then
-	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
-	esac
-      fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
-	# Collect and forward deplibs of preopened libtool libs
-	for lib in $dlprefiles; do
-	  # Ignore non-libtool-libs
-	  dependency_libs=
-	  func_resolve_sysroot "$lib"
-	  case $lib in
-	  *.la)	func_source "$func_resolve_sysroot_result" ;;
-	  esac
-
-	  # Collect preopened libtool deplibs, except any this library
-	  # has declared as weak libs
-	  for deplib in $dependency_libs; do
-	    func_basename "$deplib"
-            deplib_base=$func_basename_result
-	    case " $weak_libs " in
-	    *" $deplib_base "*) ;;
-	    *) func_append deplibs " $deplib" ;;
-	    esac
-	  done
-	done
-	libs="$dlprefiles"
-      fi
-      if test "$pass" = dlopen; then
-	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
-	deplibs=
-      fi
-
-      for deplib in $libs; do
-	lib=
-	found=no
-	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
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    func_append compiler_flags " $deplib"
-	    if test "$linkmode" = lib ; then
-		case "$new_inherited_linker_flags " in
-		    *" $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"
-	    continue
-	  fi
-	  func_stripname '-l' '' "$deplib"
-	  name=$func_stripname_result
-	  if test "$linkmode" = lib; 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"
-	  fi
-	  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}"
-	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
-		else
-		  found=no
-		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 $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
-	      case " $predeps $postdeps " in
-	      *" $deplib "*)
-		if func_lalib_p "$lib"; then
-		  library_names=
-		  old_library=
-		  func_source "$lib"
-		  for l in $old_library $library_names; do
-		    ll="$l"
-		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
-		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
-		    lib=$ladir/$old_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
-		  fi
-		fi
-		;;
-	      *) ;;
-	      esac
-	    fi
-	  fi
-	  ;; # -l
-	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) func_append new_inherited_linker_flags " $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-L*)
-	  case $linkmode in
-	  lib)
-	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && 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
-	      deplibs="$deplib $deplibs"
-	      continue
-	    fi
-	    if test "$pass" = scan; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    func_stripname '-L' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    func_append newlib_search_path " $func_resolve_sysroot_result"
-	    ;;
-	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
-	    ;;
-	  esac # linkmode
-	  continue
-	  ;; # -L
-	-R*)
-	  if test "$pass" = link; 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 "*) ;;
-	    *) func_append xrpath " $dir" ;;
-	    esac
-	  fi
-	  deplibs="$deplib $deplibs"
-	  continue
-	  ;;
-	*.la)
-	  func_resolve_sysroot "$deplib"
-	  lib=$func_resolve_sysroot_result
-	  ;;
-	*.$libext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
-	  case $linkmode in
-	  lib)
-	    # Linking convenience modules into shared libraries is allowed,
-	    # but linking other static libraries is non-portable.
-	    case " $dlpreconveniencelibs " in
-	    *" $deplib "*) ;;
-	    *)
-	      valid_a_lib=no
-	      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
-		  fi
-		;;
-		pass_all)
-		  valid_a_lib=yes
-		;;
-	      esac
-	      if test "$valid_a_lib" != yes; then
-		echo
-		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-		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"
-		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
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    continue
-	    ;;
-	  esac # linkmode
-	  ;; # *.$libext
-	*.lo | *.$objext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
-	      # If there is no dlopen support or we're linking statically,
-	      # we need to preload.
-	      func_append newdlprefiles " $deplib"
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      func_append newdlfiles " $deplib"
-	    fi
-	  fi
-	  continue
-	  ;;
-	%DEPLIBS%)
-	  alldeplibs=yes
-	  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
-
-	# 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_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
-
-	dlname=
-	dlopen=
-	dlpreopen=
-	libdir=
-	library_names=
-	old_library=
-	inherited_linker_flags=
-	# If the library was installed with an old release of libtool,
-	# it will not redefine variables installed, or shouldnotlink
-	installed=yes
-	shouldnotlink=no
-	avoidtemprpath=
-
-
-	# Read the .la file
-	func_source "$lib"
-
-	# Convert "-framework foo" to "foo.ltframework"
-	if test -n "$inherited_linker_flags"; then
-	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
-	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
-	    case " $new_inherited_linker_flags " in
-	      *" $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" && func_append dlfiles " $dlopen"
-	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
-	fi
-
-	if test "$pass" = conv; 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'"
-	    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"
-	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done
-	  continue
-	fi # $pass = conv
-
-
-	# 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
-	  linklib=$old_library
-	else
-	  for l in $old_library $library_names; do
-	    linklib="$l"
-	  done
-	fi
-	if test -z "$linklib"; then
-	  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 -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; 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.
-	    func_append dlprefiles " $lib $dependency_libs"
-	  else
-	    func_append newdlfiles " $lib"
-	  fi
-	  continue
-	fi # $pass = dlopen
-
-	# We need an absolute path.
-	case $ladir in
-	[\\/]* | [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 "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
-	  fi
-	  ;;
-	esac
-	func_basename "$lib"
-	laname="$func_basename_result"
-
-	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; 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"
-	  else
-	    dir="$lt_sysroot$libdir"
-	    absdir="$lt_sysroot$libdir"
-	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
-	else
-	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    # Remove this search path later
-	    func_append notinst_path " $abs_ladir"
-	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
-	    # Remove this search path later
-	    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'"
-	  fi
-	  case "$host" in
-	    # special handling for platforms with PE-DLLs.
-	    *cygwin* | *mingw* | *cegcc* )
-	      # Linker will automatically link against shared library if both
-	      # static and shared are present.  Therefore, ensure we extract
-	      # symbols from the import library if a shared library is present
-	      # (otherwise, the dlopen module name will be incorrect).  We do
-	      # this by putting the import library name into $newdlprefiles.
-	      # We recover the dlopen module name by 'saving' the la file
-	      # name in a special purpose variable, and (later) extracting the
-	      # dlname from the la file.
-	      if test -n "$dlname"; then
-	        func_tr_sh "$dir/$linklib"
-	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
-	        func_append newdlprefiles " $dir/$linklib"
-	      else
-	        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" && \
-	          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
-	        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" && \
-	          func_append dlpreconveniencelibs " $dir/$old_library"
-	      # Otherwise, use the dlname, so that lt_dlopen finds it.
-	      elif test -n "$dlname"; then
-	        func_append newdlprefiles " $dir/$dlname"
-	      else
-	        func_append newdlprefiles " $dir/$linklib"
-	      fi
-	    ;;
-	  esac
-	fi # $pass = dlpreopen
-
-	if test -z "$libdir"; then
-	  # Link the convenience library
-	  if test "$linkmode" = lib; then
-	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$dir/$old_library $compile_deplibs"
-	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
-	  else
-	    deplibs="$lib $deplibs" # used for prog,scan pass
-	  fi
-	  continue
-	fi
-
-
-	if test "$linkmode" = prog && test "$pass" != link; 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
-	  fi
-
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    case $deplib in
-	    -L*) func_stripname '-L' '' "$deplib"
-	         func_resolve_sysroot "$func_stripname_result"
-	         func_append newlib_search_path " $func_resolve_sysroot_result"
-		 ;;
-	    esac
-	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; 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
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done # for deplib
-	  continue
-	fi # $linkmode = prog...
-
-	if test "$linkmode,$pass" = "prog,link"; then
-	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
-	       test -z "$old_library"; }; then
-	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
-	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
-	      *"$absdir:"*) ;;
-	      *) func_append temp_rpath "$absdir:" ;;
-	      esac
-	    fi
-
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) func_append compile_rpath " $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $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 &&
-		 test -n "$library_names"; }; }; then
-	    # We only need to search for static libraries
-	    continue
-	  fi
-	fi
-
-	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
-	  use_static_libs=no
-	fi
-	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
-	  case $host in
-	  *cygwin* | *mingw* | *cegcc*)
-	      # No point in relinking DLLs because paths are not encoded
-	      func_append notinst_deplibs " $lib"
-	      need_relink=no
-	    ;;
-	  *)
-	    if test "$installed" = no; then
-	      func_append notinst_deplibs " $lib"
-	      need_relink=yes
-	    fi
-	    ;;
-	  esac
-	  # This is a shared library
-
-	  # Warn about portability, can't link against -module's on some
-	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
-	  for dlpremoduletest in $dlprefiles; do
-	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
-	      break
-	    fi
-	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
-	    echo
-	    if test "$linkmode" = prog; 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
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) func_append compile_rpath " $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append finalize_rpath " $libdir" ;;
-	      esac
-	      ;;
-	    esac
-	  fi
-
-	  if test -n "$old_archive_from_expsyms_cmds"; then
-	    # figure out the soname
-	    set dummy $library_names
-	    shift
-	    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"
-	    elif test -n "$soname_spec"; then
-	      # bleh windows
-	      case $host in
-	      *cygwin* | mingw* | *cegcc*)
-	        func_arith $current - $age
-		major=$func_arith_result
-		versuffix="-$major"
-		;;
-	      esac
-	      eval soname=\"$soname_spec\"
-	    else
-	      soname="$realname"
-	    fi
-
-	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
-	    func_basename "$soroot"
-	    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_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_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
-	    fi
-	    # make sure the library variables are pointing to the new library
-	    dir=$output_objdir
-	    linklib=$newlib
-	  fi # test -n "$old_archive_from_expsyms_cmds"
-
-	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    lib_linked=yes
-	    case $hardcode_action in
-	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
-		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
-		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
-		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
-		    # link against it, someone is ignoring the earlier warnings
-		    if /usr/bin/file -L $add 2> /dev/null |
-			 $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
-			  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"
-			fi
-		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
-		      fi
-		    fi
-		esac
-	      elif test "$hardcode_minus_L" = no; then
-		case $host in
-		*-*-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"
-	      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"
-		# Try looking first in the location we're being installed to.
-		if test -n "$inst_prefix_dir"; then
-		  case $libdir in
-		    [\\/]*)
-		      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"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    *) lib_linked=no ;;
-	    esac
-
-	    if test "$lib_linked" != yes; then
-	      func_fatal_configuration "unsupported hardcode properties"
-	    fi
-
-	    if test -n "$add_shlibpath"; then
-	      case :$compile_shlibpath: in
-	      *":$add_shlibpath:"*) ;;
-	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
-	      esac
-	    fi
-	    if test "$linkmode" = prog; 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
-		case :$finalize_shlibpath: in
-		*":$libdir:"*) ;;
-		*) func_append finalize_shlibpath "$libdir:" ;;
-		esac
-	      fi
-	    fi
-	  fi
-
-	  if test "$linkmode" = prog || test "$opt_mode" = relink; 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
-	      case :$finalize_shlibpath: in
-	      *":$libdir:"*) ;;
-	      *) func_append finalize_shlibpath "$libdir:" ;;
-	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
-	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
-	      else
-		add="$libdir/$linklib"
-	      fi
-	    else
-	      # We cannot seem to hardcode it, guess we'll fake it.
-	      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
-		  [\\/]*)
-		    func_append add_dir " -L$inst_prefix_dir$libdir"
-		    ;;
-		esac
-	      fi
-	      add="-l$name"
-	    fi
-
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
-	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	    fi
-	  fi
-	elif test "$linkmode" = prog; 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"
-	    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
-	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; 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 "*** 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
-	      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 "*** not find such a program.  So, this module is probably useless."
-		echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	      fi
-	      if test "$build_old_libs" = no; then
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  else
-	    deplibs="$dir/$old_library $deplibs"
-	    link_static=yes
-	  fi
-	fi # link shared/static library?
-
-	if test "$linkmode" = lib; then
-	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
-	    # Extract -R from dependency_libs
-	    temp_deplibs=
-	    for libdir in $dependency_libs; do
-	      case $libdir in
-	      -R*) func_stripname '-R' '' "$libdir"
-	           temp_xrpath=$func_stripname_result
-		   case " $xrpath " in
-		   *" $temp_xrpath "*) ;;
-		   *) func_append xrpath " $temp_xrpath";;
-		   esac;;
-	      *) func_append temp_deplibs " $libdir";;
-	      esac
-	    done
-	    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"
-	  # ... and its dependency_libs
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    newdependency_libs="$deplib $newdependency_libs"
-	    case $deplib in
-              -L*) func_stripname '-L' '' "$deplib"
-                   func_resolve_sysroot "$func_stripname_result";;
-              *) func_resolve_sysroot "$deplib" ;;
-            esac
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $func_resolve_sysroot_result "*)
-                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $func_resolve_sysroot_result"
-	  done
-
-	  if test "$link_all_deplibs" != no; then
-	    # Add the search paths of all dependency libraries
-	    for deplib in $dependency_libs; do
-	      path=
-	      case $deplib in
-	      -L*) path="$deplib" ;;
-	      *.la)
-	        func_resolve_sysroot "$deplib"
-	        deplib=$func_resolve_sysroot_result
-	        func_dirname "$deplib" "" "."
-		dir=$func_dirname_result
-		# We need an absolute path.
-		case $dir in
-		[\\/]* | [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"
-		  fi
-		  ;;
-		esac
-		if $GREP "^installed=no" $deplib > /dev/null; then
-		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
-		      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 -z "$darwin_install_name"; then
-                          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}"
-		      path=
-		    fi
-		  fi
-		  ;;
-		*)
-		  path="-L$absdir/$objdir"
-		  ;;
-		esac
-		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
-		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
-
-		  path="-L$absdir"
-		fi
-		;;
-	      esac
-	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$path $deplibs" ;;
-	      esac
-	    done
-	  fi # link_all_deplibs != no
-	fi # linkmode = lib
-      done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; 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
-	# 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
-	  # 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 "*) ;;
-	    *) func_append lib_search_path " $dir" ;;
-	    esac
-	  done
-	  newlib_search_path=
-	fi
-
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
-	  vars="compile_deplibs finalize_deplibs"
-	fi
-	for var in $vars dependency_libs; do
-	  # Add libraries to $var in reverse order
-	  eval tmp_libs=\"\$$var\"
-	  new_libs=
-	  for deplib in $tmp_libs; do
-	    # FIXME: Pedantically, this is the right thing to do, so
-	    #        that some nasty dependency loop isn't accidentally
-	    #        broken:
-	    #new_libs="$deplib $new_libs"
-	    # Pragmatically, this seems to cause very few problems in
-	    # practice:
-	    case $deplib in
-	    -L*) new_libs="$deplib $new_libs" ;;
-	    -R*) ;;
-	    *)
-	      # And here is the reason: when a library appears more
-	      # than once as an explicit dependence of a library, or
-	      # is implicitly linked in more than once by the
-	      # compiler, it is considered special, and multiple
-	      # occurrences thereof are not removed.  Compare this
-	      # with having the same library being listed as a
-	      # dependency of multiple other libraries: in this case,
-	      # we know (pedantically, we assume) the library does not
-	      # need to be listed more than once, so we keep only the
-	      # last copy.  This is not always right, but it is rare
-	      # enough that we require users that really mean to play
-	      # such unportable linking tricks to link the library
-	      # using -Wl,-lname, so that libtool does not consider it
-	      # for duplicate removal.
-	      case " $specialdeplibs " in
-	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
-	      *)
-		case " $new_libs " in
-		*" $deplib "*) ;;
-		*) new_libs="$deplib $new_libs" ;;
-		esac
-		;;
-	      esac
-	      ;;
-	    esac
-	  done
-	  tmp_libs=
-	  for deplib in $new_libs; do
-	    case $deplib in
-	    -L*)
-	      case " $tmp_libs " in
-	      *" $deplib "*) ;;
-	      *) func_append tmp_libs " $deplib" ;;
-	      esac
-	      ;;
-	    *) func_append tmp_libs " $deplib" ;;
-	    esac
-	  done
-	  eval $var=\"$tmp_libs\"
-	done # for var
-      fi
-      # Last step: remove runtime libs from dependency_libs
-      # (they stay in deplibs)
-      tmp_libs=
-      for i in $dependency_libs ; do
-	case " $predeps $postdeps $compiler_lib_search_path " in
-	*" $i "*)
-	  i=""
-	  ;;
-	esac
-	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"
-    fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
-    fi
-
-    case $linkmode in
-    oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
-
-      test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
-
-      test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
-
-      test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
-
-      # Now set the variables for building old libraries.
-      build_libtool_libs=no
-      oldlibs="$output"
-      func_append objs "$old_deplibs"
-      ;;
-
-    lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
-      case $outputname in
-      lib*)
-	func_stripname 'lib' '.la' "$outputname"
-	name=$func_stripname_result
-	eval shared_ext=\"$shrext_cmds\"
-	eval libname=\"$libname_spec\"
-	;;
-      *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
-
-	if test "$need_lib_prefix" != no; then
-	  # Add the "lib" prefix for modules if required
-	  func_stripname '' '.la' "$outputname"
-	  name=$func_stripname_result
-	  eval shared_ext=\"$shrext_cmds\"
-	  eval libname=\"$libname_spec\"
-	else
-	  func_stripname '' '.la' "$outputname"
-	  libname=$func_stripname_result
-	fi
-	;;
-      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"
-	else
-	  echo
-	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
-	  $ECHO "*** objects $objs is not portable!"
-	  func_append libobjs " $objs"
-	fi
-      fi
-
-      test "$dlself" != no && \
-	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"
-
-      install_libdir="$1"
-
-      oldlibs=
-      if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
-	  # Building a libtool convenience library.
-	  # 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"
-	  build_libtool_libs=convenience
-	  build_old_libs=yes
-	fi
-
-	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
-
-	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
-      else
-
-	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
-	set dummy $vinfo 0 0 0
-	shift
-	IFS="$save_ifs"
-
-	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
-
-	# convert absolute version numbers to libtool ages
-	# this retains compatibility with .la files and attempts
-	# to make the code below a bit more comprehensible
-
-	case $vinfo_number in
-	yes)
-	  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
-	  #
-	  case $version_type in
-	  # correct linux to gnu/linux during the next big refactor
-	  darwin|linux|osf|windows|none)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
-	    ;;
-	  freebsd-aout|freebsd-elf|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"
-	    lt_irix_increment=no
-	    ;;
-	  esac
-	  ;;
-	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
-	  ;;
-	esac
-
-	# Check that each of the things are valid numbers.
-	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"
-	  ;;
-	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"
-	  ;;
-	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"
-	  ;;
-	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"
-	fi
-
-	# Calculate the version variables.
-	major=
-	versuffix=
-	verstring=
-	case $version_type in
-	none) ;;
-
-	darwin)
-	  # Like Linux, but with the current version available in
-	  # verstring for coding it into the library header
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  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"
-	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-	  ;;
-
-	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
-	  ;;
-
-	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
-	  ;;
-
-	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
-	    func_arith $current - $age
-	  else
-	    func_arith $current - $age + 1
-	  fi
-	  major=$func_arith_result
-
-	  case $version_type in
-	    nonstopux) verstring_prefix=nonstopux ;;
-	    *)         verstring_prefix=sgi ;;
-	  esac
-	  verstring="$verstring_prefix$major.$revision"
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$revision
-	  while test "$loop" -ne 0; do
-	    func_arith $revision - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
-	  done
-
-	  # Before this point, $major must not contain `.'.
-	  major=.$major
-	  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"
-	  ;;
-
-	osf)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  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
-	    func_arith $current - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
-	  done
-
-	  # Make executables depend on our current version.
-	  func_append verstring ":${current}.0"
-	  ;;
-
-	qnx)
-	  major=".$current"
-	  versuffix=".$current"
-	  ;;
-
-	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
-	  ;;
-
-	windows)
-	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
-	  func_arith $current - $age
-	  major=$func_arith_result
-	  versuffix="-$major"
-	  ;;
-
-	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
-	  ;;
-	esac
-
-	# Clear the version info if we defaulted, and they specified a release.
-	if test -z "$vinfo" && test -n "$release"; then
-	  major=
-	  case $version_type in
-	  darwin)
-	    # we can't check for "0.0" in archive_cmds due to quoting
-	    # problems, so we reset it completely
-	    verstring=
-	    ;;
-	  *)
-	    verstring="0.0"
-	    ;;
-	  esac
-	  if test "$need_version" = no; then
-	    versuffix=
-	  else
-	    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
-	  major=
-	  versuffix=
-	  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
-	  fi
-	else
-	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
-	fi
-
-      fi
-
-      func_generate_dlsyms "$libname" "$libname" "yes"
-      func_append libobjs " $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
-
-      if test "$opt_mode" != relink; then
-	# Remove our outputs, but don't remove object files since they
-	# may have been created when compiling PIC objects.
-	removelist=
-	tempremovelist=`$ECHO "$output_objdir/*"`
-	for p in $tempremovelist; do
-	  case $p in
-	    *.$objext | *.gcno)
-	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
-		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-		 then
-		   continue
-		 fi
-	       fi
-	       func_append removelist " $p"
-	       ;;
-	    *) ;;
-	  esac
-	done
-	test -n "$removelist" && \
-	  func_show_eval "${RM}r \$removelist"
-      fi
-
-      # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
-	func_append oldlibs " $output_objdir/$libname.$libext"
-
-	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
-      fi
-
-      # Eliminate all temporary directories.
-      #for path in $notinst_path; do
-      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
-      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
-      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
-      #done
-
-      if test -n "$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	temp_xrpath=
-	for libdir in $xrpath; do
-	  func_replace_sysroot "$libdir"
-	  func_append temp_xrpath " -R$func_replace_sysroot_result"
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_rpath " $libdir" ;;
-	  esac
-	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
-	  dependency_libs="$temp_xrpath $dependency_libs"
-	fi
-      fi
-
-      # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
-      dlfiles=
-      for lib in $old_dlfiles; do
-	case " $dlprefiles $dlfiles " in
-	*" $lib "*) ;;
-	*) func_append dlfiles " $lib" ;;
-	esac
-      done
-
-      # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
-      dlprefiles=
-      for lib in $old_dlprefiles; do
-	case "$dlprefiles " in
-	*" $lib "*) ;;
-	*) func_append dlprefiles " $lib" ;;
-	esac
-      done
-
-      if test "$build_libtool_libs" = yes; then
-	if test -n "$rpath"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # these systems don't actually have a c library (as such)!
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C library is in the System framework
-	    func_append deplibs " System.ltframework"
-	    ;;
-	  *-*-netbsd*)
-	    # Don't link with libc until the a.out ld.so is fixed.
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    ;;
-	  *)
-	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
-	      func_append deplibs " -lc"
-	    fi
-	    ;;
-	  esac
-	fi
-
-	# Transform deplibs into only deplibs that can be linked in shared.
-	name_save=$name
-	libname_save=$libname
-	release_save=$release
-	versuffix_save=$versuffix
-	major_save=$major
-	# 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=""
-	newdeplibs=
-	droppeddeps=no
-	case $deplibs_check_method in
-	pass_all)
-	  # Don't check for shared/static.  Everything works.
-	  # This might be a little naive.  We might want to check
-	  # whether the library exists or not.  But this is on
-	  # osf3 & osf4 and I'm not really sure... Just
-	  # implementing what was already the behavior.
-	  newdeplibs=$deplibs
-	  ;;
-	test_compile)
-	  # This code stresses the "libraries are programs" paradigm to its
-	  # limits. Maybe even breaks it.  We compile a program, linking it
-	  # against the deplibs as a proxy for the library.  Then we can check
-	  # whether they linked in statically or dynamically with ldd.
-	  $opt_dry_run || $RM conftest.c
-	  cat > conftest.c <<EOF
-	  int main() { return 0; }
-EOF
-	  $opt_dry_run || $RM conftest
-	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
-	    ldd_output=`ldd conftest`
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		  case " $predeps $postdeps " in
-		  *" $i "*)
-		    func_append newdeplibs " $i"
-		    i=""
-		    ;;
-		  esac
-		fi
-		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
-		    func_append newdeplibs " $i"
-		  else
-		    droppeddeps=yes
-		    echo
-		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		    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 I believe you do not have"
-		    echo "*** because a test_compile did reveal that the linker did not use it for"
-		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
-		  fi
-		fi
-		;;
-	      *)
-		func_append newdeplibs " $i"
-		;;
-	      esac
-	    done
-	  else
-	    # Error occurred in the first compile.  Let's try to salvage
-	    # the situation: Compile a separate program for each library.
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		$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
-		    case " $predeps $postdeps " in
-		    *" $i "*)
-		      func_append newdeplibs " $i"
-		      i=""
-		      ;;
-		    esac
-		  fi
-		  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
-		      func_append newdeplibs " $i"
-		    else
-		      droppeddeps=yes
-		      echo
-		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		      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"
-		      echo "*** because a test_compile did reveal that the linker did not use this one"
-		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
-		    fi
-		  fi
-		else
-		  droppeddeps=yes
-		  echo
-		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
-		  echo "*** make it link in!  You will probably need to install it or some"
-		  echo "*** library that it depends on before this library will be fully"
-		  echo "*** functional.  Installing it before continuing would be even better."
-		fi
-		;;
-	      *)
-		func_append newdeplibs " $i"
-		;;
-	      esac
-	    done
-	  fi
-	  ;;
-	file_magic*)
-	  set dummy $deplibs_check_method; shift
-	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      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`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test "$want_nocaseglob" = yes; then
-		    shopt -s nocaseglob
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		    $nocaseglob
-		  else
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		  fi
-		  for potent_lib in $potential_libs; do
-		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null |
-			 $GREP " -> " >/dev/null; then
-			continue
-		      fi
-		      # The statement above tries to avoid entering an
-		      # endless loop below, in case of cyclic links.
-		      # We might still enter an endless loop, since a link
-		      # loop can be closed while we follow links,
-		      # but so what?
-		      potlib="$potent_lib"
-		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
-			case $potliblink in
-			[\\/]* | [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=""
-			break 2
-		      fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		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"
-		echo "*** because I did check the linker path looking for a file starting"
-		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"
-		  $ECHO "*** using a file magic. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      func_append newdeplibs " $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	match_pattern*)
-	  set dummy $deplibs_check_method; shift
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      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
-		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
-		       $EGREP "$match_pattern_regex" > /dev/null; then
-		      func_append newdeplibs " $a_deplib"
-		      a_deplib=""
-		      break 2
-		    fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		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"
-		echo "*** because I did check the linker path looking for a file starting"
-		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"
-		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      func_append newdeplibs " $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	none | unknown | *)
-	  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
-	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
-	    done
-	  fi
-	  case $tmp_deplibs in
-	  *[!\	\ ]*)
-	    echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
-	      echo "*** Warning: inter-library dependencies are not supported in this platform."
-	    else
-	      echo "*** Warning: inter-library dependencies are not known to be supported."
-	    fi
-	    echo "*** All declared inter-library dependencies are being dropped."
-	    droppeddeps=yes
-	    ;;
-	  esac
-	  ;;
-	esac
-	versuffix=$versuffix_save
-	major=$major_save
-	release=$release_save
-	libname=$libname_save
-	name=$name_save
-
-	case $host in
-	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library with the System framework
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
-	  ;;
-	esac
-
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
-	    echo
-	    echo "*** Warning: libtool could not satisfy all declared inter-library"
-	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
-	    echo "*** a static module, that should work as long as the dlopening"
-	    echo "*** application is linked with the -dlopen flag."
-	    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 "*** not find such a program.  So, this module is probably useless."
-	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
-	      build_libtool_libs=module
-	      build_old_libs=yes
-	    else
-	      build_libtool_libs=no
-	    fi
-	  else
-	    echo "*** The inter-library dependencies that have been dropped here will be"
-	    echo "*** automatically added whenever a program is linked with this library"
-	    echo "*** or is declared to -dlopen it."
-
-	    if test "$allow_undefined" = no; 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"
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  fi
-	fi
-	# Done checking deplibs!
-	deplibs=$newdeplibs
-      fi
-      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
-      case $host in
-	*-*-darwin*)
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  ;;
-      esac
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $deplibs " in
-	  *" -L$path/$objdir "*)
-	    func_append new_libs " -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) func_append new_libs " $deplib" ;;
-	  esac
-	  ;;
-	*) func_append new_libs " $deplib" ;;
-	esac
-      done
-      deplibs="$new_libs"
-
-      # All the library-specific variables (install_libdir is set above).
-      library_names=
-      old_library=
-      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.
-	# FIXME: should test the right _cmds variable.
-	case $archive_cmds in
-	  *\$LD\ *) wl= ;;
-        esac
-	if test "$hardcode_into_libs" = yes; then
-	  # Hardcode the library paths
-	  hardcode_libdirs=
-	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$opt_mode" != relink && 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"
-		else
-		  # Just accumulate the unique libdirs.
-		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		    ;;
-		  *)
-		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		    ;;
-		  esac
-		fi
-	      else
-		eval flag=\"$hardcode_libdir_flag_spec\"
-		func_append dep_rpath " $flag"
-	      fi
-	    elif test -n "$runpath_var"; then
-	      case "$perm_rpath " in
-	      *" $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"
-	    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
-	      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"
-	if test -n "$shlibpath"; then
-	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
-	fi
-
-	# Get the real and link names of the library.
-	eval shared_ext=\"$shrext_cmds\"
-	eval library_names=\"$library_names_spec\"
-	set dummy $library_names
-	shift
-	realname="$1"
-	shift
-
-	if test -n "$soname_spec"; then
-	  eval soname=\"$soname_spec\"
-	else
-	  soname="$realname"
-	fi
-	if test -z "$dlname"; then
-	  dlname=$soname
-	fi
-
-	lib="$output_objdir/$realname"
-	linknames=
-	for link
-	do
-	  func_append linknames " $link"
-	done
-
-	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	test "X$libobjs" = "X " && libobjs=
-
-	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"
-	  func_append delfiles " $export_symbols"
-	fi
-
-	orig_export_symbols=
-	case $host_os in
-	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
-	      # 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"
-	      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"
-	    $opt_dry_run || $RM $export_symbols
-	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
-	    for cmd1 in $cmds; do
-	      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
-		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
-		  try_normal_branch=yes
-		  eval cmd=\"$cmd1\"
-		  func_len " $cmd"
-		  len=$func_len_result
-		  ;;
-		*)
-		  try_normal_branch=no
-		  ;;
-	      esac
-	      if test "$try_normal_branch" = yes \
-		 && { test "$len" -lt "$max_cmd_len" \
-		      || test "$max_cmd_len" -le -1; }
-	      then
-		func_show_eval "$cmd" 'exit $?'
-		skipped_export=false
-	      elif test -n "$nm_file_list_spec"; then
-		func_basename "$output"
-		output_la=$func_basename_result
-		save_libobjs=$libobjs
-		save_output=$output
-		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"
-		func_verbose "creating $NM input file list: $output"
-		for obj in $save_libobjs; do
-		  func_to_tool_file "$obj"
-		  $ECHO "$func_to_tool_file_result"
-		done > "$output"
-		eval cmd=\"$cmd1\"
-		func_show_eval "$cmd" 'exit $?'
-		output=$save_output
-		libobjs=$save_libobjs
-		skipped_export=false
-	      else
-		# The command line is too long to execute in one step.
-		func_verbose "using reloadable object file for export list..."
-		skipped_export=:
-		# Break out early, otherwise skipped_export may be
-		# set to false by a later but shorter cmd.
-		break
-	      fi
-	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-	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"
-	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
-	fi
-
-	if test "X$skipped_export" != "X:" && 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"
-	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # '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
-	  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
-
-	tmp_deplibs=
-	for test_deplib in $deplibs; do
-	  case " $convenience " in
-	  *" $test_deplib "*) ;;
-	  *)
-	    func_append tmp_deplibs " $test_deplib"
-	    ;;
-	  esac
-	done
-	deplibs="$tmp_deplibs"
-
-	if test -n "$convenience"; then
-	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
-	    test -z "$libobjs"; then
-	    # extract the archives, so we have objects to list.
-	    # TODO: could optimize this to just extract one archive.
-	    whole_archive_flag_spec=
-	  fi
-	  if test -n "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  else
-	    gentop="$output_objdir/${outputname}x"
-	    func_append generated " $gentop"
-
-	    func_extract_archives $gentop $convenience
-	    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
-	  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
-	  $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 -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	    eval test_cmds=\"$module_expsym_cmds\"
-	    cmds=$module_expsym_cmds
-	  else
-	    eval test_cmds=\"$module_cmds\"
-	    cmds=$module_cmds
-	  fi
-	else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    eval test_cmds=\"$archive_expsym_cmds\"
-	    cmds=$archive_expsym_cmds
-	  else
-	    eval test_cmds=\"$archive_cmds\"
-	    cmds=$archive_cmds
-	  fi
-	fi
-
-	if test "X$skipped_export" != "X:" &&
-	   func_len " $test_cmds" &&
-	   len=$func_len_result &&
-	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  :
-	else
-	  # The command line is too long to link in one step, link piecewise
-	  # or, if using GNU ld and skipped_export is not :, use a linker
-	  # script.
-
-	  # Save the value of $output and $libobjs because we want to
-	  # use them later.  If we have whole_archive_flag_spec, we
-	  # want to use save_libobjs as it was before
-	  # whole_archive_flag_spec was expanded, because we can't
-	  # assume the linker understands whole_archive_flag_spec.
-	  # This may have to be revisited, in case too many
-	  # convenience libraries get linked in and end up exceeding
-	  # the spec.
-	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	  fi
-	  save_output=$output
-	  func_basename "$output"
-	  output_la=$func_basename_result
-
-	  # Clear the reloadable object creation command queue and
-	  # initialize k to one.
-	  test_cmds=
-	  concat_cmds=
-	  objlist=
-	  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
-	    func_verbose "creating GNU ld script: $output"
-	    echo 'INPUT (' > $output
-	    for obj in $save_libobjs
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    echo ')' >> $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
-	    func_verbose "creating linker input file list: $output"
-	    : > $output
-	    set x $save_libobjs
-	    shift
-	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
-	      firstobj="$1 "
-	      shift
-	    fi
-	    for obj
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    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
-	      eval test_cmds=\"$reload_cmds\"
-	      func_len " $test_cmds"
-	      len0=$func_len_result
-	      len=$len0
-
-	      # Loop over the list of objects to be linked.
-	      for obj in $save_libobjs
-	      do
-		func_len " $obj"
-		func_arith $len + $func_len_result
-		len=$func_arith_result
-		if test "X$objlist" = X ||
-		   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
-		    # The first file doesn't have a previous command to add.
-		    reload_objs=$objlist
-		    eval concat_cmds=\"$reload_cmds\"
-		  else
-		    # All subsequent reloadable object files will link in
-		    # the last one created.
-		    reload_objs="$objlist $last_robj"
-		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
-		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
-		  func_arith $k + 1
-		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
-		  objlist=" $obj"
-		  func_len " $last_robj"
-		  func_arith $len0 + $func_len_result
-		  len=$func_arith_result
-		fi
-	      done
-	      # Handle the remaining objects by creating one last
-	      # reloadable object file.  All subsequent reloadable object
-	      # 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\"
-	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
-	      fi
-	      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"
-	      $opt_dry_run || $RM $export_symbols
-	      libobjs=$output
-	      # Append the command to create the export file.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
-	      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='~'
-	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
-		  func_quote_for_expand "$cmd"
-		  eval "func_echo $func_quote_for_expand_result"
-	      }
-	      $opt_dry_run || eval "$cmd" || {
-		lt_exit=$?
-
-		# Restore the uninstalled library and exit
-		if test "$opt_mode" = relink; then
-		  ( cd "$output_objdir" && \
-		    $RM "${realname}T" && \
-		    $MV "${realname}U" "$realname" )
-		fi
-
-		exit $lt_exit
-	      }
-	    done
-	    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"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-
-          if ${skipped_export-false}; then
-	    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"
-	      $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"
-	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # '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
-	      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.
-	  output=$save_output
-
-	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	  # Expand the library linking commands again to reset the
-	  # value of $libobjs for piecewise linking.
-
-	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
-	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	      cmds=$module_expsym_cmds
-	    else
-	      cmds=$module_cmds
-	    fi
-	  else
-	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	      cmds=$archive_expsym_cmds
-	    else
-	      cmds=$archive_cmds
-	    fi
-	  fi
-	fi
-
-	if test -n "$delfiles"; then
-	  # Append the command to remove temporary files to $cmds.
-	  eval cmds=\"\$cmds~\$RM $delfiles\"
-	fi
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  func_append libobjs " $func_extract_archives_result"
-	  test "X$libobjs" = "X " && libobjs=
-	fi
-
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $opt_silent || {
-	    func_quote_for_expand "$cmd"
-	    eval "func_echo $func_quote_for_expand_result"
-	  }
-	  $opt_dry_run || eval "$cmd" || {
-	    lt_exit=$?
-
-	    # Restore the uninstalled library and exit
-	    if test "$opt_mode" = relink; then
-	      ( cd "$output_objdir" && \
-	        $RM "${realname}T" && \
-		$MV "${realname}U" "$realname" )
-	    fi
-
-	    exit $lt_exit
-	  }
-	done
-	IFS="$save_ifs"
-
-	# Restore the uninstalled library and exit
-	if test "$opt_mode" = relink; 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
-	    if test -z "$whole_archive_flag_spec"; then
-	      func_show_eval '${RM}r "$gentop"'
-	    fi
-	  fi
-
-	  exit $EXIT_SUCCESS
-	fi
-
-	# Create links to the real library.
-	for linkname in $linknames; do
-	  if test "$realname" != "$linkname"; then
-	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
-	  fi
-	done
-
-	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
-	  # On all known operating systems, these are identical.
-	  dlname="$soname"
-	fi
-      fi
-      ;;
-
-    obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
-
-      test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
-
-      test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
-
-      test -n "$release" && \
-	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"
-
-	libobj=$output
-	func_lo2o "$libobj"
-	obj=$func_lo2o_result
-	;;
-      *)
-	libobj=
-	obj="$output"
-	;;
-      esac
-
-      # Delete the old objects.
-      $opt_dry_run || $RM $obj $libobj
-
-      # Objects from convenience libraries.  This assumes
-      # single-version convenience libraries.  Whenever we create
-      # different ones for PIC/non-PIC, this we'll have to duplicate
-      # 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 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'`
-	else
-	  gentop="$output_objdir/${obj}x"
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $convenience
-	  reload_conv_objs="$reload_objs $func_extract_archives_result"
-	fi
-      fi
-
-      # If we're not building shared, we need to use non_pic_objs
-      test "$build_libtool_libs" != yes && 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
-
-      output="$obj"
-      func_execute_cmds "$reload_cmds" 'exit $?'
-
-      # Exit if we aren't doing a library object file.
-      if test -z "$libobj"; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      if test "$build_libtool_libs" != yes; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	# Create an invalid libtool object if no PIC, so that we don't
-	# accidentally link it into a program.
-	# $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
-	# Only do commands if we really have different PIC objects.
-	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
-	func_execute_cmds "$reload_cmds" 'exit $?'
-      fi
-
-      if test -n "$gentop"; then
-	func_show_eval '${RM}r "$gentop"'
-      fi
-
-      exit $EXIT_SUCCESS
-      ;;
-
-    prog)
-      case $host in
-	*cygwin*) func_stripname '' '.exe' "$output"
-	          output=$func_stripname_result.exe;;
-      esac
-      test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
-
-      test -n "$release" && \
-	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."
-
-      case $host in
-      *-*-rhapsody* | *-*-darwin1.[012])
-	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	;;
-      esac
-
-      case $host in
-      *-*-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
-	  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"
-	    ;;
-	  esac
-	fi
-	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	;;
-      esac
-
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $compile_deplibs " in
-	  *" -L$path/$objdir "*)
-	    func_append new_libs " -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $compile_deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) func_append new_libs " $deplib" ;;
-	  esac
-	  ;;
-	*) func_append new_libs " $deplib" ;;
-	esac
-      done
-      compile_deplibs="$new_libs"
-
-
-      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.
-	for libdir in $rpath $xrpath; do
-	  # This is the magic to use -rpath.
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_rpath " $libdir" ;;
-	  esac
-	done
-      fi
-
-      # Now hardcode the library paths
-      rpath=
-      hardcode_libdirs=
-      for libdir in $compile_rpath $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      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"*)
-		;;
-	      *)
-		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    func_append rpath " $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append perm_rpath " $libdir" ;;
-	  esac
-	fi
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$libdir:"*) ;;
-	  ::) dllsearchpath=$libdir;;
-	  *) func_append dllsearchpath ":$libdir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) func_append dllsearchpath ":$testbindir";;
-	  esac
-	  ;;
-	esac
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      compile_rpath="$rpath"
-
-      rpath=
-      hardcode_libdirs=
-      for libdir in $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      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"*)
-		;;
-	      *)
-		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    func_append rpath " $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$finalize_perm_rpath " in
-	  *" $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"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      finalize_rpath="$rpath"
-
-      if test -n "$libobjs" && test "$build_old_libs" = yes; 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"
-
-      # template prelinking step
-      if test -n "$prelink_cmds"; then
-	func_execute_cmds "$prelink_cmds" 'exit $?'
-      fi
-
-      wrappers_required=yes
-      case $host in
-      *cegcc* | *mingw32ce*)
-        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=no
-        ;;
-      *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
-        ;;
-      *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
-        ;;
-      esac
-      if test "$wrappers_required" = no; then
-	# Replace the output file specification.
-	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
-
-	# We have no uninstalled library dependencies, so finalize right now.
-	exit_status=0
-	func_show_eval "$link_command" 'exit_status=$?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	# Delete the generated files.
-	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"
-      fi
-      if test -n "$finalize_shlibpath"; then
-	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
-      fi
-
-      compile_var=
-      finalize_var=
-      if test -n "$runpath_var"; then
-	if test -n "$perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $perm_rpath; do
-	    func_append rpath "$dir:"
-	  done
-	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-	if test -n "$finalize_perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $finalize_perm_rpath; do
-	    func_append rpath "$dir:"
-	  done
-	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-      fi
-
-      if test "$no_install" = yes; then
-	# We don't need to create a wrapper script.
-	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.
-	$opt_dry_run || $RM $output
-	# Link the executable and exit
-	func_show_eval "$link_command" 'exit $?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	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"
-
-	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
-
-      # Replace the output file specification.
-      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
-      # Delete the old output files.
-      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
-      func_show_eval "$link_command" 'exit $?'
-
-      if test -n "$postlink_cmds"; then
-	func_to_tool_file "$output_objdir/$outputname"
-	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	func_execute_cmds "$postlink_cmds" 'exit $?'
-      fi
-
-      # Now create the wrapper script.
-      func_verbose "creating $output"
-
-      # Quote the relink command for shipping.
-      if test -n "$relink_command"; then
-	# Preserve any variables that may affect compiler behavior
-	for var in $variables_saved_for_relink; do
-	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	  elif eval var_value=\$$var; test -z "$var_value"; then
-	    relink_command="$var=; export $var; $relink_command"
-	  else
-	    func_quote_for_eval "$var_value"
-	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	  fi
-	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      fi
-
-      # Only actually do things if not in dry run mode.
-      $opt_dry_run || {
-	# win32 will think the script is a binary if it has
-	# a .exe suffix, so we strip it off here.
-	case $output in
-	  *.exe) func_stripname '' '.exe' "$output"
-	         output=$func_stripname_result ;;
-	esac
-	# test for cygwin because mv fails w/o .exe extensions
-	case $host in
-	  *cygwin*)
-	    exeext=.exe
-	    func_stripname '' '.exe' "$outputname"
-	    outputname=$func_stripname_result ;;
-	  *) exeext= ;;
-	esac
-	case $host in
-	  *cygwin* | *mingw* )
-	    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"
-	    $RM $cwrappersource $cwrapper
-	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_cwrapperexe_src > $cwrappersource
-
-	    # The wrapper executable is built using the $host compiler,
-	    # because it contains $host paths and files. If cross-
-	    # compiling, it, like the target executable, must be
-	    # executed on the $host or under an emulation environment.
-	    $opt_dry_run || {
-	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
-	      $STRIP $cwrapper
-	    }
-
-	    # Now, create the wrapper script for func_source use:
-	    func_ltwrapper_scriptname $cwrapper
-	    $RM $func_ltwrapper_scriptname_result
-	    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
-		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
-	      else
-		func_emit_wrapper no > $func_ltwrapper_scriptname_result
-	      fi
-	    }
-	  ;;
-	  * )
-	    $RM $output
-	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_wrapper no > $output
-	    chmod +x $output
-	  ;;
-	esac
-      }
-      exit $EXIT_SUCCESS
-      ;;
-    esac
-
-    # 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"
-	  build_libtool_libs=no
-	else
-	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    func_append oldobjs " $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
-
-      if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
-	func_append generated " $gentop"
-
-	func_extract_archives $gentop $addlibs
-	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
-	cmds=$old_archive_from_new_cmds
-      else
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  func_append oldobjs " $func_extract_archives_result"
-	fi
-
-	# POSIX demands no paths to be encoded in archives.  We have
-	# to avoid creating archives with duplicate basenames if we
-	# might have to extract them afterwards, e.g., when creating a
-	# static archive out of a convenience library, or when linking
-	# the entirety of a libtool archive into another (currently
-	# not supported by libtool).
-	if (for obj in $oldobjs
-	    do
-	      func_basename "$obj"
-	      $ECHO "$func_basename_result"
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	  :
-	else
-	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
-	  func_append generated " $gentop"
-	  func_mkdir_p "$gentop"
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  counter=1
-	  for obj in $save_oldobjs
-	  do
-	    func_basename "$obj"
-	    objbase="$func_basename_result"
-	    case " $oldobjs " in
-	    " ") oldobjs=$obj ;;
-	    *[\ /]"$objbase "*)
-	      while :; do
-		# Make sure we don't pick an alternate name that also
-		# overlaps.
-		newobj=lt$counter-$objbase
-		func_arith $counter + 1
-		counter=$func_arith_result
-		case " $oldobjs " in
-		*[\ /]"$newobj "*) ;;
-		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
-		esac
-	      done
-	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      func_append oldobjs " $gentop/$newobj"
-	      ;;
-	    *) func_append oldobjs " $obj" ;;
-	    esac
-	  done
-	fi
-	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-	tool_oldlib=$func_to_tool_file_result
-	eval cmds=\"$old_archive_cmds\"
-
-	func_len " $cmds"
-	len=$func_len_result
-	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  cmds=$old_archive_cmds
-	elif test -n "$archiver_list_spec"; then
-	  func_verbose "using command file archive linking..."
-	  for obj in $oldobjs
-	  do
-	    func_to_tool_file "$obj"
-	    $ECHO "$func_to_tool_file_result"
-	  done > $output_objdir/$libname.libcmd
-	  func_to_tool_file "$output_objdir/$libname.libcmd"
-	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
-	  cmds=$old_archive_cmds
-	else
-	  # the command line is too long to link in one step, link in parts
-	  func_verbose "using piecewise archive linking..."
-	  save_RANLIB=$RANLIB
-	  RANLIB=:
-	  objlist=
-	  concat_cmds=
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  # Is there a better way of finding the last object in the list?
-	  for obj in $save_oldobjs
-	  do
-	    last_oldobj=$obj
-	  done
-	  eval test_cmds=\"$old_archive_cmds\"
-	  func_len " $test_cmds"
-	  len0=$func_len_result
-	  len=$len0
-	  for obj in $save_oldobjs
-	  do
-	    func_len " $obj"
-	    func_arith $len + $func_len_result
-	    len=$func_arith_result
-	    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
-		RANLIB=$save_RANLIB
-	      fi
-	      test -z "$concat_cmds" || concat_cmds=$concat_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
-	    eval cmds=\"\$concat_cmds\"
-	  else
-	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
-	  fi
-	fi
-      fi
-      func_execute_cmds "$cmds" 'exit $?'
-    done
-
-    test -n "$generated" && \
-      func_show_eval "${RM}r$generated"
-
-    # Now create the libtool archive.
-    case $output in
-    *.la)
-      old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
-      func_verbose "creating $output"
-
-      # Preserve any variables that may affect compiler behavior
-      for var in $variables_saved_for_relink; do
-	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	elif eval var_value=\$$var; test -z "$var_value"; then
-	  relink_command="$var=; export $var; $relink_command"
-	else
-	  func_quote_for_eval "$var_value"
-	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	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=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; 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 -z "$install_libdir"; then
-	      break
-	    fi
-	    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"
-		func_resolve_sysroot "$deplib"
-		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_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      -L*)
-		func_stripname -L '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		func_append newdependency_libs " -L$func_replace_sysroot_result"
-		;;
-	      -R*)
-		func_stripname -R '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		func_append newdependency_libs " -R$func_replace_sysroot_result"
-		;;
-	      *) func_append newdependency_libs " $deplib" ;;
-	      esac
-	    done
-	    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`
-		test -z "$libdir" && \
-		  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"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-	      *.la)
-		# Only pass preopened files to the pseudo-archive (for
-		# eventual linking with the app. that links it) if we
-		# 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`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      esac
-	    done
-	    dlprefiles="$newdlprefiles"
-	  else
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      func_append newdlfiles " $abs"
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      func_append newdlprefiles " $abs"
-	    done
-	    dlprefiles="$newdlprefiles"
-	  fi
-	  $RM $output
-	  # place dlname in correct position for cygwin
-	  # In fact, it would be nice if we could use this code for all target
-	  # systems that can't hard-code library paths into their executables
-	  # and that have no shared library path variable independent of PATH,
-	  # but it turns out we can't easily determine that from inspecting
-	  # libtool variables, so we have to hard-code the OSs to which it
-	  # applies here; at the moment, that means platforms that use the PE
-	  # object format with DLL files.  See the long comment at the top of
-	  # tests/bindir.at for full details.
-	  tdlname=$dlname
-	  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
-		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result$dlname
-	      else
-		# Otherwise fall back on heuristic.
-		tdlname=../bin/$dlname
-	      fi
-	      ;;
-	  esac
-	  $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that can not go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
-	    $ECHO >> $output "\
-relink_command=\"$relink_command\""
-	  fi
-	done
-      }
-
-      # Do a symbolic link so that the libtool archive can be found in
-      # LD_LIBRARY_PATH before the program is installed.
-      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
-      ;;
-    esac
-    exit $EXIT_SUCCESS
-}
-
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-    func_mode_link ${1+"$@"}
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
-    $opt_debug
-    RM="$nonopt"
-    files=
-    rmforce=
-    exit_status=0
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    for arg
-    do
-      case $arg in
-      -f) func_append RM " $arg"; rmforce=yes ;;
-      -*) func_append RM " $arg" ;;
-      *) func_append files " $arg" ;;
-      esac
-    done
-
-    test -z "$RM" && \
-      func_fatal_help "you must specify an RM program"
-
-    rmdirs=
-
-    for file in $files; do
-      func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	odir="$objdir"
-      else
-	odir="$dir/$objdir"
-      fi
-      func_basename "$file"
-      name="$func_basename_result"
-      test "$opt_mode" = uninstall && odir="$dir"
-
-      # Remember odir for removal later, being careful to avoid duplicates
-      if test "$opt_mode" = clean; then
-	case " $rmdirs " in
-	  *" $odir "*) ;;
-	  *) func_append rmdirs " $odir" ;;
-	esac
-      fi
-
-      # Don't error if the file doesn't exist and rm -f was used.
-      if { test -L "$file"; } >/dev/null 2>&1 ||
-	 { test -h "$file"; } >/dev/null 2>&1 ||
-	 test -f "$file"; then
-	:
-      elif test -d "$file"; then
-	exit_status=1
-	continue
-      elif test "$rmforce" = yes; then
-	continue
-      fi
-
-      rmfiles="$file"
-
-      case $name in
-      *.la)
-	# Possibly a libtool archive, so verify it.
-	if func_lalib_p "$file"; then
-	  func_source $dir/$name
-
-	  # Delete the libtool libraries and symlinks.
-	  for n in $library_names; do
-	    func_append rmfiles " $odir/$n"
-	  done
-	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
-
-	  case "$opt_mode" in
-	  clean)
-	    case " $library_names " in
-	    *" $dlname "*) ;;
-	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
-	    esac
-	    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'
-	    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'
-	    fi
-	    # FIXME: should reinstall the best remaining shared library.
-	    ;;
-	  esac
-	fi
-	;;
-
-      *.lo)
-	# Possibly a libtool object, so verify it.
-	if func_lalib_p "$file"; then
-
-	  # Read the .lo file
-	  func_source $dir/$name
-
-	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; 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
-	    func_append rmfiles " $dir/$non_pic_object"
-	  fi
-	fi
-	;;
-
-      *)
-	if test "$opt_mode" = clean ; then
-	  noexename=$name
-	  case $file in
-	  *.exe)
-	    func_stripname '' '.exe' "$file"
-	    file=$func_stripname_result
-	    func_stripname '' '.exe' "$name"
-	    noexename=$func_stripname_result
-	    # $file with .exe has already been added to rmfiles,
-	    # add $file without .exe
-	    func_append rmfiles " $file"
-	    ;;
-	  esac
-	  # Do a test to see if this is a libtool program.
-	  if func_ltwrapper_p "$file"; then
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      relink_command=
-	      func_source $func_ltwrapper_scriptname_result
-	      func_append rmfiles " $func_ltwrapper_scriptname_result"
-	    else
-	      relink_command=
-	      func_source $dir/$noexename
-	    fi
-
-	    # 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/lt-$name"
-	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      func_append rmfiles " $odir/lt-${noexename}.c"
-	    fi
-	  fi
-	fi
-	;;
-      esac
-      func_show_eval "$RM $rmfiles" 'exit_status=1'
-    done
-
-    # 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"
-      fi
-    done
-
-    exit $exit_status
-}
-
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
-
-test -z "$opt_mode" && {
-  help="$generic_help"
-  func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$opt_mode'"
-
-if test -n "$exec_cmd"; then
-  eval exec "$exec_cmd"
-  exit $EXIT_FAILURE
-fi
-
-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
-# 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
-# them.  This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration.  But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
-# vi:sw=2
-
Index: sm/trunk/m4/analyses.m4
===================================================================
--- /issm/trunk/m4/analyses.m4	(revision 28275)
+++ 	(revision )
@@ -1,629 +1,0 @@
-
-dnl   WARNING: DO NOT MODIFY THIS FILE
-dnl            this file has been automatically generated by Synchronize.sh
-dnl            Please read README for more information
-
-# AX_ANALYSES_SELECTION
-# -----------------
-# Check for analyses compilation
-AC_DEFUN([AX_ANALYSES_SELECTION],
-[
-
-dnl with-HydrologyTws{{{
-AC_ARG_WITH([HydrologyTws],
-	AS_HELP_STRING([--with-HydrologyTws = YES], [compile with HydrologyTws capabilities (default is yes)]),
-	[HYDROLOGYTWS=$withval],[HYDROLOGYTWS=yes])
-AC_MSG_CHECKING(for HydrologyTws capability compilation)
-
-HAVE_HYDROLOGYTWS=no 
-if test "x$HYDROLOGYTWS" = "xyes"; then
-	HAVE_HYDROLOGYTWS=yes
-	AC_DEFINE([_HAVE_HYDROLOGYTWS_],[1],[with HydrologyTws capability])
-fi
-AM_CONDITIONAL([HYDROLOGYTWS], [test x$HAVE_HYDROLOGYTWS = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYTWS)
-dnl }}}
-dnl with-AdjointBalancethickness2{{{
-AC_ARG_WITH([AdjointBalancethickness2],
-	AS_HELP_STRING([--with-AdjointBalancethickness2 = YES], [compile with AdjointBalancethickness2 capabilities (default is yes)]),
-	[ADJOINTBALANCETHICKNESS2=$withval],[ADJOINTBALANCETHICKNESS2=yes])
-AC_MSG_CHECKING(for AdjointBalancethickness2 capability compilation)
-
-HAVE_ADJOINTBALANCETHICKNESS2=no 
-if test "x$ADJOINTBALANCETHICKNESS2" = "xyes"; then
-	HAVE_ADJOINTBALANCETHICKNESS2=yes
-	AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS2_],[1],[with AdjointBalancethickness2 capability])
-fi
-AM_CONDITIONAL([ADJOINTBALANCETHICKNESS2], [test x$HAVE_ADJOINTBALANCETHICKNESS2 = xyes])
-AC_MSG_RESULT($HAVE_ADJOINTBALANCETHICKNESS2)
-dnl }}}
-dnl with-AdjointBalancethickness{{{
-AC_ARG_WITH([AdjointBalancethickness],
-	AS_HELP_STRING([--with-AdjointBalancethickness = YES], [compile with AdjointBalancethickness capabilities (default is yes)]),
-	[ADJOINTBALANCETHICKNESS=$withval],[ADJOINTBALANCETHICKNESS=yes])
-AC_MSG_CHECKING(for AdjointBalancethickness capability compilation)
-
-HAVE_ADJOINTBALANCETHICKNESS=no 
-if test "x$ADJOINTBALANCETHICKNESS" = "xyes"; then
-	HAVE_ADJOINTBALANCETHICKNESS=yes
-	AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS_],[1],[with AdjointBalancethickness capability])
-fi
-AM_CONDITIONAL([ADJOINTBALANCETHICKNESS], [test x$HAVE_ADJOINTBALANCETHICKNESS = xyes])
-AC_MSG_RESULT($HAVE_ADJOINTBALANCETHICKNESS)
-dnl }}}
-dnl with-AdjointHoriz{{{
-AC_ARG_WITH([AdjointHoriz],
-	AS_HELP_STRING([--with-AdjointHoriz = YES], [compile with AdjointHoriz capabilities (default is yes)]),
-	[ADJOINTHORIZ=$withval],[ADJOINTHORIZ=yes])
-AC_MSG_CHECKING(for AdjointHoriz capability compilation)
-
-HAVE_ADJOINTHORIZ=no 
-if test "x$ADJOINTHORIZ" = "xyes"; then
-	HAVE_ADJOINTHORIZ=yes
-	AC_DEFINE([_HAVE_ADJOINTHORIZ_],[1],[with AdjointHoriz capability])
-fi
-AM_CONDITIONAL([ADJOINTHORIZ], [test x$HAVE_ADJOINTHORIZ = xyes])
-AC_MSG_RESULT($HAVE_ADJOINTHORIZ)
-dnl }}}
-dnl with-Age{{{
-AC_ARG_WITH([Age],
-	AS_HELP_STRING([--with-Age = YES], [compile with Age capabilities (default is yes)]),
-	[AGE=$withval],[AGE=yes])
-AC_MSG_CHECKING(for Age capability compilation)
-
-HAVE_AGE=no 
-if test "x$AGE" = "xyes"; then
-	HAVE_AGE=yes
-	AC_DEFINE([_HAVE_AGE_],[1],[with Age capability])
-fi
-AM_CONDITIONAL([AGE], [test x$HAVE_AGE = xyes])
-AC_MSG_RESULT($HAVE_AGE)
-dnl }}}
-dnl with-Balancethickness2{{{
-AC_ARG_WITH([Balancethickness2],
-	AS_HELP_STRING([--with-Balancethickness2 = YES], [compile with Balancethickness2 capabilities (default is yes)]),
-	[BALANCETHICKNESS2=$withval],[BALANCETHICKNESS2=yes])
-AC_MSG_CHECKING(for Balancethickness2 capability compilation)
-
-HAVE_BALANCETHICKNESS2=no 
-if test "x$BALANCETHICKNESS2" = "xyes"; then
-	HAVE_BALANCETHICKNESS2=yes
-	AC_DEFINE([_HAVE_BALANCETHICKNESS2_],[1],[with Balancethickness2 capability])
-fi
-AM_CONDITIONAL([BALANCETHICKNESS2], [test x$HAVE_BALANCETHICKNESS2 = xyes])
-AC_MSG_RESULT($HAVE_BALANCETHICKNESS2)
-dnl }}}
-dnl with-Balancethickness{{{
-AC_ARG_WITH([Balancethickness],
-	AS_HELP_STRING([--with-Balancethickness = YES], [compile with Balancethickness capabilities (default is yes)]),
-	[BALANCETHICKNESS=$withval],[BALANCETHICKNESS=yes])
-AC_MSG_CHECKING(for Balancethickness capability compilation)
-
-HAVE_BALANCETHICKNESS=no 
-if test "x$BALANCETHICKNESS" = "xyes"; then
-	HAVE_BALANCETHICKNESS=yes
-	AC_DEFINE([_HAVE_BALANCETHICKNESS_],[1],[with Balancethickness capability])
-fi
-AM_CONDITIONAL([BALANCETHICKNESS], [test x$HAVE_BALANCETHICKNESS = xyes])
-AC_MSG_RESULT($HAVE_BALANCETHICKNESS)
-dnl }}}
-dnl with-BalancethicknessSoft{{{
-AC_ARG_WITH([BalancethicknessSoft],
-	AS_HELP_STRING([--with-BalancethicknessSoft = YES], [compile with BalancethicknessSoft capabilities (default is yes)]),
-	[BALANCETHICKNESSSOFT=$withval],[BALANCETHICKNESSSOFT=yes])
-AC_MSG_CHECKING(for BalancethicknessSoft capability compilation)
-
-HAVE_BALANCETHICKNESSSOFT=no 
-if test "x$BALANCETHICKNESSSOFT" = "xyes"; then
-	HAVE_BALANCETHICKNESSSOFT=yes
-	AC_DEFINE([_HAVE_BALANCETHICKNESSSOFT_],[1],[with BalancethicknessSoft capability])
-fi
-AM_CONDITIONAL([BALANCETHICKNESSSOFT], [test x$HAVE_BALANCETHICKNESSSOFT = xyes])
-AC_MSG_RESULT($HAVE_BALANCETHICKNESSSOFT)
-dnl }}}
-dnl with-Balancevelocity{{{
-AC_ARG_WITH([Balancevelocity],
-	AS_HELP_STRING([--with-Balancevelocity = YES], [compile with Balancevelocity capabilities (default is yes)]),
-	[BALANCEVELOCITY=$withval],[BALANCEVELOCITY=yes])
-AC_MSG_CHECKING(for Balancevelocity capability compilation)
-
-HAVE_BALANCEVELOCITY=no 
-if test "x$BALANCEVELOCITY" = "xyes"; then
-	HAVE_BALANCEVELOCITY=yes
-	AC_DEFINE([_HAVE_BALANCEVELOCITY_],[1],[with Balancevelocity capability])
-fi
-AM_CONDITIONAL([BALANCEVELOCITY], [test x$HAVE_BALANCEVELOCITY = xyes])
-AC_MSG_RESULT($HAVE_BALANCEVELOCITY)
-dnl }}}
-dnl with-DamageEvolution{{{
-AC_ARG_WITH([DamageEvolution],
-	AS_HELP_STRING([--with-DamageEvolution = YES], [compile with DamageEvolution capabilities (default is yes)]),
-	[DAMAGEEVOLUTION=$withval],[DAMAGEEVOLUTION=yes])
-AC_MSG_CHECKING(for DamageEvolution capability compilation)
-
-HAVE_DAMAGEEVOLUTION=no 
-if test "x$DAMAGEEVOLUTION" = "xyes"; then
-	HAVE_DAMAGEEVOLUTION=yes
-	AC_DEFINE([_HAVE_DAMAGEEVOLUTION_],[1],[with DamageEvolution capability])
-fi
-AM_CONDITIONAL([DAMAGEEVOLUTION], [test x$HAVE_DAMAGEEVOLUTION = xyes])
-AC_MSG_RESULT($HAVE_DAMAGEEVOLUTION)
-dnl }}}
-dnl with-Debris{{{
-AC_ARG_WITH([Debris],
-	AS_HELP_STRING([--with-Debris = YES], [compile with Debris capabilities (default is yes)]),
-	[DEBRIS=$withval],[DEBRIS=yes])
-AC_MSG_CHECKING(for Debris capability compilation)
-
-HAVE_DEBRIS=no 
-if test "x$DEBRIS" = "xyes"; then
-	HAVE_DEBRIS=yes
-	AC_DEFINE([_HAVE_DEBRIS_],[1],[with Debris capability])
-fi
-AM_CONDITIONAL([DEBRIS], [test x$HAVE_DEBRIS = xyes])
-AC_MSG_RESULT($HAVE_DEBRIS)
-dnl }}}
-dnl with-DepthAverage{{{
-AC_ARG_WITH([DepthAverage],
-	AS_HELP_STRING([--with-DepthAverage = YES], [compile with DepthAverage capabilities (default is yes)]),
-	[DEPTHAVERAGE=$withval],[DEPTHAVERAGE=yes])
-AC_MSG_CHECKING(for DepthAverage capability compilation)
-
-HAVE_DEPTHAVERAGE=no 
-if test "x$DEPTHAVERAGE" = "xyes"; then
-	HAVE_DEPTHAVERAGE=yes
-	AC_DEFINE([_HAVE_DEPTHAVERAGE_],[1],[with DepthAverage capability])
-fi
-AM_CONDITIONAL([DEPTHAVERAGE], [test x$HAVE_DEPTHAVERAGE = xyes])
-AC_MSG_RESULT($HAVE_DEPTHAVERAGE)
-dnl }}}
-dnl with-Enthalpy{{{
-AC_ARG_WITH([Enthalpy],
-	AS_HELP_STRING([--with-Enthalpy = YES], [compile with Enthalpy capabilities (default is yes)]),
-	[ENTHALPY=$withval],[ENTHALPY=yes])
-AC_MSG_CHECKING(for Enthalpy capability compilation)
-
-HAVE_ENTHALPY=no 
-if test "x$ENTHALPY" = "xyes"; then
-	HAVE_ENTHALPY=yes
-	AC_DEFINE([_HAVE_ENTHALPY_],[1],[with Enthalpy capability])
-fi
-AM_CONDITIONAL([ENTHALPY], [test x$HAVE_ENTHALPY = xyes])
-AC_MSG_RESULT($HAVE_ENTHALPY)
-dnl }}}
-dnl with-Esa{{{
-AC_ARG_WITH([Esa],
-	AS_HELP_STRING([--with-Esa = YES], [compile with Esa capabilities (default is yes)]),
-	[ESA=$withval],[ESA=yes])
-AC_MSG_CHECKING(for Esa capability compilation)
-
-HAVE_ESA=no 
-if test "x$ESA" = "xyes"; then
-	HAVE_ESA=yes
-	AC_DEFINE([_HAVE_ESA_],[1],[with Esa capability])
-fi
-AM_CONDITIONAL([ESA], [test x$HAVE_ESA = xyes])
-AC_MSG_RESULT($HAVE_ESA)
-dnl }}}
-dnl with-Extrapolation{{{
-AC_ARG_WITH([Extrapolation],
-	AS_HELP_STRING([--with-Extrapolation = YES], [compile with Extrapolation capabilities (default is yes)]),
-	[EXTRAPOLATION=$withval],[EXTRAPOLATION=yes])
-AC_MSG_CHECKING(for Extrapolation capability compilation)
-
-HAVE_EXTRAPOLATION=no 
-if test "x$EXTRAPOLATION" = "xyes"; then
-	HAVE_EXTRAPOLATION=yes
-	AC_DEFINE([_HAVE_EXTRAPOLATION_],[1],[with Extrapolation capability])
-fi
-AM_CONDITIONAL([EXTRAPOLATION], [test x$HAVE_EXTRAPOLATION = xyes])
-AC_MSG_RESULT($HAVE_EXTRAPOLATION)
-dnl }}}
-dnl with-ExtrudeFromBase{{{
-AC_ARG_WITH([ExtrudeFromBase],
-	AS_HELP_STRING([--with-ExtrudeFromBase = YES], [compile with ExtrudeFromBase capabilities (default is yes)]),
-	[EXTRUDEFROMBASE=$withval],[EXTRUDEFROMBASE=yes])
-AC_MSG_CHECKING(for ExtrudeFromBase capability compilation)
-
-HAVE_EXTRUDEFROMBASE=no 
-if test "x$EXTRUDEFROMBASE" = "xyes"; then
-	HAVE_EXTRUDEFROMBASE=yes
-	AC_DEFINE([_HAVE_EXTRUDEFROMBASE_],[1],[with ExtrudeFromBase capability])
-fi
-AM_CONDITIONAL([EXTRUDEFROMBASE], [test x$HAVE_EXTRUDEFROMBASE = xyes])
-AC_MSG_RESULT($HAVE_EXTRUDEFROMBASE)
-dnl }}}
-dnl with-ExtrudeFromTop{{{
-AC_ARG_WITH([ExtrudeFromTop],
-	AS_HELP_STRING([--with-ExtrudeFromTop = YES], [compile with ExtrudeFromTop capabilities (default is yes)]),
-	[EXTRUDEFROMTOP=$withval],[EXTRUDEFROMTOP=yes])
-AC_MSG_CHECKING(for ExtrudeFromTop capability compilation)
-
-HAVE_EXTRUDEFROMTOP=no 
-if test "x$EXTRUDEFROMTOP" = "xyes"; then
-	HAVE_EXTRUDEFROMTOP=yes
-	AC_DEFINE([_HAVE_EXTRUDEFROMTOP_],[1],[with ExtrudeFromTop capability])
-fi
-AM_CONDITIONAL([EXTRUDEFROMTOP], [test x$HAVE_EXTRUDEFROMTOP = xyes])
-AC_MSG_RESULT($HAVE_EXTRUDEFROMTOP)
-dnl }}}
-dnl with-FreeSurfaceBase{{{
-AC_ARG_WITH([FreeSurfaceBase],
-	AS_HELP_STRING([--with-FreeSurfaceBase = YES], [compile with FreeSurfaceBase capabilities (default is yes)]),
-	[FREESURFACEBASE=$withval],[FREESURFACEBASE=yes])
-AC_MSG_CHECKING(for FreeSurfaceBase capability compilation)
-
-HAVE_FREESURFACEBASE=no 
-if test "x$FREESURFACEBASE" = "xyes"; then
-	HAVE_FREESURFACEBASE=yes
-	AC_DEFINE([_HAVE_FREESURFACEBASE_],[1],[with FreeSurfaceBase capability])
-fi
-AM_CONDITIONAL([FREESURFACEBASE], [test x$HAVE_FREESURFACEBASE = xyes])
-AC_MSG_RESULT($HAVE_FREESURFACEBASE)
-dnl }}}
-dnl with-FreeSurfaceTop{{{
-AC_ARG_WITH([FreeSurfaceTop],
-	AS_HELP_STRING([--with-FreeSurfaceTop = YES], [compile with FreeSurfaceTop capabilities (default is yes)]),
-	[FREESURFACETOP=$withval],[FREESURFACETOP=yes])
-AC_MSG_CHECKING(for FreeSurfaceTop capability compilation)
-
-HAVE_FREESURFACETOP=no 
-if test "x$FREESURFACETOP" = "xyes"; then
-	HAVE_FREESURFACETOP=yes
-	AC_DEFINE([_HAVE_FREESURFACETOP_],[1],[with FreeSurfaceTop capability])
-fi
-AM_CONDITIONAL([FREESURFACETOP], [test x$HAVE_FREESURFACETOP = xyes])
-AC_MSG_RESULT($HAVE_FREESURFACETOP)
-dnl }}}
-dnl with-GLheightadvection{{{
-AC_ARG_WITH([GLheightadvection],
-	AS_HELP_STRING([--with-GLheightadvection = YES], [compile with GLheightadvection capabilities (default is yes)]),
-	[GLHEIGHTADVECTION=$withval],[GLHEIGHTADVECTION=yes])
-AC_MSG_CHECKING(for GLheightadvection capability compilation)
-
-HAVE_GLHEIGHTADVECTION=no 
-if test "x$GLHEIGHTADVECTION" = "xyes"; then
-	HAVE_GLHEIGHTADVECTION=yes
-	AC_DEFINE([_HAVE_GLHEIGHTADVECTION_],[1],[with GLheightadvection capability])
-fi
-AM_CONDITIONAL([GLHEIGHTADVECTION], [test x$HAVE_GLHEIGHTADVECTION = xyes])
-AC_MSG_RESULT($HAVE_GLHEIGHTADVECTION)
-dnl }}}
-dnl with-HydrologyDCEfficient{{{
-AC_ARG_WITH([HydrologyDCEfficient],
-	AS_HELP_STRING([--with-HydrologyDCEfficient = YES], [compile with HydrologyDCEfficient capabilities (default is yes)]),
-	[HYDROLOGYDCEFFICIENT=$withval],[HYDROLOGYDCEFFICIENT=yes])
-AC_MSG_CHECKING(for HydrologyDCEfficient capability compilation)
-
-HAVE_HYDROLOGYDCEFFICIENT=no 
-if test "x$HYDROLOGYDCEFFICIENT" = "xyes"; then
-	HAVE_HYDROLOGYDCEFFICIENT=yes
-	AC_DEFINE([_HAVE_HYDROLOGYDCEFFICIENT_],[1],[with HydrologyDCEfficient capability])
-fi
-AM_CONDITIONAL([HYDROLOGYDCEFFICIENT], [test x$HAVE_HYDROLOGYDCEFFICIENT = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYDCEFFICIENT)
-dnl }}}
-dnl with-HydrologyDCInefficient{{{
-AC_ARG_WITH([HydrologyDCInefficient],
-	AS_HELP_STRING([--with-HydrologyDCInefficient = YES], [compile with HydrologyDCInefficient capabilities (default is yes)]),
-	[HYDROLOGYDCINEFFICIENT=$withval],[HYDROLOGYDCINEFFICIENT=yes])
-AC_MSG_CHECKING(for HydrologyDCInefficient capability compilation)
-
-HAVE_HYDROLOGYDCINEFFICIENT=no 
-if test "x$HYDROLOGYDCINEFFICIENT" = "xyes"; then
-	HAVE_HYDROLOGYDCINEFFICIENT=yes
-	AC_DEFINE([_HAVE_HYDROLOGYDCINEFFICIENT_],[1],[with HydrologyDCInefficient capability])
-fi
-AM_CONDITIONAL([HYDROLOGYDCINEFFICIENT], [test x$HAVE_HYDROLOGYDCINEFFICIENT = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYDCINEFFICIENT)
-dnl }}}
-dnl with-HydrologyGlaDS{{{
-AC_ARG_WITH([HydrologyGlaDS],
-	AS_HELP_STRING([--with-HydrologyGlaDS = YES], [compile with HydrologyGlaDS capabilities (default is yes)]),
-	[HYDROLOGYGLADS=$withval],[HYDROLOGYGLADS=yes])
-AC_MSG_CHECKING(for HydrologyGlaDS capability compilation)
-
-HAVE_HYDROLOGYGLADS=no 
-if test "x$HYDROLOGYGLADS" = "xyes"; then
-	HAVE_HYDROLOGYGLADS=yes
-	AC_DEFINE([_HAVE_HYDROLOGYGLADS_],[1],[with HydrologyGlaDS capability])
-fi
-AM_CONDITIONAL([HYDROLOGYGLADS], [test x$HAVE_HYDROLOGYGLADS = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYGLADS)
-dnl }}}
-dnl with-HydrologyPism{{{
-AC_ARG_WITH([HydrologyPism],
-	AS_HELP_STRING([--with-HydrologyPism = YES], [compile with HydrologyPism capabilities (default is yes)]),
-	[HYDROLOGYPISM=$withval],[HYDROLOGYPISM=yes])
-AC_MSG_CHECKING(for HydrologyPism capability compilation)
-
-HAVE_HYDROLOGYPISM=no 
-if test "x$HYDROLOGYPISM" = "xyes"; then
-	HAVE_HYDROLOGYPISM=yes
-	AC_DEFINE([_HAVE_HYDROLOGYPISM_],[1],[with HydrologyPism capability])
-fi
-AM_CONDITIONAL([HYDROLOGYPISM], [test x$HAVE_HYDROLOGYPISM = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYPISM)
-dnl }}}
-dnl with-HydrologyShakti{{{
-AC_ARG_WITH([HydrologyShakti],
-	AS_HELP_STRING([--with-HydrologyShakti = YES], [compile with HydrologyShakti capabilities (default is yes)]),
-	[HYDROLOGYSHAKTI=$withval],[HYDROLOGYSHAKTI=yes])
-AC_MSG_CHECKING(for HydrologyShakti capability compilation)
-
-HAVE_HYDROLOGYSHAKTI=no 
-if test "x$HYDROLOGYSHAKTI" = "xyes"; then
-	HAVE_HYDROLOGYSHAKTI=yes
-	AC_DEFINE([_HAVE_HYDROLOGYSHAKTI_],[1],[with HydrologyShakti capability])
-fi
-AM_CONDITIONAL([HYDROLOGYSHAKTI], [test x$HAVE_HYDROLOGYSHAKTI = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYSHAKTI)
-dnl }}}
-dnl with-HydrologyShreve{{{
-AC_ARG_WITH([HydrologyShreve],
-	AS_HELP_STRING([--with-HydrologyShreve = YES], [compile with HydrologyShreve capabilities (default is yes)]),
-	[HYDROLOGYSHREVE=$withval],[HYDROLOGYSHREVE=yes])
-AC_MSG_CHECKING(for HydrologyShreve capability compilation)
-
-HAVE_HYDROLOGYSHREVE=no 
-if test "x$HYDROLOGYSHREVE" = "xyes"; then
-	HAVE_HYDROLOGYSHREVE=yes
-	AC_DEFINE([_HAVE_HYDROLOGYSHREVE_],[1],[with HydrologyShreve capability])
-fi
-AM_CONDITIONAL([HYDROLOGYSHREVE], [test x$HAVE_HYDROLOGYSHREVE = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYSHREVE)
-dnl }}}
-dnl with-HydrologyArmapw{{{
-AC_ARG_WITH([HydrologyArmapw],
-	AS_HELP_STRING([--with-HydrologyArmapw = YES], [compile with HydrologyArmapw capabilities (default is yes)]),
-	[HYDROLOGYARMAPW=$withval],[HYDROLOGYARMAPW=yes])
-AC_MSG_CHECKING(for HydrologyArmapw capability compilation)
-
-HAVE_HYDROLOGYARMAPW=no 
-if test "x$HYDROLOGYARMAPW" = "xyes"; then
-	HAVE_HYDROLOGYARMAPW=yes
-	AC_DEFINE([_HAVE_HYDROLOGYARMAPW_],[1],[with HydrologyArmapw capability])
-fi
-AM_CONDITIONAL([HYDROLOGYARMAPW], [test x$HAVE_HYDROLOGYARMAPW = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYARMAPW)
-dnl }}}
-dnl with-L2ProjectionBase{{{
-AC_ARG_WITH([L2ProjectionBase],
-	AS_HELP_STRING([--with-L2ProjectionBase = YES], [compile with L2ProjectionBase capabilities (default is yes)]),
-	[L2PROJECTIONBASE=$withval],[L2PROJECTIONBASE=yes])
-AC_MSG_CHECKING(for L2ProjectionBase capability compilation)
-
-HAVE_L2PROJECTIONBASE=no 
-if test "x$L2PROJECTIONBASE" = "xyes"; then
-	HAVE_L2PROJECTIONBASE=yes
-	AC_DEFINE([_HAVE_L2PROJECTIONBASE_],[1],[with L2ProjectionBase capability])
-fi
-AM_CONDITIONAL([L2PROJECTIONBASE], [test x$HAVE_L2PROJECTIONBASE = xyes])
-AC_MSG_RESULT($HAVE_L2PROJECTIONBASE)
-dnl }}}
-dnl with-L2ProjectionEPL{{{
-AC_ARG_WITH([L2ProjectionEPL],
-	AS_HELP_STRING([--with-L2ProjectionEPL = YES], [compile with L2ProjectionEPL capabilities (default is yes)]),
-	[L2PROJECTIONEPL=$withval],[L2PROJECTIONEPL=yes])
-AC_MSG_CHECKING(for L2ProjectionEPL capability compilation)
-
-HAVE_L2PROJECTIONEPL=no 
-if test "x$L2PROJECTIONEPL" = "xyes"; then
-	HAVE_L2PROJECTIONEPL=yes
-	AC_DEFINE([_HAVE_L2PROJECTIONEPL_],[1],[with L2ProjectionEPL capability])
-fi
-AM_CONDITIONAL([L2PROJECTIONEPL], [test x$HAVE_L2PROJECTIONEPL = xyes])
-AC_MSG_RESULT($HAVE_L2PROJECTIONEPL)
-dnl }}}
-dnl with-Levelset{{{
-AC_ARG_WITH([Levelset],
-	AS_HELP_STRING([--with-Levelset = YES], [compile with Levelset capabilities (default is yes)]),
-	[LEVELSET=$withval],[LEVELSET=yes])
-AC_MSG_CHECKING(for Levelset capability compilation)
-
-HAVE_LEVELSET=no 
-if test "x$LEVELSET" = "xyes"; then
-	HAVE_LEVELSET=yes
-	AC_DEFINE([_HAVE_LEVELSET_],[1],[with Levelset capability])
-fi
-AM_CONDITIONAL([LEVELSET], [test x$HAVE_LEVELSET = xyes])
-AC_MSG_RESULT($HAVE_LEVELSET)
-dnl }}}
-dnl with-Love{{{
-AC_ARG_WITH([Love],
-	AS_HELP_STRING([--with-Love = YES], [compile with Love capabilities (default is yes)]),
-	[LOVE=$withval],[LOVE=yes])
-AC_MSG_CHECKING(for Love capability compilation)
-
-HAVE_LOVE=no 
-if test "x$LOVE" = "xyes"; then
-	HAVE_LOVE=yes
-	AC_DEFINE([_HAVE_LOVE_],[1],[with Love capability])
-fi
-AM_CONDITIONAL([LOVE], [test x$HAVE_LOVE = xyes])
-AC_MSG_RESULT($HAVE_LOVE)
-dnl }}}
-dnl with-Masstransport{{{
-AC_ARG_WITH([Masstransport],
-	AS_HELP_STRING([--with-Masstransport = YES], [compile with Masstransport capabilities (default is yes)]),
-	[MASSTRANSPORT=$withval],[MASSTRANSPORT=yes])
-AC_MSG_CHECKING(for Masstransport capability compilation)
-
-HAVE_MASSTRANSPORT=no 
-if test "x$MASSTRANSPORT" = "xyes"; then
-	HAVE_MASSTRANSPORT=yes
-	AC_DEFINE([_HAVE_MASSTRANSPORT_],[1],[with Masstransport capability])
-fi
-AM_CONDITIONAL([MASSTRANSPORT], [test x$HAVE_MASSTRANSPORT = xyes])
-AC_MSG_RESULT($HAVE_MASSTRANSPORT)
-dnl }}}
-dnl with-Melting{{{
-AC_ARG_WITH([Melting],
-	AS_HELP_STRING([--with-Melting = YES], [compile with Melting capabilities (default is yes)]),
-	[MELTING=$withval],[MELTING=yes])
-AC_MSG_CHECKING(for Melting capability compilation)
-
-HAVE_MELTING=no 
-if test "x$MELTING" = "xyes"; then
-	HAVE_MELTING=yes
-	AC_DEFINE([_HAVE_MELTING_],[1],[with Melting capability])
-fi
-AM_CONDITIONAL([MELTING], [test x$HAVE_MELTING = xyes])
-AC_MSG_RESULT($HAVE_MELTING)
-dnl }}}
-dnl with-Oceantransport{{{
-AC_ARG_WITH([Oceantransport],
-	AS_HELP_STRING([--with-Oceantransport = YES], [compile with Oceantransport capabilities (default is yes)]),
-	[OCEANTRANSPORT=$withval],[OCEANTRANSPORT=yes])
-AC_MSG_CHECKING(for Oceantransport capability compilation)
-
-HAVE_OCEANTRANSPORT=no 
-if test "x$OCEANTRANSPORT" = "xyes"; then
-	HAVE_OCEANTRANSPORT=yes
-	AC_DEFINE([_HAVE_OCEANTRANSPORT_],[1],[with Oceantransport capability])
-fi
-AM_CONDITIONAL([OCEANTRANSPORT], [test x$HAVE_OCEANTRANSPORT = xyes])
-AC_MSG_RESULT($HAVE_OCEANTRANSPORT)
-dnl }}}
-dnl with-Recovery{{{
-AC_ARG_WITH([Recovery],
-	AS_HELP_STRING([--with-Recovery = YES], [compile with Recovery capabilities (default is yes)]),
-	[RECOVERY=$withval],[RECOVERY=yes])
-AC_MSG_CHECKING(for Recovery capability compilation)
-
-HAVE_RECOVERY=no 
-if test "x$RECOVERY" = "xyes"; then
-	HAVE_RECOVERY=yes
-	AC_DEFINE([_HAVE_RECOVERY_],[1],[with Recovery capability])
-fi
-AM_CONDITIONAL([RECOVERY], [test x$HAVE_RECOVERY = xyes])
-AC_MSG_RESULT($HAVE_RECOVERY)
-dnl }}}
-dnl with-Sampling{{{
-AC_ARG_WITH([Sampling],
-	AS_HELP_STRING([--with-Sampling = YES], [compile with Sampling capabilities (default is yes)]),
-	[SAMPLING=$withval],[SAMPLING=yes])
-AC_MSG_CHECKING(for Sampling capability compilation)
-
-HAVE_SAMPLING=no 
-if test "x$SAMPLING" = "xyes"; then
-	HAVE_SAMPLING=yes
-	AC_DEFINE([_HAVE_SAMPLING_],[1],[with Sampling capability])
-fi
-AM_CONDITIONAL([SAMPLING], [test x$HAVE_SAMPLING = xyes])
-AC_MSG_RESULT($HAVE_SAMPLING)
-dnl }}}
-dnl with-Sealevelchange{{{
-AC_ARG_WITH([Sealevelchange],
-	AS_HELP_STRING([--with-Sealevelchange = YES], [compile with Sealevelchange capabilities (default is yes)]),
-	[SEALEVELCHANGE=$withval],[SEALEVELCHANGE=yes])
-AC_MSG_CHECKING(for Sealevelchange capability compilation)
-
-HAVE_SEALEVELCHANGE=no 
-if test "x$SEALEVELCHANGE" = "xyes"; then
-	HAVE_SEALEVELCHANGE=yes
-	AC_DEFINE([_HAVE_SEALEVELCHANGE_],[1],[with Sealevelchange capability])
-fi
-AM_CONDITIONAL([SEALEVELCHANGE], [test x$HAVE_SEALEVELCHANGE = xyes])
-AC_MSG_RESULT($HAVE_SEALEVELCHANGE)
-dnl }}}
-dnl with-Smb{{{
-AC_ARG_WITH([Smb],
-	AS_HELP_STRING([--with-Smb = YES], [compile with Smb capabilities (default is yes)]),
-	[SMB=$withval],[SMB=yes])
-AC_MSG_CHECKING(for Smb capability compilation)
-
-HAVE_SMB=no 
-if test "x$SMB" = "xyes"; then
-	HAVE_SMB=yes
-	AC_DEFINE([_HAVE_SMB_],[1],[with Smb capability])
-fi
-AM_CONDITIONAL([SMB], [test x$HAVE_SMB = xyes])
-AC_MSG_RESULT($HAVE_SMB)
-dnl }}}
-dnl with-Smooth{{{
-AC_ARG_WITH([Smooth],
-	AS_HELP_STRING([--with-Smooth = YES], [compile with Smooth capabilities (default is yes)]),
-	[SMOOTH=$withval],[SMOOTH=yes])
-AC_MSG_CHECKING(for Smooth capability compilation)
-
-HAVE_SMOOTH=no 
-if test "x$SMOOTH" = "xyes"; then
-	HAVE_SMOOTH=yes
-	AC_DEFINE([_HAVE_SMOOTH_],[1],[with Smooth capability])
-fi
-AM_CONDITIONAL([SMOOTH], [test x$HAVE_SMOOTH = xyes])
-AC_MSG_RESULT($HAVE_SMOOTH)
-dnl }}}
-dnl with-Stressbalance{{{
-AC_ARG_WITH([Stressbalance],
-	AS_HELP_STRING([--with-Stressbalance = YES], [compile with Stressbalance capabilities (default is yes)]),
-	[STRESSBALANCE=$withval],[STRESSBALANCE=yes])
-AC_MSG_CHECKING(for Stressbalance capability compilation)
-
-HAVE_STRESSBALANCE=no 
-if test "x$STRESSBALANCE" = "xyes"; then
-	HAVE_STRESSBALANCE=yes
-	AC_DEFINE([_HAVE_STRESSBALANCE_],[1],[with Stressbalance capability])
-fi
-AM_CONDITIONAL([STRESSBALANCE], [test x$HAVE_STRESSBALANCE = xyes])
-AC_MSG_RESULT($HAVE_STRESSBALANCE)
-dnl }}}
-dnl with-StressbalanceSIA{{{
-AC_ARG_WITH([StressbalanceSIA],
-	AS_HELP_STRING([--with-StressbalanceSIA = YES], [compile with StressbalanceSIA capabilities (default is yes)]),
-	[STRESSBALANCESIA=$withval],[STRESSBALANCESIA=yes])
-AC_MSG_CHECKING(for StressbalanceSIA capability compilation)
-
-HAVE_STRESSBALANCESIA=no 
-if test "x$STRESSBALANCESIA" = "xyes"; then
-	HAVE_STRESSBALANCESIA=yes
-	AC_DEFINE([_HAVE_STRESSBALANCESIA_],[1],[with StressbalanceSIA capability])
-fi
-AM_CONDITIONAL([STRESSBALANCESIA], [test x$HAVE_STRESSBALANCESIA = xyes])
-AC_MSG_RESULT($HAVE_STRESSBALANCESIA)
-dnl }}}
-dnl with-StressbalanceVertical{{{
-AC_ARG_WITH([StressbalanceVertical],
-	AS_HELP_STRING([--with-StressbalanceVertical = YES], [compile with StressbalanceVertical capabilities (default is yes)]),
-	[STRESSBALANCEVERTICAL=$withval],[STRESSBALANCEVERTICAL=yes])
-AC_MSG_CHECKING(for StressbalanceVertical capability compilation)
-
-HAVE_STRESSBALANCEVERTICAL=no 
-if test "x$STRESSBALANCEVERTICAL" = "xyes"; then
-	HAVE_STRESSBALANCEVERTICAL=yes
-	AC_DEFINE([_HAVE_STRESSBALANCEVERTICAL_],[1],[with StressbalanceVertical capability])
-fi
-AM_CONDITIONAL([STRESSBALANCEVERTICAL], [test x$HAVE_STRESSBALANCEVERTICAL = xyes])
-AC_MSG_RESULT($HAVE_STRESSBALANCEVERTICAL)
-dnl }}}
-dnl with-Thermal{{{
-AC_ARG_WITH([Thermal],
-	AS_HELP_STRING([--with-Thermal = YES], [compile with Thermal capabilities (default is yes)]),
-	[THERMAL=$withval],[THERMAL=yes])
-AC_MSG_CHECKING(for Thermal capability compilation)
-
-HAVE_THERMAL=no 
-if test "x$THERMAL" = "xyes"; then
-	HAVE_THERMAL=yes
-	AC_DEFINE([_HAVE_THERMAL_],[1],[with Thermal capability])
-fi
-AM_CONDITIONAL([THERMAL], [test x$HAVE_THERMAL = xyes])
-AC_MSG_RESULT($HAVE_THERMAL)
-dnl }}}
-dnl with-UzawaPressure{{{
-AC_ARG_WITH([UzawaPressure],
-	AS_HELP_STRING([--with-UzawaPressure = YES], [compile with UzawaPressure capabilities (default is yes)]),
-	[UZAWAPRESSURE=$withval],[UZAWAPRESSURE=yes])
-AC_MSG_CHECKING(for UzawaPressure capability compilation)
-
-HAVE_UZAWAPRESSURE=no 
-if test "x$UZAWAPRESSURE" = "xyes"; then
-	HAVE_UZAWAPRESSURE=yes
-	AC_DEFINE([_HAVE_UZAWAPRESSURE_],[1],[with UzawaPressure capability])
-fi
-AM_CONDITIONAL([UZAWAPRESSURE], [test x$HAVE_UZAWAPRESSURE = xyes])
-AC_MSG_RESULT($HAVE_UZAWAPRESSURE)
-dnl }}}
-
-])
Index: sm/trunk/m4/ar-lib.m4
===================================================================
--- /issm/trunk/m4/ar-lib.m4	(revision 28275)
+++ 	(revision )
@@ -1,61 +1,0 @@
-##                                                          -*- Autoconf -*-
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_AR([ACT-IF-FAIL])
-# -------------------------
-# Try to determine the archiver interface, and trigger the ar-lib wrapper
-# if it is needed.  If the detection of archiver interface fails, run
-# ACT-IF-FAIL (default is to abort configure with a proper error message).
-AC_DEFUN([AM_PROG_AR],
-[AC_BEFORE([$0], [LT_INIT])dnl
-AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([ar-lib])dnl
-AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
-: ${AR=ar}
-
-AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
-  [am_cv_ar_interface=ar
-   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
-     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
-      AC_TRY_EVAL([am_ar_try])
-      if test "$ac_status" -eq 0; then
-        am_cv_ar_interface=ar
-      else
-        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
-        AC_TRY_EVAL([am_ar_try])
-        if test "$ac_status" -eq 0; then
-          am_cv_ar_interface=lib
-        else
-          am_cv_ar_interface=unknown
-        fi
-      fi
-      rm -f conftest.lib libconftest.a
-     ])
-   ])
-
-case $am_cv_ar_interface in
-ar)
-  ;;
-lib)
-  # Microsoft lib, so override with the ar-lib wrapper script.
-  # FIXME: It is wrong to rewrite AR.
-  # But if we don't then we get into trouble of one sort or another.
-  # A longer-term fix would be to have automake use am__AR in this case,
-  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
-  # similar.
-  AR="$am_aux_dir/ar-lib $AR"
-  ;;
-unknown)
-  m4_default([$1],
-             [AC_MSG_ERROR([could not determine $AR interface])])
-  ;;
-esac
-AC_SUBST([AR])dnl
-])
Index: /issm/trunk/m4/issm_options.m4
===================================================================
--- /issm/trunk/m4/issm_options.m4	(revision 28275)
+++ /issm/trunk/m4/issm_options.m4	(revision 1)
@@ -1,2768 +1,393 @@
 dnl ISSM Options
 
-dnl TODO:
-dnl - Check if we need statements such as,
-dnl
-dnl.  	  AM_CONDITIONAL([JAVASCRIPT], [test "x${HAVE_JAVASCRIPT}" = "xyes"])
-dnl
-dnl	  when we have already performed a similar check,
-dnl
-dnl  	  if test "x${JAVASCRIPT}" = "xno"; then
-dnl
-dnl - Move library dependency checks from end of file to appropriate places
-dnl   inline
-dnl - Refactor conditionals that test both -d <file> and -f <file>
-dnl
-
 AC_DEFUN([ISSM_OPTIONS],[
-	AC_MSG_NOTICE(============================================================================)
-	AC_MSG_NOTICE(=                      Checking ISSM specific options                      =)
-	AC_MSG_NOTICE(============================================================================)
-
-	dnl ISSM's internal options
-	dnl Build info{{{
-
-	dnl Build date
-	AC_PATH_PROGS(DATE, date)
-	AC_MSG_CHECKING([for build date])
-	if test "$DATE"; then
-		PACKAGE_DATE=`date`
-	else
-		PACKAGE_DATE="unknown"
-	fi
-	AC_DEFINE_UNQUOTED([PACKAGE_BUILD_DATE], "${PACKAGE_DATE}", [build date])
-	AC_MSG_RESULT([${PACKAGE_DATE}])
-
-	dnl User name
-	AC_MSG_CHECKING([user name])
-	if test -n "$USER"
-	then
-		user_name="$USER"
-	else
-		if test -n "$LOGNAME"; then
-			user_name ="$LOGNAME"
-		else
-			user_name =`(whoami) 2>/dev/null` || user_name=unknown
-		fi
-	fi
-	AC_DEFINE_UNQUOTED([USER_NAME], "${user_name}", [user name])
-	AC_MSG_RESULT([${user_name}])
-
-	AC_MSG_CHECKING([host full OS name and version])
-	dnl Normalize some host OS names
-	case ${host_os} in
-		dnl linux is linux is linux, regardless of RMS
-		linux-gnu* | lignux* )	host_os=linux ;;
-	esac
-	AC_DEFINE_UNQUOTED([HOST_OS], "${host_os}", [host full OS name and version])
-	AC_MSG_RESULT([${host_os}])
-
-	AC_MSG_CHECKING([host cpu])
-	AC_DEFINE_UNQUOTED([HOST_CPU], "${host_cpu}", [host CPU])
-	AC_MSG_RESULT([${host_cpu}])
-
-	AC_MSG_CHECKING([vendor])
-	AC_DEFINE_UNQUOTED([HOST_VENDOR], "${host_vendor}", [host vendor])
-	AC_MSG_RESULT([${host_vendor}])
-
-	AC_MSG_CHECKING([host OS name])
-	host_os_name=`echo $host_os | sed 's/\..*//g'`
-	dnl Normalize some OS names
-	case ${host_os_name} in
-		dnl linux is linux is linux, regardless of RMS.
-		linux-gnu* | lignux* )	host_os_name=linux ;;
-	esac
-	AC_DEFINE_UNQUOTED([HOST_OS_NAME], "${host_os_name}", [host OS name])
-	AC_MSG_RESULT([${host_os_name}])
-
-	dnl Parse out the OS version of the host
-	AC_MSG_CHECKING([host OS version])
-	host_os_version=`echo $host_os | sed 's/^[[^0-9]]*//g'`
-	if test -z "$host_os_version"; then
-		host_os_version=`(uname -r) 2>/dev/null` || host_os_version=unknown
-	fi
-	AC_DEFINE_UNQUOTED([HOST_OS_VERSION], "${host_os_version}", [host OS version])
-	AC_MSG_RESULT([${host_os_version}])
-
-	dnl Determine host architecture (different than CPU)
-	AC_MSG_CHECKING([host OS architecture])
-	host_arch=`(uname -m) 2>/dev/null` || host_arch=unknown
-	dnl Normalize some names
-	case ${host_arch} in
-		sun4* )	host_arch=sun4 ;;
-		sun3x )	host_arch=sun3 ;;
-		sun )	host_arch=`(arch) 2>/dev/null` || host_arch=unknown ;;
-		i?86 )	host_arch=i386 ;; # all x86 should show up as i386
-	esac
-	AC_DEFINE_UNQUOTED([HOST_ARCH], "${host_arch}", [host archictecture])
-	AC_MSG_RESULT([${host_arch}])
-
-	dnl }}}
-	dnl Debugging {{{
-	AC_ARG_ENABLE(
-		[debugging],													dnl feature
-		AS_HELP_STRING([--enable-debugging], [turn debug support on]),	dnl help string
-		[enable_debugging=${enableval}],								dnl action if given
-		[enable_debugging=no]											dnl action if not given
-	)
-	AC_MSG_CHECKING(for debugging support)
-	if test "x${enable_debugging}" == "xyes"; then
-		AC_DEFINE([_ISSM_DEBUG_], [1], [Macro to enable debugging in ISSM])
-	fi
-	AC_MSG_RESULT([${enable_debugging}])
-	dnl }}}
-	dnl Development{{{
-	AC_ARG_ENABLE(
-		[development],													dnl feature
-		AS_HELP_STRING([--enable-development], [turn development on]),  dnl help string
-		[enable_development=${enableval}],								dnl action if given
-		[enable_development=no]											dnl action if not given
-	)
-	AC_MSG_CHECKING(for development support)
-	if test "x${enable_development}" == "xyes"; then
-		AC_DEFINE([_DEVELOPMENT_], [1], [enable development support in ISSM])
-	fi
-	AM_CONDITIONAL([DEVELOPMENT], [test "x${enable_development}" == "xyes"])
-	AC_MSG_RESULT([${enable_development}])
-	dnl }}}
-	dnl Standalone Options {{{
-	AC_ARG_ENABLE(
-		[standalone-modules],															dnl feature
-		AS_HELP_STRING([--enable-standalone-modules], [produce standalone modules]),	dnl help string
-		[enable_standalone_modules=${enableval}],										dnl action if given
-		[enable_standalone_modules=no]													dnl action if not given
-	)
-	AC_MSG_CHECKING(for standalone modules build)
-	AM_CONDITIONAL([STANDALONE_MODULES], [test "x${enable_standalone_modules}" == "xyes"])
-	AC_MSG_RESULT([${enable_standalone_modules}])
-
-	AC_ARG_ENABLE(
-		[standalone-executables],																dnl feature
-		AS_HELP_STRING([--enable-standalone-executables], [produce standalone executables]),	dnl help string
-		[enable_standalone_executables=${enableval}],											dnl action if given
-		[enable_standalone_executables=no]														dnl action if not given
-	)
-	AC_MSG_CHECKING(for standalone executables build)
-	AM_CONDITIONAL([STANDALONE_EXECUTABLES], [test "x${enable_standalone_executables}" == "xyes"])
-	AC_MSG_RESULT([${enable_standalone_executables}])
-
-	AC_ARG_ENABLE(
-		[standalone-libraries],																dnl feature
-		AS_HELP_STRING([--enable-standalone-libraries], [produce standalone libraries]),	dnl help string
-		[enable_standalone_libraries=${enableval}],											dnl action if given
-		[enable_standalone_libraries=no]													dnl action if not given
-	)
-	AC_MSG_CHECKING(for standalone libraries build)
-	AM_CONDITIONAL([STANDALONE_LIBRARIES], [test "x${enable_standalone_libraries}" == "xyes"])
-	AC_MSG_RESULT([${enable_standalone_libraries}])
-	dnl }}}
-	dnl Version{{{
-	AC_ARG_ENABLE(
-		[version],													dnl feature
-		AS_HELP_STRING([--enable-version], [produce libISSM.so.0]),	dnl help string
-		[enable_version=${enableval}],								dnl action if given
-		[enable_version=no]											dnl action if not given
-	)
-	AM_CONDITIONAL([VERSION], [test "x${enable_version}" == "xyes"])
-	dnl }}}
-	dnl Wrappers build {{{
-	AC_ARG_WITH(
-		[wrappers],															dnl feature
-		AS_HELP_STRING([--with-wrappers = value], [wrappers compilation]),	dnl help string
-		[WRAPPERS_VALUE=${withval}],										dnl action if given
-		[WRAPPERS_VALUE="yes"]												dnl action if not given
-	)
-	AC_MSG_CHECKING(for wrappers compilation)
-	AM_CONDITIONAL([WRAPPERS], [test "x${WRAPPERS_VALUE}" == "xyes"])
-	AC_MSG_RESULT([${WRAPPERS_VALUE}])
-	dnl }}}
-	dnl Extensions{{{
-	ISSMEXT=".exe"
-	AC_SUBST([ISSMEXT])
-	dnl }}}
-
-	dnl ISSM's externalpackages
-	dnl vendor{{{
-	AC_ARG_WITH(
-		[vendor],															dnl feature
-		AS_HELP_STRING([--with-vendor = VENDOR], [vendor name, ex: intel]),	dnl help string
-		[VENDOR=${withval}],												dnl action if given
-		[VENDOR=""]															dnl action if not given
-	)
-
-	AC_MSG_CHECKING([if this is a Mac build])
-	case "${host_os}" in
-		*darwin*)
-			IS_MAC=yes
-			AC_DEFINE([_MAC_], [1], [is macOS])
-			dnl When standard Dakota installation has been updated to new 
-			dnl version, remove the following
-			export CFLAGS="-Wno-deprecated-register -Wno-return-type"
-			export CXXFLAGS="-Wno-deprecated-register -Wno-return-type"
-			dnl NOTE: Commenting out the following, for now, as ISSM seems to 
-			dnl 	  compile and run fine, but certain errors (e.g. file not 
-			dnl 	  found) were not bubbling up, and instead causing MATLAB 
-			dnl 	  to crash.
-			dnl
-# 			if test "${LDFLAGS}" == ""; then
-# 				export LDFLAGS="-Wl,-no_compact_unwind"
-# 			else
-# 				export LDFLAGS="${LDFLAGS} -Wl,-no_compact_unwind"
-# 			fi
-		;;
-		*)
-			IS_MAC=no
-			AC_DEFINE([_MAC_], [0], [is macOS])
-		;;
-	esac
-	AM_CONDITIONAL([MAC], [test "${IS_MAC}" == "yes"])
-	AC_MSG_RESULT([${IS_MAC}])
-
-	dnl If macOS, check if system copy of libc has fmemopen (if it is not
-	dnl macOS, we do not check, but still must set SYSTEM_HAS_FMEMOPEN)
-	AC_MSG_CHECKING([if system copy of libc has fmemopen])
-	SYSTEM_FMEMOPEN=1
-	if test "${IS_MAC}" == "yes"; then
-		sys_ver=$(sw_vers -productVersion)
-		if test $(echo ${sys_ver} | cut -d "." -f 1) -eq 10 && test $(echo ${sys_ver} | cut -d "." -f 2) -lt 13; then
-			SYSTEM_FMEMOPEN=0
-		fi
-	fi
-	if test "${SYSTEM_FMEMOPEN}" == "1"; then
-		AC_MSG_RESULT([yes])
-	else
-		AC_MSG_RESULT([no])
-	fi
-	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], ${SYSTEM_FMEMOPEN}, [does system copy of libc have fmemopen])
-	AM_CONDITIONAL([SYSTEM_HAS_FMEMOPEN], [test "${SYSTEM_FMEMOPEN}" == "1"])
-
-	IS_MSYS2=no
-	IS_WINDOWS=no
-	AC_MSG_CHECKING([for vendor compilers])
-	if test -n "${VENDOR}"; then
-		if test "${VENDOR}" == "intel-win32"; then
-			export CC=icl
-			export CXX=icl
-			export CFLAGS="-DWIN32 -D_INTEL_WIN_"
-			export CXXFLAGS="-DWIN32 -D_INTEL_WIN_"
-			IS_WINDOWS=yes
-		elif test "${VENDOR}" == "intel-win7-32"; then
-			export CC=cl
-			export CXX=cl
-			export CXXFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
-			export CFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
-			export AR="ar-lib lib"
-			export OS_LDFLAG="-Wl,"
-			export RANLIB=true
-			IS_WINDOWS=yes
-			OSLIBS="-Wl,kernel32.lib -Wl,user32.lib -Wl,gdi32.lib -Wl,winspool.lib -Wl,comdlg32.lib -Wl,advapi32.lib -Wl,shell32.lib -Wl,ole32.lib -Wl,oleaut32.lib -Wl,uuid.lib -Wl,odbc32.lib -Wl,odbccp32.lib"
-		elif test "${VENDOR}" == "intel-win7-64"; then
-			export CC=cl
-			export CXX=cl
-			export CXXFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
-			export CFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
-			export AR="ar-lib lib"
-			export OS_LDFLAG="-Wl,"
-			export RANLIB=true
-			IS_WINDOWS=yes
-			OSLIBS="-Wl,kernel32.lib -Wl,user32.lib -Wl,gdi32.lib -Wl,winspool.lib -Wl,comdlg32.lib -Wl,advapi32.lib -Wl,shell32.lib -Wl,ole32.lib -Wl,oleaut32.lib -Wl,uuid.lib -Wl,odbc32.lib -Wl,odbccp32.lib"
-		elif test "${VENDOR}" == "MSVC-Win64"; then
-			export CC=cl
-			export CXX=cl
-			export CXXFLAGS="-DWIN32 -D_INTEL_WIN_ -D_HAVE_PETSC_MPI_ -EHsc"
-			export CFLAGS="-DWIN32 -D_INTEL_WIN_ -D_HAVE_PETSC_MPI_ -EHsc"
-			export AR="ar-lib lib"
-			export OS_LDFLAG="-Wl,"
-			export RANLIB=true
-			IS_WINDOWS=yes
-			OSLIBS="-Wl,kernel32.lib -Wl,user32.lib -Wl,gdi32.lib -Wl,winspool.lib -Wl,comdlg32.lib -Wl,advapi32.lib -Wl,shell32.lib -Wl,ole32.lib -Wl,oleaut32.lib -Wl,uuid.lib -Wl,odbc32.lib -Wl,odbccp32.lib"
-		elif test "${VENDOR}" == "MSVC-Win64-par"; then
-			export CC=cl
-			export CXX=cl
-			export CXXFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
-			export CFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
-			export AR="ar-lib lib"
-			export OS_LDFLAG="-Wl,"
-			export RANLIB=true
-			IS_WINDOWS=yes
-			OSLIBS="-Wl,kernel32.lib -Wl,user32.lib -Wl,gdi32.lib -Wl,winspool.lib -Wl,comdlg32.lib -Wl,advapi32.lib -Wl,shell32.lib -Wl,ole32.lib -Wl,oleaut32.lib -Wl,uuid.lib -Wl,odbc32.lib -Wl,odbccp32.lib"
-		elif test "${VENDOR}" == "intel-linux"; then
-			export CC=icc
-			export CXX=icpc
-			export CFLAGS="-D_INTEL_LINUX_"
-			export CXXFLAGS="-D_INTEL_LINUX_"
-		elif test "${VENDOR}" == "intel-gp"; then
-			export CC=icc
-			export CXX=icpc
-			export CFLAGS="-D_INTEL_LINUX_"
-			export CXXFLAGS="-D_INTEL_LINUX_"
-		elif test "${VENDOR}" == intel-lonestar; then
-			export CC=icc
-			export CXX=icpc
-		elif test "${VENDOR}" == "intel-aurora"; then
-			export CC=icc
-			export CXX=icpc
-			export CXXFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
-			export CFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
-		elif test "${VENDOR}" == "intel-discover"; then
-			export CC=mpicc
-			export CXX=mpicxx
-			export CXXFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK -std=c++11"
-			export CFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
-		elif test "${VENDOR}" == "intel-pleiades"; then
-			export CC=icc
-			export CXX=icpc
-			export CXXFLAGS="-O3 -D_INTEL_LINUX_ -std=c++11"
-			export CFLAGS="-O3 -D_INTEL_LINUX_"
-		elif test "${VENDOR}" == "intel-acenet"; then
-			export CC=icc
-			export CXX=icpc
-			export CXXFLAGS="-D_INTEL_LINUX_"
-			export CFLAGS="-D_INTEL_LINUX_"
-		elif test "${VENDOR}" == "intel-pleiades-gcc"; then
-			export CC=gcc
-			export CXX=g++
-			export CXXFLAGS="-O3 -march=corei7-avx -std=c++11"
-			export CFLAGS="-O3 -march=corei7-avx"
-		elif test "${VENDOR}" == "intel-pleiades-mpi"; then
-			export CC=mpicc
-			export CXX=mpicxx
-			export CXXFLAGS="-O3 -march=corei7-avx -std=c++11 -lirc -lsvml -limf"
-			export CFLAGS="-O3 -march=corei7-avx"
-		elif test "${VENDOR}" == "intel-pleiades-icpc"; then
-			export CXXFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict -std=c++11"
-			export CFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict"
-			AC_DEFINE([_HAVE_RESTRICT_], [1], [with restrict buffers])
-		elif test "${VENDOR}" == "win-msys2"; then
-			export CXXFLAGS="-D_MSYS2_"
-			export LDFLAGS="${LDFLAGS} -no-undefined"
-			export OSLIBS="-Wl,-L/c/msys64/mingw64/lib -Wl,-lstdc++ -Wl,-lmingw32 -Wl,-lgcc_s -Wl,-lmoldname -Wl,-lmingwex -Wl,-lmsvcrt -Wl,-lm -Wl,-lpthread -Wl,-lshell32 -Wl,-luser32 -Wl,-lgdi32 -Wl,-luser32 -Wl,-ladvapi32 -Wl,-lkernel32 -Wl,-lgcc"
-			IS_MSYS2=yes
-		else
-			AC_MSG_ERROR([unknown compiler vendor!])
-		fi
-	fi
-	dnl Set default standard for C++
-	if test "${CXXFLAGS}" == ""; then
-		export CXXFLAGS="-std=C++11"
-	fi
-	AC_SUBST([OSLIBS])
-	AC_MSG_RESULT([done])
-
-	AC_MSG_CHECKING([if this is a MSVC (Windows) build])
-	AM_CONDITIONAL([WINDOWS], [test "x${IS_WINDOWS}" == "xyes"])
-	AC_MSG_RESULT([${IS_WINDOWS}])
-
-	AC_MSG_CHECKING([if this is a MSYS2 (Windows) build])
-	AM_CONDITIONAL([MSYS2], [test "x${IS_MSYS2}" == "xyes"])
-	AC_MSG_RESULT([${IS_MSYS2}])
-	AC_DEFINE([_IS_MSYS2_], [1], [is a MSYS2 (Windows) build])
-	dnl }}}
-	dnl MATLAB{{{
-
-	dnl See if MATLAB has been provided
-	AC_MSG_CHECKING([for MATLAB])
-	AC_ARG_WITH(
-		[matlab-dir],														dnl feature
-		AS_HELP_STRING([--with-matlab-dir=DIR], [MATLAB root directory]),	dnl help string
-		[MATLAB_ROOT=${withval}],											dnl action if given
-		[MATLAB_ROOT="no"]													dnl action if not given
-	)
-	if test "x${MATLAB_ROOT}" == "xno"; then
-		HAVE_MATLAB=no
-	else
-		if ! test -d "${MATLAB_ROOT}"; then
-			AC_MSG_ERROR([MATLAB directory provided (${MATLAB_ROOT}) does not exist!]);
-		fi
-		if ! test -f "${MATLAB_ROOT}/extern/include/mex.h"; then
-			AC_MSG_ERROR([Couldn't find mex.h... check your installation of MATLAB])
-		fi
+	dnl Debugging option check.
+	AC_ARG_ENABLE([debugging],AS_HELP_STRING([--enable-debugging],
+					 [turn debug support on]),
+		[enable_debugging=$enableval],[enable_debugging=no])
+	if test "x$enable_debugging" = xyes; then
+	 AC_DEFINE([_DEBUG_],[1],[Macro to enable debugging in Dakota.])
+	fi
+
+	dnl serial build?
+	AC_ARG_WITH([serial],
+			  AS_HELP_STRING([--with-serial = value],
+							 [serial compilation. ]),
+			  [SERIAL_VALUE=$withval],[SERIAL_VALUE="yes"])
+	AC_MSG_CHECKING(for serial compilation)
+	AM_CONDITIONAL([NOSERIAL], [test $SERIAL_VALUE = no])
+	AC_MSG_RESULT($SERIAL_VALUE) 
+	
+
+	dnl parallel build?
+	AC_ARG_WITH([parallel],
+			  AS_HELP_STRING([--with-parallel = value],
+							 [parallel compilation. ]),
+			  [PARALLEL_VALUE=$withval],[PARALLEL_VALUE="yes"])
+	AC_MSG_CHECKING(for parallel compilation)
+	AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
+	AC_MSG_RESULT($PARALLEL_VALUE) 
+
+	dnl: check that at least serial or parallel builds have been requested!
+	if test "$SERIAL_VALUE" != "yes" ; then
+		if test "$PARALLEL_VALUE" != "yes"; then
+		AC_MSG_ERROR([cannot request --with-serial=no and --with-parallel=no at the same time!])
+		fi
+	fi
+
+
+	dnl Matlab directory
+	AC_ARG_WITH([matlab-dir],
+			  AS_HELP_STRING([--with-matlab-dir = DIR],
+							 [matlab root directory. necessary for serial build.]),
+			 [MATLAB_ROOT=$withval],[MATLAB_ROOT=""]) 
+	
+	if test -d "$MATLAB_ROOT"; then
+
+		AC_MSG_CHECKING(for Matlab headers and libraries in $MATLAB_ROOT)
+
+		dnl defaults
 		HAVE_MATLAB=yes
-	fi
-	AC_MSG_RESULT([${HAVE_MATLAB}])
-	AM_CONDITIONAL([MATLAB], [test "x${HAVE_MATLAB}" == "xyes"])
-
-	dnl Set variables
-	if test "x${HAVE_MATLAB}" == "xyes"; then
-		AC_DEFINE([_HAVE_MATLAB_], [1], [with MATLAB in ISSM src])
-
-		dnl Set MEX* variable
-		AC_MSG_CHECKING([MATLAB's mex compilation flags])
-
-		dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
-		dnl		  check again in the following conditionals
-		dnl
+		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
+		dnl  use matlab provided mexext routine to test for extension
+		MEXEXT=`$MATLAB_ROOT/bin/mexext`
+		MEXEXT=".$MEXEXT"
+		MEX=$MATLAB_ROOT/bin/mex
+
+		dnl OS-dependent variables and checks
 		case "${host_os}" in
-			*mingw*)
-				if test "${IS_MSYS2}" == "yes"; then
-					dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
-					MEXEXT=".mexw64"
-					MATLABINCL="-I${MATLAB_ROOT}/extern/include"
-					MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
-					MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
-					MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
-					MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
-					MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
-					MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
-				fi
-			;;
-			*)
-				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
-				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
-				MEXLINKFLAGS=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
-				MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS | sed -e "s/         CXXLIBS            = //g")
-				if test -z "${MEXEXT}"; then
-					echo "#include <mex.h>" > conftest.cpp
-					echo "void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){}" >> conftest.cpp
-					${MATLAB_ROOT}/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1
-					rm -f conftest.cpp
-					MEXLINKFLAGS=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
-					MEXLIB=$(cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
-					MEXEXT=$(cat conftest.tmp | grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
-					if test -z "${MEXEXT}"; then
-					 cat conftest.tmp
-					fi
-					rm -f conftest.tmp
-				fi
-
-				dnl Make sure mexFunction.map is not in MEXLIB to avoid problems with global variables
-				dnl MEXLINKFLAGS=$(echo ${MEXLINKFLAGS} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
-				MEXLINKFLAGS="" dnl We actually don't need MEXLINK????
+			*linux*)
+			if test "${host_cpu}" = "x86_64";
+			then
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnxa64/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
+			else
+				MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
+				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
+			fi
 			;;
 		esac
-		AC_MSG_RESULT([done])
-		if test -z "${MEXEXT}"; then
-			AC_MSG_ERROR([Couldn't use MATLAB's mex... check manual compilation with MATLAB or error message above])
-		fi
-
+
+		AC_DEFINE([_HAVE_MATLAB_],[1],[with Matlab in ISSM src])
+		AC_SUBST([MATLABINCL])
+		AC_SUBST([MEX])
 		AC_SUBST([MEXEXT])
-		AC_SUBST([MEXOPTFLAGS])
-		AC_SUBST([MEXCFLAGS])
-		AC_SUBST([MEXCXXFLAGS])
-		AC_SUBST([MATLABINCL])
-		AC_SUBST([MEXLINKFLAGS])
-		AC_SUBST([MEXLIB])
-	fi
-	dnl }}}
-	dnl JavaScript{{{
-	AC_MSG_CHECKING([for JavaScript])
-	AC_ARG_WITH(
-		[javascript],
-		AS_HELP_STRING([--with-javascript], [compile JavaScript wrappers? (default: no)]),
-		[JAVASCRIPT=${withval}],
-		[JAVASCRIPT="no"]
-	)
-	if test "x${JAVASCRIPT}" == "xno"; then
-		HAVE_JAVASCRIPT=no
-	else
-		HAVE_JAVASCRIPT=yes
-		AC_DEFINE([_HAVE_JAVASCRIPT_], [1], [with JavaScript])
-	fi
-	AC_MSG_RESULT([${HAVE_JAVASCRIPT}])
-	AM_CONDITIONAL([JAVASCRIPT], [test "x${HAVE_JAVASCRIPT}" == "xyes"])
-	JAVASCRIPTWRAPPEREXT=.js
-	AC_SUBST([JAVASCRIPTWRAPPEREXT])
-	dnl }}}
-	dnl Triangle {{{
-	AC_MSG_CHECKING([for triangle])
-	AC_ARG_WITH(
-		[triangle-dir],
-		AS_HELP_STRING([--with-triangle-dir=DIR], [Triangle root directory]),
-		[TRIANGLE_ROOT=${withval}],
-		[TRIANGLE_ROOT="no"]
-	)
-	if test "x${TRIANGLE_ROOT}" == "xno"; then
-		HAVE_TRIANGLE=no
-	else
+		AC_SUBST([MEXLIB]) 
+		AC_SUBST([MEXLINK])
+	
+		AC_MSG_RESULT($HAVE_MATLAB)
+	else
+		HAVE_MATLAB=no
+	fi
+
+	
+	if test $HAVE_MATLAB = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([--with-matlab-dir  missing. Matlab is needed to run ISSM serially!])
+		fi
+	fi
+
+	dnl get version number
+	if test $HAVE_MATLAB = yes; then
+
+		AX_MATLAB_VERSION
+		
+		dnl  if matlab version is 7.5 and more, and if platform is x86_64, then compile with largearray
+		dnl   default is no 
+		largearrays=no
+		if test $MATLAB_MAJOR -ge 7; then 
+			if test $MATLAB_MINOR -ge 5; then 
+				if test "${host_cpu}" = "x86_64"; then
+					largearrays=yes
+				fi
+			fi
+		fi
+	fi
+	AM_CONDITIONAL(LARGEARRAYS, test x$largearrays = xyes)
+	
+	dnl Triangle directory
+	AC_ARG_WITH([triangle-dir],
+			  AS_HELP_STRING([--with-triangle-dir = DIR], [triangle root directory. necessary for serial build]),
+			 [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT=""]) 
+	AC_MSG_CHECKING(for Triangle headers and libraries )
+	if test -d "$TRIANGLE_ROOT"; then
+
+
+		dnl defaults
 		HAVE_TRIANGLE=yes
-		if ! test -d "${TRIANGLE_ROOT}"; then
-			AC_MSG_ERROR([Triangle directory provided (${TRIANGLE_ROOT}) does not exist!]);
-		fi
-		if ! test -f "${TRIANGLE_ROOT}/include/triangle.h"; then
-			AC_MSG_ERROR([Couldn't find triangle.h... check your installation of triangle])
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_TRIANGLE}])
-	AM_CONDITIONAL([TRIANGLE], [test "x${HAVE_TRIANGLE}" == "xyes"])
-
-	dnl Triangle libraries and header files
-	if test "x${HAVE_TRIANGLE}" == "xyes"; then
-		TRIANGLEINCL=-I${TRIANGLE_ROOT}/include
-		case "${host_os}" in
-			*darwin*)
-				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
-					dnl Link to the object file, not the library
-					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
-				else
-					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
-				fi
-			;;
-			*linux*)
-				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
-					dnl Link to the object file, not the library
-					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
-				else
-					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
-				fi
-			;;
-			*mingw*)
-				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
-					dnl Link to the object file, not the library
-					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
-				else
-					TRIANGLELIB="-Wl,-L${TRIANGLE_ROOT}/lib -Wl,-ltriangle"
-				fi
-			;;
-		esac
-		AC_DEFINE([_HAVE_TRIANGLE_], [1], [with Triangle in ISSM src])
+		TRIANGLEINCL=-I$TRIANGLE_ROOT/
+		TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+
+		AC_DEFINE([_HAVE_TRIANGLE_],[1],[with Triangle in ISSM src])
 		AC_SUBST([TRIANGLEINCL])
 		AC_SUBST([TRIANGLELIB])
-	fi
-	dnl }}}
-	dnl Boost{{{
-	AC_MSG_CHECKING([for Boost])
-	AC_ARG_WITH(
-		[boost-dir],
-		AS_HELP_STRING([--with-boost-dir=DIR], [Boost root directory]),
-		[BOOST_ROOT=${withval}],
-		[BOOST_ROOT="no"]
-	)
-	if test "x${BOOST_ROOT}" == "xno"; then
-		HAVE_BOOST=no
-	else
-		HAVE_BOOST=yes
-		if ! test -d "${BOOST_ROOT}"; then
-			AC_MSG_ERROR([Boost directory provided (${BOOST_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_BOOST}])
-	AM_CONDITIONAL([BOOST], [test "x${HAVE_BOOST}" == "xyes"])
-
-	dnl Boost libraries and header files
-	if test "x${HAVE_BOOST}" == "xyes"; then
-		BOOSTINCL="-I${BOOST_ROOT}/include"
-		#BOOSTLIB="-L$BOOST_ROOT/lib -lboost_python"
-		AC_MSG_CHECKING(for Boost version)
-		BOOST_VERSION=`cat ${BOOST_ROOT}/include/boost/version.hpp | grep "#define BOOST_VERSION " | sed 's/.*BOOST_VERSION //'`
-		BOOST_VERSION_MAJOR=`expr ${BOOST_VERSION} / 100000`
-		BOOST_VERSION_MINOR=`expr ${BOOST_VERSION} / 100 % 1000`
-		AC_MSG_RESULT([${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}])
-		AC_DEFINE([_HAVE_BOOST_], [1], [with Boost in ISSM src])
-		AC_SUBST([BOOSTINCL])
-		AC_SUBST([BOOSTLIB])
-	fi
-	dnl }}}
-	dnl Dakota{{{
-	AC_MSG_CHECKING([for Dakota])
-	AC_ARG_WITH(
-		[dakota-dir],
-		AS_HELP_STRING([--with-dakota-dir=DIR], [Dakota root directory]),
-		[DAKOTA_ROOT=${withval}],
-		[DAKOTA_ROOT="no"]
-	)
-	if test "x${DAKOTA_ROOT}" == "xno"; then
-		HAVE_DAKOTA=no
-	else
-		HAVE_DAKOTA=yes
-		if ! test -d "${DAKOTA_ROOT}"; then
-			AC_MSG_ERROR([Dakota directory provided (${DAKOTA_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_DAKOTA}])
-	AM_CONDITIONAL([DAKOTA], [test "x${HAVE_DAKOTA}" == "xyes"])
-
-	dnl Dakota libraries and header files
-	if test "x${HAVE_DAKOTA}" == "xyes"; then
-		DAKOTAINCL=-I${DAKOTA_ROOT}/include
-
-		AC_MSG_CHECKING(for Dakota version)
-		dnl TODO:
-		dnl - Check if this method applies to all other versions of Dakota (it
-		dnl   should as long as the Dakota binaries have been compiled). If so,
-		dnl   we can remove the other methods of getting the version.
-		dnl - Modify src/wrappers/IssmConfig/IssmConfig.cpp so that strlen is
-		dnl   not called with _DAKOTA_VERSION_ as an argument so that we can
-		dnl   do,
-		dnl
-		dnl   	AC_DEFINE_UNQUOTED([_DAKOTA_VERSION_], ${DAKOTA_VERSION}, [Dakota version number])
-		dnl
-		if test -f "${DAKOTA_ROOT}/VERSION"; then
-			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'`
-		else
-			DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
-			if test -n "${DAKOTA_VERSION_OUTPUT}"; then
-				DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
-			elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then
-				DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
-			elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then
-				DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
-			else
-				AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
-			fi
-		fi
-		AC_MSG_RESULT([${DAKOTA_VERSION}])
-		AC_DEFINE_UNQUOTED(_DAKOTA_VERSION_, "${DAKOTA_VERSION}", [Dakota version number])
-
-		DAKOTAFLAGS=""
-
-		dnl NOTE:
-		dnl - See,
-		dnl
-		dnl 	$ISSM_DIR/externalpackages/dakota/build/src/Makefile.export.Dakota
-		dnl
-		dnl   for the flags needed by your combination of Boost and Dakota
-		dnl   versions
-		dnl - We know $DAKOTA_ROOT cannot be empty at this point, so no need to
-		dnl   check again in the following conditionals
-		dnl
-		dnl TODO:
-		dnl - Should we also be checking if HAVE_BOOST before adding boost libs?
-		dnl - Clean up the following conditionals
-		dnl
-		case "${host_os}" in
-			*darwin*)
-				if test "${DAKOTA_VERSION}" == "5.1" || test "${DAKOTA_VERSION}" == "5.2"; then
-					DAKOTALIB="-L${DAKOTA_ROOT}/lib -ldakota -lteuchos -lpecos -llhs -lsparsegrid -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -loptpp -lpsuade -lncsuopt -lcolin -linterfaces -lmomh -lscolib -lpebbl -ltinyxml -lutilib -l3po -lhopspack -lnidr -lamplsolver -lboost_signals -lboost_regex -lboost_filesystem -lboost_system -ldl"
-				elif test "${DAKOTA_VERSION}" == "5.3" || test "${DAKOTA_VERSION}" == "5.3.1"; then
-					DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_COLINY -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_JEGA -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-					DAKOTALIB="-L${DAKOTA_ROOT}/lib -L${BOOST_ROOT}/lib -ldakota_src -lpecos_src -lscolib -ljega_fe -llhs -lpebbl -lcolin -linterfaces -lmods -lmoga -loptpp -lsampling -lsoga -lsurfpack -lutilib -lconmin -ldakota_src_fortran -lmod -lncsuopt -lsurfpack_fortran -lteuchos -l3po -lamplsolver -lanalyzer -lbose -lcport -ldace -ldfftpack -leutils -lfsudace -lhopspack -ljega -lnidr -lpecos -lpsuade -lrandom -ltinyxml -lutilities -lsparsegrid -lboost_signals -lboost_regex -lboost_filesystem -lboost_system"
-					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H], [1], [enabling DAKOTA_CONFIG_H])
-					AC_DEFINE([DAKOTA_HAVE_MPI], [1], [enabling Dakota with MPI])
-				elif test "${DAKOTA_VERSION}" == "6.1" || test "${DAKOTA_VERSION}" == "6.2"; then
-					if test "${BOOST_VERSION_MAJOR}" == "1"; then
-						DAKOTAFLAGS="-DHAVE_CONFIG_H -DDISABLE_DAKOTA_CONFIG_H -DBOOST_DISABLE_ASSERTS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DHAVE_ADAPTIVE_SAMPLING -DHAVE_ESM -DHAVE_QUESO -DHAVE_QUESO_GPMSA -DHAVE_CONMIN -DHAVE_DDACE -DHAVE_DREAM -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_NOMAD -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-						DAKOTALIB="-L${DAKOTA_ROOT}/lib -ldakota_src -ldakota_src_fortran -lnidr -lteuchos -lpecos -lpecos_src -llhs -llhs_mods -llhs_mod -ldfftpack -lsparsegrid -lsurfpack -lsurfpack -lsurfpack_fortran -lqueso -lconmin -lddace -ldream -lfsudace -lhopspack -lncsuopt -lcport -lnomad -loptpp -lpsuade -lamplsolver"
-						DAKOTALIB+=" -L${BOOST_ROOT}/lib -lboost_filesystem -lboost_program_options -lboost_regex -lboost_serialization -lboost_system"
-						DAKOTALIB+=" ${BLASLAPACKLIB}"
-					fi
-					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H], [1], [enabling DAKOTA_CONFIG_H])
-					AC_DEFINE([DAKOTA_HAVE_MPI], [1], [enabling Dakota with MPI])
-				elif test "${DAKOTA_VERSION}" == "6.11"; then
-					if test "${BOOST_VERSION_MAJOR}" == "1"; then
-						if test "${BOOST_VERSION_MINOR}" == "55"; then
-							DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-							DAKOTALIB="-L${DAKOTA_ROOT}/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid -L$BOOST_ROOT/lib -lboost_serialization -lboost_signals -lboost_regex -lboost_filesystem -lboost_system ${BLASLAPACKLIB}"
-						elif test "${BOOST_VERSION_MINOR}" == "72"; then
-							DAKOTAFLAGS="-DHAVE_CONFIG_H -DDISABLE_DAKOTA_CONFIG_H -DBOOST_DISABLE_ASSERTS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DHAVE_ADAPTIVE_SAMPLING -DHAVE_ESM -DHAVE_CONMIN -DHAVE_DDACE -DHAVE_DREAM -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_NOMAD -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-							DAKOTALIB="-L${DAKOTA_ROOT}/lib -ldakota_src -ldakota_src_fortran -lnidr -lteuchosremainder -lteuchosnumerics -lteuchoscomm -lteuchosparameterlist -lteuchosparser -lteuchoscore -lpecos_util -lpecos_src -llhs -llhs_mods -llhs_mod -ldfftpack -lsparsegrid -lsurfpack -lsurfpack -lsurfpack_fortran -lapproxnn -lconmin -lddace -ldream -lfsudace -lhopspack -lncsuopt -lcport -lnomad -loptpp -lpsuade -lamplsolver -L${BOOST_ROOT}/lib -lboost_filesystem -lboost_program_options -lboost_regex -lboost_serialization -lboost_system ${BLASLAPACKLIB}"
-						fi
-					fi
-					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H], [1], [enabling DAKOTA_CONFIG_H])
-					AC_DEFINE([DAKOTA_HAVE_MPI], [1], [enabling Dakota with MPI])
-				else
-					AC_MSG_ERROR([Dakota version not found or version (${DAKOTA_VERSION}) not supported!]);
-				fi
-			;;
-			*linux*)
-				if test "${DAKOTA_VERSION}" == "5.1" || test "${DAKOTA_VERSION}" == "5.2"; then
-					DAKOTALIB="-L${DAKOTA_ROOT}/lib -ldakota -lteuchos -lpecos -llhs -lsparsegrid -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -loptpp -lpsuade -lncsuopt -lcolin -linterfaces -lmomh -lscolib -lpebbl -ltinyxml -lutilib -l3po -lhopspack -lnidr -lamplsolver -lboost_signals -lboost_regex -lboost_filesystem -lboost_system -ldl"
-				elif test "${DAKOTA_VERSION}" == "5.3" || test "${DAKOTA_VERSION}" == "5.3.1"; then
-					DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_COLINY -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_JEGA -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-					DAKOTALIB="-L${DAKOTA_ROOT}/lib -L${BOOST_ROOT}/lib -ldakota_src -lpecos_src -lscolib -ljega_fe -llhs -lpebbl -lcolin -linterfaces -lmods -lmoga -loptpp -lsampling -lsoga -lsurfpack -lutilib -lconmin -ldakota_src_fortran -lmod -lncsuopt -lsurfpack_fortran -lteuchos -l3po -lamplsolver -lanalyzer -lbose -lcport -ldace -ldfftpack -leutils -lfsudace -lhopspack -ljega -lnidr -lpecos -lpsuade -lrandom -ltinyxml -lutilities -lsparsegrid -lboost_signals -lboost_regex -lboost_filesystem -lboost_system"
-					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H], [1], [enabling DAKOTA_CONFIG_H])
-					AC_DEFINE([DAKOTA_HAVE_MPI], [1], [enabling Dakota with MPI])
-				elif test "${DAKOTA_VERSION}" == "6.1" || test "${DAKOTA_VERSION}" == "6.2"; then
-					if test "${BOOST_VERSION_MAJOR}" == "1"; then
-						DAKOTAFLAGS="-DHAVE_CONFIG_H -DDISABLE_DAKOTA_CONFIG_H -DBOOST_DISABLE_ASSERTS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DHAVE_ADAPTIVE_SAMPLING -DHAVE_ESM -DHAVE_QUESO -DHAVE_QUESO_GPMSA -DHAVE_CONMIN -DHAVE_DDACE -DHAVE_DREAM -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_NOMAD -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-						DAKOTALIB="-L${DAKOTA_ROOT}/lib -ldakota_src -ldakota_src_fortran -lnidr -lteuchos -lpecos -lpecos_src -llhs -llhs_mods -llhs_mod -ldfftpack -lsparsegrid -lsurfpack -lsurfpack -lsurfpack_fortran -lqueso -lconmin -lddace -ldream -lfsudace -lhopspack -lncsuopt -lcport -lnomad -loptpp -lpsuade -lamplsolver"
-						DAKOTALIB+=" -L${BOOST_ROOT}/lib -lboost_filesystem -lboost_program_options -lboost_regex -lboost_serialization -lboost_system"
-						DAKOTALIB+=" ${BLASLAPACKLIB}"
-					fi
-					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H], [1], [enabling DAKOTA_CONFIG_H])
-					AC_DEFINE([DAKOTA_HAVE_MPI], [1], [enabling Dakota with MPI])
-				elif test "${DAKOTA_VERSION}" == "6.11"; then
-					if test "${BOOST_VERSION_MAJOR}" == "1"; then
-						if test "${BOOST_VERSION_MINOR}" == "55"; then
-							DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-							DAKOTALIB="-L${DAKOTA_ROOT}/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid -L$BOOST_ROOT/lib -lboost_serialization -lboost_signals -lboost_regex -lboost_filesystem -lboost_system ${BLASLAPACKLIB}"
-						elif test "${BOOST_VERSION_MINOR}" == "72"; then
-							DAKOTAFLAGS="-DHAVE_CONFIG_H -DHAVE_CONFIG_H -DDISABLE_DAKOTA_CONFIG_H -DBOOST_DISABLE_ASSERTS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DHAVE_ADAPTIVE_SAMPLING -DHAVE_ESM -DHAVE_CONMIN -DHAVE_DDACE -DHAVE_DREAM -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_NOMAD -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-							DAKOTALIB="-L${DAKOTA_ROOT}/lib -ldakota_src -ldakota_src_fortran -lnidr -lteuchosremainder -lteuchosnumerics -lteuchoscomm -lteuchosparameterlist -lteuchosparser -lteuchoscore -lpecos_util -lpecos_src -llhs -llhs_mods -llhs_mod -ldfftpack -lsparsegrid -lsurfpack -lsurfpack -lsurfpack_fortran -lapproxnn -lconmin -lddace -ldream -lfsudace -lhopspack -lncsuopt -lcport -lnomad -loptpp -lpsuade -lamplsolver -L${BOOST_ROOT}/lib -lboost_filesystem -lboost_program_options -lboost_regex -lboost_serialization -lboost_system ${BLASLAPACKLIB}"
-						fi
-					fi
-					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H], [1], [enabling DAKOTA_CONFIG_H])
-					AC_DEFINE([DAKOTA_HAVE_MPI], [1], [enabling Dakota with MPI])
-				else
-					AC_MSG_ERROR([Dakota version not found or version (${DAKOTA_VERSION}) not supported!]);
-				fi
-			;;
-		esac
-
-		case ${DAKOTA_VERSION} in
-			@<:@1-9@:>@*.@<:@0-9@:>@*.@<:@0-9@:>@*)
-				DAKOTA_MAJOR=`echo ${DAKOTA_VERSION} | sed -e 's/^\(@<:@0-9@:>@*\)\..*/\1/'`
-				DAKOTA_MINOR=`echo ${DAKOTA_VERSION} | sed -e 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\)\..*/\1/'`
-				DAKOTA_BUILD=`echo ${DAKOTA_VERSION} | sed -e 's/^@<:@0-9@:>@*\.@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
-			;;
-			@<:@1-9@:>@*.@<:@0-9@:>@*)
-				DAKOTA_MAJOR=`echo ${DAKOTA_VERSION} | sed -e 's/^\(@<:@0-9@:>@*\)\..*/\1/'`
-				DAKOTA_MINOR=`echo ${DAKOTA_VERSION} | sed -e 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
-				DAKOTA_BUILD=0
-			;;
-			*)
-				AC_MSG_ERROR([Dakota version (${DAKOTA_VERSION}) not supported!])
-			;;
-		esac
-		AC_MSG_CHECKING(for Dakota major version)
-		AC_MSG_RESULT(${DAKOTA_MAJOR})
-		AC_DEFINE_UNQUOTED([_DAKOTA_MAJOR_], ${DAKOTA_MAJOR}, [Dakota major version number])
-		AC_MSG_CHECKING(for Dakota minor version)
-		AC_MSG_RESULT(${DAKOTA_MINOR})
-		AC_DEFINE_UNQUOTED([_DAKOTA_MINOR_], ${DAKOTA_MINOR}, [Dakota minor version number])
-		AC_MSG_CHECKING(for Dakota build version)
-		AC_MSG_RESULT(${DAKOTA_BUILD})
-		AC_DEFINE_UNQUOTED([_DAKOTA_BUILD_], ${DAKOTA_BUILD}, [Dakota build version number])
-
-		AC_DEFINE([_HAVE_DAKOTA_], [1], [with Dakota in ISSM src])
-		AC_SUBST([DAKOTAINCL])
-		AC_SUBST([DAKOTAFLAGS])
-		AC_SUBST([DAKOTALIB])
-	fi
-	AM_CONDITIONAL([ISSM_DAKOTA], [test "x${DAKOTA_MAJOR}" == "x6"])
-	dnl }}}
-	dnl Python{{{
-	AC_MSG_CHECKING([for Python])
-	AC_ARG_WITH(
-		[python-dir],
-		AS_HELP_STRING([--with-python-dir=DIR], [Python root directory]),
-		[PYTHON_ROOT=${withval}],
-		[PYTHON_ROOT="no"]
-	)
-
-	AC_ARG_WITH(
-		[python-version],
-		AS_HELP_STRING([--with-python-version=DIR], [Python forced version]),
-		[PYTHON_VERSION=${withval}],
-		[PYTHON_VERSION="no"]
-	)
-	if test "x${PYTHON_ROOT}" == "xno"; then
-		HAVE_PYTHON=no
-		HAVE_PYTHON3=no
-	else
-		HAVE_PYTHON=yes
-		if ! test -d "${PYTHON_ROOT}"; then
-			AC_MSG_ERROR([Python directory provided (${PYTHON_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_PYTHON}])
-	AM_CONDITIONAL([PYTHON], [test "x${HAVE_PYTHON}" == "xyes"])
-
-	dnl Python specifics
-	if test "x${HAVE_PYTHON}" == "xyes"; then
-		if test "x${PYTHON_VERSION}" == "xno"; then
-			AC_MSG_CHECKING([for Python version])
-			dnl Query Python for its version number. Getting [:3] seems to be
-			dnl the best way to do this: it's what "site.py" does in the
-			dnl standard library.
-			PYTHON_VERSION=$(${PYTHON_ROOT}/bin/python -c "import sys; print(sys.version[[:3]])")
-			AC_MSG_RESULT([${PYTHON_VERSION}])
-		else
-			AC_MSG_RESULT([enforced Python version is ${PYTHON_VERSION}])
-		fi
-		dnl Determine major version
-		PYTHON_MAJOR=${PYTHON_VERSION%.*}
-		AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_], ${PYTHON_MAJOR}, [Python version major])
-		if test "x${PYTHON_MAJOR}" == "x3"; then
-			HAVE_PYTHON3="yes"
-		else
-			HAVE_PYTHON3="no"
-		fi
-
-		AC_MSG_CHECKING([for Python header file Python.h])
-		dnl Python.h might be in different locations:
-		if test -f "${PYTHON_ROOT}/include/Python.h"; then
-			PYTHONINCL=-I${PYTHON_ROOT}/include
-		elif test -f "${PYTHON_ROOT}/include/python${PYTHON_VERSION}/Python.h"; then
-			PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}
-		elif test -f "${PYTHON_ROOT}/include/python${PYTHON_VERSION}m/Python.h"; then
-			PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}m
-		else
-			AC_MSG_ERROR([Python.h not found! Please locate this file and contact ISSM developers via forum or email.]);
-		fi
-		AC_MSG_RESULT([found])
-
-		AC_MSG_CHECKING([for Python library libpython])
-		if ls ${PYTHON_ROOT}/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
-			PYTHONLIB="-L${PYTHON_ROOT}/lib/x86_64-linux-gnu -lpython${PYTHON_VERSION}m"
-		elif ls ${PYTHON_ROOT}/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}.* 1> /dev/null 2>&1; then
-			PYTHONLIB="-L${PYTHON_ROOT}/lib/x86_64-linux-gnu -lpython${PYTHON_VERSION}"
-		elif ls ${PYTHON_ROOT}/lib/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
-			PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}m"
-		elif ls ${PYTHON_ROOT}/lib/libpython${PYTHON_VERSION}.* 1> /dev/null 2>&1; then
-			PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}"
-		elif ls ${PYTHON_ROOT}/lib64/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
-			PYTHONLIB="-L${PYTHON_ROOT}/lib64 -lpython${PYTHON_VERSION}m"
-		elif ls ${PYTHON_ROOT}/lib64/libpython${PYTHON_VERSION}.* 1> /dev/null 2>&1; then
-			PYTHONLIB="-L${PYTHON_ROOT}/lib64 -lpython${PYTHON_VERSION}"
-		else
-			AC_MSG_ERROR([libpython not found! Please locate this file and contact ISSM developers via forum or email.]);
-		fi
-		AC_MSG_RESULT([found])
-
-		PYWRAPPEREXT=.so
-		case "${host_os}" in
-			*darwin*)
-				PYTHONLINK="-dynamiclib"
-			;;
-			*linux*)
-				PYTHONLINK="-shared"
-			;;
-			*mingw*)
-				PYTHONLINK="-shared"
-			;;
-		esac
-		AC_DEFINE([_HAVE_PYTHON_], [1], [with Python in ISSM src])
-		AC_SUBST([PYTHONINCL])
-		AC_SUBST([PYTHONLIB])
-		PYTHONWRAPPEREXT=${PYWRAPPEREXT}
-		AC_SUBST([PYTHONWRAPPEREXT])
-		AC_SUBST([PYTHONLINK])
-	fi
-	AM_CONDITIONAL([PYTHON3], [test "x${HAVE_PYTHON3}" == "xyes"])
-	dnl }}}
-	dnl NumPy{{{
-	dnl NOTE: You can find NumPy by running,
-	dnl
-	dnl		>>> import numpy
-	dnl		>>> numpy.__file__
-	dnl
-	dnl TODO:
-	dnl - Replace references to python-numpy with numpy (and similar terms)
-	dnl	  project-wide
-	dnl
-	AC_MSG_CHECKING(for python-numpy)
-	AC_ARG_WITH(
-		[python-numpy-dir],
-		AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory]),
-		[PYTHON_NUMPY_ROOT=${withval}],
-		[PYTHON_NUMPY_ROOT="no"]
-	)
-	if test "x${PYTHON_NUMPY_ROOT}" == "xno"; then
-		HAVE_PYTHON_NUMPY=no
-	else
-		HAVE_PYTHON_NUMPY=yes
-		if ! test -d "${PYTHON_NUMPY_ROOT}"; then
-			AC_MSG_ERROR([NumPy directory provided (${PYTHON_NUMPY_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_PYTHON_NUMPY}])
-
-	dnl NumPy libraries and header files
-	if test "x${HAVE_PYTHON_NUMPY}" == "xyes"; then
-		PYTHON_NUMPYINCL="-I${PYTHON_NUMPY_ROOT} -I${PYTHON_NUMPY_ROOT}/core/include/numpy"
-		AC_DEFINE([_HAVE_PYTHON_NUMPY_], [1], [with NumPy in ISSM src])
-		AC_SUBST([PYTHON_NUMPYINCL])
-	fi
-	dnl }}}
-	dnl Chaco{{{
-	AC_MSG_CHECKING([for Chaco])
-	AC_ARG_WITH(
-		[chaco-dir],
-		AS_HELP_STRING([--with-chaco-dir=DIR], [Chaco root directory]),
-		[CHACO_ROOT=${withval}],
-		[CHACO_ROOT="no"]
-	)
-	if test "x${CHACO_ROOT}" == "xno"; then
-		HAVE_CHACO=no
-	else
-		HAVE_CHACO=yes
-		if ! test -d "${CHACO_ROOT}"; then
-			AC_MSG_ERROR([Chaco directory provided (${CHACO_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_CHACO}])
-	AM_CONDITIONAL([CHACO], [test "x${HAVE_CHACO}" == "xyes"])
-
-	dnl Chaco libraries and header files
-	if test "x${HAVE_CHACO}" == "xyes"; then
-		CHACOINCL="-I${CHACO_ROOT}/include"
-		if test "${IS_MSYS2}" == "yes"; then
-			CHACOLIB="-Wl,-L${CHACO_ROOT}/lib -Wl,-lchacominusblas"
-		else
-			CHACOLIB="-L${CHACO_ROOT}/lib -lchacominusblas"
-		fi
-		AC_DEFINE([_HAVE_CHACO_], [1], [with Chaco in ISSM src])
-		AC_SUBST([CHACOINCL])
-		AC_SUBST([CHACOLIB])
-	fi
-	dnl }}}
-	dnl ESMF{{{
-	AC_MSG_CHECKING([for ESMF])
-	AC_ARG_WITH(
-		[esmf-dir],
-		AS_HELP_STRING([--with-esmf-dir=DIR], [ESMF root directory]),
-		[ESMF_ROOT=${withval}],
-		[ESMF_ROOT="no"]
-	)
-	if test "x${ESMF_ROOT}" == "xno"; then
-		HAVE_ESMF=no
-	else
-		HAVE_ESMF=yes
-		if ! test -d "${ESMF_ROOT}"; then
-			AC_MSG_ERROR([ESMF directory provided (${ESMF_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_ESMF}])
-
-	dnl ESMF libraries and header files
-	if test "x${HAVE_ESMF}" == "xyes"; then
-		ESMFINCL="-I${ESMF_ROOT}/include"
-		ESMFLIB="-L${ESMF_ROOT}/lib/libO/Linux.gfortran.64.mpich.default/ -lesmf"
-		AC_DEFINE([_HAVE_ESMF_], [1], [with ESMF in ISSM src])
-		AC_SUBST([ESMFINCL])
-		AC_SUBST([ESMFLIB])
-	fi
-	AM_CONDITIONAL([ESMF], [test "x${HAVE_ESMF}" == "xyes"])
-	dnl }}}
-	dnl CoDiPack{{{
-	AC_MSG_CHECKING([for CoDiPack])
-	AC_ARG_WITH(
-		[codipack-dir],
-		AS_HELP_STRING([--with-codipack-dir=DIR], [CoDiPack root directory]),
-		[CODIPACK_ROOT=${withval}],
-		[CODIPACK_ROOT="no"]
-	)
-	if test "x${CODIPACK_ROOT}" == "xno"; then
-		HAVE_CODIPACK=no
-	else
-		HAVE_CODIPACK=yes
-		if ! test -d "${CODIPACK_ROOT}"; then
-			AC_MSG_ERROR([CoDiPack directory provided (${CODIPACK_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_CODIPACK}])
-
-	dnl CoDiPack libraries and header files
-	if test "x${HAVE_CODIPACK}" == "xyes"; then
-
-		AC_MSG_CHECKING(for CoDiPack version)
-		CODIPACK_MAJOR=`cat ${CODIPACK_ROOT}/include/codi.hpp | grep "#define CODI_MAJOR_VERSION" | sed 's/#define CODI_MAJOR_VERSION//' | sed 's/ //g'`
-		CODIPACK_MINOR=`cat ${CODIPACK_ROOT}/include/codi.hpp | grep "#define CODI_MINOR_VERSION" | sed 's/#define CODI_MINOR_VERSION//' | sed 's/ //g'`
-		if test -z "${CODIPACK_MAJOR}"; then
-			 CODIPACK_MAJOR=`cat ${CODIPACK_ROOT}/include/codi/configure.h | grep "#define CODI_MAJOR_VERSION" | sed 's/#define CODI_MAJOR_VERSION//' | sed 's/ //g'`
-			 CODIPACK_MINOR=`cat ${CODIPACK_ROOT}/include/codi/configure.h | grep "#define CODI_MINOR_VERSION" | sed 's/#define CODI_MINOR_VERSION//' | sed 's/ //g'`
-		fi
-		if test -z "${CODIPACK_MAJOR}"; then
-			AC_MSG_ERROR([Couldn't determine CoDiPack version])
-		fi
-		AC_DEFINE_UNQUOTED([_CODIPACK_MAJOR_], ${CODIPACK_MAJOR}, [CoDiPack version major])
-		AC_DEFINE_UNQUOTED([_CODIPACK_MINOR_], ${CODIPACK_MINOR}, [CoDiPack version minor])
-		AC_MSG_RESULT([${CODIPACK_MAJOR}.${CODIPACK_MINOR}])
-
-		CODIPACKINCL="-I${CODIPACK_ROOT}/include"
-		AC_DEFINE([_HAVE_CODIPACK_], [1], [with CoDiPack in ISSM src])
-		AC_DEFINE([_HAVE_AD_], [1], [with AD in ISSM src])
-		AC_SUBST([CODIPACKINCL])
-	fi
-	AM_CONDITIONAL([CODIPACK], [test "x${HAVE_CODIPACK}" == "xyes"])
-	AM_COND_IF(CODIPACK, [CXXFLAGS+=" -std=c++11"])
-	dnl }}}
-	dnl Tape Allocation {{{
-	AC_MSG_CHECKING(for tape allocation)
-	AC_ARG_ENABLE(
-		[tape-alloc],																dnl feature
-		AS_HELP_STRING([--enable-tape-alloc], [turn tape allocation support on]),
-		[enable_tape_alloc=${enableval}],
-		[enable_tape_alloc=no]
-	)
-	if test "x${enable_tape_alloc}" == "xyes"; then
-		AC_DEFINE([_AD_TAPE_ALLOC_], [1], [enable a priori tape allocation for AD])
-	fi
-	AC_MSG_RESULT([${enable_tape_alloc}])
-	dnl }}}
-	dnl ADOL-C {{{
-	AC_MSG_CHECKING([for ADOL-C])
-	AC_ARG_WITH(
-		[adolc-dir],
-		AS_HELP_STRING([--with-adolc-dir=DIR], [ADOL-C root directory]),
-		[ADOLC_ROOT=${withval}],
-		[ADOLC_ROOT="no"]
-	)
-	if test "x${ADOLC_ROOT}" == "xno"; then
-		HAVE_ADOLC=no
-	else
-		HAVE_ADOLC=yes
-		if ! test -d "${ADOLC_ROOT}"; then
-			AC_MSG_ERROR([ADOL-C directory provided (${ADOLC_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_ADOLC}])
-
-	dnl ADOL-C libraries and header files
-	if test "x${HAVE_ADOLC}" == "xyes"; then
-		ADOLCINCL="-I${ADOLC_ROOT}/include"
-		dnl ADOLCLIB="-L${ADOLC_ROOT}/lib64 -ladolc" used to be the path
-		ADOLCLIB="-L${ADOLC_ROOT}/lib -ladolc"
-		AC_DEFINE([_HAVE_ADOLC_], [1], [with ADOL-C in ISSM src])
-		AC_DEFINE([_HAVE_AD_], [1], [with AD in ISSM src])
-		AC_SUBST([ADOLCINCL])
-		AC_SUBST([ADOLCLIB])
-	fi
-	AM_CONDITIONAL([ADOLC], [test "x${HAVE_ADOLC}" == "xyes"])
-	AM_COND_IF(ADOLC, [CXXFLAGS+=" -std=c++11"])
-	dnl }}}
-	dnl ADOL-C version{{{
-	AC_MSG_CHECKING(for ADOL-C version)
-	AC_ARG_WITH(
-		[adolc-version],
-		AS_HELP_STRING([--with-adolc-version=number], [ADOL-C version]),
-		[ADOLC_VERSION=${withval}],
-		[ADOLC_VERSION=2]
-	)
-	AC_DEFINE_UNQUOTED([_ADOLC_VERSION_], ${ADOLC_VERSION}, [ADOL-C version])
-	AC_MSG_RESULT(${ADOLC_VERSION})
-	dnl }}}
-	dnl ADIC2 {{{
-	AC_MSG_CHECKING([for ADIC2])
-	AC_ARG_WITH(
-		[adic2-dir],
-		AS_HELP_STRING([--with-adic2-dir=DIR], [ADIC2 root directory]),
-		[ADIC2_ROOT=${withval}],
-		[ADIC2_ROOT="no"]
-	)
-	if test "x${ADIC2_ROOT}" == "xno"; then
-		HAVE_ADIC2=no
-	else
-		HAVE_ADIC2=yes
-		if ! test -d "${ADIC2_ROOT}"; then
-			AC_MSG_ERROR([ADIC2 directory provided (${ADIC2_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_ADIC2}])
-
-	dnl ADIC2 libraries and header files
-	if test "x${HAVE_ADIC2}" == "xyes"; then
-		ADIC2INCL="-DADIC2_DENSE -I${ADIC2_ROOT}/include -I${ADIC2_ROOT}/share/runtime_dense"
-		ADIC2LIB=""
-		AC_DEFINE([_HAVE_ADIC2_], [1], [with ADIC2 in ISSM src])
-		AC_SUBST([ADIC2INCL])
-		AC_SUBST([ADIC2LIB])
-	fi
-	AM_CONDITIONAL([ADIC2], [test "x${HAVE_ADIC2}" == "xyes"])
-	dnl }}}
-	dnl ATLAS {{{
-	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
-	AC_ARG_WITH(
-		[atlas-dir],
-		AS_HELP_STRING([--with-atlas-dir=DIR], [ATLAS root directory]),
-		[ATLAS_ROOT=${withval}],
-		[ATLAS_ROOT="no"]
-	)
-	if test "x${ATLAS_ROOT}" == "xno"; then
-		HAVE_ATLAS=no
-	else
-		HAVE_ATLAS=yes
-		if ! test -d "${ATLAS_ROOT}"; then
-			AC_MSG_ERROR([ATLAS directory provided (${ATLAS_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_ATLAS}])
-
-	dnl ATLAS libraries and header files
-	if test "x${HAVE_ATLAS}" == "xyes"; then
-		case "${host_os}" in
-			*darwin*)
-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
-			;;
-			*linux*)
-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
-			;;
-			*mingw*)
-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
-			;;
-		esac
-		AC_DEFINE([_HAVE_ATLAS_], [1], [with ATLAS in ISSM src])
-		AC_SUBST([ATLASLIB])
-	fi
-	dnl }}}
-	dnl GSL{{{
-	AC_MSG_CHECKING([for GSL])
-	AC_ARG_WITH(
-		[gsl-dir],
-		AS_HELP_STRING([--with-gsl-dir=DIR], [GSL root directory]),
-		[GSL_ROOT=${withval}],
-		[GSL_ROOT="no"]
-	)
-	if test "x${GSL_ROOT}" == "xno"; then
-		HAVE_GSL=no
-	else
-		HAVE_GSL=yes
-		if ! test -d "${GSL_ROOT}"; then
-			AC_MSG_ERROR([GSL directory provided (${GSL_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_GSL}])
-
-	dnl GSL libraries and header files
-	if test "x${HAVE_GSL}" == "xyes"; then
-		GSLINCL="-I${GSL_ROOT}/include"
-		if test "x${HAVE_ATLAS}" == "xyes"; then
-			GSLLIB="-dy -L${GSL_ROOT}/lib -lgsl -L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
-		else
-			GSLLIB="-L${GSL_ROOT}/lib -lgsl -lgslcblas -lm"
-		fi
-		AC_DEFINE([_HAVE_GSL_], [1], [with GSL in ISSM src])
-		AC_SUBST([GSLINCL])
-		AC_SUBST([GSLLIB])
-	fi
-	AM_CONDITIONAL([GSL], [test "x${HAVE_GSL}" == "xyes"])
-	dnl }}}
-	dnl AMPI (ADOL-C){{{
-	AC_MSG_CHECKING([for AMPI])
-	AC_ARG_WITH(
-		[ampi-dir],
-		AS_HELP_STRING([--with-ampi-dir=DIR], [Adjoinable MPI root directory]),
-		[AMPI_ROOT=${withval}],
-		[AMPI_ROOT="no"]
-	)
-	if test "x${AMPI_ROOT}" == "xno"; then
-		HAVE_AMPI=no
-	else
-		HAVE_AMPI=yes
-		if ! test -d "${AMPI_ROOT}"; then
-			AC_MSG_ERROR([AMPI directory provided (${AMPI_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_AMPI}])
-
-	dnl AMPI libraries and header files
-	if test "x${HAVE_AMPI}" == "xyes"; then
-		AMPIINCL="-I${AMPI_ROOT}/include"
-		if test "x${ADOLC_ROOT}" == "xno"; then
-			AC_MSG_ERROR([cannot run AMPI without ADOL-C]);
-		fi
-		dnl AMPILIB="-dy -L${AMPI_ROOT}/lib -lampiCommon -L${ADOLC_ROOT}/lib -ladolc -L${AMPI_ROOT}/lib -lampiCommon -lampiBookkeeping -lampiTape"
-		dnl AMPILIB="-dy -L${AMPI_ROOT}/lib  -L${ADOLC_ROOT}/lib -Wl,--start-group,-lampiCommon,-ladolc,-lampiCommon,-lampiBookkeeping,-lampiTape,-lampiPlainC,-lampiADtoolStubsST,--end-group"
-		dnl AMPILIB="-L${AMPI_ROOT}/lib  -L${ADOLC_ROOT}/lib -Wl,--start-group -lampiCommon -ladolc -lampiCommon -lampiBookkeeping -lampiTape -lampiPlainC -lampiADtoolStubsST -Wl,--end-group"
-		dnl AMPILIB="${AMPI_ROOT}/lib/libampiCommon.so ${ADOLC_ROOT}/lib/libadolc.so  ${AMPI_ROOT}/lib/libampiCommon.so ${AMPI_ROOT}/lib/libampiBookkeeping.so ${AMPI_ROOT}/lib/libampiTape.so ${AMPI_ROOT}/lib/libampiPlainC.so  ${AMPI_ROOT}/lib/libampiADtoolStubsST.so"
-		dnl AMPILIB="-dy -L${AMPI_ROOT}/lib  -L${ADOLC_ROOT}/lib -lampiCommon -ladolc -lampiCommon -lampiBookkeeping -lampiTape -lampiPlainC -lampiADtoolStubsST"
-		AMPILIB="-dy -L${AMPI_ROOT}/lib  -lampiCommon -lampiBookkeeping -lampiTape"
-		AC_DEFINE([_HAVE_AMPI_], [1], [with AMPI in ISSM src])
-		AC_SUBST([AMPIINCL])
-		AC_SUBST([AMPILIB])
-	fi
-	AM_CONDITIONAL([AMPI], [test "x${HAVE_AMPI}" == "xyes"])
-	dnl }}}
-	dnl Adjoint MPI (CoDiPack){{{
-	AC_MSG_CHECKING([for Adjoint MPI])
-	AC_ARG_WITH(
-		[adjointmpi-dir],
-		AS_HELP_STRING([--with-adjointmpi-dir=DIR], [Adjoint MPI root directory]),
-		[ADJOINTMPI_ROOT=${withval}],
-		[ADJOINTMPI_ROOT="no"]
-	)
-	if test "x${ADJOINTMPI_ROOT}" == "xno"; then
-		HAVE_ADJOINTMPI=no
-	else
-		HAVE_ADJOINTMPI=yes
-		if ! test -d "${ADJOINTMPI_ROOT}"; then
-			AC_MSG_ERROR([Adjoint MPI directory provided (${ADJOINTMPI_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_ADJOINTMPI}])
-
-	dnl Adjoint MPI libraries and header files
-	if test "x${HAVE_ADJOINTMPI}" == "xyes"; then
-		if test "x${CODIPACK_ROOT}" == "xno"; then
-			AC_MSG_ERROR([cannot run Adjoint MPI without CoDiPack]);
-		fi
-		ADJOINTMPIINCL="-I${ADJOINTMPI_ROOT}/include"
-		ADJOINTMPILIB="-L${ADJOINTMPI_ROOT}/lib  -lAMPI"
-		dnl Also set _HAVE_AMPI_, because the interface is (almost) the same as
-		dnl for AMPI
-		AC_DEFINE([_HAVE_AMPI_], [1], [with AMPI in ISSM src])
-		AC_DEFINE([_HAVE_ADJOINTMPI_], [1], [with Adjoint MPI in ISSM src])
-		AC_SUBST([ADJOINTMPIINCL])
-		AC_SUBST([ADJOINTMPILIB])
-	fi
-	AM_CONDITIONAL([ADJOINTMPI], [test "x${HAVE_ADJOINTMPI}" == "xyes"])
-	dnl }}}
-	dnl MeDiPack (CoDiPack, ADOL-C dev){{{
-	AC_MSG_CHECKING([for MeDiPack])
-	AC_ARG_WITH(
-		[medipack-dir],
-		AS_HELP_STRING([--with-medipack-dir=DIR], [MeDiPack root directory]),
-		[MEDIPACK_ROOT=${withval}],
-		[MEDIPACK_ROOT="no"]
-	)
-	if test "x${MEDIPACK_ROOT}" == "xno"; then
-		HAVE_MEDIPACK=no
-	else
-		HAVE_MEDIPACK=yes
-		if ! test -d "${MEDIPACK_ROOT}"; then
-			AC_MSG_ERROR([MeDiPack directory provided (${MEDIPACK_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_MEDIPACK}])
-
-	dnl MeDiPack libraries and header files
-	if test "x${HAVE_MEDIPACK}" == "xyes"; then
-		if test "x${CODIPACK_ROOT}" == "xno"; then
-			AC_MSG_ERROR([cannot run MeDiPack without CoDiPack]);
-		fi
-		MEDIPACKINCL="-I${MEDIPACK_ROOT}/include -I${MEDIPACK_ROOT}/src"
-		dnl Also set _HAVE_AMPI_, because the interface is (almost) the same as
-		dnl for AMPI
-		AC_DEFINE([_HAVE_AMPI_], [1], [with AMPI in ISSM src])
-		AC_DEFINE([_HAVE_MEDIPACK_], [1], [with MeDiPack in ISSM src])
-		AC_SUBST([MEDIPACKINCL])
-	fi
-	AM_CONDITIONAL([MEDIPACK], [test "x${HAVE_MEDIPACK}" == "xyes"])
-	dnl }}}
-	dnl HDF5 {{{
-	AC_MSG_CHECKING(for HDF5 libraries)
-	AC_ARG_WITH(
-		[hdf5-dir],
-		AS_HELP_STRING([--with-hdf5-dir=DIR], [HDF5 root directory]),
-		[HDF5_ROOT=${withval}],
-		[HDF5_ROOT="no"]
-	)
-	if test "x${HDF5_ROOT}" == "xno"; then
-		HAVE_HDF5=no
-	else
-		HAVE_HDF5=yes
-		if ! test -d "${HDF5_ROOT}"; then
-			AC_MSG_ERROR([HDF5 directory provided (${HDF5_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_HDF5}])
-
-	dnl HDF5 libraries and header files
-	dnl
-	dnl TODO: Add check for if we need to link to libhdf5_fortran and
-	dnl libhdf5hl_fortran, if and when necessary.
-	dnl
-	if test "x${HAVE_HDF5}" == "xyes"; then
-		case "${host_os}" in
-			*darwin*)
-				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
-			;;
-			*linux*)
-				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
-			;;
-			*mingw*)
-				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
-			;;
-		esac
-		AC_DEFINE([_HAVE_HDF5_], [1], [with HDF5 in ISSM src])
-		AC_SUBST([HDF5LIB])
-	fi
-	dnl }}}
-	dnl PETSc{{{
-	AC_MSG_CHECKING([for PETSc])
-	AC_ARG_WITH(
-		[petsc-dir],
-		AS_HELP_STRING([--with-petsc-dir=DIR], [PETSc root directory, necessary for parallel build]),
-		[PETSC_ROOT=${withval}],
-		[PETSC_ROOT="no"]
-	)
-	if test "x${PETSC_ROOT}" == "xno"; then
-		HAVE_PETSC=no
-	else
-		HAVE_PETSC=yes
-		if ! test -d "${PETSC_ROOT}"; then
-			AC_MSG_ERROR([PETSc directory provided (${PETSC_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_PETSC}])
-	AM_CONDITIONAL([PETSC], [test "x${HAVE_PETSC}" == "xyes"])
-
-	dnl PETSc libraries and header files
-	if test "x${HAVE_PETSC}" == "xyes"; then
-		if ! test -f "${PETSC_ROOT}/include/petscversion.h"; then
-			AC_MSG_ERROR([PETSc not instaled correctly: file (${PETSC_ROOT}/include/petscversion.h) does not exist!]);
-		fi
-
-		AC_MSG_CHECKING(for PETSc version)
-		PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'`
-		PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'`
-		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], ${PETSC_MAJOR}, [PETSc version major])
-		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], ${PETSC_MINOR}, [PETSc version minor])
-		AC_MSG_RESULT([${PETSC_MAJOR}.${PETSC_MINOR}])
-
-		AC_MSG_CHECKING(whether PETSc is the development version)
-		PETSC_RELEASE=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_RELEASE" | sed 's/#define PETSC_VERSION_RELEASE//' | sed 's/ //g'`
-		if test "${PETSC_RELEASE}" == "0"; then
-			AC_DEFINE([_HAVE_PETSCDEV_], [1], [with PETSc-dev])
-			AC_MSG_RESULT([yes])
-		else
-			AC_MSG_RESULT([no])
-		fi
-
-		AC_ARG_WITH(
-			[petsc-arch],
-			AS_HELP_STRING([--with-petsc-arch=DIR], [PETSc arch, necessary for PETSc < 3.0]),
-			[PETSC_ARCH=${withval}],
-			[PETSC_ARCH=""]
-		)
-
-		AC_MSG_CHECKING(for PETSc libraries and header files in ${PETSC_ROOT})
-		dnl To get PETSc's libraries,
-		dnl
-		dnl		cd $ISSM_DIR/externalpackages/petsc/src
-		dnl		make getlinklibs
-		dnl
-		PETSCINCL=" -I${PETSC_ROOT}/include"
-		dnl Add other location (not needed anymore since at least PETSc 3.0)
-		if test -n "${PETSC_ARCH}" && test -d "${PETSC_ROOT}/${PETSC_ARCH}/include"; then
-			PETSCINCL+=" ${PETSC_ROOT}/${PETSC_ARCH}/include"
-		fi
-		if test -n "${PETSC_ARCH}" && test -d "${PETSC_ROOT}/include/${PETSC_ARCH}"; then
-			PETSCINCL+=" ${PETSC_ROOT}/include/${PETSC_ARCH}"
-		fi
-
-		case "${host_os}" in
-			*darwin*)
-				if test ${PETSC_MAJOR} -lt 3; then
-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
-				else
-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
-					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
-						PETSCLIB+=" -lmetis"
-					fi
-				fi
-			;;
-			*linux*)
-				if test ${PETSC_MAJOR} -lt 3; then
-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lmpiuni -lpetsc"
-				else
-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc -ldl"
-					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
-						PETSCLIB+=" -lparmetis -lmetis"
-					fi
-				fi
-				if test "x$host_os_version" = "x3.0.101-0.31.1_1.0502.8394-cray_gem_s"; then
-					PETSCLIB="-L${PETSC_ROOT}/lib -lcraypetsc_gnu_real -lmetis"
-				fi
-				if test x$HOST = "xmaui01"; then
-					PETSCLIB="-L${PETSC_ROOT}/lib -lcraypetsc_intel_real -lmetis"
-				fi
-			;;
-			*mingw*)
-				PETSCLIB="-Wl,-L${PETSC_ROOT}/lib -Wl,-lpetsc"
-			;;
-		esac
-		AC_MSG_RESULT([done])
-		AC_DEFINE([_HAVE_PETSC_], [1], [with PETSc in ISSM src])
-		AC_SUBST([PETSCINCL])
-		AC_SUBST([PETSCLIB])
-	fi
-	dnl }}}
-	dnl MPI{{{
-	AC_MSG_CHECKING(for MPI)
-	AC_ARG_WITH(
-		[mpi-include],
-		AS_HELP_STRING([--with-mpi-include=DIR], [MPI include directory, necessary for parallel build]),
-		[MPI_INCLUDE=${withval}],
-		[MPI_INCLUDE=""]
-	)
-	AC_ARG_WITH(
-		[mpi-libdir],
-		AS_HELP_STRING([--with-mpi-libdir=DIR], [MPI library directory, necessary for parallel build]),
-		[MPI_LIBDIR=${withval}],
-		[MPI_LIBDIR=""]
-	)
-	AC_ARG_WITH(
-		[mpi-libflags],
-		AS_HELP_STRING([--with-mpi-libflags=LIBS], [MPI libraries to be used, necessary for parallel build]),
-		[MPI_LIBFLAGS=${withval}],
-		[MPI_LIBFLAGS=""]
-	)
-	if test -z "${MPI_INCLUDE}"; then
-		HAVE_MPI=no
-	else
-		HAVE_MPI=yes
-
-		dnl Processing for Windows
-		dnl
-		dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
-		dnl		  check again in the following conditionals
-		dnl
-		if test "${VENDOR}" == "intel-win7-32"; then
-			MPI_LIBDIR=`cygpath -m ${MPI_LIBDIR}`
-			MPI_INCLUDE=`cygpath -m ${MPI_INCLUDE}`
-		elif test "${VENDOR}" == "intel-win7-64"; then
-			MPI_LIBDIR="/I`cygpath -m ${MPI_LIBDIR}`"
-			MPI_INCLUDE=`cygpath -m ${MPI_INCLUDE}`
-		elif test "${VENDOR}" == "MSVC-Win64" || test "${VENDOR}" == "MSVC-Win64-par"; then
-			MPI_LIBDIR=`cygpath -m ${MPI_LIBDIR}`
-			MPI_INCLUDE=`cygpath -m ${MPI_INCLUDE}`
-		fi
-
-		if test -z "${MPI_LIBDIR}"; then
-			MPILIB="${MPI_LIBFLAGS}"
-		else
-			MPILIB="${MPI_LIBDIR} ${MPI_LIBFLAGS}"
-		fi
-
-		if test "x${IS_WINDOWS}" == "xyes"; then
-			MPIINCL=/I"${MPI_INCLUDE}"
-		else
-			MPIINCL="-I${MPI_INCLUDE}"
-		fi
-
-		AC_DEFINE([_HAVE_MPI_], [1], [with MPI in ISSM src])
-		AC_DEFINE([HAVE_MPI], [1], [MPI flag for Dakota (DO NOT REMOVE)])
-		AC_SUBST([MPIINCL])
-		AC_SUBST([MPILIB])
-	fi
-	AM_CONDITIONAL([MPI], [test "x${HAVE_MPI}" == "xyes"])
-	AC_MSG_RESULT([${HAVE_MPI}])
-	dnl }}}
-	dnl SCOTCH{{{
-	AC_MSG_CHECKING([for SCOTCH])
-	AC_ARG_WITH(
-		[scotch-dir],
-		AS_HELP_STRING([--with-scotch-dir=DIR], [SCOTCH root directory]),
-		[SCOTCH_ROOT=$withval],
-		[SCOTCH_ROOT="no"]
-	)
-	if test "x${SCOTCH_ROOT}" == "xno"; then
-		HAVE_SCOTCH=no
-	else
-		HAVE_SCOTCH=yes
-		if ! test -d "${SCOTCH_ROOT}"; then
-			AC_MSG_ERROR([SCOTCH directory provided (${SCOTCH_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_SCOTCH}])
-	AM_CONDITIONAL([SCOTCH], [test "x${HAVE_SCOTCH}" == "xyes"])
-
-	dnl SCOTCH libraries and header files
-	if test "x${HAVE_SCOTCH}" == "xyes"; then
-		if test "x${SCOTCH_ROOT}" == "x${PETSC_ROOT}"; then
-			AC_DEFINE([_PETSC_SCOTCH_], [1], [is SCOTCH installed via PETSc])
-			SCOTCHINCL="-DNOFILEIO -I${SCOTCH_ROOT}/include -DSCOTCH_VERSION=\\\"UNKNOWN\\\""
-			SCOTCHLIB="-L${SCOTCH_ROOT}/lib -lnfioscotch -lnfioscotcherr -lnfioscotcherrexit "
-		else
-			SCOTCHINCL="-I${SCOTCH_ROOT}/include"
-			SCOTCHLIB="-L${SCOTCH_ROOT}/lib "
-			if test "x${HAVE_MPI}" == "xyes"; then
-				SCOTCHLIB+="-lptesmumps -lptscotch -lptscotcherr -lptscotcherrexit -lscotch"
-			else
-				SCOTCHLIB+="-lscotch -lscotcherr -lscotcherrexit"
-			fi
-		fi
-		AC_DEFINE([_HAVE_SCOTCH_], [1], [with SCOTCH in ISSM src])
-		AC_SUBST([SCOTCHINCL])
-		AC_SUBST([SCOTCHLIB])
-	fi
-	dnl }}}
-	dnl METIS{{{
-	AC_MSG_CHECKING([for METIS])
-	AC_ARG_WITH(
-		[metis-dir],
-		AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
-		[METIS_ROOT=${withval}],
-		[METIS_ROOT="no"]
-	)
-	HAVE_METIS=no
-	if test "x${METIS_ROOT}" == "xno"; then
-		dnl Check if METIS was installed via PETSc
-		if test -f ${PETSC_ROOT}/install/include/metis.h; then
-			HAVE_METIS=yes
-			METIS_ROOT="${PETSC_ROOT}"
-		fi
-	else
-		if ! test -d "${METIS_ROOT}"; then
-			AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
-		fi
+
+	else
+		HAVE_TRIANGLE=no
+	fi
+	AC_MSG_RESULT($HAVE_TRIANGLE)
+
+	AC_MSG_CHECKING(for triangle and parallel status)
+	if test $HAVE_TRIANGLE = no; then
+		if test "$SERIAL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([--with-triangle-dir  missing. Triangle is needed to run ISSM serially!])
+		fi
+	fi
+	AC_MSG_RESULT(ok)
+	
+		
+	dnl Metis directory
+	AC_ARG_WITH([metis-dir],
+			  AS_HELP_STRING([--with-metis-dir = DIR],
+							 [metis root directory. necessary for serial build]),
+			  [METIS_ROOT=$withval],[METIS_ROOT=""])
+
+	if test -d "$METIS_ROOT"; then
+
+		AC_MSG_CHECKING(for Metis headers and libraries in $METIS_ROOT)
+
+		dnl defaults
 		HAVE_METIS=yes
-	fi
-	if test "${HAVE_METIS}" = "yes"; then
-		METIS_VERSION=$(grep "#define METIS_VER_MAJOR" ${METIS_ROOT}/include/metis.h | sed 's|.*METIS_VER_MAJOR[[:space:]]*||')
-		dnl METIS libraries and header files
-		if test "x${METIS_VERSION}" == "x4"; then
-			METISINCL="-I${METIS_ROOT}/Lib"
-			case "${host_os}" in
-				*darwin*)
-					METISLIB="-L${METIS_ROOT} -lmetis"
-				;;
-				*linux*)
-					METISLIB="-L${METIS_ROOT} -lmetis"
-				;;
-				*mingw*)
-					METISLIB="-Wl,-L${METIS_ROOT}/lib -Wl,-lmetis"
-				;;
-			esac
-		elif test "x${METIS_VERSION}" == "x5"; then
-			METISINCL="-I${METIS_ROOT}/include"
-			case "${host_os}" in
-				*darwin*)
-					METISLIB="-L${METIS_ROOT}/lib -lmetis"
-				;;
-				*linux*)
-					METISLIB="-L${METIS_ROOT}/lib -lmetis"
-				;;
-				*mingw*)
-					METISLIB="-Wl,-L${METIS_ROOT}/lib -Wl,-lmetis"
-				;;
-			esac
-		else
-			AC_MSG_ERROR([METIS version ${METIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
-		fi
-		AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
-		AC_DEFINE_UNQUOTED([_METIS_VERSION_], ${METIS_VERSION}, [METIS version number])
+		METISINCL=-I"$METIS_ROOT/Lib"
+		METISLIB=-L"$METIS_ROOT/ -lmetis"
+
+		AC_DEFINE([_HAVE_METIS_],[1],[with Metis in ISSM src])
 		AC_SUBST([METISINCL])
 		AC_SUBST([METISLIB])
-	fi
-	AC_MSG_RESULT([${HAVE_METIS}])
-	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" = "xyes"])
-	dnl }}}
-	dnl ParMETIS{{{
-	AC_MSG_CHECKING([for ParMETIS])
-	AC_ARG_WITH(
-		[parmetis-dir],
-		AS_HELP_STRING([--with-parmetis-dir=DIR], [ParMETIS root directory, necessary for parallel build]),
-		[PARMETIS_ROOT=${withval}],
-		[PARMETIS_ROOT="no"]
-	)
-	HAVE_PARMETIS=no
-	if test "x${PARMETIS_ROOT}" == "xno"; then
-		dnl Check if ParMETIS was installed via PETSc
-		if test -f ${PETSC_ROOT}/install/include/parmetis.h; then
-			HAVE_PARMETIS="yes"
-			PARMETIS_ROOT="${PETSC_ROOT}"
-		fi
-	else
-		if ! test -d "${PARMETIS_ROOT}"; then
-			AC_MSG_ERROR([ParMETIS directory provided (${PARMETIS_ROOT}) does not exist!]);
-		fi
-		if ! test -d "${METIS_ROOT}"; then
-			AC_MSG_ERROR([If supplying path to ParMETIS with option --with-parmetis-dir, must also supply path to METIS with option --with-metis-dir]);
-		fi
-		HAVE_PARMETIS="yes"
-	fi
-	if test "${HAVE_PARMETIS}" == "yes"; then
-		#PARMETIS_VERSION=$(grep "#define PARMETIS_MAJOR_VERSION" ${PARMETIS_ROOT}/include/parmetis.h | sed 's|.*PARMETIS_MAJOR_VERSION[[:space:]]*||')
-		dnl METIS libraries and header files
-		#if test "x${PARMETIS_VERSION}" == "x4"; then
-			PARMETISINCL="-I${PARMETIS_ROOT}/include"
-			case "${host_os}" in
-				*darwin*)
-					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
-				;;
-				*linux*)
-					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
-				;;
-				*mingw*)
-					PARMETISLIB="-Wl,-L${PARMETIS_ROOT}/lib -Wl,-lparmetis"
-				;;
-			esac
-		#else
-		#	AC_MSG_ERROR([ParMETIS version ${PARMETIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
-		#fi
-		AC_DEFINE([_HAVE_PARMETIS_], [1], [with ParMETIS in ISSM src])
-		#AC_DEFINE([_PARMETIS_VERSION_], [${PARMETIS_VERSION}], [ParMETIS version number])
-		AC_SUBST([PARMETISINCL])
-		AC_SUBST([PARMETISLIB])
-	fi
-	AC_MSG_RESULT([${HAVE_PARMETIS}])
-	AM_CONDITIONAL([PARMETIS], [test "x${HAVE_PARMETIS}" = "xyes"])
-	dnl }}}
-	dnl Toolkit for Advanced Optimization (TAO){{{
-	AC_MSG_CHECKING([for TAO])
-	AC_ARG_WITH(
-		[tao-dir],
-		AS_HELP_STRING([--with-tao-dir=DIR], [TAO root directory]),
-		[TAO_ROOT=${withval}],
-		[TAO_ROOT="no"]
-	)
-	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 5; then
-		dnl In PETSc >= 3.5, TAO is provided
-		HAVE_TAO="yes"
-		AC_DEFINE([_HAVE_TAO_], [1], [with TAO in ISSM src])
-		AC_MSG_RESULT([${HAVE_TAO}])
-	else
-		if test "x${TAO_ROOT}" == "xno"; then
-			HAVE_TAO=no
+	else
+		HAVE_METIS=no
+	fi
+
+	if test $HAVE_METIS = no; then
+	AC_MSG_ERROR([--with-metis-dir  missing. Metis is needed to run ISSM]);
+	else
+	AC_MSG_RESULT($HAVE_METIS)
+	fi
+
+	dnl Mpi options!
+	AC_MSG_CHECKING(for mpi...)
+	AC_ARG_WITH([mpi-lib],
+			  AS_HELP_STRING([--with-mpi-lib = otions],
+							 [mpi options, for ex: "-L$MPIROOT -lmpich]),
+			  [MPILIB=$withval],[MPILIB=""])
+	
+	AC_ARG_WITH([mpi-include],
+			  AS_HELP_STRING([--with-mpi-include = DIR],
+							 [mpi include directory, necessary for parallel build]),
+			  [MPI_INCLUDE=$withval],[MPI_INCLUDE=""])
+
+	dnl check that --with-mpi-include and --with-mpi-lib have been provided
+	if test -z "$MPILIB" ; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!])
+		fi
+	else
+		if test -z "$MPI_INCLUDE" ; then
+			if test "$PARALLEL_VALUE" = "yes" ; then
+				AC_MSG_ERROR([empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!])
+			fi
 		else
-			HAVE_TAO=yes
-			if ! test -d "${TAO_ROOT}"; then
-				AC_MSG_ERROR([TAO directory provided (${TAO_ROOT}) does not exist!]);
-			fi
-		fi
-		AC_MSG_RESULT([${HAVE_TAO}])
-
-		dnl TAO libraries and header files
-		if test "x${HAVE_TAO}" == "xyes"; then
-			TAOINCL="-I${TAO_ROOT} -I${TAO_ROOT}/include -I${TAO_ROOT}/bmake"
-			TAOLIB="-L${TAO_ROOT}/lib -ltao -lpetsc"
-			AC_DEFINE([_HAVE_TAO_], [1], [with Tao in ISSM src])
-			AC_SUBST([TAOINCL])
-			AC_SUBST([TAOLIB])
-		fi
-	fi
-	dnl }}}
-	dnl M1QN3{{{
-	AC_MSG_CHECKING([for M1QN3])
-	AC_ARG_WITH(
-		[m1qn3-dir],
-		AS_HELP_STRING([--with-m1qn3-dir=DIR], [M1QN3 root directory]),
-		[M1QN3_ROOT=${withval}],
-		[M1QN3_ROOT="no"]
-	)
-	if test "x${M1QN3_ROOT}" == "xno"; then
-		HAVE_M1QN3=no
-	else
-		HAVE_M1QN3=yes
-		if ! test -d "${M1QN3_ROOT}"; then
-			AC_MSG_ERROR([M1QN3 directory provided (${M1QN3_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_M1QN3}])
-
-	dnl M1QN3 libraries and header files
-	if test "x${HAVE_M1QN3}" == "xyes"; then
-		if test "${IS_MSYS2}" == "yes"; then
-			M1QN3LIB="-Wl,-L${M1QN3_ROOT} -Wl,-lm1qn3 -Wl,-lddot"
+			HAVE_MPI=yes
+			MPIINCL=-I"$MPI_INCLUDE/"
+			
+			AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
+			AC_SUBST([MPIINCL])
+			AC_SUBST([MPILIB])
+		fi
+	fi
+	AC_MSG_RESULT(done)
+
+	dnl Petsc directory and architecture
+	AC_ARG_WITH([petsc-dir],
+			  AS_HELP_STRING([--with-petsc-dir = DIR],
+							 [petsc root directory, necessary for parallel build]),
+			  [PETSC_ROOT=$withval],[PETSC_ROOT=""])
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ROOT" = "" ; then
+			AC_MSG_ERROR([missing --with-petsc-dir argument for parallel compilation!])
+		fi
+	fi
+	
+	AC_ARG_WITH([petsc-arch],
+			  AS_HELP_STRING([--with-petsc-arch = DIR],
+							 [petsc arch , necessary for parallel build]),
+			  [PETSC_ARCH=$withval],[PETSC_ARCH=""])
+
+	if test "$PARALLEL_VALUE" = "yes" ; then
+		if test "$PETSC_ARCH" = "" ; then
+			AC_MSG_ERROR([missing --with-petsc-arch argument for parallel compilation!])
+		fi
+	fi
+	
+	AC_MSG_CHECKING(for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH)
+	
+	if test -d "$PETSC_ROOT"; then
+
+		if test -d "$PETSC_ROOT/bmake/$PETSC_ARCH"; then
+		
+			PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
+			PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+			                          
+
+
+			AC_DEFINE([_HAVE_PETSC_],[1],[with Petsc in ISSM src])
+			AC_SUBST([PETSCINCL])
+			AC_SUBST([PETSCLIB])
+
+			HAVE_PETSC=yes
 		else
-			M1QN3LIB="${M1QN3_ROOT}/libm1qn3.a ${M1QN3_ROOT}/libddot.a"
-		fi
-		AC_DEFINE([_HAVE_M1QN3_], [1], [with M1QN3 in ISSM src])
-		AC_SUBST([M1QN3LIB])
-	fi
-	dnl }}}
-	dnl PROJ{{{
-	AC_MSG_CHECKING([for PROJ])
-	AC_ARG_WITH(
-		[proj-dir],
-		AS_HELP_STRING([--with-proj-dir=DIR], [PROJ root directory]),
-		[PROJ_ROOT=${withval}],
-		[PROJ_ROOT="no"]
-	)
-	if test "x${PROJ_ROOT}" == "xno"; then
-		HAVE_PROJ=no
-	else
-		HAVE_PROJ=yes
-		if ! test -d "${PROJ_ROOT}"; then
-			AC_MSG_ERROR([PROJ directory provided (${PROJ_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_PROJ}])
-
-	dnl PROJ libraries and header files
-	if test "x${HAVE_PROJ}" == "xyes"; then
-		PROJINCL="-I${PROJ_ROOT}/include"
-		PROJLIB="-L${PROJ_ROOT}/lib -lproj"
-		AC_DEFINE([_HAVE_PROJ_], [1], [with PROJ in ISSM src])
-		AC_SUBST([PROJINCL])
-		AC_SUBST([PROJLIB])
-	fi
-	AM_CONDITIONAL([PROJ], [test "x${HAVE_PROJ}" == "xyes"])
-	dnl }}}
-	dnl SLEPc{{{
-	AC_MSG_CHECKING([for SLEPc])
-	AC_ARG_WITH(
-		[slepc-dir],
-		AS_HELP_STRING([--with-slepc-dir=DIR], [SLEPc root directory]),
-		[SLEPC_ROOT=${withval}],
-		[SLEPC_ROOT="no"]
-	)
-	if test "x${SLEPC_ROOT}" == "xno"; then
-		HAVE_SLEPC=no
-	else
+			HAVE_PETSC=no
+		fi
+	else
+		HAVE_PETSC=no
+	fi
+
+	if test $HAVE_PETSC = no; then
+		if test "$PARALLEL_VALUE" = "yes" ; then
+			AC_MSG_ERROR([could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!])
+		fi
+	else
+		AC_MSG_RESULT($HAVE_PETSC)
+	fi
+
+
+	dnl Slepc directory
+	AC_ARG_WITH([slepc-dir],
+			  AS_HELP_STRING([--with-slepc-dir = DIR],
+							 [slepc root directory]),
+			  [SLEPC_ROOT=$withval],[SLEPC_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Slepc headers and libraries in $SLEPC_ROOT)
+	if test -d "$SLEPC_ROOT"; then
+
+
+		dnl defaults
 		HAVE_SLEPC=yes
-		if ! test -d "${SLEPC_ROOT}"; then
-			AC_MSG_ERROR([SLEPc directory provided (${SLEPC_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_SLEPC}])
-
-	dnl SLEPc libraries and header files
-	if test "x${HAVE_SLEPC}" == "xyes"; then
-		SLEPCINCL="-I${SLEPC_ROOT}/include"
-		SLEPCLIB="-L${SLEPC_ROOT}/lib -lslepc"
-		AC_DEFINE([_HAVE_SLEPC_], [1], [with SLEPc in ISSM src])
+		SLEPCINCL=-I"$SLEPC_ROOT/include"
+		SLEPCLIB=-L"$SLEPC_ROOT/lib/ -lslepc"
+
+		AC_DEFINE([_HAVE_SLEPC_],[1],[with Slepc in ISSM src])
 		AC_SUBST([SLEPCINCL])
 		AC_SUBST([SLEPCLIB])
-	fi
-	dnl }}}
-	dnl shapelib{{{
-	AC_MSG_CHECKING([for shapelib])
-	AC_ARG_WITH(
-		[shapelib-dir],
-		AS_HELP_STRING([--with-shapelib-dir=DIR], [shapelib root directory]),
-		[SHAPELIB_ROOT=${withval}],
-		[SHAPELIB_ROOT="no"]
-	)
-	if test "x${SHAPELIB_ROOT}" == "xno"; then
-		HAVE_SHAPELIB=no
-	else
-		HAVE_SHAPELIB=yes
-		if ! test -d "${SHAPELIB_ROOT}"; then
-			AC_MSG_ERROR([shapelib directory provided (${SHAPELIB_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_SHAPELIB}])
-
-	dnl shapelib libraries and header files
-	if test "x${HAVE_SHAPELIB}" == "xyes"; then
-		SHAPELIBINCL="-I${SHAPELIB_ROOT}/include"
-		if test -f "${SHAPELIB_ROOT}/lib/libshp.a"; then
-			SHAPELIBLIB="-L${SHAPELIB_ROOT}/lib -lshp"
-		else
-			SHAPELIBLIB="-L${SHAPELIB_ROOT}/lib -lshape"
-		fi
-		AC_DEFINE([_HAVE_SHAPELIB_], [1], [with shapelib in ISSM src])
-		AC_SUBST([SHAPELIBINCL])
-		AC_SUBST([SHAPELIBLIB])
-	fi
-	AM_CONDITIONAL([SHP], [test "x${HAVE_SHAPELIB}" == "xyes"])
-	dnl }}}
-	dnl ScaLAPACK{{{
-	dnl NOTE: User should supply path to root directory or libraries, but not both
-	dnl
-	AC_MSG_CHECKING([for ScaLAPACK])
-	AC_ARG_WITH(
-		[scalapack-dir],
-		AS_HELP_STRING([--with-scalapack-dir=DIR], [ScaLAPACK root directory]),
-		[SCALAPACK_ROOT=${withval}],
-		[SCALAPACK_ROOT="no"]
-	)
-	AC_ARG_WITH(
-		[scalapack-lib],
-		AS_HELP_STRING([--with-scalapack-lib=LIBS], [ScaLAPACK libraries to link to]),
-		[SCALAPACKLIB=${withval}],
-		[SCALAPACKLIB="no"]
-	)
-	if test "x${SCALAPACK_ROOT}" == "xno" && test "x${SCALAPACKLIB}" == "xno"; then
+	else
+		HAVE_SLEPC=no
+	fi
+	AC_MSG_RESULT($HAVE_SLEPC)
+	
+	dnl Scalapack directory
+	AC_ARG_WITH([scalapack-dir],
+			  AS_HELP_STRING([--with-scalapack-dir = DIR],
+							 [scalapack root directory]),
+			  [SCALAPACK_ROOT=$withval],[SCALAPACK_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Scalapack headers and libraries in $SCALAPACK_ROOT)
+	if test -d "$SCALAPACK_ROOT"; then
+
+
+		dnl defaults
+		HAVE_SCALAPACK=yes
+		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+
+		AC_DEFINE([_HAVE_SCALAPACK_],[1],[with Scalapack in ISSM src])
+		AC_SUBST([SCALAPACKLIB])
+	else
 		HAVE_SCALAPACK=no
-		SCALAPACKLIB=""
-	elif test "x${SCALAPACK_ROOT}" != "xno"; then
-		if ! test -d "${SCALAPACK_ROOT}"; then
-			AC_MSG_ERROR([ScaLAPACK directory provided (${SCALAPACK_ROOT}) does not exist!]);
-		fi
-		HAVE_SCALAPACK=yes
-		if test "${VENDOR}" == "win-msys2"; then
-			SCALAPACKLIB="-Wl,-L${SCALAPACK_ROOT}/lib -Wl,-lscalapack"
-		else
-			SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
-		fi
-	elif test "x${SCALAPACKLIB}" != "xno"; then
-		dnl Value of SCALAPACKLIB should be valid here, so no need to set it (as above)
-		HAVE_SCALAPACK=yes
-	else
-		AC_MSG_ERROR([use --with-scalapack-dir or --with-scalapack-lib, but not both])
-	fi
-	AC_MSG_RESULT([${HAVE_SCALAPACK}])
-
-	dnl ScaLAPACK libraries and header files
-	if test "x${HAVE_SCALAPACK}" == "xyes"; then
-		AC_DEFINE([_HAVE_SCALAPACK_], [1], [with ScaLAPACK in ISSM src])
-		AC_SUBST([SCALAPACKLIB])
-	fi
-	dnl }}}
-	dnl BLAS/LAPACK{{{
-	AC_MSG_CHECKING([for BLAS/LAPACK])
-	AC_ARG_WITH(
-		[blas-dir],
-		[AS_HELP_STRING([--with-blas-dir=DIR], [BLAS root directory])],
-		[BLAS_ROOT=$withval],
-		[BLAS_ROOT="no"]
-	)
-	AC_ARG_WITH(
-		[lapack-dir],
-		[AS_HELP_STRING([--with-lapack-dir=DIR], [LAPACK root directory])],
-		[LAPACK_ROOT=$withval],
-		[LAPACK_ROOT="no"]
-	)
-	AC_ARG_WITH(
-		[blas-lapack-dir],
-		AS_HELP_STRING([--with-blas-lapack-dir=DIR], [BLAS/LAPACK root directory]),
-		[BLASLAPACK_ROOT=$withval],
-		[BLASLAPACK_ROOT="no"]
-	)
-	if (test "x${BLAS_ROOT}" = "xno" || test "x${LAPACK_ROOT}" = "xno") && test "x${BLASLAPACK_ROOT}" = "xno"; then
+	fi
+	AC_MSG_RESULT($HAVE_SCALAPACK)
+
+	dnl Blas-lapack directory
+	AC_ARG_WITH([blas-lapack-dir],
+			  AS_HELP_STRING([--with-blas-lapack-dir = DIR],
+							 [blas-lapack root directory]),
+			  [BLASLAPACK_ROOT=$withval],[BLASLAPACK_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT)
+	if test -d "$BLASLAPACK_ROOT"; then
+
+
+		dnl defaults
+		HAVE_BLASLAPACK=yes
+		BLASLAPACKINCL=""
+		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
+
+		AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with Scalapack in ISSM src])
+		AC_SUBST([BLASLAPACKLIB])
+		AC_SUBST([BLASLAPACKINCL])
+	else
 		HAVE_BLASLAPACK=no
-	else
-		HAVE_BLASLAPACK=yes
-		if ! test -d "${BLAS_ROOT}" || ! test -d "${LAPACK_ROOT}"; then
-			if ! test -d "${BLASLAPACK_ROOT}"; then
-				AC_MSG_ERROR([Use either --with-blas-dir and --with-lapack-dir *or* --with-blaslapack-dir]);
-			fi
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_BLASLAPACK}])
-
-	dnl BLAS/LAPACK libraries and header files
-	if test "x${HAVE_BLASLAPACK}" == "xyes"; then
-		case "${host_os}" in
-			*darwin*)
-				BLASLAPACKLIB="-L${BLASLAPACK_ROOT}/lib"
-				if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
-					BLASLAPACKLIB+=" -lopenblas"
-				elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
-					BLASLAPACKLIB+=" -lf2clapack -lf2cblas"
-				elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
-					BLASLAPACKLIB+=" -lflapack -lfblas"
-				else
-					BLASLAPACKLIB+=" -llapack -lblas"
-				fi
-			;;
-			*linux*)
-				BLASLAPACKLIB="-L${BLASLAPACK_ROOT}/lib"
-				if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
-					BLASLAPACKLIB+=" -lopenblas"
-				elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
-					BLASLAPACKLIB+=" -lf2clapack -lf2cblas"
-				elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
-					BLASLAPACKLIB+=" -lflapack -lfblas"
-				else
-					BLASLAPACKLIB+=" -llapack -lblas"
-				fi
-			;;
-			*mingw*)
-				if test -d "${BLASLAPACK_ROOT}"; then
-					BLASLAPACKLIB="-Wl,-L${BLASLAPACK_ROOT}/lib"
-					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
-						BLASLAPACKLIB+=" -lopenblas"
-					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
-						BLASLAPACKLIB+=" -lf2clapack -lf2cblas"
-					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
-						BLASLAPACKLIB="-Wl,-L${BLASLAPACK_ROOT}/lib -Wl,-lflapack -Wl,-lfblas"
-					else
-						BLASLAPACKLIB+=" -Wl,-llapack -Wl,-lblas"
-					fi
-				else
-					BLASLAPACKLIB="${LAPACK_ROOT}/lib/liblapack.a ${BLAS_ROOT}/lib/libblas.a"
-				fi
-			;;
-		esac
-		AC_DEFINE([_HAVE_BLASLAPACK_], [1], [with BLAS/LAPACK in ISSM src])
-		AC_SUBST([BLASLAPACKLIB])
-	fi
-	dnl }}}
-	dnl Math Kernel Library (MKL){{{
-	AC_MSG_CHECKING([for MKL])
-	AC_ARG_WITH(
-		[mkl-libflags],
-		AS_HELP_STRING([--with-mkl-libflags=LIBS], [MKL libraries to be used]),
-		[MKL_LIBFLAGS=${withval}],
-		[MKL_LIBFLAGS="no"]
-	)
-	if test "x${MKL_LIBFLAGS}" == "xno"; then
-		HAVE_MKL=no
-	else
-		HAVE_MKL=yes
-		MKLLIB="${MKL_LIBFLAGS}"
-		AC_DEFINE([_HAVE_MKL_], [1], [with MKL in ISSM src])
-		AC_SUBST([MKLLIB])
-		AC_SUBST([MKLINCL])
-	fi
-	AC_MSG_RESULT([${HAVE_MKL}])
-	dnl }}}
-	dnl PlaLAPACK{{{
-	dnl TODO: 	Handle user supplying path to root directory *or* individual
-	dnl 		arguments (like ScaLAPACK)
-	dnl
-	AC_MSG_CHECKING(for PlaLAPACK)
-	AC_ARG_WITH(
-		[plapack-lib],
-		AS_HELP_STRING([--with-plapack-lib=<LIB>], [PlaLAPACK library]),
-		[PLAPACK_LIB=${withval}],
-		[PLAPACK_LIB=""]
-	)
-	AC_ARG_WITH(
-		[plapack-include],
-		AS_HELP_STRING([--with-plapack-include=<INC>], [PlaLAPACK include]),
-		[PLAPACK_INCLUDE=${withval}],
-		[PLAPACK_INCLUDE=""]
-	)
-
-	if test -n "${PLAPACK_LIB}"; then
-		if test -n "${PLAPACK_INCLUDE}"; then
-			HAVE_PLAPACK=yes
-			PLAPACKINCL="${PLAPACK_INCLUDE}"
-			PLAPACKLIB="${PLAPACK_LIB}"
-			AC_DEFINE([_HAVE_PLAPACK_], [1], [with PlaLAPACK in ISSM src])
-			AC_SUBST([PLAPACKINCL])
-			AC_SUBST([PLAPACKLIB])
-		else
-			HAVE_PLAPACK=no
-		fi
+	fi
+	AC_MSG_RESULT($HAVE_BLASLAPACK)
+
+
+	dnl Plapack directory
+	AC_ARG_WITH([plapack-dir],
+			  AS_HELP_STRING([--with-plapack-dir = DIR],
+							 [plapack root directory]),
+			  [PLAPACK_ROOT=$withval],[PLAPACK_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Plapack headers and libraries in $PLAPACK_ROOT)
+	if test -d "$PLAPACK_ROOT"; then
+
+
+		dnl defaults
+		HAVE_PLAPACK=yes
+		PLAPACKINCL=-I"$PLAPACK_ROOT/INCLUDE"
+		PLAPACKLIB=-L"$PLAPACK_ROOT/ -lPLAPACK"
+
+		AC_DEFINE([_HAVE_PLAPACK_],[1],[with Plapack in ISSM src])
+		AC_SUBST([PLAPACKINCL])
+		AC_SUBST([PLAPACKLIB])
 	else
 		HAVE_PLAPACK=no
 	fi
-	AC_MSG_RESULT([${HAVE_PLAPACK}])
-	dnl }}}
-	dnl MPLAPACK{{{
-	AC_MSG_CHECKING([for MPLAPACK])
-	AC_ARG_WITH(
-		[mplapack-dir],
-		AS_HELP_STRING([--with-mplapack-dir=DIR], [MPLAPACK root directory]),
-		[MPLAPACK_ROOT=${withval}],
-		[MPLAPACK_ROOT="no"]
-	)
-	if test "x${MPLAPACK_ROOT}" == "xno"; then
-		HAVE_MPLAPACK=no
-	else
-		HAVE_MPLAPACK=yes
-		if ! test -d "${MPLAPACK_ROOT}"; then
-			AC_MSG_ERROR([MPLAPACK directory provided (${MPLAPACK_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_MPLAPACK}])
-
-	dnl MPLAPACK libraries and header files
-	if test "x${HAVE_MPLAPACK}" == "xyes"; then
-		MPLAPACKINCL="-I${MPLAPACK_ROOT}/include/mplapack -I${MPLAPACK_ROOT}/include"
-		MPLAPACKLIB="-L${MPLAPACK_ROOT}/lib -lmpblas__Float128 -lmplapack__Float128 -lgomp -lquadmath"
-		AC_DEFINE([_HAVE_MPLAPACK_], [1], [with MPLAPACK in ISSM src])
-		AC_SUBST([MPLAPACKINCL])
-		AC_SUBST([MPLAPACKLIB])
-	fi
-	AM_CONDITIONAL([MPLAPACK], [test "x${HAVE_MPLAPACK}" == "xyes"])
-	dnl }}}
-	dnl MUMPS{{{
-	AC_MSG_CHECKING([for MUMPS])
-	AC_ARG_WITH(
-		[mumps-dir],
-		AS_HELP_STRING([--with-mumps-dir=DIR], [MUMPS root directory]),
-		[MUMPS_ROOT=${withval}],
-		[MUMPS_ROOT="no"]
-	)
-	if test "x${MUMPS_ROOT}" == "xno"; then
-		HAVE_MUMPS=no
-	else
+	AC_MSG_RESULT($HAVE_PLAPACK)
+
+	dnl Mumps directory
+	AC_ARG_WITH([mumps-dir],
+			  AS_HELP_STRING([--with-mumps-dir = DIR],
+							 [mumps root directory]),
+			  [MUMPS_ROOT=$withval],[MUMPS_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Mumps headers and libraries in $MUMPS_ROOT)
+	if test -d "$MUMPS_ROOT"; then
+
+		dnl defaults
 		HAVE_MUMPS=yes
-		if ! test -d "${MUMPS_ROOT}"; then
-			AC_MSG_ERROR([MUMPS directory provided (${MUMPS_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_MUMPS}])
-
-	dnl MUMPS libraries and header files
-	if test "x${HAVE_MUMPS}" == "xyes"; then
-		MUMPSINCL="-I${MUMPS_ROOT}/include"
-		if test "x${MUMPS_ROOT}" == "x${PETSC_ROOT}"; then
-			if test "${VENDOR}" == "win-msys2"; then
-				MUMPSLIB="-Wl,-L${MUMPS_ROOT}/lib -Wl,-lcmumps -Wl,-ldmumps -Wl,-lsmumps -Wl,-lzmumps -Wl,-lmumps_common -Wl,-lpord"
-			else
-				MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lcmumps -lmumps_common -lpord -lparmetis -lzmumps -lmetis"
-			fi
-		else
-			MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lmumps_common -lpord -lparmetis"
-		fi
-		AC_DEFINE([_HAVE_MUMPS_], [1], [with MUMPS in ISSM src])
+		MUMPSINCL=-I"$MUMPS_ROOT/include"
+		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps -lpord"
+
+		AC_DEFINE([_HAVE_MUMPS_],[1],[with Mumps in ISSM src])
 		AC_SUBST([MUMPSINCL])
 		AC_SUBST([MUMPSLIB])
-	fi
-	AM_CONDITIONAL([MUMPS], [test "x${HAVE_MUMPS}" == "xyes"])
-	dnl }}}
-	dnl MUMPS2{{{
-	if test "x${HAVE_MUMPS}" != "xyes"; then
-		AC_MSG_CHECKING(for MUMPS2 (standalone))
-		AC_ARG_WITH(
-			[mumps2-include],
-			AS_HELP_STRING([--with-mumps2-include=DIR], [MUMPS2 include directory, necessary for parallel build]),
-			[MUMPS_INCLUDE=${withval}],
-			[MUMPS_INCLUDE=""]
-		)
-		AC_ARG_WITH(
-			[mumps2-libflags],
-			AS_HELP_STRING([--with-mumps2-libflags=LIBS], [MUMPS2 libraries to be used, necessary for parallel build]),
-			[MUMPS_LIBFLAGS=${withval}],
-			[MUMPS_LIBFLAGS=""]
-		)
-		if test -z "${MUMPS_INCLUDE}"; then
-			HAVE_MUMPS=no
-		else
-			HAVE_MUMPS=yes
-
-			if test -z "${MUMPS_LIBDIR}"; then
-				MUMPSINCL="-I${MUMPS_INCLUDE}"
-				MUMPSLIB="${MUMPS_LIBFLAGS}"
-			else
-				MUMPSINCL="-I${MUMPS_INCLUDE}"
-				MUMPSLIB="-L${MUMPS_LIBDIR} ${MUMPS_LIBFLAGS}"
-			fi
-			AC_DEFINE([_HAVE_MUMPS_], [1], [with MUMPS])
-			AC_SUBST([MUMPSINCL])
-			AC_SUBST([MUMPSLIB])
-		fi
-		AM_CONDITIONAL([MUMPS], [test "x${HAVE_MUMPS}" == "xyes"])
-		AC_MSG_RESULT([${HAVE_MUMPS}])
-	fi
-	dnl }}}
-	dnl BLACS{{{
-	AC_MSG_CHECKING([for BLACS])
-	AC_ARG_WITH(
-		[blacs-dir],
-		AS_HELP_STRING([--with-blacs-dir=DIR], [BLACS root directory]),
-		[BLACS_ROOT=${withval}],
-		[BLACS_ROOT="no"]
-	)
-	if test "x${BLACS_ROOT}" == "xno"; then
-		HAVE_BLACS=no
-	else
+	else
+		HAVE_MUMPS=no
+	fi
+	AC_MSG_RESULT($HAVE_MUMPS)
+
+	dnl Blacs directory
+	AC_ARG_WITH([blacs-dir],
+			  AS_HELP_STRING([--with-blacs-dir = DIR],
+							 [blacs root directory]),
+			  [BLACS_ROOT=$withval],[BLACS_ROOT=""])
+			  
+	AC_MSG_CHECKING(for Blacs headers and libraries in $BLACS_ROOT)
+	if test -d "$BLACS_ROOT"; then
+
+		dnl defaults
 		HAVE_BLACS=yes
-		if ! test -d "${BLACS_ROOT}"; then
-			AC_MSG_ERROR([BLACS directory provided (${BLACS_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_BLACS}])
-
-	dnl BLACS libraries and header files
-	if test "x${HAVE_BLACS}" == "xyes"; then
 		BLACSINCL=""
-		BLACSLIB="-L${BLACS_ROOT} -lblacs"
-		AC_DEFINE([_HAVE_BLACS_], [1], [with BLACS in ISSM src])
+		BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
+        
+		AC_DEFINE([_HAVE_BLACS_],[1],[with Blacs in ISSM src])
 		AC_SUBST([BLACSINCL])
 		AC_SUBST([BLACSLIB])
-	fi
-	dnl }}}
-	dnl HYPRE{{{
-	AC_MSG_CHECKING([for HYPRE])
-	AC_ARG_WITH(
-		[hypre-dir],
-		AS_HELP_STRING([--with-hypre-dir=DIR], [HYPRE root directory]),
-		[HYPRE_ROOT=${withval}],
-		[HYPRE_ROOT="no"]
-	)
-	if test "x${HYPRE_ROOT}" == "xno"; then
-		HAVE_HYPRE=no
-	else
-		HAVE_HYPRE=yes
-		if ! test -d "${HYPRE_ROOT}"; then
-			AC_MSG_ERROR([HYPRE directory provided (${HYPRE_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_HYPRE}])
-
-	dnl HYPRE libraries and header files
-	if test "x${HAVE_HYPRE}" == "xyes"; then
-		HYPREINCL=""
-		HYPRELIB="-L${HYPRE_ROOT}/lib -lHYPRE"
-		AC_DEFINE([_HAVE_HYPRE_], [1], [with HYPRE in ISSM src])
-		AC_SUBST([HYPREINCL])
-		AC_SUBST([HYPRELIB])
-	fi
-	dnl }}}
-	dnl Prometheus{{{
-	AC_MSG_CHECKING([for Prometheus])
-	AC_ARG_WITH(
-		[prometheus-dir],
-		AS_HELP_STRING([--with-prometheus-dir=DIR], [Prometheus root directory]),
-		[PROMETHEUS_ROOT=${withval}],
-		[PROMETHEUS_ROOT="no"]
-	)
-	if test "x${PROMETHEUS_ROOT}" == "xno"; then
-		HAVE_PROMETHEUS=no
-	else
-		HAVE_PROMETHEUS=yes
-		if ! test -d "${PROMETHEUS_ROOT}"; then
-			AC_MSG_ERROR([Prometheus directory provided (${PROMETHEUS_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_PROMETHEUS}])
-
-	dnl Prometheus libraries and header files
-	if test "x${HAVE_PROMETHEUS}" == "xyes"; then
-		PROMETHEUSINCL="-I${PROMETHEUS_ROOT}/include"
-		PROMETHEUSLIB="-L${PROMETHEUS_ROOT}/lib -lpromfei -lprometheus -lparmetis"
-		AC_DEFINE([_HAVE_PROMETHEUS_], [1], [with Prometheus in ISSM src])
-		AC_SUBST([PROMETHEUSINCL])
-		AC_SUBST([PROMETHEUSLIB])
-	fi
-	dnl }}}
-	dnl SEMIC{{{
-	AC_MSG_CHECKING([for SEMIC])
-	AC_ARG_WITH(
-		[semic-dir],
-		AS_HELP_STRING([--with-semic-dir=DIR], [SEMIC root directory]),
-		[SEMIC_ROOT=${withval}],
-		[SEMIC_ROOT="no"]
-	)
-	if test "x${SEMIC_ROOT}" == "xno"; then
-		HAVE_SEMIC=no
-	else
-		HAVE_SEMIC=yes
-		if ! test -d "${SEMIC_ROOT}"; then
-			AC_MSG_ERROR([SEMIC directory provided (${SEMIC_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_SEMIC}])
-
-	dnl SEMIC libraries and header files
-	if test "x${HAVE_SEMIC}" == "xyes"; then
-		SEMICINCL="-I${SEMIC_ROOT}"
-		if test "${IS_MSYS2}" == "yes"; then
-			SEMICLIB="-Wl,-L${SEMIC_ROOT}/lib -Wl,-lsurface_physics -Wl,-lutils"
-		else
-			SEMICLIB="-L${SEMIC_ROOT}/lib -lsurface_physics -lutils"
-		fi
-		AC_DEFINE([_HAVE_SEMIC_], [1], [with SEMIC in ISSM src])
-		AC_SUBST([SEMICLIB])
-		AC_SUBST([SEMICINCL])
-	fi
-	AM_CONDITIONAL([SEMIC], [test "x${HAVE_SEMIC}" == "xyes"])
-	dnl }}}
-	dnl SPAI{{{
-	AC_MSG_CHECKING([for SPAI])
-	AC_ARG_WITH(
-		[spai-dir],
-		AS_HELP_STRING([--with-spai-dir=DIR], [SPAI root directory]),
-		[SPAI_ROOT=${withval}],
-		[SPAI_ROOT="no"]
-	)
-	if test "x${SPAI_ROOT}" == "xno"; then
-		HAVE_SPAI=no
-	else
-		HAVE_SPAI=yes
-		if ! test -d "${SPAI_ROOT}"; then
-			AC_MSG_ERROR([SPAI directory provided (${SPAI_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_SPAI}])
-
-	dnl SPAI libraries and header files
-	if test "x${HAVE_SPAI}" == "xyes"; then
-		SPAIINCL="-I${SPAI_ROOT}/include"
-		SPAILIB="-L${SPAI_ROOT}/lib -lspai"
-		AC_DEFINE([_HAVE_SPAI_], [1], [with SPAI in ISSM src])
-		AC_SUBST([SPAIINCL])
-		AC_SUBST([SPAILIB])
-	fi
-	dnl }}}
-	dnl SuperLU{{{
-	AC_MSG_CHECKING([for SuperLU])
-	AC_ARG_WITH(
-		[superlu-dir],
-		AS_HELP_STRING([--with-superlu-dir=DIR], [SuperLU root directory]),
-		[SUPERLU_ROOT=${withval}],
-		[SUPERLU_ROOT="no"]
-	)
-	if test "x${SUPERLU_ROOT}" == "xno"; then
-		HAVE_SUPERLU=no
-	else
-		HAVE_SUPERLU=yes
-		if ! test -d "${SUPERLU_ROOT}"; then
-			AC_MSG_ERROR([SuperLU directory provided (${SUPERLU_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_SUPERLU}])
-
-	dnl SuperLU libraries and header files
-	if test "x${HAVE_SUPERLU}" == "xyes"; then
-		SUPERLUINCL="-I${SUPERLU_ROOT}/include"
-		SUPERLULIB="-L${SUPERLU_ROOT}/lib -lsuperlu_dist"
-		AC_DEFINE([_HAVE_SUPERLU_], [1], [with SuperLU in ISSM src])
-		AC_SUBST([SUPERLUINCL])
-		AC_SUBST([SUPERLULIB])
-	fi
-	dnl }}}
-	dnl SPOOLES{{{
-	AC_MSG_CHECKING([for SPOOLES])
-	AC_ARG_WITH(
-		[spooles-dir],
-		AS_HELP_STRING([--with-spooles-dir=DIR], [SPOOLES root directory]),
-		[SPOOLES_ROOT=${withval}],
-		[SPOOLES_ROOT="no"]
-	)
-	if test "x${SPOOLES_ROOT}" == "xno"; then
-		HAVE_SPOOLES=no
-	else
-		HAVE_SPOOLES=yes
-		if ! test -d "${SPOOLES_ROOT}"; then
-			AC_MSG_ERROR([SPOOLES directory provided (${SPOOLES_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_SPOOLES}])
-
-	dnl SPOOLES libraries and header files
-	if test "x${HAVE_SPOOLES}" == "xyes"; then
-		SPOOLESINCL="-I${SPOOLES_ROOT}/include"
-		SPOOLESLIB="-L${SPOOLES_ROOT}/lib -lspooles"
-		AC_DEFINE([_HAVE_SPOOLES_], [1], [with SPOOLES in ISSM src])
-		AC_SUBST([SPOOLESINCL])
-		AC_SUBST([SPOOLESLIB])
-	fi
-	dnl }}}
-	dnl PaStiX{{{
-	AC_MSG_CHECKING([for PaStiX])
-	AC_ARG_WITH(
-		[pastix-dir],
-		AS_HELP_STRING([--with-pastix-dir=DIR], [PaStiX root directory]),
-		[PASTIX_ROOT=${withval}],
-		[PASTIX_ROOT="no"]
-	)
-	if test "x${PASTIX_ROOT}" == "xno"; then
-		HAVE_PASTIX=no
-	else
-		HAVE_PASTIX=yes
-		if ! test -d "${PASTIX_ROOT}"; then
-			AC_MSG_ERROR([PaStiX directory provided (${PASTIX_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_PASTIX}])
-
-	dnl PaStiX libraries and header files
-	if test "x${HAVE_PASTIX}" == "xyes"; then
-		PASTIXINCL="-I${PASTIX_ROOT}/include"
-		PASTIXLIB="-L${PASTIX_ROOT}/lib -lpastix_XXbit_mpi_smp_nobubble_int32_simple_real_scotch_i686_pc_linux -lptscotch -lptscotcherr -lpastix"
-		AC_DEFINE([_HAVE_PASTIX_], [1], [with PaStiX in ISSM src])
-		AC_SUBST([PASTIXINCL])
-		AC_SUBST([PASTIXLIB])
-	fi
-	dnl }}}
-	dnl }}}
-	dnl ml{{{
-	AC_MSG_CHECKING([for ml])
-	AC_ARG_WITH(
-		[ml-dir],
-		AS_HELP_STRING([--with-ml-dir=DIR],[ml root directory]),
-		[ML_ROOT=$withval],
-		[ML_ROOT="no"]
-	)
-	if test "x${ML_ROOT}" == "xno"; then
-		HAVE_ML=no
-	else
-		HAVE_ML=yes
-		if ! test -d "${ML_ROOT}"; then
-			AC_MSG_ERROR([ml directory provided (${ML_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_ML}])
-
-	dnl ml libraries and header files
-	if test "x${HAVE_ML}" == "xyes"; then
-		MLINCL=-I"${ML_ROOT}/include"
-		MLLIB=-L"${ML_ROOT}/lib -lml"
-		AC_DEFINE([_HAVE_ML_], [1], [with ml in ISSM src])
-		AC_SUBST([MLINCL])
-		AC_SUBST([MLLIB])
-	fi
-	dnl }}}
-	dnl UMFPACK{{{
-	AC_MSG_CHECKING([for UMFPACK])
-	AC_ARG_WITH(
-		[umfpack-dir],
-		AS_HELP_STRING([--with-umfpack-dir=DIR], [UMFPACK root directory]),
-		[UMFPACK_ROOT=${withval}],
-		[UMFPACK_ROOT="no"]
-	)
-	if test "x${UMFPACK_ROOT}" == "xno"; then
-		HAVE_UMFPACK=no
-	else
-		HAVE_UMFPACK=yes
-		if ! test -d "${UMFPACK_ROOT}"; then
-			AC_MSG_ERROR([UMFPACK directory provided (${UMFPACK_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_UMFPACK}])
-
-	dnl UMFPACK libraries and header files
-	if test "x${HAVE_UMFPACK}" == "xyes"; then
-		UMFPACKINCL=""
-		UMFPACKLIB="-L${UMFPACK_ROOT}/lib -lumfpack -lumfpack.5.5.1"
-		AC_DEFINE([_HAVE_UMFPACK_], [1], [with UMFPACK in ISSM src])
-		AC_SUBST([UMFPACKINCL])
-		AC_SUBST([UMFPACKLIB])
-	fi
-	dnl }}}
-	dnl libm (GNU math library){{{
-	AC_MSG_CHECKING(for libm)
-	AC_ARG_WITH(
-		[math-lib],
-		AS_HELP_STRING([--with-math-lib=LIB], [libm (GNU math library) to use]),
-		[MATH_LIB=${withval}],
-		[MATH_LIB=""]
-	)
-	if test -n "${MATH_LIB}"; then
-		HAVE_MATH=yes
-		MATHLIB="${MATH_LIB}"
-		AC_DEFINE([_HAVE_MATH_], [1], [with libm (GNU math library) in ISSM src])
-		AC_SUBST([MATHLIB])
-	fi
-	AC_MSG_RESULT([done])
-	dnl }}}
-	dnl MATH77{{{
-	AC_MSG_CHECKING([for MATH77])
-	AC_ARG_WITH(
-		[math77-dir],
-		AS_HELP_STRING([--with-math77-dir=DIR], [MATH77 root directory]),
-		[MATH77_ROOT=${withval}],
-		[MATH77_ROOT="no"]
-	)
-	if test "x${MATH77_ROOT}" == "xno"; then
-		HAVE_MATH77=no
-	else
-		HAVE_MATH77=yes
-		if ! test -d "${MATH77_ROOT}"; then
-			AC_MSG_ERROR([MATH77 directory provided (${MATH77_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_MATH77}])
-
-	dnl MATH77 libraries and header files
-	if test "x${HAVE_MATH77}" == "xyes"; then
-		MATH77LIB="-L${MATH77_ROOT} -lmath77"
-		AC_DEFINE([_HAVE_MATH77_], [1], [with MATH77 in ISSM src])
-		AC_SUBST([MATH77LIB])
-	fi
-	dnl }}}
-	dnl Fortran{{{
-	AC_MSG_CHECKING(for Fortran compilation)
-	AC_ARG_WITH(
-		[fortran],
-		AS_HELP_STRING([--with-fortran=YES], [do we compile Fortran code (default: yes)]),
-		[FORTRAN=${withval}],
-		[FORTRAN=yes]
-	)
-	if test "x${FORTRAN}" == "xyes"; then
-		HAVE_FORTRAN=yes
-		AC_DEFINE([_HAVE_FORTRAN_], [1], [with Fortran capability])
-	else
-		HAVE_FORTRAN=no
-	fi
-	AM_CONDITIONAL([FORTRAN], [test "x${FORTRAN}" == "xyes"])
-	AC_MSG_RESULT([${FORTRAN}])
-
-	IS_FORTRANDIR_A_DIR=no
-	if test "x${FORTRAN}" == "xyes"; then
-		dnl Fortran library
-		AC_MSG_CHECKING([for Fortran library])
-		AC_ARG_WITH(
-			[fortran-lib],
-			AS_HELP_STRING([--with-fortran-lib=LIB], [Fortran library to use (and, if needed, libraries on which it depends)]),
-			[FORTRAN_LIB=${withval}],
-			[FORTRAN_LIB=""]
-		)
-		if test -n "${FORTRAN_LIB}"; then
-			FORTRAN_DIR=$(echo ${FORTRAN_LIB} | sed -e "s/-Wl,//g" | sed -e "s/-L//g" | awk '{print $[1]}')
-			if test -d "${FORTRAN_DIR}" || test -f "${FORTRAN_DIR}"; then
-				FORTRANDIR="${FORTRAN_DIR}"
-				if test -n "${FORTRAN_DIR}"; then
-					IS_FORTRANDIR_A_DIR=yes
-				fi
-				FORTRANLIB="${FORTRAN_LIB}"
-				AC_DEFINE([_HAVE_FORTRAN_], [1], [with Fortran library in ISSM src])
-				AC_SUBST([FORTRANDIR])
-				AC_SUBST([FORTRANLIB])
-			else
-				if test "x${HAVE_MPI}" == "xyes"; then
-					MPI_REC_FORTRAN_LIB=$(mpif77 -print-file-name="libgfortran.a")
-					if test -f "${FORTRANLIB}"; then
-						AC_MSG_ERROR([Fortran library provided (${FORTRAN_LIB}) does not exist! MPI suggests the following library: ${MPI_REC_FORTRAN_LIB}]);
-					fi
-			 	fi
-				AC_MSG_ERROR([Fortran library provided (${FORTRAN_LIB}) does not exist!]);
-			fi
-		fi
-		AC_MSG_RESULT([done])
-	fi
-	AM_CONDITIONAL([HAVE_FORTRANDIR], [test "x${IS_FORTRANDIR_A_DIR}" == "xyes"])
-	dnl }}}
-	dnl Xlib (graphics library){{{
-	AC_MSG_CHECKING([for Xlib (graphics library)])
-	AC_ARG_WITH(
-		[graphics-lib],
-		AS_HELP_STRING([--with-graphics-lib=options], [Xlib (graphics library) to use]),
-		[GRAPHICS_LIB=${withval}],
-		[GRAPHICS_LIB=""]
-	)
-	if test -n "${GRAPHICS_LIB}"; then
-		GRAPHICS_DIR=$(echo ${GRAPHICS_LIB} | sed -e "s/-L//g" | awk '{print $[1]}')
-		if test -d "${GRAPHICS_DIR}" || test -f "${GRAPHICS_DIR}"; then
-			HAVE_GRAPHICS=yes
-			GRAPHICSLIB="${GRAPHICS_LIB}"
-			AC_DEFINE([_HAVE_GRAPHICS_], [1], [with Xlib (graphics library) in ISSM src])
-			AC_SUBST([GRAPHICSLIB])
-		else
-			if test -f "${PETSC_ROOT}/conf/petscvariables"; then
-				PETSC_REC_GRAPHICS_LIB=$(cat ${PETSC_ROOT}/conf/petscvariables | grep X_LIB)
-				AC_MSG_ERROR([Xlib (graphics library) provided (${GRAPHICS_LIB}) does not exist! PETSc suggests the following library: ${PETSC_REC_GRAPHICS_LIB}]);
-			fi
-			AC_MSG_ERROR([Xlib (graphics library) provided (${GRAPHICS_LIB}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([done])
-	dnl }}}
-	dnl MeteoIO{{{
-	AC_MSG_CHECKING([for MeteoIO])
-	AC_ARG_WITH(
-		[meteoio-dir],
-		AS_HELP_STRING([--with-meteoio-dir=DIR], [use MeteoIO in conjunction with SNOWPACK model]),
-		[METEOIO_ROOT=${withval}],
-		[METEOIO_ROOT="no"]
-	)
-	if test "x${METEOIO_ROOT}" == "xno"; then
-		HAVE_METEOIO=no
-	else
-		HAVE_METEOIO=yes
-		if ! test -d "${METEOIO_ROOT}"; then
-			AC_MSG_ERROR([MeteoIO directory provided (${METEOIO_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_METEOIO}])
-
-	dnl MeteoIO libraries and header files
-	if test "x${HAVE_METEOIO}" == "xyes"; then
-		METEOIOINCL="-I${METEOIO_ROOT}/include"
-		METEOIOLIB="-dy -L${METEOIO_ROOT}/lib -lmeteoio"
-
-		AC_DEFINE([_HAVE_METEOIO_], [1], [with MeteoIO])
-		AC_SUBST([METEOIOINCL])
-		AC_SUBST([METEOIOLIB])
-	fi
-	AM_CONDITIONAL([METEOIO], [test "x${HAVE_METEOIO}" == "xyes"])
-	dnl }}}
-	dnl SNOWPACK{{{
-	AC_MSG_CHECKING([for SNOWPACK])
-	AC_ARG_WITH(
-		[snowpack-dir],
-		AS_HELP_STRING([--with-snowpack-dir=DIR], [use SNOWPACK for surface mass balance model]),
-		[SNOWPACK_ROOT=${withval}],
-		[SNOWPACK_ROOT="no"]
-	)
-	if test "x${SNOWPACK_ROOT}" == "xno"; then
-		HAVE_SNOWPACK=no
-	else
-		HAVE_SNOWPACK=yes
-		if ! test -d "${SNOWPACK_ROOT}"; then
-			AC_MSG_ERROR([SNOWPACK directory provided (${SNOWPACK_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_SNOWPACK}])
-
-	dnl SNOWPACK libraries and header files
-	if test "x${HAVE_SNOWPACK}" == "xyes"; then
-		SNOWPACKINCL="-I${SNOWPACK_ROOT}/include"
-		SNOWPACKLIB="-dy -L${SNOWPACK_ROOT}/lib -lsnowpack"
-		AC_DEFINE([_HAVE_SNOWPACK_], [1], [with SNOWPACK for surface mass balance model])
-		AC_SUBST([SNOWPACKINCL])
-		AC_SUBST([SNOWPACKLIB])
-	fi
-	AM_CONDITIONAL([SNOWPACK], [test "x${HAVE_SNOWPACK}" == "xyes"])
-	dnl }}}
-	dnl NeoPZ{{{
-	AC_MSG_CHECKING([for NeoPZ])
-	AC_ARG_WITH(
-		[neopz-dir],
-		AS_HELP_STRING([--with-neopz-dir=DIR], [NeoPZ root directory]),
-		[NEOPZ_ROOT=${withval}],
-		[NEOPZ_ROOT="no"]
-	)
-	if test "x${NEOPZ_ROOT}" == "xno"; then
-		HAVE_NEOPZ=no
-	else
-		HAVE_NEOPZ=yes
-		if ! test -d "${NEOPZ_ROOT}"; then
-			AC_MSG_ERROR([NeoPZ directory provided (${NEOPZ_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_NEOPZ}])
-
-	dnl NeoPZ libraries and header files
-	if test "x${HAVE_NEOPZ}" == "xyes"; then
-		NEOPZLIB="${NEOPZ_ROOT}/lib/libpz.a"
-		NEOPZINCL="-I${NEOPZ_ROOT}/include"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Analysis"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Common"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/External"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Frontal"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Geom"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Integral"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/LinearSolvers"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Material"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Matrix"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Mesh"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Multigrid"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/PerfUtil"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Post"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Pre"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Refine"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Save"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Shape"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/SpecialMaps"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/StrMatrix"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/SubStruct"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Topology"
-		NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Util"
-		CXXFLAGS+=" -std=c++11"
-		AC_DEFINE([_HAVE_NEOPZ_], [1], [with NeoPZ in ISSM src])
-		AC_SUBST([NEOPZINCL])
-		AC_SUBST([NEOPZLIB])
-	fi
-	AM_CONDITIONAL([NEOPZ], [test "x${HAVE_NEOPZ}" == "xyes"])
-	dnl }}}
-	dnl Gmsh{{{
-	AC_MSG_CHECKING([for Gmsh])
-	AC_ARG_WITH(
-		[gmsh-dir],
-		AS_HELP_STRING([--with-gmsh-dir=DIR], [Gmsh root directory]),
-		[GMSH_ROOT=${withval}],
-		[GMSH_ROOT="no"]
-	)
-	if test "x${GMSH_ROOT}" == "xno"; then
-		HAVE_GMSH=no
-	else
-		HAVE_GMSH=yes
-		if ! test -d "${GMSH_ROOT}"; then
-			AC_MSG_ERROR([Gmsh directory provided (${GMSH_ROOT}) does not exist!]);
-		fi
-	fi
-	AC_MSG_RESULT([${HAVE_GMSH}])
-	AM_CONDITIONAL([GMSH], [test "x${HAVE_GMSH}" == "xyes"])
-
-	if test "x${HAVE_GMSH}" == "xyes"; then
-		AC_DEFINE([_HAVE_GMSH_], [1], [with Gmsh in ISSM src])
-
-		AC_MSG_CHECKING(for Gmsh version)
-		GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`
-		AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
-		AC_DEFINE_UNQUOTED([_GMSH_VERSION_MAJOR_], ${GMSH_VERSION_MAJOR}, [Gmsh major version])
-	fi
-	dnl }}}
-	dnl Capabilities
-	dnl with-bamg{{{
-	AC_MSG_CHECKING([for BAMG capability compilation])
-	AC_ARG_WITH(
-		[bamg],
-		AS_HELP_STRING([--with-bamg=YES], [compile with BAMG capabilities (default: yes)]),
-		[BAMG=${withval}],
-		[BAMG=yes]
-	)
-	HAVE_BAMG=no
-	if test "x${BAMG}" == "xyes"; then
-		HAVE_BAMG=yes
-		AC_DEFINE([_HAVE_BAMG_], [1], [with BAMG meshing capability])
-	fi
-	AM_CONDITIONAL([BAMG], [test "x${HAVE_BAMG}" == "xyes"])
-	AC_MSG_RESULT([${HAVE_BAMG}])
-	dnl }}}
-	dnl with-ocean{{{
-	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
-	AC_ARG_WITH(
-		[ocean],
-		AS_HELP_STRING([--with-ocean = YES], [compile with ice/ocean coupling capability (default: no)]),
-		[OCEAN=${withval}],
-		[OCEAN=no]
-	)
-	HAVE_OCEAN=no
-	if test "x${OCEAN}" == "xyes"; then
-		HAVE_OCEAN=yes
-		AC_DEFINE([_HAVE_OCEAN_], [1], [with ice/ocean coupling capability])
-	fi
-	AM_CONDITIONAL([OCEAN], [test "x${HAVE_OCEAN}" == "xyes"])
-	AC_MSG_RESULT([${HAVE_OCEAN}])
-	dnl }}}
-	dnl with-kml{{{
-	AC_MSG_CHECKING(for kml capability compilation)
-	AC_ARG_WITH(
-		[kml],
-		AS_HELP_STRING([--with-kml=YES], [compile with kml capabilities (default: no)]),
-		[KML=${withval}],
-		[KML=no]
-	)
-	HAVE_KML=no
-	if test "x${KML}" == "xyes"; then
-		HAVE_KML=yes
-		AC_DEFINE([_HAVE_KML_], [1], [with kml capability])
-	fi
-	AM_CONDITIONAL([KML], [test "x${HAVE_KML}" == "xyes"])
-	AC_MSG_RESULT([${HAVE_KML}])
-	dnl }}}
-	dnl with-kriging{{{
-	AC_MSG_CHECKING(for kriging capability compilation)
-	AC_ARG_WITH(
-		[kriging],
-		AS_HELP_STRING([--with-kriging=YES], [compile with kriging capabilities (default: yes)]),
-		[KRIGING=${withval}],
-		[KRIGING=yes]
-	)
-	HAVE_KRIGING=no
-	if test "x${KRIGING}" == "xyes"; then
-		HAVE_KRIGING=yes
-		AC_DEFINE([_HAVE_KRIGING_], [1], [with kriging capability])
-	fi
-	AM_CONDITIONAL([KRIGING], [test "x${HAVE_KRIGING}" == "xyes"])
-	AC_MSG_RESULT([${HAVE_KRIGING}])
-	dnl }}}
-
-	dnl Analyses
-	AX_ANALYSES_SELECTION
-
-	dnl Platform specifics
-	dnl with-ios{{{
-	AC_MSG_CHECKING(for iOS compilation)
-	AC_ARG_WITH(
-		[ios],
-		AS_HELP_STRING([--with-ios=YES], [compile with iOS capabilities (default: no)]),
-		[IOS=${withval}],
-		[IOS=no]
-	)
-	HAVE_IOS=no
-	if test "x${IOS}" == "xyes"; then
-		HAVE_IOS=yes
-		AC_DEFINE([_HAVE_IOS_], [1], [with iOS capability])
-	fi
-	AM_CONDITIONAL([IOS], [test "x${HAVE_IOS}" != "xno"])
-	AC_MSG_RESULT([${HAVE_IOS}])
-	dnl }}}
-	dnl with-android{{{
-	AC_MSG_CHECKING([for Android capability compilation])
-	AC_ARG_WITH(
-		[android],
-		AS_HELP_STRING([--with-android=EXE], [compile with Android capabilities (default: "no"; alternatives: "exe", "jni")]),
-		[ANDROID=${withval}],
-		[ANDROID=no]
-	)
-	if test "x${ANDROID}" == "xjni"; then
-		HAVE_ANDROID=jni
-		AC_DEFINE([_HAVE_ANDROID_], [1], [with Android capability])
-		AC_DEFINE([_HAVE_ANDROID_JNI_], [1], [with Android Java Native Interface (JNI)])
-	elif test "x${ANDROID}" == "xexe"; then
-		HAVE_ANDROID=exe
-		AC_DEFINE([_HAVE_ANDROID_], [1], [with Android capability])
-	elif test "x${ANDROID}" == "xno"; then
-		HAVE_ANDROID=no
-	else
-		AC_MSG_ERROR([--with-android should be either "no", "exe" or "jni"])
-	fi
-	AM_CONDITIONAL([ANDROID], [test "x${HAVE_ANDROID}" != "xno"])
-	AM_CONDITIONAL([ANDROIDJNI], [test "x${HAVE_ANDROID}" == "xjni"])
-	AM_CONDITIONAL([ANDROIDEXE], [test "x${HAVE_ANDROID}" == "xexe"])
-	AC_MSG_RESULT([${HAVE_ANDROID}])
-	dnl }}}
-	dnl with-android-ndk{{{
-	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
-	AC_ARG_WITH(
-		[android-ndk],
-		AS_HELP_STRING([--with-android-ndk=DIR], [Android NDK root directory]),
-		[ANDROID_NDK_ROOT=${withval}],
-		[ANDROID_NDK_ROOT=""]
-	)
-	if test -d "${ANDROID_NDK_ROOT}"; then
-		HAVE_ANDROID_NDK=yes
-		ANDROID_NDKINCL="-I${ANDROID_NDK_ROOT}/arm-linux-android-install/sysroot/usr/include"
-		AC_DEFINE([_HAVE_ANDROID_NDK_], [1], [with Android NDK in ISSM src])
-		AC_SUBST([ANDROID_NDKINCL])
-	else
-		HAVE_ANDROID_NDK=no
-	fi
-	AC_MSG_RESULT([${HAVE_ANDROID_NDK}])
-	dnl }}}
-
-	dnl other options
-	dnl optimization{{{
-	dnl -- bypass standard optimization -g -O2 -fPIC?
-	AC_MSG_CHECKING(for C++ optimization flags)
-	AC_ARG_WITH(
-		[cxxoptflags],
-		AS_HELP_STRING([--with-cxxoptflags=CXXOPTFLAGS], [C++ optimization flags (i.e. --with-cxxoptflags="-march=opteron -O3 -std=c++11"]),
-		[CXXOPTFLAGS=${withval}],
-		[CXXOPTFLAGS="-g -O2 -fPIC -std=c++11 -D_DO_NOT_LOAD_GLOBALS_"]
-	)
-	AC_SUBST([CXXOPTFLAGS])
-	AC_MSG_RESULT([${CXXOPTFLAGS}])
-	dnl }}}
-	dnl multithreading{{{
-	AC_MSG_CHECKING(for number of threads)
-	AC_ARG_WITH(
-		[numthreads],
-		AS_HELP_STRING([--with-numthreads=NUMTHREADS_VALUE], [number of threads (default: 1)]),
-		[NUMTHREADS_VALUE=${withval}],
-		[NUMTHREADS_VALUE=1]
-	)
-	dnl Check that supplied value is an integer
-	if test "${NUMTHREADS_VALUE}" != "${NUMTHREADS_VALUE}"; then
-		AC_MSG_ERROR([Number of threads provided (${NUMTHREADS_VALUE}) is not an integer!]);
-	elif test "${NUMTHREADS_VALUE}" == "0"; then
-		AC_MSG_ERROR([Number of threads must be at least 1!]);
-	fi
-	MULTITHREADING=no
-	MULTITHREADINLIB=""
-	if test "x${NUMTHREADS_VALUE}" != "x1"; then
-		MULTITHREADINGLIB="-lpthread -lrt"
-		case "${host_os}" in
-			*darwin*)
-				MULTITHREADINGLIB="-lpthread"
-			;;
-			*linux*)
-				MULTITHREADINGLIB="-lpthread -lrt"
-			;;
-			*mingw*)
-				MULTITHREADINGLIB=""
-			;;
-		esac
-		AC_DEFINE([_MULTITHREADING_], [1], [with multithreading enabled])
-	fi
-	AC_DEFINE_UNQUOTED([_NUMTHREADS_], ${NUMTHREADS_VALUE}, [number of threads])
-	AC_SUBST([MULTITHREADINGLIB])
-	AC_MSG_RESULT([${NUMTHREADS_VALUE}])
-	dnl }}}
-	dnl 64-bit indices{{{
-	AC_MSG_CHECKING([for 64-bit indices])
-	AC_ARG_WITH(
-		[64bit-indices],
-		AS_HELP_STRING([--with-64bit-indices=bool], [use 64-bit indices (default: 0)]),
-		[USE_64BIT_INDICES=${withval}],
-		[USE_64BIT_INDICES=0]
-	)
-	if test "x${USE_64BIT_INDICES}" == "x1"; then
-		AC_DEFINE([ISSM_USE_64BIT_INDICES], [1], [with 64-bit indices])
-	else
-		AC_DEFINE([ISSM_USE_64BIT_INDICES], [0], [with 64-bit indices])
-	fi
-	AC_MSG_RESULT([${USE_64BIT_INDICES}])
-	dnl }}}
-
-	dnl Checks {{{
-	AC_MSG_CHECKING(consistency between all external packages)
-
-	dnl Check that if PETSc is requested, MPI is specified
-	if test "x${HAVE_PETSC}" == "xyes"; then
-		if test "x${HAVE_MPI}" == "xno"; then
-			AC_MSG_ERROR([PETSc requires MPI!]);
-		fi
-	fi
-
-	dnl Check that we have MATLAB and/or Python support if we compile the modules
-	if test "x${MODULES_VALUE}" == "xyes" && test "${HAVE_MATLAB}" == "xno" && test "${HAVE_PYTHON}" == "xno"; then
-		AC_MSG_ERROR([need at least MATLAB and/or Python support to compile modules! (or use --with-modules=no)]);
-	fi
-
-	dnl Check that Fortran is provided if Gia is on
-	if test "x${HAVE_GIA}" == "xyes" &&  test "${HAVE_FORTRAN}" == "xno"; then
-		AC_MSG_ERROR([need Fortran compiler to compile Gia! (or use --without-Gia)]);
-	fi
-
-	dnl Check that Fortran is provided if Love is on
-	if test "x${HAVE_LOVE}" == "xyes" && test "x${HAVE_FORTRAN}" == "xno"; then
-		AC_MSG_ERROR([need Fortran compiler to compile Love! (or use --without-Love)]);
-	fi
-
-	dnl Check that if we have MPI, we have METIS
-	if test "x${HAVE_METIS}" == "xyes" && test "x${HAVE_MPI}" == "xno"; then
-		AC_MSG_ERROR([need MPI if using the METIS partitioner!]);
-	fi
-
-	dnl Check that if we run ADOL-C, we don't compile kriging.exe
-	if test "x${HAVE_ADOLC}" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
-		AC_MSG_ERROR([cannot compile kriging.exe under ADOL-C conditions!]);
-	fi
-
-	dnl Check that if we run ADOL-C, we don't use PETSc for now
-	if test "x${HAVE_ADOLC}" == "xyes" && test "x${HAVE_PETSC}" == "xyes"; then
-		AC_MSG_ERROR([cannot compile ISSM with both PETSc and ADOL-C!]);
-	fi
-	if test "x${HAVE_ADOLC}" == "xyes" && test "x${HAVE_CODIPACK}" == "xyes"; then
-		AC_MSG_ERROR([cannot compile ISSM with both ADOL-C and CoDiPack!]);
-	fi
-	if test "x${HAVE_ADJOINTMPI}" == "xyes" && test "x${HAVE_MEDIPACK}" == "xyes"; then
-		AC_MSG_ERROR([cannot compile ISSM with both MeDiPack and AdjointMPI!]);
-	fi
-	dnl Check that if we run MeteoIO, we have SNOWPACK also
-	if test "x${HAVE_METEOIO}" == "xyes" && test "x${HAVE_SNOWPACK}" == "xno"; then
-		AC_MSG_ERROR([cannot compile MeteoIO package without SNOWPACK!]);
-	fi
-	dnl Check that if we run SNOWPACK, we have MeteoIO also
-	if test "${HAVE_METEOIO}" == "xno" && test "${HAVE_SNOWPACK}" == "xyes"; then
-		AC_MSG_ERROR([cannot compile SNOWPACK package without MeteoIO!]);
-	fi
-
-	AC_MSG_RESULT([done])
-	dnl }}}
+	else
+		HAVE_BLACS=no
+	fi
+	AC_MSG_RESULT($HAVE_BLACS)
+
+
+
+
 ])
Index: /issm/trunk/m4/matlab.m4
===================================================================
--- /issm/trunk/m4/matlab.m4	(revision 1)
+++ /issm/trunk/m4/matlab.m4	(revision 1)
@@ -0,0 +1,1119 @@
+##### http://autoconf-archive.cryp.to/ax_cflags_warn_all.html
+#
+# SYNOPSIS
+#
+#   AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
+#
+# DESCRIPTION
+#
+#   Try to find a compiler option that enables most reasonable
+#   warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
+#   which is split up into two AX_CFLAGS_WARN_ALL and
+#   AX_CFLAGS_WARN_ALL_ANSI
+#
+#   For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
+#   result is added to the shellvar being CFLAGS by default.
+#
+#   Currently this macro knows about GCC, Solaris C compiler, Digital
+#   Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
+#   compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
+#   10.0.0.8) C compiler.
+#
+#    - $1 shell-variable-to-add-to : CFLAGS
+#    - $2 add-value-if-not-found : nothing
+#    - $3 action-if-found : add value to shellvariable
+#    - $4 action-if-not-found : nothing
+#
+# LAST MODIFICATION
+#
+#   2006-12-12
+#
+# COPYLEFT
+#
+#   Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
+#
+#   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 2 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, write to the Free Software
+#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+#   02111-1307, USA.
+#
+#   As a special exception, the respective Autoconf Macro's copyright
+#   owner gives unlimited permission to copy, distribute and modify the
+#   configure scripts that are the output of Autoconf when processing
+#   the Macro. You need not follow the terms of the GNU General Public
+#   License when using or distributing such scripts, even though
+#   portions of the text of the Macro appear in them. The GNU General
+#   Public License (GPL) does govern all other use of the material that
+#   constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+
+AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic  % -Wall"       dnl   GCC
+   "-xstrconst % -v"          dnl Solaris C
+   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
+   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+   "-ansi -ansiE % -fullwarn" dnl IRIX
+   "+ESlit     % +w1"         dnl HP-UX C
+   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+   #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+   AC_TRY_COMPILE([],[return 0;],
+   [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+     .ok|.ok,*) m4_ifvaln($3,$3) ;;
+   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+   *) m4_ifvaln($3,$3,[
+   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+   fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic  % -Wall"       dnl   GCC
+   "-xstrconst % -v"          dnl Solaris C
+   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
+   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+   "-ansi -ansiE % -fullwarn" dnl IRIX
+   "+ESlit     % +w1"         dnl HP-UX C
+   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+   #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+   AC_TRY_COMPILE([],[return 0;],
+   [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+     .ok|.ok,*) m4_ifvaln($3,$3) ;;
+   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+   *) m4_ifvaln($3,$3,[
+   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+   fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl  implementation tactics:
+dnl   the for-argument contains a list of options. The first part of
+dnl   these does only exist to detect the compiler - usually it is
+dnl   a global option to enable -ansi or -extrawarnings. All other
+dnl   compilers will fail about it. That was needed since a lot of
+dnl   compilers will give false positives for some option-syntax
+dnl   like -Woption or -Xoption as they think of it is a pass-through
+dnl   to later compile stages or something. The "%" is used as a
+dnl   delimimiter. A non-option comment can be given after "%%" marks
+dnl   which will be shown but not added to the respective C/CXXFLAGS.
+
+
+
+
+
+
+
+
+dnl matlabdir.m4 --- define Matlab directory names.
+dnl
+dnl Copyright (C) 2002, 2003 Ralph Schleicher
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2,
+dnl or (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+dnl Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if
+dnl you distribute this file as part of a program that contains a
+dnl configuration script generated by GNU Autoconf, you may include
+dnl it under the same distribution terms that you use for the rest
+dnl of that program.
+dnl
+dnl Code:
+
+# AX_MATLAB_DIR
+# -------------
+# Define Matlab directory names.
+AC_DEFUN([AX_MATLAB_DIR],
+[dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB_VERSION])
+AC_REQUIRE([AC_CANONICAL_HOST])
+ax_matlab_dir="\${datadir}/matlab"
+AC_ARG_WITH([matlab-dir], AC_HELP_STRING([--with-matlab-dir=ARG], [use ARG as the top-level installation directory for Matlab files [[$(datadir)/matlab]]]),
+[case $withval in
+  yes | no)
+    AC_MSG_ERROR([invalid value '$withval' for --with-matlab-dir])
+    ;;
+  *)
+    ax_matlab_dir=$withval
+    ;;
+esac])
+AC_MSG_CHECKING([for top-level installation directory for Matlab files])
+AC_MSG_RESULT([$ax_matlab_dir])
+matlabdir=$ax_matlab_dir
+AC_SUBST([matlabdir])
+matlabverdir="\${matlabdir}/$MATLAB_VERSION"
+AC_SUBST([matlabverdir])
+matlabarchdir="\${matlabverdir}/$host"
+AC_SUBST([matlabarchdir])
+matlabprivatedir="\${matlabdir}/private"
+AC_SUBST([matlabprivatedir])
+matlabprivateverdir="\${matlabverdir}/private"
+AC_SUBST([matlabprivateverdir])
+matlabprivatearchdir="\${matlabarchdir}/private"
+AC_SUBST([matlabprivatearchdir])
+])
+
+dnl matlabdir.m4 ends here
+
+dnl matlabver.m4 --- check for Matlab version number.
+dnl
+dnl Copyright (C) 2000--2003 Ralph Schleicher
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2,
+dnl or (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+dnl Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if
+dnl you distribute this file as part of a program that contains a
+dnl configuration script generated by GNU Autoconf, you may include
+dnl it under the same distribution terms that you use for the rest
+dnl of that program.
+dnl
+dnl Code:
+
+# AX_MATLAB_VERSION
+# -----------------
+# Check for Matlab version number.
+AC_DEFUN([AX_MATLAB_VERSION],
+[dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AX_MATLAB])
+AC_CACHE_CHECK([for Matlab version], [ax_cv_matlab_version],
+[if test "${MATLAB_VERSION+set}" = set ; then
+    ax_cv_matlab_version=$MATLAB_VERSION
+else
+    ax_cv_matlab_version=
+    # Loop over all known architectures.  The final dot covers
+    # Matlab R11 and Matlab V4 for Windows.
+    for ax_arch in alpha glnxa64 glnx86 hp700 hpux ibm_rs sgi sol2 win32 mac maci . ; do
+        for ax_exec_name in matlab$EXEEXT MATLAB ; do
+		ax_matlab_exec=$MATLAB/bin/$ax_arch/${ax_exec_name}
+		if test -f $ax_matlab_exec ; then
+	    		# For Matlab R12, the version number is stored in a
+	    		# shared library.
+	    		ax_matlab_exec_2=`find $MATLAB/bin/$ax_arch -type f -name libmwservices\* -print 2> /dev/null`
+	    		if test -n "$ax_matlab_exec_2" ; then
+				ax_cv_matlab_version=`strings $ax_matlab_exec_2 2> /dev/null | egrep '^\|build_version_\|@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^|build_version_|\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+				if test -n "$ax_cv_matlab_version" ; then
+		    			break
+				fi
+	    		fi
+	    		# For Matlab R11 and Matlab V4, the version number
+	    		# is stored in the executable program.
+	    		ax_cv_matlab_version=`strings $ax_matlab_exec 2> /dev/null | egrep '^@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+\.@<:@0-9@:>@+' | head -1 | sed 's/^\(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'`
+	    		if test -n "$ax_cv_matlab_version" ; then
+				break
+	    		fi
+		fi
+    	done
+	if test -n "$ax_cv_matlab_version" ; then
+		break
+	fi
+    done
+    if test -z "$ax_cv_matlab_version" ; then
+	ax_cv_matlab_version="not found"
+    fi
+fi])
+case $ax_cv_matlab_version in
+  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
+    MATLAB_VERSION=$ax_cv_matlab_version
+    MATLAB_MAJOR=`echo $MATLAB_VERSION | sed -e 's/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/'`
+    MATLAB_MINOR=`echo $MATLAB_VERSION | sed -e 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
+    ;;
+  *)
+    if test x$ax_enable_matlab = xyes ; then
+	AC_MSG_ERROR([can not determine Matlab version number])
+    fi
+    MATLAB_VERSION=
+    MATLAB_MAJOR=
+    MATLAB_MINOR=
+    ;;
+esac
+AC_SUBST([MATLAB_VERSION])
+AC_SUBST([MATLAB_MAJOR])
+AC_SUBST([MATLAB_MINOR])
+if test x$MATLAB_VERSION != x ; then
+    AC_DEFINE_UNQUOTED([MATLAB_MAJOR], [$MATLAB_MAJOR], [Define to the Matlab major version number.])
+    AC_DEFINE_UNQUOTED([MATLAB_MINOR], [$MATLAB_MINOR], [Define to the Matlab minor version number.])
+fi
+])
+
+# AX_REQUIRE_MATLAB_VERSION([MINIMUM-VERSION])
+# --------------------------------------------
+# Check if Matlab version number is sufficient.
+AC_DEFUN([AX_REQUIRE_MATLAB_VERSION],
+[dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB_VERSION])
+if test x$MATLAB_VERSION = x ; then
+    AC_MSG_ERROR([can not determine Matlab version number])
+fi
+m4_if([$1], [], [],
+[AC_MSG_CHECKING([if Matlab version is sufficient])
+ax_version='$1'
+case $ax_version in
+  @<:@1-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@)
+    ax_major=$ax_version
+    ax_minor=''
+    ;;
+  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
+    ax_major=`echo $ax_version | sed 's/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/'`
+    ax_minor=`echo $ax_version | sed 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
+    ;;
+  *)
+    AC_MSG_RESULT([failure])
+    AC_MSG_NOTICE([report this bug to the responsible package maintainer])
+    AC_MSG_ERROR([invalid Matlab version number argument to AX_REQUIRE_MATLAB_VERSION])
+    ;;
+esac
+ax_ans=yes
+if test $MATLAB_MAJOR -eq $ax_major ; then
+    if test x$ax_minor != x && test $MATLAB_MINOR -lt $ax_minor ; then
+	ax_ans=no
+    fi
+elif test $MATLAB_MAJOR -lt $ax_major ; then
+    ax_ans=no
+fi
+AC_MSG_RESULT([$ax_ans])
+if test x$ax_ans = xno ; then
+    AC_MSG_ERROR([require Matlab version $ax_version or above])
+fi])
+])
+
+dnl matlabver.m4 ends here
+
+dnl matlab.m4 --- check for Matlab.
+dnl
+dnl Copyright (C) 2000--2003 Ralph Schleicher
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2,
+dnl or (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+dnl Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if
+dnl you distribute this file as part of a program that contains a
+dnl configuration script generated by GNU Autoconf, you may include
+dnl it under the same distribution terms that you use for the rest
+dnl of that program.
+dnl
+dnl Code:
+
+# AX_MATLAB
+# ---------
+# Check for Matlab.
+AC_DEFUN([AX_MATLAB],
+[dnl
+AC_PREREQ([2.50])
+ax_enable_matlab=
+AC_ARG_WITH([matlab-dir], AC_HELP_STRING([--with-matlab-dir=ARG], [check for Matlab [[yes]]]),
+[case $withval in
+  yes | no)
+    # Explicitly enable or disable Matlab but determine
+    # Matlab prefix automatically.
+    ax_enable_matlab=$withval
+    ;;
+  *)
+    # Enable Matlab and use ARG as the Matlab prefix.
+    # ARG must be an existing directory.
+    ax_enable_matlab=yes
+    MATLAB=`cd "${withval-/}" > /dev/null 2>&1 && pwd`
+    if test -z "$MATLAB" ; then
+	AC_MSG_ERROR([invalid value '$withval' for --with-matlab])
+    fi
+    ;;
+esac])
+if test x$ax_enable_matlab != xno ; then
+AC_CACHE_CHECK([for Matlab prefix], [ax_cv_matlab],
+[if test "${MATLAB+set}" = set ; then
+    ax_cv_matlab=`cd "${MATLAB-/}" > /dev/null 2>&1 && pwd`
+else
+    ax_cv_matlab=
+    IFS=${IFS= 	} ; ax_ifs=$IFS ; IFS=:
+    for ax_dir in ${PATH-/opt/bin:/usr/local/bin:/usr/bin:/bin} ; do
+	if test -z "$ax_dir" ; then
+	    ax_dir=.
+	fi
+	if test -x "$ax_dir/matlab" ; then
+	    ax_dir=`echo "$ax_dir" | sed 's,/bin$,,'`
+	    # Directory sanity check.
+	    ax_cv_matlab=`cd "${ax_dir-/}" > /dev/null 2>&1 && pwd`
+	    if test -n "$ax_cv_matlab" ; then
+		break
+	    fi
+	fi
+    done
+    IFS=$ax_ifs
+fi
+if test -z "$ax_cv_matlab" ; then
+    ax_cv_matlab="not found"
+fi])
+if test "$ax_cv_matlab" = "not found" ; then
+    unset MATLAB
+else
+    # Strip trailing dashes.
+    MATLAB=`echo "$ax_cv_matlab" | sed 's,/*$,,'`
+fi
+AC_MSG_CHECKING([whether to enable Matlab support])
+if test x$ax_enable_matlab != xno ; then
+    if test "${MATLAB+set}" = set && test -d "$MATLAB/extern/include" ; then
+	ax_enable_matlab=yes
+    elif test x$ax_enable_matlab = x ; then
+	ax_enable_matlab=no
+    else
+	# Fail if Matlab was explicitly enabled.
+	AC_MSG_RESULT([failure])
+	AC_MSG_ERROR([check your Matlab setup])
+    fi
+fi
+AC_MSG_RESULT([$ax_enable_matlab])
+if test x$ax_enable_matlab = xyes ; then
+    AC_DEFINE([HAVE_MATLAB], [1], [Define if you have Matlab.])
+fi
+fi
+AC_SUBST([MATLAB])
+])
+
+# AX_REQUIRE_MATLAB
+# -----------------
+# Like AX_MATLAB but fail if Matlab support is disabled.
+AC_DEFUN([AX_REQUIRE_MATLAB],
+[dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB])
+if test x$ax_enable_matlab = xno ; then
+    AC_MSG_ERROR([can not enable Matlab support])
+fi
+])
+
+# AX_MATLAB_CONDITIONAL
+# ---------------------
+# Define Matlab conditional for GNU Automake.
+AC_DEFUN([AX_MATLAB_CONDITIONAL],
+[dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB])
+AM_CONDITIONAL([MATLAB], [test x$ax_enable_matlab = xyes])
+])
+
+dnl matlab.m4 ends here
+
+dnl mex.m4 --- check for mex(1) command.
+dnl
+dnl Copyright (C) 2000--2003 Ralph Schleicher
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2,
+dnl or (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+dnl Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if
+dnl you distribute this file as part of a program that contains a
+dnl configuration script generated by GNU Autoconf, you may include
+dnl it under the same distribution terms that you use for the rest
+dnl of that program.
+dnl
+dnl Code:
+
+# AX_PATH_MEX
+# -----------
+# Check for mex(1) command.
+AC_DEFUN([AX_PATH_MEX],
+[dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_MATLAB])
+AC_REQUIRE([AX_MEX_OPTIONS])
+AC_REQUIRE([AC_CANONICAL_HOST])
+if test "${MEX+set}" != set ; then
+    case $host_os in
+      *cygwin* | *mingw32*)
+	ax_list='mextool mex mex.bat'
+	;;
+      *)
+	ax_list='mex'
+	;;
+    esac
+    AC_PATH_PROGS([MEX], $ax_list, mex, $MATLAB/bin:$PATH)
+fi
+AC_SUBST([MEX])
+if test "${MEXFLAGS+set}" != set ; then
+    MEXFLAGS=-O
+fi
+AC_SUBST([MEXFLAGS])
+if test "${MEXLDADD+set}" != set ; then
+    MEXLDADD=
+fi
+AC_SUBST([MEXLDADD])
+])
+
+dnl mex.m4 ends here
+
+dnl mexopt.m4 --- check for MEX options file.
+dnl
+dnl Copyright (C) 2001--2003 Ralph Schleicher
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2,
+dnl or (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+dnl Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if
+dnl you distribute this file as part of a program that contains a
+dnl configuration script generated by GNU Autoconf, you may include
+dnl it under the same distribution terms that you use for the rest
+dnl of that program.
+dnl
+dnl Code:
+
+# AX_MEX_OPTIONS
+# --------------
+# Check for MEX options file.
+AC_DEFUN([AX_MEX_OPTIONS],
+[dnl
+AC_PREREQ([2.50])
+mex_options=yes
+AC_ARG_WITH([mex-options], AC_HELP_STRING([--with-mex-options=ARG], [use MEX options file ARG [[standard]]]),
+[mex_options=$withval])
+AC_MSG_CHECKING([for MEX options file handling])
+case $mex_options in
+  yes)
+    AC_MSG_RESULT([standard])
+    mexopts_sh=
+    ;;
+  no)
+    AC_MSG_RESULT([disabled])
+    mexopts_sh=$ac_aux_dir/noopts.sh
+    ;;
+  *)
+    AC_MSG_RESULT([enabled])
+    mexopts_sh=$mex_options
+    ;;
+esac
+if test -n "$mexopts_sh" ; then
+    AC_MSG_CHECKING([whether MEX options file exists])
+    if test -f "$mexopts_sh" ; then
+	AC_MSG_RESULT([yes])
+	# Canonicalize file name.
+	mexopts_sh_dir=`echo "$mexopts_sh" | sed 's,[[^/]]*$,,'`
+	mexopts_sh_dir=`cd "${mexopts_sh_dir-.}" && pwd`
+	mexopts_sh_name=`echo "$mexopts_sh" | sed 's,.*/,,'`
+	mexopts_sh="$mexopts_sh_dir/$mexopts_sh_name"
+    else
+	AC_MSG_RESULT([no])
+	AC_MSG_ERROR([$mexopts_sh: no such file])
+    fi
+    MEXOPTS="-f $mexopts_sh"
+else
+    MEXOPTS=
+fi
+AC_SUBST([mexopts_sh])
+AC_SUBST([MEXOPTS])
+])
+
+dnl mexopt.m4 ends here
+
+dnl mexext.m4 --- check for MEX-file suffix.
+dnl
+dnl Copyright (C) 2000--2003 Ralph Schleicher
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2,
+dnl or (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+dnl Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if
+dnl you distribute this file as part of a program that contains a
+dnl configuration script generated by GNU Autoconf, you may include
+dnl it under the same distribution terms that you use for the rest
+dnl of that program.
+dnl
+dnl Code:
+
+# AX_MEXEXT
+# ---------
+# Check for MEX-file suffix.
+AC_DEFUN([AX_MEXEXT],
+[dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_PATH_MEX])
+AC_CACHE_CHECK([for MEX-file suffix], [ax_cv_mexext],
+[if test "${MEXEXT+set}" = set ; then
+    ax_cv_mexext="$MEXEXT"
+else
+    if test -x ${MATLAB}/bin/mexext ; then
+      ax_cv_mexext=`${MATLAB}/bin/mexext`
+    fi
+fi
+if test "x${ax_cv_mexext}" = "x" ; then
+    echo 'mexFunction () {}' > ax_c_test.c
+    $MEX $MEXOPTS $MEXFLAGS -output ax_c_test ax_c_test.c $MEXLDADD 2> /dev/null 1>&2
+    if test -f ax_c_test.dll ; then
+	ax_cv_mexext=dll
+    elif test -f ax_c_test.mex ; then
+	ax_cv_mexext=mex
+    elif test -f ax_c_test.mexaxp ; then
+	ax_cv_mexext=mexaxp
+    elif test -f ax_c_test.mexglx ; then
+	ax_cv_mexext=mexglx
+    elif test -f ax_c_test.mexa64 ; then
+	ax_cv_mexext=mexa64
+    elif test -f ax_c_test.mexmac ; then
+	ax_cv_mexext=mexmac
+    elif test -f ax_c_test.mexmaci ; then
+	ax_cv_mexext=mexmaci
+    elif test -f ax_c_test.mexhp7 ; then
+	ax_cv_mexext=mexhp7
+    elif test -f ax_c_test.mexhpux ; then
+	ax_cv_mexext=mexhpux
+    elif test -f ax_c_test.mexrs6 ; then
+	ax_cv_mexext=mexrs6
+    elif test -f ax_c_test.mexsg ; then
+	ax_cv_mexext=mexsg
+    elif test -f ax_c_test.mexsol ; then
+	ax_cv_mexext=mexsol
+    elif test -f ax_c_test.mexs64 ; then
+	ax_cv_mexext=mexs64
+    elif test -f ax_c_test.mexw32 ; then
+	ax_cv_mexext=mexw32
+    elif test -f ax_c_test.mexw64 ; then
+	ax_cv_mexext=mexw64
+    else
+	ax_cv_mexext=unknown
+    fi
+    rm -f ax_c_test*
+fi])
+MEXEXT="$ax_cv_mexext"
+AC_SUBST([MEXEXT])
+])
+
+# AX_DOT_MEXEXT
+# -------------
+# Check for MEX-file suffix with leading dot.
+AC_DEFUN([AX_DOT_MEXEXT],
+[dnl
+AC_REQUIRE([AX_MEXEXT])
+case $MEXEXT in
+  .*)
+    ;;
+  unknown)
+    ;;
+  *)
+    if test -n "$MEXEXT" ; then
+	MEXEXT=.$MEXEXT
+	AC_MSG_RESULT([setting MEX-file suffix to $MEXEXT])
+	AC_SUBST([MEXEXT])
+    fi
+    ;;
+esac
+])
+
+dnl mexext.m4 ends here
+
+dnl ccmex.m4 --- check how to compile c programs using mex
+dnl
+dnl Copyright (C) 2007 Duncan Brown
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2,
+dnl or (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+dnl Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if
+dnl you distribute this file as part of a program that contains a
+dnl configuration script generated by GNU Autoconf, you may include
+dnl it under the same distribution terms that you use for the rest
+dnl of that program.
+dnl
+dnl Code:    
+
+# AX_CC_MEX
+# ------------
+# Check for the flags needed to build a file with mex
+AC_DEFUN([AX_CC_MEX],
+[dnl
+AC_REQUIRE([AX_PATH_MEX])
+AC_REQUIRE([AX_DOT_MEXEXT])
+AC_LANG([C])
+
+dnl Source code for the test matlab C program
+ac_mex_source='[#include "mex.h"
+void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { return; }]'
+
+dnl Check that the test C program can be compiled with mex
+ac_exeext_save=$ac_exeext
+ac_exeext=$MEXEXT
+ac_link_save=$ac_link
+ac_link='$MEX $MEXOPTS $MEXFLAGS -output conftest$ac_exeext conftest.$ac_ext $MEXLDADD >&AS_MESSAGE_LOG_FD'
+AC_MSG_CHECKING([if mex works])
+AC_LINK_IFELSE([AC_LANG_SOURCE($ac_mex_source)],
+[AC_MSG_RESULT([yes])],
+[AC_MSG_RESULT([no])])
+
+dnl Try to figure out how mex compiles a C program
+ax_cv_mex_version=
+ac_cv_mex_cppflags=
+ac_cv_mex_includes=
+ac_cv_mex_cflags=
+ac_cv_mex_libs=
+ac_cv_mex_ldflags=
+
+dnl Variable that will be subsituted
+MEX_VERSION_C=
+MEX_LDFLAGS=
+MEX_CPPFLAGS=
+MEX_INCLUDES=
+MEX_CFLAGS=
+MEX_LIBS=
+MEX_LDFLAGS=
+
+AC_MSG_CHECKING([if mex -n works])
+ac_save_MEXOPTS=$MEXOPTS
+MEXOPTS="-n $MEXOPTS"
+AC_LANG_CONFTEST([AC_LANG_SOURCE($ac_mex_source)])
+(eval echo $as_me:__oline__: \"$ac_link\") >&AS_MESSAGE_LOG_FD
+ac_cv_mex_n_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1`
+ac_cv_mex_n_result=$?
+echo "$ac_cv_mex_n_output" >&AS_MESSAGE_LOG_FD
+MEXOPTS=$ac_save_MEXOPTS
+rm -f conftest*
+ac_exeext=$ac_exeext_save
+ac_link=$ac_link_save
+
+if test $ac_cv_mex_n_result -eq 0 ; then
+  ac_cv_mex_working=yes
+  AC_MSG_RESULT([$ac_cv_mex_working])
+
+  dnl Save positional arguments (if any)
+  ac_save_positional="$[@]"
+
+  set X $ac_cv_mex_n_output
+  while test $[@%:@] != 1; do
+    shift
+      ac_arg=$[1]
+      case $ac_arg in
+        *mexversion.c)
+          ax_cv_mex_version=$ac_arg
+          ;;
+        -pthread)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cflags, ,
+            ac_cv_mex_cflags="$ac_cv_mex_cflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;
+        -mt)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cflags, ,
+            ac_cv_mex_cflags="$ac_cv_mex_cflags $ac_arg")
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;
+        -ansi)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          ;;
+        -D*)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cppflags, ,
+            ac_cv_mex_cppflags="$ac_cv_mex_cppflags $ac_arg")
+          ;;
+        -I*)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_includes, ,
+            ac_cv_mex_includes="$ac_cv_mex_includes $ac_arg")
+          ;;
+        -f* | -O* | -xO* | -xlibmil )
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_cflags, ,
+            ac_cv_mex_cflags="$ac_cv_mex_cflags $ac_arg")
+          ;;
+        -l*)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_libs, ,
+            ac_cv_mex_libs="$ac_cv_mex_libs $ac_arg")
+          ;;
+        -L)
+          # When -L is seen by itself, it takes an argument
+          # We remove the space between option and argument and re-iterate
+          # unless we find an empty arg or a new option (starting with -)
+          case $[2] in
+             "" | -*);;
+             *)
+             ac_arg="$ac_arg$[2]"
+             shift; shift
+             set X $ac_arg "$[@]"
+             ;;
+           esac
+           ;;
+        -L* | -Wl,* | -shared | -bundle | -G)
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;
+        -undefined)
+          # the darwin linker undefined option takes and argument
+          ac_arg="$ac_arg $[2]"
+          shift
+          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_mex_ldflags, ,
+            ac_cv_mex_ldflags="$ac_cv_mex_ldflags $ac_arg")
+          ;;   
+          # ignore everything else
+      esac
+  done
+  
+  # restore positional arguments
+  set X $ac_save_positional; shift
+
+  MEX_VERSION_C=$ax_cv_mex_version
+
+  AC_MSG_CHECKING([for CPPFLAGS needed to build mex objects])
+  if test "x$ac_cv_mex_cppflags" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_CPPFLAGS=`echo $ac_cv_mex_cppflags | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_CPPFLAGS])
+  fi
+  AC_MSG_CHECKING([for INCLUDES needed to build mex objects])
+  if test "x$ac_cv_mex_includes" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_INCLUDES=`echo $ac_cv_mex_includes | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_INCLUDES])
+  fi
+  AC_MSG_CHECKING([for CFLAGS needed to build mex objects])
+  if test "x$ac_cv_mex_cflags" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_CFLAGS=`echo $ac_cv_mex_cflags | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_CFLAGS])
+  fi
+  AC_MSG_CHECKING([for LIBS needed to build mex objects])
+  if test "x$ac_cv_mex_libs" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_LIBS=`echo $ac_cv_mex_libs | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_LIBS])
+  fi
+  AC_MSG_CHECKING([for LDFLAGS needed to build mex objects])
+  if test "x$ac_cv_mex_ldflags" = "x" ; then
+    AC_MSG_RESULT([none])
+  else
+    MEX_LDFLAGS=`echo $ac_cv_mex_ldflags | sed 's/^[ \t]*//;s/[ \t]*$//'`
+    AC_MSG_RESULT([$MEX_LDFLAGS])
+  fi
+else
+  ac_cv_mex_working=no
+  AC_MSG_RESULT([$ac_cv_mex_working])
+fi
+
+AC_SUBST(MEX_VERSION_C)
+AC_SUBST(MEX_CPPFLAGS)
+AC_SUBST(MEX_INCLUDES)
+AC_SUBST(MEX_CFLAGS)
+AC_SUBST(MEX_LIBS)
+AC_SUBST(MEX_LDFLAGS)
+
+])
+
+# AX_MEX_CONDITIONAL
+# ---------------------
+# Define Matlab conditional for GNU Automake.
+AC_DEFUN([AX_MEX_CONDITIONAL],
+[dnl
+AC_PREREQ([2.50])
+AC_REQUIRE([AX_CC_MEX])
+AM_CONDITIONAL(MEX, test x$ac_cv_mex_working = xyes)
+AM_CONDITIONAL(MEX_VERSION_C, test x$ax_cv_mex_version != x)
+])
+
+dnl ccmex.m4 ends here
+
+# AX_MATLAB_SYS_ZLIB
+# ------------
+# Matlab preloads an old version of zlib which means that we cannot
+# just dynamically link against the libz.so found by the linker.
+# Instead we search for a working version of zlib in the system 
+# location and use that.
+AC_DEFUN([AX_MATLAB_SYS_ZLIB],
+[dnl
+AC_REQUIRE([AX_PATH_MEX])
+AC_LANG([C])
+
+ax_matlab_sys_zlib=
+
+if test x$ax_cv_mexext != xunknown && test x$ax_cv_mexext != x ; then
+  # Where should we search for libraries
+  ax_sys_lib_search_path="/lib /usr/lib /usr/local/lib"
+
+  # If this is a 64 bit link box look in the place where redhat keeps libs
+  if test x$ax_cv_mexext = xmexa64; then
+    ax_sys_lib_search_path="/lib64 /usr/lib64 /usr/local/lib64 $ax_sys_lib_search_path"
+  fi
+
+  # set the extension of the library we are looking for
+  if test x$ax_cv_mexext = xmexmac || test x$ax_cv_mexext = xmexmaci ; then
+    ax_zlib_lib_ext=".dylib"
+  else
+    ax_zlib_lib_ext=".a"
+  fi
+
+  for lib_path in $ax_sys_lib_search_path ; do
+    ax_matlab_search_zlib=$lib_path/libz$ax_zlib_lib_ext
+
+   AC_CHECK_FILE([$ax_matlab_search_zlib],
+     [
+       AC_MSG_CHECKING([for gzungetc in $ax_matlab_search_zlib])
+       ac_save_LIBS=$LIBS
+       LIBS="$ax_matlab_search_zlib $LIBS"
+       AC_LINK_IFELSE(
+         [ AC_LANG_PROGRAM( ,[[gzungetc();]]) ],
+         [ 
+           AC_MSG_RESULT([yes]) 
+           ax_matlab_sys_zlib=$ax_matlab_search_zlib
+         ],
+         [ AC_MSG_RESULT([no]) ]
+       )
+       LIBS=$ac_save_LIBS
+     ], )
+    
+    if test x$ax_matlab_sys_zlib != x ; then
+      break
+    fi
+  done
+fi
+
+MATLAB_SYS_ZIB=$ax_matlab_sys_zlib
+
+AC_SUBST([MATLAB_SYS_ZIB])
+
+])
+
+
+##### http://autoconf-archive.cryp.to/check_zlib.html
+#
+# SYNOPSIS
+#
+#   CHECK_ZLIB()
+#
+# DESCRIPTION
+#
+#   This macro searches for an installed zlib library. If nothing was
+#   specified when calling configure, it searches first in /usr/local
+#   and then in /usr. If the --with-zlib=DIR is specified, it will try
+#   to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
+#   --without-zlib is specified, the library is not searched at all.
+#
+#   If either the header file (zlib.h) or the library (libz) is not
+#   found, the configuration exits on error, asking for a valid zlib
+#   installation directory or --without-zlib.
+#
+#   The macro defines the symbol HAVE_LIBZ if the library is found. You
+#   should use autoheader to include a definition for this symbol in a
+#   config.h file. Sample usage in a C/C++ source is as follows:
+#
+#     #ifdef HAVE_LIBZ
+#     #include <zlib.h>
+#     #endif /* HAVE_LIBZ */
+#
+# LAST MODIFICATION
+#
+#   2004-09-20
+#
+# COPYLEFT
+#
+#   Copyright (c) 2004 Loic Dachary <loic@senga.org>
+#
+#   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 2 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, write to the Free Software
+#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+#   02111-1307, USA.
+#
+#   As a special exception, the respective Autoconf Macro's copyright
+#   owner gives unlimited permission to copy, distribute and modify the
+#   configure scripts that are the output of Autoconf when processing
+#   the Macro. You need not follow the terms of the GNU General Public
+#   License when using or distributing such scripts, even though
+#   portions of the text of the Macro appear in them. The GNU General
+#   Public License (GPL) does govern all other use of the material that
+#   constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+
+AC_DEFUN([CHECK_ZLIB], [
+AC_ARG_WITH([zlib], [AS_HELP_STRING([--with-zlib=DIR], [root directory path of zlib installation (defaults to /usr/local or /usr if not found in /usr/local), --without-zlib to disable zlib usage completely])], [], [with_zlib=yes])
+
+if test "x$with_zlib" != xno ; then
+  if test "x$with_zlib" != xyes ; then
+    ZLIB_HOME=$with_zlib
+  else
+    # default locations
+    ZLIB_HOME=/usr/local
+    if test ! -f "${ZLIB_HOME}/include/zlib.h"
+    then
+      ZLIB_HOME=/usr
+    fi
+  fi
+
+  ZLIB_OLD_LDFLAGS=$LDFLAGS
+  ZLIB_OLD_CPPFLAGS=$LDFLAGS
+  LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+  CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+  AC_LANG_PUSH([C])
+  AC_CHECK_HEADERS([zlib.h])
+  AC_CHECK_LIB([z], [inflateEnd])
+  AC_LANG_POP([C])
+
+  if test "x$ac_cv_header_zlib_h" = "xyes" -a "x$ac_cv_lib_z_inflateEnd" = "xyes" ; then
+    AC_MSG_RESULT([zlib found in $ZLIB_HOME])
+    AC_SUBST([HAVE_LIBZ], [$ac_cv_lib_z_inflateEnd])
+  else
+    LDFLAGS="$ZLIB_OLD_LDFLAGS"
+    CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
+    AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib)
+  fi
+fi])
Index: /issm/trunk/missing
===================================================================
--- /issm/trunk/missing	(revision 1)
+++ /issm/trunk/missing	(revision 1)
@@ -0,0 +1,1 @@
+link /u/wilkes-r1b/larour/Bin/automake/share/automake-1.10/missing
Index: /issm/trunk/reconfigure.sh
===================================================================
--- /issm/trunk/reconfigure.sh	(revision 1)
+++ /issm/trunk/reconfigure.sh	(revision 1)
@@ -0,0 +1,10 @@
+#!/bin/sh
+#  this shell script will automatically reconfigure the entire ISSM 
+#  archive.
+
+rm -rf config.cach
+aclocal -I m4
+autoconf
+autoheader 
+automake -a 
+exit
Index: sm/trunk/scripts/BinRead.py
===================================================================
--- /issm/trunk/scripts/BinRead.py	(revision 28275)
+++ 	(revision )
@@ -1,191 +1,0 @@
-#!/usr/bin/env python3
-import numpy as np
-from os import environ, path
-import sys
-import struct
-from argparse import ArgumentParser
-
-def BinRead(infile, outfile='', verbose=0):  #{{{
-
-    print('reading binary file')
-    f = open(infile, 'rb')
-
-    if outfile:
-        sys.stdout = open(outfile, 'w')
-
-    while True:
-        try:
-            # Step 1: Read size of record name
-            recordnamesize = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-        except struct.error as e:
-            print('probable EOF: {}'.format(e))
-            break
-
-        print('============================================================================')
-        if verbose > 2:
-            print('\n recordnamesize = {}'.format(recordnamesize))
-        recordname = struct.unpack('{}s'.format(recordnamesize), f.read(recordnamesize))[0].decode('ASCII')
-        print('field: {}'.format(recordname))
-
-        # Step 2: Read the data itself
-        # First read length of record
-        #reclen = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-        reclen = struct.unpack('q', f.read(struct.calcsize('q')))[0]
-        if verbose > 1:
-            print('reclen = {}'.format(reclen))
-
-        # Read data code
-        code = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-        print('Format = {} (code {})'.format(CodeToFormat(code), code))
-
-        if code == FormatToCode('Boolean'):
-            bval = struct.unpack('i', f.read(reclen - struct.calcsize('i')))[0]
-            print('value = {}'.format(bval))
-
-        elif code == FormatToCode('Integer'):
-            ival = struct.unpack('i', f.read(reclen - struct.calcsize('i')))[0]
-            print('value = {}'.format(ival))
-
-        elif code == FormatToCode('Double'):
-            dval = struct.unpack('d', f.read(reclen - struct.calcsize('i')))[0]
-            print('value = {}'.format(dval))
-
-        elif code == FormatToCode('String'):
-            strlen = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            if verbose > 1:
-                print('strlen = {}'.format(strlen))
-            sval = struct.unpack('{}s'.format(strlen), f.read(strlen))[0]
-            print('value = {}'.format(sval))
-
-        elif code == FormatToCode('BooleanMat'):
-            # Read matrix type
-            mattype = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            print('mattype = {}'.format(mattype))
-
-            # Read matrix
-            s = [0, 0]
-            s[0] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            s[1] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            print('size = [{}x{}]'.format(s[0], s[1]))
-            data = np.zeros((s[0], s[1]))
-            for i in range(s[0]):
-                for j in range(s[1]):
-                    data[i][j] = struct.unpack('d', f.read(struct.calcsize('d')))[0]
-                    if verbose > 2:
-                        print('data[{}, {}] = {}'.format(i, j, data[i][j]))
-
-        elif code == FormatToCode('IntMat'):
-            # Read matrix type
-            mattype = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            print('mattype = {}'.format(mattype))
-
-            # Read matrix
-            s = [0, 0]
-            s[0] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            s[1] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            print('size = [{}x{}]'.format(s[0], s[1]))
-            data = np.zeros((s[0], s[1]))
-            for i in range(s[0]):
-                for j in range(s[1]):
-                    data[i][j] = struct.unpack('d', f.read(struct.calcsize('d')))[0]
-                    if verbose > 2:
-                        print('data[{}, {}] = {}'.format(i, j, data[i][j]))
-
-        elif code == FormatToCode('DoubleMat'):
-            # Read matrix type
-            mattype = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            print('mattype = {}'.format(mattype))
-
-            # Read matrix
-            s = [0, 0]
-            s[0] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            s[1] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            print('size = [{}x{}]'.format(s[0], s[1]))
-            data = np.zeros((s[0], s[1]))
-            for i in range(s[0]):
-                for j in range(s[1]):
-                    data[i][j] = struct.unpack('d', f.read(struct.calcsize('d')))[0]
-                    if verbose > 2:
-                        print('data[{}, {}] = {}'.format(i, j, data[i][j]))
-
-        elif code == FormatToCode('MatArray'):
-            f.seek(reclen - 4, 1)
-            print('skipping {} bytes for code {}'.format(code, reclen - 4))
-        elif code == FormatToCode('StringArray'):
-            f.seek(reclen - 4, 1)
-            print('skipping {} bytes for code {}'.format(code, reclen - 4))
-
-        else:
-            raise TypeError('BinRead error message: data type: {} not supported yet! ({})'.format(code, recordname))
-
-    f.close()
-#}}}
-
-def FormatToCode(format):  # {{{
-    """This routine takes the format string and converts it into an integer, 
-    which is passed along with the record in order to identify the nature of 
-    the data being sent.
-    """
-
-    if format == 'Boolean':
-        code = 1
-    elif format == 'Integer':
-        code = 2
-    elif format == 'Double':
-        code = 3
-    elif format == 'String':
-        code = 4
-    elif format == 'BooleanMat':
-        code = 5
-    elif format == 'IntMat':
-        code = 6
-    elif format == 'DoubleMat':
-        code = 7
-    elif format == 'MatArray':
-        code = 8
-    elif format == 'StringArray':
-        code = 9
-    else:
-        raise IOError('FormatToCode error message: data type not supported yet!')
-
-    return code
-# }}}
-
-def CodeToFormat(code):  # {{{
-    """This routine takes a datatype code and converts it to the corresponding 
-    string in order to identify the nature of the data retrieved.
-    """
-
-    if code == 1:
-        format = 'Boolean'
-    elif code == 2:
-        format = 'Integer'
-    elif code == 3:
-        format = 'Double'
-    elif code == 4:
-        format = 'String'
-    elif code == 5:
-        format = 'BooleanMat'
-    elif code == 6:
-        format = 'IntMat'
-    elif code == 7:
-        format = 'DoubleMat'
-    elif code == 8:
-        format = 'MatArray'
-    elif code == 9:
-        format = 'StringArray'
-    else:
-        raise TypeError('FormatToCode error message: code {} not supported yet!'.format(code))
-
-    return format
-# }}}
-
-if __name__ == '__main__':  #{{{
-    parser = ArgumentParser(description='BinRead - function to read binary input file.')
-    parser.add_argument('-f', '--infile', help='name of binary input file', default='')
-    parser.add_argument('-o', '--outfile', help='optional name of text output file', default='')
-    parser.add_argument('-v', '--verbose', help='optional level of output', default=0)
-    args = parser.parse_args()
-
-    BinRead(args.infile, args.outfile, args.verbose)
-#}}}
Index: sm/trunk/scripts/ConvertAllNetcdfArchivesToArch.m
===================================================================
--- /issm/trunk/scripts/ConvertAllNetcdfArchivesToArch.m	(revision 28275)
+++ 	(revision )
@@ -1,20 +1,0 @@
-root=pwd;
-cd('../test/Archives/');
-ncdir=pwd;
-cd(root);
-
-file_regexp=strcat(ncdir,'/*.nc');
-flist=dir(file_regexp);
-fnames={flist.name}';
-
-pattern='.nc';
-replacement='.arch';
-for i=1:numel(fnames)
-	% Remove the extension '.nc' and replace with '.arch'
-	arch_file_name=regexprep(fnames{i},pattern,replacement);
-	disp(['Converting ' fnames{i} ' to .arch format']);
-	% Reconstruct file path
-	fpath=strcat(ncdir,'/',fnames{i});
-	archpath=strcat(ncdir,'/',arch_file_name);
-	netcdf2arch(fpath,archpath);
-end
Index: sm/trunk/scripts/DownloadExamplesDatasets.sh
===================================================================
--- /issm/trunk/scripts/DownloadExamplesDatasets.sh	(revision 28275)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#!/bin/bash
-################################################################################
-# This script downloads all datasets needed for running the ISSM tutorials.
-#
-# The default behavior is to download datasets to the examples/Data directory 
-# relative to this script. An alternate output directory can be designated by 
-# supplying a command line argument.
-#
-# NOTE:
-# - This script does not clobber existing files, intentionally. To download and 
-#	unzip new copies, first remove existing files manually.
-################################################################################
-
-## Constants
-#
-DATASETS_URL="https://issm.jpl.nasa.gov/documentation/tutorials/datasets"
-DIRECTORY_PREFIX=$(cd $(dirname "$0"); pwd)"/../examples/Data" # Default behavior is to download datasets to examples/Data directory relative to this script
-
-if [ $# -gt 0 ]; then
-	DIRECTORY_PREFIX=$1
-
-	if [ ! -d "${DIRECTORY_PREFIX}" ]; then
-		mkdir -p "${DIRECTORY_PREFIX}"
-	fi
-fi
-
-# Get content of page that hosts datasets, reduce to just datasets list, then
-# parse out dataset links
-#
-# NOTE: Clear DYLD_LIBRARY_PATH in case we have installed our own copy of cURL
-#		and $ISSM_DIR/etc/environment.sh has been sourced as there may be a
-#		conflict between versions of cURL executable and libcurl
-#
-dataset_urls=$(\
-	DYLD_LIBRARY_PATH=""; \
-	curl -Ls ${DATASETS_URL} |\
-	sed '/<!--DATASETS LIST START-->/,/<!--DATASETS LIST END-->/ !d' |\
-	sed -n 's/.*<li><a href="\([^"]*\)">.*/\1/p'
-)
-
-# Get datasets
-#
-echo "Downloading examples datasets..."
-wget --quiet --no-clobber --directory-prefix="${DIRECTORY_PREFIX}" -i - <<< "${dataset_urls}"
-
-# Expand zip files
-unzip -n -d "${DIRECTORY_PREFIX}" "${DIRECTORY_PREFIX}/*.zip"
Index: sm/trunk/scripts/DownloadExternalPackage.py
===================================================================
--- /issm/trunk/scripts/DownloadExternalPackage.py	(revision 28275)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#!/usr/bin/env python
-# -*- coding: ISO-8859-1 -*-
-
-import os
-import sys
-import urllib
-
-#Check inputs
-if(len(sys.argv) != 3):
-    raise NameError('usage: . / DownloadExternalPackage.py URL localfile')
-
-url = sys.argv[1]
-localFile = sys.argv[2]
-
-#Remove file if it already exists
-if os.path.exists(localFile):
-    print("File " + localFile + " already exists and will not be downloaded...")
-    sys.exit()
-
-#Try to download from url
-httpfail = -1
-try:
-    print("Fetching %s" % localFile)
-    urllib.request(url, localFile)
-    httpfail = 0
-except urllib.error.URLError as e:
-    failureMessage = '''
-   ===========================================================================
-    Unable to download package {} from: {} due to {}
-    * If URL specified manually - perhaps there is a typo?
-    * If your network is disconnected - please reconnect
-    * Alternatively, you can download the above URL manually
-   ===========================================================================
-    '''.format(localFile, url, e)
-    print(failureMessage)
Index: sm/trunk/scripts/DownloadExternalPackage.sh
===================================================================
--- /issm/trunk/scripts/DownloadExternalPackage.sh	(revision 28275)
+++ 	(revision )
@@ -1,66 +1,0 @@
-#!/bin/bash
-#
-# DownloadExternalPackage.bash
-# Generally, used to download a hosted file from a URL
-# URL - Location of file to download
-# file - File to write to (including path)
-# usage: download_external_package.bash URL file
-
-## Constants
-#
-MSG_ERR_NO_GET_CMD="No supported file download command was found"
-MSG_USAGE="usage: $(basename ${0}) [-h] URL file
-  URL  : Location of file to download
-  file : File to write to (including path)"
-
-## Variables
-#
-OUT_FILE=""
-URL=""
-
-## Check that number of args is 2 (note that this also handles case where user
-#	explicitly requests help)
-#
-if [ $# != 2 ]
-then
-	echo "$MSG_USAGE"
-	exit 0
-fi
-
-## Retrieve args
-#
-URL=$1
-OUT_FILE=$2
-
-## Check if OUT_FILE already exists
-#
-if [ -f ${OUT_FILE} ]
-then
-	echo "File ${OUT_FILE} already exists and will not be downloaded..."
-	exit 0
-fi
-
-## Download file
-#
-if [ ! -z `which curl` ]; then
-	curl --silent $URL -o $OUT_FILE
-
-	# Try wget if curl exists but fails
-	if [ $? -ne 0 ]; then
-		if [ ! -z `which wget` ]; then
-			wget --quiet -O $OUT_FILE $URL
-
-			if [ $? -ne 0 ]; then
-				echo "Error: both curl and wget failed. To debug, download package manually using curl without '--silent' option and/or wget without '--quiet' option."
-				exit 0
-			fi
-		else
-			echo $MSG_ERR_NO_GET_CMD
-			exit 0
-		fi
-	fi
-elif [ ! -z `which wget` ]; then
-	wget --quiet -O $OUT_FILE $URL
-else
-	echo $MSG_ERR_NO_GET_CMD
-fi
Index: sm/trunk/scripts/GenerateReferences.sh
===================================================================
--- /issm/trunk/scripts/GenerateReferences.sh	(revision 28275)
+++ 	(revision )
@@ -1,38 +1,0 @@
-#!/bin/bash
-#Generate a RTF file with references provided in CITE
-#Use AGU bibliography style and delete labels for easy copy/paste
-#Version: 04/28/11
-
-#Genetare a pdf with the list of references provided in $CITE
-CITE="Joughin2009,Rignot2002,Frey2001"
-
-#First erase files; 
-rm -rf references.rtf
-
-#create Latex file
-cat <<END > references.tex
-\documentclass{article}
-\bibliographystyle{agu}
-\begin{document}
-\nocite{$CITE}
-\bibliography{$JPL_SVN/publications/bibtex/references}
-\end{document}
-END
-#Generate pdf
-echo "Compiling document"
-latex  -interaction=batchmode -file-line-error references.tex > /dev/null
-echo "Running Bibtex"
-bibtex references
-echo "Removing labels"
-cat references.bbl | sed -e "s-ibitem.*\]-DELETE-" | grep -v DELETE > references.bak1 #delete labels that hold in one line
-cat references.bak1 | sed -e "/ibitem/,/]/d" > references.bak2                        #delete labels that are on multiple lines
-mv references.bak2 references.bbl
-echo "Converting to rtf"
-$ISSM_DIR/externalpackages/latex2rtf/install/latex2rtf -P $ISSM_DIR/externalpackages/latex2rtf/install/cfg/ references
-
-#Remove all but rtf file
-rm -rf references.[!rtf]*
-rm -rf references.tex
-
-#open output
-#open references.rtf
Index: sm/trunk/scripts/OutbinRead.py
===================================================================
--- /issm/trunk/scripts/OutbinRead.py	(revision 28275)
+++ 	(revision )
@@ -1,142 +1,0 @@
-#!/usr/bin/env python
-import numpy as np
-from os import environ, path
-import sys
-import struct
-from argparse import ArgumentParser
-
-def OutbinRead(filin, filout='', verbose=0):  #{{{
-
-    yts  = 365*24*3600.
-
-    print("reading binary file.")
-    f = open(filin, 'rb')
-
-    if filout:
-        sys.stdout = open(filout, 'w')
-
-    while True:
-        try:
-            #Step 1: read size of record name
-            recordnamesize = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-        except struct.error as e:
-            print("probable EOF: {}".format(e))
-            break
-
-        print("============================================================================ ")
-        if verbose > 2:
-            print("\n recordnamesize = {}".format(recordnamesize))
-        recordname = struct.unpack('{}s'.format(recordnamesize), f.read(recordnamesize))[0]
-        print("field: {}".format(recordname))
-
-        #read time and step
-        time = struct.unpack('d', f.read(struct.calcsize('d')))[0]
-        step = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-        if time!=-9999.: time = time/yts
-        print("time = {} step = {}".format(time,step))
-
-        #read data code:
-        code = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-        print("Format = {} (code {})".format(CodeToFormat(code), code))
-
-		  #read size:
-        M = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-        N = 1 #default
-
-        #Step 2: read the data itself.
-        if code == FormatToCode('Double'):
-            dval = struct.unpack('d', f.read(struct.calcsize('d')))[0]
-            print("value = {}".format(dval))
-
-        elif code == FormatToCode('String'):
-            strlen = M
-            if verbose > 1:
-                print("strlen = {}".format(strlen))
-            sval = struct.unpack('{}s'.format(strlen), f.read(strlen))[0]
-            print("value = '{}'".format(sval))
-
-        elif code == FormatToCode('IntMat'):
-            s = [0, 0]
-            s[0] = M
-            s[1] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            print("size = [{}x{}]".format(s[0], s[1]))
-            data = np.zeros((s[0], s[1]))
-            for i in range(s[0]):
-                for j in range(s[1]):
-                    data[i][j] = struct.unpack('d', f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
-                    if verbose > 2:
-                        print("data[{}, {}] = {}".format(i, j, data[i][j]))
-
-        elif code == FormatToCode('DoubleMat'):
-            #now read matrix
-            s = [0, 0]
-            s[0] = M
-            s[1] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
-            print("size = [{}x{}]".format(s[0], s[1]))
-            if True:
-               f.read(struct.calcsize('d')*s[0]*s[1])
-            else:
-					data = np.zeros((s[0], s[1]))
-					for i in range(s[0]):
-						 for j in range(s[1]):
-							  data[i][j] = struct.unpack('d', f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
-							  if verbose > 2:
-									print("data[{}, {}] = {}".format(i, j, data[i][j]))
-
-        else:
-            raise TypeError('OutbinRead error message: data type: {} not supported yet! ({})'.format(code, recordname))
-
-    f.close()
-#}}}
-
-def FormatToCode(format):  # {{{
-    """
-    This routine takes the format string, and hardcodes it into an integer, which
-    is passed along the record, in order to identify the nature of the dataset being
-    sent.
-    """
-
-    if format == 'Double':
-        code = 1
-    elif format == 'String':
-        code = 2
-    elif format == 'DoubleMat':
-        code = 3
-    elif format == 'IntMat':
-        code = 4
-    else:
-        raise IOError('FormatToCode error message: data type not supported yet!')
-
-    return code
-# }}}
-
-def CodeToFormat(code):  # {{{
-    """
-    This routine takes the format string, and hardcodes it into an integer, which
-    is passed along the record, in order to identify the nature of the dataset being
-    sent.
-    """
-
-    if code == 1:
-        format = 'Double'
-    elif code == 2:
-        format = 'String'
-    elif code == 3:
-        format = 'DoubleMat'
-    elif code == 4:
-		 format = 'IntMat'
-    else:
-        raise TypeError('FormatToCode error message: code {} not supported yet!'.format(code))
-
-    return format
-# }}}
-
-if __name__ == '__main__':  #{{{
-    parser = ArgumentParser(description='OutbinRead - function to read binary input file.')
-    parser.add_argument('-f', '--filin', help='name of binary input file', default='')
-    parser.add_argument('-o', '--filout', help='optional name of text output file', default='')
-    parser.add_argument('-v', '--verbose', help='optional level of output', default=0)
-    args = parser.parse_args()
-
-    OutbinRead(args.filin, args.filout, args.verbose)
-#}}}
Index: /issm/trunk/scripts/archive.sh
===================================================================
--- /issm/trunk/scripts/archive.sh	(revision 1)
+++ /issm/trunk/scripts/archive.sh	(revision 1)
@@ -0,0 +1,30 @@
+#!/bin/bash
+#This bash routine  will create a tar file for the ISSM
+#code. Just run the following command: 
+
+#> source  ./archive.sh
+
+
+#Some local script functions 
+function today_date {
+suffix=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'` 
+echo $suffix;
+}
+
+#Main 
+
+#Cleanup code 
+cd $ISSM_DIR
+make -f MakefileIce clean
+make clean
+make distclean
+
+#Get rid of packages
+rm packages
+
+cd $ISSM_DIR/..
+
+#Create tar file, with today's date in the title;
+today=`today_date`
+
+tar zcvf issm-1.0-$today.tar.gz  `basename $ISSM_DIR`
Index: sm/trunk/scripts/automakererun.sh
===================================================================
--- /issm/trunk/scripts/automakererun.sh	(revision 28275)
+++ 	(revision )
@@ -1,13 +1,0 @@
-#!/bin/sh
-#
-# automakererun.sh
-# Remakes GNU Build System files.
-#
-# Currently, a wrapper for Autotools' autoreconf script.
-#
-# Run,
-#	autoreconf --help
-# for more information.
-
-cd $ISSM_DIR
-autoreconf -ivf
Index: sm/trunk/scripts/cloc
===================================================================
--- /issm/trunk/scripts/cloc	(revision 28275)
+++ 	(revision )
@@ -1,11676 +1,0 @@
-#!/usr/bin/env perl
-# cloc -- Count Lines of Code                  {{{1
-# Copyright (C) 2006-2017 Al Danial <al.danial@gmail.com>
-# First release August 2006
-#
-# Includes code from:
-#   - SLOCCount v2.26
-#     http://www.dwheeler.com/sloccount/
-#     by David Wheeler.
-#   - Regexp::Common v2013031301
-#     http://search.cpan.org/~abigail/Regexp-Common-2013031301/lib/Regexp/Common.pm
-#     by Damian Conway and Abigail.
-#   - Win32::Autoglob
-#     http://search.cpan.org/~sburke/Win32-Autoglob-1.01/Autoglob.pm
-#     by Sean M. Burke.
-#   - Algorithm::Diff
-#     http://search.cpan.org/~tyemq/Algorithm-Diff-1.1902/lib/Algorithm/Diff.pm
-#     by Tye McQueen.
-#
-# 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 2 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:
-# <http://www.gnu.org/licenses/gpl.txt>.
-#
-# 1}}}
-my $VERSION = "1.72";  # odd number == beta; even number == stable
-my $URL     = "github.com/AlDanial/cloc";  # 'https://' pushes header too wide
-require 5.006;
-# use modules                                  {{{1
-use warnings;
-use strict;
-use Getopt::Long;
-use File::Basename;
-use File::Temp qw { tempfile tempdir };
-use File::Find;
-use File::Path;
-use File::Spec;
-use IO::File;
-use POSIX "strftime";
-
-# Digest::MD5 isn't in the standard distribution. Use it only if installed.
-my $HAVE_Digest_MD5 = 0;
-eval "use Digest::MD5;";
-if (defined $Digest::MD5::VERSION) {
-    $HAVE_Digest_MD5 = 1;
-} else {
-    warn "Digest::MD5 not installed; will skip file uniqueness checks.\n";
-}
-
-# Time::HiRes became standard with Perl 5.8
-my $HAVE_Time_HiRes = 0;
-eval "use Time::HiRes;";
-$HAVE_Time_HiRes = 1 if defined $Time::HiRes::VERSION;
-
-my $HAVE_Rexexp_Common;
-# Regexp::Common isn't in the standard distribution.  It will
-# be installed in a temp directory if necessary.
-BEGIN {
-    if (eval "use Regexp::Common;") {
-        $HAVE_Rexexp_Common = 1;
-    } else {
-        $HAVE_Rexexp_Common = 0;
-    }
-}
-
-my $HAVE_Algorith_Diff = 0;
-# Algorithm::Diff isn't in the standard distribution.  It will
-# be installed in a temp directory if necessary.
-eval "use Algorithm::Diff qw ( sdiff ) ";
-if (defined $Algorithm::Diff::VERSION) {
-    $HAVE_Algorith_Diff = 1;
-} else {
-    Install_Algorithm_Diff();
-}
-# print "2 HAVE_Algorith_Diff = $HAVE_Algorith_Diff\n";
-# test_alg_diff($ARGV[$#ARGV - 1], $ARGV[$#ARGV]); die;
-# die "Hre=$HAVE_Rexexp_Common  Had=$HAVE_Algorith_Diff";
-
-# Uncomment next two lines when building Windows executable with perl2exe
-# or if running on a system that already has Regexp::Common.
-#use Regexp::Common;
-#$HAVE_Rexexp_Common = 1;
-
-#perl2exe_include "Regexp/Common/whitespace.pm"
-#perl2exe_include "Regexp/Common/URI.pm"
-#perl2exe_include "Regexp/Common/URI/fax.pm"
-#perl2exe_include "Regexp/Common/URI/file.pm"
-#perl2exe_include "Regexp/Common/URI/ftp.pm"
-#perl2exe_include "Regexp/Common/URI/gopher.pm"
-#perl2exe_include "Regexp/Common/URI/http.pm"
-#perl2exe_include "Regexp/Common/URI/pop.pm"
-#perl2exe_include "Regexp/Common/URI/prospero.pm"
-#perl2exe_include "Regexp/Common/URI/news.pm"
-#perl2exe_include "Regexp/Common/URI/tel.pm"
-#perl2exe_include "Regexp/Common/URI/telnet.pm"
-#perl2exe_include "Regexp/Common/URI/tv.pm"
-#perl2exe_include "Regexp/Common/URI/wais.pm"
-#perl2exe_include "Regexp/Common/CC.pm"
-#perl2exe_include "Regexp/Common/SEN.pm"
-#perl2exe_include "Regexp/Common/number.pm"
-#perl2exe_include "Regexp/Common/delimited.pm"
-#perl2exe_include "Regexp/Common/profanity.pm"
-#perl2exe_include "Regexp/Common/net.pm"
-#perl2exe_include "Regexp/Common/zip.pm"
-#perl2exe_include "Regexp/Common/comment.pm"
-#perl2exe_include "Regexp/Common/balanced.pm"
-#perl2exe_include "Regexp/Common/lingua.pm"
-#perl2exe_include "Regexp/Common/list.pm"
-#perl2exe_include "File/Glob.pm"
-
-use Text::Tabs qw { expand };
-use Cwd qw { cwd };
-use File::Glob;
-# 1}}}
-# Usage information, options processing.       {{{1
-my $ON_WINDOWS = 0;
-   $ON_WINDOWS = 1 if ($^O =~ /^MSWin/) or ($^O eq "Windows_NT");
-if ($ON_WINDOWS and $ENV{'SHELL'}) {
-    if ($ENV{'SHELL'} =~ m{^/}) {
-        $ON_WINDOWS = 0;  # make Cygwin look like Unix
-    } else {
-        $ON_WINDOWS = 1;  # MKS defines $SHELL but still acts like Windows
-    }
-}
-
-my $NN     = chr(27) . "[0m";  # normal
-   $NN     = "" if $ON_WINDOWS or !(-t STDERR); # -t STDERR:  is it a terminal?
-my $BB     = chr(27) . "[1m";  # bold
-   $BB     = "" if $ON_WINDOWS or !(-t STDERR);
-my $script = basename $0;
-my $brief_usage  = "
-                       cloc -- Count Lines of Code
-
-Usage:
-    $script [options] <file(s)/dir(s)>
-        Count physical lines of source code and comments in the given files
-        (may be archives such as compressed tarballs or zip files) and/or
-        recursively below the given directories.
-        Example:    cloc src/ include/ main.c
-
-    $script [options] --diff <set1>  <set2>
-        Compute differences of physical lines of source code and comments
-        between a pair of directories or archive files.
-        Example:    cloc --diff Python-3.5.tar.xz python-3.6/
-
-$script --help  shows full documentation on the options.
-http://$URL has numerous examples and more information.
-";
-my $usage  = "
-Usage: $script [options] <file(s)/dir(s)> | <set 1> <set 2> | <report files>
-
- Count, or compute differences of, physical lines of source code in the
- given files (may be archives such as compressed tarballs or zip files)
- and/or recursively below the given directories.
-
- ${BB}Input Options${NN}
-   --extract-with=<cmd>      This option is only needed if cloc is unable
-                             to figure out how to extract the contents of
-                             the input file(s) by itself.
-                             Use <cmd> to extract binary archive files (e.g.:
-                             .tar.gz, .zip, .Z).  Use the literal '>FILE<' as
-                             a stand-in for the actual file(s) to be
-                             extracted.  For example, to count lines of code
-                             in the input files
-                                gcc-4.2.tar.gz  perl-5.8.8.tar.gz
-                             on Unix use
-                               --extract-with='gzip -dc >FILE< | tar xf -'
-                             or, if you have GNU tar,
-                               --extract-with='tar zxf >FILE<'
-                             and on Windows use, for example:
-                               --extract-with=\"\\\"c:\\Program Files\\WinZip\\WinZip32.exe\\\" -e -o >FILE< .\"
-                             (if WinZip is installed there).
-   --list-file=<file>        Take the list of file and/or directory names to
-                             process from <file>, which has one file/directory
-                             name per line.  Only exact matches are counted;
-                             relative path names will be resolved starting from
-                             the directory where cloc is invoked.
-                             See also --exclude-list-file.
-   --vcs=<VCS>               Invoke a system call to <VCS> to obtain a list of
-                             files to work on.  If <VCS> is 'git', then will
-                             invoke 'git ls-files' to get a file list and
-                             'git submodule status' to get a list of submodules
-                             whose contents will be ignored.  If <VCS> is 'svn'
-                             then will invoke 'svn list -R'.  The primary benefit
-                             is that cloc will then skip files explicitly
-                             excluded by the versioning tool in question,
-                             ie, those in .gitignore or have the svn:ignore
-                             property.
-                             Alternatively <VCS> may be any system command
-                             that generates a list of files.
-                             Note:  cloc must be in a directory which can read
-                             the files as they are returned by <VCS>.  cloc will
-                             not download files from remote repositories.
-                             'svn list -R' may refer to a remote repository
-                             to obtain file names (and therefore may require
-                             authentication to the remote repository), but
-                             the files themselves must be local.
-   --unicode                 Check binary files to see if they contain Unicode
-                             expanded ASCII text.  This causes performance to
-                             drop noticeably.
-
- ${BB}Processing Options${NN}
-   --autoconf                Count .in files (as processed by GNU autoconf) of
-                             recognized languages.
-   --by-file                 Report results for every source file encountered.
-   --by-file-by-lang         Report results for every source file encountered
-                             in addition to reporting by language.
-   --count-and-diff <set1> <set2>
-                             First perform direct code counts of source file(s)
-                             of <set1> and <set2> separately, then perform a diff
-                             of these.  Inputs may be pairs of files, directories,
-                             or archives.  See also --diff, --diff-alignment,
-                             --diff-timeout, --ignore-case, --ignore-whitespace.
-   --diff <set1> <set2>      Compute differences in code and comments between
-                             source file(s) of <set1> and <set2>.  The inputs
-                             may be pairs of files, directories, or archives.
-                             Use --diff-alignment to generate a list showing
-                             which file pairs where compared.  See also
-                             --count-and-diff, --diff-alignment, --diff-timeout,
-                             --ignore-case, --ignore-whitespace.
-   --diff-timeout <N>        Ignore files which take more than <N> seconds
-                             to process.  Default is 10 seconds.
-                             (Large files with many repeated lines can cause
-                             Algorithm::Diff::sdiff() to take hours.)
-   --follow-links            [Unix only] Follow symbolic links to directories
-                             (sym links to files are always followed).
-   --force-lang=<lang>[,<ext>]
-                             Process all files that have a <ext> extension
-                             with the counter for language <lang>.  For
-                             example, to count all .f files with the
-                             Fortran 90 counter (which expects files to
-                             end with .f90) instead of the default Fortran 77
-                             counter, use
-                               --force-lang=\"Fortran 90\",f
-                             If <ext> is omitted, every file will be counted
-                             with the <lang> counter.  This option can be
-                             specified multiple times (but that is only
-                             useful when <ext> is given each time).
-                             See also --script-lang, --lang-no-ext.
-   --force-lang-def=<file>   Load language processing filters from <file>,
-                             then use these filters instead of the built-in
-                             filters.  Note:  languages which map to the same
-                             file extension (for example:
-                             MATLAB/Mathematica/Objective C/MUMPS/Mercury;
-                             Pascal/PHP; Lisp/OpenCL; Lisp/Julia; Perl/Prolog)
-                             will be ignored as these require additional
-                             processing that is not expressed in language
-                             definition files.  Use --read-lang-def to define
-                             new language filters without replacing built-in
-                             filters (see also --write-lang-def).
-   --ignore-whitespace       Ignore horizontal white space when comparing files
-                             with --diff.  See also --ignore-case.
-   --ignore-case             Ignore changes in case; consider upper- and lower-
-                             case letters equivalent when comparing files with
-                             --diff.  See also --ignore-whitespace.
-   --lang-no-ext=<lang>      Count files without extensions using the <lang>
-                             counter.  This option overrides internal logic
-                             for files without extensions (where such files
-                             are checked against known scripting languages
-                             by examining the first line for #!).  See also
-                             --force-lang, --script-lang.
-   --max-file-size=<MB>      Skip files larger than <MB> megabytes when
-                             traversing directories.  By default, <MB>=100.
-                             cloc's memory requirement is roughly twenty times
-                             larger than the largest file so running with
-                             files larger than 100 MB on a computer with less
-                             than 2 GB of memory will cause problems.
-                             Note:  this check does not apply to files
-                             explicitly passed as command line arguments.
-   --original-dir            [Only effective in combination with
-                             --strip-comments]  Write the stripped files
-                             to the same directory as the original files.
-   --read-binary-files       Process binary files in addition to text files.
-                             This is usually a bad idea and should only be
-                             attempted with text files that have embedded
-                             binary data.
-   --read-lang-def=<file>    Load new language processing filters from <file>
-                             and merge them with those already known to cloc.
-                             If <file> defines a language cloc already knows
-                             about, cloc's definition will take precedence.
-                             Use --force-lang-def to over-ride cloc's
-                             definitions (see also --write-lang-def ).
-   --script-lang=<lang>,<s>  Process all files that invoke <s> as a #!
-                             scripting language with the counter for language
-                             <lang>.  For example, files that begin with
-                                #!/usr/local/bin/perl5.8.8
-                             will be counted with the Perl counter by using
-                                --script-lang=Perl,perl5.8.8
-                             The language name is case insensitive but the
-                             name of the script language executable, <s>,
-                             must have the right case.  This option can be
-                             specified multiple times.  See also --force-lang,
-                             --lang-no-ext.
-   --sdir=<dir>              Use <dir> as the scratch directory instead of
-                             letting File::Temp chose the location.  Files
-                             written to this location are not removed at
-                             the end of the run (as they are with File::Temp).
-   --skip-uniqueness         Skip the file uniqueness check.  This will give
-                             a performance boost at the expense of counting
-                             files with identical contents multiple times
-                             (if such duplicates exist).
-   --stdin-name=<file>       Give a file name to use to determine the language
-                             for standard input.  (Use - as the input name to
-                             receive source code via STDIN.)
-   --strip-comments=<ext>    For each file processed, write to the current
-                             directory a version of the file which has blank
-                             lines and comments removed.  The name of each
-                             stripped file is the original file name with
-                             .<ext> appended to it.  It is written to the
-                             current directory unless --original-dir is on.
-   --sum-reports             Input arguments are report files previously
-                             created with the --report-file option.  Makes
-                             a cumulative set of results containing the
-                             sum of data from the individual report files.
-   --unix                    Override the operating system autodetection
-                             logic and run in UNIX mode.  See also
-                             --windows, --show-os.
-   --use-sloccount           If SLOCCount is installed, use its compiled
-                             executables c_count, java_count, pascal_count,
-                             php_count, and xml_count instead of cloc's
-                             counters.  SLOCCount's compiled counters are
-                             substantially faster than cloc's and may give
-                             a performance improvement when counting projects
-                             with large files.  However, these cloc-specific
-                             features will not be available: --diff,
-                             --count-and-diff, --strip-comments, --unicode.
-   --windows                 Override the operating system autodetection
-                             logic and run in Microsoft Windows mode.
-                             See also --unix, --show-os.
-
- ${BB}Filter Options${NN}
-   --exclude-dir=<D1>[,D2,]  Exclude the given comma separated directories
-                             D1, D2, D3, et cetera, from being scanned.  For
-                             example  --exclude-dir=.cache,test  will skip
-                             all files and subdirectories that have /.cache/
-                             or /test/ as their parent directory.
-                             Directories named .bzr, .cvs, .hg, .git, and
-                             .svn are always excluded.
-                             This option only works with individual directory
-                             names so including file path separators is not
-                             allowed.  Use --fullpath and --not-match-d=<regex>
-                             to supply a regex matching multiple subdirectories.
-   --exclude-ext=<ext1>[,<ext2>[...]]
-                             Do not count files having the given file name
-                             extensions.
-   --exclude-lang=<L1>[,L2,] Exclude the given comma separated languages
-                             L1, L2, L3, et cetera, from being counted.
-   --exclude-list-file=<file>  Ignore files and/or directories whose names
-                             appear in <file>.  <file> should have one file
-                             name per line.  Only exact matches are ignored;
-                             relative path names will be resolved starting from
-                             the directory where cloc is invoked.
-                             See also --list-file.
-   --fullpath                Modifies the behavior of --match-f, --not-match-f,
-                             and --not-match-d to include the file's path
-                             in the regex, not just the file's basename.
-                             (This does not expand each file to include its
-                             absolute path, instead it uses as much of
-                             the path as is passed in to cloc.)
-                             Note:  --match-d always looks at the full
-                             path and therefore is unaffected by --fullpath.
-   --include-lang=<L1>[,L2,] Count only the given comma separated languages
-                             L1, L2, L3, et cetera.
-   --match-d=<regex>         Only count files in directories matching the Perl
-                             regex.  For example
-                               --match-d='/(src|include)/'
-                             only counts files in directories containing
-                             /src/ or /include/.  Unlike --not-match-d,
-                             --match-f, and --not-match-f, --match-d always
-                             compares the fully qualified path against the regex.
-   --not-match-d=<regex>     Count all files except those in directories
-                             matching the Perl regex.  Only the trailing
-                             directory name is compared, for example, when
-                             counting in /usr/local/lib, only 'lib' is
-                             compared to the regex.
-                             Add --fullpath to compare parent directories to
-                             the regex.
-                             Do not include file path separators at the beginning
-                             or end of the regex.
-   --match-f=<regex>         Only count files whose basenames match the Perl
-                             regex.  For example
-                               --match-f='^[Ww]idget'
-                             only counts files that start with Widget or widget.
-                             Add --fullpath to include parent directories
-                             in the regex instead of just the basename.
-   --not-match-f=<regex>     Count all files except those whose basenames
-                             match the Perl regex.  Add --fullpath to include
-                             parent directories in the regex instead of just
-                             the basename.
-   --skip-archive=<regex>    Ignore files that end with the given Perl regular
-                             expression.  For example, if given
-                               --skip-archive='(zip|tar(\.(gz|Z|bz2|xz|7z))?)'
-                             the code will skip files that end with .zip,
-                             .tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, and
-                             .tar.7z.
-   --skip-win-hidden         On Windows, ignore hidden files.
-
- ${BB}Debug Options${NN}
-   --categorized=<file>      Save names of categorized files to <file>.
-   --counted=<file>          Save names of processed source files to <file>.
-   --diff-alignment=<file>   Write to <file> a list of files and file pairs
-                             showing which files were added, removed, and/or
-                             compared during a run with --diff.  This switch
-                             forces the --diff mode on.
-   --explain=<lang>          Print the filters used to remove comments for
-                             language <lang> and exit.  In some cases the
-                             filters refer to Perl subroutines rather than
-                             regular expressions.  An examination of the
-                             source code may be needed for further explanation.
-   --help                    Print this usage information and exit.
-   --found=<file>            Save names of every file found to <file>.
-   --ignored=<file>          Save names of ignored files and the reason they
-                             were ignored to <file>.
-   --print-filter-stages     Print processed source code before and after
-                             each filter is applied.
-   --show-ext[=<ext>]        Print information about all known (or just the
-                             given) file extensions and exit.
-   --show-lang[=<lang>]      Print information about all known (or just the
-                             given) languages and exit.
-   --show-os                 Print the value of the operating system mode
-                             and exit.  See also --unix, --windows.
-   -v[=<n>]                  Verbose switch (optional numeric value).
-   -verbose[=<n>]            Long form of -v.
-   --version                 Print the version of this program and exit.
-   --write-lang-def=<file>   Writes to <file> the language processing filters
-                             then exits.  Useful as a first step to creating
-                             custom language definitions (see also
-                             --force-lang-def, --read-lang-def).
-
- ${BB}Output Options${NN}
-   --3                       Print third-generation language output.
-                             (This option can cause report summation to fail
-                             if some reports were produced with this option
-                             while others were produced without it.)
-   --by-percent  X           Instead of comment and blank line counts, show
-                             these values as percentages based on the value
-                             of X in the denominator:
-                                X = 'c'   -> # lines of code
-                                X = 'cm'  -> # lines of code + comments
-                                X = 'cb'  -> # lines of code + blanks
-                                X = 'cmb' -> # lines of code + comments + blanks
-                             For example, if using method 'c' and your code
-                             has twice as many lines of comments as lines
-                             of code, the value in the comment column will
-                             be 200%.  The code column remains a line count.
-   --csv                     Write the results as comma separated values.
-   --csv-delimiter=<C>       Use the character <C> as the delimiter for comma
-                             separated files instead of ,.  This switch forces
-   --json                    Write the results as JavaScript Object Notation
-                             (JSON) formatted output.
-   --md                      Write the results as Markdown-formatted text.
-   --out=<file>              Synonym for --report-file=<file>.
-   --progress-rate=<n>       Show progress update after every <n> files are
-                             processed (default <n>=100).  Set <n> to 0 to
-                             suppress progress output (useful when redirecting
-                             output to STDOUT).
-   --quiet                   Suppress all information messages except for
-                             the final report.
-   --report-file=<file>      Write the results to <file> instead of STDOUT.
-   --sql=<file>              Write results as SQL create and insert statements
-                             which can be read by a database program such as
-                             SQLite.  If <file> is -, output is sent to STDOUT.
-   --sql-append              Append SQL insert statements to the file specified
-                             by --sql and do not generate table creation
-                             statements.  Only valid with the --sql option.
-   --sql-project=<name>      Use <name> as the project identifier for the
-                             current run.  Only valid with the --sql option.
-   --sql-style=<style>       Write SQL statements in the given style instead
-                             of the default SQLite format.  Currently, the
-                             only style option is Oracle.
-   --sum-one                 For plain text reports, show the SUM: output line
-                             even if only one input file is processed.
-   --xml                     Write the results in XML.
-   --xsl=<file>              Reference <file> as an XSL stylesheet within
-                             the XML output.  If <file> is 1 (numeric one),
-                             writes a default stylesheet, cloc.xsl (or
-                             cloc-diff.xsl if --diff is also given).
-                             This switch forces --xml on.
-   --yaml                    Write the results in YAML.
-
-";
-#  Help information for options not yet implemented:
-#  --inline                  Process comments that appear at the end
-#                            of lines containing code.
-#  --html                    Create HTML files of each input file showing
-#                            comment and code lines in different colors.
-
-$| = 1;  # flush STDOUT
-my $start_time = get_time();
-my (
-    $opt_categorized          ,
-    $opt_found                ,
-    @opt_force_lang           ,
-    $opt_lang_no_ext          ,
-    @opt_script_lang          ,
-    $opt_count_diff           ,
-    $opt_diff                 ,
-    $opt_diff_alignment       ,
-    $opt_diff_timeout         ,
-    $opt_html                 ,
-    $opt_ignored              ,
-    $opt_counted              ,
-    $opt_show_ext             ,
-    $opt_show_lang            ,
-    $opt_progress_rate        ,
-    $opt_print_filter_stages  ,
-    $opt_v                    ,
-    $opt_vcs                  ,
-    $opt_version              ,
-    $opt_exclude_lang         ,
-    $opt_exclude_list_file    ,
-    $opt_exclude_dir          ,
-    $opt_explain              ,
-    $opt_include_lang         ,
-    $opt_force_lang_def       ,
-    $opt_read_lang_def        ,
-    $opt_write_lang_def       ,
-    $opt_strip_comments       ,
-    $opt_original_dir         ,
-    $opt_quiet                ,
-    $opt_report_file          ,
-    $opt_sdir                 ,
-    $opt_sum_reports          ,
-    $opt_unicode              ,
-    $opt_no3                  ,   # accept it but don't use it
-    $opt_3                    ,
-    $opt_extract_with         ,
-    $opt_by_file              ,
-    $opt_by_file_by_lang      ,
-    $opt_by_percent           ,
-    $opt_xml                  ,
-    $opt_xsl                  ,
-    $opt_yaml                 ,
-    $opt_csv                  ,
-    $opt_csv_delimiter        ,
-    $opt_fullpath             ,
-    $opt_json                 ,
-    $opt_md                   ,
-    $opt_match_f              ,
-    $opt_not_match_f          ,
-    $opt_match_d              ,
-    $opt_not_match_d          ,
-    $opt_skip_uniqueness      ,
-    $opt_list_file            ,
-    $opt_help                 ,
-    $opt_skip_win_hidden      ,
-    $opt_read_binary_files    ,
-    $opt_sql                  ,
-    $opt_sql_append           ,
-    $opt_sql_project          ,
-    $opt_sql_style            ,
-    $opt_inline               ,
-    $opt_exclude_ext          ,
-    $opt_ignore_whitespace    ,
-    $opt_ignore_case          ,
-    $opt_follow_links         ,
-    $opt_autoconf             ,
-    $opt_sum_one              ,
-    $opt_stdin_name           ,
-    $opt_force_on_windows     ,
-    $opt_force_on_unix        ,   # actually forces !$ON_WINDOWS
-    $opt_show_os              ,
-    $opt_skip_archive         ,
-    $opt_max_file_size        ,   # in MB
-    $opt_use_sloccount        ,
-   );
-my $getopt_success = GetOptions(
-   "by_file|by-file"                         => \$opt_by_file             ,
-   "by_file_by_lang|by-file-by-lang"         => \$opt_by_file_by_lang     ,
-   "categorized=s"                           => \$opt_categorized         ,
-   "counted=s"                               => \$opt_counted             ,
-   "include_lang|include-lang=s"             => \$opt_include_lang        ,
-   "exclude_lang|exclude-lang=s"             => \$opt_exclude_lang        ,
-   "exclude_dir|exclude-dir=s"               => \$opt_exclude_dir         ,
-   "exclude_list_file|exclude-list-file=s"   => \$opt_exclude_list_file   ,
-   "explain=s"                               => \$opt_explain             ,
-   "extract_with|extract-with=s"             => \$opt_extract_with        ,
-   "found=s"                                 => \$opt_found               ,
-   "count_and_diff|count-and-diff"           => \$opt_count_diff          ,
-   "diff"                                    => \$opt_diff                ,
-   "diff-alignment|diff_alignment=s"         => \$opt_diff_alignment      ,
-   "diff-timeout|diff_timeout=i"             => \$opt_diff_timeout        ,
-   "html"                                    => \$opt_html                ,
-   "ignored=s"                               => \$opt_ignored             ,
-   "quiet"                                   => \$opt_quiet               ,
-   "force_lang_def|force-lang-def=s"         => \$opt_force_lang_def      ,
-   "read_lang_def|read-lang-def=s"           => \$opt_read_lang_def       ,
-   "show_ext|show-ext:s"                     => \$opt_show_ext            ,
-   "show_lang|show-lang:s"                   => \$opt_show_lang           ,
-   "progress_rate|progress-rate=i"           => \$opt_progress_rate       ,
-   "print_filter_stages|print-filter-stages" => \$opt_print_filter_stages ,
-   "report_file|report-file=s"               => \$opt_report_file         ,
-   "out=s"                                   => \$opt_report_file         ,
-   "script_lang|script-lang=s"               => \@opt_script_lang         ,
-   "sdir=s"                                  => \$opt_sdir                ,
-   "skip_uniqueness|skip-uniqueness"         => \$opt_skip_uniqueness     ,
-   "strip_comments|strip-comments=s"         => \$opt_strip_comments      ,
-   "original_dir|original-dir"               => \$opt_original_dir        ,
-   "sum_reports|sum-reports"                 => \$opt_sum_reports         ,
-   "unicode"                                 => \$opt_unicode             ,
-   "no3"                                     => \$opt_no3                 ,  # ignored
-   "3"                                       => \$opt_3                   ,
-   "v|verbose:i"                             => \$opt_v                   ,
-   "vcs=s"                                   => \$opt_vcs                 ,
-   "version"                                 => \$opt_version             ,
-   "write_lang_def|write-lang-def=s"         => \$opt_write_lang_def      ,
-   "xml"                                     => \$opt_xml                 ,
-   "xsl=s"                                   => \$opt_xsl                 ,
-   "force_lang|force-lang=s"                 => \@opt_force_lang          ,
-   "lang_no_ext|lang-no-ext=s"               => \$opt_lang_no_ext         ,
-   "yaml"                                    => \$opt_yaml                ,
-   "csv"                                     => \$opt_csv                 ,
-   "csv_delimeter|csv-delimiter=s"           => \$opt_csv_delimiter       ,
-   "json"                                    => \$opt_json                ,
-   "md"                                      => \$opt_md                  ,
-   "fullpath"                                => \$opt_fullpath            ,
-   "match_f|match-f=s"                       => \$opt_match_f             ,
-   "not_match_f|not-match-f=s"               => \$opt_not_match_f         ,
-   "match_d|match-d=s"                       => \$opt_match_d             ,
-   "not_match_d|not-match-d=s"               => \$opt_not_match_d         ,
-   "list_file|list-file=s"                   => \$opt_list_file           ,
-   "help"                                    => \$opt_help                ,
-   "skip_win_hidden|skip-win-hidden"         => \$opt_skip_win_hidden     ,
-   "read_binary_files|read-binary-files"     => \$opt_read_binary_files   ,
-   "sql=s"                                   => \$opt_sql                 ,
-   "sql_project|sql-project=s"               => \$opt_sql_project         ,
-   "sql_append|sql-append"                   => \$opt_sql_append          ,
-   "sql_style|sql-style=s"                   => \$opt_sql_style           ,
-   "inline"                                  => \$opt_inline              ,
-   "exclude_ext|exclude-ext=s"               => \$opt_exclude_ext         ,
-   "ignore_whitespace|ignore-whitespace"     => \$opt_ignore_whitespace   ,
-   "ignore_case|ignore-case"                 => \$opt_ignore_case         ,
-   "follow_links|follow-links"               => \$opt_follow_links        ,
-   "autoconf"                                => \$opt_autoconf            ,
-   "sum_one|sum-one"                         => \$opt_sum_one             ,
-   "by_percent|by-percent=s"                 => \$opt_by_percent          ,
-   "stdin_name|stdin-name=s"                 => \$opt_stdin_name          ,
-   "windows"                                 => \$opt_force_on_windows    ,
-   "unix"                                    => \$opt_force_on_unix       ,
-   "show_os|show-os"                         => \$opt_show_os             ,
-   "skip_archive|skip-archive=s"             => \$opt_skip_archive        ,
-   "max_file_size|max-file-size=i"           => \$opt_max_file_size       ,
-   "use_sloccount|use-sloccount"             => \$opt_use_sloccount       ,
-  );
-$opt_by_file  = 1 if defined  $opt_by_file_by_lang;
-my $CLOC_XSL = "cloc.xsl"; # created with --xsl
-   $CLOC_XSL = "cloc-diff.xsl" if $opt_diff;
-die "\n" unless $getopt_success;
-print $usage and exit if $opt_help;
-my %Exclude_Language = ();
-   %Exclude_Language = map { $_ => 1 } split(/,/, $opt_exclude_lang)
-        if $opt_exclude_lang;
-my %Exclude_Dir      = ();
-   %Exclude_Dir      = map { $_ => 1 } split(/,/, $opt_exclude_dir )
-        if $opt_exclude_dir ;
-die unless exclude_dir_validates(\%Exclude_Dir);
-my %Include_Language = ();
-   %Include_Language = map { $_ => 1 } split(/,/, $opt_include_lang)
-        if $opt_include_lang;
-# Forcibly exclude .svn, .cvs, .hg, .git, .bzr directories.  The contents of these
-# directories often conflict with files of interest.
-$opt_exclude_dir       = 1;
-$Exclude_Dir{".svn"}   = 1;
-$Exclude_Dir{".cvs"}   = 1;
-$Exclude_Dir{".hg"}    = 1;
-$Exclude_Dir{".git"}   = 1;
-$Exclude_Dir{".bzr"}   = 1;
-$opt_count_diff        = defined $opt_count_diff ? 1 : 0;
-$opt_diff              = 1  if $opt_diff_alignment;
-$opt_exclude_ext       = "" unless $opt_exclude_ext;
-$opt_ignore_whitespace = 0  unless $opt_ignore_whitespace;
-$opt_ignore_case       = 0  unless $opt_ignore_case;
-$opt_lang_no_ext       = 0  unless $opt_lang_no_ext;
-$opt_follow_links      = 0  unless $opt_follow_links;
-$opt_diff_timeout      =10  unless $opt_diff_timeout;
-$opt_csv               = 1  if $opt_csv_delimiter;
-$ON_WINDOWS            = 1  if $opt_force_on_windows;
-$ON_WINDOWS            = 0  if $opt_force_on_unix;
-$opt_max_file_size     = 100 unless $opt_max_file_size;
-my $HAVE_SLOCCOUNT_c_count = 0;
-if (!$ON_WINDOWS and $opt_use_sloccount) {
-    # Only bother doing this kludgey test is user explicitly wants
-    # to use SLOCCount.  Debian based systems will hang if just doing
-    #  external_utility_exists("c_count")
-    # if c_count is in $PATH; c_count expects to have input.
-    $HAVE_SLOCCOUNT_c_count = external_utility_exists("c_count /bin/sh");
-}
-if ($opt_use_sloccount) {
-    if (!$HAVE_SLOCCOUNT_c_count) {
-        warn "c_count could not be found; ignoring --use-sloccount\n";
-        $opt_use_sloccount = 0;
-    } else {
-        warn "Using c_count, php_count, xml_count, pascal_count from SLOCCount\n";
-        warn "--diff is disabled with --use-sloccount\n" if $opt_diff;
-        warn "--count-and-diff is disabled with --use-sloccount\n" if $opt_count_diff;
-        warn "--unicode is disabled with --use-sloccount\n" if $opt_unicode;
-        warn "--strip-comments is disabled with --use-sloccount\n" if $opt_strip_comments;
-        $opt_diff           = 0;
-        $opt_count_diff     = undef;
-        $opt_unicode        = 0;
-        $opt_strip_comments = 0;
-    }
-}
-
-my @COUNT_DIFF_ARGV        = undef;
-my $COUNT_DIFF_report_file = undef;
-if ($opt_count_diff) {
-    die "--count-and-diff requires two arguments; got ", scalar @ARGV, "\n"
-        if scalar @ARGV != 2;
-    # prefix with a dummy term so that $opt_count_diff is the
-    # index into @COUNT_DIFF_ARGV to work on at each pass
-    @COUNT_DIFF_ARGV = (undef, $ARGV[0],
-                               $ARGV[1],
-                              [$ARGV[0], $ARGV[1]]);  # 3rd pass: diff them
-    $COUNT_DIFF_report_file = $opt_report_file if $opt_report_file;
-}
-
-# Options defaults:
-$opt_quiet         =   1 if ($opt_md or $opt_json) and !defined $opt_report_file;
-$opt_progress_rate = 100 unless defined $opt_progress_rate;
-$opt_progress_rate =   0 if     defined $opt_quiet;
-if (!defined $opt_v) {
-    $opt_v  = 0;
-} elsif (!$opt_v) {
-    $opt_v  = 1;
-}
-if (defined $opt_xsl) {
-    $opt_xsl = $CLOC_XSL if $opt_xsl eq "1";
-    $opt_xml = 1;
-}
-my $skip_generate_report = 0;
-$opt_sql_style = 0 unless defined $opt_sql_style;
-$opt_sql = 0 unless $opt_sql_style or defined $opt_sql;
-if ($opt_sql eq "-" || $opt_sql eq "1") { # stream SQL output to STDOUT
-    $opt_quiet            = 1;
-    $skip_generate_report = 1;
-    $opt_by_file          = 1;
-    $opt_sum_reports      = 0;
-    $opt_progress_rate    = 0;
-} elsif ($opt_sql)  { # write SQL output to a file
-    $opt_by_file          = 1;
-    $skip_generate_report = 1;
-    $opt_sum_reports      = 0;
-}
-if ($opt_sql_style) {
-    $opt_sql_style = lc $opt_sql_style;
-    if (!grep { lc $_ eq $opt_sql_style } qw ( Oracle )) {
-        die "'$opt_sql_style' is not a recognized SQL style.\n";
-    }
-}
-$opt_by_percent = '' unless defined $opt_by_percent;
-if ($opt_by_percent and $opt_by_percent !~ m/^(c|cm|cb|cmb)$/i) {
-    die "--by-percent must be either 'c', 'cm', 'cb', or 'cmb'\n";
-}
-$opt_by_percent = lc $opt_by_percent;
-
-if (defined $opt_vcs) {
-    if      ($opt_vcs eq "git") {
-        $opt_vcs = "git ls-files";
-        my @submodules = invoke_generator('git submodule status');
-        foreach my $SM (@submodules) {
-            $SM =~ s/^\s+//;        # may have leading space
-            $SM =~ s/\(\S+\)\s*$//; # may end with something like (heads/master)
-			my ($checksum, $dir) = split(' ', $SM, 2);
-            $dir =~ s/\s+$//;
-            $Exclude_Dir{$dir} = 1;
-        }
-    } elsif ($opt_vcs eq "svn") {
-        $opt_vcs = "svn list -R";
-    }
-}
-
-die $brief_usage unless defined $opt_version         or
-                        defined $opt_show_lang       or
-                        defined $opt_show_ext        or
-                        defined $opt_show_os         or
-                        defined $opt_write_lang_def  or
-                        defined $opt_list_file       or
-                        defined $opt_vcs             or
-                        defined $opt_xsl             or
-                        defined $opt_explain         or
-                        scalar @ARGV >= 1;
-die "--diff requires two arguments; got ", scalar @ARGV, "\n"
-    if $opt_diff and scalar @ARGV != 2;
-if ($opt_version) {
-    printf "$VERSION\n";
-    exit;
-}
-# 1}}}
-# Step 1:  Initialize global constants.        {{{1
-#
-my $nFiles_Found = 0;  # updated in make_file_list
-my (%Language_by_Extension, %Language_by_Script,
-    %Filters_by_Language, %Not_Code_Extension, %Not_Code_Filename,
-    %Language_by_File, %Scale_Factor, %Known_Binary_Archives,
-    %EOL_Continuation_re,
-   );
-my $ALREADY_SHOWED_HEADER = 0;
-my $ALREADY_SHOWED_XML_SECTION = 0;
-my %Error_Codes = ( 'Unable to read'                => -1,
-                    'Neither file nor directory'    => -2,
-                    'Diff error (quoted comments?)' => -3,
-                    'Diff error, exceeded timeout'  => -4,
-                  );
-if ($opt_force_lang_def) {
-    # replace cloc's definitions
-    read_lang_def(
-        $opt_force_lang_def    , #        Sample values:
-        \%Language_by_Extension, # Language_by_Extension{f}    = 'Fortran 77'
-        \%Language_by_Script   , # Language_by_Script{sh}      = 'Bourne Shell'
-        \%Language_by_File     , # Language_by_File{makefile}  = 'make'
-        \%Filters_by_Language  , # Filters_by_Language{Bourne Shell}[0] =
-                                 #      [ 'remove_matches' , '^\s*#'  ]
-        \%Not_Code_Extension   , # Not_Code_Extension{jpg}     = 1
-        \%Not_Code_Filename    , # Not_Code_Filename{README}   = 1
-        \%Scale_Factor         , # Scale_Factor{Perl}          = 4.0
-        \%EOL_Continuation_re  , # EOL_Continuation_re{C++}    = '\\$'
-        );
-} else {
-    set_constants(               #
-        \%Language_by_Extension, # Language_by_Extension{f}    = 'Fortran 77'
-        \%Language_by_Script   , # Language_by_Script{sh}      = 'Bourne Shell'
-        \%Language_by_File     , # Language_by_File{makefile}  = 'make'
-        \%Filters_by_Language  , # Filters_by_Language{Bourne Shell}[0] =
-                                 #      [ 'remove_matches' , '^\s*#'  ]
-        \%Not_Code_Extension   , # Not_Code_Extension{jpg}     = 1
-        \%Not_Code_Filename    , # Not_Code_Filename{README}   = 1
-        \%Scale_Factor         , # Scale_Factor{Perl}          = 4.0
-        \%Known_Binary_Archives, # Known_Binary_Archives{.tar} = 1
-        \%EOL_Continuation_re  , # EOL_Continuation_re{C++}    = '\\$'
-        );
-}
-if ($opt_read_lang_def) {
-    # augment cloc's definitions (keep cloc's where there are overlaps)
-    merge_lang_def(
-        $opt_read_lang_def     , #        Sample values:
-        \%Language_by_Extension, # Language_by_Extension{f}    = 'Fortran 77'
-        \%Language_by_Script   , # Language_by_Script{sh}      = 'Bourne Shell'
-        \%Language_by_File     , # Language_by_File{makefile}  = 'make'
-        \%Filters_by_Language  , # Filters_by_Language{Bourne Shell}[0] =
-                                 #      [ 'remove_matches' , '^\s*#'  ]
-        \%Not_Code_Extension   , # Not_Code_Extension{jpg}     = 1
-        \%Not_Code_Filename    , # Not_Code_Filename{README}   = 1
-        \%Scale_Factor         , # Scale_Factor{Perl}          = 4.0
-        \%EOL_Continuation_re  , # EOL_Continuation_re{C++}    = '\\$'
-        );
-}
-if ($opt_lang_no_ext and !defined $Filters_by_Language{$opt_lang_no_ext}) {
-    die_unknown_lang($opt_lang_no_ext, "--lang-no-ext")
-}
-check_scale_existence(\%Filters_by_Language, \%Language_by_Extension,
-                      \%Scale_Factor);
-
-# Process command line provided extension-to-language mapping overrides.
-# Make a hash of known languages in lower case for easier matching.
-my %Recognized_Language_lc = (); # key = language name in lc, value = true name
-foreach my $language (keys %Filters_by_Language) {
-    my $lang_lc = lc $language;
-    $Recognized_Language_lc{$lang_lc} = $language;
-}
-my %Forced_Extension = (); # file name extensions which user wants to count
-my $All_One_Language = 0;  # set to !0 if --force-lang's <ext> is missing
-foreach my $pair (@opt_force_lang) {
-    my ($lang, $extension) = split(',', $pair);
-    my $lang_lc = lc $lang;
-    if (defined $extension) {
-        $Forced_Extension{$extension} = $lang;
-
-        die_unknown_lang($lang, "--force-lang")
-            unless $Recognized_Language_lc{$lang_lc};
-
-        $Language_by_Extension{$extension} = $Recognized_Language_lc{$lang_lc};
-    } else {
-        # the scary case--count everything as this language
-        $All_One_Language = $Recognized_Language_lc{$lang_lc};
-    }
-}
-
-foreach my $pair (@opt_script_lang) {
-    my ($lang, $script_name) = split(',', $pair);
-    my $lang_lc = lc $lang;
-    if (!defined $script_name) {
-        die "The --script-lang option requires a comma separated pair of ".
-            "strings.\n";
-    }
-
-    die_unknown_lang($lang, "--script-lang")
-        unless $Recognized_Language_lc{$lang_lc};
-
-    $Language_by_Script{$script_name} = $Recognized_Language_lc{$lang_lc};
-}
-
-# If user provided file extensions to ignore, add these to
-# the exclusion list.
-foreach my $ext (map { $_ => 1 } split(/,/, $opt_exclude_ext ) ) {
-    $ext = lc $ext if $ON_WINDOWS;
-    $Not_Code_Extension{$ext} = 1;
-}
-
-# If SQL or --by-file output is requested, keep track of directory names
-# generated by File::Temp::tempdir and used to temporarily hold the results
-# of compressed archives.  Contents of the SQL table 't' will be much
-# cleaner if these meaningless directory names are stripped from the front
-# of files pulled from the archives.
-my %TEMP_DIR = ();
-my $TEMP_OFF =  0;  # Needed for --sdir; keep track of the number of
-                    # scratch directories made in this run to avoid
-                    # file overwrites by multiple extractions to same
-                    # sdir.
-# Also track locations where temporary installations, if necessary, of
-# Algorithm::Diff and/or Regexp::Common are done.  Make sure these
-# directories are not counted as inputs (ref bug #80 2012-11-23).
-my %TEMP_INST = ();
-
-# invert %Language_by_Script hash to get an easy-to-look-up list of known
-# scripting languages
-my %Script_Language = map { $_ => 1 } values %Language_by_Script ;
-# 1}}}
-# Step 2:  Early exits for display, summation. {{{1
-#
-print_extension_info(   $opt_show_ext     ) if defined $opt_show_ext ;
-print_language_info(    $opt_show_lang, '') if defined $opt_show_lang;
-print_language_filters( $opt_explain      ) if defined $opt_explain  ;
-exit if (defined $opt_show_ext)  or
-        (defined $opt_show_lang) or
-        (defined $opt_explain);
-
-Top_of_Processing_Loop:
-# Sorry, coding purists.  Using a goto to implement --count-and-diff
-# which has to do three passes over the main code, starting with
-# a clean slate each time.
-if ($opt_count_diff) {
-    @ARGV = ( $COUNT_DIFF_ARGV[ $opt_count_diff ] );
-    if ($opt_count_diff == 3) {
-        $opt_diff = 1;
-        @ARGV = @{$COUNT_DIFF_ARGV[ $opt_count_diff ]}; # last arg is list of list
-    }
-    if ($opt_report_file) {
-        # Instead of just one output file, will have three.
-        # Keep their names unique otherwise results are clobbered.
-        if ($opt_count_diff == 3) {
-            $opt_report_file = $COUNT_DIFF_report_file . ".diff.$ARGV[0].$ARGV[1]";
-        } else {
-            $opt_report_file = $COUNT_DIFF_report_file . "." .  $ARGV[0];
-        }
-    } else {
-        # STDOUT; print a header showing what it's working on
-        if ($opt_count_diff == 3) {
-            print "\ndiff $ARGV[0] $ARGV[1]::\n";
-        } else {
-            print "\n" if $opt_count_diff > 1;
-            print "$ARGV[0]::\n";
-        }
-    }
-    $ALREADY_SHOWED_HEADER      = 0;
-    $ALREADY_SHOWED_XML_SECTION = 0;
-}
-
-#print "Before glob have [", join(",", @ARGV), "]\n";
-@ARGV = windows_glob(@ARGV) if $ON_WINDOWS;
-#print "after  glob have [", join(",", @ARGV), "]\n";
-
-# filter out archive files if requested to do so
-if (defined $opt_skip_archive) {
-    my @non_archive = ();
-    foreach my $candidate (@ARGV) {
-        if ($candidate !~ m/${opt_skip_archive}$/) {
-            push @non_archive, $candidate;
-
-        }
-    }
-    @ARGV = @non_archive;
-}
-
-if ($opt_sum_reports and $opt_diff) {
-    my @results = ();
-    if ($opt_list_file) { # read inputs from the list file
-        my @list = read_list_file($opt_list_file);
-        @results = combine_diffs(\@list);
-    } elsif ($opt_vcs) { # read inputs from the VCS generator
-        my @list = invoke_generator($opt_vcs, \@ARGV);
-        @results = combine_diffs(\@list);
-    } else { # get inputs from the command line
-        @results = combine_diffs(\@ARGV);
-    }
-    if ($opt_report_file) {
-        write_file($opt_report_file, @results);
-    } else {
-        print "\n", join("\n", @results), "\n";
-    }
-    exit;
-}
-if ($opt_sum_reports) {
-    my %Results = ();
-    foreach my $type( "by language", "by report file" ) {
-        my $found_lang = undef;
-        if ($opt_list_file or $opt_vcs) {
-            # read inputs from the list file
-            my @list;
-            if ($opt_vcs) {
-                @list = invoke_generator($opt_vcs, \@ARGV);
-            } else {
-                @list = read_list_file($opt_list_file);
-            }
-            $found_lang = combine_results(\@list,
-                                           $type,
-                                          \%{$Results{ $type }},
-                                          \%Filters_by_Language );
-        } else { # get inputs from the command line
-            $found_lang = combine_results(\@ARGV,
-                                           $type,
-                                          \%{$Results{ $type }},
-                                          \%Filters_by_Language );
-        }
-        next unless %Results;
-        my $end_time = get_time();
-        my @results  = generate_report($VERSION, $end_time - $start_time,
-                                       $type,
-                                      \%{$Results{ $type }}, \%Scale_Factor);
-        if ($opt_report_file) {
-            my $ext  = ".lang";
-               $ext  = ".file" unless $type eq "by language";
-            next if !$found_lang and  $ext  eq ".lang";
-            write_file($opt_report_file . $ext, @results);
-        } else {
-            print "\n", join("\n", @results), "\n";
-        }
-    }
-    exit;
-}
-if ($opt_write_lang_def) {
-    write_lang_def($opt_write_lang_def   ,
-                  \%Language_by_Extension,
-                  \%Language_by_Script   ,
-                  \%Language_by_File     ,
-                  \%Filters_by_Language  ,
-                  \%Not_Code_Extension   ,
-                  \%Not_Code_Filename    ,
-                  \%Scale_Factor         ,
-                  \%EOL_Continuation_re  ,
-                  );
-    exit;
-}
-if ($opt_show_os) {
-    if ($ON_WINDOWS) {
-        print "Windows\n";
-    } else {
-        print "UNIX\n";
-    }
-    exit;
-}
-# 1}}}
-# Step 3:  Create a list of files to consider. {{{1
-#  a) If inputs are binary archives, first cd to a temp
-#     directory, expand the archive with the user-given
-#     extraction tool, then add the temp directory to
-#     the list of dirs to process.
-#  b) Create a list of every file that might contain source
-#     code.  Ignore binary files, zero-sized files, and
-#     any file in a directory the user says to exclude.
-#  c) Determine the language for each file in the list.
-#
-my @binary_archive = ();
-my $cwd            = cwd();
-if ($opt_extract_with) {
-#print "cwd main = [$cwd]\n";
-    my @extract_location = ();
-    foreach my $bin_file (@ARGV) {
-        my $extract_dir = undef;
-        if ($opt_sdir) {
-            ++$TEMP_OFF;
-            $extract_dir = "$opt_sdir/$TEMP_OFF";
-            File::Path::rmtree($extract_dir) if     is_dir($extract_dir);
-            File::Path::mkpath($extract_dir) unless is_dir($extract_dir);
-        } else {
-            $extract_dir = tempdir( CLEANUP => 1 );  # 1 = delete on exit
-        }
-        $TEMP_DIR{ $extract_dir } = 1 if $opt_sql or $opt_by_file;
-        print "mkdir $extract_dir\n"  if $opt_v;
-        print "cd    $extract_dir\n"  if $opt_v;
-        chdir $extract_dir;
-        my $bin_file_full_path = "";
-        if (File::Spec->file_name_is_absolute( $bin_file )) {
-            $bin_file_full_path = $bin_file;
-#print "bin_file_full_path (was ful) = [$bin_file_full_path]\n";
-        } else {
-            $bin_file_full_path = File::Spec->catfile( $cwd, $bin_file );
-#print "bin_file_full_path (was rel) = [$bin_file_full_path]\n";
-        }
-        my     $extract_cmd = uncompress_archive_cmd($bin_file_full_path);
-        print  $extract_cmd, "\n" if $opt_v;
-        system $extract_cmd;
-        push @extract_location, $extract_dir;
-        chdir $cwd;
-    }
-    # It is possible that the binary archive itself contains additional
-    # files compressed the same way (true for Java .ear files).  Go
-    # through all the files that were extracted, see if they are binary
-    # archives and try to extract them.  Lather, rinse, repeat.
-    my $binary_archives_exist = 1;
-    my $count_binary_archives = 0;
-    my $previous_count        = 0;
-    my $n_pass                = 0;
-    while ($binary_archives_exist) {
-        @binary_archive = ();
-        foreach my $dir (@extract_location) {
-            find(\&archive_files, $dir);  # populates global @binary_archive
-        }
-        foreach my $archive (@binary_archive) {
-            my $extract_dir = undef;
-            if ($opt_sdir) {
-                ++$TEMP_OFF;
-                $extract_dir = "$opt_sdir/$TEMP_OFF";
-                File::Path::rmtree($extract_dir) if     is_dir($extract_dir);
-                File::Path::mkpath($extract_dir) unless is_dir($extract_dir);
-            } else {
-                $extract_dir = tempdir( CLEANUP => 1 );  # 1 = delete on exit
-            }
-            $TEMP_DIR{ $extract_dir } = 1 if $opt_sql or $opt_by_file;
-            print "mkdir $extract_dir\n"  if $opt_v;
-            print "cd    $extract_dir\n"  if $opt_v;
-            chdir  $extract_dir;
-
-            my     $extract_cmd = uncompress_archive_cmd($archive);
-            print  $extract_cmd, "\n" if $opt_v;
-            system $extract_cmd;
-            push @extract_location, $extract_dir;
-            unlink $archive;  # otherwise will be extracting it forever
-        }
-        $count_binary_archives = scalar @binary_archive;
-        if ($count_binary_archives == $previous_count) {
-            $binary_archives_exist = 0;
-        }
-        $previous_count = $count_binary_archives;
-    }
-    chdir $cwd;
-
-    @ARGV = @extract_location;
-} else {
-    # see if any of the inputs need to be auto-uncompressed &/or expanded
-    my @updated_ARGS = ();
-    foreach my $Arg (@ARGV) {
-        if (is_dir($Arg)) {
-            push @updated_ARGS, $Arg;
-            next;
-        }
-        my $full_path = "";
-        if (File::Spec->file_name_is_absolute( $Arg )) {
-            $full_path = $Arg;
-        } else {
-            $full_path = File::Spec->catfile( $cwd, $Arg );
-        }
-#print "full_path = [$full_path]\n";
-        my $extract_cmd = uncompress_archive_cmd($full_path);
-        if ($extract_cmd) {
-            my $extract_dir = undef;
-            if ($opt_sdir) {
-                ++$TEMP_OFF;
-                $extract_dir = "$opt_sdir/$TEMP_OFF";
-                File::Path::rmtree($extract_dir) if     is_dir($extract_dir);
-                File::Path::mkpath($extract_dir) unless is_dir($extract_dir);
-            } else {
-                $extract_dir = tempdir( CLEANUP => 1 ); # 1 = delete on exit
-            }
-            $TEMP_DIR{ $extract_dir } = 1 if $opt_sql or $opt_by_file;
-            print "mkdir $extract_dir\n"  if $opt_v;
-            print "cd    $extract_dir\n"  if $opt_v;
-            chdir  $extract_dir;
-            print  $extract_cmd, "\n" if $opt_v;
-            system $extract_cmd;
-            push @updated_ARGS, $extract_dir;
-            chdir $cwd;
-        } else {
-            # this is a conventional, uncompressed, unarchived file
-            # or a directory; keep as-is
-            push @updated_ARGS, $Arg;
-        }
-    }
-    @ARGV = @updated_ARGS;
-
-    # make sure we're not counting any directory containing
-    # temporary installations of Regexp::Common, Algorithm::Diff
-    foreach my $d (sort keys %TEMP_INST) {
-        foreach my $a (@ARGV) {
-            next unless is_dir($a);
-            if ($opt_v > 2) {
-                printf "Comparing %s (location of %s) to input [%s]\n",
-                        $d, $TEMP_INST{$d}, $a;
-            }
-            if ($a eq $d) {
-                die "File::Temp::tempdir chose directory ",
-                    $d, " to install ", $TEMP_INST{$d}, " but this ",
-                    "matches one of your input directories.  Rerun ",
-                    "with --sdir and supply a different temporary ",
-                    "directory for ", $TEMP_INST{$d}, "\n";
-            }
-        }
-    }
-}
-# 1}}}
-my @Errors    = ();
-my @file_list = ();  # global variable updated in files()
-my %Ignored   = ();  # files that are not counted (language not recognized or
-                     # problems reading the file)
-my @Lines_Out = ();
-if ($opt_diff) {
-# Step 4:  Separate code from non-code files.  {{{1
-my @fh            = ();
-my @files_for_set = ();
-# make file lists for each separate argument
-for (my $i = 0; $i < scalar @ARGV; $i++) {
-    push @fh,
-         make_file_list([ $ARGV[$i] ], \%Error_Codes, \@Errors, \%Ignored);
-    @{$files_for_set[$i]} = @file_list;
-    if ($opt_exclude_list_file) {
-        # note: process_exclude_list_file() references global @file_list
-        process_exclude_list_file($opt_exclude_list_file,
-                                 \%Exclude_Dir,
-                                 \%Ignored);
-    }
-    @file_list = ();
-}
-# 1}}}
-# Step 5:  Remove duplicate files.             {{{1
-#
-my %Language           = ();
-my %unique_source_file = ();
-my $n_set = 0;
-foreach my $FH (@fh) {  # loop over each pair of file sets
-    ++$n_set;
-    remove_duplicate_files($FH,
-                               \%{$Language{$FH}}               ,
-                               \%{$unique_source_file{$FH}}     ,
-                          \%Error_Codes                         ,
-                               \@Errors                         ,
-                               \%Ignored                        );
-    printf "%2d: %8d unique file%s.                          \r",
-        $n_set,
-        plural_form(scalar keys %unique_source_file)
-        unless $opt_quiet;
-}
-# 1}}}
-# Step 6:  Count code, comments, blank lines.  {{{1
-#
-my %Results_by_Language = ();
-my %Results_by_File     = ();
-my %Delta_by_Language   = ();
-my %Delta_by_File       = ();
-
-foreach (my $F = 0; $F < scalar @fh - 1; $F++) {
-    # loop over file sets; do diff between set $F to $F+1
-
-    my $nCounted = 0;
-
-    my @file_pairs    = ();
-    my @files_added   = ();
-    my @files_removed = ();
-
-    align_by_pairs(\%{$unique_source_file{$fh[$F  ]}}    , # in
-                   \%{$unique_source_file{$fh[$F+1]}}    , # in
-                   \@files_added                         , # out
-                   \@files_removed                       , # out
-                   \@file_pairs                          , # out
-                   );
-    my %already_counted = (); # already_counted{ filename } = 1
-
-    if (!@file_pairs) {
-        # Special case where all files were either added or deleted.
-        # In this case, one of these arrays will be empty:
-        #   @files_added, @files_removed
-        # so loop over both to cover both cases.
-        my $status = @files_added ? 'added' : 'removed';
-        my $offset = @files_added ? 1       : 0        ;
-        foreach my $file (@files_added, @files_removed) {
-            next unless defined $Language{$fh[$F+$offset]}{$file};
-            my $Lang = $Language{$fh[$F+$offset]}{$file};
-            next if $Lang eq '(unknown)';
-            my ($all_line_count,
-                $blank_count   ,
-                $comment_count ,
-               ) = call_counter($file, $Lang, \@Errors);
-            $already_counted{$file} = 1;
-            my $code_count = $all_line_count-$blank_count-$comment_count;
-            if ($opt_by_file) {
-                $Delta_by_File{$file}{'code'   }{$status} += $code_count   ;
-                $Delta_by_File{$file}{'blank'  }{$status} += $blank_count  ;
-                $Delta_by_File{$file}{'comment'}{$status} += $comment_count;
-                $Delta_by_File{$file}{'lang'   }{$status}  = $Lang         ;
-                $Delta_by_File{$file}{'nFiles' }{$status} += 1             ;
-            }
-            $Delta_by_Language{$Lang}{'code'   }{$status} += $code_count   ;
-            $Delta_by_Language{$Lang}{'blank'  }{$status} += $blank_count  ;
-            $Delta_by_Language{$Lang}{'comment'}{$status} += $comment_count;
-            $Delta_by_Language{$Lang}{'nFiles' }{$status} += 1             ;
-        }
-    }
-   #use Data::Dumper::Simple;
-   #use Data::Dumper;
-   #print Dumper(\@files_added, \@files_removed, \@file_pairs);
-    my @alignment = (); # only  used if --diff-alignment
-#print "after align_by_pairs:\n";
-
-#print "added:\n";
-    push @alignment, sprintf "Files added: %d\n", scalar @files_added
-        if $opt_diff_alignment;
-    foreach my $f (@files_added) {
-        next if $already_counted{$f};
-#printf "%10s -> %s\n", $f, $Language{$fh[$F+1]}{$f};
-        # Don't proceed unless the file (both L and R versions)
-        # is in a known language.
-        next if $opt_include_lang
-                and not $Include_Language{$Language{$fh[$F+1]}{$f}};
-        next if $Language{$fh[$F+1]}{$f} eq "(unknown)";
-        next if $Exclude_Language{$Language{$fh[$F+1]}{$f}};
-        push @alignment, sprintf "  + %s ; %s\n", $f, $Language{$fh[$F+1]}{$f}
-            if $opt_diff_alignment;
-        ++$Delta_by_Language{ $Language{$fh[$F+1]}{$f} }{'nFiles'}{'added'};
-        # Additionally, add contents of file $f to
-        #        Delta_by_File{$f}{comment/blank/code}{'added'}
-        #        Delta_by_Language{$lang}{comment/blank/code}{'added'}
-        my ($all_line_count,
-            $blank_count   ,
-            $comment_count ,
-           ) = call_counter($f, $Language{$fh[$F+1]}{$f}, \@Errors);
-        $Delta_by_Language{ $Language{$fh[$F+1]}{$f} }{'comment'}{'added'} +=
-            $comment_count;
-        $Delta_by_Language{ $Language{$fh[$F+1]}{$f} }{'blank'}{'added'}   +=
-            $blank_count;
-        $Delta_by_Language{ $Language{$fh[$F+1]}{$f} }{'code'}{'added'}    +=
-            $all_line_count - $blank_count - $comment_count;
-        $Delta_by_File{ $f }{'comment'}{'added'} = $comment_count;
-        $Delta_by_File{ $f }{'blank'}{'added'}   = $blank_count;
-        $Delta_by_File{ $f }{'code'}{'added'}    =
-            $all_line_count - $blank_count - $comment_count;
-    }
-    push @alignment, "\n";
-
-#print "removed:\n";
-    push @alignment, sprintf "Files removed: %d\n", scalar @files_removed
-        if $opt_diff_alignment;
-    foreach my $f (@files_removed) {
-        next if $already_counted{$f};
-        # Don't proceed unless the file (both L and R versions)
-        # is in a known language.
-        next if $opt_include_lang
-                and not $Include_Language{$Language{$fh[$F]}{$f}};
-        next if $Language{$fh[$F]}{$f} eq "(unknown)";
-        next if $Exclude_Language{$Language{$fh[$F]}{$f}};
-        ++$Delta_by_Language{ $Language{$fh[$F]}{$f} }{'nFiles'}{'removed'};
-        push @alignment, sprintf "  - %s ; %s\n", $f, $Language{$fh[$F]}{$f}
-            if $opt_diff_alignment;
-#printf "%10s -> %s\n", $f, $Language{$fh[$F  ]}{$f};
-        # Additionally, add contents of file $f to
-        #        Delta_by_File{$f}{comment/blank/code}{'removed'}
-        #        Delta_by_Language{$lang}{comment/blank/code}{'removed'}
-        my ($all_line_count,
-            $blank_count   ,
-            $comment_count ,
-           ) = call_counter($f, $Language{$fh[$F  ]}{$f}, \@Errors);
-        $Delta_by_Language{ $Language{$fh[$F  ]}{$f} }{'comment'}{'removed'} +=
-            $comment_count;
-        $Delta_by_Language{ $Language{$fh[$F  ]}{$f} }{'blank'}{'removed'}   +=
-            $blank_count;
-        $Delta_by_Language{ $Language{$fh[$F  ]}{$f} }{'code'}{'removed'}    +=
-            $all_line_count - $blank_count - $comment_count;
-        $Delta_by_File{ $f }{'comment'}{'removed'} = $comment_count;
-        $Delta_by_File{ $f }{'blank'}{'removed'}   = $blank_count;
-        $Delta_by_File{ $f }{'code'}{'removed'}    =
-            $all_line_count - $blank_count - $comment_count;
-    }
-    push @alignment, "\n";
-
-    my $alignment_pairs_index = scalar @alignment;
-    my $n_file_pairs_compared = 0;
-    # Don't know ahead of time how many file pairs will be compared
-    # since duplicates are weeded out below.  The answer is
-    # scalar @file_pairs only if there are no duplicates.
-    push @alignment, sprintf "File pairs compared: UPDATE_ME\n"
-        if $opt_diff_alignment;
-
-    foreach my $pair (@file_pairs) {
-        my $file_L = $pair->[0];
-        my $file_R = $pair->[1];
-        my $Lang_L = $Language{$fh[$F  ]}{$file_L};
-        my $Lang_R = $Language{$fh[$F+1]}{$file_R};
-#print "main step 6 file_L=$file_L    file_R=$file_R\n";
-        ++$nCounted;
-        printf "Counting:  %d\r", $nCounted
-            unless (!$opt_progress_rate or ($nCounted % $opt_progress_rate));
-        next if $Ignored{$file_L};
-        # filter out non-included languages
-        if ($opt_include_lang and not $Include_Language{$Lang_L}
-                              and not $Include_Language{$Lang_R}) {
-            $Ignored{$file_L} = "--include-lang=$Lang_L";
-            $Ignored{$file_R} = "--include-lang=$Lang_R";
-            next;
-        }
-        # filter out excluded or unrecognized languages
-        if ($Exclude_Language{$Lang_L} or $Exclude_Language{$Lang_R}) {
-            $Ignored{$file_L} = "--exclude-lang=$Lang_L";
-            $Ignored{$file_R} = "--exclude-lang=$Lang_R";
-            next;
-        }
-        my $not_Filters_by_Language_Lang_LR = 0;
-#print "file_LR = [$file_L] [$file_R]\n";
-#print "Lang_LR = [$Lang_L] [$Lang_R]\n";
-        if (!(@{$Filters_by_Language{$Lang_L} }) or
-            !(@{$Filters_by_Language{$Lang_R} })) {
-            $not_Filters_by_Language_Lang_LR = 1;
-        }
-        if ($not_Filters_by_Language_Lang_LR) {
-            if (($Lang_L eq "(unknown)") or ($Lang_R eq "(unknown)")) {
-                $Ignored{$fh[$F  ]}{$file_L} = "language unknown (#1)";
-                $Ignored{$fh[$F+1]}{$file_R} = "language unknown (#1)";
-            } else {
-                $Ignored{$fh[$F  ]}{$file_L} = "missing Filters_by_Language{$Lang_L}";
-                $Ignored{$fh[$F+1]}{$file_R} = "missing Filters_by_Language{$Lang_R}";
-            }
-            next;
-        }
-
-#print "DIFF($file_L, $file_R)\n";
-        # step 0: compare the two files' contents
-        chomp ( my @lines_L = read_file($file_L) );
-        chomp ( my @lines_R = read_file($file_R) );
-        my $language_file_L = "";
-        if (defined $Language{$fh[$F]}{$file_L}) {
-            $language_file_L = $Language{$fh[$F]}{$file_L};
-        } else {
-            # files $file_L and $file_R do not contain known language
-            next;
-        }
-        my $contents_are_same = 1;
-        if (scalar @lines_L == scalar @lines_R) {
-            # same size, must compare line-by-line
-            for (my $i = 0; $i < scalar @lines_L; $i++) {
-                if ($lines_L[$i] ne $lines_R[$i]) {
-                    $contents_are_same = 0;
-                    last;
-                }
-            }
-            if ($contents_are_same) {
-                ++$Delta_by_Language{$language_file_L}{'nFiles'}{'same'};
-            } else {
-                ++$Delta_by_Language{$language_file_L}{'nFiles'}{'modified'};
-            }
-        } else {
-            $contents_are_same = 0;
-            # different sizes, contents have changed
-            ++$Delta_by_Language{$language_file_L}{'nFiles'}{'modified'};
-        }
-        if ($opt_diff_alignment) {
-            my $str =  "$file_L | $file_R ; $language_file_L";
-            if ($contents_are_same) {
-                push @alignment, "  == $str";
-            } else {
-                push @alignment, "  != $str";
-            }
-            ++$n_file_pairs_compared;
-        }
-
-        # step 1: identify comments in both files
-#print "Diff blank removal L language= $Lang_L";
-#print " scalar(lines_L)=", scalar @lines_L, "\n";
-        my @original_minus_blanks_L
-                    = rm_blanks(  \@lines_L, $Lang_L, \%EOL_Continuation_re);
-#print "1: scalar(original_minus_blanks_L)=", scalar @original_minus_blanks_L, "\n";
-        @lines_L    = @original_minus_blanks_L;
-#print "2: scalar(lines_L)=", scalar @lines_L, "\n";
-        @lines_L    = add_newlines(\@lines_L); # compensate for rm_comments()
-        @lines_L    = rm_comments( \@lines_L, $Lang_L, $file_L,
-                                   \%EOL_Continuation_re);
-#print "3: scalar(lines_L)=", scalar @lines_L, "\n";
-
-#print "Diff blank removal R language= $Lang_R\n";
-        my @original_minus_blanks_R
-                    = rm_blanks(  \@lines_R, $Lang_R, \%EOL_Continuation_re);
-        @lines_R    = @original_minus_blanks_R;
-        @lines_R    = add_newlines(\@lines_R); # taken away by rm_comments()
-        @lines_R    = rm_comments( \@lines_R, $Lang_R, $file_R,
-                                   \%EOL_Continuation_re);
-
-        my (@diff_LL, @diff_LR, );
-        array_diff( $file_L                  ,   # in
-                   \@original_minus_blanks_L ,   # in
-                   \@lines_L                 ,   # in
-                   "comment"                 ,   # in
-                   \@diff_LL, \@diff_LR      ,   # out
-                   \@Errors);                    # in/out
-
-        my (@diff_RL, @diff_RR, );
-        array_diff( $file_R                  ,   # in
-                   \@original_minus_blanks_R ,   # in
-                   \@lines_R                 ,   # in
-                   "comment"                 ,   # in
-                   \@diff_RL, \@diff_RR      ,   # out
-                   \@Errors);                    # in/out
-        # each line of each file is now classified as
-        # code or comment
-
-#use Data::Dumper;
-#print Dumper("diff_LL", \@diff_LL, "diff_LR", \@diff_LR, );
-#print Dumper("diff_RL", \@diff_RL, "diff_RR", \@diff_RR, );
-#die;
-        # step 2: separate code from comments for L and R files
-        my @code_L = ();
-        my @code_R = ();
-        my @comm_L = ();
-        my @comm_R = ();
-        foreach my $line_info (@diff_LL) {
-            if      ($line_info->{'type'} eq "code"   ) {
-                push @code_L, $line_info->{char};
-            } elsif ($line_info->{'type'} eq "comment") {
-                push @comm_L, $line_info->{char};
-            } else {
-                die "Diff unexpected line type ",
-                    $line_info->{'type'}, "for $file_L line ",
-                    $line_info->{'lnum'};
-            }
-        }
-        foreach my $line_info (@diff_RL) {
-            if      ($line_info->{type} eq "code"   ) {
-                push @code_R, $line_info->{'char'};
-            } elsif ($line_info->{type} eq "comment") {
-                push @comm_R, $line_info->{'char'};
-            } else {
-                die "Diff unexpected line type ",
-                    $line_info->{'type'}, "for $file_R line ",
-                    $line_info->{'lnum'};
-            }
-        }
-
-        if ($opt_ignore_whitespace) {
-            # strip all whitespace from each line of source code
-            # and comments then use these stripped arrays in diffs
-            foreach (@code_L) { s/\s+//g }
-            foreach (@code_R) { s/\s+//g }
-            foreach (@comm_L) { s/\s+//g }
-            foreach (@comm_R) { s/\s+//g }
-        }
-        if ($opt_ignore_case) {
-            # change all text to lowercase in diffs
-            foreach (@code_L) { $_ = lc }
-            foreach (@code_R) { $_ = lc }
-            foreach (@comm_L) { $_ = lc }
-            foreach (@comm_R) { $_ = lc }
-        }
-        # step 3: compute code diffs
-        array_diff("$file_L v. $file_R"   ,   # in
-                   \@code_L               ,   # in
-                   \@code_R               ,   # in
-                   "revision"             ,   # in
-                   \@diff_LL, \@diff_LR   ,   # out
-                   \@Errors);                 # in/out
-#print Dumper("diff_LL", \@diff_LL, "diff_LR", \@diff_LR, );
-#print Dumper("diff_LR", \@diff_LR);
-        foreach my $line_info (@diff_LR) {
-            my $status = $line_info->{'desc'}; # same|added|removed|modified
-            ++$Delta_by_Language{$Lang_L}{'code'}{$status};
-            if ($opt_by_file) {
-                ++$Delta_by_File{$file_L}{'code'}{$status};
-            }
-        }
-#use Data::Dumper;
-#print Dumper("code diffs:", \@diff_LL, \@diff_LR);
-
-        # step 4: compute comment diffs
-        array_diff("$file_L v. $file_R"   ,   # in
-                   \@comm_L               ,   # in
-                   \@comm_R               ,   # in
-                   "revision"             ,   # in
-                   \@diff_LL, \@diff_LR   ,   # out
-                   \@Errors);                 # in/out
-#print Dumper("comment diff_LR", \@diff_LR);
-        foreach my $line_info (@diff_LR) {
-            my $status = $line_info->{'desc'}; # same|added|removed|modified
-            ++$Delta_by_Language{$Lang_L}{'comment'}{$status};
-            if ($opt_by_file) {
-                ++$Delta_by_File{$file_L}{'comment'}{$status};
-            }
-        }
-#print Dumper("comment diffs:", \@diff_LL, \@diff_LR);
-
-        # step 5: compute difference in blank lines (kind of pointless)
-        next if $Lang_L eq '(unknown)' or
-                $Lang_R eq '(unknown)';
-        my ($all_line_count_L,
-            $blank_count_L   ,
-            $comment_count_L ,
-           ) = call_counter($file_L, $Lang_L, \@Errors);
-
-        my ($all_line_count_R,
-            $blank_count_R   ,
-            $comment_count_R ,
-           ) = call_counter($file_R, $Lang_R, \@Errors);
-
-        if ($blank_count_L <  $blank_count_R) {
-            my $D = $blank_count_R - $blank_count_L;
-            $Delta_by_Language{$Lang_L}{'blank'}{'added'}   += $D;
-        } else {
-            my $D = $blank_count_L - $blank_count_R;
-            $Delta_by_Language{$Lang_L}{'blank'}{'removed'} += $D;
-        }
-        if ($opt_by_file) {
-            if ($blank_count_L <  $blank_count_R) {
-                my $D = $blank_count_R - $blank_count_L;
-                $Delta_by_File{$file_L}{'blank'}{'added'}   += $D;
-            } else {
-                my $D = $blank_count_L - $blank_count_R;
-                $Delta_by_File{$file_L}{'blank'}{'removed'} += $D;
-            }
-        }
-
-        my $code_count_L = $all_line_count_L-$blank_count_L-$comment_count_L;
-        if ($opt_by_file) {
-            $Results_by_File{$file_L}{'code'   } = $code_count_L    ;
-            $Results_by_File{$file_L}{'blank'  } = $blank_count_L   ;
-            $Results_by_File{$file_L}{'comment'} = $comment_count_L ;
-            $Results_by_File{$file_L}{'lang'   } = $Lang_L          ;
-            $Results_by_File{$file_L}{'nFiles' } = 1                ;
-        } else {
-            $Results_by_File{$file_L} = 1;  # just keep track of counted files
-        }
-
-        $Results_by_Language{$Lang_L}{'nFiles'}++;
-        $Results_by_Language{$Lang_L}{'code'}    += $code_count_L   ;
-        $Results_by_Language{$Lang_L}{'blank'}   += $blank_count_L  ;
-        $Results_by_Language{$Lang_L}{'comment'} += $comment_count_L;
-    }
-    if ($opt_diff_alignment) {
-        $alignment[$alignment_pairs_index] =~ s/UPDATE_ME/$n_file_pairs_compared/;
-        write_file($opt_diff_alignment, @alignment);
-    }
-
-}
-#use Data::Dumper;
-#print Dumper("Delta_by_Language:"  , \%Delta_by_Language);
-#print Dumper("Results_by_Language:", \%Results_by_Language);
-#print Dumper("Delta_by_File:"      , \%Delta_by_File);
-#print Dumper("Results_by_File:"    , \%Results_by_File);
-#die;
-my @ignored_reasons = map { "$_: $Ignored{$_}" } sort keys %Ignored;
-write_file($opt_ignored, @ignored_reasons   ) if $opt_ignored;
-write_file($opt_counted, sort keys %Results_by_File) if $opt_counted;
-# 1}}}
-# Step 7:  Assemble results.                   {{{1
-#
-my $end_time = get_time();
-printf "%8d file%s ignored.                           \n",
-    plural_form(scalar keys %Ignored) unless $opt_quiet;
-print_errors(\%Error_Codes, \@Errors) if @Errors;
-if (!%Delta_by_Language) {
-    print "Nothing to count.\n";
-    exit;
-}
-
-if ($opt_by_file) {
-    @Lines_Out = diff_report($VERSION, get_time() - $start_time,
-                            "by file",
-                            \%Delta_by_File, \%Scale_Factor);
-} else {
-    @Lines_Out = diff_report($VERSION, get_time() - $start_time,
-                            "by language",
-                            \%Delta_by_Language, \%Scale_Factor);
-}
-
-# 1}}}
-} else {
-# Step 4:  Separate code from non-code files.  {{{1
-my $fh = 0;
-if ($opt_list_file or $opt_vcs) {
-    my @list;
-    if ($opt_vcs) {
-        @list = invoke_generator($opt_vcs, \@ARGV);
-    } else {
-        @list = read_list_file($opt_list_file);
-    }
-    $fh = make_file_list(\@list, \%Error_Codes, \@Errors, \%Ignored);
-} else {
-    $fh = make_file_list(\@ARGV, \%Error_Codes, \@Errors, \%Ignored);
-    #     make_file_list populates global variable @file_list via call to
-    #     File::Find's find() which in turn calls files()
-}
-if ($opt_exclude_list_file) {
-    # note: process_exclude_list_file() references global @file_list
-    process_exclude_list_file($opt_exclude_list_file,
-                             \%Exclude_Dir,
-                             \%Ignored);
-}
-if ($opt_skip_win_hidden and $ON_WINDOWS) {
-    my @file_list_minus_hidded = ();
-    # eval code to run on Unix without 'missing Win32::File module' error.
-    my $win32_file_invocation = '
-        use Win32::File;
-        foreach my $F (@file_list) {
-            my $attr = undef;
-            Win32::File::GetAttributes($F, $attr);
-            if ($attr & HIDDEN) {
-                $Ignored{$F} = "Windows hidden file";
-                print "Ignoring $F since it is a Windows hidden file\n"
-                    if $opt_v > 1;
-            } else {
-                push @file_list_minus_hidded, $F;
-            }
-        }';
-    eval $win32_file_invocation;
-    @file_list = @file_list_minus_hidded;
-}
-#printf "%8d file%s excluded.                     \n",
-#   plural_form(scalar keys %Ignored)
-#   unless $opt_quiet;
-# die print ": ", join("\n: ", @file_list), "\n";
-# 1}}}
-# Step 5:  Remove duplicate files.             {{{1
-#
-my %Language           = ();
-my %unique_source_file = ();
-remove_duplicate_files($fh                          ,   # in
-                           \%Language               ,   # out
-                           \%unique_source_file     ,   # out
-                      \%Error_Codes                 ,   # in
-                           \@Errors                 ,   # out
-                           \%Ignored                );  # out
-printf "%8d unique file%s.                              \n",
-    plural_form(scalar keys %unique_source_file)
-    unless $opt_quiet;
-# 1}}}
-# Step 6:  Count code, comments, blank lines.  {{{1
-#
-
-my %Results_by_Language = ();
-my %Results_by_File     = ();
-my $nCounted = 0;
-foreach my $file (sort keys %unique_source_file) {
-    ++$nCounted;
-    printf "Counting:  %d\r", $nCounted
-        unless (!$opt_progress_rate or ($nCounted % $opt_progress_rate));
-    next if $Ignored{$file};
-    if ($opt_include_lang and not $Include_Language{$Language{$file}}) {
-        $Ignored{$file} = "--include-lang=$Language{$file}";
-        next;
-    }
-    if ($Exclude_Language{$Language{$file}}) {
-        $Ignored{$file} = "--exclude-lang=$Language{$file}";
-        next;
-    }
-    my $Filters_by_Language_Language_file = ! @{$Filters_by_Language{$Language{$file}} };
-    if ($Filters_by_Language_Language_file) {
-        if ($Language{$file} eq "(unknown)") {
-            $Ignored{$file} = "language unknown (#1)";
-        } else {
-            $Ignored{$file} = "missing Filters_by_Language{$Language{$file}}";
-        }
-        next;
-    }
-
-    my ($all_line_count, $blank_count, $comment_count, $code_count);
-    if ($opt_use_sloccount and $Language{$file} =~ /^(C|C\+\+|XML|PHP|Pascal|Java)$/) {
-        chomp ($blank_count     = `grep -Pcv '\\S' $file`);
-        chomp ($all_line_count  = `cat $file | wc -l`);
-        if      ($Language{$file} =~ /^(C|C\+\+)$/) {
-            $code_count = `cat '$file' | c_count      | head -n 1`;
-        } elsif ($Language{$file} eq "XML") {
-            $code_count = `cat '$file' | xml_count    | head -n 1`;
-        } elsif ($Language{$file} eq "PHP") {
-            $code_count = `cat '$file' | php_count    | head -n 1`;
-        } elsif ($Language{$file} eq "Pascal") {
-            $code_count = `cat '$file' | pascal_count | head -n 1`;
-        } elsif ($Language{$file} eq "Java") {
-            $code_count = `cat '$file' | java_count   | head -n 1`;
-        } else {
-            die "SLOCCount match failure: file=[$file] lang=[$Language{$file}]";
-        }
-        $code_count = substr($code_count, 0, -2);
-        $comment_count = $all_line_count - $code_count - $blank_count;
-    } else {
-        ($all_line_count,
-         $blank_count   ,
-         $comment_count ,) = call_counter($file, $Language{$file}, \@Errors);
-        $code_count = $all_line_count - $blank_count - $comment_count;
-    }
-    if ($opt_by_file) {
-        $Results_by_File{$file}{'code'   } = $code_count     ;
-        $Results_by_File{$file}{'blank'  } = $blank_count    ;
-        $Results_by_File{$file}{'comment'} = $comment_count  ;
-        $Results_by_File{$file}{'lang'   } = $Language{$file};
-        $Results_by_File{$file}{'nFiles' } = 1;
-    } else {
-        $Results_by_File{$file} = 1;  # just keep track of counted files
-    }
-
-    $Results_by_Language{$Language{$file}}{'nFiles'}++;
-    $Results_by_Language{$Language{$file}}{'code'}    += $code_count   ;
-    $Results_by_Language{$Language{$file}}{'blank'}   += $blank_count  ;
-    $Results_by_Language{$Language{$file}}{'comment'} += $comment_count;
-}
-my @ignored_reasons = map { "$_: $Ignored{$_}" } sort keys %Ignored;
-write_file($opt_ignored, @ignored_reasons   ) if $opt_ignored;
-write_file($opt_counted, sort keys %Results_by_File) if $opt_counted;
-# 1}}}
-# Step 7:  Assemble results.                   {{{1
-#
-my $end_time = get_time();
-printf "%8d file%s ignored.\n", plural_form(scalar keys %Ignored)
-    unless $opt_quiet;
-print_errors(\%Error_Codes, \@Errors) if @Errors;
-exit unless %Results_by_Language;
-
-generate_sql($end_time - $start_time,
-            \%Results_by_File, \%Scale_Factor) if $opt_sql;
-
-exit if $skip_generate_report;
-if      ($opt_by_file_by_lang) {
-    push @Lines_Out, generate_report( $VERSION, $end_time - $start_time,
-                                      "by file",
-                                      \%Results_by_File,    \%Scale_Factor);
-    push @Lines_Out, generate_report( $VERSION, $end_time - $start_time,
-                                      "by language",
-                                      \%Results_by_Language, \%Scale_Factor);
-} elsif ($opt_by_file) {
-    push @Lines_Out, generate_report( $VERSION, $end_time - $start_time,
-                                      "by file",
-                                      \%Results_by_File,    \%Scale_Factor);
-} else {
-    push @Lines_Out, generate_report( $VERSION, $end_time - $start_time,
-                                      "by language",
-                                      \%Results_by_Language, \%Scale_Factor);
-}
-# 1}}}
-}
-if ($opt_report_file) { write_file($opt_report_file, @Lines_Out); }
-else                  { print "\n", join("\n", @Lines_Out), "\n"; }
-if ($opt_count_diff) {
-    ++$opt_count_diff;
-    exit if $opt_count_diff > 3;
-    goto Top_of_Processing_Loop;
-}
-
-sub exclude_dir_validates {                  # {{{1
-    my ($rh_Exclude_Dir) = @_;
-    my $is_OK = 1;
-    foreach my $dir (keys %{$rh_Exclude_Dir}) {
-        if (($ON_WINDOWS and $dir =~ m{\\}) or ($dir =~ m{/})) {
-            $is_OK = 0;
-            warn "--exclude-dir '$dir' :  cannot specify directory paths\n";
-        }
-    }
-    if (!$is_OK) {
-        warn "Use '--fullpath --not-match-d=REGEX' instead\n";
-    }
-    return $is_OK;
-} # 1}}}
-sub process_exclude_list_file {              # {{{1
-    my ($list_file      , # in
-        $rh_exclude_dir , # out
-        $rh_ignored     , # out
-       ) = @_;
-    # note: references global @file_list
-    print "-> process_exclude_list_file($list_file)\n" if $opt_v > 2;
-    # reject a specific set of files and/or directories
-    my @reject_list   = read_list_file($list_file);
-    my @file_reject_list = ();
-    foreach my $F_or_D (@reject_list) {
-        if (is_dir($F_or_D)) {
-            $rh_exclude_dir->{$F_or_D} = 1;
-        } elsif (is_file($F_or_D)) {
-            push @file_reject_list, $F_or_D;
-        }
-    }
-
-    # Normalize file names for better comparison.
-    my %normalized_input   = normalize_file_names(@file_list);
-    my %normalized_reject  = normalize_file_names(@file_reject_list);
-    my %normalized_exclude = normalize_file_names(keys %{$rh_exclude_dir});
-    foreach my $F (keys %normalized_input) {
-        if ($normalized_reject{$F} or is_excluded($F, \%normalized_exclude)) {
-            my $orig_F = $normalized_input{$F};
-            $rh_ignored->{$orig_F} = "listed in exclusion file $opt_exclude_list_file";
-            print "Ignoring $orig_F because it appears in $opt_exclude_list_file\n"
-                if $opt_v > 1;
-        }
-    }
-    print "<- process_exclude_list_file\n" if $opt_v > 2;
-} # 1}}}
-sub combine_results {                        # {{{1
-    # returns 1 if the inputs are categorized by language
-    #         0 if no identifiable language was found
-    my ($ra_report_files, # in
-        $report_type    , # in  "by language" or "by report file"
-        $rhh_count      , # out count{TYPE}{nFiles|code|blank|comment|scaled}
-        $rhaa_Filters_by_Language , # in
-       ) = @_;
-
-    print "-> combine_results(report_type=$report_type)\n" if $opt_v > 2;
-    my $found_language = 0;
-
-    foreach my $file (@{$ra_report_files}) {
-        my $IN = new IO::File $file, "r";
-        if (!defined $IN) {
-            warn "Unable to read $file; ignoring.\n";
-            next;
-        }
-        while (<$IN>) {
-            next if /^(http|Language|SUM|-----)/;
-            if (!$opt_by_file  and
-                m{^(.*?)\s+         # language
-                   (\d+)\s+         # files
-                   (\d+)\s+         # blank
-                   (\d+)\s+         # comments
-                   (\d+)\s+         # code
-                   (                #    next four entries missing with -nno3
-                   x\s+             # x
-                   \d+\.\d+\s+      # scale
-                   =\s+             # =
-                   (\d+\.\d+)\s*    # scaled code
-                   )?
-                   $}x) {
-                if ($report_type eq "by language") {
-                    if (!defined $rhaa_Filters_by_Language->{$1}) {
-                        warn "Unrecognized language '$1' in $file ignored\n";
-                        next;
-                    }
-                    # above test necessary to avoid trying to sum reports
-                    # of reports (which have no language breakdown).
-                    $found_language = 1;
-                    $rhh_count->{$1   }{'nFiles' } += $2;
-                    $rhh_count->{$1   }{'blank'  } += $3;
-                    $rhh_count->{$1   }{'comment'} += $4;
-                    $rhh_count->{$1   }{'code'   } += $5;
-                    $rhh_count->{$1   }{'scaled' } += $7 if $opt_3;
-                } else {
-                    $rhh_count->{$file}{'nFiles' } += $2;
-                    $rhh_count->{$file}{'blank'  } += $3;
-                    $rhh_count->{$file}{'comment'} += $4;
-                    $rhh_count->{$file}{'code'   } += $5;
-                    $rhh_count->{$file}{'scaled' } += $7 if $opt_3;
-                }
-            } elsif ($opt_by_file  and
-                m{^(.*?)\s+         # language
-                   (\d+)\s+         # blank
-                   (\d+)\s+         # comments
-                   (\d+)\s+         # code
-                   (                #    next four entries missing with -nno3
-                   x\s+             # x
-                   \d+\.\d+\s+      # scale
-                   =\s+             # =
-                   (\d+\.\d+)\s*    # scaled code
-                   )?
-                   $}x) {
-                if ($report_type eq "by language") {
-                    next unless %{$rhaa_Filters_by_Language->{$1}};
-                    # above test necessary to avoid trying to sum reports
-                    # of reports (which have no language breakdown).
-                    $found_language = 1;
-                    $rhh_count->{$1   }{'nFiles' } +=  1;
-                    $rhh_count->{$1   }{'blank'  } += $2;
-                    $rhh_count->{$1   }{'comment'} += $3;
-                    $rhh_count->{$1   }{'code'   } += $4;
-                    $rhh_count->{$1   }{'scaled' } += $6 if $opt_3;
-                } else {
-                    $rhh_count->{$file}{'nFiles' } +=  1;
-                    $rhh_count->{$file}{'blank'  } += $2;
-                    $rhh_count->{$file}{'comment'} += $3;
-                    $rhh_count->{$file}{'code'   } += $4;
-                    $rhh_count->{$file}{'scaled' } += $6 if $opt_3;
-                }
-            }
-        }
-    }
-    print "<- combine_results\n" if $opt_v > 2;
-    return $found_language;
-} # 1}}}
-sub compute_denominator {                    # {{{1
-    my ($method, $nCode, $nComment, $nBlank, ) = @_;
-    print "-> compute_denominator\n" if $opt_v > 2;
-    my %den        = ( "c" => $nCode );
-       $den{"cm"}  = $den{"c"}  + $nComment;
-       $den{"cmb"} = $den{"cm"} + $nBlank;
-       $den{"cb"}  = $den{"c"}  + $nBlank;
-
-    print "<- compute_denominator\n" if $opt_v > 2;
-    return $den{ $method };
-} # 1}}}
-sub yaml_to_json_separators {                # {{{1
-    # YAML and JSON are closely related.  Their differences can be captured
-    # by trailing commas ($C), braces ($open_B, $close_B), and
-    # quotes around text ($Q).
-    my ($Q, $open_B, $close_B, $start, $C);
-    if ($opt_json) {
-       $C       = ',';
-       $Q       = '"';
-       $open_B  = '{';
-       $close_B = '}';
-       $start   = '{';
-    } else {
-       $C       = '';
-       $Q       = '' ;
-       $open_B  = '' ;
-       $close_B = '';
-       $start   = "---\n# $URL\n";
-    }
-    return ($Q, $open_B, $close_B, $start, $C);
-} # 1}}}
-sub diff_report     {                        # {{{1
-    # returns an array of lines containing the results
-    print "-> diff_report\n" if $opt_v > 2;
-
-    if ($opt_xml) {
-        print "<- diff_report\n" if $opt_v > 2;
-        return diff_xml_report(@_)
-###     return diff_xml_yaml_json_report(@_)
-    } elsif ($opt_yaml) {
-        print "<- diff_report\n" if $opt_v > 2;
-        return diff_yaml_report(@_)
-    } elsif ($opt_json) {
-        print "<- diff_report\n" if $opt_v > 2;
-        return diff_json_report(@_)
-    } elsif ($opt_csv or $opt_md) {
-        print "<- diff_report\n" if $opt_v > 2;
-        return diff_csv_report(@_)
-    }
-
-    my ($version    , # in
-        $elapsed_sec, # in
-        $report_type, # in  "by language" | "by report file" | "by file"
-        $rhhh_count , # in  count{TYPE}{nFiles|code|blank|comment}{a|m|r|s}
-        $rh_scale   , # in
-       ) = @_;
-
-#use Data::Dumper;
-#print "diff_report: ", Dumper($rhhh_count), "\n";
-    my @results       = ();
-
-    my $languages     = ();
-    my %sum           = (); # sum{nFiles|blank|comment|code}{same|modified|added|removed}
-    my $max_len       = 0;
-    foreach my $language (keys %{$rhhh_count}) {
-        foreach my $V (qw(nFiles blank comment code)) {
-            foreach my $S (qw(added same modified removed)) {
-                $rhhh_count->{$language}{$V}{$S} = 0 unless
-                    defined $rhhh_count->{$language}{$V}{$S};
-                $sum{$V}{$S}  += $rhhh_count->{$language}{$V}{$S};
-            }
-        }
-        $max_len      = length($language) if length($language) > $max_len;
-    }
-    my $column_1_offset = 0;
-       $column_1_offset = $max_len - 17 if $max_len > 17;
-    $elapsed_sec = 0.5 unless $elapsed_sec;
-
-    my $spacing_0 = 23;
-    my $spacing_1 = 13;
-    my $spacing_2 =  9;
-    my $spacing_3 = 17;
-    if (!$opt_3) {
-        $spacing_1 = 19;
-        $spacing_2 = 14;
-        $spacing_3 = 28;
-    }
-    $spacing_0 += $column_1_offset;
-    $spacing_1 += $column_1_offset;
-    $spacing_3 += $column_1_offset;
-    my %Format = (
-        '1' => { 'xml' => 'name="%s" ',
-                 'txt' => "\%-${spacing_0}s ",
-               },
-        '2' => { 'xml' => 'name="%s" ',
-                 'txt' => "\%-${spacing_3}s ",
-               },
-        '3' => { 'xml' => 'files_count="%d" ',
-                 'txt' => '%5d ',
-               },
-        '4' => { 'xml' => 'blank="%d" comment="%d" code="%d" ',
-                 'txt' => "\%${spacing_2}d \%${spacing_2}d \%${spacing_2}d",
-               },
-        '5' => { 'xml' => 'blank="%.2f" comment="%.2f" code="%d" ',
-                 'txt' => "\%3.2f \%3.2f \%${spacing_2}d",
-               },
-        '6' => { 'xml' => 'factor="%.2f" scaled="%.2f" ',
-                 'txt' => ' x %6.2f = %14.2f',
-               },
-    );
-    my $Style = "txt";
-       $Style = "xml" if $opt_xml ;
-       $Style = "xml" if $opt_yaml;  # not a typo; just set to anything but txt
-       $Style = "xml" if $opt_json;  # not a typo; just set to anything but txt
-       $Style = "xml" if $opt_csv ;  # not a typo; just set to anything but txt
-
-    my $hyphen_line = sprintf "%s", '-' x (79 + $column_1_offset);
-       $hyphen_line = sprintf "%s", '-' x (68 + $column_1_offset)
-            if (!$opt_3) and (68 + $column_1_offset) > 79;
-    my $data_line  = "";
-    my $first_column;
-    my $BY_LANGUAGE = 0;
-    my $BY_FILE     = 0;
-    if      ($report_type eq "by language") {
-        $first_column = "Language";
-        $BY_LANGUAGE  = 1;
-    } elsif ($report_type eq "by file")     {
-        $first_column = "File";
-        $BY_FILE      = 1;
-    } else {
-        $first_column = "Report File";
-    }
-
-    my $header_line  = sprintf "%s v %s", $URL, $version;
-    my $sum_files    = 1;
-    my $sum_lines    = 1;
-       $header_line .= sprintf("  T=%.2f s (%.1f files/s, %.1f lines/s)",
-                        $elapsed_sec           ,
-                        $sum_files/$elapsed_sec,
-                        $sum_lines/$elapsed_sec) unless $opt_sum_reports;
-    if ($Style eq "txt") {
-        push @results, output_header($header_line, $hyphen_line, $BY_FILE);
-    } elsif ($Style eq "csv") {
-        die "csv";
-    }
-
-    # column headers
-    if (!$opt_3 and $BY_FILE) {
-        my $spacing_n = $spacing_1 - 11;
-        $data_line  = sprintf "%-${spacing_n}s" , $first_column;
-    } else {
-        $data_line  = sprintf "%-${spacing_1}s ", $first_column;
-    }
-    if ($BY_FILE) {
-        $data_line .= sprintf "%${spacing_2}s"   , ""     ;
-    } else {
-        $data_line .= sprintf "%${spacing_2}s "  , "files";
-    }
-    my $PCT_symbol = "";
-       $PCT_symbol = " \%" if $opt_by_percent;
-    $data_line .= sprintf "%${spacing_2}s %${spacing_2}s %${spacing_2}s",
-        "blank${PCT_symbol}"         ,
-        "comment${PCT_symbol}"       ,
-        "code";
-
-    if ($Style eq "txt") {
-        push @results, $data_line;
-        push @results, $hyphen_line;
-    }
-
-####foreach my $lang_or_file (keys %{$rhhh_count}) {
-####    $rhhh_count->{$lang_or_file}{'code'} = 0 unless
-####        defined $rhhh_count->{$lang_or_file}{'code'};
-####}
-    foreach my $lang_or_file (sort {
-                                 $rhhh_count->{$b}{'code'} <=>
-                                 $rhhh_count->{$a}{'code'}
-                               }
-                          keys %{$rhhh_count}) {
-
-        if ($BY_FILE) {
-            push @results, rm_leading_tempdir($lang_or_file, \%TEMP_DIR);
-        } else {
-            push @results, $lang_or_file;
-        }
-        foreach my $S (qw(same modified added removed)) {
-            my $indent = $spacing_1 - 2;
-            my $line .= sprintf " %-${indent}s", $S;
-            if ($BY_FILE) {
-                $line .= sprintf "   ";
-            } else {
-                $line .= sprintf "  %${spacing_2}s", $rhhh_count->{$lang_or_file}{'nFiles'}{$S};
-            }
-            if ($opt_by_percent) {
-                my $DEN = compute_denominator($opt_by_percent  ,
-                    $rhhh_count->{$lang_or_file}{'code'}{$S}   ,
-                    $rhhh_count->{$lang_or_file}{'comment'}{$S},
-                    $rhhh_count->{$lang_or_file}{'blank'}{$S}  );
-                if ($rhhh_count->{$lang_or_file}{'code'}{$S} > 0) {
-                    $line .= sprintf " %14.2f %14.2f %${spacing_2}s",
-                        $rhhh_count->{$lang_or_file}{'blank'}{$S}   / $DEN * 100,
-                        $rhhh_count->{$lang_or_file}{'comment'}{$S} / $DEN * 100,
-                        $rhhh_count->{$lang_or_file}{'code'}{$S}    ;
-                } else {
-                    $line .= sprintf " %14.2f %14.2f %${spacing_2}s",
-                        0.0, 0.0, $rhhh_count->{$lang_or_file}{'code'}{$S}    ;
-                }
-            } else {
-                $line .= sprintf " %${spacing_2}s %${spacing_2}s %${spacing_2}s",
-                    $rhhh_count->{$lang_or_file}{'blank'}{$S}   ,
-                    $rhhh_count->{$lang_or_file}{'comment'}{$S} ,
-                    $rhhh_count->{$lang_or_file}{'code'}{$S}    ;
-            }
-            push @results, $line;
-        }
-    }
-    push @results, $hyphen_line;
-    push @results, "SUM:";
-    foreach my $S (qw(same modified added removed)) {
-        my $indent = $spacing_1 - 2;
-        my $line .= sprintf " %-${indent}s", $S;
-            if ($BY_FILE) {
-                $line .= sprintf "   ";
-            } else {
-                $line .= sprintf "  %${spacing_2}s", $sum{'nFiles'}{$S};
-            }
-        if ($opt_by_percent) {
-            my $DEN = compute_denominator($opt_by_percent,
-                $sum{'code'}{$S}, $sum{'comment'}{$S}, $sum{'blank'}{$S});
-            if ($sum{'code'}{$S} > 0) {
-                $line .= sprintf " %14.2f %14.2f %${spacing_2}s",
-                    $sum{'blank'}{$S}   / $DEN * 100,
-                    $sum{'comment'}{$S} / $DEN * 100,
-                    $sum{'code'}{$S}    ;
-            } else {
-                $line .= sprintf " %14.2f %14.2f %${spacing_2}s",
-                    0.0, 0.0, $sum{'code'}{$S}    ;
-            }
-        } else {
-            $line .= sprintf " %${spacing_2}s %${spacing_2}s %${spacing_2}s",
-                $sum{'blank'}{$S}   ,
-                $sum{'comment'}{$S} ,
-                $sum{'code'}{$S}    ;
-        }
-        push @results, $line;
-    }
-    push @results, $hyphen_line;
-    write_xsl_file() if $opt_xsl and $opt_xsl eq $CLOC_XSL;
-    print "<- diff_report\n" if $opt_v > 2;
-
-    return @results;
-} # 1}}}
-sub xml_yaml_or_json_header {                # {{{1
-    my ($URL, $version, $elapsed_sec, $sum_files, $sum_lines, $by_file) = @_;
-    print "-> xml_yaml_or_json_header\n" if $opt_v > 2;
-    my $header      = "";
-    my $file_rate   = $sum_files/$elapsed_sec;
-    my $line_rate   = $sum_lines/$elapsed_sec;
-    my $type        = "";
-       $type        = "diff_" if $opt_diff;
-    my $report_file = "";
-    if ($opt_report_file) {
-        if ($opt_sum_reports) {
-            if ($by_file) {
-                $report_file = "  <report_file>$opt_report_file.file</report_file>"
-            } else {
-                $report_file = "  <report_file>$opt_report_file.lang</report_file>"
-            }
-        } else {
-            $report_file = "  <report_file>$opt_report_file</report_file>"
-        }
-    }
-    if ($opt_xml) {
-        $header = "<?xml version=\"1.0\"?>";
-        $header .= "\n<?xml-stylesheet type=\"text/xsl\" href=\"" . $opt_xsl . "\"?>" if $opt_xsl;
-        $header .= "<${type}results>
-<header>
-  <cloc_url>$URL</cloc_url>
-  <cloc_version>$version</cloc_version>
-  <elapsed_seconds>$elapsed_sec</elapsed_seconds>
-  <n_files>$sum_files</n_files>
-  <n_lines>$sum_lines</n_lines>
-  <files_per_second>$file_rate</files_per_second>
-  <lines_per_second>$line_rate</lines_per_second>";
-        $header .= "\n$report_file"
-            if $opt_report_file;
-        $header .= "\n</header>";
-    } elsif ($opt_yaml or $opt_json) {
-        my ($Q, $open_B, $close_B, $start, $C) = yaml_to_json_separators();
-        $header = "${start}${Q}header${Q} : $open_B
-  ${Q}cloc_url${Q}           : ${Q}$URL${Q}${C}
-  ${Q}cloc_version${Q}       : ${Q}$version${Q}${C}
-  ${Q}elapsed_seconds${Q}    : $elapsed_sec${C}
-  ${Q}n_files${Q}            : $sum_files${C}
-  ${Q}n_lines${Q}            : $sum_lines${C}
-  ${Q}files_per_second${Q}   : $file_rate${C}
-  ${Q}lines_per_second${Q}   : $line_rate";
-        if ($opt_report_file) {
-            if ($opt_sum_reports) {
-                if ($by_file) {
-                    $header .= "$C\n  ${Q}report_file${Q}        : ${Q}$opt_report_file.file${Q}"
-                } else {
-                    $header .= "$C\n  ${Q}report_file${Q}        : ${Q}$opt_report_file.lang${Q}"
-                }
-            } else {
-                $header .= "$C\n  ${Q}report_file${Q}        : ${Q}$opt_report_file${Q}";
-            }
-        }
-        $header .= "${close_B}${C}";
-    }
-    print "<- xml_yaml_or_json_header\n" if $opt_v > 2;
-    return $header;
-} # 1}}}
-sub diff_yaml_report {                       # {{{1
-    # returns an array of lines containing the results
-    my ($version    , # in
-        $elapsed_sec, # in
-        $report_type, # in  "by language" | "by report file" | "by file"
-        $rhhh_count , # in  count{TYPE}{nFiles|code|blank|comment}{a|m|r|s}
-        $rh_scale   , # in
-       ) = @_;
-    print "-> diff_yaml_report\n" if $opt_v > 2;
-    $elapsed_sec = 0.5 unless $elapsed_sec;
-    my @results       = ();
-    my %sum           = ();
-    my ($sum_lines, $sum_files, $BY_FILE, $BY_LANGUAGE) =
-        diff_header_sum($report_type, $rhhh_count, \%sum);
-
-    if (!$ALREADY_SHOWED_HEADER) {
-        push @results,
-              xml_yaml_or_json_header($URL, $version, $elapsed_sec,
-                                 $sum_files, $sum_lines, $BY_FILE);
-        $ALREADY_SHOWED_HEADER = 1;
-    }
-    foreach my $S (qw(added same modified removed)) {
-        push @results, "$S :";
-        foreach my $F_or_L (keys %{$rhhh_count}) {
-            push @results, "  $F_or_L :";
-            foreach my $k (keys %{$rhhh_count->{$F_or_L}}) {
-                next if $k eq "lang"; # present only in those cases
-                                      # where code exists for action $S
-                $rhhh_count->{$F_or_L}{$k}{$S} = 0 unless
-                    defined $rhhh_count->{$F_or_L}{$k}{$S};
-                push @results,
-                    "    $k : $rhhh_count->{$F_or_L}{$k}{$S}";
-            }
-        }
-    }
-    print "<- diff_yaml_report\n" if $opt_v > 2;
-    return @results;
-} # 1}}}
-sub diff_json_report {                       # {{{1
-    # returns an array of lines containing the results
-    my ($version    , # in
-        $elapsed_sec, # in
-        $report_type, # in  "by language" | "by report file" | "by file"
-        $rhhh_count , # in  count{TYPE}{nFiles|code|blank|comment}{a|m|r|s}
-        $rh_scale   , # in
-       ) = @_;
-    print "-> diff_json_report\n" if $opt_v > 2;
-    $elapsed_sec = 0.5 unless $elapsed_sec;
-    my @results       = ();
-    my %sum           = ();
-    my ($sum_lines, $sum_files, $BY_FILE, $BY_LANGUAGE) =
-        diff_header_sum($report_type, $rhhh_count, \%sum);
-
-    if (!$ALREADY_SHOWED_HEADER) {
-        push @results,
-              xml_yaml_or_json_header($URL, $version, $elapsed_sec,
-                                 $sum_files, $sum_lines, $BY_FILE);
-        $ALREADY_SHOWED_HEADER = 1;
-    }
-    foreach my $S (qw(added same modified removed)) {
-        push @results, " \"$S\" : {";
-        foreach my $F_or_L (keys %{$rhhh_count}) {
-            push @results, "  \"$F_or_L\" : {";
-            foreach my $k (keys %{$rhhh_count->{$F_or_L}}) {
-                next if $k eq "lang"; # present only in those cases
-                                      # where code exists for action $S
-                $rhhh_count->{$F_or_L}{$k}{$S} = 0 unless
-                    defined $rhhh_count->{$F_or_L}{$k}{$S};
-                push @results,
-                    "    \"$k\" : \"$rhhh_count->{$F_or_L}{$k}{$S}\",";
-            }
-            $results[-1] =~ s/,\s*$//;
-            push @results, "  },"
-        }
-        $results[-1] =~ s/,\s*$//;
-        push @results, "  },"
-    }
-    $results[-1] =~ s/,\s*$//;
-    push @results, "}";
-    print "<- diff_json_report\n" if $opt_v > 2;
-    return @results;
-} # 1}}}
-sub diff_header_sum {                        # {{{1
-    my ($report_type, # in  "by language" | "by report file" | "by file"
-        $rhhh_count , # in  count{TYPE}{nFiles|code|blank|comment}{a|m|r|s}
-        $rhh_sum    , # out sum{nFiles|blank|comment|code}{same|modified|added|removed}
-       ) = @_;
-
-    my $sum_files = 0;
-    my $sum_lines = 0;
-    foreach my $language (keys %{$rhhh_count}) {
-        foreach my $V (qw(nFiles blank comment code)) {
-            foreach my $S (qw(added same modified removed)) {
-                $rhhh_count->{$language}{$V}{$S} = 0 unless
-                    defined $rhhh_count->{$language}{$V}{$S};
-                $rhh_sum->{$V}{$S}  += $rhhh_count->{$language}{$V}{$S};
-                if ($V eq "nFiles") {
-                    $sum_files += $rhhh_count->{$language}{$V}{$S};
-                } else {
-                    $sum_lines += $rhhh_count->{$language}{$V}{$S};
-                }
-            }
-        }
-    }
-
-    my $BY_LANGUAGE = 0;
-    my $BY_FILE     = 0;
-    if      ($report_type eq "by language") {
-        $BY_LANGUAGE  = 1;
-    } elsif ($report_type eq "by file")     {
-        $BY_FILE      = 1;
-    }
-    return $sum_lines, $sum_files, $BY_FILE, $BY_LANGUAGE;
-} # 1}}}
-sub diff_xml_report {                        # {{{1
-    # returns an array of lines containing the results
-    my ($version    , # in
-        $elapsed_sec, # in
-        $report_type, # in  "by language" | "by report file" | "by file"
-        $rhhh_count , # in  count{TYPE}{nFiles|code|blank|comment}{a|m|r|s}
-        $rh_scale   , # in
-       ) = @_;
-    print "-> diff_xml_report\n" if $opt_v > 2;
-    my ($Q, $open_B, $close_B, $start, $C) = yaml_to_json_separators();
-
-#print "diff_report: ", Dumper($rhhh_count), "\n";
-    $elapsed_sec = 0.5 unless $elapsed_sec;
-    my @results       = ();
-    my %sum           = ();
-    my $languages     = ();
-
-    my ($sum_lines, $sum_files, $BY_FILE, $BY_LANGUAGE) =
-        diff_header_sum($report_type, $rhhh_count, \%sum);
-
-    my $data_line   = "";
-
-    if (!$ALREADY_SHOWED_HEADER) {
-        push @results,
-              xml_yaml_or_json_header($URL, $version, $elapsed_sec,
-                                 $sum_files, $sum_lines, $BY_FILE);
-        $ALREADY_SHOWED_HEADER = 1;
-    }
-
-    foreach my $S (qw(same modified added removed)) {
-        push @results, "  <$S>";
-        foreach my $lang_or_file (sort {
-                                     $rhhh_count->{$b}{'code'} <=>
-                                     $rhhh_count->{$a}{'code'}
-                                   }
-                              keys %{$rhhh_count}) {
-            my $L = "";
-
-            if ($BY_FILE) {
-                $L .= sprintf "    <file name=\"%s\" files_count=\"1\" ",
-                    xml_metachars(
-                        rm_leading_tempdir($lang_or_file, \%TEMP_DIR));
-            } else {
-                $L .= sprintf "    <language name=\"%s\" files_count=\"%d\" ",
-                        $lang_or_file ,
-                        $rhhh_count->{$lang_or_file}{'nFiles'}{$S};
-            }
-            if ($opt_by_percent) {
-              my $DEN = compute_denominator($opt_by_percent            ,
-                            $rhhh_count->{$lang_or_file}{'code'}{$S}   ,
-                            $rhhh_count->{$lang_or_file}{'comment'}{$S},
-                            $rhhh_count->{$lang_or_file}{'blank'}{$S}  );
-              foreach my $T (qw(blank comment)) {
-                  if ($rhhh_count->{$lang_or_file}{'code'}{$S} > 0) {
-                    $L .= sprintf "%s=\"%.2f\" ",
-                            $T, $rhhh_count->{$lang_or_file}{$T}{$S} / $DEN * 100;
-                  } else {
-                    $L .= sprintf "%s=\"0.0\" ", $T;
-                  }
-              }
-              foreach my $T (qw(code)) {
-                  $L .= sprintf "%s=\"%d\" ",
-                          $T, $rhhh_count->{$lang_or_file}{$T}{$S};
-              }
-            } else {
-              foreach my $T (qw(blank comment code)) {
-                  $L .= sprintf "%s=\"%d\" ",
-                          $T, $rhhh_count->{$lang_or_file}{$T}{$S};
-              }
-            }
-            push @results, $L . "/>";
-        }
-
-
-        my $L = sprintf "    <total sum_files=\"%d\" ", $sum{'nFiles'}{$S};
-        if ($opt_by_percent) {
-          my $DEN = compute_denominator($opt_by_percent,
-                        $sum{'code'}{$S}   ,
-                        $sum{'comment'}{$S},
-                        $sum{'blank'}{$S}  );
-          foreach my $V (qw(blank comment)) {
-              if ($sum{'code'}{$S} > 0) {
-                  $L .= sprintf "%s=\"%.2f\" ", $V, $sum{$V}{$S} / $DEN * 100;
-              } else {
-                  $L .= sprintf "%s=\"0.0\" ", $V;
-              }
-          }
-          foreach my $V (qw(code)) {
-              $L .= sprintf "%s=\"%d\" ", $V, $sum{$V}{$S};
-          }
-        } else {
-          foreach my $V (qw(blank comment code)) {
-              $L .= sprintf "%s=\"%d\" ", $V, $sum{$V}{$S};
-          }
-        }
-        push @results, $L . "/>";
-        push @results, "  </$S>";
-    }
-
-    push @results, "</diff_results>";
-    write_xsl_file() if $opt_xsl and $opt_xsl eq $CLOC_XSL;
-    print "<- diff_xml_report\n" if $opt_v > 2;
-    return @results;
-} # 1}}}
-sub diff_csv_report {                        # {{{1
-    # returns an array of lines containing the results
-    my ($version    , # in
-        $elapsed_sec, # in
-        $report_type, # in  "by language" | "by report file" | "by file"
-        $rhhh_count , # in  count{TYPE}{nFiles|code|blank|comment}{a|m|r|s}
-        $rh_scale   , # in  unused
-       ) = @_;
-    print "-> diff_csv_report\n" if $opt_v > 2;
-
-#use Data::Dumper;
-#print "diff_csv_report: ", Dumper($rhhh_count), "\n";
-#die;
-    my @results       = ();
-    my $languages     = ();
-
-    my $data_line   = "";
-    my $BY_LANGUAGE = 0;
-    my $BY_FILE     = 0;
-    if      ($report_type eq "by language") {
-        $BY_LANGUAGE  = 1;
-    } elsif ($report_type eq "by file")     {
-        $BY_FILE      = 1;
-    }
-    my $DELIM = ",";
-       $DELIM = $opt_csv_delimiter if defined $opt_csv_delimiter;
-
-    $elapsed_sec = 0.5 unless $elapsed_sec;
-
-    my $line = "Language${DELIM} ";
-       $line = "File${DELIM} " if $BY_FILE;
-    foreach my $item (qw(files blank comment code)) {
-        next if $BY_FILE and $item eq 'files';
-        foreach my $symbol ( '==', '!=', '+', '-', ) {
-            $line .= "$symbol $item${DELIM} ";
-        }
-    }
-    $line .= "\"$URL v $version T=$elapsed_sec s\"";
-    push @results, $line;
-
-    foreach my $lang_or_file (keys %{$rhhh_count}) {
-        $rhhh_count->{$lang_or_file}{'code'}{'added'} = 0 unless
-            defined $rhhh_count->{$lang_or_file}{'code'};
-    }
-    foreach my $lang_or_file (sort {
-                                 $rhhh_count->{$b}{'code'} <=>
-                                 $rhhh_count->{$a}{'code'}
-                               }
-                          keys %{$rhhh_count}) {
-        if ($BY_FILE) {
-            $line = rm_leading_tempdir($lang_or_file, \%TEMP_DIR) . "$DELIM ";
-        } else {
-            $line = $lang_or_file . "${DELIM} ";
-        }
-        if ($opt_by_percent) {
-          foreach my $item (qw(nFiles)) {
-              next if $BY_FILE and $item eq 'nFiles';
-              foreach my $symbol (qw(same modified added removed)) {
-                  if (defined $rhhh_count->{$lang_or_file}{$item}{$symbol}) {
-                      $line .= "$rhhh_count->{$lang_or_file}{$item}{$symbol}${DELIM} ";
-                  } else {
-                      $line .= "0${DELIM} ";
-                  }
-              }
-          }
-          foreach my $item (qw(blank comment)) {
-              foreach my $symbol (qw(same modified added removed)) {
-                  if (defined $rhhh_count->{$lang_or_file}{$item}{$symbol} and
-                      defined $rhhh_count->{$lang_or_file}{'code'}{$symbol} and
-                      $rhhh_count->{$lang_or_file}{'code'}{$symbol} > 0) {
-                      $line .= sprintf("%.2f", $rhhh_count->{$lang_or_file}{$item}{$symbol} / $rhhh_count->{$lang_or_file}{'code'}{$symbol} * 100).${DELIM};
-                  } else {
-                      $line .= "0.00${DELIM} ";
-                  }
-              }
-          }
-          foreach my $item (qw(code)) {
-              foreach my $symbol (qw(same modified added removed)) {
-                  if (defined $rhhh_count->{$lang_or_file}{$item}{$symbol}) {
-                      $line .= "$rhhh_count->{$lang_or_file}{$item}{$symbol}${DELIM} ";
-                  } else {
-                      $line .= "0${DELIM} ";
-                  }
-              }
-          }
-        } else {
-          foreach my $item (qw(nFiles blank comment code)) {
-              next if $BY_FILE and $item eq 'nFiles';
-              foreach my $symbol (qw(same modified added removed)) {
-                  if (defined $rhhh_count->{$lang_or_file}{$item}{$symbol}) {
-                      $line .= "$rhhh_count->{$lang_or_file}{$item}{$symbol}${DELIM} ";
-                  } else {
-                      $line .= "0${DELIM} ";
-                  }
-              }
-          }
-        }
-        push @results, $line;
-    }
-
-    print "<- diff_csv_report\n" if $opt_v > 2;
-    return @results;
-} # 1}}}
-sub rm_leading_tempdir {                     # {{{1
-    my ($in_file, $rh_temp_dirs, ) = @_;
-    my $clean_filename = $in_file;
-    foreach my $temp_d (keys %{$rh_temp_dirs}) {
-        if ($ON_WINDOWS) {
-        # \ -> / necessary to allow the next if test's
-        # m{} to work in the presence of spaces in file names
-            $temp_d         =~ s{\\}{/}g;
-            $clean_filename =~ s{\\}{/}g;
-        }
-        if ($clean_filename =~ m{^$temp_d/}) {
-            $clean_filename =~ s{^$temp_d/}{};
-            last;
-        }
-    }
-    $clean_filename =~ s{/}{\\}g if $ON_WINDOWS; # then go back from / to \
-    return $clean_filename;
-} # 1}}}
-sub generate_sql    {                        # {{{1
-    my ($elapsed_sec, # in
-        $rhh_count  , # in  count{TYPE}{lang|code|blank|comment|scaled}
-        $rh_scale   , # in
-       ) = @_;
-    print "-> generate_sql\n" if $opt_v > 2;
-
-#print "generate_sql A [$opt_sql_project]\n";
-    $opt_sql_project = cwd() unless defined $opt_sql_project;
-    $opt_sql_project = '' unless defined $opt_sql_project; # have seen cwd() fail
-#print "generate_sql B [$opt_sql_project]\n";
-    $opt_sql_project =~ s{/}{\\}g if $ON_WINDOWS;
-#print "generate_sql C [$opt_sql_project]\n";
-
-    my $schema = undef;
-    if ($opt_sql_style eq "oracle") {
-        $schema = "
-CREATE TABLE metadata
-(
-  timestamp   TIMESTAMP,
-  project     VARCHAR2(500 CHAR),
-  elapsed_s   NUMBER(10, 6)
-)
-/
-
-CREATE TABLE t
-(
-  project        VARCHAR2(500 CHAR),
-  language       VARCHAR2(500 CHAR),
-  file_fullname  VARCHAR2(500 CHAR),
-  file_dirname   VARCHAR2(500 CHAR),
-  file_basename  VARCHAR2(500 CHAR),
-  nblank         INTEGER,
-  ncomment       INTEGER,
-  ncode          INTEGER,
-  nscaled        NUMBER(10, 6)
-)
-/
-
-";
-    } else {
-        $schema = "
-create table metadata (          -- $URL v $VERSION
-                timestamp varchar(500),
-                Project   varchar(500),
-                elapsed_s real);
-create table t        (
-                Project       varchar(500)   ,
-                Language      varchar(500)   ,
-                File          varchar(500)   ,
-                File_dirname  varchar(500)   ,
-                File_basename varchar(500)   ,
-                nBlank        integer        ,
-                nComment      integer        ,
-                nCode         integer        ,
-                nScaled       real           );
-";
-    }
-    $opt_sql = "-" if $opt_sql eq "1";
-
-    my $open_mode = ">";
-       $open_mode = ">>" if $opt_sql_append;
-
-    my $fh = new IO::File; # $opt_sql, "w";
-    if (!$fh->open("${open_mode}${opt_sql}")) {
-        die "Unable to write to $opt_sql  $!\n";
-    }
-    print $fh $schema unless defined $opt_sql_append;
-
-    if ($opt_sql_style eq "oracle") {
-        printf $fh "insert into metadata values(TO_TIMESTAMP('%s','yyyy-mm-dd hh24:mi:ss'), '%s', %f);\n",
-                    strftime("%Y-%m-%d %H:%M:%S", localtime(time())),
-                    $opt_sql_project, $elapsed_sec;
-    } else {
-        print $fh "begin transaction;\n";
-        printf $fh "insert into metadata values('%s', '%s', %f);\n",
-                    strftime("%Y-%m-%d %H:%M:%S", localtime(time())),
-                    $opt_sql_project, $elapsed_sec;
-    }
-
-    my $nIns = 0;
-    foreach my $file (keys %{$rhh_count}) {
-        my $language = $rhh_count->{$file}{'lang'};
-        my $clean_filename = $file;
-        # If necessary (that is, if the input contained an
-        # archive file [.tar.gz, etc]), strip the temporary
-        # directory name which was used to expand the archive
-        # from the file name.
-
-        $clean_filename = rm_leading_tempdir($clean_filename, \%TEMP_DIR);
-        $clean_filename =~ s/\'/''/g;  # double embedded single quotes
-                                       # to escape them
-
-        printf $fh "insert into t values('%s', '%s', '%s', '%s', '%s', " .
-                   "%d, %d, %d, %f);\n",
-                    $opt_sql_project           ,
-                    $language                  ,
-                    $clean_filename            ,
-                    dirname( $clean_filename)  ,
-                    basename($clean_filename)  ,
-                    $rhh_count->{$file}{'blank'},
-                    $rhh_count->{$file}{'comment'},
-                    $rhh_count->{$file}{'code'}   ,
-                    $rhh_count->{$file}{'code'}*$rh_scale->{$language};
-
-        ++$nIns;
-        if (!($nIns % 10_000) and ($opt_sql_style ne "oracle")) {
-            print $fh "commit;\n";
-            print $fh "begin transaction;\n";
-        }
-    }
-    if ($opt_sql_style ne "oracle") {
-        print $fh "commit;\n";
-    }
-
-    $fh->close unless $opt_sql eq "-"; # don't try to close STDOUT
-    print "<- generate_sql\n" if $opt_v > 2;
-
-    # sample query:
-    #
-    #   select project, language,
-    #          sum(nCode)     as Code,
-    #          sum(nComment)  as Comments,
-    #          sum(nBlank)    as Blank,
-    #          sum(nCode)+sum(nComment)+sum(nBlank) as All_Lines,
-    #          100.0*sum(nComment)/(sum(nCode)+sum(nComment)) as Comment_Pct
-    #          from t group by Project, Language order by Project, Code desc;
-    #
-} # 1}}}
-sub output_header   {                        # {{{1
-    my ($header_line,
-        $hyphen_line,
-        $BY_FILE    ,)    = @_;
-    print "-> output_header\n" if $opt_v > 2;
-    my @R = ();
-    if      ($opt_xml) {
-        if (!$ALREADY_SHOWED_XML_SECTION) {
-            push @R, "<?xml version=\"1.0\"?>";
-            push @R, '<?xml-stylesheet type="text/xsl" href="' .
-                            $opt_xsl . '"?>' if $opt_xsl;
-            push @R, "<results>";
-            push @R, "<header>$header_line</header>";
-            $ALREADY_SHOWED_XML_SECTION = 1;
-        }
-        if ($BY_FILE) {
-            push @R, "<files>";
-        } else {
-            push @R, "<languages>";
-        }
-    } elsif ($opt_yaml) {
-        push @R, "---\n# $header_line";
-    } elsif ($opt_csv or $opt_md) {
-        # append the header to the end of the column headers
-        # to keep the output a bit cleaner from a spreadsheet
-        # perspective
-    } else {
-        if ($ALREADY_SHOWED_HEADER) {
-            push @R, "";
-        } else {
-            push @R, $header_line;
-            $ALREADY_SHOWED_HEADER = 1;
-        }
-        push @R, $hyphen_line;
-    }
-    print "<- output_header\n" if $opt_v > 2;
-    return @R;
-} # 1}}}
-sub generate_report {                        # {{{1
-    # returns an array of lines containing the results
-    my ($version    , # in
-        $elapsed_sec, # in
-        $report_type, # in  "by language" | "by report file" | "by file"
-        $rhh_count  , # in  count{TYPE}{nFiles|code|blank|comment|scaled}
-        $rh_scale   , # in
-       ) = @_;
-
-    print "-> generate_report\n" if $opt_v > 2;
-    my $DELIM = ",";
-       $DELIM = $opt_csv_delimiter if defined $opt_csv_delimiter;
-       $DELIM = "|" if defined $opt_md;
-
-    my @results       = ();
-
-    my $languages     = ();
-
-    my $sum_files     = 0;
-    my $sum_code      = 0;
-    my $sum_blank     = 0;
-    my $sum_comment   = 0;
-    my $max_len       = 0;
-    foreach my $language (keys %{$rhh_count}) {
-        $sum_files   += $rhh_count->{$language}{'nFiles'} ;
-        $sum_blank   += $rhh_count->{$language}{'blank'}  ;
-        $sum_comment += $rhh_count->{$language}{'comment'};
-        $sum_code    += $rhh_count->{$language}{'code'}   ;
-        $max_len      = length($language) if length($language) > $max_len;
-    }
-    my $column_1_offset = 0;
-       $column_1_offset = $max_len - 17 if $max_len > 17;
-    my $sum_lines = $sum_blank + $sum_comment + $sum_code;
-    $elapsed_sec = 0.5 unless $elapsed_sec;
-
-    my $spacing_0 = 23;
-    my $spacing_1 = 13;
-    my $spacing_2 =  9;
-    my $spacing_3 = 17;
-    if (!$opt_3) {
-        $spacing_1 = 19;
-        $spacing_2 = 14;
-        $spacing_3 = 28;
-    }
-    $spacing_0 += $column_1_offset;
-    $spacing_1 += $column_1_offset;
-    $spacing_3 += $column_1_offset;
-    my %Format = (
-        '1' => { 'xml' => 'name="%s" ',
-                 'txt' => "\%-${spacing_0}s ",
-               },
-        '2' => { 'xml' => 'name="%s" ',
-                 'txt' => "\%-${spacing_3}s ",
-               },
-        '3' => { 'xml' => 'files_count="%d" ',
-                 'txt' => '%5d ',
-               },
-        '4' => { 'xml' => 'blank="%d" comment="%d" code="%d" ',
-                 'txt' => "\%${spacing_2}d \%${spacing_2}d \%${spacing_2}d",
-               },
-        '5' => { 'xml' => 'blank="%3.2f" comment="%3.2f" code="%d" ',
-                 'txt' => "\%14.2f \%14.2f \%${spacing_2}d",
-               },
-        '6' => { 'xml' => 'factor="%.2f" scaled="%.2f" ',
-                 'txt' => ' x %6.2f = %14.2f',
-               },
-    );
-    my $Style = "txt";
-       $Style = "xml" if $opt_xml ;
-       $Style = "xml" if $opt_yaml;  # not a typo; just set to anything but txt
-       $Style = "xml" if $opt_json;  # not a typo; just set to anything but txt
-       $Style = "xml" if $opt_csv ;  # not a typo; just set to anything but txt
-
-    my $hyphen_line = sprintf "%s", '-' x (79 + $column_1_offset);
-       $hyphen_line = sprintf "%s", '-' x (68 + $column_1_offset)
-            if (!$opt_sum_reports) and (!$opt_3) and (68 + $column_1_offset) > 79;
-    my $data_line  = "";
-    my $first_column;
-    my $BY_LANGUAGE = 0;
-    my $BY_FILE     = 0;
-    if      ($report_type eq "by language") {
-        $first_column = "Language";
-        $BY_LANGUAGE  = 1;
-    } elsif ($report_type eq "by file")     {
-        $first_column = "File";
-        $BY_FILE      = 1;
-    } elsif ($report_type eq "by report file")     {
-        $first_column = "File";
-    } else {
-        $first_column = "Report File";
-    }
-
-    my $header_line  = sprintf "%s v %s", $URL, $version;
-       $header_line .= sprintf("  T=%.2f s (%.1f files/s, %.1f lines/s)",
-                        $elapsed_sec           ,
-                        $sum_files/$elapsed_sec,
-                        $sum_lines/$elapsed_sec) unless $opt_sum_reports;
-    if ($opt_xml or $opt_yaml or $opt_json) {
-        if (!$ALREADY_SHOWED_HEADER) {
-            push @results, xml_yaml_or_json_header($URL, $version, $elapsed_sec,
-                                                   $sum_files, $sum_lines, $BY_FILE);
-            $ALREADY_SHOWED_HEADER = 1 unless $opt_sum_reports;
-            # --sum-reports yields two xml or yaml files, one by
-            # language and one by report file, each of which needs a header
-        }
-        if ($opt_xml) {
-            if ($BY_FILE or ($report_type eq "by report file")) {
-                push @results, "<files>";
-            } else {
-                push @results, "<languages>";
-            }
-        }
-    } else {
-        push @results, output_header($header_line, $hyphen_line, $BY_FILE);
-    }
-
-    if ($Style eq "txt") {
-        # column headers
-        if (!$opt_3 and $BY_FILE) {
-            my $spacing_n = $spacing_1 - 11;
-            $data_line  = sprintf "%-${spacing_n}s ", $first_column;
-        } else {
-            $data_line  = sprintf "%-${spacing_1}s ", $first_column;
-        }
-        if ($BY_FILE) {
-            $data_line .= sprintf "%${spacing_2}s "  , " "    ;
-        } else {
-            $data_line .= sprintf "%${spacing_2}s "  , "files";
-        }
-        my $PCT_symbol = "";
-           $PCT_symbol = " \%" if $opt_by_percent;
-        $data_line .= sprintf "%${spacing_2}s %${spacing_2}s %${spacing_2}s",
-            "blank${PCT_symbol}"   ,
-            "comment${PCT_symbol}" ,
-            "code";
-        $data_line .= sprintf " %8s   %14s",
-            "scale"         ,
-            "3rd gen. equiv"
-              if $opt_3;
-        if ($opt_md) {
-            my @col_header  = ();
-            if ($data_line =~ m{\s%}) {
-                $data_line =~ s{\s%}{_%}g;
-                foreach my $w ( split(' ', $data_line) ) {
-                    $w =~ s{_%}{ %};
-                    push @col_header, $w;
-                }
-            } else {
-                push @col_header, split(' ', $data_line);
-            }
-            my @col_hyphens    = ( '-------:') x scalar(@col_header);
-               $col_hyphens[0] =   ':-------'; # first column left justified
-            push @results, join("|", @col_header );
-            push @results, join("|", @col_hyphens);
-        } else {
-            push @results, $data_line;
-            push @results, $hyphen_line;
-        }
-    }
-
-    if ($opt_csv)  {
-        my $header2;
-        if ($BY_FILE) {
-            $header2 = "language${DELIM}filename";
-        } else {
-            $header2 = "files${DELIM}language";
-        }
-        $header2 .= "${DELIM}blank${DELIM}comment${DELIM}code";
-        $header2 .= "${DELIM}scale${DELIM}3rd gen. equiv" if $opt_3;
-        $header2 .= ${DELIM} . '"' . $header_line . '"';
-        push @results, $header2;
-    }
-
-    my $sum_scaled = 0;
-####foreach my $lang_or_file (keys %{$rhh_count}) {
-####    $rhh_count->{$lang_or_file}{'code'} = 0 unless
-####        defined $rhh_count->{$lang_or_file}{'code'};
-####}
-    foreach my $lang_or_file (sort {
-                                 $rhh_count->{$b}{'code'} <=>
-                                 $rhh_count->{$a}{'code'}
-                               }
-                          keys %{$rhh_count}) {
-        next if $lang_or_file eq "by report file";
-        my ($factor, $scaled);
-        if ($BY_LANGUAGE or $BY_FILE) {
-            $factor = 1;
-            if ($BY_LANGUAGE) {
-                if (defined $rh_scale->{$lang_or_file}) {
-                    $factor = $rh_scale->{$lang_or_file};
-                } else {
-                    warn "No scale factor for $lang_or_file; using 1.00";
-                }
-            } else { # by individual code file
-                if ($report_type ne "by report file") {
-                    next unless defined $rhh_count->{$lang_or_file}{'lang'};
-                    next unless defined $rh_scale->{$rhh_count->{$lang_or_file}{'lang'}};
-                    $factor = $rh_scale->{$rhh_count->{$lang_or_file}{'lang'}};
-                }
-            }
-            $scaled = $factor*$rhh_count->{$lang_or_file}{'code'};
-        } else {
-            if (!defined $rhh_count->{$lang_or_file}{'scaled'}) {
-                $opt_3 = 0;
-                # If we're summing together files previously generated
-                # with --no3 then rhh_count->{$lang_or_file}{'scaled'}
-                # this variable will be undefined.  That should only
-                # happen when summing together by file however.
-            } elsif ($BY_LANGUAGE) {
-                warn "Missing scaled language info for $lang_or_file\n";
-            }
-            if ($opt_3) {
-                $scaled =         $rhh_count->{$lang_or_file}{'scaled'};
-                $factor = $scaled/$rhh_count->{$lang_or_file}{'code'};
-            }
-        }
-
-        if ($BY_FILE) {
-            my $clean_filename = rm_leading_tempdir($lang_or_file, \%TEMP_DIR);
-               $clean_filename = xml_metachars($clean_filename) if $opt_xml;
-            $data_line  = sprintf $Format{'1'}{$Style}, $clean_filename;
-        } else {
-            $data_line  = sprintf $Format{'2'}{$Style}, $lang_or_file;
-        }
-        $data_line .= sprintf $Format{3}{$Style}  ,
-                        $rhh_count->{$lang_or_file}{'nFiles'} unless $BY_FILE;
-        if ($opt_by_percent) {
-          my $DEN = compute_denominator($opt_by_percent       ,
-                        $rhh_count->{$lang_or_file}{'code'}   ,
-                        $rhh_count->{$lang_or_file}{'comment'},
-                        $rhh_count->{$lang_or_file}{'blank'}  );
-          $data_line .= sprintf $Format{5}{$Style}  ,
-              $rhh_count->{$lang_or_file}{'blank'}   / $DEN * 100,
-              $rhh_count->{$lang_or_file}{'comment'} / $DEN * 100,
-              $rhh_count->{$lang_or_file}{'code'}   ;
-        } else {
-          $data_line .= sprintf $Format{4}{$Style}  ,
-              $rhh_count->{$lang_or_file}{'blank'}  ,
-              $rhh_count->{$lang_or_file}{'comment'},
-              $rhh_count->{$lang_or_file}{'code'}   ;
-        }
-        $data_line .= sprintf $Format{6}{$Style}  ,
-            $factor                               ,
-            $scaled if $opt_3;
-        $sum_scaled  += $scaled if $opt_3;
-
-        if ($opt_xml) {
-            if (defined $rhh_count->{$lang_or_file}{'lang'}) {
-                my $lang = $rhh_count->{$lang_or_file}{'lang'};
-                if (!defined $languages->{$lang}) {
-                    $languages->{$lang} = $lang;
-                }
-                $data_line.=' language="' . $lang . '" ';
-            }
-            if ($BY_FILE or ($report_type eq "by report file")) {
-                push @results, "  <file " . $data_line . "/>";
-            } else {
-                push @results, "  <language " . $data_line . "/>";
-            }
-        } elsif ($opt_yaml or $opt_json) {
-            my ($Q, $open_B, $close_B, $start, $C) = yaml_to_json_separators();
-            push @results,"${Q}$lang_or_file${Q} :$open_B";
-            push @results,"  ${Q}nFiles${Q}: " . $rhh_count->{$lang_or_file}{'nFiles'} . $C
-                unless $BY_FILE;
-            if ($opt_by_percent) {
-              my $DEN = compute_denominator($opt_by_percent       ,
-                            $rhh_count->{$lang_or_file}{'code'}   ,
-                            $rhh_count->{$lang_or_file}{'comment'},
-                            $rhh_count->{$lang_or_file}{'blank'}  );
-              push @results,"  ${Q}blank_pct${Q}: "   .
-                sprintf("%3.2f", $rhh_count->{$lang_or_file}{'blank'} / $DEN * 100) . $C;
-              push @results,"  ${Q}comment_pct${Q}: " .
-                sprintf("%3.2f", $rhh_count->{$lang_or_file}{'comment'} / $DEN * 100) . $C;
-              push @results,"  ${Q}code${Q}: "    . $rhh_count->{$lang_or_file}{'code'}  . $C;
-            } else {
-              push @results,"  ${Q}blank${Q}: "   . $rhh_count->{$lang_or_file}{'blank'}   . $C;
-              push @results,"  ${Q}comment${Q}: " . $rhh_count->{$lang_or_file}{'comment'} . $C;
-              push @results,"  ${Q}code${Q}: "    . $rhh_count->{$lang_or_file}{'code'}    . $C;
-            }
-            push @results,"  ${Q}language${Q}: "  . $Q . $rhh_count->{$lang_or_file}{'lang'} . $Q . $C
-                if $BY_FILE;
-            if ($opt_3) {
-                push @results, "  ${Q}scaled${Q}: " . $scaled . $C;
-                push @results, "  ${Q}factor${Q}: " . $factor . $C;
-            }
-            if ($opt_json) { # replace the trailing comma with }, on the last line
-                $results[-1] =~ s/,\s*$/},/;
-            }
-        } elsif ($opt_csv or $opt_md) {
-            my $extra_3 = "";
-               $extra_3 = "${DELIM}$factor${DELIM}$scaled" if $opt_3;
-            my $first_column = undef;
-            my $clean_name   = $lang_or_file;
-            my $str;
-            if ($opt_csv) {
-                if ($BY_FILE) {
-                    $first_column = $rhh_count->{$lang_or_file}{'lang'};
-                    $clean_name   = rm_leading_tempdir($lang_or_file, \%TEMP_DIR);
-                } else {
-                    $first_column = $rhh_count->{$lang_or_file}{'nFiles'};
-                }
-                $str = $first_column   . ${DELIM} .
-                       $clean_name     . ${DELIM};
-            } else {
-                if ($BY_FILE) {
-                    $first_column = $rhh_count->{$lang_or_file}{'lang'};
-                    $clean_name   = rm_leading_tempdir($lang_or_file, \%TEMP_DIR);
-                    $str = $clean_name . ${DELIM};
-                } else {
-                    $first_column = $rhh_count->{$lang_or_file}{'nFiles'};
-                    $str = $clean_name     . ${DELIM} .
-                           $first_column   . ${DELIM};
-                }
-            }
-            if ($opt_by_percent) {
-              my $DEN = compute_denominator($opt_by_percent               ,
-                            $rhh_count->{$lang_or_file}{'code'}   ,
-                            $rhh_count->{$lang_or_file}{'comment'},
-                            $rhh_count->{$lang_or_file}{'blank'}  );
-              $str .= sprintf("%3.2f", $rhh_count->{$lang_or_file}{'blank'}   / $DEN * 100) . ${DELIM} .
-                      sprintf("%3.2f", $rhh_count->{$lang_or_file}{'comment'} / $DEN * 100) . ${DELIM} .
-                      $rhh_count->{$lang_or_file}{'code'};
-            } else {
-              $str .= $rhh_count->{$lang_or_file}{'blank'}  . ${DELIM} .
-                      $rhh_count->{$lang_or_file}{'comment'}. ${DELIM} .
-                      $rhh_count->{$lang_or_file}{'code'};
-            }
-            $str .= $extra_3;
-            push @results, $str;
-
-        } else {
-            push @results, $data_line;
-        }
-    }
-
-    my $avg_scale = 1;  # weighted average of scale factors
-       $avg_scale = sprintf("%.2f", $sum_scaled / $sum_code)
-            if $sum_code and $opt_3;
-
-    if ($opt_xml) {
-        $data_line = "";
-        if (!$BY_FILE) {
-            $data_line .= sprintf "sum_files=\"%d\" ", $sum_files;
-        }
-        if ($opt_by_percent) {
-          my $DEN = compute_denominator($opt_by_percent    ,
-                        $sum_code, $sum_comment, $sum_blank);
-          $data_line .= sprintf $Format{'5'}{$Style},
-              $sum_blank   / $DEN * 100,
-              $sum_comment / $DEN * 100,
-              $sum_code    ;
-        } else {
-          $data_line .= sprintf $Format{'4'}{$Style},
-              $sum_blank   ,
-              $sum_comment ,
-              $sum_code    ;
-        }
-        $data_line .= sprintf $Format{'6'}{$Style},
-            $avg_scale   ,
-            $sum_scaled  if $opt_3;
-        push @results, "  <total " . $data_line . "/>";
-
-        if ($BY_FILE or ($report_type eq "by report file")) {
-            push @results, "</files>";
-        } else {
-            foreach my $language (keys %{$languages}) {
-                push @results, '  <language name="' . $language . '"/>';
-            }
-            push @results, "</languages>";
-        }
-
-        if (!$opt_by_file_by_lang or $ALREADY_SHOWED_XML_SECTION) {
-            push @results, "</results>";
-        } else {
-            $ALREADY_SHOWED_XML_SECTION = 1;
-        }
-    } elsif ($opt_yaml or $opt_json) {
-        my ($Q, $open_B, $close_B, $start, $C) = yaml_to_json_separators();
-        push @results, "${Q}SUM${Q}: ${open_B}";
-        if ($opt_by_percent) {
-          my $DEN = compute_denominator($opt_by_percent    ,
-                        $sum_code, $sum_comment, $sum_blank);
-          push @results, "  ${Q}blank${Q}: "  . sprintf("%.2f", $sum_blank   / $DEN * 100) . $C;
-          push @results, "  ${Q}comment${Q}: ". sprintf("%.2f", $sum_comment / $DEN * 100) . $C;
-          push @results, "  ${Q}code${Q}: "   . $sum_code    . $C;
-        } else {
-          push @results, "  ${Q}blank${Q}: "  . $sum_blank   . $C;
-          push @results, "  ${Q}comment${Q}: ". $sum_comment . $C;
-          push @results, "  ${Q}code${Q}: "   . $sum_code    . $C;
-        }
-        push @results, "  ${Q}nFiles${Q}: " . $sum_files   . $C;
-        if ($opt_3) {
-            push @results, "  ${Q}scaled${Q}: " . $sum_scaled . $C;
-            push @results, "  ${Q}factor${Q}: " . $avg_scale  . $C;
-        }
-        if ($opt_json) {
-            $results[-1] =~ s/,\s*$/} }/;
-        }
-    } elsif ($opt_csv) {
-        # do nothing
-    } else {
-
-        if ($BY_FILE) {
-            $data_line  = sprintf "%-${spacing_0}s ", "SUM:"  ;
-        } else {
-            $data_line  = sprintf "%-${spacing_1}s ", "SUM:"  ;
-            $data_line .= sprintf "%${spacing_2}d ", $sum_files;
-        }
-        if ($opt_by_percent) {
-          my $DEN = compute_denominator($opt_by_percent    ,
-                        $sum_code, $sum_comment, $sum_blank);
-          $data_line .= sprintf $Format{'5'}{$Style},
-              $sum_blank   / $DEN * 100,
-              $sum_comment / $DEN * 100,
-              $sum_code    ;
-        } else {
-          $data_line .= sprintf $Format{'4'}{$Style},
-              $sum_blank   ,
-              $sum_comment ,
-              $sum_code    ;
-        }
-        $data_line .= sprintf $Format{'6'}{$Style},
-            $avg_scale   ,
-            $sum_scaled if $opt_3;
-        if ($opt_md) {
-            my @words = split(' ', $data_line);
-            my $n_cols = scalar(@words);
-#           my $n_cols = scalar(split(' ', $data_line));  # deprecated
-            $data_line =~ s/\s+/\|/g;
-            my @col_hyphens    = ( '--------') x $n_cols;
-            push @results, join("|", @col_hyphens);
-            push @results, $data_line   if $sum_files > 1 or $opt_sum_one;
-            unshift @results, ( "cloc|$header_line", "--- | ---", "", );
-        } else {
-            push @results, $hyphen_line if $sum_files > 1 or $opt_sum_one;
-            push @results, $data_line   if $sum_files > 1 or $opt_sum_one;
-            push @results, $hyphen_line;
-        }
-    }
-    write_xsl_file() if $opt_xsl and $opt_xsl eq $CLOC_XSL;
-    print "<- generate_report\n" if $opt_v > 2;
-    return @results;
-} # 1}}}
-sub print_errors {                           # {{{1
-    my ($rh_Error_Codes, # in
-        $raa_errors    , # in
-       ) = @_;
-
-    print "-> print_errors\n" if $opt_v > 2;
-    my %error_string = reverse(%{$rh_Error_Codes});
-    my $nErrors      = scalar @{$raa_errors};
-    warn sprintf "\n%d error%s:\n", plural_form(scalar @Errors);
-    for (my $i = 0; $i < $nErrors; $i++) {
-        warn sprintf "%s:  %s\n",
-                     $error_string{ $raa_errors->[$i][0] },
-                     $raa_errors->[$i][1] ;
-    }
-    print "<- print_errors\n" if $opt_v > 2;
-
-} # 1}}}
-sub write_lang_def {                         # {{{1
-    my ($file                     ,
-        $rh_Language_by_Extension , # in
-        $rh_Language_by_Script    , # in
-        $rh_Language_by_File      , # in
-        $rhaa_Filters_by_Language , # in
-        $rh_Not_Code_Extension    , # in
-        $rh_Not_Code_Filename     , # in
-        $rh_Scale_Factor          , # in
-        $rh_EOL_Continuation_re   , # in
-       ) = @_;
-
-    print "-> write_lang_def($file)\n" if $opt_v > 2;
-    my $OUT = new IO::File $file, "w";
-    die "Unable to write to $file\n" unless defined $OUT;
-
-    foreach my $language (sort keys %{$rhaa_Filters_by_Language}) {
-        next if $language =~ /Brain/;
-        next if $language eq "MATLAB/Mathematica/Objective C/MUMPS/Mercury" or
-                $language eq "PHP/Pascal"                       or
-                $language eq "Pascal/Puppet"                    or
-                $language eq "Lisp/OpenCL"                      or
-                $language eq "Lisp/Julia"                       or
-                $language eq "Perl/Prolog"                      or
-                $language eq "D/dtrace"                         or
-                $language eq "IDL/Qt Project/Prolog"            or
-                $language eq "Fortran 77/Forth"                 or
-                $language eq "F#/Forth"                         or
-                $language eq "Verilog-SystemVerilog/Coq"        or
-                $language eq "TypeScript/Qt Linguist"           or
-                $language eq "Qt/Glade"                         or
-                $language eq "(unknown)";
-        printf $OUT "%s\n", $language;
-        foreach my $filter (@{$rhaa_Filters_by_Language->{$language}}) {
-            printf $OUT "    filter %s", $filter->[0];
-            printf $OUT " %s", $filter->[1] if defined $filter->[1];
-            # $filter->[0] == 'remove_between_general',
-            #                 'remove_between_regex', and
-            #                 'remove_matches_2re' have two args
-            printf $OUT " %s", $filter->[2] if defined $filter->[2];
-            print  $OUT "\n";
-        }
-        foreach my $ext (sort keys %{$rh_Language_by_Extension}) {
-            if ($language eq $rh_Language_by_Extension->{$ext}) {
-                printf $OUT "    extension %s\n", $ext;
-            }
-        }
-        foreach my $filename (sort keys %{$rh_Language_by_File}) {
-            if ($language eq $rh_Language_by_File->{$filename}) {
-                printf $OUT "    filename %s\n", $filename;
-            }
-        }
-        foreach my $script_exe (sort keys %{$rh_Language_by_Script}) {
-            if ($language eq $rh_Language_by_Script->{$script_exe}) {
-                printf $OUT "    script_exe %s\n", $script_exe;
-            }
-        }
-        printf $OUT "    3rd_gen_scale %.2f\n", $rh_Scale_Factor->{$language};
-        if (defined $rh_EOL_Continuation_re->{$language}) {
-            printf $OUT "    end_of_line_continuation %s\n",
-                $rh_EOL_Continuation_re->{$language};
-        }
-    }
-
-    $OUT->close;
-    print "<- write_lang_def\n" if $opt_v > 2;
-} # 1}}}
-sub read_lang_def {                          # {{{1
-    my ($file                     ,
-        $rh_Language_by_Extension , # out
-        $rh_Language_by_Script    , # out
-        $rh_Language_by_File      , # out
-        $rhaa_Filters_by_Language , # out
-        $rh_Not_Code_Extension    , # out
-        $rh_Not_Code_Filename     , # out
-        $rh_Scale_Factor          , # out
-        $rh_EOL_Continuation_re   , # out
-        $rh_EOL_abc,
-       ) = @_;
-
-
-    print "-> read_lang_def($file)\n" if $opt_v > 2;
-    my $IN = new IO::File $file, "r";
-    die "Unable to read $file.\n" unless defined $IN;
-
-    my $language = "";
-    while (<$IN>) {
-        next if /^\s*#/ or /^\s*$/;
-
-        if (/^(\w+.*?)\s*$/) {
-            $language = $1;
-            next;
-        }
-        die "Missing computer language name, line $. of $file\n"
-            unless $language;
-
-        if      (/^\s{4}filter\s+(remove_between_(general|2re|regex))
-                       \s+(\S+)\s+(\S+)s*$/x) {
-            push @{$rhaa_Filters_by_Language->{$language}}, [
-                  $1 , $3 , $4 ]
-
-        } elsif (/^\s{4}filter\s+(\w+)\s*$/) {
-            push @{$rhaa_Filters_by_Language->{$language}}, [ $1 ]
-
-        } elsif (/^\s{4}filter\s+(\w+)\s+(.*?)\s*$/) {
-            push @{$rhaa_Filters_by_Language->{$language}}, [ $1 , $2 ]
-
-        } elsif (/^\s{4}extension\s+(\S+)\s*$/) {
-            if (defined $rh_Language_by_Extension->{$1}) {
-                die "File extension collision:  $1 ",
-                    "maps to languages '$rh_Language_by_Extension->{$1}' ",
-                    "and '$language'\n" ,
-                    "Edit $file and remove $1 from one of these two ",
-                    "language definitions.\n";
-            }
-            $rh_Language_by_Extension->{$1} = $language;
-
-        } elsif (/^\s{4}filename\s+(\S+)\s*$/) {
-            $rh_Language_by_File->{$1} = $language;
-
-        } elsif (/^\s{4}script_exe\s+(\S+)\s*$/) {
-            $rh_Language_by_Script->{$1} = $language;
-
-        } elsif (/^\s{4}3rd_gen_scale\s+(\S+)\s*$/) {
-            $rh_Scale_Factor->{$language} = $1;
-
-        } elsif (/^\s{4}end_of_line_continuation\s+(\S+)\s*$/) {
-            $rh_EOL_Continuation_re->{$language} = $1;
-
-        } else {
-            die "Unexpected data line $. of $file:\n$_\n";
-        }
-
-    }
-    $IN->close;
-    print "<- read_lang_def\n" if $opt_v > 2;
-} # 1}}}
-sub merge_lang_def {                         # {{{1
-    my ($file                     ,
-        $rh_Language_by_Extension , # in/out
-        $rh_Language_by_Script    , # in/out
-        $rh_Language_by_File      , # in/out
-        $rhaa_Filters_by_Language , # in/out
-        $rh_Not_Code_Extension    , # in/out
-        $rh_Not_Code_Filename     , # in/out
-        $rh_Scale_Factor          , # in/out
-        $rh_EOL_Continuation_re   , # in/out
-        $rh_EOL_abc,
-       ) = @_;
-
-
-    print "-> merge_lang_def($file)\n" if $opt_v > 2;
-    my $IN = new IO::File $file, "r";
-    die "Unable to read $file.\n" unless defined $IN;
-
-    my $language        = "";
-    my $already_know_it = undef;
-    while (<$IN>) {
-        next if /^\s*#/ or /^\s*$/;
-
-        if (/^(\w+.*?)\s*$/) {
-            $language = $1;
-            $already_know_it = defined $rh_Scale_Factor->{$language};
-            next;
-        }
-        die "Missing computer language name, line $. of $file\n"
-            unless $language;
-
-        if      (/^    filter\s+(\w+)\s*$/) {
-            next if $already_know_it;
-            push @{$rhaa_Filters_by_Language->{$language}}, [ $1 ]
-
-        } elsif (/^    filter\s+(\w+)\s+(.*?)\s*$/) {
-            next if $already_know_it;
-            push @{$rhaa_Filters_by_Language->{$language}}, [ $1 , $2 ]
-
-        } elsif (/^    extension\s+(\S+)\s*$/) {
-            next if $already_know_it;
-            if (defined $rh_Language_by_Extension->{$1}) {
-                die "File extension collision:  $1 ",
-                    "maps to languages '$rh_Language_by_Extension->{$1}' ",
-                    "and '$language'\n" ,
-                    "Edit $file and remove $1 from one of these two ",
-                    "language definitions.\n";
-            }
-            $rh_Language_by_Extension->{$1} = $language;
-
-        } elsif (/^    filename\s+(\S+)\s*$/) {
-            next if $already_know_it;
-            $rh_Language_by_File->{$1} = $language;
-
-        } elsif (/^    script_exe\s+(\S+)\s*$/) {
-            next if $already_know_it;
-            $rh_Language_by_Script->{$1} = $language;
-
-        } elsif (/^    3rd_gen_scale\s+(\S+)\s*$/) {
-            next if $already_know_it;
-            $rh_Scale_Factor->{$language} = $1;
-
-        } elsif (/^    end_of_line_continuation\s+(\S+)\s*$/) {
-            next if $already_know_it;
-            $rh_EOL_Continuation_re->{$language} = $1;
-
-        } else {
-            die "Unexpected data line $. of $file:\n$_\n";
-        }
-
-    }
-    $IN->close;
-    print "<- merge_lang_def\n" if $opt_v > 2;
-} # 1}}}
-sub print_extension_info {                   # {{{1
-    my ($extension,) = @_;
-    if ($extension) {  # show information on this extension
-        foreach my $ext (sort {lc $a cmp lc $b } keys %Language_by_Extension) {
-            # Language_by_Extension{f}    = 'Fortran 77'
-            next if $Language_by_Extension{$ext} =~ /Brain/;
-            printf "%-15s -> %s\n", $ext, $Language_by_Extension{$ext}
-                if $ext =~ m{$extension}i;
-        }
-    } else {           # show information on all  extensions
-        foreach my $ext (sort {lc $a cmp lc $b } keys %Language_by_Extension) {
-            next if $Language_by_Extension{$ext} =~ /Brain/;
-            # Language_by_Extension{f}    = 'Fortran 77'
-            printf "%-15s -> %s\n", $ext, $Language_by_Extension{$ext};
-        }
-    }
-} # 1}}}
-sub print_language_info {                    # {{{1
-    my ($language,
-        $prefix ,) = @_;
-    my %extensions = (); # the subset matched by the given $language value
-    if ($language) {  # show information on this language
-        foreach my $ext (sort {lc $a cmp lc $b } keys %Language_by_Extension) {
-            # Language_by_Extension{f}    = 'Fortran 77'
-            push @{$extensions{$Language_by_Extension{$ext}} }, $ext
-                if lc $Language_by_Extension{$ext} eq lc $language;
-#               if $Language_by_Extension{$ext} =~ m{$language}i;
-        }
-    } else {          # show information on all  languages
-        foreach my $ext (sort {lc $a cmp lc $b } keys %Language_by_Extension) {
-            # Language_by_Extension{f}    = 'Fortran 77'
-            push @{$extensions{$Language_by_Extension{$ext}} }, $ext
-        }
-    }
-
-    # add exceptions (one file extension mapping to multiple languages)
-    if (!$language or $language =~ /^(Objective C|MATLAB|Mathematica|MUMPS|Mercury)$/i) {
-        push @{$extensions{'Objective C'}}, "m";
-        push @{$extensions{'MATLAB'}}     , "m";
-        push @{$extensions{'Mathematica'}}, "m";
-        push @{$extensions{'MUMPS'}}      , "m";
-        delete $extensions{'MATLAB/Mathematica/Objective C/MUMPS/Mercury'};
-    }
-    if (!$language or $language =~ /^(Lisp|OpenCL)$/i) {
-        push @{$extensions{'Lisp'}}  , "cl";
-        push @{$extensions{'OpenCL'}}, "cl";
-        delete $extensions{'Lisp/OpenCL'};
-    }
-    if (!$language or $language =~ /^(Lisp|Julia)$/i) {
-        push @{$extensions{'Lisp'}}  , "jl";
-        push @{$extensions{'Julia'}} , "jl";
-        delete $extensions{'Lisp/Julia'};
-    }
-    if (!$language or $language =~ /^(Perl|Prolog)$/i) {
-        push @{$extensions{'Perl'}}  , "pl";
-        push @{$extensions{'Prolog'}}, "pl";
-        delete $extensions{'Perl/Prolog'};
-    }
-    if (!$language or $language =~ /^(IDL|Qt Project|Prolog)$/i) {
-        push @{$extensions{'IDL'}}       , "pro";
-        push @{$extensions{'Qt Project'}}, "pro";
-        push @{$extensions{'Prolog'}}    , "pro";
-        delete $extensions{'IDL/Qt Project/Prolog'};
-    }
-    if (!$language or $language =~ /^(D|dtrace)$/i) {
-        push @{$extensions{'D'}}       , "d";
-        push @{$extensions{'dtrace'}}  , "d";
-        delete $extensions{'D/dtrace'};
-    }
-    if (!$language or $language =~ /^Forth$/) {
-        push @{$extensions{'Forth'}}     , "fs";
-        push @{$extensions{'Forth'}}     , "f";
-        push @{$extensions{'Forth'}}     , "for";
-        delete $extensions{'Fortran 77/Forth'};
-        delete $extensions{'F#/Forth'};
-    }
-    if (!$language or $language =~ /^Fortran 77$/) {
-        push @{$extensions{'Fortran 77'}}, "f";
-        push @{$extensions{'Fortran 77'}}, "for";
-        push @{$extensions{'F#'}}        , "fs";
-        delete $extensions{'Fortran 77/Forth'};
-    }
-    if (!$language or $language =~ /^F#$/) {
-        push @{$extensions{'F#'}}        , "fs";
-        delete $extensions{'F#/Forth'};
-    }
-    if (!$language or $language =~ /^(Verilog-SystemVerilog|Coq)$/) {
-        push @{$extensions{'Coq'}}                   , "v";
-        push @{$extensions{'Verilog-SystemVerilog'}} , "v";
-        delete $extensions{'Verilog-SystemVerilog/Coq'};
-    }
-    if (!$language or $language =~ /^(TypeScript|Qt Linguist)$/) {
-        push @{$extensions{'TypeScript'}}  , "ts";
-        push @{$extensions{'Qt Linguist'}} , "ts";
-        delete $extensions{'TypeScript/Qt Linguist'};
-    }
-    if (!$language or $language =~ /^(Qt|Glade)$/) {
-        push @{$extensions{'Glade'}} , "ui";
-        push @{$extensions{'Qt'}}    , "ui";
-        delete $extensions{'Qt/Glade'};
-    }
-    if (!$language or $language =~ /^(Ant)$/i) {
-        push @{$extensions{'Ant'}}  , "build.xml";
-        delete $extensions{'Ant/XML'};
-    }
-    if ($opt_explain) {
-        return unless $extensions{$language};
-        if ($prefix) {
-            printf "%s %s\n", $prefix, join(", ", @{$extensions{$language}});
-        } else {
-            printf "%-26s (%s)\n", $language, join(", ", @{$extensions{$language}});
-        }
-    } else {
-        if (%extensions) {
-            foreach my $lang (sort {lc $a cmp lc $b } keys %extensions) {
-                next if $lang =~ /Brain/;
-                if ($prefix) {
-                    printf "%s %s\n", $prefix, join(", ", @{$extensions{$lang}});
-                } else {
-                    printf "%-26s (%s)\n", $lang, join(", ", @{$extensions{$lang}});
-                }
-            }
-        }
-    }
-} # 1}}}
-sub print_language_filters {                 # {{{1
-    my ($language,) = @_;
-    if (!$Filters_by_Language{$language} or
-        !@{$Filters_by_Language{$language}}) {
-        warn "Unknown language: $language\n";
-        warn "Use --show-lang to list all defined languages.\n";
-        return;
-    }
-    printf "%s\n", $language;
-    foreach my $filter (@{$Filters_by_Language{$language}}) {
-        printf "    filter %s", $filter->[0];
-        printf "  %s", $filter->[1] if defined $filter->[1];
-        printf "  %s", $filter->[2] if defined $filter->[2];
-        print  "\n";
-    }
-    print_language_info($language, "    extensions:");
-} # 1}}}
-sub make_file_list {                         # {{{1
-    my ($ra_arg_list,  # in   file and/or directory names to examine
-        $rh_Err     ,  # in   hash of error codes
-        $raa_errors ,  # out  errors encountered
-        $rh_ignored ,  # out  files not recognized as computer languages
-        ) = @_;
-    print "-> make_file_list(@{$ra_arg_list})\n" if $opt_v > 2;
-
-    my ($fh, $filename);
-    if ($opt_categorized) {
-        $filename = $opt_categorized;
-        $fh = new IO::File $filename, "+>";  # open for read/write
-        die "Unable to write to $filename:  $!\n" unless defined $fh;
-    } elsif ($opt_sdir) {
-        # write to the user-defined scratch directory
-        $filename = $opt_sdir . '/cloc_file_list.txt';
-        $fh = new IO::File $filename, "+>";  # open for read/write
-        die "Unable to write to $filename:  $!\n" unless defined $fh;
-    } else {
-        # let File::Temp create a suitable temporary file
-        ($fh, $filename) = tempfile(UNLINK => 1);  # delete file on exit
-        print "Using temp file list [$filename]\n" if $opt_v;
-    }
-
-    my @dir_list = ();
-    foreach my $file_or_dir (@{$ra_arg_list}) {
-#print "make_file_list file_or_dir=$file_or_dir\n";
-        my $size_in_bytes = 0;
-        if (!-r $file_or_dir) {
-            push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file_or_dir];
-            next;
-        }
-        if (is_file($file_or_dir)) {
-            if (!(-s $file_or_dir)) {   # 0 sized file, named pipe, socket
-                $rh_ignored->{$file_or_dir} = 'zero sized file';
-                next;
-            } elsif (-B $file_or_dir and !$opt_read_binary_files) {
-                # avoid binary files unless user insists on reading them
-                if ($opt_unicode) {
-                    # only ignore if not a Unicode file w/trivial
-                    # ASCII transliteration
-                    if (!unicode_file($file_or_dir)) {
-                        $rh_ignored->{$file_or_dir} = 'binary file';
-                        next;
-                    }
-                } else {
-                    $rh_ignored->{$file_or_dir} = 'binary file';
-                    next;
-                }
-            }
-            push @file_list, "$file_or_dir";
-        } elsif (is_dir($file_or_dir)) {
-            push @dir_list, $file_or_dir;
-        } else {
-            push @{$raa_errors}, [$rh_Err->{'Neither file nor directory'} , $file_or_dir];
-            $rh_ignored->{$file_or_dir} = 'not file, not directory';
-        }
-    }
-
-    # apply exclusion rules to file names passed in on the command line
-    my @new_file_list = ();
-    foreach my $File (@file_list) {
-        my ($volume, $directories, $filename) = File::Spec->splitpath( $File );
-        my $ignore_this_file = 0;
-        foreach my $Sub_Dir ( File::Spec->splitdir($directories) ) {
-            if ($Exclude_Dir{$Sub_Dir}) {
-                $Ignored{$Sub_Dir} = "($File) --exclude-dir=$Sub_Dir";
-                $ignore_this_file = 1;
-                last;
-            }
-        }
-        push @new_file_list, $File unless $ignore_this_file;
-    }
-    @file_list = @new_file_list;
-
-    foreach my $dir (@dir_list) {
-#print "make_file_list dir=$dir  Exclude_Dir{$dir}=$Exclude_Dir{$dir}\n";
-        # populates global variable @file_list
-        if ($Exclude_Dir{$dir}) {
-            $Ignored{$dir} = "--exclude-dir=$Exclude_Dir{$dir}";
-            next;
-        }
-        find({wanted     => \&files            ,
-              preprocess => \&find_preprocessor,
-              follow     =>  $opt_follow_links }, $dir);
-    }
-    # there's a possibility of file duplication if user provided a list
-    # file or --vcs command that returns directory names; squash these
-    my %unique_file_list = map { $_ => 1 } @file_list;
-    @file_list = sort keys %unique_file_list;
-
-    $nFiles_Found = scalar @file_list;
-    printf "%8d text file%s.\n", plural_form($nFiles_Found) unless $opt_quiet;
-    write_file($opt_found, sort @file_list) if $opt_found;
-
-    my $nFiles_Categorized = 0;
-    foreach my $file (@file_list) {
-        printf "classifying $file\n" if $opt_v > 2;
-
-        my $basename = basename $file;
-        if ($Not_Code_Filename{$basename}) {
-            $rh_ignored->{$file} = "listed in " . '$' .
-                "Not_Code_Filename{$basename}";
-            next;
-        } elsif ($basename =~ m{~$}) {
-            $rh_ignored->{$file} = "temporary editor file";
-            next;
-        }
-
-        my $size_in_bytes = (stat $file)[7];
-        my $language      = "";
-        if ($All_One_Language) {
-            # user over-rode auto-language detection by using
-            # --force-lang with just a language name (no extension)
-            $language      = $All_One_Language;
-        } else {
-            $language      = classify_file($file      ,
-                                           $rh_Err    ,
-                                           $raa_errors,
-                                           $rh_ignored);
-        }
-die  "make_file_list($file) undef size" unless defined $size_in_bytes;
-die  "make_file_list($file) undef lang" unless defined $language;
-        printf $fh "%d,%s,%s\n", $size_in_bytes, $language, $file;
-        ++$nFiles_Categorized;
-        #printf "classified %d files\n", $nFiles_Categorized
-        #    unless (!$opt_progress_rate or
-        #            ($nFiles_Categorized % $opt_progress_rate));
-    }
-    printf "classified %d files\r", $nFiles_Categorized
-        if !$opt_quiet and $nFiles_Categorized > 1;
-
-    print "<- make_file_list()\n" if $opt_v > 2;
-
-    return $fh;   # handle to the file containing the list of files to process
-}  # 1}}}
-sub invoke_generator {                       # {{{1
-    my ($generator, $ra_user_inputs) = @_;
-    # If user provided file/directory inputs, only return
-    # generated files that are in user's request.
-    # Populates global variable %Ignored.
-    print "-> invoke_generator($generator)\n" if $opt_v > 2;
-    open(FH, "$generator |") or
-        die "Failed to pipe $generator: $!";
-    my @files = ();
-    while(<FH>) {
-        chomp;
-        my $F = $_;
-        print "VCS input:  $F\n" if $opt_v >= 2;
-        if (!defined $ra_user_inputs or !@{$ra_user_inputs}) {
-            push @files, $F;
-        } else {
-            # is this file desired?
-            my $want_this_one = 0;
-            foreach my $file_dir (@{$ra_user_inputs}) {
-                if (/^$file_dir/) {
-                    $want_this_one = 1;
-                    last;
-                }
-            }
-            push @files, $F if $want_this_one;
-        }
-    }
-    close(FH);
-    # apply match/not-match file/dir filters to the list so far
-    my @post_filter = ();
-    foreach my $F (@files) {
-        if ($opt_match_f) {
-            push @post_filter, $F if basename($F) =~ m{$opt_match_f};
-            next;
-        }
-        if ($opt_match_d) {
-            push @post_filter, $F if $F =~ m{$opt_match_d};
-            next;
-        }
-        if ($opt_not_match_d) {
-            if ($opt_fullpath and $F =~ m{$opt_not_match_d}) {
-                $Ignored{$F} = "--not-match-d=$opt_not_match_d";
-                next;
-            } elsif (basename($F) =~ m{$opt_not_match_d}) {
-                $Ignored{$F} = "--not-match-d (basename) =$opt_not_match_d";
-                next;
-            }
-        }
-        if ($opt_not_match_f) {
-            push @post_filter, $F unless basename($F) =~ m{$opt_not_match_f};
-            next;
-        }
-        push @post_filter, $F;
-    }
-    print "<- invoke_generator\n" if $opt_v > 2;
-    return @post_filter;
-} # 1}}}
-sub remove_duplicate_files {                 # {{{1
-    my ($fh                   , # in
-        $rh_Language          , # out
-        $rh_unique_source_file, # out
-        $rh_Err               , # in
-        $raa_errors           , # out  errors encountered
-        $rh_ignored           , # out
-        ) = @_;
-
-    # Check for duplicate files by comparing file sizes.
-    # Where files are equally sized, compare their MD5 checksums.
-    print "-> remove_duplicate_files\n" if $opt_v > 2;
-
-    my $n = 0;
-    my %files_by_size = (); # files_by_size{ # bytes } = [ list of files ]
-    seek($fh, 0, 0); # rewind to beginning of the temp file
-    while (<$fh>) {
-        ++$n;
-        my ($size_in_bytes, $language, $file) = split(/,/, $_, 3);
-        chomp($file);
-        $rh_Language->{$file} = $language;
-        push @{$files_by_size{$size_in_bytes}}, $file;
-        if ($opt_skip_uniqueness) {
-            $rh_unique_source_file->{$file} = 1;
-        }
-    }
-    return if $opt_skip_uniqueness;
-    if ($opt_progress_rate and ($n > $opt_progress_rate)) {
-        printf "Duplicate file check %d files (%d known unique)\r",
-            $n, scalar keys %files_by_size;
-    }
-    $n = 0;
-    foreach my $bytes (sort {$a <=> $b} keys %files_by_size) {
-        ++$n;
-        printf "Unique: %8d files                                          \r",
-            $n unless (!$opt_progress_rate or ($n % $opt_progress_rate));
-        if (scalar @{$files_by_size{$bytes}} == 1) {
-            # only one file is this big; must be unique
-            $rh_unique_source_file->{$files_by_size{$bytes}[0]} = 1;
-            next;
-        } else {
-#print "equally sized files: ",join(", ", @{$files_by_size{$bytes}}), "\n";
-            # Files in the list @{$files_by_size{$bytes} all are
-            # $bytes long.  Sort the list by file basename.
-
-          # # sorting on basename causes repeatability problems
-          # # if the basename is not unique (eg "includeA/x.h"
-          # # and "includeB/x.h".  Instead, sort on full path.
-          # # Ref bug #114.
-          # my @sorted_bn = ();
-          # my %BN = map { basename($_) => $_ } @{$files_by_size{$bytes}};
-          # foreach my $F (sort keys %BN) {
-          #     push @sorted_bn, $BN{$F};
-          # }
-
-            my @sorted_bn = sort @{$files_by_size{$bytes}};
-
-            foreach my $F (different_files(\@sorted_bn  ,
-                                            $rh_Err     ,
-                                            $raa_errors ,
-                                            $rh_ignored ) ) {
-                $rh_unique_source_file->{$F} = 1;
-            }
-        }
-    }
-    print "<- remove_duplicate_files\n" if $opt_v > 2;
-} # 1}}}
-sub find_preprocessor {                      # {{{1
-    # invoked by File::Find's find() each time it enters a new directory
-    # Reads global variable %Exclude_Dir.
-    # Populates global variable %Ignored.
-    # Reject files/directories in cwd which are in the exclude list.
-    print "-> find_preprocessor(", cwd(), ")\n" if $opt_v > 2;
-    my @ok = ();
-
-#printf "TOP find_preprocessor\n";
-
-    foreach my $F_or_D (@_) {  # pure file or directory name, no separators
-        next if $F_or_D =~ /^\.{1,2}$/;  # skip .  and  ..
-        if ($Exclude_Dir{$F_or_D}) {
-            $Ignored{$File::Find::name} = "--exclude-dir=$Exclude_Dir{$F_or_D}";
-        } else {
-#printf "  F_or_D=%-20s File::Find::name=%s\n", $F_or_D, $File::Find::name;
-            if ($opt_not_match_d) {
-                if ($opt_fullpath and $File::Find::name =~ m{$opt_not_match_d}) {
-                    $Ignored{$File::Find::name} = "--not-match-d=$opt_not_match_d";
-                } elsif (!-d $F_or_D and basename($File::Find::name) =~ m{$opt_not_match_d}) {
-                    $Ignored{$File::Find::name} = "--not-match-d (basename) =$opt_not_match_d";
-                } else {
-                    push @ok, $F_or_D;
-                }
-            } else {
-                push @ok, $F_or_D;
-            }
-        }
-    }
-
-    print "<- find_preprocessor(@ok)\n" if $opt_v > 2;
-    return @ok;
-} # 1}}}
-sub files {                                  # {{{1
-    # invoked by File::Find's find()   Populates global variable @file_list.
-    # See also find_preprocessor() which prunes undesired directories.
-
-    my $Dir = cwd(); # not $File::Find::dir which just gives relative path
-    if ($opt_fullpath) {
-        # look at as much of the path as is known
-        if ($opt_match_f    ) {
-            return unless $File::Find::name =~ m{$opt_match_f};
-        }
-        if ($opt_not_match_f) {
-            return if     $File::Find::name =~ m{$opt_not_match_f};
-        }
-    } else {
-        # only look at the basename
-        if ($opt_match_f    ) { return unless /$opt_match_f/;     }
-        if ($opt_not_match_f) { return if     /$opt_not_match_f/; }
-    }
-    if ($opt_match_d    ) { return unless $Dir =~ m{$opt_match_d}     }
-
-    my $nBytes = -s $_ ;
-    if (!$nBytes) {
-        $Ignored{$File::Find::name} = 'zero sized file';
-        printf "files(%s)  zero size\n", $File::Find::name if $opt_v > 5;
-    }
-    return unless $nBytes  ; # attempting other tests w/pipe or socket will hang
-    if ($nBytes > $opt_max_file_size*1024**2) {
-        $Ignored{$File::Find::name} = "file size of " .
-            $nBytes/1024**2 . " MB exceeds max file size of " .
-            "$opt_max_file_size MB";
-        printf "file(%s)  exceeds $opt_max_file_size MB\n",
-            $File::Find::name if $opt_v > 5;
-        return;
-    }
-    my $is_dir = is_dir($_);
-    my $is_bin = -B     $_ ;
-    printf "files(%s)  size=%d is_dir=%d  -B=%d\n",
-        $File::Find::name, $nBytes, $is_dir, $is_bin if $opt_v > 5;
-    $is_bin = 0 if $opt_unicode and unicode_file($_);
-    $is_bin = 0 if $opt_read_binary_files;
-    return if $is_dir or $is_bin;
-    ++$nFiles_Found;
-    printf "%8d files\r", $nFiles_Found
-        unless (!$opt_progress_rate or ($nFiles_Found % $opt_progress_rate));
-    push @file_list, $File::Find::name;
-} # 1}}}
-sub archive_files {                          # {{{1
-    # invoked by File::Find's find()  Populates global variable @binary_archive
-    foreach my $ext (keys %Known_Binary_Archives) {
-        push @binary_archive, $File::Find::name
-            if $File::Find::name =~ m{$ext$};
-    }
-} # 1}}}
-sub is_file {                                # {{{1
-    # portable method to test if item is a file
-    # (-f doesn't work in ActiveState Perl on Windows)
-    my $item = shift @_;
-
-    if ($ON_WINDOWS) {
-        my $mode = (stat $item)[2];
-           $mode = 0 unless $mode;
-        if ($mode & 0100000) { return 1; }
-        else                 { return 0; }
-    } else {
-        return (-f $item);  # works on Unix, Linux, CygWin, z/OS
-    }
-} # 1}}}
-sub is_dir {                                 # {{{1
-    # portable method to test if item is a directory
-    # (-d doesn't work in older versions of ActiveState Perl on Windows)
-    my $item = shift @_;
-
-    if ($ON_WINDOWS) {
-        my $mode = (stat $item)[2];
-           $mode = 0 unless $mode;
-        if ($mode & 0040000) { return 1; }
-        else                 { return 0; }
-    } else {
-        return (-d $item);  # works on Unix, Linux, CygWin, z/OS
-    }
-} # 1}}}
-sub is_excluded {                            # {{{1
-    my ($file       , # in
-        $excluded   , # in   hash of excluded directories
-       ) = @_;
-    my($filename, $filepath, $suffix) = fileparse($file);
-    foreach my $path (sort keys %{$excluded}) {
-        return 1 if ($filepath =~ m{^$path/}i);
-    }
-} # 1}}}
-sub classify_file {                          # {{{1
-    my ($full_file   , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-        $rh_ignored  , # out
-       ) = @_;
-
-    print "-> classify_file($full_file)\n" if $opt_v > 2;
-    my $language = "(unknown)";
-
-    if (basename($full_file) eq "-" && defined $opt_stdin_name) {
-       $full_file = $opt_stdin_name;
-    }
-
-    my $look_at_first_line = 0;
-    my $file = basename $full_file;
-    if ($opt_autoconf and $file =~ /\.in$/) {
-       $file =~ s/\.in$//;
-    }
-    return $language if $Not_Code_Filename{$file}; # (unknown)
-    return $language if $file =~ m{~$}; # a temp edit file (unknown)
-    if (defined $Language_by_File{$file}) {
-        if      ($Language_by_File{$file} eq "Ant/XML") {
-            return Ant_or_XML(  $full_file, $rh_Err, $raa_errors);
-        } elsif ($Language_by_File{$file} eq "Maven/XML") {
-            return Maven_or_XML($full_file, $rh_Err, $raa_errors);
-        } else {
-            return $Language_by_File{$file};
-        }
-    }
-
-    if ($file =~ /\.([^\.]+)$/) { # has an extension
-      print "$full_file extension=[$1]\n" if $opt_v > 2;
-      my $extension = $1;
-         # Windows file names are case insensitive so map
-         # all extensions to lowercase there.
-         $extension = lc $extension if $ON_WINDOWS;
-      my @extension_list = ( $extension );
-      if ($file =~ /\.([^\.]+\.[^\.]+)$/) { # has a double extension
-          my $extension = $1;
-          $extension = lc $extension if $ON_WINDOWS;
-          unshift @extension_list, $extension;  # examine double ext first
-      }
-      foreach my $extension (@extension_list) {
-        if ($Not_Code_Extension{$extension} and
-           !$Forced_Extension{$extension}) {
-           # If .1 (for example) is an extension that would ordinarily be
-           # ignored but the user has insisted this be counted with the
-           # --force-lang option, then go ahead and count it.
-            $rh_ignored->{$full_file} =
-                'listed in $Not_Code_Extension{' . $extension . '}';
-            return $language;
-        }
-        if (defined $Language_by_Extension{$extension}) {
-            if ($Language_by_Extension{$extension} eq
-                'MATLAB/Mathematica/Objective C/MUMPS/Mercury') {
-                my $lang_M_or_O = "";
-                matlab_or_objective_C($full_file ,
-                                      $rh_Err    ,
-                                      $raa_errors,
-                                     \$lang_M_or_O);
-                if ($lang_M_or_O) {
-                    return $lang_M_or_O;
-                } else { # an error happened in matlab_or_objective_C()
-                    $rh_ignored->{$full_file} =
-                        'failure in matlab_or_objective_C()';
-                    return $language; # (unknown)
-                }
-            } elsif ($Language_by_Extension{$extension} eq 'PHP/Pascal') {
-                if (really_is_php($full_file)) {
-                    return 'PHP';
-                } elsif (really_is_incpascal($full_file)) {
-                    return 'Pascal';
-                } else {
-                    return $language; # (unknown)
-                }
-            } elsif ($Language_by_Extension{$extension} eq 'Pascal/Puppet') {
-                my $lang_Pasc_or_Pup = "";
-                pascal_or_puppet(     $full_file ,
-                                      $rh_Err    ,
-                                      $raa_errors,
-                                     \$lang_Pasc_or_Pup);
-                if ($lang_Pasc_or_Pup) {
-                    return $lang_Pasc_or_Pup;
-                } else { # an error happened in pascal_or_puppet()
-                    $rh_ignored->{$full_file} =
-                        'failure in pascal_or_puppet()';
-                    return $language; # (unknown)
-                }
-            } elsif ($Language_by_Extension{$extension} eq 'Lisp/OpenCL') {
-                return Lisp_or_OpenCL($full_file, $rh_Err, $raa_errors);
-            } elsif ($Language_by_Extension{$extension} eq 'Lisp/Julia') {
-                return Lisp_or_Julia( $full_file, $rh_Err, $raa_errors);
-            } elsif ($Language_by_Extension{$extension} eq 'Perl/Prolog') {
-                return Perl_or_Prolog($full_file, $rh_Err, $raa_errors);
-            } elsif ($Language_by_Extension{$extension} eq
-                     'IDL/Qt Project/Prolog') {
-                return IDL_or_QtProject($full_file, $rh_Err, $raa_errors);
-            } elsif ($Language_by_Extension{$extension} eq 'D/dtrace') {
-                # is it D or an init.d shell script?
-                my $a_script = really_is_D($full_file, $rh_Err, $raa_errors);
-                if ($a_script) {
-                    # could be dtrace, sh, bash or anything one would
-                    # write an init.d script in
-                    if (defined $Language_by_Script{$a_script}) {
-                        return $Language_by_Script{$a_script};
-                    } else {
-                        $rh_ignored->{$full_file} =
-                            "Unrecognized script language, '$a_script'";
-                    }
-                } else {
-                    return 'D';
-                }
-            } elsif ($Language_by_Extension{$extension} eq 'Fortran 77/Forth') {
-                return Forth_or_Fortran($full_file, $rh_Err, $raa_errors);
-            } elsif ($Language_by_Extension{$extension} eq 'F#/Forth') {
-                return Forth_or_Fsharp( $full_file, $rh_Err, $raa_errors);
-            } elsif ($Language_by_Extension{$extension} eq 'Verilog-SystemVerilog/Coq') {
-                return Verilog_or_Coq( $full_file, $rh_Err, $raa_errors);
-            } elsif ($Language_by_Extension{$extension} eq 'Smarty') {
-                if ($extension eq "smarty") {
-                    # unambiguous -- if ends with .smarty, is Smarty
-                    return $Language_by_Extension{$extension};
-                }
-                # Smarty extension .tpl is generic; make sure the
-                # file at least roughly resembles PHP.  Alternatively,
-                # if the user forces the issue, do the count.
-                my $force_smarty = 0;
-                foreach (@opt_force_lang) {
-                    if (lc($_) eq "smarty,tpl") {
-                        $force_smarty = 1;
-                        last;
-                    }
-                }
-                if (really_is_php($full_file) or $force_smarty) {
-                    return 'Smarty';
-                } else {
-                    return $language; # (unknown)
-                }
-            } elsif ($Language_by_Extension{$extension} eq 'TypeScript/Qt Linguist') {
-                return TypeScript_or_QtLinguist( $full_file, $rh_Err, $raa_errors);
-            } elsif ($Language_by_Extension{$extension} eq 'Qt/Glade') {
-                return Qt_or_Glade( $full_file, $rh_Err, $raa_errors);
-            } elsif ($Language_by_Extension{$extension} eq 'Brainfuck') {
-                if (really_is_bf($full_file)) {
-                    return $Language_by_Extension{$extension};
-                } else {
-                    return $language; # (unknown)
-                }
-            } else {
-                return $Language_by_Extension{$extension};
-            }
-        } else { # has an unmapped file extension
-            $look_at_first_line = 1;
-        }
-      }
-    } elsif (defined $Language_by_File{lc $file}) {
-        return $Language_by_File{lc $file};
-    } elsif ($opt_lang_no_ext and
-             defined $Filters_by_Language{$opt_lang_no_ext}) {
-        return $opt_lang_no_ext;
-    } else {  # no file extension
-        $look_at_first_line = 1;
-    }
-
-    if ($look_at_first_line) {
-        # maybe it is a shell/Perl/Python/Ruby/etc script that
-        # starts with pound bang:
-        #   #!/usr/bin/perl
-        #   #!/usr/bin/env perl
-        my $script_language = peek_at_first_line($full_file ,
-                                                 $rh_Err    ,
-                                                 $raa_errors);
-        if (!$script_language) {
-            $rh_ignored->{$full_file} = "language unknown (#2)";
-            # returns (unknown)
-        }
-        if (defined $Language_by_Script{$script_language}) {
-            if (defined $Filters_by_Language{
-                            $Language_by_Script{$script_language}}) {
-                $language = $Language_by_Script{$script_language};
-            } else {
-                $rh_ignored->{$full_file} =
-                    "undefined:  Filters_by_Language{" .
-                    $Language_by_Script{$script_language} .
-                    "} for scripting language $script_language";
-                # returns (unknown)
-            }
-        } else {
-            $rh_ignored->{$full_file} = "language unknown (#3)";
-            # returns (unknown)
-        }
-    }
-    print "<- classify_file($full_file)=$language\n" if $opt_v > 2;
-    return $language;
-} # 1}}}
-sub peek_at_first_line {                     # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> peek_at_first_line($file)\n" if $opt_v > 2;
-
-    my $script_language = "";
-    if (!-r $file) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $script_language;
-    }
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        print "<- peek_at_first_line($file)\n" if $opt_v > 2;
-        return $script_language;
-    }
-    chomp(my $first_line = <$IN>);
-    if (defined $first_line) {
-#print "peek_at_first_line of [$file] first_line=[$first_line]\n";
-        if ($first_line =~ /^#\!\s*(\S.*?)$/) {
-#print "peek_at_first_line 1=[$1]\n";
-            my @pound_bang = split(' ', $1);
-#print "peek_at_first_line basename 0=[", basename($pound_bang[0]), "]\n";
-            if (basename($pound_bang[0]) eq "env" and
-                scalar @pound_bang > 1) {
-                $script_language = $pound_bang[1];
-#print "peek_at_first_line pound_bang A $pound_bang[1]\n";
-            } else {
-                $script_language = basename $pound_bang[0];
-#print "peek_at_first_line pound_bang B $script_language\n";
-            }
-        }
-    }
-    $IN->close;
-    print "<- peek_at_first_line($file)\n" if $opt_v > 2;
-    return $script_language;
-} # 1}}}
-sub different_files {                        # {{{1
-    # See which of the given files are unique by computing each file's MD5
-    # sum.  Return the subset of files which are unique.
-    my ($ra_files    , # in
-        $rh_Err      , # in
-        $raa_errors  , # out
-        $rh_ignored  , # out
-       ) = @_;
-
-    print "-> different_files(@{$ra_files})\n" if $opt_v > 2;
-    my %file_hash = ();  # file_hash{md5 hash} = [ file1, file2, ... ]
-    foreach my $F (@{$ra_files}) {
-        next if is_dir($F);  # needed for Windows
-        my $IN = new IO::File $F, "r";
-        if (!defined $IN) {
-            push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $F];
-            $rh_ignored->{$F} = 'cannot read';
-        } else {
-            if ($HAVE_Digest_MD5) {
-                binmode $IN;
-                my $MD5 = Digest::MD5->new->addfile($IN)->hexdigest;
-#print "$F, $MD5\n";
-                push @{$file_hash{$MD5}}, $F;
-            } else {
-                # all files treated unique
-                push @{$file_hash{$F}}, $F;
-            }
-            $IN->close;
-        }
-    }
-
-    # Loop over file sets having identical MD5 sums.  Within
-    # each set, pick the file that most resembles known source
-    # code.
-    my @unique = ();
-    for my $md5 (sort keys %file_hash) {
-        my $i_best = 0;
-        for (my $i = 1; $i < scalar(@{$file_hash{$md5}}); $i++) {
-            my $F = $file_hash{$md5}[$i];
-            my (@nul_a, %nul_h);
-            my $language = classify_file($F, $rh_Err,
-                                        # don't save these errors; pointless
-                                        \@nul_a, \%nul_h);
-            $i_best = $i if $language ne "(unknown)";
-        }
-        # keep the best one found and identify the rest as ignored
-        for (my $i = 0; $i < scalar(@{$file_hash{$md5}}); $i++) {
-            if ($i == $i_best) {
-                push @unique, $file_hash{$md5}[$i_best];
-            } else {
-                $rh_ignored->{$file_hash{$md5}[$i]} = "duplicate of " .
-                    $file_hash{$md5}[$i_best];
-            }
-        }
-
-    }
-    print "<- different_files(@unique)\n" if $opt_v > 2;
-    return @unique;
-} # 1}}}
-sub call_counter {                           # {{{1
-    my ($file     , # in
-        $language , # in
-        $ra_Errors, # out
-       ) = @_;
-
-    # Logic:  pass the file through the following filters:
-    #         1. remove blank lines
-    #         2. remove comments using each filter defined for this language
-    #            (example:  SQL has two, remove_starts_with(--) and
-    #             remove_c_comments() )
-    #         3. compute comment lines as
-    #               total lines - blank lines - lines left over after all
-    #                   comment filters have been applied
-
-    print "-> call_counter($file, $language)\n" if $opt_v > 2;
-#print "call_counter:  ", Dumper(@routines), "\n";
-
-    my @lines = ();
-    my $ascii = "";
-    if (-B $file and $opt_unicode) {
-        # was binary so must be unicode
-
-        $/ = undef;
-        my $IN = new IO::File $file, "r";
-        my $bin_text = <$IN>;
-        $IN->close;
-        $/ = "\n";
-
-        $ascii = unicode_to_ascii( $bin_text );
-        @lines = split("\n", $ascii );
-        foreach (@lines) { $_ = "$_\n"; }
-
-    } else {
-        # regular text file
-        @lines = read_file($file);
-        $ascii = join('', @lines);
-    }
-
-    my @original_lines = @lines;
-    my $total_lines    = scalar @lines;
-
-    print_lines($file, "Original file:", \@lines) if $opt_print_filter_stages;
-    @lines = rm_blanks(\@lines, $language, \%EOL_Continuation_re); # remove blank lines
-    my $blank_lines = $total_lines - scalar @lines;
-    print_lines($file, "Blank lines removed:", \@lines)
-        if $opt_print_filter_stages;
-
-    @lines = rm_comments(\@lines, $language, $file,
-                               \%EOL_Continuation_re);
-
-    my $comment_lines = $total_lines - $blank_lines - scalar  @lines;
-    if ($opt_strip_comments) {
-        my $stripped_file = "";
-        if ($opt_original_dir) {
-            $stripped_file =          $file . ".$opt_strip_comments";
-        } else {
-            $stripped_file = basename $file . ".$opt_strip_comments";
-        }
-        write_file($stripped_file, @lines);
-    }
-    if ($opt_html and !$opt_diff) {
-        chomp(@original_lines);  # includes blank lines, comments
-        chomp(@lines);           # no blank lines, no comments
-
-        my (@diff_L, @diff_R, %count);
-
-        # remove blank lines to get better quality diffs; count
-        # blank lines separately
-        my @original_lines_minus_white = ();
-        # however must keep track of how many blank lines were removed and
-        # where they were removed so that the HTML display can include it
-        my %blank_line  = ();
-        my $insert_line = 0;
-        foreach (@original_lines) {
-            if (/^\s*$/) {
-               ++$count{blank}{same};
-               ++$blank_line{ $insert_line };
-            } else {
-                ++$insert_line;
-                push @original_lines_minus_white, $_;
-            }
-        }
-
-        array_diff( $file                       ,   # in
-                   \@original_lines_minus_white ,   # in
-                   \@lines                      ,   # in
-                   "comment"                    ,   # in
-                   \@diff_L, \@diff_R,          ,   # out
-                    $ra_Errors);                    # in/out
-        write_comments_to_html($file, \@diff_L, \@diff_R, \%blank_line);
-#print Dumper("count", \%count);
-    }
-
-    print "<- call_counter($total_lines, $blank_lines, $comment_lines)\n"
-        if $opt_v > 2;
-    return ($total_lines, $blank_lines, $comment_lines);
-} # 1}}}
-sub windows_glob {                           # {{{1
-    # Windows doesn't expand wildcards.  Use code from Sean M. Burke's
-    # Win32::Autoglob module to do this.
-    return map {;
-        ( defined($_) and m/[\*\?]/ ) ? sort(glob($_)) : $_
-          } @_;
-} # 1}}}
-sub write_file {                             # {{{1
-    my ($file  , # in
-        @lines , # in
-       ) = @_;
-
-#print "write_file 1 [$file]\n";
-    # Do ~ expansion (by Tim LaBerge, fixes bug 2787984)
-    my $preglob_filename = $file;
-#print "write_file 2 [$preglob_filename]\n";
-    if ($ON_WINDOWS) {
-        $file = (windows_glob($file))[0];
-    } else {
-        $file = File::Glob::glob($file);
-    }
-#print "write_file 3 [$file]\n";
-    $file = $preglob_filename unless $file;
-#print "write_file 4 [$file]\n";
-
-    print "-> write_file($file)\n" if $opt_v > 2;
-
-    # Create the destination directory if it doesn't already exist.
-    my $abs_file_path = File::Spec->rel2abs( $file );
-    my ($volume, $directories, $filename) = File::Spec->splitpath( $abs_file_path );
-    mkpath($volume . $directories, 1, 0777);
-
-    my $OUT = new IO::File $file, "w";
-    if (defined $OUT) {
-        chomp(@lines);
-        print $OUT join("\n", @lines), "\n";
-        $OUT->close;
-    } else {
-        warn "Unable to write to $file\n";
-    }
-    print "Wrote $file" unless $opt_quiet;
-    print ", $CLOC_XSL" if $opt_xsl and $opt_xsl eq $CLOC_XSL;
-    print "\n" unless $opt_quiet;
-
-    print "<- write_file\n" if $opt_v > 2;
-} # 1}}}
-sub read_file  {                             # {{{1
-    my ($file, ) = @_;
-    my %BoM = (
-        "fe ff"           => 2 ,
-        "ff fe"           => 2 ,
-        "ef bb bf"        => 3 ,
-        "f7 64 4c"        => 3 ,
-        "0e fe ff"        => 3 ,
-        "fb ee 28"        => 3 ,
-        "00 00 fe ff"     => 4 ,
-        "ff fe 00 00"     => 4 ,
-        "2b 2f 76 38"     => 4 ,
-        "2b 2f 76 39"     => 4 ,
-        "2b 2f 76 2b"     => 4 ,
-        "2b 2f 76 2f"     => 4 ,
-        "dd 73 66 73"     => 4 ,
-        "84 31 95 33"     => 4 ,
-        "2b 2f 76 38 2d"  => 5 ,
-        );
-
-    print "-> read_file($file)\n" if $opt_v > 2;
-    my @lines = ();
-    my $IN = new IO::File $file, "r";
-    if (defined $IN) {
-        @lines = <$IN>;
-        $IN->close;
-        if ($lines[$#lines]) {  # test necessary for zero content files
-                                # (superfluous?)
-            # Some files don't end with a new line.  Force this:
-            $lines[$#lines] .= "\n" unless $lines[$#lines] =~ m/\n$/;
-        }
-    } else {
-        warn "Unable to read $file\n";
-    }
-
-    # Are first few characters of the file Unicode Byte Order
-    # Marks (http://en.wikipedia.org/wiki/Byte_Order_Mark)?
-    # If yes, remove them.
-    if (@lines) {
-        my @chrs   = split('', $lines[0]);
-        my $n_chrs = scalar @chrs;
-        my ($n2, $n3, $n4, $n5) = ('', '', '', '');
-        $n2 = sprintf("%x %x", map  ord, @chrs[0,1]) if $n_chrs >= 2;
-        $n3 = sprintf("%s %x", $n2, ord  $chrs[2])   if $n_chrs >= 3;
-        $n4 = sprintf("%s %x", $n3, ord  $chrs[3])   if $n_chrs >= 4;
-        $n5 = sprintf("%s %x", $n4, ord  $chrs[4])   if $n_chrs >= 5;
-        if      (defined $BoM{$n2}) { $lines[0] = substr $lines[0], 2;
-        } elsif (defined $BoM{$n3}) { $lines[0] = substr $lines[0], 3;
-        } elsif (defined $BoM{$n4}) { $lines[0] = substr $lines[0], 4;
-        } elsif (defined $BoM{$n5}) { $lines[0] = substr $lines[0], 5;
-        }
-    }
-
-    # Trim DOS line endings.  This allows Windows files
-    # to be diff'ed with Unix files without line endings
-    # causing every line to differ.
-    foreach (@lines) { s/\cM$// }
-
-    print "<- read_file\n" if $opt_v > 2;
-    return @lines;
-} # 1}}}
-sub rm_blanks {                              # {{{1
-    my ($ra_in    ,
-        $language ,
-        $rh_EOL_continuation_re) = @_;
-    print "-> rm_blanks(language=$language)\n" if $opt_v > 2;
-#print "rm_blanks: language = [$language]\n";
-    my @out = ();
-    if ($language eq "COBOL") {
-        @out = remove_cobol_blanks($ra_in);
-    } else {
-        # removes blank lines
-        if (defined $rh_EOL_continuation_re->{$language}) {
-            @out = remove_matches_2re($ra_in, '^\s*$',
-                                      $rh_EOL_continuation_re->{$language});
-        } else {
-            @out = remove_matches($ra_in, '^\s*$');
-        }
-    }
-
-    print "<- rm_blanks(language=$language)\n" if $opt_v > 2;
-    return @out;
-} # 1}}}
-sub rm_comments {                            # {{{1
-    my ($ra_lines , # in, must be free of blank lines
-        $language , # in
-        $file     , # in (some language counters, eg Haskell, need
-                    #     access to the original file)
-        $rh_EOL_continuation_re , # in
-       ) = @_;
-    print "-> rm_comments(file=$file)\n" if $opt_v > 2;
-    my @routines       = @{$Filters_by_Language{$language}};
-    my @lines          = @{$ra_lines};
-    my @original_lines = @{$ra_lines};
-
-    if (!scalar @original_lines) {
-        return @lines;
-    }
-
-    foreach my $call_string (@routines) {
-        my $subroutine = $call_string->[0];
-        if (! defined &{$subroutine}) {
-            warn "rm_comments undefined subroutine $subroutine for $file\n";
-            next;
-        }
-        print "rm_comments file=$file sub=$subroutine\n" if $opt_v > 1;
-        my @args  = @{$call_string};
-        shift @args; # drop the subroutine name
-        if (@args and $args[0] eq '>filename<') {
-            shift   @args;
-            unshift @args, $file;
-        }
-#use Data::Dumper;
-#print "\ncall_string=", Dumper($call_string);
-#print "args=\n";
-#print Dumper(\@args);
-#print "lines before=\n";
-#print Dumper(\@lines);
-
-        no strict 'refs';
-        @lines = &{$subroutine}(\@lines, @args);   # apply filter...
-
-#print "lines after=\n";
-#print Dumper(\@lines);
-
-        print_lines($file, "After $subroutine(@args)", \@lines)
-            if $opt_print_filter_stages;
-        # then remove blank lines which are created by comment removal
-        if (defined $rh_EOL_continuation_re->{$language}) {
-            @lines = remove_matches_2re(\@lines, '^\s*$',
-                                        $rh_EOL_continuation_re->{$language});
-        } else {
-            @lines = remove_matches(\@lines, '^\s*$');
-        }
-
-        print_lines($file, "post $subroutine(@args) blank cleanup:", \@lines)
-            if $opt_print_filter_stages;
-    }
-    # Exception for scripting languages:  treat the first #! line as code.
-    # Will need to add it back in if it was removed earlier.
-    if (defined $Script_Language{$language} and
-        $original_lines[0] =~ /^#!/ and
-        (scalar(@lines) == 0 or
-         $lines[0] ne $original_lines[0])) {
-        unshift @lines, $original_lines[0];  # add the first line back
-    }
-
-    foreach (@lines) { chomp }   # make sure no spurious newlines were added
-
-    print "<- rm_comments\n" if $opt_v > 2;
-    return @lines;
-} # 1}}}
-sub remove_f77_comments {                    # {{{1
-    my ($ra_lines, ) = @_;
-    print "-> remove_f77_comments\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    foreach (@{$ra_lines}) {
-        next if m{^[*cC]};
-        next if m{^\s*!};
-        push @save_lines, $_;
-    }
-
-    print "<- remove_f77_comments\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_f90_comments {                    # {{{1
-    # derived from SLOCCount
-    my ($ra_lines, ) = @_;
-    print "-> remove_f90_comments\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    foreach (@{$ra_lines}) {
-        # a comment is              m/^\s*!/
-        # an empty line is          m/^\s*$/
-        # a HPF statement is        m/^\s*!hpf\$/i
-        # an Open MP statement is   m/^\s*!omp\$/i
-        if (! m/^(\s*!|\s*$)/ || m/^\s*!(hpf|omp)\$/i) {
-            push @save_lines, $_;
-        }
-    }
-
-    print "<- remove_f90_comments\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_matches {                         # {{{1
-    my ($ra_lines, # in
-        $pattern , # in   Perl regular expression (case insensitive)
-       ) = @_;
-    print "-> remove_matches(pattern=$pattern)\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    foreach (@{$ra_lines}) {
-#chomp;
-#print "remove_matches [$pattern] [$_]\n";
-        next if m{$pattern}i;
-#       s{$pattern}{}i;
-#       next unless /\S/; # at least one non space
-        push @save_lines, $_;
-    }
-
-    print "<- remove_matches\n" if $opt_v > 2;
-#print "remove_matches returning\n   ", join("\n   ", @save_lines), "\n";
-    return @save_lines;
-} # 1}}}
-sub remove_matches_2re {                     # {{{1
-    my ($ra_lines, # in
-        $pattern1, # in Perl regex 1 (case insensitive) to match
-        $pattern2, # in Perl regex 2 (case insensitive) to not match prev line
-       ) = @_;
-    print "-> remove_matches_2re(pattern=$pattern1,$pattern2)\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    for (my $i = 0; $i < scalar @{$ra_lines}; $i++) {
-#       chomp($ra_lines->[$i]);
-#print "remove_matches_2re [$pattern1] [$pattern2] [$ra_lines->[$i]]\n";
-        if ($i) {
-#print "remove_matches_2re prev=[$ra_lines->[$i-1]] this=[$ra_lines->[$i]]\n";
-            next if ($ra_lines->[$i]   =~ m{$pattern1}i) and
-                    ($ra_lines->[$i-1] !~ m{$pattern2}i);
-        } else {
-            # on first line
-            next if $ra_lines->[$i]   =~  m{$pattern1}i;
-        }
-        push @save_lines, $ra_lines->[$i];
-    }
-
-    print "<- remove_matches_2re\n" if $opt_v > 2;
-#print "remove_matches_2re returning\n   ", join("\n   ", @save_lines), "\n";
-    return @save_lines;
-} # 1}}}
-sub remove_inline {                          # {{{1
-    my ($ra_lines, # in
-        $pattern , # in   Perl regular expression (case insensitive)
-       ) = @_;
-    print "-> remove_inline(pattern=$pattern)\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    unless ($opt_inline) {
-        return @{$ra_lines};
-    }
-    my $nLines_affected = 0;
-    foreach (@{$ra_lines}) {
-#chomp; print "remove_inline [$pattern] [$_]\n";
-        if (m{$pattern}i) {
-            ++$nLines_affected;
-            s{$pattern}{}i;
-        }
-        push @save_lines, $_;
-    }
-
-    print "<- remove_inline\n" if $opt_v > 2;
-#print "remove_inline returning\n   ", join("\n   ", @save_lines), "\n";
-    return @save_lines;
-} # 1}}}
-sub remove_above {                           # {{{1
-    my ($ra_lines, $marker, ) = @_;
-    print "-> remove_above(marker=$marker)\n" if $opt_v > 2;
-
-    # Make two passes through the code:
-    # 1. check if the marker exists
-    # 2. remove anything above the marker if it exists,
-    #    do nothing if the marker does not exist
-
-    # Pass 1
-    my $found_marker = 0;
-    for (my $line_number  = 1;
-            $line_number <= scalar @{$ra_lines};
-            $line_number++) {
-        if ($ra_lines->[$line_number-1] =~ m{$marker}) {
-            $found_marker = $line_number;
-            last;
-        }
-    }
-
-    # Pass 2 only if needed
-    my @save_lines = ();
-    if ($found_marker) {
-        my $n = 1;
-        foreach (@{$ra_lines}) {
-            push @save_lines, $_
-                if $n >= $found_marker;
-            ++$n;
-        }
-    } else { # marker wasn't found; save all lines
-        foreach (@{$ra_lines}) {
-            push @save_lines, $_;
-        }
-    }
-
-    print "<- remove_above\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_below {                           # {{{1
-    my ($ra_lines, $marker, ) = @_;
-    print "-> remove_below(marker=$marker)\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    foreach (@{$ra_lines}) {
-        last if m{$marker};
-        push @save_lines, $_;
-    }
-
-    print "<- remove_below\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_below_above {                     # {{{1
-    my ($ra_lines, $marker_below, $marker_above, ) = @_;
-    # delete lines delimited by start and end line markers such
-    # as Perl POD documentation
-    print "-> remove_below_above(markerB=$marker_below, A=$marker_above)\n"
-        if $opt_v > 2;
-
-    my @save_lines = ();
-    my $between    = 0;
-    foreach (@{$ra_lines}) {
-        if (!$between and m{$marker_below}) {
-            $between    = 1;
-            next;
-        }
-        if ($between and m{$marker_above}) {
-            $between    = 0;
-            next;
-        }
-        next if $between;
-        push @save_lines, $_;
-    }
-
-    print "<- remove_below_above\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_between {                         # {{{1
-    my ($ra_lines, $marker, ) = @_;
-    # $marker must contain one of the balanced pairs understood
-    # by Regexp::Common::balanced, namely
-    # '{}'  '()'  '[]'  or  '<>'
-
-    print "-> remove_between(marker=$marker)\n" if $opt_v > 2;
-    my %acceptable = ('{}'=>1,  '()'=>1,  '[]'=>1,  '<>'=>1, );
-    die "remove_between:  invalid delimiter '$marker'\n",
-        "the delimiter must be one of these four pairs:\n",
-        "{}  ()  []  <>\n" unless
-        $acceptable{$marker};
-
-    Install_Regexp_Common() unless $HAVE_Rexexp_Common;
-
-    my $all_lines = join("", @{$ra_lines});
-
-    no strict 'vars';
-    # otherwise get:
-    #  Global symbol "%RE" requires explicit package name at cloc line xx.
-    if ($all_lines =~ m/$RE{balanced}{-parens => $marker}/) {
-        no warnings;
-        $all_lines =~ s/$1//g;
-    }
-
-    print "<- remove_between\n" if $opt_v > 2;
-    return split("\n", $all_lines);
-} # 1}}}
-sub remove_between_general {                 # {{{1
-    my ($ra_lines, $start_marker, $end_marker, ) = @_;
-    # Start and end markers may be any length strings.
-
-    print "-> remove_between_general(start=$start_marker, end=$end_marker)\n"
-        if $opt_v > 2;
-
-    my $all_lines = join("", @{$ra_lines});
-
-    my @save_lines = ();
-    my $in_comment = 0;
-    foreach (@{$ra_lines}) {
-
-        next if /^\s*$/;
-        s/\Q$start_marker\E.*?\Q$end_marker\E//g;  # strip one-line comments
-        next if /^\s*$/;
-        if ($in_comment) {
-            if (/\Q$end_marker\E/) {
-                s/^.*?\Q$end_marker\E//;
-                $in_comment = 0;
-            }
-            next if $in_comment;
-        }
-        next if /^\s*$/;
-        $in_comment = 1 if /^(.*?)\Q$start_marker\E/; # $1 may be blank or code
-        next if defined $1 and $1 =~ /^\s*$/; # leading blank; all comment
-        if ($in_comment) {
-            # part code, part comment; strip the comment and keep the code
-            s/^(.*?)\Q$start_marker\E.*$/$1/;
-        }
-        push @save_lines, $_;
-    }
-
-    print "<- remove_between_general\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_between_regex   {                 # {{{1
-    my ($ra_lines, $start_RE, $end_RE, ) = @_;
-    # Start and end regex's may be any length strings.
-
-    print "-> remove_between_regex(start=$start_RE, end=$end_RE)\n"
-        if $opt_v > 2;
-
-    my $all_lines = join("", @{$ra_lines});
-
-    my @save_lines = ();
-    my $in_comment = 0;
-    foreach (@{$ra_lines}) {
-
-        next if /^\s*$/;
-        s/${start_RE}.*?${end_RE}//g;  # strip one-line comments
-        next if /^\s*$/;
-        if ($in_comment) {
-            if (/$end_RE/) {
-                s/^.*?${end_RE}//;
-                $in_comment = 0;
-            }
-            next if $in_comment;
-        }
-        next if /^\s*$/;
-        $in_comment = 1 if /^(.*?)${start_RE}/; # $1 may be blank or code
-        next if defined $1 and $1 =~ /^\s*$/; # leading blank; all comment
-        if ($in_comment) {
-            # part code, part comment; strip the comment and keep the code
-            s/^(.*?)${start_RE}.*$/$1/;
-        }
-        push @save_lines, $_;
-    }
-
-    print "<- remove_between_regex\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub replace_between_regex  {                 # {{{1
-    my ($ra_lines, $start_RE, $end_RE, $replace_RE, ) = @_;
-    # Start and end regex's may be any length strings.
-
-    print "-> replace_between_regex(start=$start_RE, end=$end_RE)\n"
-        if $opt_v > 2;
-
-    my $all_lines = join("", @{$ra_lines});
-
-    my @save_lines = ();
-    my $in_comment = 0;
-    foreach (@{$ra_lines}) {
-
-        next if /^\s*$/;
-        s/${start_RE}.*?${end_RE}/${replace_RE}/eeg;  # strip one-line comments
-        next if /^\s*$/;
-        if ($in_comment) {
-            if (/$end_RE/) {
-                s/^.*?${end_RE}/${replace_RE}/ee;
-                $in_comment = 0;
-            }
-            next if $in_comment;
-        }
-        next if /^\s*$/;
-        $in_comment = 1 if /^(.*?)${start_RE}/; # $1 may be blank or code
-        next if defined $1 and $1 =~ /^\s*$/; # leading blank; all comment
-        if ($in_comment) {
-            # part code, part comment; strip the comment and keep the code
-            s/^(.*?)${start_RE}.*$/$1/;
-        }
-        push @save_lines, $_;
-    }
-
-    print "<- replace_between_regex\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_cobol_blanks {                    # {{{1
-    # subroutines derived from SLOCCount
-    my ($ra_lines, ) = @_;
-
-    my $free_format = 0;  # Support "free format" source code.
-    my @save_lines  = ();
-
-    foreach (@{$ra_lines}) {
-        next if m/^\s*$/;
-        my $line = expand($_);  # convert tabs to equivalent spaces
-        $free_format = 1 if $line =~ m/^......\$.*SET.*SOURCEFORMAT.*FREE/i;
-        if ($free_format) {
-            push @save_lines, $_;
-        } else {
-            # Greg Toth:
-            #  (1) Treat lines with any alphanum in cols 1-6 and
-            #      blanks in cols 7 through 71 as blank line, and
-            #  (2) Treat lines with any alphanum in cols 1-6 and
-            #      slash (/) in col 7 as blank line (this is a
-            #      page eject directive).
-            push @save_lines, $_ unless m/^\d{6}\s*$/             or
-                                        ($line =~ m/^.{6}\s{66}/) or
-                                        ($line =~ m/^......\//);
-        }
-    }
-    return @save_lines;
-} # 1}}}
-sub remove_cobol_comments {                  # {{{1
-    # subroutines derived from SLOCCount
-    my ($ra_lines, ) = @_;
-
-    my $free_format = 0;  # Support "free format" source code.
-    my @save_lines  = ();
-
-    foreach (@{$ra_lines}) {
-        if (m/^......\$.*SET.*SOURCEFORMAT.*FREE/i) {$free_format = 1;}
-        if ($free_format) {
-            push @save_lines, $_ unless m{^\s*\*};
-        } else {
-            push @save_lines, $_ unless m{^......\*} or m{^\*};
-        }
-    }
-    return @save_lines;
-} # 1}}}
-sub remove_jcl_comments {                    # {{{1
-    my ($ra_lines, ) = @_;
-
-    print "-> remove_jcl_comments\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    my $in_comment = 0;
-    foreach (@{$ra_lines}) {
-        next if /^\s*$/;
-        next if m{^\s*//\*};
-        last if m{^\s*//\s*$};
-        push @save_lines, $_;
-    }
-
-    print "<- remove_jcl_comments\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_jsp_comments {                    # {{{1
-    #  JSP comment is   <%--  body of comment   --%>
-    my ($ra_lines, ) = @_;
-
-    print "-> remove_jsp_comments\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    my $in_comment = 0;
-    foreach (@{$ra_lines}) {
-
-        next if /^\s*$/;
-        s/<\%\-\-.*?\-\-\%>//g;  # strip one-line comments
-        next if /^\s*$/;
-        if ($in_comment) {
-            if (/\-\-\%>/) {
-                s/^.*?\-\-\%>//;
-                $in_comment = 0;
-            }
-        }
-        next if /^\s*$/;
-        $in_comment = 1 if /^(.*?)<\%\-\-/;
-        next if defined $1 and $1 =~ /^\s*$/;
-        next if ($in_comment);
-        push @save_lines, $_;
-    }
-
-    print "<- remove_jsp_comments\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_html_comments {                   # {{{1
-    #  HTML comment is   <!--  body of comment   -->
-    #  Need to use my own routine until the HTML comment regex in
-    #  the Regexp::Common module can handle  <!--  --  -->
-    my ($ra_lines, ) = @_;
-
-    print "-> remove_html_comments\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    my $in_comment = 0;
-    foreach (@{$ra_lines}) {
-
-        next if /^\s*$/;
-        s/<!\-\-.*?\-\->//g;  # strip one-line comments
-        next if /^\s*$/;
-        if ($in_comment) {
-            if (/\-\->/) {
-                s/^.*?\-\->//;
-                $in_comment = 0;
-            }
-        }
-        next if /^\s*$/;
-        $in_comment = 1 if /^(.*?)<!\-\-/;
-        next if defined $1 and $1 =~ /^\s*$/;
-        next if ($in_comment);
-        push @save_lines, $_;
-    }
-
-    print "<- remove_html_comments\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_bf_comments {                     # {{{1
-    my ($ra_lines, ) = @_;
-
-    print "-> remove_bf_comments\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    my $in_comment = 0;
-    foreach (@{$ra_lines}) {
-
-        s/[^<>+-.,\[\]]+//g;
-        next if /^\s*$/;
-        push @save_lines, $_;
-    }
-
-    print "<- remove_bf_comments\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub really_is_bf {                           # {{{1
-    my ($file, ) = @_;
-
-    print "-> really_is_bf\n" if $opt_v > 2;
-    my $n_bf_indicators  = 0;
-    my @lines = read_file($file);
-    foreach my $L (@lines) {
-        my $ind = 0;
-        if ($L =~ /([+-]{4,}  |          # at least four +'s or -'s in a row
-                   [\[\]]{4,} |          # at least four [ or ] in a row
-                   [<>][+-]   |          # >- or >+ or <+ or <-
-                   <{3,}      |          # at least three < in a row
-                   ^\s*[\[\]]\s*$)/x) {  # [ or ] on line by itself
-            ++$n_bf_indicators;
-            $ind = 1;
-        }
-        # if ($ind) { print "YES: $L"; } else { print "NO : $L"; }
-    }
-    my $ratio = $n_bf_indicators/scalar(@lines);
-    my $decision = ($ratio > 0.5) || ($n_bf_indicators > 5);
-    printf "<- really_is_bf(Y/N=%d %s, R=%.3f, N=%d)\n",
-            $decision, $file, $ratio, $n_bf_indicators if $opt_v > 2;
-    return $decision;
-} # 1}}}
-sub remove_intented_block {                  # {{{1
-    # Haml block comments are defined by a silent comment marker like
-    #    /
-    # or
-    #    -#
-    # followed by indented text on subsequent lines.
-    # http://haml.info/docs/yardoc/file.REFERENCE.html#comments
-    my ($ra_lines, $regex, ) = @_;
-
-    print "-> remove_intented_block\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    my $in_comment = 0;
-    foreach (@{$ra_lines}) {
-
-        next if /^\s*$/;
-        my $line = expand($_);  # convert tabs to equivalent spaces
-        if ($in_comment) {
-            $line =~ /^(\s*)/;
-            # print "indent=", length $1, "\n";
-            if (length $1 < $in_comment) {
-                # indent level is less than comment level
-                # are back in code
-                $in_comment = 0;
-            } else {
-                # still in comments, don't use this line
-                next;
-            }
-        } elsif ($line =~ m{$regex}) {
-            if ($1) {
-                $in_comment = length($1) + 1; # number of leading spaces + 1
-            } else {
-                $in_comment = 1;
-            }
-            # print "in_comment=$in_comment\n";
-            next;
-        }
-        push @save_lines, $line;
-    }
-
-    print "<- remove_intented_block\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub remove_haml_block {                      # {{{1
-    # Haml block comments are defined by a silent comment marker like
-    #    /
-    # or
-    #    -#
-    # followed by indented text on subsequent lines.
-    # http://haml.info/docs/yardoc/file.REFERENCE.html#comments
-    my ($ra_lines, ) = @_;
-
-    return remove_intented_block($ra_lines, '^(\s*)(/|-#)\s*$');
-
-} # 1}}}
-sub remove_pug_block {                       # {{{1
-    # Haml block comments are defined by a silent comment marker like
-    #    //
-    # followed by indented text on subsequent lines.
-    # http://jade-lang.com/reference/comments/
-    my ($ra_lines, ) = @_;
-    return remove_intented_block($ra_lines, '^(\s*)(//)\s*$');
-} # 1}}}
-sub remove_slim_block {                      # {{{1
-    # slim comments start with /
-    # followed by indented text on subsequent lines.
-    # http://www.rubydoc.info/gems/slim/frames
-    my ($ra_lines, ) = @_;
-    return remove_intented_block($ra_lines, '^(\s*)(/[^!])');
-} # 1}}}
-sub add_newlines {                           # {{{1
-    my ($ra_lines, ) = @_;
-    print "-> add_newlines \n" if $opt_v > 2;
-
-    my @save_lines = ();
-    foreach (@{$ra_lines}) {
-
-        push @save_lines, "$_\n";
-    }
-
-    print "<- add_newlines \n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub docstring_to_C {                         # {{{1
-    my ($ra_lines, ) = @_;
-    # Converts Python docstrings to C comments.
-
-    print "-> docstring_to_C()\n" if $opt_v > 2;
-
-    my $in_docstring = 0;
-    foreach (@{$ra_lines}) {
-        while (/"""/) {
-            if (!$in_docstring) {
-                s{[uU]?"""}{/*};
-                $in_docstring = 1;
-            } else {
-                s{"""}{*/};
-                $in_docstring = 0;
-            }
-        }
-    }
-
-    print "<- docstring_to_C\n" if $opt_v > 2;
-    return @{$ra_lines};
-} # 1}}}
-sub Forth_paren_to_C  {                      # {{{1
-    my ($ra_lines, ) = @_;
-    # Converts Forth comment parentheses to C comments.
-
-    print "-> Forth_paren_to_C()\n" if $opt_v > 2;
-
-    my $in_comment = 0;
-    foreach (@{$ra_lines}) {
-        while (/\s\(\s/ or ($in_comment and /\)/)) {
-            if (/\s\(\s.*?\)/) {
-                # in-line parenthesis comment; handle here
-                s/\s+\(\s+.*?\)//g;
-            } elsif (!$in_comment and /\s\(\s/) {
-                s{\s+\(\s+}{/*};
-                $in_comment = 1;
-            } elsif ($in_comment and /\)/) {
-                s{\)}{*/};
-                $in_comment = 0;
-            }
-        }
-    }
-
-    print "<- Forth_paren_to_C\n" if $opt_v > 2;
-    return @{$ra_lines};
-} # 1}}}
-sub powershell_to_C {                        # {{{1
-    my ($ra_lines, ) = @_;
-    # Converts PowerShell block comment markers to C comments.
-
-    print "-> powershell_to_C()\n" if $opt_v > 2;
-
-    my $in_docstring = 0;
-    foreach (@{$ra_lines}) {
-        s{<#}{/*}g;
-        s{#>}{*/}g;
-    }
-
-    print "<- powershell_to_C\n" if $opt_v > 2;
-    return @{$ra_lines};
-} # 1}}}
-sub smarty_to_C {                            # {{{1
-    my ($ra_lines, ) = @_;
-    # Converts Smarty comments to C comments.
-
-    print "-> smarty_to_C()\n" if $opt_v > 2;
-
-    foreach (@{$ra_lines}) {
-        s[{\*][/*]g;
-        s[\*}][*/]g;
-    }
-
-    print "<- smarty_to_C\n" if $opt_v > 2;
-    return @{$ra_lines};
-} # 1}}}
-sub determine_lit_type {                     # {{{1
-  my ($file) = @_;
-
-  open (FILE, $file);
-  while (<FILE>) {
-    if (m/^\\begin\{code\}/) { close FILE; return 2; }
-    if (m/^>\s/) { close FILE; return 1; }
-  }
-
-  return 0;
-} # 1}}}
-sub remove_haskell_comments {                # {{{1
-    # Bulk of code taken from SLOCCount's haskell_count script.
-    # Strips out {- .. -} and -- comments and counts the rest.
-    # Pragmas, {-#...}, are counted as SLOC.
-    # BUG: Doesn't handle strings with embedded block comment markers gracefully.
-    #      In practice, that shouldn't be a problem.
-    my ($ra_lines, $file, ) = @_;
-
-    print "-> remove_haskell_comments\n" if $opt_v > 2;
-
-    my @save_lines = ();
-    my $in_comment = 0;
-    my $incomment  = 0;
-    my ($literate, $inlitblock) = (0,0);
-
-    $literate = 1 if $file =~ /\.lhs$/;
-    if($literate) { $literate = determine_lit_type($file) }
-
-    foreach (@{$ra_lines}) {
-        if ($literate == 1) {
-            if (!s/^>//) { s/.*//; }
-        } elsif ($literate == 2) {
-            if ($inlitblock) {
-                if (m/^\\end\{code\}/) { s/.*//; $inlitblock = 0; }
-            } elsif (!$inlitblock) {
-                if (m/^\\begin\{code\}/) { s/.*//; $inlitblock = 1; }
-                else { s/.*//; }
-            }
-        }
-
-        if ($incomment) {
-            if (m/\-\}/) { s/^.*?\-\}//;  $incomment = 0;}
-            else { s/.*//; }
-        }
-        if (!$incomment) {
-            s/--.*//;
-            s!{-[^#].*?-}!!g;
-            if (m/{-/ && (!m/{-#/)) {
-              s/{-.*//;
-              $incomment = 1;
-            }
-        }
-        if (m/\S/) { push @save_lines, $_; }
-    }
-#   if ($incomment) {print "ERROR: ended in comment in $ARGV\n";}
-
-    print "<- remove_haskell_comments\n" if $opt_v > 2;
-    return @save_lines;
-} # 1}}}
-sub print_lines {                            # {{{1
-    my ($file     , # in
-        $title    , # in
-        $ra_lines , # in
-       ) = @_;
-    printf "->%-30s %s\n", $file, $title;
-    for (my $i = 0; $i < scalar @{$ra_lines}; $i++) {
-        printf "%5d | %s", $i+1, $ra_lines->[$i];
-        print "\n" unless $ra_lines->[$i] =~ m{\n$}
-    }
-} # 1}}}
-sub set_constants {                          # {{{1
-    my ($rh_Language_by_Extension , # out
-        $rh_Language_by_Script    , # out
-        $rh_Language_by_File      , # out
-        $rhaa_Filters_by_Language , # out
-        $rh_Not_Code_Extension    , # out
-        $rh_Not_Code_Filename     , # out
-        $rh_Scale_Factor          , # out
-        $rh_Known_Binary_Archives , # out
-        $rh_EOL_continuation_re   , # out
-       ) = @_;
-# 1}}}
-%{$rh_Language_by_Extension} = (             # {{{1
-            'abap'        => 'ABAP'                  ,
-            'ac'          => 'm4'                    ,
-            'ada'         => 'Ada'                   ,
-            'adb'         => 'Ada'                   ,
-            'ads'         => 'Ada'                   ,
-            'adso'        => 'ADSO/IDSM'             ,
-            'ahk'         => 'AutoHotkey'            ,
-            'aj'          => 'AspectJ'               ,
-            'am'          => 'make'                  ,
-            'ample'       => 'AMPLE'                 ,
-            'as'          => 'ActionScript'          ,
-            'dofile'      => 'AMPLE'                 ,
-            'startup'     => 'AMPLE'                 ,
-            'asa'         => 'ASP'                   ,
-            'asax'        => 'ASP.Net'               ,
-            'ascx'        => 'ASP.Net'               ,
-            'asm'         => 'Assembly'              ,
-            'asmx'        => 'ASP.Net'               ,
-            'asp'         => 'ASP'                   ,
-            'aspx'        => 'ASP.Net'               ,
-            'master'      => 'ASP.Net'               ,
-            'sitemap'     => 'ASP.Net'               ,
-            'cshtml'      => 'Razor'                 ,
-            'awk'         => 'awk'                   ,
-            'bash'        => 'Bourne Again Shell'    ,
-            'bas'         => 'Visual Basic'          ,
-            'dxl'         => 'DOORS Extension Language',
-            'bat'         => 'DOS Batch'             ,
-            'BAT'         => 'DOS Batch'             ,
-            'cmd'         => 'DOS Batch'             ,
-            'CMD'         => 'DOS Batch'             ,
-            'btm'         => 'DOS Batch'             ,
-            'BTM'         => 'DOS Batch'             ,
-            'blade.php'   => 'Blade'                 ,
-            'build.xml'   => 'Ant'                   ,
-            'b'           => 'Brainfuck'             ,
-            'bf'          => 'Brainfuck'             ,
-            'cbl'         => 'COBOL'                 ,
-            'CBL'         => 'COBOL'                 ,
-            'c'           => 'C'                     ,
-            'C'           => 'C++'                   ,
-            'cc'          => 'C++'                   ,
-            'c++'         => 'C++'                   ,
-            'ccs'         => 'CCS'                   ,
-            'cfc'         => 'ColdFusion CFScript'   ,
-            'cfm'         => 'ColdFusion'            ,
-            'cl'          => 'Lisp/OpenCL'           ,
-            'clj'         => 'Clojure'               ,
-            'cljs'        => 'ClojureScript'         ,
-            'cljc'        => 'ClojureC'              ,
-            'cls'         => 'Visual Basic'          , # also Apex Class
-            'CMakeLists.txt' => 'CMake'              ,
-            'cmake'       => 'CMake'                 ,
-            'cob'         => 'COBOL'                 ,
-            'COB'         => 'COBOL'                 ,
-            'coffee'      => 'CoffeeScript'          ,
-            'component'   => 'Visualforce Component' ,
-            'cpp'         => 'C++'                   ,
-            'cr'          => 'Crystal'               ,
-            'cs'          => 'C#'                    ,
-            'csh'         => 'C Shell'               ,
-            'cson'        => 'CSON'                  ,
-            'css'         => "CSS"                   ,
-            'ctl'         => 'Visual Basic'          ,
-            'cu'          => 'CUDA'                  ,
-            'cuh'         => 'CUDA'                  , # CUDA header file
-            'cxx'         => 'C++'                   ,
-            'd'           => 'D/dtrace'              ,
-# in addition, .d can map to init.d files typically written as
-# bash or sh scripts
-            'da'          => 'DAL'                   ,
-            'dart'        => 'Dart'                  ,
-            'def'         => 'Windows Module Definition',
-            'diff'        => 'diff'                  ,
-            'dmap'        => 'NASTRAN DMAP'          ,
-            'dpr'         => 'Pascal'                ,
-            'dita'        => 'DITA'                  ,
-            'dsr'         => 'Visual Basic'          ,
-            'dtd'         => 'DTD'                   ,
-            'ec'          => 'C'                     ,
-            'ecpp'        => 'ECPP'                  ,
-            'eex'         => 'EEx'                   ,
-            'el'          => 'Lisp'                  ,
-            'elm'         => 'Elm'                   ,
-            'exs'         => 'Elixir'                ,
-            'ex'          => 'Elixir'                ,
-            'erb'         => 'ERB'                   ,
-            'ERB'         => 'ERB'                   ,
-            'erl'         => 'Erlang'                ,
-            'exp'         => 'Expect'                ,
-            '4th'         => 'Forth'                 ,
-            'forth'       => 'Forth'                 ,
-            'fr'          => 'Forth'                 ,
-            'frt'         => 'Forth'                 ,
-            'fth'         => 'Forth'                 ,
-            'f83'         => 'Forth'                 ,
-            'fb'          => 'Forth'                 ,
-            'fpm'         => 'Forth'                 ,
-            'e4'          => 'Forth'                 ,
-            'rx'          => 'Forth'                 ,
-            'ft'          => 'Forth'                 ,
-            'f77'         => 'Fortran 77'            ,
-            'F77'         => 'Fortran 77'            ,
-            'f90'         => 'Fortran 90'            ,
-            'F90'         => 'Fortran 90'            ,
-            'f95'         => 'Fortran 95'            ,
-            'F95'         => 'Fortran 95'            ,
-            'f'           => 'Fortran 77/Forth'      ,
-            'F'           => 'Fortran 77'            ,
-            'for'         => 'Fortran 77/Forth'      ,
-            'FOR'         => 'Fortran 77'            ,
-            'ftl'         => 'Freemarker Template'   ,
-            'ftn'         => 'Fortran 77'            ,
-            'FTN'         => 'Fortran 77'            ,
-            'fmt'         => 'Oracle Forms'          ,
-            'focexec'     => 'Focus'                 ,
-            'frm'         => 'Visual Basic'          ,
-            'fs'          => 'F#/Forth'              ,
-            'fsi'         => 'F#'                    ,
-            'g'           => 'Antlr'                 ,
-            'gnumakefile' => 'make'                  ,
-            'Gnumakefile' => 'make'                  ,
-            'gd'          => 'GDScript'              ,
-            'glsl'        => 'GLSL'                  ,
-			'vert'        => 'GLSL'                  ,
-			'tesc'        => 'GLSL'                  ,
-			'tese'        => 'GLSL'                  ,
-			'geom'        => 'GLSL'                  ,
-			'frag'        => 'GLSL'                  ,
-			'comp'        => 'GLSL'                  ,
-            'go'          => 'Go'                    ,
-            'gsp'         => 'Grails'                ,
-            'groovy'      => 'Groovy'                ,
-            'gant'        => 'Groovy'                ,
-            'gradle'      => 'Groovy'                ,
-            'h'           => 'C/C++ Header'          ,
-            'H'           => 'C/C++ Header'          ,
-            'hh'          => 'C/C++ Header'          ,
-            'hpp'         => 'C/C++ Header'          ,
-            'hxx'         => 'C/C++ Header'          ,
-            'hb'          => 'Harbour'               ,
-            'hrl'         => 'Erlang'                ,
-            'hs'          => 'Haskell'               ,
-            'hlsl'        => 'HLSL'                  ,
-            'shader'      => 'HLSL'                  ,
-            'cg'          => 'HLSL'                  ,
-            'cginc'       => 'HLSL'                  ,
-            'haml'        => 'Haml'                  ,
-            'handlebars'  => 'Handlebars'            ,
-            'hbs'         => 'Handlebars'            ,
-            'hx'          => 'Haxe'                  ,
-            'htm'         => 'HTML'                  ,
-            'html'        => 'HTML'                  ,
-            'i3'          => 'Modula3'               ,
-            'ice'         => 'Slice'                 ,
-            'icl'         => 'Clean'                 ,
-            'dcl'         => 'Clean'                 ,
-            'idl'         => 'IDL'                   ,
-            'ini'         => 'INI'                   ,
-            'ism'         => 'InstallShield'         ,
-            'pro'         => 'IDL/Qt Project/Prolog' ,
-            'ig'          => 'Modula3'               ,
-            'il'          => 'SKILL'                 ,
-            'ils'         => 'SKILL++'               ,
-            'inc'         => 'PHP/Pascal'            , # might be PHP or Pascal
-            'ino'         => 'Arduino Sketch'        ,
-            'pde'         => 'Arduino Sketch'        , # pre 1.0
-            'itk'         => 'Tcl/Tk'                ,
-            'java'        => 'Java'                  ,
-            'jcl'         => 'JCL'                   , # IBM Job Control Lang.
-            'jl'          => 'Lisp/Julia'            ,
-            'js'          => 'JavaScript'            ,
-            'es6'         => 'JavaScript'            ,
-            'jsf'         => 'JavaServer Faces'      ,
-            'jsx'         => 'JSX'                   ,
-            'xhtml'       => 'XHTML'                 ,
-            'json'        => 'JSON'                  ,
-            'jsp'         => 'JSP'                   , # Java server pages
-            'jspf'        => 'JSP'                   , # Java server pages
-            'vm'          => 'Velocity Template Language' ,
-            'ksc'         => 'Kermit'                ,
-            'ksh'         => 'Korn Shell'            ,
-            'kt'          => 'Kotlin'                ,
-            'kts'         => 'Kotlin'                ,
-            'lhs'         => 'Haskell'               ,
-            'l'           => 'lex'                   ,
-            'less'        => 'LESS'                  ,
-            'lfe'         => 'LFE'                   ,
-            'liquid'      => 'liquid'                ,
-            'lsp'         => 'Lisp'                  ,
-            'lisp'        => 'Lisp'                  ,
-            'lgt'         => 'Logtalk'               ,
-            'logtalk'     => 'Logtalk'               ,
-            'lua'         => 'Lua'                   ,
-            'm3'          => 'Modula3'               ,
-            'm4'          => 'm4'                    ,
-            'makefile'    => 'make'                  ,
-            'Makefile'    => 'make'                  ,
-            'mako'        => 'Mako'                  ,
-            'md'          => 'Markdown'              ,
-            'mc'          => 'Windows Message File'  ,
-            'met'         => 'Teamcenter met'        ,
-            'mg'          => 'Modula3'               ,
-            'mk'          => 'make'                  ,
-#           'mli'         => 'ML'                    , # ML not implemented
-#           'ml'          => 'ML'                    ,
-            'ml'          => 'OCaml'                 ,
-            'mli'         => 'OCaml'                 ,
-            'mly'         => 'OCaml'                 ,
-            'mll'         => 'OCaml'                 ,
-            'm'           => 'MATLAB/Mathematica/Objective C/MUMPS/Mercury' ,
-            'mm'          => 'Objective C++'         ,
-            'mt'          => 'Mathematica'           ,
-            'wl'          => 'Mathematica'           ,
-            'wlt'         => 'Mathematica'           ,
-            'mustache'    => 'Mustache'              ,
-            'wdproj'      => 'MSBuild script'        ,
-            'csproj'      => 'MSBuild script'        ,
-            'vcproj'      => 'MSBuild script'        ,
-            'wixproj'     => 'MSBuild script'        ,
-            'vbproj'      => 'MSBuild script'        ,
-            'mps'         => 'MUMPS'                 ,
-            'mth'         => 'Teamcenter mth'        ,
-            'n'           => 'Nemerle'               ,
-            'nim'         => 'Nim'                   ,
-            'oscript'     => 'LiveLink OScript'      ,
-            'pad'         => 'Ada'                   , # Oracle Ada preprocessor
-            'page'        => 'Visualforce Page'      ,
-            'pas'         => 'Pascal'                ,
-            'pcc'         => 'C++'                   , # Oracle C++ preprocessor
-            'perl'        => 'Perl'                  ,
-            'pfo'         => 'Fortran 77'            ,
-            'pgc'         => 'C'                     , # Postgres embedded C/C++
-            'php3'        => 'PHP'                   ,
-            'php4'        => 'PHP'                   ,
-            'php5'        => 'PHP'                   ,
-            'php'         => 'PHP'                   ,
-            'phtml'       => 'PHP'                   ,
-            'pig'         => 'Pig Latin'             ,
-            'plh'         => 'Perl'                  ,
-            'pl'          => 'Perl/Prolog'           ,
-            'p6'          => 'Perl/Prolog'           ,
-            'PL'          => 'Perl/Prolog'           ,
-            'plx'         => 'Perl'                  ,
-            'pm'          => 'Perl'                  ,
-            'pm6'         => 'Perl'                  ,
-            'pom.xml'     => 'Maven'                 ,
-            'pom'         => 'Maven'                 ,
-            'P'           => 'Prolog'                ,
-            'p'           => 'Pascal'                ,
-            'pp'          => 'Pascal/Puppet'         ,
-            'psql'        => 'SQL'                   ,
-            'py'          => 'Python'                ,
-            'pyj'         => 'RapydScript'           ,
-            'pyx'         => 'Cython'                ,
-            'qml'         => 'QML'                   ,
-            'rb'          => 'Ruby'                  ,
-            'rake'        => 'Ruby'                  ,
-         #  'resx'        => 'ASP.Net'               ,
-            'rex'         => 'Oracle Reports'        ,
-            'rexx'        => 'Rexx'                  ,
-            'rhtml'       => 'Ruby HTML'             ,
-            'rs'          => 'Rust'                  ,
-            's'           => 'Assembly'              ,
-            'S'           => 'Assembly'              ,
-            'SCA'         => 'Visual Fox Pro'        ,
-            'sca'         => 'Visual Fox Pro'        ,
-            'scala'       => 'Scala'                 ,
-            'sbl'         => 'Softbridge Basic'      ,
-            'SBL'         => 'Softbridge Basic'      ,
-            'sc'          => 'Lisp'                  ,
-            'scm'         => 'Lisp'                  ,
-            'sed'         => 'sed'                   ,
-            'ses'         => 'Patran Command Language'   ,
-            'pcl'         => 'Patran Command Language'   ,
-            'pl1'         => 'PL/I'                  ,
-            'po'          => 'PO File'               ,
-            'sra'         => 'PowerBuilder'          ,
-            'srf'         => 'PowerBuilder'          ,
-            'srm'         => 'PowerBuilder'          ,
-            'srs'         => 'PowerBuilder'          ,
-            'sru'         => 'PowerBuilder'          ,
-            'srw'         => 'PowerBuilder'          ,
-            'pug'         => 'Pug'                   ,
-            'purs'        => 'PureScript'            ,
-            'prefab'      => 'Unity-Prefab'          ,
-            'proto'       => 'Protocol Buffers'      ,
-            'mat'         => 'Unity-Prefab'          ,
-            'ps1'         => 'PowerShell'            ,
-            'psd1'        => 'PowerShell'            ,
-            'psm1'        => 'PowerShell'            ,
-            'R'           => 'R'                     ,
-            'r'           => 'R'                     ,
-            'rkt'         => 'Racket'                ,
-            'rktl'        => 'Racket'                ,
-            'ss'          => 'Racket'                ,
-            'scm'         => 'Racket'                ,
-            'sch'         => 'Racket'                ,
-            'scrbl'       => 'Racket'                ,
-            'tsv'         => 'RobotFramework'        ,
-            'robot'       => 'RobotFramework'        ,
-            'rc'          => 'Windows Resource File' ,
-            'rc2'         => 'Windows Resource File' ,
-            'sas'         => 'SAS'                   ,
-            'sass'        => 'Sass'                  ,
-            'scss'        => 'Sass'                  ,
-            'sh'          => 'Bourne Shell'          ,
-            'smarty'      => 'Smarty'                ,
-            'sml'         => 'Standard ML'           ,
-            'sig'         => 'Standard ML'           ,
-            'fun'         => 'Standard ML'           ,
-            'slim'        => 'Slim'                  ,
-            'e'           => 'Specman e'             ,
-            'sql'         => 'SQL'                   ,
-            'SQL'         => 'SQL'                   ,
-            'sproc.sql'   => 'SQL Stored Procedure'  ,
-            'spoc.sql'    => 'SQL Stored Procedure'  ,
-            'spc.sql'     => 'SQL Stored Procedure'  ,
-            'udf.sql'     => 'SQL Stored Procedure'  ,
-            'data.sql'    => 'SQL Data'              ,
-            'styl'        => 'Stylus'                ,
-            'sv'          => 'Verilog-SystemVerilog' ,
-            'svh'         => 'Verilog-SystemVerilog' ,
-            'v'           => 'Verilog-SystemVerilog/Coq' ,
-            'tcl'         => 'Tcl/Tk'                ,
-            'tcsh'        => 'C Shell'               ,
-            'tk'          => 'Tcl/Tk'                ,
-            'tex'         => 'TeX'                   , # TeX, LaTex, MikTex, ..
-            'sty'         => 'TeX'                   ,
-#           'cls'         => 'TeX'                   ,
-            'dtx'         => 'TeX'                   ,
-            'bst'         => 'TeX'                   ,
-            'tpl'         => 'Smarty'                ,
-            'trigger'     => 'Apex Trigger'          ,
-            'ttcn'        => 'TTCN'                  ,
-            'ttcn2'       => 'TTCN'                  ,
-            'ttcn3'       => 'TTCN'                  ,
-            'ttcnpp'      => 'TTCN'                  ,
-            'tpd'         => 'TITAN Project File Information',
-            'ts'          => 'TypeScript/Qt Linguist',
-            'tsx'         => 'TypeScript'            ,
-            'tss'         => 'Titanium Style Sheet'  ,
-            'twig'        => 'Twig'                  ,
-            'ui'          => 'Qt/Glade'              ,
-            'glade'       => 'Glade'                 ,
-            'vala'        => 'Vala'                  ,
-            'vapi'        => 'Vala Header'           ,
-            'vhd'         => 'VHDL'                  ,
-            'VHD'         => 'VHDL'                  ,
-            'vhdl'        => 'VHDL'                  ,
-            'VHDL'        => 'VHDL'                  ,
-            'vba'         => 'Visual Basic'          ,
-            'VBA'         => 'Visual Basic'          ,
-         #  'vbp'         => 'Visual Basic'          , # .vbp - autogenerated
-            'vb'          => 'Visual Basic'          ,
-            'VB'          => 'Visual Basic'          ,
-         #  'vbw'         => 'Visual Basic'          , # .vbw - autogenerated
-            'vbs'         => 'Visual Basic'          ,
-            'VBS'         => 'Visual Basic'          ,
-            'vue'         => 'Vuejs Component'       ,
-            'webinfo'     => 'ASP.Net'               ,
-            'xmi'         => 'XMI'                   ,
-            'XMI'         => 'XMI'                   ,
-            'xml'         => 'XML'                   ,
-            'xml'         => 'XML'                   ,
-            'XML'         => 'XML'                   ,
-            'mxml'        => 'MXML'                  ,
-            'xml.builder' => 'builder'               ,
-            'build'       => 'NAnt script'           ,
-            'vim'         => 'vim script'            ,
-            'swift'       => 'Swift'                 ,
-            'xaml'        => 'XAML'                  ,
-            'wxs'         => 'WiX source'            ,
-            'wxi'         => 'WiX include'           ,
-            'wxl'         => 'WiX string localization' ,
-            'prg'         => 'xBase'                 ,
-            'ch'          => 'xBase Header'          ,
-            'xq'          => 'XQuery'                ,
-            'xquery'      => 'XQuery'                ,
-            'xsd'         => 'XSD'                   ,
-            'XSD'         => 'XSD'                   ,
-            'xslt'        => 'XSLT'                  ,
-            'XSLT'        => 'XSLT'                  ,
-            'xsl'         => 'XSLT'                  ,
-            'XSL'         => 'XSLT'                  ,
-            'y'           => 'yacc'                  ,
-            'yaml'        => 'YAML'                  ,
-            'yml'         => 'YAML'                  ,
-            'zsh'         => 'zsh'                   ,
-            );
-# 1}}}
-%{$rh_Language_by_Script}    = (             # {{{1
-            'awk'      => 'awk'                   ,
-            'bash'     => 'Bourne Again Shell'    ,
-            'bc'       => 'bc'                    ,# calculator
-            'crystal'  => 'Crystal'               ,
-            'csh'      => 'C Shell'               ,
-            'dmd'      => 'D'                     ,
-            'dtrace'   => 'dtrace'                ,
-            'idl'      => 'IDL'                   ,
-            'kermit'   => 'Kermit'                ,
-            'ksh'      => 'Korn Shell'            ,
-            'lua'      => 'Lua'                   ,
-            'make'     => 'make'                  ,
-            'octave'   => 'Octave'                ,
-            'perl5'    => 'Perl'                  ,
-            'perl6'    => 'Perl'                  ,
-            'perl'     => 'Perl'                  ,
-            'miniperl' => 'Perl'                  ,
-            'php'      => 'PHP'                   ,
-            'php5'     => 'PHP'                   ,
-            'python'   => 'Python'                ,
-            'python2.6'=> 'Python'                ,
-            'python2.7'=> 'Python'                ,
-            'python3'  => 'Python'                ,
-            'python3.3'=> 'Python'                ,
-            'python3.4'=> 'Python'                ,
-            'python3.5'=> 'Python'                ,
-            'rexx'     => 'Rexx'                  ,
-            'regina'   => 'Rexx'                  ,
-            'ruby'     => 'Ruby'                  ,
-            'sed'      => 'sed'                   ,
-            'sh'       => 'Bourne Shell'          ,
-            'swipl'    => 'Prolog'                ,
-            'tcl'      => 'Tcl/Tk'                ,
-            'tclsh'    => 'Tcl/Tk'                ,
-            'tcsh'     => 'C Shell'               ,
-            'wish'     => 'Tcl/Tk'                ,
-            'zsh'      => 'zsh'                   ,
-            );
-# 1}}}
-%{$rh_Language_by_File}      = (             # {{{1
-            'build.xml'      => 'Ant/XML'            ,
-            'CMakeLists.txt' => 'CMake'              ,
-            'Jamfile'        => 'Jam'                ,
-            'Jamrules'       => 'Jam'                ,
-            'Makefile'       => 'make'               ,
-            'makefile'       => 'make'               ,
-            'gnumakefile'    => 'make'               ,
-            'Gnumakefile'    => 'make'               ,
-            'pom.xml'        => 'Maven/XML'          ,
-            'Rakefile'       => 'Ruby'               ,
-            'rakefile'       => 'Ruby'               ,
-            'Dockerfile'     => 'Dockerfile'         ,
-            );
-# 1}}}
-%{$rhaa_Filters_by_Language} = (             # {{{1
-    '(unknown)'          => [ ],
-    'ABAP'               => [   [ 'remove_matches'      , '^\*'    ], ],
-    'ActionScript'       => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-#                               [ 'remove_matches'      , '^\s*//' ],
-                            ],
-
-    'ASP'                => [   [ 'remove_matches'      , '^\s*\47'], ],  # \47 = '
-    'ASP.Net'            => [   [ 'call_regexp_common'  , 'C'      ], ],
-    'Ada'                => [   [ 'remove_matches'      , '^\s*--' ], ],
-    'ADSO/IDSM'          => [   [ 'remove_matches'      , '^\s*\*[\+\!]' ], ],
-    'AMPLE'              => [   [ 'remove_matches'      , '^\s*//' ], ],
-    'Ant/XML'            => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'Antlr'              => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Ant'                => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'Apex Trigger'       => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Arduino Sketch'     => [   # same as C
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'AspectJ'            => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Assembly'           => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_matches'      , '^\s*;'  ],
-                                [ 'remove_matches'      , '^\s*\@' ],
-                                [ 'remove_matches'      , '^\s*\|' ],
-                                [ 'remove_matches'      , '^\s*!'  ],
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_matches'      , '^\s*--' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'remove_inline'       , ';.*$'   ],
-                                [ 'remove_inline'       , '\@.*$'  ],
-                                [ 'remove_inline'       , '\|.*$'  ],
-                                [ 'remove_inline'       , '!.*$'   ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                                [ 'remove_inline'       , '--.*$'  ],
-                            ],
-    'AutoHotkey'         => [
-                                [ 'remove_matches'      , '^\s*;'  ],
-                                [ 'remove_inline'       , ';.*$'   ],
-                            ],
-    'awk'                => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'bc'                 => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Blade'              => [
-                                [ 'remove_between_general', '{{--', '--}}' ],
-                                [ 'remove_html_comments',                  ],
-                            ],
-    'Bourne Again Shell' => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Bourne Shell'       => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Brainfuck'          => [ # puerile name for a language
-#                               [ 'call_regexp_common'  , 'Brainfuck' ],  # inaccurate
-                                [ 'remove_bf_comments',               ],
-                            ],
-    'builder'            => [
-                                [ 'remove_matches'      , '^\s*xml_markup.comment!'  ],
-                            ],
-    'C'                  => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-#                               [ 'remove_matches'      , '^\s*//' ], # C99
-                                [ 'remove_inline'       , '//.*$'  ], # C99
-                            ],
-    'C++'                => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'C/C++ Header'       => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Clean'              => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Clojure'            => [   [ 'remove_matches'      , '^\s*;'  ], ],
-    'ClojureScript'      => [   [ 'remove_matches'      , '^\s*;'  ], ],
-    'ClojureC'           => [   [ 'remove_matches'      , '^\s*;'  ], ],
-    'CMake'              => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Crystal'            => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'CUDA'               => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Cython'             => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'docstring_to_C'                 ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'C#'                 => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'CCS'                => [   [ 'call_regexp_common'  , 'C'      ], ],
-    'CSS'                => [   [ 'call_regexp_common'  , 'C'      ], ],
-    'COBOL'              => [   [ 'remove_cobol_comments',         ], ],
-    'CoffeeScript'       => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'ColdFusion'         => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ], ],
-    'ColdFusion CFScript'=> [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Coq'                => [
-                                [ 'remove_between_general', '(*', '*)' ],
-                            ],
-    'Crystal Reports'    => [   [ 'remove_matches'      , '^\s*//' ], ],
-    'CSON'               => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'D/dtrace'           => [ [ 'die' ,          ], ], # never called
-    'D'                  => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_between_general', '/+', '+/' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'DAL'                => [
-                                [ 'remove_between_general', '[', ']', ],
-                            ],
-    'Dart'               => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    # diff is kind of weird: anything but a space in the first column
-    # will count as code, with the exception of #, ---, +++.  Spaces
-    # in the first column denote context lines which aren't part of the
-    # difference.
-    'diff'               => [
-                                [ 'remove_matches'      , '^#' ],
-                                [ 'remove_matches'      , '^\-\-\-' ],
-                                [ 'remove_matches'      , '^\+\+\+' ],
-                                [ 'remove_matches'      , '^\s' ],
-                            ],
-    'DITA'               => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'DOORS Extension Language' => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'dtrace'             => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'ECPP'               => [
-                                [ 'remove_between_general',
-                                  '<%doc>', '</%doc>',             ],
-                                [ 'remove_between_general',
-                                  '<#'    , '#>'     ,             ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'EEx'                => [
-                                [ 'remove_between_general', '<%#', '%>' ],
-                            ],
-    'Elm'                => [   [ 'remove_haskell_comments', '>filename<' ], ],
-    'ERB'                => [
-                                [ 'remove_between_general', '<%#', '%>' ],
-                            ],
-    'NASTRAN DMAP'       => [
-                                [ 'remove_matches'      , '^\s*\$' ],
-                                [ 'remove_inline'       , '\$.*$'  ],
-                            ],
-    'Dockerfile'         => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'DOS Batch'          => [   [ 'remove_matches'      , '^\s*rem', ], ],
-    'DTD'                => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ], ],
-    'Elixir'             => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Erlang'             => [
-                                [ 'remove_matches'      , '^\s*%'  ],
-                                [ 'remove_inline'       , '%.*$'   ],
-                            ],
-    'Expect'             => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Focus'              => [   [ 'remove_matches'      , '^\s*\-\*'  ], ],
-    'Forth'              => [
-                                [ 'remove_matches'      , '^\s*\\\\.*$'  ],
-                                [ 'Forth_paren_to_C'                 ],
-                                [ 'call_regexp_common'  , 'C++'      ],
-                                [ 'remove_inline'       , '\\\\.*$'  ],
-                            ],
-    'Fortran 77'         => [
-                                [ 'remove_f77_comments' ,          ],
-                                [ 'remove_inline'       , '\!.*$'  ],
-                            ],
-    'Fortran 77/Forth'   => [ [ 'die' ,          ], ], # never called
-    'F#/Forth'           => [ [ 'die' ,          ], ], # never called
-    'Fortran 90'         => [
-                                [ 'remove_f77_comments' ,          ],
-                                [ 'remove_f90_comments' ,          ],
-                                [ 'remove_inline'       , '\!.*$'  ],
-                            ],
-    'Fortran 95'         => [
-                                [ 'remove_f77_comments' ,          ],
-                                [ 'remove_f90_comments' ,          ],
-                                [ 'remove_inline'       , '\!.*$'  ],
-                            ],
-    'Freemarker Template' => [
-                                [ 'remove_between_general', '<#--', '-->' ],
-                            ],
-    'F#'                 => [
-                                [ 'call_regexp_common'  , 'Pascal' ],
-                                [ 'remove_matches'      , '^\s*//' ],
-                            ],
-    'GDScript'           => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Glade'              => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'GLSL'               => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Go'                 => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Grails'             => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                                [ 'remove_jsp_comments' ,          ],
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'add_newlines'        ,          ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Groovy'             => [
-                                [ 'remove_inline'       , '//.*$'  ],
-                                # separate /* inside quoted strings with two
-                                # concatenated strings split between / and *
-                                [ 'replace_between_regex', '(["\'])(.*?/)(\*.*?)\g1',
-                                  '(.*?)' , '"$1$2$1 + $1$3$1$4"'],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Handlebars'         => [
-                                [ 'remove_between_general', '{{!--', '--}}' ],
-                                [ 'remove_between_general', '{{!', '}}' ],
-                                [ 'remove_html_comments',          ],
-                            ],
-    'Harbour'            => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_matches'      , '^\s*\&\&' ],
-                                [ 'remove_matches'      , '^\s*\*' ],
-                                [ 'remove_matches'      , '^\s*NOTE' ],
-                                [ 'remove_matches'      , '^\s*note' ],
-                                [ 'remove_matches'      , '^\s*Note' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'remove_inline'       , '\&\&.*$' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'HLSL'               => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Haml'               => [
-                                [ 'remove_haml_block'   ,          ],
-                                [ 'remove_html_comments',          ],
-                                [ 'remove_matches'      , '^\s*/\s*\S+' ],
-                                [ 'remove_matches'      , '^\s*-#\s*\S+' ],
-                            ],
-    'Haxe'               => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'HTML'               => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'INI'                => [
-                                [ 'remove_matches'      , '^\s*;'  ],
-                            ],
-    'XHTML'               => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'Haskell'            => [   [ 'remove_haskell_comments', '>filename<' ], ],
-    'IDL'                => [   [ 'remove_matches'      , '^\s*;'  ], ],
-    'IDL/Qt Project/Prolog' => [ [ 'die' ,          ], ], # never called
-    'InstallShield'      => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ], ],
-    'Jam'                => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'JSP'                => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                                [ 'remove_jsp_comments' ,          ],
-                                [ 'remove_matches'      , '^\s*//' ],
-                                [ 'add_newlines'        ,          ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                            ],
-    'JavaServer Faces'   => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Java'               => [
-                                # separate /* inside quoted strings with two
-                                # concatenated strings split between / and *
-                                [ 'replace_between_regex', '(["\'])(.*?/)(\*.*?)\g1',
-                                  '(.*?)' , '"$1$2$1 + $1$3$1$4"'],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'JavaScript'         => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'JSX'                => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'JCL'                => [   [ 'remove_jcl_comments' ,          ], ],
-    'JSON'               => [   # ECMA-404, the JSON standard definition
-                                # makes no provision for JSON comments
-                                # so just use a placeholder filter
-                                [ 'remove_matches'      , '^\s*$'  ],
-                            ],
-    'Julia'              => [
-                                [ 'remove_between_general', '#=', '=#' ],
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Kotlin'             => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-#                               [ 'remove_between_general', '/*', '*/' ],
-                            ],
-    'LESS'               => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'LFE'                => [
-                                [ 'remove_matches'      , '^\s*;'  ],
-                                [ 'remove_between_general', '#|', '|#' ],
-                            ],
-    'liquid'             => [
-                                [ 'remove_between_general', '{% comment %}',
-                                                            '{% endcomment %}' ],
-                                [ 'remove_html_comments',          ],
-                            ],
-    'Lisp'               => [
-                                [ 'remove_matches'      , '^\s*;'  ],
-                                [ 'remove_between_general', '#|', '|#' ],
-                            ],
-    'Lisp/OpenCL'        => [ [ 'die' ,          ], ], # never called
-    'Lisp/Julia'         => [ [ 'die' ,          ], ], # never called
-    'LiveLink OScript'   => [   [ 'remove_matches'      , '^\s*//' ], ],
-    'Logtalk'            => [  # same filters as Prolog
-                                [ 'remove_matches'      , '^\s*\%' ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_inline'       , '(//|\%).*$' ],
-                            ],
-#   'Lua'                => [   [ 'call_regexp_common'  , 'lua'    ], ],
-    'Lua'                => [
-                                [ 'remove_between_general', '--[[', ']]' ],
-                                [ 'remove_matches'      , '^\s*\-\-' ],
-                            ],
-    'make'               => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'MATLAB'             => [
-                                [ 'remove_matches'      , '^\s*%'  ],
-                                [ 'remove_inline'       , '%.*$'   ],
-                            ],
-    'Mathematica'        => [
-                                [ 'remove_between_general', '(*', '*)' ],
-                            ],
-    'Maven/XML'          => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'Maven'              => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'Mercury'            => [
-                                [ 'remove_inline'       , '%.*$'   ],
-                                [ 'remove_matches'      , '^\s*%'  ],
-                            ],
-    'Modula3'            => [   [ 'call_regexp_common'  , 'Pascal' ], ],
-        # Modula 3 comments are (* ... *) so applying the Pascal filter
-        # which also treats { ... } as a comment is not really correct.
-    'Nemerle'            => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Objective C'        => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Objective C++'      => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'OCaml'              => [
-                                [ 'call_regexp_common'  , 'Pascal' ],
-                            ],
-    'OpenCL'             => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-#                               [ 'remove_matches'      , '^\s*//' ], # C99
-                                [ 'remove_inline'       , '//.*$'  ], # C99
-                            ],
-    'PHP/Pascal'               => [ [ 'die' ,          ], ], # never called
-    'Mako'               => [
-                                [ 'remove_matches'       , '##.*$'  ],
-                            ],
-    'Markdown'           => [
-                                [ 'remove_between_regex',
-                                  '\[(comment|\/\/)?\]\s*:?\s*(<\s*>|#)?\s*\(.*?', '.*?\)' ],
-                                # http://stackoverflow.com/questions/4823468/comments-in-markdown
-                            ],
-    'MATLAB/Mathematica/Objective C/MUMPS/Mercury' => [ [ 'die' ,          ], ], # never called
-    'MUMPS'              => [   [ 'remove_matches'      , '^\s*;'  ], ],
-    'Mustache'           => [
-                                [ 'remove_between_general', '{{!', '}}' ],
-                            ],
-    'Nim'                => [
-                                [ 'remove_between_general', '#[', ']#' ],
-                                [ 'remove_matches'      , '^\s*#'  ],
-#                               [ 'docstring_to_C'                 ],
-#                               [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Octave'             => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Oracle Forms'       => [   [ 'call_regexp_common'  , 'C'      ], ],
-    'Oracle Reports'     => [   [ 'call_regexp_common'  , 'C'      ], ],
-    'Pascal'             => [
-                                [ 'remove_between_regex', '{[^$]', '}' ],
-                                [ 'remove_between_general', '(*', '*)' ],
-                                [ 'remove_matches'      , '^\s*//' ],
-                            ],
-####'Pascal'             => [
-####                            [ 'call_regexp_common'  , 'Pascal' ],
-####                            [ 'remove_matches'      , '^\s*//' ],
-####                        ],
-    'Pascal/Puppet'            => [ [ 'die' ,          ], ], # never called
-    'Puppet'             => [
-                                [ 'remove_matches'      , '^\s*#'   ],
-                                [ 'call_regexp_common'  , 'C'       ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'PureScript'         => [
-                                [ 'remove_matches'      , '^\s*--' ],
-                                [ 'remove_between_general', '{-', '-}' ],
-                                [ 'remove_inline'       , '--.*$'  ],
-                            ],
-    'Patran Command Language'=> [
-                                [ 'remove_matches'      , '^\s*#'   ],
-                                [ 'remove_matches'      , '^\s*\$#' ],
-                                [ 'call_regexp_common'  , 'C'       ],
-                            ],
-    'PL/I'               => [
-                                [ 'call_regexp_common'  , 'C'      ],
-                            ],
-    'Perl'               => [   [ 'remove_below'        , '^__(END|DATA)__'],
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_below_above'  , '^=head1', '^=cut'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Perl/Prolog'        => [ [ 'die' ,          ], ], # never called
-    'Pig Latin'          => [
-                                [ 'remove_matches'      , '^\s*--' ],
-                                [ 'remove_inline'       , '--.*$'  ],
-                                [ 'call_regexp_common'  , 'C'       ],
-                            ],
-    'PO File'            => [
-                                [ 'remove_matches'      , '^\s*#[^,]' ],  # '#,' is not a comment
-                            ],
-    'PowerBuilder'       => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'PowerShell'         => [
-                                [ 'powershell_to_C'                ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Prolog'             => [
-                                [ 'remove_matches'      , '^\s*\%' ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_inline'       , '(//|\%).*$' ],
-                            ],
-    'Protocol Buffers'   => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Pug'                => [
-                                [ 'remove_pug_block'    ,          ],
-                                [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Python'             => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'docstring_to_C'                 ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'PHP'                => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '#.*$'   ],
-#                               [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'QML'                => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Qt'                 => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'Qt Linguist'        => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'Qt Project'         => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'R'                  => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Racket'             => [
-                                [ 'remove_matches'      , '^\s*;'  ],
-                                [ 'remove_inline'       , ';.*$'   ],
-                            ],
-    'RapydScript'        => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'docstring_to_C'                 ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Razor'              => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_between_general', '@*', '*@' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'RobotFramework'     => [
-                                [ 'remove_matches'      , '^\s*#'   ],
-                                [ 'remove_matches'      , '^\s*Comment' ],
-                                [ 'remove_matches'      , '^\s*\*{3}\s+(Variables|Test\s+Cases|Settings|Keywords)\s+\*{3}' ] ,
-                                [ 'remove_matches'      , '^\s*\[(Documentation|Tags)\]' ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Rexx'               => [   [ 'call_regexp_common'  , 'C'      ], ],
-    'Ruby'               => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_below_above'  , '^=begin', '^=end' ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Ruby HTML'          => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ], ],
-    'Rust'               => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'SAS'                => [
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_between_general', '*', ';' ],
-                            ],
-    'Sass'               => [
-                                [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Scala'              => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Slice'             => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-#                               [ 'remove_between_general', '/*', '*/' ],
-                            ],
-    'Slim'               => [
-                                [ 'remove_slim_block'   ,          ],
-                            ],
-    'SKILL'              => [
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_matches'      , '^\s*;'  ],
-                            ],
-    'SKILL++'            => [
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_matches'      , '^\s*;'  ],
-                            ],
-    'Specman e'          => [
-                                [ 'pre_post_fix'        , "'>", "<'"],
-                                [ 'remove_between_general', "'>", "<'" ],
-                                [ 'call_regexp_common'  , 'C++',   ],
-                                [ 'remove_matches'      , '^\s*--' ],
-                            ],
-    'SQL'                => [
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_matches'      , '^\s*--' ],
-                                [ 'remove_inline'       , '--.*$'  ],
-                            ],
-    'SQL Stored Procedure'=> [
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_matches'      , '^\s*--' ],
-                                [ 'remove_inline'       , '--.*$'  ],
-                            ],
-    'SQL Data'           => [
-                                [ 'call_regexp_common'  , 'C'      ],
-                                [ 'remove_matches'      , '^\s*--' ],
-                                [ 'remove_inline'       , '--.*$'  ],
-                            ],
-    'sed'                => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Smarty'             => [
-                                [ 'smarty_to_C'                    ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                            ],
-    'Standard ML'        => [
-                                [ 'remove_between_general', '(*', '*)' ],
-                            ],
-    'Stylus'             => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Swift'              => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-
-    'm4'                 => [   [ 'remove_matches'      , '^dnl '  ], ],
-    'C Shell'            => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Kermit'             => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_matches'      , '^\s*;'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Korn Shell'         => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Tcl/Tk'             => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Teamcenter met'     => [   [ 'call_regexp_common'  , 'C'      ], ],
-    'Teamcenter mth'     => [   [ 'remove_matches'      , '^\s*#'  ], ],
-    'TeX'                => [
-                                [ 'remove_matches'      , '^\s*%'  ],
-                                [ 'remove_inline'       , '%.*$'   ],
-                            ],
-    'Titanium Style Sheet'  => [
-                                [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'remove_between_regex', '/[^/]', '[^/]/' ],
-                            ],
-    'Twig'               => [
-                                [ 'remove_between_general', '{#', '#}' ],
-                            ],
-    'TTCN'               => [
-                                [ 'call_regexp_common'  , 'C++'      ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'TITAN Project File Information'               => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'TypeScript'         => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Unity-Prefab'       => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'Visual Fox Pro'     =>  [
-                                [ 'remove_matches'      , '^\s*\*' ],
-                                [ 'remove_inline'       , '\*.*$'  ],
-                                [ 'remove_matches'      , '^\s*&&' ],
-                                [ 'remove_inline'       , '&&.*$'  ],
-                            ],
-    'Softbridge Basic'   => [   [ 'remove_above'        , '^\s*Attribute\s+VB_Name\s+=' ],
-                                [ 'remove_matches'      , '^\s*Attribute\s+'],
-                                [ 'remove_matches'      , '^\s*\47'], ],  # \47 = '
-    # http://www.altium.com/files/learningguides/TR0114%20VHDL%20Language%20Reference.pdf
-    'Vala'               => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Vala Header'        => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'Verilog-SystemVerilog/Coq' => [ ['die'] ], # never called
-    'Verilog-SystemVerilog' => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'VHDL'               => [
-                                [ 'remove_matches'      , '^\s*--' ],
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                                [ 'remove_inline'       , '--.*$'  ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'vim script'         => [
-                                [ 'remove_matches'      , '^\s*"'  ],
-                                [ 'remove_inline'       , '".*$'   ],
-                            ],
-    'Visual Basic'       => [   [ 'remove_above'        , '^\s*Attribute\s+VB_Name\s+=' ],
-                                [ 'remove_matches'      , '^\s*Attribute\s+'],
-                                [ 'remove_matches'      , '^\s*\47'], ],  # \47 = '
-    'Visualforce Component' => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'Visualforce Page'   => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'Velocity Template Language' => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                                [ 'remove_jsp_comments' ,          ],
-                                [ 'remove_matches'      , '^\s*//' ],
-                                [ 'add_newlines'        ,          ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                            ],
-    'Vuejs Component'     => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'Teamcenter def'     => [   [ 'remove_matches'      , '^\s*#'  ], ],
-    'Windows Module Definition' => [
-                                [ 'remove_matches'      , '^\s*;' ],
-                                [ 'remove_inline'       , ';.*$'  ],
-                            ],
-    'yacc'               => [
-                                [ 'call_regexp_common'  , 'C++'    ],
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                            ],
-    'YAML'               => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    'lex'                => [   [ 'call_regexp_common'  , 'C'      ], ],
-    'XAML'               => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ], ],
-    'xBase Header'       => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_matches'      , '^\s*\&\&' ],
-                                [ 'remove_matches'      , '^\s*\*' ],
-                                [ 'remove_matches'      , '^\s*NOTE' ],
-                                [ 'remove_matches'      , '^\s*note' ],
-                                [ 'remove_matches'      , '^\s*Note' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'remove_inline'       , '\&\&.*$' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'xBase'              => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_matches'      , '^\s*\&\&' ],
-                                [ 'remove_matches'      , '^\s*\*' ],
-                                [ 'remove_matches'      , '^\s*NOTE' ],
-                                [ 'remove_matches'      , '^\s*note' ],
-                                [ 'remove_matches'      , '^\s*Note' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'remove_inline'       , '\&\&.*$' ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'MXML'               => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                                [ 'remove_matches'      , '^\s*//' ],
-                                [ 'add_newlines'        ,          ],
-                                [ 'call_regexp_common'  , 'C'      ],
-                            ],
-    'Windows Message File'  => [
-                                [ 'remove_matches'      , '^\s*;\s*//' ],
-                                [ 'call_regexp_common'  , 'C'          ],
-                                [ 'remove_matches'      , '^\s*;\s*$'  ],
-#                               next line only hypothetical
-#                               [ 'remove_matches_2re'  , '^\s*;\s*/\*',
-#                                                         '^\s*;\s*\*/', ],
-                            ],
-    'Windows Resource File' => [
-#                               [ 'remove_matches'      , '^\s*//' ],
-                                [ 'remove_inline'       , '//.*$'  ],
-                                [ 'call_regexp_common'  , 'C++'    ],
-                            ],
-    'WiX source'         => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'WiX include'        => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'WiX string localization' => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'XMI'                => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'XML'                => [
-                                [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ],
-                            ],
-    'XQuery'             => [
-                                [ 'remove_between_general', '(:', ':)' ],
-                            ],
-    'XSD'                => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ], ],
-    'XSLT'               => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ], ],
-    'NAnt script'       => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ], ],
-    'MSBuild script'    => [   [ 'remove_html_comments',          ],
-                                [ 'call_regexp_common'  , 'HTML'   ], ],
-    'zsh'                => [
-                                [ 'remove_matches'      , '^\s*#'  ],
-                                [ 'remove_inline'       , '#.*$'   ],
-                            ],
-    );
-# 1}}}
-%{$rh_EOL_continuation_re} = (               # {{{1
-    'ActionScript'       =>     '\\\\$'         ,
-    'AspectJ'            =>     '\\\\$'         ,
-    'Assembly'           =>     '\\\\$'         ,
-    'ASP'                =>     '\\\\$'         ,
-    'ASP.Net'            =>     '\\\\$'         ,
-    'Ada'                =>     '\\\\$'         ,
-    'awk'                =>     '\\\\$'         ,
-    'bc'                 =>     '\\\\$'         ,
-    'C'                  =>     '\\\\$'         ,
-    'C++'                =>     '\\\\$'         ,
-    'C/C++ Header'       =>     '\\\\$'         ,
-    'CMake'              =>     '\\\\$'         ,
-    'Cython'             =>     '\\\\$'         ,
-    'C#'                 =>     '\\\\$'         ,
-    'D'                  =>     '\\\\$'         ,
-    'Dart'               =>     '\\\\$'         ,
-    'Expect'             =>     '\\\\$'         ,
-    'Go'                 =>     '\\\\$'         ,
-    'IDL'                =>     '\$\\$'         ,
-    'Java'               =>     '\\\\$'         ,
-    'JavaScript'         =>     '\\\\$'         ,
-    'JSX'                =>     '\\\\$'         ,
-    'LESS'               =>     '\\\\$'         ,
-    'Lua'                =>     '\\\\$'         ,
-    'make'               =>     '\\\\$'         ,
-    'MATLAB'             =>     '\.\.\.\s*$'    ,
-    'MXML'               =>     '\\\\$'         ,
-    'Objective C'        =>     '\\\\$'         ,
-    'Objective C++'      =>     '\\\\$'         ,
-    'OCaml'              =>     '\\\\$'         ,
-    'Octave'             =>     '\.\.\.\s*$'    ,
-    'Qt Project'         =>     '\\\\$'         ,
-    'Patran Command Language'=> '\\\\$'         ,
-    'PowerBuilder'       =>     '\\\\$'         ,
-    'PowerShell'         =>     '\\\\$'         ,
-    'Python'             =>     '\\\\$'         ,
-    'R'                  =>     '\\\\$'         ,
-    'Ruby'               =>     '\\\\$'         ,
-    'sed'                =>     '\\\\$'         ,
-    'Swift'              =>     '\\\\$'         ,
-    'Bourne Again Shell' =>     '\\\\$'         ,
-    'Bourne Shell'       =>     '\\\\$'         ,
-    'C Shell'            =>     '\\\\$'         ,
-    'Kermit'             =>     '\\\\$'         ,
-    'Korn Shell'         =>     '\\\\$'         ,
-    'Stylus'             =>     '\\\\$'         ,
-    'Tcl/Tk'             =>     '\\\\$'         ,
-    'TTCN'               =>     '\\\\$'         ,
-    'TypeScript'         =>     '\\\\$'         ,
-    'lex'                =>     '\\\\$'         ,
-    'Vala'               =>     '\\\\$'         ,
-    'Vala Header'        =>     '\\\\$'         ,
-    'zsh'                =>     '\\\\$'         ,
-    );
-# 1}}}
-%{$rh_Not_Code_Extension}    = (             # {{{1
-   '1'         => 1,  # Man pages (documentation):
-   '2'         => 1,
-   '3'         => 1,
-   '4'         => 1,
-   '5'         => 1,
-   '6'         => 1,
-   '7'         => 1,
-   '8'         => 1,
-   '9'         => 1,
-   'a'         => 1,  # Static object code.
-   'ad'        => 1,  # X application default resource file.
-   'afm'       => 1,  # font metrics
-   'arc'       => 1,  # arc(1) archive
-   'arj'       => 1,  # arj(1) archive
-   'au'        => 1,  # Audio sound filearj(1) archive
-   'bak'       => 1,  # Backup files - we only want to count the "real" files.
-   'bdf'       => 1,
-   'bmp'       => 1,
-   'bz2'       => 1,  # bzip2(1) compressed file
-   'csv'       => 1,  # comma separated values
-   'desktop'   => 1,
-   'dic'       => 1,
-   'doc'       => 1,
-   'elc'       => 1,
-   'eps'       => 1,
-   'fig'       => 1,
-   'gif'       => 1,
-   'gz'        => 1,
-   'hdf'       => 1,  # hierarchical data format
-   'in'        => 1,  # Debatable.
-   'jpg'       => 1,
-   'kdelnk'    => 1,
-   'man'       => 1,
-   'mf'        => 1,
-   'mp3'       => 1,
-   'n'         => 1,
-   'o'         => 1,  # Object code is generated from source code.
-   'o.cmd'     => 1,  # not DOS Batch; Linux kernel compilation optimization file
-   'pbm'       => 1,
-   'pdf'       => 1,
-   'pfb'       => 1,
-   'png'       => 1,
-   'ps'        => 1,  # Postscript is _USUALLY_ generated automatically.
-   'sgm'       => 1,
-   'sgml'      => 1,
-   'so'        => 1,  # Dynamically-loaded object code.
-   'Tag'       => 1,
-   'text'      => 1,
-   'tfm'       => 1,
-   'tgz'       => 1,  # gzipped tarball
-   'tiff'      => 1,
-   'txt'       => 1,
-   'vf'        => 1,
-   'wav'       => 1,
-   'xbm'       => 1,
-   'xpm'       => 1,
-   'Y'         => 1,  # file compressed with "Yabba"
-   'Z'         => 1,  # file compressed with "compress"
-   'zip'       => 1,  # zip archive
-   'gitignore' => 1,
-); # 1}}}
-%{$rh_Not_Code_Filename}     = (             # {{{1
-   'AUTHORS'     => 1,
-   'BUGS'        => 1,
-   'BUGS'        => 1,
-   'Changelog'   => 1,
-   'ChangeLog'   => 1,
-   'ChangeLog'   => 1,
-   'Changes'     => 1,
-   'CHANGES'     => 1,
-   'COPYING'     => 1,
-   'COPYING'     => 1,
-   '.cvsignore'  => 1,
-   'Entries'     => 1,
-   'FAQ'         => 1,
-   'iconfig.h'   => 1, # Skip "iconfig.h" files; they're used in Imakefiles.
-   'INSTALL'     => 1,
-   'MAINTAINERS' => 1,
-   'MD5SUMS'     => 1,
-   'NEWS'        => 1,
-   'readme'      => 1,
-   'Readme'      => 1,
-   'README'      => 1,
-   'README.tk'   => 1, # used in kdemultimedia, it's confusing.
-   'Repository'  => 1,
-   'Root'        => 1, # CVS
-   'TODO'        => 1,
-);
-# 1}}}
-%{$rh_Scale_Factor}          = (             # {{{1
-    '(unknown)'                    =>   0.00,
-    '1032/af'                      =>   5.00,
-    '1st generation default'       =>   0.25,
-    '2nd generation default'       =>   0.75,
-    '3rd generation default'       =>   1.00,
-    '4th generation default'       =>   4.00,
-    '5th generation default'       =>  16.00,
-    'aas macro'                    =>   0.88,
-    'abap/4'                       =>   5.00,
-    'ABAP'                         =>   5.00,
-    'accel'                        =>   4.21,
-    'access'                       =>   2.11,
-    'ActionScript'                 =>   1.36,
-    'actor'                        =>   3.81,
-    'acumen'                       =>   2.86,
-    'Ada'                          =>   0.52,
-    'Ada 83'                       =>   1.13,
-    'Ada 95'                       =>   1.63,
-    'adr/dl'                       =>   2.00,
-    'adr/ideal/pdl'                =>   4.00,
-    'ads/batch'                    =>   4.00,
-    'ads/online'                   =>   4.00,
-    'ADSO/IDSM'                    =>   3.00,
-    'advantage'                    =>   2.11,
-    'ai shell default'             =>   1.63,
-    'ai shells'                    =>   1.63,
-    'algol 68'                     =>   0.75,
-    'algol w'                      =>   0.75,
-    'ambush'                       =>   2.50,
-    'aml'                          =>   1.63,
-    'AMPLE'                        =>   2.00,
-    'Ant/XML'                      =>   1.90,
-    'Ant'                          =>   1.90,
-    'Antlr'                        =>   2.00,
-    'amppl ii'                     =>   1.25,
-    'ansi basic'                   =>   1.25,
-    'ansi cobol 74'                =>   0.75,
-    'ansi cobol 85'                =>   0.88,
-    'SQL'                          =>   6.15,
-    'SQL Stored Procedure'         =>   6.15,
-    'SQL Data'                     =>   1.00,
-    'answer/db'                    =>   6.15,
-    'apl 360/370'                  =>   2.50,
-    'apl default'                  =>   2.50,
-    'apl*plus'                     =>   2.50,
-    'applesoft basic'              =>   0.63,
-    'application builder'          =>   4.00,
-    'application manager'          =>   2.22,
-    'aps'                          =>   0.96,
-    'aps'                          =>   4.71,
-    'apt'                          =>   1.13,
-    'aptools'                      =>   4.00,
-    'arc'                          =>   1.63,
-    'ariel'                        =>   0.75,
-    'arity'                        =>   1.63,
-    'art'                          =>   1.63,
-    'art enterprise'               =>   1.74,
-    'artemis'                      =>   2.00,
-    'artim'                        =>   1.74,
-    'AspectJ'                      =>   1.36,
-    'as/set'                       =>   4.21,
-    'asi/inquiry'                  =>   6.15,
-    'ask windows'                  =>   1.74,
-    'asa'                          =>   1.29,
-    'ASP'                          =>   1.29,
-    'ASP.Net'                      =>   1.29,
-    'aspx'                         =>   1.29,
-    'asax'                         =>   1.29,
-    'ascx'                         =>   1.29,
-    'asmx'                         =>   1.29,
-    'config'                       =>   1.29,
-    'webinfo'                      =>   1.29,
-    'CCS'                          =>   5.33,
-    'Apex Trigger'                 =>   1.4 ,
-    'Arduino Sketch'               =>   1.00,
-    'Assembly'                     =>   0.25,
-    'Assembly (macro)'             =>   0.51,
-    'associative default'          =>   1.25,
-    'autocoder'                    =>   0.25,
-    'AutoHotkey'                   =>   1.29,
-    'awk'                          =>   3.81,
-    'aztec c'                      =>   0.63,
-    'balm'                         =>   0.75,
-    'base sas'                     =>   1.51,
-    'basic'                        =>   0.75,
-    'basic a'                      =>   0.63,
-    'bc'                           =>   1.50,
-    'berkeley pascal'              =>   0.88,
-    'better basic'                 =>   0.88,
-    'Blade'                        =>   2.00,
-    'bliss'                        =>   0.75,
-    'bmsgen'                       =>   2.22,
-    'boeingcalc'                   =>  13.33,
-    'bteq'                         =>   6.15,
-    'Brainfuck'                    =>   0.10,
-    'builder'                      =>   2.00,
-    'C'                            =>   0.77,
-    'c set 2'                      =>   0.88,
-    'C#'                           =>   1.36,
-    'C++'                          =>   1.51,
-    'c86plus'                      =>   0.63,
-    'cadbfast'                     =>   2.00,
-    'caearl'                       =>   2.86,
-    'cast'                         =>   1.63,
-    'cbasic'                       =>   0.88,
-    'cdadl'                        =>   4.00,
-    'cellsim'                      =>   1.74,
-    'ColdFusion'                   =>   4.00,
-    'ColdFusion CFScript'          =>   4.00,
-    'chili'                        =>   0.75,
-    'chill'                        =>   0.75,
-    'cics'                         =>   1.74,
-    'clarion'                      =>   1.38,
-    'clascal'                      =>   1.00,
-    'Clean'                        =>   2.50,
-    'cli'                          =>   2.50,
-    'clipper'                      =>   2.05,
-    'clipper db'                   =>   2.00,
-    'clos'                         =>   3.81,
-    'Clojure'                      =>   1.25,
-    'ClojureScript'                =>   1.25,
-    'ClojureC'                     =>   1.25,
-    'clout'                        =>   2.00,
-    'CMake'                        =>   1.00,
-    'cms2'                         =>   0.75,
-    'cmsgen'                       =>   4.21,
-    'COBOL'                        =>   1.04,
-    'COBOL ii'                     =>   0.75,
-    'COBOL/400'                    =>   0.88,
-    'cobra'                        =>   4.00,
-    'codecenter'                   =>   2.22,
-    'cofac'                        =>   2.22,
-    'CoffeeScript'                 =>   2.00,
-    'cogen'                        =>   2.22,
-    'cognos'                       =>   2.22,
-    'cogo'                         =>   1.13,
-    'comal'                        =>   1.00,
-    'comit ii'                     =>   1.25,
-    'common lisp'                  =>   1.25,
-    'concurrent pascal'            =>   1.00,
-    'conniver'                     =>   1.25,
-    'cool:gen/ief'                 =>   2.58,
-    'Coq'                          =>   5.00,
-    'coral 66'                     =>   0.75,
-    'corvet'                       =>   4.21,
-    'corvision'                    =>   5.33,
-    'cpl'                          =>   0.50,
-    'Crystal'                      =>   2.50,
-    'Crystal Reports'              =>   4.00,
-    'csl'                          =>   1.63,
-    'CSON'                         =>   2.50,
-    'csp'                          =>   1.51,
-    'cssl'                         =>   1.74,
-    'CSS'                          =>   1.0,
-    'culprit'                      =>   1.57,
-    'CUDA'                         =>   1.00,
-    'cxpert'                       =>   1.63,
-    'cygnet'                       =>   4.21,
-    'D'                            =>   1.70,
-    'DAL'                          =>   1.50,
-    'Dart'                         =>   2.00,
-    'data base default'            =>   2.00,
-    'dataflex'                     =>   2.00,
-    'datatrieve'                   =>   4.00,
-    'dbase iii'                    =>   2.00,
-    'dbase iv'                     =>   1.54,
-    'diff'                         =>   1.00,
-    'decision support default'     =>   2.22,
-    'decrally'                     =>   2.00,
-    'delphi'                       =>   2.76,
-    'DITA'                         =>   1.90,
-    'dl/1'                         =>   2.00,
-    'dtrace'                       =>   2.00,
-    'NASTRAN DMAP'                 =>   2.35,
-    'dna4'                         =>   4.21,
-    'DOORS Extension Language'     =>   1.50,
-    'Dockerfile'                   =>   2.00,
-    'DOS Batch'                    =>   0.63,
-    'dsp assembly'                 =>   0.50,
-    'dtabl'                        =>   1.74,
-    'dtipt'                        =>   1.74,
-    'dyana'                        =>   1.13,
-    'dynamoiii'                    =>   1.74,
-    'easel'                        =>   2.76,
-    'easy'                         =>   1.63,
-    'easytrieve+'                  =>   2.35,
-    'eclipse'                      =>   1.63,
-    'ECPP'                         =>   1.90,
-    'eda/sql'                      =>   6.67,
-    'edscheme 3.4'                 =>   1.51,
-    'EEx'                          =>   2.00,
-    'eiffel'                       =>   3.81,
-    'Elixir'                       =>   2.11,
-    'Elm'                          =>   2.50,
-    'enform'                       =>   1.74,
-    'englishbased default'         =>   1.51,
-    'ensemble'                     =>   2.76,
-    'epos'                         =>   4.00,
-    'ERB'                          =>   2.00,
-    'Erlang'                       =>   2.11,
-    'esf'                          =>   2.00,
-    'espadvisor'                   =>   1.63,
-    'espl/i'                       =>   1.13,
-    'euclid'                       =>   0.75,
-    'excel'                        =>   1.74,
-    'excel 12'                     =>  13.33,
-    'excel 34'                     =>  13.33,
-    'excel 5'                      =>  13.33,
-    'express'                      =>   2.22,
-    'exsys'                        =>   1.63,
-    'extended common lisp'         =>   1.43,
-    'eznomad'                      =>   2.22,
-    'facets'                       =>   4.00,
-    'factorylink iv'               =>   2.76,
-    'fame'                         =>   2.22,
-    'filemaker pro'                =>   2.22,
-    'flavors'                      =>   2.76,
-    'flex'                         =>   1.74,
-    'flexgen'                      =>   2.76,
-    'Focus'                        =>   1.90,
-    'foil'                         =>   1.51,
-    'forte'                        =>   4.44,
-    'Forth'                        =>   1.25,
-    'Fortran 66'                   =>   0.63,
-    'Fortran 77'                   =>   0.75,
-    'Fortran 90'                   =>   1.00,
-    'Fortran 95'                   =>   1.13,
-    'Fortran II'                   =>   0.63,
-    'foundation'                   =>   2.76,
-    'foxpro'                       =>   2.29,
-    'foxpro 1'                     =>   2.00,
-    'foxpro 2.5'                   =>   2.35,
-    'framework'                    =>  13.33,
-    'Freemarker Template'          =>   1.48,
-    'F#'                           =>   2.50,
-    'g2'                           =>   1.63,
-    'gamma'                        =>   5.00,
-    'genascript'                   =>   2.96,
-    'gener/ol'                     =>   6.15,
-    'genexus'                      =>   5.33,
-    'genifer'                      =>   4.21,
-    'geode 2.0'                    =>   5.00,
-    'gfa basic'                    =>   2.35,
-    'Glade'                        =>   2.00,
-    'GLSL'                         =>   2.00,
-    'gml'                          =>   1.74,
-    'golden common lisp'           =>   1.25,
-    'gpss'                         =>   1.74,
-    'guest'                        =>   2.86,
-    'guru'                         =>   1.63,
-    'GDScript'                     =>   2.50,
-    'Go'                           =>   2.50,
-    'Grails'                       =>   1.48,
-    'Groovy'                       =>   4.10,
-    'gw basic'                     =>   0.82,
-    'Harbour'                      =>   2.00,
-    'Haskell'                      =>   2.11,
-    'high c'                       =>   0.63,
-    'hlevel'                       =>   1.38,
-    'hp basic'                     =>   0.63,
-    'Haml'                         =>   2.50,
-    'Handlebars'                   =>   2.50,
-    'Haxe'                         =>   2.00,
-    'HTML'                         =>   1.90,
-    'XHTML'                        =>   1.90,
-    'XMI'                          =>   1.90,
-    'XML'                          =>   1.90,
-    'MXML'                         =>   1.90,
-    'XSLT'                         =>   1.90,
-    'DTD'                          =>   1.90,
-    'XSD'                          =>   1.90,
-    'NAnt script'                  =>   1.90,
-    'MSBuild script'               =>   1.90,
-    'HLSL'                         =>   2.00,
-    'HTML 2'                       =>   5.00,
-    'HTML 3'                       =>   5.33,
-    'huron'                        =>   5.00,
-    'ibm adf i'                    =>   4.00,
-    'ibm adf ii'                   =>   4.44,
-    'ibm advanced basic'           =>   0.82,
-    'ibm cics/vs'                  =>   2.00,
-    'ibm compiled basic'           =>   0.88,
-    'ibm vs cobol'                 =>   0.75,
-    'ibm vs cobol ii'              =>   0.88,
-    'ices'                         =>   1.13,
-    'icon'                         =>   1.00,
-    'ideal'                        =>   1.54,
-    'idms'                         =>   2.00,
-    'ief'                          =>   5.71,
-    'ief/cool:gen'                 =>   2.58,
-    'iew'                          =>   5.71,
-    'ifps/plus'                    =>   2.50,
-    'imprs'                        =>   2.00,
-    'informix'                     =>   2.58,
-    'ingres'                       =>   2.00,
-    'INI'                          =>   1.00,
-    'inquire'                      =>   6.15,
-    'insight2'                     =>   1.63,
-    'install/1'                    =>   5.00,
-    'InstallShield'                =>   1.90,
-    'intellect'                    =>   1.51,
-    'interlisp'                    =>   1.38,
-    'interpreted basic'            =>   0.75,
-    'interpreted c'                =>   0.63,
-    'iqlisp'                       =>   1.38,
-    'iqrp'                         =>   6.15,
-    'j2ee'                         =>   1.60,
-    'Jam'                          =>   2.00,
-    'janus'                        =>   1.13,
-    'Java'                         =>   1.36,
-    'JavaScript'                   =>   1.48,
-    'JavaServer Faces'             =>   1.5 ,
-    'JSON'                         =>   2.50,
-    'JSP'                          =>   1.48,
-    'JSX'                          =>   1.48,
-    'Velocity Template Language'   =>   1.00,
-    'JCL'                          =>   1.67,
-    'joss'                         =>   0.75,
-    'jovial'                       =>   0.75,
-    'jsp'                          =>   1.36,
-    'kappa'                        =>   2.00,
-    'kbms'                         =>   1.63,
-    'kcl'                          =>   1.25,
-    'kee'                          =>   1.63,
-    'keyplus'                      =>   2.00,
-    'kl'                           =>   1.25,
-    'klo'                          =>   1.25,
-    'knowol'                       =>   1.63,
-    'krl'                          =>   1.38,
-    'Kermit'                       =>   2.00,
-    'Korn Shell'                   =>   3.81,
-    'Kotlin'                       =>   2.00,
-    'ladder logic'                 =>   2.22,
-    'lambit/l'                     =>   1.25,
-    'lattice c'                    =>   0.63,
-    'LESS'                         =>   1.50,
-    'LFE'                          =>   1.25,
-    'liana'                        =>   0.63,
-    'lilith'                       =>   1.13,
-    'linc ii'                      =>   5.71,
-    'liquid'                       =>   3.00,
-    'Lisp'                         =>   1.25,
-    'LiveLink OScript'             =>   3.5 ,
-    'loglisp'                      =>   1.38,
-    'Logtalk'                      =>   2.00,
-    'loops'                        =>   3.81,
-    'lotus 123 dos'                =>  13.33,
-    'lotus macros'                 =>   0.75,
-    'lotus notes'                  =>   3.64,
-    'lucid 3d'                     =>  13.33,
-    'lyric'                        =>   1.51,
-    'm4'                           =>   1.00,
-    'm'                            =>   5.00,
-    'macforth'                     =>   1.25,
-    'mach1'                        =>   2.00,
-    'machine language'             =>   0.13,
-    'maestro'                      =>   5.00,
-    'magec'                        =>   5.00,
-    'magik'                        =>   3.81,
-    'Lake'                         =>   3.81,
-    'make'                         =>   2.50,
-    'Mako'                         =>   1.50, # Not sure about the scaling.
-    'mantis'                       =>   2.96,
-    'mapper'                       =>   0.99,
-    'mark iv'                      =>   2.00,
-    'mark v'                       =>   2.22,
-    'Markdown'                     =>   1.00,
-    'mathcad'                      =>  16.00,
-    'Maven'                        =>   1.90,
-    'mdl'                          =>   2.22,
-    'mentor'                       =>   1.51,
-    'mesa'                         =>   0.75,
-    'microfocus cobol'             =>   1.00,
-    'microforth'                   =>   1.25,
-    'microsoft c'                  =>   0.63,
-    'microstep'                    =>   4.00,
-    'miranda'                      =>   2.00,
-    'model 204'                    =>   2.11,
-    'modula 2'                     =>   1.00,
-    'mosaic'                       =>  13.33,
-    # 'ms c ++ v. 7'                 =>   1.51,
-    'ms compiled basic'            =>   0.88,
-    'msl'                          =>   1.25,
-    'mulisp'                       =>   1.25,
-    'MUMPS'                        =>   4.21,
-    'Mustache'                     =>   1.75,
-    'Nastran'                      =>   1.13,
-    'natural'                      =>   1.54,
-    'natural 1'                    =>   1.51,
-    'natural 2'                    =>   1.74,
-    'natural construct'            =>   3.20,
-    'natural language'             =>   0.03,
-    'Nemerle'                      =>   2.50,
-    'netron/cap'                   =>   4.21,
-    'nexpert'                      =>   1.63,
-    'nial'                         =>   1.63,
-    'Nim'                          =>   2.00,
-    'nomad2'                       =>   2.00,
-    'nonprocedural default'        =>   2.22,
-    'notes vip'                    =>   2.22,
-    'nroff'                        =>   1.51,
-    'object assembler'             =>   1.25,
-    'object lisp'                  =>   2.76,
-    'object logo'                  =>   2.76,
-    'object pascal'                =>   2.76,
-    'object star'                  =>   5.00,
-    'Objective C'                  =>   2.96,
-    'Objective C++'                =>   2.96,
-    'objectoriented default'       =>   2.76,
-    'objectview'                   =>   3.20,
-    'OCaml'                        =>   3.00,
-    'ogl'                          =>   1.00,
-    'omnis 7'                      =>   2.00,
-    'oodl'                         =>   2.76,
-    'ops'                          =>   1.74,
-    'ops5'                         =>   1.38,
-    'oracle'                       =>   2.76,
-    'Oracle Reports'               =>   2.76,
-    'Oracle Forms'                 =>   2.67,
-    'Oracle Developer/2000'        =>   3.48,
-    'oscar'                        =>   0.75,
-    'pacbase'                      =>   1.67,
-    'pace'                         =>   2.00,
-    'paradox/pal'                  =>   2.22,
-    'Pascal'                       =>   0.88,
-    'Patran Command Language'      =>   2.50,
-    'pc focus'                     =>   2.22,
-    'pdl millenium'                =>   3.81,
-    'pdp11 ade'                    =>   1.51,
-    'peoplesoft'                   =>   2.50,
-    'Perl'                         =>   4.00,
-    'persistance object builder'   =>   3.81,
-    'Pig Latin'                    =>   1.00,
-    'pilot'                        =>   1.51,
-    'PL/I'                         =>   1.38,
-    'pl/1'                         =>   1.38,
-    'pl/m'                         =>   1.13,
-    'pl/s'                         =>   0.88,
-    'pl/sql'                       =>   2.58,
-    'planit'                       =>   1.51,
-    'planner'                      =>   1.25,
-    'planperfect 1'                =>  11.43,
-    'plato'                        =>   1.51,
-    'PO File'                      =>   1.50,
-    'polyforth'                    =>   1.25,
-    'pop'                          =>   1.38,
-    'poplog'                       =>   1.38,
-    'power basic'                  =>   1.63,
-    'PowerBuilder'                 =>   3.33,
-    'powerhouse'                   =>   5.71,
-    'PowerShell'                   =>   3.00,
-    'ppl (plus)'                   =>   2.00,
-    'problemoriented default'      =>   1.13,
-    'proc'                         =>   2.96,
-    'procedural default'           =>   0.75,
-    'professional pascal'          =>   0.88,
-    'program generator default'    =>   5.00,
-    'progress v4'                  =>   2.22,
-    'proiv'                        =>   1.38,
-    'Prolog'                       =>   1.25,
-    'prose'                        =>   0.75,
-    'proteus'                      =>   0.75,
-    'Protocol Buffers'             =>   2.00,
-    'Pug'                          =>   2.00,
-    'Puppet'                       =>   2.00,
-    'PureScript'                   =>   2.00,
-    'qbasic'                       =>   1.38,
-    'qbe'                          =>   6.15,
-    'qmf'                          =>   5.33,
-    'QML'                          =>   1.25,
-    'Qt'                           =>   2.00,
-    'Qt Linguist'                  =>   1.00,
-    'Qt Project'                   =>   1.00,
-    'qnial'                        =>   1.63,
-    'quattro'                      =>  13.33,
-    'quattro pro'                  =>  13.33,
-    'query default'                =>   6.15,
-    'quick basic 1'                =>   1.25,
-    'quick basic 2'                =>   1.31,
-    'quick basic 3'                =>   1.38,
-    'quick c'                      =>   0.63,
-    'quickbuild'                   =>   2.86,
-    'quiz'                         =>   5.33,
-    'R'                            =>   3.00,
-    'Racket'                       =>   1.50,
-    'rally'                        =>   2.00,
-    'ramis ii'                     =>   2.00,
-    'rapidgen'                     =>   2.86,
-    'ratfor'                       =>   0.88,
-    'rdb'                          =>   2.00,
-    'realia'                       =>   1.74,
-    'realizer 1.0'                 =>   2.00,
-    'realizer 2.0'                 =>   2.22,
-    'relate/3000'                  =>   2.00,
-    'reuse default'                =>  16.00,
-    'Razor'                        =>   2.00,
-    'Rexx'                         =>   1.19,
-    'rm basic'                     =>   0.88,
-    'rm cobol'                     =>   0.75,
-    'rm fortran'                   =>   0.75,
-    'RobotFramework'               =>   2.50,
-    'rpg i'                        =>   1.00,
-    'rpg ii'                       =>   1.63,
-    'rpg iii'                      =>   1.63,
-    'rtexpert 1.4'                 =>   1.38,
-    'Rust'                         =>   1.00,
-    'sabretalk'                    =>   0.90,
-    'sail'                         =>   0.75,
-    'sapiens'                      =>   5.00,
-    'sas'                          =>   1.95,
-    'savvy'                        =>   6.15,
-    'sbasic'                       =>   0.88,
-    'Scala'                        =>   4.10,
-    'sceptre'                      =>   1.13,
-    'scheme'                       =>   1.51,
-    'screen painter default'       =>  13.33,
-    'sequal'                       =>   6.67,
-    'Slim'                         =>   3.00,
-    'Bourne Shell'                 =>   3.81,
-    'Bourne Again Shell'           =>   3.81,
-    'ksh'                          =>   3.81,
-    'zsh'                          =>   3.81,
-    'C Shell'                      =>   3.81,
-    'siebel tools '                =>   6.15,
-    'SAS'                          =>   1.5 ,
-    'Sass'                         =>   1.5 ,
-    'simplan'                      =>   2.22,
-    'simscript'                    =>   1.74,
-    'simula'                       =>   1.74,
-    'simula 67'                    =>   1.74,
-    'simulation default'           =>   1.74,
-    'SKILL'                        =>   2.00,
-    'SKILL++'                      =>   2.00,
-    'slogan'                       =>   0.98,
-    'Slice'                        =>   1.50,
-    'smalltalk'                    =>   2.50,
-    'smalltalk 286'                =>   3.81,
-    'smalltalk 80'                 =>   3.81,
-    'smalltalk/v'                  =>   3.81,
-    'Smarty'                       =>   3.50,
-    'snap'                         =>   1.00,
-    'snobol24'                     =>   0.63,
-    'softscreen'                   =>   5.71,
-    'Softbridge Basic'             =>   2.76,
-    'solo'                         =>   1.38,
-    'speakeasy'                    =>   2.22,
-    'spinnaker ppl'                =>   2.22,
-    'splus'                        =>   2.50,
-    'spreadsheet default'          =>  13.33,
-    'sps'                          =>   0.25,
-    'spss'                         =>   2.50,
-    'Specman e'                    =>   2.00,
-    'SQL'                          =>   2.29,
-    'sqlwindows'                   =>   6.67,
-    'statistical default'          =>   2.50,
-    'Standard ML'                  =>   3.00,
-    'strategem'                    =>   2.22,
-    'stress'                       =>   1.13,
-    'strongly typed default'       =>   0.88,
-    'style'                        =>   1.74,
-    'Stylus'                       =>   1.48,
-    'superbase 1.3'                =>   2.22,
-    'surpass'                      =>  13.33,
-    'Swift'                        =>   2.50,
-    'sybase'                       =>   2.00,
-    'symantec c++'                 =>   2.76,
-    'symbolang'                    =>   1.25,
-    'synchroworks'                 =>   4.44,
-    'synon/2e'                     =>   4.21,
-    'systemw'                      =>   2.22,
-    'tandem access language'       =>   0.88,
-    'Tcl/Tk'                       =>   4.00,
-    'Teamcenter def'               =>   1.00,
-    'Teamcenter met'               =>   1.00,
-    'Teamcenter mth'               =>   1.00,
-    'TeX'                          =>   1.50,
-    'telon'                        =>   5.00,
-    'tessaract'                    =>   2.00,
-    'the twin'                     =>  13.33,
-    'themis'                       =>   6.15,
-    'tiief'                        =>   5.71,
-    'Titanium Style Sheet'         =>   2.00,
-    'topspeed c++'                 =>   2.76,
-    'transform'                    =>   5.33,
-    'translisp plus'               =>   1.43,
-    'treet'                        =>   1.25,
-    'treetran'                     =>   1.25,
-    'trs80 basic'                  =>   0.63,
-    'true basic'                   =>   1.25,
-    'turbo c'                      =>   0.63,
-    'turbo expert'                 =>   1.63,
-    'turbo pascal >5'              =>   1.63,
-    'turbo pascal 14'              =>   1.00,
-    'turbo pascal 45'              =>   1.13,
-    'turing'                       =>   1.00,
-    'tutor'                        =>   1.51,
-    'twaice'                       =>   1.63,
-    'Twig'                         =>   2.00,
-    'TTCN'                         =>   2.00,
-    'TITAN Project File Information' =>   1.90,
-    'TypeScript'                   =>   2.00,
-    'ucsd pascal'                  =>   0.88,
-    'ufo/ims'                      =>   2.22,
-    'uhelp'                        =>   2.50,
-    'uniface'                      =>   5.00,
-    'Unity-Prefab'                 =>   2.50,
-    'Vala'                         =>   1.50,
-    'Vala Header'                  =>   1.40,
-    'vax acms'                     =>   1.38,
-    'vax ade'                      =>   2.00,
-    'vbscript'                     =>   2.35,
-    'vectran'                      =>   0.75,
-    'Verilog-SystemVerilog'        =>   1.51,
-    'VHDL'                         =>   4.21,
-    'vim script'                   =>   3.00,
-    'visible c'                    =>   1.63,
-    'visible cobol'                =>   2.00,
-    'visicalc 1'                   =>   8.89,
-    'visual 4.0'                   =>   2.76,
-    'visual basic'                 =>   1.90,
-    'visual basic 1'               =>   1.74,
-    'visual basic 2'               =>   1.86,
-    'visual basic 3'               =>   2.00,
-    'visual basic 4'               =>   2.22,
-    'visual basic 5'               =>   2.76,
-    'Visual Basic'                 =>   2.76,
-    'visual basic dos'             =>   2.00,
-    'visual c++'                   =>   2.35,
-    'visual cobol'                 =>   4.00,
-    'Visual Fox Pro'               =>   4.00, # Visual Fox Pro is not available in the language gearing ratios listed at Mayes Consulting web site
-    'visual objects'               =>   5.00,
-    'visualage'                    =>   3.81,
-    'Visualforce Component'        =>   1.9 ,
-    'Visualforce Page'             =>   1.9 ,
-    'visualgen'                    =>   4.44,
-    'VM'                           =>   2.00,
-    'vpf'                          =>   0.84,
-    'Vuejs Component'              =>   2.00,
-    'vulcan'                       =>   1.25,
-    'vz programmer'                =>   2.22,
-    'warp x'                       =>   2.00,
-    'watcom c'                     =>   0.63,
-    'watcom c/386'                 =>   0.63,
-    'waterloo c'                   =>   0.63,
-    'waterloo pascal'              =>   0.88,
-    'watfiv'                       =>   0.94,
-    'watfor'                       =>   0.88,
-    'web scripts'                  =>   5.33,
-    'whip'                         =>   0.88,
-    'Windows Message File'         =>   1.00,
-    'Windows Resource File'        =>   1.00,
-    'Windows Module Definition'    =>   1.00,
-    'WiX source'                   =>   1.90,
-    'WiX include'                  =>   1.90,
-    'WiX string localization'      =>   1.90,
-    'wizard'                       =>   2.86,
-    'xBase'                        =>   2.00,
-    'xBase Header'                 =>   2.00,
-    'xlisp'                        =>   1.25,
-    'XAML'                         =>   1.90,
-    'XQuery'                       =>   2.50,
-    'yacc'                         =>   1.51,
-    'yacc++'                       =>   1.51,
-    'YAML'                         =>   0.90,
-    'zbasic'                       =>   0.88,
-    'zim'                          =>   4.21,
-    'zlisp'                        =>   1.25,
-    'Expect'                       => 2.00,
-    'C/C++ Header'                 => 1.00,
-    'inc'                          => 1.00,
-    'lex'                          => 1.00,
-    'Julia'                        => 4.00,
-    'MATLAB'                       => 4.00,
-    'Mathematica'                  => 5.00,
-    'Mercury'                      => 3.00,
-    'Maven/XML'                    => 2.5,
-    'IDL'                          => 3.80,
-    'Octave'                       => 4.00,
-    'ML'                           => 3.00,
-    'Modula3'                      => 2.00,
-    'PHP'                          => 3.50,
-    'Python'                       => 4.20,
-    'RapydScript'                  => 4.20,
-    'Cython'                       => 3.80,
-    'Ruby'                         => 4.20,
-    'Ruby HTML'                    => 4.00,
-    'sed'                          => 4.00,
-    'Lua'                          => 4.00,
-    'OpenCL'                       => 1.50,
-);
-# 1}}}
-%{$rh_Known_Binary_Archives} = (             # {{{1
-            '.tar'     => 1 ,
-            '.tar.Z'   => 1 ,
-            '.tar.gz'  => 1 ,
-            '.tar.bz2' => 1 ,
-            '.zip'     => 1 ,
-            '.Zip'     => 1 ,
-            '.ZIP'     => 1 ,
-            '.ear'     => 1 ,  # Java
-            '.war'     => 1 ,  # contained within .ear
-            '.xz'      => 1 ,
-            );
-# 1}}}
-} # end sub set_constants()
-sub check_scale_existence {                  # {{{1
-    # do a few sanity checks
-    my ($rhaa_Filters_by_Language,
-        $rh_Language_by_Extension,
-        $rh_Scale_Factor) = @_;
-
-    my %extension_collisions = (
-        # TODO:  find a better way of dealing with these
-        "PHP/Pascal"                        => 1,
-        "Lisp/OpenCL"                       => 1,
-        "Lisp/Julia"                        => 1,
-        "MATLAB/Mathematica/Objective C/MUMPS/Mercury"  => 1,
-        "Pascal/Puppet"                     => 1,
-        "Perl/Prolog"                       => 1,
-        "IDL/Qt Project/Prolog"             => 1,
-        "D/dtrace"                          => 1,
-        "Fortran 77/Forth"                  => 1,
-        "F#/Forth"                          => 1,
-        "Verilog-SystemVerilog/Coq"         => 1,
-        "TypeScript/Qt Linguist"            => 1,
-        "Qt/Glade"                          => 1,
-    );
-    my $OK = 1;
-    foreach my $language (sort keys %{$rhaa_Filters_by_Language}) {
-        next if defined $extension_collisions{$language};
-        if (!defined $rh_Scale_Factor->{$language}) {
-            $OK = 0;
-            warn "Missing scale factor for $language\n";
-        }
-    }
-
-    my %seen_it = ();
-    foreach my $ext (sort keys %{$rh_Language_by_Extension}) {
-        my $language = $rh_Language_by_Extension->{$ext};
-        next if defined $extension_collisions{$language};
-        next if $seen_it{$language};
-        if (!$rhaa_Filters_by_Language->{$language}) {
-            $OK = 0;
-            warn "Missing language filter for $language\n";
-        }
-        $seen_it{$language} = 1;
-    }
-    die unless $OK;
-} # 1}}}
-sub Install_Regexp_Common {                  # {{{1
-    # Installs portions of Damian Conway's & Abigail's Regexp::Common
-    # module, version 2013031301 into a temporary directory for the
-    # duration of this run.
-    my %Regexp_Common_Contents = ();
-$Regexp_Common_Contents{'Common'} = <<'EOCommon'; # {{{2
-package Regexp::Common;
-
-use 5.00473;
-use strict;
-
-BEGIN {
-    # This makes sure 'use warnings' doesn't bomb out on 5.005_*;
-    # warnings won't be enabled on those old versions though.
-    # Since all other files use this file, we can use 'use warnings'
-    # elsewhere as well, but *AFTER* 'use Regexp::Common'.
-    if ($] < 5.006) {
-        $INC {"warnings.pm"} = 1;
-        no strict 'refs';
-        *{"warnings::unimport"} = sub {0};
-    }
-}
-
-use warnings;
-use vars qw /$VERSION %RE %sub_interface $AUTOLOAD/;
-
-$VERSION = '2013031301';
-
-
-sub _croak {
-    require Carp;
-    goto &Carp::croak;
-}
-
-sub _carp {
-    require Carp;
-    goto &Carp::carp;
-}
-
-sub new {
-    my ($class, @data) = @_;
-    my %self;
-    tie %self, $class, @data;
-    return \%self;
-}
-
-sub TIEHASH {
-    my ($class, @data) = @_;
-    bless \@data, $class;
-}
-
-sub FETCH {
-    my ($self, $extra) = @_;
-    return bless ref($self)->new(@$self, $extra), ref($self);
-}
-
-my %imports = map {$_ => "Regexp::Common::$_"}
-              qw /balanced CC     comment   delimited lingua list
-                  net      number profanity SEN       URI    whitespace
-                  zip/;
-
-sub import {
-    shift;  # Shift off the class.
-    tie %RE, __PACKAGE__;
-    {
-        no strict 'refs';
-        *{caller() . "::RE"} = \%RE;
-    }
-
-    my $saw_import;
-    my $no_defaults;
-    my %exclude;
-    foreach my $entry (grep {!/^RE_/} @_) {
-        if ($entry eq 'pattern') {
-            no strict 'refs';
-            *{caller() . "::pattern"} = \&pattern;
-            next;
-        }
-        # This used to prevent $; from being set. We still recognize it,
-        # but we won't do anything.
-        if ($entry eq 'clean') {
-            next;
-        }
-        if ($entry eq 'no_defaults') {
-            $no_defaults ++;
-            next;
-        }
-        if (my $module = $imports {$entry}) {
-            $saw_import ++;
-            eval "require $module;";
-            die $@ if $@;
-            next;
-        }
-        if ($entry =~ /^!(.*)/ && $imports {$1}) {
-            $exclude {$1} ++;
-            next;
-        }
-        # As a last resort, try to load the argument.
-        my $module = $entry =~ /^Regexp::Common/
-                            ? $entry
-                            : "Regexp::Common::" . $entry;
-        eval "require $module;";
-        die $@ if $@;
-    }
-
-    unless ($saw_import || $no_defaults) {
-        foreach my $module (values %imports) {
-            next if $exclude {$module};
-            eval "require $module;";
-            die $@ if $@;
-        }
-    }
-
-    my %exported;
-    foreach my $entry (grep {/^RE_/} @_) {
-        if ($entry =~ /^RE_(\w+_)?ALL$/) {
-            my $m  = defined $1 ? $1 : "";
-            my $re = qr /^RE_${m}.*$/;
-            while (my ($sub, $interface) = each %sub_interface) {
-                next if $exported {$sub};
-                next unless $sub =~ /$re/;
-                {
-                    no strict 'refs';
-                    *{caller() . "::$sub"} = $interface;
-                }
-                $exported {$sub} ++;
-            }
-        }
-        else {
-            next if $exported {$entry};
-            _croak "Can't export unknown subroutine &$entry"
-                unless $sub_interface {$entry};
-            {
-                no strict 'refs';
-                *{caller() . "::$entry"} = $sub_interface {$entry};
-            }
-            $exported {$entry} ++;
-        }
-    }
-}
-
-sub AUTOLOAD { _croak "Can't $AUTOLOAD" }
-
-sub DESTROY {}
-
-my %cache;
-
-my $fpat = qr/^(-\w+)/;
-
-sub _decache {
-        my @args = @{tied %{$_[0]}};
-        my @nonflags = grep {!/$fpat/} @args;
-        my $cache = get_cache(@nonflags);
-        _croak "Can't create unknown regex: \$RE{"
-            . join("}{",@args) . "}"
-                unless exists $cache->{__VAL__};
-        _croak "Perl $] does not support the pattern "
-            . "\$RE{" . join("}{",@args)
-            . "}.\nYou need Perl $cache->{__VAL__}{version} or later"
-                unless ($cache->{__VAL__}{version}||0) <= $];
-        my %flags = ( %{$cache->{__VAL__}{default}},
-                      map { /$fpat\Q$;\E(.*)/ ? ($1 => $2)
-                          : /$fpat/           ? ($1 => undef)
-                          :                     ()
-                          } @args);
-        $cache->{__VAL__}->_clone_with(\@args, \%flags);
-}
-
-use overload q{""} => \&_decache;
-
-
-sub get_cache {
-        my $cache = \%cache;
-        foreach (@_) {
-                $cache = $cache->{$_}
-                      || ($cache->{$_} = {});
-        }
-        return $cache;
-}
-
-sub croak_version {
-        my ($entry, @args) = @_;
-}
-
-sub pattern {
-        my %spec = @_;
-        _croak 'pattern() requires argument: name => [ @list ]'
-                unless $spec{name} && ref $spec{name} eq 'ARRAY';
-        _croak 'pattern() requires argument: create => $sub_ref_or_string'
-                unless $spec{create};
-
-        if (ref $spec{create} ne "CODE") {
-                my $fixed_str = "$spec{create}";
-                $spec{create} = sub { $fixed_str }
-        }
-
-        my @nonflags;
-        my %default;
-        foreach ( @{$spec{name}} ) {
-                if (/$fpat=(.*)/) {
-                        $default{$1} = $2;
-                }
-                elsif (/$fpat\s*$/) {
-                        $default{$1} = undef;
-                }
-                else {
-                        push @nonflags, $_;
-                }
-        }
-
-        my $entry = get_cache(@nonflags);
-
-        if ($entry->{__VAL__}) {
-                _carp "Overriding \$RE{"
-                   . join("}{",@nonflags)
-                   . "}";
-        }
-
-        $entry->{__VAL__} = bless {
-                                create  => $spec{create},
-                                match   => $spec{match} || \&generic_match,
-                                subs    => $spec{subs}  || \&generic_subs,
-                                version => $spec{version},
-                                default => \%default,
-                            }, 'Regexp::Common::Entry';
-
-        foreach (@nonflags) {s/\W/X/g}
-        my $subname = "RE_" . join ("_", @nonflags);
-        $sub_interface{$subname} = sub {
-                push @_ => undef if @_ % 2;
-                my %flags = @_;
-                my $pat = $spec{create}->($entry->{__VAL__},
-                               {%default, %flags}, \@nonflags);
-                if (exists $flags{-keep}) { $pat =~ s/\Q(?k:/(/g; }
-                else { $pat =~ s/\Q(?k:/(?:/g; }
-                return exists $flags {-i} ? qr /(?i:$pat)/ : qr/$pat/;
-        };
-
-        return 1;
-}
-
-sub generic_match {$_ [1] =~  /$_[0]/}
-sub generic_subs  {$_ [1] =~ s/$_[0]/$_[2]/}
-
-sub matches {
-        my ($self, $str) = @_;
-        my $entry = $self -> _decache;
-        $entry -> {match} -> ($entry, $str);
-}
-
-sub subs {
-        my ($self, $str, $newstr) = @_;
-        my $entry = $self -> _decache;
-        $entry -> {subs} -> ($entry, $str, $newstr);
-        return $str;
-}
-
-
-package Regexp::Common::Entry;
-# use Carp;
-
-use overload
-    q{""} => sub {
-        my ($self) = @_;
-        my $pat = $self->{create}->($self, $self->{flags}, $self->{args});
-        if (exists $self->{flags}{-keep}) {
-            $pat =~ s/\Q(?k:/(/g;
-        }
-        else {
-            $pat =~ s/\Q(?k:/(?:/g;
-        }
-        if (exists $self->{flags}{-i})   { $pat = "(?i)$pat" }
-        return $pat;
-    };
-
-sub _clone_with {
-    my ($self, $args, $flags) = @_;
-    bless { %$self, args=>$args, flags=>$flags }, ref $self;
-}
-
-1;
-#
-# This software is Copyright (c) 2001 - 2011, Damian Conway and Abigail.
-#
-# This module is free software, and maybe used under any of the following
-# licenses:
-#
-#  1) The Perl Artistic License.     See the file COPYRIGHT.AL.
-#  2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2.
-#  3) The BSD Licence.               See the file COPYRIGHT.BSD.
-#  4) The MIT Licence.               See the file COPYRIGHT.MIT.
-EOCommon
-# 2}}}
-$Regexp_Common_Contents{'Common/comment'} = <<'EOC';   # {{{2
-package Regexp::Common::comment;
-
-use Regexp::Common qw /pattern clean no_defaults/;
-
-use strict;
-use warnings;
-
-use vars qw /$VERSION/;
-$VERSION = '2010010201';
-
-my @generic = (
-    {languages => [qw /ABC Forth/],
-     to_eol    => ['\\\\']},   # This is for just a *single* backslash.
-
-    {languages => [qw /Ada Alan Eiffel lua/],
-     to_eol    => ['--']},
-
-    {languages => [qw /Advisor/],
-     to_eol    => ['#|//']},
-
-    {languages => [qw /Advsys CQL Lisp LOGO M MUMPS REBOL Scheme
-                       SMITH zonefile/],
-     to_eol    => [';']},
-
-    {languages => ['Algol 60'],
-     from_to   => [[qw /comment ;/]]},
-
-    {languages => [qw {ALPACA B C C-- LPC PL/I}],
-     from_to   => [[qw {/* */}]]},
-
-    {languages => [qw /awk fvwm2 Icon m4 mutt Perl Python QML
-                       R Ruby shell Tcl/],
-     to_eol    => ['#']},
-
-    {languages => [[BASIC => 'mvEnterprise']],
-     to_eol    => ['[*!]|REM']},
-
-    {languages => [qw /Befunge-98 Funge-98 Shelta/],
-     id        => [';']},
-
-    {languages => ['beta-Juliet', 'Crystal Report', 'Portia', 'Ubercode'],
-     to_eol    => ['//']},
-
-    {languages => ['BML'],
-     from_to   => [['<?_c', '_c?>']],
-    },
-
-    {languages => [qw /C++/, 'C#', qw /AspectJ Cg ECMAScript FPL Java JavaScript JSX Stylus/],
-     to_eol    => ['//'],
-     from_to   => [[qw {/* */}]]},
-
-    {languages => [qw /CLU LaTeX slrn TeX/],
-     to_eol    => ['%']},
-
-    {languages => [qw /False/],
-     from_to   => [[qw !{ }!]]},
-
-    {languages => [qw /Fortran/],
-     to_eol    => ['!']},
-
-    {languages => [qw /Haifu/],
-     id        => [',']},
-
-    {languages => [qw /ILLGOL/],
-     to_eol    => ['NB']},
-
-    {languages => [qw /INTERCAL/],
-     to_eol    => [q{(?:(?:PLEASE(?:\s+DO)?|DO)\s+)?(?:NOT|N'T)}]},
-
-    {languages => [qw /J/],
-     to_eol    => ['NB[.]']},
-
-    {languages => [qw /JavaDoc/],
-     from_to   => [[qw {/** */}]]},
-
-    {languages => [qw /Nickle/],
-     to_eol    => ['#'],
-     from_to   => [[qw {/* */}]]},
-
-    {languages => [qw /Oberon/],
-     from_to   => [[qw /(* *)/]]},
-
-    {languages => [[qw /Pascal Delphi/], [qw /Pascal Free/], [qw /Pascal GPC/]],
-     to_eol    => ['//'],
-     from_to   => [[qw !{ }!], [qw !(* *)!]]},
-
-    {languages => [[qw /Pascal Workshop/]],
-     id        => [qw /"/],
-     from_to   => [[qw !{ }!], [qw !(* *)!], [qw !/* */!]]},
-
-    {languages => [qw /PEARL/],
-     to_eol    => ['!'],
-     from_to   => [[qw {/* */}]]},
-
-    {languages => [qw /PHP/],
-     to_eol    => ['#', '//'],
-     from_to   => [[qw {/* */}]]},
-
-    {languages => [qw !PL/B!],
-     to_eol    => ['[.;]']},
-
-    {languages => [qw !PL/SQL!],
-     to_eol    => ['--'],
-     from_to   => [[qw {/* */}]]},
-
-    {languages => [qw /Q-BAL/],
-     to_eol    => ['`']},
-
-    {languages => [qw /Smalltalk/],
-     id        => ['"']},
-
-    {languages => [qw /SQL/],
-     to_eol    => ['-{2,}']},
-
-    {languages => [qw /troff/],
-     to_eol    => ['\\\"']},
-
-    {languages => [qw /vi/],
-     to_eol    => ['"']},
-
-    {languages => [qw /*W/],
-     from_to   => [[qw {|| !!}]]},
-
-    {languages => [qw /ZZT-OOP/],
-     to_eol    => ["'"]},
-);
-
-my @plain_or_nested = (
-   [Caml         =>  undef,       "(*"  => "*)"],
-   [Dylan        =>  "//",        "/*"  => "*/"],
-   [Haskell      =>  "-{2,}",     "{-"  => "-}"],
-   [Hugo         =>  "!(?!\\\\)", "!\\" => "\\!"],
-   [SLIDE        =>  "#",         "(*"  => "*)"],
-  ['Modula-2'    =>  undef,       "(*"  => "*)"],
-  ['Modula-3'    =>  undef,       "(*"  => "*)"],
-);
-
-#
-# Helper subs.
-#
-
-sub combine      {
-    local $_ = join "|", @_;
-    if (@_ > 1) {
-        s/\(\?k:/(?:/g;
-        $_ = "(?k:$_)";
-    }
-    $_
-}
-
-sub to_eol  ($)  {"(?k:(?k:$_[0])(?k:[^\\n]*)(?k:\\n))"}
-sub id      ($)  {"(?k:(?k:$_[0])(?k:[^$_[0]]*)(?k:$_[0]))"}  # One char only!
-sub from_to      {
-    my ($begin, $end) = @_;
-
-    my $qb  = quotemeta $begin;
-    my $qe  = quotemeta $end;
-    my $fe  = quotemeta substr $end   => 0, 1;
-    my $te  = quotemeta substr $end   => 1;
-
-    "(?k:(?k:$qb)(?k:(?:[^$fe]+|$fe(?!$te))*)(?k:$qe))";
-}
-
-
-my $count = 0;
-sub nested {
-    my ($begin, $end) = @_;
-
-    $count ++;
-    my $r = '(??{$Regexp::Common::comment ['. $count . ']})';
-
-    my $qb  = quotemeta $begin;
-    my $qe  = quotemeta $end;
-    my $fb  = quotemeta substr $begin => 0, 1;
-    my $fe  = quotemeta substr $end   => 0, 1;
-
-    my $tb  = quotemeta substr $begin => 1;
-    my $te  = quotemeta substr $end   => 1;
-
-    use re 'eval';
-
-    my $re;
-    if ($fb eq $fe) {
-        $re = qr /(?:$qb(?:(?>[^$fb]+)|$fb(?!$tb)(?!$te)|$r)*$qe)/;
-    }
-    else {
-        local $"      =  "|";
-        my   @clauses =  "(?>[^$fb$fe]+)";
-        push @clauses => "$fb(?!$tb)" if length $tb;
-        push @clauses => "$fe(?!$te)" if length $te;
-        push @clauses =>  $r;
-        $re           =   qr /(?:$qb(?:@clauses)*$qe)/;
-    }
-
-    $Regexp::Common::comment [$count] = qr/$re/;
-}
-
-#
-# Process data.
-#
-
-foreach my $info (@plain_or_nested) {
-    my ($language, $mark, $begin, $end) = @$info;
-    pattern name    => [comment => $language],
-            create  =>
-                sub {my $re     = nested $begin => $end;
-                     my $prefix = defined $mark ? $mark . "[^\n]*\n|" : "";
-                     exists $_ [1] -> {-keep} ? qr /($prefix$re)/
-                                              : qr  /$prefix$re/
-                },
-            version => 5.006,
-            ;
-}
-
-
-foreach my $group (@generic) {
-    my $pattern = combine +(map {to_eol   $_} @{$group -> {to_eol}}),
-                           (map {from_to @$_} @{$group -> {from_to}}),
-                           (map {id       $_} @{$group -> {id}}),
-                  ;
-    foreach my $language  (@{$group -> {languages}}) {
-        pattern name    => [comment => ref $language ? @$language : $language],
-                create  => $pattern,
-                ;
-    }
-}
-
-
-
-#
-# Other languages.
-#
-
-# http://www.pascal-central.com/docs/iso10206.txt
-pattern name    => [qw /comment Pascal/],
-        create  => '(?k:' . '(?k:[{]|[(][*])'
-                          . '(?k:[^}*]*(?:[*](?![)])[^}*]*)*)'
-                          . '(?k:[}]|[*][)])'
-                          . ')'
-        ;
-
-# http://www.templetons.com/brad/alice/language/
-pattern name    =>  [qw /comment Pascal Alice/],
-        create  =>  '(?k:(?k:[{])(?k:[^}\n]*)(?k:[}]))'
-        ;
-
-
-# http://westein.arb-phys.uni-dortmund.de/~wb/a68s.txt
-pattern name    => [qw (comment), 'Algol 68'],
-        create  => q {(?k:(?:#[^#]*#)|}                           .
-                   q {(?:\bco\b(?:[^c]+|\Bc|\bc(?!o\b))*\bco\b)|} .
-                   q {(?:\bcomment\b(?:[^c]+|\Bc|\bc(?!omment\b))*\bcomment\b))}
-        ;
-
-
-# See rules 91 and 92 of ISO 8879 (SGML).
-# Charles F. Goldfarb: "The SGML Handbook".
-# Oxford: Oxford University Press. 1990. ISBN 0-19-853737-9.
-# Ch. 10.3, pp 390.
-pattern name    => [qw (comment HTML)],
-        create  => q {(?k:(?k:<!)(?k:(?:--(?k:[^-]*(?:-[^-]+)*)--\s*)*)(?k:>))},
-        ;
-
-
-pattern name    => [qw /comment SQL MySQL/],
-        create  => q {(?k:(?:#|-- )[^\n]*\n|} .
-                   q {/\*(?:(?>[^*;"']+)|"[^"]*"|'[^']*'|\*(?!/))*(?:;|\*/))},
-        ;
-
-# Anything that isn't <>[]+-.,
-# http://home.wxs.nl/~faase009/Ha_BF.html
-pattern name    => [qw /comment Brainfuck/],
-        create  => '(?k:[^<>\[\]+\-.,]+)'
-        ;
-
-# Squeak is a variant of Smalltalk-80.
-# http://www.squeak.
-# http://mucow.com/squeak-qref.html
-pattern name    => [qw /comment Squeak/],
-        create  => '(?k:(?k:")(?k:[^"]*(?:""[^"]*)*)(?k:"))'
-        ;
-
-#
-# Scores of less than 5 or above 17....
-# http://www.cliff.biffle.org/esoterica/beatnik.html
-@Regexp::Common::comment::scores = (1,  3,  3,  2,  1,  4,  2,  4,  1,  8,
-                                    5,  1,  3,  1,  1,  3, 10,  1,  1,  1,
-                                    1,  4,  4,  8,  4, 10);
-{
-my ($s, $x);
-pattern name    =>  [qw /comment Beatnik/],
-        create  =>  sub {
-            use re 'eval';
-            my $re = qr {\b([A-Za-z]+)\b
-                         (?(?{($s, $x) = (0, lc $^N);
-                              $s += $Regexp::Common::comment::scores
-                                    [ord (chop $x) - ord ('a')] while length $x;
-                              $s  >= 5 && $s < 18})XXX|)}x;
-            $re;
-        },
-        version  => 5.008,
-        ;
-}
-
-
-# http://www.cray.com/craydoc/manuals/007-3692-005/html-007-3692-005/
-#  (Goto table of contents/3.3 Source Form)
-# Fortran, in fixed format. Comments start with a C, c or * in the first
-# column, or a ! anywhere, but the sixth column. Then end with a newline.
-pattern name    =>  [qw /comment Fortran fixed/],
-        create  =>  '(?k:(?k:(?:^[Cc*]|(?<!^.....)!))(?k:[^\n]*)(?k:\n))'
-        ;
-
-
-# http://www.csis.ul.ie/cobol/Course/COBOLIntro.htm
-# Traditionally, comments in COBOL were indicated with an asterisk in
-# the seventh column. Modern compilers may be more lenient.
-pattern name    =>  [qw /comment COBOL/],
-        create  =>  '(?<=^......)(?k:(?k:[*])(?k:[^\n]*)(?k:\n))',
-        version =>  '5.008',
-        ;
-
-1;
-EOC
-# 2}}}
-$Regexp_Common_Contents{'Common/balanced'} = <<'EOB';   # {{{2
-package Regexp::Common::balanced; {
-
-use Regexp::Common qw /pattern clean no_defaults/;
-
-use strict;
-use warnings;
-
-use vars qw /$VERSION/;
-$VERSION = '2013030901';
-
-my %closer = ( '{'=>'}', '('=>')', '['=>']', '<'=>'>' );
-my %cache;
-
-sub nested {
-    my ($start, $finish) = @_;
-
-    return $cache {$start} {$finish} if exists $cache {$start} {$finish};
-
-    my @starts   = map {s/\\(.)/$1/g; $_} grep {length}
-                        $start  =~ /([^|\\]+|\\.)+/gs;
-    my @finishes = map {s/\\(.)/$1/g; $_} grep {length}
-                        $finish =~ /([^|\\]+|\\.)+/gs;
-
-    push @finishes => ($finishes [-1]) x (@starts - @finishes);
-
-    my @re;
-    local $" = "|";
-    foreach my $begin (@starts) {
-        my $end = shift @finishes;
-
-        my $qb  = quotemeta $begin;
-        my $qe  = quotemeta $end;
-        my $fb  = quotemeta substr $begin => 0, 1;
-        my $fe  = quotemeta substr $end   => 0, 1;
-
-        my $tb  = quotemeta substr $begin => 1;
-        my $te  = quotemeta substr $end   => 1;
-
-        my $add;
-        if ($fb eq $fe) {
-            push @re =>
-                   qq /(?:$qb(?:(?>[^$fb]+)|$fb(?!$tb)(?!$te)|(?-1))*$qe)/;
-        }
-        else {
-            my   @clauses =  "(?>[^$fb$fe]+)";
-            push @clauses => "$fb(?!$tb)" if length $tb;
-            push @clauses => "$fe(?!$te)" if length $te;
-            push @clauses => "(?-1)";
-            push @re      =>  qq /(?:$qb(?:@clauses)*$qe)/;
-        }
-    }
-
-    $cache {$start} {$finish} = qr /(@re)/;
-}
-
-
-pattern name    => [qw /balanced -parens=() -begin= -end=/],
-        create  => sub {
-            my $flag = $_[1];
-            unless (defined $flag -> {-begin} && length $flag -> {-begin} &&
-                    defined $flag -> {-end}   && length $flag -> {-end}) {
-                my @open  = grep {index ($flag->{-parens}, $_) >= 0}
-                             ('[','(','{','<');
-                my @close = map {$closer {$_}} @open;
-                $flag -> {-begin} = join "|" => @open;
-                $flag -> {-end}   = join "|" => @close;
-            }
-            return nested @$flag {qw /-begin -end/};
-        },
-        version => 5.010,
-        ;
-
-}
-
-1;
-# This software is Copyright (c) 2001 - 2013, Damian Conway and Abigail.
-#
-# This module is free software, and maybe used under any of the following
-# licenses:
-#
-#  1) The Perl Artistic License.     See the file COPYRIGHT.AL.
-#  2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2.
-#  3) The BSD Licence.               See the file COPYRIGHT.BSD.
-#  4) The MIT Licence.               See the file COPYRIGHT.MIT.
-EOB
-# 2}}}
-$Regexp_Common_Contents{'Common/delimited'} = <<'EOD';   # {{{3
-package Regexp::Common::delimited;
-
-use Regexp::Common qw /pattern clean no_defaults/;
-
-use strict;
-use warnings;
-
-use vars qw /$VERSION/;
-$VERSION = '2010010201';
-
-sub gen_delimited {
-
-    my ($dels, $escs) = @_;
-    # return '(?:\S*)' unless $dels =~ /\S/;
-    if (length $escs) {
-        $escs .= substr ($escs, -1) x (length ($dels) - length ($escs));
-    }
-    my @pat = ();
-    my $i;
-    for ($i=0; $i < length $dels; $i++) {
-        my $del = quotemeta substr ($dels, $i, 1);
-        my $esc = length($escs) ? quotemeta substr ($escs, $i, 1) : "";
-        if ($del eq $esc) {
-            push @pat,
-                 "(?k:$del)(?k:[^$del]*(?:(?:$del$del)[^$del]*)*)(?k:$del)";
-        }
-        elsif (length $esc) {
-            push @pat,
-                 "(?k:$del)(?k:[^$esc$del]*(?:$esc.[^$esc$del]*)*)(?k:$del)";
-        }
-        else {
-            push @pat, "(?k:$del)(?k:[^$del]*)(?k:$del)";
-        }
-    }
-    my $pat = join '|', @pat;
-    return "(?k:$pat)";
-}
-
-sub _croak {
-    require Carp;
-    goto &Carp::croak;
-}
-
-pattern name   => [qw( delimited -delim= -esc=\\ )],
-        create => sub {my $flags = $_[1];
-                       _croak 'Must specify delimiter in $RE{delimited}'
-                             unless length $flags->{-delim};
-                       return gen_delimited (@{$flags}{-delim, -esc});
-                  },
-        ;
-
-pattern name   => [qw( quoted -esc=\\ )],
-        create => sub {my $flags = $_[1];
-                       return gen_delimited (q{"'`}, $flags -> {-esc});
-                  },
-        ;
-
-
-1;
-# This software is Copyright (c) 2001 - 2009, Damian Conway and Abigail.
-#
-# This module is free software, and maybe used under any of the following
-# licenses:
-#
-#  1) The Perl Artistic License.     See the file COPYRIGHT.AL.
-#  2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2.
-#  3) The BSD Licence.               See the file COPYRIGHT.BSD.
-#  4) The MIT Licence.               See the file COPYRIGHT.MIT.
-EOD
-# 2}}}
-    my $problems        = 0;
-    $HAVE_Rexexp_Common = 0;
-    my $dir             = "";
-    if ($opt_sdir) {
-        ++$TEMP_OFF;
-        $dir = "$opt_sdir/$TEMP_OFF";
-        File::Path::rmtree($dir) if     is_dir($dir);
-        File::Path::mkpath($dir) unless is_dir($dir);
-    } else {
-        # let File::Temp create a suitable temporary directory
-        $dir = tempdir( CLEANUP => 1 );  # 1 = delete on exit
-        $TEMP_INST{ $dir } = "Regexp::Common";
-    }
-    print "Using temp dir [$dir] to install Regexp::Common\n" if $opt_v;
-    my $Regexp_dir        = "$dir/Regexp";
-    my $Regexp_Common_dir = "$dir/Regexp/Common";
-    mkdir $Regexp_dir       ;
-    mkdir $Regexp_Common_dir;
-
-    foreach my $module_file (keys %Regexp_Common_Contents) {
-        my $OUT = new IO::File "$dir/Regexp/${module_file}.pm", "w";
-        if (defined $OUT) {
-            print $OUT $Regexp_Common_Contents{$module_file};
-            $OUT->close;
-        } else {
-            warn "Failed to install Regexp::${module_file}.pm\n";
-            $problems = 1;
-        }
-    }
-
-    push @INC, $dir;
-    eval "use Regexp::Common qw /comment RE_comment_HTML balanced/";
-    $HAVE_Rexexp_Common = 1 unless $problems;
-} # 1}}}
-sub Install_Algorithm_Diff {                 # {{{1
-    # Installs Tye McQueen's Algorithm::Diff module, v1.1902, into a
-    # temporary directory for the duration of this run.
-
-my $Algorithm_Diff_Contents = <<'EOAlgDiff'; # {{{2
-package Algorithm::Diff;
-# Skip to first "=head" line for documentation.
-use strict;
-
-use integer;    # see below in _replaceNextLargerWith() for mod to make
-                # if you don't use this
-use vars qw( $VERSION @EXPORT_OK );
-$VERSION = 1.19_02;
-#          ^ ^^ ^^-- Incremented at will
-#          | \+----- Incremented for non-trivial changes to features
-#          \-------- Incremented for fundamental changes
-require Exporter;
-*import    = \&Exporter::import;
-@EXPORT_OK = qw(
-    prepare LCS LCSidx LCS_length
-    diff sdiff compact_diff
-    traverse_sequences traverse_balanced
-);
-
-# McIlroy-Hunt diff algorithm
-# Adapted from the Smalltalk code of Mario I. Wolczko, <mario@wolczko.com>
-# by Ned Konz, perl@bike-nomad.com
-# Updates by Tye McQueen, http://perlmonks.org/?node=tye
-
-# Create a hash that maps each element of $aCollection to the set of
-# positions it occupies in $aCollection, restricted to the elements
-# within the range of indexes specified by $start and $end.
-# The fourth parameter is a subroutine reference that will be called to
-# generate a string to use as a key.
-# Additional parameters, if any, will be passed to this subroutine.
-#
-# my $hashRef = _withPositionsOfInInterval( \@array, $start, $end, $keyGen );
-
-sub _withPositionsOfInInterval
-{
-    my $aCollection = shift;    # array ref
-    my $start       = shift;
-    my $end         = shift;
-    my $keyGen      = shift;
-    my %d;
-    my $index;
-    for ( $index = $start ; $index <= $end ; $index++ )
-    {
-        my $element = $aCollection->[$index];
-        my $key = &$keyGen( $element, @_ );
-        if ( exists( $d{$key} ) )
-        {
-            unshift ( @{ $d{$key} }, $index );
-        }
-        else
-        {
-            $d{$key} = [$index];
-        }
-    }
-    return wantarray ? %d : \%d;
-}
-
-# Find the place at which aValue would normally be inserted into the
-# array. If that place is already occupied by aValue, do nothing, and
-# return undef. If the place does not exist (i.e., it is off the end of
-# the array), add it to the end, otherwise replace the element at that
-# point with aValue.  It is assumed that the array's values are numeric.
-# This is where the bulk (75%) of the time is spent in this module, so
-# try to make it fast!
-
-sub _replaceNextLargerWith
-{
-    my ( $array, $aValue, $high ) = @_;
-    $high ||= $#$array;
-
-    # off the end?
-    if ( $high == -1 || $aValue > $array->[-1] )
-    {
-        push ( @$array, $aValue );
-        return $high + 1;
-    }
-
-    # binary search for insertion point...
-    my $low = 0;
-    my $index;
-    my $found;
-    while ( $low <= $high )
-    {
-        $index = ( $high + $low ) / 2;
-
-        # $index = int(( $high + $low ) / 2);  # without 'use integer'
-        $found = $array->[$index];
-
-        if ( $aValue == $found )
-        {
-            return undef;
-        }
-        elsif ( $aValue > $found )
-        {
-            $low = $index + 1;
-        }
-        else
-        {
-            $high = $index - 1;
-        }
-    }
-
-    # now insertion point is in $low.
-    $array->[$low] = $aValue;    # overwrite next larger
-    return $low;
-}
-
-# This method computes the longest common subsequence in $a and $b.
-
-# Result is array or ref, whose contents is such that
-#   $a->[ $i ] == $b->[ $result[ $i ] ]
-# foreach $i in ( 0 .. $#result ) if $result[ $i ] is defined.
-
-# An additional argument may be passed; this is a hash or key generating
-# function that should return a string that uniquely identifies the given
-# element.  It should be the case that if the key is the same, the elements
-# will compare the same. If this parameter is undef or missing, the key
-# will be the element as a string.
-
-# By default, comparisons will use "eq" and elements will be turned into keys
-# using the default stringizing operator '""'.
-
-# Additional parameters, if any, will be passed to the key generation
-# routine.
-
-sub _longestCommonSubsequence
-{
-    my $a        = shift;    # array ref or hash ref
-    my $b        = shift;    # array ref or hash ref
-    my $counting = shift;    # scalar
-    my $keyGen   = shift;    # code ref
-    my $compare;             # code ref
-
-    if ( ref($a) eq 'HASH' )
-    {                        # prepared hash must be in $b
-        my $tmp = $b;
-        $b = $a;
-        $a = $tmp;
-    }
-
-    # Check for bogus (non-ref) argument values
-    if ( !ref($a) || !ref($b) )
-    {
-        my @callerInfo = caller(1);
-        die 'error: must pass array or hash references to ' . $callerInfo[3];
-    }
-
-    # set up code refs
-    # Note that these are optimized.
-    if ( !defined($keyGen) )    # optimize for strings
-    {
-        $keyGen = sub { $_[0] };
-        $compare = sub { my ( $a, $b ) = @_; $a eq $b };
-    }
-    else
-    {
-        $compare = sub {
-            my $a = shift;
-            my $b = shift;
-            &$keyGen( $a, @_ ) eq &$keyGen( $b, @_ );
-        };
-    }
-
-    my ( $aStart, $aFinish, $matchVector ) = ( 0, $#$a, [] );
-    my ( $prunedCount, $bMatches ) = ( 0, {} );
-
-    if ( ref($b) eq 'HASH' )    # was $bMatches prepared for us?
-    {
-        $bMatches = $b;
-    }
-    else
-    {
-        my ( $bStart, $bFinish ) = ( 0, $#$b );
-
-        # First we prune off any common elements at the beginning
-        while ( $aStart <= $aFinish
-            and $bStart <= $bFinish
-            and &$compare( $a->[$aStart], $b->[$bStart], @_ ) )
-        {
-            $matchVector->[ $aStart++ ] = $bStart++;
-            $prunedCount++;
-        }
-
-        # now the end
-        while ( $aStart <= $aFinish
-            and $bStart <= $bFinish
-            and &$compare( $a->[$aFinish], $b->[$bFinish], @_ ) )
-        {
-            $matchVector->[ $aFinish-- ] = $bFinish--;
-            $prunedCount++;
-        }
-
-        # Now compute the equivalence classes of positions of elements
-        $bMatches =
-          _withPositionsOfInInterval( $b, $bStart, $bFinish, $keyGen, @_ );
-    }
-    my $thresh = [];
-    my $links  = [];
-
-    my ( $i, $ai, $j, $k );
-    for ( $i = $aStart ; $i <= $aFinish ; $i++ )
-    {
-        $ai = &$keyGen( $a->[$i], @_ );
-        if ( exists( $bMatches->{$ai} ) )
-        {
-            $k = 0;
-            for $j ( @{ $bMatches->{$ai} } )
-            {
-
-                # optimization: most of the time this will be true
-                if ( $k and $thresh->[$k] > $j and $thresh->[ $k - 1 ] < $j )
-                {
-                    $thresh->[$k] = $j;
-                }
-                else
-                {
-                    $k = _replaceNextLargerWith( $thresh, $j, $k );
-                }
-
-                # oddly, it's faster to always test this (CPU cache?).
-                if ( defined($k) )
-                {
-                    $links->[$k] =
-                      [ ( $k ? $links->[ $k - 1 ] : undef ), $i, $j ];
-                }
-            }
-        }
-    }
-
-    if (@$thresh)
-    {
-        return $prunedCount + @$thresh if $counting;
-        for ( my $link = $links->[$#$thresh] ; $link ; $link = $link->[0] )
-        {
-            $matchVector->[ $link->[1] ] = $link->[2];
-        }
-    }
-    elsif ($counting)
-    {
-        return $prunedCount;
-    }
-
-    return wantarray ? @$matchVector : $matchVector;
-}
-
-sub traverse_sequences
-{
-    my $a                 = shift;          # array ref
-    my $b                 = shift;          # array ref
-    my $callbacks         = shift || {};
-    my $keyGen            = shift;
-    my $matchCallback     = $callbacks->{'MATCH'} || sub { };
-    my $discardACallback  = $callbacks->{'DISCARD_A'} || sub { };
-    my $finishedACallback = $callbacks->{'A_FINISHED'};
-    my $discardBCallback  = $callbacks->{'DISCARD_B'} || sub { };
-    my $finishedBCallback = $callbacks->{'B_FINISHED'};
-    my $matchVector = _longestCommonSubsequence( $a, $b, 0, $keyGen, @_ );
-
-    # Process all the lines in @$matchVector
-    my $lastA = $#$a;
-    my $lastB = $#$b;
-    my $bi    = 0;
-    my $ai;
-
-    for ( $ai = 0 ; $ai <= $#$matchVector ; $ai++ )
-    {
-        my $bLine = $matchVector->[$ai];
-        if ( defined($bLine) )    # matched
-        {
-            &$discardBCallback( $ai, $bi++, @_ ) while $bi < $bLine;
-            &$matchCallback( $ai,    $bi++, @_ );
-        }
-        else
-        {
-            &$discardACallback( $ai, $bi, @_ );
-        }
-    }
-
-    # The last entry (if any) processed was a match.
-    # $ai and $bi point just past the last matching lines in their sequences.
-
-    while ( $ai <= $lastA or $bi <= $lastB )
-    {
-
-        # last A?
-        if ( $ai == $lastA + 1 and $bi <= $lastB )
-        {
-            if ( defined($finishedACallback) )
-            {
-                &$finishedACallback( $lastA, @_ );
-                $finishedACallback = undef;
-            }
-            else
-            {
-                &$discardBCallback( $ai, $bi++, @_ ) while $bi <= $lastB;
-            }
-        }
-
-        # last B?
-        if ( $bi == $lastB + 1 and $ai <= $lastA )
-        {
-            if ( defined($finishedBCallback) )
-            {
-                &$finishedBCallback( $lastB, @_ );
-                $finishedBCallback = undef;
-            }
-            else
-            {
-                &$discardACallback( $ai++, $bi, @_ ) while $ai <= $lastA;
-            }
-        }
-
-        &$discardACallback( $ai++, $bi, @_ ) if $ai <= $lastA;
-        &$discardBCallback( $ai, $bi++, @_ ) if $bi <= $lastB;
-    }
-
-    return 1;
-}
-
-sub traverse_balanced
-{
-    my $a                 = shift;              # array ref
-    my $b                 = shift;              # array ref
-    my $callbacks         = shift || {};
-    my $keyGen            = shift;
-    my $matchCallback     = $callbacks->{'MATCH'} || sub { };
-    my $discardACallback  = $callbacks->{'DISCARD_A'} || sub { };
-    my $discardBCallback  = $callbacks->{'DISCARD_B'} || sub { };
-    my $changeCallback    = $callbacks->{'CHANGE'};
-    my $matchVector = _longestCommonSubsequence( $a, $b, 0, $keyGen, @_ );
-
-    # Process all the lines in match vector
-    my $lastA = $#$a;
-    my $lastB = $#$b;
-    my $bi    = 0;
-    my $ai    = 0;
-    my $ma    = -1;
-    my $mb;
-
-    while (1)
-    {
-
-        # Find next match indices $ma and $mb
-        do {
-            $ma++;
-        } while(
-                $ma <= $#$matchVector
-            &&  !defined $matchVector->[$ma]
-        );
-
-        last if $ma > $#$matchVector;    # end of matchVector?
-        $mb = $matchVector->[$ma];
-
-        # Proceed with discard a/b or change events until
-        # next match
-        while ( $ai < $ma || $bi < $mb )
-        {
-
-            if ( $ai < $ma && $bi < $mb )
-            {
-
-                # Change
-                if ( defined $changeCallback )
-                {
-                    &$changeCallback( $ai++, $bi++, @_ );
-                }
-                else
-                {
-                    &$discardACallback( $ai++, $bi, @_ );
-                    &$discardBCallback( $ai, $bi++, @_ );
-                }
-            }
-            elsif ( $ai < $ma )
-            {
-                &$discardACallback( $ai++, $bi, @_ );
-            }
-            else
-            {
-
-                # $bi < $mb
-                &$discardBCallback( $ai, $bi++, @_ );
-            }
-        }
-
-        # Match
-        &$matchCallback( $ai++, $bi++, @_ );
-    }
-
-    while ( $ai <= $lastA || $bi <= $lastB )
-    {
-        if ( $ai <= $lastA && $bi <= $lastB )
-        {
-
-            # Change
-            if ( defined $changeCallback )
-            {
-                &$changeCallback( $ai++, $bi++, @_ );
-            }
-            else
-            {
-                &$discardACallback( $ai++, $bi, @_ );
-                &$discardBCallback( $ai, $bi++, @_ );
-            }
-        }
-        elsif ( $ai <= $lastA )
-        {
-            &$discardACallback( $ai++, $bi, @_ );
-        }
-        else
-        {
-
-            # $bi <= $lastB
-            &$discardBCallback( $ai, $bi++, @_ );
-        }
-    }
-
-    return 1;
-}
-
-sub prepare
-{
-    my $a       = shift;    # array ref
-    my $keyGen  = shift;    # code ref
-
-    # set up code ref
-    $keyGen = sub { $_[0] } unless defined($keyGen);
-
-    return scalar _withPositionsOfInInterval( $a, 0, $#$a, $keyGen, @_ );
-}
-
-sub LCS
-{
-    my $a = shift;                  # array ref
-    my $b = shift;                  # array ref or hash ref
-    my $matchVector = _longestCommonSubsequence( $a, $b, 0, @_ );
-    my @retval;
-    my $i;
-    for ( $i = 0 ; $i <= $#$matchVector ; $i++ )
-    {
-        if ( defined( $matchVector->[$i] ) )
-        {
-            push ( @retval, $a->[$i] );
-        }
-    }
-    return wantarray ? @retval : \@retval;
-}
-
-sub LCS_length
-{
-    my $a = shift;                          # array ref
-    my $b = shift;                          # array ref or hash ref
-    return _longestCommonSubsequence( $a, $b, 1, @_ );
-}
-
-sub LCSidx
-{
-    my $a= shift @_;
-    my $b= shift @_;
-    my $match= _longestCommonSubsequence( $a, $b, 0, @_ );
-    my @am= grep defined $match->[$_], 0..$#$match;
-    my @bm= @{$match}[@am];
-    return \@am, \@bm;
-}
-
-sub compact_diff
-{
-    my $a= shift @_;
-    my $b= shift @_;
-    my( $am, $bm )= LCSidx( $a, $b, @_ );
-    my @cdiff;
-    my( $ai, $bi )= ( 0, 0 );
-    push @cdiff, $ai, $bi;
-    while( 1 ) {
-        while(  @$am  &&  $ai == $am->[0]  &&  $bi == $bm->[0]  ) {
-            shift @$am;
-            shift @$bm;
-            ++$ai, ++$bi;
-        }
-        push @cdiff, $ai, $bi;
-        last   if  ! @$am;
-        $ai = $am->[0];
-        $bi = $bm->[0];
-        push @cdiff, $ai, $bi;
-    }
-    push @cdiff, 0+@$a, 0+@$b
-        if  $ai < @$a || $bi < @$b;
-    return wantarray ? @cdiff : \@cdiff;
-}
-
-sub diff
-{
-    my $a      = shift;    # array ref
-    my $b      = shift;    # array ref
-    my $retval = [];
-    my $hunk   = [];
-    my $discard = sub {
-        push @$hunk, [ '-', $_[0], $a->[ $_[0] ] ];
-    };
-    my $add = sub {
-        push @$hunk, [ '+', $_[1], $b->[ $_[1] ] ];
-    };
-    my $match = sub {
-        push @$retval, $hunk
-            if 0 < @$hunk;
-        $hunk = []
-    };
-    traverse_sequences( $a, $b,
-        { MATCH => $match, DISCARD_A => $discard, DISCARD_B => $add }, @_ );
-    &$match();
-    return wantarray ? @$retval : $retval;
-}
-
-sub sdiff
-{
-    my $a      = shift;    # array ref
-    my $b      = shift;    # array ref
-    my $retval = [];
-    my $discard = sub { push ( @$retval, [ '-', $a->[ $_[0] ], "" ] ) };
-    my $add = sub { push ( @$retval, [ '+', "", $b->[ $_[1] ] ] ) };
-    my $change = sub {
-        push ( @$retval, [ 'c', $a->[ $_[0] ], $b->[ $_[1] ] ] );
-    };
-    my $match = sub {
-        push ( @$retval, [ 'u', $a->[ $_[0] ], $b->[ $_[1] ] ] );
-    };
-    traverse_balanced(
-        $a,
-        $b,
-        {
-            MATCH     => $match,
-            DISCARD_A => $discard,
-            DISCARD_B => $add,
-            CHANGE    => $change,
-        },
-        @_
-    );
-    return wantarray ? @$retval : $retval;
-}
-
-########################################
-my $Root= __PACKAGE__;
-package Algorithm::Diff::_impl;
-use strict;
-
-sub _Idx()  { 0 } # $me->[_Idx]: Ref to array of hunk indices
-            # 1   # $me->[1]: Ref to first sequence
-            # 2   # $me->[2]: Ref to second sequence
-sub _End()  { 3 } # $me->[_End]: Diff between forward and reverse pos
-sub _Same() { 4 } # $me->[_Same]: 1 if pos 1 contains unchanged items
-sub _Base() { 5 } # $me->[_Base]: Added to range's min and max
-sub _Pos()  { 6 } # $me->[_Pos]: Which hunk is currently selected
-sub _Off()  { 7 } # $me->[_Off]: Offset into _Idx for current position
-sub _Min() { -2 } # Added to _Off to get min instead of max+1
-
-sub Die
-{
-    require Carp;
-    Carp::confess( @_ );
-}
-
-sub _ChkPos
-{
-    my( $me )= @_;
-    return   if  $me->[_Pos];
-    my $meth= ( caller(1) )[3];
-    Die( "Called $meth on 'reset' object" );
-}
-
-sub _ChkSeq
-{
-    my( $me, $seq )= @_;
-    return $seq + $me->[_Off]
-        if  1 == $seq  ||  2 == $seq;
-    my $meth= ( caller(1) )[3];
-    Die( "$meth: Invalid sequence number ($seq); must be 1 or 2" );
-}
-
-sub getObjPkg
-{
-    my( $us )= @_;
-    return ref $us   if  ref $us;
-    return $us . "::_obj";
-}
-
-sub new
-{
-    my( $us, $seq1, $seq2, $opts ) = @_;
-    my @args;
-    for( $opts->{keyGen} ) {
-        push @args, $_   if  $_;
-    }
-    for( $opts->{keyGenArgs} ) {
-        push @args, @$_   if  $_;
-    }
-    my $cdif= Algorithm::Diff::compact_diff( $seq1, $seq2, @args );
-    my $same= 1;
-    if(  0 == $cdif->[2]  &&  0 == $cdif->[3]  ) {
-        $same= 0;
-        splice @$cdif, 0, 2;
-    }
-    my @obj= ( $cdif, $seq1, $seq2 );
-    $obj[_End] = (1+@$cdif)/2;
-    $obj[_Same] = $same;
-    $obj[_Base] = 0;
-    my $me = bless \@obj, $us->getObjPkg();
-    $me->Reset( 0 );
-    return $me;
-}
-
-sub Reset
-{
-    my( $me, $pos )= @_;
-    $pos= int( $pos || 0 );
-    $pos += $me->[_End]
-        if  $pos < 0;
-    $pos= 0
-        if  $pos < 0  ||  $me->[_End] <= $pos;
-    $me->[_Pos]= $pos || !1;
-    $me->[_Off]= 2*$pos - 1;
-    return $me;
-}
-
-sub Base
-{
-    my( $me, $base )= @_;
-    my $oldBase= $me->[_Base];
-    $me->[_Base]= 0+$base   if  defined $base;
-    return $oldBase;
-}
-
-sub Copy
-{
-    my( $me, $pos, $base )= @_;
-    my @obj= @$me;
-    my $you= bless \@obj, ref($me);
-    $you->Reset( $pos )   if  defined $pos;
-    $you->Base( $base );
-    return $you;
-}
-
-sub Next {
-    my( $me, $steps )= @_;
-    $steps= 1   if  ! defined $steps;
-    if( $steps ) {
-        my $pos= $me->[_Pos];
-        my $new= $pos + $steps;
-        $new= 0   if  $pos  &&  $new < 0;
-        $me->Reset( $new )
-    }
-    return $me->[_Pos];
-}
-
-sub Prev {
-    my( $me, $steps )= @_;
-    $steps= 1   if  ! defined $steps;
-    my $pos= $me->Next(-$steps);
-    $pos -= $me->[_End]   if  $pos;
-    return $pos;
-}
-
-sub Diff {
-    my( $me )= @_;
-    $me->_ChkPos();
-    return 0   if  $me->[_Same] == ( 1 & $me->[_Pos] );
-    my $ret= 0;
-    my $off= $me->[_Off];
-    for my $seq ( 1, 2 ) {
-        $ret |= $seq
-            if  $me->[_Idx][ $off + $seq + _Min ]
-            <   $me->[_Idx][ $off + $seq ];
-    }
-    return $ret;
-}
-
-sub Min {
-    my( $me, $seq, $base )= @_;
-    $me->_ChkPos();
-    my $off= $me->_ChkSeq($seq);
-    $base= $me->[_Base] if !defined $base;
-    return $base + $me->[_Idx][ $off + _Min ];
-}
-
-sub Max {
-    my( $me, $seq, $base )= @_;
-    $me->_ChkPos();
-    my $off= $me->_ChkSeq($seq);
-    $base= $me->[_Base] if !defined $base;
-    return $base + $me->[_Idx][ $off ] -1;
-}
-
-sub Range {
-    my( $me, $seq, $base )= @_;
-    $me->_ChkPos();
-    my $off = $me->_ChkSeq($seq);
-    if( !wantarray ) {
-        return  $me->[_Idx][ $off ]
-            -   $me->[_Idx][ $off + _Min ];
-    }
-    $base= $me->[_Base] if !defined $base;
-    return  ( $base + $me->[_Idx][ $off + _Min ] )
-        ..  ( $base + $me->[_Idx][ $off ] - 1 );
-}
-
-sub Items {
-    my( $me, $seq )= @_;
-    $me->_ChkPos();
-    my $off = $me->_ChkSeq($seq);
-    if( !wantarray ) {
-        return  $me->[_Idx][ $off ]
-            -   $me->[_Idx][ $off + _Min ];
-    }
-    return
-        @{$me->[$seq]}[
-                $me->[_Idx][ $off + _Min ]
-            ..  ( $me->[_Idx][ $off ] - 1 )
-        ];
-}
-
-sub Same {
-    my( $me )= @_;
-    $me->_ChkPos();
-    return wantarray ? () : 0
-        if  $me->[_Same] != ( 1 & $me->[_Pos] );
-    return $me->Items(1);
-}
-
-my %getName;
-BEGIN {
-    %getName= (
-        same => \&Same,
-        diff => \&Diff,
-        base => \&Base,
-        min  => \&Min,
-        max  => \&Max,
-        range=> \&Range,
-        items=> \&Items, # same thing
-    );
-}
-
-sub Get
-{
-    my $me= shift @_;
-    $me->_ChkPos();
-    my @value;
-    for my $arg (  @_  ) {
-        for my $word (  split ' ', $arg  ) {
-            my $meth;
-            if(     $word !~ /^(-?\d+)?([a-zA-Z]+)([12])?$/
-                ||  not  $meth= $getName{ lc $2 }
-            ) {
-                Die( $Root, ", Get: Invalid request ($word)" );
-            }
-            my( $base, $name, $seq )= ( $1, $2, $3 );
-            push @value, scalar(
-                4 == length($name)
-                    ? $meth->( $me )
-                    : $meth->( $me, $seq, $base )
-            );
-        }
-    }
-    if(  wantarray  ) {
-        return @value;
-    } elsif(  1 == @value  ) {
-        return $value[0];
-    }
-    Die( 0+@value, " values requested from ",
-        $Root, "'s Get in scalar context" );
-}
-
-
-my $Obj= getObjPkg($Root);
-no strict 'refs';
-
-for my $meth (  qw( new getObjPkg )  ) {
-    *{$Root."::".$meth} = \&{$meth};
-    *{$Obj ."::".$meth} = \&{$meth};
-}
-for my $meth (  qw(
-    Next Prev Reset Copy Base Diff
-    Same Items Range Min Max Get
-    _ChkPos _ChkSeq
-)  ) {
-    *{$Obj."::".$meth} = \&{$meth};
-}
-
-1;
-# This version released by Tye McQueen (http://perlmonks.org/?node=tye).
-#
-# =head1 LICENSE
-#
-# Parts Copyright (c) 2000-2004 Ned Konz.  All rights reserved.
-# Parts by Tye McQueen.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the same terms as Perl.
-#
-# =head1 MAILING LIST
-#
-# Mark-Jason still maintains a mailing list.  To join a low-volume mailing
-# list for announcements related to diff and Algorithm::Diff, send an
-# empty mail message to mjd-perl-diff-request@plover.com.
-# =head1 CREDITS
-#
-# Versions through 0.59 (and much of this documentation) were written by:
-#
-# Mark-Jason Dominus, mjd-perl-diff@plover.com
-#
-# This version borrows some documentation and routine names from
-# Mark-Jason's, but Diff.pm's code was completely replaced.
-#
-# This code was adapted from the Smalltalk code of Mario Wolczko
-# <mario@wolczko.com>, which is available at
-# ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st
-#
-# C<sdiff> and C<traverse_balanced> were written by Mike Schilli
-# <m@perlmeister.com>.
-#
-# The algorithm is that described in
-# I<A Fast Algorithm for Computing Longest Common Subsequences>,
-# CACM, vol.20, no.5, pp.350-353, May 1977, with a few
-# minor improvements to improve the speed.
-#
-# Much work was done by Ned Konz (perl@bike-nomad.com).
-#
-# The OO interface and some other changes are by Tye McQueen.
-#
-EOAlgDiff
-# 2}}}
-    my $problems        = 0;
-    $HAVE_Algorith_Diff = 0;
-    my $dir             = "";
-    if ($opt_sdir) {
-        ++$TEMP_OFF;
-        $dir = "$opt_sdir/$TEMP_OFF";
-        File::Path::rmtree($dir) if     is_dir($dir);
-        File::Path::mkpath($dir) unless is_dir($dir);
-    } else {
-        # let File::Temp create a suitable temporary directory
-        $dir = tempdir( CLEANUP => 1 );  # 1 = delete on exit
-        $TEMP_INST{ $dir } = "Algorithm::Diff";
-    }
-    print "Using temp dir [$dir] to install Algorithm::Diff\n" if $opt_v;
-    my $Algorithm_dir      = "$dir/Algorithm";
-    my $Algorithm_Diff_dir = "$dir/Algorithm/Diff";
-    mkdir $Algorithm_dir     ;
-    mkdir $Algorithm_Diff_dir;
-
-    my $OUT = new IO::File "$dir/Algorithm/Diff.pm", "w";
-    if (defined $OUT) {
-        print $OUT $Algorithm_Diff_Contents;
-        $OUT->close;
-    } else {
-        warn "Failed to install Algorithm/Diff.pm\n";
-        $problems = 1;
-    }
-
-    push @INC, $dir;  # between this & Regexp::Common only need to do once
-    eval "use Algorithm::Diff qw / sdiff /";
-    $HAVE_Algorith_Diff = 1 unless $problems;
-} # 1}}}
-sub pre_post_fix {                     # {{{1
-    # Return the input lines prefixed and postfixed
-    # by the given strings.
-    my ($ra_lines, $prefix, $postfix ) = @_;
-    print "-> pre_post_fix with $prefix, $postfix\n" if $opt_v > 2;
-
-    my $all_lines = $prefix . join(""  , @{$ra_lines}) . $postfix;
-
-    print "<- pre_post_fix\n" if $opt_v > 2;
-    return split("\n", $all_lines);
-} # 1}}}
-sub call_regexp_common {                     # {{{1
-    my ($ra_lines, $language ) = @_;
-    print "-> call_regexp_common for $language\n" if $opt_v > 2;
-
-    Install_Regexp_Common() unless $HAVE_Rexexp_Common;
-
-    my $all_lines = undef;
-    if ($language eq "C++") { # Regexp::Common's C++ comment regex is multi-line
-#       $all_lines = join("\n", @{$ra_lines});
-        $all_lines = "";
-        foreach (@{$ra_lines}) {
-            if (m/\\$/) {  # line ends with a continuation marker
-                $all_lines .= $_;
-            } else {
-                $all_lines .= "$_\n";
-            }
-        }
-    } else {
-        $all_lines = join(""  , @{$ra_lines});
-    }
-
-    no strict 'vars';
-    # otherwise get:
-    #  Global symbol "%RE" requires explicit package name at cloc line xx.
-    if ($all_lines =~ $RE{comment}{$language}) {
-        # Suppress "Use of uninitialized value in regexp compilation" that
-        # pops up when $1 is undefined--happens if there's a bug in the $RE
-        # This Pascal comment will trigger it:
-        #         (* This is { another } test. **)
-        # Curiously, testing for "defined $1" breaks the substitution.
-        no warnings;
-        # remove   comments
-        $all_lines =~ s/$1//g;
-    }
-    # a bogus use of %RE to avoid:
-    # Name "main::RE" used only once: possible typo at cloc line xx.
-    print scalar keys %RE if $opt_v < -20;
-    print "<- call_regexp_common\n" if $opt_v > 2;
-    return split("\n", $all_lines);
-} # 1}}}
-sub plural_form {                            # {{{1
-    # For getting the right plural form on some English nouns.
-    my $n = shift @_;
-    if ($n == 1) { return ( 1, "" ); }
-    else         { return ($n, "s"); }
-} # 1}}}
-sub matlab_or_objective_C {                  # {{{1
-    # Decide if code is MATLAB, Mathematica, Objective C, MUMPS, or Mercury
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-        $rs_language , # out
-       ) = @_;
-    print "-> matlab_or_objective_C\n" if $opt_v > 2;
-    # matlab markers:
-    #   first line starts with "function"
-    #   some lines start with "%"
-    #   high marks for lines that start with [
-    #
-    # Objective C markers:
-    #   must have at least two brace characters, { }
-    #   has /* ... */ style comments
-    #   some lines start with @
-    #   some lines start with #include
-    #
-    # MUMPS:
-    #   has ; comment markers
-    #   do not match:  \w+\s*=\s*\w
-    #   lines begin with   \s*\.?\w+\s+\w
-    #   high marks for lines that start with \s*K\s+ or \s*Kill\s+
-    #
-    # Mercury:
-    #   any line that begins with :- immediately triggers this
-    #
-    # Mathematica:
-    #   (* .. *)
-    #   BeginPackage
-
-    ${$rs_language} = "";
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return;
-    }
-
-    my $DEBUG              = 0;
-
-    my $matlab_points      = 0;
-    my $mathematica_points = 0;
-    my $objective_C_points = 0;
-    my $mumps_points       = 0;
-    my $mercury_points     = 0;
-    my $has_braces         = 0;
-    while (<$IN>) {
-        ++$has_braces if $_ =~ m/[{}]/;
-#print "LINE $. has_braces=$has_braces\n";
-        ++$mumps_points if $. == 1 and m{^[A-Z]};
-        if      (m{^\s*/\*} or m {^\s*//}) {   #   /* or //
-            $objective_C_points += 5;
-            $matlab_points      -= 5;
-printf ".m:  /*|//  obj C=% 2d  matlab=% 2d  mathematica=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-        } elsif (m{^:-\s+}) {      # gotta be mercury
-            $mercury_points = 1000;
-            last;
-        } elsif (m{\w+\s*=\s*\[}) {      # matrix assignment, very matlab
-            $matlab_points += 5;
-        }
-        if (m{\w+\[}) {      # function call by []
-            $mathematica_points += 2;
-printf ".m:  \\w=[   obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-        } elsif (m{^\s*\w+\s*=\s*}) {    # definitely not MUMPS
-            --$mumps_points;
-printf ".m:  \\w=    obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-        } elsif (m{^\s*\.?(\w)\s+(\w)} and $1 !~ /\d/ and $2 !~ /\d/) {
-            ++$mumps_points;
-printf ".m:  \\w \\w  obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-        } elsif (m{^\s*;}) {
-            ++$mumps_points;
-printf ".m:  ;      obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-        }
-        if (m{^\s*#(include|import)}) {
-            # Objective C without a doubt
-            $objective_C_points = 1000;
-            $matlab_points      = 0;
-printf ".m: #includ obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-            $has_braces         = 2;
-            last;
-        } elsif (m{^\s*@(interface|implementation|protocol|public|protected|private|end)\s}o) {
-            # Objective C without a doubt
-            $objective_C_points = 1000;
-            $matlab_points      = 0;
-printf ".m: keyword obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-            last;
-        } elsif (m{^\s*BeginPackage}) {
-            $mathematica_points += 2;
-        } elsif (m{^\s*\[}) {             #   line starts with [  -- very matlab
-            $matlab_points += 5;
-printf ".m:  [      obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-        } elsif (m{^\sK(ill)?\s+}) {
-            $mumps_points  += 5;
-printf ".m:  Kill   obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-        } elsif (m{^\s*function}) {
-            --$objective_C_points;
-            ++$matlab_points;
-printf ".m:  funct  obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-        } elsif (m{^\s*%}) {              #   %
-            # matlab commented line
-            --$objective_C_points;
-            ++$matlab_points;
-printf ".m:  pcent  obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-        }
-    }
-    $IN->close;
-printf "END LOOP    obj C=% 2d  matlab=% 2d  mumps=% 2d  mercury= % 2d\n", $objective_C_points, $matlab_points, $mathematica_points, $mumps_points, $mercury_points if $DEBUG;
-
-    # next heuristic is unreliable for small files
-#   $objective_C_points = -9.9e20 unless $has_braces >= 2;
-
-    my %points = ( 'MATLAB'      => $matlab_points     ,
-                   'Mathematica' => $mathematica_points     ,
-                   'MUMPS'       => $mumps_points      ,
-                   'Objective C' => $objective_C_points,
-                   'Mercury'     => $mercury_points    , );
-
-    ${$rs_language} = (sort { $points{$b} <=> $points{$a}} keys %points)[0];
-
-    print "<- matlab_or_objective_C($file: matlab=$matlab_points, mathematica=$mathematica_points, C=$objective_C_points, mumps=$mumps_points, mercury=$mercury_points) => ${$rs_language}\n"
-        if $opt_v > 2;
-
-} # 1}}}
-sub Lisp_or_OpenCL {                         # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> Lisp_or_OpenCL\n" if $opt_v > 2;
-
-    my $lang = undef;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $lisp_points   = 0;
-    my $opcl_points = 0;
-    while (<$IN>) {
-        ++$lisp_points if  /^\s*;/;
-        ++$lisp_points if  /\((def|eval|require|export|let|loop|dec|format)/;
-        ++$opcl_points if  /^\s*(int|float|const|{)/;
-    }
-    $IN->close;
-    # print "lisp_points=$lisp_points   opcl_points=$opcl_points\n";
-    if ($lisp_points > $opcl_points) {
-        $lang = "Lisp";
-    } else {
-        $lang = "OpenCL";
-    }
-
-    print "<- Lisp_or_OpenCL\n" if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub Lisp_or_Julia {                          # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> Lisp_or_Julia\n" if $opt_v > 2;
-
-    my $lang = undef;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $lisp_points   = 0;
-    my $julia_points = 0;
-    while (<$IN>) {
-        ++$lisp_points if  /^\s*;/;
-        ++$lisp_points if  /\((def|eval|require|export|let|loop|dec|format)/;
-        ++$julia_points if  /^\s*(function|end|println|for|while)/;
-    }
-    $IN->close;
-    # print "lisp_points=$lisp_points   julia_points=$julia_points\n";
-    if ($lisp_points > $julia_points) {
-        $lang = "Lisp";
-    } else {
-        $lang = "Julia";
-    }
-
-    print "<- Lisp_or_Julia\n" if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub Perl_or_Prolog {                         # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> Perl_or_Prolog\n" if $opt_v > 2;
-
-    my $lang = undef;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $perl_points = 0;
-    my $prolog_points = 0;
-    while (<$IN>) {
-        ++$perl_points if  /;\s*$/;
-        ++$perl_points if  /({|})/;
-        ++$perl_points if  /^\s*sub\s+/;
-        ++$perl_points if  /\s*<<'/;  # start HERE block
-        ++$perl_points if  /\$(\w+\->|[_!])/;
-        ++$prolog_points if !/\s*#/ and /\.\s*$/;
-        ++$prolog_points if /:-/;
-    }
-    $IN->close;
-    # print "perl_points=$perl_points   prolog_points=$prolog_points\n";
-    if ($perl_points > $prolog_points) {
-        $lang = "Perl";
-    } else {
-        $lang = "Prolog";
-    }
-
-    printf "<- Perl_or_Prolog(%s, Perl=%d Prolog=%d)\n",
-        $file, $perl_points, $prolog_points if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub IDL_or_QtProject {                       # {{{1
-    # also Prolog
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> IDL_or_QtProject($file)\n" if $opt_v > 2;
-
-    my $lang = undef;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $idl_points    = 0;
-    my $qtproj_points = 0;
-    my $prolog_points = 0;
-    while (<$IN>) {
-        ++$idl_points    if /^\s*;/;
-        ++$idl_points    if /plot\(/i;
-        ++$qtproj_points if /^\s*(qt|configs|sources)\s*\+?=/i;
-        ++$prolog_points if /\.\s*$/;
-        ++$prolog_points if /:-/;
-    }
-    $IN->close;
-    # print "idl_points=$idl_points   qtproj_points=$qtproj_points\n";
-
-    if ($idl_points > $qtproj_points) {
-        $lang = "IDL";
-    } else {
-        $lang = "Qt Project";
-    }
-
-    my %points = ( 'IDL'        => $idl_points     ,
-                   'Qt Project' => $qtproj_points  ,
-                   'Prolog'     => $prolog_points  , );
-
-    $lang = (sort { $points{$b} <=> $points{$a}} keys %points)[0];
-
-    print "<- IDL_or_QtProject(idl_points=$idl_points, ",
-          "qtproj_points=$qtproj_points, prolog_points=$prolog_points)\n"
-           if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub Ant_or_XML {                             # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> Ant_or_XML($file)\n" if $opt_v > 2;
-
-    my $lang = "XML";
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $Ant_points   = 0;
-    my $XML_points   = 1;
-    while (<$IN>) {
-        if (/^\s*<project\s+/) {
-            ++$Ant_points  ;
-            --$XML_points  ;
-        }
-        if (/xmlns:artifact="antlib:org.apache.maven.artifact.ant"/) {
-            ++$Ant_points  ;
-            --$XML_points  ;
-        }
-    }
-    $IN->close;
-
-    if ($XML_points >= $Ant_points) {
-        # tie or better goes to XML
-        $lang = "XML";
-    } else {
-        $lang = "Ant";
-    }
-
-    print "<- Ant_or_XML($lang)\n" if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub Maven_or_XML {                           # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> Maven_or_XML($file)\n" if $opt_v > 2;
-
-    my $lang = "XML";
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $Mvn_points   = 0;
-    my $XML_points   = 1;
-    while (<$IN>) {
-        if (/^\s*<project\s+/) {
-            ++$Mvn_points  ;
-            --$XML_points  ;
-        }
-        if (m{xmlns="http://maven.apache.org/POM/}) {
-            ++$Mvn_points  ;
-            --$XML_points  ;
-        }
-    }
-    $IN->close;
-
-    if ($XML_points >= $Mvn_points) {
-        # tie or better goes to XML
-        $lang = "XML";
-    } else {
-        $lang = "Maven";
-    }
-
-    print "<- Maven_or_XML($lang)\n" if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub pascal_or_puppet {                       # {{{1
-    # Decide if code is Pascal or Puppet manifest
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-        $rs_language , # out
-       ) = @_;
-
-    print "-> pascal_or_puppet\n" if $opt_v > 2;
-
-    ${$rs_language} = "";
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return;
-    }
-
-    my $DEBUG              = 0;
-    my $pascal_points      = 0;
-    my $puppet_points      = 0;
-
-    while (<$IN>) {
-
-        if ( /^\s*\#\s+/ ) {
-                $puppet_points += .001;
-                next;
-        }
-
-        ++$pascal_points if /\bprogram\s+[A-Za-z]/i;
-        ++$pascal_points if /\bunit\s+[A-Za-z]/i;
-        ++$pascal_points if /\bmodule\s+[A-Za-z]/i;
-        ++$pascal_points if /\bprocedure\b/i;
-        ++$pascal_points if /\bfunction\b/i;
-        ++$pascal_points if /^\s*interface\s+/i;
-        ++$pascal_points if /^\s*implementation\s+/i;
-        ++$pascal_points if /^\s*uses\s+/i;
-        ++$pascal_points if /(?<!\:\:)\bbegin\b(?!\:\:)/i;
-        ++$pascal_points if /(?<!\:\:)\bend\b(?!\:\:)/i;
-        ++$pascal_points if /\:\=/;
-        ++$pascal_points if /\<\>/;
-        ++$pascal_points if /^\s*\{\$(I|INCLUDE)\s+.*\}/i;
-        ++$pascal_points if /writeln/;
-
-        ++$puppet_points if /^\s*class\s+/ and not /class\s+operator\s+/;
-        ++$puppet_points if /^\s*case\s+/;
-        ++$puppet_points if /^\s*package\s+/;
-        ++$puppet_points if /^\s*file\s+/;
-        ++$puppet_points if /^\s*include\s\w+/;
-        ++$puppet_points if /^\s*service\s+/;
-        ++$puppet_points if /\s\$\w+\s*\=\s*\S/;
-        ++$puppet_points if /\S\s*\=\>\s*\S/;
-
-        # No need to process rest of file if language seems obvious.
-        last
-                if (abs ($pascal_points - $puppet_points ) > 20 );
-    }
-    $IN->close;
-
-    print "<- pascal_or_puppet(pascal=$pascal_points, puppet=$puppet_points)\n"
-        if $opt_v > 2;
-
-    if ($pascal_points > $puppet_points) {
-        ${$rs_language} = "Pascal";
-    } else {
-        ${$rs_language} = "Puppet";
-    }
-
-} # 1}}}
-sub Forth_or_Fortran {                       # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> Forth_or_Fortran\n" if $opt_v > 2;
-
-    my $lang = undef;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $forth_points = 0;
-    my $fortran_points = 0;
-    while (<$IN>) {
-        ++$forth_points if  /^:\s/;
-        ++$fortran_points if  /^([c*][^a-z]|\s{6,}(subroutine|program|end|implicit)\s|\s*!)/i;
-    }
-    $IN->close;
-    if ($forth_points > $fortran_points) {
-        $lang = "Forth";
-    } else {
-        $lang = "Fortran 77";
-    }
-
-    print "<- Forth_or_Fortran\n" if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub Forth_or_Fsharp {                        # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> Forth_or_Fsharp\n" if $opt_v > 2;
-
-    my $lang = undef;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $forth_points = 0;
-    my $fsharp_points = 0;
-    while (<$IN>) {
-        ++$forth_points if  /^:\s/;
-        ++$fsharp_points if  /^\s*(#light|import|let|module|namespace|open|type)/;
-    }
-    $IN->close;
-    if ($forth_points > $fsharp_points) {
-        $lang = "Forth";
-    } else {
-        $lang = "F#";
-    }
-
-    print "<- Forth_or_Fsharp\n" if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub Verilog_or_Coq {                         # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> Verilog_or_Coq\n" if $opt_v > 2;
-
-    my $lang = undef;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $coq_points     = 0;
-    my $verilog_points = 0;
-    while (<$IN>) {
-        ++$verilog_points if  /^\s*(module|begin|input|output|always)/;
-        ++$coq_points if /\b(Inductive|Fixpoint|Definition|
-                             Theorem|Lemma|Proof|Qed|forall|
-                             Section|Check|Notation|Variable|
-                             Goal|Fail|Require|Scheme|Module|Ltac|
-                             Set|Unset|Parameter|Coercion|Axiom|
-                             Locate|Type|Record|Existing|Class)\b/x;
-    }
-    $IN->close;
-    if ($coq_points > $verilog_points) {
-        $lang = "Coq";
-    } else {
-        $lang = "Verilog-SystemVerilog";
-    }
-
-    print "<- Verilog_or_Coq\n" if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub TypeScript_or_QtLinguist {               # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> TypeScript_or_QtLinguist\n" if $opt_v > 2;
-
-    my $lang = undef;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $tscript_points  = 0;
-    my $linguist_points = 0;
-    while (<$IN>) {
-        ++$linguist_points if m{\b</?(message|source|translation)>};
-        ++$tscript_points  if /^\s*(var|class|document)\b/;
-        ++$tscript_points  if /[;}]\s*$/;
-        ++$tscript_points  if m{^\s*//};
-    }
-    $IN->close;
-    if ($tscript_points > $linguist_points) {
-        $lang = "TypeScript";
-    } else {
-        $lang = "Qt Linguist";
-    }
-    print "<- TypeScript_or_QtLinguist\n" if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub Qt_or_Glade {                            # {{{1
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-
-    print "-> Qt_or_Glade\n" if $opt_v > 2;
-
-    my $lang = undef;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $file];
-        return $lang;
-    }
-    my $qt_points    =  1;
-    my $glade_points = -1;
-    while (<$IN>) {
-        if (/generated\s+with\s+glade/i) {
-            $glade_points =  1;
-            $qt_points    = -1;
-            last;
-        }
-    }
-    $IN->close;
-    if ($glade_points > $qt_points) {
-        $lang = "Glade";
-    } else {
-        $lang = "Qt";
-    }
-    print "<- Qt_or_Glade\n" if $opt_v > 2;
-    return $lang;
-} # 1}}}
-sub html_colored_text {                      # {{{1
-    # http://www.pagetutor.com/pagetutor/makapage/pics/net216-2.gif
-    my ($color, $text) = @_;
-#?#die "html_colored_text($text)";
-    if      ($color =~ /^red$/i)   {
-        $color = "#ff0000";
-    } elsif ($color =~ /^green$/i) {
-        $color = "#00ff00";
-    } elsif ($color =~ /^blue$/i)  {
-        $color = "#0000ff";
-    } elsif ($color =~ /^grey$/i)  {
-        $color = "#cccccc";
-    }
-#   return "" unless $text;
-    return '<font color="' . $color . '">' . html_metachars($text) . "</font>";
-} # 1}}}
-sub xml_metachars {                          # {{{1
-    # http://en.wikipedia.org/wiki/Character_encodings_in_HTML#XML_character_references
-    my ($string, ) = shift @_;
-
-    my  @in_chars    = split(//, $string);
-    my  @out_chars   = ();
-    foreach my $c (@in_chars) {
-        if      ($c eq '&') { push @out_chars, '&amp;'
-        } elsif ($c eq '<') { push @out_chars, '&lt;'
-        } elsif ($c eq '>') { push @out_chars, '&gt;'
-        } elsif ($c eq '"') { push @out_chars, '&quot;'
-        } elsif ($c eq "'") { push @out_chars, '&apos;'
-        } else {
-            push @out_chars, $c;
-        }
-    }
-    return join "", @out_chars;
-} # 1}}}
-sub html_metachars {                         # {{{1
-    # Replace HTML metacharacters with their printable forms.
-    # Future:  use HTML-Encoder-0.00_04/lib/HTML/Encoder.pm
-    # from Fabiano Reese Righetti's HTML::Encoder module if
-    # this subroutine proves to be too simplistic.
-    my ($string, ) = shift @_;
-
-    my  @in_chars    = split(//, $string);
-    my  @out_chars   = ();
-    foreach my $c (@in_chars) {
-        if      ($c eq '<') {
-            push @out_chars, '&lt;'
-        } elsif ($c eq '>') {
-            push @out_chars, '&gt;'
-        } elsif ($c eq '&') {
-            push @out_chars, '&amp;'
-        } else {
-            push @out_chars, $c;
-        }
-    }
-    return join "", @out_chars;
-} # 1}}}
-sub test_alg_diff {                          # {{{1
-    my ($file_1 ,
-        $file_2 )
-       = @_;
-    my $fh_1 = new IO::File $file_1, "r";
-    die "Unable to read $file_1:  $!\n" unless defined $fh_1;
-    chomp(my @lines_1 = <$fh_1>);
-    $fh_1->close;
-
-    my $fh_2 = new IO::File $file_2, "r";
-    die "Unable to read $file_2:  $!\n" unless defined $fh_2;
-    chomp(my @lines_2 = <$fh_2>);
-    $fh_2->close;
-
-    my $n_no_change = 0;
-    my $n_modified  = 0;
-    my $n_added     = 0;
-    my $n_deleted   = 0;
-    my @min_sdiff   = ();
-my $NN = chr(27) . "[0m";  # normal
-my $BB = chr(27) . "[1m";  # bold
-
-    my @sdiffs = sdiff( \@lines_1, \@lines_2 );
-    foreach my $entry (@sdiffs) {
-        my ($out_1, $out_2) = ('', '');
-        if ($entry->[0] eq 'u') {
-            ++$n_no_change;
-          # $out_1 = $entry->[1];
-          # $out_2 = $entry->[2];
-            next;
-        }
-#       push @min_sdiff, $entry;
-        if      ($entry->[0] eq 'c') {
-            ++$n_modified;
-            ($out_1, $out_2) = diff_two_strings($entry->[1], $entry->[2]);
-            $out_1 =~ s/\cA(\w)/${BB}$1${NN}/g;
-            $out_2 =~ s/\cA(\w)/${BB}$1${NN}/g;
-          # $out_1 =~ s/\cA//g;
-          # $out_2 =~ s/\cA//g;
-        } elsif ($entry->[0] eq '+') {
-            ++$n_added;
-            $out_1 = $entry->[1];
-            $out_2 = $entry->[2];
-        } elsif ($entry->[0] eq '-') {
-            ++$n_deleted;
-            $out_1 = $entry->[1];
-            $out_2 = $entry->[2];
-        } elsif ($entry->[0] eq 'u') {
-        } else { die "unknown entry->[0]=[$entry->[0]]\n"; }
-        printf "%-80s | %s\n", $out_1, $out_2;
-    }
-
-#   foreach my $entry (@min_sdiff) {
-#       printf "DIFF:  %s  %s  %s\n", @{$entry};
-#   }
-} # 1}}}
-sub write_comments_to_html {                 # {{{1
-    my ($filename      , # in
-        $rah_diff_L    , # in  see routine array_diff() for explanation
-        $rah_diff_R    , # in  see routine array_diff() for explanation
-        $rh_blank      , # in  location and counts of blank lines
-       ) = @_;
-
-    print "-> write_comments_to_html($filename)\n" if $opt_v > 2;
-    my $file = $filename . ".html";
-#use Data::Dumper;
-#print Dumper("rah_diff_L", $rah_diff_L, "rah_diff_R", $rah_diff_R);
-    my $OUT = new IO::File $file, "w";
-    if (!defined $OUT) {
-        warn "Unable to write to $file\n";
-        print "<- write_comments_to_html\n" if $opt_v > 2;
-        return;
-    }
-
-    my $approx_line_count = scalar @{$rah_diff_L};
-    my $n_digits = 1 + int(log($approx_line_count)/2.30258509299405); # log_10
-
-    my $html_out = html_header($filename);
-
-    my $comment_line_number = 0;
-    for (my $i = 0; $i < scalar @{$rah_diff_R}; $i++) {
-        if (defined $rh_blank->{$i}) {
-            foreach (1..$rh_blank->{$i}) {
-                $html_out .= "<!-- blank -->\n";
-            }
-        }
-        my $line_num = "";
-        my $pre      = "";
-        my $post     = '</span> &nbsp;';
-warn "undef rah_diff_R[$i]{type} " unless defined $rah_diff_R->[$i]{type};
-        if ($rah_diff_R->[$i]{type} eq 'nonexist') {
-            ++$comment_line_number;
-            $line_num = sprintf "\&nbsp; <span class=\"clinenum\"> %0${n_digits}d %s",
-                            $comment_line_number, $post;
-            $pre = '<span class="comment">';
-            $html_out .= $line_num;
-            $html_out .= $pre .
-                         html_metachars($rah_diff_L->[$i]{char}) .
-                         $post . "\n";
-            next;
-        }
-        if      ($rah_diff_R->[$i]{type} eq 'code' and
-                 $rah_diff_R->[$i]{desc} eq 'same') {
-            # entire line remains as-is
-            $line_num = sprintf "\&nbsp; <span class=\"linenum\"> %0${n_digits}d %s",
-                            $rah_diff_R->[$i]{lnum}, $post;
-            $pre    = '<span class="normal">';
-            $html_out .= $line_num;
-            $html_out .= $pre .
-                         html_metachars($rah_diff_R->[$i]{char}) . $post;
-#XX     } elsif ($rah_diff_R->[$i]{type} eq 'code') { # code+comments
-#XX
-#XX         $line_num = '<span class="linenum">' .
-#XX                      $rah_diff_R->[$i]{lnum} . $post;
-#XX         $html_out .= $line_num;
-#XX
-#XX         my @strings = @{$rah_diff_R->[$i]{char}{strings}};
-#XX         my @type    = @{$rah_diff_R->[$i]{char}{type}};
-#XX         for (my $i = 0; $i < scalar @strings; $i++) {
-#XX             if ($type[$i] eq 'u') {
-#XX                 $pre = '<span class="normal">';
-#XX             } else {
-#XX                 $pre = '<span class="comment">';
-#XX             }
-#XX             $html_out .= $pre .  html_metachars($strings[$i]) . $post;
-#XX         }
-# print Dumper(@strings, @type); die;
-
-        } elsif ($rah_diff_R->[$i]{type} eq 'comment') {
-            $line_num = '<span class="clinenum">' . $comment_line_number . $post;
-            # entire line is a comment
-            $pre    = '<span class="comment">';
-            $html_out .= $pre .
-                         html_metachars($rah_diff_R->[$i]{char}) . $post;
-        }
-#printf "%-30s %s %-30s\n", $line_1, $separator, $line_2;
-        $html_out .= "\n";
-    }
-
-    $html_out .= html_end();
-
-    my $out_file = "$filename.html";
-    open  OUT, ">$out_file" or die "Cannot write to $out_file $!\n";
-    print OUT $html_out;
-    close OUT;
-    print "Wrote $out_file\n" unless $opt_quiet;
-    $OUT->close;
-
-    print "<- write_comments_to_html\n" if $opt_v > 2;
-} # 1}}}
-sub array_diff {                             # {{{1
-    my ($file          , # in  only used for error reporting
-        $ra_lines_L    , # in  array of lines in Left  file (no blank lines)
-        $ra_lines_R    , # in  array of lines in Right file (no blank lines)
-        $mode          , # in  "comment" | "revision"
-        $rah_diff_L    , # out
-        $rah_diff_R    , # out
-        $raa_Errors    , # in/out
-       ) = @_;
-
-    # This routine operates in two ways:
-    # A. Computes diffs of the same file with and without comments.
-    #    This is used to classify lines as code, comments, or blank.
-    # B. Computes diffs of two revisions of a file.  This method
-    #    requires a prior run of method A using the older version
-    #    of the file because it needs lines to be classified.
-
-    # $rah_diff structure:
-    # An array with n entries where n equals the number of lines in
-    # an sdiff of the two files.  Each entry in the array describes
-    # the contents of the corresponding line in file Left and file Right:
-    #  diff[]{type} = blank | code | code+comment | comment | nonexist
-    #        {lnum} = line number within the original file (1-based)
-    #        {desc} = same | added | removed | modified
-    #        {char} = the input line unless {desc} = 'modified' in
-    #                 which case
-    #        {char}{strings} = [ substrings ]
-    #        {char}{type}    = [ disposition (added, removed, etc)]
-    #
-
-    @{$rah_diff_L} = ();
-    @{$rah_diff_R} = ();
-
-    print "-> array_diff()\n" if $opt_v > 2;
-    my $COMMENT_MODE = 0;
-       $COMMENT_MODE = 1 if $mode eq "comment";
-
-#print "array_diff(mode=$mode)\n";
-#print Dumper("block left:" , $ra_lines_L);
-#print Dumper("block right:", $ra_lines_R);
-
-    my @sdiffs = ();
-    eval {
-        local $SIG{ALRM} = sub { die "alarm\n" };
-        alarm $opt_diff_timeout;
-        @sdiffs = sdiff($ra_lines_L, $ra_lines_R);
-        alarm 0;
-    };
-    if ($@) {
-        # timed out
-        die unless $@ eq "alarm\n"; # propagate unexpected errors
-        push @{$raa_Errors},
-             [ $Error_Codes{'Diff error, exceeded timeout'}, $file ];
-        if ($opt_v) {
-          warn "array_diff: diff timeout failure for $file--ignoring\n";
-        }
-        return;
-    }
-
-#use Data::Dumper::Simple;
-#print Dumper($ra_lines_L, $ra_lines_R, @sdiffs);
-#die;
-
-    my $n_L        = 0;
-    my $n_R        = 0;
-    my $n_sdiff    = 0;  # index to $rah_diff_L, $rah_diff_R
-    foreach my $triple (@sdiffs) {
-        my $flag   = $triple->[0];
-        my $line_L = $triple->[1];
-        my $line_R = $triple->[2];
-        $rah_diff_L->[$n_sdiff]{char} = $line_L;
-        $rah_diff_R->[$n_sdiff]{char} = $line_R;
-        if      ($flag eq 'u') {  # u = unchanged
-            ++$n_L;
-            ++$n_R;
-            if ($COMMENT_MODE) {
-                # line exists in both with & without comments, must be code
-                $rah_diff_L->[$n_sdiff]{type} = "code";
-                $rah_diff_R->[$n_sdiff]{type} = "code";
-            }
-            $rah_diff_L->[$n_sdiff]{desc} = "same";
-            $rah_diff_R->[$n_sdiff]{desc} = "same";
-            $rah_diff_L->[$n_sdiff]{lnum} = $n_L;
-            $rah_diff_R->[$n_sdiff]{lnum} = $n_R;
-        } elsif ($flag eq 'c') {  # c = changed
-# warn "per line sdiff() commented out\n"; if (0) {
-            ++$n_L;
-            ++$n_R;
-
-            if ($COMMENT_MODE) {
-                # line has text both with & without comments;
-                # count as code
-                $rah_diff_L->[$n_sdiff]{type} = "code";
-                $rah_diff_R->[$n_sdiff]{type} = "code";
-            }
-
-            my @chars_L = split '', $line_L;
-            my @chars_R = split '', $line_R;
-
-#XX         my @inline_sdiffs = sdiff( \@chars_L, \@chars_R );
-
-#use Data::Dumper::Simple;
-#if ($n_R == 6 or $n_R == 1 or $n_R == 2) {
-#print "L=[$line_L]\n";
-#print "R=[$line_R]\n";
-#print Dumper(@chars_L, @chars_R, @inline_sdiffs);
-#}
-#XX         my @index = ();
-#XX         foreach my $il_triple (@inline_sdiffs) {
-#XX             # make an array of u|c|+|- corresponding
-#XX             # to each character
-#XX             push @index, $il_triple->[0];
-#XX         }
-#XX#print Dumper(@index); die;
-#XX          # expect problems if arrays @index and $inline_sdiffs[1];
-#XX          # (@{$inline_sdiffs->[1]} are the characters of line_L)
-#XX          # aren't the same length
-#XX          my $prev_type = $index[0];
-#XX          my @strings   = ();  # blocks of consecutive code or comment
-#XX          my @type      = ();  # u (=code) or c (=comment)
-#XX          my $j_str     = 0;
-#XX          $strings[$j_str] .= $chars_L[0];
-#XX          $type[$j_str] = $prev_type;
-#XX          for (my $i = 1; $i < scalar @chars_L; $i++) {
-#XX              if ($index[$i] ne $prev_type) {
-#XX                  ++$j_str;
-#XX#print "change at j_str=$j_str type=$index[$i]\n";
-#XX                  $type[$j_str] = $index[$i];
-#XX                  $prev_type    = $index[$i];
-#XX              }
-#XX              $strings[$j_str] .= $chars_L[$i];
-#XX          }
-# print Dumper(@strings, @type); die;
-#XX         delete $rah_diff_R->[$n_sdiff]{char};
-#XX         @{$rah_diff_R->[$n_sdiff]{char}{strings}} = @strings;
-#XX         @{$rah_diff_R->[$n_sdiff]{char}{type}}    = @type;
-            $rah_diff_L->[$n_sdiff]{desc} = "modified";
-            $rah_diff_R->[$n_sdiff]{desc} = "modified";
-            $rah_diff_L->[$n_sdiff]{lnum} = $n_L;
-            $rah_diff_R->[$n_sdiff]{lnum} = $n_R;
-#}
-
-        } elsif ($flag eq '+') {  # + = added
-            ++$n_R;
-            if ($COMMENT_MODE) {
-                # should never get here
-                @{$rah_diff_L} = ();
-                @{$rah_diff_R} = ();
-                push @{$raa_Errors},
-                     [ $Error_Codes{'Diff error (quoted comments?)'}, $file ];
-                if ($opt_v) {
-                  warn "array_diff: diff failure (diff says the\n";
-                  warn "comment-free file has added lines).\n";
-                  warn "$n_sdiff  $line_L\n";
-                }
-                last;
-            }
-            $rah_diff_L->[$n_sdiff]{type} = "nonexist";
-            $rah_diff_L->[$n_sdiff]{desc} = "removed";
-            $rah_diff_R->[$n_sdiff]{desc} = "added";
-            $rah_diff_R->[$n_sdiff]{lnum} = $n_R;
-        } elsif ($flag eq '-') {  # - = removed
-            ++$n_L;
-            if ($COMMENT_MODE) {
-                # line must be comment because blanks already gone
-                $rah_diff_L->[$n_sdiff]{type} = "comment";
-            }
-            $rah_diff_R->[$n_sdiff]{type} = "nonexist";
-            $rah_diff_R->[$n_sdiff]{desc} = "removed";
-            $rah_diff_L->[$n_sdiff]{desc} = "added";
-            $rah_diff_L->[$n_sdiff]{lnum} = $n_L;
-        }
-#printf "%-30s %s %-30s\n", $line_L, $separator, $line_R;
-        ++$n_sdiff;
-    }
-#use Data::Dumper::Simple;
-#print Dumper($rah_diff_L, $rah_diff_R);
-
-    print "<- array_diff\n" if $opt_v > 2;
-} # 1}}}
-sub remove_leading_dir {                     # {{{1
-    my @filenames = @_;
-    #
-    #  Input should be a list of file names
-    #  with the same leading directory such as
-    #
-    #      dir1/dir2/a.txt
-    #      dir1/dir2/b.txt
-    #      dir1/dir2/dir3/c.txt
-    #
-    #  Output is the same list minus the common
-    #  directory path:
-    #
-    #      a.txt
-    #      b.txt
-    #      dir3/c.txt
-    #
-    print "-> remove_leading_dir()\n" if $opt_v > 2;
-    my @D = (); # a matrix:   [ [ dir1, dir2 ],         # dir1/dir2/a.txt
-                #               [ dir1, dir2 ],         # dir1/dir2/b.txt
-                #               [ dir1, dir2 , dir3] ]  # dir1/dir2/dir3/c.txt
-    if ($ON_WINDOWS) {
-        foreach my $F (@filenames) {
-            $F =~ s{\\}{/}g;
-            $F = ucfirst($F) if $F =~ /^\w:/;  # uppercase drive letter
-        }
-    }
-    if (scalar @filenames == 1) {
-        # special case:  with only one filename
-        # cannot determine a baseline, just remove first directory level
-        $filenames[0] =~ s{^.*?/}{};
-        # print "-> $filenames[0]\n";
-        return $filenames[0];
-    }
-    foreach my $F (@filenames) {
-        my ($Vol, $Dir, $File) = File::Spec->splitpath($F);
-        my @x = File::Spec->splitdir( $Dir );
-        pop @x unless $x[$#x]; # last entry usually null, remove it
-        if ($ON_WINDOWS) {
-            if (defined($Vol) and $Vol) {
-                # put the drive letter, eg, C:, at the front
-                unshift @x, uc $Vol;
-            }
-        }
-#print "F=$F, Dir=$Dir  x=[", join("][", @x), "]\n";
-        push @D, [ @x ];
-    }
-
-    # now loop over columns until either they are all
-    # eliminated or a unique column is found
-
-#use Data::Dumper::Simple;
-#print Dumper("remove_leading_dir after ", @D);
-
-    my @common   = ();  # to contain the common leading directories
-    my $mismatch = 0;
-    while (!$mismatch) {
-        for (my $row = 1; $row < scalar @D; $row++) {
-#print "comparing $D[$row][0] to $D[0][0]\n";
-
-            if (!defined $D[$row][0] or !defined $D[0][0] or
-                ($D[$row][0] ne $D[0][0])) {
-                $mismatch = 1;
-                last;
-            }
-        }
-#print "mismatch=$mismatch\n";
-        if (!$mismatch) {
-            push @common, $D[0][0];
-            # all terms in the leading match; unshift the batch
-            foreach my $ra (@D) {
-                shift @{$ra};
-            }
-        }
-    }
-
-    push @common, " ";  # so that $leading will end with "/ "
-    my $leading = File::Spec->catdir( @common );
-       $leading =~ s{ $}{};  # now take back the bogus appended space
-#print "remove_leading_dir leading=[$leading]\n"; die;
-    if ($ON_WINDOWS) {
-       $leading =~ s{\\}{/}g;
-    }
-    foreach my $F (@filenames) {
-        $F =~ s{^$leading}{};
-    }
-
-    print "<- remove_leading_dir()\n" if $opt_v > 2;
-    return @filenames;
-
-} # 1}}}
-sub strip_leading_dir {                      # {{{1
-    my ($leading, @filenames) = @_;
-    #  removes the string $leading from each entry in @filenames
-    print "-> strip_leading_dir()\n" if $opt_v > 2;
-
-#print "remove_leading_dir leading=[$leading]\n"; die;
-    if ($ON_WINDOWS) {
-       $leading =~ s{\\}{/}g;
-        foreach my $F (@filenames) {
-            $F =~ s{\\}{/}g;
-        }
-    }
-    foreach my $F (@filenames) {
-        $F =~ s{^$leading}{};
-    }
-
-    print "<- strip_leading_dir()\n" if $opt_v > 2;
-    return @filenames;
-
-} # 1}}}
-sub find_deepest_file {                      # {{{1
-    my @filenames = @_;
-    #
-    #  Input should be a list of file names
-    #  with the same leading directory such as
-    #
-    #      dir1/dir2/a.txt
-    #      dir1/dir2/b.txt
-    #      dir1/dir2/dir3/c.txt
-    #
-    #  Output is the file with the most parent directories:
-    #
-    #      dir1/dir2/dir3/c.txt
-
-    print "-> find_deepest_file()\n" if $opt_v > 2;
-
-    my $deepest    = undef;
-    my $max_subdir = -1;
-    foreach my $F (sort @filenames) {
-        my ($Vol, $Dir, $File) = File::Spec->splitpath($F);
-        my @x = File::Spec->splitdir( $Dir );
-        pop @x unless $x[$#x]; # last entry usually null, remove it
-        if (scalar @x > $max_subdir) {
-            $deepest    = $F;
-            $max_subdir = scalar @x;
-        }
-    }
-
-    print "<- find_deepest_file()\n" if $opt_v > 2;
-    return $deepest;
-
-} # 1}}}
-sub find_uncommon_parent_dir {               # {{{1
-    my ($file_L, $file_R) = @_;
-    #
-    # example:
-    #
-    #   file_L = "perl-5.16.1/cpan/CPANPLUS/lib/CPANPLUS/Internals/Source/SQLite/Tie.pm"
-    #   file_R = "/tmp/8VxQG0OLbp/perl-5.16.3/cpan/CPANPLUS/lib/CPANPLUS/Internals/Source/SQLite/Tie.pm"
-    #
-    # then return
-    #
-    #   "perl-5.16.1",
-    #   "/tmp/8VxQG0OLbp/perl-5.16.3",
-
-    my ($Vol_L, $Dir_L, $File_L) = File::Spec->splitpath($file_L);
-    my @x_L = File::Spec->splitdir( $Dir_L );
-    my ($Vol_R, $Dir_R, $File_R) = File::Spec->splitpath($file_R);
-    my @x_R = File::Spec->splitdir( $Dir_R );
-
-    my @common  = ();
-
-    # work backwards
-    while ($x_L[$#x_L] eq $x_R[$#x_R]) {
-        push @common, $x_L[$#x_L];
-        pop  @x_L;
-        pop  @x_R;
-    }
-    my $success = scalar @common;
-
-    my $dirs_L = File::Spec->catdir( @x_L );
-    my $dirs_R = File::Spec->catdir( @x_R );
-    my $lead_L = File::Spec->catpath( $Vol_L, $dirs_L, "" );
-    my $lead_R = File::Spec->catpath( $Vol_R, $dirs_R, "" );
-
-    return $lead_L, $lead_R, $success;
-
-} # 1}}}
-sub get_leading_dirs {                       # {{{1
-    my ($rh_file_list_L, $rh_file_list_R) = @_;
-    # find uniquely named files in both sets to help determine the
-    # leading directory positions
-    my %unique_filename = ();
-    my %basename_L = ();
-    my %basename_R = ();
-    foreach my $f (keys %{$rh_file_list_L}) {
-        my $bn = basename($f);
-        $basename_L{ $bn }{'count'}   += 1;
-        $basename_L{ $bn }{'fullpath'} = $f;
-    }
-    foreach my $f (keys %{$rh_file_list_R}) {
-        my $bn = basename($f);
-        $basename_R{ $bn }{'count'}   += 1;
-        $basename_R{ $bn }{'fullpath'} = $f;
-    }
-    foreach my $f (keys %basename_L) {
-        next unless $basename_L{$f}{'count'} == 1;
-        next unless defined $basename_R{$f} and $basename_R{$f}{'count'} == 1;
-        $unique_filename{$f}{'L'} = $basename_L{ $f }{'fullpath'};
-        $unique_filename{$f}{'R'} = $basename_R{ $f }{'fullpath'};
-    }
-    return undef, undef, 0 unless %unique_filename;
-
-    my %candidate_leading_dir_L = ();
-    my %candidate_leading_dir_R = ();
-    foreach my $f (keys %unique_filename) {
-        my $fL = $unique_filename{ $f }{'L'};
-        my $fR = $unique_filename{ $f }{'R'};
-#printf "%-36s -> %-36s\n", $fL, $fR;
-        my $ptr_L = length($fL) - 1;
-        my $ptr_R = length($fR) - 1;
-        my @aL    = split '', $fL;
-        my @aR    = split '', $fR;
-        while ($ptr_L >= 0 and $ptr_R >= 0) {
-            last if $aL[$ptr_L] ne $aR[$ptr_R];
-            --$ptr_L;
-            --$ptr_R;
-        }
-#print "ptr_L=$ptr_L   ptr_R=$ptr_R\n";
-        my $leading_dir_L = "";
-           $leading_dir_L = substr($fL, 0, $ptr_L+1) if $ptr_L >= 0;
-        my $leading_dir_R = "";
-           $leading_dir_R = substr($fR, 0, $ptr_R+1) if $ptr_R >= 0;
-#print "leading_dir_L=$leading_dir_L   leading_dir_R=$leading_dir_R\n";
-        ++$candidate_leading_dir_L{$leading_dir_L};
-        ++$candidate_leading_dir_R{$leading_dir_R};
-    }
-#use Data::Dumper::Simple;
-#print Dumper(%candidate_leading_dir_L);
-#print Dumper(%candidate_leading_dir_R);
-#die;
-    my $best_L = (sort {
-               $candidate_leading_dir_L{$b} <=>
-               $candidate_leading_dir_L{$a}} keys %candidate_leading_dir_L)[0];
-    my $best_R = (sort {
-               $candidate_leading_dir_R{$b} <=>
-               $candidate_leading_dir_R{$a}} keys %candidate_leading_dir_R)[0];
-    return $best_L, $best_R, 1;
-} # 1}}}
-sub align_by_pairs {                         # {{{1
-    my ($rh_file_list_L        , # in
-        $rh_file_list_R        , # in
-        $ra_added              , # out
-        $ra_removed            , # out
-        $ra_compare_list       , # out
-        ) = @_;
-    print "-> align_by_pairs()\n" if $opt_v > 2;
-    @{$ra_compare_list} = ();
-
-    my @files_L = sort keys %{$rh_file_list_L};
-    my @files_R = sort keys %{$rh_file_list_R};
-    return () unless @files_L or  @files_R;  # at least one must have stuff
-    if      ( @files_L and !@files_R) {
-        # left side has stuff, right side is empty; everything deleted
-        @{$ra_added   }     = ();
-        @{$ra_removed }     = @files_L;
-        @{$ra_compare_list} = ();
-        return;
-    } elsif (!@files_L and  @files_R) {
-        # left side is empty, right side has stuff; everything added
-        @{$ra_added   }     = @files_R;
-        @{$ra_removed }     = ();
-        @{$ra_compare_list} = ();
-        return;
-    }
-#use Data::Dumper::Simple;
-#print Dumper("align_by_pairs", %{$rh_file_list_L}, %{$rh_file_list_R},);
-#die;
-    if (scalar @files_L == 1 and scalar @files_R == 1) {
-        # The easy case:  compare two files.
-        push @{$ra_compare_list}, [ $files_L[0],  $files_R[0] ];
-        @{$ra_added  } = ();
-        @{$ra_removed} = ();
-        return;
-    }
-    # The harder case:  compare groups of files.  This only works
-    # if the groups are in different directories so the first step
-    # is to strip the leading directory names from file lists to
-    # make it possible to align by file names.
-    my @files_L_minus_dir = undef;
-    my @files_R_minus_dir = undef;
-
-    my $deepest_file_L    = find_deepest_file(@files_L);
-    my $deepest_file_R    = find_deepest_file(@files_R);
-#print "deepest L = [$deepest_file_L]\n";
-#print "deepest R = [$deepest_file_R]\n";
-####my ($leading_dir_L, $leading_dir_R, $success) =
-####    find_uncommon_parent_dir($deepest_file_L, $deepest_file_R);
-    my ($leading_dir_L, $leading_dir_R, $success) =
-                get_leading_dirs($rh_file_list_L, $rh_file_list_R);
-#print "leading_dir_L=[$leading_dir_L]\n";
-#print "leading_dir_R=[$leading_dir_R]\n";
-#print "success      =[$success]\n";
-    if ($success) {
-        @files_L_minus_dir = strip_leading_dir($leading_dir_L, @files_L);
-        @files_R_minus_dir = strip_leading_dir($leading_dir_R, @files_R);
-    } else {
-        # otherwise fall back to old strategy
-        @files_L_minus_dir = remove_leading_dir(@files_L);
-        @files_R_minus_dir = remove_leading_dir(@files_R);
-    }
-
-    # Keys of the stripped_X arrays are canonical file names;
-    # should overlap mostly.  Keys in stripped_L but not in
-    # stripped_R are files that have been deleted.  Keys in
-    # stripped_R but not in stripped_L have been added.
-    my %stripped_L = ();
-       @stripped_L{ @files_L_minus_dir } = @files_L;
-    my %stripped_R = ();
-       @stripped_R{ @files_R_minus_dir } = @files_R;
-
-    my %common = ();
-    foreach my $f (keys %stripped_L) {
-        $common{$f}  = 1 if     defined $stripped_R{$f};
-    }
-
-    my %deleted = ();
-    foreach my $f (keys %stripped_L) {
-        $deleted{$stripped_L{$f}} = $f unless defined $stripped_R{$f};
-    }
-
-    my %added = ();
-    foreach my $f (keys %stripped_R) {
-        $added{$stripped_R{$f}}   = $f unless defined $stripped_L{$f};
-    }
-
-#use Data::Dumper::Simple;
-#print Dumper("align_by_pairs", %stripped_L, %stripped_R);
-#print Dumper("align_by_pairs", %common, %added, %deleted);
-
-    foreach my $f (keys %common) {
-        push @{$ra_compare_list}, [ $stripped_L{$f},
-                                    $stripped_R{$f} ];
-    }
-    @{$ra_added   } = keys %added  ;
-    @{$ra_removed } = keys %deleted;
-
-    print "<- align_by_pairs()\n" if $opt_v > 2;
-    return;
-#print Dumper("align_by_pairs", @files_L_minus_dir, @files_R_minus_dir);
-#die;
-} # 1}}}
-sub html_header {                            # {{{1
-    my ($title , ) = @_;
-
-    print "-> html_header\n" if $opt_v > 2;
-    return
-'<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="GENERATOR" content="cloc http://cloc.sourceforge.net">
-' .
-"
-<!-- Created by $script v$VERSION -->
-<title>$title</title>
-" .
-'
-<style TYPE="text/css">
-<!--
-    body {
-        color: black;
-        background-color: white;
-        font-family: monospace
-    }
-
-    .whitespace {
-        background-color: gray;
-    }
-
-    .comment {
-        color: gray;
-        font-style: italic;
-    }
-
-    .clinenum {
-        color: red;
-    }
-
-    .linenum {
-        color: green;
-    }
- -->
-</style>
-</head>
-<body>
-<pre><tt>
-';
-    print "<- html_header\n" if $opt_v > 2;
-} # 1}}}
-sub html_end {                               # {{{1
-return
-'</tt></pre>
-</body>
-</html>
-';
-} # 1}}}
-sub die_unknown_lang {                       # {{{1
-    my ($lang, $option_name) = @_;
-    die "Unknown language '$lang' used with $option_name option.  " .
-        "The command\n  $script --show-lang\n" .
-        "will print all recognized languages.  Language names are " .
-        "case sensitive.\n" ;
-} # 1}}}
-sub unicode_file {                           # {{{1
-    my $file = shift @_;
-
-    print "-> unicode_file($file)\n" if $opt_v > 2;
-    return 0 if (-s $file > 2_000_000);
-    # don't bother trying to test binary files bigger than 2 MB
-
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        warn "Unable to read $file; ignoring.\n";
-        return 0;
-    }
-    my @lines = <$IN>;
-    $IN->close;
-
-    if (unicode_to_ascii( join('', @lines) )) {
-        print "<- unicode_file()\n" if $opt_v > 2;
-        return 1;
-    } else {
-        print "<- unicode_file()\n" if $opt_v > 2;
-        return 0;
-    }
-
-} # 1}}}
-sub unicode_to_ascii {                       # {{{1
-    my $string = shift @_;
-
-    # A trivial attempt to convert UTF-16 little or big endian
-    # files into ASCII.  These files exhibit the following byte
-    # sequence:
-    #   byte   1:  255
-    #   byte   2:  254
-    #   byte   3:  ord of ASCII character
-    #   byte   4:    0
-    #   byte 3+i:  ord of ASCII character
-    #   byte 4+i:    0
-    # or
-    #   byte   1:  255
-    #   byte   2:  254
-    #   byte   3:    0
-    #   byte   4:  ord of ASCII character
-    #   byte 3+i:    0
-    #   byte 4+i:  ord of ASCII character
-
-    my $length  = length $string;
-#print "length=$length\n";
-    return '' if $length <= 3;
-    my @unicode = split(//, $string);
-
-    # check the first 100 characters for big or little endian UTF-16 encoding
-    my $max_peek = $length < 200 ? $length : 200;
-    my @view_1   = ();
-    for (my $i = 2; $i < $max_peek; $i += 2) { push @view_1, $unicode[$i] }
-    my @view_2   = ();
-    for (my $i = 3; $i < $max_peek; $i += 2) { push @view_2, $unicode[$i] }
-
-    my $points_1 = 0;
-    foreach my $C (@view_1) {
-        ++$points_1 if (32 <= ord($C) and ord($C) <= 127) or ord($C) == 13
-                                                          or ord($C) == 10
-                                                          or ord($C) ==  9;
-    }
-
-    my $points_2 = 0;
-    foreach my $C (@view_2) {
-        ++$points_2 if (32 <= ord($C) and ord($C) <= 127) or ord($C) == 13
-                                                          or ord($C) == 10
-                                                          or ord($C) ==  9;
-    }
-#print "points 1: $points_1\n";
-#print "points 2: $points_2\n";
-
-    my $offset = undef;
-    if    ($points_1 > 90) { $offset = 2; }
-    elsif ($points_2 > 90) { $offset = 3; }
-    else                   { return '' }  # neither big or little endian UTF-16
-
-    my @ascii              = ();
-    for (my $i = $offset; $i < $length; $i += 2) { push @ascii, $unicode[$i]; }
-    return join("", @ascii);
-} # 1}}}
-sub uncompress_archive_cmd {                 # {{{1
-    my ($archive_file, ) = @_;
-
-    # Wrap $archive_file in single or double quotes in the system
-    # commands below to avoid filename chicanery (including
-    # spaces in the names).
-
-    print "-> uncompress_archive_cmd($archive_file)\n" if $opt_v > 2;
-    my $extract_cmd = "";
-    my $missing     = "";
-    if ($opt_extract_with) {
-        ( $extract_cmd = $opt_extract_with ) =~ s/>FILE</$archive_file/g;
-    } elsif (basename($archive_file) eq "-" and !$ON_WINDOWS) {
-        $extract_cmd = "cat > -";
-    } elsif (($archive_file =~ /\.tar\.(gz|Z)$/ or
-              $archive_file =~ /\.tgz$/       ) and !$ON_WINDOWS)    {
-        if (external_utility_exists("gzip --version")) {
-            if (external_utility_exists("tar --version")) {
-                $extract_cmd = "gzip -dc '$archive_file' | tar xf -";
-            } else {
-                $missing = "tar";
-            }
-        } else {
-            $missing = "gzip";
-        }
-    } elsif ($archive_file =~ /\.tar\.bz2$/ and !$ON_WINDOWS)    {
-        if (external_utility_exists("bzip2 --help")) {
-            if (external_utility_exists("tar --version")) {
-                $extract_cmd = "bzip2 -dc '$archive_file' | tar xf -";
-            } else {
-                $missing = "tar";
-            }
-        } else {
-            $missing = "bzip2";
-        }
-    } elsif ($archive_file =~ /\.tar\.xz$/ and !$ON_WINDOWS)    {
-        if (external_utility_exists("unxz --version")) {
-            if (external_utility_exists("tar --version")) {
-                $extract_cmd = "unxz -dc '$archive_file' | tar xf -";
-            } else {
-                $missing = "tar";
-            }
-        } else {
-            $missing = "bzip2";
-        }
-    } elsif ($archive_file =~ /\.tar$/ and !$ON_WINDOWS)    {
-        $extract_cmd = "tar xf '$archive_file'";
-    } elsif ($archive_file =~ /\.src\.rpm$/i and !$ON_WINDOWS) {
-        if (external_utility_exists("cpio --version")) {
-            if (external_utility_exists("rpm2cpio")) {
-                $extract_cmd = "rpm2cpio '$archive_file' | cpio -i";
-            } else {
-                $missing = "rpm2cpio";
-            }
-        } else {
-            $missing = "bzip2";
-        }
-    } elsif ($archive_file =~ /\.zip$/i and !$ON_WINDOWS)    {
-        if (external_utility_exists("unzip")) {
-            $extract_cmd = "unzip -qq -d . '$archive_file'";
-        } else {
-            $missing = "unzip";
-        }
-    } elsif ($archive_file =~ /\.deb$/i and !$ON_WINDOWS)    {
-        # only useful if the .deb contains source code--most
-        # .deb files just have compiled executables
-        if (external_utility_exists("dpkg-deb")) {
-            $extract_cmd = "dpkg-deb -x '$archive_file' .";
-        } else {
-            $missing = "dpkg-deb";
-        }
-    } elsif ($ON_WINDOWS and $archive_file =~ /\.zip$/i) {
-        # zip on Windows, guess default Winzip install location
-        $extract_cmd = "";
-        my $WinZip = '"C:\\Program Files\\WinZip\\WinZip32.exe"';
-        if (external_utility_exists($WinZip)) {
-            $extract_cmd = "$WinZip -e -o \"$archive_file\" .";
-#print "trace 5 extract_cmd=[$extract_cmd]\n";
-        } else {
-#print "trace 6\n";
-            $missing = $WinZip;
-        }
-    }
-    print "<- uncompress_archive_cmd\n" if $opt_v > 2;
-    if ($missing) {
-        die "Unable to expand $archive_file because external\n",
-            "utility '$missing' is not available.\n",
-            "Another possibility is to use the --extract-with option.\n";
-    } else {
-        return $extract_cmd;
-    }
-}
-# 1}}}
-sub read_list_file {                         # {{{1
-    my ($file, ) = @_;
-
-    print "-> read_list_file($file)\n" if $opt_v > 2;
-    my $IN = new IO::File $file, "r";
-    if (!defined $IN) {
-        warn "Unable to read $file; ignoring.\n";
-        return ();
-    }
-    my @entry = ();
-    while (<$IN>) {
-        next if /^\s*$/ or /^\s*#/; # skip empty or commented lines
-        s/\cM$//;  # DOS to Unix
-        chomp;
-        push @entry, $_;
-    }
-    $IN->close;
-
-    print "<- read_list_file\n" if $opt_v > 2;
-    return @entry;
-}
-# 1}}}
-sub external_utility_exists {                # {{{1
-    my $exe = shift @_;
-
-    my $success      = 0;
-    if ($ON_WINDOWS) {
-        $success = 1 unless system $exe . ' > nul';
-    } else {
-        $success = 1 unless system $exe . ' >/dev/null 2>&1';
-        if (!$success) {
-            $success = 1 unless system "which" . " $exe" . ' >/dev/null 2>&1';
-        }
-    }
-
-    return $success;
-} # 1}}}
-sub write_xsl_file {                         # {{{1
-    my $OUT = new IO::File $CLOC_XSL, "w";
-    if (!defined $OUT) {
-        warn "Unable to write $CLOC_XSL  $!\n";
-        return;
-    }
-    my $XSL =             # <style>  </style> {{{2
-'<?xml version="1.0" encoding="US-ASCII"?>
-<!-- XLS file by Paul Schwann, January 2009.
-     Fixes for by-file and by-file-by-lang by d_uragan, November 2010.
-     -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-  <xsl:output method="html"/>
-  <xsl:template match="/">
-    <html xmlns="http://www.w3.org/1999/xhtml">
-      <head>
-        <title>CLOC Results</title>
-      </head>
-      <style type="text/css">
-        table {
-          table-layout: auto;
-          border-collapse: collapse;
-          empty-cells: show;
-        }
-        td, th {
-          padding: 4px;
-        }
-        th {
-          background-color: #CCCCCC;
-        }
-        td {
-          text-align: center;
-        }
-        table, td, tr, th {
-          border: thin solid #999999;
-        }
-      </style>
-      <body>
-        <h3><xsl:value-of select="results/header"/></h3>
-';
-# 2}}}
-
-    if ($opt_by_file) {
-        $XSL .=             # <table> </table>{{{2
-'        <table>
-          <thead>
-            <tr>
-              <th>File</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-              <th>Language</th>
-';
-        $XSL .=
-'             <th>3<sup>rd</sup> Generation Equivalent</th>
-              <th>Scale</th>
-' if $opt_3;
-        $XSL .=
-'           </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="results/files/file">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-              <td><xsl:value-of select="@language"/></td>
-';
-        $XSL .=
-'             <td><xsl:value-of select="@factor"/></td>
-              <td><xsl:value-of select="@scaled"/></td>
-' if $opt_3;
-        $XSL .=
-'           </tr>
-          </xsl:for-each>
-            <tr>
-              <th>Total</th>
-              <th><xsl:value-of select="results/files/total/@blank"/></th>
-              <th><xsl:value-of select="results/files/total/@comment"/></th>
-              <th><xsl:value-of select="results/files/total/@code"/></th>
-              <th><xsl:value-of select="results/files/total/@language"/></th>
-';
-        $XSL .=
-'             <th><xsl:value-of select="results/files/total/@factor"/></th>
-              <th><xsl:value-of select="results/files/total/@scaled"/></th>
-' if $opt_3;
-        $XSL .=
-'           </tr>
-          </tbody>
-        </table>
-        <br/>
-';
-# 2}}}
-    }
-
-    if (!$opt_by_file or $opt_by_file_by_lang) {
-        $XSL .=             # <table> </table> {{{2
-'       <table>
-          <thead>
-            <tr>
-              <th>Language</th>
-              <th>Files</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-';
-        $XSL .=
-'             <th>Scale</th>
-              <th>3<sup>rd</sup> Generation Equivalent</th>
-' if $opt_3;
-        $XSL .=
-'           </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="results/languages/language">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@files_count"/></td>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-';
-        $XSL .=
-'             <td><xsl:value-of select="@factor"/></td>
-              <td><xsl:value-of select="@scaled"/></td>
-' if $opt_3;
-        $XSL .=
-'          </tr>
-          </xsl:for-each>
-            <tr>
-              <th>Total</th>
-              <th><xsl:value-of select="results/languages/total/@sum_files"/></th>
-              <th><xsl:value-of select="results/languages/total/@blank"/></th>
-              <th><xsl:value-of select="results/languages/total/@comment"/></th>
-              <th><xsl:value-of select="results/languages/total/@code"/></th>
-';
-        $XSL .=
-'             <th><xsl:value-of select="results/languages/total/@factor"/></th>
-              <th><xsl:value-of select="results/languages/total/@scaled"/></th>
-' if $opt_3;
-        $XSL .=
-'           </tr>
-          </tbody>
-        </table>
-';
-# 2}}}
-    }
-
-    $XSL.= <<'EO_XSL'; # {{{2
-      </body>
-    </html>
-  </xsl:template>
-</xsl:stylesheet>
-
-EO_XSL
-# 2}}}
-
-    my $XSL_DIFF = <<'EO_DIFF_XSL'; # {{{2
-<?xml version="1.0" encoding="US-ASCII"?>
-<!-- XLS file by Blazej Kroll, November 2010 -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-  <xsl:output method="html"/>
-  <xsl:template match="/">
-    <html xmlns="http://www.w3.org/1999/xhtml">
-      <head>
-        <title>CLOC Results</title>
-      </head>
-      <style type="text/css">
-        table {
-          table-layout: auto;
-          border-collapse: collapse;
-          empty-cells: show;
-          margin: 1em;
-        }
-        td, th {
-          padding: 4px;
-        }
-        th {
-          background-color: #CCCCCC;
-        }
-        td {
-          text-align: center;
-        }
-        table, td, tr, th {
-          border: thin solid #999999;
-        }
-      </style>
-      <body>
-        <h3><xsl:value-of select="results/header"/></h3>
-EO_DIFF_XSL
-# 2}}}
-
-    if ($opt_by_file) {
-        $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2
-        <table>
-          <thead>
-          <tr><th colspan="4">Same</th>
-          </tr>
-            <tr>
-              <th>File</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-            </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="diff_results/same/file">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-            </tr>
-          </xsl:for-each>
-          </tbody>
-        </table>
-
-        <table>
-          <thead>
-          <tr><th colspan="4">Modified</th>
-          </tr>
-            <tr>
-              <th>File</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-            </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="diff_results/modified/file">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-            </tr>
-          </xsl:for-each>
-          </tbody>
-        </table>
-
-        <table>
-          <thead>
-          <tr><th colspan="4">Added</th>
-          </tr>
-            <tr>
-              <th>File</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-            </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="diff_results/added/file">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-            </tr>
-          </xsl:for-each>
-          </tbody>
-        </table>
-
-        <table>
-          <thead>
-          <tr><th colspan="4">Removed</th>
-          </tr>
-            <tr>
-              <th>File</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-            </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="diff_results/removed/file">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-            </tr>
-          </xsl:for-each>
-          </tbody>
-        </table>
-EO_DIFF_XSL
-# 2}}}
-    }
-
-    if (!$opt_by_file or $opt_by_file_by_lang) {
-        $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2
-        <table>
-          <thead>
-          <tr><th colspan="5">Same</th>
-          </tr>
-            <tr>
-              <th>Language</th>
-              <th>Files</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-            </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="diff_results/same/language">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@files_count"/></td>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-            </tr>
-          </xsl:for-each>
-          </tbody>
-        </table>
-
-        <table>
-          <thead>
-          <tr><th colspan="5">Modified</th>
-          </tr>
-            <tr>
-              <th>Language</th>
-              <th>Files</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-            </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="diff_results/modified/language">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@files_count"/></td>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-            </tr>
-          </xsl:for-each>
-          </tbody>
-        </table>
-
-        <table>
-          <thead>
-          <tr><th colspan="5">Added</th>
-          </tr>
-            <tr>
-              <th>Language</th>
-              <th>Files</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-            </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="diff_results/added/language">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@files_count"/></td>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-            </tr>
-          </xsl:for-each>
-          </tbody>
-        </table>
-
-        <table>
-          <thead>
-          <tr><th colspan="5">Removed</th>
-          </tr>
-            <tr>
-              <th>Language</th>
-              <th>Files</th>
-              <th>Blank</th>
-              <th>Comment</th>
-              <th>Code</th>
-            </tr>
-          </thead>
-          <tbody>
-          <xsl:for-each select="diff_results/removed/language">
-            <tr>
-              <th><xsl:value-of select="@name"/></th>
-              <td><xsl:value-of select="@files_count"/></td>
-              <td><xsl:value-of select="@blank"/></td>
-              <td><xsl:value-of select="@comment"/></td>
-              <td><xsl:value-of select="@code"/></td>
-            </tr>
-          </xsl:for-each>
-          </tbody>
-        </table>
-EO_DIFF_XSL
-# 2}}}
-
-    }
-
-    $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2
-      </body>
-    </html>
-  </xsl:template>
-</xsl:stylesheet>
-EO_DIFF_XSL
-# 2}}}
-    if ($opt_diff) {
-        print $OUT $XSL_DIFF;
-    } else {
-        print $OUT $XSL;
-    }
-    $OUT->close();
-} # 1}}}
-sub normalize_file_names {                   # {{{1
-    my (@files, ) = @_;
-
-    # Returns a hash of file names reduced to a canonical form
-    # (fully qualified file names, all path separators changed to /,
-    # Windows file names lowercased).  Hash values are the original
-    # file name.
-
-    my %normalized = ();
-    foreach my $F (@files) {
-        my $F_norm = $F;
-        if ($ON_WINDOWS) {
-            $F_norm = lc $F_norm; # for case insensitive file name comparisons
-            $F_norm =~ s{\\}{/}g; # Windows directory separators to Unix
-            $F_norm =~ s{^\./}{}g;  # remove leading ./
-            if (($F_norm !~ m{^/}) and ($F_norm !~ m{^\w:/})) {
-                # looks like a relative path; prefix with cwd
-                $F_norm = lc "$cwd/$F_norm";
-            }
-        } else {
-            $F_norm =~ s{^\./}{}g;  # remove leading ./
-            if ($F_norm !~ m{^/}) {
-                # looks like a relative path; prefix with cwd
-                $F_norm = lc "$cwd/$F_norm";
-            }
-        }
-        # Remove trailing / so it does not interfere with further regex code
-        # that does not expect it
-        $F_norm =~ s{/+$}{};
-        $normalized{ $F_norm } = $F;
-    }
-    return %normalized;
-} # 1}}}
-sub combine_diffs {                          # {{{1
-    # subroutine by Andy (awalshe@sf.net)
-    # https://sourceforge.net/tracker/?func=detail&aid=3261017&group_id=174787&atid=870625
-    my ($ra_files) = @_;
-
-    my $res   = "$URL v $VERSION\n";
-    my $dl    = '-';
-    my $width = 79;
-    # columns are in this order
-    my @cols  = ('files', 'blank', 'comment', 'code');
-    my %HoH   = ();
-
-    foreach my $file (@{$ra_files}) {
-        my $IN = new IO::File $file, "r";
-        if (!defined $IN) {
-            warn "Unable to read $file; ignoring.\n";
-            next;
-        }
-
-        my $sec;
-        while (<$IN>) {
-            chomp;
-            s/\cM$//;
-            next if /^(http|Language|-----)/;
-            if (/^[A-Za-z0-9]+/) {        # section title
-                $sec = $_;
-                chomp($sec);
-                $HoH{$sec} = () if ! exists $HoH{$sec};
-                next;
-            }
-
-            if (/^\s(same|modified|added|removed)/) {  # calculated totals row
-                my @ar = grep { $_ ne '' } split(/ /, $_);
-                chomp(@ar);
-                my $ttl = shift @ar;
-                my $i = 0;
-                foreach(@ar) {
-                    my $t = "${ttl}${dl}${cols[$i]}";
-                    $HoH{$sec}{$t} = 0 if ! exists $HoH{$sec}{$t};
-                    $HoH{$sec}{$t} += $_;
-                    $i++;
-                }
-            }
-        }
-        $IN->close;
-    }
-
-    # rows are in this order
-    my @rows = ('same', 'modified', 'added', 'removed');
-
-    $res .= sprintf("%s\n", "-" x $width);
-    $res .= sprintf("%-19s %14s %14s %14s %14s\n", 'Language',
-                    $cols[0], $cols[1], $cols[2], $cols[3]);
-    $res .= sprintf("%s\n", "-" x $width);
-
-    for my $sec ( keys %HoH ) {
-        next if $sec =~ /SUM:/;
-        $res .= "$sec\n";
-        foreach (@rows) {
-            $res .= sprintf(" %-18s %14s %14s %14s %14s\n",
-                            $_, $HoH{$sec}{"${_}${dl}${cols[0]}"},
-                                $HoH{$sec}{"${_}${dl}${cols[1]}"},
-                                $HoH{$sec}{"${_}${dl}${cols[2]}"},
-                                $HoH{$sec}{"${_}${dl}${cols[3]}"});
-        }
-    }
-    $res .= sprintf("%s\n", "-" x $width);
-    my $sec = 'SUM:';
-    $res .= "$sec\n";
-    foreach (@rows) {
-        $res .= sprintf(" %-18s %14s %14s %14s %14s\n",
-                        $_, $HoH{$sec}{"${_}${dl}${cols[0]}"},
-                            $HoH{$sec}{"${_}${dl}${cols[1]}"},
-                            $HoH{$sec}{"${_}${dl}${cols[2]}"},
-                            $HoH{$sec}{"${_}${dl}${cols[3]}"});
-    }
-    $res .= sprintf("%s\n", "-" x $width);
-
-    return $res;
-} # 1}}}
-sub get_time {                               # {{{1
-    if ($HAVE_Time_HiRes) {
-        return Time::HiRes::time();
-    } else {
-        return time();
-    }
-} # 1}}}
-sub really_is_D {                            # {{{1
-    # Ref bug 131, files ending with .d could be init.d scripts
-    # instead of D language source files.
-    my ($file        , # in
-        $rh_Err      , # in   hash of error codes
-        $raa_errors  , # out
-       ) = @_;
-    print "-> really_is_D($file)\n" if $opt_v > 2;
-    my $possible_script = peek_at_first_line($file, $rh_Err, $raa_errors);
-
-    print "<- really_is_D($file)\n" if $opt_v > 2;
-    return $possible_script;    # null string if D, otherwise a language
-} # 1}}}
-# subroutines copied from SLOCCount
-my %lex_files    = ();  # really_is_lex()
-my %expect_files = ();  # really_is_expect()
-my %php_files    = ();  # really_is_php()
-sub really_is_lex {                          # {{{1
-# Given filename, returns TRUE if its contents really is lex.
-# lex file must have "%%", "%{", and "%}".
-# In theory, a lex file doesn't need "%{" and "%}", but in practice
-# they all have them, and requiring them avoid mislabeling a
-# non-lexfile as a lex file.
-
- my $filename = shift;
- chomp($filename);
-
- my $is_lex = 0;      # Value to determine.
- my $percent_percent = 0;
- my $percent_opencurly = 0;
- my $percent_closecurly = 0;
-
- # Return cached result, if available:
- if ($lex_files{$filename}) { return $lex_files{$filename};}
-
- open(LEX_FILE, "<$filename") ||
-      die "Can't open $filename to determine if it's lex.\n";
- while(<LEX_FILE>) {
-   $percent_percent++     if (m/^\s*\%\%/);
-   $percent_opencurly++   if (m/^\s*\%\{/);
-   $percent_closecurly++   if (m/^\s*\%\}/);
- }
- close(LEX_FILE);
-
- if ($percent_percent && $percent_opencurly && $percent_closecurly)
-          {$is_lex = 1;}
-
- $lex_files{$filename} = $is_lex; # Store result in cache.
-
- return $is_lex;
-} # 1}}}
-sub really_is_expect {                       # {{{1
-# Given filename, returns TRUE if its contents really are Expect.
-# Many "exp" files (such as in Apache and Mesa) are just "export" data,
-# summarizing something else # (e.g., its interface).
-# Sometimes (like in RPM) it's just misc. data.
-# Thus, we need to look at the file to determine
-# if it's really an "expect" file.
-
- my $filename = shift;
- chomp($filename);
-
-# The heuristic is as follows: it's Expect _IF_ it:
-# 1. has "load_lib" command and either "#" comments or {}.
-# 2. {, }, and one of: proc, if, [...], expect
-
- my $is_expect = 0;      # Value to determine.
-
- my $begin_brace = 0;  # Lines that begin with curly braces.
- my $end_brace = 0;    # Lines that begin with curly braces.
- my $load_lib = 0;     # Lines with the Load_lib command.
- my $found_proc = 0;
- my $found_if = 0;
- my $found_brackets = 0;
- my $found_expect = 0;
- my $found_pound = 0;
-
- # Return cached result, if available:
- if ($expect_files{$filename}) { return expect_files{$filename};}
-
- open(EXPECT_FILE, "<$filename") ||
-      die "Can't open $filename to determine if it's expect.\n";
- while(<EXPECT_FILE>) {
-
-   if (m/#/) {$found_pound++; s/#.*//;}
-   if (m/^\s*\{/) { $begin_brace++;}
-   if (m/\{\s*$/) { $begin_brace++;}
-   if (m/^\s*\}/) { $end_brace++;}
-   if (m/\};?\s*$/) { $end_brace++;}
-   if (m/^\s*load_lib\s+\S/) { $load_lib++;}
-   if (m/^\s*proc\s/) { $found_proc++;}
-   if (m/^\s*if\s/) { $found_if++;}
-   if (m/\[.*\]/) { $found_brackets++;}
-   if (m/^\s*expect\s/) { $found_expect++;}
- }
- close(EXPECT_FILE);
-
- if ($load_lib && ($found_pound || ($begin_brace && $end_brace)))
-          {$is_expect = 1;}
- if ( $begin_brace && $end_brace &&
-      ($found_proc || $found_if || $found_brackets || $found_expect))
-          {$is_expect = 1;}
-
- $expect_files{$filename} = $is_expect; # Store result in cache.
-
- return $is_expect;
-} # 1}}}
-sub really_is_pascal {                       # {{{1
-# Given filename, returns TRUE if its contents really are Pascal.
-
-# This isn't as obvious as it seems.
-# Many ".p" files are Perl files
-# (such as /usr/src/redhat/BUILD/ispell-3.1/dicts/czech/glob.p),
-# others are C extractions
-# (such as /usr/src/redhat/BUILD/linux/include/linux/umsdos_fs.p
-# and some files in linuxconf).
-# However, test files in "p2c" really are Pascal, for example.
-
-# Note that /usr/src/redhat/BUILD/ucd-snmp-4.1.1/ov/bitmaps/UCD.20.p
-# is actually C code.  The heuristics determine that they're not Pascal,
-# but because it ends in ".p" it's not counted as C code either.
-# I believe this is actually correct behavior, because frankly it
-# looks like it's automatically generated (it's a bitmap expressed as code).
-# Rather than guess otherwise, we don't include it in a list of
-# source files.  Let's face it, someone who creates C files ending in ".p"
-# and expects them to be counted by default as C files in SLOCCount needs
-# their head examined.  I suggest examining their head
-# with a sucker rod (see syslogd(8) for more on sucker rods).
-
-# This heuristic counts as Pascal such files such as:
-#  /usr/src/redhat/BUILD/teTeX-1.0/texk/web2c/tangleboot.p
-# Which is hand-generated.  We don't count woven documents now anyway,
-# so this is justifiable.
-
- my $filename = shift;
- chomp($filename);
-
-# The heuristic is as follows: it's Pascal _IF_ it has all of the following
-# (ignoring {...} and (*...*) comments):
-# 1. "^..program NAME" or "^..unit NAME",
-# 2. "procedure", "function", "^..interface", or "^..implementation",
-# 3. a "begin", and
-# 4. it ends with "end.",
-#
-# Or it has all of the following:
-# 1. "^..module NAME" and
-# 2. it ends with "end.".
-#
-# Or it has all of the following:
-# 1. "^..program NAME",
-# 2. a "begin", and
-# 3. it ends with "end.".
-#
-# The "end." requirements in particular filter out non-Pascal.
-#
-# Note (jgb): this does not detect Pascal main files in fpc, like
-# fpc-1.0.4/api/test/testterminfo.pas, which does not have "program" in
-# it
-
- my $is_pascal = 0;      # Value to determine.
-
- my $has_program = 0;
- my $has_unit = 0;
- my $has_module = 0;
- my $has_procedure_or_function = 0;
- my $found_begin = 0;
- my $found_terminating_end = 0;
- my $has_begin = 0;
-
- open(PASCAL_FILE, "<$filename") ||
-      die "Can't open $filename to determine if it's pascal.\n";
- while(<PASCAL_FILE>) {
-   s/\{.*?\}//g;  # Ignore {...} comments on this line; imperfect, but effective.
-   s/\(\*.*?\*\)//g;  # Ignore (*...*) comments on this line; imperfect, but effective.
-   if (m/\bprogram\s+[A-Za-z]/i)  {$has_program=1;}
-   if (m/\bunit\s+[A-Za-z]/i)     {$has_unit=1;}
-   if (m/\bmodule\s+[A-Za-z]/i)   {$has_module=1;}
-   if (m/\bprocedure\b/i)         { $has_procedure_or_function = 1; }
-   if (m/\bfunction\b/i)          { $has_procedure_or_function = 1; }
-   if (m/^\s*interface\s+/i)      { $has_procedure_or_function = 1; }
-   if (m/^\s*implementation\s+/i) { $has_procedure_or_function = 1; }
-   if (m/\bbegin\b/i) { $has_begin = 1; }
-   # Originally I said:
-   # "This heuristic fails if there are multi-line comments after
-   # "end."; I haven't seen that in real Pascal programs:"
-   # But jgb found there are a good quantity of them in Debian, specially in
-   # fpc (at the end of a lot of files there is a multiline comment
-   # with the changelog for the file).
-   # Therefore, assume Pascal if "end." appears anywhere in the file.
-   if (m/end\.\s*$/i) {$found_terminating_end = 1;}
-#   elsif (m/\S/) {$found_terminating_end = 0;}
- }
- close(PASCAL_FILE);
-
- # Okay, we've examined the entire file looking for clues;
- # let's use those clues to determine if it's really Pascal:
-
- if ( ( ($has_unit || $has_program) && $has_procedure_or_function &&
-     $has_begin && $found_terminating_end ) ||
-      ( $has_module && $found_terminating_end ) ||
-      ( $has_program && $has_begin && $found_terminating_end ) )
-          {$is_pascal = 1;}
-
- return $is_pascal;
-} # 1}}}
-sub really_is_incpascal {                    # {{{1
-# Given filename, returns TRUE if its contents really are Pascal.
-# For .inc files (mainly seen in fpc)
-
- my $filename = shift;
- chomp($filename);
-
-# The heuristic is as follows: it is Pascal if any of the following:
-# 1. really_is_pascal returns true
-# 2. Any usual reserved word is found (program, unit, const, begin...)
-
- # If the general routine for Pascal files works, we have it
- if (really_is_pascal($filename)) {
-   return 1;
- }
-
- my $is_pascal = 0;      # Value to determine.
- my $found_begin = 0;
-
- open(PASCAL_FILE, "<$filename") ||
-      die "Can't open $filename to determine if it's pascal.\n";
- while(<PASCAL_FILE>) {
-   s/\{.*?\}//g;  # Ignore {...} comments on this line; imperfect, but effective.
-   s/\(\*.*?\*\)//g;  # Ignore (*...*) comments on this line; imperfect, but effective.
-   if (m/\bprogram\s+[A-Za-z]/i)  {$is_pascal=1;}
-   if (m/\bunit\s+[A-Za-z]/i)     {$is_pascal=1;}
-   if (m/\bmodule\s+[A-Za-z]/i)   {$is_pascal=1;}
-   if (m/\bprocedure\b/i)         {$is_pascal = 1; }
-   if (m/\bfunction\b/i)          {$is_pascal = 1; }
-   if (m/^\s*interface\s+/i)      {$is_pascal = 1; }
-   if (m/^\s*implementation\s+/i) {$is_pascal = 1; }
-   if (m/\bconstant\s+/i)         {$is_pascal=1;}
-   if (m/\bbegin\b/i) { $found_begin = 1; }
-   if ((m/end\.\s*$/i) && ($found_begin = 1)) {$is_pascal = 1;}
-   if ($is_pascal) {
-     last;
-   }
- }
-
- close(PASCAL_FILE);
- return $is_pascal;
-} # 1}}}
-sub really_is_php {                          # {{{1
-# Given filename, returns TRUE if its contents really is php.
-
- my $filename = shift;
- chomp($filename);
-
- my $is_php = 0;      # Value to determine.
- # Need to find a matching pair of surrounds, with ending after beginning:
- my $normal_surround = 0;  # <?; bit 0 = <?, bit 1 = ?>
- my $script_surround = 0;  # <script..>; bit 0 = <script language="php">
- my $asp_surround = 0;     # <%; bit 0 = <%, bit 1 = %>
-
- # Return cached result, if available:
- if ($php_files{$filename}) { return $php_files{$filename};}
-
- open(PHP_FILE, "<$filename") ||
-      die "Can't open $filename to determine if it's php.\n";
- while(<PHP_FILE>) {
-   if (m/\<\?/)                           { $normal_surround |= 1; }
-   if (m/\?\>/ && ($normal_surround & 1)) { $normal_surround |= 2; }
-   if (m/\<script.*language="?php"?/i)    { $script_surround |= 1; }
-   if (m/\<\/script\>/i && ($script_surround & 1)) { $script_surround |= 2; }
-   if (m/\<\%/)                           { $asp_surround |= 1; }
-   if (m/\%\>/ && ($asp_surround & 1)) { $asp_surround |= 2; }
- }
- close(PHP_FILE);
-
- if ( ($normal_surround == 3) || ($script_surround == 3) ||
-      ($asp_surround == 3)) {
-   $is_php = 1;
- }
-
- $php_files{$filename} = $is_php; # Store result in cache.
-
- return $is_php;
-} # 1}}}
-__END__
-mode values (stat $item)[2]
-       Unix    Windows
-file:  33188   33206
-dir :  16832   16895
-link:  33261   33206
-pipe:   4544    null
Index: sm/trunk/scripts/cloc2html.py
===================================================================
--- /issm/trunk/scripts/cloc2html.py	(revision 28275)
+++ 	(revision )
@@ -1,107 +1,0 @@
-#!/usr/bin/env python
-# -*- coding: ISO-8859-1 -*-
-#inspired from http://qwiki.stanford.edu/images/d/df/Latex2qwiki.txt
-import re
-import os
-
-ISSM_DIR = os.getenv('ISSM_DIR')
-if(not ISSM_DIR):
-    raise NameError('ISSM_DIR undefined')
-
-infile = open('temp', 'r')
-outfile = open('temp.html', 'w')
-file_text = infile.readlines()
-
-#write header
-outfile.write('<table width="600px" rules=none border=0 bordercolor="#000000" cellpadding="3" align="center" style="border-collapse:collapse;">\n')
-style_r = 'style="text-align:right;"'
-style_c = 'style="text-align:center;"'
-style_l = 'style="text-align:left;"'
-color = ' bgcolor=#7AA9DD '  #dark blue
-color1 = ' bgcolor=#C6E2FF '  #light blue
-color2 = ' bgcolor=#FFFFFF '  #white
-
-count = 0
-toggle = 0
-for i in range(len(file_text)):
-
-    #Get current lines except if first line
-    if(i == 0):
-        continue
-    line = file_text[i]
-
-    pattern = r"----------------"
-    if (re.search(pattern, line)):
-        count += 1
-        continue
-
-    if(count == 1):
-        mystr = ' <tr> \n'
-        column = 1
-        for i in line.split():
-            if(column == 1):
-                mystr += '<th ' + color + style_l + '>' + i + '</th>'
-                column += 1
-            else:
-                mystr += '<th ' + color + style_r + '>' + i + '</th>'
-        mystr += '<th ' + color + style_r + '>Total</th>\n</th>\n'
-    elif(count == 2):
-        total = 0
-        column = 1
-        if(toggle):
-            mystr = '<tr>\n<th ' + color1 + style_l + '>'
-        else:
-            mystr = '<tr>\n<th ' + color2 + style_l + '>'
-        for i in line.split():
-            if(not i.isdigit() or (i.isdigit and int(i) == 77) or (i.isdigit and int(i) == 90)):
-                mystr += ' ' + i + ' '
-            else:
-                if(column == 1):
-                    mystr += '</th>'
-                if(column >= 2):
-                    total += int(i)
-                if(toggle):
-                    mystr += '<td ' + color1 + style_r + '>' + i + '</td>'
-                else:
-                    mystr += '<td ' + color2 + style_r + '>' + i + '</td>'
-                column += 1
-        if(toggle):
-            mystr += '<td ' + color1 + style_r + '>' + str(total) + '</td>\n</tr>\n'
-        else:
-            mystr += '<td ' + color2 + style_r + '>' + str(total) + '</td>\n</tr>\n'
-        toggle = 1 - toggle
-    elif(count == 3):
-        total = 0
-        column = 1
-        if(toggle):
-            mystr = '<tr>\n<th ' + color1 + style_l + '>'
-        else:
-            mystr = '<tr>\n<th ' + color2 + style_l + '>'
-        for i in line.split():
-            if(not i.isdigit()):
-                mystr += ' ' + i + ' '
-            else:
-                if(column == 1):
-                    mystr += '</th>'
-                if(column >= 2):
-                    total += int(i)
-                if(toggle):
-                    mystr += '<td ' + color1 + style_r + '>' + i + '</td>'
-                else:
-                    mystr += '<td ' + color2 + style_r + '>' + i + '</td>'
-                column += 1
-        if(toggle):
-            mystr += '<td ' + color1 + style_r + '>' + str(total) + '</td>\n</tr>\n'
-        else:
-            mystr += '<td ' + color2 + style_r + '>' + str(total) + '</td>\n</tr>\n'
-    else:
-        continue
-
-    outfile.write(mystr)
-
-#write header
-outfile.write(' </table>\n')
-
-#close all files
-infile.close()
-outfile.close()
Index: sm/trunk/scripts/convertmatlabclasses.py
===================================================================
--- /issm/trunk/scripts/convertmatlabclasses.py	(revision 28275)
+++ 	(revision )
@@ -1,179 +1,0 @@
-#!/usr/bin/env python
-# -*- coding: ISO-8859-1 -*-
-import sys
-import re
-import os
-import shutil
-
-#get names of all directories to process
-ISSM_DIR = os.getenv('ISSM_DIR')
-if(not ISSM_DIR):
-    raise NameError('ISSM_DIR undefined')
-newclassesdir = ISSM_DIR + '/src/m/classes/'
-oldclassesdir = ISSM_DIR + '/src/m/oldclasses/'
-
-#make new directory
-if(os.path.exists(oldclassesdir)):
-    shutil.rmtree(oldclassesdir)
-os.mkdir(oldclassesdir)
-
-#prepare subsref and subsasgn
-#{{{
-subsasgntext = r'''
-function obj = subsasgn(obj, index, val)
-obj = builtin('subsasgn', obj, index, val)
-'''
-subsreftext = r'''
-function obj = subsref(obj, index)
-obj = builtin('subsref', obj, index)
-'''
-#}}}
-
-#copy all files from new classes
-files = os.listdir(newclassesdir)
-for filename in files:
-    newpath = newclassesdir + filename
-    oldpath = oldclassesdir + filename
-    if(filename == ".svn"):
-        continue
-    if(filename.endswith(".m")):
-        shutil.copy(newpath, oldpath)
-    if(filename.startswith("@")):
-        shutil.copytree(newpath, oldpath)
-    if(filename == "clusters"):
-        files2 = os.listdir(newpath)
-        for filename2 in files2:
-            if(filename2 == ".svn"):
-                continue
-            newpath = newclassesdir + filename + '/' + filename2
-            oldpath = oldclassesdir + filename2
-            shutil.copy(newpath, oldpath)
-    if(filename == "model"):
-        shutil.copy(newpath + '/model.m', oldclassesdir + 'model.m')
-    if(filename == "qmu"):
-        shutil.copytree(newpath + '/@dakota_method', oldclassesdir + '/@dakota_method')
-        files2 = os.listdir(newpath)
-        for filename2 in files2:
-            if(filename2 == ".svn"):
-                continue
-            if(filename2 == "@dakota_method"):
-                continue
-            newpath = newclassesdir + filename + '/' + filename2
-            oldpath = oldclassesdir + filename2
-            shutil.copy(newpath, oldpath)
-
-files = os.listdir(oldclassesdir)
-#prepare properties
-#{{{
-propertiesfile = open(oldclassesdir + '/properties.m', 'w')
-propertiesfile.write("function out = properties(classname)\n")
-#}}}
-for file in files:
-    if(not file.endswith(".m")):
-        continue
-    print("converting " + file + " from new to old Matlab class definition...")
-    infile = open(oldclassesdir + file, 'r')
-    classname = (re.compile(r"\.m")).sub("", file)
-    dirname = oldclassesdir + '/@' + classname
-    step = 0
-    properties = ""
-
-    #create directory
-    if(not os.path.exists(dirname)):
-        #print "Directory " + dirname + " does not exist, creating..."
-        os.mkdir(dirname)
-
-    #Process file
-    file_text = infile.readlines()
-    for i in range(len(file_text) - 2):
-        mystr = file_text[i]
-
-        if("properties" in mystr and step == 0):
-            step = 1
-            continue
-        if("methods" in mystr and step == 1):
-            step = 2
-            continue
-        if("function " in mystr and step == 2):
-            step += 1
-
-        if(step == 1):
-            if("end" in mystr):
-                continue
-            property = mystr.lstrip()
-            property = re.sub(r"%. * $", "", property)
-            property = re.sub(r"\n", "", property)
-            if(len(property)):
-                properties = properties + 'OBJ' + property + ";\n"
-
-        if("function " in mystr):
-
-            #close previous file
-            if(step > 3):
-                outfile.close()
-
-            #get function name
-            mystr2 = (re.compile("=")).sub(" ", mystr)  #replaces equal signs by blank space
-            mystr2 = (re.compile(r"\(")).sub(" (", mystr2)  #add blank spaces before and after (
-            list = mystr2.split()
-            for j in range(len(list)):
-                word = list[j]
-                if(word == '('):
-                    break
-            objectname = list[1]
-            functionname = list[j - 1]
-            objectname = re.sub(r"\[", "", objectname)
-            objectname = re.sub(r"\]", "", objectname)
-            if(functionname == "disp"):
-                functionname = "display"
-            outfile = open(dirname + '/' + functionname + '.m', 'w')
-
-            #deal with constructor
-            if(functionname == classname):
-
-                properties2 = re.sub("OBJ", objectname + '.', properties)
-                #write function declaration
-                outfile.write(mystr)
-                #write properties
-                outfile.write(properties2)
-                #write set class
-                outfile.write(objectname + "=class(" + objectname + ", '" + classname + "');\n")
-
-                #update properties list
-                properties2 = properties2.split('\n')
-                propertiesfile2 = open(dirname + '/properties.m', 'w')
-                propertiesfile2.write("function out = properties(obj), \n")
-                propertiesfile2.write('\tout = cell(' + str(len(properties2) - 1) + ', 1);\n')
-                propertiesfile.write("if strcmp(classname, '" + classname + "'), \n")
-                propertiesfile.write('\tout = cell(' + str(len(properties2) - 1) + ', 1);\n')
-                for j in range(len(properties2) - 1):
-                    property = re.sub(r"=. * $", "", properties2[j])
-                    property = property.strip()
-                    property = re.sub(objectname + '.', "", property)
-                    propertiesfile.write('\tout{' + str(j + 1) + "} = '" + property + "';\n")
-                    propertiesfile2.write('\tout{' + str(j + 1) + "} = '" + property + "';\n")
-                propertiesfile.write('end\n')
-                continue
-
-        #write file
-        if(step > 2):
-            outfile.write(mystr)
-
-    #close all files and delete m file
-    if(step > 3):
-        outfile.close()
-    infile.close()
-    os.remove(oldclassesdir + file)
-
-    #Add subsref and subsasgn
-    outfile = open(dirname + '/subsasgn.m', 'w')
-    outfile.write(subsasgntext)
-    outfile.close()
-    outfile = open(dirname + '/subsref.m', 'w')
-    outfile.write(subsreftext)
-    outfile.close()
-
-
-#close all files
-propertiesfile.close()
-#shutil.rmtree(newclassesdir)
Index: /issm/trunk/scripts/cosmosvariables.sh
===================================================================
--- /issm/trunk/scripts/cosmosvariables.sh	(revision 1)
+++ /issm/trunk/scripts/cosmosvariables.sh	(revision 1)
@@ -0,0 +1,52 @@
+declare -x BINARY_TYPE_HPC=""
+declare -x CVSROOT="/home/larour/Imos_Cvs"
+declare -x CVS_RSH="/usr/bin/ssh"
+declare -x G_BROKEN_FILENAMES="1"
+declare -x HISTSIZE="1000"
+declare -x HOME="/home/larour"
+declare -x HOSTNAME="cosmos"
+declare -x INCLUDE="/opt/intel/mkl/8.0/include:/opt/misc/include"
+declare -x INPUTRC="/etc/inputrc"
+declare -x INTEL_LICENSE_FILE="/opt/intel/licenses/server.lic"
+declare -x JPLDEFAULTS="on"
+declare -x LANG="en_US.UTF-8"
+declare -x LD_LIBRARY_PATH="/lustre/scratch/larour/libraries_tier2_ice/petsc-2.3.3-p15/lib/linux-gnu/:/lustre/scratch/larour/libraries_tier2_ice/petsc-2.3.3-p15/externalpackages/PLAPACKR32/linux-gnu:/lustre/scratch/larour/libraries_tier2_ice/petsc-2.3.3-p15/externalpackages/MUMPS_4.7.3/linux-gnu/lib/:/scratch/larour/libraries_tier2_ice/slepc-2.3.3/lib/linux-gnu:/opt/intel/mkl/8.0/lib/32/:/opt/intel/compilers/ifort_8.0.046/lib"
+declare -x LD_RUN_PATH="/lustre/scratch/larour/libraries_tier2_ice/petsc-2.3.3-p15/lib/linux-gnu/:/lustre/scratch/larour/libraries_tier2_ice/petsc-2.3.3-p15/externalpackages/PLAPACKR32/linux-gnu:/lustre/scratch/larour/libraries_tier2_ice/petsc-2.3.3-p15/externalpackages/MUMPS_4.7.3/linux-gnu/lib/:/scratch/larour/libraries_tier2_ice/slepc-2.3.3/lib/linux-gnu:/opt/intel/mkl/8.0/lib/32/:/opt/intel/compilers/ifort_8.0.046/lib"
+declare -x LESSOPEN="|/usr/bin/lesspipe.sh %s"
+declare -x LM_LICENSE_FILE="/opt/ticra/grasp9"
+declare -x LOADEDMODULES="totalview_6702:misc:intel_mkl80:intel-ifort-compiler.8.1.019:intel-icc-compiler.8.1.022:latest_intel80:mpich-gm-intel80"
+declare -x LOGNAME="larour"
+declare -x LSF_BINDIR="/opt/lsf/6.2/linux2.4-glibc2.3-x86/bin"
+declare -x LSF_ENVDIR="/opt/lsf/conf"
+declare -x LSF_LIBDIR="/opt/lsf/6.2/linux2.4-glibc2.3-x86/lib"
+declare -x LSF_SERVERDIR="/opt/lsf/6.2/linux2.4-glibc2.3-x86/etc"
+declare -x LS_COLORS="no=00:fi=00:di=01;36:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:"
+declare -x MAIL="/var/spool/mail/larour"
+declare -x MANPATH="/opt/mpich/gm/intel8.0/man:/opt/intel/compilers/ifort_8.0.046/man:/opt/intel/compilers/icc_8.0.066/man:/opt/intel/compilers/idb_732/man:/opt/intel/compilers/icc_8.1.022/man:/opt/intel/compilers/ifort_8.1.019/man:/opt/lsf/6.2/man:/opt/misc/man:/opt/toolworks/totalview.6.7.0-2/man:/opt/ticra/grasp9:/opt/ticra/grasp9:/usr/local/share/man:/usr/share/man:/usr/X11R6/man:/usr/local/man:/opt/modules/default/man"
+declare -x MODULEPATH="/opt/modules/versions:/opt/modules/\$MODULE_VERSION/modulefiles:/opt/modules/modulefiles:"
+declare -x MODULESHOME="/opt/modules/3.1.6"
+declare -x MODULE_VERSION="3.1.6"
+declare -x MODULE_VERSION_STACK="3.1.6"
+declare -x MPICH_CC="/opt/intel/compilers/icc_8.1.022/bin/icc"
+declare -x MPICH_CLINKER="/opt/intel/compilers/icc_8.1.022/bin/icc"
+declare -x MPICH_F77="/opt/intel/compilers/ifort_8.1.019/bin/ifort"
+declare -x MPICH_F90="/opt/intel/compilers/ifort_8.1.019/bin/ifort"
+declare -x MPICH_FLINKER="/opt/intel/compilers/ifort_8.1.019/bin/ifort"
+declare -x OLDPWD="/scratch/larour/Testing/AGU_2008"
+declare -x PATH="/opt/intel/compilers/ifort_8.0.046/bin:/opt/intel/compilers/icc_8.0.066/bin:/opt/intel/compilers/idb_732/bin:/opt/intel/compilers/icc_8.1.022/bin:/opt/intel/compilers/ifort_8.1.019/bin:/opt/lsf/6.2/linux2.4-glibc2.3-x86/etc:/opt/lsf/6.2/linux2.4-glibc2.3-x86/bin:/opt/misc/bin:/opt/toolworks/totalview.6.7.0-2/bin:/usr/kerberos/bin:/opt/ticra/grasp9/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/larour/bin:/usr/local/bin:/opt/mpich/gm/intel8.0/bin:/home/larour/bin"
+declare -x PETSC_ARCH="linux-gnu"
+declare -x PETSC_DIR="/lustre/scratch/larour/libraries_tier2_ice/petsc-2.3.3-p15"
+declare -x PWD="/home/larour"
+declare -x QTDIR="/usr/lib/qt-3.1"
+declare -x SHELL="/bin/bash"
+declare -x SHLVL="1"
+declare -x SLEPC_DIR="/scratch/larour/libraries_tier2_ice/slepc-2.3.3/"
+declare -x SSH_CLIENT="128.149.242.81 34131 22"
+declare -x SSH_CONNECTION="128.149.242.81 34131 128.149.134.43 22"
+declare -x SSH_TTY="/dev/pts/2"
+declare -x TERM="xterm"
+declare -x USER="larour"
+declare -x XLSF_UIDDIR="/opt/lsf/6.2/linux2.4-glibc2.3-x86/lib/uid"
+declare -x _LMFILES_="/opt/modules/modulefiles/totalview_6702:/opt/modules/modulefiles/misc:/opt/modules/modulefiles/intel_mkl80:/opt/modules/modulefiles/intel-ifort-compiler.8.1.019:/opt/modules/modulefiles/intel-icc-compiler.8.1.022:/opt/modules/modulefiles/latest_intel80:/opt/modules/modulefiles/mpich-gm-intel80"
+declare -x _MODULESBEGINENV_="/home/larour/.modulesbeginenv"
+declare -x tier="tier2_ice"
Index: sm/trunk/scripts/cppcheck.sh
===================================================================
--- /issm/trunk/scripts/cppcheck.sh	(revision 28275)
+++ 	(revision )
@@ -1,7 +1,0 @@
-#!/bin/bash
-
-#comprehensive check, except unusedFunction
-#cppcheck -j 32 --include=$ISSM_DIR/config.h -DHAVE_CONFIG_H -D_HAVE_ADOLC_ -D_HAVE_DAKOTA_ -D_HAVE_JAVASCRIPT_ --enable=warning --enable=style --enable=performance --enable=portability --enable=information --enable=missingInclude $ISSM_DIR/src/c 2> CPPCHECK.err
-
-#unused function only (slow)
-cppcheck --include=$ISSM_DIR/config.h -DHAVE_CONFIG_H -D_HAVE_ADOLC_ -D_HAVE_DAKOTA_ -D_HAVE_JAVASCRIPT_ --enable=unusedFunction $ISSM_DIR/src 2> CPPCHECK.err
Index: /issm/trunk/scripts/createlinks.sh
===================================================================
--- /issm/trunk/scripts/createlinks.sh	(revision 1)
+++ /issm/trunk/scripts/createlinks.sh	(revision 1)
@@ -0,0 +1,15 @@
+#!/bin/bash
+#creates soft links to startup in every test subdirectories
+
+#go to ISSM main directory
+cd $ISSM_DIR
+
+#get path of runmes.m
+FILES=`find ./ -name "runme.m" | sed s/runme.m//g | sed -e "s/\.\//\//g"`;
+
+#loop over the directories
+for i in $FILES; do
+	cd $ISSM_DIR$i
+	ln -s $ISSM_DIR/startup.m .
+	cd $ISSM_DIR
+done
Index: /issm/trunk/scripts/cvs2cl.pl
===================================================================
--- /issm/trunk/scripts/cvs2cl.pl	(revision 1)
+++ /issm/trunk/scripts/cvs2cl.pl	(revision 1)
@@ -0,0 +1,3250 @@
+#!/bin/sh
+exec perl -w -x "$0" ${1+"$@"} # -*- mode: perl; perl-indent-level: 2; -*-
+#!perl -w
+
+
+##############################################################
+###                                                        ###
+### cvs2cl.pl: produce ChangeLog(s) from `cvs log` output. ###
+###                                                        ###
+##############################################################
+
+## $Revision: 2.72 $
+## $Date: 2008-06-26 18:56:51 $
+## $Author: kfogel $
+##
+
+use strict;
+
+use File::Basename qw( fileparse );
+use Getopt::Long   qw( GetOptions );
+use Text::Wrap     qw( );
+use Time::Local    qw( timegm );
+use User::pwent    qw( getpwnam );
+
+# The Plan:
+#
+# Read in the logs for multiple files, spit out a nice ChangeLog that
+# mirrors the information entered during `cvs commit'.
+#
+# The problem presents some challenges. In an ideal world, we could
+# detect files with the same author, log message, and checkin time --
+# each <filelist, author, time, logmessage> would be a changelog entry.
+# We'd sort them; and spit them out.  Unfortunately, CVS is *not atomic*
+# so checkins can span a range of times.  Also, the directory structure
+# could be hierarchical.
+#
+# Another question is whether we really want to have the ChangeLog
+# exactly reflect commits. An author could issue two related commits,
+# with different log entries, reflecting a single logical change to the
+# source. GNU style ChangeLogs group these under a single author/date.
+# We try to do the same.
+#
+# So, we parse the output of `cvs log', storing log messages in a
+# multilevel hash that stores the mapping:
+#   directory => author => time => message => filelist
+# As we go, we notice "nearby" commit times and store them together
+# (i.e., under the same timestamp), so they appear in the same log
+# entry.
+#
+# When we've read all the logs, we twist this mapping into
+# a time => author => message => filelist mapping for each directory.
+#
+# If we're not using the `--distributed' flag, the directory is always
+# considered to be `./', even as descend into subdirectories.
+
+# Call Tree
+
+# name                         number of lines (10.xii.03)
+# parse_options                         192
+# derive_changelog                       13
+# +-maybe_grab_accumulation_date         38
+# +-read_changelog                      277
+#   +-maybe_read_user_map_file           94
+#     +-run_ext                           9
+#   +-read_file_path                     29
+#   +-read_symbolic_name                 43
+#   +-read_revision                      49
+#   +-read_date_author_and_state         25
+#     +-parse_date_author_and_state      20
+#   +-read_branches                      36
+# +-output_changelog                    424
+#   +-pretty_file_list                  290
+#     +-common_path_prefix               35
+#   +-preprocess_msg_text                30
+#     +-min                               1
+#   +-mywrap                             16
+#   +-last_line_len                       5
+#   +-wrap_log_entry                    177
+#
+# Utilities
+#
+# xml_escape                              6
+# slurp_file                             11
+# debug                                   5
+# version                                 2
+# usage                                 142
+
+# -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*-
+#
+# Note about a bug-slash-opportunity:
+# -----------------------------------
+#
+# There's a bug in Text::Wrap, which affects cvs2cl.  This script
+# reveals it:
+#
+#   #!/usr/bin/perl -w
+#
+#   use Text::Wrap;
+#
+#   my $test_text =
+#   "This script demonstrates a bug in Text::Wrap.  The very long line
+#   following this paragraph will be relocated relative to the surrounding
+#   text:
+#
+#   ====================================================================
+#
+#   See?  When the bug happens, we'll get the line of equal signs below
+#   this paragraph, even though it should be above.";
+#
+#
+#   # Print out the test text with no wrapping:
+#   print "$test_text";
+#   print "\n";
+#   print "\n";
+#
+#   # Now print it out wrapped, and see the bug:
+#   print wrap ("\t", "        ", "$test_text");
+#   print "\n";
+#   print "\n";
+#
+# If the line of equal signs were one shorter, then the bug doesn't
+# happen.  Interesting.
+#
+# Anyway, rather than fix this in Text::Wrap, we might as well write a
+# new wrap() which has the following much-needed features:
+#
+# * initial indentation, like current Text::Wrap()
+# * subsequent line indentation, like current Text::Wrap()
+# * user chooses among: force-break long words, leave them alone, or die()?
+# * preserve existing indentation: chopped chunks from an indented line
+#   are indented by same (like this line, not counting the asterisk!)
+# * optional list of things to preserve on line starts, default ">"
+#
+# Note that the last two are essentially the same concept, so unify in
+# implementation and give a good interface to controlling them.
+#
+# And how about:
+#
+# Optionally, when encounter a line pre-indented by same as previous
+# line, then strip the newline and refill, but indent by the same.
+# Yeah...
+
+# Globals --------------------------------------------------------------------
+
+# In case we have to print it out:
+my $VERSION = '$Revision: 2.72 $';
+$VERSION =~ s/\S+\s+(\S+)\s+\S+/$1/;
+
+## Vars set by options:
+
+# Print debugging messages?
+my $Debug = 0;
+
+# Just show version and exit?
+my $Print_Version = 0;
+
+# Just print usage message and exit?
+my $Print_Usage = 0;
+
+# What file should we generate (defaults to "ChangeLog")?
+my $Log_File_Name = "ChangeLog";
+
+# Grab most recent entry date from existing ChangeLog file, just add
+# to that ChangeLog.
+my $Cumulative = 0;
+
+# `cvs log -d`, this will repeat the last entry in the old log.  This is OK,
+# as it guarantees at least one entry in the update changelog, which means
+# that there will always be a date to extract for the next update.  The repeat
+# entry can be removed in postprocessing, if necessary.
+
+# MJP 2003-08-02
+# I don't think this actually does anything useful
+my $Update = 0;
+
+# Expand usernames to email addresses based on a map file?
+my $User_Map_File = '';
+my $User_Passwd_File;
+my $Mail_Domain;
+
+# Output log in chronological order? [default is reverse chronological order]
+my $Chronological_Order = 0;
+
+# Grab user details via gecos
+my $Gecos = 0;
+
+# User domain for gecos email addresses
+my $Domain;
+
+# Output to a file or to stdout?
+my $Output_To_Stdout = 0;
+
+# Eliminate empty log messages?
+my $Prune_Empty_Msgs = 0;
+
+# Tags of which not to output
+my %ignore_tags;
+
+# Show only revisions with Tags
+my %show_tags;
+
+# Don't call Text::Wrap on the body of the message
+my $No_Wrap = 0;
+
+# Indentation of log messages
+my $Indent = "\t";
+
+# Don't do any pretty print processing
+my $Summary = 0;
+
+# Separates header from log message.  Code assumes it is either " " or
+# "\n\n", so if there's ever an option to set it to something else,
+# make sure to go through all conditionals that use this var.
+my $After_Header = " ";
+
+# XML Encoding
+my $XML_Encoding = '';
+
+# Format more for programs than for humans.
+my $XML_Output = 0;
+my $No_XML_Namespace = 0;
+my $No_XML_ISO_Date = 0;
+
+# Do some special tweaks for log data that was written in FSF
+# ChangeLog style.
+my $FSF_Style = 0;
+
+# Set iff output should be like an FSF-style ChangeLog.
+my $FSF_Output = 0;
+
+# Show times in UTC instead of local time
+my $UTC_Times = 0;
+
+# Show times in output?
+my $Show_Times = 1;
+
+# Show day of week in output?
+my $Show_Day_Of_Week = 0;
+
+# Show revision numbers in output?
+my $Show_Revisions = 0;
+
+# Show dead files in output?
+my $Show_Dead = 0;
+
+# Hide dead trunk files which were created as a result of additions on a
+# branch?
+my $Hide_Branch_Additions = 1;
+
+# Show tags (symbolic names) in output?
+my $Show_Tags = 0;
+
+# Show tags separately in output?
+my $Show_Tag_Dates = 0;
+
+# Show branches by symbolic name in output?
+my $Show_Branches = 0;
+
+# Show only revisions on these branches or their ancestors.
+my @Follow_Branches;
+# Show only revisions on these branches or their ancestors; ignore descendent
+# branches.
+my @Follow_Only;
+
+# Don't bother with files matching this regexp.
+my @Ignore_Files;
+
+# How exactly we match entries.  We definitely want "o",
+# and user might add "i" by using --case-insensitive option.
+my $Case_Insensitive = 0;
+
+# Maybe only show log messages matching a certain regular expression.
+my $Regexp_Gate = '';
+
+# Pass this global option string along to cvs, to the left of `log':
+my $Global_Opts = '';
+
+# Pass this option string along to the cvs log subcommand:
+my $Command_Opts = '';
+
+# Read log output from stdin instead of invoking cvs log?
+my $Input_From_Stdin = 0;
+
+# Don't show filenames in output.
+my $Hide_Filenames = 0;
+
+# Don't shorten directory names from filenames.
+my $Common_Dir = 1;
+
+# Max checkin duration. CVS checkin is not atomic, so we may have checkin
+# times that span a range of time. We assume that checkins will last no
+# longer than $Max_Checkin_Duration seconds, and that similarly, no
+# checkins will happen from the same users with the same message less
+# than $Max_Checkin_Duration seconds apart.
+my $Max_Checkin_Duration = 180;
+
+# What to put at the front of [each] ChangeLog.
+my $ChangeLog_Header = '';
+
+# Whether to enable 'delta' mode, and for what start/end tags.
+my $Delta_Mode = 0;
+my $Delta_From = '';
+my $Delta_To = '';
+
+my $TestCode;
+
+# Whether to parse filenames from the RCS filename, and if so what
+# prefix to strip.
+my $RCS_Root;
+
+# Whether to output information on the # of lines added and removed
+# by each file modification.
+my $Show_Lines_Modified = 0;
+
+## end vars set by options.
+
+# latest observed times for the start/end tags in delta mode
+my $Delta_StartTime = 0;
+my $Delta_EndTime = 0;
+
+my $No_Ancestors = 0;
+
+my $No_Extra_Indent = 0;
+
+my $GroupWithinDate = 0;
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySet;
+
+sub new {
+  my $class = shift;
+  my %self;
+  bless \%self, $class;
+}
+
+# -------------------------------------
+
+sub output_changelog {
+  my $output_type = $XML_Output ? 'XML' : 'Text';
+  my $output_class = "CVS::Utils::ChangeLog::EntrySet::Output::${output_type}";
+  my $output = $output_class->new(follow_branches => \@Follow_Branches,
+                                  follow_only     => \@Follow_Only,
+                                  ignore_tags     => \%ignore_tags,
+                                  show_tags       => \%show_tags,
+                                 );
+  $output->output_changelog(@_);
+}
+
+# -------------------------------------
+
+sub add_fileentry {
+  my ($self, $file_full_path, $time, $revision, $state, $lines,
+      $branch_names, $branch_roots, $branch_numbers,
+      $symbolic_names, $author, $msg_txt) = @_;
+
+      my $qunk =
+        CVS::Utils::ChangeLog::FileEntry->new($file_full_path, $time, $revision,
+                                              $state, $lines,
+                                              $branch_names, $branch_roots,
+                                              $branch_numbers,
+                                              $symbolic_names);
+
+      # We might be including revision numbers and/or tags and/or
+      # branch names in the output.  Most of the code from here to
+      # loop-end deals with organizing these in qunk.
+
+      unless ( $Hide_Branch_Additions
+               and
+               $msg_txt =~ /file .+ was initially added on branch \S+./ ) {
+        # Add this file to the list
+        # (We use many spoonfuls of autovivication magic. Hashes and arrays
+        # will spring into existence if they aren't there already.)
+
+        &main::debug ("(pushing log msg for ". $qunk->dir_key . $qunk->filename . ")\n");
+
+        # Store with the files in this commit.  Later we'll loop through
+        # again, making sure that revisions with the same log message
+        # and nearby commit times are grouped together as one commit.
+        $self->{$qunk->dir_key}{$author}{$time}{$msg_txt} =
+          CVS::Utils::ChangeLog::Message->new($msg_txt)
+              unless exists $self->{$qunk->dir_key}{$author}{$time}{$msg_txt};
+        $self->{$qunk->dir_key}{$author}{$time}{$msg_txt}->add_fileentry($qunk);
+      }
+
+}
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySet::Output::Text;
+
+use base qw( CVS::Utils::ChangeLog::EntrySet::Output );
+
+use File::Basename qw( fileparse );
+
+sub new {
+  my $class = shift;
+  my $self = $class->SUPER::new(@_);
+}
+
+# -------------------------------------
+
+sub wday {
+  my $self = shift; my $class = ref $self;
+  my ($wday) = @_;
+
+  return $Show_Day_Of_Week ? ' ' . $class->weekday_en($wday) : '';
+}
+
+# -------------------------------------
+
+sub header_line {
+  my $self = shift;
+  my ($time, $author, $lastdate) = @_;
+
+  my $header_line = '';
+
+  my (undef,$min,$hour,$mday,$mon,$year,$wday)
+    = $UTC_Times ? gmtime($time) : localtime($time);
+
+  my $date = $self->fdatetime($time);
+
+  if ($Show_Times) {
+    $header_line =
+      sprintf "%s  %s\n\n", $date, $author;
+  } else {
+    if ( ! defined $lastdate or $date ne $lastdate or ! $GroupWithinDate ) {
+      if ( $GroupWithinDate ) {
+        $header_line = "$date\n\n";
+      } else {
+        $header_line = "$date  $author\n\n";
+      }
+    } else {
+      $header_line = '';
+    }
+  }
+}
+
+# -------------------------------------
+
+sub preprocess_msg_text {
+  my $self = shift;
+  my ($text) = @_;
+
+  $text = $self->SUPER::preprocess_msg_text($text);
+
+  unless ( $No_Wrap ) {
+    # Strip off lone newlines, but only for lines that don't begin with
+    # whitespace or a mail-quoting character, since we want to preserve
+    # that kind of formatting.  Also don't strip newlines that follow a
+    # period; we handle those specially next.  And don't strip
+    # newlines that precede an open paren.
+    1 while $text =~ s/(^|\n)([^>\s].*[^.\n])\n([^>\n])/$1$2 $3/g;
+
+    # If a newline follows a period, make sure that when we bring up the
+    # bottom sentence, it begins with two spaces.
+    1 while $text =~ s/(^|\n)([^>\s].*)\n([^>\n])/$1$2  $3/g;
+  }
+
+  return $text;
+}
+
+# -------------------------------------
+
+# Here we take a bunch of qunks and convert them into printed
+# summary that will include all the information the user asked for.
+sub pretty_file_list {
+  my $self = shift;
+
+  return ''
+    if $Hide_Filenames;
+
+  my $qunksref = shift;
+
+  my @filenames;
+  my $beauty = '';          # The accumulating header string for this entry.
+  my %non_unanimous_tags;   # Tags found in a proper subset of qunks
+  my %unanimous_tags;       # Tags found in all qunks
+  my %all_branches;         # Branches found in any qunk
+  my $fbegun = 0;           # Did we begin printing filenames yet?
+
+  my ($common_dir, $qunkrefs) =
+    $self->_pretty_file_list(\(%unanimous_tags, %non_unanimous_tags, %all_branches), $qunksref);
+
+  my @qunkrefs = @$qunkrefs;
+
+  # Not XML output, so complexly compactify for chordate consumption.  At this
+  # point we have enough global information about all the qunks to organize
+  # them non-redundantly for output.
+
+  if ($common_dir) {
+    # Note that $common_dir still has its trailing slash
+    $beauty .= "$common_dir: ";
+  }
+
+  if ($Show_Branches)
+  {
+    # For trailing revision numbers.
+    my @brevisions;
+
+    foreach my $branch (keys (%all_branches))
+    {
+      foreach my $qunkref (@qunkrefs)
+      {
+        if ((defined ($qunkref->branch))
+            and ($qunkref->branch eq $branch))
+        {
+          if ($fbegun) {
+            # kff todo: comma-delimited in XML too?  Sure.
+            $beauty .= ", ";
+          }
+          else {
+            $fbegun = 1;
+          }
+          my $fname = substr ($qunkref->filename, length ($common_dir));
+          $beauty .= $fname;
+          $qunkref->{'printed'} = 1;  # Just setting a mark bit, basically
+
+          if ( $Show_Tags and defined $qunkref->tags ) {
+            my @tags = grep ($non_unanimous_tags{$_}, @{$qunkref->tags});
+
+            if (@tags) {
+              $beauty .= " (tags: ";
+              $beauty .= join (', ', @tags);
+              $beauty .= ")";
+            }
+          }
+
+          if ($Show_Revisions) {
+            # Collect the revision numbers' last components, but don't
+            # print them -- they'll get printed with the branch name
+            # later.
+            $qunkref->revision =~ /.+\.([\d]+)$/;
+            push (@brevisions, $1);
+
+            # todo: we're still collecting branch roots, but we're not
+            # showing them anywhere.  If we do show them, it would be
+            # nifty to just call them revision "0" on a the branch.
+            # Yeah, that's the ticket.
+          }
+        }
+      }
+      $beauty .= " ($branch";
+      if (@brevisions) {
+        if ((scalar (@brevisions)) > 1) {
+          $beauty .= ".[";
+          $beauty .= (join (',', @brevisions));
+          $beauty .= "]";
+        }
+        else {
+          # Square brackets are spurious here, since there's no range to
+          # encapsulate
+          $beauty .= ".$brevisions[0]";
+        }
+      }
+      $beauty .= ")";
+    }
+  }
+
+  # Okay; any qunks that were done according to branch are taken care
+  # of, and marked as printed.  Now print everyone else.
+
+  my %fileinfo_printed;
+  foreach my $qunkref (@qunkrefs)
+  {
+    next if (defined ($qunkref->{'printed'}));   # skip if already printed
+
+    my $b = substr ($qunkref->filename, length ($common_dir));
+    # todo: Shlomo's change was this:
+    # $beauty .= substr ($qunkref->filename,
+    #              (($common_dir eq "./") ? '' : length ($common_dir)));
+    $qunkref->{'printed'} = 1;  # Set a mark bit.
+
+    if ($Show_Revisions || $Show_Tags || $Show_Dead)
+    {
+      my $started_addendum = 0;
+
+      if ($Show_Revisions) {
+        $started_addendum = 1;
+        $b .= " (";
+        $b .= $qunkref->revision;
+      }
+      if ($Show_Dead && $qunkref->state =~ /dead/)
+      {
+        # Deliberately not using $started_addendum. Keeping it simple.
+        $b .= "[DEAD]";
+      }
+      if ($Show_Tags && (defined $qunkref->tags)) {
+        my @tags = grep ($non_unanimous_tags{$_}, @{$qunkref->tags});
+        if ((scalar (@tags)) > 0) {
+          if ($started_addendum) {
+            $b .= ", ";
+          }
+          else {
+            $b .= " (tags: ";
+          }
+          $b .= join (', ', @tags);
+          $started_addendum = 1;
+        }
+      }
+      if ($started_addendum) {
+        $b .= ")";
+      }
+    }
+
+    unless ( exists $fileinfo_printed{$b} ) {
+      if ($fbegun) {
+        $beauty .= ", ";
+      } else {
+        $fbegun = 1;
+      }
+      $beauty .= $b, $fileinfo_printed{$b} = 1;
+    }
+  }
+
+  # Unanimous tags always come last.
+  if ($Show_Tags && %unanimous_tags)
+  {
+    $beauty .= " (utags: ";
+    $beauty .= join (', ', sort keys (%unanimous_tags));
+    $beauty .= ")";
+  }
+
+  # todo: still have to take care of branch_roots?
+
+  $beauty = "$beauty:";
+
+  return $beauty;
+}
+
+# -------------------------------------
+
+sub output_tagdate {
+  my $self = shift;
+  my ($fh, $time, $tag) = @_;
+
+  my $fdatetime = $self->fdatetime($time);
+  print $fh "$fdatetime  tag $tag\n\n";
+  return;
+}
+
+# -------------------------------------
+
+sub format_body {
+  my $self = shift;
+  my ($msg, $files, $qunklist) = @_;
+
+  my $body;
+
+  if ( $No_Wrap and ! $Summary ) {
+    $msg = $self->preprocess_msg_text($msg);
+    $files = $self->mywrap("\t", "\t  ", "* $files");
+    $msg =~ s/\n(.+)/\n$Indent$1/g;
+    unless ($After_Header eq " ") {
+      $msg =~ s/^(.+)/$Indent$1/g;
+    }
+    if ( $Hide_Filenames ) {
+      $body = $After_Header . $msg;
+    } else {
+      $body = $files . $After_Header . $msg;
+    }
+  } elsif ( $Summary ) {
+    my ($filelist, $qunk);
+    my (@DeletedQunks, @AddedQunks, @ChangedQunks);
+
+    $msg = $self->preprocess_msg_text($msg);
+    #
+    #     Sort the files (qunks) according to the operation that was
+    # performed.  Files which were added have no line change
+    # indicator, whereas deleted files have state dead.
+    #
+    foreach $qunk ( @$qunklist ) {
+      if ( "dead" eq $qunk->state) {
+        push @DeletedQunks, $qunk;
+      } elsif ( ! defined $qunk->lines ) {
+        push @AddedQunks, $qunk;
+      } else {
+        push @ChangedQunks, $qunk;
+      }
+    }
+    #
+    #     The qunks list was  originally in tree search order.  Let's
+    # get that back.  The lists, if they exist, will be reversed upon
+    # processing.
+    #
+
+    #
+    #     Now write the three sections onto $filelist
+    #
+    if ( @DeletedQunks ) {
+      $filelist .= "\tDeleted:\n";
+      foreach $qunk ( @DeletedQunks ) {
+        $filelist .= "\t\t" . $qunk->filename;
+        $filelist .= " (" . $qunk->revision . ")";
+        $filelist .= "\n";
+      }
+      undef @DeletedQunks;
+    }
+
+    if ( @AddedQunks ) {
+      $filelist .= "\tAdded:\n";
+      foreach $qunk (@AddedQunks) {
+        $filelist .= "\t\t" . $qunk->filename;
+        $filelist .= " (" . $qunk->revision . ")";
+        $filelist .= "\n";
+      }
+      undef @AddedQunks ;
+    }
+
+    if ( @ChangedQunks ) {
+      $filelist .= "\tChanged:\n";
+      foreach $qunk (@ChangedQunks) {
+        $filelist .= "\t\t" . $qunk->filename;
+        $filelist .= " (" . $qunk->revision . ")";
+        $filelist .= ", \"" . $qunk->state . "\"";
+        $filelist .= ", lines: " . $qunk->lines;
+        $filelist .= "\n";
+      }
+      undef @ChangedQunks;
+    }
+
+    chomp $filelist;
+
+    if ( $Hide_Filenames ) {
+      $filelist = '';
+    }
+
+    $msg =~ s/\n(.*)/\n$Indent$1/g;
+    unless ( $After_Header eq " " or $FSF_Style ) {
+      $msg =~ s/^(.*)/$Indent$1/g;
+    }
+
+    unless ( $No_Wrap ) {
+      if ( $FSF_Style ) {
+        $msg = $self->wrap_log_entry($msg, '', 69, 69);
+        chomp($msg);
+        chomp($msg);
+      } else {
+        $msg = $self->mywrap('', $Indent, "$msg");
+        $msg =~ s/[ \t]+\n/\n/g;
+      }
+    }
+
+    $body = $filelist . $After_Header . $msg;
+  } else {  # do wrapping, either FSF-style or regular
+    my $latter_wrap = $No_Extra_Indent ? $Indent : "$Indent  ";
+
+    if ( $FSF_Style ) {
+      $files = $self->mywrap($Indent, $latter_wrap, "* $files");
+
+      my $files_last_line_len = 0;
+      if ( $After_Header eq " " ) {
+        $files_last_line_len = $self->last_line_len($files);
+        $files_last_line_len += 1;  # for $After_Header
+      }
+
+      $msg = $self->wrap_log_entry($msg, $latter_wrap, 69-$files_last_line_len, 69);
+      $body = $files . $After_Header . $msg;
+    } else {  # not FSF-style
+      $msg = $self->preprocess_msg_text($msg);
+      $body = $files . $After_Header . $msg;
+      $body = $self->mywrap($Indent, $latter_wrap, "* $body");
+      $body =~ s/[ \t]+\n/\n/g;
+    }
+  }
+
+  return $body;
+}
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySet::Output::XML;
+
+use base qw( CVS::Utils::ChangeLog::EntrySet::Output );
+
+use File::Basename qw( fileparse );
+
+sub new {
+  my $class = shift;
+  my $self = $class->SUPER::new(@_);
+}
+
+# -------------------------------------
+
+sub header_line {
+  my $self = shift;
+  my ($time, $author, $lastdate) = @_;
+
+  my $header_line = '';
+
+  my $isoDate;
+
+  my ($y, $m, $d, $H, $M, $S) = (gmtime($time))[5,4,3,2,1,0];
+
+  # Ideally, this would honor $UTC_Times and use +HH:MM syntax
+  $isoDate = sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",
+                     $y + 1900, $m + 1, $d, $H, $M, $S);
+
+  my (undef,$min,$hour,$mday,$mon,$year,$wday)
+    = $UTC_Times ? gmtime($time) : localtime($time);
+
+  my $date = $self->fdatetime($time);
+  $wday = $self->wday($wday);
+
+  $header_line =
+    sprintf ("<date>%4u-%02u-%02u</date>\n${wday}<time>%02u:%02u</time>\n",
+             $year+1900, $mon+1, $mday, $hour, $min);
+  $header_line .= "<isoDate>$isoDate</isoDate>\n"
+    unless $No_XML_ISO_Date;
+  $header_line .= sprintf("<author>%s</author>\n" , $author);
+}
+
+# -------------------------------------
+
+sub wday {
+  my $self = shift; my $class = ref $self;
+  my ($wday) = @_;
+
+  return '<weekday>' . $class->weekday_en($wday) . "</weekday>\n";
+}
+
+# -------------------------------------
+
+sub escape {
+  my $self = shift;
+
+  my $txt = shift;
+  $txt =~ s/&/&amp;/g;
+  $txt =~ s/</&lt;/g;
+  $txt =~ s/>/&gt;/g;
+  return $txt;
+}
+
+# -------------------------------------
+
+sub output_header {
+  my $self = shift;
+  my ($fh) = @_;
+
+  my $encoding    =
+    length $XML_Encoding ? qq'encoding="$XML_Encoding"' : '';
+  my $version     = 'version="1.0"';
+  my $declaration =
+    sprintf '<?xml %s?>', join ' ', grep length, $version, $encoding;
+  my $root        =
+    $No_XML_Namespace ?
+      '<changelog>'     :
+        '<changelog xmlns="http://www.red-bean.com/xmlns/cvs2cl/">';
+  print $fh "$declaration\n\n$root\n\n";
+}
+
+# -------------------------------------
+
+sub output_footer {
+  my $self = shift;
+  my ($fh) = @_;
+
+  print $fh "</changelog>\n";
+}
+
+# -------------------------------------
+
+sub preprocess_msg_text {
+  my $self = shift;
+  my ($text) = @_;
+
+  $text = $self->SUPER::preprocess_msg_text($text);
+
+  $text = $self->escape($text);
+  chomp $text;
+  $text = "<msg>${text}</msg>\n";
+
+  return $text;
+}
+
+# -------------------------------------
+
+# Here we take a bunch of qunks and convert them into a printed
+# summary that will include all the information the user asked for.
+sub pretty_file_list {
+  my $self = shift;
+  my ($qunksref) = @_;
+
+  my $beauty = '';          # The accumulating header string for this entry.
+  my %non_unanimous_tags;   # Tags found in a proper subset of qunks
+  my %unanimous_tags;       # Tags found in all qunks
+  my %all_branches;         # Branches found in any qunk
+  my $fbegun = 0;           # Did we begin printing filenames yet?
+
+  my ($common_dir, $qunkrefs) =
+    $self->_pretty_file_list(\(%unanimous_tags, %non_unanimous_tags, %all_branches),
+      $qunksref);
+
+  my @qunkrefs = @$qunkrefs;
+
+  # If outputting XML, then our task is pretty simple, because we
+  # don't have to detect common dir, common tags, branch prefixing,
+  # etc.  We just output exactly what we have, and don't worry about
+  # redundancy or readability.
+
+  foreach my $qunkref (@qunkrefs)
+  {
+    my $filename    = $qunkref->filename;
+    my $state       = $qunkref->state;
+    my $revision    = $qunkref->revision;
+    my $tags        = $qunkref->tags;
+    my $branch      = $qunkref->branch;
+    my $branchroots = $qunkref->roots;
+    my $lines       = $qunkref->lines;
+
+    $filename = $self->escape($filename);   # probably paranoia
+    $revision = $self->escape($revision);   # definitely paranoia
+
+    $beauty .= "<file>\n";
+    $beauty .= "<name>${filename}</name>\n";
+    $beauty .= "<cvsstate>${state}</cvsstate>\n";
+    $beauty .= "<revision>${revision}</revision>\n";
+
+    if ($Show_Lines_Modified
+        && $lines && $lines =~ m/\+(\d+)\s+-(\d+)/) {
+        $beauty .= "<linesadded>$1</linesadded>\n";
+        $beauty .= "<linesremoved>$2</linesremoved>\n";
+    }
+
+    if ($branch) {
+      $branch   = $self->escape($branch);     # more paranoia
+      $beauty .= "<branch>${branch}</branch>\n";
+    }
+    foreach my $tag (@$tags) {
+      $tag = $self->escape($tag);  # by now you're used to the paranoia
+      $beauty .= "<tag>${tag}</tag>\n";
+    }
+    foreach my $root (@$branchroots) {
+      $root = $self->escape($root);  # which is good, because it will continue
+      $beauty .= "<branchroot>${root}</branchroot>\n";
+    }
+    $beauty .= "</file>\n";
+  }
+
+  # Theoretically, we could go home now.  But as long as we're here,
+  # let's print out the common_dir and utags, as a convenience to
+  # the receiver (after all, earlier code calculated that stuff
+  # anyway, so we might as well take advantage of it).
+
+  if ((scalar (keys (%unanimous_tags))) > 1) {
+    foreach my $utag ((keys (%unanimous_tags))) {
+      $utag = $self->escape($utag);   # the usual paranoia
+      $beauty .= "<utag>${utag}</utag>\n";
+    }
+  }
+  if ($common_dir) {
+    $common_dir = $self->escape($common_dir);
+    $beauty .= "<commondir>${common_dir}</commondir>\n";
+  }
+
+  # That's enough for XML, time to go home:
+  return $beauty;
+}
+
+# -------------------------------------
+
+sub output_tagdate {
+  my $self = shift;
+  my ($fh, $time, $tag) = @_;
+
+  my ($y, $m, $d, $H, $M, $S) = (gmtime($time))[5,4,3,2,1,0];
+
+  # Ideally, this would honor $UTC_Times and use +HH:MM syntax
+  my $isoDate = sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",
+                       $y + 1900, $m + 1, $d, $H, $M, $S);
+
+  print $fh "<tagdate>\n";
+  print $fh "<tagisodate>$isoDate</tagisodate>\n";
+  print $fh "<tagdatetag>$tag</tagdatetag>\n";
+  print $fh "</tagdate>\n\n";
+  return;
+}
+
+# -------------------------------------
+
+sub output_entry {
+  my $self = shift;
+  my ($fh, $entry) = @_;
+  print $fh "<entry>\n$entry</entry>\n\n";
+}
+
+# -------------------------------------
+
+sub format_body {
+  my $self = shift;
+  my ($msg, $files, $qunklist) = @_;
+
+  $msg = $self->preprocess_msg_text($msg);
+  return $files . $msg;
+}
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySet::Output;
+
+use Carp           qw( croak );
+use File::Basename qw( fileparse );
+
+# Class Utility Functions -------------
+
+{ # form closure
+
+my @weekdays = (qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday));
+sub weekday_en {
+  my $class = shift;
+  return $weekdays[$_[0]];
+}
+
+}
+
+# -------------------------------------
+
+sub new {
+  my ($proto, %args) = @_;
+  my $class = ref $proto || $proto;
+
+  my $follow_branches = delete $args{follow_branches};
+  my $follow_only     = delete $args{follow_only};
+  my $ignore_tags     = delete $args{ignore_tags};
+  my $show_tags       = delete $args{show_tags};
+  die "Unrecognized arg to EntrySet::Output::new: '$_'\n"
+    for keys %args;
+
+  bless +{follow_branches => $follow_branches,
+          follow_only     => $follow_only,
+          show_tags       => $show_tags,
+          ignore_tags     => $ignore_tags,
+         }, $class;
+}
+
+# Abstract Subrs ----------------------
+
+sub wday               { croak "Whoops.  Abtract method call (wday).\n" }
+sub pretty_file_list   { croak "Whoops.  Abtract method call (pretty_file_list).\n" }
+sub output_tagdate     { croak "Whoops.  Abtract method call (output_tagdate).\n" }
+sub header_line        { croak "Whoops.  Abtract method call (header_line).\n" }
+
+# Instance Subrs ----------------------
+
+sub output_header { }
+
+# -------------------------------------
+
+sub output_entry {
+  my $self = shift;
+  my ($fh, $entry) = @_;
+  print $fh "$entry\n";
+}
+
+# -------------------------------------
+
+sub output_footer { }
+
+# -------------------------------------
+
+sub escape { return $_[1] }
+
+# -------------------------------------
+
+sub _revision_is_wanted {
+  my ($self, $qunk) = @_;
+
+  my ($revision, $branch_numbers) = @{$qunk}{qw( revision branch_numbers )};
+  my $follow_branches = $self->{follow_branches};
+  my $follow_only     = $self->{follow_only};
+
+  for my $ignore_tag (keys %{$self->{ignore_tags}}) {
+    return
+      if defined $qunk->{tags} and grep $_ eq $ignore_tag, @{$qunk->{tags}};
+  }
+
+  if ( keys %{$self->{show_tags}} ) {
+    for my $show_tag (keys %{$self->{show_tags}}) {
+      return
+        if ! defined $qunk->{tags} or ! grep $_ eq $show_tag, @{$qunk->{tags}};
+    }
+  }
+
+  return 1
+    unless @$follow_branches + @$follow_only; # no follow is follow all
+
+  for my $x (map([$_, 1], @$follow_branches),
+             map([$_, 0], @$follow_only    )) {
+    my ($branch, $followsub) = @$x;
+
+    # Special case for following trunk revisions
+    return 1
+      if $branch =~ /^trunk$/i and $revision =~ /^[0-9]+\.[0-9]+$/;
+
+    if ( my $branch_number = $branch_numbers->{$branch} ) {
+      # Are we on one of the follow branches or an ancestor of same?
+
+      # If this revision is a prefix of the branch number, or possibly is less
+      # in the minormost number, OR if this branch number is a prefix of the
+      # revision, then yes.  Otherwise, no.
+
+      # So below, we determine if any of those conditions are met.
+
+      # Trivial case: is this revision on the branch?  (Compare this way to
+      # avoid regexps that screw up Emacs indentation, argh.)
+      if ( substr($revision, 0, (length($branch_number) + 1))
+           eq
+           ($branch_number . ".") ) {
+        if ( $followsub ) {
+          return 1;
+#        } elsif ( length($revision) == length($branch_number)+2 ) {
+        } elsif ( substr($revision, length($branch_number)+1) =~ /^\d+$/ ) {
+          return 1;
+        }
+      } elsif ( length($branch_number) > length($revision)
+                and
+                ! $No_Ancestors ) {
+        # Non-trivial case: check if rev is ancestral to branch
+
+        # r_left still has the trailing "."
+        my ($r_left, $r_end) = ($revision =~ /^((?:\d+\.)+)(\d+)$/);
+
+        # b_left still has trailing "."
+        # b_mid has no trailing "."
+        my ($b_left, $b_mid) = ($branch_number =~ /^((?:\d+\.)+)(\d+)\.\d+$/);
+        return 1
+          if $r_left eq $b_left and $r_end <= $b_mid;
+      }
+    }
+  }
+
+  return;
+}
+
+# -------------------------------------
+
+sub output_changelog {
+my $self = shift; my $class = ref $self;
+  my ($grand_poobah) = @_;
+  ### Process each ChangeLog
+
+  while (my ($dir,$authorhash) = each %$grand_poobah)
+  {
+    &main::debug ("DOING DIR: $dir\n");
+
+    # Here we twist our hash around, from being
+    #   author => time => message => filelist
+    # in %$authorhash to
+    #   time => author => message => filelist
+    # in %changelog.
+    #
+    # This is also where we merge entries.  The algorithm proceeds
+    # through the timeline of the changelog with a sliding window of
+    # $Max_Checkin_Duration seconds; within that window, entries that
+    # have the same log message are merged.
+    #
+    # (To save space, we zap %$authorhash after we've copied
+    # everything out of it.)
+
+    my %changelog;
+    while (my ($author,$timehash) = each %$authorhash)
+    {
+      my %stamptime;
+      foreach my $time (sort {$a <=> $b} (keys %$timehash))
+      {
+        my $msghash = $timehash->{$time};
+        while (my ($msg,$qunklist) = each %$msghash)
+        {
+          my $stamptime = $stamptime{$msg};
+          if ((defined $stamptime)
+              and (($time - $stamptime) < $Max_Checkin_Duration)
+              and (defined $changelog{$stamptime}{$author}{$msg}))
+          {
+            push(@{$changelog{$stamptime}{$author}{$msg}}, $qunklist->files);
+          }
+          else {
+            $changelog{$time}{$author}{$msg} = $qunklist->files;
+            $stamptime{$msg} = $time;
+          }
+        }
+      }
+    }
+    undef (%$authorhash);
+
+    ### Now we can write out the ChangeLog!
+
+    my ($logfile_here, $logfile_bak, $tmpfile);
+    my $lastdate;
+
+    if (! $Output_To_Stdout) {
+      $logfile_here =  $dir . $Log_File_Name;
+      if (!$^O =~ /Win32/i) {
+        $logfile_here =~ s/^\.\/\//\//;   # fix any leading ".//" problem
+      }
+      else {
+        $logfile_here =~ s/^\.\/+//;      # remove any leading "./"
+      }
+      $tmpfile      = "${logfile_here}.cvs2cl$$.tmp";
+      $logfile_bak  = "${logfile_here}.bak";
+
+      open (LOG_OUT, ">$tmpfile") or die "Unable to open \"$tmpfile\"";
+    }
+    else {
+      open (LOG_OUT, ">-") or die "Unable to open stdout for writing";
+    }
+
+    print LOG_OUT $ChangeLog_Header;
+
+    my %tag_date_printed;
+
+    $self->output_header(\*LOG_OUT);
+
+    my @key_list = ();
+    if($Chronological_Order) {
+        @key_list = sort {$a <=> $b} (keys %changelog);
+    } else {
+        @key_list = sort {$b <=> $a} (keys %changelog);
+    }
+    foreach my $time (@key_list)
+    {
+      next if ($Delta_Mode &&
+               (($time <= $Delta_StartTime) ||
+                ($time > $Delta_EndTime && $Delta_EndTime)));
+
+      # Set up the date/author line.
+      # kff todo: do some more XML munging here, on the header
+      # part of the entry:
+      my (undef,$min,$hour,$mday,$mon,$year,$wday)
+          = $UTC_Times ? gmtime($time) : localtime($time);
+
+      $wday = $self->wday($wday);
+      # XML output includes everything else, we might as well make
+      # it always include Day Of Week too, for consistency.
+      my $authorhash = $changelog{$time};
+      if ( $Show_Tag_Dates || $XML_Output ) {
+        my %tags;
+        while (my ($author,$mesghash) = each %$authorhash) {
+          while (my ($msg,$qunk) = each %$mesghash) {
+            for my $qunkref2 (@$qunk) {
+              if (defined ($qunkref2->tags)) {
+                for my $tag (@{$qunkref2->tags}) {
+                  $tags{$tag} = 1;
+                }
+              }
+            }
+          }
+        }
+        # Sort here for determinism to ease testing
+        foreach my $tag (sort keys %tags) {
+          if ( ! defined $tag_date_printed{$tag} ) {
+            $tag_date_printed{$tag} = $time;
+            $self->output_tagdate(\*LOG_OUT, $time, $tag);
+          }
+        }
+      }
+      while (my ($author,$mesghash) = each %$authorhash)
+      {
+        # If XML, escape in outer loop to avoid compound quoting:
+        $author = $self->escape($author);
+
+      FOOBIE:
+        # We sort here to enable predictable ordering for the testing porpoises
+        for my $msg (sort keys %$mesghash)
+        {
+          my $qunklist = $mesghash->{$msg};
+
+          my @qunklist =
+            grep $self->_revision_is_wanted($_), @$qunklist;
+
+          next FOOBIE unless @qunklist;
+
+          my $files               = $self->pretty_file_list(\@qunklist);
+          my $header_line;          # date and author
+          my $wholething;           # $header_line + $body
+
+          my $date = $self->fdatetime($time);
+          $header_line = $self->header_line($time, $author, $lastdate);
+          $lastdate = $date;
+
+          $Text::Wrap::huge = 'overflow'
+            if $Text::Wrap::VERSION >= 2001.0130;
+          # Reshape the body according to user preferences.
+          my $body = $self->format_body($msg, $files, \@qunklist);
+
+          $body =~ s/[ \t]+\n/\n/g;
+          $wholething = $header_line . $body;
+
+          # One last check: make sure it passes the regexp test, if the
+          # user asked for that.  We have to do it here, so that the
+          # test can match against information in the header as well
+          # as in the text of the log message.
+
+          # How annoying to duplicate so much code just because I
+          # can't figure out a way to evaluate scalars on the trailing
+          # operator portion of a regular expression.  Grrr.
+          if ($Case_Insensitive) {
+            unless ( $Regexp_Gate and ( $wholething !~ /$Regexp_Gate/oi ) ) {
+              $self->output_entry(\*LOG_OUT, $wholething);
+            }
+          }
+          else {
+            unless ( $Regexp_Gate and ( $wholething !~ /$Regexp_Gate/o ) ) {
+              $self->output_entry(\*LOG_OUT, $wholething);
+            }
+          }
+        }
+      }
+    }
+
+    $self->output_footer(\*LOG_OUT);
+
+    close (LOG_OUT);
+
+    if ( ! $Output_To_Stdout ) {
+      # If accumulating, append old data to new before renaming.  But
+      # don't append the most recent entry, since it's already in the
+      # new log due to CVS's idiosyncratic interpretation of "log -d".
+      if ($Cumulative && -f $logfile_here) {
+        open NEW_LOG, ">>$tmpfile"
+          or die "trouble appending to $tmpfile ($!)";
+
+        open OLD_LOG, "<$logfile_here"
+          or die "trouble reading from $logfile_here ($!)";
+
+        my $started_first_entry = 0;
+        my $passed_first_entry = 0;
+        while (<OLD_LOG>) {
+          if ( ! $passed_first_entry ) {
+            if ( ( ! $started_first_entry )
+                and /^(\d\d\d\d-\d\d-\d\d\s+(\w+\s+)?\d\d:\d\d)/ ) {
+              $started_first_entry = 1;
+            } elsif ( /^(\d\d\d\d-\d\d-\d\d\s+(\w+\s+)?\d\d:\d\d)/ ) {
+              $passed_first_entry = 1;
+              print NEW_LOG $_;
+            }
+          } else {
+            print NEW_LOG $_;
+          }
+        }
+
+        close NEW_LOG;
+        close OLD_LOG;
+      }
+
+      if ( -f $logfile_here ) {
+        rename $logfile_here, $logfile_bak;
+      }
+      rename $tmpfile, $logfile_here;
+    }
+  }
+}
+
+# -------------------------------------
+
+# Don't call this wrap, because with 5.5.3, that clashes with the
+# (unconditional :-( ) export of wrap() from Text::Wrap
+sub mywrap {
+  my $self = shift;
+  my ($indent1, $indent2, @text) = @_;
+  # If incoming text looks preformatted, don't get clever
+  my $text = Text::Wrap::wrap($indent1, $indent2, @text);
+  if ( grep /^\s+/m, @text ) {
+    return $text;
+  }
+  my @lines = split /\n/, $text;
+  $indent2 =~ s!^((?: {8})+)!"\t" x (length($1)/8)!e;
+  $lines[0] =~ s/^$indent1\s+/$indent1/;
+  s/^$indent2\s+/$indent2/
+    for @lines[1..$#lines];
+  my $newtext = join "\n", @lines;
+  $newtext .= "\n"
+    if substr($text, -1) eq "\n";
+  return $newtext;
+}
+
+# -------------------------------------
+
+sub preprocess_msg_text {
+  my $self = shift;
+  my ($text) = @_;
+
+  # Strip out carriage returns (as they probably result from DOSsy editors).
+  $text =~ s/\r\n/\n/g;
+  # If it *looks* like two newlines, make it *be* two newlines:
+  $text =~ s/\n\s*\n/\n\n/g;
+
+  return $text;
+}
+
+# -------------------------------------
+
+sub last_line_len {
+  my $self = shift;
+
+  my $files_list = shift;
+  my @lines = split (/\n/, $files_list);
+  my $last_line = pop (@lines);
+  return length ($last_line);
+}
+
+# -------------------------------------
+
+# A custom wrap function, sensitive to some common constructs used in
+# log entries.
+sub wrap_log_entry {
+  my $self = shift;
+
+  my $text = shift;                  # The text to wrap.
+  my $left_pad_str = shift;          # String to pad with on the left.
+
+  # These do NOT take left_pad_str into account:
+  my $length_remaining = shift;      # Amount left on current line.
+  my $max_line_length  = shift;      # Amount left for a blank line.
+
+  my $wrapped_text = '';             # The accumulating wrapped entry.
+  my $user_indent = '';              # Inherited user_indent from prev line.
+
+  my $first_time = 1;                # First iteration of the loop?
+  my $suppress_line_start_match = 0; # Set to disable line start checks.
+
+  my @lines = split (/\n/, $text);
+  while (@lines)   # Don't use `foreach' here, it won't work.
+  {
+    my $this_line = shift (@lines);
+    chomp $this_line;
+
+    if ($this_line =~ /^(\s+)/) {
+      $user_indent = $1;
+    }
+    else {
+      $user_indent = '';
+    }
+
+    # If it matches any of the line-start regexps, print a newline now...
+    if ($suppress_line_start_match)
+    {
+      $suppress_line_start_match = 0;
+    }
+    elsif (($this_line =~ /^(\s*)\*\s+[a-zA-Z0-9]/)
+           || ($this_line =~ /^(\s*)\* [a-zA-Z0-9_\.\/\+-]+/)
+           || ($this_line =~ /^(\s*)\([a-zA-Z0-9_\.\/\+-]+(\)|,\s*)/)
+           || ($this_line =~ /^(\s+)(\S+)/)
+           || ($this_line =~ /^(\s*)- +/)
+           || ($this_line =~ /^()\s*$/)
+           || ($this_line =~ /^(\s*)\*\) +/)
+           || ($this_line =~ /^(\s*)[a-zA-Z0-9](\)|\.|\:) +/))
+    {
+      # Make a line break immediately, unless header separator is set
+      # and this line is the first line in the entry, in which case
+      # we're getting the blank line for free already and shouldn't
+      # add an extra one.
+      unless (($After_Header ne " ") and ($first_time))
+      {
+        if ($this_line =~ /^()\s*$/) {
+          $suppress_line_start_match = 1;
+          $wrapped_text .= "\n${left_pad_str}";
+        }
+
+        $wrapped_text .= "\n${left_pad_str}";
+      }
+
+      $length_remaining = $max_line_length - (length ($user_indent));
+    }
+
+    # Now that any user_indent has been preserved, strip off leading
+    # whitespace, so up-folding has no ugly side-effects.
+    $this_line =~ s/^\s*//;
+
+    # Accumulate the line, and adjust parameters for next line.
+    my $this_len = length ($this_line);
+    if ($this_len == 0)
+    {
+      # Blank lines should cancel any user_indent level.
+      $user_indent = '';
+      $length_remaining = $max_line_length;
+    }
+    elsif ($this_len >= $length_remaining) # Line too long, try breaking it.
+    {
+      # Walk backwards from the end.  At first acceptable spot, break
+      # a new line.
+      my $idx = $length_remaining - 1;
+      if ($idx < 0) { $idx = 0 };
+      while ($idx > 0)
+      {
+        if (substr ($this_line, $idx, 1) =~ /\s/)
+        {
+          my $line_now = substr ($this_line, 0, $idx);
+          my $next_line = substr ($this_line, $idx);
+          $this_line = $line_now;
+
+          # Clean whitespace off the end.
+          chomp $this_line;
+
+          # The current line is ready to be printed.
+          $this_line .= "\n${left_pad_str}";
+
+          # Make sure the next line is allowed full room.
+          $length_remaining = $max_line_length - (length ($user_indent));
+
+          # Strip next_line, but then preserve any user_indent.
+          $next_line =~ s/^\s*//;
+
+          # Sneak a peek at the user_indent of the upcoming line, so
+          # $next_line (which will now precede it) can inherit that
+          # indent level.  Otherwise, use whatever user_indent level
+          # we currently have, which might be none.
+          my $next_next_line = shift (@lines);
+          if ((defined ($next_next_line)) && ($next_next_line =~ /^(\s+)/)) {
+            $next_line = $1 . $next_line if (defined ($1));
+            # $length_remaining = $max_line_length - (length ($1));
+            $next_next_line =~ s/^\s*//;
+          }
+          else {
+            $next_line = $user_indent . $next_line;
+          }
+          if (defined ($next_next_line)) {
+            unshift (@lines, $next_next_line);
+          }
+          unshift (@lines, $next_line);
+
+          # Our new next line might, coincidentally, begin with one of
+          # the line-start regexps, so we temporarily turn off
+          # sensitivity to that until we're past the line.
+          $suppress_line_start_match = 1;
+
+          last;
+        }
+        else
+        {
+          $idx--;
+        }
+      }
+
+      if ($idx == 0)
+      {
+        # We bottomed out because the line is longer than the
+        # available space.  But that could be because the space is
+        # small, or because the line is longer than even the maximum
+        # possible space.  Handle both cases below.
+
+        if ($length_remaining == ($max_line_length - (length ($user_indent))))
+        {
+          # The line is simply too long -- there is no hope of ever
+          # breaking it nicely, so just insert it verbatim, with
+          # appropriate padding.
+          $this_line = "\n${left_pad_str}${this_line}";
+        }
+        else
+        {
+          # Can't break it here, but may be able to on the next round...
+          unshift (@lines, $this_line);
+          $length_remaining = $max_line_length - (length ($user_indent));
+          $this_line = "\n${left_pad_str}";
+        }
+      }
+    }
+    else  # $this_len < $length_remaining, so tack on what we can.
+    {
+      # Leave a note for the next iteration.
+      $length_remaining = $length_remaining - $this_len;
+
+      if ($this_line =~ /\.$/)
+      {
+        $this_line .= "  ";
+        $length_remaining -= 2;
+      }
+      else  # not a sentence end
+      {
+        $this_line .= " ";
+        $length_remaining -= 1;
+      }
+    }
+
+    # Unconditionally indicate that loop has run at least once.
+    $first_time = 0;
+
+    $wrapped_text .= "${user_indent}${this_line}";
+  }
+
+  # One last bit of padding.
+  $wrapped_text .= "\n";
+
+  return $wrapped_text;
+}
+
+# -------------------------------------
+
+sub _pretty_file_list {
+  my $self = shift;
+
+  my ($unanimous_tags, $non_unanimous_tags, $all_branches, $qunksref) = @_;
+
+  my @qunkrefs =
+    grep +( ( ! $_->tags_exists
+              or
+              ! grep exists $ignore_tags{$_}, @{$_->tags})
+            and
+            ( ! keys %show_tags
+              or
+              ( $_->tags_exists
+                and
+                grep exists $show_tags{$_}, @{$_->tags} )
+            )
+          ),
+    @$qunksref;
+
+  my $common_dir;           # Dir prefix common to all files ('' if none)
+
+  # First, loop over the qunks gathering all the tag/branch names.
+  # We'll put them all in non_unanimous_tags, and take out the
+  # unanimous ones later.
+ QUNKREF:
+  foreach my $qunkref (@qunkrefs)
+  {
+    # Keep track of whether all the files in this commit were in the
+    # same directory, and memorize it if so.  We can make the output a
+    # little more compact by mentioning the directory only once.
+    if ($Common_Dir && (scalar (@qunkrefs)) > 1)
+    {
+      if (! (defined ($common_dir)))
+      {
+        my ($base, $dir);
+        ($base, $dir, undef) = fileparse ($qunkref->filename);
+
+        if ((! (defined ($dir)))  # this first case is sheer paranoia
+            or ($dir eq '')
+            or ($dir eq "./")
+            or ($dir eq ".\\"))
+        {
+          $common_dir = '';
+        }
+        else
+        {
+          $common_dir = $dir;
+        }
+      }
+      elsif ($common_dir ne '')
+      {
+        # Already have a common dir prefix, so how much of it can we preserve?
+        $common_dir = &main::common_path_prefix ($qunkref->filename, $common_dir);
+      }
+    }
+    else  # only one file in this entry anyway, so common dir not an issue
+    {
+      $common_dir = '';
+    }
+
+    if (defined ($qunkref->branch)) {
+      $all_branches->{$qunkref->branch} = 1;
+    }
+    if (defined ($qunkref->tags)) {
+      foreach my $tag (@{$qunkref->tags}) {
+        $non_unanimous_tags->{$tag} = 1;
+      }
+    }
+  }
+
+  # Any tag held by all qunks will be printed specially... but only if
+  # there are multiple qunks in the first place!
+  if ((scalar (@qunkrefs)) > 1) {
+    foreach my $tag (keys (%$non_unanimous_tags)) {
+      my $everyone_has_this_tag = 1;
+      foreach my $qunkref (@qunkrefs) {
+        if ((! (defined ($qunkref->tags)))
+            or (! (grep ($_ eq $tag, @{$qunkref->tags})))) {
+          $everyone_has_this_tag = 0;
+        }
+      }
+      if ($everyone_has_this_tag) {
+        $unanimous_tags->{$tag} = 1;
+        delete $non_unanimous_tags->{$tag};
+      }
+    }
+  }
+
+  return $common_dir, \@qunkrefs;
+}
+
+# -------------------------------------
+
+sub fdatetime {
+  my $self = shift;
+
+  my ($year, $mday, $mon, $wday, $hour, $min);
+
+  if ( @_ > 1 ) {
+    ($year, $mday, $mon, $wday, $hour, $min) = @_;
+  } else {
+    my ($time) = @_;
+    (undef, $min, $hour, $mday, $mon, $year, $wday) =
+      $UTC_Times ? gmtime($time) : localtime($time);
+
+    $year += 1900;
+    $mon  += 1;
+    $wday  = $self->wday($wday);
+  }
+
+  my $fdate = $self->fdate($year, $mon, $mday, $wday);
+
+  if ($Show_Times) {
+    my $ftime = $self->ftime($hour, $min);
+    return "$fdate $ftime";
+  } else {
+    return $fdate;
+  }
+}
+
+# -------------------------------------
+
+sub fdate {
+  my $self = shift;
+
+  my ($year, $mday, $mon, $wday);
+
+  if ( @_ > 1 ) {
+    ($year, $mon, $mday, $wday) = @_;
+  } else {
+    my ($time) = @_;
+    (undef, undef, undef, $mday, $mon, $year, $wday) =
+      $UTC_Times ? gmtime($time) : localtime($time);
+
+    $year += 1900;
+    $mon  += 1;
+    $wday  = $self->wday($wday);
+  }
+
+  return sprintf '%4u-%02u-%02u%s', $year, $mon, $mday, $wday;
+}
+
+# -------------------------------------
+
+sub ftime {
+  my $self = shift;
+
+  my ($hour, $min);
+
+  if ( @_ > 1 ) {
+    ($hour, $min) = @_;
+  } else {
+    my ($time) = @_;
+    (undef, $min, $hour) = $UTC_Times ? gmtime($time) : localtime($time);
+  }
+
+  return sprintf '%02u:%02u', $hour, $min;
+}
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::Message;
+
+sub new {
+  my $class = shift;
+  my ($msg) = @_;
+
+  my %self = (msg => $msg, files => []);
+
+  bless \%self, $class;
+}
+
+sub add_fileentry {
+  my $self = shift;
+  my ($fileentry) = @_;
+
+  die "Not a fileentry: $fileentry"
+    unless $fileentry->isa('CVS::Utils::ChangeLog::FileEntry');
+
+  push @{$self->{files}}, $fileentry;
+}
+
+sub files { wantarray ? @{$_[0]->{files}} : $_[0]->{files} }
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::FileEntry;
+
+use File::Basename qw( fileparse );
+
+# Each revision of a file has a little data structure (a `qunk')
+# associated with it.  That data structure holds not only the
+# file's name, but any additional information about the file
+# that might be needed in the output, such as the revision
+# number, tags, branches, etc.  The reason to have these things
+# arranged in a data structure, instead of just appending them
+# textually to the file's name, is that we may want to do a
+# little rearranging later as we write the output.  For example,
+# all the files on a given tag/branch will go together, followed
+# by the tag in parentheses (so trunk or otherwise non-tagged
+# files would go at the end of the file list for a given log
+# message).  This rearrangement is a lot easier to do if we
+# don't have to reparse the text.
+#
+# A qunk looks like this:
+#
+#   {
+#     filename    =>    "hello.c",
+#     revision    =>    "1.4.3.2",
+#     time        =>    a timegm() return value (moment of commit)
+#     tags        =>    [ "tag1", "tag2", ... ],
+#     branch      =>    "branchname" # There should be only one, right?
+#     roots       =>    [ "branchtag1", "branchtag2", ... ]
+#     lines       =>    "+x -y" # or undefined; x and y are integers
+#   }
+
+# Single top-level ChangeLog, or one per subdirectory?
+my $distributed;
+sub distributed { $#_ ? ($distributed = $_[1]) : $distributed; }
+
+sub new {
+  my $class = shift;
+  my ($path, $time, $revision, $state, $lines,
+      $branch_names, $branch_roots, $branch_numbers, $symbolic_names) = @_;
+
+  my %self = (time     => $time,
+              revision => $revision,
+              state    => $state,
+              lines    => $lines,
+              branch_numbers => $branch_numbers,
+             );
+
+  if ( $distributed ) {
+    @self{qw(filename dir_key)} = fileparse($path);
+  } else {
+    @self{qw(filename dir_key)} = ($path, './');
+  }
+
+  { # Scope for $branch_prefix
+    (my ($branch_prefix) = ($revision =~ /((?:\d+\.)+)\d+/));
+    $branch_prefix =~ s/\.$//;
+    if ( $branch_names->{$branch_prefix} ) {
+      my $branch_name = $branch_names->{$branch_prefix};
+      $self{branch}   = $branch_name;
+      $self{branches} = [$branch_name];
+    }
+    while ( $branch_prefix =~ s/^(\d+(?:\.\d+\.\d+)+)\.\d+\.\d+$/$1/ ) {
+      push @{$self{branches}}, $branch_names->{$branch_prefix}
+        if exists $branch_names->{$branch_prefix};
+    }
+  }
+
+  # If there's anything in the @branch_roots array, then this
+  # revision is the root of at least one branch.  We'll display
+  # them as branch names instead of revision numbers, the
+  # substitution for which is done directly in the array:
+  $self{'roots'} = [ map { $branch_names->{$_} } @$branch_roots ]
+    if @$branch_roots;
+
+  if ( exists $symbolic_names->{$revision} ) {
+    $self{tags} = delete $symbolic_names->{$revision};
+    &main::delta_check($time, $self{tags});
+  }
+
+  bless \%self, $class;
+}
+
+sub filename       { $_[0]->{filename}       }
+sub dir_key        { $_[0]->{dir_key}        }
+sub revision       { $_[0]->{revision}       }
+sub branch         { $_[0]->{branch}         }
+sub state          { $_[0]->{state}          }
+sub lines          { $_[0]->{lines}          }
+sub roots          { $_[0]->{roots}          }
+sub branch_numbers { $_[0]->{branch_numbers} }
+
+sub tags        { $_[0]->{tags}     }
+sub tags_exists {
+  exists $_[0]->{tags};
+}
+
+# This may someday be used in a more sophisticated calculation of what other
+# files are involved in this commit.  For now, we don't use it much except for
+# delta mode, because the common-commit-detection algorithm is hypothesized to
+# be "good enough" as it stands.
+sub time     { $_[0]->{time}     }
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySetBuilder;
+
+use File::Basename qw( fileparse );
+use Time::Local    qw( timegm );
+
+use constant MAILNAME => "/etc/mailname";
+
+# In 'cvs log' output, one long unbroken line of equal signs separates files:
+use constant FILE_SEPARATOR => '=' x 77;# . "\n";
+# In 'cvs log' output, a shorter line of dashes separates log messages within
+# a file:
+use constant REV_SEPARATOR  => '-' x 28;# . "\n";
+
+use constant EMPTY_LOG_MESSAGE => '*** empty log message ***';
+
+# -------------------------------------
+
+sub new {
+  my ($proto) = @_;
+  my $class = ref $proto || $proto;
+
+  my $poobah  = CVS::Utils::ChangeLog::EntrySet->new;
+  my $self = bless +{ grand_poobah => $poobah }, $class;
+
+  $self->clear_file;
+  $self->maybe_read_user_map_file;
+  return $self;
+}
+
+# -------------------------------------
+
+sub clear_msg {
+  my ($self) = @_;
+
+  # Make way for the next message
+  undef $self->{rev_msg};
+  undef $self->{rev_time};
+  undef $self->{rev_revision};
+  undef $self->{rev_author};
+  undef $self->{rev_state};
+  undef $self->{lines};
+  $self->{rev_branch_roots} = [];       # For showing which files are branch
+                                        # ancestors.
+  $self->{collecting_symbolic_names} = 0;
+}
+
+# -------------------------------------
+
+sub clear_file {
+  my ($self) = @_;
+  $self->clear_msg;
+
+  undef $self->{filename};
+  $self->{branch_names}   = +{};        # We'll grab branch names while we're
+                                        # at it.
+  $self->{branch_numbers} = +{};        # Save some revisions for
+                                        # @Follow_Branches
+  $self->{symbolic_names} = +{};        # Where tag names get stored.
+}
+
+# -------------------------------------
+
+sub grand_poobah { $_[0]->{grand_poobah} }
+
+# -------------------------------------
+
+sub read_changelog {
+  my ($self, $command) = @_;
+
+  local (*READER);
+  my $pid;
+  if (! $Input_From_Stdin) {
+    if ($^O =~ /Win32/i) {
+      open (READER, "@$command |")
+        or die "unable to run \"@$command\"";
+    }
+    else {
+      local (*WRITER);
+      pipe(READER, WRITER)
+        or die "Couldn't form pipe: $!\n";
+      $pid = fork;
+      if (! defined $pid) {
+        die "Couldn't fork: $!\n";
+      }
+      if ( ! $pid ) { # child
+        open STDOUT, '>&=' . fileno WRITER
+          or die "Couldn't dup stderr to ", fileno WRITER, "\n";
+        # strangely, some perls give spurious warnings about STDIN being opened
+        # for output only these close calls precede the STDOUT reopen above.
+        # I think they must be reusing fd 1.
+        close READER;
+        close STDIN;
+
+        exec @$command;
+      }
+
+      close WRITER;
+    }
+
+    &main::debug ("(run \"@$command\")\n");
+  }
+  else {
+    open READER, '-' or die "unable to open stdin for reading";
+  }
+
+  binmode READER;
+
+ XX_Log_Source:
+  while (<READER>) {
+    chomp;
+    s!\r$!!;
+
+    # If on a new file and don't see filename, skip until we find it, and
+    # when we find it, grab it.
+    if ( ! defined $self->{filename} ) {
+      $self->read_file_path($_);
+    } elsif ( /^symbolic names:$/ ) {
+      $self->{collecting_symbolic_names} = 1;
+    } elsif ( $self->{collecting_symbolic_names} ) {
+      $self->read_symbolic_name($_);
+    } elsif ( $_ eq FILE_SEPARATOR and ! defined $self->{rev_revision} ) {
+      $self->clear_file;
+    } elsif ( ! defined $self->{rev_revision} ) {
+        # If have file name, but not revision, and see revision, then grab
+        # it.  (We collect unconditionally, even though we may or may not
+        # ever use it.)
+      $self->read_revision($_);
+    } elsif ( ! defined $self->{rev_time} ) { # and /^date: /) {
+      $self->read_date_author_and_state($_);
+    } elsif ( /^branches:\s+(.*);$/ ) {
+      $self->read_branches($1);
+    } elsif ( ! ( $_ eq FILE_SEPARATOR or $_ eq REV_SEPARATOR ) ) {
+      # If have file name, time, and author, then we're just grabbing
+      # log message texts:
+      $self->{rev_msg} .= $_ . "\n";   # Normally, just accumulate the message...
+    } else {
+      my $noadd = 0;
+      if ( ! $self->{rev_msg}
+           or $self->{rev_msg} =~ /^\s*(\.\s*)?$/
+           or index($self->{rev_msg}, EMPTY_LOG_MESSAGE) > -1 ) {
+        # ... until a msg separator is encountered:
+        # Ensure the message contains something:
+        $self->clear_msg, $noadd = 1
+          if $Prune_Empty_Msgs;
+        $self->{rev_msg} = "[no log message]\n";
+      }
+
+      $self->add_file_entry
+        unless $noadd;
+
+      if ( $_ eq FILE_SEPARATOR ) {
+        $self->clear_file;
+      } else {
+        $self->clear_msg;
+      }
+    }
+  }
+
+  close READER
+    or die "Couldn't close pipe reader: $!\n";
+  if ( defined $pid ) {
+    my $rv;
+    waitpid $pid, 0;
+    0 == $?
+      or $!=1, die sprintf("Problem reading log input (pid/exit/signal/core: %d/%d/%d/%d)\n",
+                           $pid, $? >> 8, $? & 127, $? & 128);
+  }
+  return;
+}
+
+# -------------------------------------
+
+sub add_file_entry {
+  $_[0]->grand_poobah->add_fileentry(@{$_[0]}{qw(filename rev_time rev_revision
+                                                 rev_state lines branch_names
+                                                 rev_branch_roots
+                                                 branch_numbers
+                                                 symbolic_names
+                                                 rev_author rev_msg)});
+}
+
+# -------------------------------------
+
+sub maybe_read_user_map_file {
+  my ($self) = @_;
+
+  my %expansions;
+  my $User_Map_Input;
+
+  if ($User_Map_File)
+  {
+    if ( $User_Map_File =~ m{^([-\w\@+=.,\/]+):([-\w\@+=.,\/:]+)} and
+         !-f $User_Map_File )
+    {
+      my $rsh = (exists $ENV{'CVS_RSH'} ? $ENV{'CVS_RSH'} : 'ssh');
+      $User_Map_Input = "$rsh $1 'cat $2' |";
+      &main::debug ("(run \"${User_Map_Input}\")\n");
+    }
+    else
+    {
+      $User_Map_Input = "<$User_Map_File";
+    }
+
+    open (MAPFILE, $User_Map_Input)
+        or die ("Unable to open $User_Map_File ($!)");
+
+    while (<MAPFILE>)
+    {
+      next if /^\s*#/;  # Skip comment lines.
+      next if not /:/;  # Skip lines without colons.
+
+      # It is now safe to split on ':'.
+      my ($username, $expansion) = split ':';
+      chomp $expansion;
+      $expansion =~ s/^'(.*)'$/$1/;
+      $expansion =~ s/^"(.*)"$/$1/;
+
+      # If it looks like the expansion has a real name already, then
+      # we toss the username we got from CVS log.  Otherwise, keep
+      # it to use in combination with the email address.
+
+      if ($expansion =~ /^\s*<{0,1}\S+@.*/) {
+        # Also, add angle brackets if none present
+        if (! ($expansion =~ /<\S+@\S+>/)) {
+          $expansions{$username} = "$username <$expansion>";
+        }
+        else {
+          $expansions{$username} = "$username $expansion";
+        }
+      }
+      else {
+        $expansions{$username} = $expansion;
+      }
+    } # fi ($User_Map_File)
+
+    close (MAPFILE);
+  }
+
+  if (defined $User_Passwd_File)
+  {
+    if ( ! defined $Domain ) {
+      if ( -e MAILNAME ) {
+        chomp($Domain = slurp_file(MAILNAME));
+      } else {
+      MAILDOMAIN_CMD:
+        for ([qw(hostname -d)], 'dnsdomainname', 'domainname') {
+          my ($text, $exit, $sig, $core) = run_ext($_);
+          if ( $exit == 0 && $sig == 0 && $core == 0 ) {
+            chomp $text;
+            if ( length $text ) {
+              $Domain = $text;
+              last MAILDOMAIN_CMD;
+            }
+          }
+        }
+      }
+    }
+
+    die "No mail domain found\n"
+      unless defined $Domain;
+
+    open (MAPFILE, "<$User_Passwd_File")
+        or die ("Unable to open $User_Passwd_File ($!)");
+    while (<MAPFILE>)
+    {
+      # all lines are valid
+      my ($username, $pw, $uid, $gid, $gecos, $homedir, $shell) = split ':';
+      my $expansion = '';
+      ($expansion) = split (',', $gecos)
+        if defined $gecos && length $gecos;
+
+      my $mailname = $Domain eq '' ? $username : "$username\@$Domain";
+      $expansions{$username} = "$expansion <$mailname>";
+    }
+    close (MAPFILE);
+  }
+
+ $self->{usermap} = \%expansions;
+}
+
+# -------------------------------------
+
+sub read_file_path {
+  my ($self, $line) = @_;
+
+  my $path;
+
+  if ( $line =~ /^Working file: (.*)/ ) {
+    $path = $1;
+  } elsif ( defined $RCS_Root
+            and
+            $line =~ m|^RCS file: $RCS_Root[/\\](.*),v$| ) {
+    $path = $1;
+    $path =~ s!Attic/!!;
+  } else {
+    return;
+  }
+
+  if ( @Ignore_Files ) {
+    my $base;
+    ($base, undef, undef) = fileparse($path);
+
+    my $xpath = $Case_Insensitive ? lc($path) : $path;
+    return
+      if grep $path =~ /$_/, @Ignore_Files;
+  }
+
+  $self->{filename} = $path;
+  return;
+}
+
+# -------------------------------------
+
+sub read_symbolic_name {
+  my ($self, $line) = @_;
+
+  # All tag names are listed with whitespace in front in cvs log
+  # output; so if see non-whitespace, then we're done collecting.
+  if ( /^\S/ ) {
+    $self->{collecting_symbolic_names} = 0;
+    return;
+  } else {
+    # we're looking at a tag name, so parse & store it
+
+    # According to the Cederqvist manual, in node "Tags", tag names must start
+    # with an uppercase or lowercase letter and can contain uppercase and
+    # lowercase letters, digits, `-', and `_'.  However, it's not our place to
+    # enforce that, so we'll allow anything CVS hands us to be a tag:
+    my ($tag_name, $tag_rev) = ($line =~ /^\s+([^:]+): ([\d.]+)$/);
+
+    # A branch number either has an odd number of digit sections
+    # (and hence an even number of dots), or has ".0." as the
+    # second-to-last digit section.  Test for these conditions.
+    my $real_branch_rev = '';
+    if ( $tag_rev =~ /^(\d+\.\d+\.)+\d+$/             # Even number of dots...
+         and
+         $tag_rev !~ /^(1\.)+1$/ ) {                  # ...but not "1.[1.]1"
+      $real_branch_rev = $tag_rev;
+    } elsif ($tag_rev =~ /(\d+\.(\d+\.)+)0.(\d+)/) {  # Has ".0."
+      $real_branch_rev = $1 . $3;
+    }
+
+    # If we got a branch, record its number.
+    if ( $real_branch_rev ) {
+      $self->{branch_names}->{$real_branch_rev} = $tag_name;
+      $self->{branch_numbers}->{$tag_name} = $real_branch_rev;
+    } else {
+      # Else it's just a regular (non-branch) tag.
+      push @{$self->{symbolic_names}->{$tag_rev}}, $tag_name;
+    }
+  }
+
+  $self->{collecting_symbolic_names} = 1;
+  return;
+}
+
+# -------------------------------------
+
+sub read_revision {
+  my ($self, $line) = @_;
+
+  my ($revision) = ( $line =~ /^revision (\d+\.[\d.]+)/ );
+
+  return
+    unless $revision;
+
+  $self->{rev_revision} = $revision;
+  return;
+}
+
+# -------------------------------------
+
+{ # Closure over %gecos_warned
+my %gecos_warned;
+sub read_date_author_and_state {
+  my ($self, $line) = @_;
+
+  my ($time, $author, $state) = $self->parse_date_author_and_state($line);
+
+  if ( defined($self->{usermap}->{$author}) and $self->{usermap}->{$author} ) {
+    $author = $self->{usermap}->{$author};
+  } elsif ( defined $Domain or $Gecos == 1 ) {
+    my $email = $author;
+    $email = $author."@".$Domain
+      if defined $Domain && $Domain ne '';
+
+    my $pw = getpwnam($author);
+    my ($fullname, $office, $workphone, $homephone, $gcos);
+    if ( defined $pw ) {
+      $gcos = (getpwnam($author))[6];
+      ($fullname, $office, $workphone, $homephone) =
+        split /\s*,\s*/, $gcos;
+    } else {
+      warn "Couldn't find gecos info for author '$author'\n"
+        unless $gecos_warned{$author}++;
+      $fullname = '';
+    }
+    for (grep defined, $fullname, $office, $workphone, $homephone) {
+      s/&/ucfirst(lc($pw))/ge;
+    }
+    $author = $fullname . "  <" . $email . ">"
+      if defined $fullname && $fullname ne '';
+  }
+
+  $self->{rev_state}  = $state;
+  $self->{rev_time}   = $time;
+  $self->{rev_author} = $author;
+  return;
+}
+}
+
+# -------------------------------------
+
+sub read_branches {
+  # A "branches: ..." line here indicates that one or more branches
+  # are rooted at this revision.  If we're showing branches, then we
+  # want to show that fact as well, so we collect all the branches
+  # that this is the latest ancestor of and store them in
+  # $self->[rev_branch_roots}.  Just for reference, the format of the
+  # line we're seeing at this point is:
+  #
+  #    branches:  1.5.2;  1.5.4;  ...;
+  #
+  # Okay, here goes:
+  my ($self, $line) = @_;
+
+  # Ugh.  This really bothers me.  Suppose we see a log entry
+  # like this:
+  #
+  #    ----------------------------
+  #    revision 1.1
+  #    date: 1999/10/17 03:07:38;  author: jrandom;  state: Exp;
+  #    branches:  1.1.2;
+  #    Intended first line of log message begins here.
+  #    ----------------------------
+  #
+  # The question is, how we can tell the difference between that
+  # log message and a *two*-line log message whose first line is
+  #
+  #    "branches:  1.1.2;"
+  #
+  # See the problem?  The output of "cvs log" is inherently
+  # ambiguous.
+  #
+  # For now, we punt: we liberally assume that people don't
+  # write log messages like that, and just toss a "branches:"
+  # line if we see it but are not showing branches.  I hope no
+  # one ever loses real log data because of this.
+  if ( $Show_Branches ) {
+    $line =~ s/(1\.)+1;|(1\.)+1$//;  # ignore the trivial branch 1.1.1
+    $self->{rev_branch_roots} = [split /;\s+/, $line]
+      if length $line;
+  }
+}
+
+# -------------------------------------
+
+sub parse_date_author_and_state {
+  my ($self, $line) = @_;
+  # Parses the date/time and author out of a line like:
+  #
+  # date: 1999/02/19 23:29:05;  author: apharris;  state: Exp;
+  #
+  # or, in CVS 1.12.9:
+  #
+  # date: 2004-06-05 16:10:32 +0000; author: somebody; state: Exp;
+
+  my ($year, $mon, $mday, $hours, $min, $secs, $utcOffset, $author, $state, $rest) =
+    $line =~
+      m!(\d+)[-/](\d+)[-/](\d+)\s+(\d+):(\d+):(\d+)(\s+[+-]\d{4})?;\s+
+        author:\s+([^;]+);\s+state:\s+([^;]+);(.*)!x
+    or  die "Couldn't parse date ``$line''";
+  die "Bad date or Y2K issues"
+    unless $year > 1969 and $year < 2258;
+  # Kinda arbitrary, but useful as a sanity check
+  my $time = timegm($secs, $min, $hours, $mday, $mon-1, $year-1900);
+  if ( defined $utcOffset ) {
+    my ($plusminus, $hour, $minute) = ($utcOffset =~ m/([+-])(\d\d)(\d\d)/);
+    my $offset = (($hour * 60) + $minute) * 60 * ($plusminus eq '+' ? -1 : 1);
+    $time += $offset;
+  }
+  if ( $rest =~ m!\s+lines:\s+(.*)! ) {
+    $self->{lines} = $1;
+  }
+
+  return $time, $author, $state;
+}
+
+# Subrs ----------------------------------------------------------------------
+
+package main;
+
+sub delta_check {
+  my ($time, $tags) = @_;
+
+  # If we're in 'delta' mode, update the latest observed times for the
+  # beginning and ending tags, and when we get around to printing output, we
+  # will simply restrict ourselves to that timeframe...
+  return
+    unless $Delta_Mode;
+
+  $Delta_StartTime = $time
+    if $time > $Delta_StartTime and $Delta_From and grep { $_ eq $Delta_From } @$tags;
+
+  $Delta_EndTime = $time
+    if $time > $Delta_EndTime and $Delta_To and grep { $_ eq $Delta_To } @$tags;
+}
+
+sub run_ext {
+  my ($cmd) = @_;
+  $cmd = [$cmd]
+    unless ref $cmd;
+  local $" = ' ';
+  my $out = qx"@$cmd 2>&1";
+  my $rv  = $?;
+  my ($sig, $core, $exit) = ($? & 127, $? & 128, $? >> 8);
+  return $out, $exit, $sig, $core;
+}
+
+# -------------------------------------
+
+# If accumulating, grab the boundary date from pre-existing ChangeLog.
+sub maybe_grab_accumulation_date {
+  if (! $Cumulative || $Update) {
+    return '';
+  }
+
+  # else
+
+  open (LOG, "$Log_File_Name")
+      or die ("trouble opening $Log_File_Name for reading ($!)");
+
+  my $boundary_date;
+  while (<LOG>)
+  {
+    if (/^(\d\d\d\d-\d\d-\d\d\s+(\w+\s+)?\d\d:\d\d)/)
+    {
+      $boundary_date = "$1";
+      last;
+    }
+  }
+
+  close (LOG);
+
+  # convert time from utc to local timezone if the ChangeLog has
+  # dates/times in utc
+  if ($UTC_Times && $boundary_date)
+  {
+    # convert the utc time to a time value
+    my ($year,$mon,$mday,$hour,$min) = $boundary_date =~
+      m#(\d+)-(\d+)-(\d+)\s+(\d+):(\d+)#;
+    my $time = timegm(0,$min,$hour,$mday,$mon-1,$year-1900);
+    # print the timevalue in the local timezone
+    my ($ignore,$wday);
+    ($ignore,$min,$hour,$mday,$mon,$year,$wday) = localtime($time);
+    $boundary_date=sprintf ("%4u-%02u-%02u %02u:%02u",
+                            $year+1900,$mon+1,$mday,$hour,$min);
+  }
+
+  return $boundary_date;
+}
+
+# -------------------------------------
+
+# Fills up a ChangeLog structure in the current directory.
+sub derive_changelog {
+  my ($command) = @_;
+
+  # See "The Plan" above for a full explanation.
+
+  # Might be adding to an existing ChangeLog
+  my $accumulation_date = maybe_grab_accumulation_date;
+  if ($accumulation_date) {
+    # Insert -d immediately after 'cvs log'
+    my $Log_Date_Command = "-d>${accumulation_date}";
+
+    my ($log_index) = grep $command->[$_] eq 'log', 0..$#$command;
+    splice @$command, $log_index+1, 0, $Log_Date_Command;
+    &debug ("(adding log msg starting from $accumulation_date)\n");
+  }
+
+#  output_changelog(read_changelog($command));
+  my $builder = CVS::Utils::ChangeLog::EntrySetBuilder->new;
+  $builder->read_changelog($command);
+  $builder->grand_poobah->output_changelog;
+}
+
+# -------------------------------------
+
+sub min { $_[0] < $_[1] ? $_[0] : $_[1] }
+
+# -------------------------------------
+
+sub common_path_prefix {
+  my ($path1, $path2) = @_;
+
+  # For compatibility (with older versions of cvs2cl.pl), we think in UN*X
+  # terms, and mould windoze filenames to match.  Is this really appropriate?
+  # If a file is checked in under UN*X, and cvs log run on windoze, which way
+  # do the path separators slope?  Can we use fileparse as per the local
+  # conventions?  If so, we should probably have a user option to specify an
+  # OS to emulate to handle stdin-fed logs.  If we did this, we could avoid
+  # the nasty \-/ transmogrification below.
+
+  my ($dir1, $dir2) = map +(fileparse($_))[1], $path1, $path2;
+
+  # Transmogrify Windows filenames to look like Unix.
+  # (It is far more likely that someone is running cvs2cl.pl under
+  # Windows than that they would genuinely have backslashes in their
+  # filenames.)
+  tr!\\!/!
+    for $dir1, $dir2;
+
+  my ($accum1, $accum2, $last_common_prefix) = ('') x 3;
+
+  my @path1 = grep length($_), split qr!/!, $dir1;
+  my @path2 = grep length($_), split qr!/!, $dir2;
+
+  my @common_path;
+  for (0..min($#path1,$#path2)) {
+    if ( $path1[$_] eq $path2[$_]) {
+      push @common_path, $path1[$_];
+    } else {
+      last;
+    }
+  }
+
+  return join '', map "$_/", @common_path;
+}
+
+# -------------------------------------
+
+sub parse_options {
+  # Check this internally before setting the global variable.
+  my $output_file;
+
+  # If this gets set, we encountered unknown options and will exit at
+  # the end of this subroutine.
+  my $exit_with_admonishment = 0;
+
+  # command to generate the log
+  my @log_source_command = qw( cvs log );
+
+  my (@Global_Opts, @Local_Opts);
+
+  Getopt::Long::Configure(qw( bundling permute no_getopt_compat
+                              pass_through no_ignore_case ));
+  GetOptions('help|usage|h'   => \$Print_Usage,
+             'debug'          => \$Debug,        # unadvertised option, heh
+             'version'        => \$Print_Version,
+
+             'file|f=s'       => \$output_file,
+             'accum'          => \$Cumulative,
+             'update'         => \$Update,
+             'fsf'            => \$FSF_Style,
+             'rcs=s'          => \$RCS_Root,
+             'usermap|U=s'    => \$User_Map_File,
+             'gecos'          => \$Gecos,
+             'domain=s'       => \$Domain,
+             'passwd=s'       => \$User_Passwd_File,
+             'window|W=i'     => \$Max_Checkin_Duration,
+             'chrono'         => \$Chronological_Order,
+             'ignore|I=s'     => \@Ignore_Files,
+             'case-insensitive|C' => \$Case_Insensitive,
+             'regexp|R=s'     => \$Regexp_Gate,
+             'stdin'          => \$Input_From_Stdin,
+             'stdout'         => \$Output_To_Stdout,
+             'distributed|d'  => sub { CVS::Utils::ChangeLog::FileEntry->distributed(1) },
+             'prune|P'        => \$Prune_Empty_Msgs,
+             'no-wrap'        => \$No_Wrap,
+             'gmt|utc'        => \$UTC_Times,
+             'day-of-week|w'  => \$Show_Day_Of_Week,
+             'revisions|r'    => \$Show_Revisions,
+             'show-dead'      => \$Show_Dead,
+             'tags|t'         => \$Show_Tags,
+             'tagdates|T'     => \$Show_Tag_Dates,
+             'branches|b'     => \$Show_Branches,
+             'follow|F=s'     => \@Follow_Branches,
+             'follow-only=s'  => \@Follow_Only,
+             'xml-encoding=s' => \$XML_Encoding,
+             'xml'            => \$XML_Output,
+             'noxmlns'        => \$No_XML_Namespace,
+             'no-xml-iso-date' => \$No_XML_ISO_Date,
+             'no-ancestors'   => \$No_Ancestors,
+             'lines-modified' => \$Show_Lines_Modified,
+
+             'no-indent'    => sub {
+               $Indent = '';
+             },
+
+             'summary'      => sub {
+               $Summary = 1;
+               $After_Header = "\n\n"; # Summary implies --separate-header
+             },
+
+             'no-times'     => sub {
+               $Show_Times = 0;
+             },
+
+             'no-hide-branch-additions' => sub {
+               $Hide_Branch_Additions = 0;
+             },
+
+             'no-common-dir'  => sub {
+               $Common_Dir = 0;
+             },
+
+             'ignore-tag=s'   => sub {
+               $ignore_tags{$_[1]} = 1;
+             },
+
+             'show-tag=s'     => sub {
+               $show_tags{$_[1]} = 1;
+             },
+
+             # Deliberately undocumented.  This is not a public interface, and
+             # may change/disappear at any time.
+             'test-code=s'    => \$TestCode,
+
+             'delta=s'        => sub {
+               my $arg = $_[1];
+               if ( $arg =~
+                    /^([A-Za-z][A-Za-z0-9_\-\]\[\.]*)?:([A-Za-z][A-Za-z0-9_\-\]\[\.]*)?$/ )
+               {
+                 $Delta_From = $1;
+                 $Delta_To = $2;
+                 $Delta_Mode = 1;
+               } else {
+                 die "--delta FROM_TAG:TO_TAG is what you meant to say.\n";
+               }
+             },
+
+             'FSF'             => sub {
+               $FSF_Output = 1;
+               $Show_Times = 0;
+               $Common_Dir = 0;
+               $No_Extra_Indent = 1;
+               $Indent = "\t";
+             },
+
+             'header=s'        => sub {
+               my $narg = $_[1];
+               $ChangeLog_Header = &slurp_file ($narg);
+               if (! defined ($ChangeLog_Header)) {
+                 $ChangeLog_Header = '';
+               }
+             },
+
+             'global-opts|g=s' => sub {
+               my $narg = $_[1];
+               push @Global_Opts, $narg;
+               splice @log_source_command, 1, 0, $narg;
+             },
+
+             'log-opts|l=s' => sub {
+               my $narg = $_[1];
+               push @Local_Opts, $narg;
+               push @log_source_command, $narg;
+             },
+
+             'mailname=s'   => sub {
+               my $narg = $_[1];
+               warn "--mailname is deprecated; please use --domain instead\n";
+               $Domain = $narg;
+             },
+
+             'separate-header|S' => sub {
+               $After_Header = "\n\n";
+               $No_Extra_Indent = 1;
+             },
+
+             'group-within-date' => sub {
+               $GroupWithinDate = 1;
+               $Show_Times = 0;
+             },
+
+             'hide-filenames' => sub {
+               $Hide_Filenames = 1;
+               $After_Header = '';
+             },
+            )
+    or die "options parsing failed\n";
+
+  push @log_source_command, map "$_", @ARGV;
+
+  ## Check for contradictions...
+
+  if ($Output_To_Stdout && CVS::Utils::ChangeLog::FileEntry->distributed) {
+    print STDERR "cannot pass both --stdout and --distributed\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($Output_To_Stdout && $output_file) {
+    print STDERR "cannot pass both --stdout and --file\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($Input_From_Stdin && @Global_Opts) {
+    print STDERR "cannot pass both --stdin and -g\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($Input_From_Stdin && @Local_Opts) {
+    print STDERR "cannot pass both --stdin and -l\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($XML_Output && $Cumulative) {
+    print STDERR "cannot pass both --xml and --accum\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($FSF_Output && $Cumulative) {
+    print STDERR "cannot pass both --FSF and --accum\n";
+    $exit_with_admonishment = 1;
+  }
+
+  # Other consistency checks and option-driven logic
+
+  # Bleargh.  Compensate for a deficiency of custom wrapping.
+  if ( ($After_Header ne " ") and $FSF_Style ) {
+    $After_Header .= "\t";
+  }
+
+  @Ignore_Files = map lc, @Ignore_Files
+    if $Case_Insensitive;
+
+  # Or if any other error message has already been printed out, we
+  # just leave now:
+  if ($exit_with_admonishment) {
+    &usage ();
+    exit (1);
+  }
+  elsif ($Print_Usage) {
+    &usage ();
+    exit (0);
+  }
+  elsif ($Print_Version) {
+    &version ();
+    exit (0);
+  }
+
+  ## Else no problems, so proceed.
+
+  if ($output_file) {
+    $Log_File_Name = $output_file;
+  }
+
+  return \@log_source_command;
+}
+
+# -------------------------------------
+
+sub slurp_file {
+  my $filename = shift || die ("no filename passed to slurp_file()");
+  my $retstr;
+
+  open (SLURPEE, "<${filename}") or die ("unable to open $filename ($!)");
+  local $/ = undef;
+  $retstr = <SLURPEE>;
+  close (SLURPEE);
+  return $retstr;
+}
+
+# -------------------------------------
+
+sub debug {
+  if ($Debug) {
+    my $msg = shift;
+    print STDERR $msg;
+  }
+}
+
+# -------------------------------------
+
+sub version {
+  print "cvs2cl.pl version ${VERSION}; distributed under the GNU GPL.\n";
+}
+
+# -------------------------------------
+
+sub usage {
+  &version ();
+
+  eval "use Pod::Usage qw( pod2usage )";
+
+   if ( $@ ) {
+    print <<'END';
+
+* Pod::Usage was not found.  The formatting may be suboptimal.  Consider
+  upgrading your Perl --- Pod::Usage is standard from 5.6 onwards, and
+  versions of perl prior to 5.6 are getting rather rusty, now.  Alternatively,
+  install Pod::Usage direct from CPAN.
+END
+
+    local $/ = undef;
+    my $message = <DATA>;
+    $message =~ s/^=(head1|item) //gm;
+    $message =~ s/^=(over|back).*\n//gm;
+    $message =~ s/\n{3,}/\n\n/g;
+    print $message;
+  } else {
+    print "\n";
+    pod2usage( -exitval => 'NOEXIT',
+               -verbose => 1,
+               -output  => \*STDOUT,
+             );
+  }
+
+  return;
+}
+
+# Main -----------------------------------------------------------------------
+
+my $log_source_command = parse_options;
+if ( defined $TestCode ) {
+  eval $TestCode;
+  die "Eval failed: '$@'\n"
+    if $@;
+} else {
+  derive_changelog($log_source_command);
+}
+
+__DATA__
+
+=head1 NAME
+
+cvs2cl.pl - convert cvs log messages to changelogs
+
+=head1 SYNOPSIS
+
+B<cvs2cl> [I<options>] [I<FILE1> [I<FILE2> ...]]
+
+=head1 DESCRIPTION
+
+cvs2cl produces a GNU-style ChangeLog for CVS-controlled sources by
+running "cvs log" and parsing the output. Duplicate log messages get
+unified in the Right Way.
+
+The default output of cvs2cl is designed to be compact, formally unambiguous,
+but still easy for humans to read.  It should be largely self-explanatory; the
+one abbreviation that might not be obvious is "utags".  That stands for
+"universal tags" -- a universal tag is one held by all the files in a given
+change entry.
+
+If you need output that's easy for a program to parse, use the B<--xml> option.
+Note that with XML output, just about all available information is included
+with each change entry, whether you asked for it or not, on the theory that
+your parser can ignore anything it's not looking for.
+
+If filenames are given as arguments cvs2cl only shows log information for the
+named files.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-h>, B<-help>, B<--help>, B<-?>
+
+Show a short help and exit.
+
+=item B<--version>
+
+Show version and exit.
+
+=item B<-r>, B<--revisions>
+
+Show revision numbers in output.
+
+=item B<-b>, B<--branches>
+
+Show branch names in revisions when possible.
+
+=item B<-t>, B<--tags>
+
+Show tags (symbolic names) in output.
+
+=item B<-T>, B<--tagdates>
+
+Show tags in output on their first occurance.
+
+=item B<--show-dead>
+
+Show dead files.
+
+=item B<--stdin>
+
+Read from stdin, don't run cvs log.
+
+=item B<--stdout>
+
+Output to stdout not to ChangeLog.
+
+=item B<-d>, B<--distributed>
+
+Put ChangeLogs in subdirs.
+
+=item B<-f> I<FILE>, B<--file> I<FILE>
+
+Write to I<FILE> instead of ChangeLog.
+
+=item B<--fsf>
+
+Use this if log data is in FSF ChangeLog style.
+
+=item B<--FSF>
+
+Attempt strict FSF-standard compatible output (incompatible with B<--accum>).
+
+=item B<-W> I<SECS>, B<--window> I<SECS>
+
+Window of time within which log entries unify.
+
+=item -B<U> I<UFILE>, B<--usermap> I<UFILE>
+
+Expand usernames to email addresses from I<UFILE>.
+
+=item B<--passwd> I<PASSWORDFILE>
+
+Use system passwd file for user name expansion.  If no mail domain is provided
+(via B<--domain>), it tries to read one from B</etc/mailname>, output of B<hostname
+-d>, B<dnsdomainname>, or B<domain-name>.  cvs2cl exits with an error if none of
+those options is successful. Use a domain of '' to prevent the addition of a
+mail domain.
+
+=item B<--domain> I<DOMAIN>
+
+Domain to build email addresses from.
+
+=item B<--gecos>
+
+Get user information from GECOS data.
+
+=item B<-R> I<REGEXP>, B<--regexp> I<REGEXP>
+
+Include only entries that match I<REGEXP>.  This option may be used multiple
+times.
+
+=item B<-I> I<REGEXP>, B<--ignore> I<REGEXP>
+
+Ignore files whose names match I<REGEXP>.  This option may be used multiple
+times.  The regexp is a perl regular expression.  It is matched as is; you may
+want to prefix with a ^ or suffix with a $ to anchor the match.
+
+=item B<-C>, B<--case-insensitive>
+
+Any regexp matching is done case-insensitively.
+
+=item B<-F> I<BRANCH>, B<--follow> I<BRANCH>
+
+Show only revisions on or ancestral to I<BRANCH>.
+
+=item B<--follow-only> I<BRANCH>
+
+Like --follow, but sub-branches are not followed.
+
+=item B<--no-ancestors>
+
+When using B<-F>, only track changes since the I<BRANCH> started.
+
+=item B<--no-hide-branch-additions>
+
+By default, entries generated by cvs for a file added on a branch (a dead 1.1
+entry) are not shown.  This flag reverses that action.
+
+=item B<-S>, B<--separate-header>
+
+Blank line between each header and log message.
+
+=item B<--group-within-date>
+
+Group ChangeLog entries on the same date together, instead of having a
+separate entry for each commit on that date.
+
+=item B<--summary>
+
+Add CVS change summary information.
+
+=item B<--no-wrap>
+
+Don't auto-wrap log message (recommend B<-S> also).
+
+=item B<--no-indent>
+
+Don't indent log message
+
+=item B<--gmt>, B<--utc>
+
+Show times in GMT/UTC instead of local time.
+
+=item B<--accum>
+
+Add to an existing ChangeLog (incompatible with B<--xml> and B<--FSF>).
+
+=item B<-w>, B<--day-of-week>
+
+Show day of week.
+
+=item B<--no-times>
+
+Don't show times in output.
+
+=item B<--chrono>
+
+Output log in chronological order (default is reverse chronological order).
+
+=item B<--header> I<FILE>
+
+Get ChangeLog header from I<FILE> ("B<->" means stdin).
+
+=item B<--xml>
+
+Output XML instead of ChangeLog format (incompatible with B<--accum>).
+
+=item B<--xml-encoding> I<ENCODING.>
+
+Insert encoding clause in XML header.
+
+=item B<--noxmlns>
+
+Don't include xmlns= attribute in root element.
+
+=item B<--hide-filenames>
+
+Don't show filenames (ignored for XML output).
+
+=item B<--no-common-dir>
+
+Don't shorten directory names from filenames.
+
+=item B<--rcs> I<CVSROOT>
+
+Handle filenames from raw RCS, for instance those produced by "cvs rlog"
+output, stripping the prefix I<CVSROOT>.
+
+=item B<-P>, B<--prune>
+
+Don't show empty log messages.
+
+=item B<--lines-modified>
+
+Output the number of lines added and the number of lines removed for
+each checkin (if applicable). At the moment, this only affects the
+XML output mode.
+
+=item B<--ignore-tag> I<TAG>
+
+Ignore individual changes that are associated with a given tag.
+May be repeated, if so, changes that are associated with any of
+the given tags are ignored.
+
+=item B<--show-tag> I<TAG>
+
+Log only individual changes that are associated with a given
+tag.  May be repeated, if so, changes that are associated with
+any of the given tags are logged.
+
+=item B<--delta> I<FROM_TAG>B<:>I<TO_TAG>
+
+Attempt a delta between two tags (since I<FROM_TAG> up to and
+including I<TO_TAG>).  The algorithm is a simple date-based one
+(this is a hard problem) so results are imperfect.
+
+=item B<-g> I<OPTS>, B<--global-opts> I<OPTS>
+
+Pass I<OPTS> to cvs like in "cvs I<OPTS> log ...".
+
+=item B<-l> I<OPTS>, B<--log-opts> I<OPTS>
+
+Pass I<OPTS> to cvs log like in "cvs ... log I<OPTS>".
+
+=back
+
+Notes about the options and arguments:
+
+=over 4
+
+=item *
+
+The B<-I> and B<-F> options may appear multiple times.
+
+=item *
+
+To follow trunk revisions, use "B<-F trunk>" ("B<-F TRUNK>" also works).  This is
+okay because no would ever, ever be crazy enough to name a branch "trunk",
+right?  Right.
+
+=item *
+
+For the B<-U> option, the I<UFILE> should be formatted like CVSROOT/users. That is,
+each line of I<UFILE> looks like this:
+
+       jrandom:jrandom@red-bean.com
+
+or maybe even like this
+
+       jrandom:'Jesse Q. Random <jrandom@red-bean.com>'
+
+Don't forget to quote the portion after the colon if necessary.
+
+=item *
+
+Many people want to filter by date.  To do so, invoke cvs2cl.pl like this:
+
+       cvs2cl.pl -l "-d'DATESPEC'"
+
+where DATESPEC is any date specification valid for "cvs log -d".  (Note that
+CVS 1.10.7 and below requires there be no space between -d and its argument).
+
+=item *
+
+Dates/times are interpreted in the local time zone.
+
+=item *
+
+Remember to quote the argument to `B<-l>' so that your shell doesn't interpret
+spaces as argument separators.
+
+=item *
+
+See the 'Common Options' section of the cvs manual ('info cvs' on UNIX-like
+systems) for more information.
+
+=item *
+
+Note that the rules for quoting under windows shells are different.
+
+=item *
+
+To run in an automated environment such as CGI or PHP, suidperl may be needed
+in order to execute as the correct user to enable /cvsroot read lock files to
+be written for the 'cvs log' command.  This is likely just a case of changing
+the /usr/bin/perl command to /usr/bin/suidperl, and explicitly declaring the
+PATH variable.
+
+=back
+
+=head1 EXAMPLES
+
+Some examples (working on UNIX shells):
+
+      # logs after 6th March, 2003 (inclusive)
+      cvs2cl.pl -l "-d'>2003-03-06'"
+      # logs after 4:34PM 6th March, 2003 (inclusive)
+      cvs2cl.pl -l "-d'>2003-03-06 16:34'"
+      # logs between 4:46PM 6th March, 2003 (exclusive) and
+      # 4:34PM 6th March, 2003 (inclusive)
+      cvs2cl.pl -l "-d'2003-03-06 16:46>2003-03-06 16:34'"
+
+Some examples (on non-UNIX shells):
+
+      # Reported to work on windows xp/2000
+      cvs2cl.pl -l  "-d"">2003-10-18;today<"""
+
+=head1 AUTHORS
+
+=over 4
+
+=item Karl Fogel
+
+=item Melissa O'Neill
+
+=item Martyn J. Pearce
+
+=back
+
+Contributions from
+
+=over 4
+
+=item Mike Ayers
+
+=item Tim Bradshaw
+
+=item Richard Broberg
+
+=item Nathan Bryant
+
+=item Oswald Buddenhagen
+
+=item Neil Conway
+
+=item Arthur de Jong
+
+=item Mark W. Eichin
+
+=item Dave Elcock
+
+=item Reid Ellis
+
+=item Simon Josefsson
+
+=item Robin Hugh Johnson
+
+=item Terry Kane
+
+=item Pete Kempf
+
+=item Akos Kiss
+
+=item Claus Klein
+
+=item Eddie Kohler
+
+=item Richard Laager
+
+=item Kevin Lilly
+
+=item Karl-Heinz Marbaise
+
+=item Mitsuaki Masuhara
+
+=item Henrik Nordstrom
+
+=item Joe Orton
+
+=item Peter Palfrader
+
+=item Thomas Parmelan
+
+=item Jordan Russell
+
+=item Jacek Sliwerski
+
+=item Johannes Stezenbach
+
+=item Joseph Walton
+
+=item Ernie Zapata
+
+=back
+
+=head1 BUGS
+
+Please report bugs to C<cvs2cl-reports {_AT_} red-bean.com>.
+
+=head1 PREREQUISITES
+
+This script requires C<Text::Wrap>, C<Time::Local>, and C<File::Basename>.  It
+also seems to require C<Perl 5.004_04> or higher.
+
+=head1 OPERATING SYSTEM COMPATIBILITY
+
+Should work on any OS.
+
+=head1 SCRIPT CATEGORIES
+
+Version_Control/CVS
+
+=head1 COPYRIGHT
+
+(C) 2001,2002,2003,2004 Martyn J. Pearce, under the GNU GPL.
+
+(C) 1999 Karl Fogel, under the GNU GPL.
+
+cvs2cl.pl 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, or (at your option)
+any later version.
+
+cvs2cl.pl 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 may have received a copy of the GNU General Public License
+along with cvs2cl.pl; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+=head1 SEE ALSO
+
+cvs(1)
+
Index: /issm/trunk/scripts/cvs2cl.sh
===================================================================
--- /issm/trunk/scripts/cvs2cl.sh	(revision 1)
+++ /issm/trunk/scripts/cvs2cl.sh	(revision 1)
@@ -0,0 +1,3250 @@
+#!/bin/sh
+exec perl -w -x "$0" ${1+"$@"} # -*- mode: perl; perl-indent-level: 2; -*-
+#!perl -w
+
+
+##############################################################
+###                                                        ###
+### cvs2cl.pl: produce ChangeLog(s) from `cvs log` output. ###
+###                                                        ###
+##############################################################
+
+## $Revision: 2.72 $
+## $Date: 2008-06-26 18:56:51 $
+## $Author: kfogel $
+##
+
+use strict;
+
+use File::Basename qw( fileparse );
+use Getopt::Long   qw( GetOptions );
+use Text::Wrap     qw( );
+use Time::Local    qw( timegm );
+use User::pwent    qw( getpwnam );
+
+# The Plan:
+#
+# Read in the logs for multiple files, spit out a nice ChangeLog that
+# mirrors the information entered during `cvs commit'.
+#
+# The problem presents some challenges. In an ideal world, we could
+# detect files with the same author, log message, and checkin time --
+# each <filelist, author, time, logmessage> would be a changelog entry.
+# We'd sort them; and spit them out.  Unfortunately, CVS is *not atomic*
+# so checkins can span a range of times.  Also, the directory structure
+# could be hierarchical.
+#
+# Another question is whether we really want to have the ChangeLog
+# exactly reflect commits. An author could issue two related commits,
+# with different log entries, reflecting a single logical change to the
+# source. GNU style ChangeLogs group these under a single author/date.
+# We try to do the same.
+#
+# So, we parse the output of `cvs log', storing log messages in a
+# multilevel hash that stores the mapping:
+#   directory => author => time => message => filelist
+# As we go, we notice "nearby" commit times and store them together
+# (i.e., under the same timestamp), so they appear in the same log
+# entry.
+#
+# When we've read all the logs, we twist this mapping into
+# a time => author => message => filelist mapping for each directory.
+#
+# If we're not using the `--distributed' flag, the directory is always
+# considered to be `./', even as descend into subdirectories.
+
+# Call Tree
+
+# name                         number of lines (10.xii.03)
+# parse_options                         192
+# derive_changelog                       13
+# +-maybe_grab_accumulation_date         38
+# +-read_changelog                      277
+#   +-maybe_read_user_map_file           94
+#     +-run_ext                           9
+#   +-read_file_path                     29
+#   +-read_symbolic_name                 43
+#   +-read_revision                      49
+#   +-read_date_author_and_state         25
+#     +-parse_date_author_and_state      20
+#   +-read_branches                      36
+# +-output_changelog                    424
+#   +-pretty_file_list                  290
+#     +-common_path_prefix               35
+#   +-preprocess_msg_text                30
+#     +-min                               1
+#   +-mywrap                             16
+#   +-last_line_len                       5
+#   +-wrap_log_entry                    177
+#
+# Utilities
+#
+# xml_escape                              6
+# slurp_file                             11
+# debug                                   5
+# version                                 2
+# usage                                 142
+
+# -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*-
+#
+# Note about a bug-slash-opportunity:
+# -----------------------------------
+#
+# There's a bug in Text::Wrap, which affects cvs2cl.  This script
+# reveals it:
+#
+#   #!/usr/bin/perl -w
+#
+#   use Text::Wrap;
+#
+#   my $test_text =
+#   "This script demonstrates a bug in Text::Wrap.  The very long line
+#   following this paragraph will be relocated relative to the surrounding
+#   text:
+#
+#   ====================================================================
+#
+#   See?  When the bug happens, we'll get the line of equal signs below
+#   this paragraph, even though it should be above.";
+#
+#
+#   # Print out the test text with no wrapping:
+#   print "$test_text";
+#   print "\n";
+#   print "\n";
+#
+#   # Now print it out wrapped, and see the bug:
+#   print wrap ("\t", "        ", "$test_text");
+#   print "\n";
+#   print "\n";
+#
+# If the line of equal signs were one shorter, then the bug doesn't
+# happen.  Interesting.
+#
+# Anyway, rather than fix this in Text::Wrap, we might as well write a
+# new wrap() which has the following much-needed features:
+#
+# * initial indentation, like current Text::Wrap()
+# * subsequent line indentation, like current Text::Wrap()
+# * user chooses among: force-break long words, leave them alone, or die()?
+# * preserve existing indentation: chopped chunks from an indented line
+#   are indented by same (like this line, not counting the asterisk!)
+# * optional list of things to preserve on line starts, default ">"
+#
+# Note that the last two are essentially the same concept, so unify in
+# implementation and give a good interface to controlling them.
+#
+# And how about:
+#
+# Optionally, when encounter a line pre-indented by same as previous
+# line, then strip the newline and refill, but indent by the same.
+# Yeah...
+
+# Globals --------------------------------------------------------------------
+
+# In case we have to print it out:
+my $VERSION = '$Revision: 2.72 $';
+$VERSION =~ s/\S+\s+(\S+)\s+\S+/$1/;
+
+## Vars set by options:
+
+# Print debugging messages?
+my $Debug = 0;
+
+# Just show version and exit?
+my $Print_Version = 0;
+
+# Just print usage message and exit?
+my $Print_Usage = 0;
+
+# What file should we generate (defaults to "ChangeLog")?
+my $Log_File_Name = "ChangeLog";
+
+# Grab most recent entry date from existing ChangeLog file, just add
+# to that ChangeLog.
+my $Cumulative = 0;
+
+# `cvs log -d`, this will repeat the last entry in the old log.  This is OK,
+# as it guarantees at least one entry in the update changelog, which means
+# that there will always be a date to extract for the next update.  The repeat
+# entry can be removed in postprocessing, if necessary.
+
+# MJP 2003-08-02
+# I don't think this actually does anything useful
+my $Update = 0;
+
+# Expand usernames to email addresses based on a map file?
+my $User_Map_File = '';
+my $User_Passwd_File;
+my $Mail_Domain;
+
+# Output log in chronological order? [default is reverse chronological order]
+my $Chronological_Order = 0;
+
+# Grab user details via gecos
+my $Gecos = 0;
+
+# User domain for gecos email addresses
+my $Domain;
+
+# Output to a file or to stdout?
+my $Output_To_Stdout = 0;
+
+# Eliminate empty log messages?
+my $Prune_Empty_Msgs = 0;
+
+# Tags of which not to output
+my %ignore_tags;
+
+# Show only revisions with Tags
+my %show_tags;
+
+# Don't call Text::Wrap on the body of the message
+my $No_Wrap = 0;
+
+# Indentation of log messages
+my $Indent = "\t";
+
+# Don't do any pretty print processing
+my $Summary = 0;
+
+# Separates header from log message.  Code assumes it is either " " or
+# "\n\n", so if there's ever an option to set it to something else,
+# make sure to go through all conditionals that use this var.
+my $After_Header = " ";
+
+# XML Encoding
+my $XML_Encoding = '';
+
+# Format more for programs than for humans.
+my $XML_Output = 0;
+my $No_XML_Namespace = 0;
+my $No_XML_ISO_Date = 0;
+
+# Do some special tweaks for log data that was written in FSF
+# ChangeLog style.
+my $FSF_Style = 0;
+
+# Set iff output should be like an FSF-style ChangeLog.
+my $FSF_Output = 0;
+
+# Show times in UTC instead of local time
+my $UTC_Times = 0;
+
+# Show times in output?
+my $Show_Times = 1;
+
+# Show day of week in output?
+my $Show_Day_Of_Week = 0;
+
+# Show revision numbers in output?
+my $Show_Revisions = 0;
+
+# Show dead files in output?
+my $Show_Dead = 0;
+
+# Hide dead trunk files which were created as a result of additions on a
+# branch?
+my $Hide_Branch_Additions = 1;
+
+# Show tags (symbolic names) in output?
+my $Show_Tags = 0;
+
+# Show tags separately in output?
+my $Show_Tag_Dates = 0;
+
+# Show branches by symbolic name in output?
+my $Show_Branches = 0;
+
+# Show only revisions on these branches or their ancestors.
+my @Follow_Branches;
+# Show only revisions on these branches or their ancestors; ignore descendent
+# branches.
+my @Follow_Only;
+
+# Don't bother with files matching this regexp.
+my @Ignore_Files;
+
+# How exactly we match entries.  We definitely want "o",
+# and user might add "i" by using --case-insensitive option.
+my $Case_Insensitive = 0;
+
+# Maybe only show log messages matching a certain regular expression.
+my $Regexp_Gate = '';
+
+# Pass this global option string along to cvs, to the left of `log':
+my $Global_Opts = '';
+
+# Pass this option string along to the cvs log subcommand:
+my $Command_Opts = '';
+
+# Read log output from stdin instead of invoking cvs log?
+my $Input_From_Stdin = 0;
+
+# Don't show filenames in output.
+my $Hide_Filenames = 0;
+
+# Don't shorten directory names from filenames.
+my $Common_Dir = 1;
+
+# Max checkin duration. CVS checkin is not atomic, so we may have checkin
+# times that span a range of time. We assume that checkins will last no
+# longer than $Max_Checkin_Duration seconds, and that similarly, no
+# checkins will happen from the same users with the same message less
+# than $Max_Checkin_Duration seconds apart.
+my $Max_Checkin_Duration = 180;
+
+# What to put at the front of [each] ChangeLog.
+my $ChangeLog_Header = '';
+
+# Whether to enable 'delta' mode, and for what start/end tags.
+my $Delta_Mode = 0;
+my $Delta_From = '';
+my $Delta_To = '';
+
+my $TestCode;
+
+# Whether to parse filenames from the RCS filename, and if so what
+# prefix to strip.
+my $RCS_Root;
+
+# Whether to output information on the # of lines added and removed
+# by each file modification.
+my $Show_Lines_Modified = 0;
+
+## end vars set by options.
+
+# latest observed times for the start/end tags in delta mode
+my $Delta_StartTime = 0;
+my $Delta_EndTime = 0;
+
+my $No_Ancestors = 0;
+
+my $No_Extra_Indent = 0;
+
+my $GroupWithinDate = 0;
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySet;
+
+sub new {
+  my $class = shift;
+  my %self;
+  bless \%self, $class;
+}
+
+# -------------------------------------
+
+sub output_changelog {
+  my $output_type = $XML_Output ? 'XML' : 'Text';
+  my $output_class = "CVS::Utils::ChangeLog::EntrySet::Output::${output_type}";
+  my $output = $output_class->new(follow_branches => \@Follow_Branches,
+                                  follow_only     => \@Follow_Only,
+                                  ignore_tags     => \%ignore_tags,
+                                  show_tags       => \%show_tags,
+                                 );
+  $output->output_changelog(@_);
+}
+
+# -------------------------------------
+
+sub add_fileentry {
+  my ($self, $file_full_path, $time, $revision, $state, $lines,
+      $branch_names, $branch_roots, $branch_numbers,
+      $symbolic_names, $author, $msg_txt) = @_;
+
+      my $qunk =
+        CVS::Utils::ChangeLog::FileEntry->new($file_full_path, $time, $revision,
+                                              $state, $lines,
+                                              $branch_names, $branch_roots,
+                                              $branch_numbers,
+                                              $symbolic_names);
+
+      # We might be including revision numbers and/or tags and/or
+      # branch names in the output.  Most of the code from here to
+      # loop-end deals with organizing these in qunk.
+
+      unless ( $Hide_Branch_Additions
+               and
+               $msg_txt =~ /file .+ was initially added on branch \S+./ ) {
+        # Add this file to the list
+        # (We use many spoonfuls of autovivication magic. Hashes and arrays
+        # will spring into existence if they aren't there already.)
+
+        &main::debug ("(pushing log msg for ". $qunk->dir_key . $qunk->filename . ")\n");
+
+        # Store with the files in this commit.  Later we'll loop through
+        # again, making sure that revisions with the same log message
+        # and nearby commit times are grouped together as one commit.
+        $self->{$qunk->dir_key}{$author}{$time}{$msg_txt} =
+          CVS::Utils::ChangeLog::Message->new($msg_txt)
+              unless exists $self->{$qunk->dir_key}{$author}{$time}{$msg_txt};
+        $self->{$qunk->dir_key}{$author}{$time}{$msg_txt}->add_fileentry($qunk);
+      }
+
+}
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySet::Output::Text;
+
+use base qw( CVS::Utils::ChangeLog::EntrySet::Output );
+
+use File::Basename qw( fileparse );
+
+sub new {
+  my $class = shift;
+  my $self = $class->SUPER::new(@_);
+}
+
+# -------------------------------------
+
+sub wday {
+  my $self = shift; my $class = ref $self;
+  my ($wday) = @_;
+
+  return $Show_Day_Of_Week ? ' ' . $class->weekday_en($wday) : '';
+}
+
+# -------------------------------------
+
+sub header_line {
+  my $self = shift;
+  my ($time, $author, $lastdate) = @_;
+
+  my $header_line = '';
+
+  my (undef,$min,$hour,$mday,$mon,$year,$wday)
+    = $UTC_Times ? gmtime($time) : localtime($time);
+
+  my $date = $self->fdatetime($time);
+
+  if ($Show_Times) {
+    $header_line =
+      sprintf "%s  %s\n\n", $date, $author;
+  } else {
+    if ( ! defined $lastdate or $date ne $lastdate or ! $GroupWithinDate ) {
+      if ( $GroupWithinDate ) {
+        $header_line = "$date\n\n";
+      } else {
+        $header_line = "$date  $author\n\n";
+      }
+    } else {
+      $header_line = '';
+    }
+  }
+}
+
+# -------------------------------------
+
+sub preprocess_msg_text {
+  my $self = shift;
+  my ($text) = @_;
+
+  $text = $self->SUPER::preprocess_msg_text($text);
+
+  unless ( $No_Wrap ) {
+    # Strip off lone newlines, but only for lines that don't begin with
+    # whitespace or a mail-quoting character, since we want to preserve
+    # that kind of formatting.  Also don't strip newlines that follow a
+    # period; we handle those specially next.  And don't strip
+    # newlines that precede an open paren.
+    1 while $text =~ s/(^|\n)([^>\s].*[^.\n])\n([^>\n])/$1$2 $3/g;
+
+    # If a newline follows a period, make sure that when we bring up the
+    # bottom sentence, it begins with two spaces.
+    1 while $text =~ s/(^|\n)([^>\s].*)\n([^>\n])/$1$2  $3/g;
+  }
+
+  return $text;
+}
+
+# -------------------------------------
+
+# Here we take a bunch of qunks and convert them into printed
+# summary that will include all the information the user asked for.
+sub pretty_file_list {
+  my $self = shift;
+
+  return ''
+    if $Hide_Filenames;
+
+  my $qunksref = shift;
+
+  my @filenames;
+  my $beauty = '';          # The accumulating header string for this entry.
+  my %non_unanimous_tags;   # Tags found in a proper subset of qunks
+  my %unanimous_tags;       # Tags found in all qunks
+  my %all_branches;         # Branches found in any qunk
+  my $fbegun = 0;           # Did we begin printing filenames yet?
+
+  my ($common_dir, $qunkrefs) =
+    $self->_pretty_file_list(\(%unanimous_tags, %non_unanimous_tags, %all_branches), $qunksref);
+
+  my @qunkrefs = @$qunkrefs;
+
+  # Not XML output, so complexly compactify for chordate consumption.  At this
+  # point we have enough global information about all the qunks to organize
+  # them non-redundantly for output.
+
+  if ($common_dir) {
+    # Note that $common_dir still has its trailing slash
+    $beauty .= "$common_dir: ";
+  }
+
+  if ($Show_Branches)
+  {
+    # For trailing revision numbers.
+    my @brevisions;
+
+    foreach my $branch (keys (%all_branches))
+    {
+      foreach my $qunkref (@qunkrefs)
+      {
+        if ((defined ($qunkref->branch))
+            and ($qunkref->branch eq $branch))
+        {
+          if ($fbegun) {
+            # kff todo: comma-delimited in XML too?  Sure.
+            $beauty .= ", ";
+          }
+          else {
+            $fbegun = 1;
+          }
+          my $fname = substr ($qunkref->filename, length ($common_dir));
+          $beauty .= $fname;
+          $qunkref->{'printed'} = 1;  # Just setting a mark bit, basically
+
+          if ( $Show_Tags and defined $qunkref->tags ) {
+            my @tags = grep ($non_unanimous_tags{$_}, @{$qunkref->tags});
+
+            if (@tags) {
+              $beauty .= " (tags: ";
+              $beauty .= join (', ', @tags);
+              $beauty .= ")";
+            }
+          }
+
+          if ($Show_Revisions) {
+            # Collect the revision numbers' last components, but don't
+            # print them -- they'll get printed with the branch name
+            # later.
+            $qunkref->revision =~ /.+\.([\d]+)$/;
+            push (@brevisions, $1);
+
+            # todo: we're still collecting branch roots, but we're not
+            # showing them anywhere.  If we do show them, it would be
+            # nifty to just call them revision "0" on a the branch.
+            # Yeah, that's the ticket.
+          }
+        }
+      }
+      $beauty .= " ($branch";
+      if (@brevisions) {
+        if ((scalar (@brevisions)) > 1) {
+          $beauty .= ".[";
+          $beauty .= (join (',', @brevisions));
+          $beauty .= "]";
+        }
+        else {
+          # Square brackets are spurious here, since there's no range to
+          # encapsulate
+          $beauty .= ".$brevisions[0]";
+        }
+      }
+      $beauty .= ")";
+    }
+  }
+
+  # Okay; any qunks that were done according to branch are taken care
+  # of, and marked as printed.  Now print everyone else.
+
+  my %fileinfo_printed;
+  foreach my $qunkref (@qunkrefs)
+  {
+    next if (defined ($qunkref->{'printed'}));   # skip if already printed
+
+    my $b = substr ($qunkref->filename, length ($common_dir));
+    # todo: Shlomo's change was this:
+    # $beauty .= substr ($qunkref->filename,
+    #              (($common_dir eq "./") ? '' : length ($common_dir)));
+    $qunkref->{'printed'} = 1;  # Set a mark bit.
+
+    if ($Show_Revisions || $Show_Tags || $Show_Dead)
+    {
+      my $started_addendum = 0;
+
+      if ($Show_Revisions) {
+        $started_addendum = 1;
+        $b .= " (";
+        $b .= $qunkref->revision;
+      }
+      if ($Show_Dead && $qunkref->state =~ /dead/)
+      {
+        # Deliberately not using $started_addendum. Keeping it simple.
+        $b .= "[DEAD]";
+      }
+      if ($Show_Tags && (defined $qunkref->tags)) {
+        my @tags = grep ($non_unanimous_tags{$_}, @{$qunkref->tags});
+        if ((scalar (@tags)) > 0) {
+          if ($started_addendum) {
+            $b .= ", ";
+          }
+          else {
+            $b .= " (tags: ";
+          }
+          $b .= join (', ', @tags);
+          $started_addendum = 1;
+        }
+      }
+      if ($started_addendum) {
+        $b .= ")";
+      }
+    }
+
+    unless ( exists $fileinfo_printed{$b} ) {
+      if ($fbegun) {
+        $beauty .= ", ";
+      } else {
+        $fbegun = 1;
+      }
+      $beauty .= $b, $fileinfo_printed{$b} = 1;
+    }
+  }
+
+  # Unanimous tags always come last.
+  if ($Show_Tags && %unanimous_tags)
+  {
+    $beauty .= " (utags: ";
+    $beauty .= join (', ', sort keys (%unanimous_tags));
+    $beauty .= ")";
+  }
+
+  # todo: still have to take care of branch_roots?
+
+  $beauty = "$beauty:";
+
+  return $beauty;
+}
+
+# -------------------------------------
+
+sub output_tagdate {
+  my $self = shift;
+  my ($fh, $time, $tag) = @_;
+
+  my $fdatetime = $self->fdatetime($time);
+  print $fh "$fdatetime  tag $tag\n\n";
+  return;
+}
+
+# -------------------------------------
+
+sub format_body {
+  my $self = shift;
+  my ($msg, $files, $qunklist) = @_;
+
+  my $body;
+
+  if ( $No_Wrap and ! $Summary ) {
+    $msg = $self->preprocess_msg_text($msg);
+    $files = $self->mywrap("\t", "\t  ", "* $files");
+    $msg =~ s/\n(.+)/\n$Indent$1/g;
+    unless ($After_Header eq " ") {
+      $msg =~ s/^(.+)/$Indent$1/g;
+    }
+    if ( $Hide_Filenames ) {
+      $body = $After_Header . $msg;
+    } else {
+      $body = $files . $After_Header . $msg;
+    }
+  } elsif ( $Summary ) {
+    my ($filelist, $qunk);
+    my (@DeletedQunks, @AddedQunks, @ChangedQunks);
+
+    $msg = $self->preprocess_msg_text($msg);
+    #
+    #     Sort the files (qunks) according to the operation that was
+    # performed.  Files which were added have no line change
+    # indicator, whereas deleted files have state dead.
+    #
+    foreach $qunk ( @$qunklist ) {
+      if ( "dead" eq $qunk->state) {
+        push @DeletedQunks, $qunk;
+      } elsif ( ! defined $qunk->lines ) {
+        push @AddedQunks, $qunk;
+      } else {
+        push @ChangedQunks, $qunk;
+      }
+    }
+    #
+    #     The qunks list was  originally in tree search order.  Let's
+    # get that back.  The lists, if they exist, will be reversed upon
+    # processing.
+    #
+
+    #
+    #     Now write the three sections onto $filelist
+    #
+    if ( @DeletedQunks ) {
+      $filelist .= "\tDeleted:\n";
+      foreach $qunk ( @DeletedQunks ) {
+        $filelist .= "\t\t" . $qunk->filename;
+        $filelist .= " (" . $qunk->revision . ")";
+        $filelist .= "\n";
+      }
+      undef @DeletedQunks;
+    }
+
+    if ( @AddedQunks ) {
+      $filelist .= "\tAdded:\n";
+      foreach $qunk (@AddedQunks) {
+        $filelist .= "\t\t" . $qunk->filename;
+        $filelist .= " (" . $qunk->revision . ")";
+        $filelist .= "\n";
+      }
+      undef @AddedQunks ;
+    }
+
+    if ( @ChangedQunks ) {
+      $filelist .= "\tChanged:\n";
+      foreach $qunk (@ChangedQunks) {
+        $filelist .= "\t\t" . $qunk->filename;
+        $filelist .= " (" . $qunk->revision . ")";
+        $filelist .= ", \"" . $qunk->state . "\"";
+        $filelist .= ", lines: " . $qunk->lines;
+        $filelist .= "\n";
+      }
+      undef @ChangedQunks;
+    }
+
+    chomp $filelist;
+
+    if ( $Hide_Filenames ) {
+      $filelist = '';
+    }
+
+    $msg =~ s/\n(.*)/\n$Indent$1/g;
+    unless ( $After_Header eq " " or $FSF_Style ) {
+      $msg =~ s/^(.*)/$Indent$1/g;
+    }
+
+    unless ( $No_Wrap ) {
+      if ( $FSF_Style ) {
+        $msg = $self->wrap_log_entry($msg, '', 69, 69);
+        chomp($msg);
+        chomp($msg);
+      } else {
+        $msg = $self->mywrap('', $Indent, "$msg");
+        $msg =~ s/[ \t]+\n/\n/g;
+      }
+    }
+
+    $body = $filelist . $After_Header . $msg;
+  } else {  # do wrapping, either FSF-style or regular
+    my $latter_wrap = $No_Extra_Indent ? $Indent : "$Indent  ";
+
+    if ( $FSF_Style ) {
+      $files = $self->mywrap($Indent, $latter_wrap, "* $files");
+
+      my $files_last_line_len = 0;
+      if ( $After_Header eq " " ) {
+        $files_last_line_len = $self->last_line_len($files);
+        $files_last_line_len += 1;  # for $After_Header
+      }
+
+      $msg = $self->wrap_log_entry($msg, $latter_wrap, 69-$files_last_line_len, 69);
+      $body = $files . $After_Header . $msg;
+    } else {  # not FSF-style
+      $msg = $self->preprocess_msg_text($msg);
+      $body = $files . $After_Header . $msg;
+      $body = $self->mywrap($Indent, $latter_wrap, "* $body");
+      $body =~ s/[ \t]+\n/\n/g;
+    }
+  }
+
+  return $body;
+}
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySet::Output::XML;
+
+use base qw( CVS::Utils::ChangeLog::EntrySet::Output );
+
+use File::Basename qw( fileparse );
+
+sub new {
+  my $class = shift;
+  my $self = $class->SUPER::new(@_);
+}
+
+# -------------------------------------
+
+sub header_line {
+  my $self = shift;
+  my ($time, $author, $lastdate) = @_;
+
+  my $header_line = '';
+
+  my $isoDate;
+
+  my ($y, $m, $d, $H, $M, $S) = (gmtime($time))[5,4,3,2,1,0];
+
+  # Ideally, this would honor $UTC_Times and use +HH:MM syntax
+  $isoDate = sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",
+                     $y + 1900, $m + 1, $d, $H, $M, $S);
+
+  my (undef,$min,$hour,$mday,$mon,$year,$wday)
+    = $UTC_Times ? gmtime($time) : localtime($time);
+
+  my $date = $self->fdatetime($time);
+  $wday = $self->wday($wday);
+
+  $header_line =
+    sprintf ("<date>%4u-%02u-%02u</date>\n${wday}<time>%02u:%02u</time>\n",
+             $year+1900, $mon+1, $mday, $hour, $min);
+  $header_line .= "<isoDate>$isoDate</isoDate>\n"
+    unless $No_XML_ISO_Date;
+  $header_line .= sprintf("<author>%s</author>\n" , $author);
+}
+
+# -------------------------------------
+
+sub wday {
+  my $self = shift; my $class = ref $self;
+  my ($wday) = @_;
+
+  return '<weekday>' . $class->weekday_en($wday) . "</weekday>\n";
+}
+
+# -------------------------------------
+
+sub escape {
+  my $self = shift;
+
+  my $txt = shift;
+  $txt =~ s/&/&amp;/g;
+  $txt =~ s/</&lt;/g;
+  $txt =~ s/>/&gt;/g;
+  return $txt;
+}
+
+# -------------------------------------
+
+sub output_header {
+  my $self = shift;
+  my ($fh) = @_;
+
+  my $encoding    =
+    length $XML_Encoding ? qq'encoding="$XML_Encoding"' : '';
+  my $version     = 'version="1.0"';
+  my $declaration =
+    sprintf '<?xml %s?>', join ' ', grep length, $version, $encoding;
+  my $root        =
+    $No_XML_Namespace ?
+      '<changelog>'     :
+        '<changelog xmlns="http://www.red-bean.com/xmlns/cvs2cl/">';
+  print $fh "$declaration\n\n$root\n\n";
+}
+
+# -------------------------------------
+
+sub output_footer {
+  my $self = shift;
+  my ($fh) = @_;
+
+  print $fh "</changelog>\n";
+}
+
+# -------------------------------------
+
+sub preprocess_msg_text {
+  my $self = shift;
+  my ($text) = @_;
+
+  $text = $self->SUPER::preprocess_msg_text($text);
+
+  $text = $self->escape($text);
+  chomp $text;
+  $text = "<msg>${text}</msg>\n";
+
+  return $text;
+}
+
+# -------------------------------------
+
+# Here we take a bunch of qunks and convert them into a printed
+# summary that will include all the information the user asked for.
+sub pretty_file_list {
+  my $self = shift;
+  my ($qunksref) = @_;
+
+  my $beauty = '';          # The accumulating header string for this entry.
+  my %non_unanimous_tags;   # Tags found in a proper subset of qunks
+  my %unanimous_tags;       # Tags found in all qunks
+  my %all_branches;         # Branches found in any qunk
+  my $fbegun = 0;           # Did we begin printing filenames yet?
+
+  my ($common_dir, $qunkrefs) =
+    $self->_pretty_file_list(\(%unanimous_tags, %non_unanimous_tags, %all_branches),
+      $qunksref);
+
+  my @qunkrefs = @$qunkrefs;
+
+  # If outputting XML, then our task is pretty simple, because we
+  # don't have to detect common dir, common tags, branch prefixing,
+  # etc.  We just output exactly what we have, and don't worry about
+  # redundancy or readability.
+
+  foreach my $qunkref (@qunkrefs)
+  {
+    my $filename    = $qunkref->filename;
+    my $state       = $qunkref->state;
+    my $revision    = $qunkref->revision;
+    my $tags        = $qunkref->tags;
+    my $branch      = $qunkref->branch;
+    my $branchroots = $qunkref->roots;
+    my $lines       = $qunkref->lines;
+
+    $filename = $self->escape($filename);   # probably paranoia
+    $revision = $self->escape($revision);   # definitely paranoia
+
+    $beauty .= "<file>\n";
+    $beauty .= "<name>${filename}</name>\n";
+    $beauty .= "<cvsstate>${state}</cvsstate>\n";
+    $beauty .= "<revision>${revision}</revision>\n";
+
+    if ($Show_Lines_Modified
+        && $lines && $lines =~ m/\+(\d+)\s+-(\d+)/) {
+        $beauty .= "<linesadded>$1</linesadded>\n";
+        $beauty .= "<linesremoved>$2</linesremoved>\n";
+    }
+
+    if ($branch) {
+      $branch   = $self->escape($branch);     # more paranoia
+      $beauty .= "<branch>${branch}</branch>\n";
+    }
+    foreach my $tag (@$tags) {
+      $tag = $self->escape($tag);  # by now you're used to the paranoia
+      $beauty .= "<tag>${tag}</tag>\n";
+    }
+    foreach my $root (@$branchroots) {
+      $root = $self->escape($root);  # which is good, because it will continue
+      $beauty .= "<branchroot>${root}</branchroot>\n";
+    }
+    $beauty .= "</file>\n";
+  }
+
+  # Theoretically, we could go home now.  But as long as we're here,
+  # let's print out the common_dir and utags, as a convenience to
+  # the receiver (after all, earlier code calculated that stuff
+  # anyway, so we might as well take advantage of it).
+
+  if ((scalar (keys (%unanimous_tags))) > 1) {
+    foreach my $utag ((keys (%unanimous_tags))) {
+      $utag = $self->escape($utag);   # the usual paranoia
+      $beauty .= "<utag>${utag}</utag>\n";
+    }
+  }
+  if ($common_dir) {
+    $common_dir = $self->escape($common_dir);
+    $beauty .= "<commondir>${common_dir}</commondir>\n";
+  }
+
+  # That's enough for XML, time to go home:
+  return $beauty;
+}
+
+# -------------------------------------
+
+sub output_tagdate {
+  my $self = shift;
+  my ($fh, $time, $tag) = @_;
+
+  my ($y, $m, $d, $H, $M, $S) = (gmtime($time))[5,4,3,2,1,0];
+
+  # Ideally, this would honor $UTC_Times and use +HH:MM syntax
+  my $isoDate = sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",
+                       $y + 1900, $m + 1, $d, $H, $M, $S);
+
+  print $fh "<tagdate>\n";
+  print $fh "<tagisodate>$isoDate</tagisodate>\n";
+  print $fh "<tagdatetag>$tag</tagdatetag>\n";
+  print $fh "</tagdate>\n\n";
+  return;
+}
+
+# -------------------------------------
+
+sub output_entry {
+  my $self = shift;
+  my ($fh, $entry) = @_;
+  print $fh "<entry>\n$entry</entry>\n\n";
+}
+
+# -------------------------------------
+
+sub format_body {
+  my $self = shift;
+  my ($msg, $files, $qunklist) = @_;
+
+  $msg = $self->preprocess_msg_text($msg);
+  return $files . $msg;
+}
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySet::Output;
+
+use Carp           qw( croak );
+use File::Basename qw( fileparse );
+
+# Class Utility Functions -------------
+
+{ # form closure
+
+my @weekdays = (qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday));
+sub weekday_en {
+  my $class = shift;
+  return $weekdays[$_[0]];
+}
+
+}
+
+# -------------------------------------
+
+sub new {
+  my ($proto, %args) = @_;
+  my $class = ref $proto || $proto;
+
+  my $follow_branches = delete $args{follow_branches};
+  my $follow_only     = delete $args{follow_only};
+  my $ignore_tags     = delete $args{ignore_tags};
+  my $show_tags       = delete $args{show_tags};
+  die "Unrecognized arg to EntrySet::Output::new: '$_'\n"
+    for keys %args;
+
+  bless +{follow_branches => $follow_branches,
+          follow_only     => $follow_only,
+          show_tags       => $show_tags,
+          ignore_tags     => $ignore_tags,
+         }, $class;
+}
+
+# Abstract Subrs ----------------------
+
+sub wday               { croak "Whoops.  Abtract method call (wday).\n" }
+sub pretty_file_list   { croak "Whoops.  Abtract method call (pretty_file_list).\n" }
+sub output_tagdate     { croak "Whoops.  Abtract method call (output_tagdate).\n" }
+sub header_line        { croak "Whoops.  Abtract method call (header_line).\n" }
+
+# Instance Subrs ----------------------
+
+sub output_header { }
+
+# -------------------------------------
+
+sub output_entry {
+  my $self = shift;
+  my ($fh, $entry) = @_;
+  print $fh "$entry\n";
+}
+
+# -------------------------------------
+
+sub output_footer { }
+
+# -------------------------------------
+
+sub escape { return $_[1] }
+
+# -------------------------------------
+
+sub _revision_is_wanted {
+  my ($self, $qunk) = @_;
+
+  my ($revision, $branch_numbers) = @{$qunk}{qw( revision branch_numbers )};
+  my $follow_branches = $self->{follow_branches};
+  my $follow_only     = $self->{follow_only};
+
+  for my $ignore_tag (keys %{$self->{ignore_tags}}) {
+    return
+      if defined $qunk->{tags} and grep $_ eq $ignore_tag, @{$qunk->{tags}};
+  }
+
+  if ( keys %{$self->{show_tags}} ) {
+    for my $show_tag (keys %{$self->{show_tags}}) {
+      return
+        if ! defined $qunk->{tags} or ! grep $_ eq $show_tag, @{$qunk->{tags}};
+    }
+  }
+
+  return 1
+    unless @$follow_branches + @$follow_only; # no follow is follow all
+
+  for my $x (map([$_, 1], @$follow_branches),
+             map([$_, 0], @$follow_only    )) {
+    my ($branch, $followsub) = @$x;
+
+    # Special case for following trunk revisions
+    return 1
+      if $branch =~ /^trunk$/i and $revision =~ /^[0-9]+\.[0-9]+$/;
+
+    if ( my $branch_number = $branch_numbers->{$branch} ) {
+      # Are we on one of the follow branches or an ancestor of same?
+
+      # If this revision is a prefix of the branch number, or possibly is less
+      # in the minormost number, OR if this branch number is a prefix of the
+      # revision, then yes.  Otherwise, no.
+
+      # So below, we determine if any of those conditions are met.
+
+      # Trivial case: is this revision on the branch?  (Compare this way to
+      # avoid regexps that screw up Emacs indentation, argh.)
+      if ( substr($revision, 0, (length($branch_number) + 1))
+           eq
+           ($branch_number . ".") ) {
+        if ( $followsub ) {
+          return 1;
+#        } elsif ( length($revision) == length($branch_number)+2 ) {
+        } elsif ( substr($revision, length($branch_number)+1) =~ /^\d+$/ ) {
+          return 1;
+        }
+      } elsif ( length($branch_number) > length($revision)
+                and
+                ! $No_Ancestors ) {
+        # Non-trivial case: check if rev is ancestral to branch
+
+        # r_left still has the trailing "."
+        my ($r_left, $r_end) = ($revision =~ /^((?:\d+\.)+)(\d+)$/);
+
+        # b_left still has trailing "."
+        # b_mid has no trailing "."
+        my ($b_left, $b_mid) = ($branch_number =~ /^((?:\d+\.)+)(\d+)\.\d+$/);
+        return 1
+          if $r_left eq $b_left and $r_end <= $b_mid;
+      }
+    }
+  }
+
+  return;
+}
+
+# -------------------------------------
+
+sub output_changelog {
+my $self = shift; my $class = ref $self;
+  my ($grand_poobah) = @_;
+  ### Process each ChangeLog
+
+  while (my ($dir,$authorhash) = each %$grand_poobah)
+  {
+    &main::debug ("DOING DIR: $dir\n");
+
+    # Here we twist our hash around, from being
+    #   author => time => message => filelist
+    # in %$authorhash to
+    #   time => author => message => filelist
+    # in %changelog.
+    #
+    # This is also where we merge entries.  The algorithm proceeds
+    # through the timeline of the changelog with a sliding window of
+    # $Max_Checkin_Duration seconds; within that window, entries that
+    # have the same log message are merged.
+    #
+    # (To save space, we zap %$authorhash after we've copied
+    # everything out of it.)
+
+    my %changelog;
+    while (my ($author,$timehash) = each %$authorhash)
+    {
+      my %stamptime;
+      foreach my $time (sort {$a <=> $b} (keys %$timehash))
+      {
+        my $msghash = $timehash->{$time};
+        while (my ($msg,$qunklist) = each %$msghash)
+        {
+          my $stamptime = $stamptime{$msg};
+          if ((defined $stamptime)
+              and (($time - $stamptime) < $Max_Checkin_Duration)
+              and (defined $changelog{$stamptime}{$author}{$msg}))
+          {
+            push(@{$changelog{$stamptime}{$author}{$msg}}, $qunklist->files);
+          }
+          else {
+            $changelog{$time}{$author}{$msg} = $qunklist->files;
+            $stamptime{$msg} = $time;
+          }
+        }
+      }
+    }
+    undef (%$authorhash);
+
+    ### Now we can write out the ChangeLog!
+
+    my ($logfile_here, $logfile_bak, $tmpfile);
+    my $lastdate;
+
+    if (! $Output_To_Stdout) {
+      $logfile_here =  $dir . $Log_File_Name;
+      if (!$^O =~ /Win32/i) {
+        $logfile_here =~ s/^\.\/\//\//;   # fix any leading ".//" problem
+      }
+      else {
+        $logfile_here =~ s/^\.\/+//;      # remove any leading "./"
+      }
+      $tmpfile      = "${logfile_here}.cvs2cl$$.tmp";
+      $logfile_bak  = "${logfile_here}.bak";
+
+      open (LOG_OUT, ">$tmpfile") or die "Unable to open \"$tmpfile\"";
+    }
+    else {
+      open (LOG_OUT, ">-") or die "Unable to open stdout for writing";
+    }
+
+    print LOG_OUT $ChangeLog_Header;
+
+    my %tag_date_printed;
+
+    $self->output_header(\*LOG_OUT);
+
+    my @key_list = ();
+    if($Chronological_Order) {
+        @key_list = sort {$a <=> $b} (keys %changelog);
+    } else {
+        @key_list = sort {$b <=> $a} (keys %changelog);
+    }
+    foreach my $time (@key_list)
+    {
+      next if ($Delta_Mode &&
+               (($time <= $Delta_StartTime) ||
+                ($time > $Delta_EndTime && $Delta_EndTime)));
+
+      # Set up the date/author line.
+      # kff todo: do some more XML munging here, on the header
+      # part of the entry:
+      my (undef,$min,$hour,$mday,$mon,$year,$wday)
+          = $UTC_Times ? gmtime($time) : localtime($time);
+
+      $wday = $self->wday($wday);
+      # XML output includes everything else, we might as well make
+      # it always include Day Of Week too, for consistency.
+      my $authorhash = $changelog{$time};
+      if ( $Show_Tag_Dates || $XML_Output ) {
+        my %tags;
+        while (my ($author,$mesghash) = each %$authorhash) {
+          while (my ($msg,$qunk) = each %$mesghash) {
+            for my $qunkref2 (@$qunk) {
+              if (defined ($qunkref2->tags)) {
+                for my $tag (@{$qunkref2->tags}) {
+                  $tags{$tag} = 1;
+                }
+              }
+            }
+          }
+        }
+        # Sort here for determinism to ease testing
+        foreach my $tag (sort keys %tags) {
+          if ( ! defined $tag_date_printed{$tag} ) {
+            $tag_date_printed{$tag} = $time;
+            $self->output_tagdate(\*LOG_OUT, $time, $tag);
+          }
+        }
+      }
+      while (my ($author,$mesghash) = each %$authorhash)
+      {
+        # If XML, escape in outer loop to avoid compound quoting:
+        $author = $self->escape($author);
+
+      FOOBIE:
+        # We sort here to enable predictable ordering for the testing porpoises
+        for my $msg (sort keys %$mesghash)
+        {
+          my $qunklist = $mesghash->{$msg};
+
+          my @qunklist =
+            grep $self->_revision_is_wanted($_), @$qunklist;
+
+          next FOOBIE unless @qunklist;
+
+          my $files               = $self->pretty_file_list(\@qunklist);
+          my $header_line;          # date and author
+          my $wholething;           # $header_line + $body
+
+          my $date = $self->fdatetime($time);
+          $header_line = $self->header_line($time, $author, $lastdate);
+          $lastdate = $date;
+
+          $Text::Wrap::huge = 'overflow'
+            if $Text::Wrap::VERSION >= 2001.0130;
+          # Reshape the body according to user preferences.
+          my $body = $self->format_body($msg, $files, \@qunklist);
+
+          $body =~ s/[ \t]+\n/\n/g;
+          $wholething = $header_line . $body;
+
+          # One last check: make sure it passes the regexp test, if the
+          # user asked for that.  We have to do it here, so that the
+          # test can match against information in the header as well
+          # as in the text of the log message.
+
+          # How annoying to duplicate so much code just because I
+          # can't figure out a way to evaluate scalars on the trailing
+          # operator portion of a regular expression.  Grrr.
+          if ($Case_Insensitive) {
+            unless ( $Regexp_Gate and ( $wholething !~ /$Regexp_Gate/oi ) ) {
+              $self->output_entry(\*LOG_OUT, $wholething);
+            }
+          }
+          else {
+            unless ( $Regexp_Gate and ( $wholething !~ /$Regexp_Gate/o ) ) {
+              $self->output_entry(\*LOG_OUT, $wholething);
+            }
+          }
+        }
+      }
+    }
+
+    $self->output_footer(\*LOG_OUT);
+
+    close (LOG_OUT);
+
+    if ( ! $Output_To_Stdout ) {
+      # If accumulating, append old data to new before renaming.  But
+      # don't append the most recent entry, since it's already in the
+      # new log due to CVS's idiosyncratic interpretation of "log -d".
+      if ($Cumulative && -f $logfile_here) {
+        open NEW_LOG, ">>$tmpfile"
+          or die "trouble appending to $tmpfile ($!)";
+
+        open OLD_LOG, "<$logfile_here"
+          or die "trouble reading from $logfile_here ($!)";
+
+        my $started_first_entry = 0;
+        my $passed_first_entry = 0;
+        while (<OLD_LOG>) {
+          if ( ! $passed_first_entry ) {
+            if ( ( ! $started_first_entry )
+                and /^(\d\d\d\d-\d\d-\d\d\s+(\w+\s+)?\d\d:\d\d)/ ) {
+              $started_first_entry = 1;
+            } elsif ( /^(\d\d\d\d-\d\d-\d\d\s+(\w+\s+)?\d\d:\d\d)/ ) {
+              $passed_first_entry = 1;
+              print NEW_LOG $_;
+            }
+          } else {
+            print NEW_LOG $_;
+          }
+        }
+
+        close NEW_LOG;
+        close OLD_LOG;
+      }
+
+      if ( -f $logfile_here ) {
+        rename $logfile_here, $logfile_bak;
+      }
+      rename $tmpfile, $logfile_here;
+    }
+  }
+}
+
+# -------------------------------------
+
+# Don't call this wrap, because with 5.5.3, that clashes with the
+# (unconditional :-( ) export of wrap() from Text::Wrap
+sub mywrap {
+  my $self = shift;
+  my ($indent1, $indent2, @text) = @_;
+  # If incoming text looks preformatted, don't get clever
+  my $text = Text::Wrap::wrap($indent1, $indent2, @text);
+  if ( grep /^\s+/m, @text ) {
+    return $text;
+  }
+  my @lines = split /\n/, $text;
+  $indent2 =~ s!^((?: {8})+)!"\t" x (length($1)/8)!e;
+  $lines[0] =~ s/^$indent1\s+/$indent1/;
+  s/^$indent2\s+/$indent2/
+    for @lines[1..$#lines];
+  my $newtext = join "\n", @lines;
+  $newtext .= "\n"
+    if substr($text, -1) eq "\n";
+  return $newtext;
+}
+
+# -------------------------------------
+
+sub preprocess_msg_text {
+  my $self = shift;
+  my ($text) = @_;
+
+  # Strip out carriage returns (as they probably result from DOSsy editors).
+  $text =~ s/\r\n/\n/g;
+  # If it *looks* like two newlines, make it *be* two newlines:
+  $text =~ s/\n\s*\n/\n\n/g;
+
+  return $text;
+}
+
+# -------------------------------------
+
+sub last_line_len {
+  my $self = shift;
+
+  my $files_list = shift;
+  my @lines = split (/\n/, $files_list);
+  my $last_line = pop (@lines);
+  return length ($last_line);
+}
+
+# -------------------------------------
+
+# A custom wrap function, sensitive to some common constructs used in
+# log entries.
+sub wrap_log_entry {
+  my $self = shift;
+
+  my $text = shift;                  # The text to wrap.
+  my $left_pad_str = shift;          # String to pad with on the left.
+
+  # These do NOT take left_pad_str into account:
+  my $length_remaining = shift;      # Amount left on current line.
+  my $max_line_length  = shift;      # Amount left for a blank line.
+
+  my $wrapped_text = '';             # The accumulating wrapped entry.
+  my $user_indent = '';              # Inherited user_indent from prev line.
+
+  my $first_time = 1;                # First iteration of the loop?
+  my $suppress_line_start_match = 0; # Set to disable line start checks.
+
+  my @lines = split (/\n/, $text);
+  while (@lines)   # Don't use `foreach' here, it won't work.
+  {
+    my $this_line = shift (@lines);
+    chomp $this_line;
+
+    if ($this_line =~ /^(\s+)/) {
+      $user_indent = $1;
+    }
+    else {
+      $user_indent = '';
+    }
+
+    # If it matches any of the line-start regexps, print a newline now...
+    if ($suppress_line_start_match)
+    {
+      $suppress_line_start_match = 0;
+    }
+    elsif (($this_line =~ /^(\s*)\*\s+[a-zA-Z0-9]/)
+           || ($this_line =~ /^(\s*)\* [a-zA-Z0-9_\.\/\+-]+/)
+           || ($this_line =~ /^(\s*)\([a-zA-Z0-9_\.\/\+-]+(\)|,\s*)/)
+           || ($this_line =~ /^(\s+)(\S+)/)
+           || ($this_line =~ /^(\s*)- +/)
+           || ($this_line =~ /^()\s*$/)
+           || ($this_line =~ /^(\s*)\*\) +/)
+           || ($this_line =~ /^(\s*)[a-zA-Z0-9](\)|\.|\:) +/))
+    {
+      # Make a line break immediately, unless header separator is set
+      # and this line is the first line in the entry, in which case
+      # we're getting the blank line for free already and shouldn't
+      # add an extra one.
+      unless (($After_Header ne " ") and ($first_time))
+      {
+        if ($this_line =~ /^()\s*$/) {
+          $suppress_line_start_match = 1;
+          $wrapped_text .= "\n${left_pad_str}";
+        }
+
+        $wrapped_text .= "\n${left_pad_str}";
+      }
+
+      $length_remaining = $max_line_length - (length ($user_indent));
+    }
+
+    # Now that any user_indent has been preserved, strip off leading
+    # whitespace, so up-folding has no ugly side-effects.
+    $this_line =~ s/^\s*//;
+
+    # Accumulate the line, and adjust parameters for next line.
+    my $this_len = length ($this_line);
+    if ($this_len == 0)
+    {
+      # Blank lines should cancel any user_indent level.
+      $user_indent = '';
+      $length_remaining = $max_line_length;
+    }
+    elsif ($this_len >= $length_remaining) # Line too long, try breaking it.
+    {
+      # Walk backwards from the end.  At first acceptable spot, break
+      # a new line.
+      my $idx = $length_remaining - 1;
+      if ($idx < 0) { $idx = 0 };
+      while ($idx > 0)
+      {
+        if (substr ($this_line, $idx, 1) =~ /\s/)
+        {
+          my $line_now = substr ($this_line, 0, $idx);
+          my $next_line = substr ($this_line, $idx);
+          $this_line = $line_now;
+
+          # Clean whitespace off the end.
+          chomp $this_line;
+
+          # The current line is ready to be printed.
+          $this_line .= "\n${left_pad_str}";
+
+          # Make sure the next line is allowed full room.
+          $length_remaining = $max_line_length - (length ($user_indent));
+
+          # Strip next_line, but then preserve any user_indent.
+          $next_line =~ s/^\s*//;
+
+          # Sneak a peek at the user_indent of the upcoming line, so
+          # $next_line (which will now precede it) can inherit that
+          # indent level.  Otherwise, use whatever user_indent level
+          # we currently have, which might be none.
+          my $next_next_line = shift (@lines);
+          if ((defined ($next_next_line)) && ($next_next_line =~ /^(\s+)/)) {
+            $next_line = $1 . $next_line if (defined ($1));
+            # $length_remaining = $max_line_length - (length ($1));
+            $next_next_line =~ s/^\s*//;
+          }
+          else {
+            $next_line = $user_indent . $next_line;
+          }
+          if (defined ($next_next_line)) {
+            unshift (@lines, $next_next_line);
+          }
+          unshift (@lines, $next_line);
+
+          # Our new next line might, coincidentally, begin with one of
+          # the line-start regexps, so we temporarily turn off
+          # sensitivity to that until we're past the line.
+          $suppress_line_start_match = 1;
+
+          last;
+        }
+        else
+        {
+          $idx--;
+        }
+      }
+
+      if ($idx == 0)
+      {
+        # We bottomed out because the line is longer than the
+        # available space.  But that could be because the space is
+        # small, or because the line is longer than even the maximum
+        # possible space.  Handle both cases below.
+
+        if ($length_remaining == ($max_line_length - (length ($user_indent))))
+        {
+          # The line is simply too long -- there is no hope of ever
+          # breaking it nicely, so just insert it verbatim, with
+          # appropriate padding.
+          $this_line = "\n${left_pad_str}${this_line}";
+        }
+        else
+        {
+          # Can't break it here, but may be able to on the next round...
+          unshift (@lines, $this_line);
+          $length_remaining = $max_line_length - (length ($user_indent));
+          $this_line = "\n${left_pad_str}";
+        }
+      }
+    }
+    else  # $this_len < $length_remaining, so tack on what we can.
+    {
+      # Leave a note for the next iteration.
+      $length_remaining = $length_remaining - $this_len;
+
+      if ($this_line =~ /\.$/)
+      {
+        $this_line .= "  ";
+        $length_remaining -= 2;
+      }
+      else  # not a sentence end
+      {
+        $this_line .= " ";
+        $length_remaining -= 1;
+      }
+    }
+
+    # Unconditionally indicate that loop has run at least once.
+    $first_time = 0;
+
+    $wrapped_text .= "${user_indent}${this_line}";
+  }
+
+  # One last bit of padding.
+  $wrapped_text .= "\n";
+
+  return $wrapped_text;
+}
+
+# -------------------------------------
+
+sub _pretty_file_list {
+  my $self = shift;
+
+  my ($unanimous_tags, $non_unanimous_tags, $all_branches, $qunksref) = @_;
+
+  my @qunkrefs =
+    grep +( ( ! $_->tags_exists
+              or
+              ! grep exists $ignore_tags{$_}, @{$_->tags})
+            and
+            ( ! keys %show_tags
+              or
+              ( $_->tags_exists
+                and
+                grep exists $show_tags{$_}, @{$_->tags} )
+            )
+          ),
+    @$qunksref;
+
+  my $common_dir;           # Dir prefix common to all files ('' if none)
+
+  # First, loop over the qunks gathering all the tag/branch names.
+  # We'll put them all in non_unanimous_tags, and take out the
+  # unanimous ones later.
+ QUNKREF:
+  foreach my $qunkref (@qunkrefs)
+  {
+    # Keep track of whether all the files in this commit were in the
+    # same directory, and memorize it if so.  We can make the output a
+    # little more compact by mentioning the directory only once.
+    if ($Common_Dir && (scalar (@qunkrefs)) > 1)
+    {
+      if (! (defined ($common_dir)))
+      {
+        my ($base, $dir);
+        ($base, $dir, undef) = fileparse ($qunkref->filename);
+
+        if ((! (defined ($dir)))  # this first case is sheer paranoia
+            or ($dir eq '')
+            or ($dir eq "./")
+            or ($dir eq ".\\"))
+        {
+          $common_dir = '';
+        }
+        else
+        {
+          $common_dir = $dir;
+        }
+      }
+      elsif ($common_dir ne '')
+      {
+        # Already have a common dir prefix, so how much of it can we preserve?
+        $common_dir = &main::common_path_prefix ($qunkref->filename, $common_dir);
+      }
+    }
+    else  # only one file in this entry anyway, so common dir not an issue
+    {
+      $common_dir = '';
+    }
+
+    if (defined ($qunkref->branch)) {
+      $all_branches->{$qunkref->branch} = 1;
+    }
+    if (defined ($qunkref->tags)) {
+      foreach my $tag (@{$qunkref->tags}) {
+        $non_unanimous_tags->{$tag} = 1;
+      }
+    }
+  }
+
+  # Any tag held by all qunks will be printed specially... but only if
+  # there are multiple qunks in the first place!
+  if ((scalar (@qunkrefs)) > 1) {
+    foreach my $tag (keys (%$non_unanimous_tags)) {
+      my $everyone_has_this_tag = 1;
+      foreach my $qunkref (@qunkrefs) {
+        if ((! (defined ($qunkref->tags)))
+            or (! (grep ($_ eq $tag, @{$qunkref->tags})))) {
+          $everyone_has_this_tag = 0;
+        }
+      }
+      if ($everyone_has_this_tag) {
+        $unanimous_tags->{$tag} = 1;
+        delete $non_unanimous_tags->{$tag};
+      }
+    }
+  }
+
+  return $common_dir, \@qunkrefs;
+}
+
+# -------------------------------------
+
+sub fdatetime {
+  my $self = shift;
+
+  my ($year, $mday, $mon, $wday, $hour, $min);
+
+  if ( @_ > 1 ) {
+    ($year, $mday, $mon, $wday, $hour, $min) = @_;
+  } else {
+    my ($time) = @_;
+    (undef, $min, $hour, $mday, $mon, $year, $wday) =
+      $UTC_Times ? gmtime($time) : localtime($time);
+
+    $year += 1900;
+    $mon  += 1;
+    $wday  = $self->wday($wday);
+  }
+
+  my $fdate = $self->fdate($year, $mon, $mday, $wday);
+
+  if ($Show_Times) {
+    my $ftime = $self->ftime($hour, $min);
+    return "$fdate $ftime";
+  } else {
+    return $fdate;
+  }
+}
+
+# -------------------------------------
+
+sub fdate {
+  my $self = shift;
+
+  my ($year, $mday, $mon, $wday);
+
+  if ( @_ > 1 ) {
+    ($year, $mon, $mday, $wday) = @_;
+  } else {
+    my ($time) = @_;
+    (undef, undef, undef, $mday, $mon, $year, $wday) =
+      $UTC_Times ? gmtime($time) : localtime($time);
+
+    $year += 1900;
+    $mon  += 1;
+    $wday  = $self->wday($wday);
+  }
+
+  return sprintf '%4u-%02u-%02u%s', $year, $mon, $mday, $wday;
+}
+
+# -------------------------------------
+
+sub ftime {
+  my $self = shift;
+
+  my ($hour, $min);
+
+  if ( @_ > 1 ) {
+    ($hour, $min) = @_;
+  } else {
+    my ($time) = @_;
+    (undef, $min, $hour) = $UTC_Times ? gmtime($time) : localtime($time);
+  }
+
+  return sprintf '%02u:%02u', $hour, $min;
+}
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::Message;
+
+sub new {
+  my $class = shift;
+  my ($msg) = @_;
+
+  my %self = (msg => $msg, files => []);
+
+  bless \%self, $class;
+}
+
+sub add_fileentry {
+  my $self = shift;
+  my ($fileentry) = @_;
+
+  die "Not a fileentry: $fileentry"
+    unless $fileentry->isa('CVS::Utils::ChangeLog::FileEntry');
+
+  push @{$self->{files}}, $fileentry;
+}
+
+sub files { wantarray ? @{$_[0]->{files}} : $_[0]->{files} }
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::FileEntry;
+
+use File::Basename qw( fileparse );
+
+# Each revision of a file has a little data structure (a `qunk')
+# associated with it.  That data structure holds not only the
+# file's name, but any additional information about the file
+# that might be needed in the output, such as the revision
+# number, tags, branches, etc.  The reason to have these things
+# arranged in a data structure, instead of just appending them
+# textually to the file's name, is that we may want to do a
+# little rearranging later as we write the output.  For example,
+# all the files on a given tag/branch will go together, followed
+# by the tag in parentheses (so trunk or otherwise non-tagged
+# files would go at the end of the file list for a given log
+# message).  This rearrangement is a lot easier to do if we
+# don't have to reparse the text.
+#
+# A qunk looks like this:
+#
+#   {
+#     filename    =>    "hello.c",
+#     revision    =>    "1.4.3.2",
+#     time        =>    a timegm() return value (moment of commit)
+#     tags        =>    [ "tag1", "tag2", ... ],
+#     branch      =>    "branchname" # There should be only one, right?
+#     roots       =>    [ "branchtag1", "branchtag2", ... ]
+#     lines       =>    "+x -y" # or undefined; x and y are integers
+#   }
+
+# Single top-level ChangeLog, or one per subdirectory?
+my $distributed;
+sub distributed { $#_ ? ($distributed = $_[1]) : $distributed; }
+
+sub new {
+  my $class = shift;
+  my ($path, $time, $revision, $state, $lines,
+      $branch_names, $branch_roots, $branch_numbers, $symbolic_names) = @_;
+
+  my %self = (time     => $time,
+              revision => $revision,
+              state    => $state,
+              lines    => $lines,
+              branch_numbers => $branch_numbers,
+             );
+
+  if ( $distributed ) {
+    @self{qw(filename dir_key)} = fileparse($path);
+  } else {
+    @self{qw(filename dir_key)} = ($path, './');
+  }
+
+  { # Scope for $branch_prefix
+    (my ($branch_prefix) = ($revision =~ /((?:\d+\.)+)\d+/));
+    $branch_prefix =~ s/\.$//;
+    if ( $branch_names->{$branch_prefix} ) {
+      my $branch_name = $branch_names->{$branch_prefix};
+      $self{branch}   = $branch_name;
+      $self{branches} = [$branch_name];
+    }
+    while ( $branch_prefix =~ s/^(\d+(?:\.\d+\.\d+)+)\.\d+\.\d+$/$1/ ) {
+      push @{$self{branches}}, $branch_names->{$branch_prefix}
+        if exists $branch_names->{$branch_prefix};
+    }
+  }
+
+  # If there's anything in the @branch_roots array, then this
+  # revision is the root of at least one branch.  We'll display
+  # them as branch names instead of revision numbers, the
+  # substitution for which is done directly in the array:
+  $self{'roots'} = [ map { $branch_names->{$_} } @$branch_roots ]
+    if @$branch_roots;
+
+  if ( exists $symbolic_names->{$revision} ) {
+    $self{tags} = delete $symbolic_names->{$revision};
+    &main::delta_check($time, $self{tags});
+  }
+
+  bless \%self, $class;
+}
+
+sub filename       { $_[0]->{filename}       }
+sub dir_key        { $_[0]->{dir_key}        }
+sub revision       { $_[0]->{revision}       }
+sub branch         { $_[0]->{branch}         }
+sub state          { $_[0]->{state}          }
+sub lines          { $_[0]->{lines}          }
+sub roots          { $_[0]->{roots}          }
+sub branch_numbers { $_[0]->{branch_numbers} }
+
+sub tags        { $_[0]->{tags}     }
+sub tags_exists {
+  exists $_[0]->{tags};
+}
+
+# This may someday be used in a more sophisticated calculation of what other
+# files are involved in this commit.  For now, we don't use it much except for
+# delta mode, because the common-commit-detection algorithm is hypothesized to
+# be "good enough" as it stands.
+sub time     { $_[0]->{time}     }
+
+# ----------------------------------------------------------------------------
+
+package CVS::Utils::ChangeLog::EntrySetBuilder;
+
+use File::Basename qw( fileparse );
+use Time::Local    qw( timegm );
+
+use constant MAILNAME => "/etc/mailname";
+
+# In 'cvs log' output, one long unbroken line of equal signs separates files:
+use constant FILE_SEPARATOR => '=' x 77;# . "\n";
+# In 'cvs log' output, a shorter line of dashes separates log messages within
+# a file:
+use constant REV_SEPARATOR  => '-' x 28;# . "\n";
+
+use constant EMPTY_LOG_MESSAGE => '*** empty log message ***';
+
+# -------------------------------------
+
+sub new {
+  my ($proto) = @_;
+  my $class = ref $proto || $proto;
+
+  my $poobah  = CVS::Utils::ChangeLog::EntrySet->new;
+  my $self = bless +{ grand_poobah => $poobah }, $class;
+
+  $self->clear_file;
+  $self->maybe_read_user_map_file;
+  return $self;
+}
+
+# -------------------------------------
+
+sub clear_msg {
+  my ($self) = @_;
+
+  # Make way for the next message
+  undef $self->{rev_msg};
+  undef $self->{rev_time};
+  undef $self->{rev_revision};
+  undef $self->{rev_author};
+  undef $self->{rev_state};
+  undef $self->{lines};
+  $self->{rev_branch_roots} = [];       # For showing which files are branch
+                                        # ancestors.
+  $self->{collecting_symbolic_names} = 0;
+}
+
+# -------------------------------------
+
+sub clear_file {
+  my ($self) = @_;
+  $self->clear_msg;
+
+  undef $self->{filename};
+  $self->{branch_names}   = +{};        # We'll grab branch names while we're
+                                        # at it.
+  $self->{branch_numbers} = +{};        # Save some revisions for
+                                        # @Follow_Branches
+  $self->{symbolic_names} = +{};        # Where tag names get stored.
+}
+
+# -------------------------------------
+
+sub grand_poobah { $_[0]->{grand_poobah} }
+
+# -------------------------------------
+
+sub read_changelog {
+  my ($self, $command) = @_;
+
+  local (*READER);
+  my $pid;
+  if (! $Input_From_Stdin) {
+    if ($^O =~ /Win32/i) {
+      open (READER, "@$command |")
+        or die "unable to run \"@$command\"";
+    }
+    else {
+      local (*WRITER);
+      pipe(READER, WRITER)
+        or die "Couldn't form pipe: $!\n";
+      $pid = fork;
+      if (! defined $pid) {
+        die "Couldn't fork: $!\n";
+      }
+      if ( ! $pid ) { # child
+        open STDOUT, '>&=' . fileno WRITER
+          or die "Couldn't dup stderr to ", fileno WRITER, "\n";
+        # strangely, some perls give spurious warnings about STDIN being opened
+        # for output only these close calls precede the STDOUT reopen above.
+        # I think they must be reusing fd 1.
+        close READER;
+        close STDIN;
+
+        exec @$command;
+      }
+
+      close WRITER;
+    }
+
+    &main::debug ("(run \"@$command\")\n");
+  }
+  else {
+    open READER, '-' or die "unable to open stdin for reading";
+  }
+
+  binmode READER;
+
+ XX_Log_Source:
+  while (<READER>) {
+    chomp;
+    s!\r$!!;
+
+    # If on a new file and don't see filename, skip until we find it, and
+    # when we find it, grab it.
+    if ( ! defined $self->{filename} ) {
+      $self->read_file_path($_);
+    } elsif ( /^symbolic names:$/ ) {
+      $self->{collecting_symbolic_names} = 1;
+    } elsif ( $self->{collecting_symbolic_names} ) {
+      $self->read_symbolic_name($_);
+    } elsif ( $_ eq FILE_SEPARATOR and ! defined $self->{rev_revision} ) {
+      $self->clear_file;
+    } elsif ( ! defined $self->{rev_revision} ) {
+        # If have file name, but not revision, and see revision, then grab
+        # it.  (We collect unconditionally, even though we may or may not
+        # ever use it.)
+      $self->read_revision($_);
+    } elsif ( ! defined $self->{rev_time} ) { # and /^date: /) {
+      $self->read_date_author_and_state($_);
+    } elsif ( /^branches:\s+(.*);$/ ) {
+      $self->read_branches($1);
+    } elsif ( ! ( $_ eq FILE_SEPARATOR or $_ eq REV_SEPARATOR ) ) {
+      # If have file name, time, and author, then we're just grabbing
+      # log message texts:
+      $self->{rev_msg} .= $_ . "\n";   # Normally, just accumulate the message...
+    } else {
+      my $noadd = 0;
+      if ( ! $self->{rev_msg}
+           or $self->{rev_msg} =~ /^\s*(\.\s*)?$/
+           or index($self->{rev_msg}, EMPTY_LOG_MESSAGE) > -1 ) {
+        # ... until a msg separator is encountered:
+        # Ensure the message contains something:
+        $self->clear_msg, $noadd = 1
+          if $Prune_Empty_Msgs;
+        $self->{rev_msg} = "[no log message]\n";
+      }
+
+      $self->add_file_entry
+        unless $noadd;
+
+      if ( $_ eq FILE_SEPARATOR ) {
+        $self->clear_file;
+      } else {
+        $self->clear_msg;
+      }
+    }
+  }
+
+  close READER
+    or die "Couldn't close pipe reader: $!\n";
+  if ( defined $pid ) {
+    my $rv;
+    waitpid $pid, 0;
+    0 == $?
+      or $!=1, die sprintf("Problem reading log input (pid/exit/signal/core: %d/%d/%d/%d)\n",
+                           $pid, $? >> 8, $? & 127, $? & 128);
+  }
+  return;
+}
+
+# -------------------------------------
+
+sub add_file_entry {
+  $_[0]->grand_poobah->add_fileentry(@{$_[0]}{qw(filename rev_time rev_revision
+                                                 rev_state lines branch_names
+                                                 rev_branch_roots
+                                                 branch_numbers
+                                                 symbolic_names
+                                                 rev_author rev_msg)});
+}
+
+# -------------------------------------
+
+sub maybe_read_user_map_file {
+  my ($self) = @_;
+
+  my %expansions;
+  my $User_Map_Input;
+
+  if ($User_Map_File)
+  {
+    if ( $User_Map_File =~ m{^([-\w\@+=.,\/]+):([-\w\@+=.,\/:]+)} and
+         !-f $User_Map_File )
+    {
+      my $rsh = (exists $ENV{'CVS_RSH'} ? $ENV{'CVS_RSH'} : 'ssh');
+      $User_Map_Input = "$rsh $1 'cat $2' |";
+      &main::debug ("(run \"${User_Map_Input}\")\n");
+    }
+    else
+    {
+      $User_Map_Input = "<$User_Map_File";
+    }
+
+    open (MAPFILE, $User_Map_Input)
+        or die ("Unable to open $User_Map_File ($!)");
+
+    while (<MAPFILE>)
+    {
+      next if /^\s*#/;  # Skip comment lines.
+      next if not /:/;  # Skip lines without colons.
+
+      # It is now safe to split on ':'.
+      my ($username, $expansion) = split ':';
+      chomp $expansion;
+      $expansion =~ s/^'(.*)'$/$1/;
+      $expansion =~ s/^"(.*)"$/$1/;
+
+      # If it looks like the expansion has a real name already, then
+      # we toss the username we got from CVS log.  Otherwise, keep
+      # it to use in combination with the email address.
+
+      if ($expansion =~ /^\s*<{0,1}\S+@.*/) {
+        # Also, add angle brackets if none present
+        if (! ($expansion =~ /<\S+@\S+>/)) {
+          $expansions{$username} = "$username <$expansion>";
+        }
+        else {
+          $expansions{$username} = "$username $expansion";
+        }
+      }
+      else {
+        $expansions{$username} = $expansion;
+      }
+    } # fi ($User_Map_File)
+
+    close (MAPFILE);
+  }
+
+  if (defined $User_Passwd_File)
+  {
+    if ( ! defined $Domain ) {
+      if ( -e MAILNAME ) {
+        chomp($Domain = slurp_file(MAILNAME));
+      } else {
+      MAILDOMAIN_CMD:
+        for ([qw(hostname -d)], 'dnsdomainname', 'domainname') {
+          my ($text, $exit, $sig, $core) = run_ext($_);
+          if ( $exit == 0 && $sig == 0 && $core == 0 ) {
+            chomp $text;
+            if ( length $text ) {
+              $Domain = $text;
+              last MAILDOMAIN_CMD;
+            }
+          }
+        }
+      }
+    }
+
+    die "No mail domain found\n"
+      unless defined $Domain;
+
+    open (MAPFILE, "<$User_Passwd_File")
+        or die ("Unable to open $User_Passwd_File ($!)");
+    while (<MAPFILE>)
+    {
+      # all lines are valid
+      my ($username, $pw, $uid, $gid, $gecos, $homedir, $shell) = split ':';
+      my $expansion = '';
+      ($expansion) = split (',', $gecos)
+        if defined $gecos && length $gecos;
+
+      my $mailname = $Domain eq '' ? $username : "$username\@$Domain";
+      $expansions{$username} = "$expansion <$mailname>";
+    }
+    close (MAPFILE);
+  }
+
+ $self->{usermap} = \%expansions;
+}
+
+# -------------------------------------
+
+sub read_file_path {
+  my ($self, $line) = @_;
+
+  my $path;
+
+  if ( $line =~ /^Working file: (.*)/ ) {
+    $path = $1;
+  } elsif ( defined $RCS_Root
+            and
+            $line =~ m|^RCS file: $RCS_Root[/\\](.*),v$| ) {
+    $path = $1;
+    $path =~ s!Attic/!!;
+  } else {
+    return;
+  }
+
+  if ( @Ignore_Files ) {
+    my $base;
+    ($base, undef, undef) = fileparse($path);
+
+    my $xpath = $Case_Insensitive ? lc($path) : $path;
+    return
+      if grep $path =~ /$_/, @Ignore_Files;
+  }
+
+  $self->{filename} = $path;
+  return;
+}
+
+# -------------------------------------
+
+sub read_symbolic_name {
+  my ($self, $line) = @_;
+
+  # All tag names are listed with whitespace in front in cvs log
+  # output; so if see non-whitespace, then we're done collecting.
+  if ( /^\S/ ) {
+    $self->{collecting_symbolic_names} = 0;
+    return;
+  } else {
+    # we're looking at a tag name, so parse & store it
+
+    # According to the Cederqvist manual, in node "Tags", tag names must start
+    # with an uppercase or lowercase letter and can contain uppercase and
+    # lowercase letters, digits, `-', and `_'.  However, it's not our place to
+    # enforce that, so we'll allow anything CVS hands us to be a tag:
+    my ($tag_name, $tag_rev) = ($line =~ /^\s+([^:]+): ([\d.]+)$/);
+
+    # A branch number either has an odd number of digit sections
+    # (and hence an even number of dots), or has ".0." as the
+    # second-to-last digit section.  Test for these conditions.
+    my $real_branch_rev = '';
+    if ( $tag_rev =~ /^(\d+\.\d+\.)+\d+$/             # Even number of dots...
+         and
+         $tag_rev !~ /^(1\.)+1$/ ) {                  # ...but not "1.[1.]1"
+      $real_branch_rev = $tag_rev;
+    } elsif ($tag_rev =~ /(\d+\.(\d+\.)+)0.(\d+)/) {  # Has ".0."
+      $real_branch_rev = $1 . $3;
+    }
+
+    # If we got a branch, record its number.
+    if ( $real_branch_rev ) {
+      $self->{branch_names}->{$real_branch_rev} = $tag_name;
+      $self->{branch_numbers}->{$tag_name} = $real_branch_rev;
+    } else {
+      # Else it's just a regular (non-branch) tag.
+      push @{$self->{symbolic_names}->{$tag_rev}}, $tag_name;
+    }
+  }
+
+  $self->{collecting_symbolic_names} = 1;
+  return;
+}
+
+# -------------------------------------
+
+sub read_revision {
+  my ($self, $line) = @_;
+
+  my ($revision) = ( $line =~ /^revision (\d+\.[\d.]+)/ );
+
+  return
+    unless $revision;
+
+  $self->{rev_revision} = $revision;
+  return;
+}
+
+# -------------------------------------
+
+{ # Closure over %gecos_warned
+my %gecos_warned;
+sub read_date_author_and_state {
+  my ($self, $line) = @_;
+
+  my ($time, $author, $state) = $self->parse_date_author_and_state($line);
+
+  if ( defined($self->{usermap}->{$author}) and $self->{usermap}->{$author} ) {
+    $author = $self->{usermap}->{$author};
+  } elsif ( defined $Domain or $Gecos == 1 ) {
+    my $email = $author;
+    $email = $author."@".$Domain
+      if defined $Domain && $Domain ne '';
+
+    my $pw = getpwnam($author);
+    my ($fullname, $office, $workphone, $homephone, $gcos);
+    if ( defined $pw ) {
+      $gcos = (getpwnam($author))[6];
+      ($fullname, $office, $workphone, $homephone) =
+        split /\s*,\s*/, $gcos;
+    } else {
+      warn "Couldn't find gecos info for author '$author'\n"
+        unless $gecos_warned{$author}++;
+      $fullname = '';
+    }
+    for (grep defined, $fullname, $office, $workphone, $homephone) {
+      s/&/ucfirst(lc($pw))/ge;
+    }
+    $author = $fullname . "  <" . $email . ">"
+      if defined $fullname && $fullname ne '';
+  }
+
+  $self->{rev_state}  = $state;
+  $self->{rev_time}   = $time;
+  $self->{rev_author} = $author;
+  return;
+}
+}
+
+# -------------------------------------
+
+sub read_branches {
+  # A "branches: ..." line here indicates that one or more branches
+  # are rooted at this revision.  If we're showing branches, then we
+  # want to show that fact as well, so we collect all the branches
+  # that this is the latest ancestor of and store them in
+  # $self->[rev_branch_roots}.  Just for reference, the format of the
+  # line we're seeing at this point is:
+  #
+  #    branches:  1.5.2;  1.5.4;  ...;
+  #
+  # Okay, here goes:
+  my ($self, $line) = @_;
+
+  # Ugh.  This really bothers me.  Suppose we see a log entry
+  # like this:
+  #
+  #    ----------------------------
+  #    revision 1.1
+  #    date: 1999/10/17 03:07:38;  author: jrandom;  state: Exp;
+  #    branches:  1.1.2;
+  #    Intended first line of log message begins here.
+  #    ----------------------------
+  #
+  # The question is, how we can tell the difference between that
+  # log message and a *two*-line log message whose first line is
+  #
+  #    "branches:  1.1.2;"
+  #
+  # See the problem?  The output of "cvs log" is inherently
+  # ambiguous.
+  #
+  # For now, we punt: we liberally assume that people don't
+  # write log messages like that, and just toss a "branches:"
+  # line if we see it but are not showing branches.  I hope no
+  # one ever loses real log data because of this.
+  if ( $Show_Branches ) {
+    $line =~ s/(1\.)+1;|(1\.)+1$//;  # ignore the trivial branch 1.1.1
+    $self->{rev_branch_roots} = [split /;\s+/, $line]
+      if length $line;
+  }
+}
+
+# -------------------------------------
+
+sub parse_date_author_and_state {
+  my ($self, $line) = @_;
+  # Parses the date/time and author out of a line like:
+  #
+  # date: 1999/02/19 23:29:05;  author: apharris;  state: Exp;
+  #
+  # or, in CVS 1.12.9:
+  #
+  # date: 2004-06-05 16:10:32 +0000; author: somebody; state: Exp;
+
+  my ($year, $mon, $mday, $hours, $min, $secs, $utcOffset, $author, $state, $rest) =
+    $line =~
+      m!(\d+)[-/](\d+)[-/](\d+)\s+(\d+):(\d+):(\d+)(\s+[+-]\d{4})?;\s+
+        author:\s+([^;]+);\s+state:\s+([^;]+);(.*)!x
+    or  die "Couldn't parse date ``$line''";
+  die "Bad date or Y2K issues"
+    unless $year > 1969 and $year < 2258;
+  # Kinda arbitrary, but useful as a sanity check
+  my $time = timegm($secs, $min, $hours, $mday, $mon-1, $year-1900);
+  if ( defined $utcOffset ) {
+    my ($plusminus, $hour, $minute) = ($utcOffset =~ m/([+-])(\d\d)(\d\d)/);
+    my $offset = (($hour * 60) + $minute) * 60 * ($plusminus eq '+' ? -1 : 1);
+    $time += $offset;
+  }
+  if ( $rest =~ m!\s+lines:\s+(.*)! ) {
+    $self->{lines} = $1;
+  }
+
+  return $time, $author, $state;
+}
+
+# Subrs ----------------------------------------------------------------------
+
+package main;
+
+sub delta_check {
+  my ($time, $tags) = @_;
+
+  # If we're in 'delta' mode, update the latest observed times for the
+  # beginning and ending tags, and when we get around to printing output, we
+  # will simply restrict ourselves to that timeframe...
+  return
+    unless $Delta_Mode;
+
+  $Delta_StartTime = $time
+    if $time > $Delta_StartTime and $Delta_From and grep { $_ eq $Delta_From } @$tags;
+
+  $Delta_EndTime = $time
+    if $time > $Delta_EndTime and $Delta_To and grep { $_ eq $Delta_To } @$tags;
+}
+
+sub run_ext {
+  my ($cmd) = @_;
+  $cmd = [$cmd]
+    unless ref $cmd;
+  local $" = ' ';
+  my $out = qx"@$cmd 2>&1";
+  my $rv  = $?;
+  my ($sig, $core, $exit) = ($? & 127, $? & 128, $? >> 8);
+  return $out, $exit, $sig, $core;
+}
+
+# -------------------------------------
+
+# If accumulating, grab the boundary date from pre-existing ChangeLog.
+sub maybe_grab_accumulation_date {
+  if (! $Cumulative || $Update) {
+    return '';
+  }
+
+  # else
+
+  open (LOG, "$Log_File_Name")
+      or die ("trouble opening $Log_File_Name for reading ($!)");
+
+  my $boundary_date;
+  while (<LOG>)
+  {
+    if (/^(\d\d\d\d-\d\d-\d\d\s+(\w+\s+)?\d\d:\d\d)/)
+    {
+      $boundary_date = "$1";
+      last;
+    }
+  }
+
+  close (LOG);
+
+  # convert time from utc to local timezone if the ChangeLog has
+  # dates/times in utc
+  if ($UTC_Times && $boundary_date)
+  {
+    # convert the utc time to a time value
+    my ($year,$mon,$mday,$hour,$min) = $boundary_date =~
+      m#(\d+)-(\d+)-(\d+)\s+(\d+):(\d+)#;
+    my $time = timegm(0,$min,$hour,$mday,$mon-1,$year-1900);
+    # print the timevalue in the local timezone
+    my ($ignore,$wday);
+    ($ignore,$min,$hour,$mday,$mon,$year,$wday) = localtime($time);
+    $boundary_date=sprintf ("%4u-%02u-%02u %02u:%02u",
+                            $year+1900,$mon+1,$mday,$hour,$min);
+  }
+
+  return $boundary_date;
+}
+
+# -------------------------------------
+
+# Fills up a ChangeLog structure in the current directory.
+sub derive_changelog {
+  my ($command) = @_;
+
+  # See "The Plan" above for a full explanation.
+
+  # Might be adding to an existing ChangeLog
+  my $accumulation_date = maybe_grab_accumulation_date;
+  if ($accumulation_date) {
+    # Insert -d immediately after 'cvs log'
+    my $Log_Date_Command = "-d>${accumulation_date}";
+
+    my ($log_index) = grep $command->[$_] eq 'log', 0..$#$command;
+    splice @$command, $log_index+1, 0, $Log_Date_Command;
+    &debug ("(adding log msg starting from $accumulation_date)\n");
+  }
+
+#  output_changelog(read_changelog($command));
+  my $builder = CVS::Utils::ChangeLog::EntrySetBuilder->new;
+  $builder->read_changelog($command);
+  $builder->grand_poobah->output_changelog;
+}
+
+# -------------------------------------
+
+sub min { $_[0] < $_[1] ? $_[0] : $_[1] }
+
+# -------------------------------------
+
+sub common_path_prefix {
+  my ($path1, $path2) = @_;
+
+  # For compatibility (with older versions of cvs2cl.pl), we think in UN*X
+  # terms, and mould windoze filenames to match.  Is this really appropriate?
+  # If a file is checked in under UN*X, and cvs log run on windoze, which way
+  # do the path separators slope?  Can we use fileparse as per the local
+  # conventions?  If so, we should probably have a user option to specify an
+  # OS to emulate to handle stdin-fed logs.  If we did this, we could avoid
+  # the nasty \-/ transmogrification below.
+
+  my ($dir1, $dir2) = map +(fileparse($_))[1], $path1, $path2;
+
+  # Transmogrify Windows filenames to look like Unix.
+  # (It is far more likely that someone is running cvs2cl.pl under
+  # Windows than that they would genuinely have backslashes in their
+  # filenames.)
+  tr!\\!/!
+    for $dir1, $dir2;
+
+  my ($accum1, $accum2, $last_common_prefix) = ('') x 3;
+
+  my @path1 = grep length($_), split qr!/!, $dir1;
+  my @path2 = grep length($_), split qr!/!, $dir2;
+
+  my @common_path;
+  for (0..min($#path1,$#path2)) {
+    if ( $path1[$_] eq $path2[$_]) {
+      push @common_path, $path1[$_];
+    } else {
+      last;
+    }
+  }
+
+  return join '', map "$_/", @common_path;
+}
+
+# -------------------------------------
+
+sub parse_options {
+  # Check this internally before setting the global variable.
+  my $output_file;
+
+  # If this gets set, we encountered unknown options and will exit at
+  # the end of this subroutine.
+  my $exit_with_admonishment = 0;
+
+  # command to generate the log
+  my @log_source_command = qw( cvs log );
+
+  my (@Global_Opts, @Local_Opts);
+
+  Getopt::Long::Configure(qw( bundling permute no_getopt_compat
+                              pass_through no_ignore_case ));
+  GetOptions('help|usage|h'   => \$Print_Usage,
+             'debug'          => \$Debug,        # unadvertised option, heh
+             'version'        => \$Print_Version,
+
+             'file|f=s'       => \$output_file,
+             'accum'          => \$Cumulative,
+             'update'         => \$Update,
+             'fsf'            => \$FSF_Style,
+             'rcs=s'          => \$RCS_Root,
+             'usermap|U=s'    => \$User_Map_File,
+             'gecos'          => \$Gecos,
+             'domain=s'       => \$Domain,
+             'passwd=s'       => \$User_Passwd_File,
+             'window|W=i'     => \$Max_Checkin_Duration,
+             'chrono'         => \$Chronological_Order,
+             'ignore|I=s'     => \@Ignore_Files,
+             'case-insensitive|C' => \$Case_Insensitive,
+             'regexp|R=s'     => \$Regexp_Gate,
+             'stdin'          => \$Input_From_Stdin,
+             'stdout'         => \$Output_To_Stdout,
+             'distributed|d'  => sub { CVS::Utils::ChangeLog::FileEntry->distributed(1) },
+             'prune|P'        => \$Prune_Empty_Msgs,
+             'no-wrap'        => \$No_Wrap,
+             'gmt|utc'        => \$UTC_Times,
+             'day-of-week|w'  => \$Show_Day_Of_Week,
+             'revisions|r'    => \$Show_Revisions,
+             'show-dead'      => \$Show_Dead,
+             'tags|t'         => \$Show_Tags,
+             'tagdates|T'     => \$Show_Tag_Dates,
+             'branches|b'     => \$Show_Branches,
+             'follow|F=s'     => \@Follow_Branches,
+             'follow-only=s'  => \@Follow_Only,
+             'xml-encoding=s' => \$XML_Encoding,
+             'xml'            => \$XML_Output,
+             'noxmlns'        => \$No_XML_Namespace,
+             'no-xml-iso-date' => \$No_XML_ISO_Date,
+             'no-ancestors'   => \$No_Ancestors,
+             'lines-modified' => \$Show_Lines_Modified,
+
+             'no-indent'    => sub {
+               $Indent = '';
+             },
+
+             'summary'      => sub {
+               $Summary = 1;
+               $After_Header = "\n\n"; # Summary implies --separate-header
+             },
+
+             'no-times'     => sub {
+               $Show_Times = 0;
+             },
+
+             'no-hide-branch-additions' => sub {
+               $Hide_Branch_Additions = 0;
+             },
+
+             'no-common-dir'  => sub {
+               $Common_Dir = 0;
+             },
+
+             'ignore-tag=s'   => sub {
+               $ignore_tags{$_[1]} = 1;
+             },
+
+             'show-tag=s'     => sub {
+               $show_tags{$_[1]} = 1;
+             },
+
+             # Deliberately undocumented.  This is not a public interface, and
+             # may change/disappear at any time.
+             'test-code=s'    => \$TestCode,
+
+             'delta=s'        => sub {
+               my $arg = $_[1];
+               if ( $arg =~
+                    /^([A-Za-z][A-Za-z0-9_\-\]\[\.]*)?:([A-Za-z][A-Za-z0-9_\-\]\[\.]*)?$/ )
+               {
+                 $Delta_From = $1;
+                 $Delta_To = $2;
+                 $Delta_Mode = 1;
+               } else {
+                 die "--delta FROM_TAG:TO_TAG is what you meant to say.\n";
+               }
+             },
+
+             'FSF'             => sub {
+               $FSF_Output = 1;
+               $Show_Times = 0;
+               $Common_Dir = 0;
+               $No_Extra_Indent = 1;
+               $Indent = "\t";
+             },
+
+             'header=s'        => sub {
+               my $narg = $_[1];
+               $ChangeLog_Header = &slurp_file ($narg);
+               if (! defined ($ChangeLog_Header)) {
+                 $ChangeLog_Header = '';
+               }
+             },
+
+             'global-opts|g=s' => sub {
+               my $narg = $_[1];
+               push @Global_Opts, $narg;
+               splice @log_source_command, 1, 0, $narg;
+             },
+
+             'log-opts|l=s' => sub {
+               my $narg = $_[1];
+               push @Local_Opts, $narg;
+               push @log_source_command, $narg;
+             },
+
+             'mailname=s'   => sub {
+               my $narg = $_[1];
+               warn "--mailname is deprecated; please use --domain instead\n";
+               $Domain = $narg;
+             },
+
+             'separate-header|S' => sub {
+               $After_Header = "\n\n";
+               $No_Extra_Indent = 1;
+             },
+
+             'group-within-date' => sub {
+               $GroupWithinDate = 1;
+               $Show_Times = 0;
+             },
+
+             'hide-filenames' => sub {
+               $Hide_Filenames = 1;
+               $After_Header = '';
+             },
+            )
+    or die "options parsing failed\n";
+
+  push @log_source_command, map "$_", @ARGV;
+
+  ## Check for contradictions...
+
+  if ($Output_To_Stdout && CVS::Utils::ChangeLog::FileEntry->distributed) {
+    print STDERR "cannot pass both --stdout and --distributed\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($Output_To_Stdout && $output_file) {
+    print STDERR "cannot pass both --stdout and --file\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($Input_From_Stdin && @Global_Opts) {
+    print STDERR "cannot pass both --stdin and -g\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($Input_From_Stdin && @Local_Opts) {
+    print STDERR "cannot pass both --stdin and -l\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($XML_Output && $Cumulative) {
+    print STDERR "cannot pass both --xml and --accum\n";
+    $exit_with_admonishment = 1;
+  }
+
+  if ($FSF_Output && $Cumulative) {
+    print STDERR "cannot pass both --FSF and --accum\n";
+    $exit_with_admonishment = 1;
+  }
+
+  # Other consistency checks and option-driven logic
+
+  # Bleargh.  Compensate for a deficiency of custom wrapping.
+  if ( ($After_Header ne " ") and $FSF_Style ) {
+    $After_Header .= "\t";
+  }
+
+  @Ignore_Files = map lc, @Ignore_Files
+    if $Case_Insensitive;
+
+  # Or if any other error message has already been printed out, we
+  # just leave now:
+  if ($exit_with_admonishment) {
+    &usage ();
+    exit (1);
+  }
+  elsif ($Print_Usage) {
+    &usage ();
+    exit (0);
+  }
+  elsif ($Print_Version) {
+    &version ();
+    exit (0);
+  }
+
+  ## Else no problems, so proceed.
+
+  if ($output_file) {
+    $Log_File_Name = $output_file;
+  }
+
+  return \@log_source_command;
+}
+
+# -------------------------------------
+
+sub slurp_file {
+  my $filename = shift || die ("no filename passed to slurp_file()");
+  my $retstr;
+
+  open (SLURPEE, "<${filename}") or die ("unable to open $filename ($!)");
+  local $/ = undef;
+  $retstr = <SLURPEE>;
+  close (SLURPEE);
+  return $retstr;
+}
+
+# -------------------------------------
+
+sub debug {
+  if ($Debug) {
+    my $msg = shift;
+    print STDERR $msg;
+  }
+}
+
+# -------------------------------------
+
+sub version {
+  print "cvs2cl.pl version ${VERSION}; distributed under the GNU GPL.\n";
+}
+
+# -------------------------------------
+
+sub usage {
+  &version ();
+
+  eval "use Pod::Usage qw( pod2usage )";
+
+   if ( $@ ) {
+    print <<'END';
+
+* Pod::Usage was not found.  The formatting may be suboptimal.  Consider
+  upgrading your Perl --- Pod::Usage is standard from 5.6 onwards, and
+  versions of perl prior to 5.6 are getting rather rusty, now.  Alternatively,
+  install Pod::Usage direct from CPAN.
+END
+
+    local $/ = undef;
+    my $message = <DATA>;
+    $message =~ s/^=(head1|item) //gm;
+    $message =~ s/^=(over|back).*\n//gm;
+    $message =~ s/\n{3,}/\n\n/g;
+    print $message;
+  } else {
+    print "\n";
+    pod2usage( -exitval => 'NOEXIT',
+               -verbose => 1,
+               -output  => \*STDOUT,
+             );
+  }
+
+  return;
+}
+
+# Main -----------------------------------------------------------------------
+
+my $log_source_command = parse_options;
+if ( defined $TestCode ) {
+  eval $TestCode;
+  die "Eval failed: '$@'\n"
+    if $@;
+} else {
+  derive_changelog($log_source_command);
+}
+
+__DATA__
+
+=head1 NAME
+
+cvs2cl.pl - convert cvs log messages to changelogs
+
+=head1 SYNOPSIS
+
+B<cvs2cl> [I<options>] [I<FILE1> [I<FILE2> ...]]
+
+=head1 DESCRIPTION
+
+cvs2cl produces a GNU-style ChangeLog for CVS-controlled sources by
+running "cvs log" and parsing the output. Duplicate log messages get
+unified in the Right Way.
+
+The default output of cvs2cl is designed to be compact, formally unambiguous,
+but still easy for humans to read.  It should be largely self-explanatory; the
+one abbreviation that might not be obvious is "utags".  That stands for
+"universal tags" -- a universal tag is one held by all the files in a given
+change entry.
+
+If you need output that's easy for a program to parse, use the B<--xml> option.
+Note that with XML output, just about all available information is included
+with each change entry, whether you asked for it or not, on the theory that
+your parser can ignore anything it's not looking for.
+
+If filenames are given as arguments cvs2cl only shows log information for the
+named files.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-h>, B<-help>, B<--help>, B<-?>
+
+Show a short help and exit.
+
+=item B<--version>
+
+Show version and exit.
+
+=item B<-r>, B<--revisions>
+
+Show revision numbers in output.
+
+=item B<-b>, B<--branches>
+
+Show branch names in revisions when possible.
+
+=item B<-t>, B<--tags>
+
+Show tags (symbolic names) in output.
+
+=item B<-T>, B<--tagdates>
+
+Show tags in output on their first occurance.
+
+=item B<--show-dead>
+
+Show dead files.
+
+=item B<--stdin>
+
+Read from stdin, don't run cvs log.
+
+=item B<--stdout>
+
+Output to stdout not to ChangeLog.
+
+=item B<-d>, B<--distributed>
+
+Put ChangeLogs in subdirs.
+
+=item B<-f> I<FILE>, B<--file> I<FILE>
+
+Write to I<FILE> instead of ChangeLog.
+
+=item B<--fsf>
+
+Use this if log data is in FSF ChangeLog style.
+
+=item B<--FSF>
+
+Attempt strict FSF-standard compatible output (incompatible with B<--accum>).
+
+=item B<-W> I<SECS>, B<--window> I<SECS>
+
+Window of time within which log entries unify.
+
+=item -B<U> I<UFILE>, B<--usermap> I<UFILE>
+
+Expand usernames to email addresses from I<UFILE>.
+
+=item B<--passwd> I<PASSWORDFILE>
+
+Use system passwd file for user name expansion.  If no mail domain is provided
+(via B<--domain>), it tries to read one from B</etc/mailname>, output of B<hostname
+-d>, B<dnsdomainname>, or B<domain-name>.  cvs2cl exits with an error if none of
+those options is successful. Use a domain of '' to prevent the addition of a
+mail domain.
+
+=item B<--domain> I<DOMAIN>
+
+Domain to build email addresses from.
+
+=item B<--gecos>
+
+Get user information from GECOS data.
+
+=item B<-R> I<REGEXP>, B<--regexp> I<REGEXP>
+
+Include only entries that match I<REGEXP>.  This option may be used multiple
+times.
+
+=item B<-I> I<REGEXP>, B<--ignore> I<REGEXP>
+
+Ignore files whose names match I<REGEXP>.  This option may be used multiple
+times.  The regexp is a perl regular expression.  It is matched as is; you may
+want to prefix with a ^ or suffix with a $ to anchor the match.
+
+=item B<-C>, B<--case-insensitive>
+
+Any regexp matching is done case-insensitively.
+
+=item B<-F> I<BRANCH>, B<--follow> I<BRANCH>
+
+Show only revisions on or ancestral to I<BRANCH>.
+
+=item B<--follow-only> I<BRANCH>
+
+Like --follow, but sub-branches are not followed.
+
+=item B<--no-ancestors>
+
+When using B<-F>, only track changes since the I<BRANCH> started.
+
+=item B<--no-hide-branch-additions>
+
+By default, entries generated by cvs for a file added on a branch (a dead 1.1
+entry) are not shown.  This flag reverses that action.
+
+=item B<-S>, B<--separate-header>
+
+Blank line between each header and log message.
+
+=item B<--group-within-date>
+
+Group ChangeLog entries on the same date together, instead of having a
+separate entry for each commit on that date.
+
+=item B<--summary>
+
+Add CVS change summary information.
+
+=item B<--no-wrap>
+
+Don't auto-wrap log message (recommend B<-S> also).
+
+=item B<--no-indent>
+
+Don't indent log message
+
+=item B<--gmt>, B<--utc>
+
+Show times in GMT/UTC instead of local time.
+
+=item B<--accum>
+
+Add to an existing ChangeLog (incompatible with B<--xml> and B<--FSF>).
+
+=item B<-w>, B<--day-of-week>
+
+Show day of week.
+
+=item B<--no-times>
+
+Don't show times in output.
+
+=item B<--chrono>
+
+Output log in chronological order (default is reverse chronological order).
+
+=item B<--header> I<FILE>
+
+Get ChangeLog header from I<FILE> ("B<->" means stdin).
+
+=item B<--xml>
+
+Output XML instead of ChangeLog format (incompatible with B<--accum>).
+
+=item B<--xml-encoding> I<ENCODING.>
+
+Insert encoding clause in XML header.
+
+=item B<--noxmlns>
+
+Don't include xmlns= attribute in root element.
+
+=item B<--hide-filenames>
+
+Don't show filenames (ignored for XML output).
+
+=item B<--no-common-dir>
+
+Don't shorten directory names from filenames.
+
+=item B<--rcs> I<CVSROOT>
+
+Handle filenames from raw RCS, for instance those produced by "cvs rlog"
+output, stripping the prefix I<CVSROOT>.
+
+=item B<-P>, B<--prune>
+
+Don't show empty log messages.
+
+=item B<--lines-modified>
+
+Output the number of lines added and the number of lines removed for
+each checkin (if applicable). At the moment, this only affects the
+XML output mode.
+
+=item B<--ignore-tag> I<TAG>
+
+Ignore individual changes that are associated with a given tag.
+May be repeated, if so, changes that are associated with any of
+the given tags are ignored.
+
+=item B<--show-tag> I<TAG>
+
+Log only individual changes that are associated with a given
+tag.  May be repeated, if so, changes that are associated with
+any of the given tags are logged.
+
+=item B<--delta> I<FROM_TAG>B<:>I<TO_TAG>
+
+Attempt a delta between two tags (since I<FROM_TAG> up to and
+including I<TO_TAG>).  The algorithm is a simple date-based one
+(this is a hard problem) so results are imperfect.
+
+=item B<-g> I<OPTS>, B<--global-opts> I<OPTS>
+
+Pass I<OPTS> to cvs like in "cvs I<OPTS> log ...".
+
+=item B<-l> I<OPTS>, B<--log-opts> I<OPTS>
+
+Pass I<OPTS> to cvs log like in "cvs ... log I<OPTS>".
+
+=back
+
+Notes about the options and arguments:
+
+=over 4
+
+=item *
+
+The B<-I> and B<-F> options may appear multiple times.
+
+=item *
+
+To follow trunk revisions, use "B<-F trunk>" ("B<-F TRUNK>" also works).  This is
+okay because no would ever, ever be crazy enough to name a branch "trunk",
+right?  Right.
+
+=item *
+
+For the B<-U> option, the I<UFILE> should be formatted like CVSROOT/users. That is,
+each line of I<UFILE> looks like this:
+
+       jrandom:jrandom@red-bean.com
+
+or maybe even like this
+
+       jrandom:'Jesse Q. Random <jrandom@red-bean.com>'
+
+Don't forget to quote the portion after the colon if necessary.
+
+=item *
+
+Many people want to filter by date.  To do so, invoke cvs2cl.pl like this:
+
+       cvs2cl.pl -l "-d'DATESPEC'"
+
+where DATESPEC is any date specification valid for "cvs log -d".  (Note that
+CVS 1.10.7 and below requires there be no space between -d and its argument).
+
+=item *
+
+Dates/times are interpreted in the local time zone.
+
+=item *
+
+Remember to quote the argument to `B<-l>' so that your shell doesn't interpret
+spaces as argument separators.
+
+=item *
+
+See the 'Common Options' section of the cvs manual ('info cvs' on UNIX-like
+systems) for more information.
+
+=item *
+
+Note that the rules for quoting under windows shells are different.
+
+=item *
+
+To run in an automated environment such as CGI or PHP, suidperl may be needed
+in order to execute as the correct user to enable /cvsroot read lock files to
+be written for the 'cvs log' command.  This is likely just a case of changing
+the /usr/bin/perl command to /usr/bin/suidperl, and explicitly declaring the
+PATH variable.
+
+=back
+
+=head1 EXAMPLES
+
+Some examples (working on UNIX shells):
+
+      # logs after 6th March, 2003 (inclusive)
+      cvs2cl.pl -l "-d'>2003-03-06'"
+      # logs after 4:34PM 6th March, 2003 (inclusive)
+      cvs2cl.pl -l "-d'>2003-03-06 16:34'"
+      # logs between 4:46PM 6th March, 2003 (exclusive) and
+      # 4:34PM 6th March, 2003 (inclusive)
+      cvs2cl.pl -l "-d'2003-03-06 16:46>2003-03-06 16:34'"
+
+Some examples (on non-UNIX shells):
+
+      # Reported to work on windows xp/2000
+      cvs2cl.pl -l  "-d"">2003-10-18;today<"""
+
+=head1 AUTHORS
+
+=over 4
+
+=item Karl Fogel
+
+=item Melissa O'Neill
+
+=item Martyn J. Pearce
+
+=back
+
+Contributions from
+
+=over 4
+
+=item Mike Ayers
+
+=item Tim Bradshaw
+
+=item Richard Broberg
+
+=item Nathan Bryant
+
+=item Oswald Buddenhagen
+
+=item Neil Conway
+
+=item Arthur de Jong
+
+=item Mark W. Eichin
+
+=item Dave Elcock
+
+=item Reid Ellis
+
+=item Simon Josefsson
+
+=item Robin Hugh Johnson
+
+=item Terry Kane
+
+=item Pete Kempf
+
+=item Akos Kiss
+
+=item Claus Klein
+
+=item Eddie Kohler
+
+=item Richard Laager
+
+=item Kevin Lilly
+
+=item Karl-Heinz Marbaise
+
+=item Mitsuaki Masuhara
+
+=item Henrik Nordstrom
+
+=item Joe Orton
+
+=item Peter Palfrader
+
+=item Thomas Parmelan
+
+=item Jordan Russell
+
+=item Jacek Sliwerski
+
+=item Johannes Stezenbach
+
+=item Joseph Walton
+
+=item Ernie Zapata
+
+=back
+
+=head1 BUGS
+
+Please report bugs to C<cvs2cl-reports {_AT_} red-bean.com>.
+
+=head1 PREREQUISITES
+
+This script requires C<Text::Wrap>, C<Time::Local>, and C<File::Basename>.  It
+also seems to require C<Perl 5.004_04> or higher.
+
+=head1 OPERATING SYSTEM COMPATIBILITY
+
+Should work on any OS.
+
+=head1 SCRIPT CATEGORIES
+
+Version_Control/CVS
+
+=head1 COPYRIGHT
+
+(C) 2001,2002,2003,2004 Martyn J. Pearce, under the GNU GPL.
+
+(C) 1999 Karl Fogel, under the GNU GPL.
+
+cvs2cl.pl 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, or (at your option)
+any later version.
+
+cvs2cl.pl 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 may have received a copy of the GNU General Public License
+along with cvs2cl.pl; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+=head1 SEE ALSO
+
+cvs(1)
+
Index: sm/trunk/scripts/devpath.py
===================================================================
--- /issm/trunk/scripts/devpath.py	(revision 28275)
+++ 	(revision )
@@ -1,22 +1,0 @@
-#!/usr/bin/env python
-
-# NOTE: This script is a stripped-down version of
-#       $ISSM_DIR/src/m/dev/devpath.py and is intended only for loading ISSM in 
-#       order to test our distributable packages. It assumes the following is 
-#       set before $ISSM_DIR/test/NightlyRun/runme.py is called, 
-#
-#           export ISSM_DIR=</path/to/ISSM>
-#           export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
-#           export PYTHONPATH="${ISSM_DIR}/scripts"
-#           export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
-#           export PYTHONUNBUFFERED=1
-#
-
-import os
-import sys
-
-ISSM_DIR = os.getenv('ISSM_DIR')
-sys.path.append(ISSM_DIR + '/bin')
-sys.path.append(ISSM_DIR + '/lib')
-
-from issmversion import issmversion
Index: /issm/trunk/scripts/eraselinks.sh
===================================================================
--- /issm/trunk/scripts/eraselinks.sh	(revision 1)
+++ /issm/trunk/scripts/eraselinks.sh	(revision 1)
@@ -0,0 +1,15 @@
+#!/bin/bash
+#creates soft links to startup in every test subdirectories
+
+#go to ISSM main directory
+cd $ISSM_DIR
+
+#get path of runmes.m
+FILES=`find ./ -name "runme.m" | sed s/runme.m//g | sed -e "s/\.\//\//g"`;
+
+#loop over the directories
+for i in $FILES; do
+	cd $ISSM_DIR$i
+	rm startup.m
+	cd $ISSM_DIR
+done
Index: sm/trunk/scripts/getloc.sh
===================================================================
--- /issm/trunk/scripts/getloc.sh	(revision 28275)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#!/bin/bash
-#get number of lines of code
-cloc $ISSM_DIR/src $ISSM_DIR/m4 --exclude-dir=.svn --exclude-dir=ad  --exclude-ext=exp --exclude-lang=make --out=temp --force-lang="MATLAB",m
-cat temp
-./cloc2html.py
-rm temp
-
-cat $ISSM_DIR/src/dox/issm.dox | sed '/<table/,//d' > input1
-cat $ISSM_DIR/src/dox/issm.dox | sed '1,/<\/table>/d' > input2
-cat input1 temp.html input2 > $ISSM_DIR/src/dox/issm.dox
-#rm input1 input2 temp.html
Index: sm/trunk/scripts/historyISSM.m
===================================================================
--- /issm/trunk/scripts/historyISSM.m	(revision 28275)
+++ 	(revision )
@@ -1,7 +1,0 @@
-!vim runme.m
-runme('id',[101]);
-md.mesh.numberofelements
-md=solve(md,TransientSolutionEnum);
-md=solve(md,StressbalanceSolutionEnum);
-plotmodel(md,'data',md.results.StressbalanceSolution.Vel)
-plotmodel(md,'data',)
Index: sm/trunk/scripts/intel-compile.sh
===================================================================
--- /issm/trunk/scripts/intel-compile.sh	(revision 28275)
+++ 	(revision )
@@ -1,21 +1,0 @@
-#!/bin/bash
-#Why don't we just type make? (shouldn't automake have taken care of this?)
-#The problem is the /Fe option from the intel compiler, which we weren't able to 
-#get automake to recognize. End result is that every file compiled is not named libISSM_a-name, 
-#but just name.  This makes the creation of libISSM.a impossible, as none of its objects 
-#can be found with the correct name. 
-#As a fix, we rename the objects, and then link.
-
-#First compile.
-#make
-
-#Then change the names
-list=`ls *.obj | grep -v libISSM_a`
-for i in `echo $list`
-do
-	mv $i libISSM_a-$i
-done
-
-#Now create the library out the .obj files
-rm -rf libISSM.a
-lib.exe /out:libISSM.a *.obj
Index: sm/trunk/scripts/issmconfiguration.sh
===================================================================
--- /issm/trunk/scripts/issmconfiguration.sh	(revision 28275)
+++ 	(revision )
@@ -1,80 +1,0 @@
-#/bin/bash
-#This script picks up whatever configuration files exists in trunk/configs, 
-#and offers the user the choice to reconfigure the ISSM compilation using
-#a given configuration file: 
-
-#keep track of present directory: 
-presendir=`pwd`
-
-if test -d "$ISSM_DIR/configs" ; then
-	cd $ISSM_DIR/configs
-	LIST=`ls`
-	
-	if test -d "$JPL_SVN/usr/$USER/configs"; then
-		cd $JPL_SVN/usr/$USER/configs 
-		LIST2=`ls`
-	fi
-	
-	#print choices
-	COUNT=0;
-	printf 'ISSM wide configurations\n'
-	for STEP in $LIST
-	do
-		let COUNT=$COUNT+1
-		printf '%3i: %s\n' $COUNT $STEP
-	done
-	printf 'Personal configuration\n'
-	for STEP in $LIST2
-	do
-		let COUNT=$COUNT+1
-		printf '%3i: %s\n' $COUNT $STEP
-	done
-
-	echo -n "Configuration choice: "
-	read choice 
-
-	#Now go backto the list and retrieve the name of the configuration file: 
-	COUNT=0;
-	for STEP in $LIST
-	do
-		let COUNT=$COUNT+1
-		if [[ $COUNT == $choice ]]; then
-			configurename=$STEP
-		fi
-	done
-	for STEP in $LIST2
-	do
-		let COUNT=$COUNT+1
-		if [[ $COUNT == $choice ]]; then
-			configurename=$STEP
-		fi
-	done
-
-	#Now go ahead and configure: 
-	echo ""
-	echo "Configuring ISSM with following configs: $configurename"
-	echo ""
-
-	cd $ISSM_DIR 
-
-	#at this point, was a cleanup of the archive requested? 
-	if [ "$1" == "clean" ]; 
-	then 
-		make uninstall && make distclean
-	fi
-
-	source ./scripts/automakererun.sh 
-	if [ -f configs/$configurename ]; then 
-		source configs/$configurename
-	else 
-		source $JPL_SVN/usr/$USER/configs/$configurename
-	fi
-	
-	#we are done, go back to original directory: 
-	cd $presendir
-else
-	echo "Configuration directory does not exist!"
-	exit
-fi
-
-#alias aut='a=`pwd` && cd $ISSM_DIR && ./scripts/automakererun.sh && ./configs/config-macosx64-larour-nopetsc.sh'
Index: sm/trunk/scripts/jpic2pdf
===================================================================
--- /issm/trunk/scripts/jpic2pdf	(revision 28275)
+++ 	(revision )
@@ -1,80 +1,0 @@
-#!/bin/bash
-#Transform a pst from JPicEdt to a nice pdf
-
-# Generate temporary directory ($$ = process ID)
-TMPDIR=/tmp/jpic2pdf$$
-if [ -e $TMPDIR ] ; then
-	echo "$0: Temporary directory $TMPDIR already exists." 1>&2
-	exit 1
-fi
-mkdir $TMPDIR
-HOMEDIR="`pwd`" || exit 1
-
-#get input files
-if [ $# -eq 0 ]
-then
-	echo "No input file specified, exiting..." >&2
-	exit 1
-else
-	FILES=$*
-fi
-
-#convert files
-for FILE in $FILES
-do
-	#get file name without pst extension
-	NAME=$(echo $FILE | sed -e "s/.pst//g")
-
-	#transform equation only if begin{eqution} is found
-	echo "converting $FILE"
-	#Header
-	(
-	cat << ENDHEADER
-\documentclass[11pt,a0paper,landscape]{article}
-\usepackage{color}
-\usepackage[dvips]{graphicx}
-\usepackage[left=0cm, right=0cm, top=0cm, bottom=0cm]{geometry}  % margins
-\usepackage{array, multirow}
-\usepackage{amsmath,amsfonts,amssymb,mathrsfs,bm}
-\usepackage{pstricks}
-\pagestyle{empty}
-%\pagecolor{white}
-\definecolor{darkblue}{RGB}{0,0,170}
-\definecolor{darkgreen}{RGB}{0,140,0}
-\begin{document}
-ENDHEADER
-	) > $TMPDIR/out.tex
-
-	#File
-	cat $FILE >> $TMPDIR/out.tex
-
-	#Footer
-	(
-	cat << ENDFOOTER
-\end{document}
-ENDFOOTER
-) >> $TMPDIR/out.tex
-
-	cd "$TMPDIR"
-	latex -interaction=batchmode out.tex > /dev/null
-	ls
-
-	#check that the dvi has been generated
-	if [ ! -f "./out.dvi" ]; then
-		latex  -halt-on-error -interaction=errorstopmode out.tex
-		echo "latex compilation failed, See above" 1>&2
-		exit 1
-	fi
-	cd "$HOMEDIR"
-	dvips -o $TMPDIR/out.eps -E $TMPDIR/out.dvi 2> /dev/null
-	dvipdf $TMPDIR/out.dvi $TMPDIR/out.pdf
-	mv $TMPDIR/out.pdf $NAME.pdf
-
-	echo "cropping $FILE"
-	pdfcrop -noverbose $NAME.pdf $NAME.pdf
-done
-
-# Cleanup
-rm -rf $TMPDIR
-#mv $TMPDIR .
-exit 0
Index: sm/trunk/scripts/mToPy.py
===================================================================
--- /issm/trunk/scripts/mToPy.py	(revision 28275)
+++ 	(revision )
@@ -1,56 +1,0 @@
-#!/usr/bin/env python
-import sys
-import os
-import shutil
-import translateToPy
-import mToPy  # touch mToPy to assertain location of installation
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#
-program = 'mToPy.py'
-version = '1.0'
-versionReleaseDate = '09/24/12'
-origAuthor = 'Mike Pellegrin'
-desc = '\nMain control unit for converting an matlab script file to python'
-#
-#   Note: Output will be put in the same (absolute) location as the input.
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#                History
-#    Date        Developer           Modification
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#    09 / 24 / 12    Michael Pellegrin    Initial Release         V1.0
-#
-#
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
-def convert(inputFile):
-    try:
-        if os.path.exists(inputFile + '.m') and os.path.isfile(inputFile + '.m'):
-            checkBackupOutputFile(inputFile)
-            convertMToPy(inputFile)
-        else:
-            print('Specified input file: ' + inputFile + '.m doesn\'t appear to exist')
-    finally:
-        print('')
-
-
-def convertMToPy(inputFileName):
-    translateToPy.convertToPython(inputFileName + '.m', inputFileName + '.py')
-
-
-def checkBackupOutputFile(inputFile):
-    mFile = inputFile + '.m'
-    pyFile = inputFile + '.py'
-    if os.path.exists(pyFile):
-        i = 1
-        bkupName = pyFile + str(i)
-        while os.path.exists(bkupName):
-            i += 1
-            bkupName = pyFile + str(i)
-        os.rename(pyFile, bkupName)
-
-    shutil.copyfile(mFile, pyFile)
-
-
-if __name__ == "__main__":
-    convert(sys.argv[1])
Index: sm/trunk/scripts/mail
===================================================================
--- /issm/trunk/scripts/mail	(revision 28275)
+++ 	(revision )
@@ -1,158 +1,0 @@
-#!/bin/sh
-
-# This is a shell script to emulate the standard mail(1) aka mailx(1)
-# aka Mail(1) tool usage for sending emails. This shell script is not
-# a client for checking or reading mail. Also, this version of mail
-# does not touch any mail boxes.
-
-# Copyright (c) 2003 by Jeremy C. Reed
-# This software is provided "as is" without any warranties. You may
-# redistribute and use this source, with or without modification,
-# as long as you include this copyright and disclaimer.
-
-# To do: some switches to consider:
-# -v  display details of delivery
-# -E  do not send empty messages
-# -c  send carbon copies to users
-# -b  send blind carbon copies
-
-# todo: test if read can read in long enough lines
-# some shells may have limit of 256 characters per read?
- 
-SENDMAIL=sendmail  # set to path of your sendmail(8) command
-SENDMAIL_ARGS="-t -i" # -i is so dot doesn't terminate message
-                      # -t is to get recipients from headers
-
-unset subject
-unset to_addr
-dontsendempty=0
-
-about ()
-{
-  echo "This is mailx.sh version 0.03. This is simple, shell script"
-  echo "to implement mailx(1) functionality for sending mail. It does"
-  echo "not provide an interface for checking or reading email messages."
-  echo
-
-  # maybe do this without forking a command
-  mailname=$( basename $0 )
-
-  if [ -n "$1" ] ; then
-    echo "$mailname: $1" 1>&2
-  fi
-
-  echo "Usage: $mailname [-s subject] to-addr ..." 1>&2
-
-  if [ -n "$1" ] ; then
-    if [ -n "$2" ] ; then 
-      exit $2
-    fi
-    exit 100
-  fi
-
-  exit 0
-}
-
-if [ $# -eq 0 ] ; then
-  about "Sorry, this is not a mail reader." 1
-fi
-
-while [ -n "$1" ] ; do
-  case "$1" in
-  -*)
-      if [ "$1" = "-s" ] ; then
-        if [ -z "$2" ] ; then
-          about "The \"-s\" option requires an argument." 4
-        fi
-        subject="$2"
-        shift
-      elif [ "$1" = "-u" -o "$1" = "-f" ] ; then
-        about "Sorry, this is not a mail reader." 2
-#      elif [ "$1" = "-E" ] ; then
-# this probably needs to have entire message saved to temp file first
-#        dontsendempty=1
-      else
-#        about "unknown option -- $1" 3
-        about "Switch \"$1\" is not implemented." 3
-      fi
-      ;;
-  *)  if [ -n "$to_addr" ] ; then
-        to_addr="${to_addr}, $1"
-      else
-        to_addr="$1"
-      fi
-      ;;
-  esac
-  shift
-done
-
-
-if [ -t 0 ] ; then   # no piped in standard input
-  if [ -z "$subject" ] ; then
-    echo -n "Subject: "
-    OLD_IFS=$IFS
-    IFS=""
-    read -r subject
-    IFS=$OLD_IFS
-  fi
-fi
-
-if [ -z "$to_addr" ] ; then
-  about "No recipients specified." 6
-#  about "You must specify recipients." 6
-fi
-
-# generate SMTP headers
-
-# mail(1) doesn't seem to set date
-#date +"Date: %a, %e %b %G %T %z"
-## maybe pipe though sed to get rid of extra space
-## before single digit day of month?
-
-{
-# if [ -n "$to_addr" ] ; then
-echo "To: ${to_addr}"
-# fi
-
-if [ -n "$subject" ] ; then
-  echo "Subject: $subject"
-fi
-
-# end of headers
-echo ""
-
-# output
-line_count=0
-OLD_IFS=$IFS
-IFS=""
-while read -r line ; do
-  # finish if manual, non-piped input is a period on a line by itself
-  if [ "$line" = "." -a -t 0 ] ; then
-      break
-  fi
-  echo "$line"
-  line_count=$(( line_count + 1 ))
-done
-
-IFS=$OLD_IFS
-
-if [ -t 0 ] ; then   # no piped in standard input
-  echo "EOT" 1>&2
-fi
-
-# later add switch to not send mail by exiting
-if [ "$line_count" -eq 0 ] ; then
-#  if [ "$dontsendempty" -eq 1 ] ; then
-# todo this, have it save to temp file and then send to sendmail as needed
-#    # No message, so just exit cleanly
-#    exit 0
-#  fi
-  if [ -z "$subject" ] ; then
-    echo "No message, no subject; hope that's ok" 1>&2
-  else
-    echo "Null message body; hope that's ok" 1>&2
-  fi
-fi
-
-} | $SENDMAIL $SENDMAIL_ARGS
-
Index: sm/trunk/scripts/matlabissm.bat
===================================================================
--- /issm/trunk/scripts/matlabissm.bat	(revision 28275)
+++ 	(revision )
@@ -1,2 +1,0 @@
-@echo off
-matlab 
Index: sm/trunk/scripts/ol
===================================================================
--- /issm/trunk/scripts/ol	(revision 28275)
+++ 	(revision )
@@ -1,13 +1,0 @@
-#!/bin/bash
-
-#Get the runme file, read it, and display steps
-rm -rf orglist_temporary_file
-LIST=$(cat runme.m | grep perform | grep if | sed "s/'/ /g" | awk '{print $3}')
-
-COUNT=0;
-echo "Available steps"
-for STEP in $LIST
-do
-	let COUNT=$COUNT+1
-	printf '%3i: %s\n' $COUNT $STEP
-done
Index: sm/trunk/scripts/ol.m
===================================================================
--- /issm/trunk/scripts/ol.m	(revision 28275)
+++ 	(revision )
@@ -1,42 +1,0 @@
-function ol(varargin)
-
-	options=pairoptions(varargin{:});
-
-	%recover steps in calling workspace:  will be used to highlight current step.
-	steps= evalin('base', 'steps');
-	
-	mmin=getfieldvalue(options,'>',1);
-	mmax=getfieldvalue(options,'<',Inf);
-
-	file=getfieldvalue(options,'file','runme.m');
-
-	%Open runme.m file and read line by line
-	fid=fopen(file,'r');
-
-	tline = fgets(fid);
-	count=1;
-	while ischar(tline)
-		tline = fgets(fid);
-		if strncmpi(tline,'if perform(org,',14),
-			lastchar = strfind(tline,')');
-			lastchar = lastchar(end)-1;
-			string=tline(17:lastchar-1);
-			if strcmpi(string,'End'),
-				return;
-			end
-			if ismember(count,steps),
-				disp(sprintf('%2i: *%s',count,tline(17:lastchar-1)));
-			else
-				if count>=mmin & count <= mmax,
-					disp(sprintf('%2i:  %s',count,tline(17:lastchar-1)));
-				else
-					%do nothing. 
-				end
-			end
-			if count>mmax,
-				break;
-			end
-			count=count+1;
-		end
-	end
-	fclose(fid);
Index: sm/trunk/scripts/ola.m
===================================================================
--- /issm/trunk/scripts/ola.m	(revision 28275)
+++ 	(revision )
@@ -1,40 +1,0 @@
-function ola(varargin)
-
-	options=pairoptions(varargin{:});
-
-	%recover steps in calling workspace:  will be used to highlight current step.
-	steps= evalin('base', 'steps');
-	
-	r=getfieldvalue(options,'r',10);
-	range=(min(steps)-r):(max(steps)+r);
-
-	file=getfieldvalue(options,'file','runme.m');
-
-	%Open runme.m file and read line by line
-	fid=fopen(file,'r');
-
-	tline = fgets(fid);
-	count=1;
-	while ischar(tline)
-		tline = fgets(fid);
-		if strncmpi(tline,'if perform(org,',14),
-			lastchar = strfind(tline,')');
-			lastchar = lastchar(end)-1;
-			string=tline(17:lastchar-1);
-			if strcmpi(string,'End'),
-				return;
-			end
-			if ismember(count,range),
-				if ismember(count,steps),
-					disp(sprintf('%2i: *%s',count,tline(17:lastchar-1)));
-				else
-					disp(sprintf('%2i:  %s',count,tline(17:lastchar-1)));
-				end
-			end
-			if count>range(end),
-				break;
-			end
-			count=count+1;
-		end
-	end
-	fclose(fid);
Index: sm/trunk/scripts/ols.m
===================================================================
--- /issm/trunk/scripts/ols.m	(revision 28275)
+++ 	(revision )
@@ -1,44 +1,0 @@
-function ols(varargin)
-
-	options=pairoptions(varargin{:});
-
-	range=getfieldvalue(options,'<',Inf);
-	file=getfieldvalue(options,'file','runme.m');
-
-	%Open runme.m file and read line by line
-	fid=fopen(file,'r');
-
-	tline = fgets(fid);
-	count=1;
-	strings={};
-	while ischar(tline)
-		tline = fgets(fid);
-		if strncmpi(tline,'if perform(org,',14),
-			lastchar = strfind(tline,')');
-			lastchar = lastchar(end)-1;
-			string=tline(17:lastchar-1);
-			if strcmpi(string,'End'),
-				break;
-			end
-			strings{end+1}= sprintf('%2i: %s',count,tline(16:lastchar));
-			if count>range,
-				break;
-			end
-			count=count+1;
-		end
-	end
-	fclose(fid);
-
-
-	%ok, we have our strings, split in two: 
-	nstring=length(strings);
-	split=floor(nstring/2)
-
-	for i=1:split,
-		disp(sprintf('%s     %s',pad(strings{i},60),strings{split+i}));
-	end
-	if nstring==(2*split),
-		return;
-	else
-		disp(sprintf('%s     %s',pad('',60),strings{end}));
-	end
Index: sm/trunk/scripts/pdfcrop.pl
===================================================================
--- /issm/trunk/scripts/pdfcrop.pl	(revision 28275)
+++ 	(revision )
@@ -1,608 +1,0 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
-  if 0;
-use strict;
-$^W=1; # turn warning on
-#
-# pdfcrop.pl
-#
-# Copyright (C) 2002, 2004, 2005, 2008, 2009 Heiko Oberdiek.
-#
-# This program may be distributed and/or modified under the
-# conditions of the LaTeX Project Public License, either version 1.2
-# of this license or (at your option) any later version.
-# The latest version of this license is in
-#   http://www.latex-project.org/lppl.txt
-# and version 1.2 or later is part of all distributions of LaTeX
-# version 1999/12/01 or later.
-#
-# See file "README" for a list of files that belong to this project.
-#
-# This file "pdfcrop.pl" may be renamed to "pdfcrop"
-# for installation purposes.
-#
-my $file        = "pdfcrop.pl";
-my $program     = uc($&) if $file =~ /^\w+/;
-my $version     = "1.18";
-my $date        = "2009/07/18";
-my $author      = "Heiko Oberdiek";
-my $copyright   = "Copyright (c) 2002-2009 by $author.";
-#
-# Reqirements: Perl5, Ghostscript
-# History:
-#   2002/10/30 v1.0:  First release.
-#   2002/10/30 v1.1:  Option --hires added.
-#   2002/11/04 v1.2:  "nul" instead of "/dev/null" for windows.
-#   2002/11/23 v1.3:  Use of File::Spec module's "devnull" call.
-#   2002/11/29 v1.4:  Option --papersize added.
-#   2004/06/24 v1.5:  Clear map file entries so that pdfTeX
-#                     does not touch the fonts.
-#   2004/06/26 v1.6:  Use mgs.exe instead of gswin32c.exe for MIKTEX.
-#   2005/03/11 v1.7:  Support of spaces in file names
-#                     (open("-|") is used for ghostscript call).
-#   2008/01/09 v1.8:  Fix for moving the temporary file to the output
-#                     file across file system boundaries.
-#   2008/04/05 v1.9:  Options --resolution and --bbox added.
-#   2008/07/16 v1.10: Support for XeTeX added with new options
-#                     --pdftex, --xetex, and --xetexcmd.
-#   2008/07/22 v1.11: Workaround for open("-|").
-#   2008/07/23 v1.12: Workarounds for the workaround (error detection, ...).
-#   2008/07/24 v1.13: open("-|")/workaround removed.
-#                     Input files with unsafe file names are linked/copied
-#                     to temporary file with safe file name.
-#   2008/09/12 v1.14: Error detection for invalid Bounding Boxes.
-#   2009/07/14 v1.15: Fix for negative coordinates in Bounding Boxes
-#                     (David Menestrina).
-#   2009/07/16 v1.16: Security fixes:
-#                     * -dSAFER added for Ghostscript,
-#                     * -no-shell-escape added for pdfTeX/XeTeX.
-#   2009/07/17 v1.17: Security fixes:
-#                     * Backticks and whitespace are forbidden
-#                       for options --(gs|pdftex|xetex)cmd.
-#                     * Validation of options --papersize and --resolution.
-#   2009/07/18 v1.18: * Restricted mode added.
-#                     * Option --version added.
-
-### program identification
-my $title = "$program $version, $date - $copyright\n";
-
-### error strings
-my $Error = "!!! Error:"; # error prefix
-
-### string constants for Ghostscript run
-# get Ghostscript command name
-my $GS = "gs";
-$GS = "gs386"    if $^O =~ /dos/i;
-$GS = "gsos2"    if $^O =~ /os2/i;
-$GS = "gswin32c" if $^O =~ /mswin32/i;
-$GS = "gswin32c" if $^O =~ /cygwin/i;
-$GS = "mgs"      if defined($ENV{"TEXSYSTEM"}) and
-                    $ENV{"TEXSYSTEM"} =~ /miktex/i;
-
-# Windows detection (no SIGHUP)
-my $Win = 0;
-$Win = 1 if $^O =~ /mswin32/i;
-$Win = 1 if $^O =~ /cygwin/i;
-
-# restricted mode
-my $restricted = 0;
-if ($0 =~ /rpdfcrop/ or $0 =~ /restricted/) {
-    $restricted = 1;
-}
-
-# "null" device
-use File::Spec::Functions qw(devnull);
-my $null = devnull();
-
-### variables
-my $inputfile   = "";
-my $outputfile  = "";
-my $tmp = "tmp-\L$program\E-$$";
-
-### paper sizes
-
-my @papersizes = qw[
-  11x17 ledger legal letter lettersmall
-  archE archD archC archB archA
-  a0 a1 a2 a3 a4 a4small a5 a6 a7 a8 a9 a10
-  isob0 isob1 isob2 isob3 isob4 isob5 isob6
-  c0 c1 c2 c3 c4 c5 c6
-  jisb0 jisb1 jisb2 jisb3 jisb4 jisb5 jisb6
-  b0 b1 b2 b3 b4 b5
-  flsa flse halfletter
-];
-my %papersizes;
-foreach (@papersizes) {
-    $papersizes{$_} = 1;
-}
-
-### option variables
-my @bool = ("false", "true");
-$::opt_version    = 0;
-$::opt_help       = 0;
-$::opt_debug      = 0;
-$::opt_verbose    = 0;
-$::opt_gscmd      = $GS;
-$::opt_pdftexcmd  = "pdftex";
-$::opt_xetexcmd   = "xetex";
-$::opt_tex        = "pdftex";
-$::opt_margins    = "0 0 0 0";
-$::opt_clip       = 0;
-$::opt_hires      = 0;
-$::opt_papersize  = "";
-$::opt_resolution = "";
-$::opt_bbox       = "";
-
-my $usage = <<"END_OF_USAGE";
-${title}Syntax:   \L$program\E [options] <input[.pdf]> [output file]
-Function: Margins are calculated and removed for each page in the file.
-Options:                                                    (defaults:)
-  --help              print usage
-  --version           print version number
-  --(no)verbose       verbose printing                      ($bool[$::opt_verbose])
-  --(no)debug         debug informations                    ($bool[$::opt_debug])
-  --gscmd <name>      call of ghostscript                   ($::opt_gscmd)
-  --pdftex | --xetex  use pdfTeX | use XeTeX                ($::opt_tex)
-  --pdftexcmd <name>  call of pdfTeX                        ($::opt_pdftexcmd)
-  --xetexcmd <name>   call of XeTeX                         ($::opt_xetexcmd)
-  --margins "<left> <top> <right> <bottom>"                 ($::opt_margins)
-                      add extra margins, unit is bp. If only one number is
-                      given, then it is used for all margins, in the case
-                      of two numbers they are also used for right and bottom.
-  --(no)clip          clipping support, if margins are set  ($bool[$::opt_clip])
-                      (not available for --xetex)
-  --(no)hires         using `%%HiResBoundingBox'            ($bool[$::opt_hires])
-                      instead of `%%BoundingBox'
-Expert options:
-  --restricted        turn on restricted mode               ($bool[$restricted])
-  --papersize <foo>   parameter for gs's -sPAPERSIZE=<foo>,
-                      use only with older gs versions <7.32 ($::opt_papersize)
-  --resolution <xres>x<yres>                                ()
-  --resolution <res>  pass argument to ghostscript's option -r
-                      Example: --resolution 72
-  --bbox "<left> <top> <right> <bottom>"                    ()
-                      override bounding box found by ghostscript
-Examples:
-  \L$program\E --margins 10 input.pdf output.pdf
-  \L$program\E --margins '5 10 5 20' --clip input.pdf output.pdf
-In case of errors:
-  Try option --verbose first to get more information.
-In case of bugs:
-  Please, use option --debug for bug reports.
-END_OF_USAGE
-
-### process options
-my @OrgArgv = @ARGV;
-use Getopt::Long;
-GetOptions(
-  "help!",
-  "version!",
-  "debug!",
-  "verbose!",
-  "gscmd=s",
-  "pdftexcmd=s",
-  "xetexcmd=s",
-  "pdftex" => sub { $::opt_tex = 'pdftex'; },
-  "xetex"  => sub { $::opt_tex = 'xetex'; },
-  "margins=s",
-  "clip!",
-  "hires!",
-  "papersize=s",
-  "resolution=s",
-  "bbox=s",
-  "restricted" => sub { $restricted = 1; },
-) or die $usage;
-!$::opt_help or die $usage;
-
-if ($::opt_version) {
-    print "$version\n";
-    exit(0);
-}
-
-$::opt_verbose = 1 if $::opt_debug;
-
-@ARGV >= 1 or die $usage;
-
-print $title;
-
-if ($::opt_bbox) {
-    $::opt_bbox =~ s/^\s+//;
-    $::opt_bbox =~ s/\s+$//;
-    $::opt_bbox =~ s/\s+/ /;
-    if ($::opt_bbox =~ /^-?\d*\.?\d+ -?\d*\.?\d+ -?\d*\.?\d+ -?\d*\.?\d+$/) {
-        print "* Explicite Bounding Box: $::opt_bbox\n" if $::opt_debug;
-    }
-    else {
-        die "$Error Parse error (option --bbox \"$::opt_bbox\")!\n";
-    }
-}
-
-@ARGV <= 2 or die "$Error Too many files!\n";
-
-### input file
-$inputfile = shift @ARGV;
-
-if (! -f $inputfile) {
-    if (-f "$inputfile.pdf") {
-        $inputfile .= ".pdf";
-    }
-    else {
-        die "$Error Input file `$inputfile' not found!\n";
-    }
-}
-
-print "* Input file: $inputfile\n" if $::opt_debug;
-
-### output file
-if (@ARGV) {
-    $outputfile = shift @ARGV;
-}
-else {
-    $outputfile = $inputfile;
-    $outputfile =~ s/\.pdf$//i;
-    $outputfile .= "-crop.pdf";
-}
-
-print "* Output file: $outputfile\n" if $::opt_debug;
-
-if (($::opt_tex eq 'xetex') && $::opt_clip) {
-    die "$Error No clipping support for XeTeX!\n";
-}
-
-### margins
-my ($llx, $lly, $urx, $ury) = (0, 0, 0, 0);
-if ($::opt_margins =~
-        /^\s*([\-\.\d]+)\s+([\-\.\d]+)\s+([\-\.\d]+)\s+([\-\.\d]+)\s*$/) {
-    ($llx, $lly, $urx, $ury) = ($1, $2, $3, $4);
-}
-else {
-    if ($::opt_margins =~ /^\s*([\-\.\d]+)\s+([\-\.\d]+)\s*$/) {
-        ($llx, $lly, $urx, $ury) = ($1, $2, $1, $2);
-    }
-    else {
-        if ($::opt_margins =~ /^\s*([\-\.\d]+)\s*$/) {
-            ($llx, $lly, $urx, $ury) = ($1, $1, $1, $1);
-        }
-        else {
-            die "$Error Parse error (option --margins)!\n";
-        }
-    }
-}
-print "* Margins: $llx $lly $urx $ury\n" if $::opt_debug;
-
-### papersize validation (security)
-if ($::opt_papersize ne '') {
-    $::opt_papersize =~ /^[0-9A-Za-z]+$/
-            or die "$Error Invalid papersize ($::opt_papersize)!\n";
-    $papersizes{$::opt_papersize}
-            or die "$Error Unknown papersize ($::opt_papersize),"
-                   . " see ghostscript's documentation for option `-r'!\n";
-}
-
-### resolution validation (security)
-if ($::opt_resolution ne '') {
-    $::opt_resolution =~ /^\d+(x\d+)?$/
-            or die "$Error Invalid resolution ($::opt_resolution),"
-                   . " see ghostscript's documentation!\n";
-}
-
-### command name validation (security)
-my %cmd = (
-    'gscmd' => \$::opt_gscmd,
-    'pdftexcmd' => \$::opt_pdftexcmd,
-    'xetexcmd' => \$::opt_xetexcmd
-);
-foreach my $cmd (keys %cmd) {
-    my $val = ${$cmd{$cmd}};
-    next unless $val;
-    $val =~ s/^\s+//;
-    $val =~ s/\s+$//;
-    next unless $val;
-    if ($val =~ /`/) {
-        die "$Error Forbidden backtick for option `--$cmd' ($val)!\n";
-    }
-    if ($val =~ /\s/) {
-        die "$Error Forbidden whitespace for option `--$cmd' ($val)!\n";
-    }
-}
-if ($restricted) {
-    if ($::opt_pdftexcmd and $::opt_pdftexcmd ne 'pdftex') {
-        die "$Error pdfTeX program name must not be changed in restricted mode!\n";
-    }
-    if ($::opt_xetexcmd and $::opt_xetexcmd ne 'xetex') {
-        die "$Error XeTeX program name must not be changed in restricted mode!\n";
-    }
-    if ($::opt_gscmd) {
-        $::opt_gscmd =~ /^(gs|mgs|gswin32c|gs386|gsos2)$/
-        or $::opt_gscmd =~ /^gs[\-_]?(\d|\d[\.-_]?\d\d)c?$/
-        or die "$Error: Invalid Ghostscript program name in restricted mode!\n";
-    }
-}
-
-### cleanup system
-my @unlink_files = ();
-my $exit_code = 1;
-sub clean {
-    print "* Cleanup\n" if $::opt_debug;
-    if ($::opt_debug) {
-        print "* Temporary files: @unlink_files\n";
-    }
-    else {
-        for (; @unlink_files>0; ) {
-            unlink shift @unlink_files;
-        }
-    }
-}
-sub cleanup {
-    clean();
-    exit($exit_code);
-}
-$SIG{'INT'} = \&cleanup;
-$SIG{'__DIE__'} = \&clean;
-
-### Calculation of BoundingBoxes
-
-# use safe file name for use within cmd line of gs (unknown shell: space, ...)
-# and pdfTeX (dollar, ...)
-my $inputfilesafe = $inputfile;
-if ($inputfile =~ /[\s\$~'"]/) {
-    $inputfilesafe = "$tmp-img.pdf";
-    push @unlink_files, $inputfilesafe;
-    my $symlink_exists = eval { symlink("", ""); 1 };
-    print "* Input file name `$inputfile' contains special characters.\n"
-          . "* " . ($symlink_exists ? "Link" : "Copy")
-          . " input file to temporary file `$inputfilesafe'.\n"
-            if $::opt_verbose;
-    if ($symlink_exists) {
-        symlink($inputfile, $inputfilesafe)
-            or die "$Error Link from `$inputfile' to"
-                   . " `$inputfilesafe' failed: $!\n";
-    }
-    else {
-        use File::Copy;
-        copy($inputfile, $inputfilesafe)
-                or die "$Error Copy from `$inputfile' to"
-                       . " `$inputfilesafe' failed: $!\n";
-    }
-}
-
-my @gsargs = (
-    "-sDEVICE=bbox",
-    "-dBATCH",
-    "-dNOPAUSE"
-);
-push @gsargs, "-sPAPERSIZE=$::opt_papersize" if $::opt_papersize;
-push @gsargs, "-r$::opt_resolution" if $::opt_resolution;
-push @gsargs,
-    "-c",
-    "save",
-    "pop",
-    "-f",
-    $inputfilesafe
-;
-
-my $tmpfile = "$tmp.tex";
-push @unlink_files, $tmpfile;
-open(TMP, ">$tmpfile") or
-    die "$Error Cannot write tmp file `$tmpfile'!\n";
-print TMP "\\def\\pdffile{$inputfilesafe}\n";
-if ($::opt_tex eq 'pdftex') {
-    print TMP <<'END_TMP_HEAD';
-\csname pdfmapfile\endcsname{}
-\def\page #1 [#2 #3 #4 #5]{%
-  \count0=#1\relax
-  \setbox0=\hbox{%
-    \pdfximage page #1{\pdffile}%
-    \pdfrefximage\pdflastximage
-  }%
-  \pdfhorigin=-#2bp\relax
-  \pdfvorigin=#3bp\relax
-  \pdfpagewidth=#4bp\relax
-  \advance\pdfpagewidth by -#2bp\relax
-  \pdfpageheight=#5bp\relax
-  \advance\pdfpageheight by -#3bp\relax
-  \ht0=\pdfpageheight
-  \shipout\box0\relax
-}
-\def\pageclip #1 [#2 #3 #4 #5][#6 #7 #8 #9]{%
-  \count0=#1\relax
-  \dimen0=#4bp\relax \advance\dimen0 by -#2bp\relax
-  \edef\imagewidth{\the\dimen0}%
-  \dimen0=#5bp\relax \advance\dimen0 by -#3bp\relax
-  \edef\imageheight{\the\dimen0}%
-  \pdfximage page #1{\pdffile}%
-  \setbox0=\hbox{%
-    \kern -#2bp\relax
-    \lower #3bp\hbox{\pdfrefximage\pdflastximage}%
-  }%
-  \wd0=\imagewidth\relax
-  \ht0=\imageheight\relax
-  \dp0=0pt\relax
-  \pdfhorigin=#6pt\relax
-  \pdfvorigin=#7bp\relax
-  \pdfpagewidth=\imagewidth
-  \advance\pdfpagewidth by #6bp\relax
-  \advance\pdfpagewidth by #8bp\relax
-  \pdfpageheight=\imageheight\relax
-  \advance\pdfpageheight by #7bp\relax
-  \advance\pdfpageheight by #9bp\relax
-  \pdfxform0\relax
-  \shipout\hbox{\pdfrefxform\pdflastxform}%
-}%
-\def\pageinclude#1{%
-  \pdfhorigin=0pt\relax
-  \pdfvorigin=0pt\relax
-  \pdfximage page #1{\pdffile}%
-  \setbox0=\hbox{\pdfrefximage\pdflastximage}%
-  \pdfpagewidth=\wd0\relax
-  \pdfpageheight=\ht0\relax
-  \advance\pdfpageheight by \dp0\relax
-  \shipout\hbox{%
-    \raise\dp0\box0\relax
-  }%
-}
-END_TMP_HEAD
-}
-else { # XeTeX
-    print TMP <<'END_TMP_HEAD';
-\expandafter\ifx\csname XeTeXpdffile\endcsname\relax
-  \expandafter\ifx\csname pdffile\endcsname\relax
-    \errmessage{XeTeX not found!}%
-  \else
-    \errmessage{XeTeX is too old!}%
-  \fi
-\fi
-\def\page #1 [#2 #3 #4 #5]{%
-  \count0=#1\relax
-  \setbox0=\hbox{%
-    \XeTeXpdffile "\pdffile" page #1%
-  }%
-  \pdfpagewidth=#4bp\relax
-  \advance\pdfpagewidth by -#2bp\relax
-  \pdfpageheight=#5bp\relax
-  \advance\pdfpageheight by -#3bp\relax
-  \shipout\hbox{%
-    \kern-1in%
-    \kern-#2bp%
-    \vbox{%
-      \kern-1in%
-      \kern#3bp%
-      \ht0=\pdfpageheight
-      \box0 %
-    }%
-  }%
-}
-END_TMP_HEAD
-}
-
-print "* Running ghostscript for BoundingBox calculation ...\n"
-    if $::opt_verbose;
-print "* Ghostscript call: $::opt_gscmd @gsargs\n" if $::opt_debug;
-
-my @bbox;
-if ($::opt_bbox) {
-     $::opt_bbox =~ /([-\d\.]+) ([-\d\.]+) ([-\d\.]+) ([-\d\.]+)/;
-     @bbox = ($1, $2, $3, $4);
-}
-my $page = 0;
-my $gs_pipe = "$::opt_gscmd -dSAFER @gsargs 2>&1";
-$gs_pipe .= " 1>$null" unless $::opt_verbose;
-$gs_pipe .= "|";
-
-open(GS, $gs_pipe) or
-        die "$Error Cannot call ghostscript ($::opt_gscmd)!\n";
-my $bb = ($::opt_hires) ? "%%HiResBoundingBox" : "%%BoundingBox";
-while (<GS>) {
-    print $_ if $::opt_verbose;
-    next unless
-        /^$bb:\s*(-?[\.\d]+) (-?[\.\d]+) (-?[\.\d]+) (-?[\.\d]+)/o;
-    @bbox = ($1, $2, $3, $4) unless $::opt_bbox;
-    $page++;
-
-    my $empty = 0;
-    $empty = 1 if $bbox[0] >= $bbox[2];
-    $empty = 1 if $bbox[1] >= $bbox[3];
-    if ($empty) {
-        print <<"END_WARNING";
-
-!!! Warning: Empty Bounding Box is returned by Ghostscript!
-!!!   Page $page: @bbox
-!!! Either there is a problem with the page or with Ghostscript.
-!!! Recovery is tried by embedding the page in its original size.
-
-END_WARNING
-        print TMP "\\pageinclude{$page}\n";
-        next;
-    }
-
-    print "* Page $page: @bbox\n" if $::opt_verbose;
-
-    my @bb = ($bbox[0] - $llx, $bbox[1] - $ury,
-             $bbox[2] + $urx, $bbox[3] + $lly);
-
-    $empty = 0;
-    $empty = 1 if $bb[0] >= $bb[2];
-    $empty = 1 if $bb[1] >= $bb[3];
-    if ($empty) {
-        print <<"END_WARNING";
-
-!!! Warning: The final Bounding Box is empty!
-!!!   Page: $page: @bb
-!!! Probably caused by too large negative margin values.
-!!! Recovery by ignoring margin values.
-
-END_WARNING
-        print TMP "\\page $page [@bbox]\n";
-        # clipping shouldn't make a difference
-        next;
-    }
-    if ($::opt_clip) {
-        print TMP "\\pageclip $page [@bbox][$llx $lly $urx $ury]\n";
-    }
-    else {
-        print TMP "\\page $page [@bb]\n";
-    }
-}
-close(GS);
-
-if ($? & 127) {
-    die sprintf  "$Error Ghostscript died with signal %d!\n",
-                 ($? & 127);
-}
-elsif ($? != 0) {
-    die sprintf "$Error Ghostscript exited with error code %d!\n",
-                $? >> 8;
-}
-
-print TMP "\\csname \@\@end\\endcsname\n\\end\n";
-close(TMP);
-
-if ($page == 0) {
-    die "$Error Ghostscript does not report bounding boxes!\n";
-}
-
-### Run pdfTeX/XeTeX
-
-push @unlink_files, "$tmp.log";
-my $cmd;
-my $texname;
-if ($::opt_tex eq 'pdftex') {
-    $cmd = $::opt_pdftexcmd;
-    $texname = 'pdfTeX';
-}
-else {
-    $cmd = $::opt_xetexcmd;
-    $texname = 'XeTeX';
-}
-$cmd .= ' -no-shell-escape';
-if ($::opt_verbose) {
-    $cmd .= " -interaction=nonstopmode $tmp";
-}
-else {
-    $cmd .= " -interaction=batchmode $tmp";
-}
-print "* Running $texname ...\n" if $::opt_verbose;
-print "* $texname call: $cmd\n" if $::opt_debug;
-if ($::opt_verbose) {
-    system($cmd);
-}
-else {
-    `$cmd`;
-}
-if ($?) {
-    die "$Error $texname run failed!\n";
-}
-
-### Move temp file to output
-if (!rename("$tmp.pdf", $outputfile)) {
-    use File::Copy;
-    move "$tmp.pdf", $outputfile or
-            die "$Error Cannot move `$tmp.pdf' to `$outputfile'!\n";
-}
-
-print "==> $page page", (($page == 1) ? "" : "s"),
-      " written on `$outputfile'.\n";
-
-$exit_code = 0;
-cleanup();
-
-__END__
Index: sm/trunk/scripts/py_to_pyc.sh
===================================================================
--- /issm/trunk/scripts/py_to_pyc.sh	(revision 28275)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-
-################################################################################
-# Compiles all Python source files in a directory (recursively).
-#
-# Runs quietly if there are no errors. Otherwise, prints errors to console.
-################################################################################
-COMPILE_LOG='./py_to_pyc.log'
-TARGET='.'
-
-if [ "$#" -gt 0 ]; then
-	TARGET=$1
-fi
-
-echo "Compiling Python source files"
-python3 -m compileall -f -q -b ${TARGET}
-
-if [ -s ${COMPILE_LOG} ]; then
-	echo "Error(s) occurred while compiling Python scripts!"
-	echo "--------------- start: ${COMPILE_LOG} ---------------"
-	cat ${COMPILE_LOG}
-	echo "---------------- end: ${COMPILE_LOG} ----------------"
-	exit 1
-fi
Index: /issm/trunk/scripts/quickinstall.sh
===================================================================
--- /issm/trunk/scripts/quickinstall.sh	(revision 1)
+++ /issm/trunk/scripts/quickinstall.sh	(revision 1)
@@ -0,0 +1,82 @@
+#!/bin/bash
+#This bash script install everything that needs to be set up in ice (compilation, startup, SuiteSparse)
+#Make sure that CONFIG is the right OS system
+#config_linux32.mk for a 32 bits linux OS, 
+#config_linux64.mk for a 64 bits linux OS,
+#config_mac.mk for Mac OS X
+
+CONFIG="config_linux64.mk"
+
+#go to root
+cd $ISSM_DIR
+HERE=`pwd`;
+
+#check that ISSM_DIR is correctly set up
+if [ $HERE != $ISSM_DIR ]; then
+
+	cd ..
+
+	#.bashrc or .cshrc not correctly configured, display error message
+	echo "
+	******************************* .bashrc or .cshrc not correctly configured *******************************
+
+	In order for ISSM to work correctly, you should add the following lines in your shell
+	environment script (.bashrc or .cshrc). 
+	
+	#ISSM 
+	export ISSM_DIR=` pwd `
+	source $ISSM_DIR/etc/environment.sh
+	
+	**********************************************************************************************************
+	"
+else
+	#Ok, compile ISSM
+
+	#Configure mex file
+	cd etc
+	ln -s $CONFIG  config.mk
+	cd ..
+
+	#Compile libraries
+	cd packages
+#		cd 	dakota  
+#		sh install.sh
+#		cd ..
+#		cd 	doxygen  
+#		sh install.sh
+#		cd ..
+#		cd 	gdal  
+#		sh install.sh
+#		cd ..
+#		cd 	m2html 
+#		sh install.sh
+#		cd ..
+		cd 	metis  
+		sh install.sh
+		cd ..
+#		cd 	mpich2 
+#		sh install.sh
+#		cd ..
+#		cd 	mtoc  
+#		sh install.sh
+#		cd ..
+#		cd 	petsc  
+#		sh install.sh
+#		cd ..
+#		cd 	qhull  
+#		sh install.sh
+#		cd ..
+#		cd 	slepc  
+#		sh install.sh
+#		cd ..
+		cd 	suitesparse 
+		sh install.sh
+		cd ..
+		cd 	triangle
+		sh install.sh
+		cd ..
+	cd ..
+
+	#Compile ISSM
+	make -f MakefileIce
+fi
Index: sm/trunk/scripts/report.sh
===================================================================
--- /issm/trunk/scripts/report.sh	(revision 28275)
+++ 	(revision )
@@ -1,322 +1,0 @@
-#!/bin/bash
-#generate html report from info.log output file
-
-#style
-#{{{
-TITLE_STYLE='width="700px" cellpadding="10"'
-TITLE_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:25px;" align="center"'
-SECTION_STYLE='width="700px" cellpadding="5"'
-SECTION_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:20px; font-weight: bold;" align="left"'
-TABLE_STYLE='width="680px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'
-TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px; font-weight: normal;" align="left"'
-CODE_STYLE='width="700px" rules=none'
-CODE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="left"'
-BODY_STYLE='width="700px"'
-BODY_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;"'
-BODY_FONTC=$(echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:center; /g")
-BODY_FONTL=$(echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:left; /g")
-FOOTER_STYLE='width="700px"  cellpadding="10"'
-FOOTER_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="center"'
-#}}}
-
-#process info.log
-#{{{
-if [ ! -f info.log ]; then
-	echo "File info.log not found!" >&2   # Error message to stderr.
-	exit 1
-fi 
-NRNAME=$(      cat info.log | grep "name:"           | awk '{$1=""}1')
-TODAY=$(       cat info.log | grep "today"           | awk '{printf("%s %s",$2,$3);}')
-USER=$(        cat info.log | grep "user"            | awk '{print $2}')
-VERSION=$(     cat info.log | grep "version"         | awk '{print $2}')
-HOST_NAME=$(   cat info.log | grep "host"            | awk '{print $2}')
-OS=$(          cat info.log | grep "OS"              | awk '{print $2}')
-RELEASE=$(     cat info.log | grep "release"         | awk '{print $2}')
-EL_INSTALL=$(  cat info.log | grep "elapsed_install" | awk '{print $2}')
-EL_TOTAL=$(    cat info.log | grep "elapsed_total"   | awk '{print $2}')
-IS_MATLAB=$(   cat info.log | grep "is_matlab"       | awk '{print $2}')
-IS_PYTHON=$(   cat info.log | grep "is_python"       | awk '{print $2}')
-EL_MATLAB=$(   cat info.log | grep "elapsed_matlab"  | awk '{print $2}')
-EL_PYTHON=$(   cat info.log | grep "elapsed_python"  | awk '{print $2}')
-CRASH_MATLAB=$(cat info.log | grep "matlab_crash:"   | awk '{print $2}')
-CRASH_PYTHON=$(cat info.log | grep "python_crash:"   | awk '{print $2}')
-
-#Did installation work?
-if [ $(ls -1 $ISSM_DIR/bin | wc -l) -le 1 ]; then
-	IS_INSTALL=0
-else
-	IS_INSTALL=1
-fi
-#}}}
-
-#1. summary table 
-#{{{
-rm report.html
-cat << END >> report.html
-<div align="center">
-<table $TITLE_STYLE><tr><td $TITLE_FONT>$NRNAME</td></tr></table>
-
-<table $TABLE_STYLE>
-<tr> 
-<td $TABLE_FONT>host: $HOST_NAME ($OS)</td>
-<td $TABLE_FONT>date: $TODAY</td>
-</tr>
-<tr>
-<td $TABLE_FONT>user: $USER</td>
-<td $TABLE_FONT>release: $RELEASE</td>
-</tr>
-<tr>
-<td $TABLE_FONT>total elapsed time: $EL_TOTAL</td>
-<td $TABLE_FONT>installation elapsed time: $EL_INSTALL</td>
-</tr>
-<tr>
-<td $TABLE_FONT>svn version: $VERSION</td>
-<td $TABLE_FONT></td>
-</tr>
-</table>
-<br><hr width="700px">
-END
-# }}}
-
-#stop if did not install
-#{{{
-if [ $IS_INSTALL -eq 0 ]; then
-	cat << END >> report.html
-	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
-	<tr><td $BODY_FONTC>Status: <span style="color:#ff0000">Installation failed</span></td></tr>
-	</table>
-	<table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
-	</div>
-END
-exit 0
-fi
-#}}}
-
-#2. matlab report
-if [ $IS_MATLAB -eq 1 ]; then
-#Process matlab_log.log {{{
-cat matlab_log.log        | egrep 'ERROR|SUCCESS|FAILURE' | grep -v "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > matlab.log
-cat matlab.log        | grep -v "SUCCESS" > matlab_short.log
-cat matlab_log.log        | grep "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > petscerror.log
-NUM_MATLAB_TOT=$(wc -l matlab.log | awk '{print $1}')
-NUM_MATLAB_ERR=$(cat matlab.log | grep 'ERROR'   | grep -v "PETSC" | wc -l)
-NUM_MATLAB_SUC=$(cat matlab.log | grep 'SUCCESS' | wc -l)
-NUM_MATLAB_FAI=$(cat matlab.log | grep 'FAILURE' | wc -l)
-#}}}
-#write report {{{
-cat << END >> report.html
-<table $SECTION_STYLE><tr><td $SECTION_FONT>Matlab tests</td></tr></table>
-<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
-$(if [ $CRASH_MATLAB -eq 0 ]; then
-echo "<tr><td $BODY_FONTL>Status: <span style=\"color:#008000\">all tests have been run</span></td></tr>"
-else
-	echo "<tr><td $BODY_FONTL>Status: <span style=\"color:#ff0000\">Matlab crashed</span></td></tr>"
-fi)
-<tr><td $BODY_FONTL>Total execution time: $EL_MATLAB</td></tr>
-<tr><td $BODY_FONTL>Number of successes: $NUM_MATLAB_SUC/$NUM_MATLAB_TOT</td></tr>
-<tr><td $BODY_FONTL>Number of errors: $NUM_MATLAB_ERR/$NUM_MATLAB_TOT</td></tr>
-<tr><td $BODY_FONTL>Number of failures: $NUM_MATLAB_FAI/$NUM_MATLAB_TOT</td></tr>
-</table>
-END
-#}}}
-fi
-
-#2. python report
-if [ $IS_PYTHON -eq 1 ]; then
-#Process python_log.log {{{
-cat python_log.log        | egrep 'ERROR|SUCCESS|FAILURE' | grep -v "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > python.log
-cat python.log        | grep -v "SUCCESS" > python_short.log
-cat python_log.log        | grep "PETSC" | sed -e "s/>/\&gt;/g" | sed -e "s/</\&lt;/g" > petscerror.log
-NUM_PYTHON_TOT=$(wc -l python.log | awk '{print $1}')
-NUM_PYTHON_ERR=$(cat python.log | grep 'ERROR'   | grep -v "PETSC" | wc -l)
-NUM_PYTHON_SUC=$(cat python.log | grep 'SUCCESS' | wc -l)
-NUM_PYTHON_FAI=$(cat python.log | grep 'FAILURE' | wc -l)
-#}}}
-#write report {{{
-cat << END >> report.html
-<table $SECTION_STYLE><tr><td $SECTION_FONT>Python tests</td></tr></table>
-<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
-$(if [ $CRASH_PYTHON -eq 0 ]; then
-	echo "<tr><td $BODY_FONTL>Status: <span style=\"color:#008000\">all tests have been run</span></td></tr>"
-else
-	echo "<tr><td $BODY_FONTL>Status: <span style=\"color:#ff0000\">Python crashed</span></td></tr>"
-fi)
-<tr><td $BODY_FONTL>Total execution time: $EL_PYTHON</td></tr>
-<tr><td $BODY_FONTL>Number of successes: $NUM_PYTHON_SUC/$NUM_PYTHON_TOT</td></tr>
-<tr><td $BODY_FONTL>Number of errors: $NUM_PYTHON_ERR/$NUM_PYTHON_TOT</td></tr>
-<tr><td $BODY_FONTL>Number of failures: $NUM_PYTHON_FAI/$NUM_PYTHON_TOT</td></tr>
-</table>
-END
-#}}}
-fi
-
-#3. Matlab and python tables
-if [ $IS_MATLAB -eq 1 ]; then
-#Matlab{{{
-#display table ONLY if installation worked and there has been at leat one FAILURE or ERROR
-if [ $IS_INSTALL -eq 1 ] && [ $NUM_MATLAB_TOT -gt 1 ] && [ $NUM_MATLAB_SUC -ne $NUM_MATLAB_TOT ]
-then
-	cat << END >> report.html
-<table $SECTION_STYLE><tr><td $(echo $SECTION_FONT)>List of Matlab tests</td></tr></table>
-<table $BODY_STYLE style="border-collapse:collapse;">
-<tr> 
-<th $BODY_FONT>Result</th> 
-<th $BODY_FONT>Tolerance</th> 
-<th $BODY_FONT>Test id</th>  
-<th $BODY_FONT>Test name</th> 
-<th $BODY_FONT>Field checked</th>
-</tr>
-$(cat matlab_short.log | while read line
-  do
-	  echo "<tr>"
-	  STATUS=`echo $line | awk '{print $1}'`
-	  #FAILURE
-	  if [ "$STATUS" = "FAILURE" ]
-	  then
-		  FONTC=$(echo "$BODY_FONTC bgcolor=#ffff00");
-		  FONTL=$(echo "$BODY_FONTL bgcolor=#ffff00");
-		  echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
-		  { printf("<td %s id=FAILURE>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTC,$3,FONTC,$6,FONTL,$9,FONTL,$11);}
-		  '; 
-	  else
-		  #SUCCESS
-		  if [ "$STATUS" = "SUCCESS" ]
-		  then
-			  FONTC=$(echo "$BODY_FONTC bgcolor=#ddffdd")
-			  FONTL=$(echo "$BODY_FONTL bgcolor=#ddffdd")
-			  #do not write anything
-		  #ERROR
-		  else
-			  FONTC=$(echo "$BODY_FONTC bgcolor=#ffdddd id=ERROR")
-			  FONTL=$(echo "$BODY_FONTL bgcolor=#ffdddd")
-			  echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
-			  { printf("<td %s>%s</td>\n<td %s>%s%s%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTL,$3,$4,$5,FONTC,$8,FONTL,$11,FONTL,$13);}
-			  '; 
-		  fi
-
-	  fi
-	  echo "</tr>"
-  done
-	  )
-</table>
-<br>
-END
-fi
-#}}}
-fi
-if [ $IS_PYTHON -eq 1 ]; then
-#python{{{
-#display table ONLY if installation worked and there has been at leat one FAILURE or ERROR
-if [ $IS_INSTALL -eq 1 ] && [ $NUM_PYTHON_TOT -gt 1 ] && [ $NUM_PYTHON_SUC -ne $NUM_PYTHON_TOT ]
-then
-	cat << END >> report.html
-	<table $(echo $SECTION_STYLE)><tr><td $(echo $SECTION_FONT)>List of Python tests</td></tr></table>
-	<table $(echo $BODY_STYLE) style="border-collapse:collapse;">
-	<tr> 
-	<th $BODY_FONT>Result</th> 
-	<th $BODY_FONT>Tolerance</th> 
-	<th $BODY_FONT>Test id</th>  
-	<th $BODY_FONT>Test name</th> 
-	<th $BODY_FONT>Field checked</th>
-	</tr>
-	$(cat python_short.log | while read line
-do
-	echo "<tr>"
-	STATUS=`echo $line | awk '{print $1}'`
-
-	#FAILURE
-	if [ "$STATUS" = "FAILURE" ]
-	then
-
-		FONTC=$(echo "$BODY_FONTC bgcolor=#ffff00");
-		FONTL=$(echo "$BODY_FONTL bgcolor=#ffff00");
-		echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
-		{ printf("<td %s id=FAILURE>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTC,$3,FONTC,$6,FONTL,$9,FONTL,$11);}
-		'; 
-
-	else
-
-		#SUCCESS
-		if [ "$STATUS" = "SUCCESS" ]
-		then
-			FONTC=$(echo "$BODY_FONTC bgcolor=#ddffdd")
-			FONTL=$(echo "$BODY_FONTL bgcolor=#ddffdd")
-			#do not write anything
-			#ERROR
-		else
-			FONTC=$(echo "$BODY_FONTC bgcolor=#ffdddd id=ERROR")
-			FONTL=$(echo "$BODY_FONTL bgcolor=#ffdddd")
-			echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" '
-			{ printf("<td %s>%s</td>\n<td %s>%s%s%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n<td %s>%s</td>\n\n",FONTL,$1,FONTL,$3,$4,$5,FONTC,$8,FONTL,$11,FONTL,$13);}
-			'; 
-		fi
-
-	fi
-	echo "</tr>"
-done
-)
-</table>
-<br>
-END
-fi
-#}}}
-fi
-
-#4. Error report
-if [ $IS_MATLAB -eq 1 ] && [ -s matlaberror.log ]; then
-#Matlab {{{
-cat << END >> report.html
-<table $SECTION_STYLE><tr><td $SECTION_FONT>Matlab errors</td></tr></table>
-<table $CODE_STYLE><tr><td $CODE_FONT>
-<pre style="
-white-space: -moz-pre-wrap;
-white-space: -pre-wrap;
-white-space: -o-pre-wrap;
-white-space: pre-wrap;
-word-wrap: break-word;
-">$(cat matlaberror.log)</pre>
-</td></tr></table>
-END
-#}}}
-fi
-if [ $IS_PYTHON -eq 1 ] && [ -s pythonerror.log ]; then
-	#Python {{{
-	cat << END >> report.html
-<table $SECTION_STYLE><tr><td $SECTION_FONT>Python errors</td></tr></table>
-<table $CODE_STYLE><tr><td $CODE_FONT>
-<pre style="
-white-space: -moz-pre-wrap;
-white-space: -pre-wrap;
-white-space: -o-pre-wrap;
-white-space: pre-wrap;
-word-wrap: break-word;
-">$(cat pythonerror.log)</pre>
-</td></tr></table>
-END
-	#}}}
-fi
-if [ -s petscerror.log ]; then
-	#PETSc{{{
-cat << END >> report.html
-<table $SECTION_STYLE><tr><td $SECTION_FONT>PETSc errors</td></tr></table>
-<table $CODE_STYLE><tr><td $CODE_FONT>
-<pre style="
-white-space: -moz-pre-wrap;
-white-space: -pre-wrap;
-white-space: -o-pre-wrap;
-white-space: pre-wrap;
-word-wrap: break-word;
-">$(cat petscerror.log)</pre>
-</td></tr></table>
-END
-#}}}
-fi
-
-#last: footer
-#{{{
-cat << END >> report.html
-<br>
-<table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
-</div>
-END
-#}}}
Index: /issm/trunk/scripts/svn2cl-0.11/ChangeLog
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/ChangeLog	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/ChangeLog	(revision 1)
@@ -0,0 +1,550 @@
+2008-09-22 21:34  arthur
+
+	* [r124] svn2cl.sh: fix for OpenBSD's ksh by Carlo Marcelo Arenas
+	  Belon <carenas@sajinet.com.pe>
+
+2008-06-03 19:03  arthur
+
+	* [r123] svn2cl.sh: make awk command configurable
+
+2008-06-03 19:02  arthur
+
+	* [r122] svn2cl.sh: don't use GNU extensions to awk syntax
+
+2008-04-06 13:37  arthur
+
+	* [r120] ChangeLog, NEWS, README, TODO, svn2cl.1, svn2cl.sh,
+	  svn2cl.xsl, svn2html.xsl: get files ready for 0.10 release
+
+2008-04-06 13:27  arthur
+
+	* [r119] svn2cl.1: include not about default revision range that is
+	  used
+
+2008-04-06 12:25  arthur
+
+	* [r118] svn2cl.1, svn2cl.sh: make -a a short equivalent for
+	  --include-actions
+
+2008-01-02 21:55  arthur
+
+	* [r117] svn2cl.xsl, svn2html.xsl: escape the newline character
+	  reference in the entity definition of newl to perform the
+	  normalization at the right time (see
+	  http://mail-archives.apache.org/mod_mbox/xerces-c-dev/200010.mbox/%3COF274C146F.60A7FFAF-ON8525696D.0065F984@lotus.com%3E)
+
+2007-12-07 13:57  arthur
+
+	* [r116] README, svn2cl.1, svn2cl.sh: don't use backtick as quote
+	  character
+
+2007-10-09 20:00  arthur
+
+	* [r115] svn2cl.xsl: do not present file list if no files would be
+	  listed
+
+2007-09-25 20:03  arthur
+
+	* [r114] svn2cl.1, svn2cl.sh, svn2cl.xsl: add an --include-actions
+	  option that adds action labels about file additions and removals
+	  to the files in the log
+
+2007-04-08 12:47  arthur
+
+	* [r112] ChangeLog, NEWS, README, svn2cl.1, svn2cl.sh, svn2cl.xsl,
+	  svn2html.xsl: get files ready for 0.9 release
+
+2007-04-08 12:34  arthur
+
+	* [r111] svn2cl.1: unescape some hyphens that are not minus symbols
+
+2007-03-31 13:45  arthur
+
+	* [r110] svn2cl.xsl: completely ignore files that do not start with
+	  the specified prefix if --strip-prefix is specified
+
+2007-03-31 10:47  arthur
+
+	* [r109] svn2cl.1, svn2cl.sh, svn2cl.xsl, svn2html.xsl: add an
+	  option --ignore-message-starting to ignore any log messages that
+	  start with the specified string
+
+2006-10-19 19:18  arthur
+
+	* [r108] svn2cl.1: change hyphens into minus symbols (thanks
+	  lintian)
+
+2006-10-18 21:38  arthur
+
+	* [r106] NEWS: fix news
+
+2006-10-18 21:38  arthur
+
+	* [r105] ChangeLog, NEWS, README, TODO, svn2cl.1, svn2cl.sh,
+	  svn2cl.xsl, svn2html.xsl: get files ready for 0.8 release
+
+2006-10-18 21:27  arthur
+
+	* [r104] README: add note about VBScript port by Iwasa Kazmi
+
+2006-10-18 21:23  arthur
+
+	* [r103] README: add ant section based on snippet by Rob Moore
+	  <rmoore@espsg.com>
+
+2006-09-03 12:11  arthur
+
+	* [r102] svn2cl.xsl: fix another wrapping bug regarding spaces at
+	  the edge of the wrapped text
+
+2006-09-03 11:44  arthur
+
+	* [r101] svn2cl.xsl: fix bug in wrapping really long words
+
+2006-09-03 11:19  arthur
+
+	* [r100] svn2cl.sh: fix for having directories and/or repositories
+	  with spaces in them
+
+2006-08-26 13:04  arthur
+
+	* [r99] svn2cl.1, svn2cl.sh, svn2cl.xsl: accept a numeric paramter
+	  to --break-before-msg to specify the number of newlines that
+	  should be inserted
+
+2006-08-26 13:02  arthur
+
+	* [r98] svn2cl.xsl, svn2html.xsl: always include a space before />
+
+2006-08-26 10:26  arthur
+
+	* [r97] svn2html.xsl: fix note with reference to svn2cl.xsl
+
+2006-08-26 09:33  arthur
+
+	* [r96] svn2cl.xsl, svn2html.xsl: fix ENTITY definitions in
+	  DOCTYPE, fix by Iwasa Kazmi <iwasa@cosmo-system.jp>
+
+2006-08-26 09:28  arthur
+
+	* [r95] svn2cl.sh: explicitly set locale for svn info command to
+	  have predictable output, fix by Iwasa Kazmi
+	  <iwasa@cosmo-system.jp>
+
+2006-08-12 05:53  arthur
+
+	* [r94] svn2cl.sh: fix for running svn2cl.sh in a directory with a
+	  space in it, patch by Max Bane <max.bane@gmail.com>
+
+2006-07-02 21:21  arthur
+
+	* [r93] svn2cl.xsl: fix for problem when not using authors file
+
+2006-06-27 20:11  arthur
+
+	* [r92] svn2cl.sh: build the svn info command more or less the same
+	  way as the svn log command (but don't pass all the options)
+
+2006-06-27 19:56  arthur
+
+	* [r91] svn2cl.1: split authors file info to a separate section
+
+2006-06-27 19:52  arthur
+
+	* [r90] svn2cl.1: capitalize HTML, some spelling fixes and some
+	  wording changes
+
+2006-06-15 20:43  arthur
+
+	* [r89] authors.xml, svn2cl.1, svn2cl.xsl: also copy xml content
+	  from authors file (this change also seems to bring a small
+	  performance gain)
+
+2006-06-14 20:51  arthur
+
+	* [r88] svn2cl.1, svn2cl.sh, svn2html.xsl: implement
+	  --revision-link option to make the revision numbers in the html
+	  output linkable to some url
+
+2006-06-14 19:03  arthur
+
+	* [r87] svn2cl.1, svn2cl.sh, svn2html.xsl: implement --title option
+	  for setting a title in the html page, based on a patch by Matt
+	  Doar <matt@xensource.com>
+
+2006-06-06 21:44  arthur
+
+	* [r86] svn2cl.sh: also pass --nowrite, --nomkdir and --nonet
+	  options to xsltproc command
+
+2006-04-10 19:06  arthur
+
+	* [r84] ChangeLog, NEWS, README, TODO, svn2cl.1, svn2cl.sh,
+	  svn2html.xsl: get files ready for 0.7 release
+
+2006-04-10 18:47  arthur
+
+	* [r83] svn2cl.1, svn2html.xsl: make --reparagraph option also work
+	  for HTML output
+
+2006-04-09 21:33  arthur
+
+	* [r82] svn2cl.1: add --html compatibility information to
+	  --separate-daylogs and --repragraph options
+
+2006-04-09 21:24  arthur
+
+	* [r81] svn2cl.1, svn2cl.sh, svn2cl.xsl: implement
+	  --separate-daylogs option to put a newline between log entries
+	  when --group-by-day is used
+
+2006-04-09 20:41  arthur
+
+	* [r80] svn2cl.sh: fallback to old behaviour of stripping prefix if
+	  svn info does not provide the necessary info
+
+2006-04-09 20:32  arthur
+
+	* [r79] svn2cl.1, svn2cl.sh, svn2cl.xsl: implement --repragraph
+	  option that rewraps text inside paragraphs
+
+2006-04-02 21:10  arthur
+
+	* [r78] svn2cl.1: clearly state which options do not work with
+	  --html
+
+2006-04-02 20:43  arthur
+
+	* [r77] svn2cl.xsl: typo fix
+
+2006-04-02 09:08  arthur
+
+	* [r76] svn2cl.xsl, svn2html.xsl: split out group-by-day code to
+	  separate code block and reduce number of xsl:apply-templates
+	  calls
+
+2006-04-02 08:46  arthur
+
+	* [r75] svn2cl.xsl: typo author-lookup fix for r71 plus some
+	  readability improvements to code doing the author lookup
+
+2006-04-01 21:37  arthur
+
+	* [r74] svn2html.xsl: give template a more logical name
+
+2006-04-01 21:34  arthur
+
+	* [r73] svn2cl.sh: ensure that stringparam arguments are always
+	  properly quoted
+
+2006-04-01 21:31  arthur
+
+	* [r72] svn2cl.1, svn2cl.sh: svn option is called --targets (with
+	  the s) and some other small usage fixes
+
+2006-03-27 20:42  arthur
+
+	* [r71] svn2cl.xsl: use xsl:key when looking up author names in
+	  authors.xml file (idea from
+	  http://www-128.ibm.com/developerworks/library/x-xsltip.html)
+	  (improving performance around 10-20% with large logs)
+
+2006-03-24 17:33  arthur
+
+	* [r70] svn2cl.1, svn2cl.sh: determin prefix to strip from output
+	  of svn info command (using awk)
+
+2006-03-21 21:25  arthur
+
+	* [r69] svn2cl.sh: add comment and ensure that script returns 0 on
+	  successful exit
+
+2006-03-21 20:48  arthur
+
+	* [r68] svn2cl.1, svn2cl.sh: implement automatically converting
+	  authors file to xml if it is in colon separated format, based on
+	  a patch by Olivier Blin <oblin@mandriva.com>
+
+2006-03-17 16:22  arthur
+
+	* [r67] svn2html.css: reduce w3c css checker warnings and slightly
+	  improve layout, making anchors stand out a little less
+
+2006-03-17 16:19  arthur
+
+	* [r66] svn2html.xsl: made anchors and links for each revision
+	  based on a patch by Tobias Schäfer <tobiasschaefer@gmx.de>
+
+2006-02-11 15:29  arthur
+
+	* [r64] ChangeLog, NEWS, README, TODO, svn2cl.1, svn2cl.sh: get
+	  files ready for 0.6 release
+
+2006-02-11 15:17  arthur
+
+	* [r63] svn2html.xsl: include common formatting templates from
+	  svn2cl.xsl
+
+2006-02-11 15:03  arthur
+
+	* [r62] svn2cl.xsl, svn2html.xsl: use named entity references for
+	  newlines everywhere and put entity definitions in correct DOCTYPE
+
+2006-02-11 14:41  arthur
+
+	* [r61] svn2html.css: improve style of generated html a little
+
+2006-02-11 14:35  arthur
+
+	* [r60] svn2cl.xsl, svn2html.xsl: trim spaces from author names
+
+2006-02-11 14:34  arthur
+
+	* [r59] authors.xml: add sample authors.xml file
+
+2006-02-11 14:33  arthur
+
+	* [r58] svn2html.xsl: added footer to generated html report with a
+	  link to svn2cl homepage
+
+2006-02-01 21:22  arthur
+
+	* [r57] svn2cl.sh: make option removal expression consistent for
+	  all options (prevent copy-paste errors)
+
+2006-01-27 16:31  arthur
+
+	* [r56] svn2cl.1, svn2cl.sh, svn2cl.xsl: add --break-before-msg
+	  option, based on a patch by Vincent Danen <vdanen@linsec.ca>
+
+2006-01-27 15:44  arthur
+
+	* [r55] svn2cl.1: clarify comment about date period
+
+2006-01-27 15:38  arthur
+
+	* [r54] svn2cl.1: add extra example usage to generate changelog for
+	  last week (based on a patch by Bastian Kleineidam
+	  <calvin@users.sourceforge.net> to implement a --date option)
+
+2006-01-04 19:03  arthur
+
+	* [r53] svn2cl.1, svn2cl.sh, svn2cl.xsl, svn2html.xsl: include
+	  --authors option to specify an athors file that maps uids to
+	  author names
+
+2005-12-27 15:45  arthur
+
+	* [r52] svn2html.xsl: replace line breaks in log message with <br/>
+	  tags, thanks to Tobias Schäfer <tobiasschaefer@gmx.de> for the
+	  code
+
+2005-12-27 15:23  arthur
+
+	* [r51] svn2html.css: add commented out code to put change message
+	  on separate line
+
+2005-12-27 11:15  arthur
+
+	* [r50] svn2cl.xsl: strim trailing and double spaces and add &#10;
+	  as newline instead of &#13;, thanks to Tobias Schäfer
+	  <tobiasschaefer@gmx.de>
+
+2005-12-25 22:57  arthur
+
+	* [r48] NEWS, README, TODO, svn2cl.1, svn2cl.sh: get files ready
+	  for release 0.5
+
+2005-12-25 17:12  arthur
+
+	* [r47] svn2cl.sh: shell portability improvements to get it working
+	  on all tested shell/sed combinations, thanks to Jörg Sommer
+	  <joerg@alea.gnuu.de> for pointing this out
+
+2005-12-25 17:05  arthur
+
+	* [r46] NEWS: fix typo
+
+2005-12-25 17:03  arthur
+
+	* [r45] README: clarify usage information to include possibility to
+	  specify location of repository
+
+2005-12-25 14:44  arthur
+
+	* [r44] svn2cl.1: add manual page, some parts taken from manual
+	  page provided by Russ Allbery <rra@debian.org>
+
+2005-12-25 13:56  arthur
+
+	* [r43] svn2cl.xsl: preserve line breaks in log messages, trimming
+	  all trailing and beginning line breaks
+
+2005-12-25 13:10  arthur
+
+	* [r42] svn2cl.sh: clear up usage string, thanks to Tobias Schäfer
+	  <tobiasschaefer@gmx.de>
+
+2005-12-25 13:03  arthur
+
+	* [r41] NEWS, README: apply typo fixing and documentation improving
+	  patch by Tobias Schäfer <tobiasschaefer@gmx.de>
+
+2005-12-17 20:20  arthur
+
+	* [r40] svn2cl.sh: include --html option in --help output
+
+2005-12-04 21:26  arthur
+
+	* [r38] .: move directory back
+
+2005-12-04 21:26  arthur
+
+	* [r37] .: make release 0.4
+
+2005-12-04 21:23  arthur
+
+	* [r36] NEWS: add NEWS file
+
+2005-12-04 21:21  arthur
+
+	* [r35] TODO: include TODO file
+
+2005-12-04 21:09  arthur
+
+	* [r34] README, svn2cl.sh: bump version number to 0.4
+
+2005-12-04 21:00  arthur
+
+	* [r33] svn2cl.sh, svn2html.css, svn2html.xsl: add html stylesheet
+	  and css and --help option to output html
+
+2005-12-04 20:50  arthur
+
+	* [r32] svn2cl.sh: ensure that required arguments to options are
+	  specified (avoid silent failure)
+
+2005-12-04 20:30  arthur
+
+	* [r31] svn2cl.sh: implement passing options to the svn log
+	  command, rename -r option (--include-rev) to -i
+
+2005-12-04 20:27  arthur
+
+	* [r30] svn2cl.sh: handle --option=arg options as well as --option
+	  arg
+
+2005-12-04 20:25  arthur
+
+	* [r29] svn2cl.sh: implement handling of -f and --file options
+
+2005-12-03 12:55  arthur
+
+	* [r28] svn2cl.xsl: move adding colon to path list one level up
+
+2005-12-03 12:52  arthur
+
+	* [r27] svn2cl.xsl: remove TODO section (is now in a separate file)
+
+2005-12-03 12:52  arthur
+
+	* [r26] svn2cl.xsl: ensure that we have a space everywhere before
+	  />
+
+2005-12-03 12:14  arthur
+
+	* [r25] svn2cl.xsl: no need for xhtml namespace declaration
+
+2005-12-02 16:51  arthur
+
+	* [r24] svn2cl.xsl: explain why we use ++ for options
+
+2005-12-02 16:34  arthur
+
+	* [r23] svn2cl.xsl: switch ChangeLog encoding to utf-8
+
+2005-09-13 19:27  arthur
+
+	* [r21] README, svn2cl.sh: bump version number to 0.3
+
+2005-09-09 19:04  arthur
+
+	* [r20] svn2cl.sh: implement writing ChangeLog to a different file
+	  or stdout
+
+2005-08-16 18:24  arthur
+
+	* [r19] svn2cl.sh: make -r an alias for --include-rev
+
+2005-07-31 16:37  arthur
+
+	* [r17] README: add simple installation instructions
+
+2005-07-31 16:33  arthur
+
+	* [r16] README: add very basic README
+
+2005-07-31 16:08  arthur
+
+	* [r15] svn2cl.sh: use basename when printing program name
+
+2005-07-31 16:00  arthur
+
+	* [r14] svn2cl.sh: add code for finding the location of the .xsl
+	  file relative to the installed location of the script following
+	  symlinks
+
+2005-07-31 15:26  arthur
+
+	* [r13] svn2cl.sh: add proper command line handling to shell script
+
+2005-07-31 14:51  arthur
+
+	* [r12] svn2cl.sh: add simple shell script calling xsltproc
+
+2005-07-31 14:42  arthur
+
+	* [r11] svn2cl.xsl: add an include-rev option to also list revision
+	  number
+
+2005-07-31 14:41  arthur
+
+	* [r10] svn2cl.xsl: fix copy-pasto
+
+2005-07-31 14:40  arthur
+
+	* [r9] svn2cl.xsl: make groupbyday either have yes or no value
+
+2005-07-31 14:38  arthur
+
+	* [r8] svn2cl.xsl: add a groupbyday option to group all changes per
+	  day per author
+
+2005-03-25 17:11  arthur
+
+	* [r7] svn2cl.xsl: make linelen really configurable (param instead
+	  of variable
+
+2005-03-25 14:36  arthur
+
+	* [r6] svn2cl.xsl: move printing of trailing newline to wrap
+	  template (plus some small readability improvements)
+
+2005-03-25 14:29  arthur
+
+	* [r5] svn2cl.xsl: make line length configurable
+
+2005-03-23 21:51  arthur
+
+	* [r4] svn2cl.xsl: split out formatting of single pathname and also
+	  handle situation with trailing slash in strip-prefix
+
+2005-03-23 21:19  arthur
+
+	* [r3] svn2cl.xsl: use entities for outputting tabs, spaces and
+	  newlines
+
+2005-03-23 20:45  arthur
+
+	* [r1] ., svn2cl.xsl: check in initial version
+
Index: /issm/trunk/scripts/svn2cl-0.11/NEWS
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/NEWS	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/NEWS	(revision 1)
@@ -0,0 +1,103 @@
+changes from 0.10 to 0.11
+-------------------------
+
+* small portability improvements
+* fix for OpenBSD's ksh by Carlo Marcelo Arenas Belon
+
+
+changes from 0.9 to 0.10
+------------------------
+
+* add an --include-actions option that adds action labels about file
+  additions and removals
+* small fix for other XSLT processors
+* manual page improvement
+
+
+changes from 0.8 to 0.9
+-----------------------
+
+* ignore files outside the base directory if --strip-prefix is specified
+  (the default with the wrapper shellscript)
+* add --ignore-message-starting option to ignore any log messages that
+  start with the specified string
+
+
+changes from 0.7 to 0.8
+-----------------------
+
+* added --title option for setting html page title (thanks Matt Doar)
+* added --revision-link option to make the revision numbers in the html
+  output link to some url
+* updated --break-before option to have an optional number of breaks
+* authors file format improvements (see manual)
+* fixes to the svn info command to guess working directory (thanks Iwasa
+  Kazmi)
+* miscellaneous fixes (thanks Max Bane and Iwasa Kazmi)
+* document calling svn2cl from ant by Rob Moore
+* some wrapping fixes
+* fixes for having directories and/or repositories with spaces in them
+
+
+changes from 0.6 to 0.7
+-----------------------
+
+* performance improvements (svn2cl is about 40% faster when not using the
+  --group-by-day option plus a couple of percent when using the --authors
+  option)
+* path to strip from file names is now automatically determined (works with
+  svn>=1.3.0)
+* colon separated authors file is now supported
+* html output improvements
+* added --reparagraph option that re-wraps text inside paragraphs
+* added --separate-daylogs option that inserts newlines between log messages
+  when --group-by-day is used
+* manual page improvements
+
+
+changes from 0.5 to 0.6
+-----------------------
+
+* added --authors option to expand full author names (experimental, if anyone
+  has a better performing implementation, please let me know)
+* added --break-before-msg option (based on a patch by Vincent Danen)
+* added another example to manual page (thanks to Bastian Kleineidam)
+* preserve line breaks in html output
+* output line breaks that are more likely to be correct on most platforms
+* updated svn2html.css to give ChangeLog.html a little nicer layout
+
+
+changes from 0.4 to 0.5
+-----------------------
+
+* preserve line breaks in svn log messages
+* added manual page for shellscript wrapper
+* wrapper script portability improvements
+* documentation and --help output fixes and improvements
+
+
+changes from 0.3 to 0.4
+-----------------------
+
+* added NEWS and TODO files
+* support for passing options to svn log command
+* preliminary support for generating an html version of the ChangeLog
+  (copy css file manually)
+* switch encoding of generated files to utf-8
+* better command option handling
+
+
+changes from 0.2 to 0.3
+-----------------------
+
+* added short equivalents for some commonly used command line options
+* write the changelog to a different file or to stdout
+
+
+changes from 0.1 to 0.2
+-----------------------
+
+* support grouping entries per day
+* support for adding revision numbers in the log
+* line length is configurable
+* a wrapper shell script
Index: /issm/trunk/scripts/svn2cl-0.11/README
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/README	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/README	(revision 1)
@@ -0,0 +1,102 @@
+   svn2cl - create a ChangeLog from a subversion log
+
+   Copyright (C) 2004, 2005, 2006, 2007, 2008 Arthur de Jong
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+   3. The name of the author may not be used to endorse or promote
+      products derived from this software without specific prior
+      written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+   IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+   IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+   IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+INTRODUCTION
+============
+
+svn2cl is a simple xsl transformation and shell script wrapper for generating
+a classic GNU-style ChangeLog from a subversion repository log. It is made
+from several changelog-like scripts using common xslt constructs found in
+different places.
+
+I made it because it was the only thing that I missed from cvs after I
+converted a repository to subversion. I used cvs2cl before.
+
+INSTALLING SVN2CL
+=================
+
+Just unpack the tarball in some directory (e.g. /opt/svn2cl-0.10)
+and symlink the svn2cl.sh script in your path somewhere (e.g.
+ln -s /opt/svn2cl-0.10/svn2cl.sh /usr/local/bin/svn2cl).
+
+Note: Be sure to keep the svn2cl.xsl file in the same directory as the
+svn2cl.sh script as the script looks for it there (symlinking is ok).
+
+USING SVN2CL IN AN ANT TARGET
+=============================
+
+It is possible to use svn2cl in an ant target with a snippet like:
+
+<tempfile property="info.xml.file"
+          prefix="info-" suffix=".xml"
+          destdir="${java.io.tmpdir}" />
+<java classname="org.tmatesoft.svn.cli.SVN" dir="${basedir}"
+      fork="true" output="${info.xml.file}"
+      classpathref="javasvn-classpath">
+ <arg line="log --xml --verbose" />
+</java>
+<xslt in="${info.xml.file}" out="ChangeLog" style="svn2cl.xsl">
+ <param name="strip-prefix" expression="trunk/myProject/" />
+ <param name="groupbyday" expression="yes" />
+ <param name="separate-daylogs" expression="yes" />
+ <param name="include-rev" expression="yes" />
+ <param name="breakbeforemsg" expression="yes" />
+ <param name="reparagraph" expression="yes" />
+</xslt>
+<delete file="${info.xml.file}" />
+
+Although it seems that currently the xslt processor that is used by ant
+inserts newlines in places it shouldn't. This can be worked around by
+replacing &newl; throughout the xsl files by &#xa;.
+
+WINDOWS PORT
+============
+
+A VBScript port of the wrapper shell script has been made by Iwasa Kazmi,
+which allows running svn2cl on Microsoft Windows without a POSIX compatibility
+layer and xsltproc. More information is available here:
+http://www.cosmo-system.jp/iwasa/svn2clwin.html
+
+NOTES
+=====
+
+The log is performed on the current directory '.' unless you specify URL
+and/or PATH parameters. Before generating the ChangeLog you may want to make
+your working copy up to date with 'svn update' (non-recursive update will do)
+or pass --revision HEAD:1 as a parameter to svn2cl.sh.
+
+There will not be very frequent new releases but if there are they can be
+found at: http://ch.tudelft.nl/~arthur/svn2cl/
+
+FEEDBACK AND BUG REPORTS
+========================
+
+If you have any questions about svn2cl or would like to report a bug please
+send an email to Arthur de Jong <arthur@ch.tudelft.nl>.
Index: /issm/trunk/scripts/svn2cl-0.11/TODO
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/TODO	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/TODO	(revision 1)
@@ -0,0 +1,10 @@
+* support more xslt processors
+* group changes per autor per day
+* svn2rss?
+* if an authors.xml file exists in the current directory automatically pick it up
+* improve performance of processing authors.xml
+* fix awk magic to not break with spaces in repository names
+* find better names for options
+* create backup of previous changelog file
+* support specifying multiple --ignore-message-starting options
+* svn2cl --strip-prefix=/ doesn't work as expected
Index: /issm/trunk/scripts/svn2cl-0.11/authors.xml
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/authors.xml	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/authors.xml	(revision 1)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<authors xmlns:html="http://www.w3.org/1999/xhtml">
+ <author uid="arthur">
+  Arthur de Jong &lt;<html:a href="mailto:arthur@ch.tudelft.nl">arthur@ch.tudelft.nl</html:a>&gt;
+ </author>
+ <author uid="nobody">
+  Who's this &lt;nobody@example.com&gt;
+ </author>
+ <author uid="root">
+  Superman &lt;root@localhost&gt;
+ </author>
+</authors>
Index: /issm/trunk/scripts/svn2cl-0.11/svn2cl.1
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/svn2cl.1	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/svn2cl.1	(revision 1)
@@ -0,0 +1,208 @@
+.\" Copyright (C) 2005, 2006, 2007, 2008 Arthur de Jong
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in
+.\"    the documentation and/or other materials provided with the
+.\"    distribution.
+.\" 3. The name of the author may not be used to endorse or promote
+.\"    products derived from this software without specific prior
+.\"    written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.TH "svn2cl" "1" "Apr 2008" "Version 0.11" "User Commands"
+.nh
+.SH "NAME"
+svn2cl - Create a ChangeLog from a subversion log.
+.SH "SYNOPSIS"
+.B svn2cl
+.RI [ OPTION ]...
+.RI [ PATH ]...
+
+.SH "DESCRIPTION"
+\fBsvn2cl\fP generates a classic GNU-style ChangeLog from the log messages in a subversion repository.
+It acts as a wrapper around the '\fBsvn log\fP' command, parsing the XML output with an XSLT stylesheet.
+Alternatively it can generate HTML output intended for use with the \fBsvn2html.css\fP style sheet that comes with \fBsvn2cl\fP.
+
+In addition to its own options, it accepts and passes along most svn log options; see '\fBsvn help log\fP' for a list of those and their documentation.
+If PATH is not given, \fBsvn2cl\fP will run svn log on the current directory, so it should do the right thing when run from the top of a subversion checkout of the project.
+
+.TP
+\fB\-\-strip\-prefix\fR=\fINAME\fR
+Strip \fINAME\fR from the first part of all file names (e.g. project/trunk).
+By defaults the current path inside the repository is stripped.
+
+.TP
+\fB\-\-linelen\fR=\fINUM\fR
+Wrap lines at \fINUM\fR characters.
+By default, lines are wrapped at 75 characters.
+This option is ignored when the \-\-html option is specified.
+
+.TP
+\fB\-\-group\-by\-day\fR
+This option causes all commit messages to be grouped by day, as long as all the changes are by the same author.
+By default each message is listed separately with its own timestamp.
+
+.TP
+\fB\-\-separate\-daylogs\fR
+Include a blank line between log entries when they are grouped by day.
+Only useful with the \fB\-\-group\-by\-day\fR option.
+This option is ignored when the \-\-html option is specified, edit \fBsvn2html.css\fP to tune the layout.
+
+.TP
+\fB\-i\fR, \fB\-\-include\-rev\fR
+Include the subversion revision number in the ChangeLog.
+If the \-\-html option is specified this is implied, edit \fBsvn2html.css\fP to turn it off.
+
+.TP
+\fB\-a\fR, \fB\-\-include\-actions\fR
+Add action labels [ADD], [DEL] and [CPY] tags to files to show the operation
+that is performned on the files.
+
+.TP
+\fB\-\-break\-before\-msg\fR[=\fINUM\fR]
+Add a line break (or multiple line breadks) between the paths and the log message.
+If the \-\-html option is specified this option is ignored, edit \fBsvn2html.css\fP to set spacing.
+
+.TP
+\fB\-\-reparagraph\fR
+Newlines inside paragraphs are ignored and paragraphs are re-wrapped.
+Paragraphs are separated by empty lines.
+
+.TP
+\fB\-\-title\fR=\fINAME\fR
+If outputting an HTML file the \fINAME\fR is used as the title.
+This option is ignored for normal text output.
+
+.TP
+\fB\-\-revision\-link\fR=\fINAME\fR
+This option is used to generate links from the revision numbers in the generated HTML file.
+If \fINAME\fR contains two hashes '\fB##\fP' that part will be replaced by the revision number, otherwise the revision number will be appended to \fINAME\fR.
+Only the first occurrence of '\fB##\fP' will be replaced.
+.br
+This option is ignored for normal text output.
+
+.TP
+\fB\-\-ignore\-message\-starting\fR=\fISTRING\fR
+Any log messages that start with the specified \fISTRING\fR are ignored and will not show up in the output.
+The STRING comparison is case sensitive.
+
+.TP
+\fB\-o\fR, \fB\-f\fR, \fB\-\-output\fR=\fIFILE\fR, \fB\-\-file\fR=\fIFILE\fR
+Output ChangeLog to \fIFILE\fR instead of the default \fBChangeLog\fP (or \fBChangeLog.html\fP for HTML output).
+
+.TP
+\fB\-\-stdout\fR
+Output ChangeLog to stdout instead of to a file.
+
+.TP
+\fB\-\-authors\fR=\fIFILE\fR
+The \fIFILE\fR is used to map author names as exported by svn to full names.
+See the section on AUTHORS FILES below for more information.
+.br
+Note that the \-\-authors option can have poor performance in some cases.
+
+.TP
+\fB\-\-html\fR
+Generate an HTML file containing a ChangeLog instead of the default text ChangeLog file.
+This feature is still experimental.
+The \fBsvn2html.css\fP file that is included in the distribution can be used to format the HTML.
+
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Show short summary of options.
+
+.TP
+\fB\-V\fR, \fB\-\-version\fR
+Show version of program.
+
+.PP
+Optional PATH arguments and the following options are passed directly to the '\fBsvn \-\-xml log\fP' command:
+\fB\-r\fR, \fB\-\-revision\fR, \fB\-\-targets\fR, \fB\-\-stop\-on\-copy\fR, \fB\-\-username\fR, \fB\-\-password\fR, \fB\-\-no\-auth\-cache\fR, \fB\-\-non\-interactive\fR, \fB\-\-config\-dir\fR and \fB\-\-limit\fR.
+.br
+See '\fBsvn help log\fP' for more information on these options.
+
+.SH "AUTHORS FILES"
+
+An authors file is basically an XML file that should look something like:
+.ft B
+    <?xml version="1.0" encoding="utf\-8"?>
+    <authors>
+      <author uid="arthur">
+        Arthur de Jong &lt;arthur@ch.tudelft.nl&gt;
+      </author>
+    </authors>
+.ft R
+.br
+svn2cl searches for <author> tags with the specified uid attribute.
+The content from the author tag is substituted for the author name.
+
+The <author> tag may also contain XML child tags which can be useful for embedding HTML into the result.
+For this to work namespace information should be included for HTML output:
+.ft B
+    <?xml version="1.0" encoding="utf\-8"?>
+    <authors xmlns:html="http://www.w3.org/1999/xhtml">
+      <author uid="arthur">
+        Arthur de Jong &lt;<html:b>arthur@ch.tudelft.nl</html:b>&gt;
+      </author>
+    </authors>
+.ft R
+.br
+The svn2cl distribution contains a sample authors.xml file.
+
+As a bonus a plain text authors file that looks like the following is automatically converted to the XML representation:
+.ft B
+    arthur:Arthur de Jong <arthur@ch.tudelft.nl>
+.ft R
+
+.SH "NOTES"
+
+Note that the default revison range for \fBsvn log\fP is BASE:1.
+This means that \fBsvn2cl\fP will not always include the most recent revisons
+of the repository. Either run '\fBsvn update\fP' before running \fBsvn2cl\fP
+or pass '\fB\-r HEAD:1\fP'.
+
+.SH "EXAMPLES"
+
+Run svn log recursively on the current directory and generate a text ChangeLog file in the current directory for the entire log history:
+.ft B
+    svn2cl
+.ft R
+
+Output the changes from the last week, while including revision numbers in the ChangeLog:
+.ft B
+    svn2cl \-i \-r "HEAD:{`date \-d '7 days ago' '+%F %T'`}"
+.ft R
+.br
+(actually subversion will include the first revision before the specified period)
+
+Generate an HTML changelog for svn://svn.example.com/project/trunk, removing "project/trunk" from the file names in the changelog.
+Group all commits per day into one ChangeLog entry and only include changes from 2005:
+.ft B
+    svn2cl \-\-html \-\-strip\-prefix=project/trunk \-\-group\-by\-day \e
+           \-r '{2006\-01\-01}:{2005\-01\-01}' \e
+           svn://svn.example.com/project/trunk
+.ft R
+
+.SH "SEE ALSO"
+.BR '\fBsvn\ help\ log\fP'
+
+.SH "COPYRIGHT"
+Copyright \(co 2005, 2006, 2007, 2008 Arthur de Jong <arthur@ch.tudelft.nl>.
+.br
+This is free software; see the license for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Index: /issm/trunk/scripts/svn2cl-0.11/svn2cl.sh
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/svn2cl.sh	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/svn2cl.sh	(revision 1)
@@ -0,0 +1,334 @@
+#!/bin/sh
+
+# svn2cl.sh - front end shell script for svn2cl.xsl, calls xsltproc
+#             with the correct parameters
+#
+# Copyright (C) 2005, 2006, 2007, 2008 Arthur de Jong.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. The name of the author may not be used to endorse or promote
+#    products derived from this software without specific prior
+#    written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# exit on any failures
+set -e
+# report unset variables
+set -u
+
+# svn2cl version
+VERSION="0.11"
+
+# set default parameters
+PWD=`pwd`
+STRIPPREFIX="AUTOMATICALLY-DETERMINED"
+LINELEN=75
+GROUPBYDAY="no"
+INCLUDEREV="no"
+BREAKBEFOREMSG="no"
+REPARAGRAPH="no"
+SEPARATEDAYLOGS="no"
+ACTIONS="no"
+CHANGELOG=""
+OUTSTYLE="cl"
+SVNLOGCMD="svn --verbose --xml log"
+SVNINFOCMD="svn info"
+AUTHORSFILE=""
+IGNORE_MESSAGE_STARTING=""
+TITLE="ChangeLog"
+REVISION_LINK="#r"
+TMPFILES=""
+AWK="awk"
+
+# do command line checking
+prog=`basename $0`
+while [ $# -gt 0 ]
+do
+  case "$1" in
+    --strip-prefix)
+      STRIPPREFIX="$2"
+      shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; }
+      ;;
+    --strip-prefix=*)
+      STRIPPREFIX=`echo "$1" | sed 's/^--[a-z-]*=//'`
+      shift
+      ;;
+    --linelen)
+      LINELEN="$2";
+      shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; }
+      ;;
+    --linelen=*)
+      LINELEN=`echo "$1" | sed 's/^--[a-z-]*=//'`
+      shift
+      ;;
+    --group-by-day)
+      GROUPBYDAY="yes";
+      shift
+      ;;
+    --separate-daylogs)
+      SEPARATEDAYLOGS="yes"
+      shift
+      ;;
+    -i|--include-rev)
+      INCLUDEREV="yes";
+      shift
+      ;;
+    -a|--include-actions)
+      ACTIONS="yes"
+      shift
+      ;;
+    --break-before-msg|--breaks-before-msg)
+      # FIXME: if next argument is numeric use that as a parameter
+      BREAKBEFOREMSG="yes"
+      shift
+      ;;
+    --break-before-msg=*|--breaks-before-msg=*)
+      BREAKBEFOREMSG=`echo "$1" | sed 's/^--[a-z-]*=//'`
+      shift
+      ;;
+    --reparagraph)
+      REPARAGRAPH="yes"
+      shift
+      ;;
+    --title)
+      TITLE="$2"
+      shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; }
+      ;;
+    --title=*)
+      TITLE=`echo "$1" | sed 's/^--[a-z-]*=//'`
+      shift
+      ;;
+    --revision-link)
+      REVISION_LINK="$2"
+      shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; }
+      ;;
+    --revision-link=*)
+      REVISION_LINK=`echo "$1" | sed 's/^--[a-z-]*=//'`
+      shift
+      ;;
+    --ignore-message-starting)
+      IGNORE_MESSAGE_STARTING="$2"
+      shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; }
+      ;;
+    --ignore-message-starting=*)
+      IGNORE_MESSAGE_STARTING=`echo "$1" | sed 's/^--[a-z-]*=//'`
+      shift
+      ;;
+    -f|--file|-o|--output)
+      CHANGELOG="$2"
+      shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; }
+      ;;
+    --file=*|--output=*)
+      CHANGELOG=`echo "$1" | sed 's/^--[a-z-]*=//'`
+      shift
+      ;;
+    --stdout)
+      CHANGELOG="-"
+      shift
+      ;;
+    --authors)
+      AUTHORSFILE="$2"
+      shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; }
+      ;;
+    --authors=*)
+      AUTHORSFILE=`echo "$1" | sed 's/^--[a-z-]*=//'`
+      shift
+      ;;
+    --html)
+      OUTSTYLE="html"
+      shift
+      ;;
+    -r|--revision|--targets|--limit)
+      # add these as extra options to the command (with argument)
+      arg=`echo "$2" | sed "s/'/'\"'\"'/g"`
+      SVNLOGCMD="$SVNLOGCMD $1 '$arg'"
+      shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; }
+      ;;
+    --username|--password|--config-dir)
+      # add these as extra options to the command (with argument)
+      arg=`echo "$2" | sed "s/'/'\"'\"'/g"`
+      SVNLOGCMD="$SVNLOGCMD $1 '$arg'"
+      # also add to svn info command
+      SVNINFOCMD="$SVNINFOCMD $1 '$arg'"
+      shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; }
+      ;;
+    --revision=*|--targets=*|--limit=*)
+      # these are single argument versions of the above
+      arg=`echo "$1" | sed "s/'/'\"'\"'/g"`
+      SVNLOGCMD="$SVNLOGCMD '$arg'"
+      shift
+      ;;
+    --username=*|--password=*|--config-dir=*)
+      # these are single argument versions of the above
+      arg=`echo "$1" | sed "s/'/'\"'\"'/g"`
+      SVNLOGCMD="$SVNLOGCMD '$arg'"
+      # also add to svn info command
+      SVNINFOCMD="$SVNINFOCMD '$arg'"
+      shift
+      ;;
+    --stop-on-copy)
+      # add these as simple options
+      SVNLOGCMD="$SVNLOGCMD $1"
+      shift
+      ;;
+    --no-auth-cache|--non-interactive)
+      # add these as simple options
+      SVNLOGCMD="$SVNLOGCMD $1"
+      # also add to svn info command
+      SVNINFOCMD="$SVNINFOCMD $1"
+      shift
+      ;;
+    -V|--version)
+      echo "$prog $VERSION";
+      echo "Written by Arthur de Jong."
+      echo ""
+      echo "Copyright (C) 2005, 2006, 2007 Arthur de Jong."
+      echo "This is free software; see the source for copying conditions.  There is NO"
+      echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+      exit 0
+      ;;
+    -h|--help)
+      echo "Usage: $prog [OPTION]... [PATH]..."
+      echo "Generate a ChangeLog from a subversion repository."
+      echo ""
+      echo "  --strip-prefix=NAME  prefix to strip from all entries, defaults"
+      echo "                       path inside the repository"
+      echo "  --linelen=NUM        maximum length of an output line"
+      echo "  --group-by-day       group changelog entries by day"
+      echo "  --separate-daylogs   put a blank line between grouped by day entries"
+      echo "  -i, --include-rev    include revision numbers"
+      echo "  -a, --include-actions     add [ADD], [DEL] and [CPY] tags to files"
+      echo "  --break-before-msg[=NUM]  add a line break (or multiple breaks)"
+      echo "                       between the paths and the log message"
+      echo "  --reparagraph        rewrap lines inside a paragraph"
+      echo "  --title=NAME         title used in html file"
+      echo "  --revision-link=NAME link revision numbers in html output"
+      echo "  --ignore-message-starting=STRING"
+      echo "                       ignore messages starting with the string"
+      echo "  -o, --output=FILE    output to FILE instead of ChangeLog"
+      echo "  -f, --file=FILE      alias for -o, --output"
+      echo "  --stdout             output to stdout instead of ChangeLog"
+      echo "  --authors=FILE       file to read for authors"
+      echo "  --html               output as html instead of plain text"
+      echo "  -h, --help           display this help and exit"
+      echo "  -V, --version        output version information and exit"
+      echo ""
+      echo "PATH arguments and the following options are passed to the svn log"
+      echo "command: -r, --revision, --targets --stop-on-copy, --username,"
+      echo "--password, --no-auth-cache, --non-interactive, --config-dir and"
+      echo "--limit (see 'svn help log' for more information)."
+      exit 0
+      ;;
+    -*)
+      echo "$prog: invalid option -- $1"
+      echo "Try '$prog --help' for more information."
+      exit 1
+      ;;
+    *)
+      arg=`echo "$1" | sed "s/'/'\"'\"'/g"`
+      SVNLOGCMD="$SVNLOGCMD '$arg'"
+      SVNINFOCMD="$SVNINFOCMD '$arg'"
+      shift
+      ;;
+  esac
+done
+
+# find the directory that this script resides in
+prog="$0"
+while [ -h "$prog" ]
+do
+  dir=`dirname "$prog"`
+  prog=`ls -ld "$prog" | sed "s/^.*-> \(.*\)/\1/;/^[^/]/s,^,$dir/,"`
+done
+dir=`dirname "$prog"`
+dir=`cd "$dir" && pwd`
+XSL="$dir/svn2${OUTSTYLE}.xsl"
+
+# check if the authors file is formatted as a legacy
+# colon separated file
+if [ -n "$AUTHORSFILE" ] && \
+    egrep '^(#.*|[a-zA-Z0-9].*:)' "$AUTHORSFILE" > /dev/null 2>/dev/null
+then
+  # create a temporary file
+  tmpfile=`mktemp -t svn2cl.XXXXXX 2> /dev/null || tempfile -s .svn2cl 2> /dev/null || echo "$AUTHORSFILE.$$.xml"`
+  arg=`echo "$tmpfile" | sed "s/'/'\"'\"'/g"`
+  TMPFILES="$TMPFILES '$arg'"
+  # generate an authors.xml file on the fly
+  echo '<authors>' > "$tmpfile"
+  sed -n 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g;s|^\([a-zA-Z0-9][^:]*\):\(.*\)$| <author uid="\1">\2</author>|p' \
+      < "$AUTHORSFILE"  >> "$tmpfile"
+  echo '</authors>' >> "$tmpfile"
+  AUTHORSFILE="$tmpfile"
+fi
+
+# find the absolute path of the authors file
+# (otherwise xsltproc will find the file relative to svn2cl.xsl)
+pwd=`pwd`
+AUTHORSFILE=`echo "$AUTHORSFILE" | sed "/^[^/]/s|^|$pwd/|"`
+
+# if no filename was specified, make one up
+if [ -z "$CHANGELOG" ]
+then
+  CHANGELOG="ChangeLog"
+  if [ "$OUTSTYLE" != "cl" ]
+  then
+    CHANGELOG="$CHANGELOG.$OUTSTYLE"
+  fi
+fi
+
+# try to determin a prefix to strip from all paths
+if [ "$STRIPPREFIX" = "AUTOMATICALLY-DETERMINED" ]
+then
+  STRIPPREFIX=`LANG=C eval "$SVNINFOCMD" 2> /dev/null | $AWK '/^URL:/{url=$2} /^Repository Root:/{root=$3} END{if(root){print substr(url,length(root)+2)}else{n=split(url,u,"/");print u[n]}}'`
+  STRIPPREFIX=`echo "$STRIPPREFIX" | sed 's/%20/ /g'`
+fi
+
+# redirect stdout to the changelog file if needed
+if [ "x$CHANGELOG" != "x-" ]
+then
+  exec > "$CHANGELOG"
+fi
+
+# actually run the command we need
+eval "$SVNLOGCMD" | \
+  xsltproc --stringparam strip-prefix "$STRIPPREFIX" \
+           --stringparam linelen "$LINELEN" \
+           --stringparam groupbyday "$GROUPBYDAY" \
+           --stringparam separate-daylogs "$SEPARATEDAYLOGS" \
+           --stringparam include-rev "$INCLUDEREV" \
+           --stringparam include-actions "$ACTIONS" \
+           --stringparam breakbeforemsg "$BREAKBEFOREMSG" \
+           --stringparam reparagraph "$REPARAGRAPH" \
+           --stringparam authorsfile "$AUTHORSFILE" \
+           --stringparam title "$TITLE" \
+           --stringparam revision-link "$REVISION_LINK" \
+           --stringparam ignore-message-starting "$IGNORE_MESSAGE_STARTING" \
+           --nowrite \
+           --nomkdir \
+           --nonet \
+           "$XSL" -
+
+# clean up temporary files
+[ -n "$TMPFILES" ] && eval "rm -f $TMPFILES"
+
+# we're done (the previous command could return false)
+exit 0
Index: /issm/trunk/scripts/svn2cl-0.11/svn2cl.xsl
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/svn2cl.xsl	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/svn2cl.xsl	(revision 1)
@@ -0,0 +1,496 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+   svn2cl.xsl - xslt stylesheet for converting svn log to a normal
+                changelog
+
+   version 0.11
+
+   Usage (replace ++ with two minus signs which aren't allowed
+   inside xml comments):
+     svn ++verbose ++xml log | \
+       xsltproc ++stringparam strip-prefix `basename $(pwd)` \
+                ++stringparam linelen 75 \
+                ++stringparam groupbyday yes \
+                ++stringparam separate-daylogs yes \
+                ++stringparam include-rev yes \
+                ++stringparam include-actions yes \
+                ++stringparam breakbeforemsg yes/2 \
+                ++stringparam reparagraph yes \
+                ++stringparam authorsfile FILE \
+                ++stringparam ignore-message-starting \
+                svn2cl.xsl - > ChangeLog
+
+   This file is based on several implementations of this conversion
+   that I was not completely happy with and some other common
+   xslt constructs found on the web.
+
+   Copyright (C) 2004, 2005, 2006, 2007 Arthur de Jong.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+   3. The name of the author may not be used to endorse or promote
+      products derived from this software without specific prior
+      written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+   IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+   IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+   IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+-->
+
+<!DOCTYPE xsl:stylesheet [
+ <!ENTITY tab "&#9;">
+ <!ENTITY newl "&#38;#xA;">
+ <!ENTITY space "&#32;">
+]>
+
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output
+   method="text"
+   encoding="utf-8"
+   media-type="text/plain"
+   omit-xml-declaration="yes"
+   standalone="yes"
+   indent="no" />
+
+ <xsl:strip-space elements="*" />
+
+ <!-- the prefix of pathnames to strip -->
+ <xsl:param name="strip-prefix" select="'/'" />
+
+ <!-- the length of a line to wrap messages at -->
+ <xsl:param name="linelen" select="75" />
+
+ <!-- whether entries should be grouped by day -->
+ <xsl:param name="groupbyday" select="'no'" />
+
+ <!-- whether to seperate log messages by empty lines -->
+ <xsl:param name="separate-daylogs" select="'no'" />
+
+ <!-- whether a revision number should be included -->
+ <xsl:param name="include-rev" select="'no'" />
+
+ <!-- whether aaction labels should be added to files -->
+ <xsl:param name="include-actions" select="'no'" />
+
+ <!-- whether the log message should start on a new line -->
+ <xsl:param name="breakbeforemsg" select="'no'" />
+
+ <!-- whether the message should be rewrapped within one paragraph -->
+ <xsl:param name="reparagraph" select="'no'" />
+
+ <!-- whether certain messages should be ignored -->
+ <xsl:param name="ignore-message-starting" select="''" />
+
+ <!-- location of authors file if any -->
+ <xsl:param name="authorsfile" select="''" />
+ <xsl:key name="author-lookup" match="author" use="@uid" />
+ <xsl:variable name="authors-top" select="document($authorsfile)/authors" />
+
+ <!-- match the topmost log entry -->
+ <xsl:template match="log">
+  <xsl:choose>
+   <xsl:when test="$ignore-message-starting != ''">
+    <!-- only handle logentries with don't contain the string -->
+    <xsl:apply-templates select="logentry[not(starts-with(msg,$ignore-message-starting))]" />
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:apply-templates select="logentry" />
+   </xsl:otherwise>
+  </xsl:choose>
+  <!-- add newlines at the end of the changelog -->
+  <xsl:text>&newl;</xsl:text>
+ </xsl:template>
+
+ <!-- format one entry from the log -->
+ <xsl:template match="logentry">
+  <xsl:choose>
+   <!-- if we're grouping we should omit some headers -->
+   <xsl:when test="$groupbyday='yes'">
+    <!-- save log entry number -->
+    <xsl:variable name="pos" select="position()" />
+    <!-- fetch previous entry's date -->
+    <xsl:variable name="prevdate">
+     <xsl:apply-templates select="../logentry[position()=(($pos)-1)]/date" />
+    </xsl:variable>
+    <!-- fetch previous entry's author -->
+    <xsl:variable name="prevauthor">
+     <xsl:value-of select="normalize-space(../logentry[position()=(($pos)-1)]/author)" />
+    </xsl:variable>
+    <!-- fetch this entry's date -->
+    <xsl:variable name="date">
+     <xsl:apply-templates select="date" />
+    </xsl:variable>
+    <!-- fetch this entry's author -->
+    <xsl:variable name="author">
+     <xsl:value-of select="normalize-space(author)" />
+    </xsl:variable>
+    <!-- check if header is changed -->
+    <xsl:if test="($prevdate!=$date) or ($prevauthor!=$author)">
+     <!-- add newline -->
+     <xsl:if test="not(position()=1)">
+      <xsl:text>&newl;</xsl:text>
+     </xsl:if>
+     <!-- date -->
+     <xsl:value-of select="$date" />
+     <!-- two spaces -->
+     <xsl:text>&space;&space;</xsl:text>
+     <!-- author's name -->
+     <xsl:apply-templates select="author" />
+     <!-- two newlines -->
+     <xsl:text>&newl;</xsl:text>
+     <xsl:if test="$separate-daylogs!='yes'"><xsl:text>&newl;</xsl:text></xsl:if>
+    </xsl:if>
+   </xsl:when>
+   <!-- write the log header -->
+   <xsl:otherwise>
+    <!-- add newline -->
+    <xsl:if test="not(position()=1)">
+     <xsl:text>&newl;</xsl:text>
+    </xsl:if>
+    <!-- date -->
+    <xsl:apply-templates select="date" />
+    <!-- two spaces -->
+    <xsl:text>&space;&space;</xsl:text>
+    <!-- author's name -->
+    <xsl:apply-templates select="author" />
+    <!-- two newlines -->
+    <xsl:text>&newl;&newl;</xsl:text>
+   </xsl:otherwise>
+  </xsl:choose>
+  <!-- get paths string -->
+  <xsl:variable name="paths">
+   <xsl:apply-templates select="paths" />
+  </xsl:variable>
+  <!-- get revision number -->
+  <xsl:variable name="rev">
+   <xsl:if test="$include-rev='yes'">
+    <xsl:text>[r</xsl:text>
+    <xsl:value-of select="@revision" />
+    <xsl:text>]&space;</xsl:text>
+   </xsl:if>
+  </xsl:variable>
+  <!-- trim trailing newlines -->
+  <xsl:variable name="msg">
+   <!-- add a line break before the log message -->
+   <xsl:choose>
+    <xsl:when test="$breakbeforemsg='yes'">
+     <xsl:text>&newl;</xsl:text>
+    </xsl:when>
+    <xsl:when test="number($breakbeforemsg)&gt;0">
+     <xsl:call-template name="newlines">
+      <xsl:with-param name="count" select="number($breakbeforemsg)" />
+     </xsl:call-template>
+    </xsl:when>
+   </xsl:choose>
+   <xsl:call-template name="trim-newln">
+    <xsl:with-param name="txt" select="msg" />
+   </xsl:call-template>
+  </xsl:variable>
+  <!-- add newline here if separate-daylogs is in effect -->
+  <xsl:if test="$groupbyday='yes' and $separate-daylogs='yes'"><xsl:text>&newl;</xsl:text></xsl:if>
+  <!-- first line is indented (other indents are done in wrap template) -->
+  <xsl:text>&tab;*&space;</xsl:text>
+  <!-- set up the text to wrap -->
+  <xsl:variable name="txt">
+   <xsl:value-of select="$rev" />
+   <xsl:if test="$paths!=''">
+    <xsl:value-of select="concat($paths,':&space;')" />
+   </xsl:if>
+   <xsl:value-of select="$msg" />
+  </xsl:variable>
+  <!-- print the paths and message nicely wrapped -->
+  <xsl:call-template name="wrap">
+   <xsl:with-param name="txt" select="$txt" />
+  </xsl:call-template>
+ </xsl:template>
+
+ <!-- format date -->
+ <xsl:template match="date">
+  <xsl:variable name="date" select="normalize-space(.)" />
+  <!-- output date part -->
+  <xsl:value-of select="substring($date,1,10)" />
+  <!-- output time part -->
+  <xsl:if test="$groupbyday!='yes'">
+   <xsl:text>&space;</xsl:text>
+   <xsl:value-of select="substring($date,12,5)" />
+  </xsl:if>
+ </xsl:template>
+
+ <!-- format author -->
+ <xsl:template match="author">
+  <xsl:variable name="uid" select="normalize-space(.)" />
+  <!-- try to lookup author in authorsfile -->
+  <xsl:choose>
+   <xsl:when test="$authorsfile!=''">
+    <xsl:for-each select="$authors-top">
+     <xsl:variable name="author" select="key('author-lookup',$uid)" />
+     <!-- present result -->
+     <xsl:choose>
+      <xsl:when test="string($author/.)">
+       <xsl:apply-templates select="$author/node()" mode="copy" />
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:value-of select="$uid" />
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:for-each>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:value-of select="$uid" />
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+ <!-- copy but normalize text -->
+ <xsl:template match="text()" mode="copy">
+  <xsl:value-of select="normalize-space(.)" />
+ </xsl:template>
+
+ <!-- simple copy template -->
+ <xsl:template match="@*|node()" mode="copy">
+  <xsl:copy>
+   <xsl:apply-templates select="@*|node()" mode="copy" />
+  </xsl:copy>
+ </xsl:template>
+
+ <!-- present a list of paths names -->
+ <xsl:template match="paths">
+  <xsl:choose>
+   <!-- only handle paths that begin with the path and strip the path -->
+   <xsl:when test="$strip-prefix != ''">
+    <!-- if strip-prefix does not start with a slash, prepend it -->
+    <xsl:variable name="tmpstrip1">
+     <xsl:choose>
+      <xsl:when test="starts-with($strip-prefix,'/')">
+       <xsl:value-of select="$strip-prefix" />
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:value-of select="concat('/',$strip-prefix)" />
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    <!-- strip trailing slash from strip-prefix -->
+    <xsl:variable name="tmpstrip2">
+     <xsl:choose>
+      <xsl:when test="substring($tmpstrip1,string-length($tmpstrip1),1)='/'">
+       <xsl:value-of select="substring($tmpstrip1,1,string-length($tmpstrip1)-1)" />
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:value-of select="$tmpstrip1" />
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    <!-- filter on all entries within directory -->
+    <xsl:for-each select="path[starts-with(concat(normalize-space(.),'/'),concat($tmpstrip2,'/'))]">
+     <xsl:sort select="normalize-space(.)" data-type="text" />
+     <!-- unless we are the first entry, add a comma -->
+     <xsl:if test="not(position()=1)">
+      <xsl:text>,&space;</xsl:text>
+     </xsl:if>
+     <!-- print the path name -->
+     <xsl:call-template name="printpath">
+      <xsl:with-param name="path" select="substring(normalize-space(.),string-length($strip-prefix)+3)" />
+     </xsl:call-template>
+     <!-- add the action flag -->
+     <xsl:if test="$include-actions='yes'">
+      <xsl:apply-templates select="." mode="action"/>
+     </xsl:if>
+    </xsl:for-each>
+   </xsl:when>
+   <!-- print a simple list of all paths -->
+   <xsl:otherwise>
+    <xsl:for-each select="path">
+     <xsl:sort select="normalize-space(.)" data-type="text" />
+     <!-- unless we are the first entry, add a comma -->
+     <xsl:if test="not(position()=1)">
+      <xsl:text>,&space;</xsl:text>
+     </xsl:if>
+     <!-- print the path name -->
+     <xsl:value-of select="normalize-space(.)" />
+     <!-- add the action flag -->
+     <xsl:if test="$include-actions='yes'">
+      <xsl:apply-templates select="." mode="action"/>
+     </xsl:if>
+    </xsl:for-each>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="path" mode="action">
+  <xsl:choose>
+   <xsl:when test="@action='D'">
+    <xsl:text>[DEL]</xsl:text>
+   </xsl:when>
+   <xsl:when test="@copyfrom-path">
+    <xsl:text>[CPY]</xsl:text>
+   </xsl:when>
+   <xsl:when test="@action='D'">
+    <xsl:text>[ADD]</xsl:text>
+   </xsl:when>
+  </xsl:choose>
+ </xsl:template>
+
+ <!-- transform path to something printable -->
+ <xsl:template name="printpath">
+  <!-- fetch the pathname -->
+  <xsl:param name="path" />
+  <!-- strip leading slash -->
+  <xsl:variable name="tmp1">
+   <xsl:choose>
+    <xsl:when test="starts-with($path,'/')">
+     <xsl:value-of select="substring($path,2)" />
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$path" />
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:variable>
+  <!-- translate empty string to dot -->
+  <xsl:choose>
+   <xsl:when test="$tmp1 = ''">
+    <xsl:text>.</xsl:text>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:value-of select="$tmp1" />
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+ <!-- string-wrapping template -->
+ <xsl:template name="wrap">
+  <xsl:param name="txt" />
+  <xsl:variable name="normtxt" select="normalize-space($txt)" />
+  <xsl:choose>
+   <xsl:when test="contains($txt,'&newl;')">
+     <!-- text contains newlines, do the first line -->
+     <xsl:call-template name="wrap">
+      <xsl:with-param name="txt" select="substring-before($txt,'&newl;')" />
+     </xsl:call-template>
+     <!-- print tab -->
+     <xsl:text>&tab;&space;&space;</xsl:text>
+     <!-- wrap the rest of the text -->
+     <xsl:call-template name="wrap">
+      <xsl:with-param name="txt" select="substring-after($txt,'&newl;')" />
+     </xsl:call-template>
+   </xsl:when>
+   <xsl:when test="(string-length($normtxt) &lt; (($linelen)-9)) or not(contains($normtxt,' '))">
+    <!-- this is easy, nothing to do -->
+    <xsl:value-of select="$normtxt" />
+    <!-- add newline -->
+    <xsl:text>&newl;</xsl:text>
+   </xsl:when>
+   <xsl:otherwise>
+    <!-- find the first line -->
+    <xsl:variable name="tmp" select="substring($normtxt,1,(($linelen)-9))" />
+    <xsl:variable name="line">
+     <xsl:choose>
+      <!-- if our attempt contains spaces wrap on that -->
+      <xsl:when test="contains($tmp,' ')">
+       <xsl:call-template name="find-line">
+        <xsl:with-param name="txt" select="$tmp" />
+       </xsl:call-template>
+      </xsl:when>
+      <!-- otherwise use the first non-space characters from the text -->
+      <xsl:otherwise>
+       <xsl:value-of select="substring-before($normtxt,' ')" />
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    <!-- print line -->
+    <xsl:value-of select="$line" />
+    <!-- print newline and tab -->
+    <xsl:text>&newl;&tab;&space;&space;</xsl:text>
+    <!-- wrap the rest of the text -->
+    <xsl:call-template name="wrap">
+     <xsl:with-param name="txt" select="normalize-space(substring($normtxt,string-length($line)+1))" />
+    </xsl:call-template>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+ <!-- template to trim line to contain space as last char -->
+ <xsl:template name="find-line">
+  <xsl:param name="txt" />
+  <xsl:choose>
+   <xsl:when test="substring($txt,string-length($txt),1)=' '">
+    <xsl:value-of select="substring($txt,1,string-length($txt)-1)" />
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:call-template name="find-line">
+     <xsl:with-param name="txt" select="substring($txt,1,string-length($txt)-1)" />
+    </xsl:call-template>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+ <!-- template to trim trailing and starting newlines -->
+ <xsl:template name="trim-newln">
+  <xsl:param name="txt" />
+  <xsl:choose>
+   <!-- find starting newlines -->
+   <xsl:when test="substring($txt,1,1) = '&newl;'">
+    <xsl:call-template name="trim-newln">
+     <xsl:with-param name="txt" select="substring($txt,2)" />
+    </xsl:call-template>
+   </xsl:when>
+   <!-- find trailing newlines -->
+   <xsl:when test="substring($txt,string-length($txt),1) = '&newl;'">
+    <xsl:call-template name="trim-newln">
+     <xsl:with-param name="txt" select="substring($txt,1,string-length($txt)-1)" />
+    </xsl:call-template>
+   </xsl:when>
+   <!-- if the message has paragrapgs, find the first one -->
+   <xsl:when test="$reparagraph='yes' and contains($txt,'&newl;&newl;')">
+     <!-- remove newlines from first paragraph -->
+     <xsl:value-of select="normalize-space(substring-before($txt,'&newl;&newl;'))" />
+     <!-- paragraph separator -->
+     <xsl:text>&newl;&newl;</xsl:text>
+     <!-- do the rest of the text -->
+     <xsl:call-template name="trim-newln">
+      <xsl:with-param name="txt" select="substring-after($txt,'&newl;&newl;')" />
+     </xsl:call-template>
+   </xsl:when>
+   <!-- remove more single newlines -->
+   <xsl:when test="$reparagraph='yes'">
+    <xsl:value-of select="normalize-space($txt)" />
+   </xsl:when>
+   <!-- no newlines found, we're done -->
+   <xsl:otherwise>
+    <xsl:value-of select="$txt" />
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+ <!-- insert a number of newlines -->
+ <xsl:template name="newlines">
+  <xsl:param name="count" />
+  <xsl:text>&newl;</xsl:text>
+  <xsl:if test="$count&gt;1">
+   <xsl:call-template name="newlines">
+    <xsl:with-param name="count" select="($count)-1" />
+   </xsl:call-template>
+  </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
Index: /issm/trunk/scripts/svn2cl-0.11/svn2html.css
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/svn2html.css	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/svn2html.css	(revision 1)
@@ -0,0 +1,79 @@
+body {
+  background-color: white;
+  color: black;
+  margin-left: 1.5em;
+  margin-right: 1.5em;
+  margin-top: 1.5em;
+  margin-bottom: 1em;  
+}
+
+ul.changelog_entries {
+  margin-left: 0.7em;
+  margin-right: 0.7em;
+  padding-left: 0.7em;
+  padding-right: 0.7em;
+  padding-bottom: 0.7em;
+  background: #fefefe;
+  border: 1px dashed #88aa88;
+}
+
+li.changelog_entry {
+  list-style-type: none;
+  margin-left: 0px;
+  padding-left: 0px;
+  margin-top: 0.8em;
+  border-top: 1px solid #dddddd;
+  background: #f8f8f8;
+}
+
+li.changelog_change {
+  list-style-type: circle;
+  margin-left: 4em;
+}
+
+span.changelog_date {
+  color: black;
+}
+
+span.changelog_author {
+  color: #111188;
+}
+
+.changelog_revision {
+  font-size: 80%;
+  color: #881111;
+  background: #fff4f4;
+}
+
+.changelog_revision a {
+  color: inherit;
+}
+
+.changelog_files {
+  font-size: 80%;
+  font-family: monospace;
+  color: #116611;
+}
+
+.changelog_files:after {
+  content: ':';
+}
+
+.changelog_message {
+  display: block;
+  color: #220000;
+}
+
+p.changelog_footer {
+  margin-top: 1.5em;
+  margin-left: 0.7em;
+  font-style: italic;
+  line-height: 90%;
+  color: gray;
+  font-family: Helvetica, Arial, sans-serif;
+}
+
+p.changelog_footer a {
+  text-decoration: none;
+  color: inherit;
+}
Index: /issm/trunk/scripts/svn2cl-0.11/svn2html.xsl
===================================================================
--- /issm/trunk/scripts/svn2cl-0.11/svn2html.xsl	(revision 1)
+++ /issm/trunk/scripts/svn2cl-0.11/svn2html.xsl	(revision 1)
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+   svn2html.xsl - xslt stylesheet for converting svn log to a normal
+                  changelog fromatted in html
+
+   version 0.11
+
+   Usage (replace ++ with two minus signs):
+     svn ++verbose ++xml log | \
+       xsltproc ++stringparam strip-prefix `basename $(pwd)` \
+                ++stringparam groupbyday yes \
+                ++stringparam authorsfile FILE \
+                ++stringparam title NAME \
+                ++stringparam revision-link NAME \
+                svn2html.xsl - > ChangeLog.html
+
+   This file is partially based on (and includes) svn2cl.xsl.
+
+   Copyright (C) 2005, 2006, 2007 Arthur de Jong.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+   3. The name of the author may not be used to endorse or promote
+      products derived from this software without specific prior
+      written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+   IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+   IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+   IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+-->
+
+<!DOCTYPE xsl:stylesheet [
+ <!ENTITY newl "&#38;#xA;">
+ <!ENTITY space "&#32;">
+]>
+
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns="http://www.w3.org/1999/xhtml">
+
+ <!-- include default formatting templates from svn2cl.xsl -->
+ <xsl:include href="svn2cl.xsl" />
+
+ <xsl:output
+   method="xml"
+   encoding="utf-8"
+   media-type="text/html"
+   omit-xml-declaration="no"
+   standalone="yes"
+   indent="yes"
+   doctype-public="-//W3C//DTD XHTML 1.1//EN"
+   doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
+
+ <!-- title of the report -->
+ <xsl:param name="title" select="'ChangeLog'" />
+
+ <!-- link to use for linking revision numbers -->
+ <xsl:param name="revision-link" select="'#r'" />
+
+ <!-- match toplevel element -->
+ <xsl:template match="log">
+  <html>
+   <head>
+    <title><xsl:value-of select="string($title)" /></title>
+    <link rel="stylesheet" href="svn2html.css" type="text/css" />
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+   </head>
+   <body>
+    <xsl:if test="$title">
+     <h1><xsl:value-of select="string($title)" /></h1>
+    </xsl:if>
+    <ul class="changelog_entries">
+     <xsl:choose>
+      <xsl:when test="$ignore-message-starting != ''">
+       <!-- only handle logentries with don't contain the string -->
+       <xsl:apply-templates select="logentry[not(starts-with(msg,$ignore-message-starting))]" />
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:apply-templates select="logentry" />
+      </xsl:otherwise>
+     </xsl:choose>
+    </ul>
+    <p class="changelog_footer">
+     <xsl:text>Generated by </xsl:text><a href="http://ch.tudelft.nl/~arthur/svn2cl/">svn2cl 0.11</a>
+    </p>
+   </body>
+  </html>
+ </xsl:template>
+
+ <!-- format one entry from the log -->
+ <xsl:template match="logentry">
+  <xsl:choose>
+   <!-- if we're grouping we should omit some headers -->
+   <xsl:when test="$groupbyday='yes'">
+    <!-- save log entry number -->
+    <xsl:variable name="pos" select="position()" />
+    <!-- fetch previous entry's date -->
+    <xsl:variable name="prevdate">
+     <xsl:apply-templates select="../logentry[position()=(($pos)-1)]/date" />
+    </xsl:variable>
+    <!-- fetch previous entry's author -->
+    <xsl:variable name="prevauthor">
+     <xsl:value-of select="normalize-space(../logentry[position()=(($pos)-1)]/author)" />
+    </xsl:variable>
+    <!-- fetch this entry's date -->
+    <xsl:variable name="date">
+     <xsl:apply-templates select="date" />
+    </xsl:variable>
+    <!-- fetch this entry's author -->
+    <xsl:variable name="author">
+     <xsl:value-of select="normalize-space(author)" />
+    </xsl:variable>
+    <!-- check if header is changed -->
+    <xsl:if test="($prevdate!=$date) or ($prevauthor!=$author)">
+     <li class="changelog_entry">
+      <!-- date -->
+      <span class="changelog_date"><xsl:value-of select="$date" /></span>
+      <xsl:text>&space;</xsl:text>
+      <!-- author's name -->
+      <span class="changelog_author"><xsl:apply-templates select="author" /></span>
+     </li>
+    </xsl:if>
+   </xsl:when>
+   <!-- write the log header -->
+   <xsl:otherwise>
+    <li class="changelog_entry">
+     <!-- date -->
+     <span class="changelog_date"><xsl:apply-templates select="date" /></span>
+     <xsl:text>&space;</xsl:text>
+     <!-- author's name -->
+     <span class="changelog_author"><xsl:apply-templates select="author" /></span>
+    </li>
+   </xsl:otherwise>
+  </xsl:choose>
+  <!-- entry -->
+  <li class="changelog_change">
+   <!-- get revision number -->
+   <xsl:variable name="revlink">
+    <xsl:choose>
+     <xsl:when test="contains($revision-link,'##')">
+      <xsl:value-of select="concat(substring-before($revision-link,'##'),@revision,substring-after($revision-link,'##'))" />
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="concat($revision-link,@revision)" />
+     </xsl:otherwise>
+    </xsl:choose>
+   </xsl:variable>
+   <span class="changelog_revision">
+    <a id="r{@revision}" href="{$revlink}">[r<xsl:value-of select="@revision" />]</a>
+   </span>
+   <xsl:text>&space;</xsl:text>
+   <!-- get paths string -->
+   <span class="changelog_files"><xsl:apply-templates select="paths" /></span>
+   <xsl:text>&space;</xsl:text>
+   <!-- get message text -->
+   <xsl:variable name="msg">
+    <xsl:call-template name="trim-newln">
+     <xsl:with-param name="txt" select="msg" />
+    </xsl:call-template>
+   </xsl:variable>
+   <span class="changelog_message">
+    <xsl:call-template name="newlinestobr">
+     <xsl:with-param name="txt" select="$msg" />
+    </xsl:call-template>
+   </span>
+  </li>
+ </xsl:template>
+
+ <!-- template to replace line breaks with <br /> tags -->
+ <xsl:template name="newlinestobr">
+  <xsl:param name="txt" />
+  <xsl:choose>
+   <xsl:when test="contains($txt,'&newl;')">
+    <!-- text contains newlines, do the first line -->
+    <xsl:value-of select="substring-before($txt,'&newl;')" />
+    <!-- print new line -->
+    <br />
+    <!-- wrap the rest of the text -->
+    <xsl:call-template name="newlinestobr">
+     <xsl:with-param name="txt" select="substring-after($txt,'&newl;')" />
+    </xsl:call-template>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:value-of select="$txt" />
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+</xsl:stylesheet>
Index: sm/trunk/scripts/svn_repo_authors.sh
===================================================================
--- /issm/trunk/scripts/svn_repo_authors.sh	(revision 28275)
+++ 	(revision )
@@ -1,203 +1,0 @@
-#!/bin/bash
-
-# Parses Subversion repository log messages and outputs authors and their 
-# respective number of commits. 
-#
-# Output can be sorted:
-#
-#	-a		sort output by author name
-#	-c		sort output by number of commits
-#
-# Output can also be limited to commits from the last year:
-#
-#	-y		display only commits from the last 365 days
-#
-# Will run on first 'path' parameter, or on current working directory if no 
-# path is supplied.
-#
-# TODO:
-# - Add option to bin authors and commits by year
-# - Convert to using XML output from SVN log (i.e. `svn log --xml`)
-
-## Functions
-#
-
-function display_help {
-	echo "usage: ${script_name} [option] [path]" >&2
-	case "${uname_out}" in
-		Linux*)
-			display_help_linux
-			;;
-		Darwin*)
-			display_help_mac
-			;;
-		*)
-			;;
-	esac
-}
-
-function display_help_mac {
-	echo "	-h	display help"
-	echo "	-a	sort output by author name"
-	echo "	-c	sort output by number of commits"
-	echo "	-y	display only commits from the last 365 days"
-}
-
-function display_help_linux {
-	echo "	-h | --help		display help"
-	echo "	-a | --authors	sort output by author name"
-	echo "	-c | --commits	sort output by number of commits"
-	echo "	-y | --year		display only commits from the last 365 days"
-}
-
-function print_authors {
-	i=0
-	until [[ $i -eq "${#authors[@]}" ]]; do
-		printf "%-15s %i\n" "${authors[$i]}" "${commits[$i]}"
-		(( i++ ))
-	done
-}
-
-function print_authors_sorted_by_author {
-	local i=0
-	until [[ $i -eq "${#authors[@]}" ]]; do
-		printf "%-15s %i\n" "${authors[$i]}" "${commits[$i]}"
-		(( i++ ))
-	done |
-	sort -n -k1
-}
-
-function print_authors_sorted_by_commits {
-	local i=0
-	until [[ $i -eq "${#authors[@]}" ]]; do
-		printf "%-15s %i\n" "${authors[$i]}" "${commits[$i]}"
-		(( i++ ))
-	done |
-	sort -rn -k2
-}
-
-## Initialize conditional variables
-#
-one_year_ago=""
-sort_by_author=0
-sort_by_commits=0
-today=""
-
-# Retrieve script name
-script_name=$(basename "$0")
-
-## Retrieve OS
-#
-uname_out=$(uname -s)
-case "${uname_out}" in
-	Linux*)
-		options=$(getopt -n ${script_name} -o hacy --long help,author,commits,year -- "$@")
-		;;
-	Darwin*)
-		options=$(getopt hacy $*)
-		;;
-	*)
-		printf "operating system %s not currently supported\n" "${uname_out}" >&2
-		exit 1
-		;;
-esac
-
-## Handle options
-#
-valid_options=$?
-if [[ $valid_options -ne 0 ]]; then
-	display_help
-	exit 1
-fi
-#echo $options # Uncomment for debugging
-set -- $options
-
-while :
-do
-	case "$1" in
-		-h | --help)
-			display_help
-			exit 0
-			;;
-		-a | --author)
-			sort_by_author=1
-			shift
-			;;
-		-c | --commits)
-			sort_by_commits=1
-			shift
-			;;
-		-y | --year)
-			today=$(date +%Y-%m-%d)
-			one_year_ago=$(date -v -1y -v +1d +%Y-%m-%d) # Date adjusted 365 days
-			shift
-			;;
-		--)
-			shift
-			break
-			;;
-		*)
-			break
-			;;
-	esac
-done
-
-## Retrieve path
-#
-# If no path was given, use current working directory; if one or more were 
-# given, just use the first one.
-#
-path="."
-num_args=${#@}
-if [[ $num_args -gt 0 ]]; then
-	path=$1
-fi
-
-authors=()
-commits=()
-
-# Get entire log once
-if [[ $one_year_ago != "" ]]; then
-	log=$(svn log -r "{${today}}:{${one_year_ago}}" "${path}")
-else
-	log=$(svn log "${path}")
-fi
-
-data_lines=$(echo "${log}" | egrep "r[0-9]+") # Get only lines from log that contain info we care about
-
-while IFS= read line; do
-	author=$(echo "${line}" | awk -F "|" '{print $2}' | tr -d ' ')
-
-	# Uncomment if we want to treat blank author as "unknown"
-	if [[ "$author" == "" ]]; then
-		author="unknown"
-	fi
-
-	have_seen_author=0
-	for (( i=0; i<${#authors[@]}; ++i )); do
-		if [[ "${authors[$i]}" == "$author" ]]; then
-			have_seen_author=1
-			break
-		fi
-	done
-
-	if [[ $have_seen_author -eq 0 ]]; then
-		authors+=("${author}")
-		commits+=(1)
-	else
-		(( commits[$i]++ ))
-	fi
-done <<< "${data_lines}"
-
-## Print results (sorted, if requested)
-#
-# NOTE: If multiple sort options are specified, the order or precedence is 
-#		specified as follows.
-#
-if [ $sort_by_commits -eq 1 ]; then
-	print_authors_sorted_by_commits
-elif [ $sort_by_author -eq 1 ]; then
-	print_authors_sorted_by_author
-else
-	print_authors
-fi
Index: sm/trunk/scripts/svnlog
===================================================================
--- /issm/trunk/scripts/svnlog	(revision 28275)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#!/bin/bash
-
-svn log $1 | perl -e 'print reverse<>'
Index: sm/trunk/scripts/svnvimdiff
===================================================================
--- /issm/trunk/scripts/svnvimdiff	(revision 28275)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#!/bin/bash
-
-#get files to check
-if [ $# -eq 0 ]
-then
-	echo "no file specified"
-	return
-fi
-
-#first, check that all files exist
-for FILE in $*
-do
-	if [ ! -f "$FILE" ]
-	then
-		echo "File $FILE not found!" >&2   # Error message to stderr.
-		exit 1
-	fi 
-done
-
-#svn diff all files
-for FILE in $*
-do
-
-	FILENAME=$(basename $FILE);
-	EXT=${FILENAME/*./}
-	RELEASE=$(svn info $FILE | grep "Revision" | awk '{ print $2 }')
-
-	YOUFILE="YOUR_FILE"."$EXT"
-	SVNFILE="SVN_FILE"."$EXT"
-
-	echo "Downloading current $FILENAME in svn repository"
-	mv $FILE $YOUFILE
-	svn update -q $FILE
-	mv $FILE $SVNFILE
-
-	vimdiff $YOUFILE $SVNFILE
-
-	echo "Reverting to local version of $FILENAME"
-	svn update -q -r$RELEASE $FILE
-	wait #wait till svn has downloaded the file otherwise it could be lost!
-	mv $YOUFILE $FILE
-	touch $FILE
-	rm $SVNFILE
-done
Index: /issm/trunk/scripts/sync.sh
===================================================================
--- /issm/trunk/scripts/sync.sh	(revision 1)
+++ /issm/trunk/scripts/sync.sh	(revision 1)
@@ -0,0 +1,86 @@
+#!/bin/bash
+
+#This shell tries to synchronize the current cielo root directory on another 
+#machine. 
+
+echo "Watch out, this script should be run in top level directory of cielo"
+
+echo -n "Platform (cosmos,mustang,gemini)?: "
+read platform 
+
+
+if [[ "$platform" ==  "cosmos" ]]
+then
+	echo "Synchronizing cielo with cosmos"
+	#first cleanup the archive
+	cl
+	clb
+	cls
+	#then tar the archive
+	present_directory=`pwd`;
+	cd ../
+	rm -rf trunk.tar.gz
+	tar zcvf trunk.tar.gz trunk
+
+	#send archive to cosmos
+	scp  trunk.tar.gz larour@cosmos.jpl.nasa.gov:/home/larour
+
+	#run synchronization script on cosmos
+	ssh larour@cosmos.jpl.nasa.gov './sync_cosmos.sh'
+
+	rm -rf trunk.tar.gz
+elif [[ "$platform" ==  "mustang" ]]
+then
+	
+	echo "Synchronizing cielo with mustang"
+	#first cleanup the archive
+	cl
+	clb
+	cls
+	#then tar the archive
+	present_directory=`pwd`;
+	cd ../
+	rm -rf trunk.tar.gz
+	tar zcvf trunk.tar.gz trunk
+
+	#send archive to mustang
+	scp  trunk.tar.gz larour@mustang.jpl.nasa.gov:/proj/ice/larour/Ice/
+
+	#run synchronization script on cosmos
+	ssh larour@mustang.jpl.nasa.gov './sync_mustang.sh'
+
+	rm -rf trunk.tar.gz
+elif [[ "$platform" ==  "gemini" ]]
+then
+	echo "Synchronizing cielo with gemini"
+	
+	#first cleanup the archive
+	make -f MakefileIce clean
+	make clean 
+	cd doc
+	make -f MakefileIce clean
+	cd ..
+
+	#erase packages symlink
+	rm -rf packages 
+	cvs update -d -P packages
+	
+	#then tar the archive
+	make dist-gzip
+
+	#send archive to cosmos
+	scp  issm-1.0.tar.gz larour@gemini.jpl.nasa.gov:/home/larour
+
+	#run synchronization script on cosmos
+	ssh larour@gemini.jpl.nasa.gov './sync_gemini.sh'
+
+	rm -rf issm-1.0.tar.gz
+
+	#relink packages
+	rm -rf packages
+	ln -s ../packages packages
+
+else
+	echo "This platform not supported yet"
+	exit
+fi
Index: sm/trunk/scripts/tai
===================================================================
--- /issm/trunk/scripts/tai	(revision 28275)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#!/bin/bash
-if [ -z $EXECUTION_DIR ];
-then
-	EXECUTION_DIR=$ISSM_DIR/execution
-fi
-
-DIR=$(ls -rtd1 $EXECUTION_DIR/* | tail -n1)
-echo "Execution directory: $DIR"
-tail -f $DIR/*.outlog
Index: sm/trunk/scripts/translateToPy.py
===================================================================
--- /issm/trunk/scripts/translateToPy.py	(revision 28275)
+++ 	(revision )
@@ -1,257 +1,0 @@
-
-import codecs
-import unicodedata
-import sys
-import datetime
-import os
-
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#
-program = 'translateToPy.py'
-version = '1.0'
-versionReleaseDate = '09/24/12'
-origAuthor = 'Mike Pellegrin'
-desc = '\nMatlab script conversion into python'
-#
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#                History
-#    Date        Developer           Modification
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#    09 / 24 / 12 Michael Pellegrin    Initial Release     V1.0
-#
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
-outputLocation = sys.stdout
-inputFile = ""
-
-# other global vars
-indentLevel = 0
-
-
-def setupOutputLocation(outFile):
-    if outFile != sys.stdout:
-        globals()['outputLocation'] = open(outFile, 'w')  # clobber
-
-
-def translateFile(inputFile):
-    f = codecs.open(inputFile, encoding='utf-8')
-    try:
-        for line in f:
-            # print "in: " + line
-
-            asciiLine = unicodedata.normalize('NFKD', line).encode('ascii', 'ignore')
-            line = asciiLine
-            translateLine(line)
-
-    finally:
-        f.close()
-
-
-def translateLine(line):
-
-    if len(line) == 1:    # blank line
-        output(line)
-
-    elif line.split()[0][0] == '%':        # comment line
-        output("# " + line.replace('%', ''))
-
-    else:        # needs cleanup.  this is a real - quick - n - dirty implimentation
-        #print line
-        res = line.replace('{', '[')
-        res = res.replace('}', ']')
-        res = res.replace('model', 'model()')
-        res = res.replace('SolutionEnum', 'SolutionEnum()')
-        res = res.replace('StressTensorEnum', 'StressTensorEnum()')
-        res = res.replace('.par', '.py')
-        res = res.replace('=extrude(md, ', '.extrude(')
-
-        res = res.replace('thickness(pos)', 'thickness[pos]')
-        res = res.replace('find(md.', 'numpy.nonzero(md.')
-
-        res = res.replace('\n', '')
-
-        # handle inline comments
-        res = res.replace('%', '#')
-
-        res = res.replace('...', '\\')
-
-        # determine if the m file has mult. line cmd (real quick solution)
-        multCmds = res.split(';')
-        numLines = len(multCmds) - 2
-        allParts = ''
-        for part in multCmds:
-            allParts += part
-            #allParts += re.sub('^\s + ', '', part)
-            #allParts += part.strip()
-            if numLines > 0:
-                allParts += '\n'
-                numLines -= 1
-
-        res = allParts
-        res = res.replace(';', '')
-        res = convertFieldValues(res)
-        #print 'resulting line:' + str(res) + '\n'
-        output(res)
-
-
-def convertFieldValues(currentLine):
-    # before utilizing regex's {starting w / eg. \([0 - 9]\) } for special case: ...(#)...
-    # i noticed what i'm looking for is only TransientSolution(* ). So, ...
-
-    res = currentLine
-    if 'md.results' in currentLine:
-        res = res.replace('(md.results.', 'md.results[\'')
-
-        if 'TransientSolution(' in currentLine:        # got a TransientSolution([0 - 9..]) case
-            res = res.replace('TransientSolution(', 'TransientSolution\'][')
-            parts = res.split(')')
-            res = parts[0] + '][\'' + parts[1].replace('.', '') + '\']' + parts[2]
-
-        else:                # handle the other cases for md.results
-
-            res = res.replace('Solution.Vx)', 'Solution\'][1][\'Vx\']')
-            res = res.replace('Solution.Vy)', 'Solution\'][1][\'Vy\']')
-            res = res.replace('Solution.Vz)', 'Solution\'][1][\'Vz\']')
-            res = res.replace('Solution.Vel)', 'Solution\'][1][\'Vel\']')
-
-            res = res.replace('Solution.Pressure)', 'Solution\'][1][\'Pressure\']')
-
-            res = res.replace('Solution.StressTensorxx)', 'Solution\'][1][\'StressTensorxx\']')
-            res = res.replace('Solution.StressTensorxy)', 'Solution\'][1][\'StressTensorxy\']')
-            res = res.replace('Solution.StressTensoryy)', 'Solution\'][1][\'StressTensoryy\']')
-            res = res.replace('Solution.StressTensorzz)', 'Solution\'][1][\'StressTensorzz\']')
-            res = res.replace('Solution.StressTensorxz)', 'Solution\'][1][\'StressTensorxz\']')
-            res = res.replace('Solution.StressTensoryz)', 'Solution\'][1][\'StressTensoryz\']')
-
-            res = res.replace('Solution.FrictionCoefficient)', 'Solution\'][1][\'FrictionCoefficient\']')
-            res = res.replace('Solution.SurfaceforcingsMasBalance)', 'Solution\'][1][\'SurfaceforcingsMasBalance\']')
-            res = res.replace('Solution.MaskElementonfloatingice)', 'Solution\'][1][\'MaskElementonfloatingice\']')
-            res = res.replace('Solution.J)', 'Solution\'][1][\'J\']')
-            res = res.replace('Solution.BalancethicknessThickeningRate)', 'Solution\'][1][\'BalancethicknessThickeningRate\']')
-
-            res = res.replace('Solution.Gradient1)', 'Solution\'][1][\'Gradient1\']')
-            res = res.replace('Solution.Gradient2)', 'Solution\'][1][\'Gradient2\']')
-
-            res = res.replace('Solution.MaterialsRheologyZbar)', 'Solution\'][1][\'MaterialsRheologyZbar\']')
-            res = res.replace('Solution.MaterialsRheologyBbar)', 'Solution\'][1][\'MaterialsRheologyBbar\']')
-            res = res.replace('Solution.MaterialsRheologyB)', 'Solution\'][1][\'MaterialsRheologyB\']')
-
-            res = res.replace('Solution.Thickness)', 'Solution\'][1][\'Thickness\']')
-
-            res = res.replace('Solution.Temperature)', 'Solution\'][1][\'Temperature\']')
-
-            res = res.replace('Solution.BasalforcingsMeltingRate)', 'Solution\'][1][\'BasalforcingsMeltingRate\']')
-
-            res = res.replace('Solution.SurfaceSlopeX)', 'Solution\'][1][\'SurfaceSlopeX\']')
-            res = res.replace('Solution.SurfaceSlopeY)', 'Solution\'][1][\'SurfaceSlopeY\']')
-            res = res.replace('Solution.SurfaceSlopeZ)', 'Solution\'][1][\'SurfaceSlopeZ\']')
-
-            res = res.replace('Solution.BedSlopeX)', 'Solution\'][1][\'BedSlopeX\']')
-            res = res.replace('Solution.BedSlopeY)', 'Solution\'][1][\'BedSlopeY\']')
-            res = res.replace('Solution.BedSlopeZ)', 'Solution\'][1][\'BedSlopeZ\']')
-
-            res = res.replace('Solution.Enthalpy)', 'Solution\'][1][\'Enthalpy\']')
-            res = res.replace('Solution.Waterfraction)', 'Solution\'][1][\'Waterfraction\']')
-            res = res.replace('Solution.Temperature)', 'Solution\'][1][\'Temperature\']')
-
-            # special case
-            res = res.replace('.DiagnosticSolution.J', '[\'DiagnosticSolution\'][1][\'J\']')
-
-    return res
-
-
-def output(line):
-    numTabs = indentLevel
-    while numTabs:
-        numTabs -= 1
-        print('\t', end="", file=outputLocation)
-
-    print(line, end="", file=outputLocation)
-
-
-def outputTopOfSript(inputFile):
-
-    global indentLevel
-
-    output("\"\"\"")
-    output("====================================== ")
-    output("Auto generated python script for ISSM: {}".format(inputFile))
-    output("Created on {} via {} Ver {} by {}".format(datetime.date.today(), program, version, os.getlogin()))
-    output("====================================== ")
-    #output("")
-    output(desc)
-    output("%s Author: Michael Pellegrin" % (program))
-    output("%s Date: %s" % (program, versionReleaseDate))
-    output("====================================== ")
-    output("\"\"\"")
-    output("")
-
-
-def outputBottomOfScript():
-
-    global indentLevel
-
-    output("")
-
-
-def genericImports():
-    output("from MatlabFuncs import * ")
-    output("from model import * ")
-    output("from EnumDefinitions import * ")
-    output("from numpy import * ")
-
-
-def createImports(inputFile):
-    genericImports()
-
-    # cycle through eachline to assertain import needs
-    f = codecs.open(inputFile, encoding='utf-8')
-    try:
-        for line in f:
-            # print "in: " + line
-
-            # toss blank lines
-            if len(line) == 1:
-                continue
-
-            asciiLine = unicodedata.normalize('NFKD', line).encode('ascii', 'ignore')
-            line = asciiLine
-
-            for il in importList:
-                if line.find(il) != -1:
-                    output("from %s import * " % (il))
-                    importList.remove(il)    # already got it
-
-    finally:
-        output("")
-        f.close()
-
-
-def initImportList():
-    global importList
-
-    importList = ['triangle',
-                  'setmask',
-                  'parameterize',
-                  'setflowequation',
-                  'meshconvert',
-                  'solve']
-
-
-def convertToPython(inFile, outFile=sys.stdout):
-    #print ' in cnvrt to python w / file:' + inFile
-    initImportList()
-    setupOutputLocation(outFile)
-    outputTopOfSript(inFile)
-    createImports(inFile)
-    translateFile(inFile)
-    #    outputBottomOfScript()
-
-
-if __name__ == "__main__":
-    #print ' in main w / arg:' + sys.argv[1] + ' ' + sys.argv[2]
-    if len(sys.argv) == 2:
-        convertToPython(sys.argv[1], sys.argv[2])
-    else:
-        convertToPython(sys.argv[1])
Index: sm/trunk/scripts/user_kill
===================================================================
--- /issm/trunk/scripts/user_kill	(revision 28275)
+++ 	(revision )
@@ -1,45 +1,0 @@
-#!/bin/bash
-
-#get jobs to be killed
-if [ $# -eq 0 ]
-then
-	echo "no job specified"
-	return
-fi
-
-#kill jobs
-for JOB in $*
-do
-
-	#if [[ "$HOSTNAME" != "metro.jpl.nasa.gov" ]]
-	#then
-	#	echo "cannot use user_kill for now"
-	#	exit
-	#fi
-
-	#if [[ $1 == "screen" ]]
-	#then
-	#	echo "cannot kill screen for now!"
-	#	exit 1
-	#fi
-
-
-
-	#if [[ $1 == "matlab" ]]
-	#then
-	#	echo "cannot kill matlab for now!"
-	#	exit 1
-	#fi
-
-	if [ "$JOB" = "konsole" ]; then
-		echo "cannot kill konsole for now!"
-		exit 1
-	fi
-
-	echo "killing $JOB"
-
-	for i in `ps aux | grep $JOB | grep -v grep | grep -v user_kill | awk '{printf("%s\n",$2);}'`; 
-	do 
-		kill -9 $i;
-	done;
-done
Index: sm/trunk/scripts/vie
===================================================================
--- /issm/trunk/scripts/vie	(revision 28275)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#!/bin/bash
-
-if [ -z "$EXECUTION_DIR" ];
-then
-	EXECUTION_DIR="$ISSM_DIR/execution"
-fi
-
-DIR=$(ls -rtd1 $EXECUTION_DIR/* | tail -n1)
-vim $DIR/*.errlog
Index: sm/trunk/scripts/vil
===================================================================
--- /issm/trunk/scripts/vil	(revision 28275)
+++ 	(revision )
@@ -1,8 +1,0 @@
-#!/bin/bash
-if [ -z $EXECUTION_DIR ];
-then
-	EXECUTION_DIR="$ISSM_DIR/execution"
-fi
-
-DIR=$(ls -rtd1 $EXECUTION_DIR/* | tail -n1)
-vim $DIR/*.outlog
Index: sm/trunk/scripts/wincron.sh
===================================================================
--- /issm/trunk/scripts/wincron.sh	(revision 28275)
+++ 	(revision )
@@ -1,5 +1,0 @@
-#/bin/bash
-#Launch cron as a windows service, using cygrunsrv: 
-
-cygrunsrv --install cron --path /usr/sbin/cron --args -n
-net start cron
Index: sm/trunk/scripts/windowsbuild.sh
===================================================================
--- /issm/trunk/scripts/windowsbuild.sh	(revision 28275)
+++ 	(revision )
@@ -1,21 +1,0 @@
-#!/bin/bash
-#build windows archive of binaries.
-
-#Some local script functions 
-function today_date {
-suffix=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'` 
-echo $suffix;
-}
-
-#Create tar file, with today's date in the title;
-today=`today_date`
-
-cd $ISSM_DIR/bin
-
-#Filter out .svn files
-rm -rf list
-ls *.mexw32 | grep -v "\.svn" > list;
-
-tar zcvf ../issm-1.0-win-$today.tar.gz  `cat list`
-rm -rf list
-
Index: /issm/trunk/src/Makefile.am
===================================================================
--- /issm/trunk/src/Makefile.am	(revision 28275)
+++ /issm/trunk/src/Makefile.am	(revision 1)
@@ -1,2 +1,4 @@
-EXTRA_DIST =  perl
-SUBDIRS = c m wrappers
+EXTRA_DIST = m  MakefileIce  perl  pro
+SUBDIRS = c mex
+
+
Index: /issm/trunk/src/Makefile.in
===================================================================
--- /issm/trunk/src/Makefile.in	(revision 1)
+++ /issm/trunk/src/Makefile.in	(revision 1)
@@ -0,0 +1,506 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/issm_options.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLACSINCL = @BLACSINCL@
+BLACSLIB = @BLACSLIB@
+BLASLAPACKINCL = @BLASLAPACKINCL@
+BLASLAPACKLIB = @BLASLAPACKLIB@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLIBS = @FLIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MATLAB = @MATLAB@
+MATLABINCL = @MATLABINCL@
+MATLAB_MAJOR = @MATLAB_MAJOR@
+MATLAB_MINOR = @MATLAB_MINOR@
+MATLAB_VERSION = @MATLAB_VERSION@
+METISINCL = @METISINCL@
+METISLIB = @METISLIB@
+MEX = @MEX@
+MEXEXT = @MEXEXT@
+MEXLIB = @MEXLIB@
+MEXLINK = @MEXLINK@
+MKDIR_P = @MKDIR_P@
+MPIINCL = @MPIINCL@
+MPILIB = @MPILIB@
+MUMPSINCL = @MUMPSINCL@
+MUMPSLIB = @MUMPSLIB@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PETSCINCL = @PETSCINCL@
+PETSCLIB = @PETSCLIB@
+PLAPACKINCL = @PLAPACKINCL@
+PLAPACKLIB = @PLAPACKLIB@
+RANLIB = @RANLIB@
+SCALAPACKLIB = @SCALAPACKLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEPCINCL = @SLEPCINCL@
+SLEPCLIB = @SLEPCLIB@
+STRIP = @STRIP@
+TRIANGLEINCL = @TRIANGLEINCL@
+TRIANGLELIB = @TRIANGLELIB@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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@
+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@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = m  MakefileIce  perl  pro
+SUBDIRS = c mex
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic ctags \
+	ctags-recursive distclean distclean-generic distclean-tags \
+	distdir dvi dvi-am html 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-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+	tags-recursive uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /issm/trunk/src/c/BuildNodeSetsx/BuildNodeSetsx.cpp
===================================================================
--- /issm/trunk/src/c/BuildNodeSetsx/BuildNodeSetsx.cpp	(revision 1)
+++ /issm/trunk/src/c/BuildNodeSetsx/BuildNodeSetsx.cpp	(revision 1)
@@ -0,0 +1,88 @@
+/*!\file BuildNodeSetsx
+ * \brief: establish degrees of freedom for all nodes
+ */
+
+#include "./BuildNodeSetsx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "NodeSetsx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+int BuildNodeSetsx( NodeSets** pnodesets, DataSet* nodes){
+
+	int noerr=1;
+
+	/*output: */
+	NodeSets* nodesets=NULL;
+	int gsize,msize,nsize,fsize,ssize;
+	double* pv_m=NULL;
+	double* pv_n=NULL;
+	double* pv_f=NULL;
+	double* pv_s=NULL;
+	
+	/*intermdiary flags: */
+	Vec vec_pv_m=NULL;
+	Vec vec_pv_n=NULL;
+	Vec vec_pv_f=NULL;
+	Vec vec_pv_s=NULL;
+	
+	Vec flag_pv_g=NULL;
+	Vec flag_pv_m=NULL;
+	Vec flag_pv_n=NULL;
+	Vec flag_pv_f=NULL;
+	Vec flag_pv_s=NULL;
+
+	/*Get gsize; */
+	gsize=nodes->NumberOfDofs();
+
+	/*Now, allocate parallel vectors for all the sets: */
+	flag_pv_g=NewVec(gsize);
+	flag_pv_m=NewVec(gsize);
+	flag_pv_n=NewVec(gsize);
+	flag_pv_f=NewVec(gsize);
+	flag_pv_s=NewVec(gsize);
+
+	/*Now, go through all nodes and have every node plug into 
+	 * pv_m, pv_n, pv_f and pv_s, their own set flags, for each dof: */
+	nodes->FlagNodeSets(flag_pv_g,flag_pv_m,flag_pv_n,flag_pv_f,flag_pv_s);
+
+	/*Now, every cpu has 4 flag vectors, of size gsize. Create partition vectors (like a pos=find(flag_pv_g) in matlab*/
+	PartitionSets(&vec_pv_m,&vec_pv_n,flag_pv_g,flag_pv_m,flag_pv_n,gsize); /*! split g set into m and n sets*/
+	PartitionSets(&vec_pv_f,&vec_pv_s,flag_pv_n,flag_pv_f,flag_pv_s,gsize); /*! split n set into f and s sets*/
+
+	/*Free ressources:*/
+	VecFree(&flag_pv_g);
+	VecFree(&flag_pv_m);
+	VecFree(&flag_pv_n);
+	VecFree(&flag_pv_f);
+	VecFree(&flag_pv_s);
+
+	/*Serialize vectors: */
+	VecGetSize(vec_pv_m,&msize);
+	VecGetSize(vec_pv_n,&nsize);
+	VecGetSize(vec_pv_f,&fsize);
+	VecGetSize(vec_pv_s,&ssize);
+	VecToMPISerial(&pv_m,vec_pv_m);
+	VecToMPISerial(&pv_n,vec_pv_n);
+	VecToMPISerial(&pv_f,vec_pv_f);
+	VecToMPISerial(&pv_s,vec_pv_s);
+
+	/*Free ressources:*/
+	VecFree(&vec_pv_m);
+	VecFree(&vec_pv_n);
+	VecFree(&vec_pv_f);
+	VecFree(&vec_pv_s);
+
+
+	/*Create NodeSets* object: */
+	nodesets=new NodeSets(pv_m,pv_n,pv_f,pv_s,gsize,msize,nsize,fsize,ssize);
+
+	/*Assign output pointers: */
+	*pnodesets=nodesets;
+
+	return noerr;
+}
Index: /issm/trunk/src/c/BuildNodeSetsx/BuildNodeSetsx.h
===================================================================
--- /issm/trunk/src/c/BuildNodeSetsx/BuildNodeSetsx.h	(revision 1)
+++ /issm/trunk/src/c/BuildNodeSetsx/BuildNodeSetsx.h	(revision 1)
@@ -0,0 +1,16 @@
+/*!\file:  BuildNodeSetsx.h
+ * \brief header file for building node sets (m,n,f and s sets)
+ */ 
+
+#ifndef _BUILDNODESETSX_H
+#define _BUILDNODESETSX_H
+
+#include "../DataSet/DataSet.h" 
+#include "../objects/objects.h"
+
+/* local prototypes: */
+int		BuildNodeSetsx( NodeSets** pnodesets,DataSet* nodes);
+void PartitionSets(Vec* ppvb, Vec* ppvc,Vec flag_pva, Vec flag_pv_b, Vec flag_pv_c,int gsize);
+
+#endif  /* _BUILDNODESETSX_H */
+
Index: /issm/trunk/src/c/BuildNodeSetsx/PartitionSets.cpp
===================================================================
--- /issm/trunk/src/c/BuildNodeSetsx/PartitionSets.cpp	(revision 1)
+++ /issm/trunk/src/c/BuildNodeSetsx/PartitionSets.cpp	(revision 1)
@@ -0,0 +1,107 @@
+/*!\file:  PartitionSets.cpp
+ * \brief partition degree of freedome sets
+ */ 
+	
+#include "stdio.h"
+#include "../shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "PartitionSets"
+
+void PartitionSets(Vec* ppartitionb, Vec* ppartitionc,Vec flags_a,Vec flags_b,Vec flags_c,int gsize){
+
+	int i;
+
+	/*output: */
+	Vec partitionb=NULL;
+	double* partitionb_local=NULL;
+	Vec partitionc=NULL;
+	double* partitionc_local=NULL;
+
+	/*intermediary: */
+	int  local_size;
+	int* idxm=NULL;
+	double* flags_a_local=NULL;
+	double* flags_b_local=NULL;
+	double* flags_c_local=NULL;
+	int     lower_row, upper_row, range;
+	int     asize, bsize, csize;
+	int     acount, bcount, ccount, dummy;
+
+
+	/*First recover flags locally on each cpu: */
+	VecGetOwnershipRange(flags_a,&lower_row,&upper_row); upper_row--; range=upper_row-lower_row+1;    
+
+	if(range){
+		idxm=(int*)xmalloc(range*sizeof(int));
+		flags_a_local=(double*)xmalloc(range*sizeof(double));
+		flags_b_local=(double*)xmalloc(range*sizeof(double));
+		flags_c_local=(double*)xmalloc(range*sizeof(double));
+	}
+	for(i=0;i<range;i++)idxm[i]=lower_row+i;
+
+	VecGetValues(flags_a,range,idxm,flags_a_local);
+	VecGetValues(flags_b,range,idxm,flags_b_local);
+	VecGetValues(flags_c,range,idxm,flags_c_local);
+
+
+	/*Figure out local size of a, b and c sets on each cpu: */
+	asize=0;
+	bsize=0;
+	csize=0;
+	for(i=0;i<range;i++){
+		if (flags_a_local[i]){
+			if (flags_b_local[i])bsize++;
+			if (flags_c_local[i])csize++;
+			asize++;
+		}
+	}
+
+	/*Figure out start of "a" set local cpu counter: */
+	GetOwnershipBoundariesFromRange(&acount,&dummy,asize);
+
+	/*Allocate local partitioning vectors: */
+	if(bsize)partitionb_local=(double*)xmalloc(bsize*sizeof(double));
+	if(csize)partitionc_local=(double*)xmalloc(csize*sizeof(double));
+
+	/*Loop again, and plug values: */
+	bcount=0;
+	ccount=0;
+	for(i=0;i<range;i++){
+		if (flags_a_local[i]){
+			if (flags_b_local[i]){
+				partitionb_local[bcount]=acount+1; //matlab indexing
+				bcount++;
+			}
+			if (flags_c_local[i]){
+				partitionc_local[ccount]=acount+1; //matlab indexing
+				ccount++;
+			}
+			if (flags_b_local[i] && flags_c_local[i]) throw ErrorException(__FUNCT__,exprintf("%s%i%s"," for dof ",i,": breach of exclusive partitioning between sets"));
+			
+			acount++;
+		}
+	}
+
+	/*Now, using the local partitions for b and c, create parallel vectors: */
+	VecCreateMPIWithArray(MPI_COMM_WORLD,bsize,PETSC_DECIDE,partitionb_local,&partitionb);
+	VecCreateMPIWithArray(MPI_COMM_WORLD,csize,PETSC_DECIDE,partitionc_local,&partitionc);
+
+	/*Free ressources:*/
+	xfree((void**)&idxm);
+	xfree((void**)&flags_a_local);
+	xfree((void**)&flags_b_local);
+	xfree((void**)&flags_c_local);
+
+	VecAssemblyBegin(partitionb); 
+	VecAssemblyEnd(partitionb);
+
+	VecAssemblyBegin(partitionc); 
+	VecAssemblyEnd(partitionc);
+
+	/*Assign output pointers*/
+	*ppartitionb=partitionb;
+	*ppartitionc=partitionc;
+
+
+}
Index: /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp
===================================================================
--- /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 1)
+++ /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 1)
@@ -0,0 +1,28 @@
+/*!\file ConfigureObjectsx
+ * \brief: configure objects in elements and loads to link in with nodes
+ */
+
+#include "./ConfigureObjectsx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ConfigureObjectsx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+int	ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes,DataSet* materials){
+
+	int noerr=1;
+	int i;
+
+	extern int num_procs;
+	extern int my_rank;
+	
+	/*intermediary: */
+	elements->Configure(elements,loads,nodes,materials);
+	loads->Configure(elements,loads,nodes,materials);
+
+	return noerr;
+}
Index: /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h
===================================================================
--- /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h	(revision 1)
+++ /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h	(revision 1)
@@ -0,0 +1,14 @@
+/*!\file:  ConfigureObjectsx.h
+ * \brief header file for degree of freedoms distribution routines.
+ */ 
+
+#ifndef _CONFIGUREOBJECTSX_H
+#define _CONFIGUREOBJECTSX_H
+
+#include "../DataSet/DataSet.h"
+
+/* local prototypes: */
+int		ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* materials);
+
+#endif  /* _CONFIGUREOBJECTSX_H */
+
Index: /issm/trunk/src/c/ContourToMeshx/ContourToMeshx.cpp
===================================================================
--- /issm/trunk/src/c/ContourToMeshx/ContourToMeshx.cpp	(revision 1)
+++ /issm/trunk/src/c/ContourToMeshx/ContourToMeshx.cpp	(revision 1)
@@ -0,0 +1,68 @@
+/*! \file  ContourToMeshx.c
+ */
+
+#include "./ContourToMeshx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "ContourToMeshx"
+
+int ContourToMeshx( Vec* pin_nod,Vec* pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue) {
+
+	int noerr=1;
+	int i;
+	int m,n;
+
+	/*Contour:*/
+	Contour* contouri=NULL;
+	int      numgrids;
+	double*  xc=NULL;
+	double*  yc=NULL;
+	double*  in_nod_serial;
+	double   value;
+
+	/*output: */
+	Vec in_nod=NULL;
+	Vec in_elem=NULL;
+
+	in_nod=NewVec(nods);
+	in_elem=NewVec(nel);
+
+	/*Loop through all contours: */
+	for (i=0;i<numcontours;i++){
+		#ifdef _DEBUG_
+			printf("Handling contour %i/%i\n",i,numcontours);
+		#endif
+		contouri=*(contours+i);
+		numgrids=contouri->nods;
+		xc=contouri->x;
+		yc=contouri->y;
+		IsInPoly(in_nod,xc,yc,numgrids,x,y,nods,edgevalue);
+	}
+
+	/*Get in_nod serialised for next operation: */
+	VecToMPISerial(&in_nod_serial,in_nod);
+
+	/*Take care of the case where an element interpolation has been requested: */
+	if ((strcmp(interptype,"element")==0) || (strcmp(interptype,"element and node")==0)){
+		for (n=0;n<nel;n++){
+			if ( (in_nod_serial[ (int)*(index+3*n+0) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+1) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+2) -1] == 1) ){
+				value=1; VecSetValues(in_elem,1,&n,&value,INSERT_VALUES);
+			}
+		}
+	}
+
+	/*Assemble vectors: */
+	VecAssemblyBegin(in_nod);
+	VecAssemblyEnd(in_nod);
+	VecAssemblyBegin(in_elem);
+	VecAssemblyEnd(in_elem);
+
+	/*Assign output pointers: */
+	*pin_nod=in_nod;
+	*pin_elem=in_elem;
+
+	/*Free ressources:*/
+	xfree((void**)&in_nod_serial);
+
+	return noerr;
+}
Index: /issm/trunk/src/c/ContourToMeshx/ContourToMeshx.h
===================================================================
--- /issm/trunk/src/c/ContourToMeshx/ContourToMeshx.h	(revision 1)
+++ /issm/trunk/src/c/ContourToMeshx/ContourToMeshx.h	(revision 1)
@@ -0,0 +1,16 @@
+/*
+	ContourToMeshx.h
+*/
+
+
+#ifndef _CONTOURTOMESHX_H
+#define _CONTOURTOMESHX_H
+
+#include "../shared/shared.h"
+#include "../objects/objects.h"
+
+/* local prototypes: */
+int ContourToMeshx( Vec* pin_nods,Vec* pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue);
+
+#endif /* _CONTOURTOMESHX_H */
+
Index: /issm/trunk/src/c/ControlConstrainx/ControlConstrainx.cpp
===================================================================
--- /issm/trunk/src/c/ControlConstrainx/ControlConstrainx.cpp	(revision 1)
+++ /issm/trunk/src/c/ControlConstrainx/ControlConstrainx.cpp	(revision 1)
@@ -0,0 +1,35 @@
+/*!\file ControlConstrainx
+ * \brief constrain optimization parameters during inverse method
+ */
+
+#include "./ControlConstrainx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ControlConstrainx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+void ControlConstrainx( double* p_g, int gsize, double mincontrolconstraint, double maxcontrolconstraint,char* control_type){
+
+	int i;
+	
+	if(isnan(mincontrolconstraint) & isnan(maxcontrolconstraint)){
+		/*do nothing*/
+	}
+	else{
+		for(i=0;i<gsize;i=i+2){
+
+			if(!isnan(mincontrolconstraint)){
+				if (p_g[i]<mincontrolconstraint)p_g[i]=mincontrolconstraint;
+			}
+
+			if(!isnan(maxcontrolconstraint)){
+				if (p_g[i]>maxcontrolconstraint)p_g[i]=maxcontrolconstraint;
+			}
+		}
+	}
+		
+}
Index: /issm/trunk/src/c/ControlConstrainx/ControlConstrainx.h
===================================================================
--- /issm/trunk/src/c/ControlConstrainx/ControlConstrainx.h	(revision 1)
+++ /issm/trunk/src/c/ControlConstrainx/ControlConstrainx.h	(revision 1)
@@ -0,0 +1,14 @@
+/*!\file:  ControlConstrainx.h
+ * \brief constrain optimization parameters during inverse method
+ */ 
+
+#ifndef _CONTROLCONSTRAINX_H
+#define _CONTROLCONSTRAINX_H
+
+#include "../DataSet/DataSet.h"
+
+/* local prototypes: */
+void ControlConstrainx( double* p_g, int gsize, double mincontrolconstraint, double maxcontrolconstraint,char* control_type);
+
+#endif  /* _CONTROLCONSTRAINX_H */
+
Index: /issm/trunk/src/c/DataInterpx/DataInterpx.cpp
===================================================================
--- /issm/trunk/src/c/DataInterpx/DataInterpx.cpp	(revision 1)
+++ /issm/trunk/src/c/DataInterpx/DataInterpx.cpp	(revision 1)
@@ -0,0 +1,108 @@
+/*!\file:  DataInterpx.cpp
+ * \brief  "c" core code for interpolating values onto a mesh.
+ */ 
+
+#include "./DataInterpx.h"
+#include "../shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "DataInterpx"
+
+int findindices(int* pm,int* pn,double* x,int x_rows, double* y,int y_rows, double xgrid,double ygrid);
+
+int DataInterpx( Vec* pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods) {
+
+	int i;
+	int m,n;
+	int data_mesh_m; //local number of rows for vector data_mesh.
+
+	/*output: */
+	Vec data_mesh=NULL;
+	
+	double x_grid,y_grid;
+	double xi,eta;
+	double G1,G2,G3,G4,data_value;
+
+
+	/*Some checks on arguments: */
+	if ((M<=0)|| (N<=0) || (nods<=0)){
+		throw ErrorException(__FUNCT__," error message: nothing to be done according to the dimensions of input matrices and vectors.");
+	}
+	if(M!=(y_rows-1)){
+		throw ErrorException(__FUNCT__," error message: y vector length should be 1 more than data number of rows.");
+	}
+	if(N!=(x_rows-1)){
+		throw ErrorException(__FUNCT__," error message: x vector length should be 1 more than data number of columns.");
+	}
+
+	/*Allocate output vector: */
+	data_mesh=NewVec(nods);
+
+	/*Nearest interpolation method for now: */
+	for ( i=MPI_Lowerrow(nods); i<MPI_Upperrow(nods); i++) {
+
+		x_grid=*(x_mesh+i);
+		y_grid=*(y_mesh+i);
+
+		/*Find indices m and n into y and x, for which  y(m)<=y_grids<=y(m+1) and x(n)<=x_grid<=x(n+1)*/
+		if(findindices(&n,&m,x,x_rows, y,y_rows, x_grid,y_grid)){
+			
+			/*Do a bilinear interpolation. First find parameter coordinates: */
+			xi=-1.0+2*(x_grid-x[n])/(x[n+1]-x[n]);
+			eta=-1.0+2*(y_grid-y[m])/(y[m+1]-y[m]);
+			/*Then find values of data at each grid: (xi,eta)=(0,0),(1,0),(1,1),(0,1) */
+			G1=*(data+m*N+n);
+			G2=*(data+m*N+n+1);
+			G3=*(data+(m+1)*N+n+1);
+			G4=*(data+(m+1)*N+n);
+			/*Find data_value, by bilinear interpolation: */
+			data_value=G1*(1+xi)*(1+eta)/4.0+ G2*(1-xi)*(1+eta)/4.0+G3*(1-xi)*(1-eta)/4.0+G4*(1+xi)*(1-eta)/4.0;
+
+		}
+		else{
+			data_value=-9999;
+		}
+		VecSetValues(data_mesh,1,&i,&data_value,INSERT_VALUES);
+	}
+
+	/*Assign output pointers:*/
+	*pdata_mesh=data_mesh;
+}
+
+int findindices(int* pm,int* pn,double* x,int x_rows, double* y,int y_rows, double xgrid,double ygrid){
+
+	int foundx=0;
+	int foundy=0;
+	int i;
+	int m=-1;
+	int n=-1;
+
+	for (i=0;i<x_rows-1;i++){
+		if ( (*(x+i)<=xgrid) && (xgrid<*(x+i+1)) ){
+			m=i;
+			foundx= 1;
+			break;
+		}
+	}
+	if(*(x+x_rows-1)==xgrid){
+		m=x_rows-2;
+		foundx=1;
+	}
+	
+	for (i=0;i<y_rows-1;i++){
+		if ( (*(y+i)<=ygrid) && (ygrid<*(y+i+1)) ){
+			n=i;
+			foundy= 1;
+			break;
+		}
+	}
+	if(*(y+y_rows-1)==ygrid){
+		m=y_rows-2;
+		foundy=1;
+	}
+
+	/*Assign output pointers:*/
+	*pm=m;
+	*pn=n;
+	return foundx*foundy;
+}
Index: /issm/trunk/src/c/DataInterpx/DataInterpx.h
===================================================================
--- /issm/trunk/src/c/DataInterpx/DataInterpx.h	(revision 1)
+++ /issm/trunk/src/c/DataInterpx/DataInterpx.h	(revision 1)
@@ -0,0 +1,13 @@
+/*!\file DataInterpx.h
+ * \brief: header file for Data interpolation routines.
+ */
+
+#ifndef _DATAINTERPX_H
+#define _DATAINTERPX_H
+
+#include "../toolkits/toolkits.h"
+
+int DataInterpx( Vec* pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods);
+
+#endif /* _DATAINTERPX_H */
+
Index: /issm/trunk/src/c/DataSet/DataSet.cpp
===================================================================
--- /issm/trunk/src/c/DataSet/DataSet.cpp	(revision 1)
+++ /issm/trunk/src/c/DataSet/DataSet.cpp	(revision 1)
@@ -0,0 +1,1065 @@
+/*
+ * \file DataSet.c
+ * \brief: implementation of the DataSet class
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include <vector>
+#include <functional>
+#include <algorithm>
+#include <iostream>
+
+#include "./DataSet.h"
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+using namespace std;
+
+DataSet::DataSet(){
+	
+	sorted=0;
+	sorted_ids=NULL;
+	id_offsets=NULL;
+
+}
+
+DataSet::DataSet(int dataset_enum){
+	enum_type=dataset_enum;
+	
+	sorted=0;
+	sorted_ids=NULL;
+	id_offsets=NULL;
+
+}
+
+DataSet::~DataSet(){
+	clear();
+	xfree((void**)&sorted_ids);
+	xfree((void**)&id_offsets);
+}
+
+int  DataSet::GetEnum(){
+	return enum_type;
+}
+	
+#undef __FUNCT__
+#define  __FUNCT__ "DataSet::Echo"
+
+void DataSet::Echo(){
+
+	
+	vector<Object*>::iterator object;
+
+	if(this==NULL)throw ErrorException(__FUNCT__," trying to echo a NULL dataset");
+
+	_printf_("DataSet echo: %i objects\n",objects.size());
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Call echo on object: */
+		(*object)->Echo();
+
+	}
+	return;
+}
+
+int DataSet::MarshallSize(){
+
+	vector<Object*>::iterator object;
+	int                      marshalled_dataset_size=0;
+
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		marshalled_dataset_size+= (*object)->MarshallSize();
+	}
+
+	marshalled_dataset_size+=sizeof(int); //objects size
+	marshalled_dataset_size+=sizeof(int); //sorted size
+	if(sorted){
+		marshalled_dataset_size+=(int)objects.size()*sizeof(int); //sorted ids
+		marshalled_dataset_size+=(int)objects.size()*sizeof(int); //id offsets
+	}
+
+	return marshalled_dataset_size;
+}
+#undef __FUNCT__
+#define __FUNCT__ "DataSet::Marshall"
+
+char* DataSet::Marshall(){
+
+	vector<Object*>::iterator object;
+	int                       object_size;
+	int                       marshalled_dataset_size=0;
+	char*                     marshalled_dataset=NULL;
+	char*                     old_marshalled_dataset=NULL;
+
+	/*First get size of marshalled dataset: */
+	object_size=(int)objects.size();
+
+	marshalled_dataset_size=MarshallSize();
+	
+	/*Allocate marshalled dataset: */
+	marshalled_dataset=(char*)xmalloc(marshalled_dataset_size*sizeof(char)); 
+
+	/*Keep track of old_marshalled_dataset: */
+	old_marshalled_dataset=marshalled_dataset;
+
+	/*Store internals of dataset first: */
+	memcpy(marshalled_dataset,&object_size,sizeof(int)); marshalled_dataset+=sizeof(int);
+	memcpy(marshalled_dataset,&sorted,sizeof(int)); marshalled_dataset+=sizeof(int);
+	if(sorted){
+		if(object_size)memcpy(marshalled_dataset,sorted_ids,object_size*sizeof(int)); marshalled_dataset+=object_size*sizeof(int);
+		if(object_size)memcpy(marshalled_dataset,id_offsets,object_size*sizeof(int)); marshalled_dataset+=object_size*sizeof(int);
+	}
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		(*object)->Marshall(&marshalled_dataset);
+	}
+
+	/* Ok, marshalled_dataset now points to the end of the original marshalled_dataset pointer 
+	 * before  we started the loop on objects. Get object to point right again: */
+	marshalled_dataset-=marshalled_dataset_size;
+
+	/*We should be back to old_marshalled_dataset: check and abort if that's not the case, 
+	 * because this is a nasty error: */
+	if (marshalled_dataset!=old_marshalled_dataset){
+		_printf_("%s%s\n",__FUNCT__," error message: final marshalled dataset is different from initial one!");
+		abort();
+	}
+
+	/*Return: */
+	return marshalled_dataset;
+}
+
+int  DataSet::AddObject(Object* object){
+
+	objects.push_back(object);
+	
+	return 1;
+}
+
+int  DataSet::DeleteObject(int id){
+
+	return 0;
+}
+
+int  DataSet::Size(void){
+
+	return objects.size();
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "DataSetDemarshall"
+DataSet* DataSetDemarshall(char* marshalled_dataset){
+
+	int i;
+	
+	DataSet* dataset=NULL;
+	int      numobjects=0;
+	int      enum_type;
+	Object*  object=NULL;
+	int      sorted;
+	int*     sorted_ids=NULL;
+	int*     id_offsets=NULL;
+
+	/*initialize dataset: */
+	dataset=new DataSet();
+
+	/*Get internals first: */
+	memcpy(&numobjects,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
+	memcpy(&sorted,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
+	if(sorted){
+		if(numobjects){
+			sorted_ids=(int*)xmalloc(numobjects*sizeof(int));
+			id_offsets=(int*)xmalloc(numobjects*sizeof(int));
+			memcpy(sorted_ids,marshalled_dataset,numobjects*sizeof(int)); marshalled_dataset+=numobjects*sizeof(int);
+			memcpy(id_offsets,marshalled_dataset,numobjects*sizeof(int)); marshalled_dataset+=numobjects*sizeof(int);
+		}
+		dataset->SetSorting(sorted_ids,id_offsets);
+	}
+
+	#ifdef _DEBUG_
+	_printf_("Number of objects in dataset being demarshalled: %i\n",numobjects);
+	#endif
+
+	for(i=0;i<numobjects;i++){
+	
+		/*get enum type of object: */
+		memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
+
+		if(enum_type==NodeEnum()){
+			Node* node=NULL;
+			node=new Node();
+			node->Demarshall(&marshalled_dataset);
+			dataset->AddObject(node);
+		}
+		else if(enum_type==ParamEnum()){
+			Param* param=NULL;
+			param=new Param();
+			param->Demarshall(&marshalled_dataset);
+			dataset->AddObject(param);
+		}
+		else if(enum_type==TriaEnum()){
+			Tria* tria=NULL;
+			tria=new Tria();
+			tria->Demarshall(&marshalled_dataset);
+			dataset->AddObject(tria);
+		}
+		else if(enum_type==PentaEnum()){
+			Penta* penta=NULL;
+			penta=new Penta();
+			penta->Demarshall(&marshalled_dataset);
+			dataset->AddObject(penta);
+		}
+		else if(enum_type==MaticeEnum()){
+			Matice* matice=NULL;
+			matice=new Matice();
+			matice->Demarshall(&marshalled_dataset);
+			dataset->AddObject(matice);
+		}
+		else if(enum_type==MatparEnum()){
+			Matpar* matpar=NULL;
+			matpar=new Matpar();
+			matpar->Demarshall(&marshalled_dataset);
+			dataset->AddObject(matpar);
+		}
+		else if(enum_type==SpcEnum()){
+			Spc* spc=NULL;
+			spc=new Spc();
+			spc->Demarshall(&marshalled_dataset);
+			dataset->AddObject(spc);
+		}
+		else if(enum_type==PenpairEnum()){
+			Penpair* penpair=NULL;
+			penpair=new Penpair();
+			penpair->Demarshall(&marshalled_dataset);
+			dataset->AddObject(penpair);
+		}
+		else if(enum_type==IcefrontEnum()){
+			Icefront* icefront=NULL;
+			icefront=new Icefront();
+			icefront->Demarshall(&marshalled_dataset);
+			dataset->AddObject(icefront);
+		}
+		else if(enum_type==RgbEnum()){
+			Rgb* rgb=NULL;
+			rgb=new Rgb();
+			rgb->Demarshall(&marshalled_dataset);
+			dataset->AddObject(rgb);
+		}
+		else{
+			throw ErrorException(__FUNCT__,exprintf("%s%i"," could not recognize enum type: ",enum_type));
+		}
+
+	}
+	return dataset;
+
+}
+		
+int   DataSet::FindParam(void* pvalue, char* name){
+
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum()){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if (strcmp(param->GetParameterName(),name)==0){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pvalue);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+}
+
+void   DataSet::NodeRank(int* ranks){
+
+	/*Go through a dataset, and find a Node* object. For this object, 
+	 * ask it to report its cpu rank: */
+	
+	int node_rank;
+	int id;
+	vector<Object*>::iterator object;
+	
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Call echo on object: */
+		if((*object)->Enum()==NodeEnum()){
+			
+			/*Ok, this object is a node, ask which rank it has: */
+			node_rank=(*object)->MyRank();
+			
+			/*Which id does it have: */
+			id=(*object)->GetId();
+
+			/*Plug rank into ranks, according to id: */
+			ranks[id-1]=node_rank; //Matlab ids start at 1.
+		}
+	}
+	return;
+}
+
+
+void  DataSet::DistributeDofs(int numberofnodes,int numdofspernode){
+
+	int  dofcount=0;
+	int* alldofcount=NULL;
+	int* borderdofs=NULL;
+	int* allborderdofs=NULL;
+	int  i;
+	vector<Object*>::iterator object;
+	Node* node=NULL;
+
+	extern int num_procs;
+	extern int my_rank;
+	
+	dofcount=0;
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a node: */
+		if((*object)->Enum()==NodeEnum()){
+
+			node=(Node*)(*object);
+			
+			/*Ok, this object is a node, ask it to distribute dofs, and update the dofcount: */
+			node->DistributeDofs(&dofcount);
+			
+		}
+	}
+
+	/*Ok, now every node has distributed dofs, but locally, and with a dof count starting from 
+	 *0. This means the dofs between all the cpus are not synchronized! We need to synchronize all 
+	 *dof on all cpus, and use those to update the dofs of every node: */
+	
+	alldofcount=(int*)xmalloc(num_procs*sizeof(int));
+	MPI_Gather(&dofcount,1,MPI_INT,alldofcount,1,MPI_INT,0,MPI_COMM_WORLD);
+	MPI_Bcast(alldofcount,num_procs,MPI_INT,0,MPI_COMM_WORLD);
+
+	/*Ok, now every cpu should start its own dof count at the end of the dofcount 
+	 * from cpu-1. : */
+	dofcount=0;
+	if(my_rank==0){
+		dofcount=0;
+	}
+	else{
+		for(i=0;i<my_rank;i++){
+			dofcount+=alldofcount[i];
+		}
+	}
+
+
+	/*Ok, now every cpu knows where his dofs should start. Update the dof count: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a node: */
+		if((*object)->Enum()==NodeEnum()){
+
+			node=(Node*)(*object);
+			
+			/*Ok, this object is a node, ask it to update his dofs: */
+			node->UpdateDofs(dofcount);
+			
+		}
+	}
+
+	/*Finally, remember that cpus may have skipped some nodes, when these nodes were 
+	 * clones: */
+	borderdofs=(int*)xcalloc(numberofnodes*numdofspernode,sizeof(int));
+	allborderdofs=(int*)xcalloc(numberofnodes*numdofspernode,sizeof(int));
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a node: */
+		if((*object)->Enum()==NodeEnum()){
+
+			node=(Node*)(*object);
+			
+			/*Ok, let this object show its border dofs, if is is a border dof: */
+			node->ShowBorderDofs(borderdofs);
+			
+		}
+	}
+	MPI_Allreduce ( (void*)borderdofs,(void*)allborderdofs,numberofnodes*numdofspernode,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
+
+	/*Ok, now every cpu knows everyone else's border node dofs, update the border dofs accordingly: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a node: */
+		if((*object)->Enum()==NodeEnum()){
+
+			node=(Node*)(*object);
+			
+			/*Ok, this object is a node, ask it to update his dofs: */
+			node->UpdateBorderDofs(allborderdofs);
+			
+		}
+	}
+
+
+	/* Free ressources: */
+	xfree((void**)&alldofcount);
+	xfree((void**)&borderdofs);
+	xfree((void**)&allborderdofs);
+	return;
+
+}
+
+		
+void  DataSet::CreatePartitioningVector(Vec* ppartition,int numberofnodes,int numdofspernode){
+
+	/*output: */
+	Vec partition=NULL;
+	vector<Object*>::iterator object;
+	Node* node=NULL;
+
+	/*Create partition vector: */
+	partition=NewVec(numberofnodes*numdofspernode);
+
+	/*Go through all nodes, and ask each node to plug its doflist in 
+	 * partition. The location where each node plugs its doflist into 
+	 * partition is determined by its (id-1)*numdofspernode (ie, serial 
+	 * organisation of the dofs).
+	 */
+	
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a node: */
+		if((*object)->Enum()==NodeEnum()){
+			
+			node=(Node*)(*object);
+			
+			/*Ok, this object is a node, ask it to plug values into partition: */
+			node->CreatePartition(partition);
+			
+		}
+	}
+
+	/*Assemble the petsc vector: */
+	VecAssemblyBegin(partition);
+	VecAssemblyEnd(partition);
+
+	/*Assign output pointers: */
+	*ppartition=partition;
+
+	return;
+}
+
+void  DataSet::FlagClones(int numberofnodes){
+
+	int i;
+	extern int num_procs;
+	
+	int* ranks=NULL;
+	int* minranks=NULL;
+
+	vector<Object*>::iterator object;
+	Node* node=NULL;
+	
+	/*Allocate ranks: */
+	ranks=(int*)xmalloc(numberofnodes*sizeof(int));
+	minranks=(int*)xmalloc(numberofnodes*sizeof(int));
+	
+	for(i=0;i<numberofnodes;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.
+
+	/*Now go through all our nodes and ask them to report to who they belong (which rank): */
+	NodeRank(ranks);
+
+	#ifdef _DEBUG_
+	for(i=0;i<numberofnodes;i++){
+		_printf_("%i\n",ranks[i]);
+	}
+	#endif
+
+	/*We need to take the minimum rank for each node, and every cpu needs to get that result. That way, 
+	 * when we start building the dof list for all nodes, a cpu can check whether its node already has been 
+	 * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing 
+	 * order of cpu rank. This is also why we initialized this array to num_procs.*/
+	MPI_Allreduce ( (void*)ranks,(void*)minranks,numberofnodes,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
+
+	#ifdef _DEBUG_
+	for(i=0;i<numberofnodes;i++){
+		_printf_("%i\n",minranks[i]);
+	}
+	#endif
+
+	/*Now go through all nodes, and use minranks to flag which nodes are cloned: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a node: */
+		if((*object)->Enum()==NodeEnum()){
+			
+			node=(Node*)(*object);
+			
+			/*Ok, this object is a node, ask it to plug values into partition: */
+			node->SetClone(minranks);
+			
+		}
+	}
+
+	/*Free ressources: */
+	xfree((void**)&ranks); 
+	xfree((void**)&minranks);
+
+}
+		
+
+int   DataSet::NumberOfDofs(){
+
+
+	vector<Object*>::iterator object;
+	Node* node=NULL;
+	int   numdofs=0;
+	int   allnumdofs;
+
+	/*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a node: */
+		if((*object)->Enum()==NodeEnum()){
+			
+			node=(Node*)(*object);
+			
+			/*Ok, this object is a node, ask it to plug values into partition: */
+			if (!node->IsClone()){
+
+				numdofs+=node->GetNumberOfDofs();
+				
+			}
+		}
+	}
+
+	/*Gather from all cpus: */
+	MPI_Allreduce ( (void*)&numdofs,(void*)&allnumdofs,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+
+	return allnumdofs;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "DataSet::SetupSpcs"
+		
+void   DataSet::SetupSpcs(DataSet* nodes,Vec yg){
+
+	vector<Object*>::iterator object;
+	Spc* spc=NULL;
+	Node* node=NULL;
+
+	int nodeid;
+	int dof;
+	double value;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a single point constraint (spc): */
+		if((*object)->Enum()==SpcEnum()){
+			
+			spc=(Spc*)(*object);
+			
+			/*Ok, this object is a constraint. Get the nodeid from the node it applies to: */
+			nodeid=spc->GetNodeId();
+			dof=spc->GetDof();
+			value=spc->GetValue();
+
+			/*Now, chase through nodes and find the corect node: */
+			node=(Node*)nodes->GetObjectById(NULL,nodeid);
+
+			/*Apply constraint: */
+			if(node){ //in case the spc is dealing with a node on another cpu
+				node->ApplyConstraint(yg,dof,value);
+			}
+
+		}
+	}
+
+	/*Assemble yg: */
+	VecAssemblyBegin(yg);
+	VecAssemblyEnd(yg);
+}
+		
+
+		
+int   DataSet::NumberOfRgbs(){
+
+	vector<Object*>::iterator object;
+	Rgb* rgb=NULL;
+	int  count=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a single point constraint (spc): */
+		if((*object)->Enum()==RgbEnum()){ //we assume uniqueness of all Rgbs, no error checking here.
+
+			count++;
+
+		}
+	}
+
+	return count;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__  "DataSet::SetupMpcs"
+void DataSet::SetupMpcs(Mat Rmg,DataSet* nodes){
+
+	vector<Object*>::iterator object;
+	Rgb* rgb=NULL;
+	int  nodeid1;
+	int  nodeid2;
+	int  dof;
+
+	int  dof1;
+	int  dof2;
+
+
+	Node* node1=NULL;
+	Node* node2=NULL;
+
+	int count=-1;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a single point constraint (spc): */
+		if((*object)->Enum()==RgbEnum()){ //we assume uniqueness of all Rgbs, no error checking here.
+
+			/*we found an rgb, increment counter, so that row index for Rmg is up to date: */
+			count++;
+			rgb=(Rgb*)(*object);
+
+
+			nodeid1=rgb->GetNodeId1();
+			nodeid2=rgb->GetNodeId2();
+			dof=rgb->GetDof();
+
+			/*For this rgb, find the nodes that go with it: */
+			node1=(Node*)nodes->GetObjectById(NULL,nodeid1);
+			node2=(Node*)nodes->GetObjectById(NULL,nodeid2);
+
+			if ((node1 && !node2) || (!node1 && node2)){
+				/*we are missing one node, not good!*/
+				throw ErrorException(__FUNCT__,exprintf("%s%p%s%p"," in Rgb, missing one node. node1: ",node1," node2: ",node2));
+			}
+
+			if(!node1 && !node2){
+				/*That's ok, this Rgb can't find those nodes, so leave them alone. They are probably not on this 
+				 * cpu!*/
+			}
+			else{
+				/*Ok, this cpu owns both nodes. Put dof for node1 into m set: */
+				node1->DofInMSet(dof-1);
+				
+
+				/*Plug values into Rmg. We essentially want dofs from node1 and node2 to be the 
+				 *same: */
+				dof1=node1->GetDof(dof-1); //matlab indexing
+				dof2=node2->GetDof(dof-1); //matlab indexing
+
+				MatSetValue(Rmg,count,dof1,1.0,INSERT_VALUES);
+				MatSetValue(Rmg,count,dof2,-1.0,INSERT_VALUES);
+
+			}
+		}
+	}
+}
+	
+void DataSet::FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s){
+
+	vector<Object*>::iterator object;
+	Node* node=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Check this is a single point constraint (spc): */
+		if((*object)->Enum()==NodeEnum()){
+			
+			node=(Node*)(*object);
+
+			/*Plug set values intp our 4 set vectors: */
+			node->CreateVecSets(pv_g,pv_m,pv_n,pv_f,pv_s);
+
+		}
+	}
+
+	/*Assemble: */
+	VecAssemblyBegin(pv_g);
+	VecAssemblyEnd(pv_g);
+
+	VecAssemblyBegin(pv_m);
+	VecAssemblyEnd(pv_m);
+
+	VecAssemblyBegin(pv_n);
+	VecAssemblyEnd(pv_n);
+
+	VecAssemblyBegin(pv_f);
+	VecAssemblyEnd(pv_f);
+
+	VecAssemblyBegin(pv_s);
+	VecAssemblyEnd(pv_s);
+
+}
+void  DataSet::clear(){
+	
+	vector<Object*>::iterator object;
+	
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		delete (*object);
+		object=objects.erase(object);
+	}
+}
+
+
+void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials){
+
+	vector<Object*>::iterator object;
+	Element* element=NULL;
+	Load* load=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		
+		if(EnumIsElement((*object)->Enum())){
+
+
+			element=(Element*)(*object);
+
+			element->Configure(loads,nodes,materials);
+		}
+		if(EnumIsLoad((*object)->Enum())){
+
+			load=(Load*)(*object);
+
+			load->Configure(elements,nodes,materials);
+		}
+
+	}
+
+}
+
+void DataSet::Presort(){
+	
+	/*vector of objects is already sorted, just allocate the sorted ids and their
+	 * offsets:*/
+	int i;
+
+	if(objects.size()){
+		sorted_ids=(int*)xmalloc(objects.size()*sizeof(int));
+		id_offsets=(int*)xmalloc(objects.size()*sizeof(int));
+		for(i=0;i<objects.size();i++){
+			id_offsets[i]=i;
+			sorted_ids[i]=objects[i]->GetId();
+		}
+	}
+
+	/*set sorted flag: */
+	sorted=1;
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "DataSet::Sort"
+void DataSet::Sort(){
+
+	/*Only sort if we are not already sorted: */
+	if(!sorted){
+		throw ErrorException(__FUNCT__," not implemented yet!");
+	}
+}
+
+
+Object* DataSet::GetObjectByOffset(int offset){
+
+	return objects[offset];
+
+}
+
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GetObjectById"
+Object* DataSet::GetObjectById(int* poffset,int eid){
+
+	int id_offset;
+	int offset;
+	int i;
+
+	if(!sorted)throw ErrorException(__FUNCT__," trying to binary search on a non-sorted dataset!");
+
+	/*Carry out a binary search on the sorted_ids: */
+	if(!binary_search(&id_offset,eid, sorted_ids,objects.size())){
+		throw ErrorException(__FUNCT__,exprintf("%s%i"," could not find object with id ",eid));
+	}
+
+	/*Convert  the id offset into sorted offset: */
+	offset=id_offsets[id_offset];
+
+	/*Assign output pointers if requested:*/
+	if (poffset)*poffset=offset;
+
+	/*Return object at offset position in objects :*/
+	return objects[offset];
+}
+
+
+#undef __FUNCT__
+#define __FUNCT__ "DataSet::SetSorting"
+
+void DataSet::SetSorting(int* in_sorted_ids,int* in_id_offsets){
+
+	sorted=1;
+	sorted_ids=in_sorted_ids;
+	id_offsets=in_id_offsets;
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "DataSet::CreateKMatrix"
+void  DataSet::CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type){
+
+	vector<Object*>::iterator object;
+	Element* element=NULL;
+	Load* load=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		
+		if(EnumIsElement((*object)->Enum())){
+
+			element=(Element*)(*object);
+			element->CreateKMatrix(Kgg,inputs,analysis_type);
+		}
+		if(EnumIsLoad((*object)->Enum())){
+
+			load=(Load*)(*object);
+			load->CreateKMatrix(Kgg,inputs,analysis_type);
+		}
+	}
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "DataSet::CreatePVector"
+void  DataSet::CreatePVector(Vec pg,ParameterInputs* inputs,int analysis_type){
+
+	vector<Object*>::iterator object;
+	Element* element=NULL;
+	Load* load=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		if(EnumIsElement((*object)->Enum())){
+
+			element=(Element*)(*object);
+			element->CreatePVector(pg,inputs,analysis_type);
+		}
+		if(EnumIsLoad((*object)->Enum())){
+
+			load=(Load*)(*object);
+			load->CreatePVector(pg,inputs,analysis_type);
+		}		
+	}
+
+}
+
+#undef __FUNCT__		
+#define __FUNCT__ "UpdateFromInputs"
+void  DataSet::UpdateFromInputs(ParameterInputs* inputs){
+
+	vector<Object*>::iterator object;
+	Element* element=NULL;
+	Load* load=NULL;
+	Material* material=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		if(EnumIsElement((*object)->Enum())){
+
+			element=(Element*)(*object);
+			element->UpdateFromInputs(inputs);
+		}
+		if(EnumIsLoad((*object)->Enum())){
+
+			load=(Load*)(*object);
+			load->UpdateFromInputs(inputs);
+		}
+		if(EnumIsMaterial((*object)->Enum())){
+
+			material=(Material*)(*object);
+			material->UpdateFromInputs(inputs);
+		}		
+	}
+
+}
+
+
+#undef __FUNCT__
+#define __FUNCT__ "DataSet::PenaltyCreateKMatrix"
+void  DataSet::PenaltyCreateKMatrix(Mat Kgg,ParameterInputs* inputs,double kmax,int analysis_type){
+
+	vector<Object*>::iterator object;
+	Load* load=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		
+		if(EnumIsLoad((*object)->Enum())){
+
+			load=(Load*)(*object);
+			load->PenaltyCreateKMatrix(Kgg,inputs,kmax,analysis_type);
+		}
+	}
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "DataSet::PenaltyCreatePVector"
+void  DataSet::PenaltyCreatePVector(Vec pg,ParameterInputs* inputs,double kmax,int analysis_type){
+
+	vector<Object*>::iterator object;
+	Load* load=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		if(EnumIsLoad((*object)->Enum())){
+
+			load=(Load*)(*object);
+			load->PenaltyCreatePVector(pg,inputs,kmax,analysis_type);
+		}		
+	}
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "RiftIsPresent"
+int   DataSet::RiftIsPresent(){
+
+	return 0; //for now
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "RiftConstraints"
+void  DataSet::RiftConstraints(int* pnum_unstable_constraints,ParameterInputs* inputs,int analysis_type){
+	
+	throw ErrorException(__FUNCT__," not implemented yet!");
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "MeltingIsPresent"
+int   DataSet::MeltingIsPresent(){
+
+
+	return 0; //for now
+	
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "MeltingConstraints"
+void  DataSet::MeltingConstraints(int* pnum_unstable_constraints,ParameterInputs* inputs,int analysis_type){
+
+	throw ErrorException(__FUNCT__," not implemented yet!");
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "DataSet::Copy"
+DataSet*   DataSet::Copy(void){
+
+
+	DataSet* copy=NULL;
+	vector<Object*>::iterator object;
+	Object* object_copy=NULL;
+
+	copy=new DataSet(enum_type);
+
+	copy->sorted=sorted;
+	copy->presorted=presorted;
+	if(sorted_ids){
+		copy->sorted_ids=(int*)xmalloc(objects.size()*sizeof(int));
+		memcpy(copy->sorted_ids,sorted_ids,objects.size()*sizeof(int));
+	}
+	if(id_offsets){
+		copy->sorted_ids=(int*)xmalloc(objects.size()*sizeof(int));
+		memcpy(copy->sorted_ids,id_offsets,objects.size()*sizeof(int));
+	}
+
+	/*Now we need to deep copy the objects: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Call echo on object: */
+		object_copy = (*object)->copy();
+		copy->AddObject(object_copy);
+	}
+	return copy;
+}
+
+
+void  DataSet::Du(Vec du_g,double*  u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type){
+
+
+	vector<Object*>::iterator object;
+	Element* element=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		
+		if(EnumIsElement((*object)->Enum())){
+
+			element=(Element*)(*object);
+			element->Du(du_g,u_g,u_g_obs,inputs,analysis_type);
+		}
+	}
+
+
+}
+
+void  DataSet::Gradj(Vec grad_g,double*  u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type,char* control_type){
+
+
+	vector<Object*>::iterator object;
+	Element* element=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		
+		if(EnumIsElement((*object)->Enum())){
+
+			element=(Element*)(*object);
+			element->Gradj(grad_g,u_g,lambda_g,inputs,analysis_type,control_type);
+		}
+	}
+
+
+}		
+		
+void  DataSet::Misfit(double* pJ, double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type){
+
+	double J=0;;
+	
+	vector<Object*>::iterator object;
+	Element* element=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		
+		if(EnumIsElement((*object)->Enum())){
+
+			element=(Element*)(*object);
+			J+=element->Misfit(u_g,u_g_obs,inputs,analysis_type);
+
+		}
+	}
+
+	/*Assign output pointers:*/
+	*pJ=J;
+
+}
Index: /issm/trunk/src/c/DataSet/DataSet.h
===================================================================
--- /issm/trunk/src/c/DataSet/DataSet.h	(revision 1)
+++ /issm/trunk/src/c/DataSet/DataSet.h	(revision 1)
@@ -0,0 +1,86 @@
+/*
+ * DataSet.h:
+ * \brief Class that holds objects.
+ * \file DataSet.h This prototype defines a DataSet, capable of holding any type of 
+ * objects (using the abstract class Object). 
+ */
+
+
+#ifndef DATASET_H_
+#define DATASET_H_
+
+#include "../objects/Object.h"
+#include "../objects/ParameterInputs.h"
+#include <vector>
+#include "../toolkits/toolkits.h"
+
+using namespace std;
+
+class DataSet {
+	
+	private: 
+		/*internals: */
+		vector<Object*> objects;
+		
+		/*type of dataset: */
+		int             enum_type;
+		
+		/*sorting: */
+		int             sorted;
+		int             presorted;
+		int*            sorted_ids;
+		int*            id_offsets;
+
+	public:
+		DataSet();
+		DataSet(int enum_type);
+		~DataSet();
+
+		int   GetEnum();
+		void  Echo();
+		char* Marshall();
+		int   MarshallSize();
+		int   AddObject(Object* object);
+		int   DeleteObject(int id);
+		int   Size();
+		int   FindParam(void* pvalue, char* name);
+		void  NodeRank(int* ranks);
+		void  DistributeDofs(int numberofnodes,int numdofspernode);
+		void  CreatePartitioningVector(Vec* ppartition,int numnods,int numdofspernode);
+		void  DistributeNumDofs(int** pnumdofspernode,int numberofnodes,int analysis_type);
+		void  FlagClones(int numberofnodes);
+		int   NumberOfDofs();
+		int   NumberOfRgbs();
+		void  SetupSpcs(DataSet* nodes,Vec yg);
+		void  SetupMpcs(Mat Rmg,DataSet* nodes);
+		void  FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s);
+		void  clear();
+		void  Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials);
+		Object* GetObjectByOffset(int offset);
+		Object* GetObjectById(int* poffset,int eid);
+		void  Presort();
+		void  SetSorting(int* in_sorted_ids,int* in_id_offsets);
+		void  Sort();
+		void  CreateKMatrix(Mat Kgg,ParameterInputs* inputs, int analysis_type);
+		void  CreatePVector(Vec pg,ParameterInputs* inputs, int analysis_type);
+		void  UpdateFromInputs(ParameterInputs* inputs);
+		void  PenaltyCreateKMatrix(Mat Kgg,ParameterInputs* inputs,double kmax,int analysis_type);
+		void  PenaltyCreatePVector(Vec pg,ParameterInputs* inputs,double kmax,int analysis_type);
+		int   RiftIsPresent();
+		void  RiftConstraints(int* pnum_unstable_constraints,ParameterInputs* inputs,int analysis_type);
+		int   MeltingIsPresent();
+		void  MeltingConstraints(int* pnum_unstable_constraints,ParameterInputs* inputs,int analysis_type);
+		DataSet* Copy(void);
+		void  Du(Vec du_g,double*  u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type);
+		void  Gradj(Vec grad_g,double*  u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type,char* control_type);
+		void  Misfit(double* pJ, double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type);
+
+
+
+};
+
+
+/*This routine cannot be object oriented, but need for demarshalling: */
+DataSet* DataSetDemarshall(char* marshalled_dataset);
+
+#endif
Index: /issm/trunk/src/c/Dofx/Dofx.cpp
===================================================================
--- /issm/trunk/src/c/Dofx/Dofx.cpp	(revision 1)
+++ /issm/trunk/src/c/Dofx/Dofx.cpp	(revision 1)
@@ -0,0 +1,60 @@
+/*!\file Dofx
+ * \brief: establish degrees of freedom for all nodes
+ */
+
+#include "./Dofx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Dofx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+int Dofx( Vec* ppartition, Vec* ptpartition,DataSet* elements,DataSet* nodes, DataSet* params) {
+
+	int noerr=1;
+	int i;
+
+	int  found=0;
+	extern int num_procs;
+	extern int my_rank;
+	
+	/*intermediary: */
+	int  numberofnodes;
+	int  numberofdofspernode;
+
+	/*output: */
+	Vec partition=NULL;
+	Vec tpartition=NULL;
+
+	/*First, recover number of grids from parameters: */
+	found=params->FindParam((void*)&numberofnodes,"numberofnodes");
+	if(!found)throw ErrorException(__FUNCT__," could not find numberofnodes in parameters");
+
+	/*Recover number of dofs per node: */
+	found=params->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
+	if(!found)throw ErrorException(__FUNCT__," could not find numberofdofspernode in parameters");
+
+	/*Ensure that only for each cpu, the partition border nodes only will be taken into account once 
+	 * across the cluster. To do so, we flag all the clone nodes: */
+	nodes->FlagClones(numberofnodes);
+
+	/*Go through all nodes, and build degree of freedom lists. Each node gets a fixed number of dofs. When 
+	 *a  node has already been distributed dofs on one cpu, all other cpus with the same node cannot distribute it 
+	 *anymore. Use clone field to be sure of that: */
+	nodes->DistributeDofs(numberofnodes,numberofdofspernode);
+
+	/*Now that dofs have been distributed, create partitioning vector and its transpose: */
+	nodes->CreatePartitioningVector(&partition,numberofnodes,numberofdofspernode);
+
+	/*Transpose partition into tpartition: */
+	VecTranspose(&tpartition,partition);
+	
+	/*Assign output pointers: */
+	*ppartition=partition;
+	*ptpartition=tpartition;
+	
+	return noerr;
+}
Index: /issm/trunk/src/c/Dofx/Dofx.h
===================================================================
--- /issm/trunk/src/c/Dofx/Dofx.h	(revision 1)
+++ /issm/trunk/src/c/Dofx/Dofx.h	(revision 1)
@@ -0,0 +1,14 @@
+/*!\file:  Dofx.h
+ * \brief header file for degree of freedoms distribution routines.
+ */ 
+
+#ifndef _DOFX_H
+#define _DOFX_H
+
+#include "../DataSet/DataSet.h"
+
+/* local prototypes: */
+int		Dofx( Vec* partition, Vec* ptpartition,DataSet* elements,DataSet* nodesin,DataSet* params);
+
+#endif  /* _DOFX_H */
+
Index: /issm/trunk/src/c/Dux/Dux.cpp
===================================================================
--- /issm/trunk/src/c/Dux/Dux.cpp	(revision 1)
+++ /issm/trunk/src/c/Dux/Dux.cpp	(revision 1)
@@ -0,0 +1,44 @@
+/*!\file Dux
+ * \brief: diff between observed and modeled velocity
+ */
+
+#include "./Dux.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Dux"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+		double* u_g, double* u_g_obs, ParameterInputs* inputs,int analysis_type){
+
+	int i;
+	int gsize;
+	int found;
+
+	/*output: */
+	Vec du_g=NULL;
+
+	/*First, get elements and loads configured: */
+	elements->Configure(elements,loads, nodes, materials);
+
+	/*Get size of matrix: */
+	gsize=nodes->NumberOfDofs();
+
+	/*Allocate du_g: */
+	du_g=NewVec(gsize);
+
+	/*Compute velocity difference: */
+	elements->Du(du_g, u_g,u_g_obs,inputs,analysis_type);
+
+	/*Assemble vector: */
+	VecAssemblyBegin(du_g);
+	VecAssemblyEnd(du_g);
+
+	/*Assign output pointers: */
+	*pdu_g=du_g;
+	
+}
Index: /issm/trunk/src/c/Dux/Dux.h
===================================================================
--- /issm/trunk/src/c/Dux/Dux.h	(revision 1)
+++ /issm/trunk/src/c/Dux/Dux.h	(revision 1)
@@ -0,0 +1,15 @@
+/*!\file:  Dux.h
+ * \brief header file for degree of freedoms distribution routines.
+ */ 
+
+#ifndef _DUX_H
+#define _DUX_H
+
+#include "../DataSet/DataSet.h"
+
+/* local prototypes: */
+void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+		double* u_g, double* u_g_obs, ParameterInputs* inputs,int analysis_type);
+
+#endif  /* _DUX_H */
+
Index: /issm/trunk/src/c/EnumDefinitions/.deps/EnumDefinitions.Po
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/.deps/EnumDefinitions.Po	(revision 1)
+++ /issm/trunk/src/c/EnumDefinitions/.deps/EnumDefinitions.Po	(revision 1)
@@ -0,0 +1,3 @@
+EnumDefinitions.o EnumDefinitions.o: EnumDefinitions.c EnumDefinitions.h
+
+EnumDefinitions.h:
Index: /issm/trunk/src/c/EnumDefinitions/AnalysisTypeAsEnum.cpp
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/AnalysisTypeAsEnum.cpp	(revision 1)
+++ /issm/trunk/src/c/EnumDefinitions/AnalysisTypeAsEnum.cpp	(revision 1)
@@ -0,0 +1,45 @@
+/* \file AnalysisTypeAsEnum.cpp
+ * \brief get integer enum instead of a string
+ */
+
+#include "./EnumDefinitions.h"
+#include "../shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "AnalysisTypeAsEnum"
+
+int AnalysisTypeAsEnum(char* analysis_type){
+
+
+	if (strcmp(analysis_type,"control")==0){
+		return ControlAnalysisEnum();
+	}
+	else if (strcmp(analysis_type,"diagnostic_horiz")==0){
+		return DiagnosticHorizAnalysisEnum();
+	}
+	else if (strcmp(analysis_type,"diagnostic_vert")==0){
+		return DiagnosticVertAnalysisEnum();
+	}
+	else if (strcmp(analysis_type,"diagnostic_basevert")==0){
+		return DiagnosticBaseVertAnalysisEnum();
+	}
+	else if (strcmp(analysis_type,"prognostic")==0){
+		return PrognosticAnalysisEnum();
+	}
+	else if (strcmp(analysis_type,"thermalsteady")==0){
+		return ThermalSteadyAnalysisEnum();
+	}
+	else if (strcmp(analysis_type,"thermaltransient")==0){
+		return ThermalTransientAnalysisEnum();
+	}
+	else if (strcmp(analysis_type,"melting")==0){
+		return MeltingAnalysisEnum();
+	}
+	else if (strcmp(analysis_type,"diagnostic_stokes")==0){
+		return DiagnosticStokesAnalysisEnum();
+	}
+	else throw ErrorException(__FUNCT__," could not recognized analysis type!");
+
+}
+
+
Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp	(revision 1)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp	(revision 1)
@@ -0,0 +1,76 @@
+/*
+ * \file EnumDefinitions.cpp:
+ * \brief: enum functions for our objects
+ */
+
+#include "./EnumDefinitions.h"
+
+/*objects: */
+int NodeEnum(void){                     return           1; }
+int SpcEnum(void){                      return           4; }
+int ParamEnum(void){                    return           5; }
+int RgbEnum(void){                      return           6; }
+
+
+
+/*analysis types: */
+int StructuralAnalysisEnum(void){       return          20; }
+int ThermalAnalysisEnum(void){          return          21; }
+int ControlAnalysisEnum(void){          return          22; }
+int DiagnosticHorizAnalysisEnum(void){  return          23; }
+int DiagnosticVertAnalysisEnum(void){   return          24; }
+int DiagnosticBaseVertAnalysisEnum(void){ return        25; }
+int PrognosticAnalysisEnum(void){       return          26; }
+int ThermalSteadyAnalysisEnum(void)	{   return          27; }
+int ThermalTransientAnalysisEnum(void){ return          28; }
+int MeltingAnalysisEnum(void){          return          29; }
+int DiagnosticStokesAnalysisEnum(void){ return          30; }
+
+/*datasets: */
+int ElementsEnum(void){                 return          40; }
+int NodesEnum(void){                    return          41; }
+int ConstraintsEnum(void){              return          42; }
+int LoadsEnum(void){                    return          43; }
+int MaterialsEnum(void){                return          44; }
+int ParametersEnum(void){               return          45; }
+
+
+/*Elements: */
+int ElementEnum(void){                  return         100; }
+int TriaEnum(void){                     return         101; }
+int PentaEnum(void){                    return         102; }
+
+/*Loads: */
+int LoadEnum(void){                     return         200; }
+int IcefrontEnum(void){                 return         201; }
+int PenpairEnum(void){                  return         202; }
+
+/*Materials: */
+int MaterialEnum(void){                 return         300; }
+int MaticeEnum(void){                   return         301; }
+int MatparEnum(void){                   return         302; }
+
+/*formulations: */
+int NoneEnum(void){                     return           0; }
+int HutterEnum(void){                   return           1; }
+int MacAyealEnum(void){                 return           2; }
+int PattynEnum(void){                   return           3; }
+int StokesEnum(void){                   return           4; }
+
+
+/*functions on enums: */
+int EnumIsElement(int en){
+	if ((en>=100) && (en<=110))return 1;
+	else return 0;
+}
+
+int EnumIsLoad(int en){
+	if ((en>=200) && (en<=210))return 1;
+	else return 0;
+}
+int EnumIsMaterial(int en){
+	if ((en>=300) && (en<=310))return 1;
+	else return 0;
+}
+
+
Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 1)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 1)
@@ -0,0 +1,56 @@
+/*
+ * \file EnumDefinitions.h:
+ * \brief: enum functions for our objects
+ */
+
+#ifndef _ENUM_DEFINITIONS_
+#define _ENUM_DEFINITIONS_
+
+/*objects: */
+int NodeEnum(void);
+int TriaEnum(void);
+int PentaEnum(void);
+int MaterialEnum(void);
+int MaticeEnum(void);
+int MatparEnum(void);
+int SpcEnum(void);
+int PenpairEnum(void);
+int IcefrontEnum(void);
+int ParamEnum(void);
+int ElementEnum(void);
+int LoadEnum(void);
+int RgbEnum(void);
+
+/*formulations: */
+int NoneEnum(void);
+int HutterEnum(void);
+int MacAyealEnum(void);
+int PattynEnum(void);
+int StokesEnum(void);
+
+/* analysis enums: */
+int ControlAnalysisEnum(void);
+int DiagnosticHorizAnalysisEnum(void);
+int DiagnosticVertAnalysisEnum(void);
+int DiagnosticBaseVertAnalysisEnum(void);
+int PrognosticAnalysisEnum(void);
+int ThermalSteadyAnalysisEnum(void);
+int ThermalTransientAnalysisEnum(void);
+int MeltingAnalysisEnum(void);
+int DiagnosticStokesAnalysisEnum(void);
+
+
+/*datasets: */
+int ElementsEnum(void);
+int NodesEnum(void);
+int ConstraintsEnum(void);
+int LoadsEnum(void);
+int MaterialsEnum(void);
+int ParametersEnum(void);
+
+/*Functions on enums: */
+int EnumIsElement(int en);
+int EnumIsLoad(int en);
+int EnumIsMaterial(int en);
+int AnalysisTypeAsEnum(char* analysis_type);
+#endif
Index: /issm/trunk/src/c/Gradjx/Gradjx.cpp
===================================================================
--- /issm/trunk/src/c/Gradjx/Gradjx.cpp	(revision 1)
+++ /issm/trunk/src/c/Gradjx/Gradjx.cpp	(revision 1)
@@ -0,0 +1,43 @@
+/*!\file Gradjx
+ * \brief: compute inverse method gradient
+ */
+
+#include "./Gradjx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Gradjx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+void Gradjx( Vec* pgrad_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+		double* u_g, double* lambda_g, ParameterInputs* inputs,int analysis_type,char* control_type){
+
+	int i;
+	int gsize;
+	int found;
+
+	/*output: */
+	Vec grad_g=NULL;
+
+	/*First, get elements and loads configured: */
+	elements->Configure(elements,loads, nodes, materials);
+
+	/*Get size of matrix: */
+	gsize=nodes->NumberOfDofs();
+
+	/*Allocate grad_g: */
+	grad_g=NewVec(gsize);
+
+	/*Compute gradients: */
+	elements->Gradj(grad_g, u_g,lambda_g,inputs,analysis_type,control_type);
+
+	/*Assemble vector: */
+	VecAssemblyBegin(grad_g);
+	VecAssemblyEnd(grad_g);
+
+	/*Assign output pointers: */
+	*pgrad_g=grad_g;
+}
Index: /issm/trunk/src/c/Gradjx/Gradjx.h
===================================================================
--- /issm/trunk/src/c/Gradjx/Gradjx.h	(revision 1)
+++ /issm/trunk/src/c/Gradjx/Gradjx.h	(revision 1)
@@ -0,0 +1,15 @@
+/*!\file:  Gradjx.h
+ * \brief header file for inverse methods gradient computation
+ */ 
+
+#ifndef _GRADJX_H
+#define _GRADJX_H
+
+#include "../DataSet/DataSet.h"
+
+/* local prototypes: */
+void Gradjx( Vec* pgrad_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+		double* u_g, double* lambda_g, ParameterInputs* inputs,int analysis_type,char* control_type);
+
+#endif  /* _GRADJX_H */
+
Index: /issm/trunk/src/c/HoleFillerx/HoleFillerCrippen.c
===================================================================
--- /issm/trunk/src/c/HoleFillerx/HoleFillerCrippen.c	(revision 1)
+++ /issm/trunk/src/c/HoleFillerx/HoleFillerCrippen.c	(revision 1)
@@ -0,0 +1,1294 @@
+/* Hole Filler                   Version 2003.04.22              */
+/* Grow hole edges one pixel at a time by interpolation.         */
+/*                                                               */
+/* Only fills void pixels that are next to non-void pixels.      */
+/* Interpolates in eight directions using weighted average.      */
+/* Iterates on the entire image until all voids are filled.      */
+/* Thus grows edges by interpolation - best of both worlds.      */
+/* Smoothing option is slow but effective (two-byte data only).  */
+
+/* There is a lot of experimental code here.                     */
+/* The program was intended to do two iterations in each pass    */
+/* through the code and the screen output indicates that.        */
+/* Input A --> Output B becomes Input B --> Output A in memory.  */
+/* For experimental purposes this was bypassed so that the code  */
+/* could be written just once.                                   */
+/* Instead, for now, Output B is copied to Input A for the next  */
+/* iteration.                                                    */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+#include <string.h>
+
+int number_input();
+int yes_no_input();
+
+main(void)
+{
+	FILE 			*fp1, *fp2;
+	char			file1name[400], file2name[400], pause[400];
+	unsigned long	filesize;
+	long			lines, samps, infinit, temp;
+	long			i, j, k, ii, jj, bytes;
+	long			iii, jjj;
+	long			count, test, prevlines, prevpix, test1, test2, thresh;
+	long			bell, cycles, leftovers, smooth;
+	float			howlong;
+	float			nsteps, ssteps, wsteps, esteps;
+	float			nwsteps, nesteps, swsteps, sesteps;
+	float			north, south, east, west;
+	float			nw, sw, ne, se, elev, range;
+	float			nnesteps, enesteps, esesteps, ssesteps;
+	float			sswsteps, wswsteps, wnwsteps, nnwsteps;
+	float			nne, ene, ese, sse;
+	float			ssw, wsw, wnw, nnw;	
+	float			sum;
+	
+	time_t			t1, t2;
+	
+	unsigned char	**dns1 , **dns2 , **dns3 , *buffy ;
+	unsigned short	**dns01, **dns02, **dns03, *buffy2;
+	
+	printf( "\n" ); 
+	
+	printf( ">>> Hole Filler                   Version 2003.04.22              <<<\n" ); 
+	printf( ">>> Grow hole edges one pixel at a time by interpolation.         <<<\n" );
+	printf( ">>>                                                               <<<\n" );
+	printf( ">>> Only fills void pixels that are next to non-void pixels.      <<<\n" );
+	printf( ">>> Interpolates in eight directions using weighted average.      <<<\n" );
+	printf( ">>> Iterates on the entire image until all voids are filled.      <<<\n" );
+	printf( ">>> Thus grows edges by interpolation - best of both worlds.      <<<\n" );
+	printf( ">>> Smoothing option is slow but effective (two-byte data only).  <<<\n" );
+	
+	retry1:
+	printf( "\nEnter INPUT IMAGE file NAME: " );
+	gets(file1name);
+	if ( (fp1 = fopen( file1name, "rb")) == NULL ) 
+		{ printf( "*** No such file found! *** \a\n" ); 
+		  goto retry1; }
+	
+	fseek( fp1, 0, SEEK_END );
+	filesize = ftell( fp1 );
+	fseek( fp1, 0, SEEK_SET );
+	
+	count = 0;
+	
+	printf( "\nData Type ( Default = ONE-BYTE ), type '2' for two-byte data: ");
+	bytes = number_input();  if ( bytes > 1 ) bytes = 2; else bytes = 1;
+	if ( bytes == 1 )   printf( "ONE-BYTE data specified.\n");
+				 else { printf( "TWO-BYTE data specified.\n"); goto twobyte; }
+	
+
+	retry2:	
+	do { printf( "\nNumber of SAMPS in image: ");
+		  samps = number_input();
+		  if (samps < 1) printf( "*** Must be positive integer. *** \a\n" );
+	    } while ( samps < 1 );
+	
+	if ( filesize % samps ) 
+	{ 
+		printf( "*** Number of SAMPS is INCORRECT for file.  *** \n" );
+		printf( "***  It has %ld pixels.  ", filesize );
+		printf( "That is %6.5f lines.  ***\n\a", (float)filesize / samps );
+		goto retry2;
+	} 
+	
+	lines = filesize / samps;
+	printf( "Number of LINES in image = %ld \n", lines );
+	infinit = lines + samps;
+	
+	/* No smoothing yet for one-byte.
+	
+	retry4:
+	printf( "\nSMOOTH the output with a boxfilter? ( Default = Yes, else type 'no'): ");
+	smooth = yes_no_input();
+	if ( smooth == 0 )  printf("Data patches will be SMOOTHED. \n");
+	if ( smooth == 1 )  printf("Data patches will NOT be smoothed. \n");
+	
+	*/
+	
+	retry3:
+	printf( "\nEnter OUTPUT IMAGE file NAME: " );
+	gets(file2name);  
+	if ( strcmp(file1name,file2name) == 0 )
+	{
+		printf("*** Cannot overwrite input file! ***\n\a");
+		goto retry3;
+	}
+	if ( strlen( file2name ) == 0 ) { printf("\a"); goto retry3; }
+	if ( (fp2 = fopen( file2name, "rb")) != NULL ) 
+	{
+		fclose( fp2 );
+		printf( "*** File already EXISTS! *** \a\n\n" ); 
+		printf( "Hit 'return' to REPLACE, type 'no' to rename: "); 
+		if ( yes_no_input() > 0 ) goto retry3;
+	}
+	howlong = filesize / 44347.0 / 60 ;  /* 44347 = empirical speed factor */
+
+
+
+
+
+	printf("\nPull down menu to 'Quit', else hit 'return':"); gets(pause);
+	
+	time(&t1);  printf( "\nStart                "); printf( ctime(&t1) );	
+
+	fp2 = fopen( file2name, "wb" );
+		
+		
+	dns1 = (unsigned char **) malloc( lines * sizeof( char * ) );
+	if (dns1 == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	
+	for ( i = 0; i < lines; i ++ )				/* Get input RAM */
+	{
+		dns1[ i ] = ( unsigned char * ) malloc( samps );
+		if (dns1[ i ] == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	}	
+
+	
+	/*vvvvvvvvvvvv  Start Buffering of Input vvvvvvvvvvvv*/
+
+	buffy = (unsigned char *) malloc( samps*100 );	
+	if (buffy == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+		
+	cycles = lines / 100;
+	for ( k = 0; k < cycles; k++ )
+	{
+		fread( buffy, 1, 100*samps, fp1 );
+		for ( i = 0; i < 100; i++ )
+		{
+			prevlines = ( k * 100 ) + i;
+			prevpix   = i * samps;
+			for ( j = 0; j < samps; j++ )
+				dns1 [ prevlines ][ j ] = buffy [ prevpix + j ];
+		}
+	}
+
+	leftovers = lines - ( cycles * 100 );
+	fread( buffy, 1, samps * leftovers, fp1 );
+	for ( i = 0; i < leftovers; i++ )
+	{
+		prevlines = ( cycles * 100 ) + i;
+		prevpix   = i * samps;
+		for ( j = 0; j < samps; j++ )
+			dns1 [ prevlines ][ j ] = buffy [ prevpix + j ];
+	}
+
+	/*^^^^^^^^^^^^^  End Buffering of Input ^^^^^^^^^^^^^*/
+
+
+	dns2 = (unsigned char **) malloc( lines * sizeof( char * ) );
+	if (dns2 == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	
+	for ( i = 0; i < lines; i ++ )				/*  Get output RAM */
+	{
+		dns2[ i ] = ( unsigned char * ) malloc( samps );
+		if (dns2[ i ] == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	}	
+
+	for ( i = 0; i < lines; i++ )
+		for ( j = 0; j < samps; j++ )
+			dns2[i][j] = 0;
+	
+
+/***************** Cycling of Run Pairs *********************/
+	
+	count += 2;
+	printf( "\n" );
+	printf( "Iterations %5ld   and %5ld.", count-1, count );
+	fflush( stdout );
+	goto afterfirst1;
+	
+
+	again1:	
+	
+	count += 2;
+	
+	printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+	printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+	printf( "Iterations %5ld   and %5ld.", count-1, count );
+	fflush( stdout );
+	
+	afterfirst1:
+
+
+/***************** FIRST RUN *********************/
+
+/*
+  fprint ( "First  Application:  " ); time(&t2); printf( ctime(&t2) );
+*/
+	
+	for ( i = 0; i < lines; i++ )
+	{
+		for ( j = 0; j < samps; j++ )								
+		{
+			if ( dns1[i][j] > 0 ) { dns2[i][j] = dns1[i][j]; continue; } /* If not a void pixel */
+
+			test = 0;		
+			for ( ii = i-1; ii < i+2; ii++ ) /* Find it to be a void edge */
+			{
+				for ( jj = j-1; jj < j+2; jj++ )
+				{
+					if (( ii < 0 ) || ( ii >= lines )) continue;
+					if (( jj < 0 ) || ( jj >= samps )) continue;
+					if ( dns1[ii][jj] > 0 ) test = 1;			
+				}
+			}
+			if ( test == 0 ) { dns2[i][j] = 0; continue; }  /* If not a void edge */
+			
+			
+			/* For void edge pixels: */			
+			
+			nsteps = 0.0; ssteps = 0.0; esteps = 0.0; wsteps = 0.0;
+			nwsteps = 0.0; nesteps = 0.0; swsteps = 0.0; sesteps = 0.0;
+			north = 0.0; south = 0.0; east = 0.0; west = 0.0;
+			nw = 0.0; ne = 0.0; sw = 0.0; se = 0.0;
+
+
+			
+			for ( ii = i - 1; ii >= 0; ii-- )    /* North */
+			{
+				if ( ii <= 0 ) { north = 0; nsteps = 0; break; }
+				if ( dns1[ii][j] > 0 ) { north = dns1[ii][j]; nsteps = i - ii; break; }
+			}
+					
+			for ( ii = i + 1; ii < lines; ii++ ) /* South */
+			{
+				if ( ii >= lines-1 ) { south = 0; ssteps = 0; break; }
+				if ( dns1[ii][j] > 0 ) { south = dns1[ii][j]; ssteps = ii - i; break; }
+			}
+				
+			for ( jj = j - 1; jj >= 0; jj-- )    /* West */
+			{
+				if ( jj <= 0 ) { west = 0; wsteps = 0; break; }
+				if ( dns1[i][jj] > 0 ) { west = dns1[i][jj]; wsteps = j - jj; break; }
+			}
+				
+			for ( jj = j + 1; jj < samps; jj++ ) /* East */
+			{
+				if ( jj >= samps-1 ) { east = 0; esteps = 0; break; }
+				if ( dns1[i][jj] > 0 ) { east = dns1[i][jj]; esteps = jj - j; break; }
+			}
+				
+						
+
+			/* Southeast */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j + k;
+				if (( ii == lines ) || ( jj == samps )) { se = 0; sesteps = 0; break; }
+				if ( dns1[ii][jj] > 0 ) { se = dns1[ii][jj]; sesteps = 1.4142 * k; break; }
+			}
+			
+			
+			/* Northeast */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j + k;
+				if (( ii == -1 ) || ( jj == samps )) { ne = 0; nesteps = 0; break; }
+				if ( dns1[ii][jj] > 0 ) { ne = dns1[ii][jj]; nesteps = 1.4142 * k; break; }
+			}
+			
+			/* Northwest */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j - k;
+				if (( ii == -1 ) || ( jj == -1 )) { nw = 0; nwsteps = 0; break; }
+				if ( dns1[ii][jj] > 0 ) { nw = dns1[ii][jj]; nwsteps = 1.4142 * k; break; }
+			}
+			
+			
+			/* Southwest */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j - k;
+				if (( ii == lines ) || ( jj == -1 )) { sw = 0; swsteps = 0; break; }
+				if ( dns1[ii][jj] > 0 ) { sw = dns1[ii][jj]; swsteps = 1.4142 * k; break; }
+			}
+			
+		
+			elev = 0; range = 0;
+			if (  nsteps > 0.5 )  { elev += north /  nsteps; range +=  1.00 /  nsteps; }
+			if (  ssteps > 0.5 )  { elev += south /  ssteps; range +=  1.00 /  ssteps; }
+			if (  esteps > 0.5 )  { elev +=  east /  esteps; range +=  1.00 /  esteps; }
+			if (  wsteps > 0.5 )  { elev +=  west /  wsteps; range +=  1.00 /  wsteps; }
+			if ( nwsteps > 0.5 )  { elev +=    nw / nwsteps; range +=  1.00 / nwsteps; }
+			if ( nesteps > 0.5 )  { elev +=    ne / nesteps; range +=  1.00 / nesteps; }
+			if ( swsteps > 0.5 )  { elev +=    sw / swsteps; range +=  1.00 / swsteps; }
+			if ( sesteps > 0.5 )  { elev +=    se / sesteps; range +=  1.00 / sesteps; }
+			
+										
+			temp = ( elev / range ) + 0.5 ;
+			if ( temp > 255 ) temp = 255;
+			if ( temp <   0 ) temp =   0;
+
+			dns2[i][j] = temp ;			
+
+		}
+	}
+
+
+/***************** SECOND RUN *********************/
+
+/*
+fprintf ( stdout, "Second Application:  " ); time(&t2); printf( ctime(&t2) );
+*/
+	
+	for ( i = 0; i < lines; i++ )
+	{
+		for ( j = 0; j < samps; j++ )								
+		{
+			if ( dns2[i][j] > 0 ) { dns1[i][j] = dns2[i][j]; continue; } /* If not a void pixel */
+
+			test = 0;		
+			for ( ii = i-1; ii < i+2; ii++ ) /* Find it to be a void edge */
+			{
+				for ( jj = j-1; jj < j+2; jj++ )
+				{
+					if (( ii < 0 ) || ( ii >= lines )) continue;
+					if (( jj < 0 ) || ( jj >= samps )) continue;
+					if ( dns2[ii][jj] > 0 ) test = 1;			
+				}
+			}
+			if ( test == 0 ) { dns1[i][j] = 0; continue; }  /* If not a void edge */
+			
+			
+			/* For void edge pixels: */			
+			
+			nsteps = 0.0; ssteps = 0.0; esteps = 0.0; wsteps = 0.0;
+			nwsteps = 0.0; nesteps = 0.0; swsteps = 0.0; sesteps = 0.0;
+			north = 0.0; south = 0.0; east = 0.0; west = 0.0;
+			nw = 0.0; ne = 0.0; sw = 0.0; se = 0.0;
+
+
+			
+			for ( ii = i - 1; ii >= 0; ii-- )    /* North */
+			{
+				if ( ii <= 0 ) { north = 0; nsteps = 0; break; }
+				if ( dns2[ii][j] > 0 ) { north = dns2[ii][j]; nsteps = i - ii; break; }
+			}
+					
+			for ( ii = i + 1; ii < lines; ii++ ) /* South */
+			{
+				if ( ii >= lines-1 ) { south = 0; ssteps = 0; break; }
+				if ( dns2[ii][j] > 0 ) { south = dns2[ii][j]; ssteps = ii - i; break; }
+			}
+				
+			for ( jj = j - 1; jj >= 0; jj-- )    /* West */
+			{
+				if ( jj <= 0 ) { west = 0; wsteps = 0; break; }
+				if ( dns2[i][jj] > 0 ) { west = dns2[i][jj]; wsteps = j - jj; break; }
+			}
+				
+			for ( jj = j + 1; jj < samps; jj++ ) /* East */
+			{
+				if ( jj >= samps-1 ) { east = 0; esteps = 0; break; }
+				if ( dns2[i][jj] > 0 ) { east = dns2[i][jj]; esteps = jj - j; break; }
+			}
+				
+						
+
+			/* Southeast */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j + k;
+				if (( ii == lines ) || ( jj == samps )) { se = 0; sesteps = 0; break; }
+				if ( dns2[ii][jj] > 0 ) { se = dns2[ii][jj]; sesteps = 1.4142 * k; break; }
+			}
+			
+			
+			/* Northeast */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j + k;
+				if (( ii == -1 ) || ( jj == samps )) { ne = 0; nesteps = 0; break; }
+				if ( dns2[ii][jj] > 0 ) { ne = dns2[ii][jj]; nesteps = 1.4142 * k; break; }
+			}
+			
+			/* Northwest */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j - k;
+				if (( ii == -1 ) || ( jj == -1 )) { nw = 0; nwsteps = 0; break; }
+				if ( dns2[ii][jj] > 0 ) { nw = dns2[ii][jj]; nwsteps = 1.4142 * k; break; }
+			}
+			
+			
+			/* Southwest */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j - k;
+				if (( ii == lines ) || ( jj == -1 )) { sw = 0; swsteps = 0; break; }
+				if ( dns2[ii][jj] > 0 ) { sw = dns2[ii][jj]; swsteps = 1.4142 * k; break; }
+			}
+			
+		
+			elev = 0; range = 0;
+			if (  nsteps > 0.5 )  { elev += north /  nsteps; range +=  1.00 /  nsteps; }
+			if (  ssteps > 0.5 )  { elev += south /  ssteps; range +=  1.00 /  ssteps; }
+			if (  esteps > 0.5 )  { elev +=  east /  esteps; range +=  1.00 /  esteps; }
+			if (  wsteps > 0.5 )  { elev +=  west /  wsteps; range +=  1.00 /  wsteps; }
+			if ( nwsteps > 0.5 )  { elev +=    nw / nwsteps; range +=  1.00 / nwsteps; }
+			if ( nesteps > 0.5 )  { elev +=    ne / nesteps; range +=  1.00 / nesteps; }
+			if ( swsteps > 0.5 )  { elev +=    sw / swsteps; range +=  1.00 / swsteps; }
+			if ( sesteps > 0.5 )  { elev +=    se / sesteps; range +=  1.00 / sesteps; }
+			
+										
+			temp = ( elev / range ) + 0.5 ;
+			if ( temp > 255 ) temp = 255;
+			if ( temp <   0 ) temp =   0;
+
+			dns1[i][j] = temp ;			
+
+		}
+	}
+
+
+/***************** CHECK FOR REMAINING ZEROES *********************/
+
+
+	for ( i = 0; i < lines; i++ )
+		for ( j = 0; j < samps; j++ )
+			if ( dns1 [i][j] == 0 ) goto again1;
+		
+
+	
+	/*vvvvvvvvvvvv  Start Buffering of Output vvvvvvvvvvvv*/
+
+	cycles = lines / 100;
+	for ( k = 0; k < cycles; k++ )
+	{
+		for ( i = 0; i < 100; i++ )
+		{
+			prevlines = ( k * 100 ) + i;
+			prevpix   = i * samps;
+			for ( j = 0; j < samps; j++ )
+				buffy [ prevpix + j ] = dns1 [ prevlines ][ j ];
+		}
+		fwrite( buffy, 1, 100*samps, fp2 );
+	}
+
+	leftovers = lines - ( cycles * 100 );
+	for ( i = 0; i < leftovers; i++ )
+	{
+		prevlines = ( cycles * 100 ) + i;
+		prevpix   = i * samps;
+		for ( j = 0; j < samps; j++ )
+			buffy [ prevpix + j ] = dns1 [ prevlines ][ j ];
+	}
+	fwrite( buffy, 1, samps * leftovers, fp2 );
+
+	
+	/*^^^^^^^^^^^^^  End Buffering of Output ^^^^^^^^^^^^^*/
+
+	
+	fclose( fp1 ); fclose( fp2 );
+			
+	time(&t2);	printf ( "\n\nEnd                  "); printf( ctime(&t2) );
+	printf( "\n                           Total time:        ");
+	printf( "%4.2f minutes. \n", difftime(t2,t1)/60 );	
+	goto end;
+	
+
+
+
+
+
+	
+/*=============================  TWO-BYTE VERSION ================================*/
+	
+	twobyte:
+	
+	retry02:	
+	do { printf( "\nNumber of SAMPS in image: ");
+		  samps = number_input();
+		  if (samps < 1) printf( "*** Must be positive integer. *** \a\n" );
+	    } while ( samps < 1 );
+	
+	if ( filesize % samps ) 
+	{ 
+		printf( "*** Number of SAMPS is INCORRECT for file.  *** \n" );
+		printf( "***  It has %ld pixels.  ", filesize );
+		printf( "That is %6.5f lines.  ***\n\a", (float)filesize / samps );
+		goto retry02;
+	} 
+	
+	lines = filesize / ( samps * sizeof(short) );
+	printf( "Number of LINES in image = %ld \n", lines );
+	infinit = lines + samps;	
+
+
+	
+	retry04:
+	printf( "\nSMOOTH the output with a boxfilter? ( Default = Yes, else type 'no'): ");
+	smooth = yes_no_input();
+	if ( smooth == 0 )  printf("Data patches will be SMOOTHED. \n");
+	if ( smooth == 1 )  printf("Data patches will NOT be smoothed. \n");
+	
+
+
+		
+	retry03:
+	printf( "\nEnter OUTPUT IMAGE file NAME: " );
+	gets(file2name);  
+	if ( strcmp(file1name,file2name) == 0 )
+	{
+		printf("*** Cannot overwrite input file! ***\n\a");
+		goto retry03;
+	}
+	if ( strlen( file2name ) == 0 ) { printf("\a"); goto retry03; }
+	if ( (fp2 = fopen( file2name, "rb")) != NULL ) 
+	{
+		fclose( fp2 );
+		printf( "*** File already EXISTS! *** \a\n\n" ); 
+		printf( "Hit 'return' to REPLACE, type 'no' to rename: "); 
+		if ( yes_no_input() > 0 ) goto retry03;
+	}
+	howlong = filesize / 44347.0 / 60 ;  /* 44347 = empirical speed factor */
+
+
+
+
+	printf("\nPull down menu to 'Quit', else hit 'return':"); gets(pause);
+	
+	time(&t1);  printf( "\nStart                "); printf( ctime(&t1) );	
+
+	fp2 = fopen( file2name, "wb" );
+		
+		
+	dns01 = (unsigned short **) malloc( lines * sizeof( short * ) );
+	if (dns01 == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	
+	for ( i = 0; i < lines; i ++ )				/* Get input file */
+	{
+		dns01[ i ] = ( unsigned short * ) malloc( samps * sizeof(short) );
+		if (dns01[ i ] == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	}	
+
+	
+	/*vvvvvvvvvvvv  Start Buffering of Input vvvvvvvvvvvv*/
+
+	buffy2 = (unsigned short *) malloc( samps*100 * sizeof(short) );	
+	if (buffy2 == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+		
+	cycles = lines / 100;
+	for ( k = 0; k < cycles; k++ )
+	{
+		fread( buffy2, sizeof(short), 100*samps, fp1 );
+		for ( i = 0; i < 100; i++ )
+		{
+			prevlines = ( k * 100 ) + i;
+			prevpix   = i * samps;
+			for ( j = 0; j < samps; j++ )
+				dns01 [ prevlines ][ j ] = buffy2 [ prevpix + j ];
+		}
+	}
+
+	leftovers = lines - ( cycles * 100 );
+	fread( buffy2, sizeof(short), samps * leftovers, fp1 );
+	for ( i = 0; i < leftovers; i++ )
+	{
+		prevlines = ( cycles * 100 ) + i;
+		prevpix   = i * samps;
+		for ( j = 0; j < samps; j++ )
+			dns01 [ prevlines ][ j ] = buffy2 [ prevpix + j ];
+	}
+
+	/*^^^^^^^^^^^^^  End Buffering of Input ^^^^^^^^^^^^^*/
+	
+
+	dns02 = (unsigned short **) malloc( lines * sizeof( short * ) );
+	if (dns02 == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	
+	for ( i = 0; i < lines; i ++ )				/*  Get output RAM */
+	{
+		dns02[ i ] = ( unsigned short * ) malloc( samps * sizeof(short) );
+		if (dns02[ i ] == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	}	
+
+	
+/********** NEW: Eliminate loner pixels ***************/	
+
+/*	
+	for ( i = 0; i < lines; i++ )
+	{
+		for ( j = 0; j < samps; j++ )								
+		{
+			dns02[i][j] = dns01[i][j];
+			test = 0;
+			if ((( i == 0 ) || ( dns01[i-1][j] < 1 ) ) && ( ( i == lines-1 ) || ( dns01[i+1][j] < 1 ))) test += 1;
+			if ((( j == 0 ) || ( dns01[i][j-1] < 1 ) ) && ( ( j == samps-1 ) || ( dns01[i][j+1] < 1 ))) test += 1;
+			if ( test > 0 ) dns02[i][j] = 0;
+		}
+	}	
+	
+	for ( i = 0; i < lines; i++ )
+	{
+		for ( j = 0; j < samps; j++ )								
+		{
+			dns01[i][j] = dns02[i][j];
+		}
+	}	
+*/	
+	
+	
+/***************** Cycling of Run Pairs *********************/
+	
+
+
+	count += 2;
+	printf( "\n" );
+	printf( "Iterations %5ld   and %5ld.", count-1, count );
+	fflush( stdout );
+	goto afterfirst2;
+	
+
+	again2:	
+	
+	count += 2;
+	
+	printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+	printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+	printf( "Iterations %5ld   and %5ld.", count-1, count );
+	fflush( stdout );
+	
+	afterfirst2:
+
+
+
+
+/***************** FIRST RUN *********************/
+
+/*
+fprintf ( stdout, "First  Application:  " ); time(&t2); printf( ctime(&t2) );
+*/
+	
+	for ( i = 0; i < lines; i++ )
+	{
+		for ( j = 0; j < samps; j++ )								
+		{
+			if ( dns01[i][j] > 0 ) { dns02[i][j] = dns01[i][j]; continue; } /* If not a void pixel */
+
+
+			/* Find it to be a void edge */
+
+/* Sides Only Test1 */
+/*
+			test1 = 0;
+			if (( i >       0 ) && ( dns01[i-1][j] > 0 )) test1 += 1;
+			if (( i < lines-1 ) && ( dns01[i+1][j] > 0 )) test1 += 1;
+			if (( j >       0 ) && ( dns01[i][j-1] > 0 )) test1 += 1;
+			if (( j < samps-1 ) && ( dns01[i][j+1] > 0 )) test1 += 1;
+
+			if ( test1 < 1 ) { dns02[i][j] = 0; continue; } 
+*/
+/* Diagnals Only Test2 */
+
+/*			test2 = 0;
+			if (( i > 0 ) && ( j > 0 ) && ( dns01[i-1][j-1] > 0 )) test2 += 1;
+			if (( i < lines-1 ) && ( j < samps-1 ) && ( dns01[i+1][j+1] > 0 )) test2 += 1;
+			if (( i > 0 ) && ( j < samps-1 ) && ( dns01[i-1][j+1] > 0 )) test2 += 1;
+			if (( i < lines-1 ) && ( j > 0 ) && ( dns01[i+1][j-1] > 0 )) test2 += 1;
+
+			if ( test2 < 2 ) { dns02[i][j] = 0; continue; }
+
+			if ((  test1 < 1 ) && ( test2 < 2 )) { dns02[i][j] = 0; continue; }
+*/
+
+
+
+
+
+
+/* Count All Neighbors Test */
+
+			test = 0;		
+			for ( ii = i-1; ii < i+2; ii++ ) 
+			{
+				for ( jj = j-1; jj < j+2; jj++ )
+				{
+					if (( ii < 0 ) || ( ii >= lines )) continue;
+					if (( jj < 0 ) || ( jj >= samps )) continue;
+					if ( dns01[ii][jj] > 0 ) test += 1;			
+				}
+			}
+			if ( test < 3 ) { dns02[i][j] = 0; continue; } 
+
+
+
+
+
+
+
+			
+			
+			/* For void edge pixels: */			
+			
+			nsteps = 0.0; ssteps = 0.0; esteps = 0.0; wsteps = 0.0;
+			nwsteps = 0.0; nesteps = 0.0; swsteps = 0.0; sesteps = 0.0;
+			north = 0.0; south = 0.0; east = 0.0; west = 0.0;
+			nw = 0.0; ne = 0.0; sw = 0.0; se = 0.0;
+
+			nnesteps = 0.0; enesteps = 0.0; esesteps = 0.0; ssesteps = 0.0;
+			sswsteps = 0.0; wswsteps = 0.0; wnwsteps = 0.0; nnwsteps = 0.0;
+			nne = 0.0; ene = 0.0; ese = 0.0; sse = 0.0;
+			ssw = 0.0; wsw = 0.0; wnw = 0.0; nnw = 0.0;
+
+
+/** NSEW **/
+			
+			for ( ii = i - 1; ii >= 0; ii-- )    /* North */
+			{
+				if ( ii <= 0 ) { north = 0; nsteps = 0; break; }
+				if ( dns01[ii][j] > 0 ) { north = dns01[ii][j]; nsteps = i - ii; break; }
+			}
+					
+			for ( ii = i + 1; ii < lines; ii++ ) /* South */
+			{
+				if ( ii >= lines-1 ) { south = 0; ssteps = 0; break; }
+				if ( dns01[ii][j] > 0 ) { south = dns01[ii][j]; ssteps = ii - i; break; }
+			}
+				
+			for ( jj = j - 1; jj >= 0; jj-- )    /* West */
+			{
+				if ( jj <= 0 ) { west = 0; wsteps = 0; break; }
+				if ( dns01[i][jj] > 0 ) { west = dns01[i][jj]; wsteps = j - jj; break; }
+			}
+				
+			for ( jj = j + 1; jj < samps; jj++ ) /* East */
+			{
+				if ( jj >= samps-1 ) { east = 0; esteps = 0; break; }
+				if ( dns01[i][jj] > 0 ) { east = dns01[i][jj]; esteps = jj - j; break; }
+			}
+
+				
+/** Diagonals  **/						
+
+			/* Southeast */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j + k;
+				if (( ii == lines ) || ( jj == samps )) { se = 0; sesteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { se = dns01[ii][jj]; sesteps = 1.4142 * k; break; }
+			}
+			
+			
+			/* Northeast */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j + k;
+				if (( ii == -1 ) || ( jj == samps )) { ne = 0; nesteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { ne = dns01[ii][jj]; nesteps = 1.4142 * k; break; }
+			}
+			
+			/* Northwest */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j - k;
+				if (( ii == -1 ) || ( jj == -1 )) { nw = 0; nwsteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { nw = dns01[ii][jj]; nwsteps = 1.4142 * k; break; }
+			}
+			
+			
+			/* Southwest */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j - k;
+				if (( ii == lines ) || ( jj == -1 )) { sw = 0; swsteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { sw = dns01[ii][jj]; swsteps = 1.4142 * k; break; }
+			}
+
+
+/** Other 8 **/
+
+			/* NNE */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - (k*2); jj = j + k;
+				if (( ii <= -1 ) || ( jj >= samps )) { nne = 0; nnesteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { nne = dns01[ii][jj]; nnesteps = 2.2361 * k; break; }
+			}
+			
+			
+			/* ENE */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j + (k*2);
+				if (( ii <= -1 ) || ( jj >= samps )) { ene = 0; enesteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { ene = dns01[ii][jj]; enesteps = 2.2361 * k; break; }
+			}
+			
+			/* ESE */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j + (k*2);
+				if (( ii >= lines ) || ( jj >= samps )) { ese = 0; esesteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { ese = dns01[ii][jj]; esesteps = 2.2361 * k; break; }
+			}
+			
+			
+			/* SSE */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + (k*2); jj = j + k;
+				if (( ii >= lines ) || ( jj >= samps )) { sse = 0; ssesteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { sse = dns01[ii][jj]; ssesteps = 2.2361 * k; break; }
+			}
+
+
+
+			/* SSW */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + (k*2); jj = j - k;
+				if (( ii >= lines ) || ( jj <= -1 )) { ssw = 0; sswsteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { ssw = dns01[ii][jj]; sswsteps = 2.2361 * k; break; }
+			}
+			
+			
+			/* WSW */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j - (k*2);
+				if (( ii >= lines ) || ( jj <= -1 )) { wsw = 0; wswsteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { wsw = dns01[ii][jj]; wswsteps = 2.2361 * k; break; }
+			}
+			
+			/* WNW */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j - (k*2);
+				if (( ii <= -1 ) || ( jj <= -1 )) { wnw = 0; wnwsteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { wnw = dns01[ii][jj]; wnwsteps = 2.2361 * k; break; }
+			}
+			
+			
+			/* NNW */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - (k*2); jj = j - k;
+				if (( ii <= -1 ) || ( jj <= -1 )) { nnw = 0; nnwsteps = 0; break; }
+				if ( dns01[ii][jj] > 0 ) { nnw = dns01[ii][jj]; nnwsteps = 2.2361 * k; break; }
+			}
+			
+
+
+/* Avoid fills that use too many distant points */
+/*	
+thresh = 0;
+			if (  nsteps > 5 ) thresh += 1;
+			if (  ssteps > 5 ) thresh += 1;
+			if (  esteps > 5 ) thresh += 1;
+			if (  wsteps > 5 ) thresh += 1;
+
+			if ( nwsteps > 5 ) thresh += 1;
+			if ( nesteps > 5 ) thresh += 1;
+			if ( swsteps > 5 ) thresh += 1;
+			if ( sesteps > 5 ) thresh += 1;
+
+			if ( nnesteps > 5 ) thresh += 1;
+			if ( enesteps > 5 ) thresh += 1;
+			if ( esesteps > 5 ) thresh += 1;
+			if ( ssesteps > 5 ) thresh += 1;
+			if ( sswsteps > 5 ) thresh += 1;
+			if ( wswsteps > 5 ) thresh += 1;
+			if ( wnwsteps > 5 ) thresh += 1;
+			if ( nnwsteps > 5 ) thresh += 1;		
+if ( thresh > 14 ) { dns02[i][j] = 0; continue; }			
+*/			
+
+
+			
+/* TRY SQUARES -- BAD! */
+/*			
+			nsteps = pow(nsteps, 0.5);
+			ssteps = pow(ssteps, 0.5); 
+			esteps = pow(esteps, 0.5);
+			wsteps = pow(wsteps, 0.5);
+			nwsteps = pow(nwsteps, 0.5);
+			nesteps = pow(nesteps, 0.5);
+			swsteps = pow(swsteps, 0.5);
+			sesteps = pow(sesteps, 0.5);
+			nnesteps = pow(nnesteps, 0.5);
+			enesteps = pow(enesteps, 0.5);
+			esesteps = pow(esesteps, 0.5);
+			ssesteps = pow(ssesteps, 0.5);
+			sswsteps = pow(sswsteps, 0.5);
+			wswsteps = pow(wswsteps, 0.5);
+			wnwsteps = pow(wnwsteps, 0.5);
+			nnwsteps = pow(nnwsteps, 0.5);
+*/			
+
+			
+		
+			elev = 0; range = 0;
+/*NSEW*/			
+			if (  nsteps > 0.5 )  { elev += north /  nsteps; range +=  1.00 /  nsteps; }
+			if (  ssteps > 0.5 )  { elev += south /  ssteps; range +=  1.00 /  ssteps; }
+			if (  esteps > 0.5 )  { elev +=  east /  esteps; range +=  1.00 /  esteps; }
+			if (  wsteps > 0.5 )  { elev +=  west /  wsteps; range +=  1.00 /  wsteps; }
+/*Diag*/
+			if ( nwsteps > 0.5 )  { elev +=    nw / nwsteps; range +=  1.00 / nwsteps; }
+			if ( nesteps > 0.5 )  { elev +=    ne / nesteps; range +=  1.00 / nesteps; }
+			if ( swsteps > 0.5 )  { elev +=    sw / swsteps; range +=  1.00 / swsteps; }
+			if ( sesteps > 0.5 )  { elev +=    se / sesteps; range +=  1.00 / sesteps; }
+			
+/*Other 8*/
+			if ( nnesteps > 0.5 )  { elev += nne / nnesteps; range +=  1.00 / nnesteps; }
+			if ( enesteps > 0.5 )  { elev += ene / enesteps; range +=  1.00 / enesteps; }
+			if ( esesteps > 0.5 )  { elev += ese / esesteps; range +=  1.00 / esesteps; }
+			if ( ssesteps > 0.5 )  { elev += sse / ssesteps; range +=  1.00 / ssesteps; }
+			if ( sswsteps > 0.5 )  { elev += ssw / sswsteps; range +=  1.00 / sswsteps; }
+			if ( wswsteps > 0.5 )  { elev += wsw / wswsteps; range +=  1.00 / wswsteps; }
+			if ( wnwsteps > 0.5 )  { elev += wnw / wnwsteps; range +=  1.00 / wnwsteps; }
+			if ( nnwsteps > 0.5 )  { elev += nnw / nnwsteps; range +=  1.00 / nnwsteps; }
+			
+										
+			temp = ( elev / range ) + 0.5 ;
+			if ( temp > 10000 ) temp = 10000;
+			if ( temp <     0 ) temp =     0;
+
+			dns02[i][j] = temp ;			
+
+		}
+	}
+
+
+
+
+goto there;
+
+
+
+
+
+/***************** SECOND RUN *********************/
+
+fprintf ( stdout, "Second Application:  " ); time(&t2); printf( ctime(&t2) );
+
+	
+	for ( i = 0; i < lines; i++ )
+	{
+		for ( j = 0; j < samps; j++ )								
+		{
+			if ( dns02[i][j] > 0 ) { dns01[i][j] = dns02[i][j]; continue; } /* If not a void pixel */
+
+			test = 0;		
+			for ( ii = i-1; ii < i+2; ii++ ) /* Find it to be a void edge */
+			{
+				for ( jj = j-1; jj < j+2; jj++ )
+				{
+					if (( ii < 0 ) || ( ii >= lines )) continue;
+					if (( jj < 0 ) || ( jj >= samps )) continue;
+					if ( dns02[ii][jj] > 0 ) test = 1;			
+				}
+			}
+			if ( test == 0 ) { dns01[i][j] = 0; continue; }  /* If not a void edge */
+			
+			
+			/* For void edge pixels: */			
+			
+			nsteps = 0.0; ssteps = 0.0; esteps = 0.0; wsteps = 0.0;
+			nwsteps = 0.0; nesteps = 0.0; swsteps = 0.0; sesteps = 0.0;
+			north = 0.0; south = 0.0; east = 0.0; west = 0.0;
+			nw = 0.0; ne = 0.0; sw = 0.0; se = 0.0;
+
+
+			
+			for ( ii = i - 1; ii >= 0; ii-- )    /* North */
+			{
+				if ( ii <= 0 ) { north = 0; nsteps = 0; break; }
+				if ( dns02[ii][j] > 0 ) { north = dns02[ii][j]; nsteps = i - ii; break; }
+			}
+					
+			for ( ii = i + 1; ii < lines; ii++ ) /* South */
+			{
+				if ( ii >= lines-1 ) { south = 0; ssteps = 0; break; }
+				if ( dns02[ii][j] > 0 ) { south = dns02[ii][j]; ssteps = ii - i; break; }
+			}
+				
+			for ( jj = j - 1; jj >= 0; jj-- )    /* West */
+			{
+				if ( jj <= 0 ) { west = 0; wsteps = 0; break; }
+				if ( dns02[i][jj] > 0 ) { west = dns02[i][jj]; wsteps = j - jj; break; }
+			}
+				
+			for ( jj = j + 1; jj < samps; jj++ ) /* East */
+			{
+				if ( jj >= samps-1 ) { east = 0; esteps = 0; break; }
+				if ( dns02[i][jj] > 0 ) { east = dns02[i][jj]; esteps = jj - j; break; }
+			}
+				
+						
+
+			/* Southeast */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j + k;
+				if (( ii == lines ) || ( jj == samps )) { se = 0; sesteps = 0; break; }
+				if ( dns02[ii][jj] > 0 ) { se = dns02[ii][jj]; sesteps = 1.4142 * k; break; }
+			}
+			
+			
+			/* Northeast */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j + k;
+				if (( ii == -1 ) || ( jj == samps )) { ne = 0; nesteps = 0; break; }
+				if ( dns02[ii][jj] > 0 ) { ne = dns02[ii][jj]; nesteps = 1.4142 * k; break; }
+			}
+			
+			/* Northwest */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i - k; jj = j - k;
+				if (( ii == -1 ) || ( jj == -1 )) { nw = 0; nwsteps = 0; break; }
+				if ( dns02[ii][jj] > 0 ) { nw = dns02[ii][jj]; nwsteps = 1.4142 * k; break; }
+			}
+			
+			
+			/* Southwest */
+			for ( k = 1; k < infinit; k++ )
+			{
+				ii = i + k; jj = j - k;
+				if (( ii == lines ) || ( jj == -1 )) { sw = 0; swsteps = 0; break; }
+				if ( dns02[ii][jj] > 0 ) { sw = dns02[ii][jj]; swsteps = 1.4142 * k; break; }
+			}
+			
+		
+			elev = 0; range = 0;
+			if (  nsteps > 0.5 )  { elev += north /  nsteps; range +=  1.00 /  nsteps; }
+			if (  ssteps > 0.5 )  { elev += south /  ssteps; range +=  1.00 /  ssteps; }
+			if (  esteps > 0.5 )  { elev +=  east /  esteps; range +=  1.00 /  esteps; }
+			if (  wsteps > 0.5 )  { elev +=  west /  wsteps; range +=  1.00 /  wsteps; }
+			if ( nwsteps > 0.5 )  { elev +=    nw / nwsteps; range +=  1.00 / nwsteps; }
+			if ( nesteps > 0.5 )  { elev +=    ne / nesteps; range +=  1.00 / nesteps; }
+			if ( swsteps > 0.5 )  { elev +=    sw / swsteps; range +=  1.00 / swsteps; }
+			if ( sesteps > 0.5 )  { elev +=    se / sesteps; range +=  1.00 / sesteps; }
+			
+										
+			temp = ( elev / range ) + 0.5 ;
+			if ( temp > 10000 ) temp = 10000;
+			if ( temp <     0 ) temp =     0;
+
+			dns01[i][j] = temp ;			
+
+		}
+	}
+
+
+/***************** CHECK FOR REMAINING ZEROES *********************/
+
+
+there:
+
+for ( i = 0; i < lines; i++ )
+for ( j = 0; j < samps; j++ )
+dns01 [i][j] = dns02 [i][j];
+
+
+if ( count > 3000 ) goto there2; /* Optional within-program early termination */
+
+
+	for ( i = 0; i < lines; i++ )
+		for ( j = 0; j < samps; j++ )
+		if ( dns01 [i][j] == 0 ) goto again2;
+		
+
+if ( smooth == 1 ) goto there2;		
+		
+		
+/************************ SMOOTH THE RESULT ***********************/		
+		
+		
+		
+	dns03 = (unsigned short **) malloc( lines * sizeof( short * ) );
+	if (dns03 == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	
+	for ( i = 0; i < lines; i ++ )				/*  Get output RAM */
+	{
+		dns03[ i ] = ( unsigned short * ) malloc( samps * sizeof(short) );
+		if (dns03[ i ] == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+	}	
+	
+		
+	fseek( fp1, 0, SEEK_SET ); /* Reset pointer to Input Data */
+	
+	/* Load original data into RAM Array 3 (Need data / Non-Data Info) */
+	
+	/*vvvvvvvvvvvv  Start Buffering of Input vvvvvvvvvvvv*/
+
+	buffy2 = (unsigned short *) malloc( samps*100 * sizeof(short) );	
+	if (buffy2 == NULL) { printf("Not enough RAM.\a\n"); goto end; }
+		
+	cycles = lines / 100;
+	for ( k = 0; k < cycles; k++ )
+	{
+		fread( buffy2, sizeof(short), 100*samps, fp1 );
+		for ( i = 0; i < 100; i++ )
+		{
+			prevlines = ( k * 100 ) + i;
+			prevpix   = i * samps;
+			for ( j = 0; j < samps; j++ )
+				dns03 [ prevlines ][ j ] = buffy2 [ prevpix + j ];
+		}
+	}
+
+	leftovers = lines - ( cycles * 100 );
+	fread( buffy2, sizeof(short), samps * leftovers, fp1 );
+	for ( i = 0; i < leftovers; i++ )
+	{
+		prevlines = ( cycles * 100 ) + i;
+		prevpix   = i * samps;
+		for ( j = 0; j < samps; j++ )
+			dns03 [ prevlines ][ j ] = buffy2 [ prevpix + j ];
+	}
+
+	/*^^^^^^^^^^^^^  End Buffering of Input ^^^^^^^^^^^^^*/
+		
+	fprintf(stdout, "\n\nSmoothing Line Counter ( %5ld total ):       ", lines );
+
+
+	for ( i = 0; i < lines; i++ )
+	{
+		for ( j = 0; j < samps; j++ )
+		{
+			if ( dns03 [i][j] > 0 ) { dns02 [i][j] = dns01 [i][j]; continue; }
+
+
+
+			for ( k = 1; k < infinit; k++ )  /* Find the smallest box size with data */
+			{
+				for ( ii = i-k; ii <= i+k; ii++ )
+				{
+					if ( ii <      0 ) continue;
+					if ( ii >= lines ) break;
+					for ( jj = j-k; jj <= j+k; jj++ )
+					{
+						if ( jj <      0 ) continue;
+						if ( jj >= samps ) continue;
+						if ( dns03[ii][jj] > 0 ) goto k_nowset;
+					}
+				}
+			}
+			
+			k_nowset:
+			k = k / 4; if ( k < 1 ) k = 1; /* Errrrr.  Make it fourth size */
+			sum = 0;
+			for ( ii = i-k; ii <= i+k; ii++ )
+			{
+				if ( ii <      0 ) iii = -1 - ii; else iii = ii;
+				if ( ii >= lines ) iii = lines - (ii - lines + 1);
+				for ( jj = j-k; jj <= j+k; jj++ )
+				{
+					if ( jj <      0 ) jjj = -1 - jj; else jjj = jj;
+					if ( jj >= samps ) jjj = samps - (jj - samps + 1);
+					sum += dns01[iii][jjj];
+				}
+			}
+			k = (k*2)+1;
+			dns02[i][j] = ( sum / k / k ) + 0.5;
+
+
+			
+		}
+		if ( !(i%100) )
+		fprintf(stdout, "\b\b\b\b\b\b%5ld ", i );   /* Count lines on output screen */
+		fflush(stdout);	
+	}
+	fprintf(stdout, "\b\b\b\b\b\b%5ld ", lines );
+	fflush(stdout);	
+		
+		
+		
+		
+		
+		
+		
+there2:		
+		
+	
+	/*vvvvvvvvvvvv  Start Buffering of Output vvvvvvvvvvvv*/
+
+	cycles = lines / 100;
+	for ( k = 0; k < cycles; k++ )
+	{
+		for ( i = 0; i < 100; i++ )
+		{
+			prevlines = ( k * 100 ) + i;
+			prevpix   = i * samps;
+			for ( j = 0; j < samps; j++ )
+				buffy2 [ prevpix + j ] = dns02 [ prevlines ][ j ];
+		}
+		fwrite( buffy2, sizeof(short), 100*samps, fp2 );
+	}
+
+	leftovers = lines - ( cycles * 100 );
+	for ( i = 0; i < leftovers; i++ )
+	{
+		prevlines = ( cycles * 100 ) + i;
+		prevpix   = i * samps;
+		for ( j = 0; j < samps; j++ )
+			buffy2 [ prevpix + j ] = dns02 [ prevlines ][ j ];
+	}
+	fwrite( buffy2, sizeof(short), samps * leftovers, fp2 );
+
+	
+	/*^^^^^^^^^^^^^  End Buffering of Output ^^^^^^^^^^^^^*/
+
+	
+	fclose( fp1 ); fclose( fp2 );
+			
+	time(&t2);	printf ( "\n\nEnd                  "); printf( ctime(&t2) );
+	printf( "\n                           Total time:        ");
+	printf( "%4.2f minutes. \n", difftime(t2,t1)/60 );		
+	
+
+	end:
+	printf( "Done.\a\n" );
+	
+	return(0);
+	
+}
+
+/*==================================================================================*/
+
+int number_input()
+
+{
+	char buffer[16];
+	char	*p;
+	
+	p=buffer;
+	while ( (*p = getc(stdin) ) != '\n') p++;
+	*p = '\0';
+	return( atoi (buffer) );
+}
+
+
+
+/*==================================================================================*/
+
+int yes_no_input()
+
+{
+	char buffer[16];
+	char	*p;
+	
+	p=buffer;
+	while ( (*p = getc(stdin) ) != '\n') p++;
+	*p = '\0';
+	if ( strlen(buffer) == 0 ) return ( 0 );
+	return( 1 );
+}
+
+
+
+
+/*  EDITS:                                                              */
+/*                                                                      */
+/*  03.04.02	Modified from Zero Fill Cycle.                          */
+
Index: /issm/trunk/src/c/HoleFillerx/HoleFillerx.cpp
===================================================================
--- /issm/trunk/src/c/HoleFillerx/HoleFillerx.cpp	(revision 1)
+++ /issm/trunk/src/c/HoleFillerx/HoleFillerx.cpp	(revision 1)
@@ -0,0 +1,419 @@
+/*!\file:  HoleFillerx.cpp
+ * \brief  plug missing values of a double* array, using interpolation techniques. This 
+ * is an adaptation of Dr. Crippen's routine (Jet Propulsion Lab, see HoleFillerCrippen.c
+ * for more details.
+ */ 
+
+#include "./HoleFillerx.h"
+
+#include <stdio.h>
+#include <time.h>
+#include "../shared/shared.h"
+
+int HoleFillerx(double** pimageout,double* image, int lines,int samps,int smooth){
+	
+	FILE 			*fp1;
+	unsigned long	filesize;
+	long			infinit;
+	double          temp;
+	long			i, j, k, ii, jj, bytes;
+	long			iii, jjj;
+	long			count, test, prevlines, prevpix, test1, test2, thresh,counter;
+	long			bell, cycles, leftovers;
+	float			howlong;
+	float			nsteps, ssteps, wsteps, esteps;
+	float			nwsteps, nesteps, swsteps, sesteps;
+	float			north, south, east, west;
+	float			nw, sw, ne, se, elev, range;
+	float			nnesteps, enesteps, esesteps, ssesteps;
+	float			sswsteps, wswsteps, wnwsteps, nnwsteps;
+	float			nne, ene, ese, sse;
+	float			ssw, wsw, wnw, nnw;	
+	float			sum;
+	
+	time_t			t1, t2;
+
+	/*output: */
+	double*         imageout=NULL;
+
+	double*         image2=NULL;
+	double*         image3=NULL;
+	double*         image4=NULL;
+
+	/*Added to original routine: */
+	int             imageoutsize;
+
+	#ifdef _DEBUG_
+		if ( smooth == 1 ){
+			printf("Data patches will be SMOOTHED. \n");
+		}
+		if ( smooth == 0 ){ 
+			printf("Data patches will NOT be smoothed. \n");
+		}
+	#endif
+	
+	 /*^^^^^^^^^^^^^  Remove pixels close to the holes ^^^^^^^^^^^^^*/
+	image2 = (double*) xmalloc( lines*samps*sizeof(double));
+	memcpy(image2,image,lines*samps*sizeof(double));
+	
+  	for ( i = 0; i < lines; i++ ){
+  		for ( j = 0; j < samps; j++ ){
+ 			if ( *(image+i*samps+j) == 0 ){ 
+  				if ( (j > 3) && (j < samps-4) ){
+					*(image2+samps*i+j-1)=0;
+					*(image2+samps*i+j-2)=0;
+					*(image2+samps*i+j-3)=0;
+					*(image2+samps*i+j+1)=0;
+					*(image2+samps*i+j+2)=0;
+					*(image2+samps*i+j+3)=0;
+				}
+				if ( (i > 3) && (i < lines-4)){
+					*(image2+samps*(i-1)+j)=0;
+					*(image2+samps*(i-2)+j)=0;
+					*(image2+samps*(i-3)+j)=0;
+					*(image2+samps*(i+1)+j)=0;
+					*(image2+samps*(i+2)+j)=0;
+					*(image2+samps*(i+3)+j)=0;
+				}
+			}
+		}
+	}
+
+	image3 = (double*) xmalloc( lines*samps*sizeof(double));
+	memcpy(image3,image2,lines*samps*sizeof(double));
+
+	count += 2;
+	#ifdef _DEBUG2_
+		counter=0;
+		for ( i = 0; i < lines; i++ ) {
+			for ( j = 0; j < samps; j++ ){
+				if ( *(image2+i*samps+j) != 0 ) { 
+					counter++;
+				}
+			}
+		}
+		printf( "\n" );
+		printf("Number of zeroes remaining: %10ld",lines*samps-counter);
+		fflush( stdout );
+	#endif
+
+	#ifdef _DEBUG_
+		printf( "\n" );
+		printf( "Iterations %5ld   and %5ld.", count-1, count );
+		fflush( stdout );
+	#endif
+	goto afterfirst2;
+
+	again2:	
+	
+	count += 2;
+	
+	#ifdef _DEBUG2_
+		counter=0;
+		for ( i = 0; i < lines; i++ ) {
+			for ( j = 0; j < samps; j++ ){
+				if ( *(image2+i*samps+j) != 0 ) { 
+					counter++;
+				}
+			}
+		}
+		//        n u m b e r   o f   z e r o e s   r e m a i n i n g :   1 2 3 4 5 6 7 8 9 10        
+		printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+		printf("Number of zeroes remaining: %10ld",lines*samps-counter);
+		fflush( stdout );
+	#endif
+
+	#ifdef _DEBUG_
+		printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+		printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+		printf( "Iterations %5ld   and %5ld.", count-1, count );
+		fflush( stdout );
+	#endif
+	
+	afterfirst2:
+
+/***************** FIRST RUN *********************/
+/*
+fprintf ( stdout, "First  Application:  " ); time(&t2); printf( ctime(&t2) );
+*/
+	for ( i = 0; i < lines; i++ ){
+		for ( j = 0; j < samps; j++ ){
+			if ( *(image2+i*samps+j) != 0 ){ 
+				*(image3+samps*i+j) = *(image2+i*samps+j); 
+				continue; 
+			} 
+
+	/* Count All Neighbors Test */
+			test = 0;		
+			for ( ii = i-1; ii < i+2; ii++ ){
+				for ( jj = j-1; jj < j+2; jj++ ){
+					if (( ii < 0 ) || ( ii >= lines )) continue;
+					if (( jj < 0 ) || ( jj >= samps )) continue;
+					if ( *(image2+ii*samps+jj) != 0 ) test += 1;			
+				}
+			}
+			if ( test < 3 ){ 
+				*(image3+samps*i+j) = 0; 
+				continue; 
+			} 
+
+			/* For void edge pixels: */			
+			
+			nsteps = 0.0; ssteps = 0.0; esteps = 0.0; wsteps = 0.0;
+			nwsteps = 0.0; nesteps = 0.0; swsteps = 0.0; sesteps = 0.0;
+			north = 0.0; south = 0.0; east = 0.0; west = 0.0;
+			nw = 0.0; ne = 0.0; sw = 0.0; se = 0.0;
+
+			nnesteps = 0.0; enesteps = 0.0; esesteps = 0.0; ssesteps = 0.0;
+			sswsteps = 0.0; wswsteps = 0.0; wnwsteps = 0.0; nnwsteps = 0.0;
+			nne = 0.0; ene = 0.0; ese = 0.0; sse = 0.0;
+			ssw = 0.0; wsw = 0.0; wnw = 0.0; nnw = 0.0;
+
+
+/** NSEW **/
+			for ( ii = i - 1; ii >= 0; ii-- ){   /* North */
+				if ( ii <= 0 ) { north = 0; nsteps = 0; break;}
+				if ( *(image2+ii*samps+j) != 0 ){ north = *(image2+ii*samps+j); nsteps = i - ii; break;}
+			}
+
+			for ( ii = i + 1; ii < lines; ii++ ){ /* South */ 
+				if ( ii >= lines-1 ){ south = 0; ssteps = 0; break;}
+				if ( *(image2+ii*samps+j) != 0 ){ south = *(image2+ii*samps+j); ssteps = ii - i; break;}
+			}
+				
+			for ( jj = j - 1; jj >= 0; jj-- ){   /* West */
+				if ( jj <= 0 ) { west = 0; wsteps = 0; break;}
+				if ( *(image2+i*samps+jj) != 0 ){ west = *(image2+i*samps+jj); wsteps = j - jj; break;}
+			}
+				
+			for ( jj = j + 1; jj < samps; jj++ ){ /* East */
+				if ( jj >= samps-1 ){ east = 0; esteps = 0; break;}
+				if ( *(image2+i*samps+jj) != 0 ){ east = *(image2+i*samps+jj); esteps = jj - j; break;}
+			}
+
+				
+/** Diagonals  **/						
+			/* Southeast */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i + k; jj = j + k;
+				if (( ii == lines ) || ( jj == samps )){ se = 0; sesteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ se = *(image2+ii*samps+jj); sesteps = 1.4142 * k; break;}
+			}
+			
+			/* Northeast */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i - k; jj = j + k;
+				if (( ii == -1 ) || ( jj == samps )){ ne = 0; nesteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ ne = *(image2+ii*samps+jj); nesteps = 1.4142 * k; break;}
+			}
+			
+			/* Northwest */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i - k; jj = j - k;
+				if (( ii == -1 ) || ( jj == -1 )){ nw = 0; nwsteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ nw = *(image2+ii*samps+jj); nwsteps = 1.4142 * k; break;}
+			}
+			
+			/* Southwest */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i + k; jj = j - k;
+				if (( ii == lines ) || ( jj == -1 )){ sw = 0; swsteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ sw = *(image2+ii*samps+jj); swsteps = 1.4142 * k; break;}
+			}
+
+/** Other 8 **/
+			/* NNE */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i - (k*2); jj = j + k;
+				if (( ii <= -1 ) || ( jj >= samps )){ nne = 0; nnesteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ nne = *(image2+ii*samps+jj); nnesteps = 2.2361 * k; break;}
+			}
+			
+			/* ENE */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i - k; jj = j + (k*2);
+				if (( ii <= -1 ) || ( jj >= samps )){ ene = 0; enesteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ ene = *(image2+ii*samps+jj); enesteps = 2.2361 * k; break;}
+			}
+			
+			/* ESE */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i + k; jj = j + (k*2);
+				if (( ii >= lines ) || ( jj >= samps )){ ese = 0; esesteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ ese = *(image2+ii*samps+jj); esesteps = 2.2361 * k; break;}
+			}
+			
+			/* SSE */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i + (k*2); jj = j + k;
+				if (( ii >= lines ) || ( jj >= samps )){ sse = 0; ssesteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ sse = *(image2+ii*samps+jj); ssesteps = 2.2361 * k; break;}
+			}
+
+			/* SSW */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i + (k*2); jj = j - k;
+				if (( ii >= lines ) || ( jj <= -1 )){ ssw = 0; sswsteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ ssw = *(image2+ii*samps+jj); sswsteps = 2.2361 * k; break;}
+			}
+			
+			/* WSW */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i + k; jj = j - (k*2);
+				if (( ii >= lines ) || ( jj <= -1 )){ wsw = 0; wswsteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ wsw = *(image2+ii*samps+jj); wswsteps = 2.2361 * k; break;}
+			}
+			
+			/* WNW */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i - k; jj = j - (k*2);
+				if (( ii <= -1 ) || ( jj <= -1 )){ wnw = 0; wnwsteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ wnw = *(image2+ii*samps+jj); wnwsteps = 2.2361 * k; break;}
+			}
+			
+			/* NNW */
+			for ( k = 1; k < infinit; k++ ){
+				ii = i - (k*2); jj = j - k;
+				if (( ii <= -1 ) || ( jj <= -1 )){ nnw = 0; nnwsteps = 0; break;}
+				if ( *(image2+ii*samps+jj) != 0 ){ nnw = *(image2+ii*samps+jj); nnwsteps = 2.2361 * k; break;}
+			}
+			
+			elev = 0; range = 0;
+/*NSEW*/			
+			if ( nsteps > 0.5 ){ elev += north /  nsteps; range +=  1.00 /  nsteps;}
+			if ( ssteps > 0.5 ){ elev += south /  ssteps; range +=  1.00 /  ssteps;}
+			if ( esteps > 0.5 ){ elev +=  east /  esteps; range +=  1.00 /  esteps;}
+			if ( wsteps > 0.5 ){ elev +=  west /  wsteps; range +=  1.00 /  wsteps;}
+/*Diag*/
+			if ( nwsteps > 0.5 ){ elev +=    nw / nwsteps; range +=  1.00 / nwsteps;}
+			if ( nesteps > 0.5 ){ elev +=    ne / nesteps; range +=  1.00 / nesteps;}
+			if ( swsteps > 0.5 ){ elev +=    sw / swsteps; range +=  1.00 / swsteps;}
+			if ( sesteps > 0.5 ){ elev +=    se / sesteps; range +=  1.00 / sesteps;}
+			
+/*Other 8*/
+			if ( nnesteps > 0.5 ){ elev += nne / nnesteps; range +=  1.00 / nnesteps;}
+			if ( enesteps > 0.5 ){ elev += ene / enesteps; range +=  1.00 / enesteps;}
+			if ( esesteps > 0.5 ){ elev += ese / esesteps; range +=  1.00 / esesteps;}
+			if ( ssesteps > 0.5 ){ elev += sse / ssesteps; range +=  1.00 / ssesteps;}
+			if ( sswsteps > 0.5 ){ elev += ssw / sswsteps; range +=  1.00 / sswsteps;}
+			if ( wswsteps > 0.5 ){ elev += wsw / wswsteps; range +=  1.00 / wswsteps;}
+			if ( wnwsteps > 0.5 ){ elev += wnw / wnwsteps; range +=  1.00 / wnwsteps;}
+			if ( nnwsteps > 0.5 ){ elev += nnw / nnwsteps; range +=  1.00 / nnwsteps;}
+									
+			//temp = ( elev / range ) + 0.5 ;
+			temp = ( elev / range );
+			//+ 0.5 ;
+			//if ( temp > 10000 ) temp = 10000;
+			//if ( temp <     0 ) temp =     0;
+			
+			#ifdef _DEBUG2_
+				//printf("%g %g %g \n",temp,elev,range);
+			#endif
+
+			*(image3+samps*i+j) = temp ;			
+		}
+	}
+
+
+
+	for ( i = 0; i < lines; i++ ){
+		for ( j = 0; j < samps; j++ ){
+			*(image2+samps*i+j)= *(image3+samps*i+j);
+		}
+	}
+
+
+	for ( i = 0; i < lines; i++ ){
+		for ( j = 0; j < samps; j++ ){
+			if ( *(image2+samps*i+j) == 0 ) goto again2;
+		}
+	}
+	
+	if ( smooth == 0 ) goto there2;		
+		
+		
+/************************ SMOOTH THE RESULT ***********************/		
+		
+	image4 = (double*) xmalloc( lines*samps*sizeof(double));
+	memcpy(image4,image3,lines*samps*sizeof(double));
+
+
+	for ( i = 0; i < lines; i++ ) {
+		for ( j = 0; j < samps; j++ ) {
+			if ( *(image4+i*samps+j) != 0 ) { *(image3+i*samps+j) = *(image2+i*samps+j) ; continue; }
+
+
+			for ( k = 1; k < infinit; k++ ) { /* Find the smallest box size with data */ 
+				for ( ii = i-k; ii <= i+k; ii++ ){
+					if ( ii <      0 ) continue;
+					if ( ii >= lines ) break;
+					for ( jj = j-k; jj <= j+k; jj++ ) {
+						if ( jj <      0 ) continue;
+						if ( jj >= samps ) continue;
+						if ( *(image4+ii*samps+jj) != 0 ) goto k_nowset;
+					}
+				}
+			}
+		
+			k_nowset:
+			k = k / 4; if ( k < 1 ) k = 1; /* Errrrr.  Make it fourth size */
+			sum = 0;
+			for ( ii = i-k; ii <= i+k; ii++ ) {
+				if ( ii <      0 ) iii = -1 - ii; else iii = ii;
+				if ( ii >= lines ) iii = lines - (ii - lines + 1);
+				for ( jj = j-k; jj <= j+k; jj++ ) {
+					if ( jj <      0 ) jjj = -1 - jj; else jjj = jj;
+					if ( jj >= samps ) jjj = samps - (jj - samps + 1);
+					sum += *(image2+samps*iii+jjj) ;
+				}
+			}
+			k = (k*2)+1;
+			*(image3+samps*i+j) = ( sum / k / k ) ;//+ 0.5;
+		}
+
+		#ifdef _DEBUG_
+			if ( !(i%100) ){
+			fprintf(stdout, "\b\b\b\b\b\b%5ld ", i );   /* Count lines on output screen */
+			fflush(stdout);	
+			}
+		#endif
+	}
+
+	#ifdef _DEBUG_
+		fprintf(stdout, "\b\b\b\b\b\b%5ld ", lines );
+		fflush(stdout);	
+	#endif
+	
+		
+there2:		
+
+
+	/*Allocate output image: */
+	imageout=(double*)xmalloc(samps*lines*sizeof(double));
+	memcpy(imageout,image3,lines*samps*sizeof(double));
+
+	time(&t2);	
+	#ifdef _DEBUG_
+		printf ( "\n\nEnd                  "); printf( ctime(&t2) );
+		printf( "\n                           Total time:        ");
+		printf( "%4.2f minutes. \n", difftime(t2,t1)/60 );		
+	#endif
+	
+	#ifdef _DEBUG2_
+		printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+		printf("Number of zeroes remaining:          0\n\n");
+		printf ( "\n");
+	#endif
+	
+	end:
+
+	#ifdef _DEBUG_
+		printf( "Done.\a\n" );
+	#endif
+
+	/*Assign output pointers: */
+	*pimageout=imageout;
+
+	return 1;
+	
+}
Index: /issm/trunk/src/c/HoleFillerx/HoleFillerx.h
===================================================================
--- /issm/trunk/src/c/HoleFillerx/HoleFillerx.h	(revision 1)
+++ /issm/trunk/src/c/HoleFillerx/HoleFillerx.h	(revision 1)
@@ -0,0 +1,19 @@
+/*
+	HoleFillerx.h
+*/
+
+
+#ifndef HOLEFILLERX_H
+#define HOLEFILLERX_H
+
+//#define _DEBUG_
+//#define _DEBUG2_
+
+#undef __FUNCT__ 
+#define __FUNCT__ "HoleFillerx"
+
+/* local prototypes: */
+int HoleFillerx(double** pimageout,double* imagein, int lines,int samp,int smooth);
+	
+#endif /* HOLEFILLERX_H */
+
Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 28275)
+++ /issm/trunk/src/c/Makefile.am	(revision 1)
@@ -1,891 +1,433 @@
-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @TRIANGLEINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @PARMETISINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@ @PROJINCL@ @MPLAPACKINCL@
-AM_FCFLAGS = @SEMICINCL@
-
-AUTOMAKE_OPTIONS = subdir-objects
-
-EXEEXT=$(ISSMEXT)
-
-# Library declaration {{{
-lib_LTLIBRARIES = libISSMCore.la
-if !MSYS2
-lib_LTLIBRARIES += libISSMOverload.la
+INCLUDES = @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@  @METISINCL@ @PLAPACKINCL@  @BLASLAPACKINCL@ @MUMPSINCL@  @TRIANGLEINCL@
+
+#Compile serial library, and then try and compile parallel library
+if NOSERIAL
+if NOPARALLEL
+lib_LIBRARIES = 
+else
+lib_LIBRARIES = libpISSM.a
 endif
-if WRAPPERS
-lib_LTLIBRARIES += libISSMModules.la
-endif
-#}}}
-
-# Core sources
-issm_sources =
-
-# BAMG sources {{{
-if BAMG
-issm_sources += \
-	./bamg/BamgGeom.cpp \
-	./bamg/BamgMesh.cpp \
-	./bamg/BamgOpts.cpp \
-	./bamg/CrackedEdge.cpp \
-	./bamg/Curve.cpp \
-	./bamg/Edge.cpp \
-	./bamg/GeomEdge.cpp \
-	./bamg/GeomSubDomain.cpp \
-	./bamg/GeomVertex.cpp \
-	./bamg/Geometry.cpp \
-	./bamg/ListofIntersectionTriangles.cpp \
-	./bamg/EigenMetric.cpp \
-	./bamg/Metric.cpp \
-	./bamg/BamgQuadtree.cpp \
-	./bamg/SetOfE4.cpp \
-	./bamg/SubDomain.cpp \
-	./bamg/AdjacentTriangle.cpp \
-	./bamg/Triangle.cpp \
-	./bamg/BamgVertex.cpp \
-	./bamg/VertexOnEdge.cpp \
-	./bamg/VertexOnGeom.cpp \
-	./bamg/VertexOnVertex.cpp \
-	./bamg/Mesh.cpp \
-	./shared/Bamg/BigPrimeNumber.cpp \
-	./modules/Bamgx/Bamgx.cpp \
-	./modules/BamgConvertMeshx/BamgConvertMeshx.cpp \
-	./modules/BamgTriangulatex/BamgTriangulatex.cpp
-
-# Do not include AmrBamg with AD
-if ADOLC
-issm_sources += \
-	./shared/Numerics/isnan.cpp \
-	./shared/MemOps/MemOps.cpp
 else
-if CODIPACK
-issm_sources += ./shared/Numerics/isnan.cpp
+if NOPARALLEL
+lib_LIBRARIES = libISSM.a 
 else
-issm_sources += ./classes/AmrBamg.cpp
+lib_LIBRARIES = libISSM.a libpISSM.a
 endif
 endif
+
+#Serial compilation
+libISSM_a_SOURCES = ./objects/objects.h\
+					./objects/Object.h\
+					./objects/Element.h\
+					./objects/Element.cpp\
+					./objects/Material.h\
+					./objects/Material.cpp\
+					./objects/Load.h\
+					./objects/Load.cpp\
+					./objects/SolverEnum.h\
+					./objects/Contour.h\
+					./objects/Contour.cpp\
+					./objects/Friction.h\
+					./objects/Friction.cpp\
+					./objects/Node.h\
+					./objects/Node.cpp\
+					./objects/Tria.h\
+					./objects/Tria.cpp\
+					./objects/Penta.h\
+					./objects/Penta.cpp\
+					./objects/Matice.h\
+					./objects/Matice.cpp\
+					./objects/Matpar.h\
+					./objects/Matpar.cpp\
+					./objects/ParameterInputs.h\
+					./objects/ParameterInputs.cpp\
+					./objects/Spc.cpp\
+					./objects/Spc.h\
+					./objects/Rgb.cpp\
+					./objects/Rgb.h\
+					./objects/Penpair.cpp\
+					./objects/Penpair.h\
+					./objects/Icefront.cpp\
+					./objects/Icefront.h\
+					./objects/Param.cpp\
+					./objects/Param.h\
+					./objects/NodeSets.cpp\
+					./objects/NodeSets.h\
+					./DataSet/DataSet.cpp\
+					./DataSet/DataSet.h\
+					./shared/shared.h\
+					./shared/Alloc/alloc.h\
+					./shared/Alloc/alloc.cpp\
+					./shared/Matlab/matlabshared.h\
+					./shared/Matlab/PrintfFunction.cpp\
+					./shared/Matlab/ModuleBoot.cpp\
+					./shared/Matlab/mxGetAssignedField.cpp\
+					./shared/Matlab/mxGetField.cpp\
+					./shared/Matlab/CheckNumMatlabArguments.cpp\
+					./shared/Matrix/matrix.h\
+					./shared/Matrix/MatrixUtils.cpp\
+					./shared/Numerics/numerics.h\
+					./shared/Numerics/GaussPoints.h\
+					./shared/Numerics/extrema.cpp\
+					./shared/Numerics/GaussPoints.cpp\
+					./shared/Exceptions/exceptions.h\
+					./shared/Exceptions/Exceptions.cpp\
+					./shared/Exceptions/exprintf.cpp\
+					./shared/Exp/exp.h\
+					./shared/Exp/IsInPoly.cpp\
+					./shared/Exp/IsInPolySerial.cpp\
+					./shared/Exp/DomainOutlineRead.cpp\
+					./shared/TriMesh/trimesh.h\
+					./shared/TriMesh/AssociateSegmentToElement.cpp\
+					./shared/TriMesh/GridInsideHole.cpp\
+					./shared/TriMesh/OrderSegments.cpp\
+					./shared/TriMesh/SplitMeshForRifts.cpp\
+					./shared/TriMesh/TriMeshUtils.cpp\
+					./shared/Sorting/binary_search.cpp\
+					./shared/Sorting/sorting.h\
+					./shared/Elements/elements.h\
+					./shared/Elements/ResolvePointers.cpp\
+					./shared/Elements/Paterson.cpp\
+					./shared/Elements/GetElementNodeData.cpp\
+					./toolkits/petsc\
+					./toolkits/petsc/patches\
+					./toolkits/petsc/patches/petscpatches.h\
+					./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp\
+					./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp\
+					./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp\
+					./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp\
+					./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp\
+					./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp\
+					./toolkits/petsc/patches/PetscDetermineLocalSize.cpp\
+					./toolkits/petsc/patches/VecTranspose.cpp\
+					./toolkits/petsc/patches/VecToMPISerial.cpp\
+					./toolkits/petsc/patches/MatToSerial.cpp\
+					./toolkits/petsc/patches/VecMerge.cpp\
+					./toolkits/petsc/patches/NewVec.cpp\
+					./toolkits/petsc/patches/NewVecFromLocalSize.cpp\
+					./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp\
+					./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp\
+					./toolkits/petsc/patches/NewMat.cpp\
+					./toolkits/petsc/patches/VecFree.cpp\
+					./toolkits/petsc/patches/KSPFree.cpp\
+					./toolkits/petsc/patches/ISFree.cpp\
+					./toolkits/petsc/patches/MatFree.cpp\
+					./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp\
+					./toolkits/petsc/patches/VecPartition.cpp\
+					./toolkits/petsc/patches/MatPartition.cpp\
+					./toolkits/petsc/patches/MatInvert.cpp\
+					./toolkits/petsc/patches/MatMultPatch.cpp\
+					./toolkits/petsc/petscincludes.h\
+					./toolkits/mpi/mpiincludes.h\
+					./toolkits/mpi/patches/mpipatches.h\
+					./toolkits/mpi/patches/MPI_Upperrow.cpp\
+					./toolkits/mpi/patches/MPI_Lowerrow.cpp\
+					./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp\
+					./toolkits/metis/metisincludes.h\
+					./toolkits/triangle/triangleincludes.h\
+					./toolkits.h\
+					./io/io.h\
+					./io/FetchData.cpp\
+					./io/WriteData.cpp\
+					./io/WriteDataToDisk.cpp\
+					./io/SerialFetchData.cpp\
+					./io/SerialWriteData.cpp\
+					./io/ParallelFetchData.cpp\
+					./io/ParallelFetchInteger.cpp\
+					./io/ParallelFetchMat.cpp\
+					./io/ParallelFetchScalar.cpp\
+					./io/ParallelFetchString.cpp\
+					./io/ModelFetchData.cpp\
+					./io/WriteNodeSets.cpp\
+					./io/WriteParams.cpp\
+					./io/FetchNodeSets.cpp\
+					./io/ParameterInputsInit.cpp\
+					./EnumDefinitions/EnumDefinitions.h\
+					./EnumDefinitions/EnumDefinitions.cpp\
+					./EnumDefinitions/AnalysisTypeAsEnum.cpp\
+					./ModelProcessorx/ModelProcessorx.h\
+					./ModelProcessorx/Model.cpp\
+					./ModelProcessorx/FetchRifts.cpp\
+					./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp\
+					./ModelProcessorx/DistributeNumDofs.cpp\
+					./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp \
+					./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp\
+					./ModelProcessorx/ModelCreateParameters.cpp\
+					./Dofx/Dofx.h\
+					./Dofx/Dofx.cpp\
+					./Dux/Dux.h\
+					./Dux/Dux.cpp\
+					./ControlConstrainx/ControlConstrainx.h\
+					./ControlConstrainx/ControlConstrainx.cpp\
+					./Misfitx/Misfitx.h\
+					./Misfitx/Misfitx.cpp\
+					./Orthx/Orthx.h\
+					./Orthx/Orthx.cpp\
+					./Gradjx/Gradjx.h\
+					./Gradjx/Gradjx.cpp\
+					./UpdateFromInputsx/UpdateFromInputsx.h\
+					./UpdateFromInputsx/UpdateFromInputsx.cpp\
+					./ConfigureObjectsx/ConfigureObjectsx.h\
+					./ConfigureObjectsx/ConfigureObjectsx.cpp\
+					./BuildNodeSetsx/BuildNodeSetsx.h\
+					./BuildNodeSetsx/BuildNodeSetsx.cpp\
+					./BuildNodeSetsx/PartitionSets.cpp\
+					./SpcNodesx/SpcNodesx.h\
+					./SpcNodesx/SpcNodesx.cpp\
+					./MpcNodesx/MpcNodesx.h\
+					./MpcNodesx/MpcNodesx.cpp\
+					./DataInterpx/DataInterpx.cpp\
+					./DataInterpx/DataInterpx.h\
+					./HoleFillerx/HoleFillerx.cpp\
+					./HoleFillerx/HoleFillerx.h\
+					./MeshPartitionx/MeshPartitionx.cpp\
+					./MeshPartitionx/MeshPartitionx.h\
+					./ContourToMeshx/ContourToMeshx.cpp\
+					./ContourToMeshx/ContourToMeshx.h\
+					./Reducevectorgtosx/Reducevectorgtosx.cpp\
+					./Reducevectorgtosx/Reducevectorgtosx.h\
+					./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp\
+					./Reducematrixfromgtofx/Reducematrixfromgton.cpp\
+					./Reducematrixfromgtofx/Reducematrixfromgtofx.h\
+					./Reduceloadfromgtofx/Reduceloadfromgtofx.h\
+					./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp\
+					./NormalizeConstraintsx/NormalizeConstraintsx.cpp\
+					./NormalizeConstraintsx/NormalizeConstraintsx.h\
+					./SystemMatricesx/SystemMatricesx.cpp\
+					./SystemMatricesx/SystemMatricesx.h\
+					./PenaltyConstraintsx/PenaltyConstraintsx.cpp\
+					./PenaltyConstraintsx/PenaltyConstraintsx.h\
+					./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp\
+					./PenaltySystemMatricesx/PenaltySystemMatricesx.h\
+					./Solverx/Solverx.cpp\
+					./Solverx/Solverx.h\
+					./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp\
+					./Mergesolutionfromftogx/Mergesolutionfromftogx.h\
+					./ProcessParamsx/ProcessParamsx.cpp\
+					./ProcessParamsx/ProcessParamsx.h
+
+
+libISSM_a_CXXFLAGS = -fPIC -DMATLAB -D_SERIAL_ -ansi -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_
+if LARGEARRAYS
+libISSM_a_CXXFLAGS += -D__GCC4BUILD__  
+else
+libISSM_a_CXXFLAGS += -DMX_COMPAT_32
 endif
-#}}}
-# Core sources {{{
-issm_sources += \
-	./datastructures/DataSet.cpp \
-	./classes/gauss/GaussSeg.cpp \
-	./classes/gauss/GaussTria.cpp \
-	./classes/gauss/GaussTetra.cpp \
-	./classes/gauss/GaussPenta.cpp \
-	./classes/IoModel.cpp \
-	./classes/FemModel.cpp \
-	./classes/Loads/Friction.cpp \
-	./classes/Constraints/SpcTransient.cpp \
-	./classes/DependentObject.cpp \
-	./classes/Contours.cpp \
-	./classes/Vertices.cpp \
-	./classes/Nodes.cpp \
-	./classes/Numberedcostfunction.cpp \
-	./classes/Misfit.cpp \
-	./classes/Cfsurfacesquare.cpp \
-	./classes/Cfsurfacesquaretransient.cpp \
-	./classes/Cfdragcoeffabsgrad.cpp \
-	./classes/Cfdragcoeffabsgradtransient.cpp \
-	./classes/Cfrheologybbarabsgrad.cpp \
-	./classes/Cfrheologybbarabsgradtransient.cpp \
-	./classes/Cfsurfacelogvel.cpp \
-	./classes/Cflevelsetmisfit.cpp \
-	./classes/Regionaloutput.cpp \
-	./classes/Nodalvalue.cpp \
-	./classes/Node.cpp \
-	./classes/Vertex.cpp \
-	./classes/Hook.cpp \
-	./classes/Radar.cpp \
-	./classes/BarystaticContributions.cpp \
-	./classes/ExternalResults/Results.cpp \
-	./classes/Elements/Element.cpp \
-	./classes/Elements/Elements.cpp \
-	./classes/Elements/ElementHook.cpp \
-	./classes/Elements/Seg.cpp \
-	./classes/Elements/SegRef.cpp \
-	./classes/Elements/Tria.cpp \
-	./classes/Elements/TriaRef.cpp \
-	./classes/Elements/Tetra.cpp \
-	./classes/Elements/TetraRef.cpp \
-	./classes/Elements/Penta.cpp \
-	./classes/Elements/PentaRef.cpp \
-	./classes/Materials/Materials.cpp \
-	./classes/Materials/Matice.cpp \
-	./classes/Materials/Matlitho.cpp \
-	./classes/Materials/Matestar.cpp \
-	./classes/Constraints/Constraints.cpp \
-	./classes/Constraints/SpcStatic.cpp \
-	./classes/Constraints/SpcDynamic.cpp \
-	./classes/Loads/Channel.cpp \
-	./classes/Loads/Loads.cpp \
-	./classes/Loads/Penpair.cpp \
-	./classes/Loads/Pengrid.cpp \
-	./classes/Loads/Moulin.cpp \
-	./classes/Loads/Numericalflux.cpp \
-	./classes/Loads/Neumannflux.cpp \
-	./classes/matrix/ElementMatrix.cpp \
-	./classes/matrix/ElementVector.cpp \
-	./classes/Params/Parameters.cpp \
-	./classes/Params/BoolParam.cpp \
-	./classes/Params/ControlParam.cpp \
-	./classes/Params/IntParam.cpp \
-	./classes/Params/IntVecParam.cpp \
-	./classes/Params/IntMatParam.cpp \
-	./classes/Params/DoubleParam.cpp \
-	./classes/Params/FileParam.cpp \
-	./classes/Params/StringArrayParam.cpp \
-	./classes/Params/DoubleMatParam.cpp \
-	./classes/Params/DoubleTransientMatParam.cpp \
-	./classes/Params/DoubleMatArrayParam.cpp \
-	./classes/Params/DoubleVecParam.cpp \
-	./classes/Params/StringParam.cpp \
-	./classes/Params/MatrixParam.cpp \
-	./classes/Params/VectorParam.cpp \
-	./classes/Params/TransientParam.cpp \
-	./classes/Params/TransientArrayParam.cpp \
-	./classes/Params/DataSetParam.cpp \
-	./classes/Profiler.cpp \
-	./shared/Matrix/MatrixUtils.cpp \
-	./shared/io/Disk/pfopen.cpp \
-	./shared/io/Disk/pfclose.cpp \
-	./shared/io/Disk/WriteLockFile.cpp \
-	./shared/io/Print/PrintfFunction.cpp \
-	./shared/io/Comm/IssmComm.cpp \
-	./shared/io/Marshalling/IoCodeConversions.cpp \
-	./shared/io/Marshalling/Marshalling.cpp \
-	./shared/LatLong/Ll2xyx.cpp \
-	./shared/LatLong/Xy2llx.cpp \
-	./shared/FSanalyticals/fsanalyticals.cpp \
-	./shared/Enum/EnumToStringx.cpp \
-	./shared/Enum/StringToEnumx.cpp \
-	./shared/Numerics/Verbosity.cpp \
-	./shared/Numerics/GaussPoints.cpp \
-	./shared/Numerics/cross.cpp \
-	./shared/Numerics/cubic.cpp \
-	./shared/Numerics/NewtonSolveDnorm.cpp \
-	./shared/Numerics/ODE1.cpp \
-	./shared/Numerics/extrema.cpp \
-	./shared/Numerics/legendre.cpp \
-	./shared/Numerics/XZvectorsToCoordinateSystem.cpp \
-	./shared/Exceptions/Exceptions.cpp \
-	./shared/Sorting/binary_search.cpp \
-	./shared/Elements/Cuffey.cpp \
-	./shared/Elements/BuddJacka.cpp \
-	./shared/Elements/CuffeyTemperate.cpp \
-	./shared/Elements/StressIntensityIntegralWeight.cpp \
-	./shared/Elements/Paterson.cpp \
-	./shared/Elements/Arrhenius.cpp \
-	./shared/Elements/NyeCO2.cpp \
-	./shared/Elements/NyeH2O.cpp \
-	./shared/Elements/LliboutryDuval.cpp \
-	./shared/Elements/PrintArrays.cpp \
-	./shared/Elements/PddSurfaceMassBalance.cpp \
-	./shared/Elements/PddSurfaceMassBalanceSicopolis.cpp \
-	./shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp \
-	./shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp \
-	./shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp \
-	./shared/Elements/DrainageFunctionWaterfraction.cpp \
-	./shared/Elements/EstarComponents.cpp \
-	./shared/Random/random.cpp \
-	./shared/Random/randomgenerator.cpp \
-	./shared/String/DescriptorIndex.cpp \
-	./toolkits/issm/IssmToolkitUtils.cpp \
-	./toolkits/issm/IssmSolver.cpp \
-	./toolkits/mpi/issmmpi.cpp \
-	./toolkits/mpi/commops/DetermineLocalSize.cpp \
-	./toolkits/mpi/commops/DetermineGlobalSize.cpp \
-	./toolkits/mpi/commops/DetermineRowRankFromLocalSize.cpp \
-	./toolkits/mpi/commops/GetOwnershipBoundariesFromRange.cpp \
-	./toolkits/ToolkitOptions.cpp \
-	./modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp\
-	./modules/ModelProcessorx/ModelProcessorx.cpp \
-	./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp \
-	./modules/ModelProcessorx/NodesPartitioning.cpp \
-	./modules/ModelProcessorx/EdgesPartitioning.cpp \
-	./modules/ModelProcessorx/FacesPartitioning.cpp \
-	./modules/ModelProcessorx/CreateParameters.cpp \
-	./modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp \
-	./modules/ModelProcessorx/CreateFaces.cpp \
-	./modules/ModelProcessorx/CreateEdges.cpp \
-	./modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp \
-	./modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp \
-	./modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp \
-	./modules/ModelProcessorx/CreateNodes.cpp \
-	./modules/ParseToolkitsOptionsx/ParseToolkitsOptionsx.cpp \
-	./modules/NodesDofx/NodesDofx.cpp \
-	./modules/NodalValuex/NodalValuex.cpp \
-	./modules/VertexCoordinatesx/VertexCoordinatesx.cpp \
-	./modules/ElementCoordinatesx/ElementCoordinatesx.cpp \
-	./modules/OutputResultsx/OutputResultsx.cpp \
-	./modules/InputDepthAverageAtBasex/InputDepthAverageAtBasex.cpp \
-	./modules/InputDuplicatex/InputDuplicatex.cpp \
-	./modules/InputExtrudex/InputExtrudex.cpp \
-	./modules/SurfaceAreax/SurfaceAreax.cpp \
-	./modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp \
-	./modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp \
-	./modules/SystemMatricesx/SystemMatricesx.cpp \
-	./modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp \
-	./modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp \
-	./modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp \
-	./modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp \
-	./modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp \
-	./modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp \
-	./modules/GeothermalFluxx/GeothermalFluxx.cpp \
-	./modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp \
-	./modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp \
-	./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp \
-	./modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp \
-	./modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp \
-	./modules/FrontalForcingsx/FrontalForcingsx.cpp \
-	./modules/ConfigureObjectsx/ConfigureObjectsx.cpp \
-	./modules/SpcNodesx/SpcNodesx.cpp \
-	./modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp \
-	./modules/SurfaceMassBalancex/Gembx.cpp \
-	./modules/Reducevectorgtofx/Reducevectorgtofx.cpp \
-	./modules/Reduceloadx/Reduceloadx.cpp \
-	./modules/ConstraintsStatex/ConstraintsStatex.cpp \
-	./modules/ResetConstraintsx/ResetConstraintsx.cpp \
-	./modules/ResetFSBasalBoundaryConditionx/ResetFSBasalBoundaryConditionx.cpp \
-	./modules/Solverx/Solverx.cpp \
-	./modules/StochasticForcingx/StochasticForcingx.cpp \
-	./modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp \
-	./cores/ProcessArguments.cpp \
-	./cores/ResetBoundaryConditions.cpp \
-	./cores/WrapperCorePointerFromSolutionEnum.cpp \
-	./cores/WrapperPreCorePointerFromSolutionEnum.cpp \
-	./cores/CorePointerFromSolutionEnum.cpp \
-	./cores/ad_core.cpp \
-	./cores/adgradient_core.cpp \
-	./main/EnvironmentInit.cpp \
-	./main/EnvironmentFinalize.cpp \
-	./analyses/EnumToAnalysis.cpp \
-	./solutionsequences/solutionsequence_la.cpp \
-	./solutionsequences/solutionsequence_la_theta.cpp \
-	./solutionsequences/solutionsequence_linear.cpp \
-	./solutionsequences/solutionsequence_nonlinear.cpp \
-	./solutionsequences/solutionsequence_newton.cpp \
-	./solutionsequences/solutionsequence_fct.cpp \
-	./solutionsequences/solutionsequence_schurcg.cpp \
-	./solutionsequences/solutionsequence_sampling.cpp \
-	./solutionsequences/convergence.cpp \
-	./classes/Options/Options.cpp \
-	./classes/Options/OptionUtilities.cpp \
-	./classes/RiftStruct.cpp \
-	./modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp \
-	./modules/ModelProcessorx/Transient/UpdateParametersTransient.cpp \
-	./cores/transient_core.cpp \
-	./cores/steadystate_core.cpp \
-	./cores/masstransport_core.cpp \
-	./cores/oceantransport_core.cpp \
-	./cores/depthaverage_core.cpp \
-	./cores/extrudefrombase_core.cpp \
-	./cores/extrudefromtop_core.cpp \
-	./cores/thermal_core.cpp \
-	./cores/smb_core.cpp \
-	./cores/bmb_core.cpp \
-	./cores/debris_core.cpp \
-	./solutionsequences/solutionsequence_thermal_nonlinear.cpp \
-	./modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp \
-	./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp \
-	./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp \
-	./modules/ModelProcessorx/Control/CreateParametersControl.cpp \
-	./modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp \
-	./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp \
-	./modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp \
-	./modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp \
-	./modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp \
-	./modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp \
-	./modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp \
-	./modules/Gradjx/Gradjx.cpp \
-	./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp \
-	./modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp \
-	./modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp \
-	./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp \
-	./modules/RheologyBAbsGradientx/RheologyBAbsGradientx.cpp \
-	./shared/Numerics/BrentSearch.cpp \
-	./cores/control_core.cpp \
-	./cores/controltao_core.cpp \
-	./cores/controlm1qn3_core.cpp \
-	./cores/controladm1qn3_core.cpp \
-	./cores/controlvalidation_core.cpp \
-	./cores/adjointstressbalance_core.cpp \
-	./cores/adjointbalancethickness_core.cpp \
-	./cores/adjointbalancethickness2_core.cpp \
-	./cores/AdjointCorePointerFromSolutionEnum.cpp \
-	./solutionsequences/solutionsequence_adjoint_linear.cpp \
-	./cores/hydrology_core.cpp \
-	./solutionsequences/solutionsequence_hydro_nonlinear.cpp \
-	./solutionsequences/solutionsequence_shakti_nonlinear.cpp \
-	./solutionsequences/solutionsequence_glads_nonlinear.cpp \
-	./cores/stressbalance_core.cpp \
-	./solutionsequences/solutionsequence_stokescoupling_nonlinear.cpp \
-	./cores/balancethickness_core.cpp \
-	./cores/balancethickness2_core.cpp \
-	./cores/balancevelocity_core.cpp \
-	./cores/dummy_core.cpp \
-	./cores/surfaceslope_core.cpp \
-	./cores/bedslope_core.cpp \
-	./cores/damage_core.cpp \
-	./cores/levelsetfunctionslope_core.cpp \
-	./cores/movingfront_core.cpp \
-	./cores/groundingline_core.cpp \
-	./modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp \
-	./classes/Loads/Riftfront.cpp \
-	./modules/ConstraintsStatex/RiftConstraintsState.cpp \
-	./modules/ModelProcessorx/CreateOutputDefinitions.cpp \
-	./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp \
-	./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp \
-	./classes/Inputs/Inputs.cpp \
-	./classes/Inputs/BoolInput.cpp \
-	./classes/Inputs/DoubleInput.cpp \
-	./classes/Inputs/IntInput.cpp \
-	./classes/Inputs/ElementInput.cpp \
-	./classes/Inputs/SegInput.cpp \
-	./classes/Inputs/TriaInput.cpp \
-	./classes/Inputs/PentaInput.cpp \
-	./classes/Inputs/DatasetInput.cpp \
-	./classes/Inputs/ControlInput.cpp \
-	./classes/Inputs/TransientInput.cpp \
-	./classes/Inputs/ArrayInput.cpp \
-	./classes/Inputs/IntArrayInput.cpp
-#}}}
-# ADJOINTMPI/MeDiPack sources {{{
-if ADJOINTMPI
-issm_sources += ./toolkits/codipack/ampi_interface.cpp
+
+
+
+
+#Parallel compilation
+libpISSM_a_SOURCES = ./objects/objects.h\
+					./objects/Object.h\
+					./objects/Element.h\
+					./objects/Element.cpp\
+					./objects/Material.h\
+					./objects/Material.cpp\
+					./objects/Load.h\
+					./objects/Load.cpp\
+					./objects/SolverEnum.h\
+					./objects/Contour.h\
+					./objects/Contour.cpp\
+					./objects/Friction.h\
+					./objects/Friction.cpp\
+					./objects/Node.h\
+					./objects/Node.cpp\
+					./objects/Tria.h\
+					./objects/Tria.cpp\
+					./objects/Penta.h\
+					./objects/Penta.cpp\
+					./objects/Matice.h\
+					./objects/Matice.cpp\
+					./objects/Matpar.h\
+					./objects/Matpar.cpp\
+					./objects/ParameterInputs.h\
+					./objects/ParameterInputs.cpp\
+					./objects/Spc.cpp\
+					./objects/Spc.h\
+					./objects/Rgb.cpp\
+					./objects/Rgb.h\
+					./objects/Penpair.cpp\
+					./objects/Penpair.h\
+					./objects/Icefront.cpp\
+					./objects/Icefront.h\
+					./objects/Param.cpp\
+					./objects/Param.h\
+					./objects/NodeSets.cpp\
+					./objects/NodeSets.h\
+					./DataSet/DataSet.cpp\
+					./DataSet/DataSet.h\
+					./shared/shared.h\
+					./shared/Alloc/alloc.h\
+					./shared/Alloc/alloc.cpp\
+					./shared/Matlab/matlabshared.h\
+					./shared/Matlab/PrintfFunction.cpp\
+					./shared/Matlab/ModuleBoot.cpp\
+					./shared/Matlab/mxGetAssignedField.cpp\
+					./shared/Matlab/mxGetField.cpp\
+					./shared/Matlab/CheckNumMatlabArguments.cpp\
+					./shared/Matrix/matrix.h\
+					./shared/Matrix/MatrixUtils.cpp\
+					./shared/Numerics/numerics.h\
+					./shared/Numerics/GaussPoints.h\
+					./shared/Numerics/GaussPoints.cpp\
+					./shared/Numerics/extrema.cpp\
+					./shared/Exceptions/exceptions.h\
+					./shared/Exceptions/Exceptions.cpp\
+					./shared/Exceptions/exprintf.cpp\
+					./shared/Exp/exp.h\
+					./shared/Exp/IsInPoly.cpp\
+					./shared/Exp/IsInPolySerial.cpp\
+					./shared/Exp/DomainOutlineRead.cpp\
+					./shared/TriMesh/trimesh.h\
+					./shared/TriMesh/AssociateSegmentToElement.cpp\
+					./shared/TriMesh/GridInsideHole.cpp\
+					./shared/TriMesh/OrderSegments.cpp\
+					./shared/TriMesh/SplitMeshForRifts.cpp\
+					./shared/TriMesh/TriMeshUtils.cpp\
+					./shared/Sorting/binary_search.cpp\
+					./shared/Sorting/sorting.h\
+					./shared/Elements/elements.h\
+					./shared/Elements/ResolvePointers.cpp\
+					./shared/Elements/Paterson.cpp\
+					./shared/Elements/GetElementNodeData.cpp\
+					./toolkits/petsc\
+					./toolkits/petsc/patches\
+					./toolkits/petsc/patches/petscpatches.h\
+					./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp\
+					./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp\
+					./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp\
+					./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp\
+					./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp\
+					./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp\
+					./toolkits/petsc/patches/PetscDetermineLocalSize.cpp\
+					./toolkits/petsc/patches/VecTranspose.cpp\
+					./toolkits/petsc/patches/VecToMPISerial.cpp\
+					./toolkits/petsc/patches/MatToSerial.cpp\
+					./toolkits/petsc/patches/VecMerge.cpp\
+					./toolkits/petsc/patches/NewVec.cpp\
+					./toolkits/petsc/patches/NewVecFromLocalSize.cpp\
+					./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp\
+					./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp\
+					./toolkits/petsc/patches/NewMat.cpp\
+					./toolkits/petsc/patches/VecFree.cpp\
+					./toolkits/petsc/patches/KSPFree.cpp\
+					./toolkits/petsc/patches/ISFree.cpp\
+					./toolkits/petsc/patches/MatFree.cpp\
+					./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp\
+					./toolkits/petsc/patches/VecPartition.cpp\
+					./toolkits/petsc/patches/MatPartition.cpp\
+					./toolkits/petsc/patches/MatInvert.cpp\
+					./toolkits/petsc/patches/MatMultPatch.cpp\
+					./toolkits/petsc/petscincludes.h\
+					./toolkits/mpi/mpiincludes.h\
+					./toolkits/mpi/patches/mpipatches.h\
+					./toolkits/mpi/patches/MPI_Upperrow.cpp\
+					./toolkits/mpi/patches/MPI_Lowerrow.cpp\
+					./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp\
+					./toolkits/metis/metisincludes.h\
+					./toolkits/triangle/triangleincludes.h\
+					./toolkits.h\
+					./io/io.h\
+					./io/FetchData.cpp\
+					./io/WriteData.cpp\
+					./io/WriteDataToDisk.cpp\
+					./io/SerialFetchData.cpp\
+					./io/SerialWriteData.cpp\
+					./io/ParallelFetchData.cpp\
+					./io/ParallelFetchInteger.cpp\
+					./io/ParallelFetchMat.cpp\
+					./io/ParallelFetchScalar.cpp\
+					./io/ParallelFetchString.cpp\
+					./io/ModelFetchData.cpp\
+					./io/WriteNodeSets.cpp\
+					./io/WriteParams.cpp\
+					./io/FetchNodeSets.cpp\
+					./io/ParameterInputsInit.cpp\
+					./EnumDefinitions/EnumDefinitions.h\
+					./EnumDefinitions/EnumDefinitions.cpp\
+					./EnumDefinitions/AnalysisTypeAsEnum.cpp\
+					./ModelProcessorx/ModelProcessorx.h\
+					./ModelProcessorx/Model.cpp\
+					./ModelProcessorx/FetchRifts.cpp\
+					./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp\
+					./ModelProcessorx/DistributeNumDofs.cpp\
+					./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp \
+					./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp\
+					./ModelProcessorx/ModelCreateParameters.cpp\
+					./Dofx/Dofx.h\
+					./Dofx/Dofx.cpp\
+					./Dux/Dux.h\
+					./Dux/Dux.cpp\
+					./ControlConstrainx/ControlConstrainx.h\
+					./ControlConstrainx/ControlConstrainx.cpp\
+					./Misfitx/Misfitx.h\
+					./Misfitx/Misfitx.cpp\
+					./Orthx/Orthx.h\
+					./Orthx/Orthx.cpp\
+					./Gradjx/Gradjx.h\
+					./Gradjx/Gradjx.cpp\
+					./UpdateFromInputsx/UpdateFromInputsx.h\
+					./UpdateFromInputsx/UpdateFromInputsx.cpp\
+					./ConfigureObjectsx/ConfigureObjectsx.h\
+					./ConfigureObjectsx/ConfigureObjectsx.cpp\
+					./BuildNodeSetsx/BuildNodeSetsx.h\
+					./BuildNodeSetsx/BuildNodeSetsx.cpp\
+					./BuildNodeSetsx/PartitionSets.cpp\
+					./SpcNodesx/SpcNodesx.h\
+					./SpcNodesx/SpcNodesx.cpp\
+					./MpcNodesx/MpcNodesx.h\
+					./MpcNodesx/MpcNodesx.cpp\
+					./DataInterpx/DataInterpx.cpp\
+					./DataInterpx/DataInterpx.h\
+					./HoleFillerx/HoleFillerx.cpp\
+					./HoleFillerx/HoleFillerx.h\
+					./MeshPartitionx/MeshPartitionx.cpp\
+					./MeshPartitionx/MeshPartitionx.h\
+					./ContourToMeshx/ContourToMeshx.cpp\
+					./ContourToMeshx/ContourToMeshx.h\
+					./Reducevectorgtosx/Reducevectorgtosx.cpp\
+					./Reducevectorgtosx/Reducevectorgtosx.h\
+					./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp\
+					./Reducematrixfromgtofx/Reducematrixfromgton.cpp\
+					./Reducematrixfromgtofx/Reducematrixfromgtofx.h\
+					./Reduceloadfromgtofx/Reduceloadfromgtofx.h\
+					./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp\
+					./NormalizeConstraintsx/NormalizeConstraintsx.cpp\
+					./NormalizeConstraintsx/NormalizeConstraintsx.h\
+					./SystemMatricesx/SystemMatricesx.cpp\
+					./SystemMatricesx/SystemMatricesx.h\
+					./PenaltyConstraintsx/PenaltyConstraintsx.cpp\
+					./PenaltyConstraintsx/PenaltyConstraintsx.h\
+					./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp\
+					./PenaltySystemMatricesx/PenaltySystemMatricesx.h\
+					./Solverx/Solverx.cpp\
+					./Solverx/Solverx.h\
+					./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp\
+					./Mergesolutionfromftogx/Mergesolutionfromftogx.h\
+					./ProcessParamsx/ProcessParamsx.cpp\
+					./ProcessParamsx/ProcessParamsx.h\
+					./parallel/diagnostic_core_nonlinear.cpp\
+					./parallel/CreateFemModel.cpp\
+					./parallel/OutputDiagnostic.cpp\
+					./parallel/WriteLockFile.cpp
+
+libpISSM_a_CXXFLAGS = -fPIC -D_PARALLEL_   -D_C_
+
+if NOPARALLEL
+bin_PROGRAMS = 
+else 
+bin_PROGRAMS = diagnostic.exe 
+#control.exe thermalsteady.exe
 endif
-if MEDIPACK
-issm_sources += ./toolkits/codipack/ampi_interface.cpp
-endif
-#}}}
-# DAKOTA sources {{{
-if DAKOTA
-issm_sources += \
-	./classes/Dakota/IssmDirectApplicInterface.h \
-	./classes/Dakota/IssmParallelDirectApplicInterface.cpp \
-	./modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp \
-	./modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp \
-	./modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.cpp \
-	./modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp \
-	./modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp \
-	./modules/ModelProcessorx/Dakota/UpdateElementsAndMaterialsDakota.cpp \
-	./cores/dakota_core.cpp
-if SYSTEM_HAS_FMEMOPEN
-issm_sources += ./modules/QmuStatisticsx/QmuStatisticsx.cpp
-endif
-endif
-#}}}
-# PETSc sources {{{
-if PETSC
-issm_sources += \
-	./toolkits/petsc \
-	./toolkits/petsc/patches \
-	./toolkits/petsc/patches/VecToMPISerial.cpp \
-	./toolkits/petsc/patches/MatToMPISerial.cpp \
-	./toolkits/petsc/patches/NewVec.cpp \
-	./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp \
-	./toolkits/petsc/patches/NewMat.cpp \
-	./toolkits/petsc/patches/VecFree.cpp \
-	./toolkits/petsc/patches/KSPFree.cpp \
-	./toolkits/petsc/patches/MatFree.cpp \
-	./toolkits/petsc/patches/MatMultPatch.cpp \
-	./toolkits/petsc/patches/ISSMToPetscMatrixType.cpp \
-	./toolkits/petsc/patches/ISSMToPetscInsertMode.cpp \
-	./toolkits/petsc/patches/ISSMToPetscNormMode.cpp \
-	./toolkits/petsc/objects/PetscMat.cpp \
-	./toolkits/petsc/objects/PetscVec.cpp \
-	./toolkits/petsc/objects/PetscSolver.cpp
-endif
-#}}}
-# MUMPS sources {{{
-if MUMPS
-issm_sources += ./toolkits/mumps/MumpsSolve.cpp
-endif
-#}}}
-# GSL sources {{{
-if GSL
-issm_sources += ./toolkits/gsl/DenseGslSolve.cpp
-endif
-#}}}
-# PROJ sources {{{
-if PROJ
-issm_sources += ./modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp
-endif
-#}}}
-# Analyses {{{
-if ADJOINTBALANCETHICKNESS
-issm_sources += ./analyses/AdjointBalancethicknessAnalysis.cpp
-endif
-if ADJOINTBALANCETHICKNESS2
-issm_sources += ./analyses/AdjointBalancethickness2Analysis.cpp
-endif
-if ADJOINTHORIZ
-issm_sources += ./analyses/AdjointHorizAnalysis.cpp
-endif
-if AGE
-issm_sources += ./analyses/AgeAnalysis.cpp
-endif
-if BALANCETHICKNESS
-issm_sources += ./analyses/BalancethicknessAnalysis.cpp
-endif
-if BALANCETHICKNESS2
-issm_sources += ./analyses/Balancethickness2Analysis.cpp
-endif
-if BALANCETHICKNESSSOFT
-issm_sources += ./analyses/BalancethicknessSoftAnalysis.cpp
-endif
-if BALANCEVELOCITY
-issm_sources += ./analyses/BalancevelocityAnalysis.cpp
-endif
-if L2PROJECTIONBASE
-issm_sources += ./analyses/L2ProjectionBaseAnalysis.cpp
-endif
-if DAMAGEEVOLUTION
-issm_sources += ./analyses/DamageEvolutionAnalysis.cpp
-issm_sources += ./modules/Damagex/Damagex.cpp
-endif
-if DEBRIS
-issm_sources += ./analyses/DebrisAnalysis.cpp
-endif
-if STRESSBALANCE
-issm_sources += ./analyses/StressbalanceAnalysis.cpp
-endif
-if UZAWAPRESSURE
-issm_sources += ./analyses/UzawaPressureAnalysis.cpp
-endif
-if STRESSBALANCESIA
-issm_sources += ./analyses/StressbalanceSIAAnalysis.cpp
-endif
-if STRESSBALANCEVERTICAL
-issm_sources += ./analyses/StressbalanceVerticalAnalysis.cpp
-endif
-if ENTHALPY
-issm_sources += ./analyses/EnthalpyAnalysis.cpp
-endif
-if GLHEIGHTADVECTION
-issm_sources += ./analyses/GLheightadvectionAnalysis.cpp
-endif
-if HYDROLOGYSHREVE
-issm_sources += ./analyses/HydrologyShreveAnalysis.cpp
-endif
-if HYDROLOGYTWS
-issm_sources += ./analyses/HydrologyTwsAnalysis.cpp
-endif
-
-if HYDROLOGYSHAKTI
-issm_sources += ./analyses/HydrologyShaktiAnalysis.cpp
-endif
-if HYDROLOGYPISM
-issm_sources += ./analyses/HydrologyPismAnalysis.cpp
-endif
-if HYDROLOGYGLADS
-issm_sources += ./analyses/HydrologyGlaDSAnalysis.cpp
-endif
-if HYDROLOGYDCINEFFICIENT
-issm_sources += ./analyses/HydrologyDCInefficientAnalysis.cpp
-endif
-if HYDROLOGYDCEFFICIENT
-issm_sources += ./analyses/HydrologyDCEfficientAnalysis.cpp
-endif
-if HYDROLOGYARMAPW
-issm_sources += ./analyses/HydrologyArmapwAnalysis.cpp
-endif
-if L2PROJECTIONEPL
-issm_sources += ./analyses/L2ProjectionEPLAnalysis.cpp
-endif
-if MELTING
-issm_sources += ./analyses/MeltingAnalysis.cpp
-endif
-if MASSTRANSPORT
-issm_sources += ./analyses/MasstransportAnalysis.cpp
-endif
-if OCEANTRANSPORT
-issm_sources += ./analyses/OceantransportAnalysis.cpp
-endif
-if SMB
-issm_sources += ./analyses/SmbAnalysis.cpp
-endif
-
-if FREESURFACEBASE
-issm_sources += ./analyses/FreeSurfaceBaseAnalysis.cpp
-endif
-if FREESURFACETOP
-issm_sources += ./analyses/FreeSurfaceTopAnalysis.cpp
-endif
-if EXTRUDEFROMBASE
-issm_sources += ./analyses/ExtrudeFromBaseAnalysis.cpp
-endif
-if EXTRUDEFROMTOP
-issm_sources += ./analyses/ExtrudeFromTopAnalysis.cpp
-endif
-if DEPTHAVERAGE
-issm_sources += ./analyses/DepthAverageAnalysis.cpp
-endif
-if THERMAL
-issm_sources += ./analyses/ThermalAnalysis.cpp
-endif
-if SMOOTH
-issm_sources += ./analyses/SmoothAnalysis.cpp
-endif
-if LEVELSET
-issm_sources += ./analyses/LevelsetAnalysis.cpp
-issm_sources += ./modules/Calvingx/Calvingx.cpp
-issm_sources += ./modules/KillIcebergsx/KillIcebergsx.cpp
-endif
-if EXTRAPOLATION
-issm_sources += ./analyses/ExtrapolationAnalysis.cpp
-endif
-#}}}
-# Love sources (only if have Fortran) {{{
-if LOVE
-if FORTRAN
-issm_sources += \
-	./cores/love_core.cpp \
-	./analyses/LoveAnalysis.cpp
-endif
-endif
-#}}}
-# Esa sources {{{
-if ESA
-issm_sources += \
-	./cores/esa_core.cpp \
-	./analyses/EsaAnalysis.cpp
-endif
-#}}}
-# Ocean sources {{{
-if OCEAN
-issm_sources += ./modules/OceanExchangeDatax/OceanExchangeDatax.cpp
-endif
-#}}}
-# Sampling sources {{{
-if SAMPLING
-issm_sources += \
-	./cores/sampling_core.cpp \
-	./analyses/SamplingAnalysis.cpp
-endif
-#}}}
-# SLC sources {{{
-if SEALEVELCHANGE
-issm_sources += \
-	./cores/sealevelchange_core.cpp \
-	./analyses/SealevelchangeAnalysis.cpp\
-	./classes/GrdLoads.cpp\
-	./classes/SealevelGeometry.cpp
-
-# GIA Ivins physics (only if have Fortran)
-if FORTRAN
-issm_sources += \
-	./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp \
-	./modules/GiaDeflectionCorex/distme.f \
-	./modules/GiaDeflectionCorex/freed.f \
-	./modules/GiaDeflectionCorex/ojrule.f \
-	./modules/GiaDeflectionCorex/pwise.f \
-	./modules/GiaDeflectionCorex/qwise.f \
-	./modules/GiaDeflectionCorex/stot.f \
-	./modules/GiaDeflectionCorex/what0.f
-endif
-
-endif
-#}}}
-# METIS sources {{{
-if METIS
-issm_sources += ./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
-endif
-#}}}
-# Esmf sources {{{
-if ESMF
-issm_sources += ./main/esmfbinders.cpp
-endif
-#}}}
-# SEMIC sources {{{
-if SEMIC
-if FORTRAN
-issm_sources += ./modules/SurfaceMassBalancex/run_semic.f90
-issm_sources += ./modules/SurfaceMassBalancex/run_semic_transient.f90
-endif
-endif
-#}}}
-# Wrapper sources
-# Kml sources {{{
-kml_sources = \
-	./modules/Exp2Kmlx/Exp2Kmlx.cpp \
-	./modules/Kml2Expx/Kml2Expx.cpp \
-	./modules/Shp2Kmlx/Shp2Kmlx.cpp \
-	./modules/KMLFileReadx/KMLFileReadx.cpp \
-	./modules/KMLMeshWritex/KMLMeshWritex.cpp \
-	./modules/KMLOverlayx/KMLOverlayx.cpp \
-	./kml/KML_Attribute.cpp \
-	./kml/KML_Comment.cpp \
-	./kml/KML_ColorStyle.cpp \
-	./kml/KML_Container.cpp \
-	./kml/KML_Document.cpp \
-	./kml/KML_Feature.cpp \
-	./kml/KML_File.cpp \
-	./kml/KML_Folder.cpp \
-	./kml/KML_Geometry.cpp \
-	./kml/KML_GroundOverlay.cpp \
-	./kml/KML_Icon.cpp \
-	./kml/KML_LatLonBox.cpp \
-	./kml/KML_LinearRing.cpp \
-	./kml/KML_LineString.cpp \
-	./kml/KML_LineStyle.cpp \
-	./kml/KML_MultiGeometry.cpp \
-	./kml/KML_Object.cpp \
-	./kml/KML_Overlay.cpp \
-	./kml/KML_Point.cpp \
-	./kml/KML_Placemark.cpp \
-	./kml/KML_Polygon.cpp \
-	./kml/KML_PolyStyle.cpp \
-	./kml/KML_Style.cpp \
-	./kml/KML_StyleSelector.cpp \
-	./kml/KML_SubStyle.cpp \
-	./kml/KML_Unknown.cpp \
-	./kml/KMLFileReadUtils.cpp
-#}}}
-# NEOPZ sources {{{
-neopz_sources = ./classes/AmrNeopz.cpp
-#}}}
-# Modules sources {{{
-modules_sources = \
-	./shared/Threads/LaunchThread.cpp \
-	./shared/Threads/PartitionRange.cpp \
-	./shared/Exp/exp.cpp \
-	./shared/Triangle/AssociateSegmentToElement.cpp \
-	./shared/Triangle/GridInsideHole.cpp \
-	./shared/Triangle/OrderSegments.cpp \
-	./shared/Triangle/SplitMeshForRifts.cpp \
-	./shared/Triangle/TriangleUtils.cpp \
-	./modules/Trianglex/Trianglex.cpp \
-	./modules/ProcessRiftsx/ProcessRiftsx.cpp \
-	./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp \
-	./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp \
-	./modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp \
-	./modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp \
-	./modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp \
-	./modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp \
-	./modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp \
-	./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp \
-	./modules/ContourToMeshx/ContourToMeshx.cpp \
-	./modules/ContourToMeshx/ContourToMeshxt.cpp \
-	./modules/ExpToLevelSetx/ExpToLevelSetx.cpp \
-	./modules/ExpToLevelSetx/ExpToLevelSetxt.cpp \
-	./modules/ContourToNodesx/ContourToNodesx.cpp \
-	./modules/DistanceToMaskBoundaryx/DistanceToMaskBoundaryx.cpp \
-	./modules/DistanceToMaskBoundaryx/DistanceToMaskBoundaryxt.cpp \
-	./modules/NodeConnectivityx/NodeConnectivityx.cpp \
-	./modules/ElementConnectivityx/ElementConnectivityx.cpp \
-	./modules/PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.cpp
-
-if CHACO
-modules_sources += \
-	./modules/Chacox/Chacox.cpp \
-	./modules/Chacox/input_parse.cpp \
-	./modules/Chacox/chaco_seconds.cpp \
-	./modules/Chacox/user_params.cpp
-endif
-if SCOTCH
-modules_sources += ./modules/Scotchx/Scotchx.cpp
-endif
-#}}}
-
-# Kriging (wrapper and executable)
-# Kriging sources {{{
-if KRIGING
-issm_sources += \
-	./classes/kriging/Observations.cpp \
-	./classes/kriging/GaussianVariogram.cpp \
-	./classes/kriging/ExponentialVariogram.cpp \
-	./classes/kriging/SphericalVariogram.cpp \
-	./classes/kriging/PowerVariogram.cpp \
-	./classes/kriging/Quadtree.cpp \
-	./classes/kriging/Covertree.cpp \
-	./classes/kriging/Observation.cpp \
-	./modules/Krigingx/pKrigingx.cpp
-
-modules_sources += \
-	./modules/Krigingx/Krigingx.cpp \
-	./modules/Krigingx/pKrigingx.cpp
-endif
-#}}}
-# Library flags and sources {{{
-ALL_CXXFLAGS = $(CXXFLAGS) $(CXXOPTFLAGS)
-
-if MSYS2
-ALL_CXXFLAGS += -D_DO_NOT_LOAD_GLOBALS_ # Cannot have undefined symbols under MSYS2
-ALL_CXXFLAGS += -D_USE_MATH_DEFINES # Need to open fence to math.h definitions when --std=c++ is used (which is the default)
-endif
-
-libISSMCore_la_SOURCES  = $(issm_sources)
-libISSMCore_la_CXXFLAGS = $(ALL_CXXFLAGS) $(DAKOTAFLAGS)
-libISSMCore_la_FFLAGS = $(AM_FFLAGS)
-
-libISSMCore_LIB_ADD = $(CHACOLIB) $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MPLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) 
-if FORTRAN
-libISSMCore_LIB_ADD += $(FLIBS) $(FORTRANLIB)
-endif
-libISSMCore_LIB_ADD += $(OSLIBS)
-
-if MSYS2
-libISSMCore_la_LIBADD = ${libISSMCore_LIB_ADD}
-else
-if !STANDALONE_LIBRARIES
-libISSMCore_la_LIBADD = ${libISSMCore_LIB_ADD}
-endif
-endif
-
-if NEOPZ
-libISSMCore_la_SOURCES += $(neopz_sources)
-endif
-
-if WRAPPERS
-libISSMModules_la_SOURCES = $(modules_sources)
-libISSMModules_la_SOURCES += $(bamg_sources)
-if KRIGING
-libISSMModules_la_SOURCES += $(kriging_sources)
-endif
-if KML
-libISSMModules_la_SOURCES += $(kml_sources)
-endif
-
-libISSMModules_la_CXXFLAGS = $(ALL_CXXFLAGS)
-
-libISSMModules_LIB_ADD = $(TRIANGLELIB) $(CHACOLIB) $(BLASLAPACKLIB) $(OSLIBS)
-libISSMModules_la_LIBADD = ./libISSMCore.la
-
-if MSYS2
-libISSMModules_la_LIBADD += ${libISSMModules_LIB_ADD}
-else
-if !STANDALONE_LIBRARIES
-libISSMModules_la_LIBADD += ${libISSMModules_LIB_ADD}
-endif
-endif
-endif
-
-AM_LDFLAGS =
-
-if !VERSION
-AM_LDFLAGS += -avoid-version
-endif
-
-# NOTE:
-# - On Linux, We probably do not need the -static flag as long as we only
-#	generate static libraries for external packages. Dynamic system libraries
-#	will be linked to, whether we like it or not, if no static version is
-#	available.
-# - On macOS, static linking of binaries is not supported.
-#
-if STANDALONE_EXECUTABLES
-if MAC
-AM_LDFLAGS += -Wl,-rpath,'@loader_path/../lib'
-else
-if MSYS2
-AM_LDFLAGS += -Wl,-static
-else
-AM_LDFLAGS += -Wl,--disable-new-dtags -Wl,-rpath,'$$ORIGIN/../lib'
-endif
-endif
-else
-if MAC
-if HAVE_FORTRANDIR
-AM_LDFLAGS += -Wl,-rpath,$(FORTRANDIR)
-endif
-endif
-endif
-
-if VERSION
-libISSMCore_la_LDFLAGS =
-if WRAPPERS
-libISSMModules_la_LDFLAGS =
-endif
-else
-libISSMCore_la_LDFLAGS = -avoid-version
-if WRAPPERS
-libISSMModules_la_LDFLAGS = -avoid-version
-endif
-endif
-
-if STANDALONE_LIBRARIES
-if !MSYS2
-libISSMCore_la_LDFLAGS += -static
-if WRAPPERS
-libISSMModules_la_LDFLAGS += -static
-endif
-endif
-endif
-#}}}
-
-if !MSYS2
-# Overload library, to overload any non-standard symbols {{{
-libISSMOverload_la_SOURCES = ./shared/String/ApiPrintf.cpp
-libISSMOverload_la_CFLAGS  = -D_C_ -fPIC $(COPTFLAGS) $(CFLAGS)
-
-if VERSION
-libISSMOverload_la_LDFLAGS =
-else
-libISSMOverload_la_LDFLAGS = -avoid-version
-endif
-
-if STANDALONE_LIBRARIES
-if !MSYS2
-libISSMOverload_la_LDFLAGS += -static
-endif
-endif
-endif
-#}}}
-# Executable {{{
-if ANDROID
-if ANDROIDEXE
-bin_PROGRAMS = issm issm_slc
-else
-bin_PROGRAMS =
-endif
-else
-if JAVASCRIPT
-bin_PROGRAMS =
-else
-bin_PROGRAMS = issm issm_slc
-endif
-endif
-
-# Standard libraries
-LDADD = ./libISSMCore.la
-
-if !MSYS2
-LDADD += ./libISSMOverload.la
-endif
-
-if WRAPPERS
-LDADD += ./libISSMModules.la $(TRIANGLELIB)
-endif
-
-# External packages
-LDADD += $(DAKOTALIB) $(SEMICLIB) $(M1QN3LIB) $(CHACOLIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(PLAPACKLIB) $(MPLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB)
-if FORTRAN
-LDADD += $(FLIBS) $(FORTRANLIB)
-endif
-LDADD += $(OSLIBS)
-
-issm_SOURCES = main/issm.cpp
-issm_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
-
-issm_slc_SOURCES = main/issm_slc.cpp
-issm_slc_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
-
-if OCEAN
-bin_PROGRAMS += issm_ocean
-issm_ocean_SOURCES = main/issm_ocean.cpp
-issm_ocean_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
-endif
-
-if KRIGING
-bin_PROGRAMS += kriging
-kriging_SOURCES = main/kriging.cpp
-kriging_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS)
-endif
-
-if ISSM_DAKOTA
-bin_PROGRAMS += issm_dakota
-issm_dakota_SOURCES = main/issm_dakota.cpp
-issm_dakota_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS)
-bin_PROGRAMS += issm_post
-issm_post_SOURCES = main/issm_post.cpp
-issm_post_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
-endif
-#}}}
+
+LDADD = ./libpISSM.a $(TRIANGLELIB) $(METISLIB) $(PETSCLIB) $(SLEPCLIB) $(MUMPSLIB) $(PLAPACKLIB)  $(MPILIB) $(X_LIBS) -lX11 $(BLASLAPACKLIB) $(SCALAPACKLIB) $(BLACSLIB) $(FLIBS)
+
+diagnostic_exe_SOURCES = parallel/diagnostic.cpp
+diagnostic_exe_CXXFLAGS= -fPIC -D_PARALLEL_ 
+
+control_exe_SOURCES = parallel/control.cpp
+control_exe_CXXFLAGS= -fPIC -D_PARALLEL_ 
+
+thermalsteady_exe_SOURCES = parallel/thermalsteady.cpp
+thermalsteady_exe_CXXFLAGS= -fPIC -D_PARALLEL_ 
Index: /issm/trunk/src/c/Makefile.am.hide
===================================================================
--- /issm/trunk/src/c/Makefile.am.hide	(revision 1)
+++ /issm/trunk/src/c/Makefile.am.hide	(revision 1)
@@ -0,0 +1,12 @@
+./io/io.h\
+					./io/FetchData.cpp\
+					./io/WriteData.cpp\
+					./io/SerialFetchData.cpp\
+					./io/SerialWriteData.cpp\
+					./io/ParallelFetchData.cpp\
+					./io/ParallelFetchInteger.cpp\
+					./io/ParallelFetchMat.cpp\
+					./io/ParallelFetchScalar.cpp\
+					./io/ParallelFetchString.cpp\
+					./io/PrintfFunction.cpp\
+
Index: /issm/trunk/src/c/Makefile.in
===================================================================
--- /issm/trunk/src/c/Makefile.in	(revision 1)
+++ /issm/trunk/src/c/Makefile.in	(revision 1)
@@ -0,0 +1,4822 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@LARGEARRAYS_TRUE@am__append_1 = -D__GCC4BUILD__  
+@LARGEARRAYS_FALSE@am__append_2 = -DMX_COMPAT_32
+@NOPARALLEL_FALSE@bin_PROGRAMS = diagnostic.exe$(EXEEXT)
+subdir = src/c
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/issm_options.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+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 = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"
+libLIBRARIES_INSTALL = $(INSTALL_DATA)
+LIBRARIES = $(lib_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libISSM_a_AR = $(AR) $(ARFLAGS)
+libISSM_a_LIBADD =
+am_libISSM_a_OBJECTS = libISSM_a-Element.$(OBJEXT) \
+	libISSM_a-Material.$(OBJEXT) libISSM_a-Load.$(OBJEXT) \
+	libISSM_a-Contour.$(OBJEXT) libISSM_a-Friction.$(OBJEXT) \
+	libISSM_a-Node.$(OBJEXT) libISSM_a-Tria.$(OBJEXT) \
+	libISSM_a-Penta.$(OBJEXT) libISSM_a-Matice.$(OBJEXT) \
+	libISSM_a-Matpar.$(OBJEXT) libISSM_a-ParameterInputs.$(OBJEXT) \
+	libISSM_a-Spc.$(OBJEXT) libISSM_a-Rgb.$(OBJEXT) \
+	libISSM_a-Penpair.$(OBJEXT) libISSM_a-Icefront.$(OBJEXT) \
+	libISSM_a-Param.$(OBJEXT) libISSM_a-NodeSets.$(OBJEXT) \
+	libISSM_a-DataSet.$(OBJEXT) libISSM_a-alloc.$(OBJEXT) \
+	libISSM_a-PrintfFunction.$(OBJEXT) \
+	libISSM_a-ModuleBoot.$(OBJEXT) \
+	libISSM_a-mxGetAssignedField.$(OBJEXT) \
+	libISSM_a-mxGetField.$(OBJEXT) \
+	libISSM_a-CheckNumMatlabArguments.$(OBJEXT) \
+	libISSM_a-MatrixUtils.$(OBJEXT) libISSM_a-extrema.$(OBJEXT) \
+	libISSM_a-GaussPoints.$(OBJEXT) libISSM_a-Exceptions.$(OBJEXT) \
+	libISSM_a-exprintf.$(OBJEXT) libISSM_a-IsInPoly.$(OBJEXT) \
+	libISSM_a-IsInPolySerial.$(OBJEXT) \
+	libISSM_a-DomainOutlineRead.$(OBJEXT) \
+	libISSM_a-AssociateSegmentToElement.$(OBJEXT) \
+	libISSM_a-GridInsideHole.$(OBJEXT) \
+	libISSM_a-OrderSegments.$(OBJEXT) \
+	libISSM_a-SplitMeshForRifts.$(OBJEXT) \
+	libISSM_a-TriMeshUtils.$(OBJEXT) \
+	libISSM_a-binary_search.$(OBJEXT) \
+	libISSM_a-ResolvePointers.$(OBJEXT) \
+	libISSM_a-Paterson.$(OBJEXT) \
+	libISSM_a-GetElementNodeData.$(OBJEXT) \
+	libISSM_a-MatlabMatrixToPetscMatrix.$(OBJEXT) \
+	libISSM_a-MatlabVectorToPetscVector.$(OBJEXT) \
+	libISSM_a-PetscMatrixToMatlabMatrix.$(OBJEXT) \
+	libISSM_a-PetscVectorToMatlabVector.$(OBJEXT) \
+	libISSM_a-MatlabMatrixToDoubleMatrix.$(OBJEXT) \
+	libISSM_a-MatlabVectorToDoubleVector.$(OBJEXT) \
+	libISSM_a-PetscDetermineLocalSize.$(OBJEXT) \
+	libISSM_a-VecTranspose.$(OBJEXT) \
+	libISSM_a-VecToMPISerial.$(OBJEXT) \
+	libISSM_a-MatToSerial.$(OBJEXT) libISSM_a-VecMerge.$(OBJEXT) \
+	libISSM_a-NewVec.$(OBJEXT) \
+	libISSM_a-NewVecFromLocalSize.$(OBJEXT) \
+	libISSM_a-PetscOptionsDetermineSolverType.$(OBJEXT) \
+	libISSM_a-PetscOptionsInsertMultipleString.$(OBJEXT) \
+	libISSM_a-NewMat.$(OBJEXT) libISSM_a-VecFree.$(OBJEXT) \
+	libISSM_a-KSPFree.$(OBJEXT) libISSM_a-ISFree.$(OBJEXT) \
+	libISSM_a-MatFree.$(OBJEXT) \
+	libISSM_a-GetOwnershipBoundariesFromRange.$(OBJEXT) \
+	libISSM_a-VecPartition.$(OBJEXT) \
+	libISSM_a-MatPartition.$(OBJEXT) libISSM_a-MatInvert.$(OBJEXT) \
+	libISSM_a-MatMultPatch.$(OBJEXT) \
+	libISSM_a-MPI_Upperrow.$(OBJEXT) \
+	libISSM_a-MPI_Lowerrow.$(OBJEXT) \
+	libISSM_a-MPI_Boundariesfromrange.$(OBJEXT) \
+	libISSM_a-FetchData.$(OBJEXT) libISSM_a-WriteData.$(OBJEXT) \
+	libISSM_a-WriteDataToDisk.$(OBJEXT) \
+	libISSM_a-SerialFetchData.$(OBJEXT) \
+	libISSM_a-SerialWriteData.$(OBJEXT) \
+	libISSM_a-ParallelFetchData.$(OBJEXT) \
+	libISSM_a-ParallelFetchInteger.$(OBJEXT) \
+	libISSM_a-ParallelFetchMat.$(OBJEXT) \
+	libISSM_a-ParallelFetchScalar.$(OBJEXT) \
+	libISSM_a-ParallelFetchString.$(OBJEXT) \
+	libISSM_a-ModelFetchData.$(OBJEXT) \
+	libISSM_a-WriteNodeSets.$(OBJEXT) \
+	libISSM_a-WriteParams.$(OBJEXT) \
+	libISSM_a-FetchNodeSets.$(OBJEXT) \
+	libISSM_a-ParameterInputsInit.$(OBJEXT) \
+	libISSM_a-EnumDefinitions.$(OBJEXT) \
+	libISSM_a-AnalysisTypeAsEnum.$(OBJEXT) \
+	libISSM_a-Model.$(OBJEXT) libISSM_a-FetchRifts.$(OBJEXT) \
+	libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.$(OBJEXT) \
+	libISSM_a-DistributeNumDofs.$(OBJEXT) \
+	libISSM_a-CreateConstraintsDiagnosticHoriz.$(OBJEXT) \
+	libISSM_a-CreateLoadsDiagnosticHoriz.$(OBJEXT) \
+	libISSM_a-ModelCreateParameters.$(OBJEXT) \
+	libISSM_a-Dofx.$(OBJEXT) libISSM_a-Dux.$(OBJEXT) \
+	libISSM_a-ControlConstrainx.$(OBJEXT) \
+	libISSM_a-Misfitx.$(OBJEXT) libISSM_a-Orthx.$(OBJEXT) \
+	libISSM_a-Gradjx.$(OBJEXT) \
+	libISSM_a-UpdateFromInputsx.$(OBJEXT) \
+	libISSM_a-ConfigureObjectsx.$(OBJEXT) \
+	libISSM_a-BuildNodeSetsx.$(OBJEXT) \
+	libISSM_a-PartitionSets.$(OBJEXT) \
+	libISSM_a-SpcNodesx.$(OBJEXT) libISSM_a-MpcNodesx.$(OBJEXT) \
+	libISSM_a-DataInterpx.$(OBJEXT) \
+	libISSM_a-HoleFillerx.$(OBJEXT) \
+	libISSM_a-MeshPartitionx.$(OBJEXT) \
+	libISSM_a-ContourToMeshx.$(OBJEXT) \
+	libISSM_a-Reducevectorgtosx.$(OBJEXT) \
+	libISSM_a-Reducematrixfromgtofx.$(OBJEXT) \
+	libISSM_a-Reducematrixfromgton.$(OBJEXT) \
+	libISSM_a-Reduceloadfromgtofx.$(OBJEXT) \
+	libISSM_a-NormalizeConstraintsx.$(OBJEXT) \
+	libISSM_a-SystemMatricesx.$(OBJEXT) \
+	libISSM_a-PenaltyConstraintsx.$(OBJEXT) \
+	libISSM_a-PenaltySystemMatricesx.$(OBJEXT) \
+	libISSM_a-Solverx.$(OBJEXT) \
+	libISSM_a-Mergesolutionfromftogx.$(OBJEXT) \
+	libISSM_a-ProcessParamsx.$(OBJEXT)
+libISSM_a_OBJECTS = $(am_libISSM_a_OBJECTS)
+libpISSM_a_AR = $(AR) $(ARFLAGS)
+libpISSM_a_LIBADD =
+am_libpISSM_a_OBJECTS = libpISSM_a-Element.$(OBJEXT) \
+	libpISSM_a-Material.$(OBJEXT) libpISSM_a-Load.$(OBJEXT) \
+	libpISSM_a-Contour.$(OBJEXT) libpISSM_a-Friction.$(OBJEXT) \
+	libpISSM_a-Node.$(OBJEXT) libpISSM_a-Tria.$(OBJEXT) \
+	libpISSM_a-Penta.$(OBJEXT) libpISSM_a-Matice.$(OBJEXT) \
+	libpISSM_a-Matpar.$(OBJEXT) \
+	libpISSM_a-ParameterInputs.$(OBJEXT) libpISSM_a-Spc.$(OBJEXT) \
+	libpISSM_a-Rgb.$(OBJEXT) libpISSM_a-Penpair.$(OBJEXT) \
+	libpISSM_a-Icefront.$(OBJEXT) libpISSM_a-Param.$(OBJEXT) \
+	libpISSM_a-NodeSets.$(OBJEXT) libpISSM_a-DataSet.$(OBJEXT) \
+	libpISSM_a-alloc.$(OBJEXT) libpISSM_a-PrintfFunction.$(OBJEXT) \
+	libpISSM_a-ModuleBoot.$(OBJEXT) \
+	libpISSM_a-mxGetAssignedField.$(OBJEXT) \
+	libpISSM_a-mxGetField.$(OBJEXT) \
+	libpISSM_a-CheckNumMatlabArguments.$(OBJEXT) \
+	libpISSM_a-MatrixUtils.$(OBJEXT) \
+	libpISSM_a-GaussPoints.$(OBJEXT) libpISSM_a-extrema.$(OBJEXT) \
+	libpISSM_a-Exceptions.$(OBJEXT) libpISSM_a-exprintf.$(OBJEXT) \
+	libpISSM_a-IsInPoly.$(OBJEXT) \
+	libpISSM_a-IsInPolySerial.$(OBJEXT) \
+	libpISSM_a-DomainOutlineRead.$(OBJEXT) \
+	libpISSM_a-AssociateSegmentToElement.$(OBJEXT) \
+	libpISSM_a-GridInsideHole.$(OBJEXT) \
+	libpISSM_a-OrderSegments.$(OBJEXT) \
+	libpISSM_a-SplitMeshForRifts.$(OBJEXT) \
+	libpISSM_a-TriMeshUtils.$(OBJEXT) \
+	libpISSM_a-binary_search.$(OBJEXT) \
+	libpISSM_a-ResolvePointers.$(OBJEXT) \
+	libpISSM_a-Paterson.$(OBJEXT) \
+	libpISSM_a-GetElementNodeData.$(OBJEXT) \
+	libpISSM_a-MatlabMatrixToPetscMatrix.$(OBJEXT) \
+	libpISSM_a-MatlabVectorToPetscVector.$(OBJEXT) \
+	libpISSM_a-PetscMatrixToMatlabMatrix.$(OBJEXT) \
+	libpISSM_a-PetscVectorToMatlabVector.$(OBJEXT) \
+	libpISSM_a-MatlabMatrixToDoubleMatrix.$(OBJEXT) \
+	libpISSM_a-MatlabVectorToDoubleVector.$(OBJEXT) \
+	libpISSM_a-PetscDetermineLocalSize.$(OBJEXT) \
+	libpISSM_a-VecTranspose.$(OBJEXT) \
+	libpISSM_a-VecToMPISerial.$(OBJEXT) \
+	libpISSM_a-MatToSerial.$(OBJEXT) libpISSM_a-VecMerge.$(OBJEXT) \
+	libpISSM_a-NewVec.$(OBJEXT) \
+	libpISSM_a-NewVecFromLocalSize.$(OBJEXT) \
+	libpISSM_a-PetscOptionsDetermineSolverType.$(OBJEXT) \
+	libpISSM_a-PetscOptionsInsertMultipleString.$(OBJEXT) \
+	libpISSM_a-NewMat.$(OBJEXT) libpISSM_a-VecFree.$(OBJEXT) \
+	libpISSM_a-KSPFree.$(OBJEXT) libpISSM_a-ISFree.$(OBJEXT) \
+	libpISSM_a-MatFree.$(OBJEXT) \
+	libpISSM_a-GetOwnershipBoundariesFromRange.$(OBJEXT) \
+	libpISSM_a-VecPartition.$(OBJEXT) \
+	libpISSM_a-MatPartition.$(OBJEXT) \
+	libpISSM_a-MatInvert.$(OBJEXT) \
+	libpISSM_a-MatMultPatch.$(OBJEXT) \
+	libpISSM_a-MPI_Upperrow.$(OBJEXT) \
+	libpISSM_a-MPI_Lowerrow.$(OBJEXT) \
+	libpISSM_a-MPI_Boundariesfromrange.$(OBJEXT) \
+	libpISSM_a-FetchData.$(OBJEXT) libpISSM_a-WriteData.$(OBJEXT) \
+	libpISSM_a-WriteDataToDisk.$(OBJEXT) \
+	libpISSM_a-SerialFetchData.$(OBJEXT) \
+	libpISSM_a-SerialWriteData.$(OBJEXT) \
+	libpISSM_a-ParallelFetchData.$(OBJEXT) \
+	libpISSM_a-ParallelFetchInteger.$(OBJEXT) \
+	libpISSM_a-ParallelFetchMat.$(OBJEXT) \
+	libpISSM_a-ParallelFetchScalar.$(OBJEXT) \
+	libpISSM_a-ParallelFetchString.$(OBJEXT) \
+	libpISSM_a-ModelFetchData.$(OBJEXT) \
+	libpISSM_a-WriteNodeSets.$(OBJEXT) \
+	libpISSM_a-WriteParams.$(OBJEXT) \
+	libpISSM_a-FetchNodeSets.$(OBJEXT) \
+	libpISSM_a-ParameterInputsInit.$(OBJEXT) \
+	libpISSM_a-EnumDefinitions.$(OBJEXT) \
+	libpISSM_a-AnalysisTypeAsEnum.$(OBJEXT) \
+	libpISSM_a-Model.$(OBJEXT) libpISSM_a-FetchRifts.$(OBJEXT) \
+	libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.$(OBJEXT) \
+	libpISSM_a-DistributeNumDofs.$(OBJEXT) \
+	libpISSM_a-CreateConstraintsDiagnosticHoriz.$(OBJEXT) \
+	libpISSM_a-CreateLoadsDiagnosticHoriz.$(OBJEXT) \
+	libpISSM_a-ModelCreateParameters.$(OBJEXT) \
+	libpISSM_a-Dofx.$(OBJEXT) libpISSM_a-Dux.$(OBJEXT) \
+	libpISSM_a-ControlConstrainx.$(OBJEXT) \
+	libpISSM_a-Misfitx.$(OBJEXT) libpISSM_a-Orthx.$(OBJEXT) \
+	libpISSM_a-Gradjx.$(OBJEXT) \
+	libpISSM_a-UpdateFromInputsx.$(OBJEXT) \
+	libpISSM_a-ConfigureObjectsx.$(OBJEXT) \
+	libpISSM_a-BuildNodeSetsx.$(OBJEXT) \
+	libpISSM_a-PartitionSets.$(OBJEXT) \
+	libpISSM_a-SpcNodesx.$(OBJEXT) libpISSM_a-MpcNodesx.$(OBJEXT) \
+	libpISSM_a-DataInterpx.$(OBJEXT) \
+	libpISSM_a-HoleFillerx.$(OBJEXT) \
+	libpISSM_a-MeshPartitionx.$(OBJEXT) \
+	libpISSM_a-ContourToMeshx.$(OBJEXT) \
+	libpISSM_a-Reducevectorgtosx.$(OBJEXT) \
+	libpISSM_a-Reducematrixfromgtofx.$(OBJEXT) \
+	libpISSM_a-Reducematrixfromgton.$(OBJEXT) \
+	libpISSM_a-Reduceloadfromgtofx.$(OBJEXT) \
+	libpISSM_a-NormalizeConstraintsx.$(OBJEXT) \
+	libpISSM_a-SystemMatricesx.$(OBJEXT) \
+	libpISSM_a-PenaltyConstraintsx.$(OBJEXT) \
+	libpISSM_a-PenaltySystemMatricesx.$(OBJEXT) \
+	libpISSM_a-Solverx.$(OBJEXT) \
+	libpISSM_a-Mergesolutionfromftogx.$(OBJEXT) \
+	libpISSM_a-ProcessParamsx.$(OBJEXT) \
+	libpISSM_a-diagnostic_core_nonlinear.$(OBJEXT) \
+	libpISSM_a-CreateFemModel.$(OBJEXT) \
+	libpISSM_a-OutputDiagnostic.$(OBJEXT) \
+	libpISSM_a-WriteLockFile.$(OBJEXT)
+libpISSM_a_OBJECTS = $(am_libpISSM_a_OBJECTS)
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_diagnostic_exe_OBJECTS = diagnostic_exe-diagnostic.$(OBJEXT)
+diagnostic_exe_OBJECTS = $(am_diagnostic_exe_OBJECTS)
+diagnostic_exe_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+diagnostic_exe_DEPENDENCIES = ./libpISSM.a $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+diagnostic_exe_LINK = $(CXXLD) $(diagnostic_exe_CXXFLAGS) $(CXXFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libISSM_a_SOURCES) $(libpISSM_a_SOURCES) \
+	$(diagnostic_exe_SOURCES)
+DIST_SOURCES = $(libISSM_a_SOURCES) $(libpISSM_a_SOURCES) \
+	$(diagnostic_exe_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLACSINCL = @BLACSINCL@
+BLACSLIB = @BLACSLIB@
+BLASLAPACKINCL = @BLASLAPACKINCL@
+BLASLAPACKLIB = @BLASLAPACKLIB@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLIBS = @FLIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MATLAB = @MATLAB@
+MATLABINCL = @MATLABINCL@
+MATLAB_MAJOR = @MATLAB_MAJOR@
+MATLAB_MINOR = @MATLAB_MINOR@
+MATLAB_VERSION = @MATLAB_VERSION@
+METISINCL = @METISINCL@
+METISLIB = @METISLIB@
+MEX = @MEX@
+MEXEXT = @MEXEXT@
+MEXLIB = @MEXLIB@
+MEXLINK = @MEXLINK@
+MKDIR_P = @MKDIR_P@
+MPIINCL = @MPIINCL@
+MPILIB = @MPILIB@
+MUMPSINCL = @MUMPSINCL@
+MUMPSLIB = @MUMPSLIB@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PETSCINCL = @PETSCINCL@
+PETSCLIB = @PETSCLIB@
+PLAPACKINCL = @PLAPACKINCL@
+PLAPACKLIB = @PLAPACKLIB@
+RANLIB = @RANLIB@
+SCALAPACKLIB = @SCALAPACKLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEPCINCL = @SLEPCINCL@
+SLEPCLIB = @SLEPCLIB@
+STRIP = @STRIP@
+TRIANGLEINCL = @TRIANGLEINCL@
+TRIANGLELIB = @TRIANGLELIB@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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@
+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@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@  @METISINCL@ @PLAPACKINCL@  @BLASLAPACKINCL@ @MUMPSINCL@  @TRIANGLEINCL@
+@NOPARALLEL_FALSE@@NOSERIAL_FALSE@lib_LIBRARIES = libISSM.a libpISSM.a
+@NOPARALLEL_FALSE@@NOSERIAL_TRUE@lib_LIBRARIES = libpISSM.a
+@NOPARALLEL_TRUE@@NOSERIAL_FALSE@lib_LIBRARIES = libISSM.a 
+
+#Compile serial library, and then try and compile parallel library
+@NOPARALLEL_TRUE@@NOSERIAL_TRUE@lib_LIBRARIES = 
+
+#Serial compilation
+libISSM_a_SOURCES = ./objects/objects.h\
+					./objects/Object.h\
+					./objects/Element.h\
+					./objects/Element.cpp\
+					./objects/Material.h\
+					./objects/Material.cpp\
+					./objects/Load.h\
+					./objects/Load.cpp\
+					./objects/SolverEnum.h\
+					./objects/Contour.h\
+					./objects/Contour.cpp\
+					./objects/Friction.h\
+					./objects/Friction.cpp\
+					./objects/Node.h\
+					./objects/Node.cpp\
+					./objects/Tria.h\
+					./objects/Tria.cpp\
+					./objects/Penta.h\
+					./objects/Penta.cpp\
+					./objects/Matice.h\
+					./objects/Matice.cpp\
+					./objects/Matpar.h\
+					./objects/Matpar.cpp\
+					./objects/ParameterInputs.h\
+					./objects/ParameterInputs.cpp\
+					./objects/Spc.cpp\
+					./objects/Spc.h\
+					./objects/Rgb.cpp\
+					./objects/Rgb.h\
+					./objects/Penpair.cpp\
+					./objects/Penpair.h\
+					./objects/Icefront.cpp\
+					./objects/Icefront.h\
+					./objects/Param.cpp\
+					./objects/Param.h\
+					./objects/NodeSets.cpp\
+					./objects/NodeSets.h\
+					./DataSet/DataSet.cpp\
+					./DataSet/DataSet.h\
+					./shared/shared.h\
+					./shared/Alloc/alloc.h\
+					./shared/Alloc/alloc.cpp\
+					./shared/Matlab/matlabshared.h\
+					./shared/Matlab/PrintfFunction.cpp\
+					./shared/Matlab/ModuleBoot.cpp\
+					./shared/Matlab/mxGetAssignedField.cpp\
+					./shared/Matlab/mxGetField.cpp\
+					./shared/Matlab/CheckNumMatlabArguments.cpp\
+					./shared/Matrix/matrix.h\
+					./shared/Matrix/MatrixUtils.cpp\
+					./shared/Numerics/numerics.h\
+					./shared/Numerics/GaussPoints.h\
+					./shared/Numerics/extrema.cpp\
+					./shared/Numerics/GaussPoints.cpp\
+					./shared/Exceptions/exceptions.h\
+					./shared/Exceptions/Exceptions.cpp\
+					./shared/Exceptions/exprintf.cpp\
+					./shared/Exp/exp.h\
+					./shared/Exp/IsInPoly.cpp\
+					./shared/Exp/IsInPolySerial.cpp\
+					./shared/Exp/DomainOutlineRead.cpp\
+					./shared/TriMesh/trimesh.h\
+					./shared/TriMesh/AssociateSegmentToElement.cpp\
+					./shared/TriMesh/GridInsideHole.cpp\
+					./shared/TriMesh/OrderSegments.cpp\
+					./shared/TriMesh/SplitMeshForRifts.cpp\
+					./shared/TriMesh/TriMeshUtils.cpp\
+					./shared/Sorting/binary_search.cpp\
+					./shared/Sorting/sorting.h\
+					./shared/Elements/elements.h\
+					./shared/Elements/ResolvePointers.cpp\
+					./shared/Elements/Paterson.cpp\
+					./shared/Elements/GetElementNodeData.cpp\
+					./toolkits/petsc\
+					./toolkits/petsc/patches\
+					./toolkits/petsc/patches/petscpatches.h\
+					./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp\
+					./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp\
+					./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp\
+					./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp\
+					./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp\
+					./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp\
+					./toolkits/petsc/patches/PetscDetermineLocalSize.cpp\
+					./toolkits/petsc/patches/VecTranspose.cpp\
+					./toolkits/petsc/patches/VecToMPISerial.cpp\
+					./toolkits/petsc/patches/MatToSerial.cpp\
+					./toolkits/petsc/patches/VecMerge.cpp\
+					./toolkits/petsc/patches/NewVec.cpp\
+					./toolkits/petsc/patches/NewVecFromLocalSize.cpp\
+					./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp\
+					./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp\
+					./toolkits/petsc/patches/NewMat.cpp\
+					./toolkits/petsc/patches/VecFree.cpp\
+					./toolkits/petsc/patches/KSPFree.cpp\
+					./toolkits/petsc/patches/ISFree.cpp\
+					./toolkits/petsc/patches/MatFree.cpp\
+					./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp\
+					./toolkits/petsc/patches/VecPartition.cpp\
+					./toolkits/petsc/patches/MatPartition.cpp\
+					./toolkits/petsc/patches/MatInvert.cpp\
+					./toolkits/petsc/patches/MatMultPatch.cpp\
+					./toolkits/petsc/petscincludes.h\
+					./toolkits/mpi/mpiincludes.h\
+					./toolkits/mpi/patches/mpipatches.h\
+					./toolkits/mpi/patches/MPI_Upperrow.cpp\
+					./toolkits/mpi/patches/MPI_Lowerrow.cpp\
+					./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp\
+					./toolkits/metis/metisincludes.h\
+					./toolkits/triangle/triangleincludes.h\
+					./toolkits.h\
+					./io/io.h\
+					./io/FetchData.cpp\
+					./io/WriteData.cpp\
+					./io/WriteDataToDisk.cpp\
+					./io/SerialFetchData.cpp\
+					./io/SerialWriteData.cpp\
+					./io/ParallelFetchData.cpp\
+					./io/ParallelFetchInteger.cpp\
+					./io/ParallelFetchMat.cpp\
+					./io/ParallelFetchScalar.cpp\
+					./io/ParallelFetchString.cpp\
+					./io/ModelFetchData.cpp\
+					./io/WriteNodeSets.cpp\
+					./io/WriteParams.cpp\
+					./io/FetchNodeSets.cpp\
+					./io/ParameterInputsInit.cpp\
+					./EnumDefinitions/EnumDefinitions.h\
+					./EnumDefinitions/EnumDefinitions.cpp\
+					./EnumDefinitions/AnalysisTypeAsEnum.cpp\
+					./ModelProcessorx/ModelProcessorx.h\
+					./ModelProcessorx/Model.cpp\
+					./ModelProcessorx/FetchRifts.cpp\
+					./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp\
+					./ModelProcessorx/DistributeNumDofs.cpp\
+					./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp \
+					./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp\
+					./ModelProcessorx/ModelCreateParameters.cpp\
+					./Dofx/Dofx.h\
+					./Dofx/Dofx.cpp\
+					./Dux/Dux.h\
+					./Dux/Dux.cpp\
+					./ControlConstrainx/ControlConstrainx.h\
+					./ControlConstrainx/ControlConstrainx.cpp\
+					./Misfitx/Misfitx.h\
+					./Misfitx/Misfitx.cpp\
+					./Orthx/Orthx.h\
+					./Orthx/Orthx.cpp\
+					./Gradjx/Gradjx.h\
+					./Gradjx/Gradjx.cpp\
+					./UpdateFromInputsx/UpdateFromInputsx.h\
+					./UpdateFromInputsx/UpdateFromInputsx.cpp\
+					./ConfigureObjectsx/ConfigureObjectsx.h\
+					./ConfigureObjectsx/ConfigureObjectsx.cpp\
+					./BuildNodeSetsx/BuildNodeSetsx.h\
+					./BuildNodeSetsx/BuildNodeSetsx.cpp\
+					./BuildNodeSetsx/PartitionSets.cpp\
+					./SpcNodesx/SpcNodesx.h\
+					./SpcNodesx/SpcNodesx.cpp\
+					./MpcNodesx/MpcNodesx.h\
+					./MpcNodesx/MpcNodesx.cpp\
+					./DataInterpx/DataInterpx.cpp\
+					./DataInterpx/DataInterpx.h\
+					./HoleFillerx/HoleFillerx.cpp\
+					./HoleFillerx/HoleFillerx.h\
+					./MeshPartitionx/MeshPartitionx.cpp\
+					./MeshPartitionx/MeshPartitionx.h\
+					./ContourToMeshx/ContourToMeshx.cpp\
+					./ContourToMeshx/ContourToMeshx.h\
+					./Reducevectorgtosx/Reducevectorgtosx.cpp\
+					./Reducevectorgtosx/Reducevectorgtosx.h\
+					./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp\
+					./Reducematrixfromgtofx/Reducematrixfromgton.cpp\
+					./Reducematrixfromgtofx/Reducematrixfromgtofx.h\
+					./Reduceloadfromgtofx/Reduceloadfromgtofx.h\
+					./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp\
+					./NormalizeConstraintsx/NormalizeConstraintsx.cpp\
+					./NormalizeConstraintsx/NormalizeConstraintsx.h\
+					./SystemMatricesx/SystemMatricesx.cpp\
+					./SystemMatricesx/SystemMatricesx.h\
+					./PenaltyConstraintsx/PenaltyConstraintsx.cpp\
+					./PenaltyConstraintsx/PenaltyConstraintsx.h\
+					./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp\
+					./PenaltySystemMatricesx/PenaltySystemMatricesx.h\
+					./Solverx/Solverx.cpp\
+					./Solverx/Solverx.h\
+					./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp\
+					./Mergesolutionfromftogx/Mergesolutionfromftogx.h\
+					./ProcessParamsx/ProcessParamsx.cpp\
+					./ProcessParamsx/ProcessParamsx.h
+
+libISSM_a_CXXFLAGS = -fPIC -DMATLAB -D_SERIAL_ -ansi -D_GNU_SOURCE \
+	-fno-omit-frame-pointer -pthread -D_CPP_ $(am__append_1) \
+	$(am__append_2)
+
+#Parallel compilation
+libpISSM_a_SOURCES = ./objects/objects.h\
+					./objects/Object.h\
+					./objects/Element.h\
+					./objects/Element.cpp\
+					./objects/Material.h\
+					./objects/Material.cpp\
+					./objects/Load.h\
+					./objects/Load.cpp\
+					./objects/SolverEnum.h\
+					./objects/Contour.h\
+					./objects/Contour.cpp\
+					./objects/Friction.h\
+					./objects/Friction.cpp\
+					./objects/Node.h\
+					./objects/Node.cpp\
+					./objects/Tria.h\
+					./objects/Tria.cpp\
+					./objects/Penta.h\
+					./objects/Penta.cpp\
+					./objects/Matice.h\
+					./objects/Matice.cpp\
+					./objects/Matpar.h\
+					./objects/Matpar.cpp\
+					./objects/ParameterInputs.h\
+					./objects/ParameterInputs.cpp\
+					./objects/Spc.cpp\
+					./objects/Spc.h\
+					./objects/Rgb.cpp\
+					./objects/Rgb.h\
+					./objects/Penpair.cpp\
+					./objects/Penpair.h\
+					./objects/Icefront.cpp\
+					./objects/Icefront.h\
+					./objects/Param.cpp\
+					./objects/Param.h\
+					./objects/NodeSets.cpp\
+					./objects/NodeSets.h\
+					./DataSet/DataSet.cpp\
+					./DataSet/DataSet.h\
+					./shared/shared.h\
+					./shared/Alloc/alloc.h\
+					./shared/Alloc/alloc.cpp\
+					./shared/Matlab/matlabshared.h\
+					./shared/Matlab/PrintfFunction.cpp\
+					./shared/Matlab/ModuleBoot.cpp\
+					./shared/Matlab/mxGetAssignedField.cpp\
+					./shared/Matlab/mxGetField.cpp\
+					./shared/Matlab/CheckNumMatlabArguments.cpp\
+					./shared/Matrix/matrix.h\
+					./shared/Matrix/MatrixUtils.cpp\
+					./shared/Numerics/numerics.h\
+					./shared/Numerics/GaussPoints.h\
+					./shared/Numerics/GaussPoints.cpp\
+					./shared/Numerics/extrema.cpp\
+					./shared/Exceptions/exceptions.h\
+					./shared/Exceptions/Exceptions.cpp\
+					./shared/Exceptions/exprintf.cpp\
+					./shared/Exp/exp.h\
+					./shared/Exp/IsInPoly.cpp\
+					./shared/Exp/IsInPolySerial.cpp\
+					./shared/Exp/DomainOutlineRead.cpp\
+					./shared/TriMesh/trimesh.h\
+					./shared/TriMesh/AssociateSegmentToElement.cpp\
+					./shared/TriMesh/GridInsideHole.cpp\
+					./shared/TriMesh/OrderSegments.cpp\
+					./shared/TriMesh/SplitMeshForRifts.cpp\
+					./shared/TriMesh/TriMeshUtils.cpp\
+					./shared/Sorting/binary_search.cpp\
+					./shared/Sorting/sorting.h\
+					./shared/Elements/elements.h\
+					./shared/Elements/ResolvePointers.cpp\
+					./shared/Elements/Paterson.cpp\
+					./shared/Elements/GetElementNodeData.cpp\
+					./toolkits/petsc\
+					./toolkits/petsc/patches\
+					./toolkits/petsc/patches/petscpatches.h\
+					./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp\
+					./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp\
+					./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp\
+					./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp\
+					./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp\
+					./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp\
+					./toolkits/petsc/patches/PetscDetermineLocalSize.cpp\
+					./toolkits/petsc/patches/VecTranspose.cpp\
+					./toolkits/petsc/patches/VecToMPISerial.cpp\
+					./toolkits/petsc/patches/MatToSerial.cpp\
+					./toolkits/petsc/patches/VecMerge.cpp\
+					./toolkits/petsc/patches/NewVec.cpp\
+					./toolkits/petsc/patches/NewVecFromLocalSize.cpp\
+					./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp\
+					./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp\
+					./toolkits/petsc/patches/NewMat.cpp\
+					./toolkits/petsc/patches/VecFree.cpp\
+					./toolkits/petsc/patches/KSPFree.cpp\
+					./toolkits/petsc/patches/ISFree.cpp\
+					./toolkits/petsc/patches/MatFree.cpp\
+					./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp\
+					./toolkits/petsc/patches/VecPartition.cpp\
+					./toolkits/petsc/patches/MatPartition.cpp\
+					./toolkits/petsc/patches/MatInvert.cpp\
+					./toolkits/petsc/patches/MatMultPatch.cpp\
+					./toolkits/petsc/petscincludes.h\
+					./toolkits/mpi/mpiincludes.h\
+					./toolkits/mpi/patches/mpipatches.h\
+					./toolkits/mpi/patches/MPI_Upperrow.cpp\
+					./toolkits/mpi/patches/MPI_Lowerrow.cpp\
+					./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp\
+					./toolkits/metis/metisincludes.h\
+					./toolkits/triangle/triangleincludes.h\
+					./toolkits.h\
+					./io/io.h\
+					./io/FetchData.cpp\
+					./io/WriteData.cpp\
+					./io/WriteDataToDisk.cpp\
+					./io/SerialFetchData.cpp\
+					./io/SerialWriteData.cpp\
+					./io/ParallelFetchData.cpp\
+					./io/ParallelFetchInteger.cpp\
+					./io/ParallelFetchMat.cpp\
+					./io/ParallelFetchScalar.cpp\
+					./io/ParallelFetchString.cpp\
+					./io/ModelFetchData.cpp\
+					./io/WriteNodeSets.cpp\
+					./io/WriteParams.cpp\
+					./io/FetchNodeSets.cpp\
+					./io/ParameterInputsInit.cpp\
+					./EnumDefinitions/EnumDefinitions.h\
+					./EnumDefinitions/EnumDefinitions.cpp\
+					./EnumDefinitions/AnalysisTypeAsEnum.cpp\
+					./ModelProcessorx/ModelProcessorx.h\
+					./ModelProcessorx/Model.cpp\
+					./ModelProcessorx/FetchRifts.cpp\
+					./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp\
+					./ModelProcessorx/DistributeNumDofs.cpp\
+					./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp \
+					./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp\
+					./ModelProcessorx/ModelCreateParameters.cpp\
+					./Dofx/Dofx.h\
+					./Dofx/Dofx.cpp\
+					./Dux/Dux.h\
+					./Dux/Dux.cpp\
+					./ControlConstrainx/ControlConstrainx.h\
+					./ControlConstrainx/ControlConstrainx.cpp\
+					./Misfitx/Misfitx.h\
+					./Misfitx/Misfitx.cpp\
+					./Orthx/Orthx.h\
+					./Orthx/Orthx.cpp\
+					./Gradjx/Gradjx.h\
+					./Gradjx/Gradjx.cpp\
+					./UpdateFromInputsx/UpdateFromInputsx.h\
+					./UpdateFromInputsx/UpdateFromInputsx.cpp\
+					./ConfigureObjectsx/ConfigureObjectsx.h\
+					./ConfigureObjectsx/ConfigureObjectsx.cpp\
+					./BuildNodeSetsx/BuildNodeSetsx.h\
+					./BuildNodeSetsx/BuildNodeSetsx.cpp\
+					./BuildNodeSetsx/PartitionSets.cpp\
+					./SpcNodesx/SpcNodesx.h\
+					./SpcNodesx/SpcNodesx.cpp\
+					./MpcNodesx/MpcNodesx.h\
+					./MpcNodesx/MpcNodesx.cpp\
+					./DataInterpx/DataInterpx.cpp\
+					./DataInterpx/DataInterpx.h\
+					./HoleFillerx/HoleFillerx.cpp\
+					./HoleFillerx/HoleFillerx.h\
+					./MeshPartitionx/MeshPartitionx.cpp\
+					./MeshPartitionx/MeshPartitionx.h\
+					./ContourToMeshx/ContourToMeshx.cpp\
+					./ContourToMeshx/ContourToMeshx.h\
+					./Reducevectorgtosx/Reducevectorgtosx.cpp\
+					./Reducevectorgtosx/Reducevectorgtosx.h\
+					./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp\
+					./Reducematrixfromgtofx/Reducematrixfromgton.cpp\
+					./Reducematrixfromgtofx/Reducematrixfromgtofx.h\
+					./Reduceloadfromgtofx/Reduceloadfromgtofx.h\
+					./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp\
+					./NormalizeConstraintsx/NormalizeConstraintsx.cpp\
+					./NormalizeConstraintsx/NormalizeConstraintsx.h\
+					./SystemMatricesx/SystemMatricesx.cpp\
+					./SystemMatricesx/SystemMatricesx.h\
+					./PenaltyConstraintsx/PenaltyConstraintsx.cpp\
+					./PenaltyConstraintsx/PenaltyConstraintsx.h\
+					./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp\
+					./PenaltySystemMatricesx/PenaltySystemMatricesx.h\
+					./Solverx/Solverx.cpp\
+					./Solverx/Solverx.h\
+					./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp\
+					./Mergesolutionfromftogx/Mergesolutionfromftogx.h\
+					./ProcessParamsx/ProcessParamsx.cpp\
+					./ProcessParamsx/ProcessParamsx.h\
+					./parallel/diagnostic_core_nonlinear.cpp\
+					./parallel/CreateFemModel.cpp\
+					./parallel/OutputDiagnostic.cpp\
+					./parallel/WriteLockFile.cpp
+
+libpISSM_a_CXXFLAGS = -fPIC -D_PARALLEL_   -D_C_
+#control.exe thermalsteady.exe
+LDADD = ./libpISSM.a $(TRIANGLELIB) $(METISLIB) $(PETSCLIB) $(SLEPCLIB) $(MUMPSLIB) $(PLAPACKLIB)  $(MPILIB) $(X_LIBS) -lX11 $(BLASLAPACKLIB) $(SCALAPACKLIB) $(BLACSLIB) $(FLIBS)
+diagnostic_exe_SOURCES = parallel/diagnostic.cpp
+diagnostic_exe_CXXFLAGS = -fPIC -D_PARALLEL_ 
+control_exe_SOURCES = parallel/control.cpp
+control_exe_CXXFLAGS = -fPIC -D_PARALLEL_ 
+thermalsteady_exe_SOURCES = parallel/thermalsteady.cpp
+thermalsteady_exe_CXXFLAGS = -fPIC -D_PARALLEL_ 
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/c/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  src/c/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLIBRARIES: $(lib_LIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+	    $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	  else :; fi; \
+	done
+	@$(POST_INSTALL)
+	@list='$(lib_LIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    p=$(am__strip_dir) \
+	    echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \
+	    $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \
+	  else :; fi; \
+	done
+
+uninstall-libLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+	  rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	done
+
+clean-libLIBRARIES:
+	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+libISSM.a: $(libISSM_a_OBJECTS) $(libISSM_a_DEPENDENCIES) 
+	-rm -f libISSM.a
+	$(libISSM_a_AR) libISSM.a $(libISSM_a_OBJECTS) $(libISSM_a_LIBADD)
+	$(RANLIB) libISSM.a
+libpISSM.a: $(libpISSM_a_OBJECTS) $(libpISSM_a_DEPENDENCIES) 
+	-rm -f libpISSM.a
+	$(libpISSM_a_AR) libpISSM.a $(libpISSM_a_OBJECTS) $(libpISSM_a_LIBADD)
+	$(RANLIB) libpISSM.a
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+diagnostic.exe$(EXEEXT): $(diagnostic_exe_OBJECTS) $(diagnostic_exe_DEPENDENCIES) 
+	@rm -f diagnostic.exe$(EXEEXT)
+	$(diagnostic_exe_LINK) $(diagnostic_exe_OBJECTS) $(diagnostic_exe_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diagnostic_exe-diagnostic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-AnalysisTypeAsEnum.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-AssociateSegmentToElement.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-BuildNodeSetsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-CheckNumMatlabArguments.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ConfigureObjectsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Contour.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ContourToMeshx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ControlConstrainx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-CreateConstraintsDiagnosticHoriz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-CreateLoadsDiagnosticHoriz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-DataInterpx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-DataSet.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-DistributeNumDofs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Dofx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-DomainOutlineRead.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Dux.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Element.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-EnumDefinitions.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Exceptions.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-FetchData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-FetchNodeSets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-FetchRifts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Friction.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-GaussPoints.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-GetElementNodeData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-GetOwnershipBoundariesFromRange.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Gradjx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-GridInsideHole.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-HoleFillerx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ISFree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Icefront.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-IsInPoly.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-IsInPolySerial.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-KSPFree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Load.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MPI_Boundariesfromrange.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MPI_Lowerrow.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MPI_Upperrow.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatFree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatInvert.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatMultPatch.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatPartition.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatToSerial.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Material.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Matice.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatlabMatrixToDoubleMatrix.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatlabMatrixToPetscMatrix.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatlabVectorToDoubleVector.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatlabVectorToPetscVector.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Matpar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MatrixUtils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Mergesolutionfromftogx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MeshPartitionx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Misfitx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Model.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ModelCreateParameters.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ModelFetchData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ModuleBoot.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-MpcNodesx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-NewMat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-NewVec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-NewVecFromLocalSize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Node.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-NodeSets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-NormalizeConstraintsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-OrderSegments.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Orthx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ParallelFetchData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ParallelFetchInteger.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ParallelFetchMat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ParallelFetchScalar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ParallelFetchString.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Param.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ParameterInputs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ParameterInputsInit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-PartitionSets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Paterson.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-PenaltyConstraintsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-PenaltySystemMatricesx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Penpair.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Penta.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-PetscDetermineLocalSize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-PetscMatrixToMatlabMatrix.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-PetscOptionsDetermineSolverType.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-PetscOptionsInsertMultipleString.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-PetscVectorToMatlabVector.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-PrintfFunction.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ProcessParamsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Reduceloadfromgtofx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Reducematrixfromgtofx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Reducematrixfromgton.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Reducevectorgtosx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-ResolvePointers.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Rgb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-SerialFetchData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-SerialWriteData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Solverx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Spc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-SpcNodesx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-SplitMeshForRifts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-SystemMatricesx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-TriMeshUtils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-Tria.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-UpdateFromInputsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-VecFree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-VecMerge.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-VecPartition.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-VecToMPISerial.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-VecTranspose.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-WriteData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-WriteDataToDisk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-WriteNodeSets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-WriteParams.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-alloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-binary_search.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-exprintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-extrema.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-mxGetAssignedField.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libISSM_a-mxGetField.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-AnalysisTypeAsEnum.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-AssociateSegmentToElement.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-BuildNodeSetsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-CheckNumMatlabArguments.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ConfigureObjectsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Contour.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ContourToMeshx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ControlConstrainx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-CreateConstraintsDiagnosticHoriz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-CreateFemModel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-CreateLoadsDiagnosticHoriz.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-DataInterpx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-DataSet.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-DistributeNumDofs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Dofx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-DomainOutlineRead.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Dux.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Element.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-EnumDefinitions.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Exceptions.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-FetchData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-FetchNodeSets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-FetchRifts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Friction.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-GaussPoints.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-GetElementNodeData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-GetOwnershipBoundariesFromRange.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Gradjx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-GridInsideHole.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-HoleFillerx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ISFree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Icefront.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-IsInPoly.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-IsInPolySerial.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-KSPFree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Load.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MPI_Boundariesfromrange.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MPI_Lowerrow.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MPI_Upperrow.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatFree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatInvert.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatMultPatch.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatPartition.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatToSerial.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Material.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Matice.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatlabMatrixToDoubleMatrix.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatlabMatrixToPetscMatrix.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatlabVectorToDoubleVector.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatlabVectorToPetscVector.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Matpar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MatrixUtils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Mergesolutionfromftogx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MeshPartitionx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Misfitx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Model.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ModelCreateParameters.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ModelFetchData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ModuleBoot.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-MpcNodesx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-NewMat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-NewVec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-NewVecFromLocalSize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Node.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-NodeSets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-NormalizeConstraintsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-OrderSegments.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Orthx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-OutputDiagnostic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ParallelFetchData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ParallelFetchInteger.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ParallelFetchMat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ParallelFetchScalar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ParallelFetchString.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Param.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ParameterInputs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ParameterInputsInit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-PartitionSets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Paterson.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-PenaltyConstraintsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-PenaltySystemMatricesx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Penpair.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Penta.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-PetscDetermineLocalSize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-PetscMatrixToMatlabMatrix.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-PetscOptionsDetermineSolverType.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-PetscOptionsInsertMultipleString.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-PetscVectorToMatlabVector.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-PrintfFunction.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ProcessParamsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Reduceloadfromgtofx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Reducematrixfromgtofx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Reducematrixfromgton.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Reducevectorgtosx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-ResolvePointers.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Rgb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-SerialFetchData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-SerialWriteData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Solverx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Spc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-SpcNodesx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-SplitMeshForRifts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-SystemMatricesx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-TriMeshUtils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-Tria.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-UpdateFromInputsx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-VecFree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-VecMerge.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-VecPartition.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-VecToMPISerial.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-VecTranspose.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-WriteData.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-WriteDataToDisk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-WriteLockFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-WriteNodeSets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-WriteParams.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-alloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-binary_search.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-diagnostic_core_nonlinear.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-exprintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-extrema.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-mxGetAssignedField.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpISSM_a-mxGetField.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+libISSM_a-Element.o: ./objects/Element.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Element.o -MD -MP -MF $(DEPDIR)/libISSM_a-Element.Tpo -c -o libISSM_a-Element.o `test -f './objects/Element.cpp' || echo '$(srcdir)/'`./objects/Element.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Element.Tpo $(DEPDIR)/libISSM_a-Element.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Element.cpp' object='libISSM_a-Element.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Element.o `test -f './objects/Element.cpp' || echo '$(srcdir)/'`./objects/Element.cpp
+
+libISSM_a-Element.obj: ./objects/Element.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Element.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Element.Tpo -c -o libISSM_a-Element.obj `if test -f './objects/Element.cpp'; then $(CYGPATH_W) './objects/Element.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Element.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Element.Tpo $(DEPDIR)/libISSM_a-Element.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Element.cpp' object='libISSM_a-Element.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Element.obj `if test -f './objects/Element.cpp'; then $(CYGPATH_W) './objects/Element.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Element.cpp'; fi`
+
+libISSM_a-Material.o: ./objects/Material.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Material.o -MD -MP -MF $(DEPDIR)/libISSM_a-Material.Tpo -c -o libISSM_a-Material.o `test -f './objects/Material.cpp' || echo '$(srcdir)/'`./objects/Material.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Material.Tpo $(DEPDIR)/libISSM_a-Material.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Material.cpp' object='libISSM_a-Material.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Material.o `test -f './objects/Material.cpp' || echo '$(srcdir)/'`./objects/Material.cpp
+
+libISSM_a-Material.obj: ./objects/Material.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Material.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Material.Tpo -c -o libISSM_a-Material.obj `if test -f './objects/Material.cpp'; then $(CYGPATH_W) './objects/Material.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Material.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Material.Tpo $(DEPDIR)/libISSM_a-Material.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Material.cpp' object='libISSM_a-Material.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Material.obj `if test -f './objects/Material.cpp'; then $(CYGPATH_W) './objects/Material.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Material.cpp'; fi`
+
+libISSM_a-Load.o: ./objects/Load.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Load.o -MD -MP -MF $(DEPDIR)/libISSM_a-Load.Tpo -c -o libISSM_a-Load.o `test -f './objects/Load.cpp' || echo '$(srcdir)/'`./objects/Load.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Load.Tpo $(DEPDIR)/libISSM_a-Load.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Load.cpp' object='libISSM_a-Load.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Load.o `test -f './objects/Load.cpp' || echo '$(srcdir)/'`./objects/Load.cpp
+
+libISSM_a-Load.obj: ./objects/Load.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Load.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Load.Tpo -c -o libISSM_a-Load.obj `if test -f './objects/Load.cpp'; then $(CYGPATH_W) './objects/Load.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Load.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Load.Tpo $(DEPDIR)/libISSM_a-Load.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Load.cpp' object='libISSM_a-Load.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Load.obj `if test -f './objects/Load.cpp'; then $(CYGPATH_W) './objects/Load.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Load.cpp'; fi`
+
+libISSM_a-Contour.o: ./objects/Contour.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Contour.o -MD -MP -MF $(DEPDIR)/libISSM_a-Contour.Tpo -c -o libISSM_a-Contour.o `test -f './objects/Contour.cpp' || echo '$(srcdir)/'`./objects/Contour.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Contour.Tpo $(DEPDIR)/libISSM_a-Contour.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Contour.cpp' object='libISSM_a-Contour.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Contour.o `test -f './objects/Contour.cpp' || echo '$(srcdir)/'`./objects/Contour.cpp
+
+libISSM_a-Contour.obj: ./objects/Contour.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Contour.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Contour.Tpo -c -o libISSM_a-Contour.obj `if test -f './objects/Contour.cpp'; then $(CYGPATH_W) './objects/Contour.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Contour.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Contour.Tpo $(DEPDIR)/libISSM_a-Contour.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Contour.cpp' object='libISSM_a-Contour.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Contour.obj `if test -f './objects/Contour.cpp'; then $(CYGPATH_W) './objects/Contour.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Contour.cpp'; fi`
+
+libISSM_a-Friction.o: ./objects/Friction.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Friction.o -MD -MP -MF $(DEPDIR)/libISSM_a-Friction.Tpo -c -o libISSM_a-Friction.o `test -f './objects/Friction.cpp' || echo '$(srcdir)/'`./objects/Friction.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Friction.Tpo $(DEPDIR)/libISSM_a-Friction.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Friction.cpp' object='libISSM_a-Friction.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Friction.o `test -f './objects/Friction.cpp' || echo '$(srcdir)/'`./objects/Friction.cpp
+
+libISSM_a-Friction.obj: ./objects/Friction.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Friction.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Friction.Tpo -c -o libISSM_a-Friction.obj `if test -f './objects/Friction.cpp'; then $(CYGPATH_W) './objects/Friction.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Friction.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Friction.Tpo $(DEPDIR)/libISSM_a-Friction.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Friction.cpp' object='libISSM_a-Friction.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Friction.obj `if test -f './objects/Friction.cpp'; then $(CYGPATH_W) './objects/Friction.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Friction.cpp'; fi`
+
+libISSM_a-Node.o: ./objects/Node.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Node.o -MD -MP -MF $(DEPDIR)/libISSM_a-Node.Tpo -c -o libISSM_a-Node.o `test -f './objects/Node.cpp' || echo '$(srcdir)/'`./objects/Node.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Node.Tpo $(DEPDIR)/libISSM_a-Node.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Node.cpp' object='libISSM_a-Node.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Node.o `test -f './objects/Node.cpp' || echo '$(srcdir)/'`./objects/Node.cpp
+
+libISSM_a-Node.obj: ./objects/Node.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Node.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Node.Tpo -c -o libISSM_a-Node.obj `if test -f './objects/Node.cpp'; then $(CYGPATH_W) './objects/Node.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Node.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Node.Tpo $(DEPDIR)/libISSM_a-Node.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Node.cpp' object='libISSM_a-Node.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Node.obj `if test -f './objects/Node.cpp'; then $(CYGPATH_W) './objects/Node.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Node.cpp'; fi`
+
+libISSM_a-Tria.o: ./objects/Tria.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Tria.o -MD -MP -MF $(DEPDIR)/libISSM_a-Tria.Tpo -c -o libISSM_a-Tria.o `test -f './objects/Tria.cpp' || echo '$(srcdir)/'`./objects/Tria.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Tria.Tpo $(DEPDIR)/libISSM_a-Tria.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Tria.cpp' object='libISSM_a-Tria.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Tria.o `test -f './objects/Tria.cpp' || echo '$(srcdir)/'`./objects/Tria.cpp
+
+libISSM_a-Tria.obj: ./objects/Tria.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Tria.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Tria.Tpo -c -o libISSM_a-Tria.obj `if test -f './objects/Tria.cpp'; then $(CYGPATH_W) './objects/Tria.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Tria.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Tria.Tpo $(DEPDIR)/libISSM_a-Tria.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Tria.cpp' object='libISSM_a-Tria.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Tria.obj `if test -f './objects/Tria.cpp'; then $(CYGPATH_W) './objects/Tria.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Tria.cpp'; fi`
+
+libISSM_a-Penta.o: ./objects/Penta.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Penta.o -MD -MP -MF $(DEPDIR)/libISSM_a-Penta.Tpo -c -o libISSM_a-Penta.o `test -f './objects/Penta.cpp' || echo '$(srcdir)/'`./objects/Penta.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Penta.Tpo $(DEPDIR)/libISSM_a-Penta.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Penta.cpp' object='libISSM_a-Penta.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Penta.o `test -f './objects/Penta.cpp' || echo '$(srcdir)/'`./objects/Penta.cpp
+
+libISSM_a-Penta.obj: ./objects/Penta.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Penta.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Penta.Tpo -c -o libISSM_a-Penta.obj `if test -f './objects/Penta.cpp'; then $(CYGPATH_W) './objects/Penta.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Penta.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Penta.Tpo $(DEPDIR)/libISSM_a-Penta.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Penta.cpp' object='libISSM_a-Penta.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Penta.obj `if test -f './objects/Penta.cpp'; then $(CYGPATH_W) './objects/Penta.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Penta.cpp'; fi`
+
+libISSM_a-Matice.o: ./objects/Matice.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Matice.o -MD -MP -MF $(DEPDIR)/libISSM_a-Matice.Tpo -c -o libISSM_a-Matice.o `test -f './objects/Matice.cpp' || echo '$(srcdir)/'`./objects/Matice.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Matice.Tpo $(DEPDIR)/libISSM_a-Matice.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Matice.cpp' object='libISSM_a-Matice.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Matice.o `test -f './objects/Matice.cpp' || echo '$(srcdir)/'`./objects/Matice.cpp
+
+libISSM_a-Matice.obj: ./objects/Matice.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Matice.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Matice.Tpo -c -o libISSM_a-Matice.obj `if test -f './objects/Matice.cpp'; then $(CYGPATH_W) './objects/Matice.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Matice.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Matice.Tpo $(DEPDIR)/libISSM_a-Matice.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Matice.cpp' object='libISSM_a-Matice.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Matice.obj `if test -f './objects/Matice.cpp'; then $(CYGPATH_W) './objects/Matice.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Matice.cpp'; fi`
+
+libISSM_a-Matpar.o: ./objects/Matpar.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Matpar.o -MD -MP -MF $(DEPDIR)/libISSM_a-Matpar.Tpo -c -o libISSM_a-Matpar.o `test -f './objects/Matpar.cpp' || echo '$(srcdir)/'`./objects/Matpar.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Matpar.Tpo $(DEPDIR)/libISSM_a-Matpar.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Matpar.cpp' object='libISSM_a-Matpar.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Matpar.o `test -f './objects/Matpar.cpp' || echo '$(srcdir)/'`./objects/Matpar.cpp
+
+libISSM_a-Matpar.obj: ./objects/Matpar.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Matpar.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Matpar.Tpo -c -o libISSM_a-Matpar.obj `if test -f './objects/Matpar.cpp'; then $(CYGPATH_W) './objects/Matpar.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Matpar.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Matpar.Tpo $(DEPDIR)/libISSM_a-Matpar.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Matpar.cpp' object='libISSM_a-Matpar.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Matpar.obj `if test -f './objects/Matpar.cpp'; then $(CYGPATH_W) './objects/Matpar.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Matpar.cpp'; fi`
+
+libISSM_a-ParameterInputs.o: ./objects/ParameterInputs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParameterInputs.o -MD -MP -MF $(DEPDIR)/libISSM_a-ParameterInputs.Tpo -c -o libISSM_a-ParameterInputs.o `test -f './objects/ParameterInputs.cpp' || echo '$(srcdir)/'`./objects/ParameterInputs.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParameterInputs.Tpo $(DEPDIR)/libISSM_a-ParameterInputs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/ParameterInputs.cpp' object='libISSM_a-ParameterInputs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParameterInputs.o `test -f './objects/ParameterInputs.cpp' || echo '$(srcdir)/'`./objects/ParameterInputs.cpp
+
+libISSM_a-ParameterInputs.obj: ./objects/ParameterInputs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParameterInputs.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ParameterInputs.Tpo -c -o libISSM_a-ParameterInputs.obj `if test -f './objects/ParameterInputs.cpp'; then $(CYGPATH_W) './objects/ParameterInputs.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/ParameterInputs.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParameterInputs.Tpo $(DEPDIR)/libISSM_a-ParameterInputs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/ParameterInputs.cpp' object='libISSM_a-ParameterInputs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParameterInputs.obj `if test -f './objects/ParameterInputs.cpp'; then $(CYGPATH_W) './objects/ParameterInputs.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/ParameterInputs.cpp'; fi`
+
+libISSM_a-Spc.o: ./objects/Spc.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Spc.o -MD -MP -MF $(DEPDIR)/libISSM_a-Spc.Tpo -c -o libISSM_a-Spc.o `test -f './objects/Spc.cpp' || echo '$(srcdir)/'`./objects/Spc.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Spc.Tpo $(DEPDIR)/libISSM_a-Spc.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Spc.cpp' object='libISSM_a-Spc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Spc.o `test -f './objects/Spc.cpp' || echo '$(srcdir)/'`./objects/Spc.cpp
+
+libISSM_a-Spc.obj: ./objects/Spc.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Spc.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Spc.Tpo -c -o libISSM_a-Spc.obj `if test -f './objects/Spc.cpp'; then $(CYGPATH_W) './objects/Spc.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Spc.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Spc.Tpo $(DEPDIR)/libISSM_a-Spc.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Spc.cpp' object='libISSM_a-Spc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Spc.obj `if test -f './objects/Spc.cpp'; then $(CYGPATH_W) './objects/Spc.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Spc.cpp'; fi`
+
+libISSM_a-Rgb.o: ./objects/Rgb.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Rgb.o -MD -MP -MF $(DEPDIR)/libISSM_a-Rgb.Tpo -c -o libISSM_a-Rgb.o `test -f './objects/Rgb.cpp' || echo '$(srcdir)/'`./objects/Rgb.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Rgb.Tpo $(DEPDIR)/libISSM_a-Rgb.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Rgb.cpp' object='libISSM_a-Rgb.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Rgb.o `test -f './objects/Rgb.cpp' || echo '$(srcdir)/'`./objects/Rgb.cpp
+
+libISSM_a-Rgb.obj: ./objects/Rgb.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Rgb.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Rgb.Tpo -c -o libISSM_a-Rgb.obj `if test -f './objects/Rgb.cpp'; then $(CYGPATH_W) './objects/Rgb.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Rgb.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Rgb.Tpo $(DEPDIR)/libISSM_a-Rgb.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Rgb.cpp' object='libISSM_a-Rgb.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Rgb.obj `if test -f './objects/Rgb.cpp'; then $(CYGPATH_W) './objects/Rgb.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Rgb.cpp'; fi`
+
+libISSM_a-Penpair.o: ./objects/Penpair.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Penpair.o -MD -MP -MF $(DEPDIR)/libISSM_a-Penpair.Tpo -c -o libISSM_a-Penpair.o `test -f './objects/Penpair.cpp' || echo '$(srcdir)/'`./objects/Penpair.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Penpair.Tpo $(DEPDIR)/libISSM_a-Penpair.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Penpair.cpp' object='libISSM_a-Penpair.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Penpair.o `test -f './objects/Penpair.cpp' || echo '$(srcdir)/'`./objects/Penpair.cpp
+
+libISSM_a-Penpair.obj: ./objects/Penpair.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Penpair.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Penpair.Tpo -c -o libISSM_a-Penpair.obj `if test -f './objects/Penpair.cpp'; then $(CYGPATH_W) './objects/Penpair.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Penpair.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Penpair.Tpo $(DEPDIR)/libISSM_a-Penpair.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Penpair.cpp' object='libISSM_a-Penpair.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Penpair.obj `if test -f './objects/Penpair.cpp'; then $(CYGPATH_W) './objects/Penpair.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Penpair.cpp'; fi`
+
+libISSM_a-Icefront.o: ./objects/Icefront.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Icefront.o -MD -MP -MF $(DEPDIR)/libISSM_a-Icefront.Tpo -c -o libISSM_a-Icefront.o `test -f './objects/Icefront.cpp' || echo '$(srcdir)/'`./objects/Icefront.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Icefront.Tpo $(DEPDIR)/libISSM_a-Icefront.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Icefront.cpp' object='libISSM_a-Icefront.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Icefront.o `test -f './objects/Icefront.cpp' || echo '$(srcdir)/'`./objects/Icefront.cpp
+
+libISSM_a-Icefront.obj: ./objects/Icefront.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Icefront.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Icefront.Tpo -c -o libISSM_a-Icefront.obj `if test -f './objects/Icefront.cpp'; then $(CYGPATH_W) './objects/Icefront.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Icefront.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Icefront.Tpo $(DEPDIR)/libISSM_a-Icefront.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Icefront.cpp' object='libISSM_a-Icefront.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Icefront.obj `if test -f './objects/Icefront.cpp'; then $(CYGPATH_W) './objects/Icefront.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Icefront.cpp'; fi`
+
+libISSM_a-Param.o: ./objects/Param.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Param.o -MD -MP -MF $(DEPDIR)/libISSM_a-Param.Tpo -c -o libISSM_a-Param.o `test -f './objects/Param.cpp' || echo '$(srcdir)/'`./objects/Param.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Param.Tpo $(DEPDIR)/libISSM_a-Param.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Param.cpp' object='libISSM_a-Param.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Param.o `test -f './objects/Param.cpp' || echo '$(srcdir)/'`./objects/Param.cpp
+
+libISSM_a-Param.obj: ./objects/Param.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Param.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Param.Tpo -c -o libISSM_a-Param.obj `if test -f './objects/Param.cpp'; then $(CYGPATH_W) './objects/Param.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Param.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Param.Tpo $(DEPDIR)/libISSM_a-Param.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Param.cpp' object='libISSM_a-Param.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Param.obj `if test -f './objects/Param.cpp'; then $(CYGPATH_W) './objects/Param.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Param.cpp'; fi`
+
+libISSM_a-NodeSets.o: ./objects/NodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NodeSets.o -MD -MP -MF $(DEPDIR)/libISSM_a-NodeSets.Tpo -c -o libISSM_a-NodeSets.o `test -f './objects/NodeSets.cpp' || echo '$(srcdir)/'`./objects/NodeSets.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NodeSets.Tpo $(DEPDIR)/libISSM_a-NodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/NodeSets.cpp' object='libISSM_a-NodeSets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NodeSets.o `test -f './objects/NodeSets.cpp' || echo '$(srcdir)/'`./objects/NodeSets.cpp
+
+libISSM_a-NodeSets.obj: ./objects/NodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NodeSets.obj -MD -MP -MF $(DEPDIR)/libISSM_a-NodeSets.Tpo -c -o libISSM_a-NodeSets.obj `if test -f './objects/NodeSets.cpp'; then $(CYGPATH_W) './objects/NodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/NodeSets.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NodeSets.Tpo $(DEPDIR)/libISSM_a-NodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/NodeSets.cpp' object='libISSM_a-NodeSets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NodeSets.obj `if test -f './objects/NodeSets.cpp'; then $(CYGPATH_W) './objects/NodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/NodeSets.cpp'; fi`
+
+libISSM_a-DataSet.o: ./DataSet/DataSet.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-DataSet.o -MD -MP -MF $(DEPDIR)/libISSM_a-DataSet.Tpo -c -o libISSM_a-DataSet.o `test -f './DataSet/DataSet.cpp' || echo '$(srcdir)/'`./DataSet/DataSet.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-DataSet.Tpo $(DEPDIR)/libISSM_a-DataSet.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./DataSet/DataSet.cpp' object='libISSM_a-DataSet.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-DataSet.o `test -f './DataSet/DataSet.cpp' || echo '$(srcdir)/'`./DataSet/DataSet.cpp
+
+libISSM_a-DataSet.obj: ./DataSet/DataSet.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-DataSet.obj -MD -MP -MF $(DEPDIR)/libISSM_a-DataSet.Tpo -c -o libISSM_a-DataSet.obj `if test -f './DataSet/DataSet.cpp'; then $(CYGPATH_W) './DataSet/DataSet.cpp'; else $(CYGPATH_W) '$(srcdir)/./DataSet/DataSet.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-DataSet.Tpo $(DEPDIR)/libISSM_a-DataSet.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./DataSet/DataSet.cpp' object='libISSM_a-DataSet.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-DataSet.obj `if test -f './DataSet/DataSet.cpp'; then $(CYGPATH_W) './DataSet/DataSet.cpp'; else $(CYGPATH_W) '$(srcdir)/./DataSet/DataSet.cpp'; fi`
+
+libISSM_a-alloc.o: ./shared/Alloc/alloc.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-alloc.o -MD -MP -MF $(DEPDIR)/libISSM_a-alloc.Tpo -c -o libISSM_a-alloc.o `test -f './shared/Alloc/alloc.cpp' || echo '$(srcdir)/'`./shared/Alloc/alloc.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-alloc.Tpo $(DEPDIR)/libISSM_a-alloc.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Alloc/alloc.cpp' object='libISSM_a-alloc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-alloc.o `test -f './shared/Alloc/alloc.cpp' || echo '$(srcdir)/'`./shared/Alloc/alloc.cpp
+
+libISSM_a-alloc.obj: ./shared/Alloc/alloc.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-alloc.obj -MD -MP -MF $(DEPDIR)/libISSM_a-alloc.Tpo -c -o libISSM_a-alloc.obj `if test -f './shared/Alloc/alloc.cpp'; then $(CYGPATH_W) './shared/Alloc/alloc.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Alloc/alloc.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-alloc.Tpo $(DEPDIR)/libISSM_a-alloc.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Alloc/alloc.cpp' object='libISSM_a-alloc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-alloc.obj `if test -f './shared/Alloc/alloc.cpp'; then $(CYGPATH_W) './shared/Alloc/alloc.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Alloc/alloc.cpp'; fi`
+
+libISSM_a-PrintfFunction.o: ./shared/Matlab/PrintfFunction.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PrintfFunction.o -MD -MP -MF $(DEPDIR)/libISSM_a-PrintfFunction.Tpo -c -o libISSM_a-PrintfFunction.o `test -f './shared/Matlab/PrintfFunction.cpp' || echo '$(srcdir)/'`./shared/Matlab/PrintfFunction.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PrintfFunction.Tpo $(DEPDIR)/libISSM_a-PrintfFunction.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/PrintfFunction.cpp' object='libISSM_a-PrintfFunction.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PrintfFunction.o `test -f './shared/Matlab/PrintfFunction.cpp' || echo '$(srcdir)/'`./shared/Matlab/PrintfFunction.cpp
+
+libISSM_a-PrintfFunction.obj: ./shared/Matlab/PrintfFunction.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PrintfFunction.obj -MD -MP -MF $(DEPDIR)/libISSM_a-PrintfFunction.Tpo -c -o libISSM_a-PrintfFunction.obj `if test -f './shared/Matlab/PrintfFunction.cpp'; then $(CYGPATH_W) './shared/Matlab/PrintfFunction.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/PrintfFunction.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PrintfFunction.Tpo $(DEPDIR)/libISSM_a-PrintfFunction.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/PrintfFunction.cpp' object='libISSM_a-PrintfFunction.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PrintfFunction.obj `if test -f './shared/Matlab/PrintfFunction.cpp'; then $(CYGPATH_W) './shared/Matlab/PrintfFunction.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/PrintfFunction.cpp'; fi`
+
+libISSM_a-ModuleBoot.o: ./shared/Matlab/ModuleBoot.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ModuleBoot.o -MD -MP -MF $(DEPDIR)/libISSM_a-ModuleBoot.Tpo -c -o libISSM_a-ModuleBoot.o `test -f './shared/Matlab/ModuleBoot.cpp' || echo '$(srcdir)/'`./shared/Matlab/ModuleBoot.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ModuleBoot.Tpo $(DEPDIR)/libISSM_a-ModuleBoot.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/ModuleBoot.cpp' object='libISSM_a-ModuleBoot.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ModuleBoot.o `test -f './shared/Matlab/ModuleBoot.cpp' || echo '$(srcdir)/'`./shared/Matlab/ModuleBoot.cpp
+
+libISSM_a-ModuleBoot.obj: ./shared/Matlab/ModuleBoot.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ModuleBoot.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ModuleBoot.Tpo -c -o libISSM_a-ModuleBoot.obj `if test -f './shared/Matlab/ModuleBoot.cpp'; then $(CYGPATH_W) './shared/Matlab/ModuleBoot.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/ModuleBoot.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ModuleBoot.Tpo $(DEPDIR)/libISSM_a-ModuleBoot.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/ModuleBoot.cpp' object='libISSM_a-ModuleBoot.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ModuleBoot.obj `if test -f './shared/Matlab/ModuleBoot.cpp'; then $(CYGPATH_W) './shared/Matlab/ModuleBoot.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/ModuleBoot.cpp'; fi`
+
+libISSM_a-mxGetAssignedField.o: ./shared/Matlab/mxGetAssignedField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-mxGetAssignedField.o -MD -MP -MF $(DEPDIR)/libISSM_a-mxGetAssignedField.Tpo -c -o libISSM_a-mxGetAssignedField.o `test -f './shared/Matlab/mxGetAssignedField.cpp' || echo '$(srcdir)/'`./shared/Matlab/mxGetAssignedField.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-mxGetAssignedField.Tpo $(DEPDIR)/libISSM_a-mxGetAssignedField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/mxGetAssignedField.cpp' object='libISSM_a-mxGetAssignedField.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-mxGetAssignedField.o `test -f './shared/Matlab/mxGetAssignedField.cpp' || echo '$(srcdir)/'`./shared/Matlab/mxGetAssignedField.cpp
+
+libISSM_a-mxGetAssignedField.obj: ./shared/Matlab/mxGetAssignedField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-mxGetAssignedField.obj -MD -MP -MF $(DEPDIR)/libISSM_a-mxGetAssignedField.Tpo -c -o libISSM_a-mxGetAssignedField.obj `if test -f './shared/Matlab/mxGetAssignedField.cpp'; then $(CYGPATH_W) './shared/Matlab/mxGetAssignedField.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/mxGetAssignedField.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-mxGetAssignedField.Tpo $(DEPDIR)/libISSM_a-mxGetAssignedField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/mxGetAssignedField.cpp' object='libISSM_a-mxGetAssignedField.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-mxGetAssignedField.obj `if test -f './shared/Matlab/mxGetAssignedField.cpp'; then $(CYGPATH_W) './shared/Matlab/mxGetAssignedField.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/mxGetAssignedField.cpp'; fi`
+
+libISSM_a-mxGetField.o: ./shared/Matlab/mxGetField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-mxGetField.o -MD -MP -MF $(DEPDIR)/libISSM_a-mxGetField.Tpo -c -o libISSM_a-mxGetField.o `test -f './shared/Matlab/mxGetField.cpp' || echo '$(srcdir)/'`./shared/Matlab/mxGetField.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-mxGetField.Tpo $(DEPDIR)/libISSM_a-mxGetField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/mxGetField.cpp' object='libISSM_a-mxGetField.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-mxGetField.o `test -f './shared/Matlab/mxGetField.cpp' || echo '$(srcdir)/'`./shared/Matlab/mxGetField.cpp
+
+libISSM_a-mxGetField.obj: ./shared/Matlab/mxGetField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-mxGetField.obj -MD -MP -MF $(DEPDIR)/libISSM_a-mxGetField.Tpo -c -o libISSM_a-mxGetField.obj `if test -f './shared/Matlab/mxGetField.cpp'; then $(CYGPATH_W) './shared/Matlab/mxGetField.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/mxGetField.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-mxGetField.Tpo $(DEPDIR)/libISSM_a-mxGetField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/mxGetField.cpp' object='libISSM_a-mxGetField.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-mxGetField.obj `if test -f './shared/Matlab/mxGetField.cpp'; then $(CYGPATH_W) './shared/Matlab/mxGetField.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/mxGetField.cpp'; fi`
+
+libISSM_a-CheckNumMatlabArguments.o: ./shared/Matlab/CheckNumMatlabArguments.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-CheckNumMatlabArguments.o -MD -MP -MF $(DEPDIR)/libISSM_a-CheckNumMatlabArguments.Tpo -c -o libISSM_a-CheckNumMatlabArguments.o `test -f './shared/Matlab/CheckNumMatlabArguments.cpp' || echo '$(srcdir)/'`./shared/Matlab/CheckNumMatlabArguments.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-CheckNumMatlabArguments.Tpo $(DEPDIR)/libISSM_a-CheckNumMatlabArguments.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/CheckNumMatlabArguments.cpp' object='libISSM_a-CheckNumMatlabArguments.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-CheckNumMatlabArguments.o `test -f './shared/Matlab/CheckNumMatlabArguments.cpp' || echo '$(srcdir)/'`./shared/Matlab/CheckNumMatlabArguments.cpp
+
+libISSM_a-CheckNumMatlabArguments.obj: ./shared/Matlab/CheckNumMatlabArguments.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-CheckNumMatlabArguments.obj -MD -MP -MF $(DEPDIR)/libISSM_a-CheckNumMatlabArguments.Tpo -c -o libISSM_a-CheckNumMatlabArguments.obj `if test -f './shared/Matlab/CheckNumMatlabArguments.cpp'; then $(CYGPATH_W) './shared/Matlab/CheckNumMatlabArguments.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/CheckNumMatlabArguments.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-CheckNumMatlabArguments.Tpo $(DEPDIR)/libISSM_a-CheckNumMatlabArguments.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/CheckNumMatlabArguments.cpp' object='libISSM_a-CheckNumMatlabArguments.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-CheckNumMatlabArguments.obj `if test -f './shared/Matlab/CheckNumMatlabArguments.cpp'; then $(CYGPATH_W) './shared/Matlab/CheckNumMatlabArguments.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/CheckNumMatlabArguments.cpp'; fi`
+
+libISSM_a-MatrixUtils.o: ./shared/Matrix/MatrixUtils.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatrixUtils.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatrixUtils.Tpo -c -o libISSM_a-MatrixUtils.o `test -f './shared/Matrix/MatrixUtils.cpp' || echo '$(srcdir)/'`./shared/Matrix/MatrixUtils.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatrixUtils.Tpo $(DEPDIR)/libISSM_a-MatrixUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matrix/MatrixUtils.cpp' object='libISSM_a-MatrixUtils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatrixUtils.o `test -f './shared/Matrix/MatrixUtils.cpp' || echo '$(srcdir)/'`./shared/Matrix/MatrixUtils.cpp
+
+libISSM_a-MatrixUtils.obj: ./shared/Matrix/MatrixUtils.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatrixUtils.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatrixUtils.Tpo -c -o libISSM_a-MatrixUtils.obj `if test -f './shared/Matrix/MatrixUtils.cpp'; then $(CYGPATH_W) './shared/Matrix/MatrixUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matrix/MatrixUtils.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatrixUtils.Tpo $(DEPDIR)/libISSM_a-MatrixUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matrix/MatrixUtils.cpp' object='libISSM_a-MatrixUtils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatrixUtils.obj `if test -f './shared/Matrix/MatrixUtils.cpp'; then $(CYGPATH_W) './shared/Matrix/MatrixUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matrix/MatrixUtils.cpp'; fi`
+
+libISSM_a-extrema.o: ./shared/Numerics/extrema.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-extrema.o -MD -MP -MF $(DEPDIR)/libISSM_a-extrema.Tpo -c -o libISSM_a-extrema.o `test -f './shared/Numerics/extrema.cpp' || echo '$(srcdir)/'`./shared/Numerics/extrema.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-extrema.Tpo $(DEPDIR)/libISSM_a-extrema.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Numerics/extrema.cpp' object='libISSM_a-extrema.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-extrema.o `test -f './shared/Numerics/extrema.cpp' || echo '$(srcdir)/'`./shared/Numerics/extrema.cpp
+
+libISSM_a-extrema.obj: ./shared/Numerics/extrema.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-extrema.obj -MD -MP -MF $(DEPDIR)/libISSM_a-extrema.Tpo -c -o libISSM_a-extrema.obj `if test -f './shared/Numerics/extrema.cpp'; then $(CYGPATH_W) './shared/Numerics/extrema.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Numerics/extrema.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-extrema.Tpo $(DEPDIR)/libISSM_a-extrema.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Numerics/extrema.cpp' object='libISSM_a-extrema.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-extrema.obj `if test -f './shared/Numerics/extrema.cpp'; then $(CYGPATH_W) './shared/Numerics/extrema.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Numerics/extrema.cpp'; fi`
+
+libISSM_a-GaussPoints.o: ./shared/Numerics/GaussPoints.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-GaussPoints.o -MD -MP -MF $(DEPDIR)/libISSM_a-GaussPoints.Tpo -c -o libISSM_a-GaussPoints.o `test -f './shared/Numerics/GaussPoints.cpp' || echo '$(srcdir)/'`./shared/Numerics/GaussPoints.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-GaussPoints.Tpo $(DEPDIR)/libISSM_a-GaussPoints.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Numerics/GaussPoints.cpp' object='libISSM_a-GaussPoints.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-GaussPoints.o `test -f './shared/Numerics/GaussPoints.cpp' || echo '$(srcdir)/'`./shared/Numerics/GaussPoints.cpp
+
+libISSM_a-GaussPoints.obj: ./shared/Numerics/GaussPoints.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-GaussPoints.obj -MD -MP -MF $(DEPDIR)/libISSM_a-GaussPoints.Tpo -c -o libISSM_a-GaussPoints.obj `if test -f './shared/Numerics/GaussPoints.cpp'; then $(CYGPATH_W) './shared/Numerics/GaussPoints.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Numerics/GaussPoints.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-GaussPoints.Tpo $(DEPDIR)/libISSM_a-GaussPoints.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Numerics/GaussPoints.cpp' object='libISSM_a-GaussPoints.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-GaussPoints.obj `if test -f './shared/Numerics/GaussPoints.cpp'; then $(CYGPATH_W) './shared/Numerics/GaussPoints.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Numerics/GaussPoints.cpp'; fi`
+
+libISSM_a-Exceptions.o: ./shared/Exceptions/Exceptions.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Exceptions.o -MD -MP -MF $(DEPDIR)/libISSM_a-Exceptions.Tpo -c -o libISSM_a-Exceptions.o `test -f './shared/Exceptions/Exceptions.cpp' || echo '$(srcdir)/'`./shared/Exceptions/Exceptions.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Exceptions.Tpo $(DEPDIR)/libISSM_a-Exceptions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exceptions/Exceptions.cpp' object='libISSM_a-Exceptions.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Exceptions.o `test -f './shared/Exceptions/Exceptions.cpp' || echo '$(srcdir)/'`./shared/Exceptions/Exceptions.cpp
+
+libISSM_a-Exceptions.obj: ./shared/Exceptions/Exceptions.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Exceptions.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Exceptions.Tpo -c -o libISSM_a-Exceptions.obj `if test -f './shared/Exceptions/Exceptions.cpp'; then $(CYGPATH_W) './shared/Exceptions/Exceptions.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exceptions/Exceptions.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Exceptions.Tpo $(DEPDIR)/libISSM_a-Exceptions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exceptions/Exceptions.cpp' object='libISSM_a-Exceptions.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Exceptions.obj `if test -f './shared/Exceptions/Exceptions.cpp'; then $(CYGPATH_W) './shared/Exceptions/Exceptions.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exceptions/Exceptions.cpp'; fi`
+
+libISSM_a-exprintf.o: ./shared/Exceptions/exprintf.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-exprintf.o -MD -MP -MF $(DEPDIR)/libISSM_a-exprintf.Tpo -c -o libISSM_a-exprintf.o `test -f './shared/Exceptions/exprintf.cpp' || echo '$(srcdir)/'`./shared/Exceptions/exprintf.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-exprintf.Tpo $(DEPDIR)/libISSM_a-exprintf.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exceptions/exprintf.cpp' object='libISSM_a-exprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-exprintf.o `test -f './shared/Exceptions/exprintf.cpp' || echo '$(srcdir)/'`./shared/Exceptions/exprintf.cpp
+
+libISSM_a-exprintf.obj: ./shared/Exceptions/exprintf.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-exprintf.obj -MD -MP -MF $(DEPDIR)/libISSM_a-exprintf.Tpo -c -o libISSM_a-exprintf.obj `if test -f './shared/Exceptions/exprintf.cpp'; then $(CYGPATH_W) './shared/Exceptions/exprintf.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exceptions/exprintf.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-exprintf.Tpo $(DEPDIR)/libISSM_a-exprintf.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exceptions/exprintf.cpp' object='libISSM_a-exprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-exprintf.obj `if test -f './shared/Exceptions/exprintf.cpp'; then $(CYGPATH_W) './shared/Exceptions/exprintf.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exceptions/exprintf.cpp'; fi`
+
+libISSM_a-IsInPoly.o: ./shared/Exp/IsInPoly.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-IsInPoly.o -MD -MP -MF $(DEPDIR)/libISSM_a-IsInPoly.Tpo -c -o libISSM_a-IsInPoly.o `test -f './shared/Exp/IsInPoly.cpp' || echo '$(srcdir)/'`./shared/Exp/IsInPoly.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-IsInPoly.Tpo $(DEPDIR)/libISSM_a-IsInPoly.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/IsInPoly.cpp' object='libISSM_a-IsInPoly.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-IsInPoly.o `test -f './shared/Exp/IsInPoly.cpp' || echo '$(srcdir)/'`./shared/Exp/IsInPoly.cpp
+
+libISSM_a-IsInPoly.obj: ./shared/Exp/IsInPoly.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-IsInPoly.obj -MD -MP -MF $(DEPDIR)/libISSM_a-IsInPoly.Tpo -c -o libISSM_a-IsInPoly.obj `if test -f './shared/Exp/IsInPoly.cpp'; then $(CYGPATH_W) './shared/Exp/IsInPoly.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/IsInPoly.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-IsInPoly.Tpo $(DEPDIR)/libISSM_a-IsInPoly.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/IsInPoly.cpp' object='libISSM_a-IsInPoly.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-IsInPoly.obj `if test -f './shared/Exp/IsInPoly.cpp'; then $(CYGPATH_W) './shared/Exp/IsInPoly.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/IsInPoly.cpp'; fi`
+
+libISSM_a-IsInPolySerial.o: ./shared/Exp/IsInPolySerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-IsInPolySerial.o -MD -MP -MF $(DEPDIR)/libISSM_a-IsInPolySerial.Tpo -c -o libISSM_a-IsInPolySerial.o `test -f './shared/Exp/IsInPolySerial.cpp' || echo '$(srcdir)/'`./shared/Exp/IsInPolySerial.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-IsInPolySerial.Tpo $(DEPDIR)/libISSM_a-IsInPolySerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/IsInPolySerial.cpp' object='libISSM_a-IsInPolySerial.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-IsInPolySerial.o `test -f './shared/Exp/IsInPolySerial.cpp' || echo '$(srcdir)/'`./shared/Exp/IsInPolySerial.cpp
+
+libISSM_a-IsInPolySerial.obj: ./shared/Exp/IsInPolySerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-IsInPolySerial.obj -MD -MP -MF $(DEPDIR)/libISSM_a-IsInPolySerial.Tpo -c -o libISSM_a-IsInPolySerial.obj `if test -f './shared/Exp/IsInPolySerial.cpp'; then $(CYGPATH_W) './shared/Exp/IsInPolySerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/IsInPolySerial.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-IsInPolySerial.Tpo $(DEPDIR)/libISSM_a-IsInPolySerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/IsInPolySerial.cpp' object='libISSM_a-IsInPolySerial.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-IsInPolySerial.obj `if test -f './shared/Exp/IsInPolySerial.cpp'; then $(CYGPATH_W) './shared/Exp/IsInPolySerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/IsInPolySerial.cpp'; fi`
+
+libISSM_a-DomainOutlineRead.o: ./shared/Exp/DomainOutlineRead.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-DomainOutlineRead.o -MD -MP -MF $(DEPDIR)/libISSM_a-DomainOutlineRead.Tpo -c -o libISSM_a-DomainOutlineRead.o `test -f './shared/Exp/DomainOutlineRead.cpp' || echo '$(srcdir)/'`./shared/Exp/DomainOutlineRead.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-DomainOutlineRead.Tpo $(DEPDIR)/libISSM_a-DomainOutlineRead.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/DomainOutlineRead.cpp' object='libISSM_a-DomainOutlineRead.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-DomainOutlineRead.o `test -f './shared/Exp/DomainOutlineRead.cpp' || echo '$(srcdir)/'`./shared/Exp/DomainOutlineRead.cpp
+
+libISSM_a-DomainOutlineRead.obj: ./shared/Exp/DomainOutlineRead.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-DomainOutlineRead.obj -MD -MP -MF $(DEPDIR)/libISSM_a-DomainOutlineRead.Tpo -c -o libISSM_a-DomainOutlineRead.obj `if test -f './shared/Exp/DomainOutlineRead.cpp'; then $(CYGPATH_W) './shared/Exp/DomainOutlineRead.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/DomainOutlineRead.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-DomainOutlineRead.Tpo $(DEPDIR)/libISSM_a-DomainOutlineRead.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/DomainOutlineRead.cpp' object='libISSM_a-DomainOutlineRead.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-DomainOutlineRead.obj `if test -f './shared/Exp/DomainOutlineRead.cpp'; then $(CYGPATH_W) './shared/Exp/DomainOutlineRead.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/DomainOutlineRead.cpp'; fi`
+
+libISSM_a-AssociateSegmentToElement.o: ./shared/TriMesh/AssociateSegmentToElement.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-AssociateSegmentToElement.o -MD -MP -MF $(DEPDIR)/libISSM_a-AssociateSegmentToElement.Tpo -c -o libISSM_a-AssociateSegmentToElement.o `test -f './shared/TriMesh/AssociateSegmentToElement.cpp' || echo '$(srcdir)/'`./shared/TriMesh/AssociateSegmentToElement.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-AssociateSegmentToElement.Tpo $(DEPDIR)/libISSM_a-AssociateSegmentToElement.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/AssociateSegmentToElement.cpp' object='libISSM_a-AssociateSegmentToElement.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-AssociateSegmentToElement.o `test -f './shared/TriMesh/AssociateSegmentToElement.cpp' || echo '$(srcdir)/'`./shared/TriMesh/AssociateSegmentToElement.cpp
+
+libISSM_a-AssociateSegmentToElement.obj: ./shared/TriMesh/AssociateSegmentToElement.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-AssociateSegmentToElement.obj -MD -MP -MF $(DEPDIR)/libISSM_a-AssociateSegmentToElement.Tpo -c -o libISSM_a-AssociateSegmentToElement.obj `if test -f './shared/TriMesh/AssociateSegmentToElement.cpp'; then $(CYGPATH_W) './shared/TriMesh/AssociateSegmentToElement.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/AssociateSegmentToElement.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-AssociateSegmentToElement.Tpo $(DEPDIR)/libISSM_a-AssociateSegmentToElement.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/AssociateSegmentToElement.cpp' object='libISSM_a-AssociateSegmentToElement.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-AssociateSegmentToElement.obj `if test -f './shared/TriMesh/AssociateSegmentToElement.cpp'; then $(CYGPATH_W) './shared/TriMesh/AssociateSegmentToElement.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/AssociateSegmentToElement.cpp'; fi`
+
+libISSM_a-GridInsideHole.o: ./shared/TriMesh/GridInsideHole.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-GridInsideHole.o -MD -MP -MF $(DEPDIR)/libISSM_a-GridInsideHole.Tpo -c -o libISSM_a-GridInsideHole.o `test -f './shared/TriMesh/GridInsideHole.cpp' || echo '$(srcdir)/'`./shared/TriMesh/GridInsideHole.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-GridInsideHole.Tpo $(DEPDIR)/libISSM_a-GridInsideHole.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/GridInsideHole.cpp' object='libISSM_a-GridInsideHole.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-GridInsideHole.o `test -f './shared/TriMesh/GridInsideHole.cpp' || echo '$(srcdir)/'`./shared/TriMesh/GridInsideHole.cpp
+
+libISSM_a-GridInsideHole.obj: ./shared/TriMesh/GridInsideHole.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-GridInsideHole.obj -MD -MP -MF $(DEPDIR)/libISSM_a-GridInsideHole.Tpo -c -o libISSM_a-GridInsideHole.obj `if test -f './shared/TriMesh/GridInsideHole.cpp'; then $(CYGPATH_W) './shared/TriMesh/GridInsideHole.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/GridInsideHole.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-GridInsideHole.Tpo $(DEPDIR)/libISSM_a-GridInsideHole.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/GridInsideHole.cpp' object='libISSM_a-GridInsideHole.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-GridInsideHole.obj `if test -f './shared/TriMesh/GridInsideHole.cpp'; then $(CYGPATH_W) './shared/TriMesh/GridInsideHole.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/GridInsideHole.cpp'; fi`
+
+libISSM_a-OrderSegments.o: ./shared/TriMesh/OrderSegments.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-OrderSegments.o -MD -MP -MF $(DEPDIR)/libISSM_a-OrderSegments.Tpo -c -o libISSM_a-OrderSegments.o `test -f './shared/TriMesh/OrderSegments.cpp' || echo '$(srcdir)/'`./shared/TriMesh/OrderSegments.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-OrderSegments.Tpo $(DEPDIR)/libISSM_a-OrderSegments.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/OrderSegments.cpp' object='libISSM_a-OrderSegments.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-OrderSegments.o `test -f './shared/TriMesh/OrderSegments.cpp' || echo '$(srcdir)/'`./shared/TriMesh/OrderSegments.cpp
+
+libISSM_a-OrderSegments.obj: ./shared/TriMesh/OrderSegments.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-OrderSegments.obj -MD -MP -MF $(DEPDIR)/libISSM_a-OrderSegments.Tpo -c -o libISSM_a-OrderSegments.obj `if test -f './shared/TriMesh/OrderSegments.cpp'; then $(CYGPATH_W) './shared/TriMesh/OrderSegments.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/OrderSegments.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-OrderSegments.Tpo $(DEPDIR)/libISSM_a-OrderSegments.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/OrderSegments.cpp' object='libISSM_a-OrderSegments.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-OrderSegments.obj `if test -f './shared/TriMesh/OrderSegments.cpp'; then $(CYGPATH_W) './shared/TriMesh/OrderSegments.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/OrderSegments.cpp'; fi`
+
+libISSM_a-SplitMeshForRifts.o: ./shared/TriMesh/SplitMeshForRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SplitMeshForRifts.o -MD -MP -MF $(DEPDIR)/libISSM_a-SplitMeshForRifts.Tpo -c -o libISSM_a-SplitMeshForRifts.o `test -f './shared/TriMesh/SplitMeshForRifts.cpp' || echo '$(srcdir)/'`./shared/TriMesh/SplitMeshForRifts.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SplitMeshForRifts.Tpo $(DEPDIR)/libISSM_a-SplitMeshForRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/SplitMeshForRifts.cpp' object='libISSM_a-SplitMeshForRifts.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SplitMeshForRifts.o `test -f './shared/TriMesh/SplitMeshForRifts.cpp' || echo '$(srcdir)/'`./shared/TriMesh/SplitMeshForRifts.cpp
+
+libISSM_a-SplitMeshForRifts.obj: ./shared/TriMesh/SplitMeshForRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SplitMeshForRifts.obj -MD -MP -MF $(DEPDIR)/libISSM_a-SplitMeshForRifts.Tpo -c -o libISSM_a-SplitMeshForRifts.obj `if test -f './shared/TriMesh/SplitMeshForRifts.cpp'; then $(CYGPATH_W) './shared/TriMesh/SplitMeshForRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/SplitMeshForRifts.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SplitMeshForRifts.Tpo $(DEPDIR)/libISSM_a-SplitMeshForRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/SplitMeshForRifts.cpp' object='libISSM_a-SplitMeshForRifts.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SplitMeshForRifts.obj `if test -f './shared/TriMesh/SplitMeshForRifts.cpp'; then $(CYGPATH_W) './shared/TriMesh/SplitMeshForRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/SplitMeshForRifts.cpp'; fi`
+
+libISSM_a-TriMeshUtils.o: ./shared/TriMesh/TriMeshUtils.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-TriMeshUtils.o -MD -MP -MF $(DEPDIR)/libISSM_a-TriMeshUtils.Tpo -c -o libISSM_a-TriMeshUtils.o `test -f './shared/TriMesh/TriMeshUtils.cpp' || echo '$(srcdir)/'`./shared/TriMesh/TriMeshUtils.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-TriMeshUtils.Tpo $(DEPDIR)/libISSM_a-TriMeshUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/TriMeshUtils.cpp' object='libISSM_a-TriMeshUtils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-TriMeshUtils.o `test -f './shared/TriMesh/TriMeshUtils.cpp' || echo '$(srcdir)/'`./shared/TriMesh/TriMeshUtils.cpp
+
+libISSM_a-TriMeshUtils.obj: ./shared/TriMesh/TriMeshUtils.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-TriMeshUtils.obj -MD -MP -MF $(DEPDIR)/libISSM_a-TriMeshUtils.Tpo -c -o libISSM_a-TriMeshUtils.obj `if test -f './shared/TriMesh/TriMeshUtils.cpp'; then $(CYGPATH_W) './shared/TriMesh/TriMeshUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/TriMeshUtils.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-TriMeshUtils.Tpo $(DEPDIR)/libISSM_a-TriMeshUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/TriMeshUtils.cpp' object='libISSM_a-TriMeshUtils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-TriMeshUtils.obj `if test -f './shared/TriMesh/TriMeshUtils.cpp'; then $(CYGPATH_W) './shared/TriMesh/TriMeshUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/TriMeshUtils.cpp'; fi`
+
+libISSM_a-binary_search.o: ./shared/Sorting/binary_search.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-binary_search.o -MD -MP -MF $(DEPDIR)/libISSM_a-binary_search.Tpo -c -o libISSM_a-binary_search.o `test -f './shared/Sorting/binary_search.cpp' || echo '$(srcdir)/'`./shared/Sorting/binary_search.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-binary_search.Tpo $(DEPDIR)/libISSM_a-binary_search.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Sorting/binary_search.cpp' object='libISSM_a-binary_search.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-binary_search.o `test -f './shared/Sorting/binary_search.cpp' || echo '$(srcdir)/'`./shared/Sorting/binary_search.cpp
+
+libISSM_a-binary_search.obj: ./shared/Sorting/binary_search.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-binary_search.obj -MD -MP -MF $(DEPDIR)/libISSM_a-binary_search.Tpo -c -o libISSM_a-binary_search.obj `if test -f './shared/Sorting/binary_search.cpp'; then $(CYGPATH_W) './shared/Sorting/binary_search.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Sorting/binary_search.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-binary_search.Tpo $(DEPDIR)/libISSM_a-binary_search.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Sorting/binary_search.cpp' object='libISSM_a-binary_search.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-binary_search.obj `if test -f './shared/Sorting/binary_search.cpp'; then $(CYGPATH_W) './shared/Sorting/binary_search.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Sorting/binary_search.cpp'; fi`
+
+libISSM_a-ResolvePointers.o: ./shared/Elements/ResolvePointers.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ResolvePointers.o -MD -MP -MF $(DEPDIR)/libISSM_a-ResolvePointers.Tpo -c -o libISSM_a-ResolvePointers.o `test -f './shared/Elements/ResolvePointers.cpp' || echo '$(srcdir)/'`./shared/Elements/ResolvePointers.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ResolvePointers.Tpo $(DEPDIR)/libISSM_a-ResolvePointers.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/ResolvePointers.cpp' object='libISSM_a-ResolvePointers.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ResolvePointers.o `test -f './shared/Elements/ResolvePointers.cpp' || echo '$(srcdir)/'`./shared/Elements/ResolvePointers.cpp
+
+libISSM_a-ResolvePointers.obj: ./shared/Elements/ResolvePointers.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ResolvePointers.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ResolvePointers.Tpo -c -o libISSM_a-ResolvePointers.obj `if test -f './shared/Elements/ResolvePointers.cpp'; then $(CYGPATH_W) './shared/Elements/ResolvePointers.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/ResolvePointers.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ResolvePointers.Tpo $(DEPDIR)/libISSM_a-ResolvePointers.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/ResolvePointers.cpp' object='libISSM_a-ResolvePointers.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ResolvePointers.obj `if test -f './shared/Elements/ResolvePointers.cpp'; then $(CYGPATH_W) './shared/Elements/ResolvePointers.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/ResolvePointers.cpp'; fi`
+
+libISSM_a-Paterson.o: ./shared/Elements/Paterson.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Paterson.o -MD -MP -MF $(DEPDIR)/libISSM_a-Paterson.Tpo -c -o libISSM_a-Paterson.o `test -f './shared/Elements/Paterson.cpp' || echo '$(srcdir)/'`./shared/Elements/Paterson.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Paterson.Tpo $(DEPDIR)/libISSM_a-Paterson.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/Paterson.cpp' object='libISSM_a-Paterson.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Paterson.o `test -f './shared/Elements/Paterson.cpp' || echo '$(srcdir)/'`./shared/Elements/Paterson.cpp
+
+libISSM_a-Paterson.obj: ./shared/Elements/Paterson.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Paterson.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Paterson.Tpo -c -o libISSM_a-Paterson.obj `if test -f './shared/Elements/Paterson.cpp'; then $(CYGPATH_W) './shared/Elements/Paterson.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/Paterson.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Paterson.Tpo $(DEPDIR)/libISSM_a-Paterson.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/Paterson.cpp' object='libISSM_a-Paterson.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Paterson.obj `if test -f './shared/Elements/Paterson.cpp'; then $(CYGPATH_W) './shared/Elements/Paterson.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/Paterson.cpp'; fi`
+
+libISSM_a-GetElementNodeData.o: ./shared/Elements/GetElementNodeData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-GetElementNodeData.o -MD -MP -MF $(DEPDIR)/libISSM_a-GetElementNodeData.Tpo -c -o libISSM_a-GetElementNodeData.o `test -f './shared/Elements/GetElementNodeData.cpp' || echo '$(srcdir)/'`./shared/Elements/GetElementNodeData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-GetElementNodeData.Tpo $(DEPDIR)/libISSM_a-GetElementNodeData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/GetElementNodeData.cpp' object='libISSM_a-GetElementNodeData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-GetElementNodeData.o `test -f './shared/Elements/GetElementNodeData.cpp' || echo '$(srcdir)/'`./shared/Elements/GetElementNodeData.cpp
+
+libISSM_a-GetElementNodeData.obj: ./shared/Elements/GetElementNodeData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-GetElementNodeData.obj -MD -MP -MF $(DEPDIR)/libISSM_a-GetElementNodeData.Tpo -c -o libISSM_a-GetElementNodeData.obj `if test -f './shared/Elements/GetElementNodeData.cpp'; then $(CYGPATH_W) './shared/Elements/GetElementNodeData.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/GetElementNodeData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-GetElementNodeData.Tpo $(DEPDIR)/libISSM_a-GetElementNodeData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/GetElementNodeData.cpp' object='libISSM_a-GetElementNodeData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-GetElementNodeData.obj `if test -f './shared/Elements/GetElementNodeData.cpp'; then $(CYGPATH_W) './shared/Elements/GetElementNodeData.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/GetElementNodeData.cpp'; fi`
+
+libISSM_a-MatlabMatrixToPetscMatrix.o: ./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatlabMatrixToPetscMatrix.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatlabMatrixToPetscMatrix.Tpo -c -o libISSM_a-MatlabMatrixToPetscMatrix.o `test -f './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatlabMatrixToPetscMatrix.Tpo $(DEPDIR)/libISSM_a-MatlabMatrixToPetscMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp' object='libISSM_a-MatlabMatrixToPetscMatrix.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatlabMatrixToPetscMatrix.o `test -f './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
+
+libISSM_a-MatlabMatrixToPetscMatrix.obj: ./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatlabMatrixToPetscMatrix.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatlabMatrixToPetscMatrix.Tpo -c -o libISSM_a-MatlabMatrixToPetscMatrix.obj `if test -f './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatlabMatrixToPetscMatrix.Tpo $(DEPDIR)/libISSM_a-MatlabMatrixToPetscMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp' object='libISSM_a-MatlabMatrixToPetscMatrix.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatlabMatrixToPetscMatrix.obj `if test -f './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; fi`
+
+libISSM_a-MatlabVectorToPetscVector.o: ./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatlabVectorToPetscVector.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatlabVectorToPetscVector.Tpo -c -o libISSM_a-MatlabVectorToPetscVector.o `test -f './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatlabVectorToPetscVector.Tpo $(DEPDIR)/libISSM_a-MatlabVectorToPetscVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp' object='libISSM_a-MatlabVectorToPetscVector.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatlabVectorToPetscVector.o `test -f './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
+
+libISSM_a-MatlabVectorToPetscVector.obj: ./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatlabVectorToPetscVector.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatlabVectorToPetscVector.Tpo -c -o libISSM_a-MatlabVectorToPetscVector.obj `if test -f './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatlabVectorToPetscVector.Tpo $(DEPDIR)/libISSM_a-MatlabVectorToPetscVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp' object='libISSM_a-MatlabVectorToPetscVector.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatlabVectorToPetscVector.obj `if test -f './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; fi`
+
+libISSM_a-PetscMatrixToMatlabMatrix.o: ./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscMatrixToMatlabMatrix.o -MD -MP -MF $(DEPDIR)/libISSM_a-PetscMatrixToMatlabMatrix.Tpo -c -o libISSM_a-PetscMatrixToMatlabMatrix.o `test -f './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscMatrixToMatlabMatrix.Tpo $(DEPDIR)/libISSM_a-PetscMatrixToMatlabMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp' object='libISSM_a-PetscMatrixToMatlabMatrix.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscMatrixToMatlabMatrix.o `test -f './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
+
+libISSM_a-PetscMatrixToMatlabMatrix.obj: ./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscMatrixToMatlabMatrix.obj -MD -MP -MF $(DEPDIR)/libISSM_a-PetscMatrixToMatlabMatrix.Tpo -c -o libISSM_a-PetscMatrixToMatlabMatrix.obj `if test -f './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscMatrixToMatlabMatrix.Tpo $(DEPDIR)/libISSM_a-PetscMatrixToMatlabMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp' object='libISSM_a-PetscMatrixToMatlabMatrix.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscMatrixToMatlabMatrix.obj `if test -f './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; fi`
+
+libISSM_a-PetscVectorToMatlabVector.o: ./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscVectorToMatlabVector.o -MD -MP -MF $(DEPDIR)/libISSM_a-PetscVectorToMatlabVector.Tpo -c -o libISSM_a-PetscVectorToMatlabVector.o `test -f './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscVectorToMatlabVector.Tpo $(DEPDIR)/libISSM_a-PetscVectorToMatlabVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp' object='libISSM_a-PetscVectorToMatlabVector.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscVectorToMatlabVector.o `test -f './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
+
+libISSM_a-PetscVectorToMatlabVector.obj: ./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscVectorToMatlabVector.obj -MD -MP -MF $(DEPDIR)/libISSM_a-PetscVectorToMatlabVector.Tpo -c -o libISSM_a-PetscVectorToMatlabVector.obj `if test -f './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscVectorToMatlabVector.Tpo $(DEPDIR)/libISSM_a-PetscVectorToMatlabVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp' object='libISSM_a-PetscVectorToMatlabVector.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscVectorToMatlabVector.obj `if test -f './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; fi`
+
+libISSM_a-MatlabMatrixToDoubleMatrix.o: ./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatlabMatrixToDoubleMatrix.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatlabMatrixToDoubleMatrix.Tpo -c -o libISSM_a-MatlabMatrixToDoubleMatrix.o `test -f './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatlabMatrixToDoubleMatrix.Tpo $(DEPDIR)/libISSM_a-MatlabMatrixToDoubleMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp' object='libISSM_a-MatlabMatrixToDoubleMatrix.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatlabMatrixToDoubleMatrix.o `test -f './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
+
+libISSM_a-MatlabMatrixToDoubleMatrix.obj: ./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatlabMatrixToDoubleMatrix.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatlabMatrixToDoubleMatrix.Tpo -c -o libISSM_a-MatlabMatrixToDoubleMatrix.obj `if test -f './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatlabMatrixToDoubleMatrix.Tpo $(DEPDIR)/libISSM_a-MatlabMatrixToDoubleMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp' object='libISSM_a-MatlabMatrixToDoubleMatrix.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatlabMatrixToDoubleMatrix.obj `if test -f './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; fi`
+
+libISSM_a-MatlabVectorToDoubleVector.o: ./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatlabVectorToDoubleVector.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatlabVectorToDoubleVector.Tpo -c -o libISSM_a-MatlabVectorToDoubleVector.o `test -f './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatlabVectorToDoubleVector.Tpo $(DEPDIR)/libISSM_a-MatlabVectorToDoubleVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp' object='libISSM_a-MatlabVectorToDoubleVector.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatlabVectorToDoubleVector.o `test -f './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
+
+libISSM_a-MatlabVectorToDoubleVector.obj: ./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatlabVectorToDoubleVector.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatlabVectorToDoubleVector.Tpo -c -o libISSM_a-MatlabVectorToDoubleVector.obj `if test -f './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatlabVectorToDoubleVector.Tpo $(DEPDIR)/libISSM_a-MatlabVectorToDoubleVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp' object='libISSM_a-MatlabVectorToDoubleVector.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatlabVectorToDoubleVector.obj `if test -f './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; fi`
+
+libISSM_a-PetscDetermineLocalSize.o: ./toolkits/petsc/patches/PetscDetermineLocalSize.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscDetermineLocalSize.o -MD -MP -MF $(DEPDIR)/libISSM_a-PetscDetermineLocalSize.Tpo -c -o libISSM_a-PetscDetermineLocalSize.o `test -f './toolkits/petsc/patches/PetscDetermineLocalSize.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscDetermineLocalSize.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscDetermineLocalSize.Tpo $(DEPDIR)/libISSM_a-PetscDetermineLocalSize.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscDetermineLocalSize.cpp' object='libISSM_a-PetscDetermineLocalSize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscDetermineLocalSize.o `test -f './toolkits/petsc/patches/PetscDetermineLocalSize.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscDetermineLocalSize.cpp
+
+libISSM_a-PetscDetermineLocalSize.obj: ./toolkits/petsc/patches/PetscDetermineLocalSize.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscDetermineLocalSize.obj -MD -MP -MF $(DEPDIR)/libISSM_a-PetscDetermineLocalSize.Tpo -c -o libISSM_a-PetscDetermineLocalSize.obj `if test -f './toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscDetermineLocalSize.Tpo $(DEPDIR)/libISSM_a-PetscDetermineLocalSize.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscDetermineLocalSize.cpp' object='libISSM_a-PetscDetermineLocalSize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscDetermineLocalSize.obj `if test -f './toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; fi`
+
+libISSM_a-VecTranspose.o: ./toolkits/petsc/patches/VecTranspose.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecTranspose.o -MD -MP -MF $(DEPDIR)/libISSM_a-VecTranspose.Tpo -c -o libISSM_a-VecTranspose.o `test -f './toolkits/petsc/patches/VecTranspose.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecTranspose.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecTranspose.Tpo $(DEPDIR)/libISSM_a-VecTranspose.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecTranspose.cpp' object='libISSM_a-VecTranspose.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecTranspose.o `test -f './toolkits/petsc/patches/VecTranspose.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecTranspose.cpp
+
+libISSM_a-VecTranspose.obj: ./toolkits/petsc/patches/VecTranspose.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecTranspose.obj -MD -MP -MF $(DEPDIR)/libISSM_a-VecTranspose.Tpo -c -o libISSM_a-VecTranspose.obj `if test -f './toolkits/petsc/patches/VecTranspose.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecTranspose.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecTranspose.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecTranspose.Tpo $(DEPDIR)/libISSM_a-VecTranspose.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecTranspose.cpp' object='libISSM_a-VecTranspose.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecTranspose.obj `if test -f './toolkits/petsc/patches/VecTranspose.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecTranspose.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecTranspose.cpp'; fi`
+
+libISSM_a-VecToMPISerial.o: ./toolkits/petsc/patches/VecToMPISerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecToMPISerial.o -MD -MP -MF $(DEPDIR)/libISSM_a-VecToMPISerial.Tpo -c -o libISSM_a-VecToMPISerial.o `test -f './toolkits/petsc/patches/VecToMPISerial.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecToMPISerial.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecToMPISerial.Tpo $(DEPDIR)/libISSM_a-VecToMPISerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecToMPISerial.cpp' object='libISSM_a-VecToMPISerial.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecToMPISerial.o `test -f './toolkits/petsc/patches/VecToMPISerial.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecToMPISerial.cpp
+
+libISSM_a-VecToMPISerial.obj: ./toolkits/petsc/patches/VecToMPISerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecToMPISerial.obj -MD -MP -MF $(DEPDIR)/libISSM_a-VecToMPISerial.Tpo -c -o libISSM_a-VecToMPISerial.obj `if test -f './toolkits/petsc/patches/VecToMPISerial.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecToMPISerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecToMPISerial.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecToMPISerial.Tpo $(DEPDIR)/libISSM_a-VecToMPISerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecToMPISerial.cpp' object='libISSM_a-VecToMPISerial.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecToMPISerial.obj `if test -f './toolkits/petsc/patches/VecToMPISerial.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecToMPISerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecToMPISerial.cpp'; fi`
+
+libISSM_a-MatToSerial.o: ./toolkits/petsc/patches/MatToSerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatToSerial.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatToSerial.Tpo -c -o libISSM_a-MatToSerial.o `test -f './toolkits/petsc/patches/MatToSerial.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatToSerial.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatToSerial.Tpo $(DEPDIR)/libISSM_a-MatToSerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatToSerial.cpp' object='libISSM_a-MatToSerial.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatToSerial.o `test -f './toolkits/petsc/patches/MatToSerial.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatToSerial.cpp
+
+libISSM_a-MatToSerial.obj: ./toolkits/petsc/patches/MatToSerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatToSerial.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatToSerial.Tpo -c -o libISSM_a-MatToSerial.obj `if test -f './toolkits/petsc/patches/MatToSerial.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatToSerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatToSerial.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatToSerial.Tpo $(DEPDIR)/libISSM_a-MatToSerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatToSerial.cpp' object='libISSM_a-MatToSerial.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatToSerial.obj `if test -f './toolkits/petsc/patches/MatToSerial.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatToSerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatToSerial.cpp'; fi`
+
+libISSM_a-VecMerge.o: ./toolkits/petsc/patches/VecMerge.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecMerge.o -MD -MP -MF $(DEPDIR)/libISSM_a-VecMerge.Tpo -c -o libISSM_a-VecMerge.o `test -f './toolkits/petsc/patches/VecMerge.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecMerge.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecMerge.Tpo $(DEPDIR)/libISSM_a-VecMerge.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecMerge.cpp' object='libISSM_a-VecMerge.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecMerge.o `test -f './toolkits/petsc/patches/VecMerge.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecMerge.cpp
+
+libISSM_a-VecMerge.obj: ./toolkits/petsc/patches/VecMerge.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecMerge.obj -MD -MP -MF $(DEPDIR)/libISSM_a-VecMerge.Tpo -c -o libISSM_a-VecMerge.obj `if test -f './toolkits/petsc/patches/VecMerge.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecMerge.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecMerge.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecMerge.Tpo $(DEPDIR)/libISSM_a-VecMerge.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecMerge.cpp' object='libISSM_a-VecMerge.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecMerge.obj `if test -f './toolkits/petsc/patches/VecMerge.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecMerge.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecMerge.cpp'; fi`
+
+libISSM_a-NewVec.o: ./toolkits/petsc/patches/NewVec.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NewVec.o -MD -MP -MF $(DEPDIR)/libISSM_a-NewVec.Tpo -c -o libISSM_a-NewVec.o `test -f './toolkits/petsc/patches/NewVec.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewVec.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NewVec.Tpo $(DEPDIR)/libISSM_a-NewVec.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewVec.cpp' object='libISSM_a-NewVec.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NewVec.o `test -f './toolkits/petsc/patches/NewVec.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewVec.cpp
+
+libISSM_a-NewVec.obj: ./toolkits/petsc/patches/NewVec.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NewVec.obj -MD -MP -MF $(DEPDIR)/libISSM_a-NewVec.Tpo -c -o libISSM_a-NewVec.obj `if test -f './toolkits/petsc/patches/NewVec.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewVec.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewVec.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NewVec.Tpo $(DEPDIR)/libISSM_a-NewVec.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewVec.cpp' object='libISSM_a-NewVec.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NewVec.obj `if test -f './toolkits/petsc/patches/NewVec.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewVec.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewVec.cpp'; fi`
+
+libISSM_a-NewVecFromLocalSize.o: ./toolkits/petsc/patches/NewVecFromLocalSize.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NewVecFromLocalSize.o -MD -MP -MF $(DEPDIR)/libISSM_a-NewVecFromLocalSize.Tpo -c -o libISSM_a-NewVecFromLocalSize.o `test -f './toolkits/petsc/patches/NewVecFromLocalSize.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewVecFromLocalSize.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NewVecFromLocalSize.Tpo $(DEPDIR)/libISSM_a-NewVecFromLocalSize.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewVecFromLocalSize.cpp' object='libISSM_a-NewVecFromLocalSize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NewVecFromLocalSize.o `test -f './toolkits/petsc/patches/NewVecFromLocalSize.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewVecFromLocalSize.cpp
+
+libISSM_a-NewVecFromLocalSize.obj: ./toolkits/petsc/patches/NewVecFromLocalSize.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NewVecFromLocalSize.obj -MD -MP -MF $(DEPDIR)/libISSM_a-NewVecFromLocalSize.Tpo -c -o libISSM_a-NewVecFromLocalSize.obj `if test -f './toolkits/petsc/patches/NewVecFromLocalSize.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewVecFromLocalSize.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewVecFromLocalSize.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NewVecFromLocalSize.Tpo $(DEPDIR)/libISSM_a-NewVecFromLocalSize.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewVecFromLocalSize.cpp' object='libISSM_a-NewVecFromLocalSize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NewVecFromLocalSize.obj `if test -f './toolkits/petsc/patches/NewVecFromLocalSize.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewVecFromLocalSize.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewVecFromLocalSize.cpp'; fi`
+
+libISSM_a-PetscOptionsDetermineSolverType.o: ./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscOptionsDetermineSolverType.o -MD -MP -MF $(DEPDIR)/libISSM_a-PetscOptionsDetermineSolverType.Tpo -c -o libISSM_a-PetscOptionsDetermineSolverType.o `test -f './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscOptionsDetermineSolverType.Tpo $(DEPDIR)/libISSM_a-PetscOptionsDetermineSolverType.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp' object='libISSM_a-PetscOptionsDetermineSolverType.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscOptionsDetermineSolverType.o `test -f './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
+
+libISSM_a-PetscOptionsDetermineSolverType.obj: ./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscOptionsDetermineSolverType.obj -MD -MP -MF $(DEPDIR)/libISSM_a-PetscOptionsDetermineSolverType.Tpo -c -o libISSM_a-PetscOptionsDetermineSolverType.obj `if test -f './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscOptionsDetermineSolverType.Tpo $(DEPDIR)/libISSM_a-PetscOptionsDetermineSolverType.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp' object='libISSM_a-PetscOptionsDetermineSolverType.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscOptionsDetermineSolverType.obj `if test -f './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; fi`
+
+libISSM_a-PetscOptionsInsertMultipleString.o: ./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscOptionsInsertMultipleString.o -MD -MP -MF $(DEPDIR)/libISSM_a-PetscOptionsInsertMultipleString.Tpo -c -o libISSM_a-PetscOptionsInsertMultipleString.o `test -f './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscOptionsInsertMultipleString.Tpo $(DEPDIR)/libISSM_a-PetscOptionsInsertMultipleString.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp' object='libISSM_a-PetscOptionsInsertMultipleString.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscOptionsInsertMultipleString.o `test -f './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+
+libISSM_a-PetscOptionsInsertMultipleString.obj: ./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PetscOptionsInsertMultipleString.obj -MD -MP -MF $(DEPDIR)/libISSM_a-PetscOptionsInsertMultipleString.Tpo -c -o libISSM_a-PetscOptionsInsertMultipleString.obj `if test -f './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PetscOptionsInsertMultipleString.Tpo $(DEPDIR)/libISSM_a-PetscOptionsInsertMultipleString.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp' object='libISSM_a-PetscOptionsInsertMultipleString.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PetscOptionsInsertMultipleString.obj `if test -f './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; fi`
+
+libISSM_a-NewMat.o: ./toolkits/petsc/patches/NewMat.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NewMat.o -MD -MP -MF $(DEPDIR)/libISSM_a-NewMat.Tpo -c -o libISSM_a-NewMat.o `test -f './toolkits/petsc/patches/NewMat.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewMat.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NewMat.Tpo $(DEPDIR)/libISSM_a-NewMat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewMat.cpp' object='libISSM_a-NewMat.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NewMat.o `test -f './toolkits/petsc/patches/NewMat.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewMat.cpp
+
+libISSM_a-NewMat.obj: ./toolkits/petsc/patches/NewMat.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NewMat.obj -MD -MP -MF $(DEPDIR)/libISSM_a-NewMat.Tpo -c -o libISSM_a-NewMat.obj `if test -f './toolkits/petsc/patches/NewMat.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewMat.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewMat.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NewMat.Tpo $(DEPDIR)/libISSM_a-NewMat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewMat.cpp' object='libISSM_a-NewMat.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NewMat.obj `if test -f './toolkits/petsc/patches/NewMat.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewMat.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewMat.cpp'; fi`
+
+libISSM_a-VecFree.o: ./toolkits/petsc/patches/VecFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecFree.o -MD -MP -MF $(DEPDIR)/libISSM_a-VecFree.Tpo -c -o libISSM_a-VecFree.o `test -f './toolkits/petsc/patches/VecFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecFree.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecFree.Tpo $(DEPDIR)/libISSM_a-VecFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecFree.cpp' object='libISSM_a-VecFree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecFree.o `test -f './toolkits/petsc/patches/VecFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecFree.cpp
+
+libISSM_a-VecFree.obj: ./toolkits/petsc/patches/VecFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecFree.obj -MD -MP -MF $(DEPDIR)/libISSM_a-VecFree.Tpo -c -o libISSM_a-VecFree.obj `if test -f './toolkits/petsc/patches/VecFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecFree.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecFree.Tpo $(DEPDIR)/libISSM_a-VecFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecFree.cpp' object='libISSM_a-VecFree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecFree.obj `if test -f './toolkits/petsc/patches/VecFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecFree.cpp'; fi`
+
+libISSM_a-KSPFree.o: ./toolkits/petsc/patches/KSPFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-KSPFree.o -MD -MP -MF $(DEPDIR)/libISSM_a-KSPFree.Tpo -c -o libISSM_a-KSPFree.o `test -f './toolkits/petsc/patches/KSPFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/KSPFree.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-KSPFree.Tpo $(DEPDIR)/libISSM_a-KSPFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/KSPFree.cpp' object='libISSM_a-KSPFree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-KSPFree.o `test -f './toolkits/petsc/patches/KSPFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/KSPFree.cpp
+
+libISSM_a-KSPFree.obj: ./toolkits/petsc/patches/KSPFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-KSPFree.obj -MD -MP -MF $(DEPDIR)/libISSM_a-KSPFree.Tpo -c -o libISSM_a-KSPFree.obj `if test -f './toolkits/petsc/patches/KSPFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/KSPFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/KSPFree.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-KSPFree.Tpo $(DEPDIR)/libISSM_a-KSPFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/KSPFree.cpp' object='libISSM_a-KSPFree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-KSPFree.obj `if test -f './toolkits/petsc/patches/KSPFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/KSPFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/KSPFree.cpp'; fi`
+
+libISSM_a-ISFree.o: ./toolkits/petsc/patches/ISFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ISFree.o -MD -MP -MF $(DEPDIR)/libISSM_a-ISFree.Tpo -c -o libISSM_a-ISFree.o `test -f './toolkits/petsc/patches/ISFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/ISFree.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ISFree.Tpo $(DEPDIR)/libISSM_a-ISFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/ISFree.cpp' object='libISSM_a-ISFree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ISFree.o `test -f './toolkits/petsc/patches/ISFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/ISFree.cpp
+
+libISSM_a-ISFree.obj: ./toolkits/petsc/patches/ISFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ISFree.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ISFree.Tpo -c -o libISSM_a-ISFree.obj `if test -f './toolkits/petsc/patches/ISFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/ISFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/ISFree.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ISFree.Tpo $(DEPDIR)/libISSM_a-ISFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/ISFree.cpp' object='libISSM_a-ISFree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ISFree.obj `if test -f './toolkits/petsc/patches/ISFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/ISFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/ISFree.cpp'; fi`
+
+libISSM_a-MatFree.o: ./toolkits/petsc/patches/MatFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatFree.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatFree.Tpo -c -o libISSM_a-MatFree.o `test -f './toolkits/petsc/patches/MatFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatFree.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatFree.Tpo $(DEPDIR)/libISSM_a-MatFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatFree.cpp' object='libISSM_a-MatFree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatFree.o `test -f './toolkits/petsc/patches/MatFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatFree.cpp
+
+libISSM_a-MatFree.obj: ./toolkits/petsc/patches/MatFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatFree.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatFree.Tpo -c -o libISSM_a-MatFree.obj `if test -f './toolkits/petsc/patches/MatFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatFree.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatFree.Tpo $(DEPDIR)/libISSM_a-MatFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatFree.cpp' object='libISSM_a-MatFree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatFree.obj `if test -f './toolkits/petsc/patches/MatFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatFree.cpp'; fi`
+
+libISSM_a-GetOwnershipBoundariesFromRange.o: ./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-GetOwnershipBoundariesFromRange.o -MD -MP -MF $(DEPDIR)/libISSM_a-GetOwnershipBoundariesFromRange.Tpo -c -o libISSM_a-GetOwnershipBoundariesFromRange.o `test -f './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-GetOwnershipBoundariesFromRange.Tpo $(DEPDIR)/libISSM_a-GetOwnershipBoundariesFromRange.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp' object='libISSM_a-GetOwnershipBoundariesFromRange.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-GetOwnershipBoundariesFromRange.o `test -f './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
+
+libISSM_a-GetOwnershipBoundariesFromRange.obj: ./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-GetOwnershipBoundariesFromRange.obj -MD -MP -MF $(DEPDIR)/libISSM_a-GetOwnershipBoundariesFromRange.Tpo -c -o libISSM_a-GetOwnershipBoundariesFromRange.obj `if test -f './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-GetOwnershipBoundariesFromRange.Tpo $(DEPDIR)/libISSM_a-GetOwnershipBoundariesFromRange.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp' object='libISSM_a-GetOwnershipBoundariesFromRange.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-GetOwnershipBoundariesFromRange.obj `if test -f './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; fi`
+
+libISSM_a-VecPartition.o: ./toolkits/petsc/patches/VecPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecPartition.o -MD -MP -MF $(DEPDIR)/libISSM_a-VecPartition.Tpo -c -o libISSM_a-VecPartition.o `test -f './toolkits/petsc/patches/VecPartition.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecPartition.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecPartition.Tpo $(DEPDIR)/libISSM_a-VecPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecPartition.cpp' object='libISSM_a-VecPartition.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecPartition.o `test -f './toolkits/petsc/patches/VecPartition.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecPartition.cpp
+
+libISSM_a-VecPartition.obj: ./toolkits/petsc/patches/VecPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-VecPartition.obj -MD -MP -MF $(DEPDIR)/libISSM_a-VecPartition.Tpo -c -o libISSM_a-VecPartition.obj `if test -f './toolkits/petsc/patches/VecPartition.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecPartition.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-VecPartition.Tpo $(DEPDIR)/libISSM_a-VecPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecPartition.cpp' object='libISSM_a-VecPartition.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-VecPartition.obj `if test -f './toolkits/petsc/patches/VecPartition.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecPartition.cpp'; fi`
+
+libISSM_a-MatPartition.o: ./toolkits/petsc/patches/MatPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatPartition.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatPartition.Tpo -c -o libISSM_a-MatPartition.o `test -f './toolkits/petsc/patches/MatPartition.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatPartition.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatPartition.Tpo $(DEPDIR)/libISSM_a-MatPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatPartition.cpp' object='libISSM_a-MatPartition.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatPartition.o `test -f './toolkits/petsc/patches/MatPartition.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatPartition.cpp
+
+libISSM_a-MatPartition.obj: ./toolkits/petsc/patches/MatPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatPartition.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatPartition.Tpo -c -o libISSM_a-MatPartition.obj `if test -f './toolkits/petsc/patches/MatPartition.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatPartition.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatPartition.Tpo $(DEPDIR)/libISSM_a-MatPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatPartition.cpp' object='libISSM_a-MatPartition.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatPartition.obj `if test -f './toolkits/petsc/patches/MatPartition.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatPartition.cpp'; fi`
+
+libISSM_a-MatInvert.o: ./toolkits/petsc/patches/MatInvert.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatInvert.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatInvert.Tpo -c -o libISSM_a-MatInvert.o `test -f './toolkits/petsc/patches/MatInvert.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatInvert.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatInvert.Tpo $(DEPDIR)/libISSM_a-MatInvert.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatInvert.cpp' object='libISSM_a-MatInvert.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatInvert.o `test -f './toolkits/petsc/patches/MatInvert.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatInvert.cpp
+
+libISSM_a-MatInvert.obj: ./toolkits/petsc/patches/MatInvert.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatInvert.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatInvert.Tpo -c -o libISSM_a-MatInvert.obj `if test -f './toolkits/petsc/patches/MatInvert.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatInvert.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatInvert.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatInvert.Tpo $(DEPDIR)/libISSM_a-MatInvert.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatInvert.cpp' object='libISSM_a-MatInvert.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatInvert.obj `if test -f './toolkits/petsc/patches/MatInvert.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatInvert.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatInvert.cpp'; fi`
+
+libISSM_a-MatMultPatch.o: ./toolkits/petsc/patches/MatMultPatch.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatMultPatch.o -MD -MP -MF $(DEPDIR)/libISSM_a-MatMultPatch.Tpo -c -o libISSM_a-MatMultPatch.o `test -f './toolkits/petsc/patches/MatMultPatch.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatMultPatch.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatMultPatch.Tpo $(DEPDIR)/libISSM_a-MatMultPatch.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatMultPatch.cpp' object='libISSM_a-MatMultPatch.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatMultPatch.o `test -f './toolkits/petsc/patches/MatMultPatch.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatMultPatch.cpp
+
+libISSM_a-MatMultPatch.obj: ./toolkits/petsc/patches/MatMultPatch.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MatMultPatch.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MatMultPatch.Tpo -c -o libISSM_a-MatMultPatch.obj `if test -f './toolkits/petsc/patches/MatMultPatch.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatMultPatch.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatMultPatch.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MatMultPatch.Tpo $(DEPDIR)/libISSM_a-MatMultPatch.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatMultPatch.cpp' object='libISSM_a-MatMultPatch.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MatMultPatch.obj `if test -f './toolkits/petsc/patches/MatMultPatch.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatMultPatch.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatMultPatch.cpp'; fi`
+
+libISSM_a-MPI_Upperrow.o: ./toolkits/mpi/patches/MPI_Upperrow.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MPI_Upperrow.o -MD -MP -MF $(DEPDIR)/libISSM_a-MPI_Upperrow.Tpo -c -o libISSM_a-MPI_Upperrow.o `test -f './toolkits/mpi/patches/MPI_Upperrow.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Upperrow.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MPI_Upperrow.Tpo $(DEPDIR)/libISSM_a-MPI_Upperrow.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Upperrow.cpp' object='libISSM_a-MPI_Upperrow.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MPI_Upperrow.o `test -f './toolkits/mpi/patches/MPI_Upperrow.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Upperrow.cpp
+
+libISSM_a-MPI_Upperrow.obj: ./toolkits/mpi/patches/MPI_Upperrow.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MPI_Upperrow.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MPI_Upperrow.Tpo -c -o libISSM_a-MPI_Upperrow.obj `if test -f './toolkits/mpi/patches/MPI_Upperrow.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Upperrow.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Upperrow.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MPI_Upperrow.Tpo $(DEPDIR)/libISSM_a-MPI_Upperrow.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Upperrow.cpp' object='libISSM_a-MPI_Upperrow.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MPI_Upperrow.obj `if test -f './toolkits/mpi/patches/MPI_Upperrow.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Upperrow.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Upperrow.cpp'; fi`
+
+libISSM_a-MPI_Lowerrow.o: ./toolkits/mpi/patches/MPI_Lowerrow.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MPI_Lowerrow.o -MD -MP -MF $(DEPDIR)/libISSM_a-MPI_Lowerrow.Tpo -c -o libISSM_a-MPI_Lowerrow.o `test -f './toolkits/mpi/patches/MPI_Lowerrow.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Lowerrow.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MPI_Lowerrow.Tpo $(DEPDIR)/libISSM_a-MPI_Lowerrow.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Lowerrow.cpp' object='libISSM_a-MPI_Lowerrow.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MPI_Lowerrow.o `test -f './toolkits/mpi/patches/MPI_Lowerrow.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Lowerrow.cpp
+
+libISSM_a-MPI_Lowerrow.obj: ./toolkits/mpi/patches/MPI_Lowerrow.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MPI_Lowerrow.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MPI_Lowerrow.Tpo -c -o libISSM_a-MPI_Lowerrow.obj `if test -f './toolkits/mpi/patches/MPI_Lowerrow.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Lowerrow.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Lowerrow.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MPI_Lowerrow.Tpo $(DEPDIR)/libISSM_a-MPI_Lowerrow.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Lowerrow.cpp' object='libISSM_a-MPI_Lowerrow.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MPI_Lowerrow.obj `if test -f './toolkits/mpi/patches/MPI_Lowerrow.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Lowerrow.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Lowerrow.cpp'; fi`
+
+libISSM_a-MPI_Boundariesfromrange.o: ./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MPI_Boundariesfromrange.o -MD -MP -MF $(DEPDIR)/libISSM_a-MPI_Boundariesfromrange.Tpo -c -o libISSM_a-MPI_Boundariesfromrange.o `test -f './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MPI_Boundariesfromrange.Tpo $(DEPDIR)/libISSM_a-MPI_Boundariesfromrange.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp' object='libISSM_a-MPI_Boundariesfromrange.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MPI_Boundariesfromrange.o `test -f './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
+
+libISSM_a-MPI_Boundariesfromrange.obj: ./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MPI_Boundariesfromrange.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MPI_Boundariesfromrange.Tpo -c -o libISSM_a-MPI_Boundariesfromrange.obj `if test -f './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MPI_Boundariesfromrange.Tpo $(DEPDIR)/libISSM_a-MPI_Boundariesfromrange.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp' object='libISSM_a-MPI_Boundariesfromrange.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MPI_Boundariesfromrange.obj `if test -f './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; fi`
+
+libISSM_a-FetchData.o: ./io/FetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-FetchData.o -MD -MP -MF $(DEPDIR)/libISSM_a-FetchData.Tpo -c -o libISSM_a-FetchData.o `test -f './io/FetchData.cpp' || echo '$(srcdir)/'`./io/FetchData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-FetchData.Tpo $(DEPDIR)/libISSM_a-FetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/FetchData.cpp' object='libISSM_a-FetchData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-FetchData.o `test -f './io/FetchData.cpp' || echo '$(srcdir)/'`./io/FetchData.cpp
+
+libISSM_a-FetchData.obj: ./io/FetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-FetchData.obj -MD -MP -MF $(DEPDIR)/libISSM_a-FetchData.Tpo -c -o libISSM_a-FetchData.obj `if test -f './io/FetchData.cpp'; then $(CYGPATH_W) './io/FetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/FetchData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-FetchData.Tpo $(DEPDIR)/libISSM_a-FetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/FetchData.cpp' object='libISSM_a-FetchData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-FetchData.obj `if test -f './io/FetchData.cpp'; then $(CYGPATH_W) './io/FetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/FetchData.cpp'; fi`
+
+libISSM_a-WriteData.o: ./io/WriteData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-WriteData.o -MD -MP -MF $(DEPDIR)/libISSM_a-WriteData.Tpo -c -o libISSM_a-WriteData.o `test -f './io/WriteData.cpp' || echo '$(srcdir)/'`./io/WriteData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-WriteData.Tpo $(DEPDIR)/libISSM_a-WriteData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteData.cpp' object='libISSM_a-WriteData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-WriteData.o `test -f './io/WriteData.cpp' || echo '$(srcdir)/'`./io/WriteData.cpp
+
+libISSM_a-WriteData.obj: ./io/WriteData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-WriteData.obj -MD -MP -MF $(DEPDIR)/libISSM_a-WriteData.Tpo -c -o libISSM_a-WriteData.obj `if test -f './io/WriteData.cpp'; then $(CYGPATH_W) './io/WriteData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-WriteData.Tpo $(DEPDIR)/libISSM_a-WriteData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteData.cpp' object='libISSM_a-WriteData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-WriteData.obj `if test -f './io/WriteData.cpp'; then $(CYGPATH_W) './io/WriteData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteData.cpp'; fi`
+
+libISSM_a-WriteDataToDisk.o: ./io/WriteDataToDisk.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-WriteDataToDisk.o -MD -MP -MF $(DEPDIR)/libISSM_a-WriteDataToDisk.Tpo -c -o libISSM_a-WriteDataToDisk.o `test -f './io/WriteDataToDisk.cpp' || echo '$(srcdir)/'`./io/WriteDataToDisk.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-WriteDataToDisk.Tpo $(DEPDIR)/libISSM_a-WriteDataToDisk.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteDataToDisk.cpp' object='libISSM_a-WriteDataToDisk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-WriteDataToDisk.o `test -f './io/WriteDataToDisk.cpp' || echo '$(srcdir)/'`./io/WriteDataToDisk.cpp
+
+libISSM_a-WriteDataToDisk.obj: ./io/WriteDataToDisk.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-WriteDataToDisk.obj -MD -MP -MF $(DEPDIR)/libISSM_a-WriteDataToDisk.Tpo -c -o libISSM_a-WriteDataToDisk.obj `if test -f './io/WriteDataToDisk.cpp'; then $(CYGPATH_W) './io/WriteDataToDisk.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteDataToDisk.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-WriteDataToDisk.Tpo $(DEPDIR)/libISSM_a-WriteDataToDisk.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteDataToDisk.cpp' object='libISSM_a-WriteDataToDisk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-WriteDataToDisk.obj `if test -f './io/WriteDataToDisk.cpp'; then $(CYGPATH_W) './io/WriteDataToDisk.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteDataToDisk.cpp'; fi`
+
+libISSM_a-SerialFetchData.o: ./io/SerialFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SerialFetchData.o -MD -MP -MF $(DEPDIR)/libISSM_a-SerialFetchData.Tpo -c -o libISSM_a-SerialFetchData.o `test -f './io/SerialFetchData.cpp' || echo '$(srcdir)/'`./io/SerialFetchData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SerialFetchData.Tpo $(DEPDIR)/libISSM_a-SerialFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/SerialFetchData.cpp' object='libISSM_a-SerialFetchData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SerialFetchData.o `test -f './io/SerialFetchData.cpp' || echo '$(srcdir)/'`./io/SerialFetchData.cpp
+
+libISSM_a-SerialFetchData.obj: ./io/SerialFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SerialFetchData.obj -MD -MP -MF $(DEPDIR)/libISSM_a-SerialFetchData.Tpo -c -o libISSM_a-SerialFetchData.obj `if test -f './io/SerialFetchData.cpp'; then $(CYGPATH_W) './io/SerialFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/SerialFetchData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SerialFetchData.Tpo $(DEPDIR)/libISSM_a-SerialFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/SerialFetchData.cpp' object='libISSM_a-SerialFetchData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SerialFetchData.obj `if test -f './io/SerialFetchData.cpp'; then $(CYGPATH_W) './io/SerialFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/SerialFetchData.cpp'; fi`
+
+libISSM_a-SerialWriteData.o: ./io/SerialWriteData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SerialWriteData.o -MD -MP -MF $(DEPDIR)/libISSM_a-SerialWriteData.Tpo -c -o libISSM_a-SerialWriteData.o `test -f './io/SerialWriteData.cpp' || echo '$(srcdir)/'`./io/SerialWriteData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SerialWriteData.Tpo $(DEPDIR)/libISSM_a-SerialWriteData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/SerialWriteData.cpp' object='libISSM_a-SerialWriteData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SerialWriteData.o `test -f './io/SerialWriteData.cpp' || echo '$(srcdir)/'`./io/SerialWriteData.cpp
+
+libISSM_a-SerialWriteData.obj: ./io/SerialWriteData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SerialWriteData.obj -MD -MP -MF $(DEPDIR)/libISSM_a-SerialWriteData.Tpo -c -o libISSM_a-SerialWriteData.obj `if test -f './io/SerialWriteData.cpp'; then $(CYGPATH_W) './io/SerialWriteData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/SerialWriteData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SerialWriteData.Tpo $(DEPDIR)/libISSM_a-SerialWriteData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/SerialWriteData.cpp' object='libISSM_a-SerialWriteData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SerialWriteData.obj `if test -f './io/SerialWriteData.cpp'; then $(CYGPATH_W) './io/SerialWriteData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/SerialWriteData.cpp'; fi`
+
+libISSM_a-ParallelFetchData.o: ./io/ParallelFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchData.o -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchData.Tpo -c -o libISSM_a-ParallelFetchData.o `test -f './io/ParallelFetchData.cpp' || echo '$(srcdir)/'`./io/ParallelFetchData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchData.Tpo $(DEPDIR)/libISSM_a-ParallelFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchData.cpp' object='libISSM_a-ParallelFetchData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchData.o `test -f './io/ParallelFetchData.cpp' || echo '$(srcdir)/'`./io/ParallelFetchData.cpp
+
+libISSM_a-ParallelFetchData.obj: ./io/ParallelFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchData.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchData.Tpo -c -o libISSM_a-ParallelFetchData.obj `if test -f './io/ParallelFetchData.cpp'; then $(CYGPATH_W) './io/ParallelFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchData.Tpo $(DEPDIR)/libISSM_a-ParallelFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchData.cpp' object='libISSM_a-ParallelFetchData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchData.obj `if test -f './io/ParallelFetchData.cpp'; then $(CYGPATH_W) './io/ParallelFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchData.cpp'; fi`
+
+libISSM_a-ParallelFetchInteger.o: ./io/ParallelFetchInteger.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchInteger.o -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchInteger.Tpo -c -o libISSM_a-ParallelFetchInteger.o `test -f './io/ParallelFetchInteger.cpp' || echo '$(srcdir)/'`./io/ParallelFetchInteger.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchInteger.Tpo $(DEPDIR)/libISSM_a-ParallelFetchInteger.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchInteger.cpp' object='libISSM_a-ParallelFetchInteger.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchInteger.o `test -f './io/ParallelFetchInteger.cpp' || echo '$(srcdir)/'`./io/ParallelFetchInteger.cpp
+
+libISSM_a-ParallelFetchInteger.obj: ./io/ParallelFetchInteger.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchInteger.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchInteger.Tpo -c -o libISSM_a-ParallelFetchInteger.obj `if test -f './io/ParallelFetchInteger.cpp'; then $(CYGPATH_W) './io/ParallelFetchInteger.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchInteger.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchInteger.Tpo $(DEPDIR)/libISSM_a-ParallelFetchInteger.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchInteger.cpp' object='libISSM_a-ParallelFetchInteger.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchInteger.obj `if test -f './io/ParallelFetchInteger.cpp'; then $(CYGPATH_W) './io/ParallelFetchInteger.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchInteger.cpp'; fi`
+
+libISSM_a-ParallelFetchMat.o: ./io/ParallelFetchMat.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchMat.o -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchMat.Tpo -c -o libISSM_a-ParallelFetchMat.o `test -f './io/ParallelFetchMat.cpp' || echo '$(srcdir)/'`./io/ParallelFetchMat.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchMat.Tpo $(DEPDIR)/libISSM_a-ParallelFetchMat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchMat.cpp' object='libISSM_a-ParallelFetchMat.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchMat.o `test -f './io/ParallelFetchMat.cpp' || echo '$(srcdir)/'`./io/ParallelFetchMat.cpp
+
+libISSM_a-ParallelFetchMat.obj: ./io/ParallelFetchMat.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchMat.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchMat.Tpo -c -o libISSM_a-ParallelFetchMat.obj `if test -f './io/ParallelFetchMat.cpp'; then $(CYGPATH_W) './io/ParallelFetchMat.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchMat.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchMat.Tpo $(DEPDIR)/libISSM_a-ParallelFetchMat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchMat.cpp' object='libISSM_a-ParallelFetchMat.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchMat.obj `if test -f './io/ParallelFetchMat.cpp'; then $(CYGPATH_W) './io/ParallelFetchMat.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchMat.cpp'; fi`
+
+libISSM_a-ParallelFetchScalar.o: ./io/ParallelFetchScalar.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchScalar.o -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchScalar.Tpo -c -o libISSM_a-ParallelFetchScalar.o `test -f './io/ParallelFetchScalar.cpp' || echo '$(srcdir)/'`./io/ParallelFetchScalar.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchScalar.Tpo $(DEPDIR)/libISSM_a-ParallelFetchScalar.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchScalar.cpp' object='libISSM_a-ParallelFetchScalar.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchScalar.o `test -f './io/ParallelFetchScalar.cpp' || echo '$(srcdir)/'`./io/ParallelFetchScalar.cpp
+
+libISSM_a-ParallelFetchScalar.obj: ./io/ParallelFetchScalar.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchScalar.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchScalar.Tpo -c -o libISSM_a-ParallelFetchScalar.obj `if test -f './io/ParallelFetchScalar.cpp'; then $(CYGPATH_W) './io/ParallelFetchScalar.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchScalar.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchScalar.Tpo $(DEPDIR)/libISSM_a-ParallelFetchScalar.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchScalar.cpp' object='libISSM_a-ParallelFetchScalar.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchScalar.obj `if test -f './io/ParallelFetchScalar.cpp'; then $(CYGPATH_W) './io/ParallelFetchScalar.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchScalar.cpp'; fi`
+
+libISSM_a-ParallelFetchString.o: ./io/ParallelFetchString.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchString.o -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchString.Tpo -c -o libISSM_a-ParallelFetchString.o `test -f './io/ParallelFetchString.cpp' || echo '$(srcdir)/'`./io/ParallelFetchString.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchString.Tpo $(DEPDIR)/libISSM_a-ParallelFetchString.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchString.cpp' object='libISSM_a-ParallelFetchString.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchString.o `test -f './io/ParallelFetchString.cpp' || echo '$(srcdir)/'`./io/ParallelFetchString.cpp
+
+libISSM_a-ParallelFetchString.obj: ./io/ParallelFetchString.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParallelFetchString.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ParallelFetchString.Tpo -c -o libISSM_a-ParallelFetchString.obj `if test -f './io/ParallelFetchString.cpp'; then $(CYGPATH_W) './io/ParallelFetchString.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchString.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParallelFetchString.Tpo $(DEPDIR)/libISSM_a-ParallelFetchString.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchString.cpp' object='libISSM_a-ParallelFetchString.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParallelFetchString.obj `if test -f './io/ParallelFetchString.cpp'; then $(CYGPATH_W) './io/ParallelFetchString.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchString.cpp'; fi`
+
+libISSM_a-ModelFetchData.o: ./io/ModelFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ModelFetchData.o -MD -MP -MF $(DEPDIR)/libISSM_a-ModelFetchData.Tpo -c -o libISSM_a-ModelFetchData.o `test -f './io/ModelFetchData.cpp' || echo '$(srcdir)/'`./io/ModelFetchData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ModelFetchData.Tpo $(DEPDIR)/libISSM_a-ModelFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ModelFetchData.cpp' object='libISSM_a-ModelFetchData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ModelFetchData.o `test -f './io/ModelFetchData.cpp' || echo '$(srcdir)/'`./io/ModelFetchData.cpp
+
+libISSM_a-ModelFetchData.obj: ./io/ModelFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ModelFetchData.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ModelFetchData.Tpo -c -o libISSM_a-ModelFetchData.obj `if test -f './io/ModelFetchData.cpp'; then $(CYGPATH_W) './io/ModelFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ModelFetchData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ModelFetchData.Tpo $(DEPDIR)/libISSM_a-ModelFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ModelFetchData.cpp' object='libISSM_a-ModelFetchData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ModelFetchData.obj `if test -f './io/ModelFetchData.cpp'; then $(CYGPATH_W) './io/ModelFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ModelFetchData.cpp'; fi`
+
+libISSM_a-WriteNodeSets.o: ./io/WriteNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-WriteNodeSets.o -MD -MP -MF $(DEPDIR)/libISSM_a-WriteNodeSets.Tpo -c -o libISSM_a-WriteNodeSets.o `test -f './io/WriteNodeSets.cpp' || echo '$(srcdir)/'`./io/WriteNodeSets.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-WriteNodeSets.Tpo $(DEPDIR)/libISSM_a-WriteNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteNodeSets.cpp' object='libISSM_a-WriteNodeSets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-WriteNodeSets.o `test -f './io/WriteNodeSets.cpp' || echo '$(srcdir)/'`./io/WriteNodeSets.cpp
+
+libISSM_a-WriteNodeSets.obj: ./io/WriteNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-WriteNodeSets.obj -MD -MP -MF $(DEPDIR)/libISSM_a-WriteNodeSets.Tpo -c -o libISSM_a-WriteNodeSets.obj `if test -f './io/WriteNodeSets.cpp'; then $(CYGPATH_W) './io/WriteNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteNodeSets.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-WriteNodeSets.Tpo $(DEPDIR)/libISSM_a-WriteNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteNodeSets.cpp' object='libISSM_a-WriteNodeSets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-WriteNodeSets.obj `if test -f './io/WriteNodeSets.cpp'; then $(CYGPATH_W) './io/WriteNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteNodeSets.cpp'; fi`
+
+libISSM_a-WriteParams.o: ./io/WriteParams.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-WriteParams.o -MD -MP -MF $(DEPDIR)/libISSM_a-WriteParams.Tpo -c -o libISSM_a-WriteParams.o `test -f './io/WriteParams.cpp' || echo '$(srcdir)/'`./io/WriteParams.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-WriteParams.Tpo $(DEPDIR)/libISSM_a-WriteParams.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteParams.cpp' object='libISSM_a-WriteParams.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-WriteParams.o `test -f './io/WriteParams.cpp' || echo '$(srcdir)/'`./io/WriteParams.cpp
+
+libISSM_a-WriteParams.obj: ./io/WriteParams.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-WriteParams.obj -MD -MP -MF $(DEPDIR)/libISSM_a-WriteParams.Tpo -c -o libISSM_a-WriteParams.obj `if test -f './io/WriteParams.cpp'; then $(CYGPATH_W) './io/WriteParams.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteParams.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-WriteParams.Tpo $(DEPDIR)/libISSM_a-WriteParams.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteParams.cpp' object='libISSM_a-WriteParams.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-WriteParams.obj `if test -f './io/WriteParams.cpp'; then $(CYGPATH_W) './io/WriteParams.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteParams.cpp'; fi`
+
+libISSM_a-FetchNodeSets.o: ./io/FetchNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-FetchNodeSets.o -MD -MP -MF $(DEPDIR)/libISSM_a-FetchNodeSets.Tpo -c -o libISSM_a-FetchNodeSets.o `test -f './io/FetchNodeSets.cpp' || echo '$(srcdir)/'`./io/FetchNodeSets.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-FetchNodeSets.Tpo $(DEPDIR)/libISSM_a-FetchNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/FetchNodeSets.cpp' object='libISSM_a-FetchNodeSets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-FetchNodeSets.o `test -f './io/FetchNodeSets.cpp' || echo '$(srcdir)/'`./io/FetchNodeSets.cpp
+
+libISSM_a-FetchNodeSets.obj: ./io/FetchNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-FetchNodeSets.obj -MD -MP -MF $(DEPDIR)/libISSM_a-FetchNodeSets.Tpo -c -o libISSM_a-FetchNodeSets.obj `if test -f './io/FetchNodeSets.cpp'; then $(CYGPATH_W) './io/FetchNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/FetchNodeSets.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-FetchNodeSets.Tpo $(DEPDIR)/libISSM_a-FetchNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/FetchNodeSets.cpp' object='libISSM_a-FetchNodeSets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-FetchNodeSets.obj `if test -f './io/FetchNodeSets.cpp'; then $(CYGPATH_W) './io/FetchNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/FetchNodeSets.cpp'; fi`
+
+libISSM_a-ParameterInputsInit.o: ./io/ParameterInputsInit.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParameterInputsInit.o -MD -MP -MF $(DEPDIR)/libISSM_a-ParameterInputsInit.Tpo -c -o libISSM_a-ParameterInputsInit.o `test -f './io/ParameterInputsInit.cpp' || echo '$(srcdir)/'`./io/ParameterInputsInit.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParameterInputsInit.Tpo $(DEPDIR)/libISSM_a-ParameterInputsInit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParameterInputsInit.cpp' object='libISSM_a-ParameterInputsInit.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParameterInputsInit.o `test -f './io/ParameterInputsInit.cpp' || echo '$(srcdir)/'`./io/ParameterInputsInit.cpp
+
+libISSM_a-ParameterInputsInit.obj: ./io/ParameterInputsInit.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ParameterInputsInit.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ParameterInputsInit.Tpo -c -o libISSM_a-ParameterInputsInit.obj `if test -f './io/ParameterInputsInit.cpp'; then $(CYGPATH_W) './io/ParameterInputsInit.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParameterInputsInit.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ParameterInputsInit.Tpo $(DEPDIR)/libISSM_a-ParameterInputsInit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParameterInputsInit.cpp' object='libISSM_a-ParameterInputsInit.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ParameterInputsInit.obj `if test -f './io/ParameterInputsInit.cpp'; then $(CYGPATH_W) './io/ParameterInputsInit.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParameterInputsInit.cpp'; fi`
+
+libISSM_a-EnumDefinitions.o: ./EnumDefinitions/EnumDefinitions.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-EnumDefinitions.o -MD -MP -MF $(DEPDIR)/libISSM_a-EnumDefinitions.Tpo -c -o libISSM_a-EnumDefinitions.o `test -f './EnumDefinitions/EnumDefinitions.cpp' || echo '$(srcdir)/'`./EnumDefinitions/EnumDefinitions.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-EnumDefinitions.Tpo $(DEPDIR)/libISSM_a-EnumDefinitions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./EnumDefinitions/EnumDefinitions.cpp' object='libISSM_a-EnumDefinitions.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-EnumDefinitions.o `test -f './EnumDefinitions/EnumDefinitions.cpp' || echo '$(srcdir)/'`./EnumDefinitions/EnumDefinitions.cpp
+
+libISSM_a-EnumDefinitions.obj: ./EnumDefinitions/EnumDefinitions.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-EnumDefinitions.obj -MD -MP -MF $(DEPDIR)/libISSM_a-EnumDefinitions.Tpo -c -o libISSM_a-EnumDefinitions.obj `if test -f './EnumDefinitions/EnumDefinitions.cpp'; then $(CYGPATH_W) './EnumDefinitions/EnumDefinitions.cpp'; else $(CYGPATH_W) '$(srcdir)/./EnumDefinitions/EnumDefinitions.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-EnumDefinitions.Tpo $(DEPDIR)/libISSM_a-EnumDefinitions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./EnumDefinitions/EnumDefinitions.cpp' object='libISSM_a-EnumDefinitions.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-EnumDefinitions.obj `if test -f './EnumDefinitions/EnumDefinitions.cpp'; then $(CYGPATH_W) './EnumDefinitions/EnumDefinitions.cpp'; else $(CYGPATH_W) '$(srcdir)/./EnumDefinitions/EnumDefinitions.cpp'; fi`
+
+libISSM_a-AnalysisTypeAsEnum.o: ./EnumDefinitions/AnalysisTypeAsEnum.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-AnalysisTypeAsEnum.o -MD -MP -MF $(DEPDIR)/libISSM_a-AnalysisTypeAsEnum.Tpo -c -o libISSM_a-AnalysisTypeAsEnum.o `test -f './EnumDefinitions/AnalysisTypeAsEnum.cpp' || echo '$(srcdir)/'`./EnumDefinitions/AnalysisTypeAsEnum.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-AnalysisTypeAsEnum.Tpo $(DEPDIR)/libISSM_a-AnalysisTypeAsEnum.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./EnumDefinitions/AnalysisTypeAsEnum.cpp' object='libISSM_a-AnalysisTypeAsEnum.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-AnalysisTypeAsEnum.o `test -f './EnumDefinitions/AnalysisTypeAsEnum.cpp' || echo '$(srcdir)/'`./EnumDefinitions/AnalysisTypeAsEnum.cpp
+
+libISSM_a-AnalysisTypeAsEnum.obj: ./EnumDefinitions/AnalysisTypeAsEnum.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-AnalysisTypeAsEnum.obj -MD -MP -MF $(DEPDIR)/libISSM_a-AnalysisTypeAsEnum.Tpo -c -o libISSM_a-AnalysisTypeAsEnum.obj `if test -f './EnumDefinitions/AnalysisTypeAsEnum.cpp'; then $(CYGPATH_W) './EnumDefinitions/AnalysisTypeAsEnum.cpp'; else $(CYGPATH_W) '$(srcdir)/./EnumDefinitions/AnalysisTypeAsEnum.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-AnalysisTypeAsEnum.Tpo $(DEPDIR)/libISSM_a-AnalysisTypeAsEnum.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./EnumDefinitions/AnalysisTypeAsEnum.cpp' object='libISSM_a-AnalysisTypeAsEnum.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-AnalysisTypeAsEnum.obj `if test -f './EnumDefinitions/AnalysisTypeAsEnum.cpp'; then $(CYGPATH_W) './EnumDefinitions/AnalysisTypeAsEnum.cpp'; else $(CYGPATH_W) '$(srcdir)/./EnumDefinitions/AnalysisTypeAsEnum.cpp'; fi`
+
+libISSM_a-Model.o: ./ModelProcessorx/Model.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Model.o -MD -MP -MF $(DEPDIR)/libISSM_a-Model.Tpo -c -o libISSM_a-Model.o `test -f './ModelProcessorx/Model.cpp' || echo '$(srcdir)/'`./ModelProcessorx/Model.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Model.Tpo $(DEPDIR)/libISSM_a-Model.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/Model.cpp' object='libISSM_a-Model.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Model.o `test -f './ModelProcessorx/Model.cpp' || echo '$(srcdir)/'`./ModelProcessorx/Model.cpp
+
+libISSM_a-Model.obj: ./ModelProcessorx/Model.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Model.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Model.Tpo -c -o libISSM_a-Model.obj `if test -f './ModelProcessorx/Model.cpp'; then $(CYGPATH_W) './ModelProcessorx/Model.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/Model.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Model.Tpo $(DEPDIR)/libISSM_a-Model.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/Model.cpp' object='libISSM_a-Model.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Model.obj `if test -f './ModelProcessorx/Model.cpp'; then $(CYGPATH_W) './ModelProcessorx/Model.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/Model.cpp'; fi`
+
+libISSM_a-FetchRifts.o: ./ModelProcessorx/FetchRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-FetchRifts.o -MD -MP -MF $(DEPDIR)/libISSM_a-FetchRifts.Tpo -c -o libISSM_a-FetchRifts.o `test -f './ModelProcessorx/FetchRifts.cpp' || echo '$(srcdir)/'`./ModelProcessorx/FetchRifts.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-FetchRifts.Tpo $(DEPDIR)/libISSM_a-FetchRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/FetchRifts.cpp' object='libISSM_a-FetchRifts.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-FetchRifts.o `test -f './ModelProcessorx/FetchRifts.cpp' || echo '$(srcdir)/'`./ModelProcessorx/FetchRifts.cpp
+
+libISSM_a-FetchRifts.obj: ./ModelProcessorx/FetchRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-FetchRifts.obj -MD -MP -MF $(DEPDIR)/libISSM_a-FetchRifts.Tpo -c -o libISSM_a-FetchRifts.obj `if test -f './ModelProcessorx/FetchRifts.cpp'; then $(CYGPATH_W) './ModelProcessorx/FetchRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/FetchRifts.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-FetchRifts.Tpo $(DEPDIR)/libISSM_a-FetchRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/FetchRifts.cpp' object='libISSM_a-FetchRifts.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-FetchRifts.obj `if test -f './ModelProcessorx/FetchRifts.cpp'; then $(CYGPATH_W) './ModelProcessorx/FetchRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/FetchRifts.cpp'; fi`
+
+libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o: ./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o -MD -MP -MF $(DEPDIR)/libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Tpo -c -o libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Tpo $(DEPDIR)/libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp' object='libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
+
+libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj: ./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj -MD -MP -MF $(DEPDIR)/libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Tpo -c -o libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Tpo $(DEPDIR)/libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp' object='libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; fi`
+
+libISSM_a-DistributeNumDofs.o: ./ModelProcessorx/DistributeNumDofs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-DistributeNumDofs.o -MD -MP -MF $(DEPDIR)/libISSM_a-DistributeNumDofs.Tpo -c -o libISSM_a-DistributeNumDofs.o `test -f './ModelProcessorx/DistributeNumDofs.cpp' || echo '$(srcdir)/'`./ModelProcessorx/DistributeNumDofs.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-DistributeNumDofs.Tpo $(DEPDIR)/libISSM_a-DistributeNumDofs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/DistributeNumDofs.cpp' object='libISSM_a-DistributeNumDofs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-DistributeNumDofs.o `test -f './ModelProcessorx/DistributeNumDofs.cpp' || echo '$(srcdir)/'`./ModelProcessorx/DistributeNumDofs.cpp
+
+libISSM_a-DistributeNumDofs.obj: ./ModelProcessorx/DistributeNumDofs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-DistributeNumDofs.obj -MD -MP -MF $(DEPDIR)/libISSM_a-DistributeNumDofs.Tpo -c -o libISSM_a-DistributeNumDofs.obj `if test -f './ModelProcessorx/DistributeNumDofs.cpp'; then $(CYGPATH_W) './ModelProcessorx/DistributeNumDofs.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/DistributeNumDofs.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-DistributeNumDofs.Tpo $(DEPDIR)/libISSM_a-DistributeNumDofs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/DistributeNumDofs.cpp' object='libISSM_a-DistributeNumDofs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-DistributeNumDofs.obj `if test -f './ModelProcessorx/DistributeNumDofs.cpp'; then $(CYGPATH_W) './ModelProcessorx/DistributeNumDofs.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/DistributeNumDofs.cpp'; fi`
+
+libISSM_a-CreateConstraintsDiagnosticHoriz.o: ./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-CreateConstraintsDiagnosticHoriz.o -MD -MP -MF $(DEPDIR)/libISSM_a-CreateConstraintsDiagnosticHoriz.Tpo -c -o libISSM_a-CreateConstraintsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-CreateConstraintsDiagnosticHoriz.Tpo $(DEPDIR)/libISSM_a-CreateConstraintsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp' object='libISSM_a-CreateConstraintsDiagnosticHoriz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-CreateConstraintsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp
+
+libISSM_a-CreateConstraintsDiagnosticHoriz.obj: ./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-CreateConstraintsDiagnosticHoriz.obj -MD -MP -MF $(DEPDIR)/libISSM_a-CreateConstraintsDiagnosticHoriz.Tpo -c -o libISSM_a-CreateConstraintsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-CreateConstraintsDiagnosticHoriz.Tpo $(DEPDIR)/libISSM_a-CreateConstraintsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp' object='libISSM_a-CreateConstraintsDiagnosticHoriz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-CreateConstraintsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; fi`
+
+libISSM_a-CreateLoadsDiagnosticHoriz.o: ./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-CreateLoadsDiagnosticHoriz.o -MD -MP -MF $(DEPDIR)/libISSM_a-CreateLoadsDiagnosticHoriz.Tpo -c -o libISSM_a-CreateLoadsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-CreateLoadsDiagnosticHoriz.Tpo $(DEPDIR)/libISSM_a-CreateLoadsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp' object='libISSM_a-CreateLoadsDiagnosticHoriz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-CreateLoadsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp
+
+libISSM_a-CreateLoadsDiagnosticHoriz.obj: ./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-CreateLoadsDiagnosticHoriz.obj -MD -MP -MF $(DEPDIR)/libISSM_a-CreateLoadsDiagnosticHoriz.Tpo -c -o libISSM_a-CreateLoadsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-CreateLoadsDiagnosticHoriz.Tpo $(DEPDIR)/libISSM_a-CreateLoadsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp' object='libISSM_a-CreateLoadsDiagnosticHoriz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-CreateLoadsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; fi`
+
+libISSM_a-ModelCreateParameters.o: ./ModelProcessorx/ModelCreateParameters.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ModelCreateParameters.o -MD -MP -MF $(DEPDIR)/libISSM_a-ModelCreateParameters.Tpo -c -o libISSM_a-ModelCreateParameters.o `test -f './ModelProcessorx/ModelCreateParameters.cpp' || echo '$(srcdir)/'`./ModelProcessorx/ModelCreateParameters.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ModelCreateParameters.Tpo $(DEPDIR)/libISSM_a-ModelCreateParameters.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/ModelCreateParameters.cpp' object='libISSM_a-ModelCreateParameters.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ModelCreateParameters.o `test -f './ModelProcessorx/ModelCreateParameters.cpp' || echo '$(srcdir)/'`./ModelProcessorx/ModelCreateParameters.cpp
+
+libISSM_a-ModelCreateParameters.obj: ./ModelProcessorx/ModelCreateParameters.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ModelCreateParameters.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ModelCreateParameters.Tpo -c -o libISSM_a-ModelCreateParameters.obj `if test -f './ModelProcessorx/ModelCreateParameters.cpp'; then $(CYGPATH_W) './ModelProcessorx/ModelCreateParameters.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/ModelCreateParameters.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ModelCreateParameters.Tpo $(DEPDIR)/libISSM_a-ModelCreateParameters.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/ModelCreateParameters.cpp' object='libISSM_a-ModelCreateParameters.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ModelCreateParameters.obj `if test -f './ModelProcessorx/ModelCreateParameters.cpp'; then $(CYGPATH_W) './ModelProcessorx/ModelCreateParameters.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/ModelCreateParameters.cpp'; fi`
+
+libISSM_a-Dofx.o: ./Dofx/Dofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Dofx.o -MD -MP -MF $(DEPDIR)/libISSM_a-Dofx.Tpo -c -o libISSM_a-Dofx.o `test -f './Dofx/Dofx.cpp' || echo '$(srcdir)/'`./Dofx/Dofx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Dofx.Tpo $(DEPDIR)/libISSM_a-Dofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Dofx/Dofx.cpp' object='libISSM_a-Dofx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Dofx.o `test -f './Dofx/Dofx.cpp' || echo '$(srcdir)/'`./Dofx/Dofx.cpp
+
+libISSM_a-Dofx.obj: ./Dofx/Dofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Dofx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Dofx.Tpo -c -o libISSM_a-Dofx.obj `if test -f './Dofx/Dofx.cpp'; then $(CYGPATH_W) './Dofx/Dofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Dofx/Dofx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Dofx.Tpo $(DEPDIR)/libISSM_a-Dofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Dofx/Dofx.cpp' object='libISSM_a-Dofx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Dofx.obj `if test -f './Dofx/Dofx.cpp'; then $(CYGPATH_W) './Dofx/Dofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Dofx/Dofx.cpp'; fi`
+
+libISSM_a-Dux.o: ./Dux/Dux.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Dux.o -MD -MP -MF $(DEPDIR)/libISSM_a-Dux.Tpo -c -o libISSM_a-Dux.o `test -f './Dux/Dux.cpp' || echo '$(srcdir)/'`./Dux/Dux.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Dux.Tpo $(DEPDIR)/libISSM_a-Dux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Dux/Dux.cpp' object='libISSM_a-Dux.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Dux.o `test -f './Dux/Dux.cpp' || echo '$(srcdir)/'`./Dux/Dux.cpp
+
+libISSM_a-Dux.obj: ./Dux/Dux.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Dux.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Dux.Tpo -c -o libISSM_a-Dux.obj `if test -f './Dux/Dux.cpp'; then $(CYGPATH_W) './Dux/Dux.cpp'; else $(CYGPATH_W) '$(srcdir)/./Dux/Dux.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Dux.Tpo $(DEPDIR)/libISSM_a-Dux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Dux/Dux.cpp' object='libISSM_a-Dux.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Dux.obj `if test -f './Dux/Dux.cpp'; then $(CYGPATH_W) './Dux/Dux.cpp'; else $(CYGPATH_W) '$(srcdir)/./Dux/Dux.cpp'; fi`
+
+libISSM_a-ControlConstrainx.o: ./ControlConstrainx/ControlConstrainx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ControlConstrainx.o -MD -MP -MF $(DEPDIR)/libISSM_a-ControlConstrainx.Tpo -c -o libISSM_a-ControlConstrainx.o `test -f './ControlConstrainx/ControlConstrainx.cpp' || echo '$(srcdir)/'`./ControlConstrainx/ControlConstrainx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ControlConstrainx.Tpo $(DEPDIR)/libISSM_a-ControlConstrainx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ControlConstrainx/ControlConstrainx.cpp' object='libISSM_a-ControlConstrainx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ControlConstrainx.o `test -f './ControlConstrainx/ControlConstrainx.cpp' || echo '$(srcdir)/'`./ControlConstrainx/ControlConstrainx.cpp
+
+libISSM_a-ControlConstrainx.obj: ./ControlConstrainx/ControlConstrainx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ControlConstrainx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ControlConstrainx.Tpo -c -o libISSM_a-ControlConstrainx.obj `if test -f './ControlConstrainx/ControlConstrainx.cpp'; then $(CYGPATH_W) './ControlConstrainx/ControlConstrainx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ControlConstrainx/ControlConstrainx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ControlConstrainx.Tpo $(DEPDIR)/libISSM_a-ControlConstrainx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ControlConstrainx/ControlConstrainx.cpp' object='libISSM_a-ControlConstrainx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ControlConstrainx.obj `if test -f './ControlConstrainx/ControlConstrainx.cpp'; then $(CYGPATH_W) './ControlConstrainx/ControlConstrainx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ControlConstrainx/ControlConstrainx.cpp'; fi`
+
+libISSM_a-Misfitx.o: ./Misfitx/Misfitx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Misfitx.o -MD -MP -MF $(DEPDIR)/libISSM_a-Misfitx.Tpo -c -o libISSM_a-Misfitx.o `test -f './Misfitx/Misfitx.cpp' || echo '$(srcdir)/'`./Misfitx/Misfitx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Misfitx.Tpo $(DEPDIR)/libISSM_a-Misfitx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Misfitx/Misfitx.cpp' object='libISSM_a-Misfitx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Misfitx.o `test -f './Misfitx/Misfitx.cpp' || echo '$(srcdir)/'`./Misfitx/Misfitx.cpp
+
+libISSM_a-Misfitx.obj: ./Misfitx/Misfitx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Misfitx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Misfitx.Tpo -c -o libISSM_a-Misfitx.obj `if test -f './Misfitx/Misfitx.cpp'; then $(CYGPATH_W) './Misfitx/Misfitx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Misfitx/Misfitx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Misfitx.Tpo $(DEPDIR)/libISSM_a-Misfitx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Misfitx/Misfitx.cpp' object='libISSM_a-Misfitx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Misfitx.obj `if test -f './Misfitx/Misfitx.cpp'; then $(CYGPATH_W) './Misfitx/Misfitx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Misfitx/Misfitx.cpp'; fi`
+
+libISSM_a-Orthx.o: ./Orthx/Orthx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Orthx.o -MD -MP -MF $(DEPDIR)/libISSM_a-Orthx.Tpo -c -o libISSM_a-Orthx.o `test -f './Orthx/Orthx.cpp' || echo '$(srcdir)/'`./Orthx/Orthx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Orthx.Tpo $(DEPDIR)/libISSM_a-Orthx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Orthx/Orthx.cpp' object='libISSM_a-Orthx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Orthx.o `test -f './Orthx/Orthx.cpp' || echo '$(srcdir)/'`./Orthx/Orthx.cpp
+
+libISSM_a-Orthx.obj: ./Orthx/Orthx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Orthx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Orthx.Tpo -c -o libISSM_a-Orthx.obj `if test -f './Orthx/Orthx.cpp'; then $(CYGPATH_W) './Orthx/Orthx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Orthx/Orthx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Orthx.Tpo $(DEPDIR)/libISSM_a-Orthx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Orthx/Orthx.cpp' object='libISSM_a-Orthx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Orthx.obj `if test -f './Orthx/Orthx.cpp'; then $(CYGPATH_W) './Orthx/Orthx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Orthx/Orthx.cpp'; fi`
+
+libISSM_a-Gradjx.o: ./Gradjx/Gradjx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Gradjx.o -MD -MP -MF $(DEPDIR)/libISSM_a-Gradjx.Tpo -c -o libISSM_a-Gradjx.o `test -f './Gradjx/Gradjx.cpp' || echo '$(srcdir)/'`./Gradjx/Gradjx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Gradjx.Tpo $(DEPDIR)/libISSM_a-Gradjx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Gradjx/Gradjx.cpp' object='libISSM_a-Gradjx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Gradjx.o `test -f './Gradjx/Gradjx.cpp' || echo '$(srcdir)/'`./Gradjx/Gradjx.cpp
+
+libISSM_a-Gradjx.obj: ./Gradjx/Gradjx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Gradjx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Gradjx.Tpo -c -o libISSM_a-Gradjx.obj `if test -f './Gradjx/Gradjx.cpp'; then $(CYGPATH_W) './Gradjx/Gradjx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Gradjx/Gradjx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Gradjx.Tpo $(DEPDIR)/libISSM_a-Gradjx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Gradjx/Gradjx.cpp' object='libISSM_a-Gradjx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Gradjx.obj `if test -f './Gradjx/Gradjx.cpp'; then $(CYGPATH_W) './Gradjx/Gradjx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Gradjx/Gradjx.cpp'; fi`
+
+libISSM_a-UpdateFromInputsx.o: ./UpdateFromInputsx/UpdateFromInputsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-UpdateFromInputsx.o -MD -MP -MF $(DEPDIR)/libISSM_a-UpdateFromInputsx.Tpo -c -o libISSM_a-UpdateFromInputsx.o `test -f './UpdateFromInputsx/UpdateFromInputsx.cpp' || echo '$(srcdir)/'`./UpdateFromInputsx/UpdateFromInputsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-UpdateFromInputsx.Tpo $(DEPDIR)/libISSM_a-UpdateFromInputsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./UpdateFromInputsx/UpdateFromInputsx.cpp' object='libISSM_a-UpdateFromInputsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-UpdateFromInputsx.o `test -f './UpdateFromInputsx/UpdateFromInputsx.cpp' || echo '$(srcdir)/'`./UpdateFromInputsx/UpdateFromInputsx.cpp
+
+libISSM_a-UpdateFromInputsx.obj: ./UpdateFromInputsx/UpdateFromInputsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-UpdateFromInputsx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-UpdateFromInputsx.Tpo -c -o libISSM_a-UpdateFromInputsx.obj `if test -f './UpdateFromInputsx/UpdateFromInputsx.cpp'; then $(CYGPATH_W) './UpdateFromInputsx/UpdateFromInputsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./UpdateFromInputsx/UpdateFromInputsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-UpdateFromInputsx.Tpo $(DEPDIR)/libISSM_a-UpdateFromInputsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./UpdateFromInputsx/UpdateFromInputsx.cpp' object='libISSM_a-UpdateFromInputsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-UpdateFromInputsx.obj `if test -f './UpdateFromInputsx/UpdateFromInputsx.cpp'; then $(CYGPATH_W) './UpdateFromInputsx/UpdateFromInputsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./UpdateFromInputsx/UpdateFromInputsx.cpp'; fi`
+
+libISSM_a-ConfigureObjectsx.o: ./ConfigureObjectsx/ConfigureObjectsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ConfigureObjectsx.o -MD -MP -MF $(DEPDIR)/libISSM_a-ConfigureObjectsx.Tpo -c -o libISSM_a-ConfigureObjectsx.o `test -f './ConfigureObjectsx/ConfigureObjectsx.cpp' || echo '$(srcdir)/'`./ConfigureObjectsx/ConfigureObjectsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ConfigureObjectsx.Tpo $(DEPDIR)/libISSM_a-ConfigureObjectsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ConfigureObjectsx/ConfigureObjectsx.cpp' object='libISSM_a-ConfigureObjectsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ConfigureObjectsx.o `test -f './ConfigureObjectsx/ConfigureObjectsx.cpp' || echo '$(srcdir)/'`./ConfigureObjectsx/ConfigureObjectsx.cpp
+
+libISSM_a-ConfigureObjectsx.obj: ./ConfigureObjectsx/ConfigureObjectsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ConfigureObjectsx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ConfigureObjectsx.Tpo -c -o libISSM_a-ConfigureObjectsx.obj `if test -f './ConfigureObjectsx/ConfigureObjectsx.cpp'; then $(CYGPATH_W) './ConfigureObjectsx/ConfigureObjectsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ConfigureObjectsx/ConfigureObjectsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ConfigureObjectsx.Tpo $(DEPDIR)/libISSM_a-ConfigureObjectsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ConfigureObjectsx/ConfigureObjectsx.cpp' object='libISSM_a-ConfigureObjectsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ConfigureObjectsx.obj `if test -f './ConfigureObjectsx/ConfigureObjectsx.cpp'; then $(CYGPATH_W) './ConfigureObjectsx/ConfigureObjectsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ConfigureObjectsx/ConfigureObjectsx.cpp'; fi`
+
+libISSM_a-BuildNodeSetsx.o: ./BuildNodeSetsx/BuildNodeSetsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-BuildNodeSetsx.o -MD -MP -MF $(DEPDIR)/libISSM_a-BuildNodeSetsx.Tpo -c -o libISSM_a-BuildNodeSetsx.o `test -f './BuildNodeSetsx/BuildNodeSetsx.cpp' || echo '$(srcdir)/'`./BuildNodeSetsx/BuildNodeSetsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-BuildNodeSetsx.Tpo $(DEPDIR)/libISSM_a-BuildNodeSetsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./BuildNodeSetsx/BuildNodeSetsx.cpp' object='libISSM_a-BuildNodeSetsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-BuildNodeSetsx.o `test -f './BuildNodeSetsx/BuildNodeSetsx.cpp' || echo '$(srcdir)/'`./BuildNodeSetsx/BuildNodeSetsx.cpp
+
+libISSM_a-BuildNodeSetsx.obj: ./BuildNodeSetsx/BuildNodeSetsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-BuildNodeSetsx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-BuildNodeSetsx.Tpo -c -o libISSM_a-BuildNodeSetsx.obj `if test -f './BuildNodeSetsx/BuildNodeSetsx.cpp'; then $(CYGPATH_W) './BuildNodeSetsx/BuildNodeSetsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./BuildNodeSetsx/BuildNodeSetsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-BuildNodeSetsx.Tpo $(DEPDIR)/libISSM_a-BuildNodeSetsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./BuildNodeSetsx/BuildNodeSetsx.cpp' object='libISSM_a-BuildNodeSetsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-BuildNodeSetsx.obj `if test -f './BuildNodeSetsx/BuildNodeSetsx.cpp'; then $(CYGPATH_W) './BuildNodeSetsx/BuildNodeSetsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./BuildNodeSetsx/BuildNodeSetsx.cpp'; fi`
+
+libISSM_a-PartitionSets.o: ./BuildNodeSetsx/PartitionSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PartitionSets.o -MD -MP -MF $(DEPDIR)/libISSM_a-PartitionSets.Tpo -c -o libISSM_a-PartitionSets.o `test -f './BuildNodeSetsx/PartitionSets.cpp' || echo '$(srcdir)/'`./BuildNodeSetsx/PartitionSets.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PartitionSets.Tpo $(DEPDIR)/libISSM_a-PartitionSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./BuildNodeSetsx/PartitionSets.cpp' object='libISSM_a-PartitionSets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PartitionSets.o `test -f './BuildNodeSetsx/PartitionSets.cpp' || echo '$(srcdir)/'`./BuildNodeSetsx/PartitionSets.cpp
+
+libISSM_a-PartitionSets.obj: ./BuildNodeSetsx/PartitionSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PartitionSets.obj -MD -MP -MF $(DEPDIR)/libISSM_a-PartitionSets.Tpo -c -o libISSM_a-PartitionSets.obj `if test -f './BuildNodeSetsx/PartitionSets.cpp'; then $(CYGPATH_W) './BuildNodeSetsx/PartitionSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./BuildNodeSetsx/PartitionSets.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PartitionSets.Tpo $(DEPDIR)/libISSM_a-PartitionSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./BuildNodeSetsx/PartitionSets.cpp' object='libISSM_a-PartitionSets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PartitionSets.obj `if test -f './BuildNodeSetsx/PartitionSets.cpp'; then $(CYGPATH_W) './BuildNodeSetsx/PartitionSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./BuildNodeSetsx/PartitionSets.cpp'; fi`
+
+libISSM_a-SpcNodesx.o: ./SpcNodesx/SpcNodesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SpcNodesx.o -MD -MP -MF $(DEPDIR)/libISSM_a-SpcNodesx.Tpo -c -o libISSM_a-SpcNodesx.o `test -f './SpcNodesx/SpcNodesx.cpp' || echo '$(srcdir)/'`./SpcNodesx/SpcNodesx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SpcNodesx.Tpo $(DEPDIR)/libISSM_a-SpcNodesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./SpcNodesx/SpcNodesx.cpp' object='libISSM_a-SpcNodesx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SpcNodesx.o `test -f './SpcNodesx/SpcNodesx.cpp' || echo '$(srcdir)/'`./SpcNodesx/SpcNodesx.cpp
+
+libISSM_a-SpcNodesx.obj: ./SpcNodesx/SpcNodesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SpcNodesx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-SpcNodesx.Tpo -c -o libISSM_a-SpcNodesx.obj `if test -f './SpcNodesx/SpcNodesx.cpp'; then $(CYGPATH_W) './SpcNodesx/SpcNodesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./SpcNodesx/SpcNodesx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SpcNodesx.Tpo $(DEPDIR)/libISSM_a-SpcNodesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./SpcNodesx/SpcNodesx.cpp' object='libISSM_a-SpcNodesx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SpcNodesx.obj `if test -f './SpcNodesx/SpcNodesx.cpp'; then $(CYGPATH_W) './SpcNodesx/SpcNodesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./SpcNodesx/SpcNodesx.cpp'; fi`
+
+libISSM_a-MpcNodesx.o: ./MpcNodesx/MpcNodesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MpcNodesx.o -MD -MP -MF $(DEPDIR)/libISSM_a-MpcNodesx.Tpo -c -o libISSM_a-MpcNodesx.o `test -f './MpcNodesx/MpcNodesx.cpp' || echo '$(srcdir)/'`./MpcNodesx/MpcNodesx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MpcNodesx.Tpo $(DEPDIR)/libISSM_a-MpcNodesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./MpcNodesx/MpcNodesx.cpp' object='libISSM_a-MpcNodesx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MpcNodesx.o `test -f './MpcNodesx/MpcNodesx.cpp' || echo '$(srcdir)/'`./MpcNodesx/MpcNodesx.cpp
+
+libISSM_a-MpcNodesx.obj: ./MpcNodesx/MpcNodesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MpcNodesx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MpcNodesx.Tpo -c -o libISSM_a-MpcNodesx.obj `if test -f './MpcNodesx/MpcNodesx.cpp'; then $(CYGPATH_W) './MpcNodesx/MpcNodesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./MpcNodesx/MpcNodesx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MpcNodesx.Tpo $(DEPDIR)/libISSM_a-MpcNodesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./MpcNodesx/MpcNodesx.cpp' object='libISSM_a-MpcNodesx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MpcNodesx.obj `if test -f './MpcNodesx/MpcNodesx.cpp'; then $(CYGPATH_W) './MpcNodesx/MpcNodesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./MpcNodesx/MpcNodesx.cpp'; fi`
+
+libISSM_a-DataInterpx.o: ./DataInterpx/DataInterpx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-DataInterpx.o -MD -MP -MF $(DEPDIR)/libISSM_a-DataInterpx.Tpo -c -o libISSM_a-DataInterpx.o `test -f './DataInterpx/DataInterpx.cpp' || echo '$(srcdir)/'`./DataInterpx/DataInterpx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-DataInterpx.Tpo $(DEPDIR)/libISSM_a-DataInterpx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./DataInterpx/DataInterpx.cpp' object='libISSM_a-DataInterpx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-DataInterpx.o `test -f './DataInterpx/DataInterpx.cpp' || echo '$(srcdir)/'`./DataInterpx/DataInterpx.cpp
+
+libISSM_a-DataInterpx.obj: ./DataInterpx/DataInterpx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-DataInterpx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-DataInterpx.Tpo -c -o libISSM_a-DataInterpx.obj `if test -f './DataInterpx/DataInterpx.cpp'; then $(CYGPATH_W) './DataInterpx/DataInterpx.cpp'; else $(CYGPATH_W) '$(srcdir)/./DataInterpx/DataInterpx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-DataInterpx.Tpo $(DEPDIR)/libISSM_a-DataInterpx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./DataInterpx/DataInterpx.cpp' object='libISSM_a-DataInterpx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-DataInterpx.obj `if test -f './DataInterpx/DataInterpx.cpp'; then $(CYGPATH_W) './DataInterpx/DataInterpx.cpp'; else $(CYGPATH_W) '$(srcdir)/./DataInterpx/DataInterpx.cpp'; fi`
+
+libISSM_a-HoleFillerx.o: ./HoleFillerx/HoleFillerx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-HoleFillerx.o -MD -MP -MF $(DEPDIR)/libISSM_a-HoleFillerx.Tpo -c -o libISSM_a-HoleFillerx.o `test -f './HoleFillerx/HoleFillerx.cpp' || echo '$(srcdir)/'`./HoleFillerx/HoleFillerx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-HoleFillerx.Tpo $(DEPDIR)/libISSM_a-HoleFillerx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./HoleFillerx/HoleFillerx.cpp' object='libISSM_a-HoleFillerx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-HoleFillerx.o `test -f './HoleFillerx/HoleFillerx.cpp' || echo '$(srcdir)/'`./HoleFillerx/HoleFillerx.cpp
+
+libISSM_a-HoleFillerx.obj: ./HoleFillerx/HoleFillerx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-HoleFillerx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-HoleFillerx.Tpo -c -o libISSM_a-HoleFillerx.obj `if test -f './HoleFillerx/HoleFillerx.cpp'; then $(CYGPATH_W) './HoleFillerx/HoleFillerx.cpp'; else $(CYGPATH_W) '$(srcdir)/./HoleFillerx/HoleFillerx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-HoleFillerx.Tpo $(DEPDIR)/libISSM_a-HoleFillerx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./HoleFillerx/HoleFillerx.cpp' object='libISSM_a-HoleFillerx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-HoleFillerx.obj `if test -f './HoleFillerx/HoleFillerx.cpp'; then $(CYGPATH_W) './HoleFillerx/HoleFillerx.cpp'; else $(CYGPATH_W) '$(srcdir)/./HoleFillerx/HoleFillerx.cpp'; fi`
+
+libISSM_a-MeshPartitionx.o: ./MeshPartitionx/MeshPartitionx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MeshPartitionx.o -MD -MP -MF $(DEPDIR)/libISSM_a-MeshPartitionx.Tpo -c -o libISSM_a-MeshPartitionx.o `test -f './MeshPartitionx/MeshPartitionx.cpp' || echo '$(srcdir)/'`./MeshPartitionx/MeshPartitionx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MeshPartitionx.Tpo $(DEPDIR)/libISSM_a-MeshPartitionx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./MeshPartitionx/MeshPartitionx.cpp' object='libISSM_a-MeshPartitionx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MeshPartitionx.o `test -f './MeshPartitionx/MeshPartitionx.cpp' || echo '$(srcdir)/'`./MeshPartitionx/MeshPartitionx.cpp
+
+libISSM_a-MeshPartitionx.obj: ./MeshPartitionx/MeshPartitionx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-MeshPartitionx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-MeshPartitionx.Tpo -c -o libISSM_a-MeshPartitionx.obj `if test -f './MeshPartitionx/MeshPartitionx.cpp'; then $(CYGPATH_W) './MeshPartitionx/MeshPartitionx.cpp'; else $(CYGPATH_W) '$(srcdir)/./MeshPartitionx/MeshPartitionx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-MeshPartitionx.Tpo $(DEPDIR)/libISSM_a-MeshPartitionx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./MeshPartitionx/MeshPartitionx.cpp' object='libISSM_a-MeshPartitionx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-MeshPartitionx.obj `if test -f './MeshPartitionx/MeshPartitionx.cpp'; then $(CYGPATH_W) './MeshPartitionx/MeshPartitionx.cpp'; else $(CYGPATH_W) '$(srcdir)/./MeshPartitionx/MeshPartitionx.cpp'; fi`
+
+libISSM_a-ContourToMeshx.o: ./ContourToMeshx/ContourToMeshx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ContourToMeshx.o -MD -MP -MF $(DEPDIR)/libISSM_a-ContourToMeshx.Tpo -c -o libISSM_a-ContourToMeshx.o `test -f './ContourToMeshx/ContourToMeshx.cpp' || echo '$(srcdir)/'`./ContourToMeshx/ContourToMeshx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ContourToMeshx.Tpo $(DEPDIR)/libISSM_a-ContourToMeshx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ContourToMeshx/ContourToMeshx.cpp' object='libISSM_a-ContourToMeshx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ContourToMeshx.o `test -f './ContourToMeshx/ContourToMeshx.cpp' || echo '$(srcdir)/'`./ContourToMeshx/ContourToMeshx.cpp
+
+libISSM_a-ContourToMeshx.obj: ./ContourToMeshx/ContourToMeshx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ContourToMeshx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ContourToMeshx.Tpo -c -o libISSM_a-ContourToMeshx.obj `if test -f './ContourToMeshx/ContourToMeshx.cpp'; then $(CYGPATH_W) './ContourToMeshx/ContourToMeshx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ContourToMeshx/ContourToMeshx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ContourToMeshx.Tpo $(DEPDIR)/libISSM_a-ContourToMeshx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ContourToMeshx/ContourToMeshx.cpp' object='libISSM_a-ContourToMeshx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ContourToMeshx.obj `if test -f './ContourToMeshx/ContourToMeshx.cpp'; then $(CYGPATH_W) './ContourToMeshx/ContourToMeshx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ContourToMeshx/ContourToMeshx.cpp'; fi`
+
+libISSM_a-Reducevectorgtosx.o: ./Reducevectorgtosx/Reducevectorgtosx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Reducevectorgtosx.o -MD -MP -MF $(DEPDIR)/libISSM_a-Reducevectorgtosx.Tpo -c -o libISSM_a-Reducevectorgtosx.o `test -f './Reducevectorgtosx/Reducevectorgtosx.cpp' || echo '$(srcdir)/'`./Reducevectorgtosx/Reducevectorgtosx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Reducevectorgtosx.Tpo $(DEPDIR)/libISSM_a-Reducevectorgtosx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducevectorgtosx/Reducevectorgtosx.cpp' object='libISSM_a-Reducevectorgtosx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Reducevectorgtosx.o `test -f './Reducevectorgtosx/Reducevectorgtosx.cpp' || echo '$(srcdir)/'`./Reducevectorgtosx/Reducevectorgtosx.cpp
+
+libISSM_a-Reducevectorgtosx.obj: ./Reducevectorgtosx/Reducevectorgtosx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Reducevectorgtosx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Reducevectorgtosx.Tpo -c -o libISSM_a-Reducevectorgtosx.obj `if test -f './Reducevectorgtosx/Reducevectorgtosx.cpp'; then $(CYGPATH_W) './Reducevectorgtosx/Reducevectorgtosx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducevectorgtosx/Reducevectorgtosx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Reducevectorgtosx.Tpo $(DEPDIR)/libISSM_a-Reducevectorgtosx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducevectorgtosx/Reducevectorgtosx.cpp' object='libISSM_a-Reducevectorgtosx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Reducevectorgtosx.obj `if test -f './Reducevectorgtosx/Reducevectorgtosx.cpp'; then $(CYGPATH_W) './Reducevectorgtosx/Reducevectorgtosx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducevectorgtosx/Reducevectorgtosx.cpp'; fi`
+
+libISSM_a-Reducematrixfromgtofx.o: ./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Reducematrixfromgtofx.o -MD -MP -MF $(DEPDIR)/libISSM_a-Reducematrixfromgtofx.Tpo -c -o libISSM_a-Reducematrixfromgtofx.o `test -f './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp' || echo '$(srcdir)/'`./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Reducematrixfromgtofx.Tpo $(DEPDIR)/libISSM_a-Reducematrixfromgtofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp' object='libISSM_a-Reducematrixfromgtofx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Reducematrixfromgtofx.o `test -f './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp' || echo '$(srcdir)/'`./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
+
+libISSM_a-Reducematrixfromgtofx.obj: ./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Reducematrixfromgtofx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Reducematrixfromgtofx.Tpo -c -o libISSM_a-Reducematrixfromgtofx.obj `if test -f './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; then $(CYGPATH_W) './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Reducematrixfromgtofx.Tpo $(DEPDIR)/libISSM_a-Reducematrixfromgtofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp' object='libISSM_a-Reducematrixfromgtofx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Reducematrixfromgtofx.obj `if test -f './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; then $(CYGPATH_W) './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; fi`
+
+libISSM_a-Reducematrixfromgton.o: ./Reducematrixfromgtofx/Reducematrixfromgton.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Reducematrixfromgton.o -MD -MP -MF $(DEPDIR)/libISSM_a-Reducematrixfromgton.Tpo -c -o libISSM_a-Reducematrixfromgton.o `test -f './Reducematrixfromgtofx/Reducematrixfromgton.cpp' || echo '$(srcdir)/'`./Reducematrixfromgtofx/Reducematrixfromgton.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Reducematrixfromgton.Tpo $(DEPDIR)/libISSM_a-Reducematrixfromgton.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducematrixfromgtofx/Reducematrixfromgton.cpp' object='libISSM_a-Reducematrixfromgton.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Reducematrixfromgton.o `test -f './Reducematrixfromgtofx/Reducematrixfromgton.cpp' || echo '$(srcdir)/'`./Reducematrixfromgtofx/Reducematrixfromgton.cpp
+
+libISSM_a-Reducematrixfromgton.obj: ./Reducematrixfromgtofx/Reducematrixfromgton.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Reducematrixfromgton.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Reducematrixfromgton.Tpo -c -o libISSM_a-Reducematrixfromgton.obj `if test -f './Reducematrixfromgtofx/Reducematrixfromgton.cpp'; then $(CYGPATH_W) './Reducematrixfromgtofx/Reducematrixfromgton.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducematrixfromgtofx/Reducematrixfromgton.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Reducematrixfromgton.Tpo $(DEPDIR)/libISSM_a-Reducematrixfromgton.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducematrixfromgtofx/Reducematrixfromgton.cpp' object='libISSM_a-Reducematrixfromgton.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Reducematrixfromgton.obj `if test -f './Reducematrixfromgtofx/Reducematrixfromgton.cpp'; then $(CYGPATH_W) './Reducematrixfromgtofx/Reducematrixfromgton.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducematrixfromgtofx/Reducematrixfromgton.cpp'; fi`
+
+libISSM_a-Reduceloadfromgtofx.o: ./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Reduceloadfromgtofx.o -MD -MP -MF $(DEPDIR)/libISSM_a-Reduceloadfromgtofx.Tpo -c -o libISSM_a-Reduceloadfromgtofx.o `test -f './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp' || echo '$(srcdir)/'`./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Reduceloadfromgtofx.Tpo $(DEPDIR)/libISSM_a-Reduceloadfromgtofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp' object='libISSM_a-Reduceloadfromgtofx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Reduceloadfromgtofx.o `test -f './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp' || echo '$(srcdir)/'`./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
+
+libISSM_a-Reduceloadfromgtofx.obj: ./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Reduceloadfromgtofx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Reduceloadfromgtofx.Tpo -c -o libISSM_a-Reduceloadfromgtofx.obj `if test -f './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; then $(CYGPATH_W) './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Reduceloadfromgtofx.Tpo $(DEPDIR)/libISSM_a-Reduceloadfromgtofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp' object='libISSM_a-Reduceloadfromgtofx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Reduceloadfromgtofx.obj `if test -f './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; then $(CYGPATH_W) './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; fi`
+
+libISSM_a-NormalizeConstraintsx.o: ./NormalizeConstraintsx/NormalizeConstraintsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NormalizeConstraintsx.o -MD -MP -MF $(DEPDIR)/libISSM_a-NormalizeConstraintsx.Tpo -c -o libISSM_a-NormalizeConstraintsx.o `test -f './NormalizeConstraintsx/NormalizeConstraintsx.cpp' || echo '$(srcdir)/'`./NormalizeConstraintsx/NormalizeConstraintsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NormalizeConstraintsx.Tpo $(DEPDIR)/libISSM_a-NormalizeConstraintsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./NormalizeConstraintsx/NormalizeConstraintsx.cpp' object='libISSM_a-NormalizeConstraintsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NormalizeConstraintsx.o `test -f './NormalizeConstraintsx/NormalizeConstraintsx.cpp' || echo '$(srcdir)/'`./NormalizeConstraintsx/NormalizeConstraintsx.cpp
+
+libISSM_a-NormalizeConstraintsx.obj: ./NormalizeConstraintsx/NormalizeConstraintsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-NormalizeConstraintsx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-NormalizeConstraintsx.Tpo -c -o libISSM_a-NormalizeConstraintsx.obj `if test -f './NormalizeConstraintsx/NormalizeConstraintsx.cpp'; then $(CYGPATH_W) './NormalizeConstraintsx/NormalizeConstraintsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./NormalizeConstraintsx/NormalizeConstraintsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-NormalizeConstraintsx.Tpo $(DEPDIR)/libISSM_a-NormalizeConstraintsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./NormalizeConstraintsx/NormalizeConstraintsx.cpp' object='libISSM_a-NormalizeConstraintsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-NormalizeConstraintsx.obj `if test -f './NormalizeConstraintsx/NormalizeConstraintsx.cpp'; then $(CYGPATH_W) './NormalizeConstraintsx/NormalizeConstraintsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./NormalizeConstraintsx/NormalizeConstraintsx.cpp'; fi`
+
+libISSM_a-SystemMatricesx.o: ./SystemMatricesx/SystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SystemMatricesx.o -MD -MP -MF $(DEPDIR)/libISSM_a-SystemMatricesx.Tpo -c -o libISSM_a-SystemMatricesx.o `test -f './SystemMatricesx/SystemMatricesx.cpp' || echo '$(srcdir)/'`./SystemMatricesx/SystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SystemMatricesx.Tpo $(DEPDIR)/libISSM_a-SystemMatricesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./SystemMatricesx/SystemMatricesx.cpp' object='libISSM_a-SystemMatricesx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SystemMatricesx.o `test -f './SystemMatricesx/SystemMatricesx.cpp' || echo '$(srcdir)/'`./SystemMatricesx/SystemMatricesx.cpp
+
+libISSM_a-SystemMatricesx.obj: ./SystemMatricesx/SystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-SystemMatricesx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-SystemMatricesx.Tpo -c -o libISSM_a-SystemMatricesx.obj `if test -f './SystemMatricesx/SystemMatricesx.cpp'; then $(CYGPATH_W) './SystemMatricesx/SystemMatricesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./SystemMatricesx/SystemMatricesx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-SystemMatricesx.Tpo $(DEPDIR)/libISSM_a-SystemMatricesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./SystemMatricesx/SystemMatricesx.cpp' object='libISSM_a-SystemMatricesx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-SystemMatricesx.obj `if test -f './SystemMatricesx/SystemMatricesx.cpp'; then $(CYGPATH_W) './SystemMatricesx/SystemMatricesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./SystemMatricesx/SystemMatricesx.cpp'; fi`
+
+libISSM_a-PenaltyConstraintsx.o: ./PenaltyConstraintsx/PenaltyConstraintsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PenaltyConstraintsx.o -MD -MP -MF $(DEPDIR)/libISSM_a-PenaltyConstraintsx.Tpo -c -o libISSM_a-PenaltyConstraintsx.o `test -f './PenaltyConstraintsx/PenaltyConstraintsx.cpp' || echo '$(srcdir)/'`./PenaltyConstraintsx/PenaltyConstraintsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PenaltyConstraintsx.Tpo $(DEPDIR)/libISSM_a-PenaltyConstraintsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./PenaltyConstraintsx/PenaltyConstraintsx.cpp' object='libISSM_a-PenaltyConstraintsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PenaltyConstraintsx.o `test -f './PenaltyConstraintsx/PenaltyConstraintsx.cpp' || echo '$(srcdir)/'`./PenaltyConstraintsx/PenaltyConstraintsx.cpp
+
+libISSM_a-PenaltyConstraintsx.obj: ./PenaltyConstraintsx/PenaltyConstraintsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PenaltyConstraintsx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-PenaltyConstraintsx.Tpo -c -o libISSM_a-PenaltyConstraintsx.obj `if test -f './PenaltyConstraintsx/PenaltyConstraintsx.cpp'; then $(CYGPATH_W) './PenaltyConstraintsx/PenaltyConstraintsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./PenaltyConstraintsx/PenaltyConstraintsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PenaltyConstraintsx.Tpo $(DEPDIR)/libISSM_a-PenaltyConstraintsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./PenaltyConstraintsx/PenaltyConstraintsx.cpp' object='libISSM_a-PenaltyConstraintsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PenaltyConstraintsx.obj `if test -f './PenaltyConstraintsx/PenaltyConstraintsx.cpp'; then $(CYGPATH_W) './PenaltyConstraintsx/PenaltyConstraintsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./PenaltyConstraintsx/PenaltyConstraintsx.cpp'; fi`
+
+libISSM_a-PenaltySystemMatricesx.o: ./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PenaltySystemMatricesx.o -MD -MP -MF $(DEPDIR)/libISSM_a-PenaltySystemMatricesx.Tpo -c -o libISSM_a-PenaltySystemMatricesx.o `test -f './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp' || echo '$(srcdir)/'`./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PenaltySystemMatricesx.Tpo $(DEPDIR)/libISSM_a-PenaltySystemMatricesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp' object='libISSM_a-PenaltySystemMatricesx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PenaltySystemMatricesx.o `test -f './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp' || echo '$(srcdir)/'`./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
+
+libISSM_a-PenaltySystemMatricesx.obj: ./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-PenaltySystemMatricesx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-PenaltySystemMatricesx.Tpo -c -o libISSM_a-PenaltySystemMatricesx.obj `if test -f './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; then $(CYGPATH_W) './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-PenaltySystemMatricesx.Tpo $(DEPDIR)/libISSM_a-PenaltySystemMatricesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp' object='libISSM_a-PenaltySystemMatricesx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-PenaltySystemMatricesx.obj `if test -f './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; then $(CYGPATH_W) './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; fi`
+
+libISSM_a-Solverx.o: ./Solverx/Solverx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Solverx.o -MD -MP -MF $(DEPDIR)/libISSM_a-Solverx.Tpo -c -o libISSM_a-Solverx.o `test -f './Solverx/Solverx.cpp' || echo '$(srcdir)/'`./Solverx/Solverx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Solverx.Tpo $(DEPDIR)/libISSM_a-Solverx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Solverx/Solverx.cpp' object='libISSM_a-Solverx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Solverx.o `test -f './Solverx/Solverx.cpp' || echo '$(srcdir)/'`./Solverx/Solverx.cpp
+
+libISSM_a-Solverx.obj: ./Solverx/Solverx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Solverx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Solverx.Tpo -c -o libISSM_a-Solverx.obj `if test -f './Solverx/Solverx.cpp'; then $(CYGPATH_W) './Solverx/Solverx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Solverx/Solverx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Solverx.Tpo $(DEPDIR)/libISSM_a-Solverx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Solverx/Solverx.cpp' object='libISSM_a-Solverx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Solverx.obj `if test -f './Solverx/Solverx.cpp'; then $(CYGPATH_W) './Solverx/Solverx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Solverx/Solverx.cpp'; fi`
+
+libISSM_a-Mergesolutionfromftogx.o: ./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Mergesolutionfromftogx.o -MD -MP -MF $(DEPDIR)/libISSM_a-Mergesolutionfromftogx.Tpo -c -o libISSM_a-Mergesolutionfromftogx.o `test -f './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp' || echo '$(srcdir)/'`./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Mergesolutionfromftogx.Tpo $(DEPDIR)/libISSM_a-Mergesolutionfromftogx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp' object='libISSM_a-Mergesolutionfromftogx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Mergesolutionfromftogx.o `test -f './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp' || echo '$(srcdir)/'`./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
+
+libISSM_a-Mergesolutionfromftogx.obj: ./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-Mergesolutionfromftogx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-Mergesolutionfromftogx.Tpo -c -o libISSM_a-Mergesolutionfromftogx.obj `if test -f './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; then $(CYGPATH_W) './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-Mergesolutionfromftogx.Tpo $(DEPDIR)/libISSM_a-Mergesolutionfromftogx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp' object='libISSM_a-Mergesolutionfromftogx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-Mergesolutionfromftogx.obj `if test -f './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; then $(CYGPATH_W) './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; fi`
+
+libISSM_a-ProcessParamsx.o: ./ProcessParamsx/ProcessParamsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ProcessParamsx.o -MD -MP -MF $(DEPDIR)/libISSM_a-ProcessParamsx.Tpo -c -o libISSM_a-ProcessParamsx.o `test -f './ProcessParamsx/ProcessParamsx.cpp' || echo '$(srcdir)/'`./ProcessParamsx/ProcessParamsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ProcessParamsx.Tpo $(DEPDIR)/libISSM_a-ProcessParamsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ProcessParamsx/ProcessParamsx.cpp' object='libISSM_a-ProcessParamsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ProcessParamsx.o `test -f './ProcessParamsx/ProcessParamsx.cpp' || echo '$(srcdir)/'`./ProcessParamsx/ProcessParamsx.cpp
+
+libISSM_a-ProcessParamsx.obj: ./ProcessParamsx/ProcessParamsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libISSM_a-ProcessParamsx.obj -MD -MP -MF $(DEPDIR)/libISSM_a-ProcessParamsx.Tpo -c -o libISSM_a-ProcessParamsx.obj `if test -f './ProcessParamsx/ProcessParamsx.cpp'; then $(CYGPATH_W) './ProcessParamsx/ProcessParamsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ProcessParamsx/ProcessParamsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libISSM_a-ProcessParamsx.Tpo $(DEPDIR)/libISSM_a-ProcessParamsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ProcessParamsx/ProcessParamsx.cpp' object='libISSM_a-ProcessParamsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libISSM_a-ProcessParamsx.obj `if test -f './ProcessParamsx/ProcessParamsx.cpp'; then $(CYGPATH_W) './ProcessParamsx/ProcessParamsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ProcessParamsx/ProcessParamsx.cpp'; fi`
+
+libpISSM_a-Element.o: ./objects/Element.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Element.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Element.Tpo -c -o libpISSM_a-Element.o `test -f './objects/Element.cpp' || echo '$(srcdir)/'`./objects/Element.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Element.Tpo $(DEPDIR)/libpISSM_a-Element.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Element.cpp' object='libpISSM_a-Element.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Element.o `test -f './objects/Element.cpp' || echo '$(srcdir)/'`./objects/Element.cpp
+
+libpISSM_a-Element.obj: ./objects/Element.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Element.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Element.Tpo -c -o libpISSM_a-Element.obj `if test -f './objects/Element.cpp'; then $(CYGPATH_W) './objects/Element.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Element.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Element.Tpo $(DEPDIR)/libpISSM_a-Element.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Element.cpp' object='libpISSM_a-Element.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Element.obj `if test -f './objects/Element.cpp'; then $(CYGPATH_W) './objects/Element.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Element.cpp'; fi`
+
+libpISSM_a-Material.o: ./objects/Material.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Material.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Material.Tpo -c -o libpISSM_a-Material.o `test -f './objects/Material.cpp' || echo '$(srcdir)/'`./objects/Material.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Material.Tpo $(DEPDIR)/libpISSM_a-Material.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Material.cpp' object='libpISSM_a-Material.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Material.o `test -f './objects/Material.cpp' || echo '$(srcdir)/'`./objects/Material.cpp
+
+libpISSM_a-Material.obj: ./objects/Material.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Material.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Material.Tpo -c -o libpISSM_a-Material.obj `if test -f './objects/Material.cpp'; then $(CYGPATH_W) './objects/Material.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Material.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Material.Tpo $(DEPDIR)/libpISSM_a-Material.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Material.cpp' object='libpISSM_a-Material.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Material.obj `if test -f './objects/Material.cpp'; then $(CYGPATH_W) './objects/Material.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Material.cpp'; fi`
+
+libpISSM_a-Load.o: ./objects/Load.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Load.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Load.Tpo -c -o libpISSM_a-Load.o `test -f './objects/Load.cpp' || echo '$(srcdir)/'`./objects/Load.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Load.Tpo $(DEPDIR)/libpISSM_a-Load.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Load.cpp' object='libpISSM_a-Load.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Load.o `test -f './objects/Load.cpp' || echo '$(srcdir)/'`./objects/Load.cpp
+
+libpISSM_a-Load.obj: ./objects/Load.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Load.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Load.Tpo -c -o libpISSM_a-Load.obj `if test -f './objects/Load.cpp'; then $(CYGPATH_W) './objects/Load.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Load.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Load.Tpo $(DEPDIR)/libpISSM_a-Load.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Load.cpp' object='libpISSM_a-Load.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Load.obj `if test -f './objects/Load.cpp'; then $(CYGPATH_W) './objects/Load.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Load.cpp'; fi`
+
+libpISSM_a-Contour.o: ./objects/Contour.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Contour.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Contour.Tpo -c -o libpISSM_a-Contour.o `test -f './objects/Contour.cpp' || echo '$(srcdir)/'`./objects/Contour.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Contour.Tpo $(DEPDIR)/libpISSM_a-Contour.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Contour.cpp' object='libpISSM_a-Contour.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Contour.o `test -f './objects/Contour.cpp' || echo '$(srcdir)/'`./objects/Contour.cpp
+
+libpISSM_a-Contour.obj: ./objects/Contour.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Contour.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Contour.Tpo -c -o libpISSM_a-Contour.obj `if test -f './objects/Contour.cpp'; then $(CYGPATH_W) './objects/Contour.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Contour.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Contour.Tpo $(DEPDIR)/libpISSM_a-Contour.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Contour.cpp' object='libpISSM_a-Contour.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Contour.obj `if test -f './objects/Contour.cpp'; then $(CYGPATH_W) './objects/Contour.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Contour.cpp'; fi`
+
+libpISSM_a-Friction.o: ./objects/Friction.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Friction.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Friction.Tpo -c -o libpISSM_a-Friction.o `test -f './objects/Friction.cpp' || echo '$(srcdir)/'`./objects/Friction.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Friction.Tpo $(DEPDIR)/libpISSM_a-Friction.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Friction.cpp' object='libpISSM_a-Friction.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Friction.o `test -f './objects/Friction.cpp' || echo '$(srcdir)/'`./objects/Friction.cpp
+
+libpISSM_a-Friction.obj: ./objects/Friction.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Friction.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Friction.Tpo -c -o libpISSM_a-Friction.obj `if test -f './objects/Friction.cpp'; then $(CYGPATH_W) './objects/Friction.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Friction.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Friction.Tpo $(DEPDIR)/libpISSM_a-Friction.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Friction.cpp' object='libpISSM_a-Friction.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Friction.obj `if test -f './objects/Friction.cpp'; then $(CYGPATH_W) './objects/Friction.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Friction.cpp'; fi`
+
+libpISSM_a-Node.o: ./objects/Node.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Node.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Node.Tpo -c -o libpISSM_a-Node.o `test -f './objects/Node.cpp' || echo '$(srcdir)/'`./objects/Node.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Node.Tpo $(DEPDIR)/libpISSM_a-Node.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Node.cpp' object='libpISSM_a-Node.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Node.o `test -f './objects/Node.cpp' || echo '$(srcdir)/'`./objects/Node.cpp
+
+libpISSM_a-Node.obj: ./objects/Node.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Node.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Node.Tpo -c -o libpISSM_a-Node.obj `if test -f './objects/Node.cpp'; then $(CYGPATH_W) './objects/Node.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Node.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Node.Tpo $(DEPDIR)/libpISSM_a-Node.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Node.cpp' object='libpISSM_a-Node.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Node.obj `if test -f './objects/Node.cpp'; then $(CYGPATH_W) './objects/Node.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Node.cpp'; fi`
+
+libpISSM_a-Tria.o: ./objects/Tria.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Tria.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Tria.Tpo -c -o libpISSM_a-Tria.o `test -f './objects/Tria.cpp' || echo '$(srcdir)/'`./objects/Tria.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Tria.Tpo $(DEPDIR)/libpISSM_a-Tria.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Tria.cpp' object='libpISSM_a-Tria.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Tria.o `test -f './objects/Tria.cpp' || echo '$(srcdir)/'`./objects/Tria.cpp
+
+libpISSM_a-Tria.obj: ./objects/Tria.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Tria.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Tria.Tpo -c -o libpISSM_a-Tria.obj `if test -f './objects/Tria.cpp'; then $(CYGPATH_W) './objects/Tria.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Tria.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Tria.Tpo $(DEPDIR)/libpISSM_a-Tria.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Tria.cpp' object='libpISSM_a-Tria.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Tria.obj `if test -f './objects/Tria.cpp'; then $(CYGPATH_W) './objects/Tria.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Tria.cpp'; fi`
+
+libpISSM_a-Penta.o: ./objects/Penta.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Penta.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Penta.Tpo -c -o libpISSM_a-Penta.o `test -f './objects/Penta.cpp' || echo '$(srcdir)/'`./objects/Penta.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Penta.Tpo $(DEPDIR)/libpISSM_a-Penta.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Penta.cpp' object='libpISSM_a-Penta.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Penta.o `test -f './objects/Penta.cpp' || echo '$(srcdir)/'`./objects/Penta.cpp
+
+libpISSM_a-Penta.obj: ./objects/Penta.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Penta.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Penta.Tpo -c -o libpISSM_a-Penta.obj `if test -f './objects/Penta.cpp'; then $(CYGPATH_W) './objects/Penta.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Penta.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Penta.Tpo $(DEPDIR)/libpISSM_a-Penta.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Penta.cpp' object='libpISSM_a-Penta.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Penta.obj `if test -f './objects/Penta.cpp'; then $(CYGPATH_W) './objects/Penta.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Penta.cpp'; fi`
+
+libpISSM_a-Matice.o: ./objects/Matice.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Matice.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Matice.Tpo -c -o libpISSM_a-Matice.o `test -f './objects/Matice.cpp' || echo '$(srcdir)/'`./objects/Matice.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Matice.Tpo $(DEPDIR)/libpISSM_a-Matice.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Matice.cpp' object='libpISSM_a-Matice.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Matice.o `test -f './objects/Matice.cpp' || echo '$(srcdir)/'`./objects/Matice.cpp
+
+libpISSM_a-Matice.obj: ./objects/Matice.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Matice.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Matice.Tpo -c -o libpISSM_a-Matice.obj `if test -f './objects/Matice.cpp'; then $(CYGPATH_W) './objects/Matice.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Matice.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Matice.Tpo $(DEPDIR)/libpISSM_a-Matice.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Matice.cpp' object='libpISSM_a-Matice.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Matice.obj `if test -f './objects/Matice.cpp'; then $(CYGPATH_W) './objects/Matice.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Matice.cpp'; fi`
+
+libpISSM_a-Matpar.o: ./objects/Matpar.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Matpar.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Matpar.Tpo -c -o libpISSM_a-Matpar.o `test -f './objects/Matpar.cpp' || echo '$(srcdir)/'`./objects/Matpar.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Matpar.Tpo $(DEPDIR)/libpISSM_a-Matpar.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Matpar.cpp' object='libpISSM_a-Matpar.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Matpar.o `test -f './objects/Matpar.cpp' || echo '$(srcdir)/'`./objects/Matpar.cpp
+
+libpISSM_a-Matpar.obj: ./objects/Matpar.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Matpar.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Matpar.Tpo -c -o libpISSM_a-Matpar.obj `if test -f './objects/Matpar.cpp'; then $(CYGPATH_W) './objects/Matpar.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Matpar.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Matpar.Tpo $(DEPDIR)/libpISSM_a-Matpar.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Matpar.cpp' object='libpISSM_a-Matpar.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Matpar.obj `if test -f './objects/Matpar.cpp'; then $(CYGPATH_W) './objects/Matpar.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Matpar.cpp'; fi`
+
+libpISSM_a-ParameterInputs.o: ./objects/ParameterInputs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParameterInputs.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ParameterInputs.Tpo -c -o libpISSM_a-ParameterInputs.o `test -f './objects/ParameterInputs.cpp' || echo '$(srcdir)/'`./objects/ParameterInputs.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParameterInputs.Tpo $(DEPDIR)/libpISSM_a-ParameterInputs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/ParameterInputs.cpp' object='libpISSM_a-ParameterInputs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParameterInputs.o `test -f './objects/ParameterInputs.cpp' || echo '$(srcdir)/'`./objects/ParameterInputs.cpp
+
+libpISSM_a-ParameterInputs.obj: ./objects/ParameterInputs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParameterInputs.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ParameterInputs.Tpo -c -o libpISSM_a-ParameterInputs.obj `if test -f './objects/ParameterInputs.cpp'; then $(CYGPATH_W) './objects/ParameterInputs.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/ParameterInputs.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParameterInputs.Tpo $(DEPDIR)/libpISSM_a-ParameterInputs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/ParameterInputs.cpp' object='libpISSM_a-ParameterInputs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParameterInputs.obj `if test -f './objects/ParameterInputs.cpp'; then $(CYGPATH_W) './objects/ParameterInputs.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/ParameterInputs.cpp'; fi`
+
+libpISSM_a-Spc.o: ./objects/Spc.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Spc.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Spc.Tpo -c -o libpISSM_a-Spc.o `test -f './objects/Spc.cpp' || echo '$(srcdir)/'`./objects/Spc.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Spc.Tpo $(DEPDIR)/libpISSM_a-Spc.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Spc.cpp' object='libpISSM_a-Spc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Spc.o `test -f './objects/Spc.cpp' || echo '$(srcdir)/'`./objects/Spc.cpp
+
+libpISSM_a-Spc.obj: ./objects/Spc.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Spc.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Spc.Tpo -c -o libpISSM_a-Spc.obj `if test -f './objects/Spc.cpp'; then $(CYGPATH_W) './objects/Spc.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Spc.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Spc.Tpo $(DEPDIR)/libpISSM_a-Spc.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Spc.cpp' object='libpISSM_a-Spc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Spc.obj `if test -f './objects/Spc.cpp'; then $(CYGPATH_W) './objects/Spc.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Spc.cpp'; fi`
+
+libpISSM_a-Rgb.o: ./objects/Rgb.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Rgb.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Rgb.Tpo -c -o libpISSM_a-Rgb.o `test -f './objects/Rgb.cpp' || echo '$(srcdir)/'`./objects/Rgb.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Rgb.Tpo $(DEPDIR)/libpISSM_a-Rgb.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Rgb.cpp' object='libpISSM_a-Rgb.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Rgb.o `test -f './objects/Rgb.cpp' || echo '$(srcdir)/'`./objects/Rgb.cpp
+
+libpISSM_a-Rgb.obj: ./objects/Rgb.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Rgb.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Rgb.Tpo -c -o libpISSM_a-Rgb.obj `if test -f './objects/Rgb.cpp'; then $(CYGPATH_W) './objects/Rgb.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Rgb.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Rgb.Tpo $(DEPDIR)/libpISSM_a-Rgb.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Rgb.cpp' object='libpISSM_a-Rgb.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Rgb.obj `if test -f './objects/Rgb.cpp'; then $(CYGPATH_W) './objects/Rgb.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Rgb.cpp'; fi`
+
+libpISSM_a-Penpair.o: ./objects/Penpair.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Penpair.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Penpair.Tpo -c -o libpISSM_a-Penpair.o `test -f './objects/Penpair.cpp' || echo '$(srcdir)/'`./objects/Penpair.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Penpair.Tpo $(DEPDIR)/libpISSM_a-Penpair.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Penpair.cpp' object='libpISSM_a-Penpair.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Penpair.o `test -f './objects/Penpair.cpp' || echo '$(srcdir)/'`./objects/Penpair.cpp
+
+libpISSM_a-Penpair.obj: ./objects/Penpair.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Penpair.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Penpair.Tpo -c -o libpISSM_a-Penpair.obj `if test -f './objects/Penpair.cpp'; then $(CYGPATH_W) './objects/Penpair.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Penpair.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Penpair.Tpo $(DEPDIR)/libpISSM_a-Penpair.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Penpair.cpp' object='libpISSM_a-Penpair.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Penpair.obj `if test -f './objects/Penpair.cpp'; then $(CYGPATH_W) './objects/Penpair.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Penpair.cpp'; fi`
+
+libpISSM_a-Icefront.o: ./objects/Icefront.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Icefront.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Icefront.Tpo -c -o libpISSM_a-Icefront.o `test -f './objects/Icefront.cpp' || echo '$(srcdir)/'`./objects/Icefront.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Icefront.Tpo $(DEPDIR)/libpISSM_a-Icefront.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Icefront.cpp' object='libpISSM_a-Icefront.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Icefront.o `test -f './objects/Icefront.cpp' || echo '$(srcdir)/'`./objects/Icefront.cpp
+
+libpISSM_a-Icefront.obj: ./objects/Icefront.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Icefront.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Icefront.Tpo -c -o libpISSM_a-Icefront.obj `if test -f './objects/Icefront.cpp'; then $(CYGPATH_W) './objects/Icefront.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Icefront.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Icefront.Tpo $(DEPDIR)/libpISSM_a-Icefront.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Icefront.cpp' object='libpISSM_a-Icefront.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Icefront.obj `if test -f './objects/Icefront.cpp'; then $(CYGPATH_W) './objects/Icefront.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Icefront.cpp'; fi`
+
+libpISSM_a-Param.o: ./objects/Param.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Param.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Param.Tpo -c -o libpISSM_a-Param.o `test -f './objects/Param.cpp' || echo '$(srcdir)/'`./objects/Param.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Param.Tpo $(DEPDIR)/libpISSM_a-Param.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Param.cpp' object='libpISSM_a-Param.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Param.o `test -f './objects/Param.cpp' || echo '$(srcdir)/'`./objects/Param.cpp
+
+libpISSM_a-Param.obj: ./objects/Param.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Param.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Param.Tpo -c -o libpISSM_a-Param.obj `if test -f './objects/Param.cpp'; then $(CYGPATH_W) './objects/Param.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Param.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Param.Tpo $(DEPDIR)/libpISSM_a-Param.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/Param.cpp' object='libpISSM_a-Param.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Param.obj `if test -f './objects/Param.cpp'; then $(CYGPATH_W) './objects/Param.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/Param.cpp'; fi`
+
+libpISSM_a-NodeSets.o: ./objects/NodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NodeSets.o -MD -MP -MF $(DEPDIR)/libpISSM_a-NodeSets.Tpo -c -o libpISSM_a-NodeSets.o `test -f './objects/NodeSets.cpp' || echo '$(srcdir)/'`./objects/NodeSets.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NodeSets.Tpo $(DEPDIR)/libpISSM_a-NodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/NodeSets.cpp' object='libpISSM_a-NodeSets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NodeSets.o `test -f './objects/NodeSets.cpp' || echo '$(srcdir)/'`./objects/NodeSets.cpp
+
+libpISSM_a-NodeSets.obj: ./objects/NodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NodeSets.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-NodeSets.Tpo -c -o libpISSM_a-NodeSets.obj `if test -f './objects/NodeSets.cpp'; then $(CYGPATH_W) './objects/NodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/NodeSets.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NodeSets.Tpo $(DEPDIR)/libpISSM_a-NodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./objects/NodeSets.cpp' object='libpISSM_a-NodeSets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NodeSets.obj `if test -f './objects/NodeSets.cpp'; then $(CYGPATH_W) './objects/NodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./objects/NodeSets.cpp'; fi`
+
+libpISSM_a-DataSet.o: ./DataSet/DataSet.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-DataSet.o -MD -MP -MF $(DEPDIR)/libpISSM_a-DataSet.Tpo -c -o libpISSM_a-DataSet.o `test -f './DataSet/DataSet.cpp' || echo '$(srcdir)/'`./DataSet/DataSet.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-DataSet.Tpo $(DEPDIR)/libpISSM_a-DataSet.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./DataSet/DataSet.cpp' object='libpISSM_a-DataSet.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-DataSet.o `test -f './DataSet/DataSet.cpp' || echo '$(srcdir)/'`./DataSet/DataSet.cpp
+
+libpISSM_a-DataSet.obj: ./DataSet/DataSet.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-DataSet.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-DataSet.Tpo -c -o libpISSM_a-DataSet.obj `if test -f './DataSet/DataSet.cpp'; then $(CYGPATH_W) './DataSet/DataSet.cpp'; else $(CYGPATH_W) '$(srcdir)/./DataSet/DataSet.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-DataSet.Tpo $(DEPDIR)/libpISSM_a-DataSet.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./DataSet/DataSet.cpp' object='libpISSM_a-DataSet.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-DataSet.obj `if test -f './DataSet/DataSet.cpp'; then $(CYGPATH_W) './DataSet/DataSet.cpp'; else $(CYGPATH_W) '$(srcdir)/./DataSet/DataSet.cpp'; fi`
+
+libpISSM_a-alloc.o: ./shared/Alloc/alloc.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-alloc.o -MD -MP -MF $(DEPDIR)/libpISSM_a-alloc.Tpo -c -o libpISSM_a-alloc.o `test -f './shared/Alloc/alloc.cpp' || echo '$(srcdir)/'`./shared/Alloc/alloc.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-alloc.Tpo $(DEPDIR)/libpISSM_a-alloc.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Alloc/alloc.cpp' object='libpISSM_a-alloc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-alloc.o `test -f './shared/Alloc/alloc.cpp' || echo '$(srcdir)/'`./shared/Alloc/alloc.cpp
+
+libpISSM_a-alloc.obj: ./shared/Alloc/alloc.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-alloc.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-alloc.Tpo -c -o libpISSM_a-alloc.obj `if test -f './shared/Alloc/alloc.cpp'; then $(CYGPATH_W) './shared/Alloc/alloc.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Alloc/alloc.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-alloc.Tpo $(DEPDIR)/libpISSM_a-alloc.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Alloc/alloc.cpp' object='libpISSM_a-alloc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-alloc.obj `if test -f './shared/Alloc/alloc.cpp'; then $(CYGPATH_W) './shared/Alloc/alloc.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Alloc/alloc.cpp'; fi`
+
+libpISSM_a-PrintfFunction.o: ./shared/Matlab/PrintfFunction.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PrintfFunction.o -MD -MP -MF $(DEPDIR)/libpISSM_a-PrintfFunction.Tpo -c -o libpISSM_a-PrintfFunction.o `test -f './shared/Matlab/PrintfFunction.cpp' || echo '$(srcdir)/'`./shared/Matlab/PrintfFunction.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PrintfFunction.Tpo $(DEPDIR)/libpISSM_a-PrintfFunction.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/PrintfFunction.cpp' object='libpISSM_a-PrintfFunction.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PrintfFunction.o `test -f './shared/Matlab/PrintfFunction.cpp' || echo '$(srcdir)/'`./shared/Matlab/PrintfFunction.cpp
+
+libpISSM_a-PrintfFunction.obj: ./shared/Matlab/PrintfFunction.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PrintfFunction.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-PrintfFunction.Tpo -c -o libpISSM_a-PrintfFunction.obj `if test -f './shared/Matlab/PrintfFunction.cpp'; then $(CYGPATH_W) './shared/Matlab/PrintfFunction.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/PrintfFunction.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PrintfFunction.Tpo $(DEPDIR)/libpISSM_a-PrintfFunction.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/PrintfFunction.cpp' object='libpISSM_a-PrintfFunction.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PrintfFunction.obj `if test -f './shared/Matlab/PrintfFunction.cpp'; then $(CYGPATH_W) './shared/Matlab/PrintfFunction.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/PrintfFunction.cpp'; fi`
+
+libpISSM_a-ModuleBoot.o: ./shared/Matlab/ModuleBoot.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ModuleBoot.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ModuleBoot.Tpo -c -o libpISSM_a-ModuleBoot.o `test -f './shared/Matlab/ModuleBoot.cpp' || echo '$(srcdir)/'`./shared/Matlab/ModuleBoot.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ModuleBoot.Tpo $(DEPDIR)/libpISSM_a-ModuleBoot.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/ModuleBoot.cpp' object='libpISSM_a-ModuleBoot.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ModuleBoot.o `test -f './shared/Matlab/ModuleBoot.cpp' || echo '$(srcdir)/'`./shared/Matlab/ModuleBoot.cpp
+
+libpISSM_a-ModuleBoot.obj: ./shared/Matlab/ModuleBoot.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ModuleBoot.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ModuleBoot.Tpo -c -o libpISSM_a-ModuleBoot.obj `if test -f './shared/Matlab/ModuleBoot.cpp'; then $(CYGPATH_W) './shared/Matlab/ModuleBoot.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/ModuleBoot.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ModuleBoot.Tpo $(DEPDIR)/libpISSM_a-ModuleBoot.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/ModuleBoot.cpp' object='libpISSM_a-ModuleBoot.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ModuleBoot.obj `if test -f './shared/Matlab/ModuleBoot.cpp'; then $(CYGPATH_W) './shared/Matlab/ModuleBoot.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/ModuleBoot.cpp'; fi`
+
+libpISSM_a-mxGetAssignedField.o: ./shared/Matlab/mxGetAssignedField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-mxGetAssignedField.o -MD -MP -MF $(DEPDIR)/libpISSM_a-mxGetAssignedField.Tpo -c -o libpISSM_a-mxGetAssignedField.o `test -f './shared/Matlab/mxGetAssignedField.cpp' || echo '$(srcdir)/'`./shared/Matlab/mxGetAssignedField.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-mxGetAssignedField.Tpo $(DEPDIR)/libpISSM_a-mxGetAssignedField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/mxGetAssignedField.cpp' object='libpISSM_a-mxGetAssignedField.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-mxGetAssignedField.o `test -f './shared/Matlab/mxGetAssignedField.cpp' || echo '$(srcdir)/'`./shared/Matlab/mxGetAssignedField.cpp
+
+libpISSM_a-mxGetAssignedField.obj: ./shared/Matlab/mxGetAssignedField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-mxGetAssignedField.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-mxGetAssignedField.Tpo -c -o libpISSM_a-mxGetAssignedField.obj `if test -f './shared/Matlab/mxGetAssignedField.cpp'; then $(CYGPATH_W) './shared/Matlab/mxGetAssignedField.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/mxGetAssignedField.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-mxGetAssignedField.Tpo $(DEPDIR)/libpISSM_a-mxGetAssignedField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/mxGetAssignedField.cpp' object='libpISSM_a-mxGetAssignedField.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-mxGetAssignedField.obj `if test -f './shared/Matlab/mxGetAssignedField.cpp'; then $(CYGPATH_W) './shared/Matlab/mxGetAssignedField.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/mxGetAssignedField.cpp'; fi`
+
+libpISSM_a-mxGetField.o: ./shared/Matlab/mxGetField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-mxGetField.o -MD -MP -MF $(DEPDIR)/libpISSM_a-mxGetField.Tpo -c -o libpISSM_a-mxGetField.o `test -f './shared/Matlab/mxGetField.cpp' || echo '$(srcdir)/'`./shared/Matlab/mxGetField.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-mxGetField.Tpo $(DEPDIR)/libpISSM_a-mxGetField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/mxGetField.cpp' object='libpISSM_a-mxGetField.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-mxGetField.o `test -f './shared/Matlab/mxGetField.cpp' || echo '$(srcdir)/'`./shared/Matlab/mxGetField.cpp
+
+libpISSM_a-mxGetField.obj: ./shared/Matlab/mxGetField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-mxGetField.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-mxGetField.Tpo -c -o libpISSM_a-mxGetField.obj `if test -f './shared/Matlab/mxGetField.cpp'; then $(CYGPATH_W) './shared/Matlab/mxGetField.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/mxGetField.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-mxGetField.Tpo $(DEPDIR)/libpISSM_a-mxGetField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/mxGetField.cpp' object='libpISSM_a-mxGetField.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-mxGetField.obj `if test -f './shared/Matlab/mxGetField.cpp'; then $(CYGPATH_W) './shared/Matlab/mxGetField.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/mxGetField.cpp'; fi`
+
+libpISSM_a-CheckNumMatlabArguments.o: ./shared/Matlab/CheckNumMatlabArguments.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CheckNumMatlabArguments.o -MD -MP -MF $(DEPDIR)/libpISSM_a-CheckNumMatlabArguments.Tpo -c -o libpISSM_a-CheckNumMatlabArguments.o `test -f './shared/Matlab/CheckNumMatlabArguments.cpp' || echo '$(srcdir)/'`./shared/Matlab/CheckNumMatlabArguments.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CheckNumMatlabArguments.Tpo $(DEPDIR)/libpISSM_a-CheckNumMatlabArguments.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/CheckNumMatlabArguments.cpp' object='libpISSM_a-CheckNumMatlabArguments.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CheckNumMatlabArguments.o `test -f './shared/Matlab/CheckNumMatlabArguments.cpp' || echo '$(srcdir)/'`./shared/Matlab/CheckNumMatlabArguments.cpp
+
+libpISSM_a-CheckNumMatlabArguments.obj: ./shared/Matlab/CheckNumMatlabArguments.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CheckNumMatlabArguments.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-CheckNumMatlabArguments.Tpo -c -o libpISSM_a-CheckNumMatlabArguments.obj `if test -f './shared/Matlab/CheckNumMatlabArguments.cpp'; then $(CYGPATH_W) './shared/Matlab/CheckNumMatlabArguments.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/CheckNumMatlabArguments.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CheckNumMatlabArguments.Tpo $(DEPDIR)/libpISSM_a-CheckNumMatlabArguments.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matlab/CheckNumMatlabArguments.cpp' object='libpISSM_a-CheckNumMatlabArguments.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CheckNumMatlabArguments.obj `if test -f './shared/Matlab/CheckNumMatlabArguments.cpp'; then $(CYGPATH_W) './shared/Matlab/CheckNumMatlabArguments.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matlab/CheckNumMatlabArguments.cpp'; fi`
+
+libpISSM_a-MatrixUtils.o: ./shared/Matrix/MatrixUtils.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatrixUtils.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatrixUtils.Tpo -c -o libpISSM_a-MatrixUtils.o `test -f './shared/Matrix/MatrixUtils.cpp' || echo '$(srcdir)/'`./shared/Matrix/MatrixUtils.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatrixUtils.Tpo $(DEPDIR)/libpISSM_a-MatrixUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matrix/MatrixUtils.cpp' object='libpISSM_a-MatrixUtils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatrixUtils.o `test -f './shared/Matrix/MatrixUtils.cpp' || echo '$(srcdir)/'`./shared/Matrix/MatrixUtils.cpp
+
+libpISSM_a-MatrixUtils.obj: ./shared/Matrix/MatrixUtils.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatrixUtils.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatrixUtils.Tpo -c -o libpISSM_a-MatrixUtils.obj `if test -f './shared/Matrix/MatrixUtils.cpp'; then $(CYGPATH_W) './shared/Matrix/MatrixUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matrix/MatrixUtils.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatrixUtils.Tpo $(DEPDIR)/libpISSM_a-MatrixUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Matrix/MatrixUtils.cpp' object='libpISSM_a-MatrixUtils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatrixUtils.obj `if test -f './shared/Matrix/MatrixUtils.cpp'; then $(CYGPATH_W) './shared/Matrix/MatrixUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Matrix/MatrixUtils.cpp'; fi`
+
+libpISSM_a-GaussPoints.o: ./shared/Numerics/GaussPoints.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-GaussPoints.o -MD -MP -MF $(DEPDIR)/libpISSM_a-GaussPoints.Tpo -c -o libpISSM_a-GaussPoints.o `test -f './shared/Numerics/GaussPoints.cpp' || echo '$(srcdir)/'`./shared/Numerics/GaussPoints.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-GaussPoints.Tpo $(DEPDIR)/libpISSM_a-GaussPoints.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Numerics/GaussPoints.cpp' object='libpISSM_a-GaussPoints.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-GaussPoints.o `test -f './shared/Numerics/GaussPoints.cpp' || echo '$(srcdir)/'`./shared/Numerics/GaussPoints.cpp
+
+libpISSM_a-GaussPoints.obj: ./shared/Numerics/GaussPoints.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-GaussPoints.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-GaussPoints.Tpo -c -o libpISSM_a-GaussPoints.obj `if test -f './shared/Numerics/GaussPoints.cpp'; then $(CYGPATH_W) './shared/Numerics/GaussPoints.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Numerics/GaussPoints.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-GaussPoints.Tpo $(DEPDIR)/libpISSM_a-GaussPoints.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Numerics/GaussPoints.cpp' object='libpISSM_a-GaussPoints.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-GaussPoints.obj `if test -f './shared/Numerics/GaussPoints.cpp'; then $(CYGPATH_W) './shared/Numerics/GaussPoints.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Numerics/GaussPoints.cpp'; fi`
+
+libpISSM_a-extrema.o: ./shared/Numerics/extrema.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-extrema.o -MD -MP -MF $(DEPDIR)/libpISSM_a-extrema.Tpo -c -o libpISSM_a-extrema.o `test -f './shared/Numerics/extrema.cpp' || echo '$(srcdir)/'`./shared/Numerics/extrema.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-extrema.Tpo $(DEPDIR)/libpISSM_a-extrema.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Numerics/extrema.cpp' object='libpISSM_a-extrema.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-extrema.o `test -f './shared/Numerics/extrema.cpp' || echo '$(srcdir)/'`./shared/Numerics/extrema.cpp
+
+libpISSM_a-extrema.obj: ./shared/Numerics/extrema.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-extrema.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-extrema.Tpo -c -o libpISSM_a-extrema.obj `if test -f './shared/Numerics/extrema.cpp'; then $(CYGPATH_W) './shared/Numerics/extrema.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Numerics/extrema.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-extrema.Tpo $(DEPDIR)/libpISSM_a-extrema.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Numerics/extrema.cpp' object='libpISSM_a-extrema.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-extrema.obj `if test -f './shared/Numerics/extrema.cpp'; then $(CYGPATH_W) './shared/Numerics/extrema.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Numerics/extrema.cpp'; fi`
+
+libpISSM_a-Exceptions.o: ./shared/Exceptions/Exceptions.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Exceptions.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Exceptions.Tpo -c -o libpISSM_a-Exceptions.o `test -f './shared/Exceptions/Exceptions.cpp' || echo '$(srcdir)/'`./shared/Exceptions/Exceptions.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Exceptions.Tpo $(DEPDIR)/libpISSM_a-Exceptions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exceptions/Exceptions.cpp' object='libpISSM_a-Exceptions.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Exceptions.o `test -f './shared/Exceptions/Exceptions.cpp' || echo '$(srcdir)/'`./shared/Exceptions/Exceptions.cpp
+
+libpISSM_a-Exceptions.obj: ./shared/Exceptions/Exceptions.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Exceptions.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Exceptions.Tpo -c -o libpISSM_a-Exceptions.obj `if test -f './shared/Exceptions/Exceptions.cpp'; then $(CYGPATH_W) './shared/Exceptions/Exceptions.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exceptions/Exceptions.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Exceptions.Tpo $(DEPDIR)/libpISSM_a-Exceptions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exceptions/Exceptions.cpp' object='libpISSM_a-Exceptions.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Exceptions.obj `if test -f './shared/Exceptions/Exceptions.cpp'; then $(CYGPATH_W) './shared/Exceptions/Exceptions.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exceptions/Exceptions.cpp'; fi`
+
+libpISSM_a-exprintf.o: ./shared/Exceptions/exprintf.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-exprintf.o -MD -MP -MF $(DEPDIR)/libpISSM_a-exprintf.Tpo -c -o libpISSM_a-exprintf.o `test -f './shared/Exceptions/exprintf.cpp' || echo '$(srcdir)/'`./shared/Exceptions/exprintf.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-exprintf.Tpo $(DEPDIR)/libpISSM_a-exprintf.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exceptions/exprintf.cpp' object='libpISSM_a-exprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-exprintf.o `test -f './shared/Exceptions/exprintf.cpp' || echo '$(srcdir)/'`./shared/Exceptions/exprintf.cpp
+
+libpISSM_a-exprintf.obj: ./shared/Exceptions/exprintf.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-exprintf.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-exprintf.Tpo -c -o libpISSM_a-exprintf.obj `if test -f './shared/Exceptions/exprintf.cpp'; then $(CYGPATH_W) './shared/Exceptions/exprintf.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exceptions/exprintf.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-exprintf.Tpo $(DEPDIR)/libpISSM_a-exprintf.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exceptions/exprintf.cpp' object='libpISSM_a-exprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-exprintf.obj `if test -f './shared/Exceptions/exprintf.cpp'; then $(CYGPATH_W) './shared/Exceptions/exprintf.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exceptions/exprintf.cpp'; fi`
+
+libpISSM_a-IsInPoly.o: ./shared/Exp/IsInPoly.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-IsInPoly.o -MD -MP -MF $(DEPDIR)/libpISSM_a-IsInPoly.Tpo -c -o libpISSM_a-IsInPoly.o `test -f './shared/Exp/IsInPoly.cpp' || echo '$(srcdir)/'`./shared/Exp/IsInPoly.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-IsInPoly.Tpo $(DEPDIR)/libpISSM_a-IsInPoly.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/IsInPoly.cpp' object='libpISSM_a-IsInPoly.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-IsInPoly.o `test -f './shared/Exp/IsInPoly.cpp' || echo '$(srcdir)/'`./shared/Exp/IsInPoly.cpp
+
+libpISSM_a-IsInPoly.obj: ./shared/Exp/IsInPoly.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-IsInPoly.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-IsInPoly.Tpo -c -o libpISSM_a-IsInPoly.obj `if test -f './shared/Exp/IsInPoly.cpp'; then $(CYGPATH_W) './shared/Exp/IsInPoly.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/IsInPoly.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-IsInPoly.Tpo $(DEPDIR)/libpISSM_a-IsInPoly.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/IsInPoly.cpp' object='libpISSM_a-IsInPoly.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-IsInPoly.obj `if test -f './shared/Exp/IsInPoly.cpp'; then $(CYGPATH_W) './shared/Exp/IsInPoly.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/IsInPoly.cpp'; fi`
+
+libpISSM_a-IsInPolySerial.o: ./shared/Exp/IsInPolySerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-IsInPolySerial.o -MD -MP -MF $(DEPDIR)/libpISSM_a-IsInPolySerial.Tpo -c -o libpISSM_a-IsInPolySerial.o `test -f './shared/Exp/IsInPolySerial.cpp' || echo '$(srcdir)/'`./shared/Exp/IsInPolySerial.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-IsInPolySerial.Tpo $(DEPDIR)/libpISSM_a-IsInPolySerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/IsInPolySerial.cpp' object='libpISSM_a-IsInPolySerial.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-IsInPolySerial.o `test -f './shared/Exp/IsInPolySerial.cpp' || echo '$(srcdir)/'`./shared/Exp/IsInPolySerial.cpp
+
+libpISSM_a-IsInPolySerial.obj: ./shared/Exp/IsInPolySerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-IsInPolySerial.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-IsInPolySerial.Tpo -c -o libpISSM_a-IsInPolySerial.obj `if test -f './shared/Exp/IsInPolySerial.cpp'; then $(CYGPATH_W) './shared/Exp/IsInPolySerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/IsInPolySerial.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-IsInPolySerial.Tpo $(DEPDIR)/libpISSM_a-IsInPolySerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/IsInPolySerial.cpp' object='libpISSM_a-IsInPolySerial.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-IsInPolySerial.obj `if test -f './shared/Exp/IsInPolySerial.cpp'; then $(CYGPATH_W) './shared/Exp/IsInPolySerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/IsInPolySerial.cpp'; fi`
+
+libpISSM_a-DomainOutlineRead.o: ./shared/Exp/DomainOutlineRead.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-DomainOutlineRead.o -MD -MP -MF $(DEPDIR)/libpISSM_a-DomainOutlineRead.Tpo -c -o libpISSM_a-DomainOutlineRead.o `test -f './shared/Exp/DomainOutlineRead.cpp' || echo '$(srcdir)/'`./shared/Exp/DomainOutlineRead.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-DomainOutlineRead.Tpo $(DEPDIR)/libpISSM_a-DomainOutlineRead.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/DomainOutlineRead.cpp' object='libpISSM_a-DomainOutlineRead.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-DomainOutlineRead.o `test -f './shared/Exp/DomainOutlineRead.cpp' || echo '$(srcdir)/'`./shared/Exp/DomainOutlineRead.cpp
+
+libpISSM_a-DomainOutlineRead.obj: ./shared/Exp/DomainOutlineRead.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-DomainOutlineRead.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-DomainOutlineRead.Tpo -c -o libpISSM_a-DomainOutlineRead.obj `if test -f './shared/Exp/DomainOutlineRead.cpp'; then $(CYGPATH_W) './shared/Exp/DomainOutlineRead.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/DomainOutlineRead.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-DomainOutlineRead.Tpo $(DEPDIR)/libpISSM_a-DomainOutlineRead.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Exp/DomainOutlineRead.cpp' object='libpISSM_a-DomainOutlineRead.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-DomainOutlineRead.obj `if test -f './shared/Exp/DomainOutlineRead.cpp'; then $(CYGPATH_W) './shared/Exp/DomainOutlineRead.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Exp/DomainOutlineRead.cpp'; fi`
+
+libpISSM_a-AssociateSegmentToElement.o: ./shared/TriMesh/AssociateSegmentToElement.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-AssociateSegmentToElement.o -MD -MP -MF $(DEPDIR)/libpISSM_a-AssociateSegmentToElement.Tpo -c -o libpISSM_a-AssociateSegmentToElement.o `test -f './shared/TriMesh/AssociateSegmentToElement.cpp' || echo '$(srcdir)/'`./shared/TriMesh/AssociateSegmentToElement.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-AssociateSegmentToElement.Tpo $(DEPDIR)/libpISSM_a-AssociateSegmentToElement.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/AssociateSegmentToElement.cpp' object='libpISSM_a-AssociateSegmentToElement.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-AssociateSegmentToElement.o `test -f './shared/TriMesh/AssociateSegmentToElement.cpp' || echo '$(srcdir)/'`./shared/TriMesh/AssociateSegmentToElement.cpp
+
+libpISSM_a-AssociateSegmentToElement.obj: ./shared/TriMesh/AssociateSegmentToElement.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-AssociateSegmentToElement.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-AssociateSegmentToElement.Tpo -c -o libpISSM_a-AssociateSegmentToElement.obj `if test -f './shared/TriMesh/AssociateSegmentToElement.cpp'; then $(CYGPATH_W) './shared/TriMesh/AssociateSegmentToElement.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/AssociateSegmentToElement.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-AssociateSegmentToElement.Tpo $(DEPDIR)/libpISSM_a-AssociateSegmentToElement.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/AssociateSegmentToElement.cpp' object='libpISSM_a-AssociateSegmentToElement.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-AssociateSegmentToElement.obj `if test -f './shared/TriMesh/AssociateSegmentToElement.cpp'; then $(CYGPATH_W) './shared/TriMesh/AssociateSegmentToElement.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/AssociateSegmentToElement.cpp'; fi`
+
+libpISSM_a-GridInsideHole.o: ./shared/TriMesh/GridInsideHole.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-GridInsideHole.o -MD -MP -MF $(DEPDIR)/libpISSM_a-GridInsideHole.Tpo -c -o libpISSM_a-GridInsideHole.o `test -f './shared/TriMesh/GridInsideHole.cpp' || echo '$(srcdir)/'`./shared/TriMesh/GridInsideHole.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-GridInsideHole.Tpo $(DEPDIR)/libpISSM_a-GridInsideHole.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/GridInsideHole.cpp' object='libpISSM_a-GridInsideHole.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-GridInsideHole.o `test -f './shared/TriMesh/GridInsideHole.cpp' || echo '$(srcdir)/'`./shared/TriMesh/GridInsideHole.cpp
+
+libpISSM_a-GridInsideHole.obj: ./shared/TriMesh/GridInsideHole.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-GridInsideHole.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-GridInsideHole.Tpo -c -o libpISSM_a-GridInsideHole.obj `if test -f './shared/TriMesh/GridInsideHole.cpp'; then $(CYGPATH_W) './shared/TriMesh/GridInsideHole.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/GridInsideHole.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-GridInsideHole.Tpo $(DEPDIR)/libpISSM_a-GridInsideHole.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/GridInsideHole.cpp' object='libpISSM_a-GridInsideHole.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-GridInsideHole.obj `if test -f './shared/TriMesh/GridInsideHole.cpp'; then $(CYGPATH_W) './shared/TriMesh/GridInsideHole.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/GridInsideHole.cpp'; fi`
+
+libpISSM_a-OrderSegments.o: ./shared/TriMesh/OrderSegments.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-OrderSegments.o -MD -MP -MF $(DEPDIR)/libpISSM_a-OrderSegments.Tpo -c -o libpISSM_a-OrderSegments.o `test -f './shared/TriMesh/OrderSegments.cpp' || echo '$(srcdir)/'`./shared/TriMesh/OrderSegments.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-OrderSegments.Tpo $(DEPDIR)/libpISSM_a-OrderSegments.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/OrderSegments.cpp' object='libpISSM_a-OrderSegments.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-OrderSegments.o `test -f './shared/TriMesh/OrderSegments.cpp' || echo '$(srcdir)/'`./shared/TriMesh/OrderSegments.cpp
+
+libpISSM_a-OrderSegments.obj: ./shared/TriMesh/OrderSegments.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-OrderSegments.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-OrderSegments.Tpo -c -o libpISSM_a-OrderSegments.obj `if test -f './shared/TriMesh/OrderSegments.cpp'; then $(CYGPATH_W) './shared/TriMesh/OrderSegments.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/OrderSegments.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-OrderSegments.Tpo $(DEPDIR)/libpISSM_a-OrderSegments.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/OrderSegments.cpp' object='libpISSM_a-OrderSegments.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-OrderSegments.obj `if test -f './shared/TriMesh/OrderSegments.cpp'; then $(CYGPATH_W) './shared/TriMesh/OrderSegments.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/OrderSegments.cpp'; fi`
+
+libpISSM_a-SplitMeshForRifts.o: ./shared/TriMesh/SplitMeshForRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SplitMeshForRifts.o -MD -MP -MF $(DEPDIR)/libpISSM_a-SplitMeshForRifts.Tpo -c -o libpISSM_a-SplitMeshForRifts.o `test -f './shared/TriMesh/SplitMeshForRifts.cpp' || echo '$(srcdir)/'`./shared/TriMesh/SplitMeshForRifts.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SplitMeshForRifts.Tpo $(DEPDIR)/libpISSM_a-SplitMeshForRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/SplitMeshForRifts.cpp' object='libpISSM_a-SplitMeshForRifts.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SplitMeshForRifts.o `test -f './shared/TriMesh/SplitMeshForRifts.cpp' || echo '$(srcdir)/'`./shared/TriMesh/SplitMeshForRifts.cpp
+
+libpISSM_a-SplitMeshForRifts.obj: ./shared/TriMesh/SplitMeshForRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SplitMeshForRifts.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-SplitMeshForRifts.Tpo -c -o libpISSM_a-SplitMeshForRifts.obj `if test -f './shared/TriMesh/SplitMeshForRifts.cpp'; then $(CYGPATH_W) './shared/TriMesh/SplitMeshForRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/SplitMeshForRifts.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SplitMeshForRifts.Tpo $(DEPDIR)/libpISSM_a-SplitMeshForRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/SplitMeshForRifts.cpp' object='libpISSM_a-SplitMeshForRifts.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SplitMeshForRifts.obj `if test -f './shared/TriMesh/SplitMeshForRifts.cpp'; then $(CYGPATH_W) './shared/TriMesh/SplitMeshForRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/SplitMeshForRifts.cpp'; fi`
+
+libpISSM_a-TriMeshUtils.o: ./shared/TriMesh/TriMeshUtils.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-TriMeshUtils.o -MD -MP -MF $(DEPDIR)/libpISSM_a-TriMeshUtils.Tpo -c -o libpISSM_a-TriMeshUtils.o `test -f './shared/TriMesh/TriMeshUtils.cpp' || echo '$(srcdir)/'`./shared/TriMesh/TriMeshUtils.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-TriMeshUtils.Tpo $(DEPDIR)/libpISSM_a-TriMeshUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/TriMeshUtils.cpp' object='libpISSM_a-TriMeshUtils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-TriMeshUtils.o `test -f './shared/TriMesh/TriMeshUtils.cpp' || echo '$(srcdir)/'`./shared/TriMesh/TriMeshUtils.cpp
+
+libpISSM_a-TriMeshUtils.obj: ./shared/TriMesh/TriMeshUtils.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-TriMeshUtils.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-TriMeshUtils.Tpo -c -o libpISSM_a-TriMeshUtils.obj `if test -f './shared/TriMesh/TriMeshUtils.cpp'; then $(CYGPATH_W) './shared/TriMesh/TriMeshUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/TriMeshUtils.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-TriMeshUtils.Tpo $(DEPDIR)/libpISSM_a-TriMeshUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/TriMesh/TriMeshUtils.cpp' object='libpISSM_a-TriMeshUtils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-TriMeshUtils.obj `if test -f './shared/TriMesh/TriMeshUtils.cpp'; then $(CYGPATH_W) './shared/TriMesh/TriMeshUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/TriMesh/TriMeshUtils.cpp'; fi`
+
+libpISSM_a-binary_search.o: ./shared/Sorting/binary_search.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-binary_search.o -MD -MP -MF $(DEPDIR)/libpISSM_a-binary_search.Tpo -c -o libpISSM_a-binary_search.o `test -f './shared/Sorting/binary_search.cpp' || echo '$(srcdir)/'`./shared/Sorting/binary_search.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-binary_search.Tpo $(DEPDIR)/libpISSM_a-binary_search.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Sorting/binary_search.cpp' object='libpISSM_a-binary_search.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-binary_search.o `test -f './shared/Sorting/binary_search.cpp' || echo '$(srcdir)/'`./shared/Sorting/binary_search.cpp
+
+libpISSM_a-binary_search.obj: ./shared/Sorting/binary_search.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-binary_search.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-binary_search.Tpo -c -o libpISSM_a-binary_search.obj `if test -f './shared/Sorting/binary_search.cpp'; then $(CYGPATH_W) './shared/Sorting/binary_search.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Sorting/binary_search.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-binary_search.Tpo $(DEPDIR)/libpISSM_a-binary_search.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Sorting/binary_search.cpp' object='libpISSM_a-binary_search.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-binary_search.obj `if test -f './shared/Sorting/binary_search.cpp'; then $(CYGPATH_W) './shared/Sorting/binary_search.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Sorting/binary_search.cpp'; fi`
+
+libpISSM_a-ResolvePointers.o: ./shared/Elements/ResolvePointers.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ResolvePointers.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ResolvePointers.Tpo -c -o libpISSM_a-ResolvePointers.o `test -f './shared/Elements/ResolvePointers.cpp' || echo '$(srcdir)/'`./shared/Elements/ResolvePointers.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ResolvePointers.Tpo $(DEPDIR)/libpISSM_a-ResolvePointers.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/ResolvePointers.cpp' object='libpISSM_a-ResolvePointers.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ResolvePointers.o `test -f './shared/Elements/ResolvePointers.cpp' || echo '$(srcdir)/'`./shared/Elements/ResolvePointers.cpp
+
+libpISSM_a-ResolvePointers.obj: ./shared/Elements/ResolvePointers.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ResolvePointers.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ResolvePointers.Tpo -c -o libpISSM_a-ResolvePointers.obj `if test -f './shared/Elements/ResolvePointers.cpp'; then $(CYGPATH_W) './shared/Elements/ResolvePointers.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/ResolvePointers.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ResolvePointers.Tpo $(DEPDIR)/libpISSM_a-ResolvePointers.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/ResolvePointers.cpp' object='libpISSM_a-ResolvePointers.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ResolvePointers.obj `if test -f './shared/Elements/ResolvePointers.cpp'; then $(CYGPATH_W) './shared/Elements/ResolvePointers.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/ResolvePointers.cpp'; fi`
+
+libpISSM_a-Paterson.o: ./shared/Elements/Paterson.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Paterson.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Paterson.Tpo -c -o libpISSM_a-Paterson.o `test -f './shared/Elements/Paterson.cpp' || echo '$(srcdir)/'`./shared/Elements/Paterson.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Paterson.Tpo $(DEPDIR)/libpISSM_a-Paterson.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/Paterson.cpp' object='libpISSM_a-Paterson.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Paterson.o `test -f './shared/Elements/Paterson.cpp' || echo '$(srcdir)/'`./shared/Elements/Paterson.cpp
+
+libpISSM_a-Paterson.obj: ./shared/Elements/Paterson.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Paterson.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Paterson.Tpo -c -o libpISSM_a-Paterson.obj `if test -f './shared/Elements/Paterson.cpp'; then $(CYGPATH_W) './shared/Elements/Paterson.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/Paterson.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Paterson.Tpo $(DEPDIR)/libpISSM_a-Paterson.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/Paterson.cpp' object='libpISSM_a-Paterson.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Paterson.obj `if test -f './shared/Elements/Paterson.cpp'; then $(CYGPATH_W) './shared/Elements/Paterson.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/Paterson.cpp'; fi`
+
+libpISSM_a-GetElementNodeData.o: ./shared/Elements/GetElementNodeData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-GetElementNodeData.o -MD -MP -MF $(DEPDIR)/libpISSM_a-GetElementNodeData.Tpo -c -o libpISSM_a-GetElementNodeData.o `test -f './shared/Elements/GetElementNodeData.cpp' || echo '$(srcdir)/'`./shared/Elements/GetElementNodeData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-GetElementNodeData.Tpo $(DEPDIR)/libpISSM_a-GetElementNodeData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/GetElementNodeData.cpp' object='libpISSM_a-GetElementNodeData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-GetElementNodeData.o `test -f './shared/Elements/GetElementNodeData.cpp' || echo '$(srcdir)/'`./shared/Elements/GetElementNodeData.cpp
+
+libpISSM_a-GetElementNodeData.obj: ./shared/Elements/GetElementNodeData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-GetElementNodeData.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-GetElementNodeData.Tpo -c -o libpISSM_a-GetElementNodeData.obj `if test -f './shared/Elements/GetElementNodeData.cpp'; then $(CYGPATH_W) './shared/Elements/GetElementNodeData.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/GetElementNodeData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-GetElementNodeData.Tpo $(DEPDIR)/libpISSM_a-GetElementNodeData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./shared/Elements/GetElementNodeData.cpp' object='libpISSM_a-GetElementNodeData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-GetElementNodeData.obj `if test -f './shared/Elements/GetElementNodeData.cpp'; then $(CYGPATH_W) './shared/Elements/GetElementNodeData.cpp'; else $(CYGPATH_W) '$(srcdir)/./shared/Elements/GetElementNodeData.cpp'; fi`
+
+libpISSM_a-MatlabMatrixToPetscMatrix.o: ./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatlabMatrixToPetscMatrix.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatlabMatrixToPetscMatrix.Tpo -c -o libpISSM_a-MatlabMatrixToPetscMatrix.o `test -f './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatlabMatrixToPetscMatrix.Tpo $(DEPDIR)/libpISSM_a-MatlabMatrixToPetscMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp' object='libpISSM_a-MatlabMatrixToPetscMatrix.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatlabMatrixToPetscMatrix.o `test -f './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
+
+libpISSM_a-MatlabMatrixToPetscMatrix.obj: ./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatlabMatrixToPetscMatrix.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatlabMatrixToPetscMatrix.Tpo -c -o libpISSM_a-MatlabMatrixToPetscMatrix.obj `if test -f './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatlabMatrixToPetscMatrix.Tpo $(DEPDIR)/libpISSM_a-MatlabMatrixToPetscMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp' object='libpISSM_a-MatlabMatrixToPetscMatrix.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatlabMatrixToPetscMatrix.obj `if test -f './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp'; fi`
+
+libpISSM_a-MatlabVectorToPetscVector.o: ./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatlabVectorToPetscVector.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatlabVectorToPetscVector.Tpo -c -o libpISSM_a-MatlabVectorToPetscVector.o `test -f './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatlabVectorToPetscVector.Tpo $(DEPDIR)/libpISSM_a-MatlabVectorToPetscVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp' object='libpISSM_a-MatlabVectorToPetscVector.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatlabVectorToPetscVector.o `test -f './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
+
+libpISSM_a-MatlabVectorToPetscVector.obj: ./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatlabVectorToPetscVector.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatlabVectorToPetscVector.Tpo -c -o libpISSM_a-MatlabVectorToPetscVector.obj `if test -f './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatlabVectorToPetscVector.Tpo $(DEPDIR)/libpISSM_a-MatlabVectorToPetscVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp' object='libpISSM_a-MatlabVectorToPetscVector.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatlabVectorToPetscVector.obj `if test -f './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp'; fi`
+
+libpISSM_a-PetscMatrixToMatlabMatrix.o: ./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscMatrixToMatlabMatrix.o -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscMatrixToMatlabMatrix.Tpo -c -o libpISSM_a-PetscMatrixToMatlabMatrix.o `test -f './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscMatrixToMatlabMatrix.Tpo $(DEPDIR)/libpISSM_a-PetscMatrixToMatlabMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp' object='libpISSM_a-PetscMatrixToMatlabMatrix.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscMatrixToMatlabMatrix.o `test -f './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
+
+libpISSM_a-PetscMatrixToMatlabMatrix.obj: ./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscMatrixToMatlabMatrix.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscMatrixToMatlabMatrix.Tpo -c -o libpISSM_a-PetscMatrixToMatlabMatrix.obj `if test -f './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscMatrixToMatlabMatrix.Tpo $(DEPDIR)/libpISSM_a-PetscMatrixToMatlabMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp' object='libpISSM_a-PetscMatrixToMatlabMatrix.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscMatrixToMatlabMatrix.obj `if test -f './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp'; fi`
+
+libpISSM_a-PetscVectorToMatlabVector.o: ./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscVectorToMatlabVector.o -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscVectorToMatlabVector.Tpo -c -o libpISSM_a-PetscVectorToMatlabVector.o `test -f './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscVectorToMatlabVector.Tpo $(DEPDIR)/libpISSM_a-PetscVectorToMatlabVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp' object='libpISSM_a-PetscVectorToMatlabVector.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscVectorToMatlabVector.o `test -f './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
+
+libpISSM_a-PetscVectorToMatlabVector.obj: ./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscVectorToMatlabVector.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscVectorToMatlabVector.Tpo -c -o libpISSM_a-PetscVectorToMatlabVector.obj `if test -f './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscVectorToMatlabVector.Tpo $(DEPDIR)/libpISSM_a-PetscVectorToMatlabVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp' object='libpISSM_a-PetscVectorToMatlabVector.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscVectorToMatlabVector.obj `if test -f './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp'; fi`
+
+libpISSM_a-MatlabMatrixToDoubleMatrix.o: ./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatlabMatrixToDoubleMatrix.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatlabMatrixToDoubleMatrix.Tpo -c -o libpISSM_a-MatlabMatrixToDoubleMatrix.o `test -f './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatlabMatrixToDoubleMatrix.Tpo $(DEPDIR)/libpISSM_a-MatlabMatrixToDoubleMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp' object='libpISSM_a-MatlabMatrixToDoubleMatrix.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatlabMatrixToDoubleMatrix.o `test -f './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
+
+libpISSM_a-MatlabMatrixToDoubleMatrix.obj: ./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatlabMatrixToDoubleMatrix.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatlabMatrixToDoubleMatrix.Tpo -c -o libpISSM_a-MatlabMatrixToDoubleMatrix.obj `if test -f './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatlabMatrixToDoubleMatrix.Tpo $(DEPDIR)/libpISSM_a-MatlabMatrixToDoubleMatrix.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp' object='libpISSM_a-MatlabMatrixToDoubleMatrix.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatlabMatrixToDoubleMatrix.obj `if test -f './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp'; fi`
+
+libpISSM_a-MatlabVectorToDoubleVector.o: ./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatlabVectorToDoubleVector.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatlabVectorToDoubleVector.Tpo -c -o libpISSM_a-MatlabVectorToDoubleVector.o `test -f './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatlabVectorToDoubleVector.Tpo $(DEPDIR)/libpISSM_a-MatlabVectorToDoubleVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp' object='libpISSM_a-MatlabVectorToDoubleVector.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatlabVectorToDoubleVector.o `test -f './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
+
+libpISSM_a-MatlabVectorToDoubleVector.obj: ./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatlabVectorToDoubleVector.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatlabVectorToDoubleVector.Tpo -c -o libpISSM_a-MatlabVectorToDoubleVector.obj `if test -f './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatlabVectorToDoubleVector.Tpo $(DEPDIR)/libpISSM_a-MatlabVectorToDoubleVector.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp' object='libpISSM_a-MatlabVectorToDoubleVector.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatlabVectorToDoubleVector.obj `if test -f './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp'; fi`
+
+libpISSM_a-PetscDetermineLocalSize.o: ./toolkits/petsc/patches/PetscDetermineLocalSize.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscDetermineLocalSize.o -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscDetermineLocalSize.Tpo -c -o libpISSM_a-PetscDetermineLocalSize.o `test -f './toolkits/petsc/patches/PetscDetermineLocalSize.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscDetermineLocalSize.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscDetermineLocalSize.Tpo $(DEPDIR)/libpISSM_a-PetscDetermineLocalSize.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscDetermineLocalSize.cpp' object='libpISSM_a-PetscDetermineLocalSize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscDetermineLocalSize.o `test -f './toolkits/petsc/patches/PetscDetermineLocalSize.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscDetermineLocalSize.cpp
+
+libpISSM_a-PetscDetermineLocalSize.obj: ./toolkits/petsc/patches/PetscDetermineLocalSize.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscDetermineLocalSize.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscDetermineLocalSize.Tpo -c -o libpISSM_a-PetscDetermineLocalSize.obj `if test -f './toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscDetermineLocalSize.Tpo $(DEPDIR)/libpISSM_a-PetscDetermineLocalSize.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscDetermineLocalSize.cpp' object='libpISSM_a-PetscDetermineLocalSize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscDetermineLocalSize.obj `if test -f './toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscDetermineLocalSize.cpp'; fi`
+
+libpISSM_a-VecTranspose.o: ./toolkits/petsc/patches/VecTranspose.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecTranspose.o -MD -MP -MF $(DEPDIR)/libpISSM_a-VecTranspose.Tpo -c -o libpISSM_a-VecTranspose.o `test -f './toolkits/petsc/patches/VecTranspose.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecTranspose.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecTranspose.Tpo $(DEPDIR)/libpISSM_a-VecTranspose.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecTranspose.cpp' object='libpISSM_a-VecTranspose.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecTranspose.o `test -f './toolkits/petsc/patches/VecTranspose.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecTranspose.cpp
+
+libpISSM_a-VecTranspose.obj: ./toolkits/petsc/patches/VecTranspose.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecTranspose.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-VecTranspose.Tpo -c -o libpISSM_a-VecTranspose.obj `if test -f './toolkits/petsc/patches/VecTranspose.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecTranspose.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecTranspose.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecTranspose.Tpo $(DEPDIR)/libpISSM_a-VecTranspose.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecTranspose.cpp' object='libpISSM_a-VecTranspose.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecTranspose.obj `if test -f './toolkits/petsc/patches/VecTranspose.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecTranspose.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecTranspose.cpp'; fi`
+
+libpISSM_a-VecToMPISerial.o: ./toolkits/petsc/patches/VecToMPISerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecToMPISerial.o -MD -MP -MF $(DEPDIR)/libpISSM_a-VecToMPISerial.Tpo -c -o libpISSM_a-VecToMPISerial.o `test -f './toolkits/petsc/patches/VecToMPISerial.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecToMPISerial.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecToMPISerial.Tpo $(DEPDIR)/libpISSM_a-VecToMPISerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecToMPISerial.cpp' object='libpISSM_a-VecToMPISerial.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecToMPISerial.o `test -f './toolkits/petsc/patches/VecToMPISerial.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecToMPISerial.cpp
+
+libpISSM_a-VecToMPISerial.obj: ./toolkits/petsc/patches/VecToMPISerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecToMPISerial.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-VecToMPISerial.Tpo -c -o libpISSM_a-VecToMPISerial.obj `if test -f './toolkits/petsc/patches/VecToMPISerial.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecToMPISerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecToMPISerial.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecToMPISerial.Tpo $(DEPDIR)/libpISSM_a-VecToMPISerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecToMPISerial.cpp' object='libpISSM_a-VecToMPISerial.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecToMPISerial.obj `if test -f './toolkits/petsc/patches/VecToMPISerial.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecToMPISerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecToMPISerial.cpp'; fi`
+
+libpISSM_a-MatToSerial.o: ./toolkits/petsc/patches/MatToSerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatToSerial.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatToSerial.Tpo -c -o libpISSM_a-MatToSerial.o `test -f './toolkits/petsc/patches/MatToSerial.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatToSerial.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatToSerial.Tpo $(DEPDIR)/libpISSM_a-MatToSerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatToSerial.cpp' object='libpISSM_a-MatToSerial.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatToSerial.o `test -f './toolkits/petsc/patches/MatToSerial.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatToSerial.cpp
+
+libpISSM_a-MatToSerial.obj: ./toolkits/petsc/patches/MatToSerial.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatToSerial.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatToSerial.Tpo -c -o libpISSM_a-MatToSerial.obj `if test -f './toolkits/petsc/patches/MatToSerial.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatToSerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatToSerial.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatToSerial.Tpo $(DEPDIR)/libpISSM_a-MatToSerial.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatToSerial.cpp' object='libpISSM_a-MatToSerial.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatToSerial.obj `if test -f './toolkits/petsc/patches/MatToSerial.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatToSerial.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatToSerial.cpp'; fi`
+
+libpISSM_a-VecMerge.o: ./toolkits/petsc/patches/VecMerge.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecMerge.o -MD -MP -MF $(DEPDIR)/libpISSM_a-VecMerge.Tpo -c -o libpISSM_a-VecMerge.o `test -f './toolkits/petsc/patches/VecMerge.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecMerge.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecMerge.Tpo $(DEPDIR)/libpISSM_a-VecMerge.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecMerge.cpp' object='libpISSM_a-VecMerge.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecMerge.o `test -f './toolkits/petsc/patches/VecMerge.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecMerge.cpp
+
+libpISSM_a-VecMerge.obj: ./toolkits/petsc/patches/VecMerge.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecMerge.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-VecMerge.Tpo -c -o libpISSM_a-VecMerge.obj `if test -f './toolkits/petsc/patches/VecMerge.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecMerge.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecMerge.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecMerge.Tpo $(DEPDIR)/libpISSM_a-VecMerge.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecMerge.cpp' object='libpISSM_a-VecMerge.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecMerge.obj `if test -f './toolkits/petsc/patches/VecMerge.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecMerge.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecMerge.cpp'; fi`
+
+libpISSM_a-NewVec.o: ./toolkits/petsc/patches/NewVec.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NewVec.o -MD -MP -MF $(DEPDIR)/libpISSM_a-NewVec.Tpo -c -o libpISSM_a-NewVec.o `test -f './toolkits/petsc/patches/NewVec.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewVec.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NewVec.Tpo $(DEPDIR)/libpISSM_a-NewVec.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewVec.cpp' object='libpISSM_a-NewVec.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NewVec.o `test -f './toolkits/petsc/patches/NewVec.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewVec.cpp
+
+libpISSM_a-NewVec.obj: ./toolkits/petsc/patches/NewVec.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NewVec.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-NewVec.Tpo -c -o libpISSM_a-NewVec.obj `if test -f './toolkits/petsc/patches/NewVec.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewVec.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewVec.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NewVec.Tpo $(DEPDIR)/libpISSM_a-NewVec.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewVec.cpp' object='libpISSM_a-NewVec.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NewVec.obj `if test -f './toolkits/petsc/patches/NewVec.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewVec.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewVec.cpp'; fi`
+
+libpISSM_a-NewVecFromLocalSize.o: ./toolkits/petsc/patches/NewVecFromLocalSize.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NewVecFromLocalSize.o -MD -MP -MF $(DEPDIR)/libpISSM_a-NewVecFromLocalSize.Tpo -c -o libpISSM_a-NewVecFromLocalSize.o `test -f './toolkits/petsc/patches/NewVecFromLocalSize.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewVecFromLocalSize.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NewVecFromLocalSize.Tpo $(DEPDIR)/libpISSM_a-NewVecFromLocalSize.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewVecFromLocalSize.cpp' object='libpISSM_a-NewVecFromLocalSize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NewVecFromLocalSize.o `test -f './toolkits/petsc/patches/NewVecFromLocalSize.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewVecFromLocalSize.cpp
+
+libpISSM_a-NewVecFromLocalSize.obj: ./toolkits/petsc/patches/NewVecFromLocalSize.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NewVecFromLocalSize.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-NewVecFromLocalSize.Tpo -c -o libpISSM_a-NewVecFromLocalSize.obj `if test -f './toolkits/petsc/patches/NewVecFromLocalSize.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewVecFromLocalSize.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewVecFromLocalSize.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NewVecFromLocalSize.Tpo $(DEPDIR)/libpISSM_a-NewVecFromLocalSize.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewVecFromLocalSize.cpp' object='libpISSM_a-NewVecFromLocalSize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NewVecFromLocalSize.obj `if test -f './toolkits/petsc/patches/NewVecFromLocalSize.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewVecFromLocalSize.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewVecFromLocalSize.cpp'; fi`
+
+libpISSM_a-PetscOptionsDetermineSolverType.o: ./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscOptionsDetermineSolverType.o -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscOptionsDetermineSolverType.Tpo -c -o libpISSM_a-PetscOptionsDetermineSolverType.o `test -f './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscOptionsDetermineSolverType.Tpo $(DEPDIR)/libpISSM_a-PetscOptionsDetermineSolverType.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp' object='libpISSM_a-PetscOptionsDetermineSolverType.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscOptionsDetermineSolverType.o `test -f './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
+
+libpISSM_a-PetscOptionsDetermineSolverType.obj: ./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscOptionsDetermineSolverType.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscOptionsDetermineSolverType.Tpo -c -o libpISSM_a-PetscOptionsDetermineSolverType.obj `if test -f './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscOptionsDetermineSolverType.Tpo $(DEPDIR)/libpISSM_a-PetscOptionsDetermineSolverType.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp' object='libpISSM_a-PetscOptionsDetermineSolverType.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscOptionsDetermineSolverType.obj `if test -f './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp'; fi`
+
+libpISSM_a-PetscOptionsInsertMultipleString.o: ./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscOptionsInsertMultipleString.o -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscOptionsInsertMultipleString.Tpo -c -o libpISSM_a-PetscOptionsInsertMultipleString.o `test -f './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscOptionsInsertMultipleString.Tpo $(DEPDIR)/libpISSM_a-PetscOptionsInsertMultipleString.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp' object='libpISSM_a-PetscOptionsInsertMultipleString.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscOptionsInsertMultipleString.o `test -f './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+
+libpISSM_a-PetscOptionsInsertMultipleString.obj: ./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PetscOptionsInsertMultipleString.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-PetscOptionsInsertMultipleString.Tpo -c -o libpISSM_a-PetscOptionsInsertMultipleString.obj `if test -f './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PetscOptionsInsertMultipleString.Tpo $(DEPDIR)/libpISSM_a-PetscOptionsInsertMultipleString.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp' object='libpISSM_a-PetscOptionsInsertMultipleString.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PetscOptionsInsertMultipleString.obj `if test -f './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp'; fi`
+
+libpISSM_a-NewMat.o: ./toolkits/petsc/patches/NewMat.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NewMat.o -MD -MP -MF $(DEPDIR)/libpISSM_a-NewMat.Tpo -c -o libpISSM_a-NewMat.o `test -f './toolkits/petsc/patches/NewMat.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewMat.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NewMat.Tpo $(DEPDIR)/libpISSM_a-NewMat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewMat.cpp' object='libpISSM_a-NewMat.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NewMat.o `test -f './toolkits/petsc/patches/NewMat.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/NewMat.cpp
+
+libpISSM_a-NewMat.obj: ./toolkits/petsc/patches/NewMat.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NewMat.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-NewMat.Tpo -c -o libpISSM_a-NewMat.obj `if test -f './toolkits/petsc/patches/NewMat.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewMat.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewMat.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NewMat.Tpo $(DEPDIR)/libpISSM_a-NewMat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/NewMat.cpp' object='libpISSM_a-NewMat.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NewMat.obj `if test -f './toolkits/petsc/patches/NewMat.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/NewMat.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/NewMat.cpp'; fi`
+
+libpISSM_a-VecFree.o: ./toolkits/petsc/patches/VecFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecFree.o -MD -MP -MF $(DEPDIR)/libpISSM_a-VecFree.Tpo -c -o libpISSM_a-VecFree.o `test -f './toolkits/petsc/patches/VecFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecFree.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecFree.Tpo $(DEPDIR)/libpISSM_a-VecFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecFree.cpp' object='libpISSM_a-VecFree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecFree.o `test -f './toolkits/petsc/patches/VecFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecFree.cpp
+
+libpISSM_a-VecFree.obj: ./toolkits/petsc/patches/VecFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecFree.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-VecFree.Tpo -c -o libpISSM_a-VecFree.obj `if test -f './toolkits/petsc/patches/VecFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecFree.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecFree.Tpo $(DEPDIR)/libpISSM_a-VecFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecFree.cpp' object='libpISSM_a-VecFree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecFree.obj `if test -f './toolkits/petsc/patches/VecFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecFree.cpp'; fi`
+
+libpISSM_a-KSPFree.o: ./toolkits/petsc/patches/KSPFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-KSPFree.o -MD -MP -MF $(DEPDIR)/libpISSM_a-KSPFree.Tpo -c -o libpISSM_a-KSPFree.o `test -f './toolkits/petsc/patches/KSPFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/KSPFree.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-KSPFree.Tpo $(DEPDIR)/libpISSM_a-KSPFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/KSPFree.cpp' object='libpISSM_a-KSPFree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-KSPFree.o `test -f './toolkits/petsc/patches/KSPFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/KSPFree.cpp
+
+libpISSM_a-KSPFree.obj: ./toolkits/petsc/patches/KSPFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-KSPFree.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-KSPFree.Tpo -c -o libpISSM_a-KSPFree.obj `if test -f './toolkits/petsc/patches/KSPFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/KSPFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/KSPFree.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-KSPFree.Tpo $(DEPDIR)/libpISSM_a-KSPFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/KSPFree.cpp' object='libpISSM_a-KSPFree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-KSPFree.obj `if test -f './toolkits/petsc/patches/KSPFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/KSPFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/KSPFree.cpp'; fi`
+
+libpISSM_a-ISFree.o: ./toolkits/petsc/patches/ISFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ISFree.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ISFree.Tpo -c -o libpISSM_a-ISFree.o `test -f './toolkits/petsc/patches/ISFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/ISFree.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ISFree.Tpo $(DEPDIR)/libpISSM_a-ISFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/ISFree.cpp' object='libpISSM_a-ISFree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ISFree.o `test -f './toolkits/petsc/patches/ISFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/ISFree.cpp
+
+libpISSM_a-ISFree.obj: ./toolkits/petsc/patches/ISFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ISFree.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ISFree.Tpo -c -o libpISSM_a-ISFree.obj `if test -f './toolkits/petsc/patches/ISFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/ISFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/ISFree.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ISFree.Tpo $(DEPDIR)/libpISSM_a-ISFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/ISFree.cpp' object='libpISSM_a-ISFree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ISFree.obj `if test -f './toolkits/petsc/patches/ISFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/ISFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/ISFree.cpp'; fi`
+
+libpISSM_a-MatFree.o: ./toolkits/petsc/patches/MatFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatFree.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatFree.Tpo -c -o libpISSM_a-MatFree.o `test -f './toolkits/petsc/patches/MatFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatFree.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatFree.Tpo $(DEPDIR)/libpISSM_a-MatFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatFree.cpp' object='libpISSM_a-MatFree.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatFree.o `test -f './toolkits/petsc/patches/MatFree.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatFree.cpp
+
+libpISSM_a-MatFree.obj: ./toolkits/petsc/patches/MatFree.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatFree.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatFree.Tpo -c -o libpISSM_a-MatFree.obj `if test -f './toolkits/petsc/patches/MatFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatFree.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatFree.Tpo $(DEPDIR)/libpISSM_a-MatFree.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatFree.cpp' object='libpISSM_a-MatFree.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatFree.obj `if test -f './toolkits/petsc/patches/MatFree.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatFree.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatFree.cpp'; fi`
+
+libpISSM_a-GetOwnershipBoundariesFromRange.o: ./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-GetOwnershipBoundariesFromRange.o -MD -MP -MF $(DEPDIR)/libpISSM_a-GetOwnershipBoundariesFromRange.Tpo -c -o libpISSM_a-GetOwnershipBoundariesFromRange.o `test -f './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-GetOwnershipBoundariesFromRange.Tpo $(DEPDIR)/libpISSM_a-GetOwnershipBoundariesFromRange.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp' object='libpISSM_a-GetOwnershipBoundariesFromRange.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-GetOwnershipBoundariesFromRange.o `test -f './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
+
+libpISSM_a-GetOwnershipBoundariesFromRange.obj: ./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-GetOwnershipBoundariesFromRange.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-GetOwnershipBoundariesFromRange.Tpo -c -o libpISSM_a-GetOwnershipBoundariesFromRange.obj `if test -f './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-GetOwnershipBoundariesFromRange.Tpo $(DEPDIR)/libpISSM_a-GetOwnershipBoundariesFromRange.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp' object='libpISSM_a-GetOwnershipBoundariesFromRange.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-GetOwnershipBoundariesFromRange.obj `if test -f './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp'; fi`
+
+libpISSM_a-VecPartition.o: ./toolkits/petsc/patches/VecPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecPartition.o -MD -MP -MF $(DEPDIR)/libpISSM_a-VecPartition.Tpo -c -o libpISSM_a-VecPartition.o `test -f './toolkits/petsc/patches/VecPartition.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecPartition.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecPartition.Tpo $(DEPDIR)/libpISSM_a-VecPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecPartition.cpp' object='libpISSM_a-VecPartition.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecPartition.o `test -f './toolkits/petsc/patches/VecPartition.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/VecPartition.cpp
+
+libpISSM_a-VecPartition.obj: ./toolkits/petsc/patches/VecPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-VecPartition.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-VecPartition.Tpo -c -o libpISSM_a-VecPartition.obj `if test -f './toolkits/petsc/patches/VecPartition.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecPartition.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-VecPartition.Tpo $(DEPDIR)/libpISSM_a-VecPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/VecPartition.cpp' object='libpISSM_a-VecPartition.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-VecPartition.obj `if test -f './toolkits/petsc/patches/VecPartition.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/VecPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/VecPartition.cpp'; fi`
+
+libpISSM_a-MatPartition.o: ./toolkits/petsc/patches/MatPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatPartition.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatPartition.Tpo -c -o libpISSM_a-MatPartition.o `test -f './toolkits/petsc/patches/MatPartition.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatPartition.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatPartition.Tpo $(DEPDIR)/libpISSM_a-MatPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatPartition.cpp' object='libpISSM_a-MatPartition.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatPartition.o `test -f './toolkits/petsc/patches/MatPartition.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatPartition.cpp
+
+libpISSM_a-MatPartition.obj: ./toolkits/petsc/patches/MatPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatPartition.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatPartition.Tpo -c -o libpISSM_a-MatPartition.obj `if test -f './toolkits/petsc/patches/MatPartition.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatPartition.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatPartition.Tpo $(DEPDIR)/libpISSM_a-MatPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatPartition.cpp' object='libpISSM_a-MatPartition.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatPartition.obj `if test -f './toolkits/petsc/patches/MatPartition.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatPartition.cpp'; fi`
+
+libpISSM_a-MatInvert.o: ./toolkits/petsc/patches/MatInvert.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatInvert.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatInvert.Tpo -c -o libpISSM_a-MatInvert.o `test -f './toolkits/petsc/patches/MatInvert.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatInvert.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatInvert.Tpo $(DEPDIR)/libpISSM_a-MatInvert.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatInvert.cpp' object='libpISSM_a-MatInvert.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatInvert.o `test -f './toolkits/petsc/patches/MatInvert.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatInvert.cpp
+
+libpISSM_a-MatInvert.obj: ./toolkits/petsc/patches/MatInvert.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatInvert.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatInvert.Tpo -c -o libpISSM_a-MatInvert.obj `if test -f './toolkits/petsc/patches/MatInvert.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatInvert.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatInvert.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatInvert.Tpo $(DEPDIR)/libpISSM_a-MatInvert.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatInvert.cpp' object='libpISSM_a-MatInvert.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatInvert.obj `if test -f './toolkits/petsc/patches/MatInvert.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatInvert.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatInvert.cpp'; fi`
+
+libpISSM_a-MatMultPatch.o: ./toolkits/petsc/patches/MatMultPatch.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatMultPatch.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MatMultPatch.Tpo -c -o libpISSM_a-MatMultPatch.o `test -f './toolkits/petsc/patches/MatMultPatch.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatMultPatch.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatMultPatch.Tpo $(DEPDIR)/libpISSM_a-MatMultPatch.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatMultPatch.cpp' object='libpISSM_a-MatMultPatch.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatMultPatch.o `test -f './toolkits/petsc/patches/MatMultPatch.cpp' || echo '$(srcdir)/'`./toolkits/petsc/patches/MatMultPatch.cpp
+
+libpISSM_a-MatMultPatch.obj: ./toolkits/petsc/patches/MatMultPatch.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MatMultPatch.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MatMultPatch.Tpo -c -o libpISSM_a-MatMultPatch.obj `if test -f './toolkits/petsc/patches/MatMultPatch.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatMultPatch.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatMultPatch.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MatMultPatch.Tpo $(DEPDIR)/libpISSM_a-MatMultPatch.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/petsc/patches/MatMultPatch.cpp' object='libpISSM_a-MatMultPatch.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MatMultPatch.obj `if test -f './toolkits/petsc/patches/MatMultPatch.cpp'; then $(CYGPATH_W) './toolkits/petsc/patches/MatMultPatch.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/petsc/patches/MatMultPatch.cpp'; fi`
+
+libpISSM_a-MPI_Upperrow.o: ./toolkits/mpi/patches/MPI_Upperrow.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MPI_Upperrow.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MPI_Upperrow.Tpo -c -o libpISSM_a-MPI_Upperrow.o `test -f './toolkits/mpi/patches/MPI_Upperrow.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Upperrow.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MPI_Upperrow.Tpo $(DEPDIR)/libpISSM_a-MPI_Upperrow.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Upperrow.cpp' object='libpISSM_a-MPI_Upperrow.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MPI_Upperrow.o `test -f './toolkits/mpi/patches/MPI_Upperrow.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Upperrow.cpp
+
+libpISSM_a-MPI_Upperrow.obj: ./toolkits/mpi/patches/MPI_Upperrow.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MPI_Upperrow.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MPI_Upperrow.Tpo -c -o libpISSM_a-MPI_Upperrow.obj `if test -f './toolkits/mpi/patches/MPI_Upperrow.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Upperrow.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Upperrow.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MPI_Upperrow.Tpo $(DEPDIR)/libpISSM_a-MPI_Upperrow.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Upperrow.cpp' object='libpISSM_a-MPI_Upperrow.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MPI_Upperrow.obj `if test -f './toolkits/mpi/patches/MPI_Upperrow.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Upperrow.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Upperrow.cpp'; fi`
+
+libpISSM_a-MPI_Lowerrow.o: ./toolkits/mpi/patches/MPI_Lowerrow.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MPI_Lowerrow.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MPI_Lowerrow.Tpo -c -o libpISSM_a-MPI_Lowerrow.o `test -f './toolkits/mpi/patches/MPI_Lowerrow.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Lowerrow.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MPI_Lowerrow.Tpo $(DEPDIR)/libpISSM_a-MPI_Lowerrow.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Lowerrow.cpp' object='libpISSM_a-MPI_Lowerrow.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MPI_Lowerrow.o `test -f './toolkits/mpi/patches/MPI_Lowerrow.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Lowerrow.cpp
+
+libpISSM_a-MPI_Lowerrow.obj: ./toolkits/mpi/patches/MPI_Lowerrow.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MPI_Lowerrow.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MPI_Lowerrow.Tpo -c -o libpISSM_a-MPI_Lowerrow.obj `if test -f './toolkits/mpi/patches/MPI_Lowerrow.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Lowerrow.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Lowerrow.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MPI_Lowerrow.Tpo $(DEPDIR)/libpISSM_a-MPI_Lowerrow.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Lowerrow.cpp' object='libpISSM_a-MPI_Lowerrow.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MPI_Lowerrow.obj `if test -f './toolkits/mpi/patches/MPI_Lowerrow.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Lowerrow.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Lowerrow.cpp'; fi`
+
+libpISSM_a-MPI_Boundariesfromrange.o: ./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MPI_Boundariesfromrange.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MPI_Boundariesfromrange.Tpo -c -o libpISSM_a-MPI_Boundariesfromrange.o `test -f './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MPI_Boundariesfromrange.Tpo $(DEPDIR)/libpISSM_a-MPI_Boundariesfromrange.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp' object='libpISSM_a-MPI_Boundariesfromrange.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MPI_Boundariesfromrange.o `test -f './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp' || echo '$(srcdir)/'`./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
+
+libpISSM_a-MPI_Boundariesfromrange.obj: ./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MPI_Boundariesfromrange.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MPI_Boundariesfromrange.Tpo -c -o libpISSM_a-MPI_Boundariesfromrange.obj `if test -f './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MPI_Boundariesfromrange.Tpo $(DEPDIR)/libpISSM_a-MPI_Boundariesfromrange.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp' object='libpISSM_a-MPI_Boundariesfromrange.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MPI_Boundariesfromrange.obj `if test -f './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; then $(CYGPATH_W) './toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; else $(CYGPATH_W) '$(srcdir)/./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp'; fi`
+
+libpISSM_a-FetchData.o: ./io/FetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-FetchData.o -MD -MP -MF $(DEPDIR)/libpISSM_a-FetchData.Tpo -c -o libpISSM_a-FetchData.o `test -f './io/FetchData.cpp' || echo '$(srcdir)/'`./io/FetchData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-FetchData.Tpo $(DEPDIR)/libpISSM_a-FetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/FetchData.cpp' object='libpISSM_a-FetchData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-FetchData.o `test -f './io/FetchData.cpp' || echo '$(srcdir)/'`./io/FetchData.cpp
+
+libpISSM_a-FetchData.obj: ./io/FetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-FetchData.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-FetchData.Tpo -c -o libpISSM_a-FetchData.obj `if test -f './io/FetchData.cpp'; then $(CYGPATH_W) './io/FetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/FetchData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-FetchData.Tpo $(DEPDIR)/libpISSM_a-FetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/FetchData.cpp' object='libpISSM_a-FetchData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-FetchData.obj `if test -f './io/FetchData.cpp'; then $(CYGPATH_W) './io/FetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/FetchData.cpp'; fi`
+
+libpISSM_a-WriteData.o: ./io/WriteData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteData.o -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteData.Tpo -c -o libpISSM_a-WriteData.o `test -f './io/WriteData.cpp' || echo '$(srcdir)/'`./io/WriteData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteData.Tpo $(DEPDIR)/libpISSM_a-WriteData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteData.cpp' object='libpISSM_a-WriteData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteData.o `test -f './io/WriteData.cpp' || echo '$(srcdir)/'`./io/WriteData.cpp
+
+libpISSM_a-WriteData.obj: ./io/WriteData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteData.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteData.Tpo -c -o libpISSM_a-WriteData.obj `if test -f './io/WriteData.cpp'; then $(CYGPATH_W) './io/WriteData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteData.Tpo $(DEPDIR)/libpISSM_a-WriteData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteData.cpp' object='libpISSM_a-WriteData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteData.obj `if test -f './io/WriteData.cpp'; then $(CYGPATH_W) './io/WriteData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteData.cpp'; fi`
+
+libpISSM_a-WriteDataToDisk.o: ./io/WriteDataToDisk.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteDataToDisk.o -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteDataToDisk.Tpo -c -o libpISSM_a-WriteDataToDisk.o `test -f './io/WriteDataToDisk.cpp' || echo '$(srcdir)/'`./io/WriteDataToDisk.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteDataToDisk.Tpo $(DEPDIR)/libpISSM_a-WriteDataToDisk.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteDataToDisk.cpp' object='libpISSM_a-WriteDataToDisk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteDataToDisk.o `test -f './io/WriteDataToDisk.cpp' || echo '$(srcdir)/'`./io/WriteDataToDisk.cpp
+
+libpISSM_a-WriteDataToDisk.obj: ./io/WriteDataToDisk.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteDataToDisk.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteDataToDisk.Tpo -c -o libpISSM_a-WriteDataToDisk.obj `if test -f './io/WriteDataToDisk.cpp'; then $(CYGPATH_W) './io/WriteDataToDisk.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteDataToDisk.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteDataToDisk.Tpo $(DEPDIR)/libpISSM_a-WriteDataToDisk.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteDataToDisk.cpp' object='libpISSM_a-WriteDataToDisk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteDataToDisk.obj `if test -f './io/WriteDataToDisk.cpp'; then $(CYGPATH_W) './io/WriteDataToDisk.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteDataToDisk.cpp'; fi`
+
+libpISSM_a-SerialFetchData.o: ./io/SerialFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SerialFetchData.o -MD -MP -MF $(DEPDIR)/libpISSM_a-SerialFetchData.Tpo -c -o libpISSM_a-SerialFetchData.o `test -f './io/SerialFetchData.cpp' || echo '$(srcdir)/'`./io/SerialFetchData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SerialFetchData.Tpo $(DEPDIR)/libpISSM_a-SerialFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/SerialFetchData.cpp' object='libpISSM_a-SerialFetchData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SerialFetchData.o `test -f './io/SerialFetchData.cpp' || echo '$(srcdir)/'`./io/SerialFetchData.cpp
+
+libpISSM_a-SerialFetchData.obj: ./io/SerialFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SerialFetchData.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-SerialFetchData.Tpo -c -o libpISSM_a-SerialFetchData.obj `if test -f './io/SerialFetchData.cpp'; then $(CYGPATH_W) './io/SerialFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/SerialFetchData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SerialFetchData.Tpo $(DEPDIR)/libpISSM_a-SerialFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/SerialFetchData.cpp' object='libpISSM_a-SerialFetchData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SerialFetchData.obj `if test -f './io/SerialFetchData.cpp'; then $(CYGPATH_W) './io/SerialFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/SerialFetchData.cpp'; fi`
+
+libpISSM_a-SerialWriteData.o: ./io/SerialWriteData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SerialWriteData.o -MD -MP -MF $(DEPDIR)/libpISSM_a-SerialWriteData.Tpo -c -o libpISSM_a-SerialWriteData.o `test -f './io/SerialWriteData.cpp' || echo '$(srcdir)/'`./io/SerialWriteData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SerialWriteData.Tpo $(DEPDIR)/libpISSM_a-SerialWriteData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/SerialWriteData.cpp' object='libpISSM_a-SerialWriteData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SerialWriteData.o `test -f './io/SerialWriteData.cpp' || echo '$(srcdir)/'`./io/SerialWriteData.cpp
+
+libpISSM_a-SerialWriteData.obj: ./io/SerialWriteData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SerialWriteData.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-SerialWriteData.Tpo -c -o libpISSM_a-SerialWriteData.obj `if test -f './io/SerialWriteData.cpp'; then $(CYGPATH_W) './io/SerialWriteData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/SerialWriteData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SerialWriteData.Tpo $(DEPDIR)/libpISSM_a-SerialWriteData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/SerialWriteData.cpp' object='libpISSM_a-SerialWriteData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SerialWriteData.obj `if test -f './io/SerialWriteData.cpp'; then $(CYGPATH_W) './io/SerialWriteData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/SerialWriteData.cpp'; fi`
+
+libpISSM_a-ParallelFetchData.o: ./io/ParallelFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchData.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchData.Tpo -c -o libpISSM_a-ParallelFetchData.o `test -f './io/ParallelFetchData.cpp' || echo '$(srcdir)/'`./io/ParallelFetchData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchData.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchData.cpp' object='libpISSM_a-ParallelFetchData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchData.o `test -f './io/ParallelFetchData.cpp' || echo '$(srcdir)/'`./io/ParallelFetchData.cpp
+
+libpISSM_a-ParallelFetchData.obj: ./io/ParallelFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchData.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchData.Tpo -c -o libpISSM_a-ParallelFetchData.obj `if test -f './io/ParallelFetchData.cpp'; then $(CYGPATH_W) './io/ParallelFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchData.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchData.cpp' object='libpISSM_a-ParallelFetchData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchData.obj `if test -f './io/ParallelFetchData.cpp'; then $(CYGPATH_W) './io/ParallelFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchData.cpp'; fi`
+
+libpISSM_a-ParallelFetchInteger.o: ./io/ParallelFetchInteger.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchInteger.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchInteger.Tpo -c -o libpISSM_a-ParallelFetchInteger.o `test -f './io/ParallelFetchInteger.cpp' || echo '$(srcdir)/'`./io/ParallelFetchInteger.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchInteger.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchInteger.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchInteger.cpp' object='libpISSM_a-ParallelFetchInteger.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchInteger.o `test -f './io/ParallelFetchInteger.cpp' || echo '$(srcdir)/'`./io/ParallelFetchInteger.cpp
+
+libpISSM_a-ParallelFetchInteger.obj: ./io/ParallelFetchInteger.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchInteger.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchInteger.Tpo -c -o libpISSM_a-ParallelFetchInteger.obj `if test -f './io/ParallelFetchInteger.cpp'; then $(CYGPATH_W) './io/ParallelFetchInteger.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchInteger.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchInteger.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchInteger.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchInteger.cpp' object='libpISSM_a-ParallelFetchInteger.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchInteger.obj `if test -f './io/ParallelFetchInteger.cpp'; then $(CYGPATH_W) './io/ParallelFetchInteger.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchInteger.cpp'; fi`
+
+libpISSM_a-ParallelFetchMat.o: ./io/ParallelFetchMat.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchMat.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchMat.Tpo -c -o libpISSM_a-ParallelFetchMat.o `test -f './io/ParallelFetchMat.cpp' || echo '$(srcdir)/'`./io/ParallelFetchMat.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchMat.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchMat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchMat.cpp' object='libpISSM_a-ParallelFetchMat.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchMat.o `test -f './io/ParallelFetchMat.cpp' || echo '$(srcdir)/'`./io/ParallelFetchMat.cpp
+
+libpISSM_a-ParallelFetchMat.obj: ./io/ParallelFetchMat.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchMat.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchMat.Tpo -c -o libpISSM_a-ParallelFetchMat.obj `if test -f './io/ParallelFetchMat.cpp'; then $(CYGPATH_W) './io/ParallelFetchMat.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchMat.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchMat.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchMat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchMat.cpp' object='libpISSM_a-ParallelFetchMat.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchMat.obj `if test -f './io/ParallelFetchMat.cpp'; then $(CYGPATH_W) './io/ParallelFetchMat.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchMat.cpp'; fi`
+
+libpISSM_a-ParallelFetchScalar.o: ./io/ParallelFetchScalar.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchScalar.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchScalar.Tpo -c -o libpISSM_a-ParallelFetchScalar.o `test -f './io/ParallelFetchScalar.cpp' || echo '$(srcdir)/'`./io/ParallelFetchScalar.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchScalar.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchScalar.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchScalar.cpp' object='libpISSM_a-ParallelFetchScalar.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchScalar.o `test -f './io/ParallelFetchScalar.cpp' || echo '$(srcdir)/'`./io/ParallelFetchScalar.cpp
+
+libpISSM_a-ParallelFetchScalar.obj: ./io/ParallelFetchScalar.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchScalar.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchScalar.Tpo -c -o libpISSM_a-ParallelFetchScalar.obj `if test -f './io/ParallelFetchScalar.cpp'; then $(CYGPATH_W) './io/ParallelFetchScalar.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchScalar.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchScalar.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchScalar.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchScalar.cpp' object='libpISSM_a-ParallelFetchScalar.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchScalar.obj `if test -f './io/ParallelFetchScalar.cpp'; then $(CYGPATH_W) './io/ParallelFetchScalar.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchScalar.cpp'; fi`
+
+libpISSM_a-ParallelFetchString.o: ./io/ParallelFetchString.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchString.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchString.Tpo -c -o libpISSM_a-ParallelFetchString.o `test -f './io/ParallelFetchString.cpp' || echo '$(srcdir)/'`./io/ParallelFetchString.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchString.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchString.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchString.cpp' object='libpISSM_a-ParallelFetchString.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchString.o `test -f './io/ParallelFetchString.cpp' || echo '$(srcdir)/'`./io/ParallelFetchString.cpp
+
+libpISSM_a-ParallelFetchString.obj: ./io/ParallelFetchString.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParallelFetchString.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ParallelFetchString.Tpo -c -o libpISSM_a-ParallelFetchString.obj `if test -f './io/ParallelFetchString.cpp'; then $(CYGPATH_W) './io/ParallelFetchString.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchString.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParallelFetchString.Tpo $(DEPDIR)/libpISSM_a-ParallelFetchString.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParallelFetchString.cpp' object='libpISSM_a-ParallelFetchString.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParallelFetchString.obj `if test -f './io/ParallelFetchString.cpp'; then $(CYGPATH_W) './io/ParallelFetchString.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParallelFetchString.cpp'; fi`
+
+libpISSM_a-ModelFetchData.o: ./io/ModelFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ModelFetchData.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ModelFetchData.Tpo -c -o libpISSM_a-ModelFetchData.o `test -f './io/ModelFetchData.cpp' || echo '$(srcdir)/'`./io/ModelFetchData.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ModelFetchData.Tpo $(DEPDIR)/libpISSM_a-ModelFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ModelFetchData.cpp' object='libpISSM_a-ModelFetchData.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ModelFetchData.o `test -f './io/ModelFetchData.cpp' || echo '$(srcdir)/'`./io/ModelFetchData.cpp
+
+libpISSM_a-ModelFetchData.obj: ./io/ModelFetchData.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ModelFetchData.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ModelFetchData.Tpo -c -o libpISSM_a-ModelFetchData.obj `if test -f './io/ModelFetchData.cpp'; then $(CYGPATH_W) './io/ModelFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ModelFetchData.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ModelFetchData.Tpo $(DEPDIR)/libpISSM_a-ModelFetchData.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ModelFetchData.cpp' object='libpISSM_a-ModelFetchData.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ModelFetchData.obj `if test -f './io/ModelFetchData.cpp'; then $(CYGPATH_W) './io/ModelFetchData.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ModelFetchData.cpp'; fi`
+
+libpISSM_a-WriteNodeSets.o: ./io/WriteNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteNodeSets.o -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteNodeSets.Tpo -c -o libpISSM_a-WriteNodeSets.o `test -f './io/WriteNodeSets.cpp' || echo '$(srcdir)/'`./io/WriteNodeSets.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteNodeSets.Tpo $(DEPDIR)/libpISSM_a-WriteNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteNodeSets.cpp' object='libpISSM_a-WriteNodeSets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteNodeSets.o `test -f './io/WriteNodeSets.cpp' || echo '$(srcdir)/'`./io/WriteNodeSets.cpp
+
+libpISSM_a-WriteNodeSets.obj: ./io/WriteNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteNodeSets.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteNodeSets.Tpo -c -o libpISSM_a-WriteNodeSets.obj `if test -f './io/WriteNodeSets.cpp'; then $(CYGPATH_W) './io/WriteNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteNodeSets.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteNodeSets.Tpo $(DEPDIR)/libpISSM_a-WriteNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteNodeSets.cpp' object='libpISSM_a-WriteNodeSets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteNodeSets.obj `if test -f './io/WriteNodeSets.cpp'; then $(CYGPATH_W) './io/WriteNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteNodeSets.cpp'; fi`
+
+libpISSM_a-WriteParams.o: ./io/WriteParams.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteParams.o -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteParams.Tpo -c -o libpISSM_a-WriteParams.o `test -f './io/WriteParams.cpp' || echo '$(srcdir)/'`./io/WriteParams.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteParams.Tpo $(DEPDIR)/libpISSM_a-WriteParams.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteParams.cpp' object='libpISSM_a-WriteParams.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteParams.o `test -f './io/WriteParams.cpp' || echo '$(srcdir)/'`./io/WriteParams.cpp
+
+libpISSM_a-WriteParams.obj: ./io/WriteParams.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteParams.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteParams.Tpo -c -o libpISSM_a-WriteParams.obj `if test -f './io/WriteParams.cpp'; then $(CYGPATH_W) './io/WriteParams.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteParams.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteParams.Tpo $(DEPDIR)/libpISSM_a-WriteParams.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/WriteParams.cpp' object='libpISSM_a-WriteParams.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteParams.obj `if test -f './io/WriteParams.cpp'; then $(CYGPATH_W) './io/WriteParams.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/WriteParams.cpp'; fi`
+
+libpISSM_a-FetchNodeSets.o: ./io/FetchNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-FetchNodeSets.o -MD -MP -MF $(DEPDIR)/libpISSM_a-FetchNodeSets.Tpo -c -o libpISSM_a-FetchNodeSets.o `test -f './io/FetchNodeSets.cpp' || echo '$(srcdir)/'`./io/FetchNodeSets.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-FetchNodeSets.Tpo $(DEPDIR)/libpISSM_a-FetchNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/FetchNodeSets.cpp' object='libpISSM_a-FetchNodeSets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-FetchNodeSets.o `test -f './io/FetchNodeSets.cpp' || echo '$(srcdir)/'`./io/FetchNodeSets.cpp
+
+libpISSM_a-FetchNodeSets.obj: ./io/FetchNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-FetchNodeSets.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-FetchNodeSets.Tpo -c -o libpISSM_a-FetchNodeSets.obj `if test -f './io/FetchNodeSets.cpp'; then $(CYGPATH_W) './io/FetchNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/FetchNodeSets.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-FetchNodeSets.Tpo $(DEPDIR)/libpISSM_a-FetchNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/FetchNodeSets.cpp' object='libpISSM_a-FetchNodeSets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-FetchNodeSets.obj `if test -f './io/FetchNodeSets.cpp'; then $(CYGPATH_W) './io/FetchNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/FetchNodeSets.cpp'; fi`
+
+libpISSM_a-ParameterInputsInit.o: ./io/ParameterInputsInit.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParameterInputsInit.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ParameterInputsInit.Tpo -c -o libpISSM_a-ParameterInputsInit.o `test -f './io/ParameterInputsInit.cpp' || echo '$(srcdir)/'`./io/ParameterInputsInit.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParameterInputsInit.Tpo $(DEPDIR)/libpISSM_a-ParameterInputsInit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParameterInputsInit.cpp' object='libpISSM_a-ParameterInputsInit.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParameterInputsInit.o `test -f './io/ParameterInputsInit.cpp' || echo '$(srcdir)/'`./io/ParameterInputsInit.cpp
+
+libpISSM_a-ParameterInputsInit.obj: ./io/ParameterInputsInit.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ParameterInputsInit.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ParameterInputsInit.Tpo -c -o libpISSM_a-ParameterInputsInit.obj `if test -f './io/ParameterInputsInit.cpp'; then $(CYGPATH_W) './io/ParameterInputsInit.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParameterInputsInit.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ParameterInputsInit.Tpo $(DEPDIR)/libpISSM_a-ParameterInputsInit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./io/ParameterInputsInit.cpp' object='libpISSM_a-ParameterInputsInit.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ParameterInputsInit.obj `if test -f './io/ParameterInputsInit.cpp'; then $(CYGPATH_W) './io/ParameterInputsInit.cpp'; else $(CYGPATH_W) '$(srcdir)/./io/ParameterInputsInit.cpp'; fi`
+
+libpISSM_a-EnumDefinitions.o: ./EnumDefinitions/EnumDefinitions.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-EnumDefinitions.o -MD -MP -MF $(DEPDIR)/libpISSM_a-EnumDefinitions.Tpo -c -o libpISSM_a-EnumDefinitions.o `test -f './EnumDefinitions/EnumDefinitions.cpp' || echo '$(srcdir)/'`./EnumDefinitions/EnumDefinitions.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-EnumDefinitions.Tpo $(DEPDIR)/libpISSM_a-EnumDefinitions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./EnumDefinitions/EnumDefinitions.cpp' object='libpISSM_a-EnumDefinitions.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-EnumDefinitions.o `test -f './EnumDefinitions/EnumDefinitions.cpp' || echo '$(srcdir)/'`./EnumDefinitions/EnumDefinitions.cpp
+
+libpISSM_a-EnumDefinitions.obj: ./EnumDefinitions/EnumDefinitions.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-EnumDefinitions.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-EnumDefinitions.Tpo -c -o libpISSM_a-EnumDefinitions.obj `if test -f './EnumDefinitions/EnumDefinitions.cpp'; then $(CYGPATH_W) './EnumDefinitions/EnumDefinitions.cpp'; else $(CYGPATH_W) '$(srcdir)/./EnumDefinitions/EnumDefinitions.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-EnumDefinitions.Tpo $(DEPDIR)/libpISSM_a-EnumDefinitions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./EnumDefinitions/EnumDefinitions.cpp' object='libpISSM_a-EnumDefinitions.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-EnumDefinitions.obj `if test -f './EnumDefinitions/EnumDefinitions.cpp'; then $(CYGPATH_W) './EnumDefinitions/EnumDefinitions.cpp'; else $(CYGPATH_W) '$(srcdir)/./EnumDefinitions/EnumDefinitions.cpp'; fi`
+
+libpISSM_a-AnalysisTypeAsEnum.o: ./EnumDefinitions/AnalysisTypeAsEnum.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-AnalysisTypeAsEnum.o -MD -MP -MF $(DEPDIR)/libpISSM_a-AnalysisTypeAsEnum.Tpo -c -o libpISSM_a-AnalysisTypeAsEnum.o `test -f './EnumDefinitions/AnalysisTypeAsEnum.cpp' || echo '$(srcdir)/'`./EnumDefinitions/AnalysisTypeAsEnum.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-AnalysisTypeAsEnum.Tpo $(DEPDIR)/libpISSM_a-AnalysisTypeAsEnum.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./EnumDefinitions/AnalysisTypeAsEnum.cpp' object='libpISSM_a-AnalysisTypeAsEnum.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-AnalysisTypeAsEnum.o `test -f './EnumDefinitions/AnalysisTypeAsEnum.cpp' || echo '$(srcdir)/'`./EnumDefinitions/AnalysisTypeAsEnum.cpp
+
+libpISSM_a-AnalysisTypeAsEnum.obj: ./EnumDefinitions/AnalysisTypeAsEnum.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-AnalysisTypeAsEnum.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-AnalysisTypeAsEnum.Tpo -c -o libpISSM_a-AnalysisTypeAsEnum.obj `if test -f './EnumDefinitions/AnalysisTypeAsEnum.cpp'; then $(CYGPATH_W) './EnumDefinitions/AnalysisTypeAsEnum.cpp'; else $(CYGPATH_W) '$(srcdir)/./EnumDefinitions/AnalysisTypeAsEnum.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-AnalysisTypeAsEnum.Tpo $(DEPDIR)/libpISSM_a-AnalysisTypeAsEnum.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./EnumDefinitions/AnalysisTypeAsEnum.cpp' object='libpISSM_a-AnalysisTypeAsEnum.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-AnalysisTypeAsEnum.obj `if test -f './EnumDefinitions/AnalysisTypeAsEnum.cpp'; then $(CYGPATH_W) './EnumDefinitions/AnalysisTypeAsEnum.cpp'; else $(CYGPATH_W) '$(srcdir)/./EnumDefinitions/AnalysisTypeAsEnum.cpp'; fi`
+
+libpISSM_a-Model.o: ./ModelProcessorx/Model.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Model.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Model.Tpo -c -o libpISSM_a-Model.o `test -f './ModelProcessorx/Model.cpp' || echo '$(srcdir)/'`./ModelProcessorx/Model.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Model.Tpo $(DEPDIR)/libpISSM_a-Model.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/Model.cpp' object='libpISSM_a-Model.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Model.o `test -f './ModelProcessorx/Model.cpp' || echo '$(srcdir)/'`./ModelProcessorx/Model.cpp
+
+libpISSM_a-Model.obj: ./ModelProcessorx/Model.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Model.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Model.Tpo -c -o libpISSM_a-Model.obj `if test -f './ModelProcessorx/Model.cpp'; then $(CYGPATH_W) './ModelProcessorx/Model.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/Model.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Model.Tpo $(DEPDIR)/libpISSM_a-Model.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/Model.cpp' object='libpISSM_a-Model.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Model.obj `if test -f './ModelProcessorx/Model.cpp'; then $(CYGPATH_W) './ModelProcessorx/Model.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/Model.cpp'; fi`
+
+libpISSM_a-FetchRifts.o: ./ModelProcessorx/FetchRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-FetchRifts.o -MD -MP -MF $(DEPDIR)/libpISSM_a-FetchRifts.Tpo -c -o libpISSM_a-FetchRifts.o `test -f './ModelProcessorx/FetchRifts.cpp' || echo '$(srcdir)/'`./ModelProcessorx/FetchRifts.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-FetchRifts.Tpo $(DEPDIR)/libpISSM_a-FetchRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/FetchRifts.cpp' object='libpISSM_a-FetchRifts.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-FetchRifts.o `test -f './ModelProcessorx/FetchRifts.cpp' || echo '$(srcdir)/'`./ModelProcessorx/FetchRifts.cpp
+
+libpISSM_a-FetchRifts.obj: ./ModelProcessorx/FetchRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-FetchRifts.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-FetchRifts.Tpo -c -o libpISSM_a-FetchRifts.obj `if test -f './ModelProcessorx/FetchRifts.cpp'; then $(CYGPATH_W) './ModelProcessorx/FetchRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/FetchRifts.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-FetchRifts.Tpo $(DEPDIR)/libpISSM_a-FetchRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/FetchRifts.cpp' object='libpISSM_a-FetchRifts.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-FetchRifts.obj `if test -f './ModelProcessorx/FetchRifts.cpp'; then $(CYGPATH_W) './ModelProcessorx/FetchRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/FetchRifts.cpp'; fi`
+
+libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o: ./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o -MD -MP -MF $(DEPDIR)/libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Tpo -c -o libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Tpo $(DEPDIR)/libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp' object='libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
+
+libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj: ./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Tpo -c -o libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Tpo $(DEPDIR)/libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp' object='libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CreateElementsNodesAndMaterialsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp'; fi`
+
+libpISSM_a-DistributeNumDofs.o: ./ModelProcessorx/DistributeNumDofs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-DistributeNumDofs.o -MD -MP -MF $(DEPDIR)/libpISSM_a-DistributeNumDofs.Tpo -c -o libpISSM_a-DistributeNumDofs.o `test -f './ModelProcessorx/DistributeNumDofs.cpp' || echo '$(srcdir)/'`./ModelProcessorx/DistributeNumDofs.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-DistributeNumDofs.Tpo $(DEPDIR)/libpISSM_a-DistributeNumDofs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/DistributeNumDofs.cpp' object='libpISSM_a-DistributeNumDofs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-DistributeNumDofs.o `test -f './ModelProcessorx/DistributeNumDofs.cpp' || echo '$(srcdir)/'`./ModelProcessorx/DistributeNumDofs.cpp
+
+libpISSM_a-DistributeNumDofs.obj: ./ModelProcessorx/DistributeNumDofs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-DistributeNumDofs.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-DistributeNumDofs.Tpo -c -o libpISSM_a-DistributeNumDofs.obj `if test -f './ModelProcessorx/DistributeNumDofs.cpp'; then $(CYGPATH_W) './ModelProcessorx/DistributeNumDofs.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/DistributeNumDofs.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-DistributeNumDofs.Tpo $(DEPDIR)/libpISSM_a-DistributeNumDofs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/DistributeNumDofs.cpp' object='libpISSM_a-DistributeNumDofs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-DistributeNumDofs.obj `if test -f './ModelProcessorx/DistributeNumDofs.cpp'; then $(CYGPATH_W) './ModelProcessorx/DistributeNumDofs.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/DistributeNumDofs.cpp'; fi`
+
+libpISSM_a-CreateConstraintsDiagnosticHoriz.o: ./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CreateConstraintsDiagnosticHoriz.o -MD -MP -MF $(DEPDIR)/libpISSM_a-CreateConstraintsDiagnosticHoriz.Tpo -c -o libpISSM_a-CreateConstraintsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CreateConstraintsDiagnosticHoriz.Tpo $(DEPDIR)/libpISSM_a-CreateConstraintsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp' object='libpISSM_a-CreateConstraintsDiagnosticHoriz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CreateConstraintsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp
+
+libpISSM_a-CreateConstraintsDiagnosticHoriz.obj: ./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CreateConstraintsDiagnosticHoriz.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-CreateConstraintsDiagnosticHoriz.Tpo -c -o libpISSM_a-CreateConstraintsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CreateConstraintsDiagnosticHoriz.Tpo $(DEPDIR)/libpISSM_a-CreateConstraintsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp' object='libpISSM_a-CreateConstraintsDiagnosticHoriz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CreateConstraintsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp'; fi`
+
+libpISSM_a-CreateLoadsDiagnosticHoriz.o: ./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CreateLoadsDiagnosticHoriz.o -MD -MP -MF $(DEPDIR)/libpISSM_a-CreateLoadsDiagnosticHoriz.Tpo -c -o libpISSM_a-CreateLoadsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CreateLoadsDiagnosticHoriz.Tpo $(DEPDIR)/libpISSM_a-CreateLoadsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp' object='libpISSM_a-CreateLoadsDiagnosticHoriz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CreateLoadsDiagnosticHoriz.o `test -f './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp' || echo '$(srcdir)/'`./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp
+
+libpISSM_a-CreateLoadsDiagnosticHoriz.obj: ./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CreateLoadsDiagnosticHoriz.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-CreateLoadsDiagnosticHoriz.Tpo -c -o libpISSM_a-CreateLoadsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CreateLoadsDiagnosticHoriz.Tpo $(DEPDIR)/libpISSM_a-CreateLoadsDiagnosticHoriz.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp' object='libpISSM_a-CreateLoadsDiagnosticHoriz.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CreateLoadsDiagnosticHoriz.obj `if test -f './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; then $(CYGPATH_W) './ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp'; fi`
+
+libpISSM_a-ModelCreateParameters.o: ./ModelProcessorx/ModelCreateParameters.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ModelCreateParameters.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ModelCreateParameters.Tpo -c -o libpISSM_a-ModelCreateParameters.o `test -f './ModelProcessorx/ModelCreateParameters.cpp' || echo '$(srcdir)/'`./ModelProcessorx/ModelCreateParameters.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ModelCreateParameters.Tpo $(DEPDIR)/libpISSM_a-ModelCreateParameters.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/ModelCreateParameters.cpp' object='libpISSM_a-ModelCreateParameters.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ModelCreateParameters.o `test -f './ModelProcessorx/ModelCreateParameters.cpp' || echo '$(srcdir)/'`./ModelProcessorx/ModelCreateParameters.cpp
+
+libpISSM_a-ModelCreateParameters.obj: ./ModelProcessorx/ModelCreateParameters.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ModelCreateParameters.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ModelCreateParameters.Tpo -c -o libpISSM_a-ModelCreateParameters.obj `if test -f './ModelProcessorx/ModelCreateParameters.cpp'; then $(CYGPATH_W) './ModelProcessorx/ModelCreateParameters.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/ModelCreateParameters.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ModelCreateParameters.Tpo $(DEPDIR)/libpISSM_a-ModelCreateParameters.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ModelProcessorx/ModelCreateParameters.cpp' object='libpISSM_a-ModelCreateParameters.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ModelCreateParameters.obj `if test -f './ModelProcessorx/ModelCreateParameters.cpp'; then $(CYGPATH_W) './ModelProcessorx/ModelCreateParameters.cpp'; else $(CYGPATH_W) '$(srcdir)/./ModelProcessorx/ModelCreateParameters.cpp'; fi`
+
+libpISSM_a-Dofx.o: ./Dofx/Dofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Dofx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Dofx.Tpo -c -o libpISSM_a-Dofx.o `test -f './Dofx/Dofx.cpp' || echo '$(srcdir)/'`./Dofx/Dofx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Dofx.Tpo $(DEPDIR)/libpISSM_a-Dofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Dofx/Dofx.cpp' object='libpISSM_a-Dofx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Dofx.o `test -f './Dofx/Dofx.cpp' || echo '$(srcdir)/'`./Dofx/Dofx.cpp
+
+libpISSM_a-Dofx.obj: ./Dofx/Dofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Dofx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Dofx.Tpo -c -o libpISSM_a-Dofx.obj `if test -f './Dofx/Dofx.cpp'; then $(CYGPATH_W) './Dofx/Dofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Dofx/Dofx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Dofx.Tpo $(DEPDIR)/libpISSM_a-Dofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Dofx/Dofx.cpp' object='libpISSM_a-Dofx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Dofx.obj `if test -f './Dofx/Dofx.cpp'; then $(CYGPATH_W) './Dofx/Dofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Dofx/Dofx.cpp'; fi`
+
+libpISSM_a-Dux.o: ./Dux/Dux.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Dux.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Dux.Tpo -c -o libpISSM_a-Dux.o `test -f './Dux/Dux.cpp' || echo '$(srcdir)/'`./Dux/Dux.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Dux.Tpo $(DEPDIR)/libpISSM_a-Dux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Dux/Dux.cpp' object='libpISSM_a-Dux.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Dux.o `test -f './Dux/Dux.cpp' || echo '$(srcdir)/'`./Dux/Dux.cpp
+
+libpISSM_a-Dux.obj: ./Dux/Dux.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Dux.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Dux.Tpo -c -o libpISSM_a-Dux.obj `if test -f './Dux/Dux.cpp'; then $(CYGPATH_W) './Dux/Dux.cpp'; else $(CYGPATH_W) '$(srcdir)/./Dux/Dux.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Dux.Tpo $(DEPDIR)/libpISSM_a-Dux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Dux/Dux.cpp' object='libpISSM_a-Dux.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Dux.obj `if test -f './Dux/Dux.cpp'; then $(CYGPATH_W) './Dux/Dux.cpp'; else $(CYGPATH_W) '$(srcdir)/./Dux/Dux.cpp'; fi`
+
+libpISSM_a-ControlConstrainx.o: ./ControlConstrainx/ControlConstrainx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ControlConstrainx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ControlConstrainx.Tpo -c -o libpISSM_a-ControlConstrainx.o `test -f './ControlConstrainx/ControlConstrainx.cpp' || echo '$(srcdir)/'`./ControlConstrainx/ControlConstrainx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ControlConstrainx.Tpo $(DEPDIR)/libpISSM_a-ControlConstrainx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ControlConstrainx/ControlConstrainx.cpp' object='libpISSM_a-ControlConstrainx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ControlConstrainx.o `test -f './ControlConstrainx/ControlConstrainx.cpp' || echo '$(srcdir)/'`./ControlConstrainx/ControlConstrainx.cpp
+
+libpISSM_a-ControlConstrainx.obj: ./ControlConstrainx/ControlConstrainx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ControlConstrainx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ControlConstrainx.Tpo -c -o libpISSM_a-ControlConstrainx.obj `if test -f './ControlConstrainx/ControlConstrainx.cpp'; then $(CYGPATH_W) './ControlConstrainx/ControlConstrainx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ControlConstrainx/ControlConstrainx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ControlConstrainx.Tpo $(DEPDIR)/libpISSM_a-ControlConstrainx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ControlConstrainx/ControlConstrainx.cpp' object='libpISSM_a-ControlConstrainx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ControlConstrainx.obj `if test -f './ControlConstrainx/ControlConstrainx.cpp'; then $(CYGPATH_W) './ControlConstrainx/ControlConstrainx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ControlConstrainx/ControlConstrainx.cpp'; fi`
+
+libpISSM_a-Misfitx.o: ./Misfitx/Misfitx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Misfitx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Misfitx.Tpo -c -o libpISSM_a-Misfitx.o `test -f './Misfitx/Misfitx.cpp' || echo '$(srcdir)/'`./Misfitx/Misfitx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Misfitx.Tpo $(DEPDIR)/libpISSM_a-Misfitx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Misfitx/Misfitx.cpp' object='libpISSM_a-Misfitx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Misfitx.o `test -f './Misfitx/Misfitx.cpp' || echo '$(srcdir)/'`./Misfitx/Misfitx.cpp
+
+libpISSM_a-Misfitx.obj: ./Misfitx/Misfitx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Misfitx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Misfitx.Tpo -c -o libpISSM_a-Misfitx.obj `if test -f './Misfitx/Misfitx.cpp'; then $(CYGPATH_W) './Misfitx/Misfitx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Misfitx/Misfitx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Misfitx.Tpo $(DEPDIR)/libpISSM_a-Misfitx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Misfitx/Misfitx.cpp' object='libpISSM_a-Misfitx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Misfitx.obj `if test -f './Misfitx/Misfitx.cpp'; then $(CYGPATH_W) './Misfitx/Misfitx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Misfitx/Misfitx.cpp'; fi`
+
+libpISSM_a-Orthx.o: ./Orthx/Orthx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Orthx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Orthx.Tpo -c -o libpISSM_a-Orthx.o `test -f './Orthx/Orthx.cpp' || echo '$(srcdir)/'`./Orthx/Orthx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Orthx.Tpo $(DEPDIR)/libpISSM_a-Orthx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Orthx/Orthx.cpp' object='libpISSM_a-Orthx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Orthx.o `test -f './Orthx/Orthx.cpp' || echo '$(srcdir)/'`./Orthx/Orthx.cpp
+
+libpISSM_a-Orthx.obj: ./Orthx/Orthx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Orthx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Orthx.Tpo -c -o libpISSM_a-Orthx.obj `if test -f './Orthx/Orthx.cpp'; then $(CYGPATH_W) './Orthx/Orthx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Orthx/Orthx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Orthx.Tpo $(DEPDIR)/libpISSM_a-Orthx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Orthx/Orthx.cpp' object='libpISSM_a-Orthx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Orthx.obj `if test -f './Orthx/Orthx.cpp'; then $(CYGPATH_W) './Orthx/Orthx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Orthx/Orthx.cpp'; fi`
+
+libpISSM_a-Gradjx.o: ./Gradjx/Gradjx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Gradjx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Gradjx.Tpo -c -o libpISSM_a-Gradjx.o `test -f './Gradjx/Gradjx.cpp' || echo '$(srcdir)/'`./Gradjx/Gradjx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Gradjx.Tpo $(DEPDIR)/libpISSM_a-Gradjx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Gradjx/Gradjx.cpp' object='libpISSM_a-Gradjx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Gradjx.o `test -f './Gradjx/Gradjx.cpp' || echo '$(srcdir)/'`./Gradjx/Gradjx.cpp
+
+libpISSM_a-Gradjx.obj: ./Gradjx/Gradjx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Gradjx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Gradjx.Tpo -c -o libpISSM_a-Gradjx.obj `if test -f './Gradjx/Gradjx.cpp'; then $(CYGPATH_W) './Gradjx/Gradjx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Gradjx/Gradjx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Gradjx.Tpo $(DEPDIR)/libpISSM_a-Gradjx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Gradjx/Gradjx.cpp' object='libpISSM_a-Gradjx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Gradjx.obj `if test -f './Gradjx/Gradjx.cpp'; then $(CYGPATH_W) './Gradjx/Gradjx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Gradjx/Gradjx.cpp'; fi`
+
+libpISSM_a-UpdateFromInputsx.o: ./UpdateFromInputsx/UpdateFromInputsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-UpdateFromInputsx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-UpdateFromInputsx.Tpo -c -o libpISSM_a-UpdateFromInputsx.o `test -f './UpdateFromInputsx/UpdateFromInputsx.cpp' || echo '$(srcdir)/'`./UpdateFromInputsx/UpdateFromInputsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-UpdateFromInputsx.Tpo $(DEPDIR)/libpISSM_a-UpdateFromInputsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./UpdateFromInputsx/UpdateFromInputsx.cpp' object='libpISSM_a-UpdateFromInputsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-UpdateFromInputsx.o `test -f './UpdateFromInputsx/UpdateFromInputsx.cpp' || echo '$(srcdir)/'`./UpdateFromInputsx/UpdateFromInputsx.cpp
+
+libpISSM_a-UpdateFromInputsx.obj: ./UpdateFromInputsx/UpdateFromInputsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-UpdateFromInputsx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-UpdateFromInputsx.Tpo -c -o libpISSM_a-UpdateFromInputsx.obj `if test -f './UpdateFromInputsx/UpdateFromInputsx.cpp'; then $(CYGPATH_W) './UpdateFromInputsx/UpdateFromInputsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./UpdateFromInputsx/UpdateFromInputsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-UpdateFromInputsx.Tpo $(DEPDIR)/libpISSM_a-UpdateFromInputsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./UpdateFromInputsx/UpdateFromInputsx.cpp' object='libpISSM_a-UpdateFromInputsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-UpdateFromInputsx.obj `if test -f './UpdateFromInputsx/UpdateFromInputsx.cpp'; then $(CYGPATH_W) './UpdateFromInputsx/UpdateFromInputsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./UpdateFromInputsx/UpdateFromInputsx.cpp'; fi`
+
+libpISSM_a-ConfigureObjectsx.o: ./ConfigureObjectsx/ConfigureObjectsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ConfigureObjectsx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ConfigureObjectsx.Tpo -c -o libpISSM_a-ConfigureObjectsx.o `test -f './ConfigureObjectsx/ConfigureObjectsx.cpp' || echo '$(srcdir)/'`./ConfigureObjectsx/ConfigureObjectsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ConfigureObjectsx.Tpo $(DEPDIR)/libpISSM_a-ConfigureObjectsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ConfigureObjectsx/ConfigureObjectsx.cpp' object='libpISSM_a-ConfigureObjectsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ConfigureObjectsx.o `test -f './ConfigureObjectsx/ConfigureObjectsx.cpp' || echo '$(srcdir)/'`./ConfigureObjectsx/ConfigureObjectsx.cpp
+
+libpISSM_a-ConfigureObjectsx.obj: ./ConfigureObjectsx/ConfigureObjectsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ConfigureObjectsx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ConfigureObjectsx.Tpo -c -o libpISSM_a-ConfigureObjectsx.obj `if test -f './ConfigureObjectsx/ConfigureObjectsx.cpp'; then $(CYGPATH_W) './ConfigureObjectsx/ConfigureObjectsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ConfigureObjectsx/ConfigureObjectsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ConfigureObjectsx.Tpo $(DEPDIR)/libpISSM_a-ConfigureObjectsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ConfigureObjectsx/ConfigureObjectsx.cpp' object='libpISSM_a-ConfigureObjectsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ConfigureObjectsx.obj `if test -f './ConfigureObjectsx/ConfigureObjectsx.cpp'; then $(CYGPATH_W) './ConfigureObjectsx/ConfigureObjectsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ConfigureObjectsx/ConfigureObjectsx.cpp'; fi`
+
+libpISSM_a-BuildNodeSetsx.o: ./BuildNodeSetsx/BuildNodeSetsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-BuildNodeSetsx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-BuildNodeSetsx.Tpo -c -o libpISSM_a-BuildNodeSetsx.o `test -f './BuildNodeSetsx/BuildNodeSetsx.cpp' || echo '$(srcdir)/'`./BuildNodeSetsx/BuildNodeSetsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-BuildNodeSetsx.Tpo $(DEPDIR)/libpISSM_a-BuildNodeSetsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./BuildNodeSetsx/BuildNodeSetsx.cpp' object='libpISSM_a-BuildNodeSetsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-BuildNodeSetsx.o `test -f './BuildNodeSetsx/BuildNodeSetsx.cpp' || echo '$(srcdir)/'`./BuildNodeSetsx/BuildNodeSetsx.cpp
+
+libpISSM_a-BuildNodeSetsx.obj: ./BuildNodeSetsx/BuildNodeSetsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-BuildNodeSetsx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-BuildNodeSetsx.Tpo -c -o libpISSM_a-BuildNodeSetsx.obj `if test -f './BuildNodeSetsx/BuildNodeSetsx.cpp'; then $(CYGPATH_W) './BuildNodeSetsx/BuildNodeSetsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./BuildNodeSetsx/BuildNodeSetsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-BuildNodeSetsx.Tpo $(DEPDIR)/libpISSM_a-BuildNodeSetsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./BuildNodeSetsx/BuildNodeSetsx.cpp' object='libpISSM_a-BuildNodeSetsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-BuildNodeSetsx.obj `if test -f './BuildNodeSetsx/BuildNodeSetsx.cpp'; then $(CYGPATH_W) './BuildNodeSetsx/BuildNodeSetsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./BuildNodeSetsx/BuildNodeSetsx.cpp'; fi`
+
+libpISSM_a-PartitionSets.o: ./BuildNodeSetsx/PartitionSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PartitionSets.o -MD -MP -MF $(DEPDIR)/libpISSM_a-PartitionSets.Tpo -c -o libpISSM_a-PartitionSets.o `test -f './BuildNodeSetsx/PartitionSets.cpp' || echo '$(srcdir)/'`./BuildNodeSetsx/PartitionSets.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PartitionSets.Tpo $(DEPDIR)/libpISSM_a-PartitionSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./BuildNodeSetsx/PartitionSets.cpp' object='libpISSM_a-PartitionSets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PartitionSets.o `test -f './BuildNodeSetsx/PartitionSets.cpp' || echo '$(srcdir)/'`./BuildNodeSetsx/PartitionSets.cpp
+
+libpISSM_a-PartitionSets.obj: ./BuildNodeSetsx/PartitionSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PartitionSets.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-PartitionSets.Tpo -c -o libpISSM_a-PartitionSets.obj `if test -f './BuildNodeSetsx/PartitionSets.cpp'; then $(CYGPATH_W) './BuildNodeSetsx/PartitionSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./BuildNodeSetsx/PartitionSets.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PartitionSets.Tpo $(DEPDIR)/libpISSM_a-PartitionSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./BuildNodeSetsx/PartitionSets.cpp' object='libpISSM_a-PartitionSets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PartitionSets.obj `if test -f './BuildNodeSetsx/PartitionSets.cpp'; then $(CYGPATH_W) './BuildNodeSetsx/PartitionSets.cpp'; else $(CYGPATH_W) '$(srcdir)/./BuildNodeSetsx/PartitionSets.cpp'; fi`
+
+libpISSM_a-SpcNodesx.o: ./SpcNodesx/SpcNodesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SpcNodesx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-SpcNodesx.Tpo -c -o libpISSM_a-SpcNodesx.o `test -f './SpcNodesx/SpcNodesx.cpp' || echo '$(srcdir)/'`./SpcNodesx/SpcNodesx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SpcNodesx.Tpo $(DEPDIR)/libpISSM_a-SpcNodesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./SpcNodesx/SpcNodesx.cpp' object='libpISSM_a-SpcNodesx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SpcNodesx.o `test -f './SpcNodesx/SpcNodesx.cpp' || echo '$(srcdir)/'`./SpcNodesx/SpcNodesx.cpp
+
+libpISSM_a-SpcNodesx.obj: ./SpcNodesx/SpcNodesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SpcNodesx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-SpcNodesx.Tpo -c -o libpISSM_a-SpcNodesx.obj `if test -f './SpcNodesx/SpcNodesx.cpp'; then $(CYGPATH_W) './SpcNodesx/SpcNodesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./SpcNodesx/SpcNodesx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SpcNodesx.Tpo $(DEPDIR)/libpISSM_a-SpcNodesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./SpcNodesx/SpcNodesx.cpp' object='libpISSM_a-SpcNodesx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SpcNodesx.obj `if test -f './SpcNodesx/SpcNodesx.cpp'; then $(CYGPATH_W) './SpcNodesx/SpcNodesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./SpcNodesx/SpcNodesx.cpp'; fi`
+
+libpISSM_a-MpcNodesx.o: ./MpcNodesx/MpcNodesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MpcNodesx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MpcNodesx.Tpo -c -o libpISSM_a-MpcNodesx.o `test -f './MpcNodesx/MpcNodesx.cpp' || echo '$(srcdir)/'`./MpcNodesx/MpcNodesx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MpcNodesx.Tpo $(DEPDIR)/libpISSM_a-MpcNodesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./MpcNodesx/MpcNodesx.cpp' object='libpISSM_a-MpcNodesx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MpcNodesx.o `test -f './MpcNodesx/MpcNodesx.cpp' || echo '$(srcdir)/'`./MpcNodesx/MpcNodesx.cpp
+
+libpISSM_a-MpcNodesx.obj: ./MpcNodesx/MpcNodesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MpcNodesx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MpcNodesx.Tpo -c -o libpISSM_a-MpcNodesx.obj `if test -f './MpcNodesx/MpcNodesx.cpp'; then $(CYGPATH_W) './MpcNodesx/MpcNodesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./MpcNodesx/MpcNodesx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MpcNodesx.Tpo $(DEPDIR)/libpISSM_a-MpcNodesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./MpcNodesx/MpcNodesx.cpp' object='libpISSM_a-MpcNodesx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MpcNodesx.obj `if test -f './MpcNodesx/MpcNodesx.cpp'; then $(CYGPATH_W) './MpcNodesx/MpcNodesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./MpcNodesx/MpcNodesx.cpp'; fi`
+
+libpISSM_a-DataInterpx.o: ./DataInterpx/DataInterpx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-DataInterpx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-DataInterpx.Tpo -c -o libpISSM_a-DataInterpx.o `test -f './DataInterpx/DataInterpx.cpp' || echo '$(srcdir)/'`./DataInterpx/DataInterpx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-DataInterpx.Tpo $(DEPDIR)/libpISSM_a-DataInterpx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./DataInterpx/DataInterpx.cpp' object='libpISSM_a-DataInterpx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-DataInterpx.o `test -f './DataInterpx/DataInterpx.cpp' || echo '$(srcdir)/'`./DataInterpx/DataInterpx.cpp
+
+libpISSM_a-DataInterpx.obj: ./DataInterpx/DataInterpx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-DataInterpx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-DataInterpx.Tpo -c -o libpISSM_a-DataInterpx.obj `if test -f './DataInterpx/DataInterpx.cpp'; then $(CYGPATH_W) './DataInterpx/DataInterpx.cpp'; else $(CYGPATH_W) '$(srcdir)/./DataInterpx/DataInterpx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-DataInterpx.Tpo $(DEPDIR)/libpISSM_a-DataInterpx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./DataInterpx/DataInterpx.cpp' object='libpISSM_a-DataInterpx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-DataInterpx.obj `if test -f './DataInterpx/DataInterpx.cpp'; then $(CYGPATH_W) './DataInterpx/DataInterpx.cpp'; else $(CYGPATH_W) '$(srcdir)/./DataInterpx/DataInterpx.cpp'; fi`
+
+libpISSM_a-HoleFillerx.o: ./HoleFillerx/HoleFillerx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-HoleFillerx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-HoleFillerx.Tpo -c -o libpISSM_a-HoleFillerx.o `test -f './HoleFillerx/HoleFillerx.cpp' || echo '$(srcdir)/'`./HoleFillerx/HoleFillerx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-HoleFillerx.Tpo $(DEPDIR)/libpISSM_a-HoleFillerx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./HoleFillerx/HoleFillerx.cpp' object='libpISSM_a-HoleFillerx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-HoleFillerx.o `test -f './HoleFillerx/HoleFillerx.cpp' || echo '$(srcdir)/'`./HoleFillerx/HoleFillerx.cpp
+
+libpISSM_a-HoleFillerx.obj: ./HoleFillerx/HoleFillerx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-HoleFillerx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-HoleFillerx.Tpo -c -o libpISSM_a-HoleFillerx.obj `if test -f './HoleFillerx/HoleFillerx.cpp'; then $(CYGPATH_W) './HoleFillerx/HoleFillerx.cpp'; else $(CYGPATH_W) '$(srcdir)/./HoleFillerx/HoleFillerx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-HoleFillerx.Tpo $(DEPDIR)/libpISSM_a-HoleFillerx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./HoleFillerx/HoleFillerx.cpp' object='libpISSM_a-HoleFillerx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-HoleFillerx.obj `if test -f './HoleFillerx/HoleFillerx.cpp'; then $(CYGPATH_W) './HoleFillerx/HoleFillerx.cpp'; else $(CYGPATH_W) '$(srcdir)/./HoleFillerx/HoleFillerx.cpp'; fi`
+
+libpISSM_a-MeshPartitionx.o: ./MeshPartitionx/MeshPartitionx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MeshPartitionx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-MeshPartitionx.Tpo -c -o libpISSM_a-MeshPartitionx.o `test -f './MeshPartitionx/MeshPartitionx.cpp' || echo '$(srcdir)/'`./MeshPartitionx/MeshPartitionx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MeshPartitionx.Tpo $(DEPDIR)/libpISSM_a-MeshPartitionx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./MeshPartitionx/MeshPartitionx.cpp' object='libpISSM_a-MeshPartitionx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MeshPartitionx.o `test -f './MeshPartitionx/MeshPartitionx.cpp' || echo '$(srcdir)/'`./MeshPartitionx/MeshPartitionx.cpp
+
+libpISSM_a-MeshPartitionx.obj: ./MeshPartitionx/MeshPartitionx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-MeshPartitionx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-MeshPartitionx.Tpo -c -o libpISSM_a-MeshPartitionx.obj `if test -f './MeshPartitionx/MeshPartitionx.cpp'; then $(CYGPATH_W) './MeshPartitionx/MeshPartitionx.cpp'; else $(CYGPATH_W) '$(srcdir)/./MeshPartitionx/MeshPartitionx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-MeshPartitionx.Tpo $(DEPDIR)/libpISSM_a-MeshPartitionx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./MeshPartitionx/MeshPartitionx.cpp' object='libpISSM_a-MeshPartitionx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-MeshPartitionx.obj `if test -f './MeshPartitionx/MeshPartitionx.cpp'; then $(CYGPATH_W) './MeshPartitionx/MeshPartitionx.cpp'; else $(CYGPATH_W) '$(srcdir)/./MeshPartitionx/MeshPartitionx.cpp'; fi`
+
+libpISSM_a-ContourToMeshx.o: ./ContourToMeshx/ContourToMeshx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ContourToMeshx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ContourToMeshx.Tpo -c -o libpISSM_a-ContourToMeshx.o `test -f './ContourToMeshx/ContourToMeshx.cpp' || echo '$(srcdir)/'`./ContourToMeshx/ContourToMeshx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ContourToMeshx.Tpo $(DEPDIR)/libpISSM_a-ContourToMeshx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ContourToMeshx/ContourToMeshx.cpp' object='libpISSM_a-ContourToMeshx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ContourToMeshx.o `test -f './ContourToMeshx/ContourToMeshx.cpp' || echo '$(srcdir)/'`./ContourToMeshx/ContourToMeshx.cpp
+
+libpISSM_a-ContourToMeshx.obj: ./ContourToMeshx/ContourToMeshx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ContourToMeshx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ContourToMeshx.Tpo -c -o libpISSM_a-ContourToMeshx.obj `if test -f './ContourToMeshx/ContourToMeshx.cpp'; then $(CYGPATH_W) './ContourToMeshx/ContourToMeshx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ContourToMeshx/ContourToMeshx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ContourToMeshx.Tpo $(DEPDIR)/libpISSM_a-ContourToMeshx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ContourToMeshx/ContourToMeshx.cpp' object='libpISSM_a-ContourToMeshx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ContourToMeshx.obj `if test -f './ContourToMeshx/ContourToMeshx.cpp'; then $(CYGPATH_W) './ContourToMeshx/ContourToMeshx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ContourToMeshx/ContourToMeshx.cpp'; fi`
+
+libpISSM_a-Reducevectorgtosx.o: ./Reducevectorgtosx/Reducevectorgtosx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Reducevectorgtosx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Reducevectorgtosx.Tpo -c -o libpISSM_a-Reducevectorgtosx.o `test -f './Reducevectorgtosx/Reducevectorgtosx.cpp' || echo '$(srcdir)/'`./Reducevectorgtosx/Reducevectorgtosx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Reducevectorgtosx.Tpo $(DEPDIR)/libpISSM_a-Reducevectorgtosx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducevectorgtosx/Reducevectorgtosx.cpp' object='libpISSM_a-Reducevectorgtosx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Reducevectorgtosx.o `test -f './Reducevectorgtosx/Reducevectorgtosx.cpp' || echo '$(srcdir)/'`./Reducevectorgtosx/Reducevectorgtosx.cpp
+
+libpISSM_a-Reducevectorgtosx.obj: ./Reducevectorgtosx/Reducevectorgtosx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Reducevectorgtosx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Reducevectorgtosx.Tpo -c -o libpISSM_a-Reducevectorgtosx.obj `if test -f './Reducevectorgtosx/Reducevectorgtosx.cpp'; then $(CYGPATH_W) './Reducevectorgtosx/Reducevectorgtosx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducevectorgtosx/Reducevectorgtosx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Reducevectorgtosx.Tpo $(DEPDIR)/libpISSM_a-Reducevectorgtosx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducevectorgtosx/Reducevectorgtosx.cpp' object='libpISSM_a-Reducevectorgtosx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Reducevectorgtosx.obj `if test -f './Reducevectorgtosx/Reducevectorgtosx.cpp'; then $(CYGPATH_W) './Reducevectorgtosx/Reducevectorgtosx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducevectorgtosx/Reducevectorgtosx.cpp'; fi`
+
+libpISSM_a-Reducematrixfromgtofx.o: ./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Reducematrixfromgtofx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Reducematrixfromgtofx.Tpo -c -o libpISSM_a-Reducematrixfromgtofx.o `test -f './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp' || echo '$(srcdir)/'`./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Reducematrixfromgtofx.Tpo $(DEPDIR)/libpISSM_a-Reducematrixfromgtofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp' object='libpISSM_a-Reducematrixfromgtofx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Reducematrixfromgtofx.o `test -f './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp' || echo '$(srcdir)/'`./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
+
+libpISSM_a-Reducematrixfromgtofx.obj: ./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Reducematrixfromgtofx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Reducematrixfromgtofx.Tpo -c -o libpISSM_a-Reducematrixfromgtofx.obj `if test -f './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; then $(CYGPATH_W) './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Reducematrixfromgtofx.Tpo $(DEPDIR)/libpISSM_a-Reducematrixfromgtofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp' object='libpISSM_a-Reducematrixfromgtofx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Reducematrixfromgtofx.obj `if test -f './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; then $(CYGPATH_W) './Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp'; fi`
+
+libpISSM_a-Reducematrixfromgton.o: ./Reducematrixfromgtofx/Reducematrixfromgton.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Reducematrixfromgton.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Reducematrixfromgton.Tpo -c -o libpISSM_a-Reducematrixfromgton.o `test -f './Reducematrixfromgtofx/Reducematrixfromgton.cpp' || echo '$(srcdir)/'`./Reducematrixfromgtofx/Reducematrixfromgton.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Reducematrixfromgton.Tpo $(DEPDIR)/libpISSM_a-Reducematrixfromgton.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducematrixfromgtofx/Reducematrixfromgton.cpp' object='libpISSM_a-Reducematrixfromgton.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Reducematrixfromgton.o `test -f './Reducematrixfromgtofx/Reducematrixfromgton.cpp' || echo '$(srcdir)/'`./Reducematrixfromgtofx/Reducematrixfromgton.cpp
+
+libpISSM_a-Reducematrixfromgton.obj: ./Reducematrixfromgtofx/Reducematrixfromgton.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Reducematrixfromgton.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Reducematrixfromgton.Tpo -c -o libpISSM_a-Reducematrixfromgton.obj `if test -f './Reducematrixfromgtofx/Reducematrixfromgton.cpp'; then $(CYGPATH_W) './Reducematrixfromgtofx/Reducematrixfromgton.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducematrixfromgtofx/Reducematrixfromgton.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Reducematrixfromgton.Tpo $(DEPDIR)/libpISSM_a-Reducematrixfromgton.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reducematrixfromgtofx/Reducematrixfromgton.cpp' object='libpISSM_a-Reducematrixfromgton.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Reducematrixfromgton.obj `if test -f './Reducematrixfromgtofx/Reducematrixfromgton.cpp'; then $(CYGPATH_W) './Reducematrixfromgtofx/Reducematrixfromgton.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reducematrixfromgtofx/Reducematrixfromgton.cpp'; fi`
+
+libpISSM_a-Reduceloadfromgtofx.o: ./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Reduceloadfromgtofx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Reduceloadfromgtofx.Tpo -c -o libpISSM_a-Reduceloadfromgtofx.o `test -f './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp' || echo '$(srcdir)/'`./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Reduceloadfromgtofx.Tpo $(DEPDIR)/libpISSM_a-Reduceloadfromgtofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp' object='libpISSM_a-Reduceloadfromgtofx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Reduceloadfromgtofx.o `test -f './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp' || echo '$(srcdir)/'`./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
+
+libpISSM_a-Reduceloadfromgtofx.obj: ./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Reduceloadfromgtofx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Reduceloadfromgtofx.Tpo -c -o libpISSM_a-Reduceloadfromgtofx.obj `if test -f './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; then $(CYGPATH_W) './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Reduceloadfromgtofx.Tpo $(DEPDIR)/libpISSM_a-Reduceloadfromgtofx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp' object='libpISSM_a-Reduceloadfromgtofx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Reduceloadfromgtofx.obj `if test -f './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; then $(CYGPATH_W) './Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp'; fi`
+
+libpISSM_a-NormalizeConstraintsx.o: ./NormalizeConstraintsx/NormalizeConstraintsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NormalizeConstraintsx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-NormalizeConstraintsx.Tpo -c -o libpISSM_a-NormalizeConstraintsx.o `test -f './NormalizeConstraintsx/NormalizeConstraintsx.cpp' || echo '$(srcdir)/'`./NormalizeConstraintsx/NormalizeConstraintsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NormalizeConstraintsx.Tpo $(DEPDIR)/libpISSM_a-NormalizeConstraintsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./NormalizeConstraintsx/NormalizeConstraintsx.cpp' object='libpISSM_a-NormalizeConstraintsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NormalizeConstraintsx.o `test -f './NormalizeConstraintsx/NormalizeConstraintsx.cpp' || echo '$(srcdir)/'`./NormalizeConstraintsx/NormalizeConstraintsx.cpp
+
+libpISSM_a-NormalizeConstraintsx.obj: ./NormalizeConstraintsx/NormalizeConstraintsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-NormalizeConstraintsx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-NormalizeConstraintsx.Tpo -c -o libpISSM_a-NormalizeConstraintsx.obj `if test -f './NormalizeConstraintsx/NormalizeConstraintsx.cpp'; then $(CYGPATH_W) './NormalizeConstraintsx/NormalizeConstraintsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./NormalizeConstraintsx/NormalizeConstraintsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-NormalizeConstraintsx.Tpo $(DEPDIR)/libpISSM_a-NormalizeConstraintsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./NormalizeConstraintsx/NormalizeConstraintsx.cpp' object='libpISSM_a-NormalizeConstraintsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-NormalizeConstraintsx.obj `if test -f './NormalizeConstraintsx/NormalizeConstraintsx.cpp'; then $(CYGPATH_W) './NormalizeConstraintsx/NormalizeConstraintsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./NormalizeConstraintsx/NormalizeConstraintsx.cpp'; fi`
+
+libpISSM_a-SystemMatricesx.o: ./SystemMatricesx/SystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SystemMatricesx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-SystemMatricesx.Tpo -c -o libpISSM_a-SystemMatricesx.o `test -f './SystemMatricesx/SystemMatricesx.cpp' || echo '$(srcdir)/'`./SystemMatricesx/SystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SystemMatricesx.Tpo $(DEPDIR)/libpISSM_a-SystemMatricesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./SystemMatricesx/SystemMatricesx.cpp' object='libpISSM_a-SystemMatricesx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SystemMatricesx.o `test -f './SystemMatricesx/SystemMatricesx.cpp' || echo '$(srcdir)/'`./SystemMatricesx/SystemMatricesx.cpp
+
+libpISSM_a-SystemMatricesx.obj: ./SystemMatricesx/SystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-SystemMatricesx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-SystemMatricesx.Tpo -c -o libpISSM_a-SystemMatricesx.obj `if test -f './SystemMatricesx/SystemMatricesx.cpp'; then $(CYGPATH_W) './SystemMatricesx/SystemMatricesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./SystemMatricesx/SystemMatricesx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-SystemMatricesx.Tpo $(DEPDIR)/libpISSM_a-SystemMatricesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./SystemMatricesx/SystemMatricesx.cpp' object='libpISSM_a-SystemMatricesx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-SystemMatricesx.obj `if test -f './SystemMatricesx/SystemMatricesx.cpp'; then $(CYGPATH_W) './SystemMatricesx/SystemMatricesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./SystemMatricesx/SystemMatricesx.cpp'; fi`
+
+libpISSM_a-PenaltyConstraintsx.o: ./PenaltyConstraintsx/PenaltyConstraintsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PenaltyConstraintsx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-PenaltyConstraintsx.Tpo -c -o libpISSM_a-PenaltyConstraintsx.o `test -f './PenaltyConstraintsx/PenaltyConstraintsx.cpp' || echo '$(srcdir)/'`./PenaltyConstraintsx/PenaltyConstraintsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PenaltyConstraintsx.Tpo $(DEPDIR)/libpISSM_a-PenaltyConstraintsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./PenaltyConstraintsx/PenaltyConstraintsx.cpp' object='libpISSM_a-PenaltyConstraintsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PenaltyConstraintsx.o `test -f './PenaltyConstraintsx/PenaltyConstraintsx.cpp' || echo '$(srcdir)/'`./PenaltyConstraintsx/PenaltyConstraintsx.cpp
+
+libpISSM_a-PenaltyConstraintsx.obj: ./PenaltyConstraintsx/PenaltyConstraintsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PenaltyConstraintsx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-PenaltyConstraintsx.Tpo -c -o libpISSM_a-PenaltyConstraintsx.obj `if test -f './PenaltyConstraintsx/PenaltyConstraintsx.cpp'; then $(CYGPATH_W) './PenaltyConstraintsx/PenaltyConstraintsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./PenaltyConstraintsx/PenaltyConstraintsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PenaltyConstraintsx.Tpo $(DEPDIR)/libpISSM_a-PenaltyConstraintsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./PenaltyConstraintsx/PenaltyConstraintsx.cpp' object='libpISSM_a-PenaltyConstraintsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PenaltyConstraintsx.obj `if test -f './PenaltyConstraintsx/PenaltyConstraintsx.cpp'; then $(CYGPATH_W) './PenaltyConstraintsx/PenaltyConstraintsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./PenaltyConstraintsx/PenaltyConstraintsx.cpp'; fi`
+
+libpISSM_a-PenaltySystemMatricesx.o: ./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PenaltySystemMatricesx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-PenaltySystemMatricesx.Tpo -c -o libpISSM_a-PenaltySystemMatricesx.o `test -f './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp' || echo '$(srcdir)/'`./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PenaltySystemMatricesx.Tpo $(DEPDIR)/libpISSM_a-PenaltySystemMatricesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp' object='libpISSM_a-PenaltySystemMatricesx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PenaltySystemMatricesx.o `test -f './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp' || echo '$(srcdir)/'`./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
+
+libpISSM_a-PenaltySystemMatricesx.obj: ./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-PenaltySystemMatricesx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-PenaltySystemMatricesx.Tpo -c -o libpISSM_a-PenaltySystemMatricesx.obj `if test -f './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; then $(CYGPATH_W) './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-PenaltySystemMatricesx.Tpo $(DEPDIR)/libpISSM_a-PenaltySystemMatricesx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp' object='libpISSM_a-PenaltySystemMatricesx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-PenaltySystemMatricesx.obj `if test -f './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; then $(CYGPATH_W) './PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; else $(CYGPATH_W) '$(srcdir)/./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp'; fi`
+
+libpISSM_a-Solverx.o: ./Solverx/Solverx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Solverx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Solverx.Tpo -c -o libpISSM_a-Solverx.o `test -f './Solverx/Solverx.cpp' || echo '$(srcdir)/'`./Solverx/Solverx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Solverx.Tpo $(DEPDIR)/libpISSM_a-Solverx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Solverx/Solverx.cpp' object='libpISSM_a-Solverx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Solverx.o `test -f './Solverx/Solverx.cpp' || echo '$(srcdir)/'`./Solverx/Solverx.cpp
+
+libpISSM_a-Solverx.obj: ./Solverx/Solverx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Solverx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Solverx.Tpo -c -o libpISSM_a-Solverx.obj `if test -f './Solverx/Solverx.cpp'; then $(CYGPATH_W) './Solverx/Solverx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Solverx/Solverx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Solverx.Tpo $(DEPDIR)/libpISSM_a-Solverx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Solverx/Solverx.cpp' object='libpISSM_a-Solverx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Solverx.obj `if test -f './Solverx/Solverx.cpp'; then $(CYGPATH_W) './Solverx/Solverx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Solverx/Solverx.cpp'; fi`
+
+libpISSM_a-Mergesolutionfromftogx.o: ./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Mergesolutionfromftogx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-Mergesolutionfromftogx.Tpo -c -o libpISSM_a-Mergesolutionfromftogx.o `test -f './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp' || echo '$(srcdir)/'`./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Mergesolutionfromftogx.Tpo $(DEPDIR)/libpISSM_a-Mergesolutionfromftogx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp' object='libpISSM_a-Mergesolutionfromftogx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Mergesolutionfromftogx.o `test -f './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp' || echo '$(srcdir)/'`./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
+
+libpISSM_a-Mergesolutionfromftogx.obj: ./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-Mergesolutionfromftogx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-Mergesolutionfromftogx.Tpo -c -o libpISSM_a-Mergesolutionfromftogx.obj `if test -f './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; then $(CYGPATH_W) './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-Mergesolutionfromftogx.Tpo $(DEPDIR)/libpISSM_a-Mergesolutionfromftogx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp' object='libpISSM_a-Mergesolutionfromftogx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-Mergesolutionfromftogx.obj `if test -f './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; then $(CYGPATH_W) './Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; else $(CYGPATH_W) '$(srcdir)/./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp'; fi`
+
+libpISSM_a-ProcessParamsx.o: ./ProcessParamsx/ProcessParamsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ProcessParamsx.o -MD -MP -MF $(DEPDIR)/libpISSM_a-ProcessParamsx.Tpo -c -o libpISSM_a-ProcessParamsx.o `test -f './ProcessParamsx/ProcessParamsx.cpp' || echo '$(srcdir)/'`./ProcessParamsx/ProcessParamsx.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ProcessParamsx.Tpo $(DEPDIR)/libpISSM_a-ProcessParamsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ProcessParamsx/ProcessParamsx.cpp' object='libpISSM_a-ProcessParamsx.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ProcessParamsx.o `test -f './ProcessParamsx/ProcessParamsx.cpp' || echo '$(srcdir)/'`./ProcessParamsx/ProcessParamsx.cpp
+
+libpISSM_a-ProcessParamsx.obj: ./ProcessParamsx/ProcessParamsx.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-ProcessParamsx.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-ProcessParamsx.Tpo -c -o libpISSM_a-ProcessParamsx.obj `if test -f './ProcessParamsx/ProcessParamsx.cpp'; then $(CYGPATH_W) './ProcessParamsx/ProcessParamsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ProcessParamsx/ProcessParamsx.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-ProcessParamsx.Tpo $(DEPDIR)/libpISSM_a-ProcessParamsx.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./ProcessParamsx/ProcessParamsx.cpp' object='libpISSM_a-ProcessParamsx.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-ProcessParamsx.obj `if test -f './ProcessParamsx/ProcessParamsx.cpp'; then $(CYGPATH_W) './ProcessParamsx/ProcessParamsx.cpp'; else $(CYGPATH_W) '$(srcdir)/./ProcessParamsx/ProcessParamsx.cpp'; fi`
+
+libpISSM_a-diagnostic_core_nonlinear.o: ./parallel/diagnostic_core_nonlinear.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-diagnostic_core_nonlinear.o -MD -MP -MF $(DEPDIR)/libpISSM_a-diagnostic_core_nonlinear.Tpo -c -o libpISSM_a-diagnostic_core_nonlinear.o `test -f './parallel/diagnostic_core_nonlinear.cpp' || echo '$(srcdir)/'`./parallel/diagnostic_core_nonlinear.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-diagnostic_core_nonlinear.Tpo $(DEPDIR)/libpISSM_a-diagnostic_core_nonlinear.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./parallel/diagnostic_core_nonlinear.cpp' object='libpISSM_a-diagnostic_core_nonlinear.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-diagnostic_core_nonlinear.o `test -f './parallel/diagnostic_core_nonlinear.cpp' || echo '$(srcdir)/'`./parallel/diagnostic_core_nonlinear.cpp
+
+libpISSM_a-diagnostic_core_nonlinear.obj: ./parallel/diagnostic_core_nonlinear.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-diagnostic_core_nonlinear.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-diagnostic_core_nonlinear.Tpo -c -o libpISSM_a-diagnostic_core_nonlinear.obj `if test -f './parallel/diagnostic_core_nonlinear.cpp'; then $(CYGPATH_W) './parallel/diagnostic_core_nonlinear.cpp'; else $(CYGPATH_W) '$(srcdir)/./parallel/diagnostic_core_nonlinear.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-diagnostic_core_nonlinear.Tpo $(DEPDIR)/libpISSM_a-diagnostic_core_nonlinear.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./parallel/diagnostic_core_nonlinear.cpp' object='libpISSM_a-diagnostic_core_nonlinear.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-diagnostic_core_nonlinear.obj `if test -f './parallel/diagnostic_core_nonlinear.cpp'; then $(CYGPATH_W) './parallel/diagnostic_core_nonlinear.cpp'; else $(CYGPATH_W) '$(srcdir)/./parallel/diagnostic_core_nonlinear.cpp'; fi`
+
+libpISSM_a-CreateFemModel.o: ./parallel/CreateFemModel.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CreateFemModel.o -MD -MP -MF $(DEPDIR)/libpISSM_a-CreateFemModel.Tpo -c -o libpISSM_a-CreateFemModel.o `test -f './parallel/CreateFemModel.cpp' || echo '$(srcdir)/'`./parallel/CreateFemModel.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CreateFemModel.Tpo $(DEPDIR)/libpISSM_a-CreateFemModel.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./parallel/CreateFemModel.cpp' object='libpISSM_a-CreateFemModel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CreateFemModel.o `test -f './parallel/CreateFemModel.cpp' || echo '$(srcdir)/'`./parallel/CreateFemModel.cpp
+
+libpISSM_a-CreateFemModel.obj: ./parallel/CreateFemModel.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-CreateFemModel.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-CreateFemModel.Tpo -c -o libpISSM_a-CreateFemModel.obj `if test -f './parallel/CreateFemModel.cpp'; then $(CYGPATH_W) './parallel/CreateFemModel.cpp'; else $(CYGPATH_W) '$(srcdir)/./parallel/CreateFemModel.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-CreateFemModel.Tpo $(DEPDIR)/libpISSM_a-CreateFemModel.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./parallel/CreateFemModel.cpp' object='libpISSM_a-CreateFemModel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-CreateFemModel.obj `if test -f './parallel/CreateFemModel.cpp'; then $(CYGPATH_W) './parallel/CreateFemModel.cpp'; else $(CYGPATH_W) '$(srcdir)/./parallel/CreateFemModel.cpp'; fi`
+
+libpISSM_a-OutputDiagnostic.o: ./parallel/OutputDiagnostic.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-OutputDiagnostic.o -MD -MP -MF $(DEPDIR)/libpISSM_a-OutputDiagnostic.Tpo -c -o libpISSM_a-OutputDiagnostic.o `test -f './parallel/OutputDiagnostic.cpp' || echo '$(srcdir)/'`./parallel/OutputDiagnostic.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-OutputDiagnostic.Tpo $(DEPDIR)/libpISSM_a-OutputDiagnostic.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./parallel/OutputDiagnostic.cpp' object='libpISSM_a-OutputDiagnostic.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-OutputDiagnostic.o `test -f './parallel/OutputDiagnostic.cpp' || echo '$(srcdir)/'`./parallel/OutputDiagnostic.cpp
+
+libpISSM_a-OutputDiagnostic.obj: ./parallel/OutputDiagnostic.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-OutputDiagnostic.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-OutputDiagnostic.Tpo -c -o libpISSM_a-OutputDiagnostic.obj `if test -f './parallel/OutputDiagnostic.cpp'; then $(CYGPATH_W) './parallel/OutputDiagnostic.cpp'; else $(CYGPATH_W) '$(srcdir)/./parallel/OutputDiagnostic.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-OutputDiagnostic.Tpo $(DEPDIR)/libpISSM_a-OutputDiagnostic.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./parallel/OutputDiagnostic.cpp' object='libpISSM_a-OutputDiagnostic.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-OutputDiagnostic.obj `if test -f './parallel/OutputDiagnostic.cpp'; then $(CYGPATH_W) './parallel/OutputDiagnostic.cpp'; else $(CYGPATH_W) '$(srcdir)/./parallel/OutputDiagnostic.cpp'; fi`
+
+libpISSM_a-WriteLockFile.o: ./parallel/WriteLockFile.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteLockFile.o -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteLockFile.Tpo -c -o libpISSM_a-WriteLockFile.o `test -f './parallel/WriteLockFile.cpp' || echo '$(srcdir)/'`./parallel/WriteLockFile.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteLockFile.Tpo $(DEPDIR)/libpISSM_a-WriteLockFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./parallel/WriteLockFile.cpp' object='libpISSM_a-WriteLockFile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteLockFile.o `test -f './parallel/WriteLockFile.cpp' || echo '$(srcdir)/'`./parallel/WriteLockFile.cpp
+
+libpISSM_a-WriteLockFile.obj: ./parallel/WriteLockFile.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -MT libpISSM_a-WriteLockFile.obj -MD -MP -MF $(DEPDIR)/libpISSM_a-WriteLockFile.Tpo -c -o libpISSM_a-WriteLockFile.obj `if test -f './parallel/WriteLockFile.cpp'; then $(CYGPATH_W) './parallel/WriteLockFile.cpp'; else $(CYGPATH_W) '$(srcdir)/./parallel/WriteLockFile.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/libpISSM_a-WriteLockFile.Tpo $(DEPDIR)/libpISSM_a-WriteLockFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./parallel/WriteLockFile.cpp' object='libpISSM_a-WriteLockFile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpISSM_a_CXXFLAGS) $(CXXFLAGS) -c -o libpISSM_a-WriteLockFile.obj `if test -f './parallel/WriteLockFile.cpp'; then $(CYGPATH_W) './parallel/WriteLockFile.cpp'; else $(CYGPATH_W) '$(srcdir)/./parallel/WriteLockFile.cpp'; fi`
+
+diagnostic_exe-diagnostic.o: parallel/diagnostic.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diagnostic_exe_CXXFLAGS) $(CXXFLAGS) -MT diagnostic_exe-diagnostic.o -MD -MP -MF $(DEPDIR)/diagnostic_exe-diagnostic.Tpo -c -o diagnostic_exe-diagnostic.o `test -f 'parallel/diagnostic.cpp' || echo '$(srcdir)/'`parallel/diagnostic.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/diagnostic_exe-diagnostic.Tpo $(DEPDIR)/diagnostic_exe-diagnostic.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='parallel/diagnostic.cpp' object='diagnostic_exe-diagnostic.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diagnostic_exe_CXXFLAGS) $(CXXFLAGS) -c -o diagnostic_exe-diagnostic.o `test -f 'parallel/diagnostic.cpp' || echo '$(srcdir)/'`parallel/diagnostic.cpp
+
+diagnostic_exe-diagnostic.obj: parallel/diagnostic.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diagnostic_exe_CXXFLAGS) $(CXXFLAGS) -MT diagnostic_exe-diagnostic.obj -MD -MP -MF $(DEPDIR)/diagnostic_exe-diagnostic.Tpo -c -o diagnostic_exe-diagnostic.obj `if test -f 'parallel/diagnostic.cpp'; then $(CYGPATH_W) 'parallel/diagnostic.cpp'; else $(CYGPATH_W) '$(srcdir)/parallel/diagnostic.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/diagnostic_exe-diagnostic.Tpo $(DEPDIR)/diagnostic_exe-diagnostic.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='parallel/diagnostic.cpp' object='diagnostic_exe-diagnostic.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diagnostic_exe_CXXFLAGS) $(CXXFLAGS) -c -o diagnostic_exe-diagnostic.obj `if test -f 'parallel/diagnostic.cpp'; then $(CYGPATH_W) 'parallel/diagnostic.cpp'; else $(CYGPATH_W) '$(srcdir)/parallel/diagnostic.cpp'; fi`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS install-libLIBRARIES
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-libLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libLIBRARIES ctags distclean \
+	distclean-compile distclean-generic 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-libLIBRARIES 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 pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-binPROGRAMS uninstall-libLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /issm/trunk/src/c/Makefile.parallel
===================================================================
--- /issm/trunk/src/c/Makefile.parallel	(revision 1)
+++ /issm/trunk/src/c/Makefile.parallel	(revision 1)
@@ -0,0 +1,4 @@
+all:  
+	$(MAKE) cielodiagnostic.exe
+	$(MAKE) cielocontrol.exe
+	$(MAKE) cielothermalsteady.exe
Index: /issm/trunk/src/c/Makefile.serial
===================================================================
--- /issm/trunk/src/c/Makefile.serial	(revision 1)
+++ /issm/trunk/src/c/Makefile.serial	(revision 1)
@@ -0,0 +1,75 @@
+#Makefile 
+include ../../etc/Make_config.mk
+export
+
+#Some Makefile variables
+DELIVERY = delivery
+
+ifeq (no,$(supported))
+ERR = unsupported combination of VER, PLATFORM, COMPILER
+all: print_build_info err
+else
+all: print_build_info 
+	$(MAKE) -C shared
+	$(MAKE) -C io
+	$(MAKE) -C objects
+	$(MAKE) -C DataSet
+	$(MAKE) -C EnumDefinitions 
+	$(MAKE) -C NumericalToolkitsAPI 
+	sh ./CieloLib.sh $(LIB_EXT) $(OBJ_EXT)
+	$(MAKE) -C Dux
+	$(MAKE) -C Echox
+	$(MAKE) -C Emgx
+	$(MAKE) -C PenaltyEmgx
+	$(MAKE) -C GenerateStatesx
+	$(MAKE) -C Gp1x
+	$(MAKE) -C Gp1bx
+	$(MAKE) -C Gp2x
+	$(MAKE) -C Gp4x
+	$(MAKE) -C Gradjx
+	$(MAKE) -C GriddataMeshToGridx
+	$(MAKE) -C Impx
+	$(MAKE) -C IMdbx
+	$(MAKE) -C Misfitx
+	$(MAKE) -C Orthx
+	$(MAKE) -C PenaltyConstraintsx
+	$(MAKE) -C Solverx
+	$(MAKE) -C Upartnx
+endif
+
+include ../../etc/Make_build_err_usage_targets.mk
+
+.PHONY : clean
+ifeq (no,$(supported))
+   ERR = unsupported combination of VER, PLATFORM, COMPILER
+   clean: print_build_info err
+else
+clean: print_build_info 
+	@echo cleaning up files with extensions .$(LIB_EXT), .$(OBJ_EXT) and .$(MEX_EXT) ...
+	$(MAKE) -C shared clean
+	$(MAKE) -C io clean
+	$(MAKE) -C objects clean
+	$(MAKE) -C DataSet clean
+	$(MAKE) -C EnumDefinitions  clean
+	$(MAKE) -C NumericalToolkitsAPI  clean
+	rm -rf Cielo.$(LIB_EXT)
+	$(MAKE) -C Dux clean
+	$(MAKE) -C Echox clean
+	$(MAKE) -C Emgx clean
+	$(MAKE) -C PenaltyEmgx clean
+	$(MAKE) -C GenerateStatesx clean
+	$(MAKE) -C Gp1x clean
+	$(MAKE) -C Gp1bx clean
+	$(MAKE) -C Gp2x clean
+	$(MAKE) -C Gp4x clean
+	$(MAKE) -C Gradjx clean
+	$(MAKE) -C GriddataMeshToGridx clean
+	$(MAKE) -C Impx clean
+	$(MAKE) -C IMdbx clean
+	$(MAKE) -C Misfitx clean
+	$(MAKE) -C Orthx clean
+	$(MAKE) -C PenaltyConstraintsx clean
+	$(MAKE) -C Solverx clean
+	$(MAKE) -C Upartnx clean
+endif
+
Index: /issm/trunk/src/c/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
===================================================================
--- /issm/trunk/src/c/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp	(revision 1)
+++ /issm/trunk/src/c/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp	(revision 1)
@@ -0,0 +1,51 @@
+/*!\file Mergesolutionfromftogx
+ * \brief merge solution back from f set into g set
+ */
+
+#include "./Mergesolutionfromftogx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Mergesolutionfromftogx"
+
+void	Mergesolutionfromftogx( Vec* pug, Vec uf, Mat Gmn, Vec ys, NodeSets* nodesets){
+
+	/*output: */
+	Vec ug=NULL;
+	int  ug_local_size;
+
+	/*intermediary*/
+	Vec u_m=NULL;
+	Vec u_n=NULL;
+	int  u_n_local_size;
+	int  Gmn_localm,Gmn_localn;
+	
+	
+	/*Merge f set back into n set: */
+	u_n=NewVec(nodesets->GetNSize());
+	VecMerge(u_n,uf,nodesets->GetPV_F(),nodesets->GetFSize());
+
+	/*merge single point constraints into n set: */
+	if(ys){
+		VecMerge(u_n,ys,nodesets->GetPV_S(),nodesets->GetSSize());
+	}
+
+	/* Merge n_set and m_set to g_set:*/
+	ug=NewVec(nodesets->GetGSize());
+	VecMerge(ug,u_n,nodesets->GetPV_N(),nodesets->GetNSize());
+
+	/*Merge m set into g set: */
+	if(nodesets->GetMSize()){
+		MatGetLocalSize(Gmn,&Gmn_localm,&Gmn_localn);
+		u_m=NewVecFromLocalSize(Gmn_localm);
+		MatMultPatch(Gmn,u_n,u_m);
+		VecMerge(ug,u_m,nodesets->GetPV_M(),nodesets->GetMSize());
+	}
+	
+		
+	/*Free ressources:*/
+	VecFree(&u_m);
+	VecFree(&u_n);
+
+	/*Assign correct pointer*/
+	*pug=ug;
+}
Index: /issm/trunk/src/c/Mergesolutionfromftogx/Mergesolutionfromftogx.h
===================================================================
--- /issm/trunk/src/c/Mergesolutionfromftogx/Mergesolutionfromftogx.h	(revision 1)
+++ /issm/trunk/src/c/Mergesolutionfromftogx/Mergesolutionfromftogx.h	(revision 1)
@@ -0,0 +1,14 @@
+/*!\file:  Mergesolutionfromftogx.h
+ * \brief merge solution back from f set into g set
+ */ 
+
+#ifndef _MERGESOLUTIONFROMFTOGX_H
+#define _MERGESOLUTIONFROMFTOGX_H
+
+#include "../objects/objects.h"
+
+/* local prototypes: */
+void	Mergesolutionfromftogx( Vec* pug, Vec uf, Mat Gmn, Vec ys, NodeSets* nodesets);
+
+#endif  /* _MERGESOLUTIONFROMFTOGX_H */
+
Index: /issm/trunk/src/c/MeshPartitionx/MeshPartitionx.cpp
===================================================================
--- /issm/trunk/src/c/MeshPartitionx/MeshPartitionx.cpp	(revision 1)
+++ /issm/trunk/src/c/MeshPartitionx/MeshPartitionx.cpp	(revision 1)
@@ -0,0 +1,101 @@
+/*!\file:  MeshPartition.cpp
+ * \brief partition elements and grids across a cluster of size numprocs. 
+ */
+
+
+#include "./MeshPartitionx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "MeshPartitionx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+
+int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofgrids,double* elements,
+		int numberofelements2d,int numberofgrids2d,double* elements2d,int numlayers,int elements_width, char* meshtype,int num_procs){
+
+	int noerr=1;
+	int i,j;
+
+	/*Metis partitioning: */
+	int* epart=NULL;
+	int* npart=NULL;
+	int* index=NULL;
+
+	int* epart2d=NULL;
+	int* npart2d=NULL;
+	int* index2d=NULL;
+	int  count=0;
+
+	int  etype=1; //tria mesh see metis/Programs/Io.c
+	int  etype2d=1; //tria mesh see metis/Programs/Io.c
+	int  numflag=0;
+	int  edgecut=1;
+
+	if(strcmp(meshtype,"2d")==0){
+		epart=(int*)xmalloc(numberofelements*sizeof(int));
+		npart=(int*)xmalloc(numberofgrids*sizeof(int));
+		index=(int*)xmalloc(elements_width*numberofelements*sizeof(int));
+		for (i=0;i<numberofelements;i++){
+			for (j=0;j<elements_width;j++){
+				*(index+elements_width*i+j)=(int)*(elements+elements_width*i+j)-1; //-1 for C indexing in Metis
+			}
+		}
+
+		/*Partition using Metis:*/
+		METIS_PartMeshNodal(&numberofelements,&numberofgrids, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
+	}
+	else{
+		/*We have a 3d mesh, made of a regularly extruded 2d mesh. We first partition the 2d mesh, then we extrude the partition: */
+
+		/*First build concatenated 2d mesh  from 2d_coll and 2d_noncoll: */
+		epart2d=(int*)xmalloc(numberofelements2d*sizeof(int));
+		npart2d=(int*)xmalloc(numberofgrids2d*sizeof(int)); 
+		index2d=(int*)xmalloc(3*numberofelements2d*sizeof(int));
+
+		for (i=0;i<numberofelements2d;i++){
+			for (j=0;j<3;j++){
+				*(index2d+3*i+j)=(int)*(elements2d+3*i+j)-1; //-1 for C indexing in Metis
+			}
+		}
+
+		METIS_PartMeshNodal(&numberofelements2d,&numberofgrids2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
+
+		/*Extrude epart2d to epart, using numlayers: */
+		epart=(int*)xmalloc(numberofelements*sizeof(int));
+		
+		count=0;
+		for(i=0;i<(numlayers-1);i++){
+			for(j=0;j<numberofelements2d;j++){
+				epart[count]=epart2d[j];
+				count++;
+			}
+		}
+		throw ErrorException(__FUNCT__," grid partitioning not implemented yet in 3d");
+
+	}
+
+	#ifdef _DEBUG_
+	if(my_rank==0){
+		for (i=0;i<numberofelements;i++){
+			printf("El %i My rank %i\n",i+1,epart[i]);
+		}
+	}
+	#endif
+	
+	/*Assign output pointer:*/
+	*pepart=epart;
+	*pnpart=npart;
+
+	/*Free ressources: */
+	xfree((void**)&index);
+	xfree((void**)&epart2d);
+	xfree((void**)&npart2d);
+	xfree((void**)&index2d);
+
+	return noerr;
+
+}
Index: /issm/trunk/src/c/MeshPartitionx/MeshPartitionx.h
===================================================================
--- /issm/trunk/src/c/MeshPartitionx/MeshPartitionx.h	(revision 1)
+++ /issm/trunk/src/c/MeshPartitionx/MeshPartitionx.h	(revision 1)
@@ -0,0 +1,16 @@
+/*!\file:  MeshPartitionx.h
+ * \brief  header file for partitioning module.
+ */ 
+
+#ifndef _MESHPARTITIONX_H
+#define _MESHPARTITIONX_H
+
+#undef __FUNCT__ 
+#define __FUNCT__ "MeshPartitionx"
+
+/* local prototypes: */
+int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofgrids,double* elements,
+		int numberofelements2d,int numberofgrids2d,double* elements2d,int numlayers,int elements_width, char* meshtype,int numareas);
+	
+#endif /* _MESHPARTITIONX_H */
+
Index: /issm/trunk/src/c/Misfitx/Misfitx.cpp
===================================================================
--- /issm/trunk/src/c/Misfitx/Misfitx.cpp	(revision 1)
+++ /issm/trunk/src/c/Misfitx/Misfitx.cpp	(revision 1)
@@ -0,0 +1,35 @@
+/*!\file Misfitx
+ * \brief: compute misfit between observations and model
+ */
+
+#include "./Misfitx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Misfitx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+		double* u_g, double* u_g_obs, ParameterInputs* inputs,int analysis_type){
+	
+	/*output: */
+	double J;
+	double J_sum;
+	
+	/*First, get elements and loads configured: */
+	elements->Configure(elements,loads, nodes, materials);
+
+	/*Compute gradients: */
+	elements->Misfit(&J, u_g,u_g_obs,inputs,analysis_type);
+
+	/*Sum all J from all cpus of the cluster:*/
+	MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
+	MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+	J=J_sum;
+
+	/*Assign output pointers: */
+	*pJ=J;
+}
Index: /issm/trunk/src/c/Misfitx/Misfitx.h
===================================================================
--- /issm/trunk/src/c/Misfitx/Misfitx.h	(revision 1)
+++ /issm/trunk/src/c/Misfitx/Misfitx.h	(revision 1)
@@ -0,0 +1,15 @@
+/*!\file:  Misfitx.h
+ * \brief header file for inverse methods misfit computation
+ */ 
+
+#ifndef _MISFITX_H
+#define _MISFITX_H
+
+#include "../DataSet/DataSet.h"
+
+/* local prototypes: */
+void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+		double* u_g, double* u_g_obs, ParameterInputs* inputs,int analysis_type);
+
+#endif  /* _MISFITX_H */
+
Index: /issm/trunk/src/c/ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/CreateConstraintsDiagnosticHoriz.cpp	(revision 1)
@@ -0,0 +1,91 @@
+/*
+ * CreateConstraintsDiagnosticHoriz.c:
+ */
+
+#undef __FUNCT__ 
+#define __FUNCT__ "CreateConstraintsDiagnosticHoriz"
+
+#include "../DataSet/DataSet.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../objects/objects.h"
+#include "../shared/shared.h"
+#include "./ModelProcessorx.h"
+
+
+int	CreateConstraintsDiagnosticHoriz(DataSet** pconstraints, Model* model,ConstDataHandle model_handle){
+
+
+	int noerr=1;
+	int i;
+	int count;
+	
+	DataSet* constraints = NULL;
+	Spc*    spc  = NULL;
+
+	/*spc intermediary data: */
+	int spc_sid;
+	int spc_node;
+	int spc_dof;
+	double spc_value;
+	
+	double* dirichletvalues_diag=NULL;
+	double* gridondirichlet_diag=NULL;
+	
+	/*Create constraints: */
+	constraints = new DataSet(ConstraintsEnum());
+
+
+	/*Fetch data: */
+	ModelFetchData((void**)&gridondirichlet_diag,NULL,NULL,model_handle,"gridondirichlet_diag","Matrix","Mat");
+	ModelFetchData((void**)&dirichletvalues_diag,NULL,NULL,model_handle,"dirichletvalues_diag","Matrix","Mat");
+
+	count=0;
+
+	/*Create spcs from x,y,z, as well as the spc values on those spcs: */
+	for (i=0;i<model->numberofnodes;i++){
+	#ifdef _PARALLEL_
+	/*keep only this partition's nodes:*/
+	if((model->my_grids[i]==1)){
+	#endif
+
+		if ((int)gridondirichlet_diag[i]){
+	
+			/*This grid needs to be spc'd to vx_obs and vy_obs:*/
+
+			spc_sid=count;
+			spc_node=i+1;
+			spc_dof=1; //we enforce first x translation degree of freedom
+			spc_value=*(dirichletvalues_diag+2*i+0)/model->yts;
+
+			spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
+			constraints->AddObject(spc);
+			count++;
+
+			spc_sid=count;
+			spc_node=i+1;
+			spc_dof=2; //we enforce first y translation degree of freedom
+			spc_value=*(dirichletvalues_diag+2*i+1)/model->yts;
+			
+			spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
+			constraints->AddObject(spc);
+			count++;
+		}
+
+	#ifdef _PARALLEL_
+	} //if((my_grids[i]==1))
+	#endif
+	}
+
+	/*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 
+	 * datasets, it will not be redone: */
+	constraints->Presort();
+
+	/*Free data: */
+	xfree((void**)&gridondirichlet_diag);
+	xfree((void**)&dirichletvalues_diag);
+
+	/*Assign output pointer: */
+	*pconstraints=constraints;
+	return noerr;
+}
Index: /issm/trunk/src/c/ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp	(revision 1)
@@ -0,0 +1,646 @@
+/*
+ * CreateElementsNodesAndMaterialsDiagnosticHoriz.c:
+ */
+
+#undef __FUNCT__ 
+#define __FUNCT__ "CreateElementsNodesAndMaterialsDiagnosticHoriz"
+
+#include "../DataSet/DataSet.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../objects/objects.h"
+#include "../shared/shared.h"
+#include "./ModelProcessorx.h"
+#include "./MeshPartitionx/MeshPartitionx.h"
+
+
+int	CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle){
+
+
+	/*output: int* epart, int* my_grids, double* my_bordergrids*/
+
+
+	int noerr=1;
+	int i,j,k,n;
+	extern int my_rank;
+	extern int num_procs;
+
+	/*DataSets: */
+	DataSet*    elements  = NULL;
+	DataSet*    nodes = NULL;
+	DataSet*    materials = NULL;
+	
+	/*Objects: */
+	Node*       node   = NULL;
+	Tria*       tria = NULL;
+	Penta*      penta = NULL;
+	Matice*     matice  = NULL;
+	Matpar*     matpar  = NULL;
+
+	int         analysis_type;
+	
+	/*output: */
+	int* epart=NULL; //element partitioning.
+	int* npart=NULL; //node partitioning.
+	int* my_grids=NULL;
+	double* my_bordergrids=NULL;
+
+
+	/*intermediary: */
+	int elements_width; //size of elements
+	double B_avg;
+			
+	/*tria constructor input: */
+	int tria_id;
+	int tria_mid;
+	int tria_mparid;
+	int tria_g[3];
+	double tria_h[3];
+	double tria_s[3];
+	double tria_b[3];
+	double tria_k[3];
+	int    tria_friction_type;
+	double tria_p;
+	double tria_q;
+	int    tria_shelf;
+	double tria_fit;
+	double tria_meanvel;/*!scaling ratio for velocities*/
+	double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
+	int    tria_acceleration;
+
+	/*matice constructor input: */
+	int    matice_mid;
+	double matice_B;
+	double matice_n;
+	
+	/*penta constructor input: */
+
+	int penta_id;
+	int penta_mid;
+	int penta_mparid;
+	int penta_g[6];
+	double penta_h[6];
+	double penta_s[6];
+	double penta_b[6];
+	double penta_k[6];
+	int penta_friction_type;
+	double penta_p;
+	double penta_q;
+	int penta_shelf;
+	int penta_onbed;
+	int penta_onsurface;
+	double penta_fit;
+	double penta_meanvel;/*!scaling ratio for velocities*/
+	double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
+	int penta_acceleration;
+	int penta_collapse;
+	double penta_melting[6];
+	double penta_accumulation[6];
+	double penta_geothermalflux[6];
+	int penta_artdiff;
+	int penta_thermal_steadystate;
+
+	/*matpar constructor input: */
+	int	matpar_mid;
+	double matpar_rho_ice; 
+	double matpar_rho_water;
+	double matpar_heatcapacity;
+	double matpar_thermalconductivity;
+	double matpar_latentheat;
+	double matpar_beta;
+	double matpar_meltingpoint;
+	double matpar_mixed_layer_capacity;
+	double matpar_thermal_exchange_velocity;
+	double matpar_g;
+	double matpar_viscosity_overshoot;
+
+	/* node constructor input: */
+	int node_id;
+	int node_partitionborder=0;
+	double node_x[3];
+	int node_onbed;
+	int node_onsurface;
+	int node_numdofs;
+
+		
+	#ifdef _PARALLEL_
+	/*Metis partitioning: */
+	int  range;
+	Vec  gridborder;
+	int  my_numgrids;
+	int* all_numgrids=NULL;
+	int  gridcount;
+	int  count;
+	#endif
+	int  first_grid_index;
+
+	/*Rifts:*/
+	int* riftsnumpenaltypairs;
+	double** riftspenaltypairs;
+	int* riftsfill;
+	double* riftsfriction;
+	double* riftpenaltypairs=NULL;
+	int el1,el2;
+	 
+	/*Penalty partitioning: */
+	int num_grids3d_collapsed;
+	double* double_penalties_grids3d_collapsed=NULL;
+	double* double_penalties_grids3d_noncollapsed=NULL;
+	int     grid_ids[6];
+	int     num_grid_ids;
+	int     grid_id;
+
+
+	/*First create the elements, nodes and material properties: */
+	elements  = new DataSet(ElementsEnum());
+	nodes     = new DataSet(NodesEnum());
+	materials = new DataSet(MaterialsEnum());
+
+
+	/*Width of elements: */
+	if(strcmp(model->meshtype,"2d")==0){
+		elements_width=3; //tria elements
+	}
+	else{
+		elements_width=6; //penta elements
+	}
+
+
+	#ifdef _PARALLEL_
+	/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
+	if(strcmp(model->meshtype,"2d")==0){
+		/*load elements: */
+		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
+	}
+	else{
+		/*load elements2d: */
+		ModelFetchData((void**)&model->elements2d,NULL,NULL,model_handle,"elements2d","Matrix","Mat");
+	}
+
+	MeshPartitionx(&epart, &npart,model->numberofelements,model->numberofnodes,model->elements, model->numberofelements2d,model->numberofnodes2d,model->elements2d,model->numlayers,elements_width, model->meshtype,num_procs);
+
+	/*Free elements and elements2d: */
+	xfree((void**)&model->elements);
+	xfree((void**)&model->elements2d);
+		
+
+	/*Deal with rifts, they have to be included into one partition only, not several: */
+	FetchRifts(&riftsnumpenaltypairs,&riftspenaltypairs,&riftsfill,&riftsfriction,model_handle,model->numrifts);
+	
+	for(i=0;i<model->numrifts;i++){
+		riftpenaltypairs=model->riftspenaltypairs[i];
+		for(j=0;j<model->riftsnumpenaltypairs[i];j++){
+			el1=(int)*(riftpenaltypairs+7*j+2)-1; //matlab indexing to c indexing
+			el2=(int)*(riftpenaltypairs+7*j+3)-1; //matlab indexing to c indexing
+			epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding grids;
+		}
+	}
+	/*Free rifts: */
+	xfree((void**)&riftsnumpenaltypairs); 
+	for(i=0;i<model->numrifts;i++){
+		double* temp=riftspenaltypairs[i];
+		xfree((void**)&temp);
+	}
+	xfree((void**)&riftspenaltypairs);
+	xfree((void**)&riftsfill);
+	xfree((void**)&riftsfriction);
+
+	/*Used later on: */
+	my_grids=(int*)xcalloc(model->numberofnodes,sizeof(int));
+	#endif
+
+
+
+	/*elements created vary if we are dealing with a 2d mesh, or a 3d mesh: */
+
+	/*2d mesh: */
+	if (strcmp(model->meshtype,"2d")==0){
+
+		/*Fetch data needed: */
+		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
+		ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
+		ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
+		ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
+		ModelFetchData((void**)&model->drag,NULL,NULL,model_handle,"drag","Matrix","Mat");
+		ModelFetchData((void**)&model->p,NULL,NULL,model_handle,"p","Matrix","Mat");
+		ModelFetchData((void**)&model->q,NULL,NULL,model_handle,"q","Matrix","Mat");
+		ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat");
+		ModelFetchData((void**)&model->fit,NULL,NULL,model_handle,"fit","Matrix","Mat");
+		ModelFetchData((void**)&model->B,NULL,NULL,model_handle,"B","Matrix","Mat");
+		ModelFetchData((void**)&model->n,NULL,NULL,model_handle,"n","Matrix","Mat");
+	
+		
+		for (i=0;i<model->numberofelements;i++){
+
+		#ifdef _PARALLEL_
+		/*!All elements have been partitioned above, only create elements for this CPU: */
+		if(my_rank==epart[i]){ 
+		#endif
+			
+			
+			/*ids: */
+			tria_id=i+1; //matlab indexing.
+			tria_mid=i+1; //refers to the corresponding material property card
+			tria_mparid=model->numberofelements+1;//refers to the corresponding parmat property card
+
+			/*vertices offsets: */
+			tria_g[0]=(int)*(model->elements+elements_width*i+0);
+			tria_g[1]=(int)*(model->elements+elements_width*i+1);
+			tria_g[2]=(int)*(model->elements+elements_width*i+2);
+
+			/*thickness,surface and bed:*/
+			tria_h[0]= *(model->thickness+ ((int)*(model->elements+elements_width*i+0)-1)); //remember, elements is an index of vertices offsets, in matlab indexing.
+			tria_h[1]=*(model->thickness+  ((int)*(model->elements+elements_width*i+1)-1)); 
+			tria_h[2]=*(model->thickness+  ((int)*(model->elements+elements_width*i+2)-1)) ;
+
+			tria_s[0]=*(model->surface+    ((int)*(model->elements+elements_width*i+0)-1)); 
+			tria_s[1]=*(model->surface+    ((int)*(model->elements+elements_width*i+1)-1)); 
+			tria_s[2]=*(model->surface+    ((int)*(model->elements+elements_width*i+2)-1)); 
+
+			tria_b[0]=*(model->bed+        ((int)*(model->elements+elements_width*i+0)-1)); 
+			tria_b[1]=*(model->bed+        ((int)*(model->elements+elements_width*i+1)-1)); 
+			tria_b[2]=*(model->bed+        ((int)*(model->elements+elements_width*i+2)-1)); 
+
+			/*basal drag:*/
+			tria_friction_type=(int)model->drag_type;
+
+			tria_k[0]=*(model->drag+        ((int)*(model->elements+elements_width*i+0)-1)); 
+			tria_k[1]=*(model->drag+        ((int)*(model->elements+elements_width*i+1)-1)); 
+			tria_k[2]=*(model->drag+        ((int)*(model->elements+elements_width*i+2)-1)); 
+			
+			tria_p=model->p[i];
+			tria_q=model->q[i];
+
+			/*element on iceshelf?:*/
+			tria_shelf=(int)*(model->elementoniceshelf+i);
+
+			/*type of fitting? : */
+			tria_fit=model->fit[0];
+			tria_meanvel=model->meanvel;
+			tria_epsvel=model->epsvel;
+
+			/*diverse:*/
+			tria_acceleration=0;
+
+			/*Create tria element using its constructor:*/
+			tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_friction_type, tria_p, tria_q, tria_shelf, tria_fit, tria_meanvel, tria_epsvel, tria_acceleration);
+
+			/*Add tria element to elements dataset: */
+			elements->AddObject(tria);
+
+			/*Deal with material property card: */
+			matice_mid=i+1; //same as the material id from the geom2 elements.
+			
+			/*Average B over 3 grid elements: */
+			B_avg=0;
+			for(j=0;j<3;j++){
+				B_avg+=*(model->B+((int)*(model->elements+elements_width*i+j)-1));
+			}
+			B_avg=B_avg/3;
+			matice_B=B_avg;
+			matice_n=(double)*(model->n+i);
+			
+			/*Create matice using its constructor:*/
+			matice= new Matice(matice_mid,matice_B,matice_n);
+	
+			/*Add matice element to materials dataset: */
+			materials->AddObject(matice);
+	
+			#ifdef _PARALLEL_
+			/*Now that we are here, we can also start building the list of grids belonging to this node partition: we use 
+			 *the  element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing) 
+			 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 
+			 will hold which grids belong to this partition*/
+			my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
+			my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
+			my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
+			#endif
+
+		#ifdef _PARALLEL_
+		}//if(my_rank==epart[i])
+		#endif
+
+		}//for (i=0;i<numberofelements;i++)
+
+	
+		/*Free data : */
+		/*xfree((void**)&model->elements);
+		xfree((void**)&model->thickness);
+		xfree((void**)&model->surface);
+		xfree((void**)&model->bed);
+		xfree((void**)&model->drag);
+		xfree((void**)&model->p);
+		xfree((void**)&model->q);
+		xfree((void**)&model->elementoniceshelf);
+		xfree((void**)&model->fit);
+		xfree((void**)&model->B);
+		xfree((void**)&model->n);*/
+	}
+	else{ //	if (strcmp(meshtype,"2d")==0)
+
+		/*Fetch data needed: */
+		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
+		ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
+		ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
+		ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
+		ModelFetchData((void**)&model->drag,NULL,NULL,model_handle,"drag","Matrix","Mat");
+		ModelFetchData((void**)&model->p,NULL,NULL,model_handle,"p","Matrix","Mat");
+		ModelFetchData((void**)&model->q,NULL,NULL,model_handle,"q","Matrix","Mat");
+		ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat");
+		ModelFetchData((void**)&model->fit,NULL,NULL,model_handle,"fit","Matrix","Mat");
+		ModelFetchData((void**)&model->elementonbed,NULL,NULL,model_handle,"elementonbed","Matrix","Mat");
+		ModelFetchData((void**)&model->elementonsurface,NULL,NULL,model_handle,"elementonsurface","Matrix","Mat");
+		ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat");
+		ModelFetchData((void**)&model->B,NULL,NULL,model_handle,"B","Matrix","Mat");
+		ModelFetchData((void**)&model->n,NULL,NULL,model_handle,"n","Matrix","Mat");
+		
+		for (i=0;i<model->numberofelements;i++){
+		#ifdef _PARALLEL_
+		/*We are using our element partition to decide which elements will be created on this node: */
+		if(my_rank==epart[i]){
+		#endif
+
+			
+			/*name and id: */
+			penta_id=i+1; //matlab indexing.
+			penta_mid=i+1; //refers to the corresponding material property card
+			penta_mparid=model->numberofelements+1;//refers to the corresponding parmat property card
+
+			/*vertices,thickness,surface,bed and drag: */
+			for(j=0;j<6;j++){
+				penta_g[j]=(int)*(model->elements+elements_width*i+j);
+				penta_h[j]=*(model->thickness+    ((int)*(model->elements+elements_width*i+j)-1)); 
+				penta_s[j]=*(model->surface+    ((int)*(model->elements+elements_width*i+j)-1)); 
+				penta_b[j]=*(model->bed+    ((int)*(model->elements+elements_width*i+j)-1)); 
+				penta_k[j]=*(model->drag+        ((int)*(model->elements+elements_width*i+j)-1)); 
+			}
+
+			/*basal drag:*/
+			penta_friction_type=(int)model->drag_type;
+	
+			penta_p=model->p[i];
+			penta_q=model->q[i];
+
+			/*diverse: */
+			penta_shelf=(int)*(model->elementoniceshelf+i);
+			penta_fit=(int)model->fit[0];
+			penta_onbed=(int)*(model->elementonbed+i);
+			penta_onsurface=(int)*(model->elementonsurface+i);
+			penta_meanvel=model->meanvel;
+			penta_epsvel=model->epsvel;
+			penta_acceleration=0;
+
+			if (*(model->elements_type+2*i+0)==MacAyealEnum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base.
+				penta_collapse=1;
+			}
+			else{
+				penta_collapse=0;
+			}
+
+
+			/*Create Penta using its constructor:*/
+			penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
+					penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_fit,penta_meanvel,penta_epsvel,
+					penta_acceleration,penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
+					penta_thermal_steadystate); 
+
+			/*Add penta element to elements dataset: */
+			elements->AddObject(penta);
+	
+
+			/*Deal with material:*/
+			matice_mid=i+1; //same as the material id from the geom2 elements.
+			/*Average B over 6 element grids: */
+			B_avg=0;
+			for(j=0;j<6;j++){
+				B_avg+=*(model->B+((int)*(model->elements+elements_width*i+j)-1));
+			}
+			B_avg=B_avg/6;
+			matice_B= B_avg;
+			matice_n=(double)*(model->n+i);
+	
+			/*Create matice using its constructor:*/
+			matice= new Matice(matice_mid,matice_B,matice_n);
+	
+			/*Add matice element to materials dataset: */
+			materials->AddObject(matice);
+			
+			#ifdef _PARALLEL_
+			/*Now that we are here, we can also start building the list of grids belonging to this node partition: we use 
+			 *the  element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing) 
+			 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 
+			 will hold which grids belong to this partition*/
+			my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
+			my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
+			my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
+			my_grids[(int)*(model->elements+elements_width*i+3)-1]=1;
+			my_grids[(int)*(model->elements+elements_width*i+4)-1]=1;
+			my_grids[(int)*(model->elements+elements_width*i+5)-1]=1;
+			#endif
+
+		#ifdef _PARALLEL_
+		}//if(my_rank==epart[i])
+		#endif
+
+		}//for (i=0;i<numberofelements;i++)
+
+		/*Free data: */
+		/*xfree((void**)&model->elements);
+		xfree((void**)&model->thickness);
+		xfree((void**)&model->surface);
+		xfree((void**)&model->bed);
+		xfree((void**)&model->drag);
+		xfree((void**)&model->p);
+		xfree((void**)&model->q);
+		xfree((void**)&model->elementoniceshelf);
+		xfree((void**)&model->fit);
+		xfree((void**)&model->elementonbed);
+		xfree((void**)&model->elementonsurface);
+		xfree((void**)&model->elements_type);
+		xfree((void**)&model->n);
+		xfree((void**)&model->B);*/
+
+	} //if (strcmp(meshtype,"2d")==0)
+
+	/*Add one constant material property to materials: */
+	matpar_mid=model->numberofelements+1; //put it at the end of the materials
+	matpar_g=model->g; 
+	matpar_viscosity_overshoot=model->viscosity_overshoot; 
+	matpar_rho_ice=model->rho_ice; 
+	matpar_rho_water=model->rho_water; 
+	matpar_thermalconductivity=model->thermalconductivity; 
+	matpar_heatcapacity=model->heatcapacity; 
+	matpar_latentheat=model->latentheat; 
+	matpar_beta=model->beta; 
+	matpar_meltingpoint=model->meltingpoint; 
+	matpar_mixed_layer_capacity=model->mixed_layer_capacity; 
+	matpar_thermal_exchange_velocity=model->thermal_exchange_velocity; 
+
+	/*Create matpar object using its constructor: */
+	matpar=new Matpar(matpar_mid,matpar_rho_ice,matpar_rho_water,matpar_heatcapacity,matpar_thermalconductivity,
+			matpar_latentheat,matpar_beta,matpar_meltingpoint,matpar_mixed_layer_capacity,
+			matpar_thermal_exchange_velocity,matpar_g,matpar_viscosity_overshoot);
+		
+	/*Add to materials datset: */
+	materials->AddObject(matpar);
+	
+	#ifdef _PARALLEL_
+		/*From the element partitioning, we can determine which grids are on the inside of this cpu's 
+		 *element partition, and which are on its border with other nodes:*/
+		gridborder=NewVec(model->numberofnodes);
+
+		for (i=0;i<model->numberofnodes;i++){
+			if(my_grids[i])VecSetValue(gridborder,i,1,ADD_VALUES);
+		}
+		VecAssemblyBegin(gridborder);
+		VecAssemblyEnd(gridborder);
+
+		#ifdef _DEBUG_
+		VecView(gridborder,PETSC_VIEWER_STDOUT_WORLD);
+		#endif
+		
+		VecToMPISerial(&my_bordergrids,gridborder);
+
+		#ifdef _DEBUG_
+		if(my_rank==0){
+			for (i=0;i<model->numberofnodes;i++){
+				printf("Grid id %i Border grid %lf\n",i+1,my_bordergrids[i]);
+			}
+		}
+		#endif
+	#endif
+
+	/*Partition penalties in 3d: */
+	if(strcmp(model->meshtype,"3d")==0){
+	
+		/*Get penalties: */
+		ModelFetchData((void**)&model->penalties,&model->numpenalties,NULL,model_handle,"penalties","Matrix","Mat");
+
+		if(model->numpenalties){
+
+			model->penaltypartitioning=(int*)xmalloc(model->numpenalties*sizeof(int));
+			for(i=0;i<model->numpenalties;i++)model->penaltypartitioning[i]=-1;
+
+			for(i=0;i<model->numpenalties;i++){
+				first_grid_index=(int)(*(model->penalties+i*model->numlayers+0)-1);
+				if((my_grids[first_grid_index]==1) && (my_bordergrids[first_grid_index]<=1.0) ) { //this grid belongs to this node's internal partition  grids
+					/*All grids that are being penalised belong to this node's internal grid partition.:*/
+					model->penaltypartitioning[i]=1;
+				}
+				if(my_bordergrids[first_grid_index]>1.0) { //this grid belongs to a partition border
+					model->penaltypartitioning[i]=0;
+				}
+			}
+		}
+
+		/*Free penalties: */
+		xfree((void**)&model->penalties);
+	}
+
+	/*Ok, let's summarise. Now, every CPU has the following two arrays: my_grids, and my_bordergrids. 
+	 We can therefore determine  which grids are internal to this node's partition 
+	 and which ones are shared with other nodes because they are on the border of this node's partition. Knowing 
+	 that, go and create the grids*/
+
+	/*Create nodes from x,y,z, as well as the spc values on those grids: */
+		
+	/*First fetch data: */
+	if (strcmp(model->meshtype,"3d")==0){
+		ModelFetchData((void**)&model->deadgrids,NULL,NULL,model_handle,"deadgrids","Matrix","Mat");
+	}
+	ModelFetchData((void**)&model->x,NULL,NULL,model_handle,"x","Matrix","Mat");
+	ModelFetchData((void**)&model->y,NULL,NULL,model_handle,"y","Matrix","Mat");
+	ModelFetchData((void**)&model->z,NULL,NULL,model_handle,"z","Matrix","Mat");
+	ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
+	ModelFetchData((void**)&model->gridonsurface,NULL,NULL,model_handle,"gridonsurface","Matrix","Mat");
+
+	/*Get analysis_type: */
+	analysis_type=AnalysisTypeAsEnum(model->analysis_type);
+
+	/*Get number of dofs per node: */
+	DistributeNumDofs(&node_numdofs,analysis_type);
+
+	for (i=0;i<model->numberofnodes;i++){
+	#ifdef _PARALLEL_
+	/*keep only this partition's nodes:*/
+	if((my_grids[i]==1)){
+	#endif
+
+		node_id=i+1; //matlab indexing
+			
+		
+		
+		#ifdef _PARALLEL_
+		if(my_bordergrids[i]>1.0) { //this grid belongs to a partition border
+			node_partitionborder=1;
+		}
+		else{
+			node_partitionborder=0;
+		}
+		#else
+			node_partitionborder=0;
+		#endif
+
+
+		node_x[0]=model->x[i];
+		node_x[1]=model->y[i];
+		node_x[2]=model->z[i];
+		
+		node_onbed=(int)model->gridonbed[i];
+		node_onsurface=(int)model->gridonsurface[i];
+
+		/*Create node using its constructor: */
+		node=new Node(node_id,node_partitionborder,node_numdofs,node_x,node_onbed,node_onsurface);
+
+		/*set single point constraints.: */
+		if (strcmp(model->meshtype,"3d")==0){
+			/*On a 3d mesh, we may have collapsed grids. Spc all their dofs: */
+			if (model->deadgrids[i]){
+				for(k=0;k<node_numdofs;k++){
+					node->DofInSSet(k);
+				}
+			}
+		}
+		/*Add node to nodes dataset: */
+		nodes->AddObject(node);
+
+	#ifdef _PARALLEL_
+	} //if((my_grids[i]==1))
+	#endif
+	}
+
+	/*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 
+	 * datasets, it will not be redone: */
+	elements->Presort();
+	nodes->Presort();
+	materials->Presort();
+
+	/*Clean fetched data: */
+	xfree((void**)&model->deadgrids);
+	xfree((void**)&model->x);
+	xfree((void**)&model->y);
+	xfree((void**)&model->z);
+	xfree((void**)&model->gridonbed);
+	xfree((void**)&model->gridonsurface);
+		
+	cleanup_and_return:
+
+	/*Assign output pointer: */
+	*pelements=elements;
+	*pnodes=nodes;
+	*pmaterials=materials;
+
+	/*Keep partitioning information into model*/
+	model->epart=epart;
+	model->my_grids=my_grids;
+	model->my_bordergrids=my_bordergrids;
+
+	/*Free ressources:*/
+	#ifdef _PARALLEL_
+	xfree((void**)&all_numgrids);
+	VecFree(&gridborder);
+	#endif
+
+	return noerr;
+
+}
Index: /issm/trunk/src/c/ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/CreateLoadsDiagnosticHoriz.cpp	(revision 1)
@@ -0,0 +1,281 @@
+/*! \file CreateLoadsDiagnosticHoriz.c:
+ */
+
+#undef __FUNCT__ 
+#define __FUNCT__ "CreateLoadsDiagnosticHoriz"
+
+#include "../DataSet/DataSet.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../objects/objects.h"
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "./ModelProcessorx.h"
+
+
+int	CreateLoadsDiagnosticHoriz(DataSet** ploads, Model* model,ConstDataHandle model_handle){
+
+	int noerr=1;
+	int i,j,counter;
+	int element;
+
+	extern int my_rank;
+	extern int num_procs;
+	
+	DataSet*    loads    = NULL;
+	Icefront*   icefront = NULL;
+	Penpair*    penpair  = NULL;
+
+	int segment_width;
+	int element_type;
+	int i1,i2,i3,i4;
+	int i0,range;
+	int grid1,grid2;
+
+	/*rift penpair: */
+	double  normal[2];
+	double  length;
+	double  friction;
+	int     fill;
+		
+	/*icefront intermediary data: */
+	char icefront_type[ICEFRONTSTRING];
+	int icefront_element_type;
+	int	icefront_sid;
+	int icefront_eid;
+	int icefront_mparid;
+	int	icefront_node_ids[MAX_ICEFRONT_GRIDS];
+	double icefront_h[MAX_ICEFRONT_GRIDS];
+	double	icefront_b[MAX_ICEFRONT_GRIDS];
+
+	/*penpair intermediary data: */
+	int penpair_id;
+	int penpair_node_ids[2];
+	double penpair_penalty_offset;
+	int penpair_numdofs;
+	int penpair_dof;
+	int penpair_penalty_lock;
+	int penpair_element_ids[2];
+	double penpair_friction;
+	int penpair_fill;
+	double penpair_normal[2];
+	double penpair_length;
+
+	/*Rifts:*/
+	int* riftsnumpenaltypairs=NULL;
+	double** riftspenaltypairs=NULL;
+	int* riftsfill=NULL;
+	int* riftsfriction=NULL;
+	double* riftpenaltypairs=NULL;
+	int el1,el2;
+	
+	/*Create loads: */
+	loads   = new DataSet(LoadsEnum());
+	
+	/*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the grids
+	 * referenced by a certain load must belong to the cluster node): */
+	ModelFetchData((void**)&model->segmentonneumann_diag,&model->numberofsegs_diag,NULL,model_handle,"segmentonneumann_diag","Matrix","Mat");
+	ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat");
+	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
+	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
+
+	/*First load data:*/
+	for (i=0;i<model->numberofsegs_diag;i++){
+		
+		if (strcmp(model->meshtype,"2d")==0){
+			segment_width=3;
+			element_type=TriaEnum();
+		}
+		else{
+			segment_width=5;
+			element_type=PentaEnum();
+		}
+
+
+		element=(int)(*(model->segmentonneumann_diag+segment_width*i+segment_width-1)-1); //element is in the last column
+
+		#ifdef _PARALLEL_
+		if (model->epart[element]!=my_rank){
+			/*This load does not belong to this cluster node, as it references an element 
+			 *that does not belong to this node's partition. Drop this 'i':*/
+			continue;
+		}
+		#endif
+	
+		icefront_mparid=model->numberofelements+1; //matlab indexing
+		icefront_sid=i+1; //matlab indexing
+		icefront_eid=(int)*(model->segmentonneumann_diag+segment_width*i+segment_width-1); //matlab indexing
+		icefront_element_type=element_type;
+
+		i1=(int)*(model->segmentonneumann_diag+segment_width*i+0);
+		i2=(int)*(model->segmentonneumann_diag+segment_width*i+1);
+			
+		icefront_node_ids[0]=i1;
+		icefront_node_ids[1]=i2;
+		
+		icefront_h[0]=model->thickness[i1-1];
+		icefront_h[1]=model->thickness[i2-1];
+
+		icefront_b[0]=model->bed[i1-1];
+		icefront_b[1]=model->bed[i2-1];
+		
+		if ((int)*(model->elements_type+2*element+0)==MacAyealEnum()){ //this is a collapsed 3d element, icefront will be 2d
+			strcpy(icefront_type,"segment");
+		}
+		else if ((int)*(model->elements_type+2*element+0)==PattynEnum()){ //this is a real 3d element, icefront will be 3d.
+			strcpy(icefront_type,"quad");
+			i3=(int)*(model->segmentonneumann_diag+segment_width*i+2);
+			i4=(int)*(model->segmentonneumann_diag+segment_width*i+3);
+			icefront_node_ids[2]=i3;
+			icefront_node_ids[3]=i4;
+			
+			icefront_h[2]=model->thickness[i3-1];
+			icefront_h[3]=model->thickness[i4-1];
+
+			icefront_b[2]=model->bed[i3-1];
+			icefront_b[3]=model->bed[i4-1];
+		}
+		else{
+			_printf_("%s%s\n",__FUNCT__," error message: element type not supported yet");
+			return 0;
+		}
+
+		icefront = new Icefront(icefront_type,icefront_sid,icefront_mparid,icefront_eid,icefront_element_type,icefront_node_ids,icefront_h,icefront_b);
+		
+		loads->AddObject(icefront);
+
+	}
+	/*Free data: */
+	xfree((void**)&model->segmentonneumann_diag);
+	xfree((void**)&model->elements_type);
+	xfree((void**)&model->thickness);
+	xfree((void**)&model->bed);
+
+		
+	/*Create penalties loads for linking of collapsed formulation grids with non collapsed grids: */
+
+	/*First fetch penalties: */
+	if (strcmp(model->meshtype,"3d")==0){
+		ModelFetchData((void**)&model->penalties,&model->numpenalties,NULL,model_handle,"penalties","Matrix","Mat");
+	}
+
+	counter=0;
+	if(model->numpenalties){
+
+		/*First deal with internal grids: */
+		if (model->penaltypartitioning[i]>=0){ //this penalty belongs to at least this CPU
+
+			for(j=0;j<model->numlayers-1;j++){
+
+				/*We are pairing grids along a vertical profile.*/
+				grid1=(int)*(model->penalties+model->numlayers*i+j);
+				grid2=(int)*(model->penalties+model->numlayers*i+j+1);
+				
+				penpair_id=counter+1; //matlab indexing
+				penpair_dof=1;
+				penpair_node_ids[0]=grid1;
+				penpair_node_ids[1]=grid2;
+				penpair_penalty_offset=model->penalty_offset;
+				penpair_numdofs=1;
+		
+				penpair= new Penpair(penpair_id,penpair_penalty_offset,penpair_penalty_lock,penpair_numdofs,penpair_node_ids,penpair_dof,
+						penpair_element_ids,penpair_friction,penpair_fill,penpair_normal,penpair_length);
+				loads->AddObject(penpair);
+		
+
+				counter++;
+			
+				penpair_id=counter+1; //matlab indexing
+				penpair_dof=2;
+				penpair_node_ids[0]=grid1;
+				penpair_node_ids[1]=grid2;
+				penpair_penalty_offset=model->penalty_offset;
+				penpair_numdofs=1;
+			
+				penpair= new Penpair(penpair_id,penpair_penalty_offset,penpair_penalty_lock,penpair_numdofs,penpair_node_ids,penpair_dof,
+						penpair_element_ids,penpair_friction,penpair_fill,penpair_normal,penpair_length);
+				loads->AddObject(penpair);
+	
+
+				counter++;
+
+			}
+		} //for ( i=0; i<numpenalties; i++) 
+	}
+
+	/*Free data: */
+	xfree((void**)&model->penalties);
+	
+	/*Create penpair loads also for rift grids, so that they don't penetrate one another, if needed: */
+	/*First fetch rifts: */
+	if(model->numrifts){
+
+		for(i=0;i<model->numrifts;i++){
+			riftpenaltypairs=model->riftspenaltypairs[i];
+			for(j=0;j<model->riftsnumpenaltypairs[i];j++){
+
+				el1=(int)*(riftpenaltypairs+7*j+2);
+				#ifdef _PARALLEL_
+				if (model->epart[el1-1]!=my_rank){
+					/*This load does not belong to this cluster node, as it references an element 
+					 *that does not belong to this node's partition. Drop this 'j':*/
+					continue;
+				}
+				#endif
+
+				/*Ok, retrieve all the data needed to add a penalty between the two grids: */
+				el2=(int)*(riftpenaltypairs+7*j+3); 
+				grid1=(int)*(riftpenaltypairs+7*j+0); 
+				grid2=(int)*(riftpenaltypairs+7*j+1);
+				normal[0]=*(riftpenaltypairs+7*j+4);
+				normal[1]=*(riftpenaltypairs+7*j+5);
+				length=*(riftpenaltypairs+7*j+6);
+				friction=model->riftsfriction[i];
+				fill=model->riftsfill[i];
+
+				penpair_id=counter+1; //matlab indexing
+				penpair_node_ids[0]=grid1;
+				penpair_node_ids[1]=grid2;
+				penpair_element_ids[0]=el1;
+				penpair_element_ids[1]=el2;
+				penpair_penalty_offset=model->penalty_offset;
+				penpair_penalty_lock=model->penalty_lock;
+				penpair_numdofs=2;
+				penpair_normal[0]=normal[0];
+				penpair_normal[1]=normal[1];
+				penpair_length=length;
+				penpair_friction=friction;
+				penpair_fill=fill;
+
+				penpair= new Penpair(penpair_id,penpair_penalty_offset,penpair_penalty_lock,penpair_numdofs,penpair_node_ids,penpair_dof,
+						penpair_element_ids,penpair_friction,penpair_fill,penpair_normal,penpair_length);
+				
+				loads->AddObject(penpair);
+
+				counter++;
+			}
+		}
+	}
+
+	/*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 
+	 * datasets, it will not be redone: */
+	loads->Presort();
+
+	/*Free ressources:*/
+	xfree((void**)&riftsnumpenaltypairs); 
+	for(i=0;i<model->numrifts;i++){
+		double* temp=riftspenaltypairs[i];
+		xfree((void**)&temp);
+	}
+	xfree((void**)&riftspenaltypairs);
+	xfree((void**)&riftsfill);
+	xfree((void**)&riftsfriction);
+
+
+	/*Assign output pointer: */
+	*ploads=loads;
+
+	return noerr;
+}
+
+
Index: /issm/trunk/src/c/ModelProcessorx/DistributeNumDofs.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DistributeNumDofs.cpp	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/DistributeNumDofs.cpp	(revision 1)
@@ -0,0 +1,33 @@
+/*!\file:  DistributeNumDofs.cpp
+ * \brief: figure out the maximum number of dofs per grid.
+ */ 
+
+#include "../include/macros.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../shared/shared.h"
+
+#undef __FUNCT__  
+#define __FUNCT__ "DistributeNumDofs"
+
+int DistributeNumDofs(int *pnumdofs,int analysis_type){
+
+	int numdofs=2;
+	int i;
+
+	/*ok, according to analysis type: */
+	if (analysis_type==DiagnosticHorizAnalysisEnum()){
+		numdofs=2;
+	}
+	else if (analysis_type==ControlAnalysisEnum()){
+		numdofs=2;
+	}
+	else if (analysis_type==ThermalSteadyAnalysisEnum()){
+		numdofs=1;
+	}
+	else throw ErrorException(__FUNCT__," analysis type not implemented yet!");
+
+	/*Assign output pointers:*/
+	*pnumdofs=numdofs;;
+
+	return 1;
+}
Index: /issm/trunk/src/c/ModelProcessorx/FetchRifts.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/FetchRifts.cpp	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/FetchRifts.cpp	(revision 1)
@@ -0,0 +1,78 @@
+/*! \file FetchRifts.cpp
+ *  \brief: special i/o here to recover the rifts data. Because serially, the rifts are held into a matlab array strucutre, 
+ *  hard to parse. In parallel, it's easier, as we have marshalled the data into a binary buffer.
+ */
+
+#undef __FUNCT__
+#define __FUNCT__ "FetchRifts"
+
+#include "../io/io.h" 
+#include "../shared/shared.h"
+
+int FetchRifts(int** priftsnumpenaltypairs,double*** priftspenaltypairs,int** priftsfill,double** priftsfriction,ConstDataHandle model_handle,int numrifts){
+
+	int      i;
+	int      noerr=1;
+	
+	/*output: */
+	int*     riftsnumpenaltypairs=NULL;
+	double** riftspenaltypairs=NULL;
+	int*     riftsfill=NULL;
+	double*  riftsfriction=NULL;
+
+	/*intermediary: */
+	double   fill;
+	double*  riftpenaltypairs=NULL;
+	#ifdef _SERIAL_
+	mxArray* pmxa_rifts=NULL;
+	#endif
+
+	if(numrifts){
+
+		/*Allocate arrays: */
+		riftsnumpenaltypairs=(int*)xmalloc(numrifts*sizeof(int));
+		riftspenaltypairs=(double**)xmalloc(numrifts*sizeof(double*));
+		riftsfill=(int*)xmalloc(numrifts*sizeof(int));
+		riftsfriction=(double*)xmalloc(numrifts*sizeof(double));
+
+		#ifdef _SERIAL_
+		/*From model handle, recover rifts handle: */
+		pmxa_rifts=mxGetField(model_handle,0,"rifts");
+
+		for(i=0;i<numrifts;i++){
+		
+			/*riftspenaltypairs: */
+			FetchData((void**)&riftpenaltypairs,riftsnumpenaltypairs+i,NULL,mxGetField(pmxa_rifts,i,"penaltypairs"),"Matrix","Mat");
+			riftspenaltypairs[i]=riftpenaltypairs;
+			
+			/*Riftsfill: */
+			FetchData((void**)&fill,NULL,NULL,mxGetField(pmxa_rifts,i,"fill"),"Scalar",NULL);
+			riftsfill[i]=(int)fill;
+			
+			/*Riftsfriction: */
+			FetchData((void**)riftsfriction+i,NULL,NULL,mxGetField(pmxa_rifts,i,"friction"),"Scalar",NULL);
+		}
+		#else
+		for(i=0;i<numrifts;i++){
+			ModelFetchData((void**)&riftpenaltypairs,riftsnumpenaltypairs+i,NULL,model_handle,exprintf("%s%i","penaltypairs",i),"Matrix","Mat");
+			riftspenaltypairs[i]=riftpenaltypairs;
+			
+			ModelFetchData((void**)&fill,NULL,NULL,model_handle,exprintf("%s%i","fill",i),"Matrix","Mat");
+			riftsfill[i]=(int)fill;
+			
+			ModelFetchData((void**)riftsfriction,NULL,NULL,model_handle,exprintf("%s%i","friction",i),"Matrix","Mat");
+		}
+
+		#endif
+	}
+
+	/*Assign output pointers: */
+	*priftsnumpenaltypairs=riftsnumpenaltypairs;
+	*priftspenaltypairs=riftspenaltypairs;
+	*priftsfill=riftsfill;
+	*priftsfriction=riftsfriction;
+	
+
+	return noerr;
+}
+	
Index: /issm/trunk/src/c/ModelProcessorx/Model.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Model.cpp	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/Model.cpp	(revision 1)
@@ -0,0 +1,508 @@
+/*! \file Model.cpp
+ * \brief  Model structure that mirrors the matlab workspace structure. Servers for the serial 
+ * and parallel runs.
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../shared/shared.h"
+#include "../io/io.h"
+#include "../include/globals.h"
+#include "../include/macros.h"
+
+#include <string.h>
+#include "stdio.h"
+
+#include "./ModelProcessorx.h"
+
+
+/*!--------------------------------------------------
+	NewModel
+  --------------------------------------------------*/
+
+Model* NewModel(void) {
+	/*! create a new Model object */
+	Model* model=NULL;
+
+	model=(Model*)xmalloc(sizeof(Model));
+
+	/*!initialize all pointers to 0: */
+
+
+	model->repository=NULL;
+	model->meshtype=NULL;
+	model->analysis_type=NULL;
+	model->numberofelements=0;
+	model->numberofnodes=0;
+	model->x=NULL; 
+	model->y=NULL;
+	model->z=NULL;
+	model->elements=NULL;
+	model->elements_type=NULL;
+	model->numberofnodes2d=0;
+	model->elements2d=NULL;
+	model->numlayers=0;
+	model->deadgrids=NULL;
+	
+	model->vx_obs=NULL;
+	model->vy_obs=NULL;
+	model->vx=NULL;
+	model->vy=NULL;
+	model->vz=NULL;
+	model->pressure=NULL;
+	model->elementonbed=NULL;
+	model->elementonsurface=NULL;
+	model->gridonbed=NULL;
+	model->gridonsurface=NULL;
+	model->thickness=NULL;
+	model->surface=NULL;
+	model->bed=NULL;
+	model->elementoniceshelf=NULL;
+
+	model->drag_type=0;
+	model->drag=NULL;
+	model->p=NULL;
+	
+	
+	model->numberofsegs_diag=0;
+	model->segmentonneumann_diag=NULL;
+	model-> neumannvalues_diag=NULL;
+	model-> gridondirichlet_diag=NULL;
+	model-> dirichletvalues_diag=NULL;
+	//prognostic
+	model-> segmentonneumann_prog=NULL;
+	model-> neumannvalues_prog=NULL;
+	model-> gridondirichlet_prog=NULL;
+	model-> dirichletvalues_prog=NULL;
+	//prognostic2
+	model-> segmentonneumann_prog2=NULL;
+	model-> neumannvalues_prog2=NULL;
+	//thermal
+	model-> gridondirichlet_thermal=NULL;
+	model-> dirichletvalues_thermal=NULL;
+	model-> geothermalflux=NULL;
+	
+	/*!materials: */
+	model->rho_water=0;
+	model->rho_ice=0;
+		model->g=0;
+	model->n=0;
+	model->B=NULL;
+
+	/*!control methods: */
+	model->control_type=NULL;
+
+	/*!solution parameters: */
+	model->fit=NULL;
+	model->meanvel=0;
+	model->epsvel=0;
+	model->artificial_diffusivity=0;
+	model->nsteps=0;
+	model->tolx=0;
+	model->maxiter=NULL;
+	model->mincontrolconstraint=0;
+	model->maxcontrolconstraint=0;
+	model->debug=0;
+	model->plot=0;
+	model->eps_rel=0;
+	model->eps_abs=0;
+	model->dt=0;
+	model->ndt=0;
+	model->penalty_offset=0;
+	model->penalty_melting=0;
+	model->penalty_lock=0;
+	model->sparsity=0;
+	model->connectivity=0;
+	model->lowmem=0;
+	model->optscal=NULL;
+	model->yts=0;
+	model->viscosity_overshoot=0;
+	model->waitonlock=0;
+
+	/*!thermal parameters: */
+	model->beta=0;
+	model->meltingpoint=0;
+	model->latentheat=0;
+	model->heatcapacity=0;
+	model->thermalconductivity=0;
+	model->min_thermal_constraints=0;
+	model->mixed_layer_capacity=0;
+	model->thermal_exchange_velocity=0;
+
+	
+	model->numrifts=0;
+	model->riftsnumpenaltypairs=NULL;
+	model->riftspenaltypairs=NULL;
+	model->riftsfill=NULL;
+	model->riftsfriction=NULL;
+
+	/*!penalties: */
+	model->numpenalties=0;
+	model->penalties=NULL;
+	model->penaltypartitioning=NULL;
+
+	/*!basal: */
+	model->melting=NULL;
+	model->accumulation=NULL;
+
+	return model;
+}
+
+
+/*!--------------------------------------------------
+	DeleteModel
+  --------------------------------------------------*/
+
+void DeleteModel(Model** pmodel){
+
+	/*!Recover structure: */
+	Model* model = *pmodel;
+	
+	int i;
+
+	/*!Two cases here: 
+	 * - serial mode: matlab's memory manager will take care of delete model when returning from Imp. Do nothing here, so as not to confuse 
+	 *                the memory manager.
+     * - in parallel, anything the io layer does (FetchData) did needs to be erased explicitely in the model.
+	 */
+
+	#ifdef _PARALLEL_
+	xfree((void**)&model->x);
+	xfree((void**)&model->y);
+	xfree((void**)&model->z);
+	xfree((void**)&model->elements);
+	xfree((void**)&model->elements_type);
+	if (strcmp(model->meshtype,"3d")==0){
+		xfree((void**)&model->elements2d);
+		xfree((void**)&model->deadgrids);
+	}
+	xfree((void**)&model->solverstring);
+	xfree((void**)&model->elementonbed);
+	xfree((void**)&model->elementonsurface);
+	xfree((void**)&model->gridonbed);
+	xfree((void**)&model->gridonsurface);
+	xfree((void**)&model->thickness);
+	xfree((void**)&model->surface);
+	xfree((void**)&model->bed);
+	xfree((void**)&model->vx_obs);
+	xfree((void**)&model->vy_obs);
+	xfree((void**)&model->vx);
+	xfree((void**)&model->vy);
+	xfree((void**)&model->vz);
+	xfree((void**)&model->pressure);
+	xfree((void**)&model->drag);
+	xfree((void**)&model->p);
+	xfree((void**)&model->q);
+	xfree((void**)&model->elementoniceshelf);
+	xfree((void**)&model->segmentonneumann_diag);
+	xfree((void**)&model->neumannvalues_diag);
+	xfree((void**)&model->gridondirichlet_diag);
+	xfree((void**)&model->dirichletvalues_diag);
+	xfree((void**)&model->segmentonneumann_prog);
+	xfree((void**)&model->neumannvalues_prog);
+	xfree((void**)&model->gridondirichlet_prog);
+	xfree((void**)&model->dirichletvalues_prog);
+	xfree((void**)&model->segmentonneumann_prog2);
+	xfree((void**)&model->neumannvalues_prog2);
+	xfree((void**)&model->gridondirichlet_thermal);
+	xfree((void**)&model->dirichletvalues_thermal);
+	xfree((void**)&model->geothermalflux);
+	xfree((void**)&model->melting);
+	xfree((void**)&model->accumulation);
+	xfree((void**)&model->B);
+	xfree((void**)&model->n);
+	xfree((void**)&model->fit);
+	xfree((void**)&model->optscal);
+	xfree((void**)&model->maxiter);
+
+
+	/*!Delete structure fields: */
+	xfree((void**)&model->repository);
+	xfree((void**)&model->meshtype);
+	xfree((void**)&model->analysis_type);
+	
+	if(model->numrifts){
+		for(i=0;i<model->numrifts;i++){
+			double* riftpenaltypairs=model->riftspenaltypairs[i];
+			xfree((void**)&riftpenaltypairs);
+		}
+		xfree((void**)&model->riftspenaltypairs);
+		xfree((void**)&model->riftsnumpenaltypairs);
+		xfree((void**)&model->riftsfill);
+		xfree((void**)&model->riftsfriction);
+	}
+	
+	xfree((void**)&model->penalties);
+	xfree((void**)&model->penaltypartitioning);
+	
+	xfree((void**)&model->control_type);
+	
+	/*!Delete entire structure: */
+	xfree((void**)pmodel);
+	#endif
+}
+
+/*!--------------------------------------------------
+	ModelInit
+  --------------------------------------------------*/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ModelInit"
+
+int	ModelInit(Model** pmodel,ConstDataHandle model_handle){
+
+	int i,j;
+	
+	/*output: */
+	Model* model=NULL;
+
+	/*Allocate model: */
+	model=NewModel();
+
+	/*In ModelInit, we get all the data that is not difficult to get, and that is small: */
+	ModelFetchData((void**)&model->analysis_type,NULL,NULL,model_handle,"analysis_type","String",NULL); 
+
+	ModelFetchData((void**)&model->meshtype,NULL,NULL,model_handle,"type","String",NULL);
+
+	/*!Get numberofelements and numberofnodes: */
+	ModelFetchData((void**)&model->numberofnodes,NULL,NULL,model_handle,"numberofgrids","Integer",NULL);
+	ModelFetchData((void**)&model->numberofelements,NULL,NULL,model_handle,"numberofelements","Integer",NULL);
+
+	/*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */
+	if (strcmp(model->meshtype,"3d")==0){
+	
+		/*!Deal with 2d mesh: */
+		ModelFetchData((void**)&model->numberofelements2d,NULL,NULL,model_handle,"numberofelements2d","Integer",NULL);
+		ModelFetchData((void**)&model->numberofnodes2d,NULL,NULL,model_handle,"numberofgrids2d","Integer",NULL);
+		ModelFetchData((void**)&model->numlayers,NULL,NULL,model_handle,"numlayers","Integer",NULL);
+	}
+	
+	/*!Get drag_type, drag and p,q: */
+	ModelFetchData((void**)&model->drag_type,NULL,NULL,model_handle,"drag_type","Integer",NULL);
+
+	/*!Get materials: */
+	ModelFetchData((void**)&model->rho_water,NULL,NULL,model_handle,"rho_water","Scalar",NULL);
+	ModelFetchData((void**)&model->rho_ice,NULL,NULL,model_handle,"rho_ice","Scalar",NULL);
+	ModelFetchData((void**)&model->g,NULL,NULL,model_handle,"g","Scalar",NULL);
+
+	/*Get control parameters: */
+	ModelFetchData((void**)&model->control_type,NULL,NULL,model_handle,"control_type","String",NULL); 
+
+	/*!Get solution parameters: */
+	ModelFetchData((void**)&model->yts,NULL,NULL,model_handle,"yts","Scalar",NULL);
+	ModelFetchData((void**)&model->meanvel,NULL,NULL,model_handle,"meanvel","Scalar",NULL);
+	ModelFetchData((void**)&model->epsvel,NULL,NULL,model_handle,"epsvel","Scalar",NULL);
+	ModelFetchData((void**)&model->debug,NULL,NULL,model_handle,"debug","Integer",NULL);
+	ModelFetchData((void**)&model->plot,NULL,NULL,model_handle,"plot","Integer",NULL);
+	ModelFetchData((void**)&model->artificial_diffusivity,NULL,NULL,model_handle,"artificial_diffusivity","Integer",NULL);
+	ModelFetchData((void**)&model->nsteps,NULL,NULL,model_handle,"nsteps","Integer",NULL);
+	ModelFetchData((void**)&model->tolx,NULL,NULL,model_handle,"tolx","Scalar",NULL);
+	ModelFetchData((void**)&model->mincontrolconstraint,NULL,NULL,model_handle,"mincontrolconstraint","Scalar",NULL);
+	ModelFetchData((void**)&model->maxcontrolconstraint,NULL,NULL,model_handle,"maxcontrolconstraint","Scalar",NULL);
+	ModelFetchData((void**)&model->eps_rel,NULL,NULL,model_handle,"eps_rel","Scalar",NULL);
+	ModelFetchData((void**)&model->eps_abs,NULL,NULL,model_handle,"eps_abs","Scalar",NULL);
+	ModelFetchData((void**)&model->dt,NULL,NULL,model_handle,"dt","Scalar",NULL);
+	ModelFetchData((void**)&model->ndt,NULL,NULL,model_handle,"ndt","Scalar",NULL);
+	ModelFetchData((void**)&model->penalty_offset,NULL,NULL,model_handle,"penalty_offset","Scalar",NULL);
+	ModelFetchData((void**)&model->penalty_melting,NULL,NULL,model_handle,"penalty_melting","Scalar",NULL);
+	ModelFetchData((void**)&model->penalty_lock,NULL,NULL,model_handle,"penalty_lock","Integer",NULL);
+	ModelFetchData((void**)&model->sparsity,NULL,NULL,model_handle,"sparsity","Scalar",NULL);
+	ModelFetchData((void**)&model->connectivity,NULL,NULL,model_handle,"connectivity","Integer",NULL);
+	ModelFetchData((void**)&model->lowmem,NULL,NULL,model_handle,"lowmem","Integer",NULL);
+	ModelFetchData((void**)&model->solverstring,NULL,NULL,model_handle,"solverstring","String",NULL);
+	ModelFetchData((void**)&model->viscosity_overshoot,NULL,NULL,model_handle,"viscosity_overshoot","Scalar",NULL);
+	ModelFetchData((void**)&model->waitonlock,NULL,NULL,model_handle,"waitonlock","Integer",NULL);
+
+	/*!Get thermal parameters: */
+	ModelFetchData((void**)&model->beta,NULL,NULL,model_handle,"beta","Scalar",NULL);
+	ModelFetchData((void**)&model->meltingpoint,NULL,NULL,model_handle,"meltingpoint","Scalar",NULL);
+	ModelFetchData((void**)&model->latentheat,NULL,NULL,model_handle,"latentheat","Scalar",NULL);
+	ModelFetchData((void**)&model->heatcapacity,NULL,NULL,model_handle,"heatcapacity","Scalar",NULL);
+	ModelFetchData((void**)&model->thermalconductivity,NULL,NULL,model_handle,"thermalconductivity","Scalar",NULL);
+	ModelFetchData((void**)&model->min_thermal_constraints,NULL,NULL,model_handle,"min_thermal_constraints","Integer",NULL);
+	ModelFetchData((void**)&model->mixed_layer_capacity,NULL,NULL,model_handle,"mixed_layer_capacity","Scalar",NULL);
+	ModelFetchData((void**)&model->thermal_exchange_velocity,NULL,NULL,model_handle,"thermal_exchange_velocity","Scalar",NULL);
+	
+	/*rifts: */
+	ModelFetchData((void**)&model->numrifts,NULL,NULL,model_handle,"numrifts","Integer",NULL);
+
+	/*Assign output pointers: */
+	*pmodel=model;
+
+	return 1;
+}
+
+/*!--------------------------------------------------
+	ModelEcho
+  --------------------------------------------------*/
+void ModelEcho(Model* model,int which_part,int rank) {
+
+	//which_part  determines what gets echoed, otherwise, we'll get too much output.
+	//1-> penalties
+
+	int i,j;
+
+	if(which_part==1 && my_rank==rank && (strcmp(model->meshtype,"3d")==0)){
+		printf("Model penalties: \n");
+		printf("   number of penalties: %i\n",model->numpenalties);
+		printf("   grids: \n");
+
+		for(i=0;i<model->numpenalties;i++){
+			for(j=0;j<model->numlayers;j++){
+				printf("%i ",(int)*(model->penalties+model->numlayers*i+j));
+			}
+			printf("\n");
+		}
+	}
+	
+	if(which_part==2 && my_rank==rank){
+		printf("Model rifts: \n");
+		printf("   number of rifts: %i\n",model->numrifts);
+		for(i=0;i<model->numrifts;i++){
+			double* penaltypairs=model->riftspenaltypairs[i];
+			printf("   rift #%i\n",i);
+			for (j=0;j<model->riftsnumpenaltypairs[i];j++){
+				printf("      grids %g %g  elements %g %g normal [%g,%g] length %g\n",*(penaltypairs+7*j+0),*(penaltypairs+7*j+1),*(penaltypairs+7*j+2),*(penaltypairs+7*j+3),
+						*(penaltypairs+7*j+4),*(penaltypairs+7*j+5),*(penaltypairs+7*j+6));
+			}
+			printf("		  friction %g fill %i\n",model->riftsfriction[i],model->riftsfill[i]);
+		}
+	}
+	cleanup_and_return: 
+	return;
+}
+
+/*!--------------------------------------------------
+	ModelCreateElementsNodesAndMaterials
+  --------------------------------------------------*/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ModelCreateElementsNodesAndMaterials"
+
+int	ModelCreateElementsNodesAndMaterials(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle){
+
+	int noerr=1;
+
+	/*This is just a high level driver: */
+	if ((strcmp(model->analysis_type,"diagnostic_horiz")==0)|| (strcmp(model->analysis_type,"control")==0)){
+
+		CreateElementsNodesAndMaterialsDiagnosticHoriz(pelements,pnodes,pmaterials, model,model_handle);
+	
+	}
+	/*else if (strcmp(model->analysis_type,"diagnostic_basevert")==0){
+
+		noerr=CreateElementsNodesAndMaterialsDataSetsDiagnosticBaseVert(pelements,pnodes,pmaterials, model,model->analysis_type);
+
+	}
+	else if (strcmp(model->analysis_type,"diagnostic_vert")==0){
+
+		noerr=CreateElementsNodesAndMaterialsDataSetsDiagnosticVert(pelements,pnodes,pmaterials, model,model->analysis_type);
+	}
+	else if (strcmp(model->analysis_type,"melting")==0){
+
+		noerr=CreateElementsNodesAndMaterialsDataSetsMelting(pelements,pnodes,pmaterials, model,model->analysis_type);
+	}
+	else if (strcmp(model->analysis_type,"prognostic")==0){
+
+		noerr=CreateElementsNodesAndMaterialsDataSetsPrognostic(pelements,pnodes,pmaterials, model,model->analysis_type);
+	}
+	else if ((strcmp(model->analysis_type,"thermalsteady")==0) || (strcmp(model->analysis_type,"thermaltransient")==0)){
+
+		noerr=CreateElementsNodesAndMaterialsDataSetsThermal(pelements,pnodes,pmaterials, model,model->analysis_type);
+	}*/
+	else{
+		_printf_("%s%s\n",__FUNCT__,"error message: analysis_type not supported yet!");
+	}
+
+	return noerr;
+
+}
+
+
+/*! ModelCreateConstraints
+ */
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ModelCreateConstraints"
+
+int ModelCreateConstraints(DataSet** pconstraints, Model* model,ConstDataHandle model_handle){
+	
+	int noerr=1;
+
+	/*This is just a high level driver: */
+	if ((strcmp(model->analysis_type,"diagnostic_horiz")==0)|| (strcmp(model->analysis_type,"control")==0)){
+		noerr=CreateConstraintsDiagnosticHoriz(pconstraints,model,model_handle);
+	}
+	/*else if (strcmp(model->analysis_type,"diagnostic_basevert")==0){
+		noerr=CreateConstraintsDiagnosticBaseVert(pconstraints,model,model_handle);
+	}
+	else if (strcmp(model->analysis_type,"diagnostic_vert")==0){
+		noerr=CreateConstraintsDiagnosticVert(pconstraints,model,model_handle);
+	}
+	else if (strcmp(model->analysis_type,"melting")==0){
+		noerr=CreateConstraintsMelting(pconstraints,model,model_handle);
+	}
+	else if (strcmp(model->analysis_type,"prognostic")==0){
+		noerr=CreateConstraintsPrognostic(pconstraints,model,model_handle);
+	}
+	else if ((strcmp(model->analysis_type,"thermalsteady")==0) || (strcmp(model->analysis_type,"thermaltransient")==0)){
+		noerr=CreateConstraintsThermal(pconstraints,model,model_handle);
+	}
+	else{
+		_printf_("%s%s\n",__FUNCT__,"error message: model->analysis_type not supported yet!");
+	}*/
+
+	return noerr;
+
+}	
+
+
+
+/*! ModelCreateLoads
+ */
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ModelCreateLoads"
+
+int ModelCreateLoads(DataSet** ploads, Model* model,ConstDataHandle model_handle){
+
+	int noerr=1;
+
+	/*This is just a high level driver: */
+	if ((strcmp(model->analysis_type,"diagnostic_horiz")==0)|| (strcmp(model->analysis_type,"control")==0)){
+
+		noerr=CreateLoadsDiagnosticHoriz(ploads,model,model_handle);
+	}
+	/*else if (strcmp(model->analysis_type,"diagnostic_basevert")==0){
+
+		noerr=CreateLoadsDiagnosticBaseVert(ploads,model,model_handle);
+	}
+	else if (strcmp(model->analysis_type,"diagnostic_vert")==0){
+
+		noerr=CreateLoadsDiagnosticVert(ploads,model,model_handle);
+	}
+	else if (strcmp(model->analysis_type,"melting")==0){
+
+		noerr=CreateLoadsMelting(ploads,model,model_handle);
+	}
+	else if (strcmp(model->analysis_type,"prognostic")==0){
+
+		noerr=CreateLoadsPrognostic(ploads,model,model_handle);
+	}
+	else if ((strcmp(model->analysis_type,"thermalsteady")==0) || (strcmp(model->analysis_type,"thermaltransient")==0)){
+	
+		noerr=CreateLoadsThermal(ploads,model,model_handle);
+
+	}
+	else{
+		_printf_("%s%s\n",__FUNCT__,"error message: model->analysis_type not supported yet!");
+	}*/
+
+	return noerr;
+
+}
Index: /issm/trunk/src/c/ModelProcessorx/ModelCreateParameters.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/ModelCreateParameters.cpp	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/ModelCreateParameters.cpp	(revision 1)
@@ -0,0 +1,274 @@
+/*
+ * ModelCreateParameters.c:
+ */
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ModelCreateParameters"
+
+#include "../DataSet/DataSet.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../objects/objects.h"
+#include "../shared/shared.h"
+#include "./ModelProcessorx.h"
+
+int ModelCreateParameters(DataSet** pparameters,Model* model,ConstDataHandle model_handle){
+	
+	int noerr=1;
+	int i;
+	
+	DataSet* parameters = NULL;
+	Param*   param = NULL;
+	int      count=1;
+	int      analysis_type;
+	int      numberofdofspernode;
+
+	double* fit=NULL;
+	double* optscal=NULL;
+	double* maxiter=NULL; 
+	double* control_parameter=NULL;
+	
+	
+	
+	/*Initialize dataset: */
+	parameters   = new DataSet(ParametersEnum());
+
+	//Get analysis_type:
+	analysis_type=AnalysisTypeAsEnum(model->analysis_type);
+	
+	count++;
+	param= new Param(count,"analysis_type",INTEGER);
+	param->SetInteger(analysis_type);
+	parameters->AddObject(param);
+
+	
+	/*debug: */
+	param= new Param(count,"debug",INTEGER);
+	param->SetInteger(model->debug);
+	parameters->AddObject(param);
+
+	/*eps_rel: */
+	count++;
+	param= new Param(count,"eps_rel",DOUBLE);
+	param->SetDouble(model->eps_rel);
+	parameters->AddObject(param);
+
+	/*eps_abs: */
+	count++;
+	param= new Param(count,"eps_abs",DOUBLE);
+	param->SetDouble(model->eps_abs);
+	parameters->AddObject(param);
+
+	/*dt: */
+	count++;
+	param= new Param(count,"dt",DOUBLE);
+	param->SetDouble(model->dt);
+	parameters->AddObject(param);
+
+	/*ndt: */
+	count++;
+	param= new Param(count,"ndt",DOUBLE);
+	param->SetDouble(model->ndt);
+	parameters->AddObject(param);
+
+	/*penalty_offset: */
+	count++;
+	param= new Param(count,"penalty_offset",DOUBLE);
+	param->SetDouble(model->penalty_offset);
+	parameters->AddObject(param);
+
+	/*sparsity: */
+	count++;
+	param= new Param(count,"sparsity",DOUBLE);
+	param->SetDouble(model->sparsity);
+	parameters->AddObject(param);
+
+	/*lowmem: */
+	count++;
+	param= new Param(count,"lowmem",INTEGER);
+	param->SetInteger(model->lowmem);
+	parameters->AddObject(param);
+
+	/*connectivity: */
+	count++;
+	param= new Param(count,"connectivity",INTEGER);
+	param->SetInteger(model->connectivity);
+	parameters->AddObject(param);
+
+	/*beta: */
+	count++;
+	param= new Param(count,"beta",DOUBLE);
+	param->SetDouble(model->beta);
+	parameters->AddObject(param);
+
+	/*meltingpoint: */
+	count++;
+	param= new Param(count,"meltingpoint",DOUBLE);
+	param->SetDouble(model->meltingpoint);
+	parameters->AddObject(param);
+
+	/*latentheat: */
+	count++;
+	param= new Param(count,"latentheat",DOUBLE);
+	param->SetDouble(model->latentheat);
+	parameters->AddObject(param);
+
+	/*heatcapacity: */
+	count++;
+	param= new Param(count,"heatcapacity",DOUBLE);
+	param->SetDouble(model->heatcapacity);
+	parameters->AddObject(param);
+
+	/*penalty_melting: */
+	count++;
+	param= new Param(count,"penalty_melting",DOUBLE);
+	param->SetDouble(model->penalty_melting);
+	parameters->AddObject(param);
+
+	/*min_thermal_constraints: */
+	count++;
+	param= new Param(count,"min_thermal_constraints",INTEGER);
+	param->SetInteger(model->min_thermal_constraints);
+	parameters->AddObject(param);
+
+	/*waitonlock: */
+	count++;
+	param= new Param(count,"waitonlock",INTEGER);
+	param->SetInteger(model->waitonlock);
+	parameters->AddObject(param);
+
+	/*solverstring: */
+	count++;
+	param= new Param(count,"solverstring",STRING);
+	param->SetString(model->solverstring);
+	parameters->AddObject(param);
+
+	/*plot: */
+	count++;
+	param= new Param(count,"plot",INTEGER);
+	param->SetInteger(model->plot);
+	parameters->AddObject(param);
+
+	/*numberofgrids: */
+	count++;
+	param= new Param(count,"numberofnodes",INTEGER);
+	param->SetInteger(model->numberofnodes);
+	parameters->AddObject(param);
+
+	/*Deal with numberofdofspernode: */
+	DistributeNumDofs(&numberofdofspernode,analysis_type);
+
+	count++;
+	param= new Param(count,"numberofdofspernode",INTEGER);
+	param->SetInteger(numberofdofspernode);
+	parameters->AddObject(param);
+
+	/*All our datasets are already ordered by ids. Set presort flag so that later on, when sorting is requested on these 
+	 * datasets, it will not be redone: */
+	parameters->Presort();
+
+	/*Deal with control parameters: */
+	if (analysis_type==ControlAnalysisEnum()){
+
+		/*control_type: */
+		count++;
+		param= new Param(count,"control_type",STRING);
+		param->SetString(model->control_type);
+		parameters->AddObject(param);
+
+
+		/*nsteps: */
+		count++;
+		param= new Param(count,"nsteps",INTEGER);
+		param->SetInteger(model->nsteps);
+		parameters->AddObject(param);
+
+		/*tolx: */
+		count++;
+		param= new Param(count,"tolx",DOUBLE);
+		param->SetDouble(model->tolx);
+		parameters->AddObject(param);
+
+		/*mincontrolconstraint: */
+		count++;
+		param= new Param(count,"mincontrolconstraint",DOUBLE);
+		param->SetDouble(model->mincontrolconstraint);
+		parameters->AddObject(param);
+
+		/*maxcontrolconstraint: */
+		count++;
+		param= new Param(count,"maxcontrolconstraint",DOUBLE);
+		param->SetDouble(model->maxcontrolconstraint);
+		parameters->AddObject(param);
+		
+		/*epsvel: */
+		count++;
+		param= new Param(count,"epsvel",DOUBLE);
+		param->SetDouble(model->epsvel);
+		parameters->AddObject(param);
+		
+		/*meanvel: */
+		count++;
+		param= new Param(count,"meanvel",DOUBLE);
+		param->SetDouble(model->meanvel);
+		parameters->AddObject(param);
+
+		/*Now, recover fit, optscal and maxiter as vectors: */
+		ModelFetchData((void**)&model->fit,NULL,NULL,model_handle,"fit","Matrix","Mat");
+		ModelFetchData((void**)&model->optscal,NULL,NULL,model_handle,"optscal","Matrix","Mat");
+		ModelFetchData((void**)&model->maxiter,NULL,NULL,model_handle,"maxiter","Matrix","Mat");
+	
+		count++;
+		param= new Param(count,"fit",DOUBLEVEC);
+		param->SetDoubleVec(model->fit,model->nsteps);
+		parameters->AddObject(param);
+
+		count++;
+		param= new Param(count,"optscal",DOUBLEVEC);
+		param->SetDoubleVec(model->optscal,model->nsteps);
+		parameters->AddObject(param);
+
+		count++;
+		param= new Param(count,"maxiter",DOUBLEVEC);
+		param->SetDoubleVec(model->maxiter,model->nsteps);
+		parameters->AddObject(param);
+	
+		xfree((void**)&model->fit);
+		xfree((void**)&model->optscal);
+		xfree((void**)&model->maxiter);
+
+		/*Get vx_obs, vy_obs, and the parameter value: */
+		ModelFetchData((void**)&model->vx_obs,NULL,NULL,model_handle,"vx_obs","Matrix","Mat");
+		ModelFetchData((void**)&model->vy_obs,NULL,NULL,model_handle,"vy_obs","Matrix","Mat");
+		ModelFetchData((void**)&control_parameter,NULL,NULL,model_handle,model->control_type,"Matrix","Mat");
+
+		for(i=0;i<model->numberofnodes;i++)model->vx_obs[i]=model->vx_obs[i]/model->yts;
+		for(i=0;i<model->numberofnodes;i++)model->vy_obs[i]=model->vy_obs[i]/model->yts;
+
+		count++;
+		param= new Param(count,"vx_obs",DOUBLEVEC);
+		param->SetDoubleVec(model->vx_obs,model->numberofnodes);
+		parameters->AddObject(param);
+
+		count++;
+		param= new Param(count,"vy_obs",DOUBLEVEC);
+		param->SetDoubleVec(model->vy_obs,model->numberofnodes);
+		parameters->AddObject(param);
+
+		count++;
+		param= new Param(count,"control_parameter",DOUBLEVEC);
+		param->SetDoubleVec(control_parameter,model->numberofnodes);
+		parameters->AddObject(param);
+		
+		xfree((void**)&model->vx_obs);
+		xfree((void**)&model->vy_obs);
+		xfree((void**)&control_parameter);
+
+
+	}
+
+	/*Assign output pointer: */
+	*pparameters=parameters;
+}
+
+	
Index: /issm/trunk/src/c/ModelProcessorx/ModelProcessorx.h
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/ModelProcessorx.h	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/ModelProcessorx.h	(revision 1)
@@ -0,0 +1,214 @@
+/* \file ModelProcessorx.h
+ * \brief  Header file defining the Model structure and processing of input data.
+ * \sa Model.cpp
+ */
+
+#ifndef _MODELPROCESSORX_H
+#define _MODELPROCESSORX_H
+
+#include "../io/io.h"
+#include "../DataSet/DataSet.h"
+#include "../toolkits/toolkits.h"
+
+typedef struct {
+
+	char*   repository;
+	char*   meshtype;
+	char*   analysis_type;
+	char*   solverstring;
+
+	/*2d mesh: */
+	int     numberofelements;
+	int     numberofnodes;
+	double* x;
+	double* y;
+	double* z;
+	double* elements;
+	double* elements_type;
+
+	/*3d mesh: */
+	int     numberofnodes2d;
+	int     numberofelements2d;
+	double* elements2d;
+	int     numlayers;
+	double* deadgrids;
+
+
+	/*results: */
+	double* vx;
+	double* vy;
+	double* vz;
+	double* pressure;
+
+	/*observations: */
+	double*  vx_obs;
+	double*  vy_obs;
+
+	/*geometry: */
+	double* elementonbed;
+	double* elementonsurface;
+	double* gridonbed;
+	double* gridonsurface;
+	double* thickness;
+	double* surface;
+	double* bed;
+	double* elementoniceshelf;
+
+	/*friction: */
+	int     drag_type;
+	double* drag;
+	double* p;
+	double* q;
+
+	/*boundary conditions: */
+	//diagnostic
+	int     numberofsegs_diag;
+	double* segmentonneumann_diag;
+	double* neumannvalues_diag;
+	double* gridondirichlet_diag;
+	double* dirichletvalues_diag;
+	//prognostic
+	double* segmentonneumann_prog;
+	double* neumannvalues_prog;
+	double* gridondirichlet_prog;
+	double* dirichletvalues_prog;
+	//prognostic2
+	double* segmentonneumann_prog2;
+	double* neumannvalues_prog2;
+	//thermal
+	double* gridondirichlet_thermal;
+	double* dirichletvalues_thermal;
+	double* geothermalflux;
+	
+	/*materials: */
+	double  rho_water,rho_ice;
+	double  g;
+	double* B;
+	double* n;
+
+	/*control methods: */
+	char*	control_type;
+
+	/*solution parameters: */
+	double* fit;
+	double  meanvel,epsvel;
+	int     artificial_diffusivity;
+	int     nsteps;
+	double  tolx;
+	double* maxiter;
+	double  mincontrolconstraint;
+	double  maxcontrolconstraint;
+	int     debug;
+	int     plot;
+	double  eps_rel;
+	double  eps_abs;
+	double  dt,ndt;
+	double  penalty_offset;
+	double  penalty_melting;
+	int     penalty_lock;
+	double  sparsity;
+	int     connectivity;
+	int     lowmem;
+	double* optscal;
+	double  yts;
+	double  viscosity_overshoot;
+	int     waitonlock;
+
+	/*thermal parameters: */
+	double beta;
+	double meltingpoint;
+	double latentheat;
+	double  heatcapacity,thermalconductivity;
+	int    min_thermal_constraints;
+	double mixed_layer_capacity;
+	double thermal_exchange_velocity;
+
+	/*rifts: */
+	int      numrifts;
+	int*     riftsnumpenaltypairs;
+	double** riftspenaltypairs;
+	int*     riftsfill;
+	double*  riftsfriction;
+
+	/*penalties: */
+	int      numpenalties;
+	double*  penalties;
+	
+	/*basal: */
+	double*  melting;
+	double*  accumulation;
+
+
+	/*exterior data: */
+	int* epart; /*!element partitioning.*/
+	int* my_grids; /*! grids that belong to this cpu*/
+	double* my_bordergrids; /*! grids that belong to this cpu, and some other cpu also*/
+	int*     penaltypartitioning;
+
+} Model;
+
+
+
+	Model*	NewModel(void);
+
+	void    DeleteModel( Model** pthis);
+
+	void    ModelEcho(Model* model,int which_part,int rank);
+
+	int	    ModelInit(Model** pmodel,ConstDataHandle model_handle);
+
+	int	    ModelCreateElementsNodesAndMaterials(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
+	int	    CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
+	int     DistributeNumDofs(int *pnumdofs,int analysis_type);
+
+	int     ModelCreateConstraints(DataSet** pconstraints, Model* model,ConstDataHandle model_handle);
+	int	    CreateConstraintsDiagnosticHoriz(DataSet** pconstraints,Model* model,ConstDataHandle model_handle);
+
+	int     ModelCreateLoads(DataSet** ploads, Model* model, ConstDataHandle model_handle);
+	int     CreateLoadsDiagnosticHoriz(DataSet** ploads, Model* model, ConstDataHandle model_handle);
+
+	int     ModelCreateParameters(DataSet** pparameters,Model* model,ConstDataHandle model_handle);
+
+#ifdef _PARALLEL_
+	//int ProcessBatchParameters(BatchParams* params,Model* model,DataSet* ncase);
+	//int ProcessWorkspaceParameters(WorkspaceParams* params,Model* model,Vec* partition);
+#endif
+
+int FetchRifts(int** priftsnumpenaltypairs,double*** priftspenaltypairs,int** priftsfill,double** priftsfriction,ConstDataHandle model_handle,int numrifts);
+
+/*Elements, grids and materials: */
+int CreateElementsGridsAndMaterialsDataSets(int** pepart, DataSet** pelements, DataSet** pgrids, DataSet** pmaterials, Vec* ppartition, Vec* ptpartition,
+		int** pmy_grids, Vec* pmy_bordergrids, Model* model,char* analysis_type);
+int CreateElementsGridsAndMaterialsDataSetsDiagnosticBaseVert(int** pepart, DataSet** pelements, DataSet** pgrids, DataSet** pmaterials, Vec* ppartition, Vec* ptpartition,
+		int** pmy_grids, Vec* pmy_bordergrids, Model* model,char* analysis_type);
+int CreateElementsGridsAndMaterialsDataSetsDiagnosticHoriz(int** pepart, DataSet** pelements, DataSet** pgrids, DataSet** pmaterials, Vec* ppartition, Vec* ptpartition,
+		int** pmy_grids, Vec* pmy_bordergrids, Model* model,char* analysis_type);
+int CreateElementsGridsAndMaterialsDataSetsDiagnosticVert(int** pepart, DataSet** pelements, DataSet** pgrids, DataSet** pmaterials, Vec* ppartition, Vec* ptpartition,
+		int** pmy_grids, Vec* pmy_bordergrids, Model* model,char* analysis_type);
+int CreateElementsGridsAndMaterialsDataSetsMelting(int** pepart, DataSet** pelements, DataSet** pgrids, DataSet** pmaterials, Vec* ppartition, Vec* ptpartition,
+		int** pmy_grids, Vec* pmy_bordergrids, Model* model,char* analysis_type);
+int CreateElementsGridsAndMaterialsDataSetsPrognostic(int** pepart, DataSet** pelements, DataSet** pgrids, DataSet** pmaterials, Vec* ppartition, Vec* ptpartition,
+		int** pmy_grids, Vec* pmy_bordergrids, Model* model,char* analysis_type);
+int CreateElementsGridsAndMaterialsDataSetsThermal(int** pepart, DataSet** pelements, DataSet** pgrids, DataSet** pmaterials, Vec* ppartition, Vec* ptpartition,
+		int** pmy_grids, Vec* pmy_bordergrids, Model* model,char* analysis_type);
+
+/*Constraints: */
+int CreateConstraintsDataSet(DataSet** pconstraints,Model* model,char* analysis_type);
+int CreateConstraintsDataSetDiagnosticBaseVert(DataSet** pconstraints,Model* model,char* analysis_type);
+int CreateConstraintsDataSetDiagnosticHoriz(DataSet** pconstraints,Model* model,char* analysis_type);
+int CreateConstraintsDataSetDiagnosticVert(DataSet** pconstraints,Model* model,char* analysis_type);
+int CreateConstraintsDataSetMelting(DataSet** pconstraints,Model* model,char* analysis_type);
+int CreateConstraintsDataSetPrognostic(DataSet** pconstraints,Model* model,char* analysis_type);
+int CreateConstraintsDataSetThermal(DataSet** pconstraints,Model* model,char* analysis_type);
+
+/*Loads: */
+int CreateLoadsDataSet(DataSet** ploads,int* my_grids,double* my_bordergrids, int* epart,Model* model,char* analysis_type);
+int CreateLoadsDataSetDiagnosticBaseVert(DataSet** ploads,int* my_grids,double* my_bordergrids,int* epart,Model* model,char* analysis_type);
+int CreateLoadsDataSetDiagnosticHoriz(DataSet** ploads,int* my_grids,double* my_bordergrids,int* epart,Model* model,char* analysis_type);
+int CreateLoadsDataSetDiagnosticVert(DataSet** ploads,int* my_grids,double* my_bordergrids,int* epart,Model* model,char* analysis_type);
+int CreateLoadsDataSetMelting(DataSet** ploads,int* my_grids,double* my_bordergrids,int* epart,Model* model,char* analysis_type);
+int CreateLoadsDataSetPrognostic(DataSet** ploads,int* my_grids,double* my_bordergrids,int* epart,Model* model,char* analysis_type);
+int CreateLoadsDataSetThermal(DataSet** ploads,int* my_grids,double* my_bordergrids,int* epart,Model* model,char* analysis_type);
+
+
+#endif  /* _MODELPROCESSORX_H */
Index: /issm/trunk/src/c/ModelProcessorx/ProcessBatchParameters.c
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/ProcessBatchParameters.c	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/ProcessBatchParameters.c	(revision 1)
@@ -0,0 +1,81 @@
+/*
+ * ProcessBatchParameters.c:
+ *	   from ncase dataset, fill in the BatchParams* structure, so that the solution sequences (in batch/, for ex. cielodiagnostic.c) can get access to 
+ *	   solution parameters (like eps, tolx, etc ...)
+ */
+#include "../include/cielo.h" 
+#include "./Model.h"
+
+#ifdef _PARALLEL_
+
+int ProcessBatchParameters(BatchParams* params,Model* model,DataSet* ncase){
+
+	int noerr=1;
+	int i;
+
+	/* general dataset handling: */
+	Param* param=NULL;
+
+	/*Firt recover analysis_type: */
+	params->analysis_type=xmalloc(strlen(model->analysis_type)*sizeof(char));
+	strcpy(params->analysis_type,model->analysis_type);
+	params->analysis_type_enum=GetAnalysisTypeAsEnumFromString(params->analysis_type);
+
+	/*Go through ncase, looking for parameters: */
+	for ( i=0; i<DataSetAllObjectCount(ncase); i++) {
+		if ( ParamEnum()==DataSetGetEnum(ncase,i)){
+
+			param=DataSetGetObjectPtr(ncase,i);
+
+			if (strcasecmp_eq(ParamGetTypeString(param),"sparsity")){
+				params->sparsity=ParamGetRealValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"solverstring")){
+				params->solverstring=xmalloc((strlen(ParamGetStringValue(param))+1)*sizeof(char));
+				strcpy(params->solverstring,ParamGetStringValue(param));
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"connecti")){
+				params->connectivity=ParamGetIntegerValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"eps_rel")){
+				params->eps_rel=ParamGetRealValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"debug")){
+				params->debug=ParamGetIntegerValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"debug")){
+				params->debug=ParamGetIntegerValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"beta")){
+				params->beta=ParamGetRealValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"meltingpoint")){
+				params->meltingpoint=ParamGetRealValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"latentheat")){
+				params->latentheat=ParamGetRealValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"heatcapacity")){
+				params->heatcapacity=ParamGetRealValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"penalty_thermal")){
+				params->penalty_thermal=ParamGetRealValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"min_thermal_constraints")){
+				params->min_thermal_constraints=ParamGetIntegerValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"waitonlock")){
+				params->waitonlock=ParamGetIntegerValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"dt")){
+				params->dt=ParamGetRealValue(param);
+			}
+			if (strcasecmp_eq(ParamGetTypeString(param),"ndt")){
+				params->ndt=ParamGetRealValue(param);
+			}
+		}
+	}
+	return noerr;
+
+}
+#endif
Index: /issm/trunk/src/c/ModelProcessorx/ProcessWorkspaceParameters.c
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/ProcessWorkspaceParameters.c	(revision 1)
+++ /issm/trunk/src/c/ModelProcessorx/ProcessWorkspaceParameters.c	(revision 1)
@@ -0,0 +1,135 @@
+/*
+ * ProcessWorkspaceParameters.c:
+ * for batch control solution sequence, we need more info from the model than Impx provides. We put this info here.
+ */
+#include "../include/cielo.h" 
+#include "./Model.h"
+#include "./Impx.h"
+
+#ifdef _PARALLEL_
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ProcessWorkspaceParameters"
+
+#undef CLEANUP
+#define CLEANUP ProcessWorkspaceParametersLocalCleanup(&partition);
+
+void ProcessWorkspaceParametersLocalCleanup(double** ppartition);
+
+int ProcessWorkspaceParameters(WorkspaceParams* this,Model* model,Vec* vec_partition){
+
+	int noerr=1;
+	int i;
+
+	/*control: */
+	char* control_type=NULL;
+	char* control_type2=NULL;
+	double* partition=NULL;
+
+	if strcasecmp_eq(model->analysis_type,"control"){
+
+		/*Initialize nstesp and tolx: */
+		this->nsteps=model->nsteps;
+		this->tolx=model->tolx;
+
+		/*Serialize partition vector needed for later: */
+		VecToMPISerial(&partition,vec_partition);
+
+		/*First recover the control_types from model: */
+		this->num_control_parameters=model->num_control_parameters;
+		this->control_types=xmalloc(this->num_control_parameters*sizeof(char*));
+		for(i=0;i<this->num_control_parameters;i++){
+			control_type=model->control_types[i];
+			control_type2=xmalloc((strlen(control_type)+1)*sizeof(char));
+			strcpy(control_type2,control_type);
+			this->control_types[i]=control_type2;
+		}
+
+		/*Initialize misfit array: */
+		this->J=xmalloc(model->nsteps*sizeof(double));
+		for(i=0;i<model->nsteps;i++){
+			this->J[i]=0;
+		}
+
+		/*Figure out size of uset: */
+		this->gsize=model->numberofgrids*6;
+
+		/*Go through control parameters and initialize corresponding parameters, and the gradient: */
+		for(i=0;i<this->num_control_parameters;i++){
+			control_type=this->control_types[i];
+
+			if strcasecmp_eq(control_type,"drag"){
+				this->drag=xcalloc(this->gsize,sizeof(double));
+				for(i=0;i<(int)(this->gsize/6);i++){
+					this->drag[6*i+0]=model->drag[(int)(partition[i]-1)];
+				}
+			}
+			else if strcasecmp_eq(control_type,"B"){
+				this->B=xcalloc(this->gsize,sizeof(double));
+				for(i=0;i<(int)(this->gsize/6);i++){
+					this->B[6*i+0]=model->B[(int)(partition[i]-1)];
+				}
+			}
+			else{
+				printf("%s%s%s%s\n",__FUNCT__," error message: control parameter ",control_type," not supported yet!");
+				return 0;
+			}
+		}
+
+		/*Initialize observations: */
+		this->u_g_obs=xcalloc(this->gsize,sizeof(double));
+		for(i=0;i<(int)(this->gsize/6);i++){
+			this->u_g_obs[6*i+0]=model->vx_obs[(int)(partition[i]-1)]/model->yts;
+			this->u_g_obs[6*i+1]=model->vy_obs[(int)(partition[i]-1)]/model->yts;
+		}
+
+		/*Fill in fit,maxiter and optscal fields of params: */
+		this->fit=xmalloc(model->nsteps*sizeof(double));
+		memcpy(this->fit,model->fit,model->nsteps*sizeof(double));
+		
+		this->maxiter=xmalloc(model->nsteps*sizeof(double));
+		memcpy(this->maxiter,model->maxiter,model->nsteps*sizeof(double));
+
+		this->optscal=xmalloc(model->nsteps*sizeof(double));
+		memcpy(this->optscal,model->optscal,model->nsteps*sizeof(double));
+
+		/*Setup contraint bounds: */
+		this->mincontrolconstraint=model->mincontrolconstraint;
+		this->maxcontrolconstraint=model->maxcontrolconstraint;
+
+	}
+	else if(strcasecmp_eq(model->analysis_type,"thermalsteady") || strcasecmp_eq(model->analysis_type,"thermalsteady")){
+	
+		/*Initialize velocity and pressure: */
+		
+		/*Figure out size of uset: */
+		this->gsize=model->numberofgrids*6;
+
+		this->velocity=xcalloc(this->gsize,sizeof(double));
+		this->pressure=xcalloc(this->gsize,sizeof(double));
+	
+		/*Serialize partition vector needed for later: */
+		VecToMPISerial(&partition,vec_partition);
+
+		for(i=0;i<(int)(this->gsize/6);i++){
+			this->velocity[6*i+0]=model->vx[(int)(partition[i]-1)]/model->yts;
+			this->velocity[6*i+1]=model->vy[(int)(partition[i]-1)]/model->yts;
+			this->velocity[6*i+2]=model->vz[(int)(partition[i]-1)]/model->yts;
+			this->pressure[6*i+0]=model->pressure[(int)(partition[i]-1)];
+		}
+
+	}
+	else{
+		/*Do nothing!: */
+	}
+	EXIT(noerr);
+
+}
+
+void ProcessWorkspaceParametersLocalCleanup(double** ppartition){
+	xfree((void**)ppartition);
+	return;
+}
+
+
+#endif
Index: /issm/trunk/src/c/MpcNodesx/MpcNodesx.cpp
===================================================================
--- /issm/trunk/src/c/MpcNodesx/MpcNodesx.cpp	(revision 1)
+++ /issm/trunk/src/c/MpcNodesx/MpcNodesx.cpp	(revision 1)
@@ -0,0 +1,58 @@
+/*!\file MpcNodesx
+ * \brief: establish matrix for wringing out rigid body modes. (multi-point constraints)
+ */
+
+#include "./MpcNodesx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "MpcNodesx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+int MpcNodesx( Mat* pRmg, DataSet* nodes,DataSet* constraints){
+
+	int i;
+	int numberofdofs;
+	int numberofequations;
+
+	/*output: */
+	Mat Rmg=NULL;
+
+	
+	/*fake values: */
+	int Rmg_connectivity;
+	int Rmg_numberofdofspernode;
+
+	/*output: */
+	Vec yg=NULL;
+
+	/*First, recover number of dofs from nodes: */
+	numberofdofs=nodes->NumberOfDofs();
+
+	/*Get number of equations from number of constraints: */
+	numberofequations=constraints->NumberOfRgbs();
+
+	if(numberofequations){
+
+		/*Allocate Rmg: */
+		Rmg_connectivity=2; Rmg_numberofdofspernode=1; 
+		
+		Rmg=NewMat(numberofequations,numberofdofs,NULL,&Rmg_connectivity,&Rmg_numberofdofspernode);
+
+		/*Now, go through constraints, and update the nodes and the constraint vector at the same time: */
+		constraints->SetupMpcs(Rmg,nodes);
+
+		/*Assemble matrix: */
+		MatAssemblyBegin(Rmg,MAT_FINAL_ASSEMBLY);
+		MatAssemblyEnd(Rmg,MAT_FINAL_ASSEMBLY);
+	}
+
+	/*Assign output pointers: */
+	*pRmg=Rmg;
+	
+	return 1;
+	
+}
Index: /issm/trunk/src/c/MpcNodesx/MpcNodesx.h
===================================================================
--- /issm/trunk/src/c/MpcNodesx/MpcNodesx.h	(revision 1)
+++ /issm/trunk/src/c/MpcNodesx/MpcNodesx.h	(revision 1)
@@ -0,0 +1,15 @@
+/*!\file:  MpcNodesx.h
+ * \brief header file for rigid body motion
+ */ 
+
+#ifndef _MPCNODESX_H
+#define _MPCNODESX_H
+
+#include "../DataSet/DataSet.h"
+#include "../toolkits/toolkits.h"
+
+/* local prototypes: */
+int		MpcNodesx( Mat* pRmg, DataSet* nodes,DataSet* constraints);
+
+#endif  /* _MPCNODESX_H */
+
Index: /issm/trunk/src/c/NormalizeConstraintsx/NormalizeConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/NormalizeConstraintsx/NormalizeConstraintsx.cpp	(revision 1)
+++ /issm/trunk/src/c/NormalizeConstraintsx/NormalizeConstraintsx.cpp	(revision 1)
@@ -0,0 +1,65 @@
+/*!\file NormalizeConstraintsx
+ * \brief normalize and reduce constraints matrix Rmg to Gmn:
+ */
+
+#include "./NormalizeConstraintsx.h"
+
+#include "../shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "NormalizeConstraintsx"
+
+void NormalizeConstraintsx( Mat* pGmn, Mat Rmg, NodeSets* nodesets){
+
+	/*output: */
+	Mat Gmn=NULL;
+
+	/*intermediary: */
+	int i;
+	Mat Rmm=NULL;
+	Mat Rmn=NULL;
+	Mat InvRmm=NULL;
+	int msize,nsize;
+	double* pv_m=NULL;
+	double* row_m=NULL;
+	double* pv_n=NULL;
+	int     null=0;
+
+	/*Recover data: */
+	msize=nodesets->GetMSize();
+	nsize=nodesets->GetNSize();
+	pv_m=nodesets->GetPV_M();
+	pv_n=nodesets->GetPV_N();
+
+
+	if (msize){
+
+		/*Build row partitioning vector for Rmm and Rmn: */
+		row_m=(double*)xmalloc(msize*sizeof(double));
+		for(i=0;i<msize;i++)row_m[i]=i+1; //matlab indexing
+
+		/*Partition Rmg into Rmm and Rmn: */
+		MatPartition(&Rmm,Rmg,row_m,msize,pv_m,msize); //equivalent of Rmm=Rmg(:,mset);
+		MatPartition(&Rmn,Rmg,row_m,msize,pv_n,nsize);
+
+		/*Invert Rmm: */
+		MatInvert(&InvRmm,Rmm);
+
+		/*Do Gmn=-(Rmm-1)*Rmn :*/
+		MatScale(InvRmm,-1.0);
+		MatMatMult(InvRmm,Rmn,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&Gmn);
+
+	}
+	else{
+		Gmn=NULL;
+	}
+
+	/*Free ressources:*/
+	xfree((void**)&row_m);
+	MatFree(&Rmm);
+	MatFree(&Rmn);
+	MatFree(&InvRmm);
+	
+	/*Assign output pointers:*/
+	*pGmn=Gmn;
+}
Index: /issm/trunk/src/c/NormalizeConstraintsx/NormalizeConstraintsx.h
===================================================================
--- /issm/trunk/src/c/NormalizeConstraintsx/NormalizeConstraintsx.h	(revision 1)
+++ /issm/trunk/src/c/NormalizeConstraintsx/NormalizeConstraintsx.h	(revision 1)
@@ -0,0 +1,13 @@
+/*!\file:  NormalizeConstraintsx.h
+ * \brief normalize and reduce constraints matrix Rmg to Gmn:
+ */ 
+
+#ifndef _NORMALIZECONSTRAINTSX_H_
+#define _NORMALIZECONSTRAINTSX_H_
+
+#include "../objects/objects.h"
+
+/* local prototypes: */
+void	NormalizeConstraintsx( Mat* pGmn, Mat Rmg, NodeSets* nodesets);
+
+#endif  /* _NORMALIZECONSTRAINTSX_H_ */
Index: /issm/trunk/src/c/Orthx/Orthx.cpp
===================================================================
--- /issm/trunk/src/c/Orthx/Orthx.cpp	(revision 1)
+++ /issm/trunk/src/c/Orthx/Orthx.cpp	(revision 1)
@@ -0,0 +1,52 @@
+/*!\file Orthx
+ * \brief orthogonalize searching directions for inverse control methods
+ */
+
+#include "./Orthx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Orthx"
+
+void	Orthx( Vec* pnewgradj, Vec gradj, Vec oldgradj){
+
+	/*output: */
+	Vec newgradj=NULL;
+
+	/*intermediary:*/
+	Vec oldgradj2=NULL;
+	double norm,dot_product;;
+
+
+	if (!oldgradj){
+		VecDuplicate(gradj,&oldgradj2);
+		VecCopy(gradj,oldgradj2);
+		/*scale to 1:*/
+		VecNorm(oldgradj2,NORM_INFINITY,&norm);
+		VecScale(oldgradj2,1.0/norm);
+	}
+
+	/*% normalize gradient to 1:*/
+	VecDuplicate(gradj,&newgradj);
+	VecCopy(gradj,newgradj);
+	VecNorm(newgradj,NORM_INFINITY,&norm);
+	VecScale(newgradj,1.0/norm);
+
+	/*rough orthagonalization
+	gradient=gradient-(gradient'*oldgradient)*oldgradient; 
+	*/
+
+	if(oldgradj){
+		VecDot(newgradj,oldgradj,&dot_product);
+		VecAXPY(newgradj, -dot_product,oldgradj);
+	}
+	else{
+		VecDot(newgradj,oldgradj2,&dot_product);
+		VecAXPY(newgradj, -dot_product,oldgradj2);
+	}
+
+	/*Assign correct pointer*/
+	*pnewgradj=newgradj;
+
+	/*Free ressources and return*/
+	VecFree(&oldgradj2);
+}
Index: /issm/trunk/src/c/Orthx/Orthx.h
===================================================================
--- /issm/trunk/src/c/Orthx/Orthx.h	(revision 1)
+++ /issm/trunk/src/c/Orthx/Orthx.h	(revision 1)
@@ -0,0 +1,14 @@
+/*!\file:  Orthx.h
+ * \brief orthogonalize searching directions for inverse control methods
+ */ 
+
+#ifndef _ORTHX_H
+#define _ORTHX_H
+
+#include "../objects/objects.h"
+
+/* local prototypes: */
+void	Orthx( Vec* pnewgradj, Vec gradj, Vec oldgradj);
+
+#endif  /* _ORTHX_H */
+
Index: /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp	(revision 1)
+++ /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp	(revision 1)
@@ -0,0 +1,51 @@
+/*!\file PenaltyConstraintsx
+ * \brief: set up penalty constraints on loads
+ */
+
+#include "./PenaltyConstraintsx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "PenaltyConstraintsx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes,
+		DataSet* loads,DataSet* materials, ParameterInputs* inputs,int analysis_type){
+
+	int i;
+
+	extern int num_procs;
+	extern int my_rank;
+	
+	/*output: */
+	int converged=0;
+	int num_unstable_constraints=0;
+
+	/*First, get loads configured: */
+	loads->Configure(elements, loads, nodes, materials);
+
+	/*Do we have penalties linked to rifts? In this case, run our special rifts penalty 
+	 * management routine, otherwise, skip : */
+	if (loads->RiftIsPresent()){
+		loads->RiftConstraints(&num_unstable_constraints,inputs,analysis_type);
+	}
+	else if(loads->MeltingIsPresent()){
+		loads->MeltingConstraints(&num_unstable_constraints,inputs,analysis_type);
+	}
+	else{
+		/*Do nothing, no constraints management!:*/
+		num_unstable_constraints=0;
+	}
+
+	/*Have we converged? : */
+	if (num_unstable_constraints==0) converged=1;
+	else converged=0;
+	
+	/*Assign output pointers: */
+	*pconverged=converged;
+	*pnum_unstable_constraints=num_unstable_constraints;
+	
+}
Index: /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h
===================================================================
--- /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h	(revision 1)
+++ /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h	(revision 1)
@@ -0,0 +1,16 @@
+/*!\file:  PenaltyConstraintsx.h
+ * \brief header file for penalty constraints module
+ */ 
+
+#ifndef _PENALTYCONSTRAINTSX_H
+#define _PENALTYCONSTRAINTSX_H
+
+#include "../DataSet/DataSet.h"
+#include "../objects/objects.h"
+
+/* local prototypes: */
+void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes,
+		DataSet* loads,DataSet* materials, ParameterInputs* inputs,int analysis_type); 
+
+#endif  /* _PENALTYCONSTRAINTSX_H */
+
Index: /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
===================================================================
--- /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp	(revision 1)
+++ /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp	(revision 1)
@@ -0,0 +1,56 @@
+/*!\file PenaltySystemMatricesx
+ * \brief: add penalties to system matrices
+ */
+
+#include "./PenaltySystemMatricesx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "PenaltySystemMatricesx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+void PenaltySystemMatricesx(Mat Kgg, Vec pg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
+		int kflag,int pflag,ParameterInputs* inputs,int analysis_type){
+	
+	int i;
+
+	extern int num_procs;
+	extern int my_rank;
+	double kmax;
+	
+	/*First, get elements and loads configured: */
+	elements->Configure(elements,loads, nodes, materials);
+	loads->Configure(elements, loads, nodes, materials);
+
+	/*Now, figure out maximum value of K_gg, so that we can penalize it correctly: */
+	MatNorm(Kgg,NORM_INFINITY,&kmax);
+	#ifdef _DEBUG_
+	 _printf_("   K_gg infinity norm: %g\n",kmax);
+	#endif
+
+	/*Add penalties to stiffnesses, from loads: */
+	if(kflag)loads->PenaltyCreateKMatrix(Kgg,inputs,kmax,analysis_type);
+	if(pflag)loads->PenaltyCreatePVector(pg,inputs,kmax,analysis_type);
+	
+	/*Assemble matrices: */
+	if(kflag){
+		MatAssemblyBegin(Kgg,MAT_FINAL_ASSEMBLY);
+		MatAssemblyEnd(Kgg,MAT_FINAL_ASSEMBLY);
+		MatCompress(Kgg);
+	}
+	if(pflag){
+		VecAssemblyBegin(pg);
+		VecAssemblyEnd(pg);
+	}
+
+	MatNorm(Kgg,NORM_INFINITY,&kmax);
+	#ifdef _DEBUG_
+	 _printf_("   K_gg infinity norm after penalties: %g\n",kmax);
+	#endif
+
+
+
+}
Index: /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h
===================================================================
--- /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h	(revision 1)
+++ /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h	(revision 1)
@@ -0,0 +1,16 @@
+/*!\file:  PenaltySystemMatricesx.h
+ * \brief 
+ */ 
+
+#ifndef _PENALTYSYSTEMMATRICESX_H
+#define _PENALTYSYSTEMMATRICESX_H
+
+#include "../DataSet/DataSet.h"
+#include "../objects/objects.h"
+
+/* local prototypes: */
+void PenaltySystemMatricesx(Mat Kgg, Vec pg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
+		int kflag,int pflag,ParameterInputs* inputs,int analysis_type); 
+
+#endif  /* _PENALTYSYSTEMMATRICESX_H */
+
Index: /issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp
===================================================================
--- /issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp	(revision 1)
+++ /issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp	(revision 1)
@@ -0,0 +1,73 @@
+/*!\file ProcessParamsx
+ * \brief: process parameters using partitioning vector
+ */
+
+#include "./ProcessParamsx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ProcessParamsx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+void ProcessParamsx( DataSet* parameters, Vec  part){
+
+	int i;
+	
+	double* partition=NULL;
+	Param*  param=NULL;
+	double* vx_obs=NULL;
+	double* vy_obs=NULL;
+	double* control_parameter=NULL;
+	int     numberofnodes;
+	int     analysis_type;
+	int     count;
+
+	/*new parameters: */
+	double* u_g_obs=NULL;
+	double* p_g=NULL;
+
+	parameters->FindParam((void*)&analysis_type,"analysis_type");
+	count=parameters->Size();
+
+	if(analysis_type==ControlAnalysisEnum()){
+
+		/*First serialize partition vector: */
+		VecToMPISerial(&partition,part);
+		
+		parameters->FindParam((void*)&vx_obs,"vx_obs");
+		parameters->FindParam((void*)&vy_obs,"vy_obs");
+		parameters->FindParam((void*)&control_parameter,"control_parameter");
+		parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+
+		/*Now, from vx_obs and vy_obs, build u_g_obs, correctly partitioned: */
+		u_g_obs=(double*)xcalloc(numberofnodes*2,sizeof(double));
+		p_g=(double*)xcalloc(numberofnodes*2,sizeof(double));
+
+		for(i=0;i<numberofnodes;i++){
+			u_g_obs[(int)(partition[2*i+0]-1)]=vx_obs[i];  //C indexing
+			u_g_obs[(int)(partition[2*i+1]-1)]=vy_obs[i];  //C indexing
+			p_g[(int)(partition[2*i+0]-1)]=control_parameter[i];
+		}
+
+		/*Now, create new parameters: */
+		count++;
+		param= new Param(count,"u_g_obs",DOUBLEVEC);
+		param->SetDoubleVec(u_g_obs,2*numberofnodes);
+		parameters->AddObject(param);
+
+		count++;
+		param= new Param(count,"p_g",DOUBLEVEC);
+		param->SetDoubleVec(p_g,2*numberofnodes);
+		parameters->AddObject(param);
+	}
+
+	xfree((void**)&partition);
+	xfree((void**)&vx_obs);
+	xfree((void**)&vy_obs);
+	xfree((void**)&control_parameter);
+	xfree((void**)&u_g_obs);
+	xfree((void**)&p_g); 
+}
Index: /issm/trunk/src/c/ProcessParamsx/ProcessParamsx.h
===================================================================
--- /issm/trunk/src/c/ProcessParamsx/ProcessParamsx.h	(revision 1)
+++ /issm/trunk/src/c/ProcessParamsx/ProcessParamsx.h	(revision 1)
@@ -0,0 +1,14 @@
+/*!\file:  ProcessParamsx.h
+ * \brief header file for processing parameters
+ */ 
+
+#ifndef _PROCESSPARAMSX_H
+#define _PROCESSPARAMSX_H
+
+#include "../DataSet/DataSet.h"
+
+/* local prototypes: */
+void		ProcessParamsx( DataSet* parameters, Vec partition);
+
+#endif  /* _PROCESSPARAMSX_H */
+
Index: /issm/trunk/src/c/Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
===================================================================
--- /issm/trunk/src/c/Reduceloadfromgtofx/Reduceloadfromgtofx.cpp	(revision 1)
+++ /issm/trunk/src/c/Reduceloadfromgtofx/Reduceloadfromgtofx.cpp	(revision 1)
@@ -0,0 +1,86 @@
+/*!\file Reduceloadfromgtofx
+ * \brief reduce loads from g set to f set 
+ */
+
+#include "./Reduceloadfromgtofx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Reduceloadfromgtofx"
+
+void	Reduceloadfromgtofx( Vec* ppf, Vec pg, Mat G_mn, Mat Kfs, Vec y_s, NodeSets* nodesets){
+
+	/*output: */
+	Vec pf=NULL;
+
+	/*intermediary*/
+	Vec pn=NULL;
+	Vec pm=NULL;
+	Mat tG_mn=NULL;
+	int tG_mnm,tG_mnn;
+	Vec tG_mnpm=NULL;
+	Vec Kfsy_s=NULL;
+	int Kfsm,Kfsn;
+	PetscScalar a;
+	
+
+	if(!pg){
+		pf=NULL;
+	}
+	else{
+
+		/* Reduce pg to pn:*/
+		if (nodesets->GetMSize()){
+
+			VecPartition(&pn, pg, nodesets->GetPV_N(), nodesets->GetNSize());
+			VecPartition(&pm, pg, nodesets->GetPV_M(), nodesets->GetMSize());
+		
+			/*Create G_mn'*/
+			MatTranspose(G_mn,&tG_mn);  
+
+			/*Create G_mn' * pm*/
+			MatGetLocalSize(tG_mn,&tG_mnm,&tG_mnn);
+			tG_mnpm=NewVecFromLocalSize(tG_mnm);
+			MatMultPatch(tG_mn,pm,tG_mnpm);
+
+			/*add pn to G_mn' * pm*/ 
+			a=1;
+			VecAXPY(pn,a,tG_mnpm);  
+		}
+		else{
+			VecDuplicate(pg,&pn);  
+			VecCopy(pg,pn);  
+		}
+		
+		/*% Reduce pn to pf:*/
+
+		if (nodesets->GetSSize()){
+
+			VecPartition(&pf, pn, nodesets->GetPV_F(),nodesets->GetFSize());
+
+			/*pf = pf - Kfs * y_s;*/
+			MatGetLocalSize(Kfs,&Kfsm,&Kfsn);
+			Kfsy_s=NewVecFromLocalSize(Kfsm);
+			MatMultPatch(Kfs,y_s,Kfsy_s);
+
+			a=-1;
+			VecAXPY(pf,a,Kfsy_s);  
+		}
+		else{
+			/*pf=pn*/
+			VecDuplicate(pn,&pf);  
+			VecCopy(pn,pf);  
+		}
+	}
+	
+	
+	/*Assign correct pointer*/
+	*ppf=pf;
+
+	/*Free ressources and return*/
+	VecFree(&pn);
+	VecFree(&pm);
+	MatFree(&tG_mn);
+	VecFree(&tG_mnpm);
+	VecFree(&Kfsy_s);
+
+}
Index: /issm/trunk/src/c/Reduceloadfromgtofx/Reduceloadfromgtofx.h
===================================================================
--- /issm/trunk/src/c/Reduceloadfromgtofx/Reduceloadfromgtofx.h	(revision 1)
+++ /issm/trunk/src/c/Reduceloadfromgtofx/Reduceloadfromgtofx.h	(revision 1)
@@ -0,0 +1,14 @@
+/*!\file:  Reduceloadfromgtofx.h
+ * \brief reduce load from g set to f set
+ */ 
+
+#ifndef _REDUCELOADFROMGTOFX_H
+#define _REDUCELOADFROMGTOFX_H
+
+#include "../objects/objects.h"
+
+/* local prototypes: */
+void	Reduceloadfromgtofx( Vec* ppf, Vec pg, Mat Gmn, Mat Kfs, Vec ys, NodeSets* nodesets);
+
+#endif  /* _REDUCELOADFROMGTOFX_H */
+
Index: /issm/trunk/src/c/Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
===================================================================
--- /issm/trunk/src/c/Reducematrixfromgtofx/Reducematrixfromgtofx.cpp	(revision 1)
+++ /issm/trunk/src/c/Reducematrixfromgtofx/Reducematrixfromgtofx.cpp	(revision 1)
@@ -0,0 +1,40 @@
+/*!\file Reducematrixfromgtofx
+ * \brief reduce matrix from g set to f fset
+ */
+
+#include "./Reducematrixfromgtofx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Reducematrixfromgtofx"
+
+void Reducematrixfromgtofx( Mat* pKff, Mat* pKfs,Mat Kgg,Mat Gmn,NodeSets* nodesets){
+
+	/*output: */
+	Mat Kff=NULL;
+	Mat Kfs=NULL;
+
+	/*intermediary: */
+	Mat Knn=NULL;
+	
+	/*Reduce to n set: */
+	Reducematrixfromgton( &Knn, Kgg, Gmn, nodesets->GetPV_M(), nodesets->GetMSize(),nodesets->GetPV_N(),nodesets->GetNSize(), 2 );
+
+	//Reduce matrix from n-size to f-size
+	if(nodesets->GetSSize()){
+		
+		MatPartition(&Kff, Knn, nodesets->GetPV_F(),nodesets->GetFSize(),nodesets->GetPV_F(),nodesets->GetFSize()); 
+		MatPartition(&Kfs, Knn, nodesets->GetPV_F(),nodesets->GetFSize(),nodesets->GetPV_S(),nodesets->GetSSize()); 
+
+	}
+	else{
+		MatDuplicate(Knn,MAT_COPY_VALUES,&Kff);
+		Kfs=NULL;
+	}
+
+	/*Free ressources:*/
+	MatFree(&Knn);
+	
+	/*Assign output pointers:*/
+	*pKff=Kff;
+	*pKfs=Kfs;
+}
Index: /issm/trunk/src/c/Reducematrixfromgtofx/Reducematrixfromgtofx.h
===================================================================
--- /issm/trunk/src/c/Reducematrixfromgtofx/Reducematrixfromgtofx.h	(revision 1)
+++ /issm/trunk/src/c/Reducematrixfromgtofx/Reducematrixfromgtofx.h	(revision 1)
@@ -0,0 +1,16 @@
+/*!\file:  Reducematrixfromgtofx.h
+ * \brief reduce petsc matrix from g set to fset: 
+ */
+
+
+#ifndef _REDUCEMATRIXFROMGTOFX_H
+#define _REDUCEMATRIXFROMGTOFX_H
+
+#include "../objects/objects.h"
+
+/* local prototypes: */
+void	Reducematrixfromgtofx( Mat* pKff, Mat* pKfs,Mat Kgg,Mat Gmn,NodeSets* nodesets);
+void    Reducematrixfromgton(Mat* pKnn,Mat Kgg,Mat Gmn,double* pv_m,int msize, double* pv_n,int nsize,int flag);
+
+#endif  /* _REDUCEMATRIXFROMGTOFX_H */
+
Index: /issm/trunk/src/c/Reducematrixfromgtofx/Reducematrixfromgton.cpp
===================================================================
--- /issm/trunk/src/c/Reducematrixfromgtofx/Reducematrixfromgton.cpp	(revision 1)
+++ /issm/trunk/src/c/Reducematrixfromgtofx/Reducematrixfromgton.cpp	(revision 1)
@@ -0,0 +1,73 @@
+/*!\file: Reducematrixfromgton
+ * \brief
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Reducematrixfromgton"
+
+#include "../toolkits/toolkits.h"
+
+
+void  Reducematrixfromgton(Mat* pKnn,Mat Kgg,Mat Gmn,double* pv_m,int msize, double* pv_n,int nsize,int flag){
+
+
+	/*output: */
+	Mat Knn=NULL;
+
+	/*intermediary: */
+	Mat Kmm=NULL;
+	Mat Kmn=NULL;
+	Mat Knm=NULL;
+	Mat KnmGmn=NULL;
+	Mat KmmGmn=NULL;
+	Mat tGmn=NULL;
+	Mat tGmnKmn=NULL;
+	PetscScalar a=1;
+
+	if (msize){
+		
+		/*Partition K_gg*/
+		MatPartition(&Kmm, Kgg, pv_m,msize,pv_m,msize); 
+		MatPartition(&Kmn, Kgg, pv_m,msize,pv_n,nsize); 
+		MatPartition(&Knm, Kgg, pv_n,nsize,pv_m,msize); 
+		MatPartition(&Knn, Kgg, pv_n,nsize,pv_n,nsize);
+	
+		/*Reduce K_gg to K_nn*/
+		//K_nn = K_nn + K_nm * G_mn;
+		MatMatMult(Knm,Gmn,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&KnmGmn);
+		MatAXPY(Knn,a,KnmGmn,DIFFERENT_NONZERO_PATTERN);
+
+		if (flag!=1){
+			//K_mn = K_mn + K_mm * G_mn;
+			MatMatMult(Kmm,Gmn,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&KmmGmn);
+			MatAXPY(Kmn,a,KmmGmn,DIFFERENT_NONZERO_PATTERN);
+			
+			//K_nn = K_nn + G_mn' * K_mn;
+			MatTranspose(Gmn,&tGmn);
+			MatMatMult(tGmn,Kmn,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&tGmnKmn);
+			MatAXPY(Knn,a,tGmnKmn,DIFFERENT_NONZERO_PATTERN);
+		}
+	}
+	else{
+		/*msize=0 just return input*/
+		MatDuplicate(Kgg,MAT_COPY_VALUES,&Knn);
+	}	
+
+	/*Free ressources:*/
+	MatFree(&Kmm);
+	MatFree(&Kmn);
+	MatFree(&Knm);
+	MatFree(&KnmGmn);
+	MatFree(&KmmGmn);
+	MatFree(&tGmn);
+	MatFree(&tGmnKmn);
+	
+	/*Assign output pointers:*/
+	*pKnn=Knn;
+}
Index: /issm/trunk/src/c/Reducevectorgtosx/Reducevectorgtosx.cpp
===================================================================
--- /issm/trunk/src/c/Reducevectorgtosx/Reducevectorgtosx.cpp	(revision 1)
+++ /issm/trunk/src/c/Reducevectorgtosx/Reducevectorgtosx.cpp	(revision 1)
@@ -0,0 +1,42 @@
+/*!\file Reducevectorgtosx
+ * \brief reduce petsc vector from g set to s set (single point constraints), using the nodeset partitioning 
+ * vectors.
+ */
+
+#include "./Reducevectorgtosx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Reducevectorgtosx"
+
+void Reducevectorgtosx( Vec* pys, Vec* pys0, Vec yg, NodeSets* nodesets){
+
+	/*output: */
+	Vec ys=NULL;
+	Vec ys0=NULL;
+
+	/*intermediary: */
+	Vec yn=NULL;
+
+	if (nodesets->GetNSize() && nodesets->GetSSize()){
+
+		VecPartition(&yn,yg,nodesets->GetPV_N(),nodesets->GetNSize());
+	
+		VecPartition(&ys,yn,nodesets->GetPV_S(),nodesets->GetSSize());
+	
+	}
+
+	/*Create ys0, full of 0: */
+	if(ys){
+		VecDuplicate(ys,&ys0);
+		VecSet(ys0,0.0);
+		VecAssemblyBegin(ys0);
+		VecAssemblyEnd(ys0);
+	}
+
+	/*Free ressources:*/
+	VecFree(&yn);
+	
+	/*Assign output pointers:*/
+	*pys=ys;
+	*pys0=ys0;
+}
Index: /issm/trunk/src/c/Reducevectorgtosx/Reducevectorgtosx.h
===================================================================
--- /issm/trunk/src/c/Reducevectorgtosx/Reducevectorgtosx.h	(revision 1)
+++ /issm/trunk/src/c/Reducevectorgtosx/Reducevectorgtosx.h	(revision 1)
@@ -0,0 +1,15 @@
+/*!\file:  Reducevectorgtosx.h
+ * \brief reduce petsc vector from g set to s set (single point constraints), using the nodeset partitioning 
+ * vectors.
+ */ 
+
+#ifndef _REDUCEVECTORGTOSX_H
+#define _REDUCEVECTORGTOSX_H
+
+#include "../objects/objects.h"
+
+/* local prototypes: */
+void	Reducevectorgtosx( Vec* pys, Vec* pys0,Vec yg, NodeSets* nodesets);
+
+#endif  /* _REDUCEVECTORGTOSX_H */
+
Index: /issm/trunk/src/c/Solverx/Solverx.cpp
===================================================================
--- /issm/trunk/src/c/Solverx/Solverx.cpp	(revision 1)
+++ /issm/trunk/src/c/Solverx/Solverx.cpp	(revision 1)
@@ -0,0 +1,102 @@
+/*!\file Solverx
+ * \brief solver
+ */
+
+#include "./Solverx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Solverx"
+
+#include "../shared/shared.h"
+
+void	Solverx( Vec* puf, Mat Kff, Vec pf, Vec uf0, char* solver_string){
+
+	/*output: */
+	Vec uf=NULL;
+
+	/*intermediary: */
+	int local_m,local_n;
+	
+	/*Solver*/
+	KSP ksp=NULL;
+	int iteration_number;
+	PetscTruth flag;
+	int solver_type;
+
+	/*If initial guess for solution exists, use it to create uf, otherwise, 
+	 * duplicate right hand side so that solution vector has same structure*/
+	if(uf0){
+		VecDuplicate(uf0,&uf); VecCopy(uf0,uf);
+	}
+	else{
+		MatGetLocalSize(Kff,&local_m,&local_n);uf=NewVecFromLocalSize(local_n);
+	}
+
+	/*Before preparing the solver, add options to the options database*/
+	PetscOptionsInsertMultipleString(solver_string);
+
+	/*Process solver_string to see if we are not using special types of external solvers: */
+	PetscOptionsDetermineSolverType(&solver_type,solver_string);
+
+	if (solver_type==MUMPSPACKAGE_LU){
+		/*Convert Kff to MATTAIJMUMPS: */
+		MatConvert(Kff,MATAIJMUMPS,MAT_REUSE_MATRIX,&Kff);
+	}
+	if (solver_type==MUMPSPACKAGE_CHOL){
+		/*Convert Kff to MATTSBAIJMUMPS: */
+		MatConvert(Kff,MATSBAIJMUMPS,MAT_REUSE_MATRIX,&Kff);
+	}
+	if (solver_type==SPOOLESPACKAGE_LU){
+		/*Convert Kff to MATTSBAIJMUMPS: */
+		MatConvert(Kff,MATAIJSPOOLES,MAT_REUSE_MATRIX,&Kff);
+	}
+	if (solver_type==SPOOLESPACKAGE_CHOL){
+		/*Convert Kff to MATTSBAIJMUMPS: */
+		MatConvert(Kff,MATSBAIJSPOOLES,MAT_REUSE_MATRIX,&Kff);
+	}
+	if (solver_type==SUPERLUDISTPACKAGE){
+		/*Convert Kff to MATTSBAIJMUMPS: */
+		MatConvert(Kff,MATSUPERLU_DIST,MAT_REUSE_MATRIX,&Kff);
+	}
+
+
+	/*Prepare solver*/
+	KSPCreate(MPI_COMM_WORLD,&ksp);
+	KSPSetOperators(ksp,Kff,Kff,DIFFERENT_NONZERO_PATTERN);
+	KSPSetFromOptions(ksp);
+
+	/*If initial guess for solution, use it, except if we are using the MUMPS direct solver, where any initial 
+	 * guess will crash Petsc: */
+	if (uf0){
+		if( (solver_type!=MUMPSPACKAGE_LU) && (solver_type!=MUMPSPACKAGE_CHOL) && (solver_type!=SPOOLESPACKAGE_LU)&& (solver_type!=SPOOLESPACKAGE_CHOL)&& (solver_type!=SUPERLUDISTPACKAGE)){
+			KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);
+		}
+	}
+		
+
+	#ifdef _DEBUG_ 
+		KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);
+		KSPGetInitialGuessNonzero(ksp,&flag); 
+		_printf_("User provided initial guess solution: %i\n",flag);
+	#endif
+
+	KSPSolve(ksp,pf,uf);
+	
+	/*Check convergence*/
+	KSPGetIterationNumber(ksp,&iteration_number);
+	if (iteration_number<0){
+		throw ErrorException(__FUNCT__,exprintf("%s%i"," Solver diverged at iteration number: ",-iteration_number));
+	}
+	else{
+		#ifdef _DEBUG_ 
+		_printf_("%s%i%s\n","Solver converged after ",iteration_number," iterations");
+		#endif
+	}
+
+	/*Free ressources:*/
+	KSPFree(&ksp);
+
+	
+	/*Assign output pointers:*/
+	*puf=uf;
+}
Index: /issm/trunk/src/c/Solverx/Solverx.h
===================================================================
--- /issm/trunk/src/c/Solverx/Solverx.h	(revision 1)
+++ /issm/trunk/src/c/Solverx/Solverx.h	(revision 1)
@@ -0,0 +1,15 @@
+/*!\file:  Solverx.h
+ * \brief solver
+ */ 
+
+#ifndef _SOLVERX_H
+#define _SOLVERX_H
+
+#include "../objects/objects.h"
+
+
+/* local prototypes: */
+void	Solverx( Vec* puf, Mat Kff, Vec pf, Vec uf0, char* solver_string);
+
+#endif  /* _SOLVERX_H */
+
Index: /issm/trunk/src/c/SpcNodesx/SpcNodesx.cpp
===================================================================
--- /issm/trunk/src/c/SpcNodesx/SpcNodesx.cpp	(revision 1)
+++ /issm/trunk/src/c/SpcNodesx/SpcNodesx.cpp	(revision 1)
@@ -0,0 +1,37 @@
+/*!\file SpcNodesx
+ * \brief: establish single point constraints on all grids, as well as constraints vector.
+ */
+
+#include "./SpcNodesx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "SpcNodesx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+int SpcNodesx( Vec* pyg, DataSet* nodes,DataSet* constraints){
+
+	int i;
+	int numberofdofs;
+
+	/*output: */
+	Vec yg=NULL;
+
+	/*First, recover number of dofs from nodes: */
+	numberofdofs=nodes->NumberOfDofs();
+
+	/*Allocate yg: */
+	yg=NewVec(numberofdofs);
+
+	/*Now, go through constraints, and update the nodes and the constraint vector at the same time: */
+	constraints->SetupSpcs(nodes,yg);
+
+	/*Assign output pointers: */
+	*pyg=yg;
+
+	return 1;
+	
+}
Index: /issm/trunk/src/c/SpcNodesx/SpcNodesx.h
===================================================================
--- /issm/trunk/src/c/SpcNodesx/SpcNodesx.h	(revision 1)
+++ /issm/trunk/src/c/SpcNodesx/SpcNodesx.h	(revision 1)
@@ -0,0 +1,15 @@
+/*!\file:  SpcNodesx.h
+ * \brief header file for node single point constraints
+ */ 
+
+#ifndef _SPCNODESX_H
+#define _SPCNODESX_H
+
+#include "../DataSet/DataSet.h"
+#include "../toolkits/toolkits.h"
+
+/* local prototypes: */
+int		SpcNodesx( Vec* yg, DataSet* nodesin,DataSet* constraints);
+
+#endif  /* _SPCNODESX_H */
+
Index: /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp
===================================================================
--- /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp	(revision 1)
+++ /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp	(revision 1)
@@ -0,0 +1,65 @@
+/*!\file SystemMatricesx
+ * \brief: create system matrices (stiffness matrix, loads vector)
+ */
+
+#include "./SystemMatricesx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "SystemMatricesx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
+		int kflag,int pflag,int connectivity,int numberofdofspernode,ParameterInputs* inputs,int analysis_type){
+	
+	int i;
+
+	extern int num_procs;
+	extern int my_rank;
+	
+	/*intermediary: */
+	int gsize;
+
+	/*output: */
+	Mat Kgg=NULL;
+	Vec pg=NULL;
+
+	/*First, get elements and loads configured: */
+	elements->Configure(elements,loads, nodes, materials);
+	loads->Configure(elements, loads, nodes, materials);
+
+
+	/*Get size of matrix: */
+	gsize=nodes->NumberOfDofs();
+
+	/*Allocate Kgg and pg: */
+	if(kflag)Kgg=NewMat(gsize,gsize,NULL,&connectivity,&numberofdofspernode);
+	if(pflag)pg=NewVec(gsize);
+	
+	/*Fill stiffness matrix and right hand side vector, from elements: */
+	if(kflag)elements->CreateKMatrix(Kgg,inputs,analysis_type);
+	if(pflag)elements->CreatePVector(pg,inputs,analysis_type);
+	
+	/*Fill stiffness matrix and right hand side vector, from loads: */
+	if(kflag)loads->CreateKMatrix(Kgg,inputs,analysis_type);
+	if(pflag)loads->CreatePVector(pg,inputs,analysis_type);
+
+	/*Assemble matrices: */
+	if(kflag){
+		MatAssemblyBegin(Kgg,MAT_FINAL_ASSEMBLY);
+		MatAssemblyEnd(Kgg,MAT_FINAL_ASSEMBLY);
+		MatCompress(Kgg);
+	}
+	if(pflag){
+		VecAssemblyBegin(pg);
+		VecAssemblyEnd(pg);
+	}
+	
+
+	/*Assign output pointers: */
+	*pKgg=Kgg;
+	*ppg=pg;
+}
Index: /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h
===================================================================
--- /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h	(revision 1)
+++ /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h	(revision 1)
@@ -0,0 +1,16 @@
+/*!\file:  SystemMatricesx.h
+ * \brief header file for degree of freedoms distribution routines.
+ */ 
+
+#ifndef _SYSTEMMATRICESX_H
+#define _SYSTEMMATRICESX_H
+
+#include "../DataSet/DataSet.h"
+#include "../objects/objects.h"
+
+/* local prototypes: */
+void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
+		int kflag,int pflag,int connectivity,int numberofdofspernode,ParameterInputs* inputs,int analysis_type); 
+
+#endif  /* _SYSTEMMATRICESX_H */
+
Index: /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.cpp
===================================================================
--- /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.cpp	(revision 1)
+++ /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.cpp	(revision 1)
@@ -0,0 +1,34 @@
+/*!\file UpdateFromInputsx
+ * \brief: update datasets using  parameter inputs
+ */
+
+#include "./UpdateFromInputsx.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "UpdateFromInputsx"
+
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../toolkits/toolkits.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+int UpdateFromInputsx( DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, ParameterInputs* inputs) {
+
+	int noerr=1;
+	int i;
+
+	int  found=0;
+	extern int num_procs;
+	extern int my_rank;
+
+	/*First, get elements and loads configured: */
+	elements->Configure(elements,loads, nodes, materials);
+	loads->Configure(elements, loads, nodes, materials);
+	
+	/*Update elements, loads and materials from inputs: */
+	elements->UpdateFromInputs(inputs);
+	loads->UpdateFromInputs(inputs);
+
+	return noerr;
+
+}
Index: /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.h
===================================================================
--- /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.h	(revision 1)
+++ /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.h	(revision 1)
@@ -0,0 +1,15 @@
+/*!\file:  UpdateFromInputsx.h
+ * \brief header file for updating datasets from inputs
+ */ 
+
+#ifndef _UPDATEFROMINPUTSXX_H
+#define _UPDATEFROMINPUTSXX_H
+
+#include "../DataSet/DataSet.h"
+#include "../objects/ParameterInputs.h"
+
+/* local prototypes: */
+int		UpdateFromInputsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, ParameterInputs* inputs);
+
+#endif  /* _UPDATEFROMINPUTSXX_H */
+
Index: /issm/trunk/src/c/include/globals.h
===================================================================
--- /issm/trunk/src/c/include/globals.h	(revision 1)
+++ /issm/trunk/src/c/include/globals.h	(revision 1)
@@ -0,0 +1,11 @@
+/*!\file global.h:
+ * \brief: these are the global variables always needed. 
+ */
+
+#ifndef GLOBALS_H_
+#define GLOBALS_H_
+
+extern int my_rank;
+extern int num_procs;
+
+#endif
Index: /issm/trunk/src/c/include/macros.h
===================================================================
--- /issm/trunk/src/c/include/macros.h	(revision 1)
+++ /issm/trunk/src/c/include/macros.h	(revision 1)
@@ -0,0 +1,54 @@
+/* \file macros.h
+ * \brief: global macros used in the whole code
+ */
+
+
+#ifndef _MACROS_H_
+#define _MACROS_H_
+
+
+/*Printing macro: */
+#define _printf_(...) PrintfFunction(__VA_ARGS__)
+
+
+/*The following macros hide the error exception handling in a matlab module. Just put 
+ * MODULEBOOT(); and MODULEEND(); at the beginning and end of a module, and c++ exceptions 
+ * will be trapped. Really nifty!*/
+
+#ifdef _SERIAL_
+
+#define MODULEBOOT(); ModuleBoot(); \
+	try{
+
+#define MODULEEND(); }\
+	catch(ErrorException &exception){\
+		exception.Report(); \
+		mexErrMsgTxt(" ");\
+	}\
+	catch (exception& e) {\
+		_printf_("Standard exception: %s\n",e.what());\
+		mexErrMsgTxt(" ");\
+	}
+
+
+
+#else 
+
+
+#define MODULEBOOT(); ModuleBoot(); \
+	try{
+
+#define MODULEEND(); }\
+	catch(ErrorException &exception){\
+		exception.Report(); \
+		return 1;\
+	}\
+	catch (exception& e) {\
+		_printf_("Standard exception: %s\n",e.what());\
+		return 1;\
+	}
+
+#endif
+
+#endif
+
Index: /issm/trunk/src/c/include/typedefs.h
===================================================================
--- /issm/trunk/src/c/include/typedefs.h	(revision 1)
+++ /issm/trunk/src/c/include/typedefs.h	(revision 1)
@@ -0,0 +1,11 @@
+/*!\file: typedefs.h
+ * \brief prototypes for typedefs.h
+ */ 
+
+#ifndef _ISSMTYPEDEFS_H_
+#define  _ISSMTYPEDEFS_H_
+
+#define UNDEF -9999
+
+#endif //ifndef _ISSMTYPEDEFS_H_
+
Index: /issm/trunk/src/c/io/.deps/CreateDataRef.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/CreateDataRef.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/CreateDataRef.Po	(revision 1)
@@ -0,0 +1,632 @@
+CreateDataRef.o CreateDataRef.o: CreateDataRef.c /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io_local.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io_local.h:
Index: /issm/trunk/src/c/io/.deps/CreateDataSetRef.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/CreateDataSetRef.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/CreateDataSetRef.Po	(revision 1)
@@ -0,0 +1,632 @@
+CreateDataSetRef.o CreateDataSetRef.o: CreateDataSetRef.c \
+  /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io_local.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io_local.h:
Index: /issm/trunk/src/c/io/.deps/DropMultipleDataSets.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/DropMultipleDataSets.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/DropMultipleDataSets.Po	(revision 1)
@@ -0,0 +1,629 @@
+DropMultipleDataSets.o DropMultipleDataSets.o: DropMultipleDataSets.c \
+  /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io_local.h io.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io_local.h:
+
+io.h:
Index: /issm/trunk/src/c/io/.deps/FetchData.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/FetchData.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/FetchData.Po	(revision 1)
@@ -0,0 +1,407 @@
+FetchData.o FetchData.o: FetchData.c io.h ../objects/ParameterInputs.h \
+  ../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/stdlib.h /usr/include/sys/types.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
+  /usr/include/sys/select.h /usr/include/bits/select.h \
+  /usr/include/bits/sigset.h /usr/include/bits/time.h \
+  /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
+  /usr/include/alloca.h /usr/include/assert.h /usr/include/stdio.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h
+
+io.h:
+
+../objects/ParameterInputs.h:
+
+../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/assert.h:
+
+/usr/include/stdio.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
Index: /issm/trunk/src/c/io/.deps/FetchDataSet.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/FetchDataSet.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/FetchDataSet.Po	(revision 1)
@@ -0,0 +1,632 @@
+FetchDataSet.o FetchDataSet.o: FetchDataSet.c /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io_local.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io_local.h:
Index: /issm/trunk/src/c/io/.deps/GetDataFromDisk.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/GetDataFromDisk.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/GetDataFromDisk.Po	(revision 1)
@@ -0,0 +1,630 @@
+GetDataFromDisk.o GetDataFromDisk.o: GetDataFromDisk.c \
+  /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
Index: /issm/trunk/src/c/io/.deps/GetStructureElementPtr.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/GetStructureElementPtr.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/GetStructureElementPtr.Po	(revision 1)
@@ -0,0 +1,633 @@
+GetStructureElementPtr.o GetStructureElementPtr.o:  \
+ GetStructureElementPtr.c /usr/include/ctype.h /usr/include/features.h \
+  /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
+  /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
+  /usr/include/bits/types.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/typesizes.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/stdio.h /usr/include/libio.h \
+  /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
+  /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io_local.h
+
+/usr/include/ctype.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/include/bits/types.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/stdio.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io_local.h:
Index: /issm/trunk/src/c/io/.deps/HeaderAddToDataSetRef.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/HeaderAddToDataSetRef.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/HeaderAddToDataSetRef.Po	(revision 1)
@@ -0,0 +1,665 @@
+HeaderAddToDataSetRef.o HeaderAddToDataSetRef.o: HeaderAddToDataSetRef.c \
+  ../include/cielo.h ../include/../../../config.h \
+  ../include/./standard_includes.h /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/ctype.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/time.h /usr/include/bits/time.h \
+  /usr/include/signal.h /usr/include/bits/sigset.h \
+  /usr/include/bits/signum.h /usr/include/time.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/bits/sigthread.h \
+  /usr/include/sys/sem.h /usr/include/sys/ipc.h \
+  /usr/include/bits/ipctypes.h /usr/include/bits/ipc.h \
+  /usr/include/bits/sem.h /usr/include/sys/types.h \
+  /usr/include/sys/select.h /usr/include/bits/select.h \
+  /usr/include/sys/sysmacros.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/stdlib.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/math.h /usr/include/bits/huge_val.h \
+  /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
+  /usr/include/bits/mathinline.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../include/./cielo_types.h ../include/./cielo_macros.h \
+  /usr/include/strings.h ../include/./cielo_externals.h \
+  ../include/./../DataSet/DataSet.h \
+  ../include/./../DataSet/./ContentsList.h \
+  ../include/./../objects/objects.h ../include/./../objects/./Analysis.h \
+  ../include/./../objects/./../DataSet/DataSet.h \
+  ../include/./../objects/././InputFormats.h \
+  ../include/./../objects/./MpcCase.h ../include/./../objects/./SpcCase.h \
+  ../include/./../objects/./Suport.h \
+  ../include/./../objects/./SubcaseCase.h \
+  ../include/./../objects/./IcCase.h ../include/./../objects/./LoadCase.h \
+  ../include/./../objects/./MethodCase.h \
+  ../include/./../objects/./ThloadCase.h \
+  ../include/./../objects/./ThspcCase.h \
+  ../include/./../objects/./TimeCase.h \
+  ../include/./../objects/./TstepCase.h ../include/./../objects/./Grid.h \
+  ../include/./../objects/./Grdset.h ../include/./../objects/./Cordx.h \
+  ../include/./../objects/./Tria.h ../include/./../objects/./Penta.h \
+  ../include/./../objects/./Fluxic.h ../include/./../objects/./Gradic.h \
+  ../include/./../objects/./Penpair.h ../include/./../objects/./Pengrid.h \
+  ../include/./../objects/./Penload.h \
+  ../include/./../objects/./Icefront.h ../include/./../objects/./Tstep.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Tstepnl.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Mpc.h \
+  ../include/./../objects/././GenericLinkedList.h \
+  ../include/./../objects/./Mpcadd.h \
+  ../include/./../objects/././SetList.h \
+  ../include/./../objects/././../DataSet/DataSet.h \
+  ../include/./../objects/./Spc.h ../include/./../objects/./Spc1.h \
+  ../include/./../objects/./SetList.h ../include/./../objects/./Spcadd.h \
+  ../include/./../objects/./Spcd.h ../include/./../objects/./Thspc.h \
+  ../include/./../objects/./Thspc1.h ../include/./../objects/./Thspcadd.h \
+  ../include/./../objects/./Thspcd.h \
+  ../include/./../objects/./InternalGrid.h \
+  ../include/./../objects/././Grid.h \
+  ../include/./../objects/./../include/cielo_types.h \
+  ../include/./../objects/./InternalCordx.h \
+  ../include/./../objects/././Cordx.h ../include/./../objects/./Matice.h \
+  ../include/./../objects/./Matpar.h ../include/./../objects/./Param.h \
+  ../include/./../objects/./SetEntry.h ../include/./../objects/./State.h \
+  ../include/./../objects/././Analysis.h \
+  ../include/./../objects/././Param.h \
+  ../include/./../objects/./SpcState.h \
+  ../include/./../objects/./SubcaseState.h \
+  ../include/./../objects/./LoadState.h ../include/./../objects/SetList.h \
+  ../include/./../objects/./DOFSets.h \
+  ../include/./../objects/./VirtualFunctions.h \
+  ../include/./../objects/././ElementObjects/ElemMatrix.h \
+  ../include/./../objects/././ElementObjects/ElemVector.h \
+  ../include/./../objects/./../io/io.h \
+  ../include/./../objects/./../io/../objects/ParameterInputs.h \
+  ../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h /usr/include/alloca.h \
+  /usr/include/assert.h \
+  ../include/./../objects/./ElementObjects/ElementObjects.h \
+  ../include/./../objects/./ElementObjects/./TriaElement.h \
+  ../include/./../objects/./ElementObjects/./../Tria.h \
+  ../include/./../objects/./ElementObjects/./../Friction.h \
+  ../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/././ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/./../objects/./ElementObjects/./././ElemVector.h \
+  ../include/./../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/./../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./../objects.h \
+  ../include/./../objects/./ElementObjects/./PentaElement.h \
+  ../include/./../objects/./ElementObjects/./../Penta.h \
+  ../include/./../objects/./ElementObjects/././TriaElement.h \
+  ../include/./../objects/./ElementObjects/./GaussPoints.h \
+  ../include/./../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/./../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/./../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/ElementUtils.h \
+  ../include/./../objects/./LoadObjects/LoadObjects.h \
+  ../include/./../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/./../objects/./LoadObjects/./../objects.h \
+  ../include/./../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/./../objects/./LoadObjects/./../Icefront.h \
+  ../include/./../objects/./LoadObjects/./PengridLoad.h \
+  ../include/./../objects/./LoadObjects/././PengridLoad.h \
+  ../include/./../objects/./LoadObjects/./../Pengrid.h \
+  ../include/./../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/./../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./Uset.h \
+  ../include/./../objects/./ParameterInputs.h \
+  ../include/./../objects/./Contour.h ../include/../DataSet/DataSet.h \
+  ../include/../EnumDefinitions/EnumDefinitions.h \
+  ../include/../objects/objects.h ../include/../shared/shared.h \
+  ../include/../shared/./AllocOps/alloc.h \
+  ../include/../shared/./AllocOps/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/MatlabLayer.h \
+  ../include/../shared/./MatlabLayer/../../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h \
+  ../include/../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../include/../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../include/../shared/./MatrixUtils/MatrixUtils.h \
+  ../include/../shared/./ElementUtils/ElementUtils.h \
+  ../include/../shared/./DofOps/DofOps.h \
+  ../include/../shared/./DofOps/../../include/cielo_types.h \
+  ../include/../shared/./DofOps/../../DataSet/DataSet.h \
+  ../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../include/../shared/./Numerics/UnsymmCrout.h \
+  ../include/../shared/./Numerics/cross.h \
+  ../include/../shared/./Numerics/norm.h \
+  ../include/../shared/./Numerics/extrema.h \
+  ../include/../shared/./SortAndSearch/SortAndSearch.h \
+  ../include/../shared/./Sparse/Sparse.h \
+  ../include/../shared/./Sparse/SparseUtils.h \
+  ../include/../shared/./Sparse/CsrSparseMatrix.h \
+  ../include/../shared/./Sparse/./SparseUtils.h \
+  ../include/../shared/./Marshalling/Marshalling.h \
+  ../include/../shared/./ErrorMacros.h \
+  ../include/../shared/./../include/cielo_externals.h \
+  ../include/../shared/./Time/Time.h \
+  ../include/../shared/./StdMemOut/StdMemOut.h \
+  ../include/../shared/./PrintfMacroExpand.h \
+  ../include/../shared/./Thread/thread.h ../include/../shared/Io/Io.h \
+  ../include/../shared/./SetErrMsg.h \
+  ../include/../shared/./Time/Profiler.h ../include/../shared/./Exp/Exp.h \
+  ../include/./matlab_includes.h ../include/../io/io.h \
+  ../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h
+
+../include/cielo.h:
+
+../include/../../../config.h:
+
+../include/./standard_includes.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/ctype.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../include/./cielo_types.h:
+
+../include/./cielo_macros.h:
+
+/usr/include/strings.h:
+
+../include/./cielo_externals.h:
+
+../include/./../DataSet/DataSet.h:
+
+../include/./../DataSet/./ContentsList.h:
+
+../include/./../objects/objects.h:
+
+../include/./../objects/./Analysis.h:
+
+../include/./../objects/./../DataSet/DataSet.h:
+
+../include/./../objects/././InputFormats.h:
+
+../include/./../objects/./MpcCase.h:
+
+../include/./../objects/./SpcCase.h:
+
+../include/./../objects/./Suport.h:
+
+../include/./../objects/./SubcaseCase.h:
+
+../include/./../objects/./IcCase.h:
+
+../include/./../objects/./LoadCase.h:
+
+../include/./../objects/./MethodCase.h:
+
+../include/./../objects/./ThloadCase.h:
+
+../include/./../objects/./ThspcCase.h:
+
+../include/./../objects/./TimeCase.h:
+
+../include/./../objects/./TstepCase.h:
+
+../include/./../objects/./Grid.h:
+
+../include/./../objects/./Grdset.h:
+
+../include/./../objects/./Cordx.h:
+
+../include/./../objects/./Tria.h:
+
+../include/./../objects/./Penta.h:
+
+../include/./../objects/./Fluxic.h:
+
+../include/./../objects/./Gradic.h:
+
+../include/./../objects/./Penpair.h:
+
+../include/./../objects/./Pengrid.h:
+
+../include/./../objects/./Penload.h:
+
+../include/./../objects/./Icefront.h:
+
+../include/./../objects/./Tstep.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Tstepnl.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Mpc.h:
+
+../include/./../objects/././GenericLinkedList.h:
+
+../include/./../objects/./Mpcadd.h:
+
+../include/./../objects/././SetList.h:
+
+../include/./../objects/././../DataSet/DataSet.h:
+
+../include/./../objects/./Spc.h:
+
+../include/./../objects/./Spc1.h:
+
+../include/./../objects/./SetList.h:
+
+../include/./../objects/./Spcadd.h:
+
+../include/./../objects/./Spcd.h:
+
+../include/./../objects/./Thspc.h:
+
+../include/./../objects/./Thspc1.h:
+
+../include/./../objects/./Thspcadd.h:
+
+../include/./../objects/./Thspcd.h:
+
+../include/./../objects/./InternalGrid.h:
+
+../include/./../objects/././Grid.h:
+
+../include/./../objects/./../include/cielo_types.h:
+
+../include/./../objects/./InternalCordx.h:
+
+../include/./../objects/././Cordx.h:
+
+../include/./../objects/./Matice.h:
+
+../include/./../objects/./Matpar.h:
+
+../include/./../objects/./Param.h:
+
+../include/./../objects/./SetEntry.h:
+
+../include/./../objects/./State.h:
+
+../include/./../objects/././Analysis.h:
+
+../include/./../objects/././Param.h:
+
+../include/./../objects/./SpcState.h:
+
+../include/./../objects/./SubcaseState.h:
+
+../include/./../objects/./LoadState.h:
+
+../include/./../objects/SetList.h:
+
+../include/./../objects/./DOFSets.h:
+
+../include/./../objects/./VirtualFunctions.h:
+
+../include/./../objects/././ElementObjects/ElemMatrix.h:
+
+../include/./../objects/././ElementObjects/ElemVector.h:
+
+../include/./../objects/./../io/io.h:
+
+../include/./../objects/./../io/../objects/ParameterInputs.h:
+
+../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/include/alloca.h:
+
+/usr/include/assert.h:
+
+../include/./../objects/./ElementObjects/ElementObjects.h:
+
+../include/./../objects/./ElementObjects/./TriaElement.h:
+
+../include/./../objects/./ElementObjects/./../Tria.h:
+
+../include/./../objects/./ElementObjects/./../Friction.h:
+
+../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/././ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/./../objects/./ElementObjects/./././ElemVector.h:
+
+../include/./../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/./../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./../objects.h:
+
+../include/./../objects/./ElementObjects/./PentaElement.h:
+
+../include/./../objects/./ElementObjects/./../Penta.h:
+
+../include/./../objects/./ElementObjects/././TriaElement.h:
+
+../include/./../objects/./ElementObjects/./GaussPoints.h:
+
+../include/./../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/./../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/./../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/ElementUtils.h:
+
+../include/./../objects/./LoadObjects/LoadObjects.h:
+
+../include/./../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/./../objects/./LoadObjects/./../objects.h:
+
+../include/./../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/./../objects/./LoadObjects/./../Icefront.h:
+
+../include/./../objects/./LoadObjects/./PengridLoad.h:
+
+../include/./../objects/./LoadObjects/././PengridLoad.h:
+
+../include/./../objects/./LoadObjects/./../Pengrid.h:
+
+../include/./../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/./../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./Uset.h:
+
+../include/./../objects/./ParameterInputs.h:
+
+../include/./../objects/./Contour.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../EnumDefinitions/EnumDefinitions.h:
+
+../include/../objects/objects.h:
+
+../include/../shared/shared.h:
+
+../include/../shared/./AllocOps/alloc.h:
+
+../include/../shared/./AllocOps/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/MatlabLayer.h:
+
+../include/../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../include/../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../include/../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../include/../shared/./MatrixUtils/MatrixUtils.h:
+
+../include/../shared/./ElementUtils/ElementUtils.h:
+
+../include/../shared/./DofOps/DofOps.h:
+
+../include/../shared/./DofOps/../../include/cielo_types.h:
+
+../include/../shared/./DofOps/../../DataSet/DataSet.h:
+
+../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../include/../shared/./Numerics/UnsymmCrout.h:
+
+../include/../shared/./Numerics/cross.h:
+
+../include/../shared/./Numerics/norm.h:
+
+../include/../shared/./Numerics/extrema.h:
+
+../include/../shared/./SortAndSearch/SortAndSearch.h:
+
+../include/../shared/./Sparse/Sparse.h:
+
+../include/../shared/./Sparse/SparseUtils.h:
+
+../include/../shared/./Sparse/CsrSparseMatrix.h:
+
+../include/../shared/./Sparse/./SparseUtils.h:
+
+../include/../shared/./Marshalling/Marshalling.h:
+
+../include/../shared/./ErrorMacros.h:
+
+../include/../shared/./../include/cielo_externals.h:
+
+../include/../shared/./Time/Time.h:
+
+../include/../shared/./StdMemOut/StdMemOut.h:
+
+../include/../shared/./PrintfMacroExpand.h:
+
+../include/../shared/./Thread/thread.h:
+
+../include/../shared/Io/Io.h:
+
+../include/../shared/./SetErrMsg.h:
+
+../include/../shared/./Time/Profiler.h:
+
+../include/../shared/./Exp/Exp.h:
+
+../include/./matlab_includes.h:
+
+../include/../io/io.h:
+
+../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
Index: /issm/trunk/src/c/io/.deps/IsDataSetRef.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/IsDataSetRef.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/IsDataSetRef.Po	(revision 1)
@@ -0,0 +1,632 @@
+IsDataSetRef.o IsDataSetRef.o: IsDataSetRef.c /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io_local.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io_local.h:
Index: /issm/trunk/src/c/io/.deps/ParallelFetchData.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/ParallelFetchData.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/ParallelFetchData.Po	(revision 1)
@@ -0,0 +1,621 @@
+ParallelFetchData.o ParallelFetchData.o: ParallelFetchData.c io.h \
+  ../objects/ParameterInputs.h \
+  ../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/stdlib.h /usr/include/sys/types.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
+  /usr/include/sys/select.h /usr/include/bits/select.h \
+  /usr/include/bits/sigset.h /usr/include/bits/time.h \
+  /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
+  /usr/include/alloca.h /usr/include/assert.h /usr/include/stdio.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h
+
+io.h:
+
+../objects/ParameterInputs.h:
+
+../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/assert.h:
+
+/usr/include/stdio.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
Index: /issm/trunk/src/c/io/.deps/ParallelFetchInteger.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/ParallelFetchInteger.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/ParallelFetchInteger.Po	(revision 1)
@@ -0,0 +1,665 @@
+ParallelFetchInteger.o ParallelFetchInteger.o: ParallelFetchInteger.c \
+  ../include/cielo.h ../include/../../../config.h \
+  ../include/./standard_includes.h /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/ctype.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/time.h /usr/include/bits/time.h \
+  /usr/include/signal.h /usr/include/bits/sigset.h \
+  /usr/include/bits/signum.h /usr/include/time.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/bits/sigthread.h \
+  /usr/include/sys/sem.h /usr/include/sys/ipc.h \
+  /usr/include/bits/ipctypes.h /usr/include/bits/ipc.h \
+  /usr/include/bits/sem.h /usr/include/sys/types.h \
+  /usr/include/sys/select.h /usr/include/bits/select.h \
+  /usr/include/sys/sysmacros.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/stdlib.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/math.h /usr/include/bits/huge_val.h \
+  /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
+  /usr/include/bits/mathinline.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../include/./cielo_types.h ../include/./cielo_macros.h \
+  /usr/include/strings.h ../include/./cielo_externals.h \
+  ../include/./../DataSet/DataSet.h \
+  ../include/./../DataSet/./ContentsList.h \
+  ../include/./../objects/objects.h ../include/./../objects/./Analysis.h \
+  ../include/./../objects/./../DataSet/DataSet.h \
+  ../include/./../objects/././InputFormats.h \
+  ../include/./../objects/./MpcCase.h ../include/./../objects/./SpcCase.h \
+  ../include/./../objects/./Suport.h \
+  ../include/./../objects/./SubcaseCase.h \
+  ../include/./../objects/./IcCase.h ../include/./../objects/./LoadCase.h \
+  ../include/./../objects/./MethodCase.h \
+  ../include/./../objects/./ThloadCase.h \
+  ../include/./../objects/./ThspcCase.h \
+  ../include/./../objects/./TimeCase.h \
+  ../include/./../objects/./TstepCase.h ../include/./../objects/./Grid.h \
+  ../include/./../objects/./Grdset.h ../include/./../objects/./Cordx.h \
+  ../include/./../objects/./Tria.h ../include/./../objects/./Penta.h \
+  ../include/./../objects/./Fluxic.h ../include/./../objects/./Gradic.h \
+  ../include/./../objects/./Penpair.h ../include/./../objects/./Pengrid.h \
+  ../include/./../objects/./Penload.h \
+  ../include/./../objects/./Icefront.h ../include/./../objects/./Tstep.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Tstepnl.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Mpc.h \
+  ../include/./../objects/././GenericLinkedList.h \
+  ../include/./../objects/./Mpcadd.h \
+  ../include/./../objects/././SetList.h \
+  ../include/./../objects/././../DataSet/DataSet.h \
+  ../include/./../objects/./Spc.h ../include/./../objects/./Spc1.h \
+  ../include/./../objects/./SetList.h ../include/./../objects/./Spcadd.h \
+  ../include/./../objects/./Spcd.h ../include/./../objects/./Thspc.h \
+  ../include/./../objects/./Thspc1.h ../include/./../objects/./Thspcadd.h \
+  ../include/./../objects/./Thspcd.h \
+  ../include/./../objects/./InternalGrid.h \
+  ../include/./../objects/././Grid.h \
+  ../include/./../objects/./../include/cielo_types.h \
+  ../include/./../objects/./InternalCordx.h \
+  ../include/./../objects/././Cordx.h ../include/./../objects/./Matice.h \
+  ../include/./../objects/./Matpar.h ../include/./../objects/./Param.h \
+  ../include/./../objects/./SetEntry.h ../include/./../objects/./State.h \
+  ../include/./../objects/././Analysis.h \
+  ../include/./../objects/././Param.h \
+  ../include/./../objects/./SpcState.h \
+  ../include/./../objects/./SubcaseState.h \
+  ../include/./../objects/./LoadState.h ../include/./../objects/SetList.h \
+  ../include/./../objects/./DOFSets.h \
+  ../include/./../objects/./VirtualFunctions.h \
+  ../include/./../objects/././ElementObjects/ElemMatrix.h \
+  ../include/./../objects/././ElementObjects/ElemVector.h \
+  ../include/./../objects/./../io/io.h \
+  ../include/./../objects/./../io/../objects/ParameterInputs.h \
+  ../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h /usr/include/alloca.h \
+  /usr/include/assert.h \
+  ../include/./../objects/./ElementObjects/ElementObjects.h \
+  ../include/./../objects/./ElementObjects/./TriaElement.h \
+  ../include/./../objects/./ElementObjects/./../Tria.h \
+  ../include/./../objects/./ElementObjects/./../Friction.h \
+  ../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/././ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/./../objects/./ElementObjects/./././ElemVector.h \
+  ../include/./../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/./../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./../objects.h \
+  ../include/./../objects/./ElementObjects/./PentaElement.h \
+  ../include/./../objects/./ElementObjects/./../Penta.h \
+  ../include/./../objects/./ElementObjects/././TriaElement.h \
+  ../include/./../objects/./ElementObjects/./GaussPoints.h \
+  ../include/./../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/./../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/./../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/ElementUtils.h \
+  ../include/./../objects/./LoadObjects/LoadObjects.h \
+  ../include/./../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/./../objects/./LoadObjects/./../objects.h \
+  ../include/./../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/./../objects/./LoadObjects/./../Icefront.h \
+  ../include/./../objects/./LoadObjects/./PengridLoad.h \
+  ../include/./../objects/./LoadObjects/././PengridLoad.h \
+  ../include/./../objects/./LoadObjects/./../Pengrid.h \
+  ../include/./../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/./../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./Uset.h \
+  ../include/./../objects/./ParameterInputs.h \
+  ../include/./../objects/./Contour.h ../include/../DataSet/DataSet.h \
+  ../include/../EnumDefinitions/EnumDefinitions.h \
+  ../include/../objects/objects.h ../include/../shared/shared.h \
+  ../include/../shared/./AllocOps/alloc.h \
+  ../include/../shared/./AllocOps/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/MatlabLayer.h \
+  ../include/../shared/./MatlabLayer/../../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h \
+  ../include/../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../include/../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../include/../shared/./MatrixUtils/MatrixUtils.h \
+  ../include/../shared/./ElementUtils/ElementUtils.h \
+  ../include/../shared/./DofOps/DofOps.h \
+  ../include/../shared/./DofOps/../../include/cielo_types.h \
+  ../include/../shared/./DofOps/../../DataSet/DataSet.h \
+  ../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../include/../shared/./Numerics/UnsymmCrout.h \
+  ../include/../shared/./Numerics/cross.h \
+  ../include/../shared/./Numerics/norm.h \
+  ../include/../shared/./Numerics/extrema.h \
+  ../include/../shared/./SortAndSearch/SortAndSearch.h \
+  ../include/../shared/./Sparse/Sparse.h \
+  ../include/../shared/./Sparse/SparseUtils.h \
+  ../include/../shared/./Sparse/CsrSparseMatrix.h \
+  ../include/../shared/./Sparse/./SparseUtils.h \
+  ../include/../shared/./Marshalling/Marshalling.h \
+  ../include/../shared/./ErrorMacros.h \
+  ../include/../shared/./../include/cielo_externals.h \
+  ../include/../shared/./Time/Time.h \
+  ../include/../shared/./StdMemOut/StdMemOut.h \
+  ../include/../shared/./PrintfMacroExpand.h \
+  ../include/../shared/./Thread/thread.h ../include/../shared/Io/Io.h \
+  ../include/../shared/./SetErrMsg.h \
+  ../include/../shared/./Time/Profiler.h ../include/../shared/./Exp/Exp.h \
+  ../include/./matlab_includes.h ../include/../io/io.h \
+  ../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h
+
+../include/cielo.h:
+
+../include/../../../config.h:
+
+../include/./standard_includes.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/ctype.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../include/./cielo_types.h:
+
+../include/./cielo_macros.h:
+
+/usr/include/strings.h:
+
+../include/./cielo_externals.h:
+
+../include/./../DataSet/DataSet.h:
+
+../include/./../DataSet/./ContentsList.h:
+
+../include/./../objects/objects.h:
+
+../include/./../objects/./Analysis.h:
+
+../include/./../objects/./../DataSet/DataSet.h:
+
+../include/./../objects/././InputFormats.h:
+
+../include/./../objects/./MpcCase.h:
+
+../include/./../objects/./SpcCase.h:
+
+../include/./../objects/./Suport.h:
+
+../include/./../objects/./SubcaseCase.h:
+
+../include/./../objects/./IcCase.h:
+
+../include/./../objects/./LoadCase.h:
+
+../include/./../objects/./MethodCase.h:
+
+../include/./../objects/./ThloadCase.h:
+
+../include/./../objects/./ThspcCase.h:
+
+../include/./../objects/./TimeCase.h:
+
+../include/./../objects/./TstepCase.h:
+
+../include/./../objects/./Grid.h:
+
+../include/./../objects/./Grdset.h:
+
+../include/./../objects/./Cordx.h:
+
+../include/./../objects/./Tria.h:
+
+../include/./../objects/./Penta.h:
+
+../include/./../objects/./Fluxic.h:
+
+../include/./../objects/./Gradic.h:
+
+../include/./../objects/./Penpair.h:
+
+../include/./../objects/./Pengrid.h:
+
+../include/./../objects/./Penload.h:
+
+../include/./../objects/./Icefront.h:
+
+../include/./../objects/./Tstep.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Tstepnl.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Mpc.h:
+
+../include/./../objects/././GenericLinkedList.h:
+
+../include/./../objects/./Mpcadd.h:
+
+../include/./../objects/././SetList.h:
+
+../include/./../objects/././../DataSet/DataSet.h:
+
+../include/./../objects/./Spc.h:
+
+../include/./../objects/./Spc1.h:
+
+../include/./../objects/./SetList.h:
+
+../include/./../objects/./Spcadd.h:
+
+../include/./../objects/./Spcd.h:
+
+../include/./../objects/./Thspc.h:
+
+../include/./../objects/./Thspc1.h:
+
+../include/./../objects/./Thspcadd.h:
+
+../include/./../objects/./Thspcd.h:
+
+../include/./../objects/./InternalGrid.h:
+
+../include/./../objects/././Grid.h:
+
+../include/./../objects/./../include/cielo_types.h:
+
+../include/./../objects/./InternalCordx.h:
+
+../include/./../objects/././Cordx.h:
+
+../include/./../objects/./Matice.h:
+
+../include/./../objects/./Matpar.h:
+
+../include/./../objects/./Param.h:
+
+../include/./../objects/./SetEntry.h:
+
+../include/./../objects/./State.h:
+
+../include/./../objects/././Analysis.h:
+
+../include/./../objects/././Param.h:
+
+../include/./../objects/./SpcState.h:
+
+../include/./../objects/./SubcaseState.h:
+
+../include/./../objects/./LoadState.h:
+
+../include/./../objects/SetList.h:
+
+../include/./../objects/./DOFSets.h:
+
+../include/./../objects/./VirtualFunctions.h:
+
+../include/./../objects/././ElementObjects/ElemMatrix.h:
+
+../include/./../objects/././ElementObjects/ElemVector.h:
+
+../include/./../objects/./../io/io.h:
+
+../include/./../objects/./../io/../objects/ParameterInputs.h:
+
+../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/include/alloca.h:
+
+/usr/include/assert.h:
+
+../include/./../objects/./ElementObjects/ElementObjects.h:
+
+../include/./../objects/./ElementObjects/./TriaElement.h:
+
+../include/./../objects/./ElementObjects/./../Tria.h:
+
+../include/./../objects/./ElementObjects/./../Friction.h:
+
+../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/././ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/./../objects/./ElementObjects/./././ElemVector.h:
+
+../include/./../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/./../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./../objects.h:
+
+../include/./../objects/./ElementObjects/./PentaElement.h:
+
+../include/./../objects/./ElementObjects/./../Penta.h:
+
+../include/./../objects/./ElementObjects/././TriaElement.h:
+
+../include/./../objects/./ElementObjects/./GaussPoints.h:
+
+../include/./../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/./../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/./../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/ElementUtils.h:
+
+../include/./../objects/./LoadObjects/LoadObjects.h:
+
+../include/./../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/./../objects/./LoadObjects/./../objects.h:
+
+../include/./../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/./../objects/./LoadObjects/./../Icefront.h:
+
+../include/./../objects/./LoadObjects/./PengridLoad.h:
+
+../include/./../objects/./LoadObjects/././PengridLoad.h:
+
+../include/./../objects/./LoadObjects/./../Pengrid.h:
+
+../include/./../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/./../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./Uset.h:
+
+../include/./../objects/./ParameterInputs.h:
+
+../include/./../objects/./Contour.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../EnumDefinitions/EnumDefinitions.h:
+
+../include/../objects/objects.h:
+
+../include/../shared/shared.h:
+
+../include/../shared/./AllocOps/alloc.h:
+
+../include/../shared/./AllocOps/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/MatlabLayer.h:
+
+../include/../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../include/../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../include/../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../include/../shared/./MatrixUtils/MatrixUtils.h:
+
+../include/../shared/./ElementUtils/ElementUtils.h:
+
+../include/../shared/./DofOps/DofOps.h:
+
+../include/../shared/./DofOps/../../include/cielo_types.h:
+
+../include/../shared/./DofOps/../../DataSet/DataSet.h:
+
+../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../include/../shared/./Numerics/UnsymmCrout.h:
+
+../include/../shared/./Numerics/cross.h:
+
+../include/../shared/./Numerics/norm.h:
+
+../include/../shared/./Numerics/extrema.h:
+
+../include/../shared/./SortAndSearch/SortAndSearch.h:
+
+../include/../shared/./Sparse/Sparse.h:
+
+../include/../shared/./Sparse/SparseUtils.h:
+
+../include/../shared/./Sparse/CsrSparseMatrix.h:
+
+../include/../shared/./Sparse/./SparseUtils.h:
+
+../include/../shared/./Marshalling/Marshalling.h:
+
+../include/../shared/./ErrorMacros.h:
+
+../include/../shared/./../include/cielo_externals.h:
+
+../include/../shared/./Time/Time.h:
+
+../include/../shared/./StdMemOut/StdMemOut.h:
+
+../include/../shared/./PrintfMacroExpand.h:
+
+../include/../shared/./Thread/thread.h:
+
+../include/../shared/Io/Io.h:
+
+../include/../shared/./SetErrMsg.h:
+
+../include/../shared/./Time/Profiler.h:
+
+../include/../shared/./Exp/Exp.h:
+
+../include/./matlab_includes.h:
+
+../include/../io/io.h:
+
+../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
Index: /issm/trunk/src/c/io/.deps/ParallelFetchMat.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/ParallelFetchMat.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/ParallelFetchMat.Po	(revision 1)
@@ -0,0 +1,665 @@
+ParallelFetchMat.o ParallelFetchMat.o: ParallelFetchMat.c \
+  ../include/cielo.h ../include/../../../config.h \
+  ../include/./standard_includes.h /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/ctype.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/time.h /usr/include/bits/time.h \
+  /usr/include/signal.h /usr/include/bits/sigset.h \
+  /usr/include/bits/signum.h /usr/include/time.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/bits/sigthread.h \
+  /usr/include/sys/sem.h /usr/include/sys/ipc.h \
+  /usr/include/bits/ipctypes.h /usr/include/bits/ipc.h \
+  /usr/include/bits/sem.h /usr/include/sys/types.h \
+  /usr/include/sys/select.h /usr/include/bits/select.h \
+  /usr/include/sys/sysmacros.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/stdlib.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/math.h /usr/include/bits/huge_val.h \
+  /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
+  /usr/include/bits/mathinline.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../include/./cielo_types.h ../include/./cielo_macros.h \
+  /usr/include/strings.h ../include/./cielo_externals.h \
+  ../include/./../DataSet/DataSet.h \
+  ../include/./../DataSet/./ContentsList.h \
+  ../include/./../objects/objects.h ../include/./../objects/./Analysis.h \
+  ../include/./../objects/./../DataSet/DataSet.h \
+  ../include/./../objects/././InputFormats.h \
+  ../include/./../objects/./MpcCase.h ../include/./../objects/./SpcCase.h \
+  ../include/./../objects/./Suport.h \
+  ../include/./../objects/./SubcaseCase.h \
+  ../include/./../objects/./IcCase.h ../include/./../objects/./LoadCase.h \
+  ../include/./../objects/./MethodCase.h \
+  ../include/./../objects/./ThloadCase.h \
+  ../include/./../objects/./ThspcCase.h \
+  ../include/./../objects/./TimeCase.h \
+  ../include/./../objects/./TstepCase.h ../include/./../objects/./Grid.h \
+  ../include/./../objects/./Grdset.h ../include/./../objects/./Cordx.h \
+  ../include/./../objects/./Tria.h ../include/./../objects/./Penta.h \
+  ../include/./../objects/./Fluxic.h ../include/./../objects/./Gradic.h \
+  ../include/./../objects/./Penpair.h ../include/./../objects/./Pengrid.h \
+  ../include/./../objects/./Penload.h \
+  ../include/./../objects/./Icefront.h ../include/./../objects/./Tstep.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Tstepnl.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Mpc.h \
+  ../include/./../objects/././GenericLinkedList.h \
+  ../include/./../objects/./Mpcadd.h \
+  ../include/./../objects/././SetList.h \
+  ../include/./../objects/././../DataSet/DataSet.h \
+  ../include/./../objects/./Spc.h ../include/./../objects/./Spc1.h \
+  ../include/./../objects/./SetList.h ../include/./../objects/./Spcadd.h \
+  ../include/./../objects/./Spcd.h ../include/./../objects/./Thspc.h \
+  ../include/./../objects/./Thspc1.h ../include/./../objects/./Thspcadd.h \
+  ../include/./../objects/./Thspcd.h \
+  ../include/./../objects/./InternalGrid.h \
+  ../include/./../objects/././Grid.h \
+  ../include/./../objects/./../include/cielo_types.h \
+  ../include/./../objects/./InternalCordx.h \
+  ../include/./../objects/././Cordx.h ../include/./../objects/./Matice.h \
+  ../include/./../objects/./Matpar.h ../include/./../objects/./Param.h \
+  ../include/./../objects/./SetEntry.h ../include/./../objects/./State.h \
+  ../include/./../objects/././Analysis.h \
+  ../include/./../objects/././Param.h \
+  ../include/./../objects/./SpcState.h \
+  ../include/./../objects/./SubcaseState.h \
+  ../include/./../objects/./LoadState.h ../include/./../objects/SetList.h \
+  ../include/./../objects/./DOFSets.h \
+  ../include/./../objects/./VirtualFunctions.h \
+  ../include/./../objects/././ElementObjects/ElemMatrix.h \
+  ../include/./../objects/././ElementObjects/ElemVector.h \
+  ../include/./../objects/./../io/io.h \
+  ../include/./../objects/./../io/../objects/ParameterInputs.h \
+  ../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h /usr/include/alloca.h \
+  /usr/include/assert.h \
+  ../include/./../objects/./ElementObjects/ElementObjects.h \
+  ../include/./../objects/./ElementObjects/./TriaElement.h \
+  ../include/./../objects/./ElementObjects/./../Tria.h \
+  ../include/./../objects/./ElementObjects/./../Friction.h \
+  ../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/././ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/./../objects/./ElementObjects/./././ElemVector.h \
+  ../include/./../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/./../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./../objects.h \
+  ../include/./../objects/./ElementObjects/./PentaElement.h \
+  ../include/./../objects/./ElementObjects/./../Penta.h \
+  ../include/./../objects/./ElementObjects/././TriaElement.h \
+  ../include/./../objects/./ElementObjects/./GaussPoints.h \
+  ../include/./../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/./../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/./../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/ElementUtils.h \
+  ../include/./../objects/./LoadObjects/LoadObjects.h \
+  ../include/./../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/./../objects/./LoadObjects/./../objects.h \
+  ../include/./../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/./../objects/./LoadObjects/./../Icefront.h \
+  ../include/./../objects/./LoadObjects/./PengridLoad.h \
+  ../include/./../objects/./LoadObjects/././PengridLoad.h \
+  ../include/./../objects/./LoadObjects/./../Pengrid.h \
+  ../include/./../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/./../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./Uset.h \
+  ../include/./../objects/./ParameterInputs.h \
+  ../include/./../objects/./Contour.h ../include/../DataSet/DataSet.h \
+  ../include/../EnumDefinitions/EnumDefinitions.h \
+  ../include/../objects/objects.h ../include/../shared/shared.h \
+  ../include/../shared/./AllocOps/alloc.h \
+  ../include/../shared/./AllocOps/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/MatlabLayer.h \
+  ../include/../shared/./MatlabLayer/../../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h \
+  ../include/../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../include/../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../include/../shared/./MatrixUtils/MatrixUtils.h \
+  ../include/../shared/./ElementUtils/ElementUtils.h \
+  ../include/../shared/./DofOps/DofOps.h \
+  ../include/../shared/./DofOps/../../include/cielo_types.h \
+  ../include/../shared/./DofOps/../../DataSet/DataSet.h \
+  ../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../include/../shared/./Numerics/UnsymmCrout.h \
+  ../include/../shared/./Numerics/cross.h \
+  ../include/../shared/./Numerics/norm.h \
+  ../include/../shared/./Numerics/extrema.h \
+  ../include/../shared/./SortAndSearch/SortAndSearch.h \
+  ../include/../shared/./Sparse/Sparse.h \
+  ../include/../shared/./Sparse/SparseUtils.h \
+  ../include/../shared/./Sparse/CsrSparseMatrix.h \
+  ../include/../shared/./Sparse/./SparseUtils.h \
+  ../include/../shared/./Marshalling/Marshalling.h \
+  ../include/../shared/./ErrorMacros.h \
+  ../include/../shared/./../include/cielo_externals.h \
+  ../include/../shared/./Time/Time.h \
+  ../include/../shared/./StdMemOut/StdMemOut.h \
+  ../include/../shared/./PrintfMacroExpand.h \
+  ../include/../shared/./Thread/thread.h ../include/../shared/Io/Io.h \
+  ../include/../shared/./SetErrMsg.h \
+  ../include/../shared/./Time/Profiler.h ../include/../shared/./Exp/Exp.h \
+  ../include/./matlab_includes.h ../include/../io/io.h \
+  ../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h
+
+../include/cielo.h:
+
+../include/../../../config.h:
+
+../include/./standard_includes.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/ctype.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../include/./cielo_types.h:
+
+../include/./cielo_macros.h:
+
+/usr/include/strings.h:
+
+../include/./cielo_externals.h:
+
+../include/./../DataSet/DataSet.h:
+
+../include/./../DataSet/./ContentsList.h:
+
+../include/./../objects/objects.h:
+
+../include/./../objects/./Analysis.h:
+
+../include/./../objects/./../DataSet/DataSet.h:
+
+../include/./../objects/././InputFormats.h:
+
+../include/./../objects/./MpcCase.h:
+
+../include/./../objects/./SpcCase.h:
+
+../include/./../objects/./Suport.h:
+
+../include/./../objects/./SubcaseCase.h:
+
+../include/./../objects/./IcCase.h:
+
+../include/./../objects/./LoadCase.h:
+
+../include/./../objects/./MethodCase.h:
+
+../include/./../objects/./ThloadCase.h:
+
+../include/./../objects/./ThspcCase.h:
+
+../include/./../objects/./TimeCase.h:
+
+../include/./../objects/./TstepCase.h:
+
+../include/./../objects/./Grid.h:
+
+../include/./../objects/./Grdset.h:
+
+../include/./../objects/./Cordx.h:
+
+../include/./../objects/./Tria.h:
+
+../include/./../objects/./Penta.h:
+
+../include/./../objects/./Fluxic.h:
+
+../include/./../objects/./Gradic.h:
+
+../include/./../objects/./Penpair.h:
+
+../include/./../objects/./Pengrid.h:
+
+../include/./../objects/./Penload.h:
+
+../include/./../objects/./Icefront.h:
+
+../include/./../objects/./Tstep.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Tstepnl.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Mpc.h:
+
+../include/./../objects/././GenericLinkedList.h:
+
+../include/./../objects/./Mpcadd.h:
+
+../include/./../objects/././SetList.h:
+
+../include/./../objects/././../DataSet/DataSet.h:
+
+../include/./../objects/./Spc.h:
+
+../include/./../objects/./Spc1.h:
+
+../include/./../objects/./SetList.h:
+
+../include/./../objects/./Spcadd.h:
+
+../include/./../objects/./Spcd.h:
+
+../include/./../objects/./Thspc.h:
+
+../include/./../objects/./Thspc1.h:
+
+../include/./../objects/./Thspcadd.h:
+
+../include/./../objects/./Thspcd.h:
+
+../include/./../objects/./InternalGrid.h:
+
+../include/./../objects/././Grid.h:
+
+../include/./../objects/./../include/cielo_types.h:
+
+../include/./../objects/./InternalCordx.h:
+
+../include/./../objects/././Cordx.h:
+
+../include/./../objects/./Matice.h:
+
+../include/./../objects/./Matpar.h:
+
+../include/./../objects/./Param.h:
+
+../include/./../objects/./SetEntry.h:
+
+../include/./../objects/./State.h:
+
+../include/./../objects/././Analysis.h:
+
+../include/./../objects/././Param.h:
+
+../include/./../objects/./SpcState.h:
+
+../include/./../objects/./SubcaseState.h:
+
+../include/./../objects/./LoadState.h:
+
+../include/./../objects/SetList.h:
+
+../include/./../objects/./DOFSets.h:
+
+../include/./../objects/./VirtualFunctions.h:
+
+../include/./../objects/././ElementObjects/ElemMatrix.h:
+
+../include/./../objects/././ElementObjects/ElemVector.h:
+
+../include/./../objects/./../io/io.h:
+
+../include/./../objects/./../io/../objects/ParameterInputs.h:
+
+../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/include/alloca.h:
+
+/usr/include/assert.h:
+
+../include/./../objects/./ElementObjects/ElementObjects.h:
+
+../include/./../objects/./ElementObjects/./TriaElement.h:
+
+../include/./../objects/./ElementObjects/./../Tria.h:
+
+../include/./../objects/./ElementObjects/./../Friction.h:
+
+../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/././ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/./../objects/./ElementObjects/./././ElemVector.h:
+
+../include/./../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/./../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./../objects.h:
+
+../include/./../objects/./ElementObjects/./PentaElement.h:
+
+../include/./../objects/./ElementObjects/./../Penta.h:
+
+../include/./../objects/./ElementObjects/././TriaElement.h:
+
+../include/./../objects/./ElementObjects/./GaussPoints.h:
+
+../include/./../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/./../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/./../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/ElementUtils.h:
+
+../include/./../objects/./LoadObjects/LoadObjects.h:
+
+../include/./../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/./../objects/./LoadObjects/./../objects.h:
+
+../include/./../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/./../objects/./LoadObjects/./../Icefront.h:
+
+../include/./../objects/./LoadObjects/./PengridLoad.h:
+
+../include/./../objects/./LoadObjects/././PengridLoad.h:
+
+../include/./../objects/./LoadObjects/./../Pengrid.h:
+
+../include/./../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/./../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./Uset.h:
+
+../include/./../objects/./ParameterInputs.h:
+
+../include/./../objects/./Contour.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../EnumDefinitions/EnumDefinitions.h:
+
+../include/../objects/objects.h:
+
+../include/../shared/shared.h:
+
+../include/../shared/./AllocOps/alloc.h:
+
+../include/../shared/./AllocOps/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/MatlabLayer.h:
+
+../include/../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../include/../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../include/../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../include/../shared/./MatrixUtils/MatrixUtils.h:
+
+../include/../shared/./ElementUtils/ElementUtils.h:
+
+../include/../shared/./DofOps/DofOps.h:
+
+../include/../shared/./DofOps/../../include/cielo_types.h:
+
+../include/../shared/./DofOps/../../DataSet/DataSet.h:
+
+../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../include/../shared/./Numerics/UnsymmCrout.h:
+
+../include/../shared/./Numerics/cross.h:
+
+../include/../shared/./Numerics/norm.h:
+
+../include/../shared/./Numerics/extrema.h:
+
+../include/../shared/./SortAndSearch/SortAndSearch.h:
+
+../include/../shared/./Sparse/Sparse.h:
+
+../include/../shared/./Sparse/SparseUtils.h:
+
+../include/../shared/./Sparse/CsrSparseMatrix.h:
+
+../include/../shared/./Sparse/./SparseUtils.h:
+
+../include/../shared/./Marshalling/Marshalling.h:
+
+../include/../shared/./ErrorMacros.h:
+
+../include/../shared/./../include/cielo_externals.h:
+
+../include/../shared/./Time/Time.h:
+
+../include/../shared/./StdMemOut/StdMemOut.h:
+
+../include/../shared/./PrintfMacroExpand.h:
+
+../include/../shared/./Thread/thread.h:
+
+../include/../shared/Io/Io.h:
+
+../include/../shared/./SetErrMsg.h:
+
+../include/../shared/./Time/Profiler.h:
+
+../include/../shared/./Exp/Exp.h:
+
+../include/./matlab_includes.h:
+
+../include/../io/io.h:
+
+../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
Index: /issm/trunk/src/c/io/.deps/ParallelFetchScalar.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/ParallelFetchScalar.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/ParallelFetchScalar.Po	(revision 1)
@@ -0,0 +1,665 @@
+ParallelFetchScalar.o ParallelFetchScalar.o: ParallelFetchScalar.c \
+  ../include/cielo.h ../include/../../../config.h \
+  ../include/./standard_includes.h /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/ctype.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/time.h /usr/include/bits/time.h \
+  /usr/include/signal.h /usr/include/bits/sigset.h \
+  /usr/include/bits/signum.h /usr/include/time.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/bits/sigthread.h \
+  /usr/include/sys/sem.h /usr/include/sys/ipc.h \
+  /usr/include/bits/ipctypes.h /usr/include/bits/ipc.h \
+  /usr/include/bits/sem.h /usr/include/sys/types.h \
+  /usr/include/sys/select.h /usr/include/bits/select.h \
+  /usr/include/sys/sysmacros.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/stdlib.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/math.h /usr/include/bits/huge_val.h \
+  /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
+  /usr/include/bits/mathinline.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../include/./cielo_types.h ../include/./cielo_macros.h \
+  /usr/include/strings.h ../include/./cielo_externals.h \
+  ../include/./../DataSet/DataSet.h \
+  ../include/./../DataSet/./ContentsList.h \
+  ../include/./../objects/objects.h ../include/./../objects/./Analysis.h \
+  ../include/./../objects/./../DataSet/DataSet.h \
+  ../include/./../objects/././InputFormats.h \
+  ../include/./../objects/./MpcCase.h ../include/./../objects/./SpcCase.h \
+  ../include/./../objects/./Suport.h \
+  ../include/./../objects/./SubcaseCase.h \
+  ../include/./../objects/./IcCase.h ../include/./../objects/./LoadCase.h \
+  ../include/./../objects/./MethodCase.h \
+  ../include/./../objects/./ThloadCase.h \
+  ../include/./../objects/./ThspcCase.h \
+  ../include/./../objects/./TimeCase.h \
+  ../include/./../objects/./TstepCase.h ../include/./../objects/./Grid.h \
+  ../include/./../objects/./Grdset.h ../include/./../objects/./Cordx.h \
+  ../include/./../objects/./Tria.h ../include/./../objects/./Penta.h \
+  ../include/./../objects/./Fluxic.h ../include/./../objects/./Gradic.h \
+  ../include/./../objects/./Penpair.h ../include/./../objects/./Pengrid.h \
+  ../include/./../objects/./Penload.h \
+  ../include/./../objects/./Icefront.h ../include/./../objects/./Tstep.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Tstepnl.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Mpc.h \
+  ../include/./../objects/././GenericLinkedList.h \
+  ../include/./../objects/./Mpcadd.h \
+  ../include/./../objects/././SetList.h \
+  ../include/./../objects/././../DataSet/DataSet.h \
+  ../include/./../objects/./Spc.h ../include/./../objects/./Spc1.h \
+  ../include/./../objects/./SetList.h ../include/./../objects/./Spcadd.h \
+  ../include/./../objects/./Spcd.h ../include/./../objects/./Thspc.h \
+  ../include/./../objects/./Thspc1.h ../include/./../objects/./Thspcadd.h \
+  ../include/./../objects/./Thspcd.h \
+  ../include/./../objects/./InternalGrid.h \
+  ../include/./../objects/././Grid.h \
+  ../include/./../objects/./../include/cielo_types.h \
+  ../include/./../objects/./InternalCordx.h \
+  ../include/./../objects/././Cordx.h ../include/./../objects/./Matice.h \
+  ../include/./../objects/./Matpar.h ../include/./../objects/./Param.h \
+  ../include/./../objects/./SetEntry.h ../include/./../objects/./State.h \
+  ../include/./../objects/././Analysis.h \
+  ../include/./../objects/././Param.h \
+  ../include/./../objects/./SpcState.h \
+  ../include/./../objects/./SubcaseState.h \
+  ../include/./../objects/./LoadState.h ../include/./../objects/SetList.h \
+  ../include/./../objects/./DOFSets.h \
+  ../include/./../objects/./VirtualFunctions.h \
+  ../include/./../objects/././ElementObjects/ElemMatrix.h \
+  ../include/./../objects/././ElementObjects/ElemVector.h \
+  ../include/./../objects/./../io/io.h \
+  ../include/./../objects/./../io/../objects/ParameterInputs.h \
+  ../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h /usr/include/alloca.h \
+  /usr/include/assert.h \
+  ../include/./../objects/./ElementObjects/ElementObjects.h \
+  ../include/./../objects/./ElementObjects/./TriaElement.h \
+  ../include/./../objects/./ElementObjects/./../Tria.h \
+  ../include/./../objects/./ElementObjects/./../Friction.h \
+  ../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/././ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/./../objects/./ElementObjects/./././ElemVector.h \
+  ../include/./../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/./../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./../objects.h \
+  ../include/./../objects/./ElementObjects/./PentaElement.h \
+  ../include/./../objects/./ElementObjects/./../Penta.h \
+  ../include/./../objects/./ElementObjects/././TriaElement.h \
+  ../include/./../objects/./ElementObjects/./GaussPoints.h \
+  ../include/./../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/./../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/./../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/ElementUtils.h \
+  ../include/./../objects/./LoadObjects/LoadObjects.h \
+  ../include/./../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/./../objects/./LoadObjects/./../objects.h \
+  ../include/./../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/./../objects/./LoadObjects/./../Icefront.h \
+  ../include/./../objects/./LoadObjects/./PengridLoad.h \
+  ../include/./../objects/./LoadObjects/././PengridLoad.h \
+  ../include/./../objects/./LoadObjects/./../Pengrid.h \
+  ../include/./../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/./../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./Uset.h \
+  ../include/./../objects/./ParameterInputs.h \
+  ../include/./../objects/./Contour.h ../include/../DataSet/DataSet.h \
+  ../include/../EnumDefinitions/EnumDefinitions.h \
+  ../include/../objects/objects.h ../include/../shared/shared.h \
+  ../include/../shared/./AllocOps/alloc.h \
+  ../include/../shared/./AllocOps/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/MatlabLayer.h \
+  ../include/../shared/./MatlabLayer/../../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h \
+  ../include/../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../include/../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../include/../shared/./MatrixUtils/MatrixUtils.h \
+  ../include/../shared/./ElementUtils/ElementUtils.h \
+  ../include/../shared/./DofOps/DofOps.h \
+  ../include/../shared/./DofOps/../../include/cielo_types.h \
+  ../include/../shared/./DofOps/../../DataSet/DataSet.h \
+  ../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../include/../shared/./Numerics/UnsymmCrout.h \
+  ../include/../shared/./Numerics/cross.h \
+  ../include/../shared/./Numerics/norm.h \
+  ../include/../shared/./Numerics/extrema.h \
+  ../include/../shared/./SortAndSearch/SortAndSearch.h \
+  ../include/../shared/./Sparse/Sparse.h \
+  ../include/../shared/./Sparse/SparseUtils.h \
+  ../include/../shared/./Sparse/CsrSparseMatrix.h \
+  ../include/../shared/./Sparse/./SparseUtils.h \
+  ../include/../shared/./Marshalling/Marshalling.h \
+  ../include/../shared/./ErrorMacros.h \
+  ../include/../shared/./../include/cielo_externals.h \
+  ../include/../shared/./Time/Time.h \
+  ../include/../shared/./StdMemOut/StdMemOut.h \
+  ../include/../shared/./PrintfMacroExpand.h \
+  ../include/../shared/./Thread/thread.h ../include/../shared/Io/Io.h \
+  ../include/../shared/./SetErrMsg.h \
+  ../include/../shared/./Time/Profiler.h ../include/../shared/./Exp/Exp.h \
+  ../include/./matlab_includes.h ../include/../io/io.h \
+  ../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h
+
+../include/cielo.h:
+
+../include/../../../config.h:
+
+../include/./standard_includes.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/ctype.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../include/./cielo_types.h:
+
+../include/./cielo_macros.h:
+
+/usr/include/strings.h:
+
+../include/./cielo_externals.h:
+
+../include/./../DataSet/DataSet.h:
+
+../include/./../DataSet/./ContentsList.h:
+
+../include/./../objects/objects.h:
+
+../include/./../objects/./Analysis.h:
+
+../include/./../objects/./../DataSet/DataSet.h:
+
+../include/./../objects/././InputFormats.h:
+
+../include/./../objects/./MpcCase.h:
+
+../include/./../objects/./SpcCase.h:
+
+../include/./../objects/./Suport.h:
+
+../include/./../objects/./SubcaseCase.h:
+
+../include/./../objects/./IcCase.h:
+
+../include/./../objects/./LoadCase.h:
+
+../include/./../objects/./MethodCase.h:
+
+../include/./../objects/./ThloadCase.h:
+
+../include/./../objects/./ThspcCase.h:
+
+../include/./../objects/./TimeCase.h:
+
+../include/./../objects/./TstepCase.h:
+
+../include/./../objects/./Grid.h:
+
+../include/./../objects/./Grdset.h:
+
+../include/./../objects/./Cordx.h:
+
+../include/./../objects/./Tria.h:
+
+../include/./../objects/./Penta.h:
+
+../include/./../objects/./Fluxic.h:
+
+../include/./../objects/./Gradic.h:
+
+../include/./../objects/./Penpair.h:
+
+../include/./../objects/./Pengrid.h:
+
+../include/./../objects/./Penload.h:
+
+../include/./../objects/./Icefront.h:
+
+../include/./../objects/./Tstep.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Tstepnl.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Mpc.h:
+
+../include/./../objects/././GenericLinkedList.h:
+
+../include/./../objects/./Mpcadd.h:
+
+../include/./../objects/././SetList.h:
+
+../include/./../objects/././../DataSet/DataSet.h:
+
+../include/./../objects/./Spc.h:
+
+../include/./../objects/./Spc1.h:
+
+../include/./../objects/./SetList.h:
+
+../include/./../objects/./Spcadd.h:
+
+../include/./../objects/./Spcd.h:
+
+../include/./../objects/./Thspc.h:
+
+../include/./../objects/./Thspc1.h:
+
+../include/./../objects/./Thspcadd.h:
+
+../include/./../objects/./Thspcd.h:
+
+../include/./../objects/./InternalGrid.h:
+
+../include/./../objects/././Grid.h:
+
+../include/./../objects/./../include/cielo_types.h:
+
+../include/./../objects/./InternalCordx.h:
+
+../include/./../objects/././Cordx.h:
+
+../include/./../objects/./Matice.h:
+
+../include/./../objects/./Matpar.h:
+
+../include/./../objects/./Param.h:
+
+../include/./../objects/./SetEntry.h:
+
+../include/./../objects/./State.h:
+
+../include/./../objects/././Analysis.h:
+
+../include/./../objects/././Param.h:
+
+../include/./../objects/./SpcState.h:
+
+../include/./../objects/./SubcaseState.h:
+
+../include/./../objects/./LoadState.h:
+
+../include/./../objects/SetList.h:
+
+../include/./../objects/./DOFSets.h:
+
+../include/./../objects/./VirtualFunctions.h:
+
+../include/./../objects/././ElementObjects/ElemMatrix.h:
+
+../include/./../objects/././ElementObjects/ElemVector.h:
+
+../include/./../objects/./../io/io.h:
+
+../include/./../objects/./../io/../objects/ParameterInputs.h:
+
+../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/include/alloca.h:
+
+/usr/include/assert.h:
+
+../include/./../objects/./ElementObjects/ElementObjects.h:
+
+../include/./../objects/./ElementObjects/./TriaElement.h:
+
+../include/./../objects/./ElementObjects/./../Tria.h:
+
+../include/./../objects/./ElementObjects/./../Friction.h:
+
+../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/././ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/./../objects/./ElementObjects/./././ElemVector.h:
+
+../include/./../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/./../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./../objects.h:
+
+../include/./../objects/./ElementObjects/./PentaElement.h:
+
+../include/./../objects/./ElementObjects/./../Penta.h:
+
+../include/./../objects/./ElementObjects/././TriaElement.h:
+
+../include/./../objects/./ElementObjects/./GaussPoints.h:
+
+../include/./../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/./../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/./../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/ElementUtils.h:
+
+../include/./../objects/./LoadObjects/LoadObjects.h:
+
+../include/./../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/./../objects/./LoadObjects/./../objects.h:
+
+../include/./../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/./../objects/./LoadObjects/./../Icefront.h:
+
+../include/./../objects/./LoadObjects/./PengridLoad.h:
+
+../include/./../objects/./LoadObjects/././PengridLoad.h:
+
+../include/./../objects/./LoadObjects/./../Pengrid.h:
+
+../include/./../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/./../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./Uset.h:
+
+../include/./../objects/./ParameterInputs.h:
+
+../include/./../objects/./Contour.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../EnumDefinitions/EnumDefinitions.h:
+
+../include/../objects/objects.h:
+
+../include/../shared/shared.h:
+
+../include/../shared/./AllocOps/alloc.h:
+
+../include/../shared/./AllocOps/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/MatlabLayer.h:
+
+../include/../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../include/../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../include/../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../include/../shared/./MatrixUtils/MatrixUtils.h:
+
+../include/../shared/./ElementUtils/ElementUtils.h:
+
+../include/../shared/./DofOps/DofOps.h:
+
+../include/../shared/./DofOps/../../include/cielo_types.h:
+
+../include/../shared/./DofOps/../../DataSet/DataSet.h:
+
+../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../include/../shared/./Numerics/UnsymmCrout.h:
+
+../include/../shared/./Numerics/cross.h:
+
+../include/../shared/./Numerics/norm.h:
+
+../include/../shared/./Numerics/extrema.h:
+
+../include/../shared/./SortAndSearch/SortAndSearch.h:
+
+../include/../shared/./Sparse/Sparse.h:
+
+../include/../shared/./Sparse/SparseUtils.h:
+
+../include/../shared/./Sparse/CsrSparseMatrix.h:
+
+../include/../shared/./Sparse/./SparseUtils.h:
+
+../include/../shared/./Marshalling/Marshalling.h:
+
+../include/../shared/./ErrorMacros.h:
+
+../include/../shared/./../include/cielo_externals.h:
+
+../include/../shared/./Time/Time.h:
+
+../include/../shared/./StdMemOut/StdMemOut.h:
+
+../include/../shared/./PrintfMacroExpand.h:
+
+../include/../shared/./Thread/thread.h:
+
+../include/../shared/Io/Io.h:
+
+../include/../shared/./SetErrMsg.h:
+
+../include/../shared/./Time/Profiler.h:
+
+../include/../shared/./Exp/Exp.h:
+
+../include/./matlab_includes.h:
+
+../include/../io/io.h:
+
+../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
Index: /issm/trunk/src/c/io/.deps/ParallelFetchString.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/ParallelFetchString.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/ParallelFetchString.Po	(revision 1)
@@ -0,0 +1,665 @@
+ParallelFetchString.o ParallelFetchString.o: ParallelFetchString.c \
+  ../include/cielo.h ../include/../../../config.h \
+  ../include/./standard_includes.h /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/ctype.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/time.h /usr/include/bits/time.h \
+  /usr/include/signal.h /usr/include/bits/sigset.h \
+  /usr/include/bits/signum.h /usr/include/time.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/bits/sigthread.h \
+  /usr/include/sys/sem.h /usr/include/sys/ipc.h \
+  /usr/include/bits/ipctypes.h /usr/include/bits/ipc.h \
+  /usr/include/bits/sem.h /usr/include/sys/types.h \
+  /usr/include/sys/select.h /usr/include/bits/select.h \
+  /usr/include/sys/sysmacros.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/stdlib.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/math.h /usr/include/bits/huge_val.h \
+  /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
+  /usr/include/bits/mathinline.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../include/./cielo_types.h ../include/./cielo_macros.h \
+  /usr/include/strings.h ../include/./cielo_externals.h \
+  ../include/./../DataSet/DataSet.h \
+  ../include/./../DataSet/./ContentsList.h \
+  ../include/./../objects/objects.h ../include/./../objects/./Analysis.h \
+  ../include/./../objects/./../DataSet/DataSet.h \
+  ../include/./../objects/././InputFormats.h \
+  ../include/./../objects/./MpcCase.h ../include/./../objects/./SpcCase.h \
+  ../include/./../objects/./Suport.h \
+  ../include/./../objects/./SubcaseCase.h \
+  ../include/./../objects/./IcCase.h ../include/./../objects/./LoadCase.h \
+  ../include/./../objects/./MethodCase.h \
+  ../include/./../objects/./ThloadCase.h \
+  ../include/./../objects/./ThspcCase.h \
+  ../include/./../objects/./TimeCase.h \
+  ../include/./../objects/./TstepCase.h ../include/./../objects/./Grid.h \
+  ../include/./../objects/./Grdset.h ../include/./../objects/./Cordx.h \
+  ../include/./../objects/./Tria.h ../include/./../objects/./Penta.h \
+  ../include/./../objects/./Fluxic.h ../include/./../objects/./Gradic.h \
+  ../include/./../objects/./Penpair.h ../include/./../objects/./Pengrid.h \
+  ../include/./../objects/./Penload.h \
+  ../include/./../objects/./Icefront.h ../include/./../objects/./Tstep.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Tstepnl.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Mpc.h \
+  ../include/./../objects/././GenericLinkedList.h \
+  ../include/./../objects/./Mpcadd.h \
+  ../include/./../objects/././SetList.h \
+  ../include/./../objects/././../DataSet/DataSet.h \
+  ../include/./../objects/./Spc.h ../include/./../objects/./Spc1.h \
+  ../include/./../objects/./SetList.h ../include/./../objects/./Spcadd.h \
+  ../include/./../objects/./Spcd.h ../include/./../objects/./Thspc.h \
+  ../include/./../objects/./Thspc1.h ../include/./../objects/./Thspcadd.h \
+  ../include/./../objects/./Thspcd.h \
+  ../include/./../objects/./InternalGrid.h \
+  ../include/./../objects/././Grid.h \
+  ../include/./../objects/./../include/cielo_types.h \
+  ../include/./../objects/./InternalCordx.h \
+  ../include/./../objects/././Cordx.h ../include/./../objects/./Matice.h \
+  ../include/./../objects/./Matpar.h ../include/./../objects/./Param.h \
+  ../include/./../objects/./SetEntry.h ../include/./../objects/./State.h \
+  ../include/./../objects/././Analysis.h \
+  ../include/./../objects/././Param.h \
+  ../include/./../objects/./SpcState.h \
+  ../include/./../objects/./SubcaseState.h \
+  ../include/./../objects/./LoadState.h ../include/./../objects/SetList.h \
+  ../include/./../objects/./DOFSets.h \
+  ../include/./../objects/./VirtualFunctions.h \
+  ../include/./../objects/././ElementObjects/ElemMatrix.h \
+  ../include/./../objects/././ElementObjects/ElemVector.h \
+  ../include/./../objects/./../io/io.h \
+  ../include/./../objects/./../io/../objects/ParameterInputs.h \
+  ../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h /usr/include/alloca.h \
+  /usr/include/assert.h \
+  ../include/./../objects/./ElementObjects/ElementObjects.h \
+  ../include/./../objects/./ElementObjects/./TriaElement.h \
+  ../include/./../objects/./ElementObjects/./../Tria.h \
+  ../include/./../objects/./ElementObjects/./../Friction.h \
+  ../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/././ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/./../objects/./ElementObjects/./././ElemVector.h \
+  ../include/./../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/./../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./../objects.h \
+  ../include/./../objects/./ElementObjects/./PentaElement.h \
+  ../include/./../objects/./ElementObjects/./../Penta.h \
+  ../include/./../objects/./ElementObjects/././TriaElement.h \
+  ../include/./../objects/./ElementObjects/./GaussPoints.h \
+  ../include/./../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/./../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/./../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/ElementUtils.h \
+  ../include/./../objects/./LoadObjects/LoadObjects.h \
+  ../include/./../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/./../objects/./LoadObjects/./../objects.h \
+  ../include/./../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/./../objects/./LoadObjects/./../Icefront.h \
+  ../include/./../objects/./LoadObjects/./PengridLoad.h \
+  ../include/./../objects/./LoadObjects/././PengridLoad.h \
+  ../include/./../objects/./LoadObjects/./../Pengrid.h \
+  ../include/./../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/./../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./Uset.h \
+  ../include/./../objects/./ParameterInputs.h \
+  ../include/./../objects/./Contour.h ../include/../DataSet/DataSet.h \
+  ../include/../EnumDefinitions/EnumDefinitions.h \
+  ../include/../objects/objects.h ../include/../shared/shared.h \
+  ../include/../shared/./AllocOps/alloc.h \
+  ../include/../shared/./AllocOps/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/MatlabLayer.h \
+  ../include/../shared/./MatlabLayer/../../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h \
+  ../include/../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../include/../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../include/../shared/./MatrixUtils/MatrixUtils.h \
+  ../include/../shared/./ElementUtils/ElementUtils.h \
+  ../include/../shared/./DofOps/DofOps.h \
+  ../include/../shared/./DofOps/../../include/cielo_types.h \
+  ../include/../shared/./DofOps/../../DataSet/DataSet.h \
+  ../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../include/../shared/./Numerics/UnsymmCrout.h \
+  ../include/../shared/./Numerics/cross.h \
+  ../include/../shared/./Numerics/norm.h \
+  ../include/../shared/./Numerics/extrema.h \
+  ../include/../shared/./SortAndSearch/SortAndSearch.h \
+  ../include/../shared/./Sparse/Sparse.h \
+  ../include/../shared/./Sparse/SparseUtils.h \
+  ../include/../shared/./Sparse/CsrSparseMatrix.h \
+  ../include/../shared/./Sparse/./SparseUtils.h \
+  ../include/../shared/./Marshalling/Marshalling.h \
+  ../include/../shared/./ErrorMacros.h \
+  ../include/../shared/./../include/cielo_externals.h \
+  ../include/../shared/./Time/Time.h \
+  ../include/../shared/./StdMemOut/StdMemOut.h \
+  ../include/../shared/./PrintfMacroExpand.h \
+  ../include/../shared/./Thread/thread.h ../include/../shared/Io/Io.h \
+  ../include/../shared/./SetErrMsg.h \
+  ../include/../shared/./Time/Profiler.h ../include/../shared/./Exp/Exp.h \
+  ../include/./matlab_includes.h ../include/../io/io.h \
+  ../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h
+
+../include/cielo.h:
+
+../include/../../../config.h:
+
+../include/./standard_includes.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/ctype.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../include/./cielo_types.h:
+
+../include/./cielo_macros.h:
+
+/usr/include/strings.h:
+
+../include/./cielo_externals.h:
+
+../include/./../DataSet/DataSet.h:
+
+../include/./../DataSet/./ContentsList.h:
+
+../include/./../objects/objects.h:
+
+../include/./../objects/./Analysis.h:
+
+../include/./../objects/./../DataSet/DataSet.h:
+
+../include/./../objects/././InputFormats.h:
+
+../include/./../objects/./MpcCase.h:
+
+../include/./../objects/./SpcCase.h:
+
+../include/./../objects/./Suport.h:
+
+../include/./../objects/./SubcaseCase.h:
+
+../include/./../objects/./IcCase.h:
+
+../include/./../objects/./LoadCase.h:
+
+../include/./../objects/./MethodCase.h:
+
+../include/./../objects/./ThloadCase.h:
+
+../include/./../objects/./ThspcCase.h:
+
+../include/./../objects/./TimeCase.h:
+
+../include/./../objects/./TstepCase.h:
+
+../include/./../objects/./Grid.h:
+
+../include/./../objects/./Grdset.h:
+
+../include/./../objects/./Cordx.h:
+
+../include/./../objects/./Tria.h:
+
+../include/./../objects/./Penta.h:
+
+../include/./../objects/./Fluxic.h:
+
+../include/./../objects/./Gradic.h:
+
+../include/./../objects/./Penpair.h:
+
+../include/./../objects/./Pengrid.h:
+
+../include/./../objects/./Penload.h:
+
+../include/./../objects/./Icefront.h:
+
+../include/./../objects/./Tstep.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Tstepnl.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Mpc.h:
+
+../include/./../objects/././GenericLinkedList.h:
+
+../include/./../objects/./Mpcadd.h:
+
+../include/./../objects/././SetList.h:
+
+../include/./../objects/././../DataSet/DataSet.h:
+
+../include/./../objects/./Spc.h:
+
+../include/./../objects/./Spc1.h:
+
+../include/./../objects/./SetList.h:
+
+../include/./../objects/./Spcadd.h:
+
+../include/./../objects/./Spcd.h:
+
+../include/./../objects/./Thspc.h:
+
+../include/./../objects/./Thspc1.h:
+
+../include/./../objects/./Thspcadd.h:
+
+../include/./../objects/./Thspcd.h:
+
+../include/./../objects/./InternalGrid.h:
+
+../include/./../objects/././Grid.h:
+
+../include/./../objects/./../include/cielo_types.h:
+
+../include/./../objects/./InternalCordx.h:
+
+../include/./../objects/././Cordx.h:
+
+../include/./../objects/./Matice.h:
+
+../include/./../objects/./Matpar.h:
+
+../include/./../objects/./Param.h:
+
+../include/./../objects/./SetEntry.h:
+
+../include/./../objects/./State.h:
+
+../include/./../objects/././Analysis.h:
+
+../include/./../objects/././Param.h:
+
+../include/./../objects/./SpcState.h:
+
+../include/./../objects/./SubcaseState.h:
+
+../include/./../objects/./LoadState.h:
+
+../include/./../objects/SetList.h:
+
+../include/./../objects/./DOFSets.h:
+
+../include/./../objects/./VirtualFunctions.h:
+
+../include/./../objects/././ElementObjects/ElemMatrix.h:
+
+../include/./../objects/././ElementObjects/ElemVector.h:
+
+../include/./../objects/./../io/io.h:
+
+../include/./../objects/./../io/../objects/ParameterInputs.h:
+
+../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/include/alloca.h:
+
+/usr/include/assert.h:
+
+../include/./../objects/./ElementObjects/ElementObjects.h:
+
+../include/./../objects/./ElementObjects/./TriaElement.h:
+
+../include/./../objects/./ElementObjects/./../Tria.h:
+
+../include/./../objects/./ElementObjects/./../Friction.h:
+
+../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/././ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/./../objects/./ElementObjects/./././ElemVector.h:
+
+../include/./../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/./../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./../objects.h:
+
+../include/./../objects/./ElementObjects/./PentaElement.h:
+
+../include/./../objects/./ElementObjects/./../Penta.h:
+
+../include/./../objects/./ElementObjects/././TriaElement.h:
+
+../include/./../objects/./ElementObjects/./GaussPoints.h:
+
+../include/./../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/./../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/./../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/ElementUtils.h:
+
+../include/./../objects/./LoadObjects/LoadObjects.h:
+
+../include/./../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/./../objects/./LoadObjects/./../objects.h:
+
+../include/./../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/./../objects/./LoadObjects/./../Icefront.h:
+
+../include/./../objects/./LoadObjects/./PengridLoad.h:
+
+../include/./../objects/./LoadObjects/././PengridLoad.h:
+
+../include/./../objects/./LoadObjects/./../Pengrid.h:
+
+../include/./../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/./../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./Uset.h:
+
+../include/./../objects/./ParameterInputs.h:
+
+../include/./../objects/./Contour.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../EnumDefinitions/EnumDefinitions.h:
+
+../include/../objects/objects.h:
+
+../include/../shared/shared.h:
+
+../include/../shared/./AllocOps/alloc.h:
+
+../include/../shared/./AllocOps/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/MatlabLayer.h:
+
+../include/../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../include/../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../include/../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../include/../shared/./MatrixUtils/MatrixUtils.h:
+
+../include/../shared/./ElementUtils/ElementUtils.h:
+
+../include/../shared/./DofOps/DofOps.h:
+
+../include/../shared/./DofOps/../../include/cielo_types.h:
+
+../include/../shared/./DofOps/../../DataSet/DataSet.h:
+
+../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../include/../shared/./Numerics/UnsymmCrout.h:
+
+../include/../shared/./Numerics/cross.h:
+
+../include/../shared/./Numerics/norm.h:
+
+../include/../shared/./Numerics/extrema.h:
+
+../include/../shared/./SortAndSearch/SortAndSearch.h:
+
+../include/../shared/./Sparse/Sparse.h:
+
+../include/../shared/./Sparse/SparseUtils.h:
+
+../include/../shared/./Sparse/CsrSparseMatrix.h:
+
+../include/../shared/./Sparse/./SparseUtils.h:
+
+../include/../shared/./Marshalling/Marshalling.h:
+
+../include/../shared/./ErrorMacros.h:
+
+../include/../shared/./../include/cielo_externals.h:
+
+../include/../shared/./Time/Time.h:
+
+../include/../shared/./StdMemOut/StdMemOut.h:
+
+../include/../shared/./PrintfMacroExpand.h:
+
+../include/../shared/./Thread/thread.h:
+
+../include/../shared/Io/Io.h:
+
+../include/../shared/./SetErrMsg.h:
+
+../include/../shared/./Time/Profiler.h:
+
+../include/../shared/./Exp/Exp.h:
+
+../include/./matlab_includes.h:
+
+../include/../io/io.h:
+
+../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
Index: /issm/trunk/src/c/io/.deps/RegisterDataSet.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/RegisterDataSet.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/RegisterDataSet.Po	(revision 1)
@@ -0,0 +1,632 @@
+RegisterDataSet.o RegisterDataSet.o: RegisterDataSet.c \
+  /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  ../include/cielo_types.h ../include/cielo_macros.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/bits/nan.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \
+  /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \
+  /usr/include/asm/ioctls.h /usr/include/asm-x86_64/ioctls.h \
+  /usr/include/asm/ioctl.h /usr/include/asm-x86_64/ioctl.h \
+  /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \
+  /usr/include/sys/ttydefaults.h /usr/include/setjmp.h \
+  /usr/include/bits/setjmp.h ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io_local.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io_local.h:
Index: /issm/trunk/src/c/io/.deps/SerialFetchData.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/SerialFetchData.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/SerialFetchData.Po	(revision 1)
@@ -0,0 +1,664 @@
+SerialFetchData.o SerialFetchData.o: SerialFetchData.c ../include/cielo.h \
+  ../include/../../../config.h ../include/./standard_includes.h \
+  /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/ctype.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/time.h /usr/include/bits/time.h \
+  /usr/include/signal.h /usr/include/bits/sigset.h \
+  /usr/include/bits/signum.h /usr/include/time.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/bits/sigthread.h \
+  /usr/include/sys/sem.h /usr/include/sys/ipc.h \
+  /usr/include/bits/ipctypes.h /usr/include/bits/ipc.h \
+  /usr/include/bits/sem.h /usr/include/sys/types.h \
+  /usr/include/sys/select.h /usr/include/bits/select.h \
+  /usr/include/sys/sysmacros.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/stdlib.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/math.h /usr/include/bits/huge_val.h \
+  /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
+  /usr/include/bits/mathinline.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../include/./cielo_types.h ../include/./cielo_macros.h \
+  /usr/include/strings.h ../include/./cielo_externals.h \
+  ../include/./../DataSet/DataSet.h \
+  ../include/./../DataSet/./ContentsList.h \
+  ../include/./../objects/objects.h ../include/./../objects/./Analysis.h \
+  ../include/./../objects/./../DataSet/DataSet.h \
+  ../include/./../objects/././InputFormats.h \
+  ../include/./../objects/./MpcCase.h ../include/./../objects/./SpcCase.h \
+  ../include/./../objects/./Suport.h \
+  ../include/./../objects/./SubcaseCase.h \
+  ../include/./../objects/./IcCase.h ../include/./../objects/./LoadCase.h \
+  ../include/./../objects/./MethodCase.h \
+  ../include/./../objects/./ThloadCase.h \
+  ../include/./../objects/./ThspcCase.h \
+  ../include/./../objects/./TimeCase.h \
+  ../include/./../objects/./TstepCase.h ../include/./../objects/./Grid.h \
+  ../include/./../objects/./Grdset.h ../include/./../objects/./Cordx.h \
+  ../include/./../objects/./Tria.h ../include/./../objects/./Penta.h \
+  ../include/./../objects/./Fluxic.h ../include/./../objects/./Gradic.h \
+  ../include/./../objects/./Penpair.h ../include/./../objects/./Pengrid.h \
+  ../include/./../objects/./Penload.h \
+  ../include/./../objects/./Icefront.h ../include/./../objects/./Tstep.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Tstepnl.h \
+  ../include/./../objects/./TstepTimeInterval.h \
+  ../include/./../objects/./Mpc.h \
+  ../include/./../objects/././GenericLinkedList.h \
+  ../include/./../objects/./Mpcadd.h \
+  ../include/./../objects/././SetList.h \
+  ../include/./../objects/././../DataSet/DataSet.h \
+  ../include/./../objects/./Spc.h ../include/./../objects/./Spc1.h \
+  ../include/./../objects/./SetList.h ../include/./../objects/./Spcadd.h \
+  ../include/./../objects/./Spcd.h ../include/./../objects/./Thspc.h \
+  ../include/./../objects/./Thspc1.h ../include/./../objects/./Thspcadd.h \
+  ../include/./../objects/./Thspcd.h \
+  ../include/./../objects/./InternalGrid.h \
+  ../include/./../objects/././Grid.h \
+  ../include/./../objects/./../include/cielo_types.h \
+  ../include/./../objects/./InternalCordx.h \
+  ../include/./../objects/././Cordx.h ../include/./../objects/./Matice.h \
+  ../include/./../objects/./Matpar.h ../include/./../objects/./Param.h \
+  ../include/./../objects/./SetEntry.h ../include/./../objects/./State.h \
+  ../include/./../objects/././Analysis.h \
+  ../include/./../objects/././Param.h \
+  ../include/./../objects/./SpcState.h \
+  ../include/./../objects/./SubcaseState.h \
+  ../include/./../objects/./LoadState.h ../include/./../objects/SetList.h \
+  ../include/./../objects/./DOFSets.h \
+  ../include/./../objects/./VirtualFunctions.h \
+  ../include/./../objects/././ElementObjects/ElemMatrix.h \
+  ../include/./../objects/././ElementObjects/ElemVector.h \
+  ../include/./../objects/./../io/io.h \
+  ../include/./../objects/./../io/../objects/ParameterInputs.h \
+  ../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h /usr/include/alloca.h \
+  /usr/include/assert.h \
+  ../include/./../objects/./ElementObjects/ElementObjects.h \
+  ../include/./../objects/./ElementObjects/./TriaElement.h \
+  ../include/./../objects/./ElementObjects/./../Tria.h \
+  ../include/./../objects/./ElementObjects/./../Friction.h \
+  ../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/././ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/./../objects/./ElementObjects/./././ElemVector.h \
+  ../include/./../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/./../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/./../objects/./ElementObjects/./../objects.h \
+  ../include/./../objects/./ElementObjects/./PentaElement.h \
+  ../include/./../objects/./ElementObjects/./../Penta.h \
+  ../include/./../objects/./ElementObjects/././TriaElement.h \
+  ../include/./../objects/./ElementObjects/./GaussPoints.h \
+  ../include/./../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/./../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/./../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./ElementObjects/ElementUtils.h \
+  ../include/./../objects/./LoadObjects/LoadObjects.h \
+  ../include/./../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/./../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/./../objects/./LoadObjects/./../objects.h \
+  ../include/./../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/./../objects/./LoadObjects/./../Icefront.h \
+  ../include/./../objects/./LoadObjects/./PengridLoad.h \
+  ../include/./../objects/./LoadObjects/././PengridLoad.h \
+  ../include/./../objects/./LoadObjects/./../Pengrid.h \
+  ../include/./../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/./../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/./../objects/./Uset.h \
+  ../include/./../objects/./ParameterInputs.h \
+  ../include/./../objects/./Contour.h ../include/../DataSet/DataSet.h \
+  ../include/../EnumDefinitions/EnumDefinitions.h \
+  ../include/../objects/objects.h ../include/../shared/shared.h \
+  ../include/../shared/./AllocOps/alloc.h \
+  ../include/../shared/./AllocOps/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/MatlabLayer.h \
+  ../include/../shared/./MatlabLayer/../../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h \
+  ../include/../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../include/../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../include/../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../include/../shared/./MatrixUtils/MatrixUtils.h \
+  ../include/../shared/./ElementUtils/ElementUtils.h \
+  ../include/../shared/./DofOps/DofOps.h \
+  ../include/../shared/./DofOps/../../include/cielo_types.h \
+  ../include/../shared/./DofOps/../../DataSet/DataSet.h \
+  ../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../include/../shared/./Numerics/UnsymmCrout.h \
+  ../include/../shared/./Numerics/cross.h \
+  ../include/../shared/./Numerics/norm.h \
+  ../include/../shared/./Numerics/extrema.h \
+  ../include/../shared/./SortAndSearch/SortAndSearch.h \
+  ../include/../shared/./Sparse/Sparse.h \
+  ../include/../shared/./Sparse/SparseUtils.h \
+  ../include/../shared/./Sparse/CsrSparseMatrix.h \
+  ../include/../shared/./Sparse/./SparseUtils.h \
+  ../include/../shared/./Marshalling/Marshalling.h \
+  ../include/../shared/./ErrorMacros.h \
+  ../include/../shared/./../include/cielo_externals.h \
+  ../include/../shared/./Time/Time.h \
+  ../include/../shared/./StdMemOut/StdMemOut.h \
+  ../include/../shared/./PrintfMacroExpand.h \
+  ../include/../shared/./Thread/thread.h ../include/../shared/Io/Io.h \
+  ../include/../shared/./SetErrMsg.h \
+  ../include/../shared/./Time/Profiler.h ../include/../shared/./Exp/Exp.h \
+  ../include/./matlab_includes.h ../include/../io/io.h \
+  ../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h
+
+../include/cielo.h:
+
+../include/../../../config.h:
+
+../include/./standard_includes.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/ctype.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/time.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../include/./cielo_types.h:
+
+../include/./cielo_macros.h:
+
+/usr/include/strings.h:
+
+../include/./cielo_externals.h:
+
+../include/./../DataSet/DataSet.h:
+
+../include/./../DataSet/./ContentsList.h:
+
+../include/./../objects/objects.h:
+
+../include/./../objects/./Analysis.h:
+
+../include/./../objects/./../DataSet/DataSet.h:
+
+../include/./../objects/././InputFormats.h:
+
+../include/./../objects/./MpcCase.h:
+
+../include/./../objects/./SpcCase.h:
+
+../include/./../objects/./Suport.h:
+
+../include/./../objects/./SubcaseCase.h:
+
+../include/./../objects/./IcCase.h:
+
+../include/./../objects/./LoadCase.h:
+
+../include/./../objects/./MethodCase.h:
+
+../include/./../objects/./ThloadCase.h:
+
+../include/./../objects/./ThspcCase.h:
+
+../include/./../objects/./TimeCase.h:
+
+../include/./../objects/./TstepCase.h:
+
+../include/./../objects/./Grid.h:
+
+../include/./../objects/./Grdset.h:
+
+../include/./../objects/./Cordx.h:
+
+../include/./../objects/./Tria.h:
+
+../include/./../objects/./Penta.h:
+
+../include/./../objects/./Fluxic.h:
+
+../include/./../objects/./Gradic.h:
+
+../include/./../objects/./Penpair.h:
+
+../include/./../objects/./Pengrid.h:
+
+../include/./../objects/./Penload.h:
+
+../include/./../objects/./Icefront.h:
+
+../include/./../objects/./Tstep.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Tstepnl.h:
+
+../include/./../objects/./TstepTimeInterval.h:
+
+../include/./../objects/./Mpc.h:
+
+../include/./../objects/././GenericLinkedList.h:
+
+../include/./../objects/./Mpcadd.h:
+
+../include/./../objects/././SetList.h:
+
+../include/./../objects/././../DataSet/DataSet.h:
+
+../include/./../objects/./Spc.h:
+
+../include/./../objects/./Spc1.h:
+
+../include/./../objects/./SetList.h:
+
+../include/./../objects/./Spcadd.h:
+
+../include/./../objects/./Spcd.h:
+
+../include/./../objects/./Thspc.h:
+
+../include/./../objects/./Thspc1.h:
+
+../include/./../objects/./Thspcadd.h:
+
+../include/./../objects/./Thspcd.h:
+
+../include/./../objects/./InternalGrid.h:
+
+../include/./../objects/././Grid.h:
+
+../include/./../objects/./../include/cielo_types.h:
+
+../include/./../objects/./InternalCordx.h:
+
+../include/./../objects/././Cordx.h:
+
+../include/./../objects/./Matice.h:
+
+../include/./../objects/./Matpar.h:
+
+../include/./../objects/./Param.h:
+
+../include/./../objects/./SetEntry.h:
+
+../include/./../objects/./State.h:
+
+../include/./../objects/././Analysis.h:
+
+../include/./../objects/././Param.h:
+
+../include/./../objects/./SpcState.h:
+
+../include/./../objects/./SubcaseState.h:
+
+../include/./../objects/./LoadState.h:
+
+../include/./../objects/SetList.h:
+
+../include/./../objects/./DOFSets.h:
+
+../include/./../objects/./VirtualFunctions.h:
+
+../include/./../objects/././ElementObjects/ElemMatrix.h:
+
+../include/./../objects/././ElementObjects/ElemVector.h:
+
+../include/./../objects/./../io/io.h:
+
+../include/./../objects/./../io/../objects/ParameterInputs.h:
+
+../include/./../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/include/alloca.h:
+
+/usr/include/assert.h:
+
+../include/./../objects/./ElementObjects/ElementObjects.h:
+
+../include/./../objects/./ElementObjects/./TriaElement.h:
+
+../include/./../objects/./ElementObjects/./../Tria.h:
+
+../include/./../objects/./ElementObjects/./../Friction.h:
+
+../include/./../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/././ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/./../objects/./ElementObjects/./././ElemVector.h:
+
+../include/./../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/./../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/./../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/./../objects/./ElementObjects/./../objects.h:
+
+../include/./../objects/./ElementObjects/./PentaElement.h:
+
+../include/./../objects/./ElementObjects/./../Penta.h:
+
+../include/./../objects/./ElementObjects/././TriaElement.h:
+
+../include/./../objects/./ElementObjects/./GaussPoints.h:
+
+../include/./../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/./../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/./../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/./../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./ElementObjects/ElementUtils.h:
+
+../include/./../objects/./LoadObjects/LoadObjects.h:
+
+../include/./../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/./../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/./../objects/./LoadObjects/./../objects.h:
+
+../include/./../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/./../objects/./LoadObjects/./../Icefront.h:
+
+../include/./../objects/./LoadObjects/./PengridLoad.h:
+
+../include/./../objects/./LoadObjects/././PengridLoad.h:
+
+../include/./../objects/./LoadObjects/./../Pengrid.h:
+
+../include/./../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/./../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/./../objects/./Uset.h:
+
+../include/./../objects/./ParameterInputs.h:
+
+../include/./../objects/./Contour.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../EnumDefinitions/EnumDefinitions.h:
+
+../include/../objects/objects.h:
+
+../include/../shared/shared.h:
+
+../include/../shared/./AllocOps/alloc.h:
+
+../include/../shared/./AllocOps/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/MatlabLayer.h:
+
+../include/../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../include/../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../include/../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../include/../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../include/../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../include/../shared/./MatrixUtils/MatrixUtils.h:
+
+../include/../shared/./ElementUtils/ElementUtils.h:
+
+../include/../shared/./DofOps/DofOps.h:
+
+../include/../shared/./DofOps/../../include/cielo_types.h:
+
+../include/../shared/./DofOps/../../DataSet/DataSet.h:
+
+../include/../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../include/../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../include/../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../include/../shared/./Numerics/UnsymmCrout.h:
+
+../include/../shared/./Numerics/cross.h:
+
+../include/../shared/./Numerics/norm.h:
+
+../include/../shared/./Numerics/extrema.h:
+
+../include/../shared/./SortAndSearch/SortAndSearch.h:
+
+../include/../shared/./Sparse/Sparse.h:
+
+../include/../shared/./Sparse/SparseUtils.h:
+
+../include/../shared/./Sparse/CsrSparseMatrix.h:
+
+../include/../shared/./Sparse/./SparseUtils.h:
+
+../include/../shared/./Marshalling/Marshalling.h:
+
+../include/../shared/./ErrorMacros.h:
+
+../include/../shared/./../include/cielo_externals.h:
+
+../include/../shared/./Time/Time.h:
+
+../include/../shared/./StdMemOut/StdMemOut.h:
+
+../include/../shared/./PrintfMacroExpand.h:
+
+../include/../shared/./Thread/thread.h:
+
+../include/../shared/Io/Io.h:
+
+../include/../shared/./SetErrMsg.h:
+
+../include/../shared/./Time/Profiler.h:
+
+../include/../shared/./Exp/Exp.h:
+
+../include/./matlab_includes.h:
+
+../include/../io/io.h:
+
+../include/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
Index: /issm/trunk/src/c/io/.deps/SerialWriteData.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/SerialWriteData.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/SerialWriteData.Po	(revision 1)
@@ -0,0 +1,632 @@
+SerialWriteData.o SerialWriteData.o: SerialWriteData.c \
+  /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io.h:
Index: /issm/trunk/src/c/io/.deps/WriteData.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/WriteData.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/WriteData.Po	(revision 1)
@@ -0,0 +1,632 @@
+WriteData.o WriteData.o: WriteData.c /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io.h:
Index: /issm/trunk/src/c/io/.deps/WriteDataSet.Po
===================================================================
--- /issm/trunk/src/c/io/.deps/WriteDataSet.Po	(revision 1)
+++ /issm/trunk/src/c/io/.deps/WriteDataSet.Po	(revision 1)
@@ -0,0 +1,632 @@
+WriteDataSet.o WriteDataSet.o: WriteDataSet.c /usr/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
+  /usr/include/gnu/stubs-64.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
+  /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+  /usr/include/bits/wchar.h /usr/include/gconv.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h /usr/include/stdlib.h \
+  /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
+  /usr/include/bits/endian.h /usr/include/sys/select.h \
+  /usr/include/bits/select.h /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
+  ../include/cielo_types.h ../include/cielo_macros.h /usr/include/math.h \
+  /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
+  /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
+  /usr/include/strings.h ../include/cielo_externals.h \
+  ../include/../DataSet/DataSet.h ../include/../DataSet/./ContentsList.h \
+  ../include/../objects/objects.h ../include/../objects/./Analysis.h \
+  ../include/../objects/./../DataSet/DataSet.h \
+  ../include/../objects/././InputFormats.h \
+  ../include/../objects/./MpcCase.h ../include/../objects/./SpcCase.h \
+  ../include/../objects/./Suport.h ../include/../objects/./SubcaseCase.h \
+  ../include/../objects/./IcCase.h ../include/../objects/./LoadCase.h \
+  ../include/../objects/./MethodCase.h \
+  ../include/../objects/./ThloadCase.h \
+  ../include/../objects/./ThspcCase.h ../include/../objects/./TimeCase.h \
+  ../include/../objects/./TstepCase.h ../include/../objects/./Grid.h \
+  ../include/../objects/./Grdset.h ../include/../objects/./Cordx.h \
+  ../include/../objects/./Tria.h ../include/../objects/./Penta.h \
+  ../include/../objects/./Fluxic.h ../include/../objects/./Gradic.h \
+  ../include/../objects/./Penpair.h ../include/../objects/./Pengrid.h \
+  ../include/../objects/./Penload.h ../include/../objects/./Icefront.h \
+  ../include/../objects/./Tstep.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Tstepnl.h \
+  ../include/../objects/./TstepTimeInterval.h \
+  ../include/../objects/./Mpc.h \
+  ../include/../objects/././GenericLinkedList.h \
+  ../include/../objects/./Mpcadd.h ../include/../objects/././SetList.h \
+  ../include/../objects/././../DataSet/DataSet.h \
+  ../include/../objects/./Spc.h ../include/../objects/./Spc1.h \
+  ../include/../objects/./SetList.h ../include/../objects/./Spcadd.h \
+  ../include/../objects/./Spcd.h ../include/../objects/./Thspc.h \
+  ../include/../objects/./Thspc1.h ../include/../objects/./Thspcadd.h \
+  ../include/../objects/./Thspcd.h ../include/../objects/./InternalGrid.h \
+  ../include/../objects/././Grid.h \
+  ../include/../objects/./../include/cielo_types.h \
+  ../include/../objects/./InternalCordx.h \
+  ../include/../objects/././Cordx.h ../include/../objects/./Matice.h \
+  ../include/../objects/./Matpar.h ../include/../objects/./Param.h \
+  ../include/../objects/./SetEntry.h ../include/../objects/./State.h \
+  ../include/../objects/././Analysis.h ../include/../objects/././Param.h \
+  ../include/../objects/./SpcState.h \
+  ../include/../objects/./SubcaseState.h \
+  ../include/../objects/./LoadState.h ../include/../objects/SetList.h \
+  ../include/../objects/./DOFSets.h \
+  ../include/../objects/./VirtualFunctions.h \
+  ../include/../objects/././ElementObjects/ElemMatrix.h \
+  ../include/../objects/././ElementObjects/ElemVector.h \
+  ../include/../objects/./../io/io.h \
+  ../include/../objects/./../io/../objects/ParameterInputs.h \
+  ../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mex.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/matrix.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h \
+  /usr/include/assert.h \
+  ../include/../objects/./ElementObjects/ElementObjects.h \
+  ../include/../objects/./ElementObjects/./TriaElement.h \
+  ../include/../objects/./ElementObjects/./../Tria.h \
+  ../include/../objects/./ElementObjects/./../Friction.h \
+  ../include/../objects/./ElementObjects/./../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/./../InternalGrid.h \
+  ../include/../objects/./ElementObjects/././ElementUtils.h \
+  ../include/../objects/./ElementObjects/./././ElemMatrix.h \
+  ../include/../objects/./ElementObjects/./././ElemVector.h \
+  ../include/../objects/./ElementObjects/./././GetElementGridData.h \
+  ../include/../objects/./ElementObjects/./././../InternalGrid.h \
+  ../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h \
+  ../include/../objects/./ElementObjects/./../objects.h \
+  ../include/../objects/./ElementObjects/./PentaElement.h \
+  ../include/../objects/./ElementObjects/./../Penta.h \
+  ../include/../objects/./ElementObjects/././TriaElement.h \
+  ../include/../objects/./ElementObjects/./GaussPoints.h \
+  ../include/../objects/./ElementObjects/./MatrixOperations.h \
+  ../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h \
+  ../include/../objects/./ElementObjects/SpawnElementObjects.h \
+  ../include/../objects/./ElementObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./ElementObjects/ElementUtils.h \
+  ../include/../objects/./LoadObjects/LoadObjects.h \
+  ../include/../objects/./LoadObjects/./PenpairLoad.h \
+  ../include/../objects/./LoadObjects/././PenpairLoad.h \
+  ../include/../objects/./LoadObjects/./../InternalGrid.h \
+  ../include/../objects/./LoadObjects/./../objects.h \
+  ../include/../objects/./LoadObjects/./IcefrontLoad.h \
+  ../include/../objects/./LoadObjects/./../Icefront.h \
+  ../include/../objects/./LoadObjects/./PengridLoad.h \
+  ../include/../objects/./LoadObjects/././PengridLoad.h \
+  ../include/../objects/./LoadObjects/./../Pengrid.h \
+  ../include/../objects/./LoadObjects/SpawnLoadObjects.h \
+  ../include/../objects/./LoadObjects/../../DataSet/DataSet.h \
+  ../include/../objects/./Uset.h \
+  ../include/../objects/./ParameterInputs.h \
+  ../include/../objects/./Contour.h ../include/matlab_includes.h \
+  /usr/local/pkgs/matlab-7.6//extern/include/mat.h ../DataSet/DataSet.h \
+  ../EnumDefinitions/EnumDefinitions.h ../shared/shared.h \
+  ../shared/./AllocOps/alloc.h \
+  ../shared/./AllocOps/../../include/standard_includes.h \
+  /usr/include/ctype.h /usr/include/signal.h /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h /usr/include/sys/sem.h \
+  /usr/include/sys/ipc.h /usr/include/bits/ipctypes.h \
+  /usr/include/bits/ipc.h /usr/include/bits/sem.h /usr/include/errno.h \
+  /usr/include/bits/errno.h /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h /usr/include/asm-x86_64/errno.h \
+  /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
+  /usr/include/string.h /usr/include/bits/string.h \
+  /usr/include/bits/string2.h /usr/include/bits/nan.h \
+  /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/ioctl.h \
+  /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \
+  /usr/include/asm-x86_64/ioctls.h /usr/include/asm/ioctl.h \
+  /usr/include/asm-x86_64/ioctl.h /usr/include/asm-generic/ioctl.h \
+  /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
+  /usr/include/setjmp.h /usr/include/bits/setjmp.h \
+  ../shared/./MatlabLayer/MatlabLayer.h \
+  ../shared/./MatlabLayer/../../include/matlab_includes.h \
+  ../shared/./MatlabLayer/../../include/standard_includes.h \
+  ../shared/./MatlabLayer/../Sparse/Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/SparseUtils.h \
+  ../shared/./MatlabLayer/../Sparse/./Sparse.h \
+  ../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h \
+  ../shared/./MatrixUtils/MatrixUtils.h \
+  ../shared/./ElementUtils/ElementUtils.h ../shared/./DofOps/DofOps.h \
+  ../shared/./DofOps/../../include/cielo_types.h \
+  ../shared/./DofOps/../../DataSet/DataSet.h \
+  ../shared/./SetLogicMatrixOps/SetLogicMatrix.h \
+  ../shared/./SetLogicMatrixOps/../../objects/SetList.h \
+  ../shared/./Numerics/GetVectorbOrthogonalToVectora.h \
+  ../shared/./Numerics/UnsymmCrout.h ../shared/./Numerics/cross.h \
+  ../shared/./Numerics/norm.h ../shared/./Numerics/extrema.h \
+  ../shared/./SortAndSearch/SortAndSearch.h ../shared/./Sparse/Sparse.h \
+  ../shared/./Sparse/SparseUtils.h ../shared/./Sparse/CsrSparseMatrix.h \
+  ../shared/./Sparse/./SparseUtils.h \
+  ../shared/./Marshalling/Marshalling.h ../shared/./ErrorMacros.h \
+  ../shared/./../include/cielo_externals.h ../shared/./Time/Time.h \
+  ../shared/./StdMemOut/StdMemOut.h ../shared/./PrintfMacroExpand.h \
+  ../shared/./Thread/thread.h ../shared/Io/Io.h ../shared/./SetErrMsg.h \
+  ../shared/./Time/Profiler.h ../shared/./Exp/Exp.h io_local.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/sys/cdefs.h:
+
+/usr/include/bits/wordsize.h:
+
+/usr/include/gnu/stubs.h:
+
+/usr/include/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:
+
+/usr/include/bits/types.h:
+
+/usr/include/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/bits/wchar.h:
+
+/usr/include/gconv.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stdarg.h:
+
+/usr/include/bits/stdio_lim.h:
+
+/usr/include/bits/sys_errlist.h:
+
+/usr/include/bits/stdio.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/endian.h:
+
+/usr/include/bits/endian.h:
+
+/usr/include/sys/select.h:
+
+/usr/include/bits/select.h:
+
+/usr/include/bits/sigset.h:
+
+/usr/include/bits/time.h:
+
+/usr/include/sys/sysmacros.h:
+
+/usr/include/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+../include/cielo_types.h:
+
+../include/cielo_macros.h:
+
+/usr/include/math.h:
+
+/usr/include/bits/huge_val.h:
+
+/usr/include/bits/mathdef.h:
+
+/usr/include/bits/mathcalls.h:
+
+/usr/include/bits/mathinline.h:
+
+/usr/include/strings.h:
+
+../include/cielo_externals.h:
+
+../include/../DataSet/DataSet.h:
+
+../include/../DataSet/./ContentsList.h:
+
+../include/../objects/objects.h:
+
+../include/../objects/./Analysis.h:
+
+../include/../objects/./../DataSet/DataSet.h:
+
+../include/../objects/././InputFormats.h:
+
+../include/../objects/./MpcCase.h:
+
+../include/../objects/./SpcCase.h:
+
+../include/../objects/./Suport.h:
+
+../include/../objects/./SubcaseCase.h:
+
+../include/../objects/./IcCase.h:
+
+../include/../objects/./LoadCase.h:
+
+../include/../objects/./MethodCase.h:
+
+../include/../objects/./ThloadCase.h:
+
+../include/../objects/./ThspcCase.h:
+
+../include/../objects/./TimeCase.h:
+
+../include/../objects/./TstepCase.h:
+
+../include/../objects/./Grid.h:
+
+../include/../objects/./Grdset.h:
+
+../include/../objects/./Cordx.h:
+
+../include/../objects/./Tria.h:
+
+../include/../objects/./Penta.h:
+
+../include/../objects/./Fluxic.h:
+
+../include/../objects/./Gradic.h:
+
+../include/../objects/./Penpair.h:
+
+../include/../objects/./Pengrid.h:
+
+../include/../objects/./Penload.h:
+
+../include/../objects/./Icefront.h:
+
+../include/../objects/./Tstep.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Tstepnl.h:
+
+../include/../objects/./TstepTimeInterval.h:
+
+../include/../objects/./Mpc.h:
+
+../include/../objects/././GenericLinkedList.h:
+
+../include/../objects/./Mpcadd.h:
+
+../include/../objects/././SetList.h:
+
+../include/../objects/././../DataSet/DataSet.h:
+
+../include/../objects/./Spc.h:
+
+../include/../objects/./Spc1.h:
+
+../include/../objects/./SetList.h:
+
+../include/../objects/./Spcadd.h:
+
+../include/../objects/./Spcd.h:
+
+../include/../objects/./Thspc.h:
+
+../include/../objects/./Thspc1.h:
+
+../include/../objects/./Thspcadd.h:
+
+../include/../objects/./Thspcd.h:
+
+../include/../objects/./InternalGrid.h:
+
+../include/../objects/././Grid.h:
+
+../include/../objects/./../include/cielo_types.h:
+
+../include/../objects/./InternalCordx.h:
+
+../include/../objects/././Cordx.h:
+
+../include/../objects/./Matice.h:
+
+../include/../objects/./Matpar.h:
+
+../include/../objects/./Param.h:
+
+../include/../objects/./SetEntry.h:
+
+../include/../objects/./State.h:
+
+../include/../objects/././Analysis.h:
+
+../include/../objects/././Param.h:
+
+../include/../objects/./SpcState.h:
+
+../include/../objects/./SubcaseState.h:
+
+../include/../objects/./LoadState.h:
+
+../include/../objects/SetList.h:
+
+../include/../objects/./DOFSets.h:
+
+../include/../objects/./VirtualFunctions.h:
+
+../include/../objects/././ElementObjects/ElemMatrix.h:
+
+../include/../objects/././ElementObjects/ElemVector.h:
+
+../include/../objects/./../io/io.h:
+
+../include/../objects/./../io/../objects/ParameterInputs.h:
+
+../include/../objects/./../io/../objects/../NumericalToolkitsAPI/NumericalToolkitsAPI.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mex.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/matrix.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/tmwtypes.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/bits/posix1_lim.h:
+
+/usr/include/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/float.h:
+
+/usr/include/assert.h:
+
+../include/../objects/./ElementObjects/ElementObjects.h:
+
+../include/../objects/./ElementObjects/./TriaElement.h:
+
+../include/../objects/./ElementObjects/./../Tria.h:
+
+../include/../objects/./ElementObjects/./../Friction.h:
+
+../include/../objects/./ElementObjects/./../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/./../InternalGrid.h:
+
+../include/../objects/./ElementObjects/././ElementUtils.h:
+
+../include/../objects/./ElementObjects/./././ElemMatrix.h:
+
+../include/../objects/./ElementObjects/./././ElemVector.h:
+
+../include/../objects/./ElementObjects/./././GetElementGridData.h:
+
+../include/../objects/./ElementObjects/./././../InternalGrid.h:
+
+../include/../objects/./ElementObjects/./../../shared/ElementUtils/ElementUtils.h:
+
+../include/../objects/./ElementObjects/./../objects.h:
+
+../include/../objects/./ElementObjects/./PentaElement.h:
+
+../include/../objects/./ElementObjects/./../Penta.h:
+
+../include/../objects/./ElementObjects/././TriaElement.h:
+
+../include/../objects/./ElementObjects/./GaussPoints.h:
+
+../include/../objects/./ElementObjects/./MatrixOperations.h:
+
+../include/../objects/./ElementObjects/../../shared/Sparse/Sparse.h:
+
+../include/../objects/./ElementObjects/SpawnElementObjects.h:
+
+../include/../objects/./ElementObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./ElementObjects/ElementUtils.h:
+
+../include/../objects/./LoadObjects/LoadObjects.h:
+
+../include/../objects/./LoadObjects/./PenpairLoad.h:
+
+../include/../objects/./LoadObjects/././PenpairLoad.h:
+
+../include/../objects/./LoadObjects/./../InternalGrid.h:
+
+../include/../objects/./LoadObjects/./../objects.h:
+
+../include/../objects/./LoadObjects/./IcefrontLoad.h:
+
+../include/../objects/./LoadObjects/./../Icefront.h:
+
+../include/../objects/./LoadObjects/./PengridLoad.h:
+
+../include/../objects/./LoadObjects/././PengridLoad.h:
+
+../include/../objects/./LoadObjects/./../Pengrid.h:
+
+../include/../objects/./LoadObjects/SpawnLoadObjects.h:
+
+../include/../objects/./LoadObjects/../../DataSet/DataSet.h:
+
+../include/../objects/./Uset.h:
+
+../include/../objects/./ParameterInputs.h:
+
+../include/../objects/./Contour.h:
+
+../include/matlab_includes.h:
+
+/usr/local/pkgs/matlab-7.6//extern/include/mat.h:
+
+../DataSet/DataSet.h:
+
+../EnumDefinitions/EnumDefinitions.h:
+
+../shared/shared.h:
+
+../shared/./AllocOps/alloc.h:
+
+../shared/./AllocOps/../../include/standard_includes.h:
+
+/usr/include/ctype.h:
+
+/usr/include/signal.h:
+
+/usr/include/bits/signum.h:
+
+/usr/include/bits/siginfo.h:
+
+/usr/include/bits/sigaction.h:
+
+/usr/include/bits/sigcontext.h:
+
+/usr/include/bits/sigstack.h:
+
+/usr/include/bits/sigthread.h:
+
+/usr/include/sys/sem.h:
+
+/usr/include/sys/ipc.h:
+
+/usr/include/bits/ipctypes.h:
+
+/usr/include/bits/ipc.h:
+
+/usr/include/bits/sem.h:
+
+/usr/include/errno.h:
+
+/usr/include/bits/errno.h:
+
+/usr/include/linux/errno.h:
+
+/usr/include/asm/errno.h:
+
+/usr/include/asm-x86_64/errno.h:
+
+/usr/include/asm-generic/errno.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/usr/include/string.h:
+
+/usr/include/bits/string.h:
+
+/usr/include/bits/string2.h:
+
+/usr/include/bits/nan.h:
+
+/usr/include/fcntl.h:
+
+/usr/include/bits/fcntl.h:
+
+/usr/include/sys/ioctl.h:
+
+/usr/include/bits/ioctls.h:
+
+/usr/include/asm/ioctls.h:
+
+/usr/include/asm-x86_64/ioctls.h:
+
+/usr/include/asm/ioctl.h:
+
+/usr/include/asm-x86_64/ioctl.h:
+
+/usr/include/asm-generic/ioctl.h:
+
+/usr/include/bits/ioctl-types.h:
+
+/usr/include/sys/ttydefaults.h:
+
+/usr/include/setjmp.h:
+
+/usr/include/bits/setjmp.h:
+
+../shared/./MatlabLayer/MatlabLayer.h:
+
+../shared/./MatlabLayer/../../include/matlab_includes.h:
+
+../shared/./MatlabLayer/../../include/standard_includes.h:
+
+../shared/./MatlabLayer/../Sparse/Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/SparseUtils.h:
+
+../shared/./MatlabLayer/../Sparse/./Sparse.h:
+
+../shared/./MatlabLayer/../Sparse/../../include/matlab_includes.h:
+
+../shared/./MatrixUtils/MatrixUtils.h:
+
+../shared/./ElementUtils/ElementUtils.h:
+
+../shared/./DofOps/DofOps.h:
+
+../shared/./DofOps/../../include/cielo_types.h:
+
+../shared/./DofOps/../../DataSet/DataSet.h:
+
+../shared/./SetLogicMatrixOps/SetLogicMatrix.h:
+
+../shared/./SetLogicMatrixOps/../../objects/SetList.h:
+
+../shared/./Numerics/GetVectorbOrthogonalToVectora.h:
+
+../shared/./Numerics/UnsymmCrout.h:
+
+../shared/./Numerics/cross.h:
+
+../shared/./Numerics/norm.h:
+
+../shared/./Numerics/extrema.h:
+
+../shared/./SortAndSearch/SortAndSearch.h:
+
+../shared/./Sparse/Sparse.h:
+
+../shared/./Sparse/SparseUtils.h:
+
+../shared/./Sparse/CsrSparseMatrix.h:
+
+../shared/./Sparse/./SparseUtils.h:
+
+../shared/./Marshalling/Marshalling.h:
+
+../shared/./ErrorMacros.h:
+
+../shared/./../include/cielo_externals.h:
+
+../shared/./Time/Time.h:
+
+../shared/./StdMemOut/StdMemOut.h:
+
+../shared/./PrintfMacroExpand.h:
+
+../shared/./Thread/thread.h:
+
+../shared/Io/Io.h:
+
+../shared/./SetErrMsg.h:
+
+../shared/./Time/Profiler.h:
+
+../shared/./Exp/Exp.h:
+
+io_local.h:
Index: /issm/trunk/src/c/io/FetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/FetchData.cpp	(revision 1)
+++ /issm/trunk/src/c/io/FetchData.cpp	(revision 1)
@@ -0,0 +1,29 @@
+/*\file FetchData.cpp:
+ * \brief: general I/O interface to fetch data.
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./io.h"
+
+#ifdef _SERIAL_
+
+#include <mex.h>
+void FetchData(void** pdata,int* pM,int* pN,const mxArray* pdataref,char* data_type,char* sub_data_type){
+	
+	SerialFetchData(pdata,pM,pN,pdataref,data_type,sub_data_type);
+
+}
+#endif
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+void FetchData(void** pdata,int* pM,int* pN,FILE* fid,char* data_type,char* sub_data_type){
+
+	ParallelFetchData(pdata,pM,pN,fid, data_type,sub_data_type);
+
+}
+#endif
Index: /issm/trunk/src/c/io/FetchNodeSets.cpp
===================================================================
--- /issm/trunk/src/c/io/FetchNodeSets.cpp	(revision 1)
+++ /issm/trunk/src/c/io/FetchNodeSets.cpp	(revision 1)
@@ -0,0 +1,51 @@
+/* \file FetchNodeSets.c:
+ * \brief: interface for reading nodesets from matlab workspace
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#undef __FUNCT__ 
+#define __FUNCT__  "FetchNodeSets"
+
+#ifdef _SERIAL_
+#include <mex.h>
+
+#include "../objects/NodeSets.h"
+#include "./io.h"
+
+void  FetchNodeSets(NodeSets** pnodesets,ConstDataHandle dataref){
+
+	/*output: */
+	NodeSets* nodesets=NULL;
+	double* pv_m=NULL;
+	double* pv_n=NULL;
+	double* pv_f=NULL;
+	double* pv_s=NULL;
+	int gsize;
+	int msize;
+	int nsize;
+	int fsize;
+	int ssize;
+
+	FetchData((void**)&pv_m,NULL,NULL,mxGetField(dataref,0,"pv_m"),"Vector","Vec");
+	FetchData((void**)&pv_n,NULL,NULL,mxGetField(dataref,0,"pv_n"),"Vector","Vec");
+	FetchData((void**)&pv_f,NULL,NULL,mxGetField(dataref,0,"pv_f"),"Vector","Vec");
+	FetchData((void**)&pv_s,NULL,NULL,mxGetField(dataref,0,"pv_s"),"Vector","Vec");
+	
+	gsize=(int)mxGetScalar(mxGetField(dataref,0,"gsize"));
+	msize=(int)mxGetScalar(mxGetField(dataref,0,"msize"));
+	nsize=(int)mxGetScalar(mxGetField(dataref,0,"nsize"));
+	fsize=(int)mxGetScalar(mxGetField(dataref,0,"fsize"));
+	ssize=(int)mxGetScalar(mxGetField(dataref,0,"ssize"));
+
+	nodesets=new NodeSets( pv_m,pv_n,pv_f,pv_s,gsize,msize,nsize,fsize,ssize);
+
+	/*Assign output pointers:*/
+	*pnodesets=nodesets;
+
+}
+#endif
Index: /issm/trunk/src/c/io/HeaderAddToDataSetRef.c
===================================================================
--- /issm/trunk/src/c/io/HeaderAddToDataSetRef.c	(revision 1)
+++ /issm/trunk/src/c/io/HeaderAddToDataSetRef.c	(revision 1)
@@ -0,0 +1,97 @@
+/*
+ * HeaderAddToDataSetRef.c
+ *     Description:  This function adds a header structure to a dataset reference. This is 
+ *     normally done in WriteDataSet, but modules don't call WriteDataSet when the data 
+ *     returned is remote. In these cases, we call HeaderAddToDataSetRef. Why do we call 
+ *     this other function instead of WriteDataSet? Because for ex in modules View and 
+ *     Rmg, remote data is not downloaded, and WriteDataSet would not be able to retrieve 
+ *     M,N, nnz, isempty, issparse from the input dataset  reference, only garbage. 
+ */
+
+/* hosting environment: */
+#include "../include/cielo.h"
+
+
+int HeaderAddToDataSetRef(mxArray* pdatasetref,double M,double N,double nnz,double IsEmpty,double IsSparse){
+
+	int noerr=1;
+	int i;
+	
+	/*Header variables*/
+	int nfields=5;
+	const	char*	fnames[nfields];
+	mwSize		onebyone[2] = {1,1};
+	mwSize		ndim=2;
+	mxArray* pmxa_header=NULL;
+	double* pM=NULL;
+	double* pN=NULL;
+	double* pnnz=NULL;
+	double* pIsEmpty=NULL;
+	double* pIsSparse=NULL;
+	mxArray* pmxa_M=NULL;
+	mxArray* pmxa_N=NULL;
+	mxArray* pmxa_nnz=NULL;
+	mxArray* pmxa_IsEmpty=NULL;
+	mxArray* pmxa_IsSparse=NULL;
+
+
+	
+	
+	fnames[0] = "M";
+	fnames[1] = "N";
+	fnames[2] = "nnz";
+	fnames[3] = "isempty";
+	fnames[4] = "issparse";
+	
+	pmxa_header=mxCreateStructArray( ndim,onebyone,nfields,fnames);
+
+	pM=(double*)xcalloc(1,sizeof(double));
+	pN=(double*)xcalloc(1,sizeof(double));
+	pnnz=(double*)xcalloc(1,sizeof(double));
+	pIsEmpty=(double*)xcalloc(1,sizeof(double));
+	pIsSparse=(double*)xcalloc(1,sizeof(double));
+
+	*pM=M;
+	*pN=N;
+	*pnnz=nnz;
+	*pIsEmpty=IsEmpty;
+	*pIsSparse=IsSparse;
+	
+	pmxa_M = mxCreateDoubleMatrix(1,1,mxREAL);
+	mxSetM(pmxa_M,1);
+	mxSetN(pmxa_M,1);
+	mxSetPr(pmxa_M,pM);
+	
+	pmxa_N = mxCreateDoubleMatrix(1,1,mxREAL);
+	mxSetM(pmxa_N,1);
+	mxSetN(pmxa_N,1);
+	mxSetPr(pmxa_N,pN);
+
+	pmxa_nnz = mxCreateDoubleMatrix(1,1,mxREAL);
+	mxSetM(pmxa_nnz,1);
+	mxSetN(pmxa_nnz,1);
+	mxSetPr(pmxa_nnz,pnnz);
+
+
+	pmxa_IsEmpty = mxCreateDoubleMatrix(1,1,mxREAL);
+	mxSetM(pmxa_IsEmpty,1);
+	mxSetN(pmxa_IsEmpty,1);
+	mxSetPr(pmxa_IsEmpty,pIsEmpty);
+
+	pmxa_IsSparse = mxCreateDoubleMatrix(1,1,mxREAL);
+	mxSetM(pmxa_IsSparse,1);
+	mxSetN(pmxa_IsSparse,1);
+	mxSetPr(pmxa_IsSparse,pIsSparse);
+	
+	mxSetField( pmxa_header, 0, "M",     pmxa_M);
+	mxSetField( pmxa_header, 0, "N",     pmxa_N);
+	mxSetField( pmxa_header, 0, "nnz",     pmxa_nnz);
+	mxSetField( pmxa_header, 0, "isempty",     pmxa_IsEmpty);
+	mxSetField( pmxa_header, 0, "issparse",     pmxa_IsSparse);
+
+	/*Add header to pOuputStructure*/
+	mxAddField(pdatasetref,"header");
+	mxSetField(pdatasetref,0,"header",pmxa_header);
+
+	return noerr;
+}
Index: /issm/trunk/src/c/io/ModelFetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/ModelFetchData.cpp	(revision 1)
+++ /issm/trunk/src/c/io/ModelFetchData.cpp	(revision 1)
@@ -0,0 +1,96 @@
+/*! \file ModelFetchData.c
+ *  \brief: wrapper to the I/O routines, for special processing of the Model structure.
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./io.h"
+#include "../ModelProcessorx/ModelProcessorx.h"
+#include "../shared/shared.h"
+
+void  ModelFetchData(void** pdata,int* pM,int* pN,ConstDataHandle model_handle,char* data_name,char* data_type,char* sub_data_type){
+	
+
+	extern int my_rank;
+	extern int num_procs;
+
+	int string_size;
+	int record_length;
+	char* string=NULL;
+
+	/*Why this routine? To make Model management simpler. FetchData is enough for regular I/O, but here, we are dealing with 
+	 * I/O that can act on the model matlab array (in case we are running serially), or I/O on the binary file when running 
+	 * in parallel. On a matlab model array, it is easy to find the data with name "data_name", but not in a binary file. We 
+	 * are abstracting all of this with one function, operating on the DataHandle object. */
+
+	char* repository=NULL;
+	FILE* fid=NULL;
+	int found=0;
+
+	/*Ok, on the matlab side: */
+	#ifdef _SERIAL_
+
+	/*The typical model_handle is a const mxArray*, to which FetchData is applied. But here, we are dealing with a structure, the 
+	 *model. Therefore, we are looking to fetch a certain field of this data. So get this field first, and then feed it to the 
+	 FetchData routine. : */
+
+	FetchData((void**)pdata,pM,pN,mxGetAssignedField(model_handle,0,data_name),data_type,sub_data_type);
+
+	#else
+
+	/*In parallel, we have a FetchData, which will recover data, but it will do a good job provided the FILE* descriptor 
+	 * is pointing to the start of the data we want. Here, we have to go looking for the beginning of this data. */
+
+	if(my_rank==0){
+	
+		/*First set FILE* position to the beginning of the file: */
+		fid=(FILE*)model_handle;
+		fseek(fid,0,SEEK_SET);
+
+		/*Now march through file looking for the correct name: */
+		for(;;){
+			/*Read size of first string name: */
+			if(fread(&string_size,sizeof(int),1,fid)==0){
+				/*Ok, we have reached the end of the file. break: */
+				found=0;
+				break;
+			}
+			/*Allocate string of correct size: */
+			string=(char*)xmalloc((string_size+1)*sizeof(char));
+			string[string_size]='\0';
+
+			/*Read string: */
+			if(fread(string,string_size*sizeof(char),1,fid)==0){
+				/*Ok, we have reached the end of the file. break: */
+				found=0;
+				break;
+			}
+			/*Is this the correct string? : */
+			if (strcmp(string,data_name)==0){
+				/*Ok, we have found the correct string. Pass the record length, and break: */
+				fseek(fid,sizeof(int),SEEK_CUR);
+				found=1;
+				break;
+			}
+			else{
+				/*This is not the correct string, read the record length, and skip it: */
+				fread(&record_length,sizeof(int),1,fid);
+				/*skip: */
+				fseek(fid,record_length,SEEK_CUR);
+			}
+			/*Erase string: */
+			xfree((void**)&string);
+		}
+	}
+	MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	if(!found)throw ErrorException(__FUNCT__,exprintf("%s%s","could not find data with name",data_name));
+
+	/*We are at the correct position! Go for it: */
+	FetchData((void**)pdata,pM,pN,fid,data_type,sub_data_type);
+	#endif
+}
Index: /issm/trunk/src/c/io/ParallelFetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchData.cpp	(revision 1)
+++ /issm/trunk/src/c/io/ParallelFetchData.cpp	(revision 1)
@@ -0,0 +1,57 @@
+/*
+ * ParallelFetchData.c
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "./io.h"
+#include "../include/macros.h"
+#include "../shared/shared.h"
+
+
+#undef __FUNCT__
+#define __FUNCT__ "ParallelFetchData"
+
+void ParallelFetchData(void** pdata,int* pM,int* pN,FILE* fid, char* data_type,char* sub_data_type){
+
+	/*Branch according to data type and sub_data_type: */
+	if (strcmp(data_type,"Matrix")==0){
+
+		if (strcmp(sub_data_type,"Mat")==0){
+			ParallelFetchMat((double**)pdata,pM,pN,fid);
+		}
+		else throw ErrorException(__FUNCT__,exprintf("%s%s%s%s%s"," sub_data_type ",sub_data_type," for ",data_type," type not supported yet!"));
+	}
+	else if (strcmp(data_type,"String")==0){
+
+		/*Call ParallelFetchString: */
+		ParallelFetchString((char**)pdata,fid);
+
+
+	}
+	else if (strcmp(data_type,"Scalar")==0){
+
+		/*Call ParallelFetchScalar. Cast pdata from a (void**) to a (double*), because we are not going to allocate a scalar,
+		 *just dereference the double*.: */
+		ParallelFetchScalar((double*)pdata,fid);
+
+	}
+	else if (strcmp(data_type,"Integer")==0){
+
+		/*Call ParallelFetchInteger. Cast pdata from a (void**) to a (int*), because we are not going to allocate an integer,
+		 *just dereference the int*.: */
+		ParallelFetchInteger((int*)pdata,fid);
+	
+	}
+	else throw ErrorException(__FUNCT__,exprintf("%s%s%s"," data_type ",data_type," not supported yet!"));
+}
+
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/io/ParallelFetchInteger.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchInteger.cpp	(revision 1)
+++ /issm/trunk/src/c/io/ParallelFetchInteger.cpp	(revision 1)
@@ -0,0 +1,41 @@
+
+/*
+   ParallelFetchInteger.c
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "../toolkits/toolkits.h"
+#include "../shared/shared.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#undef __FUNCT__
+#define __FUNCT__ "ParallelFetchInteger"
+void ParallelFetchInteger(int* pinteger,FILE* fid){
+
+	/*error management*/
+	extern int my_rank;
+	extern int num_procs;
+
+	/*output: */
+	int   integer;
+
+	/*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
+	if(my_rank==0){  
+		if(fread(&integer,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__," could not read integer ");
+	}
+
+	MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	/*Assign output pointers: */
+	*pinteger=integer;
+
+}
+
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
Index: /issm/trunk/src/c/io/ParallelFetchMat.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchMat.cpp	(revision 1)
+++ /issm/trunk/src/c/io/ParallelFetchMat.cpp	(revision 1)
@@ -0,0 +1,62 @@
+
+/*
+   ParallelFetchMat.c
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "../shared/shared.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#undef __FUNCT__
+#define __FUNCT__ "ParallelFetchMat"
+#define CLEANUP ParallelFetchMatLocalCleanup();
+
+void ParallelFetchMat(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,FILE* fid){
+
+	/*output: */
+	int matrix_rows,matrix_cols;
+	double* matrix=NULL;
+	extern int my_rank;
+	extern int num_procs;
+
+	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
+	/*numberofelements: */
+	if(my_rank==0){  
+		if(fread(&matrix_rows,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__,"could not read number of rows for matrix ");
+	}
+
+	MPI_Bcast(&matrix_rows,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	if(my_rank==0){  
+		if(fread(&matrix_cols,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__,"  could not read number of columns for matrix ");
+	}
+	MPI_Bcast(&matrix_cols,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	/*Now allocate matrix: */
+	if(matrix_rows*matrix_cols){
+		matrix=(double*)xmalloc(matrix_rows*matrix_cols*sizeof(double));
+
+		/*Read matrix on node 0, then broadcast: */
+		if(my_rank==0){  
+			if(fread(matrix,matrix_rows*matrix_cols*sizeof(double),1,fid)!=1) throw ErrorException(__FUNCT__," could not read matrix ");
+		}
+		
+		MPI_Bcast(matrix,matrix_rows*matrix_cols,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+	}
+
+
+	/*Assign output pointers: */
+	if (pmatrix)*pmatrix=matrix;
+	if (pmatrix_rows)*pmatrix_rows=matrix_rows;
+	if (pmatrix_cols)*pmatrix_cols=matrix_cols;
+
+}
+
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
Index: /issm/trunk/src/c/io/ParallelFetchScalar.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchScalar.cpp	(revision 1)
+++ /issm/trunk/src/c/io/ParallelFetchScalar.cpp	(revision 1)
@@ -0,0 +1,38 @@
+
+/*
+   ParallelFetchScalar.c
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "../shared/shared.h"
+#include "../toolkits/toolkits.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#undef __FUNCT__
+#define __FUNCT__ "ParallelFetchScalar"
+
+void ParallelFetchScalar(double* pscalar,FILE* fid){
+
+	/*output: */
+	double   scalar;
+	extern int my_rank;
+	extern int num_procs;
+
+	/*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */
+	if(my_rank==0){
+		if(fread(&scalar,sizeof(double),1,fid)!=1)throw ErrorException(__FUNCT__," could not read scalar ");
+	}
+	MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+
+	/*Assign output pointers: */
+	*pscalar=scalar;
+}
+
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
Index: /issm/trunk/src/c/io/ParallelFetchString.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchString.cpp	(revision 1)
+++ /issm/trunk/src/c/io/ParallelFetchString.cpp	(revision 1)
@@ -0,0 +1,55 @@
+
+/*
+   ParallelFetchString.c
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "stdio.h"
+#include "../shared/shared.h"
+
+#undef __FUNCT__
+#define __FUNCT__ "ParallelFetchString"
+
+void ParallelFetchString(char** pstring,FILE* fid){
+
+	/*output: */
+	char* string=NULL;
+	int   string_size;
+	extern int my_rank;
+	extern int num_procs;
+
+	/*We have to read a string from disk. First read the dimensions of the string, then the string: */
+	if(my_rank==0){  
+		if(fread(&string_size,sizeof(int),1,fid)!=1)throw ErrorException(__FUNCT__," could not read length of string ");
+	}
+
+	MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	/*Now allocate string: */
+	if(string_size){
+		string=(char*)xmalloc((string_size+1)*sizeof(char));
+		string[string_size]='\0';
+
+		/*Read string on node 0, then broadcast: */
+		if(my_rank==0){  
+			if(fread(string,string_size*sizeof(char),1,fid)!=1)throw ErrorException(__FUNCT__,"  could not read string ");
+		}
+		MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+	}
+	else{
+		string=(char*)xmalloc(sizeof(char));
+		string[0]='\0';
+	}
+
+
+	/*Assign output pointers: */
+	*pstring=string;
+}
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
Index: /issm/trunk/src/c/io/ParameterInputsInit.cpp
===================================================================
--- /issm/trunk/src/c/io/ParameterInputsInit.cpp	(revision 1)
+++ /issm/trunk/src/c/io/ParameterInputsInit.cpp	(revision 1)
@@ -0,0 +1,76 @@
+/*!\file:  ParameterInputsInits.cpp
+ * \brief inputs routine is in the io for initializing a ParameterInputs structure out of the matlab workspace.
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#ifdef _SERIAL_
+
+#include "../objects/objects.h"
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "./io.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ParameterInputsInit" 
+void  ParameterInputsInit(ParameterInputs** pinputs, const mxArray* inputhandle){
+		
+	int dummy;
+	int i;
+	int nelems;
+	int field_name_length;
+	
+	/*output: */
+	ParameterInputs* inputs=NULL;
+
+	/*First allocate ParameterInputs: */
+	inputs=NewParameterInputs();
+
+	/*Now populate the structure: */
+
+	/*How many fields? :*/
+	inputs->nfields = mxGetNumberOfFields(inputhandle); //tells us how many parameters we have 
+	
+	/*Check that we don't have a multi-dimensional structure array: */
+	nelems  = mxGetNumberOfElements(inputhandle); 
+	
+	if(nelems!=1){
+		_printf_("%s%s\n",__FUNCT__," error message: input parameter structure must be of size 1!");
+		mexErrMsgTxt(" ");
+	}
+	
+	/*Allocate fields and field names: */
+	inputs->fields=(double**)xmalloc(inputs->nfields*sizeof(double*));
+	inputs->field_names=(char**)xmalloc(inputs->nfields*sizeof(char*));
+	inputs->fields_length=(int*)xmalloc(inputs->nfields*sizeof(int));
+
+	/*Initialize, we never know: */
+	for(i=0;i<inputs->nfields;i++){
+		inputs->fields[i]=NULL;
+		inputs->field_names[i]=NULL;
+		inputs->fields_length[i]=0;
+	}
+
+
+	/*Go through input structure fields and populate our ParameterInputs object:*/
+	for (i=0;i<inputs->nfields;i++){
+		
+		/*Recover field value: */
+		FetchData((void**)&inputs->fields[i],&inputs->fields_length[i],&dummy,mxGetFieldByNumber( inputhandle,0,i),"Matrix","Mat");
+
+		/*Recover field name: */
+		const char* field_name=mxGetFieldNameByNumber(inputhandle,i);
+		field_name_length=strlen(field_name)+1;
+		inputs->field_names[i]=(char*)xmalloc(field_name_length*sizeof(char));
+		strcpy(inputs->field_names[i],field_name);
+	}
+		
+	/*Assign output poiters:*/
+	*pinputs=inputs;
+
+}
+#endif //#ifdef _SERIAL-
Index: /issm/trunk/src/c/io/SerialFetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/SerialFetchData.cpp	(revision 1)
+++ /issm/trunk/src/c/io/SerialFetchData.cpp	(revision 1)
@@ -0,0 +1,201 @@
+/*  \file * SerialFetchData.c
+ *  \brief fetch data from the matlab workspace, and pass it to the "x" code layer
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../shared/shared.h"
+
+#ifdef _SERIAL_
+
+#undef __FUNCT__ 
+#define __FUNCT__ "SerialFetchData"
+
+void SerialFetchData(void** pdata,int* pM,int* pN,const mxArray* mxdata,char* data_type,char* sub_data_type){
+
+	
+	int i,j;
+
+
+	/*output*/
+	DataSet* outdataset=NULL;
+	char*    outdataset_buffer=NULL;
+	int      outdataset_size;
+
+	double*  outmatrix;
+	Mat      outpetscmatrix;
+	double*  outmatrix_workspace=NULL;;
+	int      outmatrix_rows,outmatrix_cols;
+	int      petsc;
+
+	double*  outvector;
+	Vec      outpetscvector;
+	double*  outvector_workspace=NULL;
+	int      outvector_rows;
+
+	char*    outstring=NULL;
+	double   outscalar;
+	
+	/*First branch on the type of data. Allowed types are DataSet, Matrix, Vector, Integer, Scalar and String. Matrix and Vector will 
+	 * behave the same way on the client side, differently on the server side. : */
+	if (strcmp(data_type,"DataSet")==0){
+
+		/*First, check that our reference is a double, otherwise, error out: */
+		if (mxIsDouble(mxdata)){
+			/*We need to copy the data pointed by mxdata, so that our dataset is not actually a pointer!:*/
+			if (!mxIsEmpty(mxdata)){
+				outdataset_buffer=(char*)mxGetPr(mxdata);
+				outdataset_size=mxGetM(mxdata)*mxGetN(mxdata);
+				if(outdataset_size)outdataset=DataSetDemarshall(outdataset_buffer);
+			}
+		}
+		else{
+			if (mxIsEmpty(mxdata)){
+				/*Nothing to pick up. Just initialize pointer to NULL, and warn the server we are not uploading anything: */
+				outdataset_size=0;
+				outdataset=NULL;
+			}
+			else{
+				/*This is an error: we don't have the correct input!: */
+				throw ErrorException(__FUNCT__,"  wrong input parameter!");
+			}
+		}
+	}
+	else if (strcmp(data_type,"Matrix")==0){
+		if(mxIsEmpty(mxdata)){
+			/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+			outmatrix_rows=0;
+			outmatrix_cols=0;
+			outmatrix=NULL;
+			petsc=0;
+		}
+		else if (mxIsDouble(mxdata) ){
+
+			/*Look at the sub_type: do we want a double* matrix (Mat) or a petsc matrix (PM)?*/
+			if (sub_data_type && strcmp(sub_data_type,"Mat")==0){
+				/*Convert matlab matrix to double* matrix: */
+				MatlabMatrixToDoubleMatrix(&outmatrix,&outmatrix_rows,&outmatrix_cols,mxdata);
+				petsc=0;
+			}
+			else{
+				/*Convert matlab matrix to petsc matrix: */
+				MatlabMatrixToPetscMatrix(&outpetscmatrix,&outmatrix_rows,&outmatrix_cols,mxdata);
+				petsc=1;
+			}
+		}
+		else{
+			/*This is an error: we don't have the correct input!: */
+			throw ErrorException(__FUNCT__,"wrong input parameter");
+		}
+	}
+	else if (strcmp(data_type,"Vector")==0){
+
+		if(mxIsEmpty(mxdata)){
+			/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+			outvector_rows=0;
+			outvector=NULL;
+			petsc=0;
+		}
+		else if (mxIsDouble(mxdata) ){
+
+			/*Look at the sub_type: do we want a double* matrix (Vec) or a petsc vector (PV)?*/
+			if (sub_data_type && strcmp(sub_data_type,"Vec")==0){
+				/*Convert matlab vector to double*  vector: */
+				MatlabVectorToDoubleVector(&outvector,&outvector_rows,mxdata);
+				petsc=0;
+			}
+			else{
+				/*Convert matlab vector to petsc vector: */
+				MatlabVectorToPetscVector(&outpetscvector,&outvector_rows,mxdata);
+				petsc=1;
+			}
+		}
+		else{
+			/*This is an error: we don't have the correct input!: */
+			throw ErrorException(__FUNCT__,"wrong input parameter");
+		}
+	}
+	else if (strcmp(data_type,"String")==0){
+		/*Ok, the string should be coming directly from the matlab workspace: */
+		if (!mxIsChar(mxdata)){
+			throw ErrorException(__FUNCT__,"input data_type is not a string!");
+		}
+		else{
+			/*Recover the string:*/
+			int stringlen;
+			
+			stringlen = mxGetM(mxdata)*mxGetN(mxdata)+1;
+			outstring = (char*)xmalloc(sizeof(mxChar)*stringlen);
+			mxGetString(mxdata,outstring,stringlen);
+		}
+	}
+	else if ((strcmp(data_type,"Scalar")==0) || (strcmp(data_type,"Integer")==0)){
+		/*The scalar should be coming directly from the matlab workspace. But we are fetching a scalar, not an array of scalars, 
+		 *we  therefore don't want to dynamically allocate the scalar. Therefore, we are going to do some pointer gymnastics here. 
+		 *We assume that  pdata, which is cast as a (void**) pointer, is actually a (double*), we can do that, because void pointers
+		 *can be cast to anything!: */
+		if (!mxIsDouble(mxdata)){
+			throw ErrorException(__FUNCT__,"input data_type is not a scalar!");
+		}
+		else{
+			/*Recover the double: */
+			outscalar=mxGetScalar(mxdata);
+		}
+	}
+	else{
+		throw ErrorException(__FUNCT__,"incorrect data type data_type only \"Matrix\", \"DataSet\", \"Vector\", \"Scalar\",\"Integer\"  and \"String\" are allowed");
+	}
+
+
+	/*Assign output pointers: */
+	
+	if(strcmp(data_type,"DataSet")==0){
+		*pdata=(void*)outdataset;
+		if (pM)*pM=outdataset_size;
+		if (pN)*pN=1;
+	}
+	if(strcmp(data_type,"Matrix")==0){
+		if (petsc){
+			*pdata=(void*)outpetscmatrix;
+		}
+		else{
+			*pdata=(void*)outmatrix;
+		}
+		if (pM)*pM=outmatrix_rows;
+		if (pN)*pN=outmatrix_cols;
+	}
+	if(strcmp(data_type,"Vector")==0){
+		if(petsc){
+			*pdata=(void*)outpetscvector;
+		}
+		else{
+			*pdata=(void*)outvector;
+		}
+		if (pM)*pM=outvector_rows;
+		if (pN)*pN=1;
+	}
+	if(strcmp(data_type,"String")==0){
+		*pdata=(void*)outstring;
+		if (pM)*pM=strlen(outstring)+1;
+		if (pN)*pN=1;
+	}
+	if(strcmp(data_type,"Scalar")==0){
+		/*some pointer gymnastics: */
+		double* pdouble=(double*)pdata; /*Yes, this is not a mistake, as said before, we do not want to dynamically allocate a scalar!*/
+		*pdouble=outscalar;
+		if (pM)*pM=1;
+		if (pN)*pN=1;
+	}
+	if(strcmp(data_type,"Integer")==0){
+		/*same as Scalar, except we cast the result to an integer: */
+		int* pinteger=(int*)pdata; /*Yes, this is not a mistake, as said before, we do not want to dynamically allocate a scalar, or an integer!*/
+		*pinteger=(int)outscalar; /*cast the double to an integer*/
+		if (pM)*pM=1;
+		if (pN)*pN=1;
+	}
+}
+#endif //#ifndef _PARALLEL_
Index: /issm/trunk/src/c/io/SerialWriteData.cpp
===================================================================
--- /issm/trunk/src/c/io/SerialWriteData.cpp	(revision 1)
+++ /issm/trunk/src/c/io/SerialWriteData.cpp	(revision 1)
@@ -0,0 +1,151 @@
+/*  \file * SerialWriteData.c
+ *  \brief write data from the "x" code layer to the matlab workspace
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./io.h"
+#include "../DataSet/DataSet.h"
+#include "../toolkits/toolkits.h"
+#include "../include/macros.h"
+#include "../shared/shared.h"
+
+
+#ifdef _SERIAL_
+
+#undef __FUNCT__ 
+#define __FUNCT__ "SerialWriteData"
+
+
+void SerialWriteData(mxArray** pdataref,void* data,int M, int N,char* data_type,char* sub_data_type){
+
+	int n;
+
+	/*Dataset: */
+	DataSet* dataset=NULL;
+	char* marshalled_dataset=NULL;
+	int   marshalled_dataset_size;
+
+	/*Matrix: */
+	Mat        matrix;
+	MatType    type;
+	
+	/*Vector: */
+	Vec        vector;
+
+	/*Scalar: */
+	double* pscalar=NULL;
+	double  scalar;
+
+	/*Integer: */
+	int* pinteger=NULL;
+	int  integer;
+
+	/*String: */
+	char* string=NULL;
+
+	/*Matlab arrays: */
+	mxArray* dataref=NULL;
+
+	/*Branch on the type of data:*/
+	if (strcmp(data_type,"DataSet")==0){
+	
+		if(data){
+			/* marshall the dataset: */
+			dataset=(DataSet*)data;
+
+			marshalled_dataset=dataset->Marshall();
+			marshalled_dataset_size=dataset->MarshallSize();
+			
+			dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+			mxSetM(dataref,(mwSize)(marshalled_dataset_size/sizeof(double)));
+			mxSetN(dataref,(mwSize)1);
+			mxSetPr(dataref,(double*)marshalled_dataset);	
+		}
+		else{
+			/* return empty matrix: */
+			dataref=mxCreateDoubleMatrix(0,0,mxREAL);
+		}
+		*pdataref=dataref;
+	}
+	else if (strcmp(data_type,"Matrix")==0){
+
+		if(data){
+		
+			if (sub_data_type && strcmp(sub_data_type,"Mat")==0){
+				
+				/*data is a double* pointer. Copy into a matrix: */
+				dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+				mxSetM(dataref,(mwSize)M);
+				mxSetN(dataref,(mwSize)N);
+				mxSetPr(dataref,(double*)data);
+			}
+			else{
+
+				/*cast  matrix type: */
+				matrix=(Mat)data;
+
+				/*call toolkit routine: */
+				PetscMatrixToMatlabMatrix(&dataref,matrix);
+			}
+
+		}
+		else{
+			dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+		}
+		*pdataref=dataref;
+	}
+	else if (strcmp(data_type,"Vector")==0){
+		
+		if(data){
+
+			if (sub_data_type && strcmp(sub_data_type,"Vec")==0){
+				
+				/*data is a double* pointer. Copy into a vector: */
+				dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+				mxSetM(dataref,(mwSize)M);
+				mxSetN(dataref,(mwSize)1);
+				mxSetPr(dataref,(double*)data);
+			}
+			else{
+
+		
+				/*cast  vector type: */
+				vector=(Vec)data;
+
+				/*call toolkit routine: */
+				PetscVectorToMatlabVector(&dataref,vector);
+			}
+		}
+		else{
+			dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+		}
+		*pdataref=dataref;
+	}
+	else if (strcmp(data_type,"Scalar")==0){
+		/*Get scalar: */
+		pscalar=(double*)data;
+		scalar=*pscalar;
+		
+		*pdataref=mxCreateDoubleScalar(scalar);
+	}
+	else if (strcmp(data_type,"Integer")==0){
+		/*Integer is pointed to by data: */
+		pinteger=(int*)data;
+		integer=*pinteger;
+		*pdataref=mxCreateDoubleScalar((double)integer);
+	}
+	else if (strcmp(data_type,"String")==0){
+		/*String is pointed to by data: */
+		string=(char*)data;
+		*pdataref=mxCreateString(string);
+	}
+	else{
+		throw ErrorException(__FUNCT__,exprintf("%s%s%s","incorrect data type ",data_type," .Only \"Matrix\",\"DataSet\",\"String\",\"Scalar\", or \"Integer\"  are allowed."));
+	}
+}
+#endif //#ifdef _SERIAL_
Index: /issm/trunk/src/c/io/WriteData.cpp
===================================================================
--- /issm/trunk/src/c/io/WriteData.cpp	(revision 1)
+++ /issm/trunk/src/c/io/WriteData.cpp	(revision 1)
@@ -0,0 +1,30 @@
+/* \file WriteData.c:
+ * \brief: general interface for writing data
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../include/macros.h"
+#include "./shared/shared.h"
+#include "./io.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "WriteData"
+
+#ifdef _SERIAL_
+
+#include <mex.h>
+void WriteData(mxArray** pdataref,void* data,int M,int N,char* data_type,char* sub_data_type){
+	
+	SerialWriteData(pdataref,data,M,N,data_type,sub_data_type);
+}
+#else
+void WriteData(int* pdummy,void* data,char* data_type){
+	
+	/*In parallel mode, WriteData is not used, instead we access the data directly through pointers in the solution sequences. */
+}
+#endif
Index: /issm/trunk/src/c/io/WriteDataToDisk.cpp
===================================================================
--- /issm/trunk/src/c/io/WriteDataToDisk.cpp	(revision 1)
+++ /issm/trunk/src/c/io/WriteDataToDisk.cpp	(revision 1)
@@ -0,0 +1,72 @@
+/*!\file:  WriteDataToDisk.cpp
+ * \brief
+ */ 
+
+#undef __FUNCT__
+#define __FUNCT__ "WriteDataToDisk"
+
+#include "stdio.h"
+#include "string.h"
+#include "../include/macros.h"
+#include "../shared/shared.h"
+
+void WriteDataToDisk(void* data,int* pM,int* pN,char* datatype,FILE* fid){
+	
+	/*Pendant of the ISSM WriteData routine: */
+
+	double datatype_code;
+	
+	/*string:*/
+	char*  string=NULL;
+	double string_size=0;
+
+	/*matrix: */
+	double* matrix=NULL;
+	double  M,N;
+
+	/*integer:*/
+	double  integer;
+
+	/*scalar:*/
+	double  scalar;
+
+	if (strcmp(datatype,"String")==0){
+		string=(char*)data;
+		string_size=(double)((strlen(string)+1)*sizeof(char));
+		datatype_code=0;
+
+		fwrite(&datatype_code,sizeof(double),1,fid);
+		fwrite(&string_size,sizeof(double),1,fid);
+		fwrite(string,(int)string_size,1,fid);
+	}
+	else if (strcmp(datatype,"Mat")==0){
+		matrix=(double*)data;
+		M=*pM;
+		N=*pN;
+		datatype_code=1;
+
+		fwrite(&datatype_code,sizeof(double),1,fid);
+		fwrite(&M,sizeof(double),1,fid);
+		fwrite(&N,sizeof(double),1,fid);
+		fwrite(matrix,(int)(M*N*sizeof(double)),1,fid);
+
+	}
+	else if (strcmp(datatype,"Integer")==0){
+		integer=(double)*((int*)data);
+		datatype_code=2;
+		fwrite(&datatype_code,sizeof(double),1,fid);
+		fwrite(&integer,sizeof(double),1,fid);
+
+	}
+	else if (strcmp(datatype,"Scalar")==0){
+		
+		scalar=(double)(*(double*)data);
+		datatype_code=3;
+		fwrite(&datatype_code,sizeof(double),1,fid);
+		fwrite(&scalar,sizeof(double),1,fid);
+
+	}
+	else{
+		_printf_("%s%s\n",__FUNCT__," error message: data type not supported yet!");
+	}
+}
Index: /issm/trunk/src/c/io/WriteNodeSets.cpp
===================================================================
--- /issm/trunk/src/c/io/WriteNodeSets.cpp	(revision 1)
+++ /issm/trunk/src/c/io/WriteNodeSets.cpp	(revision 1)
@@ -0,0 +1,127 @@
+/* \file WriteNodeSets.c:
+ * \brief: interface for writing nodesets to matlab workspace
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#undef __FUNCT__ 
+#define __FUNCT__  "WriteNodeSets"
+
+#ifdef _SERIAL_
+#include <mex.h>
+
+#include "../objects/NodeSets.h"
+#include "./io.h"
+#include "../shared/shared.h"
+
+void WriteNodeSets(DataHandle* pdataref,NodeSets* nodesets){
+
+	/*output: */
+	mxArray* dataref=NULL;
+	int gsize=0;
+	int msize=0;
+	int nsize=0;
+	int fsize=0;
+	int ssize=0;
+	mwSize nfields=9;
+	const	char*	fnames[nfields];
+	mwSize		onebyone[2] = {1,1};
+	mwSize		ndim=2;
+
+	
+	/*intermediary: */
+	double* pv_m=NULL;
+	double* pv_n=NULL;
+	double* pv_f=NULL;
+	double* pv_s=NULL;
+	mxArray*    field=NULL;
+
+	/*Recover data from the nodesets class: */
+	gsize=nodesets->GetGSize();
+	msize=nodesets->GetMSize();
+	nsize=nodesets->GetNSize();
+	fsize=nodesets->GetFSize();
+	ssize=nodesets->GetSSize();
+
+	if(msize){
+		pv_m=(double*)xmalloc(msize*sizeof(double));
+		memcpy(pv_m,nodesets->GetPV_M(),msize*sizeof(double));
+	}
+	if(nsize){
+		pv_n=(double*)xmalloc(nsize*sizeof(double));
+		memcpy(pv_n,nodesets->GetPV_N(),nsize*sizeof(double));
+	}
+	if(fsize){
+		pv_f=(double*)xmalloc(fsize*sizeof(double));
+		memcpy(pv_f,nodesets->GetPV_F(),fsize*sizeof(double));
+	}
+	if(ssize){
+		pv_s=(double*)xmalloc(ssize*sizeof(double));
+		memcpy(pv_s,nodesets->GetPV_S(),ssize*sizeof(double));
+	}
+
+	/*Build structure in matlab workspace with all these fields: */
+	fnames[0] = "gsize";
+	fnames[1] = "msize";
+	fnames[2] = "nsize";
+	fnames[3] = "fsize";
+	fnames[4] = "ssize";
+	fnames[5] = "pv_m";
+	fnames[6] = "pv_n";
+	fnames[7] = "pv_f";
+	fnames[8] = "pv_s";
+
+	dataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);
+	
+	mxSetField( dataref, 0, "gsize",mxCreateDoubleScalar((double)gsize));
+	mxSetField( dataref, 0, "msize",mxCreateDoubleScalar((double)msize));
+	mxSetField( dataref, 0, "nsize",mxCreateDoubleScalar((double)nsize));
+	mxSetField( dataref, 0, "fsize",mxCreateDoubleScalar((double)fsize));
+	mxSetField( dataref, 0, "ssize",mxCreateDoubleScalar((double)ssize));
+
+	if(msize){
+		field = mxCreateDoubleMatrix(0,0,mxREAL);
+		mxSetM(field,msize); mxSetN(field,1); mxSetPr(field,pv_m);
+	}
+	else{
+		field = mxCreateDoubleMatrix(0,0,mxREAL);
+	}
+	mxSetField( dataref, 0, "pv_m",field);
+
+	if(nsize){
+		field = mxCreateDoubleMatrix(0,0,mxREAL);
+		mxSetM(field,nsize); mxSetN(field,1); mxSetPr(field,pv_n);
+	}
+	else{
+		field = mxCreateDoubleMatrix(0,0,mxREAL);
+	}
+	mxSetField( dataref, 0, "pv_n",field);
+
+	
+	if(fsize){
+		field = mxCreateDoubleMatrix(0,0,mxREAL);
+		mxSetM(field,fsize); mxSetN(field,1); mxSetPr(field,pv_f);
+	}
+	else{
+		field = mxCreateDoubleMatrix(0,0,mxREAL);
+	}
+	mxSetField( dataref, 0, "pv_f",field);
+	
+	if(ssize){
+		field = mxCreateDoubleMatrix(0,0,mxREAL);
+		mxSetM(field,ssize); mxSetN(field,1); mxSetPr(field,pv_s);
+	}
+	else{
+		field = mxCreateDoubleMatrix(0,0,mxREAL);
+	}
+	mxSetField( dataref, 0, "pv_s",field);
+
+	/*Assign output pointers:*/
+	*pdataref=dataref;
+
+}
+#endif
Index: /issm/trunk/src/c/io/WriteParams.cpp
===================================================================
--- /issm/trunk/src/c/io/WriteParams.cpp	(revision 1)
+++ /issm/trunk/src/c/io/WriteParams.cpp	(revision 1)
@@ -0,0 +1,136 @@
+/* \file WriteParams.c:
+ * \brief: interface for writing parameters dataset into a matlab structure
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+#ifdef _SERIAL_
+#include <mex.h>
+
+#include "../objects/Param.h"
+#include "./io.h"
+#include "../shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "WriteParams"
+void WriteParams(DataHandle* pdataref,DataSet* parameters){
+
+	/*output: */
+	mxArray* dataref=NULL;
+	mwSize nfields;
+	const	char**	fnames=NULL;
+	mwSize		onebyone[2] = {1,1};
+	mwSize		ndim=2;
+	mxArray*    pfield=NULL;
+
+	/*intermediary: */
+	int         i;
+	mxArray*    field=NULL;
+	Param*      param=NULL;
+	int         integer;
+	double      ddouble;
+	char*       string;
+	double*     doublevec=NULL;
+	double*     doublemat=NULL;
+	Mat         mat=NULL;
+	Vec         vec=NULL;
+	double*     serial_vec=NULL;
+	double*     serial_mat=NULL;
+	mwSize      M,N;
+
+	/*Recover data from the parameters dataset: */
+	nfields=(mwSize)parameters->Size();
+
+	fnames=(const char**)xmalloc(nfields*sizeof(char*));
+	
+	/*Build structure in matlab workspace with all the parameter fields: */
+	for(i=0;i<nfields;i++){
+		param=(Param*)parameters->GetObjectByOffset(i);
+		fnames[i]=(const char*)xmalloc((strlen(param->GetParameterName())+1)*sizeof(char));
+		strcpy((char*)fnames[i],param->GetParameterName());
+	}
+	/*Initialize structure: */
+	dataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);
+
+	/*Fill each field: */
+	for(i=0;i<nfields;i++){
+
+		param=(Param*)parameters->GetObjectByOffset(i);
+		
+		switch(param->GetType()){
+			case INTEGER:
+				param->GetParameterValue((void*)&integer);
+				mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)integer));
+				break;
+
+			case DOUBLE:
+				param->GetParameterValue((void*)&ddouble);
+				mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)ddouble));
+				break;
+
+			case STRING:
+				param->GetParameterValue((void*)&string);
+				mxSetField( dataref, 0, param->GetParameterName(),mxCreateString(string));
+				break;
+
+			case DOUBLEVEC:
+				param->GetParameterValue((void*)&doublevec);
+				M=param->GetM();
+				pfield=mxCreateDoubleMatrix(0,0,mxREAL);
+				mxSetM(pfield,M);
+				mxSetN(pfield,1);
+				mxSetPr(pfield,doublevec);
+				mxSetField( dataref, 0, param->GetParameterName(),pfield);
+				break;
+
+			case DOUBLEMAT:
+				param->GetParameterValue((void*)&doublemat);
+				M=param->GetM();
+				N=param->GetN();
+				pfield=mxCreateDoubleMatrix(0,0,mxREAL);
+				mxSetM(pfield,M);
+				mxSetN(pfield,N);
+				mxSetPr(pfield,doublemat);
+				mxSetField( dataref, 0, param->GetParameterName(),pfield);
+				break;
+		
+			case PETSCVEC:
+				param->GetParameterValue((void*)&vec);
+				VecToMPISerial(&serial_vec,vec);
+				VecFree(&vec);
+				M=param->GetM();
+				pfield=mxCreateDoubleMatrix(0,0,mxREAL);
+				mxSetM(pfield,M);
+				mxSetN(pfield,1);
+				mxSetPr(pfield,serial_vec);
+				mxSetField( dataref, 0, param->GetParameterName(),pfield);
+				break;
+		
+			case PETSCMAT:
+				param->GetParameterValue((void*)&mat);
+				MatToSerial(&serial_mat,mat);
+				MatFree(&mat);
+				M=param->GetM();
+				N=param->GetN();
+				pfield=mxCreateDoubleMatrix(0,0,mxREAL);
+				mxSetM(pfield,M);
+				mxSetN(pfield,N);
+				mxSetPr(pfield,serial_mat);
+				mxSetField( dataref, 0, param->GetParameterName(),pfield);
+				break;
+			default:
+				throw ErrorException(__FUNCT__,exprintf("%s%i","unknown parameter type: ",param->GetType()));
+				break;
+		}
+	}
+
+	/*Assign output pointers:*/
+	*pdataref=dataref;
+
+}
+#endif
Index: /issm/trunk/src/c/io/io.h
===================================================================
--- /issm/trunk/src/c/io/io.h	(revision 1)
+++ /issm/trunk/src/c/io/io.h	(revision 1)
@@ -0,0 +1,46 @@
+/*\file io.h
+ *\brief: I/O for ISSM
+ */
+
+#ifndef IO_H_
+#define IO_H_
+
+#include "../objects/NodeSets.h"
+#include "../DataSet/DataSet.h"
+
+/*Define abstract type for I/O: */
+#ifdef _SERIAL_
+#include <mex.h>
+typedef const mxArray* ConstDataHandle;  //serially, we are reading data from a matlab array.
+typedef mxArray* DataHandle;  
+#else 
+typedef FILE* ConstDataHandle; //in parallel, we are reading data from a file.
+typedef FILE* DataHandle; 
+#endif
+
+
+void FetchData(void** pdata,int* pM,int* pN,ConstDataHandle data_handle,char* data_type,char* sub_data_type);
+void WriteData(DataHandle* pdata_handle,void* data,int M,int N,char* data_type,char* sub_data_type);
+void ModelFetchData(void** pdata,int* pM,int* pN,ConstDataHandle model_handle,char* data_name,char* data_type,char* sub_data_type);
+
+/*Serial: */
+#ifdef _SERIAL_
+void SerialFetchData(void** pdata,int* pM,int* pN,ConstDataHandle data_handle,char* data_type,char* sub_data_type);
+void SerialWriteData(DataHandle* pdata_handle,void* data,int M,int N,char* data_type,char* sub_data_type);
+void FetchNodeSets(NodeSets** pnodesets,ConstDataHandle dataref);
+void WriteNodeSets(DataHandle* pdataref,NodeSets* nodesets);
+void WriteParams(DataHandle* pdataref,DataSet* parameters);
+#endif
+
+/*Parallel: */
+#ifdef _PARALLEL_
+void ParallelFetchData(void** pdata,int* pM,int* pN,DataHandle data_handle, char* data_type,char* sub_data_type);
+void ParallelFetchMat(double** pdata,int* pM,int* pN,DataHandle data_handle);
+void ParallelFetchString(char** pdata,DataHandle data_handle);
+void ParallelFetchScalar(double* pdata,DataHandle data_handle);
+void ParallelFetchInteger(int* pdata,DataHandle data_handle);
+void WriteDataToDisk(void* data,int* pM,int* pN,char* datatype,FILE* fid);
+#endif
+
+#endif	/* _IMDB_H */
+
Index: /issm/trunk/src/c/issm.h
===================================================================
--- /issm/trunk/src/c/issm.h	(revision 1)
+++ /issm/trunk/src/c/issm.h	(revision 1)
@@ -0,0 +1,48 @@
+/*! \file issm.h: 
+ *  \brief header file for all the ISSM library. 
+ *  This header file should be included for the parallel binaries, or any 
+ *  matlab mex module.
+ */
+
+#ifndef _ISSM_H_
+#define _ISSM_H_
+
+#include "DataSet/DataSet.h"
+#include "io/io.h"
+#include "EnumDefinitions/EnumDefinitions.h"
+#include "toolkits/toolkits.h"
+#include "objects/objects.h"
+#include "shared/shared.h"
+#include "include/macros.h"
+#include "include/globals.h"
+
+/*Modules: */
+#include "./ModelProcessorx/ModelProcessorx.h"
+#include "./Dofx/Dofx.h"
+#include "./Dux/Dux.h"
+#include "./SpcNodesx/SpcNodesx.h"
+#include "./MpcNodesx/MpcNodesx.h"
+#include "./ContourToMeshx/ContourToMeshx.h"
+#include "./DataInterpx/DataInterpx.h"
+#include "./HoleFillerx/HoleFillerx.h"
+#include "./MeshPartitionx/MeshPartitionx.h"
+#include "./BuildNodeSetsx/BuildNodeSetsx.h"
+#include "./Reducevectorgtosx/Reducevectorgtosx.h"
+#include "./NormalizeConstraintsx/NormalizeConstraintsx.h"
+#include "./ConfigureObjectsx/ConfigureObjectsx.h"
+#include "./SystemMatricesx/SystemMatricesx.h"
+#include "./UpdateFromInputsx/UpdateFromInputsx.h"
+#include "./PenaltySystemMatricesx/PenaltySystemMatricesx.h"
+#include "./Reducematrixfromgtofx/Reducematrixfromgtofx.h"
+#include "./Reduceloadfromgtofx/Reduceloadfromgtofx.h"
+#include "./Solverx/Solverx.h"
+#include "./Mergesolutionfromftogx/Mergesolutionfromftogx.h"
+#include "./PenaltyConstraintsx/PenaltyConstraintsx.h"
+#include "./ProcessParamsx/ProcessParamsx.h"
+#include "./Gradjx/Gradjx.h"
+#include "./Orthx/Orthx.h"
+#include "./Misfitx/Misfitx.h"
+#include "./ControlConstrainx/ControlConstrainx.h"
+
+
+#endif
Index: /issm/trunk/src/c/objects/Contour.cpp
===================================================================
--- /issm/trunk/src/c/objects/Contour.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Contour.cpp	(revision 1)
@@ -0,0 +1,24 @@
+/*! \file Contour.c
+ *  \sa Contour.h
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./Contour.h"
+#include "../include/macros.h"
+#include "../shared/Matlab/matlabshared.h"
+
+void ContourEcho(Contour* contour){
+
+	int i;
+
+	_printf_("Number of grids in contour: %i\n",contour->nods);
+	_printf_("Grid coordinates: \n");
+	for (i=0;i<contour->nods;i++){
+		_printf_("%lf %lf\n",*(contour->x+i),*(contour->y+i));
+	}
+}
Index: /issm/trunk/src/c/objects/Contour.h
===================================================================
--- /issm/trunk/src/c/objects/Contour.h	(revision 1)
+++ /issm/trunk/src/c/objects/Contour.h	(revision 1)
@@ -0,0 +1,19 @@
+/*! \file Contour.h
+ *  \brief structure object to hold contour profiles from an 
+ *  Argus domain outline file, or from any cad system.
+ */
+
+#ifndef CONTOUR_H_
+#define CONTOUR_H_
+
+/*!Contour declaration: */
+struct Contour {
+	int	nods;
+	double* x;
+	double* y;
+};
+
+/*!Methods: */
+void ContourEcho(Contour* contour);
+
+#endif  /* CONTOUR_H_ */
Index: /issm/trunk/src/c/objects/Element.cpp
===================================================================
--- /issm/trunk/src/c/objects/Element.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Element.cpp	(revision 1)
@@ -0,0 +1,18 @@
+/*!\file: Element.cpp 
+ * \brief: implementation of the Enum routine, which is the only non-virtual routine from 
+ * the Object derived class Element.
+ */ 
+
+
+#include "./Object.h"
+#include "./Element.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "stdio.h"
+#include "../DataSet/DataSet.h"
+
+int Element::Enum(void){
+
+	return ElementEnum();
+}
+		
+
Index: /issm/trunk/src/c/objects/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Element.h	(revision 1)
+++ /issm/trunk/src/c/objects/Element.h	(revision 1)
@@ -0,0 +1,47 @@
+/*!\file:  Element.h
+ * \brief abstract class for Element object
+ * This class is a place holder for the Tria and the Penta elements. 
+ * It is derived from Element, so DataSets can contain them.
+ */ 
+
+
+#ifndef _ELEMENT_H_
+#define _ELEMENT_H_
+
+#include "./Object.h"
+#include "./ParameterInputs.h"
+#include "../toolkits/toolkits.h"
+#include "./Node.h"
+#include "./Matpar.h"
+
+class Element: public Object{
+
+	public: 
+		virtual       ~Element(){};
+		virtual void  Echo()=0;
+		virtual int   GetId()=0;
+		virtual int   MyRank()=0;
+		virtual void  Marshall(char** pmarshalled_dataset)=0;
+		virtual int   MarshallSize()=0;
+		virtual char* GetName()=0;
+		virtual void  Demarshall(char** pmarshalled_dataset)=0;
+		virtual void  Configure(void* loads,void* nodes,void* materials)=0;
+		virtual void  CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type)=0;
+		virtual void  CreatePVector(Vec pg, ParameterInputs* inputs, int analysis_type)=0;
+		virtual void  UpdateFromInputs(ParameterInputs* inputs)=0;
+		virtual void  GetNodes(Node** nodes)=0;
+		virtual Matpar* GetMatPar()=0;
+		virtual int   GetShelf()=0; 
+		virtual int   GetOnBed()=0;
+		virtual void          GetThicknessList(double* thickness_list)=0;
+		virtual void          GetBedList(double* bed_list)=0;
+		virtual void  Du(Vec du_g,double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type)=0;
+		virtual void  Gradj(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type,char* control_type)=0;
+		virtual void  GradjDrag(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type)=0;
+		virtual void  GradjB(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type)=0;
+        virtual double Misfit(double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type)=0;
+
+		int           Enum();
+		
+};
+#endif
Index: /issm/trunk/src/c/objects/FemModel.h
===================================================================
--- /issm/trunk/src/c/objects/FemModel.h	(revision 1)
+++ /issm/trunk/src/c/objects/FemModel.h	(revision 1)
@@ -0,0 +1,31 @@
+/*
+ * FemModel.h: 
+ */
+
+#ifndef FEMMODEL_H_
+#define FEMMODEL_H_
+
+#include "../toolkits/toolkits.h"
+#include "../DataSet/DataSet.h"
+
+struct FemModel {
+	
+	DataSet*            elements;
+	DataSet*            nodes;
+	DataSet*            constraints;
+	DataSet*            loads;
+	DataSet*            materials;
+	DataSet*            parameters;
+
+	Vec                 partition;
+	Vec                 tpartition;
+	Vec                 yg;
+	Mat                 Rmg;
+	NodeSets*           nodesets;
+	Vec                 ys;
+	Vec                 ys0;
+	Mat                 Gmn;
+
+};
+
+#endif
Index: /issm/trunk/src/c/objects/Friction.cpp
===================================================================
--- /issm/trunk/src/c/objects/Friction.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Friction.cpp	(revision 1)
@@ -0,0 +1,139 @@
+/*!\file: Friction.cpp
+ * \brief: wrapper for all friction parameters
+ */ 
+
+#include "./Friction.h"
+#include "../shared/shared.h"
+#include "../include/typedefs.h"
+
+/*--------------------------------------------------
+	NewFriction
+  --------------------------------------------------*/
+
+Friction* NewFriction(void)
+{
+	/* create a new Friction object */
+
+	return (Friction*)xmalloc(sizeof(Friction));
+}
+
+
+/*--------------------------------------------------
+	FrictionInit
+  --------------------------------------------------*/
+
+int FrictionInit(Friction* friction)
+{
+	friction->element_type=NULL;
+	friction->gravity=UNDEF;
+	friction->rho_ice=UNDEF;
+	friction->rho_water=UNDEF;
+	friction->K=NULL; 
+	friction->bed=NULL;
+	friction->thickness=NULL;
+	friction->velocities=NULL;
+	friction->p=UNDEF;
+	friction->q=UNDEF;
+	
+	return 1;
+}
+
+/*--------------------------------------------------
+	DeleteFriction
+  --------------------------------------------------*/
+
+void DeleteFriction(Friction** pfriction)
+{
+	Friction* friction = *pfriction;
+
+	/*Just  erase element_type: */
+	xfree((void**)&friction->element_type);
+
+	/*Erase entire structure: */
+	xfree((void**)pfriction);
+}
+
+
+/*--------------------------------------------------
+	FrictionGetAlpha2
+  --------------------------------------------------*/
+void  FrictionGetAlpha2(double* alpha2, Friction* friction){
+
+	/*This routine calculates the basal friction coefficient 
+	alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p*
+	alpha2 is assumed to be double[3]: */
+
+	/*diverse: */
+	int     i;
+	int     numgrids=3;
+	double  Neff[numgrids];
+	double  r,s;
+	double  velocity_x[numgrids];
+	double  velocity_y[numgrids];
+	double  velocity_mag[numgrids];
+
+	//compute r and q coefficients: */
+	r=friction->q/friction->p;
+	s=1./friction->p;
+		
+	//From bed and thickness, compute effective pressure when drag is viscous:
+	for(i=0;i<numgrids;i++){
+
+		Neff[i]=friction->gravity*(friction->rho_ice*friction->thickness[i]+friction->rho_water*friction->bed[i]);
+
+		/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
+		the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
+		for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
+		replace it by Neff=0 (ie, equival it to an ice shelf)*/
+		if (Neff[i]<0)Neff[i]=0;
+
+		//We need the velocity magnitude to evaluate the basal stress:
+		velocity_x[i]=*(friction->velocities+2*i+0); //velocities of size numgridsx2
+		velocity_y[i]=*(friction->velocities+2*i+1);
+		velocity_mag[i]=sqrt(pow(velocity_x[i],2)+pow(velocity_y[i],2));
+	
+		alpha2[i]=pow(friction->K[i],2)*pow(Neff[i],r)*pow(velocity_mag[i],(s-1));
+	}
+}
+
+/*--------------------------------------------------
+	FrictionGetAlphaComplement
+  --------------------------------------------------*/
+void  FrictionGetAlphaComplement(double* alpha_complement, Friction* friction){
+
+	/* FrictionGetAlpha2 computes alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p. 
+	 * FrictionGetAlphaComplement is used in control methods on drag, and it computes: 
+	 * alpha_complement= Neff ^r * vel ^s*/
+
+	/*diverse: */
+	int     i;
+	int     numgrids=3;
+	double  Neff[numgrids];
+	double  r,s;
+	double  velocity_x[numgrids];
+	double  velocity_y[numgrids];
+	double  velocity_mag[numgrids];
+
+	//compute r and q coefficients: */
+	r=friction->q/friction->p;
+	s=1./friction->p;
+		
+	//From bed and thickness, compute effective pressure when drag is viscous:
+	for(i=0;i<numgrids;i++){
+
+		Neff[i]=friction->gravity*(friction->rho_ice*friction->thickness[i]+friction->rho_water*friction->bed[i]);
+
+		/*If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
+		the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
+		for friction should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
+		replace it by Neff=0 (ie, equival it to an ice shelf)*/
+		if (Neff[i]<0)Neff[i]=0;
+
+		//We need the velocity magnitude to evaluate the basal stress:
+		velocity_x[i]=*(friction->velocities+2*i+0); //velocities of size numgridsx2
+		velocity_y[i]=*(friction->velocities+2*i+1);
+		velocity_mag[i]=sqrt(pow(velocity_x[i],2)+pow(velocity_y[i],2));
+	
+		alpha_complement[i]=pow(Neff[i],r)*pow(velocity_mag[i],(s-1));
+	}
+}
Index: /issm/trunk/src/c/objects/Friction.h
===================================================================
--- /issm/trunk/src/c/objects/Friction.h	(revision 1)
+++ /issm/trunk/src/c/objects/Friction.h	(revision 1)
@@ -0,0 +1,34 @@
+/*! \file Friction.h
+ *  \brief Friction object, interface, declaration
+ */
+
+#ifndef _FRICTION_H
+#define _FRICTION_H
+
+/*!Friction declaration: */
+struct Friction {
+
+	char*   element_type;
+	double  gravity;
+	double  rho_ice;
+	double  rho_water;
+	double* K;
+	double* bed;
+	double* thickness;
+	double* velocities;
+	double  p;
+	double  q;
+
+};
+
+
+/* creation, initialisation: */
+
+	Friction*	NewFriction(void);
+	int		    FrictionInit(Friction* friction);
+	void        DeleteFriction(Friction** pfriction);
+	void  FrictionGetAlpha2(double* alpha2, Friction* friction);
+	void  FrictionGetAlphaComplement(double* alpha_complement, Friction* friction);
+
+#endif  /* _FRICTION_H */
+
Index: /issm/trunk/src/c/objects/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Icefront.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Icefront.cpp	(revision 1)
@@ -0,0 +1,522 @@
+/*!\file Icefront.c
+ * \brief: implementation of the Icefront object
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../shared/shared.h"
+#include "../include/typedefs.h"
+#include "../include/macros.h"
+#include "./objects.h"
+
+		
+Icefront::Icefront(){
+	return;
+}
+
+Icefront::Icefront(char icefront_type[ICEFRONTSTRING],int icefront_sid, int icefront_mparid, int icefront_eid, int icefront_element_type, 
+		int icefront_node_ids[MAX_ICEFRONT_GRIDS],double icefront_h[MAX_ICEFRONT_GRIDS],double	icefront_b[MAX_ICEFRONT_GRIDS]){
+
+	int i;
+	
+	strcpy(type,icefront_type);
+	sid=icefront_sid;
+	
+	mparid=icefront_mparid;
+	
+	eid=icefront_eid;
+	element_type=icefront_element_type;
+	for(i=0;i<MAX_ICEFRONT_GRIDS;i++){
+		node_ids[i]=icefront_node_ids[i];
+		node_offsets[i]=UNDEF;
+		nodes[i]=NULL;
+		h[i]=icefront_h[i];
+		b[i]=icefront_b[i];
+	}
+	
+	matpar=NULL;
+	matpar_offset=UNDEF;
+
+	element=NULL;
+	element_offset=UNDEF;
+
+	return;
+}
+
+Icefront::~Icefront(){
+	return;
+}
+		
+void Icefront::Echo(void){
+
+	int i;
+	
+	printf("Icefront:\n");
+	printf("   type: %s\n",type);
+	printf("   sid: %i\n",sid);
+	
+	printf("   mparid: %i\n",mparid);
+	printf("   matpar_offset: %i\n",matpar_offset);
+	printf("   matpar: \n");
+	if(matpar)matpar->Echo();
+	
+	printf("   element_type: %i\n",element_type);
+	printf("   eid: %i\n",eid);
+	printf("   element_offset: %i\n",eid);
+	printf("   element\n");
+	if(element)element->Echo();
+		
+	if (strcmp(type,"segment")==0){
+		printf("   node_ids=[%i,%i]\n",node_ids[0],node_ids[1]);
+		printf("   node_offsets=[%i,%i]\n",node_offsets[0],node_offsets[1]);
+		printf("   h=[%g,%g]\n",h[0],h[1]);
+		printf("   b=[%g,%g]\n",b[0],b[1]);
+		for(i=0;i<2;i++){
+			if(nodes[i])nodes[i]->Echo();
+		}
+	}
+	else{
+		printf("   node_ids=[%i,%i,%i,%i]\n",node_ids[0],node_ids[1],node_ids[2],node_ids[3]);
+		printf("   node_offsets=[%i,%i]\n",node_offsets[0],node_offsets[1],node_offsets[2],node_offsets[3]);
+		printf("   h=[%g,%g,%g,%g]\n",h[0],h[1],h[2],h[3]);
+		printf("   b=[%g,%g,%g,%g]\n",b[0],b[1],b[2],b[3]);
+		for(i=0;i<4;i++){
+			if(nodes[i])nodes[i]->Echo();
+		}
+	}
+
+	return;
+}
+		
+void  Icefront::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Icefront: */
+	enum_type=IcefrontEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Icefront data: */
+	memcpy(marshalled_dataset,&type,sizeof(type));marshalled_dataset+=sizeof(type);
+	memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
+	
+	memcpy(marshalled_dataset,&mparid,sizeof(mparid));marshalled_dataset+=sizeof(mparid);
+	memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	
+	memcpy(marshalled_dataset,&element_type,sizeof(element_type));marshalled_dataset+=sizeof(element_type);
+	memcpy(marshalled_dataset,&eid,sizeof(eid));marshalled_dataset+=sizeof(eid);
+	memcpy(marshalled_dataset,&element_offset,sizeof(element_offset));marshalled_dataset+=sizeof(element_offset);
+	
+	memcpy(marshalled_dataset,&node_ids,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
+	memcpy(marshalled_dataset,&node_offsets,sizeof(node_offsets));marshalled_dataset+=sizeof(node_offsets);
+	
+	memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
+	memcpy(marshalled_dataset,&b,sizeof(b));marshalled_dataset+=sizeof(b);
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Icefront::MarshallSize(){
+
+	return sizeof(type)+
+		sizeof(sid)+
+		sizeof(mparid)+
+		sizeof(matpar_offset)+
+		sizeof(eid)+
+		sizeof(element_offset)+
+		sizeof(element_type)+
+		sizeof(node_ids)+
+		sizeof(node_offsets)+
+		sizeof(h)+
+		sizeof(b)+
+		sizeof(int); //sizeof(int) for enum type
+}
+
+char* Icefront::GetName(void){
+	return "icefront";
+}
+		
+
+void  Icefront::Demarshall(char** pmarshalled_dataset){
+
+	int i;
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&type,marshalled_dataset,sizeof(type));marshalled_dataset+=sizeof(type);
+	memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
+	
+	memcpy(&mparid,marshalled_dataset,sizeof(mparid));marshalled_dataset+=sizeof(mparid);
+	memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+
+	memcpy(&element_type,marshalled_dataset,sizeof(element_type));marshalled_dataset+=sizeof(element_type);
+	memcpy(&eid,marshalled_dataset,sizeof(eid));marshalled_dataset+=sizeof(eid);
+	memcpy(&element_offset,marshalled_dataset,sizeof(element_offset));marshalled_dataset+=sizeof(element_offset);
+
+	memcpy(&node_ids,marshalled_dataset,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
+	memcpy(&node_offsets,marshalled_dataset,sizeof(node_offsets));marshalled_dataset+=sizeof(node_offsets);
+	
+	memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
+	memcpy(&b,marshalled_dataset,sizeof(b));marshalled_dataset+=sizeof(b);
+
+	for(i=0;i<MAX_ICEFRONT_GRIDS;i++)nodes[i]=NULL;
+	matpar=NULL;
+	element=NULL;
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+
+int Icefront::Enum(void){
+
+	return IcefrontEnum();
+
+}
+
+int    Icefront::GetId(void){ return sid; }
+
+int    Icefront::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+void  Icefront::DistributeNumDofs(int* numdofspernode,int analysis_type){return;}
+		
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::Configure"
+
+void  Icefront::Configure(void* pelementsin,void* pnodesin,void* pmaterialsin){
+
+	DataSet* elementsin=NULL;
+	DataSet* nodesin=NULL;
+	DataSet* materialsin=NULL;
+
+	/*Recover pointers :*/
+	elementsin=(DataSet*)pelementsin;
+	nodesin=(DataSet*)pnodesin;
+	materialsin=(DataSet*)pmaterialsin;
+	
+	/*Link this load with its nodes: */
+	if (strcmp(type,"segment")==0){
+		
+		ResolvePointers((Object**)nodes,node_ids,node_offsets,2,nodesin);
+	
+	}
+	else{
+		ResolvePointers((Object**)nodes,node_ids,node_offsets,4,nodesin);
+	}
+
+	
+	/*Same for materials: */
+	ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
+
+
+	/*Same for element: */
+	ResolvePointers((Object**)&element,&eid,&element_offset,1,elementsin);
+
+}
+
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::CreateKMatrix"
+
+void  Icefront::CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type){
+
+	/*No stiffness loads applied, do nothing: */
+
+	return;
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::CreatePVector"
+void  Icefront::CreatePVector(Vec pg, ParameterInputs* inputs, int analysis_type){
+
+	/*Just branch to the correct element icefront vector generator, according to the type of analysis we are carrying out: */
+	if ((analysis_type==DiagnosticHorizAnalysisEnum()) || (analysis_type==ControlAnalysisEnum())){
+		CreatePVectorDiagnosticHoriz( pg,inputs,analysis_type);
+	}
+	else{
+		throw ErrorException(__FUNCT__,exprintf("%s%i%s"," analysis ",analysis_type," not supported yet"));
+	}
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::CreatePVectorDiagnosticHoriz"
+void Icefront::CreatePVectorDiagnosticHoriz( Vec pg, ParameterInputs* inputs, int analysis_type){
+
+	/*Branck on the type of icefront: */
+	if (strcmp(type,"segment")==0){
+		CreatePVectorDiagnosticHorizSegment(pg,inputs,analysis_type);
+	}
+	else{
+		CreatePVectorDiagnosticHorizQuad(pg,inputs,analysis_type);
+	}
+}	
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::CreatePVectorDiagnosticHorizSegment"
+
+void Icefront::CreatePVectorDiagnosticHorizSegment( Vec pg,ParameterInputs* inputs, int analysis_type){
+
+	int i,j;
+	
+	const int numgrids=2;
+	const int NDOF2=2;
+	int   numberofdofspernode;
+	const int numdofs=numgrids*NDOF2;
+	int   doflist[numdofs];
+	double xyz_list[numgrids][3];
+
+	double x1,y1,x2,y2;
+
+	/* input parameters: */
+	double thickness_list_element[3];
+	double thickness_list[2];
+	double bed_list_element[3];
+	double bed_list[2];
+	
+	int    grid1,grid2;
+	double normal[2];
+	double length;
+	int    fill;
+
+	/*Objects: */
+	double  pe_g[numdofs];
+	Matpar* matpar=NULL;
+	Node**  element_nodes=NULL;
+
+	/*Recover material and fill parameters: */
+	matpar=element->GetMatPar();
+	fill=element->GetShelf();
+
+	//check that the element is onbed (collapsed formulation) otherwise:pe=0
+	if(element_type==PentaEnum()){
+		if  (!element->GetOnBed()){
+			return;
+		}
+	}
+
+	/* Set pe_g to 0: */
+	for(i=0;i<numdofs;i++) pe_g[i]=0.0;
+		
+	/*Identify which grids are comprised in the segment. */
+	if(element_type==TriaEnum())element_nodes=(Node**)xmalloc(3*sizeof(Node*));
+	if(element_type==PentaEnum())element_nodes=(Node**)xmalloc(6*sizeof(Node*));
+	element->GetNodes(element_nodes);
+		
+	/*go through first 3 grids (all grids for tria, bed grids for penta) and identify 1st and 2nd grid: */
+	for(i=0;i<3;i++){
+		if (nodes[0]==element_nodes[i])grid1=i;
+		if (nodes[1]==element_nodes[i])grid2=i;
+	}
+	
+	/* Get dof list and node coordinates: */
+	GetDofList(&doflist[0],&numberofdofspernode);
+	GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
+	
+	/*Now build thickness_list_element and bed_list_element: */
+	element->GetThicknessList(&thickness_list_element[0]);
+	element->GetBedList(&thickness_list_element[0]);
+	
+	/*Build thickness_list and bed_list: */
+	thickness_list[0]=thickness_list_element[grid1];
+	thickness_list[1]=thickness_list_element[grid2];
+	bed_list[0]=bed_list_element[grid1];
+	bed_list[1]=bed_list_element[grid2];
+
+	//Recover grid coordinates
+	x1=xyz_list[0][0];
+	y1=xyz_list[0][1];
+	x2=xyz_list[1][0];
+	y2=xyz_list[1][1];
+
+	//Compute length and normal of segment
+	normal[0]=cos(atan2(x1-x2,y2-y1));
+	normal[1]=sin(atan2(x1-x2,y2-y1));
+	length=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
+
+	//Compute load contribution for this segment:
+	SegmentPressureLoad(pe_g,matpar->GetRhoWater(),matpar->GetRhoIce(),matpar->GetG(),thickness_list,bed_list,normal,length,fill);
+		
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && this->icefront.eid==ELID){ 
+		printf("\nicefront load\n");
+		printf("grids %i %i\n",grid1,grid2);
+		printf("rho_water %g\n",rho_water);
+		printf("rho_ice %g\n",rho_ice);
+		printf("gravity %g\n",gravity);
+		printf("thickness_list (%g,%g)\n",thickness_list[0],thickness_list[1]);
+		printf("bed_list (%g,%g)\n",bed_list[0],bed_list[1]);
+		printf("normal (%g,%g)\n",normal[0],normal[1]);
+		printf("length %g\n",length);
+		printf("fill %i\n",fill);
+		printf("pe_g->terms\n");
+		for(i=0;i<numgrids*NDOF2;i++){
+			printf("%g ",*(pe_g->terms+i));
+		}
+	}
+	#endif
+
+	/*Plug pe_g into vector: */
+	VecSetValues(pg,numdofs,doflist,pe_g,INSERT_VALUES);
+
+	/*Free ressources:*/
+	xfree((void**)&element_nodes);
+
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefont::CreatePVectorDiagnosticHorizQuad"
+void Icefront::CreatePVectorDiagnosticHorizQuad( Vec pg,ParameterInputs* inputs, int analysis_type){
+
+	throw ErrorException(__FUNCT__," not implemented yet!");
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::UpdateFromInputs"
+void  Icefront::UpdateFromInputs(ParameterInputs* inputs){
+	
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::GetDofList"
+
+void  Icefront::GetDofList(int* doflist,int* pnumberofdofspernode){
+
+	int i,j;
+	int doflist_per_node[MAXDOFSPERNODE];
+	int numberofdofspernode;
+	
+	if (strcmp(type,"segment")==0){
+		for(i=0;i<2;i++){
+			nodes[i]->GetDofList(&doflist_per_node[0],&numberofdofspernode);
+			for(j=0;j<numberofdofspernode;j++){
+				doflist[i*numberofdofspernode+j]=doflist_per_node[j];
+			}
+		}
+	}
+	else{
+		for(i=0;i<4;i++){
+			nodes[i]->GetDofList(&doflist_per_node[0],&numberofdofspernode);
+			for(j=0;j<numberofdofspernode;j++){
+				doflist[i*numberofdofspernode+j]=doflist_per_node[j];
+			}
+		}
+	}
+
+	/*Assign output pointers:*/
+	*pnumberofdofspernode=numberofdofspernode;
+
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::SegmentPressureLoad"
+
+void Icefront::SegmentPressureLoad(double* pe_g,double rho_water,double rho_ice,double gravity, double* thickness_list, double* bed_list, double* normal,double length,int fill){
+
+	double   nx,ny;
+	double   h1,h2,b1,b2;
+	int      num_gauss;
+	double*  segment_gauss_coord=NULL;
+	double*  gauss_weights=NULL;
+	int      ig;
+	double   Jdet;
+	double   thickness,bed;
+	double   ice_pressure,water_pressure,air_pressure;
+	double   surface_under_water,base_under_water;
+	double   pressure;
+
+	nx=normal[0];
+	ny=normal[1];
+
+	//Get gaussian points and weights. order 2 since we have a product of 2 nodal functions
+	num_gauss=3;
+	GaussSegment(&segment_gauss_coord, &gauss_weights, num_gauss);
+
+	//recover thickness and bed at two grids
+	h1=thickness_list[0];
+	h2=thickness_list[1];
+	b1=bed_list[0];
+	b2=bed_list[1];
+
+	//compute Jacobian of segment
+	Jdet=1./2.*length;
+
+	for(ig=0;ig<num_gauss;ig++){
+
+		thickness=h1*(1+segment_gauss_coord[ig])/2+h2*(1-segment_gauss_coord[ig])/2;
+		bed=b1*(1+segment_gauss_coord[ig])/2+b2*(1-segment_gauss_coord[ig])/2;
+
+		if (fill==1){
+			//icefront ends in water: 
+			ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2);
+			air_pressure=0;
+
+			//Now deal with water pressure
+			surface_under_water=min(0,thickness+bed); // 0 if the top of the glacier is above water level
+			base_under_water=min(0,bed);              // 0 if the bottom of the glacier is above water level
+			water_pressure=1.0/2.0*gravity*rho_water*(pow(surface_under_water,2) - pow(base_under_water,2));
+		}
+		else if (fill==0){
+			ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2);
+			air_pressure=0;
+			water_pressure=0;
+		}
+		else{
+			throw ErrorException(__FUNCT__," fill type not supported yet");
+		}
+
+		pressure = ice_pressure + water_pressure + air_pressure;
+
+		pe_g[2*0+0]+= pressure*Jdet*gauss_weights[ig]*(1+segment_gauss_coord[ig])/2*nx;
+		pe_g[2*0+1]+= pressure*Jdet*gauss_weights[ig]*(1+segment_gauss_coord[ig])/2*ny;
+		pe_g[2*1+0]+= pressure*Jdet*gauss_weights[ig]*(1-segment_gauss_coord[ig])/2*nx;
+		pe_g[2*1+1]+= pressure*Jdet*gauss_weights[ig]*(1-segment_gauss_coord[ig])/2*ny;
+
+	} //for(ig=0;ig<num_gauss;ig++)
+
+	xfree((void**)&segment_gauss_coord);
+	xfree((void**)&gauss_weights);
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::PenaltyCreateKMatrix"
+void  Icefront::PenaltyCreateKMatrix(Mat Kgg,ParameterInputs* inputs,double kmax,int analysis_type){
+	/*do nothing: */
+}
+		
+#undef __FUNCT__ 
+#define __FUNCT__ "Icefront::PenaltyCreatePVector"
+void  Icefront::PenaltyCreatePVector(Vec pg,ParameterInputs* inputs,double kmax,int analysis_type){
+	/*do nothing: */
+}
+
+Object* Icefront::copy() {
+	return new Icefront(*this); 
+}
+
Index: /issm/trunk/src/c/objects/Icefront.h
===================================================================
--- /issm/trunk/src/c/objects/Icefront.h	(revision 1)
+++ /issm/trunk/src/c/objects/Icefront.h	(revision 1)
@@ -0,0 +1,72 @@
+/*!\file Icefront.h
+ * \brief: header file for icefront object
+ */
+
+#ifndef _ICEFRONT_H_
+#define _ICEFRONT_H_
+
+#include "./Load.h"
+#include "./Matpar.h"
+#include "./Element.h"
+#include "./Node.h"
+
+#define MAX_ICEFRONT_GRIDS 4 //max number of grids for a certain load
+#define ICEFRONTSTRING 20 //max string length
+
+class Icefront: public Load {
+
+	private: 
+		char	type[ICEFRONTSTRING];
+		int		sid;
+	
+		/*material: */
+		int mparid; //material id
+		Matpar* matpar; 
+		int   matpar_offset;
+	
+		/*element of icefront: */
+		int 	element_type;
+		int     eid;  //id of element on ice front
+		Element* element;
+		int     element_offset;
+
+		/*nodes: */
+		int   node_ids[MAX_ICEFRONT_GRIDS]; //node ids
+		Node* nodes[MAX_ICEFRONT_GRIDS]; //node pointers
+		int   node_offsets[MAX_ICEFRONT_GRIDS]; //node offsets in nodes dataset
+
+		/*properties: */
+		double		h[MAX_ICEFRONT_GRIDS]; //thickness
+		double		b[MAX_ICEFRONT_GRIDS]; //bed
+
+	public:
+
+		Icefront();
+		Icefront(char type[ICEFRONTSTRING],int sid, int mparid, int eid, int element_type, int node_ids[MAX_ICEFRONT_GRIDS],double h[MAX_ICEFRONT_GRIDS],double	b[MAX_ICEFRONT_GRIDS]);
+		~Icefront();
+
+		void  Echo();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		char* GetName();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   GetId(); 
+		int   MyRank();
+		void  DistributeNumDofs(int* numdofspernode,int analysis_type);
+		void  Configure(void* elements,void* nodes,void* materials);
+		void  CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type);
+		void  UpdateFromInputs(ParameterInputs* inputs);
+		
+		void  CreatePVector(Vec pg, ParameterInputs* inputs, int analysis_type);
+		void  CreatePVectorDiagnosticHoriz( Vec pg, ParameterInputs* inputs, int analysis_type);
+		void  CreatePVectorDiagnosticHorizSegment( Vec pg,ParameterInputs* inputs, int analysis_type);
+		void  CreatePVectorDiagnosticHorizQuad( Vec pg,ParameterInputs* inputs, int analysis_type);
+		void  GetDofList(int* doflist,int* pnumberofdofs);
+		void  SegmentPressureLoad(double* pe_g,double rho_water,double rho_ice,double gravity, double* thickness_list, double* bed_list, double* normal,double length,int fill);
+		void  PenaltyCreateKMatrix(Mat Kgg,ParameterInputs* inputs,double kmax,int analysis_type);
+		void  PenaltyCreatePVector(Vec pg,ParameterInputs* inputs,double kmax,int analysis_type);
+		Object* copy();
+};
+
+#endif  /* _ICEFRONT_H_ */
Index: /issm/trunk/src/c/objects/Load.cpp
===================================================================
--- /issm/trunk/src/c/objects/Load.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Load.cpp	(revision 1)
@@ -0,0 +1,18 @@
+/*!\file: Load.cpp 
+ * \brief: implementation of the Enum routine, which is the only non-virtual routine from 
+ * the Object derived class Load.
+ */ 
+
+
+#include "./Object.h"
+#include "./Load.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "stdio.h"
+#include "../DataSet/DataSet.h"
+
+int Load::Enum(void){
+
+	return LoadEnum();
+}
+		
+
Index: /issm/trunk/src/c/objects/Load.h
===================================================================
--- /issm/trunk/src/c/objects/Load.h	(revision 1)
+++ /issm/trunk/src/c/objects/Load.h	(revision 1)
@@ -0,0 +1,36 @@
+/*!\file:  Load.h
+ * \brief abstract class for Load object
+ * This class is a place holder for the Icefront  and the Penpair loads.
+ * It is derived from Load, so DataSets can contain them.
+ */ 
+
+
+#ifndef _LOAD_H_
+#define _LOAD_H_
+
+#include "./Object.h"
+#include "./ParameterInputs.h"
+#include "../toolkits/toolkits.h"
+
+class Load: public Object{
+
+	public: 
+		virtual       ~Load(){};
+		virtual void  Echo()=0;
+		virtual int   GetId()=0;
+		virtual int   MyRank()=0;
+		virtual void  Marshall(char** pmarshalled_dataset)=0;
+		virtual int   MarshallSize()=0;
+		virtual char* GetName()=0;
+		virtual void  Demarshall(char** pmarshalled_dataset)=0;
+		virtual void  Configure(void* elements,void* nodes,void* materials)=0;
+		virtual void  CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type)=0;
+		virtual void  CreatePVector(Vec pg, ParameterInputs* inputs, int analysis_type)=0;
+		virtual void  UpdateFromInputs(ParameterInputs* inputs)=0;
+		virtual void  PenaltyCreateKMatrix(Mat Kgg,ParameterInputs* inputs,double kmax,int analysis_type)=0;
+		virtual void  PenaltyCreatePVector(Vec pg,ParameterInputs* inputs,double kmax,int analysis_type)=0;
+
+		int           Enum();
+
+};
+#endif
Index: /issm/trunk/src/c/objects/Material.cpp
===================================================================
--- /issm/trunk/src/c/objects/Material.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Material.cpp	(revision 1)
@@ -0,0 +1,18 @@
+/*!\file: Material.cpp 
+ * \brief: implementation of the Enum routine, which is the only non-virtual routine from 
+ * the Object derived class Material.
+ */ 
+
+
+#include "./Object.h"
+#include "./Material.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "stdio.h"
+#include "../DataSet/DataSet.h"
+
+int Material::Enum(void){
+
+	return MaterialEnum();
+}
+		
+
Index: /issm/trunk/src/c/objects/Material.h
===================================================================
--- /issm/trunk/src/c/objects/Material.h	(revision 1)
+++ /issm/trunk/src/c/objects/Material.h	(revision 1)
@@ -0,0 +1,28 @@
+/*!\file:  Material.h
+ * \brief abstract class for Material object
+ */ 
+
+
+#ifndef _MATERIAL_H_
+#define _MATERIAL_H_
+
+#include "./Object.h"
+#include "./ParameterInputs.h"
+#include "../toolkits/toolkits.h"
+
+class Material: public Object{
+
+	public: 
+		virtual       ~Material(){};
+		virtual void  Echo()=0;
+		virtual int   GetId()=0;
+		virtual int   MyRank()=0;
+		virtual void  Marshall(char** pmarshalled_dataset)=0;
+		virtual int   MarshallSize()=0;
+		virtual char* GetName()=0;
+		virtual void  Demarshall(char** pmarshalled_dataset)=0;
+		virtual void  UpdateFromInputs(ParameterInputs* inputs)=0;
+		int           Enum();
+		
+};
+#endif
Index: /issm/trunk/src/c/objects/Matice.cpp
===================================================================
--- /issm/trunk/src/c/objects/Matice.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Matice.cpp	(revision 1)
@@ -0,0 +1,241 @@
+/*!\file Matice.c
+ * \brief: implementation of the Matice object
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "./Matice.h"
+#include <string.h>
+#include "../shared/shared.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+		
+Matice::Matice(){
+	return;
+}
+Matice::Matice(int matice_mid,double matice_B,double matice_n){
+	mid=matice_mid;
+	B=matice_B;
+	n=matice_n;
+	return;
+}
+
+Matice::~Matice(){
+	return;
+}
+void Matice::Echo(void){
+
+	printf("Matice:\n");
+	printf("   mid: %i\n",mid);
+	printf("   B: %g\n",B);
+	printf("   n: %g\n",n);
+	return;
+}
+		
+void  Matice::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Matice: */
+	enum_type=MaticeEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Matice data: */
+	memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
+	memcpy(marshalled_dataset,&B,sizeof(B));marshalled_dataset+=sizeof(B);
+	memcpy(marshalled_dataset,&n,sizeof(n));marshalled_dataset+=sizeof(n);
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Matice::MarshallSize(){
+
+	return sizeof(mid)+sizeof(B)+sizeof(n)+sizeof(int); //sizeof(int) for enum type
+}
+
+char* Matice::GetName(void){
+	return "matice";
+}
+		
+
+void  Matice::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
+	memcpy(&B,marshalled_dataset,sizeof(B));marshalled_dataset+=sizeof(B);
+	memcpy(&n,marshalled_dataset,sizeof(n));marshalled_dataset+=sizeof(n);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+
+int Matice::Enum(void){
+
+	return MaticeEnum();
+
+}
+
+int    Matice::GetId(void){ return mid; }
+
+int    Matice::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+void  Matice::DistributeNumDofs(int* numdofspernode,int analysis_type){return;}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Matice::UpdateFromInputs"
+void  Matice::UpdateFromInputs(ParameterInputs* inputs){
+	
+	throw ErrorException(__FUNCT__," not supported yet!");
+
+}
+		
+#undef __FUNCT__ 
+#define __FUNCT__ "Matice::SetB"
+void  Matice::SetB(double B_param){
+	B=B_param;
+}
+		
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "MatIce::GetViscosity2d"
+void  Matice::GetViscosity2d(double* pviscosity, double* epsilon){
+
+
+	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
+	                                  2*B
+	  viscosity= -------------------------------------------------------------------
+	      2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
+	 
+	      where viscosity is the viscotiy, B the flow law parameter , (u,v) the velocity 
+	      vector, and n the flow law exponent.
+	 
+	  If epsilon is NULL, it means this is the first time SystemMatrices is being run, and we 
+	  return 10^14, initial viscosity.
+*/
+
+	/*output: */
+	double viscosity;
+
+	/*input strain rate: */
+	double exx,eyy,exy;
+
+	/*Intermediary value A and exponent e: */
+	double A,e;
+
+	if (n==1){
+		/*Viscous behaviour! viscosity=B: */
+		viscosity=B;
+	}
+	else{
+		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0)){
+			viscosity=pow(10,14);
+		}
+		else{
+			/*Retrive strain rate components: */
+			exx=*(epsilon+0);
+			eyy=*(epsilon+1);
+			exy=*(epsilon+2);
+
+			/*Build viscosity: viscosity=2*B/(2*A^e) */
+			A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
+			if(A==0){
+				/*Maxiviscositym viscosity for 0 shear areas: */
+				viscosity=4.5*pow(10,17);
+			}
+			else{
+				e=(n-1)/2/n;
+				viscosity=2*B/(2*pow(A,e));
+			}
+		}
+	}
+	#ifdef _DEBUG_
+	_printf_("Viscosity %lf\n",viscosity);
+	#endif
+
+	/*Return: */
+	*pviscosity=viscosity;
+}
+
+Object* Matice::copy() {
+	return new Matice(*this); 
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "MatIce::GetViscosity2"
+void  Matice::GetViscosity2(double* pviscosity2, double* epsilon){
+
+	/*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]: 
+	 *
+	 *                                  2* (1-n)/2n
+	 * mu2= -------------------------------------------------------------------
+	 *     2[ (du/dx)^2+(dv/dy)^2+1/4*(du/dy+dv/dx)^2+du/dx*dv/dy ]^[(3n-1)/2n]
+	 *
+	 *     where mu2 is the second viscosity, (u,v) the velocity 
+	 *     vector, and n the flow law exponent.
+	 *
+	 * If epsilon is NULL, it means this is the first time Gradjb is being run, and we 
+	 * return mu20, initial viscosity.
+	 */
+	
+	/*output: */
+	double viscosity2;
+
+	/*input strain rate: */
+	double exx,eyy,exy;
+
+	/*Intermediary value A and exponent e: */
+	double A,e;
+
+	if(epsilon){
+		exx=*(epsilon+0);
+		eyy=*(epsilon+1);
+		exy=*(epsilon+2);
+
+		/*Build viscosity: mu2=B/(2*A^e) */
+		A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+exx*eyy;
+		if(A==0){
+			/*Maximum viscosity2 for 0 shear areas: */
+			viscosity2=4.5*pow(10,17);
+		}
+		else{
+			e=(3*n-1)/2/n;
+		
+			viscosity2=2*(1-n)/2/n/(2*pow(A,e));
+		}
+	}
+	else{
+		viscosity2=4.5*pow(10,17);
+	}
+		
+	#ifdef _DEBUG_
+	_printf_("Viscosity2 %lf\n",mu2);
+	#endif
+
+	/*Return: */
+	*pviscosity2=viscosity2;
+}
Index: /issm/trunk/src/c/objects/Matice.h
===================================================================
--- /issm/trunk/src/c/objects/Matice.h	(revision 1)
+++ /issm/trunk/src/c/objects/Matice.h	(revision 1)
@@ -0,0 +1,40 @@
+/*!\file Matice.h
+ * \brief: header file for matice object
+ */
+
+#ifndef MATICE_H_
+#define MATICE_H_
+
+#include "./Material.h"
+
+class Matice: public Material{
+
+	private: 
+		int	   mid;
+		double B;
+		double n;
+
+	public:
+
+		Matice();
+		Matice(int mid,double B,double n);
+		~Matice();
+
+		void  Echo();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		char* GetName();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   GetId(); 
+		int   MyRank();
+		void  DistributeNumDofs(int* numdofspernode,int analysis_type);
+		void  UpdateFromInputs(ParameterInputs* inputs);
+		void  SetB(double B_param);
+		void  GetViscosity2d(double* pviscosity, double* pepsilon);
+		void  GetViscosity2(double* pviscosity2, double* pepsilon);
+		Object* copy();
+
+};
+
+#endif  /* _MATICE_H_ */
Index: /issm/trunk/src/c/objects/Matpar.cpp
===================================================================
--- /issm/trunk/src/c/objects/Matpar.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Matpar.cpp	(revision 1)
@@ -0,0 +1,178 @@
+/*!\file Matpar.c
+ * \brief: implementation of the Matpar object
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "../shared/shared.h"
+#include "./Matpar.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+
+		
+Matpar::Matpar(){
+	return;
+}
+Matpar::Matpar(int	matpar_mid, double	matpar_rho_ice, double	matpar_rho_water, double  matpar_heatcapacity, double  matpar_thermalconductivity, double  matpar_latentheat, double  matpar_beta, double  matpar_meltingpoint, double  matpar_mixed_layer_capacity, double  matpar_thermal_exchange_velocity, double  matpar_g, double  matpar_viscosity_overshoot){
+
+
+	mid=matpar_mid; 
+	rho_ice=matpar_rho_ice; 
+	rho_water=matpar_rho_water; 
+	heatcapacity=matpar_heatcapacity; 
+	thermalconductivity=matpar_thermalconductivity; 
+	latentheat=matpar_latentheat; 
+	beta=matpar_beta; 
+	meltingpoint=matpar_meltingpoint; 
+	mixed_layer_capacity=matpar_mixed_layer_capacity; 
+	thermal_exchange_velocity=matpar_thermal_exchange_velocity; 
+	g=matpar_g; 
+	viscosity_overshoot=matpar_viscosity_overshoot;
+
+	return;
+}
+
+Matpar::~Matpar(){
+	return;
+}
+void Matpar::Echo(void){
+
+	printf("Matpar:\n");
+	printf("   mid: %i\n",mid);
+	printf("   rho_ice: %g\n",rho_ice);
+	printf("   rho_water: %g\n",rho_water);
+	printf("   heatcapacity: %g\n",heatcapacity);
+	printf("   thermalconductivity: %g\n",thermalconductivity);
+	printf("   latentheat: %g\n",latentheat);
+	printf("   beta: %g\n",beta);
+	printf("   meltingpoint: %g\n",meltingpoint);
+	printf("   mixed_layer_capacity: %g\n",mixed_layer_capacity);
+	printf("   thermal_exchange_velocity: %g\n",thermal_exchange_velocity);
+	printf("   g: %g\n",g);
+	printf("   viscosity_overshoot: %g\n",viscosity_overshoot);
+	return;
+}
+		
+void  Matpar::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Matpar: */
+	enum_type=MatparEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Matpar data: */
+	memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
+	memcpy(marshalled_dataset,&rho_ice,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
+	memcpy(marshalled_dataset,&rho_water,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
+	memcpy(marshalled_dataset,&heatcapacity,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
+	memcpy(marshalled_dataset,&thermalconductivity,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
+	memcpy(marshalled_dataset,&latentheat,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
+	memcpy(marshalled_dataset,&beta,sizeof(beta));marshalled_dataset+=sizeof(beta);
+	memcpy(marshalled_dataset,&meltingpoint,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
+	memcpy(marshalled_dataset,&mixed_layer_capacity,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
+	memcpy(marshalled_dataset,&thermal_exchange_velocity,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
+	memcpy(marshalled_dataset,&g,sizeof(g));marshalled_dataset+=sizeof(g);
+	memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Matpar::MarshallSize(){
+
+	return sizeof(mid)+
+		sizeof(rho_ice)+
+		sizeof(rho_water)+
+		sizeof(heatcapacity)+
+		sizeof(thermalconductivity)+
+		sizeof(latentheat)+
+		sizeof(beta)+
+		sizeof(meltingpoint)+
+		sizeof(mixed_layer_capacity)+
+		sizeof(thermal_exchange_velocity)+
+		sizeof(g)+
+		sizeof(viscosity_overshoot)+
+		sizeof(int); //sizeof(int) for enum type
+}
+
+char* Matpar::GetName(void){
+	return "matpar";
+}
+		
+
+void  Matpar::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
+	memcpy(&rho_ice,marshalled_dataset,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
+	memcpy(&rho_water,marshalled_dataset,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
+	memcpy(&heatcapacity,marshalled_dataset,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
+	memcpy(&thermalconductivity,marshalled_dataset,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
+	memcpy(&latentheat,marshalled_dataset,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
+	memcpy(&beta,marshalled_dataset,sizeof(beta));marshalled_dataset+=sizeof(beta);
+	memcpy(&meltingpoint,marshalled_dataset,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
+	memcpy(&mixed_layer_capacity,marshalled_dataset,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
+	memcpy(&thermal_exchange_velocity,marshalled_dataset,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
+	memcpy(&g,marshalled_dataset,sizeof(g));marshalled_dataset+=sizeof(g);
+	memcpy(&viscosity_overshoot,marshalled_dataset,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+
+int Matpar::Enum(void){
+
+	return MatparEnum();
+
+}
+
+int    Matpar::GetId(void){ return mid; }
+
+int    Matpar::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+void  Matpar::DistributeNumDofs(int* numdofspernode,int analysis_type){return;}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Matpar::UpdateFromInputs"
+void  Matpar::UpdateFromInputs(ParameterInputs* inputs){
+	
+	throw ErrorException(__FUNCT__," not supported yet!");
+
+}
+
+double Matpar::GetG(){
+	return g;
+}
+double Matpar::GetRhoIce(){
+	return rho_ice;
+}
+double Matpar::GetRhoWater(){
+	return rho_water;
+}
+
+Object* Matpar::copy() {
+	return new Matpar(*this); 
+}
Index: /issm/trunk/src/c/objects/Matpar.h
===================================================================
--- /issm/trunk/src/c/objects/Matpar.h	(revision 1)
+++ /issm/trunk/src/c/objects/Matpar.h	(revision 1)
@@ -0,0 +1,51 @@
+/*!\file Matpar.h
+ * \brief: header file for matpar object
+ */
+
+#ifndef _MATPAR_H_
+#define _MATPAR_H_
+
+#include "./Material.h"
+
+class Matpar: public Material{
+
+	private: 
+		int	mid;
+		double	rho_ice; 
+		double	rho_water;
+		double  heatcapacity;
+		double  thermalconductivity;
+		double  latentheat;
+		double  beta;
+		double  meltingpoint;
+		double  mixed_layer_capacity;
+		double  thermal_exchange_velocity;
+		double  g;
+		double  viscosity_overshoot;
+
+	public:
+
+		Matpar();
+	
+		Matpar(int	mid, double	rho_ice, double	rho_water, double  heatcapacity, double  thermalconductivity, double  latentheat, double  beta, double  meltingpoint, double  mixed_layer_capacity, double  thermal_exchange_velocity, double  g, double  viscosity_overshoot);
+		
+		~Matpar();
+
+		void  Echo();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		char* GetName();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   GetId(); 
+		int   MyRank();
+		void  DistributeNumDofs(int* numdofspernode,int analysis_type);
+		void  UpdateFromInputs(ParameterInputs* inputs);
+		double GetG();
+		double GetRhoIce();
+		double GetRhoWater();
+		Object* copy();
+
+};
+
+#endif  /* _MATPAR_H_ */
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 1)
@@ -0,0 +1,409 @@
+/*!\file Node.c
+ * \brief: implementation of the Node object
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "./Node.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../shared/shared.h"
+
+		
+Node::Node(){
+	return;
+}
+Node::Node(int node_id,int node_partitionborder,int node_numdofs, double node_x[3],int node_onbed,int node_onsurface){
+
+	int i;
+	
+	id=node_id;
+	partitionborder=node_partitionborder;
+	numberofdofs=node_numdofs;
+	x[0]=node_x[0];
+	x[1]=node_x[1];
+	x[2]=node_x[2];
+	onbed=node_onbed;
+	onsurface=node_onsurface;
+
+	/*Initialize sets: */
+	for(i=0;i<numberofdofs;i++){
+		mset[i]=0;
+		nset[i]=1; 
+		fset[i]=1; //we assume new nodes are not constrained in rigid body mode, or single point constraint mode.
+		sset[i]=0;
+	}
+
+	return;
+}
+
+Node::~Node(){
+	return;
+}
+		
+void Node::Echo(void){
+
+	int i;
+
+	printf("Node:\n");
+	printf("   id: %i\n",id);
+	printf("   partitionborder: %i\n",partitionborder);
+	printf("   clone: %i\n",clone);
+	printf("   numberofdofs: %i\n",numberofdofs);
+	printf("   x=[%g,%g,%g]\n",x[0],x[1],x[2]);
+	printf("   onbed: %i\n",onbed);
+	printf("   onsurface: %i\n",onsurface);
+	printf("   doflist:|");
+	for(i=0;i<numberofdofs;i++){
+		if(i>MAXDOFSPERNODE)break;
+		printf("%i|",doflist[i]);
+	}
+	printf("\n");
+
+	printf("   set membership: m,n,f,s sets \n");
+	for(i=0;i<numberofdofs;i++){
+		if(i>MAXDOFSPERNODE)break;
+		printf("      dof %i: %i %i %i %i\n",i,mset[i],nset[i],fset[i],sset[i]);
+	}
+	printf("\n");
+
+	return;
+}
+		
+void  Node::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Node: */
+	enum_type=NodeEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Node data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&partitionborder,sizeof(partitionborder));marshalled_dataset+=sizeof(partitionborder);
+	memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone);
+	memcpy(marshalled_dataset,&numberofdofs,sizeof(numberofdofs));marshalled_dataset+=sizeof(numberofdofs);
+	memcpy(marshalled_dataset,&x,sizeof(x));marshalled_dataset+=sizeof(x);
+	memcpy(marshalled_dataset,&onbed,sizeof(onbed));marshalled_dataset+=sizeof(onbed);
+	memcpy(marshalled_dataset,&onsurface,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface);
+	memcpy(marshalled_dataset,&doflist,sizeof(doflist));marshalled_dataset+=sizeof(doflist);
+	memcpy(marshalled_dataset,&mset,sizeof(mset));marshalled_dataset+=sizeof(mset);
+	memcpy(marshalled_dataset,&nset,sizeof(nset));marshalled_dataset+=sizeof(nset);
+	memcpy(marshalled_dataset,&fset,sizeof(fset));marshalled_dataset+=sizeof(fset);
+	memcpy(marshalled_dataset,&sset,sizeof(sset));marshalled_dataset+=sizeof(sset);
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Node::MarshallSize(){
+
+	return sizeof(id)+
+		sizeof(partitionborder)+
+		sizeof(clone)+
+		sizeof(numberofdofs)+
+		sizeof(x)+
+		sizeof(onbed)+
+		sizeof(onsurface)+
+		sizeof(doflist)+
+		sizeof(mset)+
+		sizeof(nset)+
+		sizeof(fset)+
+		sizeof(sset)+
+		sizeof(int); //sizeof(int) for enum type
+}
+
+char* Node::GetName(void){
+	return "node";
+}
+		
+
+void  Node::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&partitionborder,marshalled_dataset,sizeof(partitionborder));marshalled_dataset+=sizeof(partitionborder);
+	memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone);
+	memcpy(&numberofdofs,marshalled_dataset,sizeof(numberofdofs));marshalled_dataset+=sizeof(numberofdofs);
+	memcpy(&x,marshalled_dataset,sizeof(x));marshalled_dataset+=sizeof(x);
+	memcpy(&onbed,marshalled_dataset,sizeof(onbed));marshalled_dataset+=sizeof(onbed);
+	memcpy(&onsurface,marshalled_dataset,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface);
+	memcpy(&doflist,marshalled_dataset,sizeof(doflist));marshalled_dataset+=sizeof(doflist);
+	memcpy(&mset,marshalled_dataset,sizeof(mset));marshalled_dataset+=sizeof(mset);
+	memcpy(&nset,marshalled_dataset,sizeof(nset));marshalled_dataset+=sizeof(nset);
+	memcpy(&fset,marshalled_dataset,sizeof(fset));marshalled_dataset+=sizeof(fset);
+	memcpy(&sset,marshalled_dataset,sizeof(sset));marshalled_dataset+=sizeof(sset);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+
+int Node::Enum(void){
+
+	return NodeEnum();
+
+}
+int    Node::GetId(void){ return id; }
+
+int    Node::MyRank(void){ 
+	extern int my_rank;
+
+	return my_rank; 
+}
+
+void  Node::DistributeDofs(int* pdofcount){ 
+
+	int i;
+	extern int my_rank;
+	int dofcount;
+
+	dofcount=*pdofcount;
+	
+	if(clone){
+		/*This node is a clone! Don't distribute dofs, it will get them from another cpu!*/
+		return;
+	}
+
+	/*This node should distribute dofs, go ahead: */
+	for(i=0;i<numberofdofs;i++){
+		doflist[i]=dofcount+i;
+	}
+	dofcount+=numberofdofs;
+
+	/*Assign output pointers: */
+	*pdofcount=dofcount;
+
+	return; 
+}
+
+void  Node::UpdateDofs(int dofcount){
+	
+	int i;
+	extern int my_rank;
+	
+	if(clone){
+		/*This node is a clone, don't update the dofs!: */
+		return;
+	}
+
+	/*This node should update the dofs, go ahead: */
+	for(i=0;i<numberofdofs;i++){
+		doflist[i]+=dofcount;
+	}
+
+	return; 
+}
+
+void  Node::ShowBorderDofs(int* borderdofs){
+
+	int j;
+	extern int my_rank;
+	
+	/*Is this node on the partition border? */
+	if(!partitionborder)return;
+
+	/*Are we the cpu that created this node's dof list? */
+	if(clone)return;
+
+	/*Ok, we are on the partition border, and we did create the 
+	 * dofs for this node, plug the doflist into borderdofs: */
+	for(j=0;j<numberofdofs;j++){
+		*(borderdofs+numberofdofs*(id-1)+j)=doflist[j];
+	}
+
+	return;
+}
+
+void  Node::UpdateBorderDofs(int* allborderdofs){ 
+
+	int j;
+	extern int my_rank;
+	
+	/*Is this node on the partition border? */
+	if(!partitionborder)return;
+	
+	/*Are we the cpu that created this node's dof list? */
+	if(clone==0)return;
+
+	/*Ok, we are on the partition border, but we did not create 
+	 * the dofs for this node. Therefore, our doflist is garbage right 
+	 * now. Go pick it up in the allborderdofs: */
+	for(j=0;j<numberofdofs;j++){
+		doflist[j]=*(allborderdofs+numberofdofs*(id-1)+j);
+	}	
+	return; 
+}
+void  Node::CreatePartition(Vec partition){ 
+
+	int      i;
+	int*     idxm=NULL;
+	double*  values=NULL;
+
+	idxm=(int*)xmalloc(numberofdofs*sizeof(int));
+	values=(double*)xmalloc(numberofdofs*sizeof(double));
+
+	for(i=0;i<numberofdofs;i++)idxm[i]=(id-1)*numberofdofs+i;
+	for(i=0;i<numberofdofs;i++)values[i]=(double)doflist[i];
+
+	VecSetValues(partition,numberofdofs,idxm,values,INSERT_VALUES);
+
+	xfree((void**)&idxm);
+	xfree((void**)&values);
+
+	return;
+}
+void  Node::DistributeNumDofs(int* numdofspernode,int analysis_type){return;}
+		
+		
+void  Node::SetClone(int* minranks){
+
+	extern int my_rank;
+
+	if (minranks[id-1]==my_rank){
+		clone=0;
+	}
+	else{
+		/*!there is a cpu with lower rank that has the same node, 
+		therefore, I am a clone*/
+		clone=1; 	
+	}
+
+}
+		
+
+int   Node::GetNumberOfDofs(){
+	
+	return numberofdofs;
+
+}
+
+int   Node::IsClone(){
+	
+	return clone;
+
+}
+
+
+void  Node::ApplyConstraint(Vec yg,int dof,double value){
+
+	int index;
+
+	/*First, dof should be added in the s set, describing which 
+	 * dofs are constrained to a certain value (dirichlet boundary condition*/
+
+	DofInSSet(dof-1);
+
+	/*Second, we should add value into yg, at dof corresponding to doflist[dof], unless
+	 *  we are a clone!*/
+
+	if(!clone){
+
+		index=doflist[dof-1]; //matlab indexing
+
+		VecSetValues(yg,1,&index,&value,INSERT_VALUES);
+
+	}
+
+}
+		
+
+void  Node::DofInSSet(int dof){
+
+	/*Put dof for this node into the s set (ie, this dof will be constrained 
+	 * to a fixed value during computations. */
+
+	mset[dof]=0; //m and n are mutually exclusive (m for rigid body modes)
+	nset[dof]=1;
+	fset[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
+	sset[dof]=1;
+}
+
+void  Node::DofInMSet(int dof){
+
+	/*Put dof for this node into the m set (m set is for rigid body modes)*/
+
+	mset[dof]=1; //m and n are mutually exclusive (m for rigid body modes)
+	nset[dof]=0;
+	fset[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
+	sset[dof]=0;
+}
+		
+
+int   Node::GetDof(int dofindex){
+
+	return doflist[dofindex];
+
+}
+
+		
+void  Node::CreateVecSets(Vec pv_g,Vec pv_m,Vec pv_n,Vec pv_f,Vec pv_s){
+
+	double gvalue=1.0; //all nodes are in the g set;
+	double value;
+
+	int i;
+
+	for(i=0;i<numberofdofs;i++){
+
+		/*g set: */
+		VecSetValues(pv_g,1,&doflist[i],&gvalue,INSERT_VALUES);
+		
+		/*m set: */
+		value=(double)mset[i];
+		VecSetValues(pv_m,1,&doflist[i],&value,INSERT_VALUES);
+
+		/*n set: */
+		value=(double)nset[i];
+		VecSetValues(pv_n,1,&doflist[i],&value,INSERT_VALUES);
+
+		/*f set: */
+		value=(double)fset[i];
+		VecSetValues(pv_f,1,&doflist[i],&value,INSERT_VALUES);
+
+		/*s set: */
+		value=(double)sset[i];
+		VecSetValues(pv_s,1,&doflist[i],&value,INSERT_VALUES);
+
+	}
+
+
+}
+		
+void  Node::GetDofList(int* outdoflist,int* pnumberofdofspernode){
+
+	int i;
+	for(i=0;i<numberofdofs;i++){
+		outdoflist[i]=doflist[i];
+	}
+	/*Assign output pointers:*/
+	*pnumberofdofspernode=numberofdofs;
+}
+
+
+double Node::GetX(){return x[0];}
+double Node::GetY(){return x[1];}
+double Node::GetZ(){return x[2];}
+
+Object* Node::copy() {
+	return new Node(*this); 
+}
Index: /issm/trunk/src/c/objects/Node.h
===================================================================
--- /issm/trunk/src/c/objects/Node.h	(revision 1)
+++ /issm/trunk/src/c/objects/Node.h	(revision 1)
@@ -0,0 +1,72 @@
+/*!\file Node.h
+ * \brief: header file for node object
+ */
+
+#ifndef _NODE_H_
+#define _NODE_H_
+
+#include "./Object.h"
+#include "../toolkits/toolkits.h"
+
+#define MAXDOFSPERNODE 4
+#define PSSTRINGLENGTH 20
+
+class Node: public Object{
+
+	private: 
+		/*raw data coming from the model processor: */
+		int	    id; /*! id, to track it*/
+		int     partitionborder; /*! during parallel partitioning, does this grid belong to a partition border?*/
+		int     numberofdofs; //real number of dofs, between 0 and MAXDOFSPERNODE
+		int     clone;  /*!this nodes is one the partition border, and is cloned*/
+		double	x[3]; /*! coordinates*/
+		int	    onbed; /*! for 3d, on bedrock*/
+		int	    onsurface; /*! for 3d, on surface*/
+
+		/*for dof constraining: */
+		int     mset[MAXDOFSPERNODE];
+		int     nset[MAXDOFSPERNODE];
+		int     fset[MAXDOFSPERNODE];
+		int     sset[MAXDOFSPERNODE];
+
+		/*data that is post processed : */
+		int doflist[MAXDOFSPERNODE];
+
+	public:
+
+		Node();
+		Node(int node_id,int node_partitionborder,int node_numdofs, double node_x[3],int node_onbed,int node_onsurface);
+		~Node();
+
+		void  Echo();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		char* GetName();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   GetId(void); 
+		int   MyRank(void);
+		void  DistributeDofs(int* pdofcount);
+		void  UpdateDofs(int dofcount);
+		void  ShowBorderDofs(int* borderdofs);
+		void  UpdateBorderDofs(int* allborderdofs);
+		void  CreatePartition(Vec partition);
+		void  DistributeNumDofs(int* numdofspernode,int analysis_type);
+		void  SetClone(int* minranks);
+		int   GetNumberOfDofs();
+		int   IsClone();
+		void  ApplyConstraint(Vec yg,int dof,double value);
+		void  DofInSSet(int dof);
+		void  DofInMSet(int dof);
+		int   GetDof(int dofindex);
+		void  CreateVecSets(Vec pv_g,Vec pv_m,Vec pv_n,Vec pv_f,Vec pv_s);
+		void  GetDofList(int* outdoflist,int* pnumberofdofspernode);
+		double GetX();
+		double GetY();
+		double GetZ();
+		Object* copy();
+
+};
+
+#endif  /* _NODE_H_ */
+
Index: /issm/trunk/src/c/objects/NodeSets.cpp
===================================================================
--- /issm/trunk/src/c/objects/NodeSets.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/NodeSets.cpp	(revision 1)
@@ -0,0 +1,99 @@
+/*!\file: NodeSet.cpp
+ * \brief routines for handling node sets (m,n,f and s sets)
+ */ 
+
+#include "../include/macros.h"
+#include "../shared/shared.h"
+#include "./objects.h"
+
+/*--------------------------------------------------
+	Construtor
+  --------------------------------------------------*/
+NodeSets::NodeSets( double* nodesets_pv_m,double* nodesets_pv_n,double* nodesets_pv_f,double* nodesets_pv_s,
+		int nodesets_gsize,int nodesets_msize,int nodesets_nsize,int nodesets_fsize,int nodesets_ssize){
+
+	gsize=nodesets_gsize;
+	msize=nodesets_msize;
+	nsize=nodesets_nsize;
+	fsize=nodesets_fsize;
+	ssize=nodesets_ssize;
+
+	pv_m=nodesets_pv_m;
+	pv_n=nodesets_pv_n;
+	pv_f=nodesets_pv_f;
+	pv_s=nodesets_pv_s;
+
+}
+
+
+
+/*--------------------------------------------------
+	Destructor:
+  --------------------------------------------------*/
+
+NodeSets::~NodeSets(void){
+
+	xfree((void**)&pv_m);
+	xfree((void**)&pv_n);
+	xfree((void**)&pv_f);
+	xfree((void**)&pv_s);
+
+}
+
+/*--------------------------------------------------
+	Echo
+  --------------------------------------------------*/
+
+void NodeSets::Echo(void){
+	
+	int i;
+
+	printf("\nNodeSets echo:\n");
+	printf(" gsize: %i\n",gsize);
+	printf(" msize: %i\n",msize);
+	printf(" nsize: %i\n",nsize);
+	printf(" fsize: %i\n",fsize);
+	printf(" ssize: %i\n",ssize);
+
+	if(pv_m){
+		printf("m set:\n");
+		for(i=0;i<msize;i++){
+			printf("%g\n",pv_m[i]);
+		}
+	}
+		
+	if(pv_n){
+		printf("n set:\n");
+		for(i=0;i<nsize;i++){
+			printf("%g\n",pv_n[i]);
+		}
+	}
+	
+	if(pv_f){
+		printf("f set:\n");
+		for(i=0;i<fsize;i++){
+			printf("%g\n",pv_f[i]);
+		}
+	}
+	
+	if(pv_s){
+		printf("s set:\n");
+		for(i=0;i<ssize;i++){
+			printf("%g\n",pv_s[i]);
+		}
+	}	
+}
+
+
+/*Access to internals: */
+int NodeSets::GetGSize(){ return gsize;}
+int NodeSets::GetMSize(){ return msize;}
+int NodeSets::GetNSize(){ return nsize;}
+int NodeSets::GetFSize(){ return fsize;}
+int NodeSets::GetSSize(){ return ssize;}
+double* NodeSets::GetPV_M(){ return pv_m;}
+double* NodeSets::GetPV_N(){ return pv_n;}
+double* NodeSets::GetPV_F(){ return pv_f;}
+double* NodeSets::GetPV_S(){ return pv_s;}
+
+
Index: /issm/trunk/src/c/objects/NodeSets.h
===================================================================
--- /issm/trunk/src/c/objects/NodeSets.h	(revision 1)
+++ /issm/trunk/src/c/objects/NodeSets.h	(revision 1)
@@ -0,0 +1,42 @@
+/*!\file:  NodeSets.h
+ * \brief header file for  a strcture holding all the nodesets.
+ */ 
+
+#ifndef _NODESETS_H
+#define _NODESETS_H
+
+#include "../toolkits/toolkits.h"
+
+class NodeSets {
+
+	private:
+		int gsize;
+		int msize;
+		int nsize;
+		int fsize;
+		int ssize;
+
+		double* pv_m;
+		double* pv_n;
+		double* pv_f;
+		double* pv_s;
+
+	public:
+
+	NodeSets( double* pv_m,double* pv_n,double* pv_f,double* pv_s,int gsize,int msize,int nsize,int fsize,int ssize);
+	~NodeSets();
+
+	void Echo();
+	int GetGSize();
+	int GetMSize();
+	int GetNSize();
+	int GetFSize();
+	int GetSSize();
+	double* GetPV_M();
+	double* GetPV_N();
+	double* GetPV_F();
+	double* GetPV_S();
+
+};
+#endif  /* _NODESETS_H */
+
Index: /issm/trunk/src/c/objects/Object.h
===================================================================
--- /issm/trunk/src/c/objects/Object.h	(revision 1)
+++ /issm/trunk/src/c/objects/Object.h	(revision 1)
@@ -0,0 +1,29 @@
+/*
+ * Object.h:
+ * \brief prototype for abstract Object class
+ * \file Object.h
+ * This prototype describes the Object class. This is an abstract class, parent 
+ * to any other objects (Quad, Tria, Grid, etc ...), that can be included in a 
+ * DataSet.
+ */
+
+
+#ifndef _OBJECT_H_
+#define _OBJECT_H_
+
+class Object {
+
+	public: 
+		virtual       ~Object() {};
+		virtual void  Echo()=0;
+		virtual int   GetId()=0;
+		virtual int   MyRank()=0;
+		virtual void  Marshall(char** pmarshalled_dataset)=0;
+		virtual int   MarshallSize()=0;
+		virtual char* GetName()=0;
+		virtual void  Demarshall(char** pmarshalled_dataset)=0;
+		virtual int   Enum()=0;
+		virtual Object* copy()=0;
+
+};
+#endif
Index: /issm/trunk/src/c/objects/Param.cpp
===================================================================
--- /issm/trunk/src/c/objects/Param.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Param.cpp	(revision 1)
@@ -0,0 +1,425 @@
+/*!\file Param.c
+ * \brief: implementation of the Param object
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../include/macros.h"
+#include "../shared/shared.h"
+#include "./objects.h"
+
+		
+Param::Param(){
+	return;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Param constructor"
+Param::Param(int param_id, char* param_name, int param_type){
+
+	id=param_id;
+	strcpy(name,param_name);
+	type=param_type;
+	if ((param_type!=STRING) & (param_type!=INTEGER) & (param_type!=DOUBLE) & 
+		(param_type!=DOUBLEVEC) & (param_type!=DOUBLEMAT) & (param_type!=PETSCVEC) & (param_type!=PETSCMAT) 
+		){
+		throw ErrorException(__FUNCT__,exprintf("%s%i"," unknow parameter type ",param_type));
+	}
+}
+
+Param::~Param(){
+	return;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Param echo"
+void Param::Echo(void){
+
+	int i,j;
+	
+	printf("Param:\n");
+	printf("   id: %i\n",id);
+	printf("   name: %s\n",name);
+	
+	switch(type){
+		case STRING:
+			printf("   string value: %s\n",string);
+			break;
+	
+		case INTEGER:
+			printf("   integer value: %i\n",integer);
+			break;
+	
+		case DOUBLE:
+			printf("   double value: %g\n",ddouble);
+			break;
+		
+		case DOUBLEVEC:
+			printf("   double vector. size: %i\n",M);
+			for(i=0;i<M;i++)printf("%g\n",doublevec[i]);
+			break;
+	
+		case DOUBLEMAT:
+			printf("   double matrix. size: %i,%i\n",M,N);
+			for(i=0;i<M;i++){
+				for(j=0;j<N;j++){
+					printf("%g ",*(doublemat+N*i+j));
+				}
+				printf("\n");
+			}
+			break;
+
+		case PETSCVEC:
+			printf("   Petsc vector: \n");
+			VecView(vec,PETSC_VIEWER_STDOUT_WORLD);
+			break;
+
+		case  PETSCMAT:
+			printf("   Petsc matrix: \n");
+			MatView(mat,PETSC_VIEWER_STDOUT_WORLD);
+			break;
+
+		default:
+			throw ErrorException(__FUNCT__,exprintf("%s%i","unknow parameter type ",type));
+	}
+}
+	
+#undef __FUNCT__
+#define __FUNCT__ "Marshall"
+
+void  Param::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+	double* serial_vec=NULL; 
+	double* serial_mat=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Param: */
+	enum_type=ParamEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Param data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&name,sizeof(name));marshalled_dataset+=sizeof(name);
+	memcpy(marshalled_dataset,&type,sizeof(type));marshalled_dataset+=sizeof(type);
+
+	switch(type){
+		case STRING:
+			memcpy(marshalled_dataset,&string,sizeof(string));marshalled_dataset+=sizeof(string);
+			break;
+		case INTEGER:
+			memcpy(marshalled_dataset,&integer,sizeof(integer));marshalled_dataset+=sizeof(integer);
+			break;
+		case DOUBLE:
+			memcpy(marshalled_dataset,&ddouble,sizeof(ddouble));marshalled_dataset+=sizeof(ddouble);
+			break;
+		case DOUBLEVEC:
+			memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+			memcpy(marshalled_dataset,doublevec,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
+			break;
+
+		case DOUBLEMAT:
+			memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+			memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
+			memcpy(marshalled_dataset,doublevec,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
+			break;
+
+		case PETSCVEC:
+			VecGetSize(vec,&M);
+			VecToMPISerial(&serial_vec,vec);
+			memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+			memcpy(marshalled_dataset,serial_vec,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
+			xfree((void**)&serial_vec);
+			break;
+
+		case PETSCMAT:
+			MatGetSize(mat,&M,&N);
+			MatToSerial(&serial_mat,mat);
+			memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+			memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
+			memcpy(marshalled_dataset,serial_mat,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
+			xfree((void**)&serial_mat);
+			break;
+		
+		default:
+			_printf_("cheinnere\n");
+			throw ErrorException(__FUNCT__,exprintf("%s%i","unknown parameter type",type));
+			break;
+	}
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Param::MarshallSize(){
+
+	int size;
+
+	size=sizeof(id)+
+		sizeof(name)+
+		sizeof(type)+
+		sizeof(int); //sizeof(int) for enum type
+
+	switch(type){
+		case STRING:
+			size+=sizeof(string);
+			break;
+		case INTEGER:
+			size+= sizeof(integer);
+			break;
+		case DOUBLE:
+			size+= sizeof(ddouble);
+			break;
+		case DOUBLEVEC:
+			size+= sizeof(M)+M*sizeof(double);
+			break;
+
+		case DOUBLEMAT:
+			size+= sizeof(M)+sizeof(N)+M*N*sizeof(double);
+			break;
+
+		case PETSCVEC:
+			size+= sizeof(M)+M*sizeof(double);
+			break;
+
+		case PETSCMAT:
+			size+= sizeof(M)+sizeof(N)+M*N*sizeof(double);
+			break;
+
+		default:
+			throw ErrorException(__FUNCT__,exprintf("%s%i","unknown parameter type",type));
+	}
+
+	return size;
+}
+
+char* Param::GetName(void){
+	return "param";
+}
+		
+
+void  Param::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	double* serial_vec=NULL;
+	double* serial_mat=NULL;
+	int* idxm=NULL;
+	int* idxn=NULL; 
+	int i;
+	double sparsity=.001;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&name,marshalled_dataset,sizeof(name));marshalled_dataset+=sizeof(name);
+	memcpy(&type,marshalled_dataset,sizeof(type));marshalled_dataset+=sizeof(type);
+
+
+	switch(type){
+
+		case STRING:
+			memcpy(&string,marshalled_dataset,sizeof(string));marshalled_dataset+=sizeof(string);
+			break;
+
+		case INTEGER:
+			memcpy(&integer,marshalled_dataset,sizeof(integer));marshalled_dataset+=sizeof(integer);
+			break;
+
+		case DOUBLE:
+			memcpy(&ddouble,marshalled_dataset,sizeof(ddouble));marshalled_dataset+=sizeof(ddouble);
+			break;
+
+		case DOUBLEVEC:
+	
+			memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
+			doublevec=(double*)xmalloc(M*sizeof(double));
+			memcpy(doublevec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
+			break;
+
+		case DOUBLEMAT:
+			memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
+			memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
+			doublemat=(double*)xmalloc(M*N*sizeof(double));
+			memcpy(doublemat,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
+			break;
+
+		case PETSCVEC:
+			memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
+			serial_vec=(double*)xmalloc(M*sizeof(double));
+			memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
+
+			vec=NewVec(M);
+			idxm=(int*)xmalloc(M*sizeof(int));
+			for(i=0;i<M;i++)idxm[i]=i;
+			VecSetValues(vec,M,idxm,serial_vec,INSERT_VALUES);
+
+			VecAssemblyBegin(vec);
+			VecAssemblyEnd(vec);
+			
+			xfree((void**)&serial_vec);
+			xfree((void**)&idxm);
+			break;
+
+		case PETSCMAT:
+			memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
+			memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
+			serial_mat=(double*)xmalloc(M*N*sizeof(double));
+			memcpy(serial_mat,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
+			mat=NewMat(M,N,&sparsity,NULL,NULL);
+			idxm=(int*)xmalloc(M*sizeof(int));
+			idxn=(int*)xmalloc(N*sizeof(int));
+			for(i=0;i<M;i++)idxm[i]=i;
+			for(i=0;i<N;i++)idxn[i]=i;
+			MatSetValues(mat,M,idxm,N,idxn,serial_mat,INSERT_VALUES); 
+			MatAssemblyBegin(mat,MAT_FINAL_ASSEMBLY); 
+			MatAssemblyEnd(mat,MAT_FINAL_ASSEMBLY);
+
+			xfree((void**)&serial_mat);
+			xfree((void**)&idxm);
+			xfree((void**)&idxn);
+			break;
+
+		default:
+			throw ErrorException(__FUNCT__,exprintf("%s%i","unknown parameter type",type));
+	}
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+
+
+int Param::Enum(void){
+
+	return ParamEnum();
+}
+
+char* Param::GetParameterName(void){ 
+	return name; 
+}
+
+void  Param::GetParameterValue(void* pvalue){ 
+
+	if (type==STRING){
+		char** pstring=(char**)pvalue; //a little dangerous, but hey!
+		char*  outstring=NULL;
+		outstring=(char*)xmalloc((strlen(string)+1)*sizeof(char));
+		strcpy(outstring,string);
+		*pstring=outstring;
+	}
+	else if(type==INTEGER){
+		int* pinteger=(int*)pvalue;
+		*pinteger=integer;
+	}
+	else if(type==DOUBLE){
+		double* pdouble=(double*)pvalue;
+		*pdouble=ddouble;
+	}
+	else if(type==DOUBLEVEC){
+		double** pdoublevec=(double**)pvalue;
+		double* outdoublevec=NULL;
+		outdoublevec=(double*)xmalloc(M*sizeof(double));
+		memcpy(outdoublevec,doublevec,M*sizeof(double));
+		*pdoublevec=outdoublevec;
+	}
+	else if(type==DOUBLEMAT){
+		double** pdoublemat=(double**)pvalue;
+		double* outdoublemat=NULL;
+		outdoublemat=(double*)xmalloc(M*N*sizeof(double));
+		memcpy(outdoublemat,doublemat,M*N*sizeof(double));
+		*pdoublemat=outdoublemat;
+	}
+	else if(type==PETSCVEC){
+		Vec* pvec=(Vec*)pvalue;
+		Vec  outvec=NULL;
+		VecDuplicate(vec,&outvec);
+		VecCopy(vec,outvec);
+		*pvec=outvec;
+	}
+	else if(type==PETSCMAT){
+		Mat* pmat=(Mat*)pvalue;
+		Mat  outmat=NULL;
+		MatDuplicate(mat,MAT_COPY_VALUES,&outmat);
+		*pmat=outmat;
+	}
+	else{
+		_printf_("%s%s%i\n",__FUNCT__," error message: unknow type ",type);
+		abort();
+	}
+	return;
+}
+
+int    Param::GetId(void){ return id; }
+
+int    Param::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+
+void  Param::DistributeNumDofs(int* numdofspernode,int analysis_type){return;}
+		
+
+int   Param::GetType(){
+	return type;
+}
+
+Object* Param::copy() {
+	return new Param(*this); 
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "SetDouble"
+void  Param::SetDouble(double value){
+	if (type!=DOUBLE) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set double for type",type));
+	ddouble=value;
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "SetInteger"
+void  Param::SetInteger(int value){
+	if (type!=INTEGER) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set integer for type",type));
+	integer=value;
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "SetString"
+void  Param::SetString(char* value){
+	if (type!=STRING) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set string for type",type));
+	strcpy(string,value);
+}
+
+int   Param::GetM(){
+	return M;
+}
+
+int   Param::GetN(){
+	return N;
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "SetDoubleVec"
+void  Param::SetDoubleVec(double* value,int size){
+	if (type!=DOUBLEVEC) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set doublevecfor type",type));
+	
+	M=size;
+	doublevec=(double*)xmalloc(M*sizeof(double));
+	memcpy(doublevec,value,M*sizeof(double));
+
+}
Index: /issm/trunk/src/c/objects/Param.h
===================================================================
--- /issm/trunk/src/c/objects/Param.h	(revision 1)
+++ /issm/trunk/src/c/objects/Param.h	(revision 1)
@@ -0,0 +1,62 @@
+/*!\file Param.h
+ * \brief: header file for param object
+ */
+
+#ifndef _PARAM_H_
+#define _PARAM_H_
+
+#include "./Object.h"
+#include "../toolkits/toolkits.h"
+
+#define PARAMSTRING 200 //max string length
+
+enum param_type { STRING, INTEGER, DOUBLE, DOUBLEVEC, DOUBLEMAT, PETSCVEC, PETSCMAT };
+
+class Param: public Object{
+
+	private: 
+		int	id; /*! id, to track it*/
+		char name[PARAMSTRING]; /*! name of parameter*/
+		int  type; /*! param type, from enum above*/
+		
+		int  integer;
+		double ddouble;
+		char  string[PARAMSTRING];
+		double* doublevec;
+		double* doublemat;
+		Vec vec;
+		Mat mat;
+		int M; //dimensions of vectors and matrices
+		int N;
+
+	public:
+
+		Param();
+		Param(int param_id, char* param_name, int param_type);
+		~Param();
+
+		void  Echo();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		char* GetName();
+		char* GetParameterName();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		
+		void  SetDouble(double value);
+		void  SetDoubleVec(double* value,int size);
+		void  SetInteger(int value);
+		void  SetString(char* value);
+		void  GetParameterValue(void* pvalue);
+		
+		int   GetId(); 
+		int   MyRank();
+		void  DistributeNumDofs(int* numdofspernode,int analysis_type);
+		int   GetType();
+		int   GetM();
+		int   GetN();
+		Object* copy();
+
+};
+
+#endif  /* _PARAM_H_ */
Index: /issm/trunk/src/c/objects/ParameterInputs.cpp
===================================================================
--- /issm/trunk/src/c/objects/ParameterInputs.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/ParameterInputs.cpp	(revision 1)
@@ -0,0 +1,380 @@
+/*!\file:  ParameterInputs.cpp
+ * \brief  routines for loading from matlab the parameter inputs to our non-linear iterations.
+ */ 
+
+
+#include "./ParameterInputs.h"
+#include "../shared/shared.h"
+#include "../include/macros.h"
+
+/*--------------------------------------------------
+	NewParameterInputs
+  --------------------------------------------------*/
+
+ParameterInputs* NewParameterInputs(void) {
+	
+	ParameterInputs*	inputs=NULL;
+
+	inputs=(ParameterInputs*)xmalloc(sizeof(ParameterInputs));
+
+	inputs->nfields=0;
+	inputs->fields=NULL;
+	inputs->field_names=NULL;
+	inputs->fields_length=NULL;
+	
+	return inputs;
+}
+
+
+/*--------------------------------------------------
+	ParameterInputsEcho	
+  --------------------------------------------------*/
+int ParameterInputsEcho(ParameterInputs* inputs,int longecho){
+
+	int noerr=1;
+	int i,j;
+
+	/*short echo: */
+	if(!longecho){
+		_printf_("field names, field pointers: \n");
+		for (i=0;i<inputs->nfields;i++){
+			_printf_("%s: %p\n",inputs->field_names[i],inputs->fields[i]);
+		}
+	}
+	/*long echo: */
+	else{
+		for (i=0;i<inputs->nfields;i++){
+			double* values=inputs->fields[i];
+			_printf_("field names: %s\n",inputs->field_names[i]);
+			_printf_("field values: \n");
+			for(j=0;j<inputs->fields_length[i];j++){
+				printf("  %g\n",values[j]);
+			}
+		}
+	}
+	return noerr;
+}
+
+/*--------------------------------------------------
+	ParameterInputsRecover	
+  --------------------------------------------------*/
+double* ParameterInputsRecover(ParameterInputs* inputs,char* field_name){
+
+	double* param=NULL;
+	int i;
+	
+	/*Find field_name input field, and return the value: */
+	for(i=0;i<inputs->nfields;i++){
+		if (strcmp(inputs->field_names[i],field_name)==0){
+			param=inputs->fields[i];
+		}
+	}
+	return param;
+}
+
+/*--------------------------------------------------
+	DeleteParameterInputs	
+  --------------------------------------------------*/
+void DeleteParameterInputs(ParameterInputs** pinputs){
+
+	ParameterInputs* inputs=NULL;
+	int i;
+	char*  field_name=NULL;
+	double* field=NULL;
+
+	#ifdef _PARALLEL_ //inputs operation is only done on the cluster, on the serial side, we leave the matlab memory manager handle inputs.
+	inputs=*pinputs;
+
+	if(inputs){
+
+		for(i=0;i<inputs->nfields;i++){
+			field_name=inputs->field_names[i];
+			xfree((void**)&field_name);
+
+			/*In parallel, erase: */
+			field=inputs->fields[i];
+			xfree((void**)&field);
+		}
+
+		xfree((void**)&inputs->field_names);
+		xfree((void**)&inputs->fields);
+		xfree((void**)&inputs->fields_length);
+	}
+	xfree((void**)pinputs);
+	#else
+	#endif
+	return;
+}
+
+/*--------------------------------------------------
+	ParameterInputsAddFromVec	
+  --------------------------------------------------*/
+int  ParameterInputsAddFromVec(ParameterInputs* inputs,Vec vector,char* pfield_name){
+	
+	int     noerr=1;
+	double* double_vector=NULL;
+	double* double_vector2=NULL;
+	int     vector_size;
+	char*   field_name;
+	char**  field_names;
+	int     field_name_size;
+	double** fields=NULL;
+	int*    fields_length;
+	int     i;
+
+	/*Take vector, serialize it, and plug it into inputs with field name "field_name": */
+	if (vector){
+		VecGetSize(vector,&vector_size);
+		VecToMPISerial(&double_vector,vector);
+		
+		if(inputs->nfields==0){
+			/*Ok, we need to allocate fields, field_names and fields_length: */
+			inputs->nfields=1;
+			
+			inputs->field_names=(char**)xmalloc(sizeof(char*));
+			field_name_size=strlen(pfield_name)+1;
+			field_name=(char*)xmalloc(field_name_size*sizeof(char));
+			strcpy(field_name,pfield_name);
+			inputs->field_names[0]=field_name;
+
+			inputs->fields=(double**)xmalloc(sizeof(double*));
+			inputs->fields[0]=double_vector;
+
+			inputs->fields_length=(int*)xmalloc(sizeof(int));
+			inputs->fields_length[0]=vector_size;
+		}
+		else{
+			/*First, figure out if there is already an existing field with name pfield_name: */
+			for(i=0;i<inputs->nfields;i++){
+				if (strcmp(inputs->field_names[i],pfield_name)==0){
+					/*Erase old field and plug new field: */
+					double_vector2=inputs->fields[i];
+					xfree((void**)&double_vector2); //no leak!
+					inputs->fields[i]=double_vector;
+					inputs->fields_length[i]=vector_size;
+					return noerr;
+				}
+			}
+
+			/*Ok, if we are here, the field did not already exist, we need to add it. First reallocate 
+			 * the inputs: */
+			field_names=inputs->field_names; //save field_names pointer.
+			inputs->field_names=(char**)xmalloc((inputs->nfields+1)*sizeof(char*));
+			for(i=0;i<inputs->nfields;i++){
+				inputs->field_names[i]=field_names[i];
+			}
+			xfree((void**)&field_names);
+
+			field_name_size=strlen(pfield_name)+1;
+			field_name=(char*)xmalloc(field_name_size*sizeof(char));
+			strcpy(field_name,pfield_name);
+			inputs->field_names[inputs->nfields]=field_name;
+
+
+
+			fields=inputs->fields; //save fields pointer
+			inputs->fields=(double**)xmalloc((inputs->nfields+1)*sizeof(double*));
+			for(i=0;i<inputs->nfields;i++){
+				inputs->fields[i]=fields[i];
+			}
+			xfree((void**)&fields);
+			inputs->fields[inputs->nfields]=double_vector;
+
+			fields_length=inputs->fields_length;
+			inputs->fields_length=(int*)xmalloc((inputs->nfields+1)*sizeof(int));
+			for(i=0;i<inputs->nfields;i++){
+				inputs->fields_length[i]=fields_length[i];
+			}
+			inputs->fields_length[inputs->nfields]=vector_size;
+			xfree((void**)&fields_length);
+			
+			inputs->nfields++;
+		}
+	}
+	else{
+		/*Do nothing, there is no input to add!: */
+		;
+	}
+	return noerr;
+}
+
+/*--------------------------------------------------
+	ParameterInputsAddFromDouble	
+  --------------------------------------------------*/
+int  ParameterInputsAddFromDouble(ParameterInputs* inputs,double scalar, char* pfield_name){
+	
+	int     noerr=1;
+	double* double_vector2=NULL;
+	double* double_vector=NULL;
+	int     vector_size;
+	char*   field_name;
+	char**  field_names;
+	int     field_name_size;
+	double** fields=NULL;
+	int*    fields_length;
+	int     i;
+
+	/*Create double_vector pointing to scalar: */
+	vector_size=1;
+	double_vector=(double*)xmalloc(sizeof(double));
+	double_vector[0]=scalar;
+
+
+	if(inputs->nfields==0){
+		/*Ok, we need to allocate fields, field_names and fields_length: */
+		inputs->nfields=1;
+		
+		inputs->field_names=(char**)xmalloc(sizeof(char*));
+		field_name_size=strlen(pfield_name)+1;
+		field_name=(char*)xmalloc(field_name_size*sizeof(char));
+		strcpy(field_name,pfield_name);
+		inputs->field_names[0]=field_name;
+
+		inputs->fields=(double**)xmalloc(sizeof(double*));
+		inputs->fields[0]=double_vector;
+
+		inputs->fields_length=(int*)xmalloc(sizeof(int));
+		inputs->fields_length[0]=vector_size;
+	}
+	else{
+		/*First, figure out if there is already an existing field with name pfield_name: */
+		for(i=0;i<inputs->nfields;i++){
+			if (strcmp(inputs->field_names[i],pfield_name)==0){
+				/*Erase old field and plug new field: */
+				double_vector2=inputs->fields[i];
+				xfree((void**)&double_vector2); //no leak!
+				inputs->fields[i]=double_vector;
+				inputs->fields_length[i]=vector_size;
+				return noerr;
+			}
+		}
+
+		/*Ok, if we are here, the field did not already exist, we need to add it. First reallocate 
+		 * the inputs: */
+		field_names=inputs->field_names; //save field_names pointer.
+		inputs->field_names=(char**)xmalloc((inputs->nfields+1)*sizeof(char*));
+		for(i=0;i<inputs->nfields;i++){
+			inputs->field_names[i]=field_names[i];
+		}
+		xfree((void**)&field_names);
+
+		field_name_size=strlen(pfield_name)+1;
+		field_name=(char*)xmalloc(field_name_size*sizeof(char));
+		strcpy(field_name,pfield_name);
+		inputs->field_names[inputs->nfields]=field_name;
+
+
+
+		fields=inputs->fields; //save fields pointer
+		inputs->fields=(double**)xmalloc((inputs->nfields+1)*sizeof(double*));
+		for(i=0;i<inputs->nfields;i++){
+			inputs->fields[i]=fields[i];
+		}
+		xfree((void**)&fields);
+		inputs->fields[inputs->nfields]=double_vector;
+
+		fields_length=inputs->fields_length;
+		inputs->fields_length=(int*)xmalloc((inputs->nfields+1)*sizeof(int));
+		for(i=0;i<inputs->nfields;i++){
+			inputs->fields_length[i]=fields_length[i];
+		}
+		inputs->fields_length[inputs->nfields]=vector_size;
+		xfree((void**)&fields_length);
+		
+		inputs->nfields++;
+	}
+	return noerr;
+}
+
+/*--------------------------------------------------
+	ParameterInputsAddFromMat	
+  --------------------------------------------------*/
+int  ParameterInputsAddFromMat(ParameterInputs* inputs,double* vector,int vector_size,char* pfield_name){
+	
+	int     noerr=1;
+	char*   field_name;
+	char**  field_names;
+	int     field_name_size;
+	double** fields=NULL;
+	int*    fields_length;
+	double* double_vector=NULL;
+	double* double_vector2=NULL;
+	int     i;
+
+	/*Make a copy of input vector, so as to not create any leaks: */
+	double_vector=(double*)xmalloc(vector_size*sizeof(double));
+	memcpy(double_vector,vector,vector_size*sizeof(double));
+
+	/*Take vector, serialize it, and plug it into inputs with field name "field_name": */
+	if (vector){
+		
+		if(inputs->nfields==0){
+			/*Ok, we need to allocate fields, field_names and fields_length: */
+			inputs->nfields=1;
+			
+			inputs->field_names=(char**)xmalloc(sizeof(char*));
+			field_name_size=strlen(pfield_name)+1;
+			field_name=(char*)xmalloc(field_name_size*sizeof(char));
+			strcpy(field_name,pfield_name);
+			inputs->field_names[0]=field_name;
+
+			inputs->fields=(double**)xmalloc(sizeof(double*));
+			inputs->fields[0]=double_vector;
+
+			inputs->fields_length=(int*)xmalloc(sizeof(int));
+			inputs->fields_length[0]=vector_size;
+		}
+		else{
+
+			/*First, figure out if there is already an existing field with name pfield_name: */
+			for(i=0;i<inputs->nfields;i++){
+				if (strcmp(inputs->field_names[i],pfield_name)==0){
+					/*Just xfree old field and plug new field: */
+					double_vector2=inputs->fields[i];
+					xfree((void**)&double_vector2);
+					inputs->fields[i]=double_vector;
+					inputs->fields_length[i]=vector_size;
+					return noerr;
+				}
+			}
+
+			/*Ok, if we are here, the field did not already exist, we need to add it. First reallocate 
+			 * the inputs: */
+			field_names=inputs->field_names; //save field_names pointer.
+			inputs->field_names=(char**)xmalloc((inputs->nfields+1)*sizeof(char*));
+			for(i=0;i<inputs->nfields;i++){
+				inputs->field_names[i]=field_names[i];
+			}
+			xfree((void**)&field_names);
+
+			field_name_size=strlen(pfield_name)+1;
+			field_name=(char*)xmalloc(field_name_size*sizeof(char));
+			strcpy(field_name,pfield_name);
+			inputs->field_names[inputs->nfields]=field_name;
+
+
+			fields=inputs->fields; //save fields pointer
+			inputs->fields=(double**)xmalloc((inputs->nfields+1)*sizeof(double*));
+			for(i=0;i<inputs->nfields;i++){
+				inputs->fields[i]=fields[i];
+			}
+			xfree((void**)&fields);
+			inputs->fields[inputs->nfields]=double_vector;
+
+			fields_length=inputs->fields_length;
+			inputs->fields_length=(int*)xmalloc((inputs->nfields+1)*sizeof(int));
+			for(i=0;i<inputs->nfields;i++){
+				inputs->fields_length[i]=fields_length[i];
+			}
+			inputs->fields_length[inputs->nfields]=vector_size;
+			xfree((void**)&fields_length);
+			
+			inputs->nfields++;
+		}
+	}
+	else{
+		/*Do nothing, there is no input to add!: */
+		;
+	}
+	return noerr;
+}
Index: /issm/trunk/src/c/objects/ParameterInputs.h
===================================================================
--- /issm/trunk/src/c/objects/ParameterInputs.h	(revision 1)
+++ /issm/trunk/src/c/objects/ParameterInputs.h	(revision 1)
@@ -0,0 +1,32 @@
+/*!\file:  ParameterInputs.h
+ * \brief prototype for parameter inputs, from matlab workspace.
+ */ 
+#ifndef PARAMETER_INPUTS_H_
+#define PARAMETER_INPUTS_H_
+
+#include "../toolkits/toolkits.h"
+
+struct ParameterInputs{
+
+	int	nfields; //number of inputs
+	char** field_names;  //characterization of each field.
+	double** fields;  //value of each field.
+	int* fields_length; //length of each values field
+
+};
+
+ParameterInputs* NewParameterInputs();
+void             DeleteParameterInputs(ParameterInputs** pinputs);
+int              ParameterInputsEcho(ParameterInputs* inputs,int longecho);
+double*          ParameterInputsRecover(ParameterInputs* inputs,char* field_name);
+
+int              ParameterInputsAddFromVec(ParameterInputs* inputs,Vec vector,char* field_name);
+int              ParameterInputsAddFromMat(ParameterInputs* inputs,double* vector,int vector_size,char* field_name);
+int              ParameterInputsAddFromDouble(ParameterInputs* inputs,double scalar, char* pfield_name);
+
+#ifdef _SERIAL_
+#include "mex.h"
+void  ParameterInputsInit(ParameterInputs** pthis, const mxArray* inputhandle);
+#endif
+
+#endif
Index: /issm/trunk/src/c/objects/Penpair.cpp
===================================================================
--- /issm/trunk/src/c/objects/Penpair.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Penpair.cpp	(revision 1)
@@ -0,0 +1,248 @@
+/*!\file Penpair.c
+ * \brief: implementation of the Penpair object
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "./Penpair.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../shared/shared.h"
+#include "../include/typedefs.h"
+
+		
+Penpair::Penpair(){
+	return;
+}
+
+Penpair::Penpair(int	penpair_id, double penpair_penalty_offset,int  penpair_penalty_lock,int penpair_numdofs,int penpair_node_ids[2],int penpair_dof,
+		int penpair_element_ids[2],double penpair_friction,int penpair_fill,double penpair_normal[2],double penpair_length){
+	
+	int i;
+	id=penpair_id;
+	penalty_offset =penpair_penalty_offset;
+	penalty_lock  =penpair_penalty_lock;
+	numdofs =penpair_numdofs;
+
+	for(i=0;i<2;i++){
+		node_ids[i]=penpair_node_ids[i];
+		node_offsets[i]=UNDEF;
+		nodes[i]=NULL;
+
+		element_ids[i]=penpair_element_ids[i];
+		element_offsets[i]=UNDEF;
+		elements[i]=NULL;
+	}
+	dof=penpair_dof;
+	
+	friction =penpair_friction;
+	fill =penpair_fill;
+	normal[0]=penpair_normal[0];
+	normal[1]=penpair_normal[1];
+	length=penpair_length;
+
+	return;
+}
+
+Penpair::~Penpair(){
+	return;
+}
+		
+void Penpair::Echo(void){
+
+	int i;
+
+	printf("Penpair:\n");
+	printf("   id: %i\n",id);
+	printf("   penalty_offset: %g\n",penalty_offset);
+	printf("   penalty_lock: %i\n",penalty_lock);
+	printf("   numdofs: %i\n",numdofs);
+	printf("   node_ids: [%i %i]\n",node_ids[0],node_ids[1]);
+	printf("   node_offsets: [%i %i]\n",node_offsets[0],node_offsets[1]);
+	printf("   dof: %i\n",dof);
+	printf("   element_ids: [%i %i]\n",element_ids[0],element_ids[1]);
+	printf("   element_offsets: [%i %i]\n",element_offsets[0],element_offsets[1]);
+	printf("   friction: %g\n",friction);
+	printf("   fill: %i\n",fill);
+	printf("   normal: %g %g\n",normal[0],normal[1]);
+	printf("   length: %g\n",length);
+	
+	for(i=0;i<2;i++){
+		if(nodes[i])nodes[i]->Echo();
+		if(elements[i])elements[i]->Echo();
+	}
+	return;
+}
+		
+void  Penpair::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Penpair: */
+	enum_type=PenpairEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Penpair data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&penalty_offset,sizeof(penalty_offset));marshalled_dataset+=sizeof(penalty_offset);
+	memcpy(marshalled_dataset,&penalty_lock,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
+	memcpy(marshalled_dataset,&numdofs,sizeof(numdofs));marshalled_dataset+=sizeof(numdofs);
+	memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
+	memcpy(marshalled_dataset,&node_ids,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
+	memcpy(marshalled_dataset,&node_offsets,sizeof(node_offsets));marshalled_dataset+=sizeof(node_offsets);
+	memcpy(marshalled_dataset,&element_ids,sizeof(element_ids));marshalled_dataset+=sizeof(element_ids);
+	memcpy(marshalled_dataset,&element_offsets,sizeof(element_offsets));marshalled_dataset+=sizeof(element_offsets);
+	memcpy(marshalled_dataset,&friction,sizeof(friction));marshalled_dataset+=sizeof(friction);
+	memcpy(marshalled_dataset,&fill,sizeof(fill));marshalled_dataset+=sizeof(fill);
+	memcpy(marshalled_dataset,&normal,sizeof(normal));marshalled_dataset+=sizeof(normal);
+	memcpy(marshalled_dataset,&length,sizeof(length));marshalled_dataset+=sizeof(length);
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Penpair::MarshallSize(){
+
+	return sizeof(id)+
+		sizeof(penalty_offset)+
+		sizeof(penalty_lock)+
+		sizeof(numdofs)+
+		sizeof(dof)+
+		sizeof(node_ids)+
+		sizeof(node_offsets)+
+		sizeof(element_ids)+
+		sizeof(element_offsets)+
+		sizeof(friction)+
+		sizeof(fill)+
+		sizeof(normal)+
+		sizeof(length)+
+		sizeof(int); //sizeof(int) for enum type
+}
+
+char* Penpair::GetName(void){
+	return "penpair";
+}
+		
+
+void  Penpair::Demarshall(char** pmarshalled_dataset){
+
+	int i;
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&penalty_offset,marshalled_dataset,sizeof(penalty_offset));marshalled_dataset+=sizeof(penalty_offset);
+	memcpy(&penalty_lock,marshalled_dataset,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
+	memcpy(&numdofs,marshalled_dataset,sizeof(numdofs));marshalled_dataset+=sizeof(numdofs);
+	memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
+	memcpy(&node_ids,marshalled_dataset,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
+	memcpy(&node_offsets,marshalled_dataset,sizeof(node_offsets));marshalled_dataset+=sizeof(node_offsets);
+	memcpy(&element_ids,marshalled_dataset,sizeof(element_ids));marshalled_dataset+=sizeof(element_ids);
+	memcpy(&element_offsets,marshalled_dataset,sizeof(element_offsets));marshalled_dataset+=sizeof(element_offsets);
+	memcpy(&friction,marshalled_dataset,sizeof(friction));marshalled_dataset+=sizeof(friction);
+	memcpy(&fill,marshalled_dataset,sizeof(fill));marshalled_dataset+=sizeof(fill);
+	memcpy(&normal,marshalled_dataset,sizeof(normal));marshalled_dataset+=sizeof(normal);
+	memcpy(&length,marshalled_dataset,sizeof(length));marshalled_dataset+=sizeof(length);
+
+	for(i=0;i<2;i++){
+		elements[i]=NULL;
+		nodes[i]=NULL;
+	}
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+int Penpair::Enum(void){
+
+	return PenpairEnum();
+}
+
+int    Penpair::GetId(void){ return id; }
+
+int    Penpair::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+void  Penpair::DistributeNumDofs(int* numdofspernode,int analysis_type){return;}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Penpair::Configure"
+
+void  Penpair::Configure(void* pelementsin,void* pnodesin,void* pmaterialsin){
+
+	DataSet* elementsin=NULL;
+	DataSet* nodesin=NULL;
+
+	/*Recover pointers :*/
+	elementsin=(DataSet*)pelementsin;
+	nodesin=(DataSet*)pnodesin;
+printf("here1\n");	
+	/*Link this load with its nodes: */
+	ResolvePointers((Object**)nodes,node_ids,node_offsets,2,nodesin);
+printf("here2\n");	
+
+	/*Same for elements: */
+	ResolvePointers((Object**)&elements,element_ids,element_offsets,2,elementsin);
+printf("here3\n");	
+
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Penpair::CreateKMatrix"
+
+void  Penpair::CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type){
+
+	/*No loads applied, do nothing: */
+	return;
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Penpair::CreatePVector"
+void  Penpair::CreatePVector(Vec pg, ParameterInputs* inputs, int analysis_type){
+
+	/*No loads applied, do nothing: */
+	return;
+
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "Penpair::UpdateFromInputs"
+void  Penpair::UpdateFromInputs(ParameterInputs* inputs){
+	
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Penpair::PenaltyCreateKMatrix"
+void  Penpair::PenaltyCreateKMatrix(Mat Kgg,ParameterInputs* inputs,double kmax,int analysis_type){
+	throw ErrorException(__FUNCT__," not implemented yet!");
+}
+		
+#undef __FUNCT__ 
+#define __FUNCT__ "Penpair::PenaltyCreatePVector"
+void  Penpair::PenaltyCreatePVector(Vec pg,ParameterInputs* inputs,double kmax,int analysis_type){
+	throw ErrorException(__FUNCT__," not implemented yet!");
+}
+
+Object* Penpair::copy() {
+	return new Penpair(*this); 
+}
+
Index: /issm/trunk/src/c/objects/Penpair.h
===================================================================
--- /issm/trunk/src/c/objects/Penpair.h	(revision 1)
+++ /issm/trunk/src/c/objects/Penpair.h	(revision 1)
@@ -0,0 +1,64 @@
+/*!\file Penpair.h
+ * \brief: header file for penpair object */
+
+#ifndef _PENPAIR_H_
+#define _PENPAIR_H_
+
+#include "./Load.h"
+#include "./Node.h"
+#include "./Element.h"
+
+class Penpair: public Load{
+
+	private: 
+
+		int		id;
+		double  penalty_offset; //penalty used
+		int     penalty_lock;  //maximum counter can go until locks the penalty.
+		int     numdofs; //switch from penalty pairing of 1 or 2 dofs.
+		
+		/*nodes: */
+		int     node_ids[2];
+		Node*   nodes[2];
+		int     node_offsets[2];
+
+		/*penalty pairing of one dof: */
+		int     dof;
+
+		/*penalty pairing of two dofs: */
+		int      element_ids[2];//elements for those two grids
+		Element* elements[2];
+		int      element_offsets[2];
+
+		double  friction; //friction coefficient
+		int     fill; 
+		double  normal[2];
+		double  length;
+
+	public:
+
+		Penpair();
+		Penpair(int	id, double penalty_offset,int  penalty_lock,int numdofs,int nodes_ids[2],int dof,int element_ids[2],double friction,int fill,double normal[2],double length);
+		~Penpair();
+
+		void  Echo();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		char* GetName();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   GetId(); 
+		int   MyRank();
+		void  DistributeNumDofs(int* numdofspernode,int analysis_type);
+		void  Configure(void* elements,void* nodes,void* materials);
+		void  CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type);
+		void  CreatePVector(Vec pg, ParameterInputs* inputs, int analysis_type);
+		void  UpdateFromInputs(ParameterInputs* inputs);
+		void  PenaltyCreateKMatrix(Mat Kgg,ParameterInputs* inputs,double kmax,int analysis_type);
+		void  PenaltyCreatePVector(Vec pg,ParameterInputs* inputs,double kmax,int analysis_type);
+		Object* copy();
+};
+
+#endif  /* _PENPAIR_H_ */
+
+
Index: /issm/trunk/src/c/objects/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Penta.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Penta.cpp	(revision 1)
@@ -0,0 +1,295 @@
+/*!\file Penta.c
+ * \brief: implementation of the Penta object
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "./Penta.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../shared/shared.h"
+
+Penta::Penta(){
+	return;
+}
+Penta::Penta( int penta_id, int penta_mid, int penta_mparid, int penta_node_ids[6], double penta_h[6], double penta_s[6], double penta_b[6], double penta_k[6], int penta_friction_type, 
+				double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface, double penta_fit, double penta_meanvel,double penta_epsvel, 
+				int penta_acceleration, int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6], 
+				int penta_artdiff, int penta_thermal_steadystate){
+	
+	int i;
+
+	id = penta_id;
+	mid = penta_mid; 
+	mparid = penta_mparid; 
+
+	for(i =0;i<6;i++){
+		node_ids[i] = penta_node_ids[i]; 
+		h[i] = penta_h[i]; 
+		s[i] = penta_s[i]; 
+		b[i] = penta_b[i]; 
+		k[i] = penta_k[i]; 
+		melting[i] = penta_melting[i]; 
+		accumulation[i] = penta_accumulation[i] ;
+		geothermalflux[i] = penta_geothermalflux[i]; 
+	}
+
+	friction_type = penta_friction_type; 
+	p = penta_p; 
+	q = penta_q; 
+	shelf = penta_shelf; 
+	onbed = penta_onbed; 
+	onsurface = penta_onsurface; 
+	fit = penta_fit; 
+	meanvel = penta_meanvel;
+	epsvel = penta_epsvel; 
+	acceleration = penta_acceleration; 
+	collapse = penta_collapse; 
+	artdiff = penta_artdiff; 
+	thermal_steadystate = penta_thermal_steadystate;
+
+	return;
+}
+
+Penta::~Penta(){
+	return;
+}
+void Penta::Echo(void){
+
+	printf("Penta:\n");
+	printf("   id: %i\n",id);
+	printf("   mid: %i\n",mid);
+	printf("   mparid: %i\n",mparid);
+
+	printf("   nodes=[%i,%i,%i,%i,%i,%i]\n",node_ids[0],node_ids[1],node_ids[2],node_ids[3],node_ids[4],node_ids[5]);
+	printf("   h=[%i,%i,%i,%i,%i,%i]\n",h[0],h[1],h[2],h[3],h[4],h[5]);
+	printf("   s=[%i,%i,%i,%i,%i,%i]\n",s[0],s[1],s[2],s[3],s[4],s[5]);
+	printf("   b=[%i,%i,%i,%i,%i,%i]\n",b[0],b[1],b[2],b[3],b[4],b[5]);
+	printf("   k=[%i,%i,%i,%i,%i,%i]\n",k[0],k[1],k[2],k[3],k[4],k[5]);
+	
+	printf("   friction_type: %i\n",friction_type);
+	printf("   p: %g\n",p);
+	printf("   q: %g\n",q);
+	printf("   shelf: %i\n",shelf);
+	printf("   onbed: %i\n",onbed);
+	printf("   onsurface: %i\n",onsurface);
+	printf("   fit: %g\n",fit);
+	printf("   meanvel: %g\n",meanvel);
+	printf("   epsvel: %g\n",epsvel);
+	printf("   acceleration: %i\n",acceleration);
+	printf("   collapse: %i\n",collapse);
+	
+	printf("   melting=[%i,%i,%i,%i,%i,%i]\n",melting[0],melting[1],melting[2],melting[3],melting[4],melting[5]);
+	printf("   accumulation=[%i,%i,%i,%i,%i,%i]\n",accumulation[0],accumulation[1],accumulation[2],accumulation[3],accumulation[4],accumulation[5]);
+	printf("   geothermalflux=[%i,%i,%i,%i,%i,%i]\n",geothermalflux[0],geothermalflux[1],geothermalflux[2],geothermalflux[3],geothermalflux[4],geothermalflux[5]);
+	printf("   artdiff: %i\n",artdiff);
+	printf("   thermal_steadystate: %i\n",thermal_steadystate);
+	return;
+}
+
+void  Penta::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Penta: */
+	enum_type=PentaEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Penta data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
+	memcpy(marshalled_dataset,&mparid,sizeof(mparid));marshalled_dataset+=sizeof(mparid);
+	memcpy(marshalled_dataset,&node_ids,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
+	memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
+	memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s);
+	memcpy(marshalled_dataset,&b,sizeof(b));marshalled_dataset+=sizeof(b);
+	memcpy(marshalled_dataset,&k,sizeof(k));marshalled_dataset+=sizeof(k);
+	memcpy(marshalled_dataset,&friction_type,sizeof(friction_type));marshalled_dataset+=sizeof(friction_type);
+	memcpy(marshalled_dataset,&p,sizeof(p));marshalled_dataset+=sizeof(p);
+	memcpy(marshalled_dataset,&q,sizeof(q));marshalled_dataset+=sizeof(q);
+	memcpy(marshalled_dataset,&shelf,sizeof(shelf));marshalled_dataset+=sizeof(shelf);
+	memcpy(marshalled_dataset,&onbed,sizeof(onbed));marshalled_dataset+=sizeof(onbed);
+	memcpy(marshalled_dataset,&onsurface,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface);
+	memcpy(marshalled_dataset,&fit,sizeof(fit));marshalled_dataset+=sizeof(fit);
+	memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
+	memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
+	memcpy(marshalled_dataset,&acceleration,sizeof(acceleration));marshalled_dataset+=sizeof(acceleration);
+	memcpy(marshalled_dataset,&collapse,sizeof(collapse));marshalled_dataset+=sizeof(collapse);
+	memcpy(marshalled_dataset,&melting,sizeof(melting));marshalled_dataset+=sizeof(melting);
+	memcpy(marshalled_dataset,&accumulation,sizeof(accumulation));marshalled_dataset+=sizeof(accumulation);
+	memcpy(marshalled_dataset,&geothermalflux,sizeof(geothermalflux));marshalled_dataset+=sizeof(geothermalflux);
+	memcpy(marshalled_dataset,&artdiff,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
+	memcpy(marshalled_dataset,&thermal_steadystate,sizeof(thermal_steadystate));marshalled_dataset+=sizeof(thermal_steadystate);
+	
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Penta::MarshallSize(){
+
+	return sizeof(id)+sizeof(mid)+sizeof(mparid)+sizeof(node_ids)+sizeof(h)+sizeof(s)+sizeof(b)+sizeof(k)+sizeof(friction_type)+sizeof(p)+sizeof(q)+sizeof(shelf)+sizeof(onbed)+sizeof(onsurface)+sizeof(fit)+sizeof(meanvel)+sizeof(epsvel)+sizeof(acceleration)+sizeof(collapse)+sizeof(melting)+sizeof(accumulation)+sizeof(geothermalflux)+sizeof(artdiff)+sizeof(thermal_steadystate) +sizeof(int); //sizeof(int) for enum type
+}
+
+char* Penta::GetName(void){
+	return "penta";
+}
+
+void  Penta::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
+	memcpy(&mparid,marshalled_dataset,sizeof(mparid));marshalled_dataset+=sizeof(mparid);
+	memcpy(&node_ids,marshalled_dataset,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
+	memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
+	memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s);
+	memcpy(&b,marshalled_dataset,sizeof(b));marshalled_dataset+=sizeof(b);
+	memcpy(&k,marshalled_dataset,sizeof(k));marshalled_dataset+=sizeof(k);
+	memcpy(&friction_type,marshalled_dataset,sizeof(friction_type));marshalled_dataset+=sizeof(friction_type);
+	memcpy(&p,marshalled_dataset,sizeof(p));marshalled_dataset+=sizeof(p);
+	memcpy(&q,marshalled_dataset,sizeof(q));marshalled_dataset+=sizeof(q);
+	memcpy(&shelf,marshalled_dataset,sizeof(shelf));marshalled_dataset+=sizeof(shelf);
+	memcpy(&onbed,marshalled_dataset,sizeof(onbed));marshalled_dataset+=sizeof(onbed);
+	memcpy(&onsurface,marshalled_dataset,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface);
+	memcpy(&fit,marshalled_dataset,sizeof(fit));marshalled_dataset+=sizeof(fit);
+	memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
+	memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
+	memcpy(&acceleration,marshalled_dataset,sizeof(acceleration));marshalled_dataset+=sizeof(acceleration);
+	memcpy(&collapse,marshalled_dataset,sizeof(collapse));marshalled_dataset+=sizeof(collapse);
+	memcpy(&melting,marshalled_dataset,sizeof(melting));marshalled_dataset+=sizeof(melting);
+	memcpy(&accumulation,marshalled_dataset,sizeof(accumulation));marshalled_dataset+=sizeof(accumulation);
+	memcpy(&geothermalflux,marshalled_dataset,sizeof(geothermalflux));marshalled_dataset+=sizeof(geothermalflux);
+	memcpy(&artdiff,marshalled_dataset,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
+	memcpy(&thermal_steadystate,marshalled_dataset,sizeof(thermal_steadystate));marshalled_dataset+=sizeof(thermal_steadystate);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+int Penta::Enum(void){
+
+	return PentaEnum();
+
+}
+int    Penta::GetId(void){ return id; }
+
+int    Penta::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::Configure"
+void  Penta::Configure(void* loads,void* nodes,void* materials){
+
+	throw ErrorException(__FUNCT__," not supported yet!");
+
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::CreateKMatrix"
+
+void  Penta::CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type){
+
+	throw ErrorException(__FUNCT__," not supported yet!");
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::CreatePVector"
+void  Penta::CreatePVector(Vec pg, ParameterInputs* inputs, int analysis_type){
+	
+	throw ErrorException(__FUNCT__," not supported yet!");
+
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::UpdateFromInputs"
+void  Penta::UpdateFromInputs(ParameterInputs* inputs){
+	
+	throw ErrorException(__FUNCT__," not supported yet!");
+
+}
+
+Matpar* Penta::GetMatPar(){
+	return matpar;
+}
+
+int   Penta::GetShelf(){
+	return shelf;
+}
+
+
+void  Penta::GetNodes(Node** pnodes){
+	int i;
+	for(i=0;i<6;i++){
+		pnodes[i]=nodes[i];
+	}
+}
+		
+int Penta::GetOnBed(){
+	return onbed;
+}
+
+void          Penta::GetThicknessList(double* thickness_list){
+
+	int i;
+	for(i=0;i<6;i++)thickness_list[i]=h[i];
+}
+void          Penta::GetBedList(double* bed_list){
+	
+	int i;
+	for(i=0;i<6;i++)bed_list[i]=b[i];
+
+}
+
+Object* Penta::copy() {
+	return new Penta(*this); 
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::Du"
+void  Penta::Du(Vec du_g,double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type){
+	
+	throw ErrorException(__FUNCT__," not supported yet!");
+
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::Gradj"
+void  Penta::Gradj(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type,char* control_type){
+	throw ErrorException(__FUNCT__," not supported yet!");
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::GradjDrag"
+void  Penta::GradjDrag(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type){
+	throw ErrorException(__FUNCT__," not supported yet!");
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::GradjB"
+void  Penta::GradjB(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type){
+	throw ErrorException(__FUNCT__," not supported yet!");
+}
+        
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::Misfit"
+double Penta::Misfit(double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type){
+	throw ErrorException(__FUNCT__," not supported yet!");
+}
Index: /issm/trunk/src/c/objects/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Penta.h	(revision 1)
+++ /issm/trunk/src/c/objects/Penta.h	(revision 1)
@@ -0,0 +1,94 @@
+/*! \file Penta.h 
+ *  \brief: header file for penta object
+ */
+
+#ifndef _PENTA_H
+#define _PENTA_H
+
+#include "./Object.h"
+#include "./Element.h"
+#include "./Matpar.h"
+#include "./Matice.h"
+#include "./Node.h"
+
+class Penta: public Element{
+
+	private: 
+		int id;
+		
+		/*nodes: */
+		int   node_ids[6]; //node ids
+		Node* nodes[6]; //node pointers
+		int   node_offsets[6]; //node offsets in nodes dataset
+
+		/*materials: */
+		int   mid;
+		Matice* matice; 
+		int   matice_offset;
+		
+		int mparid;
+		Matpar* matpar; 
+		int   matpar_offset;
+	
+
+		double h[6];
+		double s[6];
+		double b[6];
+		double k[6];
+		int    friction_type;
+		double p;
+		double q;
+		int    shelf;
+		int    onbed;
+		int    onsurface;
+		double fit;
+		double meanvel;/*!scaling ratio for velocities*/
+		double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
+		int    acceleration;
+		int    collapse;
+		double melting[6];
+		double accumulation[6];
+		double geothermalflux[6];
+		int    artdiff;
+		int    thermal_steadystate;
+	
+	
+	public:
+
+		Penta();
+		Penta( int id, int mid, int mparid, int g[6], double h[6], double s[6], double b[6], double k[6], int    friction_type, 
+				double p, double q, int    shelf, int    onbed, int    onsurface, double fit, double meanvel,double epsvel, 
+				int    acceleration, int    collapse, double melting[6], double accumulation[6], double geothermalflux[6], 
+				int    artdiff, int    thermal_steadystate);
+		~Penta();
+
+		void  Echo();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		char* GetName();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   GetId(); 
+		int   MyRank();
+		void  Configure(void* loads,void* nodes,void* materials);
+		void  CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type);
+		void  CreatePVector(Vec pg, ParameterInputs* inputs, int analysis_type);
+		void  UpdateFromInputs(ParameterInputs* inputs);
+		Matpar* GetMatPar();
+		int   GetShelf();
+		void  GetNodes(Node** nodes);
+		int   GetOnBed();
+		void  Du(Vec du_g,double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type);
+		void  Gradj(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type,char* control_type);
+		void  GradjDrag(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type);
+		void  GradjB(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type);
+        double Misfit(double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type);
+		
+		void          GetThicknessList(double* thickness_list);
+		void          GetBedList(double* bed_list);
+		Object* copy();
+
+
+
+};
+#endif  /* _PENTA_H */
Index: /issm/trunk/src/c/objects/Rgb.cpp
===================================================================
--- /issm/trunk/src/c/objects/Rgb.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Rgb.cpp	(revision 1)
@@ -0,0 +1,130 @@
+/*!\file Rgb.c
+ * \brief: implementation of the Rgb object
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../DataSet/DataSet.h"
+#include "./objects.h"
+
+		
+Rgb::Rgb(){
+	return;
+}
+Rgb::Rgb(int rgb_id,int rgb_nodeid1,int rgb_nodeid2, int rgb_dof){
+
+	id=rgb_id;
+	nodeid1=rgb_nodeid1;
+	nodeid2=rgb_nodeid2;
+	dof=rgb_dof;
+
+	return;
+}
+
+Rgb::~Rgb(){
+	return;
+}
+		
+void Rgb::Echo(void){
+
+	printf("Rgb:\n");
+	printf("   id: %i\n",id);
+	printf("   nodeid1: %i\n",nodeid1);
+	printf("   nodeid2: %i\n",nodeid2);
+	printf("   dof: %i\n",dof);
+	return;
+}
+		
+void  Rgb::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Rgb: */
+	enum_type=RgbEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Rgb data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&nodeid1,sizeof(nodeid1));marshalled_dataset+=sizeof(nodeid1);
+	memcpy(marshalled_dataset,&nodeid2,sizeof(nodeid2));marshalled_dataset+=sizeof(nodeid2);
+	memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Rgb::MarshallSize(){
+
+	return sizeof(id)+
+		sizeof(nodeid1)+
+		sizeof(nodeid2)+
+		sizeof(dof)+
+		sizeof(int); //sizeof(int) for enum type
+}
+
+char* Rgb::GetName(void){
+	return "rgb";
+}
+		
+
+void  Rgb::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&nodeid1,marshalled_dataset,sizeof(nodeid1));marshalled_dataset+=sizeof(nodeid1);
+	memcpy(&nodeid2,marshalled_dataset,sizeof(nodeid2));marshalled_dataset+=sizeof(nodeid2);
+	memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+int Rgb::Enum(void){
+
+	return RgbEnum();
+
+}
+int    Rgb::GetId(void){ return id; }
+
+int    Rgb::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+
+int   Rgb::GetNodeId1(){
+	
+	return nodeid1;
+}
+int   Rgb::GetNodeId2(){
+	
+	return nodeid2;
+}
+
+int Rgb::GetDof(){
+	return dof;
+}
+Object* Rgb::copy() {
+	return new Rgb(*this); 
+}
+
Index: /issm/trunk/src/c/objects/Rgb.h
===================================================================
--- /issm/trunk/src/c/objects/Rgb.h	(revision 1)
+++ /issm/trunk/src/c/objects/Rgb.h	(revision 1)
@@ -0,0 +1,42 @@
+/*!\file Rgb.h
+ * \brief: header file for rgb object
+ */
+
+#ifndef _RGB_H_
+#define _RGB_H_
+
+#include "./Object.h"
+#include "../DataSet/DataSet.h"
+
+class Rgb: public Object{
+
+	private: 
+		int	id; /*! id, to track it*/
+		int	nodeid1; 
+		int	nodeid2; 
+		int dof; /*!component*/
+
+	public:
+
+		Rgb();
+		Rgb(int rgb_id,int rgb_nodeid1,int rgb_nodeid2, int rgb_dof);
+		~Rgb();
+
+		void   Echo();
+		void   Marshall(char** pmarshalled_dataset);
+		int    MarshallSize();
+		char*  GetName();
+		void   Demarshall(char** pmarshalled_dataset);
+		int    Enum();
+		int    GetId(); 
+		int    MyRank();
+
+		/*non virtual: */
+		int    GetNodeId1();
+		int    GetNodeId2();
+		int    GetDof();
+		Object* copy();
+
+};
+
+#endif  /* _RGB_H_ */
Index: /issm/trunk/src/c/objects/SolverEnum.h
===================================================================
--- /issm/trunk/src/c/objects/SolverEnum.h	(revision 1)
+++ /issm/trunk/src/c/objects/SolverEnum.h	(revision 1)
@@ -0,0 +1,19 @@
+/*!\file: SolverEnum.h
+ * \brief prototypes for SolverEnum.h
+ */ 
+
+#ifndef _SOLVERENUM_H_
+#define  _SOLVERENUM_H_
+
+typedef enum{
+	PETSCPACKAGE,
+	MUMPSPACKAGE_LU,
+	MUMPSPACKAGE_CHOL,
+	SPOOLESPACKAGE_LU,
+	SPOOLESPACKAGE_CHOL,
+	SUPERLUDISTPACKAGE,
+} EXTERNALPACKAGES; 
+
+
+#endif //ifndef _SOLVERENUM_H_
+
Index: /issm/trunk/src/c/objects/Spc.cpp
===================================================================
--- /issm/trunk/src/c/objects/Spc.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Spc.cpp	(revision 1)
@@ -0,0 +1,128 @@
+/*!\file Spc.c
+ * \brief: implementation of the Spc object
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../DataSet/DataSet.h"
+#include "./objects.h"
+
+		
+Spc::Spc(){
+	return;
+}
+Spc::Spc(int spc_sid,int spc_nodeid, int spc_dof,double spc_value){
+
+	sid=spc_sid;
+	nodeid=spc_nodeid;
+	dof=spc_dof;
+	value=spc_value;
+
+	return;
+}
+
+Spc::~Spc(){
+	return;
+}
+		
+void Spc::Echo(void){
+
+	printf("Spc:\n");
+	printf("   sid: %i\n",sid);
+	printf("   nodeid: %i\n",nodeid);
+	printf("   dof: %i\n",dof);
+	printf("   value: %g\n",value);
+	return;
+}
+		
+void  Spc::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Spc: */
+	enum_type=SpcEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Spc data: */
+	memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
+	memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
+	memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
+	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Spc::MarshallSize(){
+
+	return sizeof(sid)+sizeof(nodeid)+sizeof(dof)+sizeof(value)+sizeof(int); //sizeof(int) for enum type
+}
+
+char* Spc::GetName(void){
+	return "spc";
+}
+		
+
+void  Spc::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
+	memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
+	memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
+	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+int Spc::Enum(void){
+
+	return SpcEnum();
+
+}
+int    Spc::GetId(void){ return sid; }
+
+int    Spc::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+void  Spc::DistributeNumDofs(int* numdofspernode,int analysis_type){return;}
+		
+int   Spc::GetNodeId(){
+	
+	return nodeid;
+}
+
+int Spc::GetDof(){
+	return dof;
+}
+
+double Spc::GetValue(){
+	return value;
+}
+
+Object* Spc::copy() {
+	return new Spc(*this); 
+}
+
Index: /issm/trunk/src/c/objects/Spc.h
===================================================================
--- /issm/trunk/src/c/objects/Spc.h	(revision 1)
+++ /issm/trunk/src/c/objects/Spc.h	(revision 1)
@@ -0,0 +1,41 @@
+/*!\file Spc.h
+ * \brief: header file for spc object
+ */
+
+#ifndef _SPC_H_
+#define _SPC_H_
+
+#include "./Object.h"
+#include "../DataSet/DataSet.h"
+
+class Spc: public Object{
+
+	private: 
+		int	sid; /*! id, to track it*/
+		int	nodeid; /*!node id*/
+		int dof; /*!component*/
+		double value; /*value*/
+
+	public:
+
+		Spc();
+		Spc(int sid,int nodeid, int dof,double value);
+		~Spc();
+
+		void   Echo();
+		void   Marshall(char** pmarshalled_dataset);
+		int    MarshallSize();
+		char*  GetName();
+		void   Demarshall(char** pmarshalled_dataset);
+		int    Enum();
+		int    GetId(); 
+		int    MyRank();
+		void   DistributeNumDofs(int* numdofspernode,int analysis_type);
+		int    GetNodeId();
+		int    GetDof();
+		double GetValue();
+		Object* copy();
+
+};
+
+#endif  /* _SPC_H_ */
Index: /issm/trunk/src/c/objects/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Tria.cpp	(revision 1)
+++ /issm/trunk/src/c/objects/Tria.cpp	(revision 1)
@@ -0,0 +1,1925 @@
+/*!\file Tria.c
+ * \brief: implementation of the Tria object
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "./Tria.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../shared/shared.h"
+#include "../DataSet/DataSet.h"
+#include "../include/typedefs.h"
+
+
+/*For debugging purposes: */
+#define ELID 141 //element for which to print debug statements
+#define RANK 2 //rank of cpu for which to print debug statements.
+//#define _DEBUGELEMENTS_
+//#define _DEBUGGAUSS_
+
+Tria::Tria(){
+	return;
+}
+
+Tria::~Tria(){
+	return;
+}
+
+Tria::Tria(int tria_id,int tria_mid,int tria_mparid,int tria_node_ids[3],double tria_h[3],double tria_s[3],double tria_b[3],double tria_k[3],
+				int tria_friction_type,double tria_p,double tria_q,int tria_shelf,double tria_fit,double tria_meanvel,double tria_epsvel,int tria_acceleration){
+	
+	int i;
+	
+	id=tria_id;
+	mid=tria_mid;
+	mparid=tria_mparid;
+	for(i=0;i<3;i++){
+		node_ids[i]=tria_node_ids[i];
+		node_offsets[i]=UNDEF;
+		nodes[i]=NULL;
+		h[i]=tria_h[i];
+		s[i]=tria_s[i];
+		b[i]=tria_b[i];
+		k[i]=tria_k[i];
+	}
+	matice=NULL;
+	matice_offset=UNDEF;
+	matpar=NULL;
+	matpar_offset=UNDEF;
+	friction_type=tria_friction_type;
+	p=tria_p;
+	q=tria_q;
+	shelf=tria_shelf;
+	fit=tria_fit;
+	meanvel=tria_meanvel;
+	epsvel=tria_epsvel;
+	acceleration=tria_acceleration;
+	onbed=1;
+	
+	return;
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "Tria::Echo"
+
+void Tria::Echo(void){
+
+	printf("Tria:\n");
+	printf("   id: %i\n",id);
+	printf("   mid: %i\n",mid);
+	printf("   mparid: %i\n",mparid);
+	printf("   node_ids=[%i,%i,%i]\n",node_ids[0],node_ids[1],node_ids[2]);
+	printf("   node_offsets=[%i,%i,%i]\n",node_offsets[0],node_offsets[1],node_offsets[2]);
+	printf("   matice_offset=%i\n",matice_offset);
+	printf("   matpar_offset=%i\n",matpar_offset);
+	printf("   h=[%g,%g,%g]\n",h[0],h[1],h[2]);
+	printf("   s=[%g,%g,%g]\n",s[0],s[1],s[2]);
+	printf("   b=[%g,%g,%g]\n",b[0],b[1],b[2]);
+	printf("   k=[%g,%g,%g]\n",k[0],k[1],k[2]);
+	printf("   friction_type: %i\n",friction_type);
+	printf("   p: %g\n",p);
+	printf("   q: %g\n",q);
+	printf("   shelf: %i\n",shelf);
+	printf("   fit: %g\n",fit);
+	printf("   meanvel: %g\n",meanvel);
+	printf("   epsvel: %g\n",epsvel);
+	printf("   acceleration: %i\n",acceleration);
+	printf("   onbed: %i\n",onbed);
+	printf("   nodes: \n");
+	if(nodes[0])nodes[0]->Echo();
+	if(nodes[1])nodes[1]->Echo();
+	if(nodes[2])nodes[2]->Echo();
+	if(matice)matice->Echo();
+	if(matpar)matpar->Echo();
+
+	return;
+}
+
+void  Tria::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Tria: */
+	enum_type=TriaEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Tria data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
+	memcpy(marshalled_dataset,&mparid,sizeof(mparid));marshalled_dataset+=sizeof(mparid);
+	memcpy(marshalled_dataset,&node_ids,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
+	memcpy(marshalled_dataset,&nodes,sizeof(nodes));marshalled_dataset+=sizeof(nodes);
+	memcpy(marshalled_dataset,&node_offsets,sizeof(node_offsets));marshalled_dataset+=sizeof(node_offsets);
+	memcpy(marshalled_dataset,&matice,sizeof(matice));marshalled_dataset+=sizeof(matice);
+	memcpy(marshalled_dataset,&matice_offset,sizeof(matice_offset));marshalled_dataset+=sizeof(matice_offset);
+	memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
+	memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
+	memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s);
+	memcpy(marshalled_dataset,&b,sizeof(b));marshalled_dataset+=sizeof(b);
+	memcpy(marshalled_dataset,&k,sizeof(k));marshalled_dataset+=sizeof(k);
+	memcpy(marshalled_dataset,&friction_type,sizeof(friction_type));marshalled_dataset+=sizeof(friction_type);
+	memcpy(marshalled_dataset,&onbed,sizeof(onbed));marshalled_dataset+=sizeof(onbed);
+	memcpy(marshalled_dataset,&p,sizeof(p));marshalled_dataset+=sizeof(p);
+	memcpy(marshalled_dataset,&q,sizeof(q));marshalled_dataset+=sizeof(q);
+	memcpy(marshalled_dataset,&shelf,sizeof(shelf));marshalled_dataset+=sizeof(shelf);
+	memcpy(marshalled_dataset,&fit,sizeof(fit));marshalled_dataset+=sizeof(fit);
+	memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
+	memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
+	memcpy(marshalled_dataset,&acceleration,sizeof(acceleration));marshalled_dataset+=sizeof(acceleration);
+	
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Tria::MarshallSize(){
+	return sizeof(id)
+		+sizeof(mid)
+		+sizeof(mparid)
+		+sizeof(node_ids)
+		+sizeof(nodes)
+		+sizeof(node_offsets)
+		+sizeof(matice)
+		+sizeof(matice_offset)
+		+sizeof(matpar)
+		+sizeof(matpar_offset)
+		+sizeof(h)
+		+sizeof(s)
+		+sizeof(b)
+		+sizeof(k)
+		+sizeof(friction_type)
+		+sizeof(onbed)
+		+sizeof(p)
+		+sizeof(q)
+		+sizeof(shelf)
+		+sizeof(fit)
+		+sizeof(meanvel)
+		+sizeof(epsvel)
+		+sizeof(acceleration)
+		+sizeof(int); //sizeof(int) for enum type
+}
+
+char* Tria::GetName(void){
+	return "tria";
+}
+
+void  Tria::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
+	memcpy(&mparid,marshalled_dataset,sizeof(mparid));marshalled_dataset+=sizeof(mparid);
+	memcpy(&node_ids,marshalled_dataset,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
+	memcpy(&nodes,marshalled_dataset,sizeof(nodes));marshalled_dataset+=sizeof(nodes);
+	memcpy(&node_offsets,marshalled_dataset,sizeof(node_offsets));marshalled_dataset+=sizeof(node_offsets);
+	memcpy(&matice,marshalled_dataset,sizeof(matice));marshalled_dataset+=sizeof(matice);
+	memcpy(&matice_offset,marshalled_dataset,sizeof(matice_offset));marshalled_dataset+=sizeof(matice_offset);
+	memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
+	memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
+	memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s);
+	memcpy(&b,marshalled_dataset,sizeof(b));marshalled_dataset+=sizeof(b);
+	memcpy(&k,marshalled_dataset,sizeof(k));marshalled_dataset+=sizeof(k);
+	memcpy(&friction_type,marshalled_dataset,sizeof(friction_type));marshalled_dataset+=sizeof(friction_type);
+	memcpy(&onbed,marshalled_dataset,sizeof(onbed));marshalled_dataset+=sizeof(onbed);
+	memcpy(&p,marshalled_dataset,sizeof(p));marshalled_dataset+=sizeof(p);
+	memcpy(&q,marshalled_dataset,sizeof(q));marshalled_dataset+=sizeof(q);
+	memcpy(&shelf,marshalled_dataset,sizeof(shelf));marshalled_dataset+=sizeof(shelf);
+	memcpy(&fit,marshalled_dataset,sizeof(fit));marshalled_dataset+=sizeof(fit);
+	memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
+	memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
+	memcpy(&acceleration,marshalled_dataset,sizeof(acceleration));marshalled_dataset+=sizeof(acceleration);
+
+	/*nodes and materials are not pointing to correct objects anymore:*/
+	for(i=0;i<3;i++)nodes[i]=NULL;
+	matice=NULL;
+	matpar=NULL;
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+int Tria::Enum(void){
+
+	return TriaEnum();
+
+}
+int    Tria::GetId(void){ return id; }
+
+int    Tria::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::Configure"
+void  Tria::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin){
+
+	int i;
+	
+	DataSet* loadsin=NULL;
+	DataSet* nodesin=NULL;
+	DataSet* materialsin=NULL;
+
+	/*Recover pointers :*/
+	loadsin=(DataSet*)ploadsin;
+	nodesin=(DataSet*)pnodesin;
+	materialsin=(DataSet*)pmaterialsin;
+
+	/*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
+	ResolvePointers((Object**)nodes,node_ids,node_offsets,3,nodesin);
+	
+	/*Same for materials: */
+	ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
+	ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::CreateKMatrix"
+
+void  Tria::CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type){
+
+	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
+	if ((analysis_type==DiagnosticHorizAnalysisEnum()) || (analysis_type==ControlAnalysisEnum())){
+
+		CreateKMatrixDiagnosticHoriz( Kgg,inputs,analysis_type);
+
+	}
+	else{
+		throw ErrorException(__FUNCT__,exprintf("%s%i%s\n","analysis: ",analysis_type," not supported yet"));
+	}
+
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::CreateKMatrixDiagnosticHoriz"
+
+void  Tria::CreateKMatrixDiagnosticHoriz(Mat Kgg,ParameterInputs* inputs,int analysis_type){
+
+
+	/* local declarations */
+	int             i,j;
+
+	/* node data: */
+	const int    numgrids=3;
+	const int    numdofs=2*numgrids;
+	double       xyz_list[numgrids][3];
+	int          doflist[numdofs];
+	int          numberofdofspernode;
+	
+	/* gaussian points: */
+	int     num_gauss,ig;
+	double* first_gauss_area_coord  =  NULL;
+	double* second_gauss_area_coord =  NULL;
+	double* third_gauss_area_coord  =  NULL;
+	double* gauss_weights           =  NULL;
+	double  gauss_weight;
+	double  gauss_l1l2l3[3];
+
+	/* material data: */
+	double viscosity; //viscosity
+	
+	/* strain rate: */
+	double epsilon[3]; /* epsilon=[exx,eyy,exy];*/
+
+	/* matrices: */
+	double B[3][numdofs];
+	double Bprime[3][numdofs];
+	double L[2][numdofs];
+	double D[3][3]={{ 0,0,0 },{0,0,0},{0,0,0}};              // material matrix, simple scalar matrix.
+	double D_scalar;
+	double DL[2][2]={{ 0,0 },{0,0}}; //for basal drag
+	double DL_scalar;
+
+	/* local element matrices: */
+	double Ke_gg[numdofs][numdofs]; //local element stiffness matrix 
+	double Ke_gg_gaussian[numdofs][numdofs]; //stiffness matrix evaluated at the gaussian point.
+	double Ke_gg_drag_gaussian[numdofs][numdofs]; //stiffness matrix contribution from drag
+	
+	double Jdet;
+	
+	/*slope: */
+	double  slope[2]={0.0,0.0};
+	double  slope_magnitude;
+
+	/*input parameters for structural analysis (diagnostic): */
+	double* velocity_param=NULL;
+	double  vxvy_list[numgrids][2];
+	double  thickness;
+
+	/*friction: */
+	double alpha2_list[numgrids]={0.0,0.0,0.0};
+	double alpha2;
+
+	double MAXSLOPE=.06; // 6 %
+	double MOUNTAINKEXPONENT=10;
+
+
+	/*First check that acceleration is not on: */
+	if (acceleration){
+		/*do nothing: */
+		return;
+	}
+
+	/*recover extra inputs from users, at current convergence iteration: */
+	velocity_param=ParameterInputsRecover(inputs,"velocity"); 
+
+	/* Get node coordinates and dof list: */
+	GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
+	GetDofList(&doflist[0],&numberofdofspernode);
+
+	/* Set Ke_gg to 0: */
+	for(i=0;i<numdofs;i++) for(j=0;j<numdofs;j++) Ke_gg[i][j]=0.0;
+
+
+	/*Initialize vxvy_list: */
+	for(i=0;i<numgrids;i++){
+		if(velocity_param){
+			vxvy_list[i][0]=velocity_param[doflist[i*numberofdofspernode+0]];
+			vxvy_list[i][1]=velocity_param[doflist[i*numberofdofspernode+1]];
+		}
+		else{
+			vxvy_list[i][0]=0;
+			vxvy_list[i][1]=0;
+		}
+	}
+
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && id==ELID){ 
+		printf("El id %i Rank %i TriaElemnet input list before gaussian loop: \n",ELID,RANK); 
+		printf("   rho_ice: %g \n",matpar->GetRhoIce());
+		printf("   gravity: %g \n",matpar->GetG())
+		printf("   rho_water: %g \n",matpar->GetRhoWater());
+		printf("   Velocity: \n");
+		for (i=0;i<numgrids;i++){
+			printf("      node %i  [%g,%g]\n",i,vxvy_list[i][0],vxvy_list[i][1]);
+		}
+		printf("   flow_law_parameter [%g ]\n",matice->GetB());
+		printf("   drag [%g %g %g ]\n",k[0],k[1],k[2]);
+		printf("   thickness [%g %g %g]\n",h[0],h[1],h[2]);
+		printf("   surface [%g %g %g ]\n",s[0],s[1],s[2]);
+		printf("   bed [%g %g %g]\n",b[0],b[1],b[2]);
+	}
+	#endif
+
+
+	/*Build alpha2_list used by drag stiffness matrix*/
+	if (!shelf && (friction_type==2)){
+		
+		/*Allocate friction object: */
+		Friction* friction=NewFriction();
+		
+		/*Initialize all fields: */
+		friction->element_type=(char*)xmalloc((strlen("2d")+1)*sizeof(char));
+		strcpy(friction->element_type,"2d");
+		
+		friction->gravity=matpar->GetG();
+		friction->rho_ice=matpar->GetRhoIce();
+		friction->rho_water=matpar->GetRhoWater();
+		friction->K=&k[0];
+		friction->bed=&b[0];
+		friction->thickness=&h[0];
+		friction->velocities=&vxvy_list[0][0];
+		friction->p=p;
+		friction->q=q;
+
+		/*Compute alpha2_list: */
+		FrictionGetAlpha2(&alpha2_list[0],friction);
+
+		/*Erase friction object: */
+		DeleteFriction(&friction);
+	}
+
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && id==ELID){ 
+		printf("   alpha2_list [%g %g %g ]\n",alpha2_list[0],alpha2_list[1],alpha2_list[2]);
+	}
+	#endif
+
+	/* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
+	GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2);
+
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && id==ELID){ 
+		printf("   gaussian points: \n");
+		for(i=0;i<num_gauss;i++){
+			printf("    %g %g %g : %g\n",first_gauss_area_coord[i],second_gauss_area_coord[i],third_gauss_area_coord[i],gauss_weights[i]);
+		}
+	}
+	#endif
+
+	/* Start  looping on the number of gaussian points: */
+	for (ig=0; ig<num_gauss; ig++){
+		/*Pick up the gaussian point: */
+		gauss_weight=*(gauss_weights+ig);
+		gauss_l1l2l3[0]=*(first_gauss_area_coord+ig); 
+		gauss_l1l2l3[1]=*(second_gauss_area_coord+ig);
+		gauss_l1l2l3[2]=*(third_gauss_area_coord+ig);
+
+
+		/*Compute thickness at gaussian point: */
+		GetParameterValue(&thickness, &h[0],gauss_l1l2l3);
+
+		// If we have a slope > 6% for this element,  it means  we are on a mountain. In this particular case, 
+		//velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */
+		if(!shelf){
+			GetParameterDerivativeValue(&slope[0], &s[0],&xyz_list[0][0], gauss_l1l2l3);
+			slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2));
+
+			if (slope_magnitude>MAXSLOPE){
+				alpha2_list[0]=pow(10,MOUNTAINKEXPONENT);
+				alpha2_list[1]=pow(10,MOUNTAINKEXPONENT);
+				alpha2_list[2]=pow(10,MOUNTAINKEXPONENT);
+			}
+		}
+
+		/*Get strain rate from velocity: */
+		GetStrainRate(&epsilon[0],&vxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3);
+		
+		/*Get viscosity: */
+		matice->GetViscosity2d(&viscosity, &epsilon[0]);
+		
+		/* Get Jacobian determinant: */
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3);
+
+		/* Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant 
+		   onto this scalar matrix, so that we win some computational time: */
+		D_scalar=viscosity*thickness*gauss_weight*Jdet;
+		for (i=0;i<3;i++){
+			D[i][i]=D_scalar;
+		}
+		
+		#ifdef _DEBUGELEMENTS_
+		if(my_rank==RANK && id==ELID){ 
+			printf("   gaussian loop %i\n",ig);
+			printf("      thickness %g\n",thickness);
+			printf("      slope [%g,%g]\n",slope[0],slope[1]);
+			printf("      alpha2_list [%g,%g,%g]\n",alpha2_list[0],alpha2_list[1],alpha2_list[2]);
+			printf("      epsilon [%g,%g,%g]\n",epsilon[0],epsilon[1],epsilon[2]);
+			printf("      Matice: \n");
+			matice->Echo();
+			printf("      Matpar: \n");
+			matpar->Echo();
+			printf("\n    viscosity: %g \n",viscosity);
+			printf("      jacobian: %g \n",Jdet);
+			printf("      gauss_weight: %g \n",gauss_weight);
+		}
+		#endif
+
+		/*Get B and Bprime matrices: */
+		GetB(&B[0][0], &xyz_list[0][0], gauss_l1l2l3);
+		GetBPrime(&Bprime[0][0], &xyz_list[0][0], gauss_l1l2l3);
+
+		/*Get L matrix if viscous basal drag present: */
+		if((friction_type==2) && (!shelf)){
+			GetL(&L[0][0], &xyz_list[0][0], gauss_l1l2l3,numberofdofspernode);
+		}	
+
+		/*  Do the triple product tB*D*Bprime: */
+		TripleMultiply( &B[0][0],3,numdofs,1,
+					  &D[0][0],3,3,0,
+					  &Bprime[0][0],3,numdofs,0,
+					  &Ke_gg_gaussian[0][0],0);
+
+		/* Add the Ke_gg_gaussian, and optionally Ke_gg_drag_gaussian onto Ke_gg: */
+		for( i=0; i<numdofs; i++) for(j=0;j<numdofs;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
+		
+		/*Now, take care of the basal friction if there is any: */
+		if((!shelf) && (friction_type==2)){
+
+			GetParameterValue(&alpha2, &alpha2_list[0],gauss_l1l2l3);
+
+			if (velocity_param){
+				DL_scalar=alpha2*gauss_weight*Jdet;
+			}
+			else{
+				DL_scalar=0;
+			}
+				
+			for (i=0;i<2;i++){
+				DL[i][i]=DL_scalar;
+			}
+			
+			/*  Do the triple producte tL*D*L: */
+			TripleMultiply( &L[0][0],2,numdofs,1,
+						&DL[0][0],2,2,0,
+						&L[0][0],2,numdofs,0,
+						&Ke_gg_drag_gaussian[0][0],0);
+
+			for( i=0; i<numdofs; i++) for(j=0;j<numdofs;j++) Ke_gg[i][j]+=Ke_gg_drag_gaussian[i][j];
+		}
+
+
+		#ifdef _DEBUGELEMENTS_
+		if(my_rank==RANK && id==ELID){ 
+			printf("      alpha2 %g\n",alpha2);
+			printf("      B:\n");
+			for(i=0;i<3;i++){
+				for(j=0;j<numdofs;j++){
+					printf("%g ",B[i][j]);
+				}
+				printf("\n");
+			}
+			printf("      Bprime:\n");
+			for(i=0;i<3;i++){
+				for(j=0;j<numdofs;j++){
+					printf("%g ",Bprime[i][j]);
+				}
+				printf("\n");
+			}
+			printf("      L:\n");
+			for(i=0;i<2;i++){
+				for(j=0;j<numdofs;j++){
+					printf("%g ",L[i][j]);
+				}
+				printf("\n");
+			}
+
+		}
+		#endif
+	} // for (ig=0; ig<num_gauss; ig++)
+
+	/*Add Ke_gg to global matrix Kgg: */
+	MatSetValues(Kgg,numdofs,doflist,numdofs,doflist,(const double*)Ke_gg,ADD_VALUES);
+
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && id==ELID){ 
+		printf("      Ke_gg erms:\n");
+		for( i=0; i<numdofs; i++){
+			for (j=0;j<numdofs;j++){
+				printf("%g ",Ke_gg[i][j]);
+			}
+			printf("\n");
+		}
+		printf("      Ke_gg row_indices:\n");
+		for( i=0; i<numdofs; i++){
+			printf("%i ",doflist[i]);
+		}
+
+	}
+	#endif
+
+	cleanup_and_return: 
+	xfree((void**)&first_gauss_area_coord);
+	xfree((void**)&second_gauss_area_coord);
+	xfree((void**)&third_gauss_area_coord);
+	xfree((void**)&gauss_weights);
+
+}
+	
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::CreatePVector"
+void  Tria::CreatePVector(Vec pg,ParameterInputs* inputs,int analysis_type){
+	
+	/*Just branch to the correct load generator, according to the type of analysis we are carrying out: */
+	if ((analysis_type==DiagnosticHorizAnalysisEnum()) || (analysis_type==ControlAnalysisEnum())){
+		CreatePVectorDiagnosticHoriz( pg,inputs,analysis_type);
+	}
+	else{
+		throw ErrorException(__FUNCT__,exprintf("%s%i%s"," analysis ",analysis_type," not supported yet"));
+	}
+
+}
+
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::CreatePVectorDiagnosticHoriz"
+
+void Tria::CreatePVectorDiagnosticHoriz( Vec pg, ParameterInputs* inputs, int analysis_type){
+
+	int             i,j;
+
+	/* node data: */
+	const int    numgrids=3;
+	const int    numdofs=2*numgrids;
+	const int    NDOF2=2;
+	double       xyz_list[numgrids][3];
+	int          doflist[numdofs];
+	int          numberofdofspernode;
+	
+	/* parameters: */
+	double  plastic_stress; 
+	double  slope[NDOF2];
+	double  driving_stress_baseline;
+
+	/* gaussian points: */
+	int     num_gauss,ig;
+	double* first_gauss_area_coord  =  NULL;
+	double* second_gauss_area_coord =  NULL;
+	double* third_gauss_area_coord  =  NULL;
+	double* gauss_weights           =  NULL;
+	double  gauss_weight;
+	double  gauss_l1l2l3[3];
+
+	/* Jacobian: */
+	double Jdet;
+
+	/*nodal functions: */
+	double l1l2l3[3];
+
+	/*element vector at the gaussian points: */
+	double  pe_g[numdofs];
+	double  pe_g_gaussian[numdofs];
+
+	/*input parameters for structural analysis (diagnostic): */
+	double  thickness;
+
+	/*First check that acceleration is not on: */
+	if (acceleration){
+		return;
+	}
+
+	/* Get node coordinates and dof list: */
+	GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
+	GetDofList(&doflist[0],&numberofdofspernode);
+
+	/* Set pe_g to 0: */
+	for(i=0;i<numdofs;i++) pe_g[i]=0.0;
+
+
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && id==ELID){ 
+		printf("gravity %g\n",matpar->GetG());
+		printf("rho_ice %g\n",matpar->GetRhoIce());
+		printf("thickness [%g,%g,%g]\n",h[0],h[1],h[2]);
+		printf("surface[%g,%g,%g]\n",s[0],s[1],s[2]);
+		printf("bed[%g,%g,%g]\n",b[0],b[1],b[2]);
+		printf("drag [%g,%g,%g]\n",k[0],k[1],k[2]);
+	}
+	#endif
+
+
+	/* Get gaussian points and weights: */
+	GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2); /*We need higher order because our load is order 2*/
+
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && id==ELID){ 
+		printf("   gaussian points: \n");
+		for(i=0;i<num_gauss;i++){
+			printf("    %g %g %g : %g\n",first_gauss_area_coord[i],second_gauss_area_coord[i],third_gauss_area_coord[i],gauss_weights[i]);
+		}
+	}
+	#endif
+
+
+
+	/* Start  looping on the number of gaussian points: */
+	for (ig=0; ig<num_gauss; ig++){
+		/*Pick up the gaussian point: */
+		gauss_weight=*(gauss_weights+ig);
+		gauss_l1l2l3[0]=*(first_gauss_area_coord+ig); 
+		gauss_l1l2l3[1]=*(second_gauss_area_coord+ig);
+		gauss_l1l2l3[2]=*(third_gauss_area_coord+ig);
+
+		/*Compute thickness at gaussian point: */
+		GetParameterValue(&thickness, &h[0],gauss_l1l2l3);
+	
+		GetParameterDerivativeValue(&slope[0], &s[0],&xyz_list[0][0], gauss_l1l2l3);
+		
+		/*In case we have plastic basal drag, compute plastic stress at gaussian point from k1, k2 and k3 fields in the 
+		 * element itself: */
+		if(friction_type==1){
+			GetParameterValue(&plastic_stress, &k[0],gauss_l1l2l3);
+		}
+
+		/* Get Jacobian determinant: */
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3);
+		
+		 /*Get nodal functions: */
+		GetNodalFunctions(l1l2l3, gauss_l1l2l3);
+
+		/*Compute driving stress: */
+		driving_stress_baseline=matpar->GetRhoIce()*matpar->GetG()*thickness;
+
+
+	 	#ifdef _DEBUGELEMENTS_
+		if(my_rank==RANK && id==ELID){ 
+			printf("      gaussian %i\n",ig);
+			printf("      thickness %g\n",thickness);
+			printf("      slope(%g,%g)\n",slope[0],slope[1]);
+			printf("      Jdet %g\n",Jdet);
+			printf("      gaussweigth %g\n",gauss_weight);
+			printf("      l1l2l3 (%g,%g,%g)\n",l1l2l3[0],l1l2l3[1],l1l2l3[2]);
+			if(friction_type==1)printf("      plastic_stress(%g)\n",plastic_stress);
+		}
+		#endif
+
+		/*Build pe_g_gaussian vector: */
+		if(friction_type==1){
+			for (i=0;i<numgrids;i++){
+				for (j=0;j<NDOF2;j++){
+					pe_g_gaussian[i*NDOF2+j]=(-driving_stress_baseline*slope[j]-plastic_stress)*Jdet*gauss_weight*l1l2l3[i]; 
+				}
+			}
+		}
+		else {
+			for (i=0;i<numgrids;i++){
+				for (j=0;j<NDOF2;j++){
+					pe_g_gaussian[i*NDOF2+j]=-driving_stress_baseline*slope[j]*Jdet*gauss_weight*l1l2l3[i];
+				}
+			}
+		}
+
+		/*Add pe_g_gaussian vector to pe_g: */
+		for( i=0; i<numdofs; i++)pe_g[i]+=pe_g_gaussian[i];
+
+	} //for (ig=0; ig<num_gauss; ig++)
+
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && id==ELID){ 
+		printf("      pe_g->terms\n",ig);
+		for( i=0; i<pe_g->nrows; i++){
+			printf("%g ",*(pe_g->terms+i));
+		}
+		printf("\n");
+		printf("      pe_g->row_indices\n",ig);
+		for( i=0; i<pe_g->nrows; i++){
+			printf("%i ",*(pe_g->row_indices+i));
+		}
+	}
+	#endif
+
+	/*Add pe_g to global vector pg: */
+	VecSetValues(pg,numdofs,doflist,(const double*)pe_g,ADD_VALUES);
+
+	cleanup_and_return: 
+	xfree((void**)&first_gauss_area_coord);
+	xfree((void**)&second_gauss_area_coord);
+	xfree((void**)&third_gauss_area_coord);
+	xfree((void**)&gauss_weights);
+
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::UpdateFromInputs"
+void  Tria::UpdateFromInputs(ParameterInputs* inputs){
+
+	int i;
+	int doflist[MAXDOFSPERNODE*3];
+	int numberofdofspernode;
+
+	double* thickness=NULL;
+	double* bed=NULL;
+	double* surface=NULL;
+	double* drag=NULL;
+	double* temperature_average_param=NULL;
+	double* flow_law_param=NULL;
+	double temperature_average;
+	double B_average;
+
+
+
+	/*Get dof list: */
+	GetDofList(&doflist[0],&numberofdofspernode);
+
+	/*Update internal data if inputs holds new values: */
+	thickness=ParameterInputsRecover(inputs,"thickness");
+	bed=ParameterInputsRecover(inputs,"bed");
+	surface=ParameterInputsRecover(inputs,"surface");
+	drag=ParameterInputsRecover(inputs,"drag");
+
+	for(i=0;i<3;i++){
+		if(thickness)h[i]=thickness[doflist[i*numberofdofspernode+0]];
+		if(bed)b[i]=bed[doflist[i*numberofdofspernode+0]];
+		if(surface)s[i]=surface[doflist[i*numberofdofspernode+0]];
+		if(drag)k[i]=drag[doflist[i*numberofdofspernode+0]];
+	}
+
+	//Update material if necessary
+	temperature_average_param=ParameterInputsRecover(inputs,"temperature_average");
+	flow_law_param=ParameterInputsRecover(inputs,"B");
+	if(temperature_average_param){
+		for(i=0;i<3;i++) temperature_average+=temperature_average_param[doflist[i*numberofdofspernode+0]];
+		temperature_average=temperature_average/3.0;
+		B_average=Paterson(temperature_average);
+		matice->SetB(B_average);
+	}
+
+	//Update material if B is provided.
+	if(flow_law_param){
+		for(i=0;i<3;i++) B_average+=flow_law_param[doflist[i*numberofdofspernode+0]];
+		B_average=B_average/3.0;
+		matice->SetB(B_average);
+	}
+
+}
+		
+void  Tria::GetDofList(int* doflist,int* pnumberofdofspernode){
+
+	int i,j;
+	int doflist_per_node[MAXDOFSPERNODE];
+	int numberofdofspernode;
+	
+	for(i=0;i<3;i++){
+		nodes[i]->GetDofList(&doflist_per_node[0],&numberofdofspernode);
+		for(j=0;j<numberofdofspernode;j++){
+			doflist[i*numberofdofspernode+j]=doflist_per_node[j];
+		}
+	}
+
+	/*Assign output pointers:*/
+	*pnumberofdofspernode=numberofdofspernode;
+
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetParameterValue"
+void Tria::GetParameterValue(double* pp, double* plist, double* gauss_l1l2l3){
+	
+	/*From node values of parameter p (plist[0],plist[1],plist[2]), return parameter value at gaussian 
+	 * point specifie by gauss_l1l2l3: */
+	
+	/*nodal functions: */
+	double l1l2l3[3];
+
+	/*output: */
+	double p;
+
+	GetNodalFunctions(l1l2l3, gauss_l1l2l3);
+
+	p=l1l2l3[0]*plist[0]+l1l2l3[1]*plist[1]+l1l2l3[2]*plist[2];
+
+	/*Assign output pointers:*/
+	*pp=p;
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetParameterDerivativeValue"
+void Tria::GetParameterDerivativeValue(double* p, double* plist,double* xyz_list, double* gauss_l1l2l3){
+	 
+	const int NDOF2=2;
+	const int numgrids=3;
+	/*From node values of parameter p (plist[0],plist[1],plist[2]), return parameter derivative value at gaussian 
+	 * point specified by gauss_l1l2l3:
+	 *   dp/dx=plist[0]*dh1/dx+plist[1]*dh2/dx+plist[2]*dh3/dx
+	 *   dp/dx=plist[0]*dh1/dx+plist[1]*dh2/dx+plist[2]*dh3/dx
+	 *
+	 * p is a vector of size 2x1 already allocated.
+	 */
+	
+	double dh1dh2dh3_basic[NDOF2][numgrids]; //nodal derivative functions in basic coordinate system.
+
+	/*Get dh1dh2dh3 in basic coordinate system: */
+	GetNodalFunctionsDerivativesBasic(&dh1dh2dh3_basic[0][0],xyz_list, gauss_l1l2l3);
+
+	*(p+0)=plist[0]*dh1dh2dh3_basic[0][0]+plist[1]*dh1dh2dh3_basic[0][1]+plist[2]*dh1dh2dh3_basic[0][2];
+	*(p+1)=plist[0]*dh1dh2dh3_basic[1][0]+plist[1]*dh1dh2dh3_basic[1][1]+plist[2]*dh1dh2dh3_basic[1][2];
+
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetStrainRate"
+void Tria::GetStrainRate(double* epsilon, double* velocity, double* xyz_list, double* gauss_l1l2l3){
+
+	int i;
+	const int NDOF2=2;
+	const int numgrids=3;
+
+	double B[3][NDOF2*numgrids];
+
+	/*Get B matrix: */
+	GetB(&B[0][0], xyz_list, gauss_l1l2l3);
+
+	#ifdef _DEBUG_
+	printf("B for grid1 : [ %lf   %lf  \n",B[0][0],B[0][1]);
+	printf("              [ %lf   %lf  \n",B[1][0],B[1][1]);
+	printf("              [ %lf   %lf  ]\n",B[2][0],B[2][1]);
+
+	printf("B for grid2 : [ %lf   %lf  \n",B[0][2],B[0][3]);
+	printf("              [ %lf   %lf  \n",B[1][2],B[1][3]);
+	printf("              [ %lf   %lf  ]\n",B[2][2],B[2][3]);
+
+	printf("B for grid3 : [ %lf   %lf  \n",B[0][4],B[0][5]);
+	printf("              [ %lf   %lf  \n",B[1][4],B[1][5]);
+	printf("              [ %lf   %lf  ]\n",B[2][4],B[2][5]);
+		
+	for (i=0;i<numgrids;i++){
+		printf("Velocity for grid %i %lf %lf\n",i,*(vxvy_list+2*i+0),*(vxvy_list+2*i+1));
+	}
+	#endif
+
+	/*Multiply B by velocity, to get strain rate: */
+	MatrixMultiply( &B[0][0],3,NDOF2*numgrids,0,
+			              velocity,NDOF2*numgrids,1,0,
+						  epsilon,0);
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetJacobianDeterminant" 
+void Tria::GetJacobianDeterminant(double*  Jdet, double* xyz_list,double* gauss_l1l2l3){
+
+	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+
+	double x1,x2,x3,y1,y2,y3;
+	
+	x1=*(xyz_list+3*0+0);
+	y1=*(xyz_list+3*0+1);
+	x2=*(xyz_list+3*1+0);
+	y2=*(xyz_list+3*1+1);
+	x3=*(xyz_list+3*2+0);
+	y3=*(xyz_list+3*2+1);
+
+
+	*Jdet=sqrt(3.0)/6.0*((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1));
+
+	if(Jdet<0){
+		printf("%s%s\n",__FUNCT__," error message: negative jacobian determinant!");
+	}
+	
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetB"
+
+void Tria::GetB(double* B, double* xyz_list, double* gauss_l1l2l3){
+
+	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
+	 * For grid i, Bi can be expressed in the basic coordinate system
+	 * by: 
+	 *       Bi_basic=[ dh/dx    0    ]
+	 *                [   0    dh/dy  ]
+	 *                [ 1/2*dh/dy  1/2*dh/dx  ]
+	 * where h is the interpolation function for grid i.
+	 *
+	 * We assume B has been allocated already, of size: 3x(NDOF2*numgrids)
+	 */
+	
+	int i;
+	const int NDOF2=2;
+	const int numgrids=3;
+
+	double dh1dh2dh3_basic[NDOF2][numgrids];
+
+
+	/*Get dh1dh2dh3 in basic coordinate system: */
+	GetNodalFunctionsDerivativesBasic(&dh1dh2dh3_basic[0][0],xyz_list, gauss_l1l2l3);
+
+	#ifdef _DEBUG_ 
+	for (i=0;i<3;i++){
+		printf("Node %i  dh/dx=%lf dh/dy=%lf \n",i,dh1dh2dh3_basic[0][i],dh1dh2dh3_basic[1][i]);
+	}
+	#endif
+
+	/*Build B: */
+	for (i=0;i<numgrids;i++){
+		*(B+NDOF2*numgrids*0+NDOF2*i)=dh1dh2dh3_basic[0][i]; //B[0][NDOF2*i]=dh1dh2dh3_basic[0][i];
+		*(B+NDOF2*numgrids*0+NDOF2*i+1)=0;
+		*(B+NDOF2*numgrids*1+NDOF2*i)=0;
+		*(B+NDOF2*numgrids*1+NDOF2*i+1)=dh1dh2dh3_basic[1][i];
+		*(B+NDOF2*numgrids*2+NDOF2*i)=(float).5*dh1dh2dh3_basic[1][i]; 
+		*(B+NDOF2*numgrids*2+NDOF2*i+1)=(float).5*dh1dh2dh3_basic[0][i]; 
+	}
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetBPrime"
+
+void Tria::GetBPrime(double* Bprime, double* xyz_list, double* gauss_l1l2l3){
+
+	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 
+	 * For grid i, Bi' can be expressed in the basic coordinate system
+	 * by: 
+	 *       Bi_prime__basic=[ 2*dh/dx dh/dy ]
+	 *                       [ dh/dx  2*dh/dy]
+	 *                       [dh/dy dh/dx]
+	 * where h is the interpolation function for grid i.
+	 *
+	 * We assume B' has been allocated already, of size: 3x(NDOF2*numgrids)
+	 */
+	
+	int i;
+	const int NDOF2=2;
+	const int numgrids=3;
+
+	/*Same thing in the basic coordinate system: */
+	double dh1dh2dh3_basic[NDOF2][numgrids];
+
+
+	/*Get dh1dh2dh3 in basic coordinates system : */
+	GetNodalFunctionsDerivativesBasic(&dh1dh2dh3_basic[0][0],xyz_list,gauss_l1l2l3);
+
+	/*Build B': */
+	for (i=0;i<numgrids;i++){
+		*(Bprime+NDOF2*numgrids*0+NDOF2*i)=2*dh1dh2dh3_basic[0][i]; 
+		*(Bprime+NDOF2*numgrids*0+NDOF2*i+1)=dh1dh2dh3_basic[1][i]; 
+		*(Bprime+NDOF2*numgrids*1+NDOF2*i)=dh1dh2dh3_basic[0][i]; 
+		*(Bprime+NDOF2*numgrids*1+NDOF2*i+1)=2*dh1dh2dh3_basic[1][i]; 
+		*(Bprime+NDOF2*numgrids*2+NDOF2*i)=dh1dh2dh3_basic[1][i]; 
+		*(Bprime+NDOF2*numgrids*2+NDOF2*i+1)=dh1dh2dh3_basic[0][i]; 
+	}
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetL"
+
+void Tria::GetL(double* L, double* xyz_list, double* gauss_l1l2l3,int numdof){
+
+	/*Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
+	 * For grid i, Li can be expressed in the basic coordinate system
+	 * by: 
+	 *       numdof=1: 
+	 *       Li_basic=h;
+	 *       numdof=2:
+	 *       Li_basic=[ h    0    ]
+	 *                [   0   h  ]
+	 * where h is the interpolation function for grid i.
+	 *
+	 * We assume L has been allocated already, of size: numgrids (numdof=1), or numdofx(numdof*numgrids) (numdof=2)
+	 */
+	
+	int i;
+	const int NDOF2=2;
+	const int numgrids=3;
+
+	double l1l2l3[3];
+
+
+	/*Get l1l2l3 in basic coordinate system: */
+	GetNodalFunctions(l1l2l3, gauss_l1l2l3);
+
+	#ifdef _DELUG_ 
+	for (i=0;i<3;i++){
+		printf("Node %i  h=%lf \n",i,l1l2l3[i]);
+	}
+	#endif
+
+	/*Build L: */
+	if(numdof==1){
+		for (i=0;i<numgrids;i++){
+			L[i]=l1l2l3[i]; 
+		}
+	}
+	else{
+		for (i=0;i<numgrids;i++){
+			*(L+numdof*numgrids*0+numdof*i)=l1l2l3[i]; //L[0][NDOF2*i]=dh1dh2dh3_basic[0][i];
+			*(L+numdof*numgrids*0+numdof*i+1)=0;
+			*(L+numdof*numgrids*1+numdof*i)=0;
+			*(L+numdof*numgrids*1+numdof*i+1)=l1l2l3[i];
+		}
+	}
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetNodalFunctions"
+void Tria::GetNodalFunctions(double* l1l2l3, double* gauss_l1l2l3){
+	
+	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+
+	/*First nodal function: */
+	l1l2l3[0]=gauss_l1l2l3[0];
+
+	/*Second nodal function: */
+	l1l2l3[1]=gauss_l1l2l3[1];
+
+	/*Third nodal function: */
+	l1l2l3[2]=gauss_l1l2l3[2];
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetNodalFunctionsDerivativesBasic"
+void Tria::GetNodalFunctionsDerivativesBasic(double* dh1dh2dh3_basic,double* xyz_list, double* gauss_l1l2l3){
+	
+	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+	 * basic coordinate system: */
+
+	int i;
+	const int NDOF2=2;
+	const int numgrids=3;
+
+	double dh1dh2dh3_param[NDOF2][numgrids];
+	double Jinv[NDOF2][NDOF2];
+
+
+	/*Get derivative values with respect to parametric coordinate system: */
+	GetNodalFunctionsDerivativesParams(&dh1dh2dh3_param[0][0], gauss_l1l2l3); 
+
+	/*Get Jacobian invert: */
+	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss_l1l2l3);
+
+	/*Build dh1dh2dh3_basic: 
+	 *
+	 * [dhi/dx]= Jinv*[dhi/dr]
+	 * [dhi/dy]       [dhi/ds]
+	 */
+
+	for (i=0;i<numgrids;i++){
+		*(dh1dh2dh3_basic+numgrids*0+i)=Jinv[0][0]*dh1dh2dh3_param[0][i]+Jinv[0][1]*dh1dh2dh3_param[1][i];
+		*(dh1dh2dh3_basic+numgrids*1+i)=Jinv[1][0]*dh1dh2dh3_param[0][i]+Jinv[1][1]*dh1dh2dh3_param[1][i];
+	}
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetNodalFunctionsDerivativesParams"
+void Tria::GetNodalFunctionsDerivativesParams(double* dl1dl2dl3,double* gauss_l1l2l3){
+	
+	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+	 * natural coordinate system) at the gaussian point. */
+
+	const int NDOF2=2;
+	const int numgrids=3;
+
+	double sqrt3=sqrt(3.0);
+
+	/*First nodal function: */
+	*(dl1dl2dl3+numgrids*0+0)=-1.0/2.0; 
+	*(dl1dl2dl3+numgrids*1+0)=-1.0/(2.0*sqrt3);
+
+	/*Second nodal function: */
+	*(dl1dl2dl3+numgrids*0+1)=1.0/2.0;
+	*(dl1dl2dl3+numgrids*1+1)=-1.0/(2.0*sqrt3);
+
+	/*Third nodal function: */
+	*(dl1dl2dl3+numgrids*0+2)=0;
+	*(dl1dl2dl3+numgrids*1+2)=1.0/sqrt3;
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetJacobianInvert"
+void Tria::GetJacobianInvert(double*  Jinv, double* xyz_list,double* gauss_l1l2l3){
+
+	double Jdet;
+	const int NDOF2=2;
+	const int numgrids=3;
+	
+	/*Call Jacobian routine to get the jacobian:*/
+	GetJacobian(Jinv, xyz_list, gauss_l1l2l3);
+
+	/*Invert Jacobian matrix: */
+	MatrixInverse(Jinv,NDOF2,NDOF2,NULL,0,&Jdet);
+		
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GetJacobian"
+void Tria::GetJacobian(double* J, double* xyz_list,double* gauss_l1l2l3){
+
+	/*The Jacobian is constant over the element, discard the gaussian points. 
+	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+
+	const int NDOF2=2;
+	const int numgrids=3;
+	double x1,y1,x2,y2,x3,y3;
+	double sqrt3=sqrt(3.0);
+	
+	x1=*(xyz_list+numgrids*0+0);
+	y1=*(xyz_list+numgrids*0+1);
+	x2=*(xyz_list+numgrids*1+0);
+	y2=*(xyz_list+numgrids*1+1);
+	x3=*(xyz_list+numgrids*2+0);
+	y3=*(xyz_list+numgrids*2+1);
+
+
+	*(J+NDOF2*0+0)=1.0/2.0*(x2-x1);
+	*(J+NDOF2*1+0)=sqrt3/6.0*(2*x3-x1-x2);
+	*(J+NDOF2*0+1)=1.0/2.0*(y2-y1);
+	*(J+NDOF2*1+1)=sqrt3/6.0*(2*y3-y1-y2);
+}
+
+Matpar* Tria::GetMatPar(){
+	return matpar;
+}
+
+int   Tria::GetShelf(){
+	return shelf;
+}
+
+		
+void  Tria::GetNodes(Node** pnodes){
+	int i;
+	for(i=0;i<3;i++){
+		pnodes[i]=nodes[i];
+	}
+}
+		
+
+int Tria::GetOnBed(){
+	return onbed;
+}
+
+void          Tria::GetThicknessList(double* thickness_list){
+
+	int i;
+	for(i=0;i<3;i++)thickness_list[i]=h[i];
+}
+void          Tria::GetBedList(double* bed_list){
+	
+	int i;
+	for(i=0;i<3;i++)bed_list[i]=b[i];
+
+}
+  
+
+Object* Tria::copy() {
+	return new Tria(*this); 
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::Du"
+void Tria::Du(Vec du_g,double* velocity,double* obs_velocity,ParameterInputs* inputs,int analysis_type){
+
+	int i;
+	
+	/* node data: */
+	const int    numgrids=3;
+	const int    numdofs=2*numgrids;
+	const int    NDOF2=2;
+	double       xyz_list[numgrids][3];
+	int          doflist[numdofs];
+	int          numberofdofspernode;
+
+	/* grid data: */
+	double vx_list[numgrids];
+	double vy_list[numgrids];
+	double obs_vx_list[numgrids];
+	double obs_vy_list[numgrids];
+
+	/* gaussian points: */
+	int     num_gauss,ig;
+	double* first_gauss_area_coord  =  NULL;
+	double* second_gauss_area_coord =  NULL;
+	double* third_gauss_area_coord  =  NULL;
+	double* gauss_weights           =  NULL;
+	double  gauss_weight;
+	double  gauss_l1l2l3[3];
+
+	/* parameters: */
+	double  velocity_x,velocity_y,velocity_mag;
+	double  obs_velocity_x,obs_velocity_y,obs_velocity_mag;
+
+	/*element vector : */
+	double  due_g[numdofs];
+	double  due_g_gaussian[numdofs];
+
+	/* Jacobian: */
+	double Jdet;
+
+	/*nodal functions: */
+	double l1l2l3[3];
+
+	/*relative and algorithmic fitting: */
+	double meanvel=0;
+	double epsvel=0;
+	double scalex=1;
+	double scaley=1;
+	double scale=0;
+	double* fit_param=NULL;
+	double  fit=-1;
+
+	/* Get node coordinates and dof list: */
+	GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
+	GetDofList(&doflist[0],&numberofdofspernode);
+
+	/* Set due_g to 0: */
+	for(i=0;i<numdofs;i++) due_g[i]=0.0;
+
+	/* Recover input data: */
+	fit_param=ParameterInputsRecover(inputs,"fit");
+	if(fit_param){
+		fit=*fit_param;
+	}
+
+	/*Initialize velocities: */
+	for(i=0;i<numgrids;i++){
+		vx_list[i]=velocity[doflist[i*numberofdofspernode+0]];
+		vy_list[i]=velocity[doflist[i*numberofdofspernode+1]];
+		obs_vx_list[i]=obs_velocity[doflist[i*numberofdofspernode+0]];
+		obs_vy_list[i]=obs_velocity[doflist[i*numberofdofspernode+1]];
+
+	}
+
+	
+	/* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
+	GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2);
+
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && id==ELID){ 
+		printf("   gaussian points: \n");
+		for(i=0;i<num_gauss;i++){
+			printf("    %g %g %g : %g\n",first_gauss_area_coord[i],second_gauss_area_coord[i],third_gauss_area_coord[i],gauss_weights[i]);
+		}
+	}
+	#endif
+	
+	/* Start  looping on the number of gaussian points: */
+	for (ig=0; ig<num_gauss; ig++){
+		/*Pick up the gaussian point: */
+		gauss_weight=*(gauss_weights+ig);
+		gauss_l1l2l3[0]=*(first_gauss_area_coord+ig); 
+		gauss_l1l2l3[1]=*(second_gauss_area_coord+ig);
+		gauss_l1l2l3[2]=*(third_gauss_area_coord+ig);
+
+		
+		/*Compute velocities at gaussian point: */
+		GetParameterValue(&velocity_x, &vx_list[0],gauss_l1l2l3);
+		GetParameterValue(&velocity_y, &vy_list[0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+			printf("Velocity: %lf %lf\n", velocity_x,velocity_y);
+		#endif
+	
+		/*Compute obs_velocities at gaussian point: */
+		GetParameterValue(&obs_velocity_x, &obs_vx_list[0],gauss_l1l2l3);
+		GetParameterValue(&obs_velocity_y, &obs_vy_list[0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+			printf("Observed velocity: %g %g\n", obs_velocity_x,obs_velocity_y);
+		#endif
+
+		/* Get Jacobian determinant: */
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+		printf("Element id %i Jacobian determinant: %lf\n",TriaElementGetID(this),Jdet);
+		#endif
+		
+		/* Get nodal functions value at gaussian point:*/
+		GetNodalFunctions(l1l2l3, gauss_l1l2l3);
+
+		/*Build due_g_gaussian vector: we have three cases here, according to which type of misfit we are using. */
+		if(fit==0){
+			/*We are using an absolute misfit: */
+			for (i=0;i<numgrids;i++){
+				due_g_gaussian[i*NDOF2+0]=(velocity_x-obs_velocity_x)*Jdet*gauss_weight*l1l2l3[i]; 
+				due_g_gaussian[i*NDOF2+1]=(velocity_y-obs_velocity_y)*Jdet*gauss_weight*l1l2l3[i]; 
+			}
+		}
+		else if(fit==1){
+			/*We are using a relative misfit: */
+			scalex=pow(meanvel/(obs_velocity_x+epsvel),2);
+			scaley=pow(meanvel/(obs_velocity_y+epsvel),2);
+			if(obs_velocity_x==0)scalex=0;
+			if(obs_velocity_y==0)scaley=0;
+			for (i=0;i<numgrids;i++){
+				due_g_gaussian[i*NDOF2+0]=scalex*(velocity_x-obs_velocity_x)*Jdet*gauss_weight*l1l2l3[i]; 
+				due_g_gaussian[i*NDOF2+1]=scaley*(velocity_y-obs_velocity_y)*Jdet*gauss_weight*l1l2l3[i]; 
+			}
+		}
+		else if(fit==2){
+
+			/*We are using a logarithmic misfit: */
+			velocity_mag=sqrt(pow(velocity_x,2)+pow(velocity_y,2))+epsvel; //epsvel to avoid velocity being nil.
+			obs_velocity_mag=sqrt(pow(obs_velocity_x,2)+pow(obs_velocity_y,2))+epsvel; //epsvel to avoid observed velocity being nil.
+			scale=8*pow(meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);
+			for (i=0;i<numgrids;i++){
+				due_g_gaussian[i*NDOF2+0]=scale*velocity_x*Jdet*gauss_weight*l1l2l3[i]; 
+				due_g_gaussian[i*NDOF2+1]=scale*velocity_y*Jdet*gauss_weight*l1l2l3[i]; 
+			}
+		}
+		else{
+			/*Not supported yet! : */
+			throw ErrorException(__FUNCT__,exprintf("%s%g","unsupported type of fit: ",fit));
+		}
+		
+		
+		/*Add due_g_gaussian vector to due_g: */
+		for( i=0; i<numdofs; i++){
+			due_g[i]+=due_g_gaussian[i];
+		}
+	}
+	
+	
+	/*Add due_g to global vector du_g: */
+	VecSetValues(du_g,numdofs,doflist,(const double*)due_g,ADD_VALUES);
+	
+	cleanup_and_return: 
+	xfree((void**)&first_gauss_area_coord);
+	xfree((void**)&second_gauss_area_coord);
+	xfree((void**)&third_gauss_area_coord);
+	xfree((void**)&gauss_weights);
+
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::Gradj"
+void  Tria::Gradj(Vec grad_g,double* velocity,double* adjoint,ParameterInputs* inputs,int analysis_type,char* control_type){
+
+	if (strcmp(control_type,"drag")==0){
+		GradjDrag( grad_g,velocity,adjoint,inputs,analysis_type);
+	}
+	else if (strcmp(control_type,"B")==0){
+		GradjB( grad_g, velocity, adjoint, inputs,analysis_type);
+	}
+	else throw ErrorException(__FUNCT__,exprintf("%s%s","control type not supported yet: ",control_type));
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GradjDrag"
+void  Tria::GradjDrag(Vec grad_g,double* velocity,double* adjoint,ParameterInputs* inputs,int analysis_type){
+
+
+	int i;
+
+	/* node data: */
+	const int    numgrids=3;
+	const int    numdofs=2*numgrids;
+	const int    NDOF2=2;
+	double       xyz_list[numgrids][3];
+	int          doflist[numdofs];
+	int          numberofdofspernode;
+
+	/* grid data: */
+	double vx_list[numgrids];
+	double vy_list[numgrids];
+	double vxvy_list[numgrids][2];
+	double adjx_list[numgrids];
+	double adjy_list[numgrids];
+
+	double* basal_drag_param=NULL;
+	double K_list[numgrids];
+	double drag;
+
+	double* bed_param=NULL;
+	double bed_list[numgrids];
+	double* thickness_param=NULL;
+	double thickness_list[numgrids];
+
+	/* gaussian points: */
+	int     num_gauss,ig;
+	double* first_gauss_area_coord  =  NULL;
+	double* second_gauss_area_coord =  NULL;
+	double* third_gauss_area_coord  =  NULL;
+	double* gauss_weights           =  NULL;
+	double  gauss_weight;
+	double  gauss_l1l2l3[3];
+
+	/* parameters: */
+	double  viscosity2;
+	double  dvx[NDOF2];
+	double  dvy[NDOF2]; 
+	double  dadjx[NDOF2];
+	double  dadjy[NDOF2];
+	double  vx,vy;
+	double  lambda,mu;
+	double  bed,thickness,Neff;
+	
+	/*drag: */
+	double  pcoeff,qcoeff;
+	double alpha_complement_list[numgrids];
+	double alpha_complement;
+
+
+	/*element vector at the gaussian points: */
+	double  grade_g[numgrids];
+	double  grade_g_gaussian[numgrids];
+
+	/* Jacobian: */
+	double Jdet;
+
+	/*nodal functions: */
+	double l1l2l3[3];
+
+	/* strain rate: */
+	double epsilon[3]; /* epsilon=[exx,eyy,exy];*/
+
+	/* Get node coordinates and dof list: */
+	GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
+	GetDofList(&doflist[0],&numberofdofspernode);
+
+	/* Set grade_g to 0: */
+	for(i=0;i<numdofs;i++) grade_g[i]=0.0;
+
+	/* recover input parameters: */
+	basal_drag_param=ParameterInputsRecover(inputs,"drag");
+	bed_param=ParameterInputsRecover(inputs,"bed");
+	thickness_param=ParameterInputsRecover(inputs,"thickness");
+
+	/*Initialize parameter lists: */
+	for(i=0;i<numgrids;i++){
+		vx_list[i]=velocity[doflist[i*numberofdofspernode+0]];
+		vy_list[i]=velocity[doflist[i*numberofdofspernode+1]];
+		vxvy_list[i][0]=vx_list[i];
+		vxvy_list[i][1]=vy_list[i];
+		adjx_list[i]=adjoint[doflist[i*numberofdofspernode+0]];
+		adjy_list[i]=adjoint[doflist[i*numberofdofspernode+1]];
+		if(basal_drag_param){
+			K_list[i]=basal_drag_param[doflist[i*numberofdofspernode+0]];
+		}
+		else{
+			K_list[i]=k[i];
+		}
+		if(bed_param){
+			bed_list[i]=bed_param[doflist[i*numberofdofspernode+0]];
+		}
+		else{
+			bed_list[i]=b[i];
+		}
+		if(thickness_param){
+			thickness_list[i]=thickness_param[doflist[i*numberofdofspernode+0]];
+		}
+		else{
+			thickness_list[i]=h[i];
+		}
+	}
+	
+	/* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
+	GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 4);
+
+	#ifdef _DEBUGELEMENTS_
+	if(my_rank==RANK && id==ELID){ 
+		printf("   gaussian points: \n");
+		for(i=0;i<num_gauss;i++){
+			printf("    %g %g %g : %g\n",first_gauss_area_coord[i],second_gauss_area_coord[i],third_gauss_area_coord[i],gauss_weights[i]);
+		}
+	}
+	#endif
+	
+	/* Start  looping on the number of gaussian points: */
+	for (ig=0; ig<num_gauss; ig++){
+		/*Pick up the gaussian point: */
+		gauss_weight=*(gauss_weights+ig);
+		gauss_l1l2l3[0]=*(first_gauss_area_coord+ig); 
+		gauss_l1l2l3[1]=*(second_gauss_area_coord+ig);
+		gauss_l1l2l3[2]=*(third_gauss_area_coord+ig);
+
+		/*Build alpha_complement_list: */
+		if (!shelf && (friction_type==2)){
+		
+			/*Allocate friction object: */
+			Friction* friction=NewFriction();
+			
+			/*Initialize all fields: */
+			friction->element_type=(char*)xmalloc((strlen("2d")+1)*sizeof(char));
+			strcpy(friction->element_type,"2d");
+			
+			friction->gravity=matpar->GetG();
+			friction->rho_ice=matpar->GetRhoIce();
+			friction->rho_water=matpar->GetRhoWater();
+			friction->K=&K_list[0];
+			friction->bed=&bed_list[0];
+			friction->thickness=&thickness_list[0];
+			friction->velocities=&vxvy_list[0][0];
+			friction->p=p;
+			friction->q=q;
+
+			if(friction->p!=1) throw ErrorException(__FUNCT__,"non-linear friction not supported yet in control methods!");
+
+			/*Compute alpha complement: */
+			FrictionGetAlphaComplement(&alpha_complement_list[0],friction);
+
+			/*Erase friction object: */
+			DeleteFriction(&friction);
+		}
+		else{
+			alpha_complement_list[0]=0;
+			alpha_complement_list[1]=0;
+			alpha_complement_list[2]=0;
+		}
+	
+		/*Recover alpha_complement and k: */
+		GetParameterValue(&alpha_complement, &alpha_complement_list[0],gauss_l1l2l3);
+		GetParameterValue(&drag, &K_list[0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+			printf("Drag complement: %20.20lf Drag: %20.20lf\n",alpha_complement,drag);
+		#endif
+
+		/*recover lambda and mu: */
+		GetParameterValue(&lambda, &adjx_list[0],gauss_l1l2l3);
+		GetParameterValue(&mu, &adjy_list[0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+			printf("Adjoint vector %20.20lf %20.20lf\n",lambda,mu);
+		#endif
+			
+		/*recover vx and vy: */
+		GetParameterValue(&vx, &vx_list[0],gauss_l1l2l3);
+		GetParameterValue(&vy, &vy_list[0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+			printf("Velocity vector %20.20lf %20.20lf\n",vx,vy);
+		#endif
+
+		/* Get Jacobian determinant: */
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+		printf("Element id %i Jacobian determinant: %lf\n",TriaElementGetID(this),Jdet);
+		#endif
+		
+		/* Get nodal functions value at gaussian point:*/
+		GetNodalFunctions(l1l2l3, gauss_l1l2l3);
+
+		/*Build gradje_g_gaussian vector: */
+		for (i=0;i<numgrids;i++){
+			grade_g_gaussian[i]=-2*drag*alpha_complement*( (lambda*vx+mu*vy))*Jdet*gauss_weight*l1l2l3[i]; 
+		}
+		
+		/*Add gradje_g_gaussian vector to gradje_g: */
+		for( i=0; i<numdofs; i++)grade_g[i]+=grade_g_gaussian[i];
+	}
+
+	/*Add grade_g to global vector grad_g: */
+	VecSetValues(grad_g,numdofs,doflist,(const double*)grade_g,ADD_VALUES);
+	
+	cleanup_and_return: 
+	xfree((void**)&first_gauss_area_coord);
+	xfree((void**)&second_gauss_area_coord);
+	xfree((void**)&third_gauss_area_coord);
+	xfree((void**)&gauss_weights);
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::GradjB"
+void  Tria::GradjB(Vec grad_g,double* velocity,double* adjoint,ParameterInputs* inputs,int analysis_type){
+
+	int i;
+
+	/* node data: */
+	const int    numgrids=3;
+	const int    numdofs=2*numgrids;
+	const int    NDOF2=2;
+	double       xyz_list[numgrids][3];
+	int          doflist[numdofs];
+	int          numberofdofspernode;
+
+	/* grid data: */
+	double vx_list[numgrids];
+	double vy_list[numgrids];
+	double vxvy_list[numgrids][2];
+	double adjx_list[numgrids];
+	double adjy_list[numgrids];
+
+	double* thickness_param=NULL;
+	double thickness_list[numgrids];
+
+	/* gaussian points: */
+	int     num_gauss,ig;
+	double* first_gauss_area_coord  =  NULL;
+	double* second_gauss_area_coord =  NULL;
+	double* third_gauss_area_coord  =  NULL;
+	double* gauss_weights           =  NULL;
+	double  gauss_weight;
+	double  gauss_l1l2l3[3];
+
+	/*element vector at the gaussian points: */
+	double  grade_g[numgrids];
+	double  grade_g_gaussian[numgrids];
+
+	/* Jacobian: */
+	double Jdet;
+
+	/*nodal functions: */
+	double l1l2l3[3];
+
+	/* strain rate: */
+	double epsilon[3]; /* epsilon=[exx,eyy,exy];*/
+
+
+	/* parameters: */
+	double  viscosity2;
+	double  dvx[NDOF2];
+	double  dvy[NDOF2]; 
+	double  dadjx[NDOF2];
+	double  dadjy[NDOF2];
+	double  vx,vy;
+	double  lambda,mu;
+	double  thickness;
+	
+
+	/* Get node coordinates and dof list: */
+	GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
+	GetDofList(&doflist[0],&numberofdofspernode);
+
+	/* Set grade_g to 0: */
+	for(i=0;i<numdofs;i++) grade_g[i]=0.0;
+
+	/* recover input parameters: */
+	thickness_param=ParameterInputsRecover(inputs,"thickness");
+
+	/*Initialize parameter lists: */
+	for(i=0;i<numgrids;i++){
+		vx_list[i]=velocity[doflist[i*numberofdofspernode+0]];
+		vy_list[i]=velocity[doflist[i*numberofdofspernode+1]];
+		vxvy_list[i][0]=vx_list[i];
+		vxvy_list[i][1]=vy_list[i];
+		adjx_list[i]=adjoint[doflist[i*numberofdofspernode+0]];
+		adjy_list[i]=adjoint[doflist[i*numberofdofspernode+1]];
+		if(thickness_param){
+			thickness_list[i]=thickness_param[doflist[i*numberofdofspernode+0]];
+		}
+		else{
+			thickness_list[i]=h[i];
+		}
+	}
+	
+	/* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
+	GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 4);
+	#ifdef _DEBUG_ 
+	for (i=0;i<num_gauss;i++){
+		printf("Gauss coord %i: %lf %lf %lf Weight: %lf\n",i,*(first_gauss_area_coord+i),*(second_gauss_area_coord+i),*(third_gauss_area_coord+i),*(gauss_weights+i));
+	}
+	#endif
+
+	/* Start  looping on the number of gaussian points: */
+	for (ig=0; ig<num_gauss; ig++){
+		/*Pick up the gaussian point: */
+		gauss_weight=*(gauss_weights+ig);
+		gauss_l1l2l3[0]=*(first_gauss_area_coord+ig); 
+		gauss_l1l2l3[1]=*(second_gauss_area_coord+ig);
+		gauss_l1l2l3[2]=*(third_gauss_area_coord+ig);
+
+		/*Get thickness: */
+		GetParameterValue(&thickness, &h[0],gauss_l1l2l3);
+	
+		/*Get strain rate, if velocity has been supplied: */
+		GetStrainRate(&epsilon[0],&vxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3);
+	
+		/*Get viscosity2: */
+		matice->GetViscosity2(&viscosity2, &epsilon[0]);
+		
+		/*Get dvx, dvy, dadjx and dadjx: */
+		GetParameterDerivativeValue(&dvx[0], &vx_list[0],&xyz_list[0][0], gauss_l1l2l3);
+		GetParameterDerivativeValue(&dvy[0], &vy_list[0],&xyz_list[0][0], gauss_l1l2l3);
+		GetParameterDerivativeValue(&dadjx[0], &adjx_list[0],&xyz_list[0][0], gauss_l1l2l3);
+		GetParameterDerivativeValue(&dadjy[0], &adjy_list[0],&xyz_list[0][0], gauss_l1l2l3);
+
+		/* Get Jacobian determinant: */
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3);
+		
+		/* Get nodal functions value at gaussian point:*/
+		GetNodalFunctions(l1l2l3, gauss_l1l2l3);
+		#ifdef _DEBUG_
+			_printf_("viscosity2 %g thickness %g dvx [%g %g] dvy [%g %g]  dadjx [%g %g] dadjy[%g %g]\n",viscosity2,thickness,dvx[0],dvx[1],dvy[0],dvy[1],dadjx[0],dadjx[1],dadjy[0],dadjy[1]);
+		#endif
+
+		/*Build gradje_g_gaussian vector: */
+		for (i=0;i<numgrids;i++){
+			grade_g_gaussian[i]=viscosity2*thickness*( (2*dvx[0]+dvy[1])*2*dadjx[0]+(dvx[1]+dvy[0])*(dadjx[1]+dadjy[0])+(2*dvy[1]+dvx[0])*2*dadjy[1])*Jdet*gauss_weight*l1l2l3[i]; 
+		}
+
+		/*Add grade_g_gaussian to grade_g: */
+		for( i=0; i<numdofs;i++)grade_g[i]+=grade_g_gaussian[i];
+	}
+	
+	/*Add grade_g to global vector grad_g: */
+	VecSetValues(grad_g,numdofs,doflist,(const double*)grade_g,ADD_VALUES);
+	
+	cleanup_and_return: 
+	xfree((void**)&first_gauss_area_coord);
+	xfree((void**)&second_gauss_area_coord);
+	xfree((void**)&third_gauss_area_coord);
+	xfree((void**)&gauss_weights);
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::Misfit"
+double Tria::Misfit(double* velocity,double* obs_velocity,ParameterInputs* inputs,int analysis_type){
+	int i;
+	
+	/* output: */
+	double Jelem=0;
+
+	/* node data: */
+	const int    numgrids=3;
+	const int    numdofs=2*numgrids;
+	const int    NDOF2=2;
+	double       xyz_list[numgrids][3];
+	int          doflist[numdofs];
+	int          numberofdofspernode;
+
+	/* grid data: */
+	double vx_list[numgrids];
+	double vy_list[numgrids];
+	double obs_vx_list[numgrids];
+	double obs_vy_list[numgrids];
+
+	/* gaussian points: */
+	int     num_gauss,ig;
+	double* first_gauss_area_coord  =  NULL;
+	double* second_gauss_area_coord =  NULL;
+	double* third_gauss_area_coord  =  NULL;
+	double* gauss_weights           =  NULL;
+	double  gauss_weight;
+	double  gauss_l1l2l3[3];
+
+	/* parameters: */
+	double  velocity_x,velocity_y,velocity_mag;
+	double  obs_velocity_x,obs_velocity_y,obs_velocity_mag;
+
+	/* Jacobian: */
+	double Jdet;
+	
+	/*relative and logarithmic control method :*/
+	double scalex=1;
+	double scaley=1;
+	double* fit_param=NULL;
+	double  fit=-1;
+
+	/* Get node coordinates and dof list: */
+	GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
+	GetDofList(&doflist[0],&numberofdofspernode);
+	
+	/* Recover input data: */
+	fit_param=ParameterInputsRecover(inputs,"fit");
+	if(fit_param){
+		fit=*fit_param;
+	}
+
+	/*Initialize velocities: */
+	for(i=0;i<numgrids;i++){
+		vx_list[i]=velocity[doflist[i*numberofdofspernode+0]];
+		vy_list[i]=velocity[doflist[i*numberofdofspernode+1]];
+		obs_vx_list[i]=obs_velocity[doflist[i*numberofdofspernode+0]];
+		obs_vy_list[i]=obs_velocity[doflist[i*numberofdofspernode+1]];
+
+	}
+
+	
+	/* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
+	GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2);
+	
+	#ifdef _DEBUG_ 
+	for (i=0;i<num_gauss;i++){
+		printf("Gauss coord %i: %lf %lf %lf Weight: %lf\n",i,*(first_gauss_area_coord+i),*(second_gauss_area_coord+i),*(third_gauss_area_coord+i),*(gauss_weights+i));
+	}
+	#endif
+
+	/* Start  looping on the number of gaussian points: */
+	for (ig=0; ig<num_gauss; ig++){
+		/*Pick up the gaussian point: */
+		gauss_weight=*(gauss_weights+ig);
+		gauss_l1l2l3[0]=*(first_gauss_area_coord+ig); 
+		gauss_l1l2l3[1]=*(second_gauss_area_coord+ig);
+		gauss_l1l2l3[2]=*(third_gauss_area_coord+ig);
+
+	
+		/*Compute velocities at gaussian point: */
+		GetParameterValue(&velocity_x, &vx_list[0],gauss_l1l2l3);
+		GetParameterValue(&velocity_y, &vy_list[0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+			printf("Velocity: %g %g\n", velocity_x,velocity_y);
+		#endif
+	
+		/*Compute obs_velocities at gaussian point: */
+		GetParameterValue(&obs_velocity_x, &obs_vx_list[0],gauss_l1l2l3);
+		GetParameterValue(&obs_velocity_y, &obs_vy_list[0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+			printf("Observed velocity: %g %g\n", obs_velocity_x,obs_velocity_y);
+		#endif
+
+		/* Get Jacobian determinant: */
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3);
+		#ifdef _DEBUG_ 
+		printf("Element id %i Jacobian determinant: %lf\n",TriaElementGetID(this),Jdet);
+		#endif
+		
+		/*Differents misfits are allowed: */
+		if(fit==0){
+			/*Absolute misfit: */
+			Jelem+=.5*(pow((velocity_x-obs_velocity_x),2)+pow((velocity_y-obs_velocity_y),2))*Jdet*gauss_weight;
+		}
+		else if(fit==1){
+			/*Relative misfit: */
+			scalex=pow(meanvel/(obs_velocity_x+epsvel),2);
+			scaley=pow(meanvel/(obs_velocity_y+epsvel),2);
+			if(obs_velocity_x==0)scalex=0;
+			if(obs_velocity_y==0)scaley=0;
+			Jelem+=.5*(scalex*pow((velocity_x-obs_velocity_x),2)+scaley*pow((velocity_y-obs_velocity_y),2))*Jdet*gauss_weight;
+		}	
+		else if(fit==2){
+			/*Logarithmic misfit: */
+			velocity_mag=sqrt(pow(velocity_x,2)+pow(velocity_y,2))+epsvel; //epsvel to avoid velocity being nil.
+			obs_velocity_mag=sqrt(pow(obs_velocity_x,2)+pow(obs_velocity_y,2))+epsvel; //epsvel to avoid observed velocity being nil.
+			Jelem+=4*pow(meanvel,2)*pow(log(velocity_mag/obs_velocity_mag),2);
+		}
+		else throw ErrorException(__FUNCT__,exprintf("%s%i%s","fit type",fit," not supported yet!"));
+
+	}
+	cleanup_and_return: 
+	xfree((void**)&first_gauss_area_coord);
+	xfree((void**)&second_gauss_area_coord);
+	xfree((void**)&third_gauss_area_coord);
+	xfree((void**)&gauss_weights);
+
+	/*Return: */
+	return Jelem;
+}
Index: /issm/trunk/src/c/objects/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Tria.h	(revision 1)
+++ /issm/trunk/src/c/objects/Tria.h	(revision 1)
@@ -0,0 +1,101 @@
+/*! \file Tria.h 
+ *  \brief: header file for tria object
+ */
+
+#ifndef _TRIA_H
+#define _TRIA_H
+
+#include "./Element.h"
+#include "./Node.h"
+#include "./Matice.h"
+#include "./Matpar.h"
+
+class Tria: public Element{
+
+	private: 
+
+		/*ids:*/
+		int id;
+
+		/*nodes: */
+		int   node_ids[3]; //node ids
+		Node* nodes[3]; //node pointers
+		int   node_offsets[3]; //node offsets in nodes dataset
+
+		/*materials: */
+		int   mid;
+		Matice* matice; 
+		int   matice_offset;
+		
+		int mparid;
+		Matpar* matpar; 
+		int   matpar_offset;
+	
+		double h[3];
+		double s[3];
+		double b[3];
+		double k[3];
+		int    friction_type;
+		double p;
+		double q;
+		int    shelf;
+		double fit;
+		double meanvel;/*!scaling ratio for velocities*/
+		double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
+		int    acceleration;
+		int    onbed;
+	
+	public:
+
+		Tria();
+		Tria(int id,int mid,int mparid,int node_ids[3],double h[3],double s[3],double b[3],double k[3],
+				int friction_type,double p,double q,int shelf,double fit,double meanvel,double epsvel,int acceleration);
+		~Tria();
+
+		void  Echo();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		char* GetName();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   GetId(); 
+		int   MyRank();
+		void  Configure(void* loads,void* nodes,void* materials);
+		void  CreateKMatrix(Mat Kgg,ParameterInputs* inputs,int analysis_type);
+		void  CreatePVector(Vec pg, ParameterInputs* inputs, int analysis_type);
+		void  UpdateFromInputs(ParameterInputs* inputs);
+		void  GetDofList(int* doflist,int* pnumberofdofs);
+		
+		void  CreateKMatrixDiagnosticHoriz(Mat Kgg,ParameterInputs* inputs,int analysis_type);
+		void  GetParameterValue(double* pp, double* plist, double* gauss_l1l2l3);
+		void  GetParameterDerivativeValue(double* p, double* plist,double* xyz_list, double* gauss_l1l2l3);
+		void  GetStrainRate(double* epsilon, double* velocity, double* xyz_list, double* gauss_l1l2l3);
+		void  GetJacobianDeterminant(double*  Jdet, double* xyz_list,double* gauss_l1l2l3);
+		void  GetB(double* B, double* xyz_list, double* gauss_l1l2l3);
+		void  GetBPrime(double* Bprime, double* xyz_list, double* gauss_l1l2l3);
+		void  GetL(double* L, double* xyz_list, double* gauss_l1l2l3,int numdof);
+		void  GetNodalFunctions(double* l1l2l3, double* gauss_l1l2l3);
+		void  GetNodalFunctionsDerivativesBasic(double* dh1dh2dh3_basic,double* xyz_list, double* gauss_l1l2l3);
+		void  GetNodalFunctionsDerivativesParams(double* dl1dl2dl3,double* gauss_l1l2l3);
+		void  GetJacobianInvert(double*  Jinv, double* xyz_list,double* gauss_l1l2l3);
+		void  GetJacobian(double* J, double* xyz_list,double* gauss_l1l2l3);
+		void  Du(Vec du_g,double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type);
+		void  Gradj(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type,char* control_type);
+		void  GradjDrag(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type);
+		void  GradjB(Vec grad_g,double* u_g,double* lambda_g,ParameterInputs* inputs,int analysis_type);
+        double Misfit(double* u_g,double* u_g_obs,ParameterInputs* inputs,int analysis_type);
+
+		void  CreatePVectorDiagnosticHoriz(Vec pg,ParameterInputs* inputs,int analysis_type);
+		Matpar* GetMatPar();
+		int   GetShelf();
+		void  GetNodes(Node** nodes);
+		int   GetOnBed();
+
+		void          GetThicknessList(double* thickness_list);
+		void          GetBedList(double* bed_list);
+		Object* copy();
+
+
+};
+#endif  /* _TRIA_H */
+
Index: /issm/trunk/src/c/objects/objects.h
===================================================================
--- /issm/trunk/src/c/objects/objects.h	(revision 1)
+++ /issm/trunk/src/c/objects/objects.h	(revision 1)
@@ -0,0 +1,34 @@
+/* \file objects.h
+ * \brief: prototype header for all objects.
+ */
+
+#ifndef ALL_OBJECTS_H_
+#define ALL_OBJECTS_H_
+
+/*Abstract class: */
+#include "./Object.h"
+
+/*C++ Objects: */
+#include "./Material.h"
+#include "./Matice.h"
+#include "./Matpar.h"
+#include "./Node.h"
+#include "./Object.h"
+#include "./Penta.h"
+#include "./Tria.h"
+#include "./Spc.h"
+#include "./Rgb.h"
+#include "./Icefront.h"
+#include "./Penpair.h"
+#include "./Param.h"
+#include "./Element.h" 
+#include "./NodeSets.h"
+
+/*C objects: */
+#include "./Contour.h"
+#include "./ParameterInputs.h"
+#include "./Friction.h"
+#include "./SolverEnum.h"
+#include "./FemModel.h"
+
+#endif
Index: /issm/trunk/src/c/parallel/.vimrc
===================================================================
--- /issm/trunk/src/c/parallel/.vimrc	(revision 1)
+++ /issm/trunk/src/c/parallel/.vimrc	(revision 1)
@@ -0,0 +1,90 @@
+
+" Use Vim settings, rather then Vi settings (much better!).
+" This must be first, because it changes other options as a side effect.
+set nocompatible
+
+" allow backspacing over everything in insert mode
+set backspace=indent,eol,start
+
+set autoindent		" always set autoindenting on
+set history=50		" keep 50 lines of command line history
+set ruler		" show the cursor position all the time
+set showcmd		" display incomplete commands
+set incsearch		" do incremental searching 
+set softtabstop=3 
+set uc=0                " disable swap files
+set shell=/bin/bash  
+set nobackup
+
+" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
+" let &guioptions = substitute(&guioptions, "t", "", "g")
+
+" Don't use Ex mode, use Q for formatting
+map Q gq
+
+" Make p in Visual mode replace the selected text with the "" register.
+vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc>
+
+" This is an alternative that also works in block mode, but the deleted
+" text is lost and it only works for putting the current register.
+"vnoremap p "_dp
+
+" Switch syntax highlighting on, when the terminal has colors
+" Also switch on highlighting the last used search pattern.
+syntax on
+set hlsearch 
+
+" Only do this part when compiled with support for autocommands.
+if has("autocmd")
+
+  " Enable file type detection.
+  " Use the default filetype settings, so that mail gets 'tw' set to 72,
+  " 'cindent' is on in C files, etc.
+  " Also load indent files, to automatically do language-dependent indenting.
+  filetype plugin indent on
+
+  " For all text files set 'textwidth' to 78 characters.
+  autocmd FileType text setlocal textwidth=0
+
+  " When editing a file, always jump to the last known cursor position.
+  " Don't do it when the position is invalid or when inside an event handler
+  " (happens when dropping a file on gvim).
+  autocmd BufReadPost *
+    \ if line("'\"") > 0 && line("'\"") <= line("$") |
+    \   exe "normal g`\"" |
+    \ endif
+
+endif " has("autocmd")
+colo default  
+
+
+"execute "source ~/.vim/plugin/FeralToggleCommentify.vim" 
+"map <M-c> : call ToggleCommentify()<CR>j
+"imap <M-c> <ESC>:call ToggleCommentify()<CR>j
+
+
+
+function! InsertTabWrapper(direction) 
+let col = col('.') - 1 
+if !col || getline('.')[col - 1] !~ '\k' 
+   return "\<tab>" 
+elseif "backward" == a:direction 
+   return "\<c-p>" 
+else 
+   return "\<c-n>" 
+endif 
+endfunction 
+
+inoremap <tab> <c-r>=InsertTabWrapper ("forward")<cr>
+inoremap <s-tab> <c-r>=InsertTabWrapper ("backward")<cr>
+
+source ~/.exrc 
+set wildmenu
+set  background=dark
+
+"Do local Makefile
+map <F2> :!/home/larour/bin/cs <CR>
+"Compile server code
+map <F1> :!/home/larour/bin/c <CR>
+"Change to directory of current file automatically
+autocmd BufEnter * lcd %:p:h
Index: /issm/trunk/src/c/parallel/BatchDebug.c
===================================================================
--- /issm/trunk/src/c/parallel/BatchDebug.c	(revision 1)
+++ /issm/trunk/src/c/parallel/BatchDebug.c	(revision 1)
@@ -0,0 +1,77 @@
+/*
+ * BatchDebug: get a matrix or a vector written to disk, so that it can be read on the matlab 
+ * side and compared with ISSM code: 
+ */
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "../include/cielo.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "OutputControl"
+
+
+int BatchDebug(Mat* Kgg,Vec* pg,FemModel* femmodel,char* filename){
+
+	int noerr=1;
+	
+	/* standard output: */
+	Vec* tpartition=NULL;
+	double* serial_tpartition=NULL;
+	int     serial_tpartition_rows;
+	int     dummy=1;
+	FILE* fid=NULL;
+
+	double* serial_pg=NULL;
+	int     serial_pg_rows;
+	double* serial_Kgg=NULL;
+	int     serial_Kgg_rows,serial_Kgg_cols;
+
+	/*recover parameters: */
+	tpartition=femmodel->tpartition;
+
+	/*serialize partition vector: */
+	VecGetSize(*tpartition,&serial_tpartition_rows);
+	VecToMPISerial(&serial_tpartition,tpartition);
+
+	/*Serialize output matrices and vectors if they exist: */
+	if(Kgg){
+		MatGetSize(*Kgg,&serial_Kgg_rows,&serial_Kgg_cols);
+		MatToSerial(&serial_Kgg,Kgg);
+	}
+
+	if(pg){
+		VecGetSize(*pg,&serial_pg_rows);
+		VecToMPISerial(&serial_pg,pg);
+	}
+
+
+	/* Open output file to write raw binary data: */
+	if(my_rank==0){
+		fid=fopen(filename,"wb");
+		if(fid==NULL){
+			_printf_("%s%s\n",__FUNCT__," error message: could not open file ",filename," for binary writing.");
+			noerr=0; goto cleanup_and_return;
+		}
+
+		/*Write tpartition: */
+		WriteDataToDisk(serial_tpartition,&serial_tpartition_rows,&dummy,"Mat",fid);
+
+		/*Write Kgg if it exists: */
+		if(Kgg)WriteDataToDisk(serial_Kgg,&serial_Kgg_rows,&serial_Kgg_cols,"Mat",fid);
+		
+		/*Write pg if it exists: */
+		if(pg)WriteDataToDisk(serial_pg,&serial_pg_rows,&dummy,"Mat",fid);
+		
+		
+		/*Close file: */
+		if(fclose(fid)!=0){
+			_printf_("%s%s%s\n",__FUNCT__," error message: could not close file ",filename);
+			noerr=0; goto cleanup_and_return;
+		}
+	}
+
+	cleanup_and_return:
+	return noerr;
+}
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+	
Index: /issm/trunk/src/c/parallel/CreateFemModel.cpp
===================================================================
--- /issm/trunk/src/c/parallel/CreateFemModel.cpp	(revision 1)
+++ /issm/trunk/src/c/parallel/CreateFemModel.cpp	(revision 1)
@@ -0,0 +1,89 @@
+/*!\file: CreateFemModel.cpp
+ * \brief: create all the datasets, vectors and matrices needed to run the finite element analysis.
+ */ 
+
+#undef __FUNCT__ 
+#define __FUNCT__ "CreateFemModel"
+
+#include "../objects/objects.h"
+#include "../io/io.h"
+#include "../issm.h"
+
+void CreateFemModel(FemModel* femmodel,ConstDataHandle MODEL,char* analysis_type){
+
+	/*Model output: */
+	DataSet*            elements;
+	DataSet*            nodes;
+	DataSet*            constraints;
+	DataSet*            loads;
+	DataSet*            materials;
+	DataSet*            parameters;
+	Vec                 partition;
+	Vec                 tpartition;
+	Vec                 yg;
+	Mat                 Rmg;
+	Mat                 Gmn;
+	NodeSets*           nodesets;
+	Vec                 ys;
+	Vec                 ys0;
+
+	/*intermediary: */
+	Model* model=NULL;
+	
+
+	_printf_("   fill model with matlab workspace data\n");
+	ModelInit(&model,MODEL); 
+
+	_printf_("   create elements, nodes and materials:\n");
+	ModelCreateElementsNodesAndMaterials(&elements,&nodes,&materials,model,MODEL);
+
+	_printf_("   create constraints: \n");
+	ModelCreateConstraints(&constraints,model,MODEL);
+	
+	_printf_("   create loads: \n");
+	ModelCreateLoads(&loads,model,MODEL);
+
+	_printf_("   create parameters: \n");
+	ModelCreateParameters(&parameters,model,MODEL);
+
+	_printf_("   create degrees of freedom: \n");
+	Dofx( &partition,&tpartition,elements,nodes, parameters);
+	
+	_printf_("   create single point constraints: \n");
+	SpcNodesx( &yg, nodes,constraints); 
+	
+	_printf_("   create rigid body constraints:\n");
+	MpcNodesx( &Rmg, nodes,constraints); 
+	
+	_printf_("   create node sets:\n");
+	BuildNodeSetsx(&nodesets, nodes);
+
+	_printf_("   reducing single point constraints vector:\n");
+	Reducevectorgtosx(&ys,&ys0, yg,nodesets);
+	
+	_printf_("   normalizing rigid body constraints matrix:\n");
+	NormalizeConstraintsx(&Gmn, Rmg,nodesets);
+	
+	_printf_("   configuring element and loads:\n");
+	ConfigureObjectsx(elements, loads, nodes, materials);
+	
+	_printf_("   free ressources:\n");
+	DeleteModel(&model);
+
+	/*Assign output pointers:*/
+	femmodel->elements=elements;
+	femmodel->nodes=nodes;
+	femmodel->constraints=constraints;
+	femmodel->loads=loads;
+	femmodel->materials=materials;
+	femmodel->parameters=parameters;
+	femmodel->partition=partition;
+	femmodel->tpartition=tpartition;
+	femmodel->yg=yg;
+	femmodel->Rmg=Rmg;
+	femmodel->Gmn=Gmn;
+	femmodel->nodesets=nodesets;
+	femmodel->ys=ys;
+	femmodel->ys0=ys0;
+	
+}
Index: /issm/trunk/src/c/parallel/GradJCheck.c
===================================================================
--- /issm/trunk/src/c/parallel/GradJCheck.c	(revision 1)
+++ /issm/trunk/src/c/parallel/GradJCheck.c	(revision 1)
@@ -0,0 +1,69 @@
+/*
+ * GradJCheck.c:
+ */
+
+#include "../../../config.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "../include/cielo.h"
+#include "../modules.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GradJCheck"
+#undef CLEANUP
+#define CLEANUP GradJCheckLocalCleanup();
+
+void GradJCheckLocalCleanup(void);
+
+int GradJCheck(WorkspaceParams* workspaceparams,int step,int status){
+	
+	int reloop=0;
+	int i;
+
+	if (step==0){
+		/*Ok, this is the first time we are running the GradJSearch. No criterion applied here. : */
+	}
+	else{
+		if  (workspaceparams->J[step]>workspaceparams->J[step-1]){
+			/*Ok, the GradJSearch yielded a worse cost function. reloop and increate maxiter by 5 for the rest of the model. As well, 
+			 * lower tolx: */
+			if(status==0){
+				/*tolerance was breached! Are we under 10^-10?: */
+				if (workspaceparams->tolx<10^-10){
+					/*Ok, we are never converging!: */
+					_printf_("%s\n","      convergence failed. getting out!");
+					reloop=0;
+				}
+				else{
+					workspaceparams->tolx=workspaceparams->tolx/5;
+					_printf_("%s%g\n","      optimization failed. relooping with tolx changed to: ",workspaceparams->tolx);
+					reloop=1;
+				}
+			}
+			else{
+				/* maxiter was breached. Are we over 50 iterations?: */
+				if(workspaceparams->maxiter[step]>50){
+					_printf_("%s\n","      convergence failed. getting out!");
+					reloop=0;
+				}
+				else{
+					for(i=step;i<workspaceparams->nsteps;i++){
+						workspaceparams->maxiter[i]+=5;
+					}
+					_printf_("%s%g\n","      optimization failed. relooping with maxiter changed to: ",workspaceparams->maxiter[step]);
+					reloop=1;
+				}
+			}
+		}
+	}
+	return reloop;
+}
+
+
+void GradJCheckLocalCleanup(void){
+	return;
+}
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/parallel/GradJCompute.c
===================================================================
--- /issm/trunk/src/c/parallel/GradJCompute.c	(revision 1)
+++ /issm/trunk/src/c/parallel/GradJCompute.c	(revision 1)
@@ -0,0 +1,89 @@
+/*
+ * GradJCompute.c:
+ */
+
+#include "../../../config.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "../include/cielo.h"
+#include "../modules.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GradJCompute"
+#undef CLEANUP
+#define CLEANUP GradJComputeLocalCleanup();
+
+void GradJComputeLocalCleanup(void);
+
+int GradJCompute(ParameterInputs* inputs,FemModel* femmodel){
+	
+	/*Error management: */
+	int noerr=1;
+	int i;
+	int dummy;
+	
+	Vec* u_g=NULL;
+	Vec* du_g=NULL;
+	Vec* du_f=NULL;
+	Vec* lambda_f=NULL;
+	Vec* lambda_g=NULL;
+	double* lambda_g_double=NULL;
+	double* u_g_double=NULL;
+	Vec* gradj_g=NULL;
+	Mat* K_ff0=NULL;
+	Mat* K_fs0=NULL;
+	
+	//Recover uset: */
+	uset=femmodel->uset; //external variable
+
+	//Recover solution for this stiffness and right hand side: 
+	cielodiagnostic_core_nonlinear(&u_g,&K_ff0,&K_fs0,inputs,femmodel);
+
+	//Buid Du, difference between observed velocity and model velocity.
+	VecToMPISerial(&u_g_double,u_g); VecFree(&u_g);
+	
+	Dux(&du_g,femmodel->bgpdt, femmodel->bgpdtb, femmodel->est, femmodel->ept, femmodel->mpt,femmodel->lst, u_g_double,femmodel->workspaceparams->u_g_obs,inputs,femmodel->batchparams->analysis_type_enum);
+
+
+	//Reduce adjoint load from g-set to f-set
+	Reducerightside(&du_f, du_g, femmodel->G_mn, K_fs0, femmodel->y_s0, femmodel->flag_y_s0, uset->pv_m, uset->msize, uset->pv_n, uset->nsize, uset->pv_f, uset->fsize, uset->msize,uset->ssize,uset->fsize);
+	VecFree(&du_g);MatFree(&K_fs0);
+
+	
+	//Solve for adjoint vector: 
+	lambda_f=xmalloc(sizeof(Vec));
+	Solverx(lambda_f,&dummy,K_ff0,dummy,dummy,du_f,dummy,NULL,0,femmodel->batchparams->solverstring);
+	VecFree(&du_f);
+	MatFree(&K_ff0);
+
+	
+	//Merge back to g set
+	Mergesolvec( &lambda_g, lambda_f, femmodel->G_mn, femmodel->y_s0, uset->pv_m, uset->msize, uset->pv_n, uset->nsize, uset->pv_f, uset->fsize, uset->pv_s, uset->ssize, uset->gsize,uset->msize,uset->nsize);
+	VecFree(&lambda_f);
+
+	//Compute gradJ for each parameter
+	VecToMPISerial(&lambda_g_double,lambda_g);VecFree(&lambda_g);
+	
+	for(i=0;i<femmodel->workspaceparams->num_control_parameters;i++){
+		char* control_type=femmodel->workspaceparams->control_types[i];
+	
+		Gradjx( &gradj_g, femmodel->bgpdt, femmodel->bgpdtb, femmodel->est, femmodel->ept, femmodel->mpt,femmodel->lst, u_g_double,lambda_g_double,inputs,femmodel->batchparams->analysis_type_enum,control_type);
+
+		WorkspaceParamsSetParameterGradient(femmodel->workspaceparams,gradj_g,control_type);
+	}
+	
+	/*free ressources: */
+	xfree((void**)&lambda_g_double);
+	xfree((void**)&u_g_double);
+
+
+	EXIT(noerr);
+}
+
+void GradJComputeLocalCleanup(void){
+	return;
+}
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/parallel/GradJOrth.c
===================================================================
--- /issm/trunk/src/c/parallel/GradJOrth.c	(revision 1)
+++ /issm/trunk/src/c/parallel/GradJOrth.c	(revision 1)
@@ -0,0 +1,57 @@
+/*
+ * GradJOrth.c:
+ */
+
+#include "../../../config.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "../include/cielo.h"
+#include "../modules.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GradJOrth"
+#undef CLEANUP
+#define CLEANUP GradJOrthLocalCleanup();
+
+void GradJOrthLocalCleanup(void);
+
+int GradJOrth(WorkspaceParams* workspaceparams){
+	
+	/*Error management: */
+	int noerr=1;
+	int i;
+
+	Vec* gradient=NULL;
+	Vec* gradient2=NULL;
+	Vec* oldgradient=NULL;
+	Vec* newgradient=NULL;
+
+
+	for(i=0;i<workspaceparams->num_control_parameters;i++){
+		char* control_type=workspaceparams->control_types[i];
+
+		gradient=WorkspaceParamsGetParameterGradient(workspaceparams,control_type);
+		oldgradient=WorkspaceParamsGetOldParameterGradient(workspaceparams,control_type);
+
+		Orthx( &newgradient,gradient,oldgradient);
+
+		/*Save oldgradient: */
+		gradient2=xmalloc(sizeof(Vec));VecDuplicate(*gradient,gradient2);VecCopy(*gradient,*gradient2); 
+		WorkspaceParamsSetOldParameterGradient(workspaceparams,gradient2,control_type);
+		
+		/*Set new gradient: */
+		WorkspaceParamsSetParameterGradient(workspaceparams,newgradient,control_type);
+	}
+
+
+	EXIT(noerr);
+}
+
+void GradJOrthLocalCleanup(void){
+	return;
+}
+
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/parallel/GradJSearch.c
===================================================================
--- /issm/trunk/src/c/parallel/GradJSearch.c	(revision 1)
+++ /issm/trunk/src/c/parallel/GradJSearch.c	(revision 1)
@@ -0,0 +1,328 @@
+/*
+ * GradJSearch.c:
+ */
+
+#include "../../../config.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "../include/cielo.h"
+#include "../modules.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GradJSearch"
+#undef CLEANUP
+#define CLEANUP GradJSearchLocalCleanup();
+
+void GradJSearchLocalCleanup(void);
+
+
+int GradJSearch(double* search_vector,FemModel* femmodel,int step){
+	
+	/*Error management: */
+	int noerr=1;
+	int i,n;
+	int dummy;
+	ParameterInputs* inputs=NULL;
+	int status;
+
+	//status=GoldenSearch(search_vector,femmodel->workspaceparams->J+step,-1,1,femmodel->workspaceparams->tolx,(int)femmodel->workspaceparams->maxiter[step],
+	//		femmodel->workspaceparams->fit[step],femmodel->workspaceparams->optscal[step],&objectivefunctionC,femmodel);  //do only one dimension search for now.
+
+	status=BrentSearch(search_vector,femmodel->workspaceparams->J+step,-1,1,femmodel->workspaceparams->tolx,(int)femmodel->workspaceparams->maxiter[step],
+			femmodel->workspaceparams->fit[step],femmodel->workspaceparams->optscal[step],&objectivefunctionC,femmodel);  //do only one dimension search for now.
+
+	TESTEXIT(noerr);
+	
+	return status;
+}
+
+void GradJSearchLocalCleanup(void){
+	return;
+}
+
+int GoldenSearch(double* psearch_scalar,double* pJ,double xa, double xb, double tolerance, int maxiter, double fit,double optscal,double (*f)(double*,double,double,FemModel*,ParameterInputs*),FemModel* femmodel){
+	
+	double xc, xd, fc, fd;
+	double oneminustau = 1 - (sqrt(5) - 1) / 2;
+	int iter = 0;
+	ParameterInputs* inputs=NULL;
+	int status;
+
+	inputs=NewParameterInputs();
+
+	xc = xa + oneminustau * (xb - xa);
+	fc = (*f)(&xc,fit,optscal,femmodel,inputs);
+	xd = xb - oneminustau * (xb - xa);
+	fd = (*f)(&xd,fit,optscal,femmodel,inputs);
+	do {
+		iter++;
+		if (fc < fd) {
+			xb = xd;
+			xd = xc;
+			xc = xa + oneminustau * (xb - xa);
+			fd = fc;
+			fc = (*f)(&xc,fit,optscal,femmodel,inputs);
+		}
+		else {
+			xa = xc;
+			xc = xd;
+			xd = xb - oneminustau * (xb - xa);
+			fc = fd;
+			fd = (*f)(&xd,fit,optscal,femmodel,inputs);
+		}
+		_printf_("         iter# %i f(x) %g x %g  toler %g/%g iter %i/%i\n",iter,(fc+fd)/2,(xa+xb)/2,fabs(xb-xa),tolerance,iter,maxiter);
+	} 
+	while (fabs(xb - xa) > tolerance && iter < maxiter);
+
+	if (fabs(xb-xa)<tolerance)status=0;
+	else status=1;
+
+	/*Assign output pointers: */
+	*psearch_scalar=(xa+xb)/2;
+	*pJ=(fc+fd)/2;
+	
+	return status;
+}
+
+int BrentSearch(double* psearch_scalar,double* pJ,double a, double b, double tolerance, int maxiter, double fit,double optscal,double (*f)(double*,double,double,FemModel*,ParameterInputs*),FemModel* femmodel){
+
+	/* This routine is optimizing a given function using Brent's method
+	 * (Golden or parabolic procedure)*/
+ 
+	/*optimization variable: */
+	double si;
+	double gold;
+	double intervalgold;
+	double oldintervalgold;
+	double parab_num,parab_den;
+	double distance;
+
+	/*function values: */
+	double fxmax,fxmin,fxbest,fval;
+	double fx,fx1,fx2;
+
+	/*x : */
+	double xmax,xmin,xbest;
+	double x,x1,x2,xm,xval;
+
+	/*tolerances: */
+	double tol1,tol2,seps;
+
+	/*counters: */
+	int iter,goldenflag,loop;
+
+	/*inputs: */
+	int status;
+	ParameterInputs* inputs=NULL;
+	
+	/*Recover inputs: */
+	inputs=NewParameterInputs();
+
+	//initialize counter and boundaries
+	iter=0;
+
+	//get the value of the function at the first boundary
+	fxmin = (*f)(&a,fit,optscal,femmodel,inputs);
+
+	//display result
+	_printf_("\n        Iteration       x           f(x)       Tolerance         Procedure\n\n");
+	_printf_("        %s   %12.6g  %12.6g  %s","   N/A",a,fxmin,"         N/A         boundary\n");
+
+	//get the value of the function at the first boundary b and display result
+	fxmax = (*f)(&b,fit,optscal,femmodel,inputs);
+	_printf_("        %s   %12.6g  %12.6g  %s","   N/A",b,fxmax,"         N/A         boundary\n");
+
+	//initialize the other variables
+	seps=sqrt(DBL_EPSILON); //precision of a double
+	distance=0.0;              //new_x=old_x + distance
+	gold=0.5*(3.0-sqrt(5.0));  //gold = 1 - golden ratio
+	intervalgold=0.0;          //distance used by Golden procedure
+
+	//Compute initial point
+	
+	//1: initialize the value of the 4 x needed (x1,x2,x,xbest)
+	x1=a+gold*(b-a);
+	x2=x1;
+	xbest=x1;
+	x=xbest;
+
+	//2: call the function to be evaluated
+	fxbest = (*f)(&x,fit,optscal,femmodel,inputs);
+	iter=iter+1;
+
+	//3: update the other variables
+	fx1=fxbest;
+	fx2=fxbest;
+	//xm is always in the middle of a and b
+	xm=0.5*(a+b);                           
+	//update tolerances
+	tol1=seps*sqrt(pow(xbest,2))+tolerance/3.0;
+	tol2=2.0*tol1;
+
+	//4: print result
+	_printf_("         %5i    %12.6g  %12.6g  %12.6g  %s\n",iter,xbest,fxbest,pow(pow(xbest-xm,2),0.5),"       initial");
+
+	//Main Loop
+	loop=1;
+	while(loop){
+
+		goldenflag=1;
+
+		// Is a parabolic fit possible ?
+		if (sqrt(pow(intervalgold,2))>tol1){
+
+			// Yes, so fit parabola
+			goldenflag=0;
+			parab_num=(xbest-x1)*(xbest-x1)*(fxbest-fx2)-(xbest-x2)*(xbest-x2)*(fxbest-fx1);;
+			parab_den=2.0*(xbest-x1)*(fxbest-fx2)-2.0*(xbest-x2)*(fxbest-fx1);
+
+			//reverse p if necessary
+			if(parab_den>0.0){ 
+				parab_num=-parab_num;
+			}
+			parab_den=sqrt(pow(parab_den,2));
+			oldintervalgold=intervalgold;
+			intervalgold=distance;
+
+			// Is the parabola acceptable
+			if (( sqrt(pow(parab_num,2)) < sqrt(pow(0.5*parab_den*oldintervalgold,2))) &&
+						(parab_num>parab_den*(a-xbest)) &&
+						(parab_num<parab_den*(b-xbest))){
+
+				// Yes, parabolic interpolation step
+				distance=parab_num/parab_den;
+				x=xbest+distance;
+
+				// f must not be evaluated too close to min_x or max_x
+				if (((x-a)<tol2) || ((b-x)<tol2)){
+
+					if ((xm-xbest)<0.0){
+						si=-1;
+					}
+					else{
+						si=1;
+					}
+
+					//compute new distance
+					distance=tol1*si;
+				}
+			}
+			else{
+
+				// Not acceptable, must do a golden section step
+				goldenflag=1;
+			}
+		}
+
+		//Golden procedure
+		if(goldenflag){
+
+			// compute the new distance d
+			if(xbest>=xm){
+				intervalgold=a-xbest;    
+			}
+			else{ 
+				intervalgold=b-xbest;  
+			}
+			distance=gold*intervalgold;
+		}
+
+		// The function must not be evaluated too close to xbest
+		if(distance<0){
+			si=-1;
+		}
+		else{
+			si=1;
+		}
+		if (sqrt(pow(distance,2))>tol1){
+			x=xbest+si*sqrt(pow(distance,2));
+		}
+		else{
+			x=xbest+si*tol1;
+		}
+
+		//evaluate function on x
+		fx = (*f)(&x,fit,optscal,femmodel,inputs);
+		iter=iter+1;
+
+		// Update a, b, xm, x1, x2, tol1, tol2
+		if (fx<=fxbest){
+			if (x>=xbest){
+				a=xbest;
+			}
+			else{
+				b=xbest;
+			}
+			x1=x2;    fx1=fx2;
+			x2=xbest; fx2=fxbest;
+			xbest=x;  fxbest=fx;
+		}
+
+		else{ // fx > fxbest
+			if (x < xbest){
+				a=x;
+			}
+			else{
+				b=x;
+			}
+			if ((fx<=fx2) || (x2==xbest)){
+				x1=x2; fx1=fx2;
+				x2=x;  fx2=fx;
+			}
+			else if ( (fx <= fx1) || (x1 == xbest) || (x1 == x2) ){
+				x1=x;  fx1=fx;
+			}
+		}
+		xm = 0.5*(a+b);
+		tol1=seps*pow(pow(xbest,2),0.5)+tolerance/3.0;
+		tol2=2.0*tol1;
+
+		//print result
+		if (goldenflag){
+			_printf_("         %5i    %12.6g  %12.6g  %12.6g  %s\n",iter,x,fx,pow(pow(xbest-xm,2),0.5),"       golden");
+		}
+		else{
+			_printf_("         %5i    %12.6g  %12.6g  %12.6g  %s\n",iter,x,fx,pow(pow(xbest-xm,2),0.5),"       parabolic");
+		}
+
+		//Stop the optimization?
+		if (sqrt(pow(xbest-xm,2)) < (tol2-0.5*(b-a))){
+			_printf_("\nOptimization terminated:\nthe current x satisfies the termination criteria using 'tolx' of %g \n", tolerance);
+			loop=0;
+			status=0;
+		}
+		else if (iter>=maxiter){
+			_printf_("\nExiting: Maximum number of iterations has been exceeded  - increase 'maxiter'\n");
+			loop=0;
+			status=1;
+		}
+		else{
+			//continue
+			loop=1;
+		}
+	}//end while
+
+	//Now, check that the value on the boundaries are not better than current fxbest
+	if (fxbest>fxmin){
+		xval=xmin;
+		fval=fxmin;
+	}
+	else if (fxbest>fxmax){
+		xval=xmax;
+		fval=fxmax;
+	}
+	else{
+		xval=xbest;
+		fval=fxbest;
+	}
+
+	/*Assign output pointers: */
+	*psearch_scalar=xval;
+	*pJ=fval;
+	
+	return status;
+}
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/parallel/OutputControl.c
===================================================================
--- /issm/trunk/src/c/parallel/OutputControl.c	(revision 1)
+++ /issm/trunk/src/c/parallel/OutputControl.c	(revision 1)
@@ -0,0 +1,99 @@
+
+/*
+	OutputControl.c: output model results for control methods.
+*/
+#include "../../../config.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "../include/cielo.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "OutputControl"
+
+#undef CLEANUP
+#define CLEANUP OutputControlLocalCleanup();
+
+void OutputControlLocalCleanup(void);
+	
+int OutputControl(WorkspaceParams* workspaceparams,BatchParams* batchparams,Vec* u_g,Vec* partition, char* filename,char* analysis_type){
+
+	/* error handling: */
+	int i;
+	int		noerr=1;	
+	
+	/* output: */
+	FILE* fid=NULL;
+
+	/* standard output: */
+	double* serial_partition=NULL;
+	int     serial_partition_rows;
+	int     dummy=1;
+	int    analysis_size;
+
+	double* serial_u_g=NULL;
+	int     serial_u_g_rows;
+
+	double* parameter=NULL;
+	int     parameter_rows;
+
+	/*serialize outputs: */
+	VecShift(partition,1.0); //matlab indexing
+	VecGetSize(*partition,&serial_partition_rows);
+	noerr=VecToMPISerial(&serial_partition,partition);TESTEXIT(noerr);
+
+	VecGetSize(*u_g,&serial_u_g_rows);
+	noerr=VecToMPISerial(&serial_u_g,u_g);TESTEXIT(noerr);
+
+	/* Open output file to write raw binary data: */
+	if(my_rank==0){
+		fid=fopen(filename,"wb");
+		if(fid==NULL){
+			_printf_("%s%s%s%s\n",__FUNCT__," error message: could not open file ",filename," for binary writing.");
+			noerr=0; goto cleanup_and_return;
+		}
+
+		/*Write solution type: */
+		WriteDataToDisk(analysis_type,NULL,NULL,"String",fid);
+		
+		/*Write uset.gsize: */
+		WriteDataToDisk(&uset->gsize,NULL,NULL,"Integer",fid);
+
+		/*Write partition: */
+		WriteDataToDisk(serial_partition,&serial_partition_rows,&dummy,"Mat",fid);
+		
+		/*Write misfit J vector: */
+		WriteDataToDisk(&workspaceparams->num_control_parameters,NULL,NULL,"Integer",fid);
+		WriteDataToDisk(&workspaceparams->nsteps,NULL,NULL,"Integer",fid);
+		WriteDataToDisk(workspaceparams->J,&workspaceparams->nsteps,&dummy,"Mat",fid);
+		
+		/*Go through all control parameters, and write optimized parameters: */
+		for(i=0;i<workspaceparams->num_control_parameters;i++){
+			char* control_type=workspaceparams->control_types[i];
+			parameter=WorkspaceParamsGetParameter(workspaceparams,control_type);
+			parameter_rows=uset->gsize;
+			WriteDataToDisk(parameter,&parameter_rows,&dummy,"Mat",fid);
+		}
+
+		/*Write solution: */
+		WriteDataToDisk(serial_u_g,&serial_u_g_rows,&dummy,"Mat",fid);
+	
+		/*Close file: */
+		if(fclose(fid)!=0){
+			_printf_("%s%s%s\n",__FUNCT__," error message: could not close file ",filename);
+			noerr=0; goto cleanup_and_return;
+		}
+	}
+
+	cleanup_and_return:
+	TESTEXIT(noerr);
+
+	EXIT(noerr);
+}	
+void OutputControlLocalCleanup(void){
+	return;
+}
+
+
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/parallel/OutputDiagnostic.cpp
===================================================================
--- /issm/trunk/src/c/parallel/OutputDiagnostic.cpp	(revision 1)
+++ /issm/trunk/src/c/parallel/OutputDiagnostic.cpp	(revision 1)
@@ -0,0 +1,63 @@
+
+/*
+	OutputDiagnostic.c: output model results for diagnostic solution.
+*/
+#undef __FUNCT__ 
+#define __FUNCT__ "OutputDiagnostic"
+
+#include "../toolkits/toolkits.h"
+#include "../shared/shared.h"
+#include "../io/io.h"
+#include "../objects/objects.h"
+
+void OutputDiagnostic(Vec u_g,Vec partition,char* filename,NodeSets* nodesets,char* analysis_type){
+
+	/* error handling: */
+	int i;
+
+	extern int my_rank;
+	
+	/* output: */
+	FILE* fid=NULL;
+
+	/* standard output: */
+	double* serial_partition=NULL;
+	int     serial_partition_rows;
+	int    analysis_size;
+
+	double* serial_u_g=NULL;
+	int     serial_u_g_rows;
+	int     dummy=1;
+	int     gsize;
+
+	/*serialize outputs: */
+	VecShift(partition,1.0); //matlab indexing
+	VecGetSize(partition,&serial_partition_rows);
+	VecToMPISerial(&serial_partition,partition);
+
+	VecGetSize(u_g,&serial_u_g_rows);
+	VecToMPISerial(&serial_u_g,u_g);
+
+	/* Open output file to write raw binary data: */
+	if(my_rank==0){
+		fid=fopen(filename,"wb");
+		if(fid==NULL)throw ErrorException(__FUNCT__,exprintf("%s%s%s","could not open file ",filename," for binary writing."));
+
+		/*Write solution type: */
+		WriteDataToDisk(analysis_type,NULL,NULL,"String",fid);
+
+		/*Write uset.gsize: */
+		gsize=nodesets->GetGSize();
+		WriteDataToDisk(&gsize,NULL,NULL,"Integer",fid);
+
+		/*Write partition: */
+		WriteDataToDisk(serial_partition,&serial_partition_rows,&dummy,"Mat",fid);
+		
+		/*Write solution to disk: */
+		WriteDataToDisk(serial_u_g,&serial_u_g_rows,&dummy,"Mat",fid);
+	
+		/*Close file: */
+		if(fclose(fid)!=0)throw ErrorException(__FUNCT__,exprintf("%s%s","could not close file ",filename));
+	}
+
+}	
Index: /issm/trunk/src/c/parallel/OutputThermal.c
===================================================================
--- /issm/trunk/src/c/parallel/OutputThermal.c	(revision 1)
+++ /issm/trunk/src/c/parallel/OutputThermal.c	(revision 1)
@@ -0,0 +1,81 @@
+
+/*
+	OutputThermal.c: output model results for thermal solution.
+*/
+#include "../../../config.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "../include/cielo.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "OutputThermal"
+
+#undef CLEANUP
+#define CLEANUP OutputThermalLocalCleanup();
+
+void OutputThermalLocalCleanup(void);
+	
+int OutputThermal(Vec* t_g,Vec* partition,char* filename,char* analysis_type){
+
+	/* error handling: */
+	int i;
+	int		noerr=1;	
+	
+	/* output: */
+	FILE* fid=NULL;
+
+	/* standard output: */
+	double* serial_partition=NULL;
+	int     serial_partition_rows;
+	int    analysis_size;
+
+	double* serial_t_g=NULL;
+	int     serial_t_g_rows;
+	int     dummy=1;
+
+	/*serialize outputs: */
+	VecShift(partition,1.0); //matlab indexing
+	VecGetSize(*partition,&serial_partition_rows);
+	noerr=VecToMPISerial(&serial_partition,partition);TESTEXIT(noerr);
+
+	VecGetSize(*t_g,&serial_t_g_rows);
+	noerr=VecToMPISerial(&serial_t_g,t_g);TESTEXIT(noerr);
+
+	/* Open output file to write raw binary data: */
+	if(my_rank==0){
+		fid=fopen(filename,"wb");
+		if(fid==NULL){
+			_printf_("%s%s%s%s\n",__FUNCT__," error message: could not open file ",filename," for binary writing.");
+			noerr=0; goto cleanup_and_return;
+		}
+
+		/*Write solution type: */
+		WriteDataToDisk(analysis_type,NULL,NULL,"String",fid);
+
+		/*Write uset.gsize: */
+		WriteDataToDisk(&uset->gsize,NULL,NULL,"Integer",fid);
+
+		/*Write partition: */
+		WriteDataToDisk(serial_partition,&serial_partition_rows,&dummy,"Mat",fid);
+	
+		/*Write solution to disk: */
+		WriteDataToDisk(serial_t_g,&serial_t_g_rows,&dummy,"Mat",fid);
+	
+		/*Close file: */
+		if(fclose(fid)!=0){
+			_printf_("%s%s%s\n",__FUNCT__," error message: could not close file ",filename);
+			noerr=0; goto cleanup_and_return;
+		}
+	}
+
+	cleanup_and_return:
+	TESTEXIT(noerr);
+
+	EXIT(noerr);
+}	
+void OutputThermalLocalCleanup(void){
+	return;
+}
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/parallel/ParameterUpdate.c
===================================================================
--- /issm/trunk/src/c/parallel/ParameterUpdate.c	(revision 1)
+++ /issm/trunk/src/c/parallel/ParameterUpdate.c	(revision 1)
@@ -0,0 +1,61 @@
+/*
+ * ParameterUpdate.c:
+ */
+
+#include "../../../config.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "../include/cielo.h"
+#include "../modules.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ParameterUpdate"
+#undef CLEANUP
+#define CLEANUP ParameterUpdateLocalCleanup(&gradient);
+
+void ParameterUpdateLocalCleanup(double** pgradient);
+
+int ParameterUpdate(double* search_vector,int step,WorkspaceParams* workspaceparams,BatchParams* batchparams){
+	
+	/*Error management: */
+	int noerr=1;
+	int i,j;
+	double* parameter=NULL;
+	Vec*    vec_gradient=NULL;
+	double* gradient=NULL;
+	
+
+	//Go through parameters, and update along gradients, multiplying by search_vector.
+	for(i=0;i<workspaceparams->num_control_parameters;i++){
+		char* control_type=workspaceparams->control_types[i];
+
+		/*Get parameter, and gradient for the parameter: */
+		parameter=WorkspaceParamsGetParameter(workspaceparams,control_type);
+		vec_gradient=WorkspaceParamsGetParameterGradient(workspaceparams,control_type);
+		
+		/*serialize gradient: */
+		VecToMPISerial(&gradient,vec_gradient);
+
+		/*Ok, for this parameter, we have a direction. Update the parameter along 
+		 * the direction, using the search_vector value: */
+		for(j=0;j<(int)(workspaceparams->gsize/6);j++){
+			parameter[6*j+0]=parameter[6*j+0]-search_vector[i]*workspaceparams->optscal[step]*gradient[6*j+0];
+		}
+
+		/*Now, call on  each parameter's self constraining routine: */
+		WorkspaceParamsConstrain(workspaceparams,control_type);
+	}
+
+	/*Done, just return: */
+	EXIT(noerr);
+}
+
+void ParameterUpdateLocalCleanup(double** pgradient){
+	xfree((void**)pgradient);
+	return;
+}
+
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/parallel/WriteLockFile.cpp
===================================================================
--- /issm/trunk/src/c/parallel/WriteLockFile.cpp	(revision 1)
+++ /issm/trunk/src/c/parallel/WriteLockFile.cpp	(revision 1)
@@ -0,0 +1,27 @@
+/*!\file:  WriteLockFile.cpp
+ * \brief
+ */ 
+#undef __FUNCT__ 
+#define __FUNCT__ "WriteLockFile"
+
+#include "stdio.h"
+#include "../shared/shared.h"
+
+void WriteLockFile(char* filename){
+
+	int i;
+	extern int my_rank;
+	
+	/* output: */
+	FILE* fid=NULL;
+
+	/* Open lock file and write 1 into it: */
+	if(my_rank==0){
+		fid=fopen(filename,"w");
+		if(fid==NULL)throw ErrorException(__FUNCT__,exprintf("%s%s","error message: could not open lock file ",filename));
+
+		/*Close file: */
+		if(fclose(fid)!=0)throw ErrorException(__FUNCT__,exprintf("%s%s","could not close lock file ",filename));
+	}
+
+}	
Index: /issm/trunk/src/c/parallel/control.cpp
===================================================================
--- /issm/trunk/src/c/parallel/control.cpp	(revision 1)
+++ /issm/trunk/src/c/parallel/control.cpp	(revision 1)
@@ -0,0 +1,168 @@
+/*
+ * cielocontrol.c:
+ */
+
+#include "../include/cielo.h"
+#include "../modules.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "cielocontrol"
+
+int main(int argc,char* *argv){
+	
+	int i,n;
+	
+	/*I/O: */
+	FILE* fid=NULL;
+	char* inputfilename=NULL;
+	char* outputfilename=NULL;
+	char* lockname=NULL;
+	char* analysis_type="control";
+
+	/*Finite element model: */
+	#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+	FemModel femmodel;
+	#endif
+
+	/*control : */
+	#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+	Vec*             u_g=NULL;
+	#endif
+	double*          search_vector=NULL;
+	int              status;
+	ParameterInputs* inputs=NULL;
+	int              reloop;
+	
+	#if !defined(_PARALLEL_) || (defined(_PARALLEL_) && !defined(_HAVE_PETSC_))
+		_printf_("%s%s\n",__FUNCT__," error message: parallel executable was compiled without support of parallel libraries!");
+		return 1;
+	#else
+	
+		/*Initialize MPI environment: */
+		PetscInitialize(&argc,&argv,(char *)0,"");  
+
+		/*Size and rank: */
+		MPI_Comm_rank(MPI_COMM_WORLD,&my_rank);  
+		MPI_Comm_size(MPI_COMM_WORLD,&num_procs); 
+
+		/*Some checks on size of cluster*/
+		if (num_procs<=1){
+			_printf_("\nSize of MPI COMM WORLD is 1, needs to be at least 2. Include more nodes\n"); 
+			PetscFinalize(); 
+			return 0;
+		}
+
+		/*Recover dbdir, input file name and output file name: */
+		dbdir=argv[1];
+		inputfilename=argv[2];
+		outputfilename=argv[3];
+		lockname=argv[4];
+
+		/*Open handle to data on disk: */
+		fid=fopen(inputfilename,"rb");
+		if(fid==NULL){
+			_printf_("%s%s\n",__FUNCT__," error message: could not open file ",inputfilename," for binary reading"); 
+			return 0;
+		}
+
+		/*Read and create finite element model: */
+		if(!CreateFemModel(&femmodel,fid,analysis_type)){
+			_printf_("%s\n",__FUNCT__," error message: could not read finite element model!\n");
+			return 0;
+		}
+
+		/*Initialize inputs: */
+		inputs=NewParameterInputs();
+
+		/*For now, only one parameter is allowed: */
+		if (femmodel.workspaceparams->num_control_parameters>1){
+			_printf_("%s%s\n",__FUNCT__," error message: multiple control parameters not implemented yet!");
+			PetscFinalize();
+			return 1;
+		}
+
+		/*Initialize search vector: */
+		search_vector=xmalloc(femmodel.workspaceparams->num_control_parameters*sizeof(double));
+
+		/*Start looping: */
+		for(n=0;n<femmodel.workspaceparams->nsteps;n++){
+			
+			_printf_("\n%s%i%s%i\n","   control method step ",(n+1),"/",femmodel.workspaceparams->nsteps);
+
+			//initialize inputs, ie parameters on which we invert.
+			DeleteParameterInputs(&inputs); inputs=NewParameterInputs();
+			
+			for(i=0;i<femmodel.workspaceparams->num_control_parameters;i++){
+				char* control_type=femmodel.workspaceparams->control_types[i];
+				ParameterInputsAddFromMat(inputs,WorkspaceParamsGetParameter(femmodel.workspaceparams,control_type),femmodel.workspaceparams->gsize,control_type);
+			}
+			ParameterInputsAddFromDouble(inputs,femmodel.workspaceparams->fit[n],"fit");
+
+			//update velocity:
+			_printf_("%s\n","      updating velocity...");
+			VecFree(&u_g); cielodiagnostic_core_nonlinear(&u_g,NULL,NULL,inputs,&femmodel);
+			_printf_("%s\n","      done.");
+
+			//call gradJ module 
+			_printf_("%s\n","      computing gradJ...");
+			GradJCompute(inputs,&femmodel);
+			_printf_("%s\n","      done.");
+			
+			//normalize directions 
+			_printf_("%s\n","      normalizing directions...");
+			GradJOrth(femmodel.workspaceparams);
+			_printf_("%s\n","      done.");
+
+
+			//search along the direction for the parameter vector that minimizes the misfit J
+			_printf_("%s\n","      optimizing...");
+			status=GradJSearch(search_vector,&femmodel,n);
+			_printf_("%s\n","      done.");
+			
+			_printf_("%s%g\n","      misfit: ",femmodel.workspaceparams->J[n]);
+
+			//Check the GradJSearch actually resulting in improving the misfit. Otherwise, reloop.
+			reloop=GradJCheck(femmodel.workspaceparams,n,status);
+			if (reloop){
+				printf("reloop\n",reloop);
+				n=n-1;
+				continue;
+			}
+
+			//update parameters with new optimized values
+			_printf_("%s\n","      updating parameters...");
+			ParameterUpdate(search_vector,n,femmodel.workspaceparams,femmodel.batchparams);
+			_printf_("%s\n","      done.");
+
+			//temporary saving 
+			if ((n%1)==0){
+				_printf_("%s\n","      saving temporary results...");
+				OutputControl(femmodel.workspaceparams,femmodel.batchparams,u_g,femmodel.tpartition,outputfilename,"control");
+				_printf_("%s\n","      done.");
+			}
+
+		}
+		
+		/*Write results to disk: */
+		_printf_("%s\n","      saving final results...");
+		OutputControl(femmodel.workspaceparams,femmodel.batchparams,u_g,femmodel.tpartition,outputfilename,"control");
+		_printf_("%s\n","      done.");
+
+		/*Write lock file if requested: */
+		if (femmodel.batchparams->waitonlock){
+			WriteLockFile(lockname);
+		}
+			
+		cleanup_and_return:
+		_printf_("exiting.\n");
+		
+		/*Synchronize everyone before exiting: */
+		MPI_Barrier(MPI_COMM_WORLD);
+
+		/*Close MPI libraries: */
+		PetscFinalize(); 
+		
+		return 0; //unix success return;
+	#endif
+}
Index: /issm/trunk/src/c/parallel/diagnostic.cpp
===================================================================
--- /issm/trunk/src/c/parallel/diagnostic.cpp	(revision 1)
+++ /issm/trunk/src/c/parallel/diagnostic.cpp	(revision 1)
@@ -0,0 +1,83 @@
+/*!\file:  diagnostic.cpp
+ * \brief: diagnostic solution
+ */ 
+
+#include "../issm.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "diagnostic"
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+int main(int argc,char* *argv){
+	
+	/*I/O: */
+	FILE* fid=NULL;
+	char* inputfilename=NULL;
+	char* outputfilename=NULL;
+	char* lockname=NULL;
+	char* analysis_type="diagnostic_horiz";
+
+	/*Intermediary: */
+	FemModel femmodel;
+	Vec u_g=NULL;
+	ParameterInputs* inputs=NULL;
+	int waitonlock=0;
+
+	MODULEBOOT();
+
+	#if !defined(_PARALLEL_) || (defined(_PARALLEL_) && !defined(_HAVE_PETSC_))
+	throw ErrorException(__FUNCT__," parallel executable was compiled without support of parallel libraries!");
+	#endif
+
+	PetscInitialize(&argc,&argv,(char *)0,"");  
+
+	/*Size and rank: */
+	MPI_Comm_rank(MPI_COMM_WORLD,&my_rank);  
+	MPI_Comm_size(MPI_COMM_WORLD,&num_procs); 
+
+	_printf_("recover , input file name and output file name:\n");
+	inputfilename=argv[2];
+	outputfilename=argv[3];
+	lockname=argv[4];
+
+	/*Open handle to data on disk: */
+	fid=fopen(inputfilename,"rb");
+	if(fid==NULL) throw ErrorException(__FUNCT__,exprintf("%s%s%s","could not open file ",inputfilename," for binary reading")); 
+	
+	_printf_("read and create finite element model:\n");
+	CreateFemModel(&femmodel,fid,analysis_type);
+
+	/*Initialize inputs: */
+	inputs=NewParameterInputs();
+
+	_printf_("call computational core:\n");
+	diagnostic_core_nonlinear(&u_g,NULL,NULL,inputs,femmodel);
+
+	_printf_("write results to disk:\n");
+	OutputDiagnostic(u_g,femmodel.partition,outputfilename,femmodel.nodesets,analysis_type);
+
+	_printf_("write lock file:\n");
+	femmodel.parameters->FindParam((void*)&waitonlock,"waitonlock");
+	if (waitonlock){
+		WriteLockFile(lockname);
+	}
+		
+	_printf_("closing MPI and Petsc\n");
+	MPI_Barrier(MPI_COMM_WORLD);
+
+	/*Close MPI libraries: */
+	PetscFinalize(); 
+
+
+	/*end module: */
+	MODULEEND();
+	
+	return 0; //unix success return;
+}
Index: /issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp	(revision 1)
+++ /issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp	(revision 1)
@@ -0,0 +1,162 @@
+/*!\file: diagnostic_core_nonlinear.cpp
+ * \brief: core of the diagnostic solution for non linear materials
+ */ 
+
+#undef __FUNCT__ 
+#define __FUNCT__ "cielodiagnostic_core_nonlinear"
+
+#include "../toolkits/toolkits.h"
+#include "../objects/objects.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../issm.h"
+
+void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, ParameterInputs* inputs,FemModel fem){
+
+
+	/*solution : */
+	Vec ug=NULL; 
+	Vec old_ug=NULL; 
+	Vec old_uf=NULL; 
+	Vec uf=NULL; 
+	DataSet* loads=NULL;
+
+	/*intermediary: */
+	Mat Kgg=NULL;
+	Mat Kff=NULL;
+	Mat Kfs=NULL;
+	Vec pg=NULL;
+	Vec pf=NULL;
+	int converged;
+	int constraints_converged;
+	int num_unstable_constraints;
+	int count;
+
+	Vec dug;
+	double ndu,nu;
+
+	/*parameters:*/
+	int kflag,pflag,connectivity,numberofdofspernode;
+	char* analysis_type_string=NULL;
+	int analysis_type;
+	char* solver_string=NULL;
+	int debug=0;
+	double eps_rel;
+
+	/*Recover parameters: */
+	kflag=1; pflag=1;
+	fem.parameters->FindParam((void*)&connectivity,"connectivity");
+	fem.parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
+	fem.parameters->FindParam((void*)&solver_string,"solverstring");
+	fem.parameters->FindParam((void*)&eps_rel,"eps_rel");
+	fem.parameters->FindParam((void*)&debug,"debug");
+
+	fem.parameters->FindParam((void*)&analysis_type_string,"analysis_type");
+    analysis_type=AnalysisTypeAsEnum(analysis_type_string);
+
+	/*Copy loads for backup: */
+	loads=fem.loads->Copy();
+
+	count=1;
+	converged=0;
+	for(;;){
+
+		if (debug) _printf_("   Updating inputs\n");
+
+		//save pointer to old velocity
+		VecFree(&old_ug);old_ug=ug;
+		VecFree(&old_uf);old_uf=uf;
+
+		/*Set input parameters: */
+		if(ug)ParameterInputsAddFromVec(inputs,ug,"velocity");
+
+		/*Update parameters: */
+		UpdateFromInputsx(fem.elements,fem.nodes,loads, fem.materials,inputs);
+
+		if (debug) _printf_("   Generating matrices\n");
+		//*Generate system matrices
+		SystemMatricesx(&Kgg, &pg,fem.elements,fem.nodes,loads,fem.materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type); 
+
+		if (debug) _printf_("   Generating penalty matrices\n");
+		//*Generate penalty system matrices
+		PenaltySystemMatricesx(Kgg, pg,fem.elements,fem.nodes,loads,fem.materials,kflag,pflag,inputs,analysis_type); 
+
+		if (debug) _printf_("   reducing matrix from g to f set\n");
+		/*!Reduce matrix from g to f size:*/
+		Reducematrixfromgtofx(&Kff,&Kfs,Kgg,fem.Gmn,fem.nodesets);
+
+		/*Free ressources: */
+		MatFree(&Kgg);
+	
+		if (debug) _printf_("   reducing load from g to f set\n");
+		/*!Reduce load from g to f size: */
+		Reduceloadfromgtofx(&pf, pg, fem.Gmn, Kfs, fem.ys, fem.nodesets);
+
+		//no need for pg and Kfs anymore 
+		VecFree(&pg); 
+		MatFree(&Kfs);
+
+		/*Solve: */
+		if (debug) _printf_("   solving\n");
+		Solverx(&uf, Kff, pf, old_uf, solver_string);
+	
+		//no need for Kff and pf anymore
+		MatFree(&Kff);VecFree(&pf);
+
+		
+		if (debug) _printf_("   merging solution from f to g set\n");
+		//Merge back to g set
+		Mergesolutionfromftogx(&ug, uf,fem.Gmn,fem.ys,fem.nodesets);
+
+		//Deal with penalty loads
+		if (debug) _printf_("   penalty constraints\n");
+		ParameterInputsAddFromVec(inputs,ug,"velocity");
+		
+		PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem.elements,fem.nodes,loads,fem.materials,inputs,analysis_type); 
+
+		//Figure out if convergence is reached.
+		if(count>=2){
+			VecDuplicate(old_ug,&dug);VecCopy(old_ug,dug); VecAYPX(dug,-1.0,ug);
+			VecNorm(dug,NORM_2,&ndu); VecNorm(ug,NORM_2,&nu);VecFree(&dug);
+
+
+			if((ndu/nu)<eps_rel){
+				if (constraints_converged) converged=1;
+			}
+		
+			if (debug){
+				_printf_("%s%g%s%g\n","   Convergence criterion: norm(du)/norm(u)=",ndu/nu," > ",eps_rel);
+			}
+		}
+
+		/*Increase count: */
+		count++;
+		if(converged==1)break;
+
+	}
+
+	//more output might be needed, when running in cielocontrol.c
+	if(pKff0){
+
+		/*Set input parameters: */
+		ParameterInputsAddFromVec(inputs,ug,"velocity");
+	
+		kflag=1; pflag=0; //stiffness generation only
+	
+		SystemMatricesx(&Kgg, &pg,fem.elements,fem.nodes,fem.loads,fem.materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type); 
+	
+		Reducematrixfromgtofx(&Kff,&Kfs,Kgg,fem.Gmn,fem.nodesets);
+		
+		MatFree(&Kgg);VecFree(&pg);
+
+	}
+
+	/*Delete loads: */
+	delete loads;
+	
+	/*Assign output pointers: */
+	*pug=ug;
+	if(pKff0)*pKff0=Kff;
+	if(pKfs0)*pKfs0=Kfs;
+
+}
+
Index: /issm/trunk/src/c/parallel/objectivefunctionC.c
===================================================================
--- /issm/trunk/src/c/parallel/objectivefunctionC.c	(revision 1)
+++ /issm/trunk/src/c/parallel/objectivefunctionC.c	(revision 1)
@@ -0,0 +1,113 @@
+/*
+ * objectivefunctionC.c:
+ */
+#include "../../../config.h"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+#include "../include/cielo.h"
+#include "../modules.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "objectivefunctionC"
+
+double objectivefunctionC(double* search_vector,double fit,double optscal,FemModel*  femmodel,ParameterInputs* inputs){
+	
+		
+	/*Error management: */
+	int noerr=1;
+	int i;
+	int j;
+	double*          parameter=NULL;
+	double*          newparameter=NULL;
+	Vec*             vec_gradient=NULL;
+	double*          gradient=NULL;
+	Vec*             u_g=NULL;
+	double*          u_g_double=NULL;
+
+	/*output: */
+	double           J;
+
+	/*inputs recovered from the FemModel: */
+	WorkspaceParams* workspaceparams=NULL;
+	BatchParams*        batchparams=NULL;
+	DataSet*            bgpdt=NULL;
+	DataSet*            bgpdtb=NULL;
+	DataSet*            est=NULL;
+	DataSet*            lst=NULL;
+	DataSet*            ept=NULL;
+	DataSet*            mpt=NULL;
+	DataSet*            geom3=NULL;
+	Mat*                G_mn=NULL;
+	Vec*                y_s=NULL;
+	int                 flag_y_s=-1;
+	int                 analysis_type=-1;
+
+	/*Recover model inputs: */
+	workspaceparams=femmodel->workspaceparams;
+	batchparams=femmodel->batchparams;
+	bgpdt=femmodel->bgpdt;
+	bgpdtb=femmodel->bgpdtb;
+	est=femmodel->est;
+	lst=femmodel->lst;
+	ept=femmodel->ept;
+	mpt=femmodel->mpt;
+	geom3=femmodel->geom3;
+	G_mn=femmodel->G_mn;
+	y_s=femmodel->y_s;
+	flag_y_s=femmodel->flag_y_s;
+	analysis_type=femmodel->batchparams->analysis_type_enum;
+
+	//Go through parameters, and update along gradients, multiplying by search_vector.
+	for(i=0;i<workspaceparams->num_control_parameters;i++){
+
+		
+		char* control_type=workspaceparams->control_types[i];
+
+		/*Get parameter, and gradient for the parameter: */
+		parameter=WorkspaceParamsGetParameter(workspaceparams,control_type);
+		vec_gradient=WorkspaceParamsGetParameterGradient(workspaceparams,control_type);
+	
+	
+		/*serialize gradient: */
+		VecToMPISerial(&gradient,vec_gradient);
+
+
+		/*Ok, for this parameter, we have a direction. Update the parameter along 
+		 * the direction, using the search_vector value. Now, because parameter comes
+		 * directly from a workspaceparams pointer, we do not want to modify it. Make a copy
+		 * before updating it.*/
+		newparameter=xmalloc(workspaceparams->gsize*sizeof(double));
+		memcpy(newparameter,parameter,workspaceparams->gsize*sizeof(double));
+
+
+		for(j=0;j<(int)(workspaceparams->gsize/6);j++){
+			newparameter[6*j+0]=parameter[6*j+0]-search_vector[i]*optscal*gradient[6*j+0];
+		}
+		
+
+		/*Add newparameter to inputs: */
+		ParameterInputsAddFromMat(inputs,newparameter,workspaceparams->gsize,control_type);
+
+		/*Now, call on  each parameter's self constraining routine: */
+		WorkspaceParamsConstrain(workspaceparams,control_type);
+	}
+
+	//Run diagnostic with updated parameters.
+	cielodiagnostic_core_nonlinear(&u_g,NULL,NULL,inputs,femmodel);
+	VecToMPISerial(&u_g_double,u_g);
+
+	//Compute misfit for this velocity field. 
+	ParameterInputsAddFromDouble(inputs,fit,"fit");
+	Misfitx( &J, femmodel->bgpdt, femmodel->bgpdtb, femmodel->est, femmodel->ept, femmodel->mpt,femmodel->geom3, u_g_double, workspaceparams->u_g_obs,inputs, femmodel->batchparams->analysis_type_enum);
+
+	/*Free ressources: */
+	xfree((void**)&gradient);
+	xfree((void**)&newparameter);
+	xfree((void**)&u_g_double);
+
+	return J;
+}
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/parallel/parallel.h
===================================================================
--- /issm/trunk/src/c/parallel/parallel.h	(revision 1)
+++ /issm/trunk/src/c/parallel/parallel.h	(revision 1)
@@ -0,0 +1,35 @@
+/*
+ * parallel.h: 
+ */
+
+#ifndef PARALLEL_H_
+#define PARALLEL_H_
+
+#include "../objects/objects.h"
+
+int GradJCompute(ParameterInputs* inputs,FemModel* femmodel);
+
+void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, ParameterInputs* inputs,FemModel fem);
+int cielothermal_core(Vec** pt_g,ParameterInputs* inputs,FemModel* femmodel);
+
+//int GradJOrth(WorkspaceParams* workspaceparams);
+
+int GoldenSearch(double* psearch_scalar,double* pJ,double xa, double xb, double tolerance, int maxiter, double fit,double optscal,double (*f)(double*,double,double,FemModel*,ParameterInputs*),FemModel* femmodel);
+
+int BrentSearch(double* psearch_scalar,double* pJ,double xa, double xb, double tolerance, int maxiter, double fit,double optscal,double (*f)(double*,double,double,FemModel*,ParameterInputs*),FemModel* femmodel);
+	
+double objectivefunctionC(double* search_vector,double fit,double optscal,FemModel*  femmodel,ParameterInputs* inputs);
+
+int GradJSearch(double* search_vector,FemModel* femmodel,int step);
+//int GradJCheck(WorkspaceParams* workspaceparams,int step,int status);
+
+//int ParameterUpdate(double* search_vector,int step, WorkspaceParams* workspaceparams,BatchParams* batchparams);
+void OutputDiagnostic(Vec u_g,Vec tpartition,char* filename,NodeSets* nodesets,char* analysis_type);
+int OutputThermal(Vec* t_g,Vec* tpartition,char* filename,char* analysis_type);
+//int OutputControl(WorkspaceParams* workspaceparams,BatchParams* batchparams,Vec* u_g,Vec* tpartition, char* filename,char* analysis_type);
+void WriteLockFile(char* filename);
+
+void CreateFemModel(FemModel* femmodel,ConstDataHandle MODEL,char* analysis_type);
+//int BatchDebug(Mat* Kgg,Vec* pg,FemModel* femmodel,char* filename);
+
+#endif
Index: /issm/trunk/src/c/parallel/thermal_core.c
===================================================================
--- /issm/trunk/src/c/parallel/thermal_core.c	(revision 1)
+++ /issm/trunk/src/c/parallel/thermal_core.c	(revision 1)
@@ -0,0 +1,176 @@
+/*
+ * cielothermal_core.c:
+ */
+
+#include "../include/cielo.h"
+#include "../modules.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "cielothermal_core"
+
+#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
+int cielothermal_core(Vec** pt_g,ParameterInputs* inputs,FemModel* femmodel){
+
+	
+	
+	/*Femmodel: */
+	BatchParams* batchparams=NULL;
+	Mat* G_mn=NULL;
+	Vec* y_s=NULL;
+	int flag_y_s;
+	DataSet* bgpdt=NULL;
+	DataSet* bgpdtb=NULL;
+	DataSet* est=NULL;
+	DataSet* lst=NULL;
+	DataSet* new_lst=NULL;
+	DataSet* ept=NULL;
+	DataSet* mpt=NULL;
+	DataSet* geom3=NULL;
+	
+	int  noerr=1;
+
+	int  dummy;
+	Vec* t_f=NULL;
+	Vec* t_g=NULL;
+
+	Mat* K_gg=NULL;
+	Mat* K_gg_initial=NULL;
+	Mat* KT_gg=NULL;
+	Vec* p_g=NULL;
+	Vec* p_g_initial=NULL;
+	Mat* K_ff=NULL;
+	Mat* K_fs=NULL;
+	Vec* p_f=NULL;
+
+	int kflag,ktflag,pflag;
+	int converged=0;
+	int count;
+
+	/*some parameters:*/
+	double sparsity;
+	int    connectivity;
+	int    analysis_type_enum;
+	char*  solverstring=NULL;
+	int    debug;
+	int    min_thermal_constraints;
+	
+	/*intermediary data: */
+	int    num_unstable_constraints;
+
+	/*Recover model parameters: */
+	batchparams=femmodel->batchparams;
+	G_mn=femmodel->G_mn;
+	y_s=femmodel->y_s;
+	flag_y_s=femmodel->flag_y_s;
+	bgpdt=femmodel->bgpdt;
+	bgpdtb=femmodel->bgpdtb;
+	est=femmodel->est;
+	lst=femmodel->lst;
+	ept=femmodel->ept;
+	mpt=femmodel->mpt;
+	geom3=femmodel->geom3;
+	uset=femmodel->uset; //external variable
+
+	sparsity=batchparams->sparsity;
+	connectivity=batchparams->connectivity;
+	analysis_type_enum=batchparams->analysis_type_enum;
+	solverstring=batchparams->solverstring;
+	debug=batchparams->debug;
+	min_thermal_constraints=batchparams->min_thermal_constraints;
+
+	
+	//Start iteration on non-linearity
+	kflag=1; pflag=1; ktflag=0; //stiffness and load generation only:
+	converged=0;  //flag to break loop on non-linearity
+	count=1;
+		
+	for(;;){
+		if(count==1){
+			//*Generate system matrices
+			Emgx(&K_gg, &p_g, &KT_gg,kflag,pflag,ktflag,sparsity,connectivity,bgpdt, bgpdtb, est, lst, ept, mpt, geom3, inputs, analysis_type_enum);
+		
+			//Keep initial K_gg, so that penalties don't keep piling up onto K_gg: */
+			K_gg_initial=xmalloc(sizeof(Mat));
+			MatDuplicate(*K_gg,MAT_COPY_VALUES,K_gg_initial);
+			
+			p_g_initial=xmalloc(sizeof(Vec));
+			VecDuplicate(*p_g,p_g_initial);VecCopy(*p_g,*p_g_initial);
+		}
+		else{
+			/*Copy K_gg_initial into K_gg, same for p_g: */
+			K_gg=xmalloc(sizeof(Mat));
+			MatDuplicate(*K_gg_initial,MAT_COPY_VALUES,K_gg);
+	
+			p_g=xmalloc(sizeof(Vec));
+			VecDuplicate(*p_g_initial,p_g);VecCopy(*p_g_initial,*p_g);
+		}
+
+		//Add penalties
+		PenaltyEmgx(K_gg, p_g, kflag,pflag,bgpdt, bgpdtb, est, lst, ept, mpt, geom3, inputs, analysis_type_enum);
+
+		//Reduce tangent matrix from g size to f size
+		Reducematrixfromgtof(&K_ff,&dummy,&dummy, &K_fs,&dummy,&dummy, K_gg, G_mn, flag_y_s, 
+				uset->pv_m,uset->msize, uset->pv_n,uset->nsize, uset->pv_f,uset->fsize, uset->pv_s,uset->ssize,uset->gsize,uset->msize,uset->ssize);
+
+		//no need for K_gg and KT_gg anymore
+		MatFree(&K_gg); MatFree(&KT_gg);
+
+		//Reduce load from g size to f size
+		Reducerightside(&p_f, p_g, G_mn, K_fs, y_s, flag_y_s,
+				     uset->pv_m, uset->msize, uset->pv_n, uset->nsize, uset->pv_f, uset->fsize, 
+					 uset->msize,uset->ssize,uset->fsize);
+
+		//no need for p_g and K_fs anymore 
+		VecFree(&p_g); MatFree(&K_fs);
+
+		//solve
+		if(uset->fsize>0){
+			t_f=xmalloc(sizeof(Vec));
+			Solverx(t_f,&dummy,K_ff,dummy,dummy,p_f,dummy,NULL,0,solverstring);
+		}
+		else{
+			_printf_("All dof are constrained, f_set is empty...\n");
+			goto cleanup_and_return;
+		}
+
+		//no need for K_ff and p_f anymore
+		MatFree(&K_ff);VecFree(&p_f);
+
+		//Merge back to g set
+		Mergesolvec( &t_g, t_f, G_mn, y_s, uset->pv_m, uset->msize, uset->pv_n, uset->nsize, uset->pv_f, uset->fsize, uset->pv_s, uset->ssize,
+				uset->gsize,uset->msize,uset->nsize);
+
+		//t_f not  needed anymore
+		VecFree(&t_f);
+
+		//Deal with penalty loads
+		ParameterInputsAddFromVec(inputs,t_g,"temperature");
+		PenaltyConstraintsx(&new_lst, &converged,&num_unstable_constraints, bgpdt, bgpdtb, est, lst, mpt, inputs,analysis_type_enum);
+		
+		//Figure out if convergence is reached.
+		if(!converged){
+			if (debug){
+				_printf_("%s %i\n","   #unstable constraints ",num_unstable_constraints);
+				if (num_unstable_constraints<=min_thermal_constraints){
+					converged=1;
+				}
+			}
+		}
+
+		/*Reset lst to new_lst:*/
+		DeleteDataSet(&lst); lst=new_lst;
+
+		count++;
+		if(converged==1)break;
+	}
+
+	cleanup_and_return:
+
+	/*Assign output pointers: */
+	*pt_g=t_g;
+	return noerr;
+}
+#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+
Index: /issm/trunk/src/c/parallel/thermalsteady.c
===================================================================
--- /issm/trunk/src/c/parallel/thermalsteady.c	(revision 1)
+++ /issm/trunk/src/c/parallel/thermalsteady.c	(revision 1)
@@ -0,0 +1,111 @@
+/*
+ * cielothermalsteady.c:
+ */
+
+#include "../include/cielo.h"
+#include "../modules.h"
+#include "./parallel.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "cielothermalsteady"
+
+int main(int argc,char* *argv){
+	
+	/*I/O: */
+	FILE* fid=NULL;
+	char* inputfilename=NULL;
+	char* outputfilename=NULL;
+	char* lockname=NULL;
+	char* analysis_type_t="thermalsteady";
+	char* analysis_type_m="melting";
+
+	/*Intermediary: */
+	
+	#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+	FemModel femmodel_t;
+	FemModel femmodel_m;	Vec* t_g=NULL;
+	#endif
+	ParameterInputs* inputs=NULL;
+
+	#if !defined(_PARALLEL_) || (defined(_PARALLEL_) && !defined(_HAVE_PETSC_))
+		_printf_("%s%s\n",__FUNCT__," error message: parallel executable was compiled without support of parallel libraries!");
+		return 1;
+	#else
+
+		/*Initialize MPI environment: */
+		PetscInitialize(&argc,&argv,(char *)0,"");  
+
+		/*Size and rank: */
+		MPI_Comm_rank(MPI_COMM_WORLD,&my_rank);  
+		MPI_Comm_size(MPI_COMM_WORLD,&num_procs); 
+
+		/*Some checks on size of cluster*/
+		if (num_procs<=1){
+			_printf_("\nSize of MPI COMM WORLD is 1, needs to be at least 2. Include more nodes\n"); 
+			PetscFinalize(); 
+			return 0;
+		}
+
+		/*Recover dbdir, input file name and output file name: */
+		dbdir=argv[1];
+		inputfilename=argv[2];
+		outputfilename=argv[3];
+		lockname=argv[4];
+
+		
+		
+		/*Read and create thermal finite element model: */
+		fid=fopen(inputfilename,"rb");
+		if(fid==NULL){
+			_printf_("%s%s\n",__FUNCT__," error message: could not open file ",inputfilename," for binary reading"); 
+			return 0;
+		}
+		if(!CreateFemModel(&femmodel_t,fid,analysis_type_t)){
+			_printf_("%s\n",__FUNCT__," error message: could not read melting finite element model!\n");
+			return 0;
+		}
+		fclose(fid);
+
+		/*Read and create melting finite element model: */
+		fid=fopen(inputfilename,"rb");
+		if(!CreateFemModel(&femmodel_m,fid,analysis_type_m)){
+			_printf_("%s\n",__FUNCT__," error message: could not read thermal finite element model!\n");
+			return 0;
+		}
+		fclose(fid);
+
+		/*Initialize inputs: */
+		inputs=NewParameterInputs();
+			
+		ParameterInputsAddFromMat(inputs,WorkspaceParamsGetVelocity(femmodel_t.workspaceparams),femmodel_t.workspaceparams->gsize,"velocity");
+		ParameterInputsAddFromMat(inputs,WorkspaceParamsGetPressure(femmodel_t.workspaceparams),femmodel_t.workspaceparams->gsize,"pressure");
+
+		ParameterInputsAddFromMat(inputs,&femmodel_t.batchparams->dt,1,"dt");
+		
+		/*Call computational core: */
+		if(!cielothermal_core(&t_g,inputs,&femmodel_t)){
+			_printf_("%s\n",__FUNCT__," error message: could not run computational core!\n");
+			return 0;
+		}
+		
+		/*Write results to disk: */
+		OutputThermal(t_g,femmodel_t.tpartition,outputfilename,analysis_type_t);
+
+		/*Write lock file if requested: */
+		if (femmodel_t.batchparams->waitonlock){
+			WriteLockFile(lockname);
+		}
+					
+		cleanup_and_return:
+		_printf_("done.\n");
+		
+		/*Synchronize everyone before exiting: */
+		MPI_Barrier(MPI_COMM_WORLD);
+
+		/*Close MPI libraries: */
+		PetscFinalize(); 
+		
+		return 0; //unix success return;
+
+	#endif
+}
Index: /issm/trunk/src/c/shared/Alloc/alloc.cpp
===================================================================
--- /issm/trunk/src/c/shared/Alloc/alloc.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Alloc/alloc.cpp	(revision 1)
@@ -0,0 +1,104 @@
+/* \file alloc.h
+ * \brief: wrappers to "C" or "Matlab" memory allocators.
+ * These wrappers try to insulate ISSM from any library dependency.
+ * Ie: if we are running in matlab, matlab has to handle all memory allocations, 
+ * otherwise, we get big segfaults. If running in stand alone mode (pure C or C++ 
+ * application), we rely on the "C" library implementation of dynamic memory allocation.
+ * Why don't we use the "new" and "delete" c++ implementations? Because so far there 
+ * are no matlab wrappers to these, which implies having tons of segfaults when 
+ * running a mex module.
+ * Still, we try to throw memory allocation exceptions a la "C++" style when 
+ * the allocation routines described here do not work.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile without HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#if defined(_SERIAL_) && defined(_HAVE_MATLAB_)
+#include "mex.h"
+#endif
+
+#include "stdio.h"
+
+#include  "./alloc.h"
+#include "../Exceptions/exceptions.h"
+
+#undef __FUNCT__
+#define __FUNCT__ "xmalloc"
+void* xmalloc(int size){
+
+	void* memptr=NULL;
+
+	if(!size)throw ErrorException(__FUNCT__," attempting to 0 size allocation!");
+
+	#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
+	/* Use the matlab api to do the allocation: */
+	memptr=mxMalloc(size);
+	#else
+	/* Use the c library to do the allocation: */
+	memptr=malloc(size);
+	#endif
+	if(!memptr) throw ErrorException(__FUNCT__," memory allocation failed!");
+
+	return memptr;
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "xcalloc"
+void* xcalloc(int n,int size){
+
+	void* memptr=NULL;
+	
+	if(!size)throw ErrorException(__FUNCT__," attempting to 0 size allocation!");
+
+	#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
+	/* Use the matlab api to do the allocation: */
+	memptr=mxCalloc(n,size);
+	#else
+	/* Use the c library to do the allocation: */
+	memptr=calloc(n,size);
+	#endif
+	if(!memptr) throw ErrorException(__FUNCT__," memory allocation failed!");
+
+	return memptr;
+}
+
+void xfree( void* *pv)
+{
+
+	if (pv && *pv) {
+
+		#ifdef _SERIAL_
+		mxFree(*pv);
+		#else
+		free(*pv);
+		#endif
+
+		*pv=NULL;
+	}
+}
+
+
+#undef __FUNCT__
+#define __FUNCT__ "xrealloc"
+void* xrealloc ( void* pv, int size){
+	
+	register void* value=NULL;
+	
+	if(!size)throw ErrorException(__FUNCT__," attempting to realloc to zero");
+
+	#ifndef MATLAB
+	value = (void*)realloc(pv,size);
+	#else
+	value = (void*)mxRealloc(pv,size);
+	#endif
+
+	if (value == NULL) {
+		throw ErrorException(__FUNCT__,"virtual memory exhausted");
+	}
+	return value;
+}
Index: /issm/trunk/src/c/shared/Alloc/alloc.h
===================================================================
--- /issm/trunk/src/c/shared/Alloc/alloc.h	(revision 1)
+++ /issm/trunk/src/c/shared/Alloc/alloc.h	(revision 1)
@@ -0,0 +1,15 @@
+/* \file alloc.h
+ * \brief: header file for memory allocations.
+ */
+
+
+#ifndef _ALLOC_H_
+#define _ALLOC_H_
+
+
+void* xmalloc(int size);
+void* xcalloc(int n,int size);
+void  xfree(void** pvptr);
+void* xrealloc ( void* pv, int size);
+
+#endif
Index: sm/trunk/src/c/shared/Elements/Arrhenius.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/Arrhenius.cpp	(revision 28275)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/* \file Arrhenius.cpp
- * \brief figure out B of ice for a certain temperature
- */
-
-#include <math.h>
-#include "../Numerics/types.h"
-#include "../Exceptions/exceptions.h"
-
-IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n){
-	/*Use EISMINT Parameterization for the rheology: Payne2000
-	 *
-	 *  A(T*) = A0 exp(-Q/RT*)
-	 *
-	 *  A0 constant of proportionality
-	 *     = 3.61 * 10^-13   if T*<263.15K
-	 *     = 1.73 * 10^3     if T*>263.15K
-	 *  Q  Activation energy for creep
-	 *     = 6.0  * 10^4     if T*<263.15K
-	 *     = 13.9 * 10^4     if T*>263.15K
-	 *  R  Universal gas constant
-	 *     = 8.314
-	 *  T* Absolute temperature corrected for the dependence of Tpmp on P
-	 *     = T - beta (s-z)
-	 *
-	 *  Convert A to B :  B = A^(-1/n) */
-
-	/*Some physical constants (Payne2000)*/
-	IssmDouble beta=8.66*1.e-4;
-	IssmDouble R=8.314;
-
-	/*Intermediaries*/
-	IssmDouble A,B,Tstar;
-
-	/*convert temperature to absolute temperature*/
-	_assert_(depth>0);
-	Tstar=temperature-beta*depth;
-	_assert_(Tstar>0);
-
-	/*Get A*/
-	if(Tstar<263.15){
-		A=3.61e-13*exp(  -6.e+4/(R*Tstar));
-	}
-	else{
-		A=1.73e+3 *exp(-13.9e+4/(R*Tstar));
-	}
-
-	/*Convert to B*/
-	B=pow(A,-1./n);
-
-	return B;
-}
Index: sm/trunk/src/c/shared/Elements/BuddJacka.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/BuddJacka.cpp	(revision 28275)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/* \file BuddJacka.cpp
- * \brief figure out B of ice for a certain temperature
- *	  INPUT function B=BuddJacka(temperature)
- *    where rigidity (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Budd and Jacka, 1989). 
- */
-#include <math.h>
-
-#include "../Numerics/types.h"
-
-IssmDouble BuddJacka(IssmDouble temperature){
-
-	/*output: */
-	IssmDouble B,T;
-
-	/*Switch to celsius from Kelvin: */
-	T=temperature-273.15;
-
-	if(T<=-40.){
-		B=1e9*(-0.000031098521204*pow(T+50.,3)+ 0.002234792114381*pow(T+50.,2)-0.065051516643164*(T+50.)+1.005181071430026);
-	}
-	else if((-40.<T)  &&  (T<=-35.)){
-	 B=1e9*(-0.000031098521204*pow(T+40.,3)+ 0.001301836478264*pow(T+40.,2)-0.029685230716715*(T+40.)+0.547046595232583);
-	}
-	else if((-35.<T)  &&  (T<=-30.)){
-		B=1e9*(-0.000038394040864*pow(T+35.,3)+ 0.000835358660205*pow(T+35.,2)-0.018999255024368*(T+35.)+0.427279038455119);
-	}
-	else if((-30.<T)  &&  (T<=-25.)){
-		B=1e9*(-0.000007037062330*pow(T+30.,3)+ 0.000259448047242*pow(T+30.,2)-0.013525221487131*(T+30.)+0.348367474730384);
-	}
-	else if((-25.<T)  &&  (T<=-20.)){
-		B=1e9*( 0.000000905055684*pow(T+25.,3)+ 0.000153892112291*pow(T+25.,2)-0.011458520689465*(T+25.)+0.286347935684521);
-	}
-	else if((-20.<T)  &&  (T<=-15.)){
-		B=1e9*(-0.000002025865930*pow(T+20.,3)+ 0.000167467947546*pow(T+20.,2)-0.009851720390281*(T+20.)+0.233015767004928);
-	}
-	else if((-15.<T)  &&  (T<=-10.)){
-		B=1e9*(-0.000014464671112*pow(T+15.,3)+ 0.000137079958603*pow(T+15.,2)-0.008328980859537*(T+15.)+0.187690630500981);
-	}
-	else if((-10.<T)  &&  (T<=-5.)){
-		B=1e9*(-0.000014230086582*pow(T+10.,3)+-0.000079890108083*pow(T+10.,2)-0.008043031606935*(T+10.)+0.147664641279324);
-	}
-	else if((-5.<T)  &&  (T<=-2.)){
-		B=1e9*( 0.000022694046251*pow(T+5.,3)+-0.000293341406806*pow(T+5.,2)-0.009909189181377*(T+5. )+0.103673469719891);
-	}
-	else if((-2.<T)  &&  (T<=-1.)){
-		B=1e9*( 0.000056280347425*pow(T+2.,3)+-0.000089094990549*pow(T+2.,2)-0.011056498373441*(T+2. )+0.071918568763277);
-	}
-	else if((-1.<T)){
-		B=1e9*( 0.000056280347425*pow(T+1.,3)+ 0.000079746051725*pow(T+1.,2)-0.011065847312265*(T+1. )+0.060829255746712);
-	}
-	else{
-		/*FIXME: just copying previous case for now.... Felicity?*/
-		B=1e9*( 0.000056280347425*pow(T+1.,3)+ 0.000079746051725*pow(T+1.,2)-0.011065847312265*(T+1. )+0.060829255746712);
-	}
-
-	/*B cannot be negative!*/
-	if(B<0) B=1.e+6;
-
-	return B;
-}
Index: sm/trunk/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp	(revision 28275)
+++ 	(revision )
@@ -1,39 +1,0 @@
-/* file:  ComputeTemperaturePrecipitationfrom018.cpp
- Scale present day monthly precipitation and temperature fields
- along the NGRIP oxygen isotope record.
- */
-
-#include "./elements.h"
-#include "../Numerics/numerics.h"
-#include <cmath>
-
-void ComputeD18OTemperaturePrecipitationFromPD(IssmDouble d018,IssmDouble dpermil,bool isTemperatureScaled,
-			bool isPrecipScaled, IssmDouble f, IssmDouble* PrecipitationPresentday,IssmDouble* TemperaturePresentday,
-			IssmDouble* PrecipitationReconstructed,IssmDouble* TemperatureReconstructed, IssmDouble* monthlytemperaturesout, 
-			IssmDouble* monthlyprecout){
-
-  IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12];
-  IssmDouble deltaTemp;
-
-  /* Constants */
-  // dpermil = 2.4;/*degrees C per mil*/
-
-  /*Create Delta Temp to be applied to monthly temps and used in precip scaling*/
-  deltaTemp = dpermil * (d018+34.83);   
-
-  for(int imonth = 0; imonth<12; imonth++){
-
-	 if(isTemperatureScaled)monthlytemperaturestmp[imonth] = TemperaturePresentday[imonth] + deltaTemp;
-	 else{
-		 monthlytemperaturestmp[imonth] = TemperatureReconstructed[imonth];
-		 deltaTemp=TemperatureReconstructed[imonth]-TemperaturePresentday[imonth];
-	 }
-
-	 if (isPrecipScaled)monthlyprectmp[imonth] = PrecipitationPresentday[imonth]*exp((f/dpermil)*deltaTemp);
-	 else monthlyprectmp[imonth] = PrecipitationReconstructed[imonth];
-
-    /*Assign output pointer*/
-    *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth];
-    *(monthlyprecout+imonth) = monthlyprectmp[imonth];
-  }
-}
Index: sm/trunk/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 28275)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/* file:  ComputeTemperaturePrecipitation.cpp
-   Compute the temperature and precipitation at time t from 
-   the data at present day and delta18O
- */
-
-#include "./elements.h"
-#include "../Numerics/numerics.h"
-#include <cmath>
-
-void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
-				     IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, 
-				     IssmDouble* PrecipitationsPresentday,
-				     IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 
-				     IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout){
-
-  IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12];
-  IssmDouble delta18oLapseRate=-6.2*pow(10.,-3);
-  IssmDouble glacialindex; // used to vary present day temperature
-
-  glacialindex = (Delta18oTime-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceTime-Delta18oSurfacePresent))
-    /(Delta18oLgm-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceLgm-Delta18oSurfacePresent)); // Tarasov 2004 paper
-
-  for (int imonth = 0; imonth<12; imonth++){
-    monthlytemperaturestmp[imonth] = glacialindex*TemperaturesLgm[imonth] + (1.-glacialindex)*TemperaturesPresentday[imonth];
-    monthlyprectmp[imonth] = PrecipitationsPresentday[imonth];
-
-    /*Assign output pointer*/
-    *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth];
-    *(monthlyprecout+imonth) = monthlyprectmp[imonth];
-  }
-}
Index: sm/trunk/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp	(revision 28275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-/* file:  ComputeMungsmTemperaturePrecipitation.cpp
-   Compute the temperature and precipitation at time t from 
-   the data at present day and lgm.
-   The interpolation is done from some factors extracted from the MUNGSM
- */
-
-#include "./elements.h"
-#include "../Numerics/numerics.h"
-#include <cmath>
-
-void ComputeMungsmTemperaturePrecipitation(IssmDouble TdiffTime, IssmDouble PfacTime,
-					   IssmDouble* PrecipitationsLgm, IssmDouble* PrecipitationsPresentday,
-					   IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday,
-					   IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout){ 
-
-  IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12];
-  IssmDouble tdiffh;  
-
-  for (int imonth = 0; imonth<12; imonth++){
-    tdiffh = TdiffTime*( TemperaturesLgm[imonth] - TemperaturesPresentday[imonth] );
-    monthlytemperaturestmp[imonth] = tdiffh + TemperaturesPresentday[imonth] ;
-
-    monthlyprectmp[imonth] =min(1.5, PrecipitationsPresentday[imonth] * pow(PrecipitationsLgm[imonth],PfacTime));   // [m/yr]
-
-    /*Assign output pointer*/
-    *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth];
-    *(monthlyprecout+imonth) = monthlyprectmp[imonth];
-  }
-  // printf(" tempera %f\n",monthlytemperaturestmp[1]);
-}
Index: sm/trunk/src/c/shared/Elements/Cuffey.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/Cuffey.cpp	(revision 28275)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/* \file Cuffey.cpp
- * \brief figure out B of ice for a certain temperature
- *	  INPUT function B=Cuffey(temperature)
- *    where rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Cuffey, p75). 
- */
-
-#include <math.h>
-
-#include "../Numerics/types.h"
-
-IssmDouble Cuffey(IssmDouble temperature){
-
-	/*output: */
-	IssmDouble B,T;
-
-	/*Switch to celsius from Kelvin: */
-	T=temperature-273.15;
-
-	if(T<=-45.0){
-		B=1.e+8*(-0.000396645116301*pow(T+50.,3)+ 0.013345579471334*pow(T+50.,2) -0.356868703259105*(T+50.)+7.272363035371383);
-	}
-	else if((T>=-45.0) && (T<=-40.0)){
-		B=1.e+8*(-0.000396645116301*pow(T+45.,3)+ 0.007395902726819*pow(T+45.,2) -0.253161292268336*(T+45.)+5.772078366321591);
-	}
-	else if((T>=-40.0) && (T<=-35.0)){
-		B=1.e+8*(0.000408322072669*pow(T+40.,3)+  0.001446225982305*pow(T+40.,2)  -0.208950648722716*(T+40.)+4.641588833612773);
-	}
-	else if((T>=-35.0) && (T<=-30.0)){
-		B=1.e+8*(-0.000423888728124*pow(T+35.,3)+ 0.007571057072334*pow(T+35.,2)  -0.163864233449525*(T+35.)+3.684031498640382);
-	}
-	else if((T>=-30.0) && (T<=-25.0)){
-		B=1.e+8*(0.000147154327025*pow(T+30.,3)+ 0.001212726150476*pow(T+30.,2) -0.119945317335478*(T+30.)+3.001000667185614);
-	}
-	else if((T>=-25.0) && (T<=-20.0)){
-		B=1.e+8*(-0.000193435838672*pow(T+25.,3)+ 0.003420041055847*pow(T+25.,2)  -0.096781481303861*(T+25.)+2.449986525148220);
-	}
-	else if((T>=-20.0) && (T<=-15.0)){
-		B=1.e+8*(0.000219771255067*pow(T+20.,3)+  0.000518503475772*pow(T+20.,2)  -0.077088758645767*(T+20.)+2.027400665191131);
-	}
-	else if((T>=-15.0) && (T<=-10.0)){
-		B=1.e+8*(-0.000653438900191*pow(T+15.,3)+ 0.003815072301777*pow(T+15.,2)  -0.055420879758021*(T+15.)+1.682390865739973);
-	}
-	else if((T>=-10.0) && (T<=-5.0)){
-		B=1.e+8*(0.000692439419762*pow(T+10.,3) -0.005986511201093 *pow(T+10.,2) -0.066278074254598*(T+10.)+1.418983411970382);
-	}
-	else if((T>=-5.0) && (T<=-2.0)){
-		B=1.e+8*(-0.000132282004110*pow(T+5.,3) +0.004400080095332*pow(T+5.,2)    -0.074210229783403*(T+5.)+ 1.024485188140279);
-	}
-	else{
-		B=1.e+8*(-0.000132282004110*pow(T+2.,3) +0.003209542058346*pow(T+2.,2)    -0.051381363322371*(T+2.)+ 0.837883605537096);
-	}
-
-	/*B cannot be negative!*/
-	if(B<0) B=1.e+6;
-
-	return B;
-}
Index: sm/trunk/src/c/shared/Elements/CuffeyTemperate.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/CuffeyTemperate.cpp	(revision 28275)
+++ 	(revision )
@@ -1,15 +1,0 @@
-/* \file CuffeyTemperate.cpp
- * \brief figure out B of ice for a certain temperature and waterfraction
- *	  INPUT function B=Cuffey(temperature, waterfraction)
- *    where rigidity (in s^(1/3)Pa) is the flow law parameter in the flow law sigma=B*e(1/3) (Cuffey, p75). 
- */
-
-#include <math.h>
-#include "./elements.h"
-#include "../Numerics/numerics.h"
-
-IssmDouble CuffeyTemperate(IssmDouble temperature, IssmDouble waterfraction, IssmDouble stressexp){
-
-	return Cuffey(temperature)*pow(1+181.25*max(0., min(0.01, waterfraction)), -1./stressexp); 
-
-}
Index: sm/trunk/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp	(revision 28275)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*!\file DrainageFunctionWaterfraction.cpp
- * \brief: drain excess water fraction
- */
-
-#include <math.h>
-#include "../Numerics/types.h"
-#include "../Exceptions/exceptions.h"
-
-IssmDouble DrainageFunctionWaterfraction(IssmDouble waterfraction, IssmDouble dt=0.){
-	/* DrainageFunctionWaterfraction returns how much of the waterfraction is drained per year */
-	_assert_(waterfraction>=0.);
-	_assert_(dt>=0.);
-
-	IssmDouble w0=0.01, w1=0.02, w2=0.03;
-	IssmDouble yts=365.*24.*60.*60.;
-	IssmDouble Dret, D0=0., D1=0.005/yts, D2=0.05/yts;
-
-	/*get drainage function value*/
-	if((w0==w1)||(w1==w2)||(w0==w2))
-		_error_("Error: equal ordinates in DrainageFunctionWaterfraction -> division by zero. Abort");
-
-	if(waterfraction<=w0)
-		Dret=D0;
-	else if((waterfraction>w0) && (waterfraction<=w1))
-		Dret=(D1-D0)/(w1-w0)*(waterfraction-w0)+D0;
-	else if((waterfraction>w1) && (waterfraction<=w2))
-		Dret=(D2-D1)/(w2-w1)*(waterfraction-w1)+D1;
-	else 
-		Dret=D2;
-
-	/*drain only up to w0*/
-	if(dt==0.){
-		if(waterfraction>w0) 
-			return waterfraction-w0;
-		else
-			return Dret;
-	}
-	else{
-		if((waterfraction>w0) && (waterfraction-dt*Dret<w0))
-			return (waterfraction-w0)/dt;
-		else
-			return Dret;
-	}
-}
Index: sm/trunk/src/c/shared/Elements/EstarComponents.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/EstarComponents.cpp	(revision 28275)
+++ 	(revision )
@@ -1,129 +1,0 @@
-#include <math.h>
-#include "../Numerics/types.h"
-#include "../Exceptions/exceptions.h"
-#include "./elements.h"
-void EstarStrainrateQuantities(IssmDouble *pepsprime_norm, IssmDouble vx,IssmDouble vy,IssmDouble vz,IssmDouble vmag,IssmDouble* dvx,IssmDouble* dvy,IssmDouble* dvz,IssmDouble* dvmag){/*{{{*/
-
-	/*Intermediaries*/
-	IssmDouble omega[3];
-	IssmDouble nrsp[3],nrsp_norm;
-	IssmDouble eps[3][3];
-	IssmDouble epsprime[3],epsprime_norm;
-
-	/*Get omega, correction for rigid body rotation*/
-	EstarOmega(&omega[0],vx,vy,vz,vmag,dvx,dvy,dvz,dvmag);
-
-	/*Non-rotating shear plane*/
-	nrsp[0] =  vy*omega[2] - vz*omega[1];
-	nrsp[1] =  vz*omega[0] - vx*omega[2];
-	nrsp[2] =  vx*omega[1] - vy*omega[0];
-
-	/*Normalize*/
-	nrsp_norm = sqrt(nrsp[0]*nrsp[0] + nrsp[1]*nrsp[1] + nrsp[2]*nrsp[2]);
-	if(nrsp_norm==0){
-		nrsp[0] = 0.;
-		nrsp[1] = 0.;
-		nrsp[2] = 0.;
-	}
-	else{
-		nrsp[0] =nrsp[0]/nrsp_norm;
-		nrsp[1] =nrsp[1]/nrsp_norm;
-		nrsp[2] =nrsp[2]/nrsp_norm;
-	}
-
-	/*Build strain rate tensor*/
-	eps[0][0] = dvx[0];             eps[0][1] = .5*(dvx[1]+dvy[0]); eps[0][2] = .5*(dvx[2]+dvz[0]);
-	eps[1][0] = .5*(dvx[1]+dvy[0]); eps[1][1] = dvy[1];             eps[1][2] = .5*(dvy[2]+dvz[1]);
-	eps[2][0] = .5*(dvx[2]+dvz[0]); eps[2][1] = .5*(dvy[2]+dvz[1]); eps[2][2] = dvz[2];
-
-	/*Compute the shear strain rate on the non rotating shear plane*/
-	epsprime[0]=0.;
-	epsprime[1]=0.;
-	epsprime[2]=0.;
-	/*term #1: eps'.n */
-	for(int i=0;i<3;i++){
-		for(int j=0;j<3;j++){
-			epsprime[i] += eps[i][j]*nrsp[j];
-		}
-	}
-	/*term #2: ((eps'.n).n)n */
-	for(int i=0;i<3;i++){
-		for(int j=0;j<3;j++){
-			for(int k=0;k<3;k++){
-				epsprime[j] += -nrsp[i]*eps[i][k]*nrsp[k]*nrsp[j];
-			}
-		}
-	}
-	/*term #3: ((eps'.n).omega)omega */
-	for(int i=0;i<3;i++){
-		for(int j=0;j<3;j++){
-			for(int k=0;k<3;k++){
-				epsprime[j] += -nrsp[i]*eps[i][k]*omega[k]*omega[j];
-			}
-		}
-	}
-
-	/*Get norm of epsprime*/
-	epsprime_norm = sqrt(epsprime[0]*epsprime[0] + epsprime[1]*epsprime[1] + epsprime[2]*epsprime[2]);
-
-	/*Assign output pointers*/
-	*pepsprime_norm=epsprime_norm;
-}/*}}}*/
-void EstarOmega(IssmDouble* omega,IssmDouble vx,IssmDouble vy,IssmDouble vz,IssmDouble vmag,IssmDouble* dvx,IssmDouble* dvy,IssmDouble* dvz, IssmDouble* dvmag){/*{{{*/
-
-	/*Intermediaries*/
-	IssmDouble omega_norm;
-	IssmDouble omega_rigid[3];
-
-	/*Create vorticity vector*/
-	_assert_(dvx && dvy && dvz && dvmag);
-	if(vmag<1e-12)vmag=1e-12;
-
-	/*Create vorticity vector, corrected for rigid body rotation
-	 * \overline{\omega} =\omega - \omega_rigid
-	 *                   =\nabla\times{\bf v} - 2*U*\kappa*\hat{b};
-	 *                   =\nabla\times{\bf v} - (2*{\bf v}\times(({\bf v}\cdot\nabla)*{\bf v}))/U^2
-	 * check the magnitude of the second term -- if it is small, then the two
-	 * vorticities (omega and first term in omega) are approx. equal
-	 *
-	 * */
-	omega_rigid[0] = 2*(vy*(vx*dvz[0]+vy*dvz[1]+vz*dvz[2]) - vz*(vx*dvy[0]+vy*dvy[1]+vz*dvy[2]))/(vmag*vmag);
-	omega_rigid[1] = 2*(vz*(vx*dvx[0]+vy*dvx[1]+vz*dvx[2]) - vx*(vx*dvz[0]+vy*dvz[1]+vz*dvz[2]))/(vmag*vmag);
-	omega_rigid[2] = 2*(vx*(vx*dvy[0]+vy*dvy[1]+vz*dvy[2]) - vy*(vx*dvx[0]+vy*dvx[1]+vz*dvx[2]))/(vmag*vmag);
-
-	omega[0] = (dvz[1] - dvy[2]) - omega_rigid[0];
-	omega[1] = (dvx[2] - dvz[0]) - omega_rigid[1];
-	omega[2] = (dvy[0] - dvx[1]) - omega_rigid[2];
-
-	/*Take out vorticity component aligned with the velocity*/
-	IssmDouble wdotv = vx/vmag*omega[0] + vy/vmag*omega[1] + vz/vmag*omega[2];
-	omega[0] = omega[0] - wdotv*vx/vmag;
-	omega[1] = omega[1] - wdotv*vy/vmag;
-	omega[2] = omega[2] - wdotv*vz/vmag;
-
-	/*Normalize*/
-	omega_norm = sqrt(omega[0]*omega[0] + omega[1]*omega[1] + omega[2]*omega[2]);
-	if(omega_norm==0){
-		omega[0] = 0.;
-		omega[1] = 0.;
-		omega[2] = 0.;
-	}
-	else{
-		omega[0] =omega[0]/omega_norm;
-		omega[1] =omega[1]/omega_norm;
-		omega[2] =omega[2]/omega_norm;
-	}
-
-}/*}}}*/
-IssmDouble EstarLambdaS(IssmDouble epseff, IssmDouble epsprime_norm){/*{{{*/
-	IssmDouble lambdas;
-
-	_assert_(epsprime_norm>=0.); 
-	if(epseff==0.){
-		lambdas=0.;
-	}
-	else{
-		lambdas=sqrt(epsprime_norm*epsprime_norm/(epseff*epseff));
-	}
-	return lambdas; 
-}/*}}}*/
Index: /issm/trunk/src/c/shared/Elements/GetElementNodeData.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/GetElementNodeData.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Elements/GetElementNodeData.cpp	(revision 1)
@@ -0,0 +1,18 @@
+/*!\file:  GetElementNodeData.cpp
+ * \brief get node coordinates
+ */ 
+
+#include "../../objects/Node.h"
+
+int GetElementNodeData( double* xyz,  Node** nodes, int numgrids){
+
+	int i;
+
+	for ( i=0; i<numgrids; i++) {
+		xyz[i*3+0]=nodes[i]->GetX();
+		xyz[i*3+1]=nodes[i]->GetY();
+		xyz[i*3+2]=nodes[i]->GetZ();
+	}
+
+}
+
Index: sm/trunk/src/c/shared/Elements/LliboutryDuval.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/LliboutryDuval.cpp	(revision 28275)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/* \file LliboutryDuval.cpp
- * \brief figure out B of ice for a certain temperature and water fraction or enthalpy
- */
-
-#include <math.h>
-#include "../Numerics/types.h"
-#include "../Exceptions/exceptions.h"
-
-/* get ice stiffness B from enthalpy, pressure and flow law exponent*/
-IssmDouble LliboutryDuval(IssmDouble enthalpy, IssmDouble pressure, IssmDouble n, IssmDouble betaCC, IssmDouble referencetemperature, IssmDouble heatcapacity, IssmDouble latentheat){
-  /*Use Lliboutry & Duval's 1985 parameterization for the rheology: 
-	* see also: Grewe/Blatter 2009, Aschwanden et al. 2012
-	*
-	* ISSM uses enthalpy/temperature values that are not corrected for pressure.
-   *
-   *  A(H,p) = A0 exp(-Q/RT(H,p)), if H < H_s(p)
-   *         = A0 exp(-Q/RTpmp) (1+181.25w(H,p)), if H_s(p) \le H < H_l(p)
-   *  
-   *  T(H,p) = Tref + H/c_i, if H < H_s(p)
-   *         = Tpmp , if H_s(p) \le H \le H_l(p)
-   *
-   *  w(H,p) = 0, if H < H_s(p)
-   *         = (H - H_s(p))/L
-   *
-   *  H_s(p) = c_i (Tpmp - Tref)
-   *
-   *  Tpmp   = T - betaCC p;
-   *
-   *  A0 constant of proportionality
-   *     = 3.61 * 10^-13   if T*<263.15K
-   *     = 1.73 * 10^3     if T*>263.15K
-   *  Q  Activation energy for creep
-   *     = 6.0  * 10^4     if T*<263.15K
-   *     = 13.9 * 10^4     if T*>263.15K
-   *  R  Universal gas constant
-   *     = 8.314
-   *  
-   *  Convert A to B :  B = A^(-1/n) */
-	/*check feasibility*/
-	_assert_(pressure+1.e-4>=0); // deal with pressure instability at ice surface
-	_assert_(n>0);
-	_assert_(betaCC>=0);
-	_assert_(referencetemperature>=0);
-	_assert_(heatcapacity>0);
-	_assert_(latentheat>0);
-
-	/*Some physical constants*/
-	IssmDouble R=8.314; 
-
-	/*Intermediaries*/
-	IssmDouble A,B,Tstar,Tpmp,H_sp,waterfraction;
-
-	Tpmp=273.15-betaCC*pressure; //pressure melting point temperature
-	H_sp=heatcapacity*(Tpmp-referencetemperature); //pressure melting point enthalpy
-	if (enthalpy<H_sp){ //compute homologous temperature and water fraction
-		Tstar=referencetemperature+enthalpy/heatcapacity+betaCC*pressure; 
-		waterfraction=0.;
-	}
-	else{
-		Tstar=273.15;
-		waterfraction=(enthalpy-H_sp)/latentheat;
-		if (waterfraction>0.01) waterfraction=0.01; // limit softness of ice
-	}
-
-	/*Get A*/
-	if(Tstar<=263.15){A=3.61e-13*exp(-6.e+4/(R*Tstar));}
-	else{A=1.73e3*exp(-13.9e+4/(R*Tstar));}
-	A*=(1.+181.25*waterfraction);
-
-	/*Convert to B*/
-	B=pow(A,-1./n);
-	return B;
-}
Index: sm/trunk/src/c/shared/Elements/NyeCO2.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/NyeCO2.cpp	(revision 28275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/* \file NyeCO2.cpp
- * \brief figure out B of CO2 ice for a certain temperature
- *		INPUT function B=NyeCO2(temperature)
- *    	where rigidigty (in s^(1/n)Pa) is the flow law paramter in the flow law sigma=B*e(1/n) (Nye, p2000). 
- */
-
-#include "../io/io.h" 
-#include <math.h> 
-#include "../Numerics/types.h"
-
-IssmDouble NyeCO2(IssmDouble temperature){
-
-	/*Coefficients*/
-	const IssmPDouble Rg      = 8.3144598;     /* J mol^-1 K^-1   */ 
-	const IssmPDouble A_const = pow(10.,13.0); /* s^-1 MPa        */ 
-	const IssmPDouble Q       = 66900.;        /* J mol^-1        */ 
-	const IssmPDouble n       = 8.;            /* Glen's exponent */
-
-	/*Arrhenius Law*/
-	IssmDouble A = A_const *exp(-Q/(temperature*Rg));  /* s^-1 MPa   */
-	IssmDouble B = 1e6*pow(A,-1/n);                    /* s^(1/n) Pa */
-
-	/*Beyond-melting-point cases*/
-	if((temperature>200.)&&(temperature<220.)) _printf0_("CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.\n");
-	else if(temperature>=220.) _printf0_("CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.\n");
-
-	/*Return output*/
-	return B; 
-}
Index: sm/trunk/src/c/shared/Elements/NyeH2O.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/NyeH2O.cpp	(revision 28275)
+++ 	(revision )
@@ -1,28 +1,0 @@
-/* \file NyeH2O.cpp
- * brief figure out B of H2O ice for a certain temperature
- *		INPUT function B=NyeH2O(temperature)
- *    	where rigidigty (in s^(1/n)Pa) is the flow law paramter in the flow law sigma=B*e(1/n) (Nye, p2000). 
- */
-
-#include "../io/io.h"
-#include <math.h>
-#include "../Numerics/types.h"
-
-IssmDouble NyeH2O(IssmDouble temperature){
-
-	/*Coefficients*/
-	const IssmPDouble Rg      = 8.3144598; /* J mol^-1 K^-1 */
-	const IssmPDouble A_const = 9.e4;      /*s^-1 MPa       */
-	const IssmPDouble Q       = 60000.;    /*J mol^-1       */
-	const IssmPDouble n       = 3.;        /*Glen's exponent*/
-
-	/*Arrhenius Law*/
-	IssmDouble A = A_const *exp(-Q/(temperature*Rg));  /*s^-1 MPa   */
-	IssmDouble B = 1e6*pow(A,-1/n);                    /*s^(1/n) Pa */
-
-	/*Beyond-melting-point case*/
-	if(temperature>=273.15) _printf0_("H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\n");
-
-	/*Return output*/
-	return B;
-}
Index: /issm/trunk/src/c/shared/Elements/Paterson.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/Paterson.cpp	(revision 28275)
+++ /issm/trunk/src/c/shared/Elements/Paterson.cpp	(revision 1)
@@ -5,52 +5,66 @@
  */
 
+#undef __FUNCT__ 
+#define __FUNCT__ "Paterson"
 #include <math.h>
-
-#include "../Numerics/types.h"
-
-IssmDouble Paterson(IssmDouble temperature){
-
-	IssmDouble B,T;
+double Paterson(double temperature){
+	
+	/*output: */
+	double B;
+	double T;
 
 	/*Switch to celsius from Kelvin: */
 	T=temperature-273.15;
 
+//	%The routine below is equivalent to:
+//	% n=3; T=temperature-273;
+//	% %From Paterson,
+//	% Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
+//	% A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
+//	% 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
+//	% %Convert into B B
+//	% B=A.^(-1/n)*10^3; %s^(1/3)Pa
+//	% %Now, do a cubic fit between Temp and B: 
+//	% fittedmodel=fit(Temp,B,'cubicspline');
+//	% B=fittedmodel(temperature);
+
+
 	if(T<=-45.0){
-		B=1.e+8*(-0.000292866376675*pow(T+50.,3)+ 0.011672640664130*pow(T+50.,2)  -0.325004442485481*(T+50.)+  6.524779401948101);
+		B=pow(10,8)*(-0.000292866376675*pow(T+50,3)+ 0.011672640664130*pow(T+50,2)  -0.325004442485481*(T+50)+  6.524779401948101);
 	}
-	else if((T>=-45.0) && (T<=-40.0)){
-		B=1.e+8*(-0.000292866376675*pow(T+45.,3)+ 0.007279645014004*pow(T+45.,2)  -0.230243014094813*(T+45.)+  5.154964909039554);
+	if((T>=-45.0) && (T<=-40.0)){
+		B=pow(10,8)*(-0.000292866376675*pow(T+45,3)+ 0.007279645014004*pow(T+45,2)  -0.230243014094813*(T+45)+  5.154964909039554);
 	}
-	else if((T>=-40.0) && (T<=-35.0)){
-		B=1.e+8*(0.000072737147457*pow(T+40.,3)+  0.002886649363879*pow(T+40.,2)  -0.179411542205399*(T+40.)+  4.149132666831214);
+	if((T>=-40.0) && (T<=-35.0)){
+		B=pow(10,8)*(0.000072737147457*pow(T+40,3)+  0.002886649363879*pow(T+40,2)  -0.179411542205399*(T+40)+  4.149132666831214);
 	}
-	else if((T>=-35.0) && (T<=-30.0)){
-		B=1.e+8*(-0.000086144770023*pow(T+35.,3)+ 0.003977706575736*pow(T+35.,2)  -0.145089762507325*(T+35.)+  3.333333333333331);
+	if((T>=-35.0) && (T<=-30.0)){
+		B=pow(10,8)*(-0.000086144770023*pow(T+35,3)+ 0.003977706575736*pow(T+35,2)  -0.145089762507325*(T+35)+  3.333333333333331);
 	}
-	else if((T>=-30.0) && (T<=-25.0)){
-		B=1.e+8*(-0.000043984685769*pow(T+30.,3)+ 0.002685535025386*pow(T+30.,2)  -0.111773554501713*(T+30.)+  2.696559088937191);
+	if((T>=-30.0) && (T<=-25.0)){
+		B=pow(10,8)*(-0.000043984685769*pow(T+30,3)+ 0.002685535025386*pow(T+30,2)  -0.111773554501713*(T+30)+  2.696559088937191);
 	}
-	else if((T>=-25.0) && (T<=-20.0)){
-		B=1.e+8*(-0.000029799523463*pow(T+25.,3)+ 0.002025764738854*pow(T+25.,2)  -0.088217055680511*(T+25.)+  2.199331606342181);
+	if((T>=-25.0) && (T<=-20.0)){
+		B=pow(10,8)*(-0.000029799523463*pow(T+25,3)+ 0.002025764738854*pow(T+25,2)  -0.088217055680511*(T+25)+  2.199331606342181);
 	}
-	else if((T>=-20.0) && (T<=-15.0)){
-		B=1.e+8*(0.000136920904777*pow(T+20.,3)+  0.001578771886910*pow(T+20.,2)  -0.070194372551690*(T+20.)+  1.805165505978111);
+	if((T>=-20.0) && (T<=-15.0)){
+		B=pow(10,8)*(0.000136920904777*pow(T+20,3)+  0.001578771886910*pow(T+20,2)  -0.070194372551690*(T+20)+  1.805165505978111);
 	}
-	else if((T>=-15.0) && (T<=-10.0)){
-		B=1.e+8*(-0.000899763781026*pow(T+15.,3)+ 0.003632585458564*pow(T+15.,2)  -0.044137585824322*(T+15.)+  1.510778053489523);
+	if((T>=-15.0) && (T<=-10.0)){
+		B=pow(10,8)*(-0.000899763781026*pow(T+15,3)+ 0.003632585458564*pow(T+15,2)  -0.044137585824322*(T+15)+  1.510778053489523);
 	}
-	else if((T>=-10.0) && (T<=-5.0)){
-		B=1.e+8*(0.001676964325070*pow(T+10.,3)-  0.009863871256831*pow(T+10.,2)  -0.075294014815659*(T+10.)+  1.268434288203714);
+	if((T>=-10.0) && (T<=-5.0)){
+		B=pow(10,8)*(0.001676964325070*pow(T+10,3)-  0.009863871256831*pow(T+10,2)  -0.075294014815659*(T+10)+  1.268434288203714);
 	}
-	else if((T>=-5.0) && (T<=-2.0)){
-		B=1.e+8*(-0.003748937622487*pow(T+5.,3)+0.015290593619213*pow(T+5.,2)  -0.048160403003748*(T+5.)+  0.854987973338348);
+	if((T>=-5.0) && (T<=-2.0)){
+		B=pow(10,8)*(-0.003748937622487*pow(T+5,3)+0.015290593619213*pow(T+5,2)  -0.048160403003748*(T+5)+  0.854987973338348);
 	}
-	else{
-		B=1.e+8*(-0.003748937622488*pow(T+2.,3)-0.018449844983174*pow(T+2.,2)  -0.057638157095631*(T+2.)+  0.746900791092860);
+	if(T>=-2.0){
+		B=pow(10,8)*(-0.003748937622488*pow(T+2,3)-0.018449844983174*pow(T+2,2)  -0.057638157095631*(T+2)+  0.746900791092860);
 	}
-
-	/*B cannot be negative!*/
-	if(B<0) B=1.e+6;
 
 	return B;
 }
+
+
+
Index: sm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 28275)
+++ 	(revision )
@@ -1,249 +1,0 @@
-/* file:  PddSurfaceMassBlance.cpp
-   Calculating the surface mass balance using the positive degree day method.
-   Updating the precipitation and temperature to the new elevation
- */
-
-#include "../io/io.h"
-#include "./elements.h"
-#include "../Numerics/numerics.h"
-#include <cmath>
-
-IssmDouble PddSurfaceMassBalance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
-				 IssmDouble* pdds, IssmDouble* pds, IssmDouble* melt, IssmDouble* accu, 
-				 IssmDouble signorm, IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble desfac,
-				 IssmDouble s0t,IssmDouble s0p, IssmDouble rlaps,IssmDouble rlapslgm,
-				 IssmDouble TdiffTime,IssmDouble sealevTime, IssmDouble pddsnowfac,IssmDouble pddicefac,
-				 IssmDouble rho_water,IssmDouble rho_ice){
-
-  // output:
-  IssmDouble B;    // surface mass balance, melt+accumulation
-  int    iqj,imonth;
-
-  IssmDouble saccu;     // yearly surface accumulation
-  IssmDouble smelt;     // yearly melt
-  IssmDouble precrunoff;      // yearly runoff
-  IssmDouble prect; // total precipitation during 1 year taking into account des. ef.
-  IssmDouble water; //water=rain + snowmelt 
-  IssmDouble runoff; //meltwater only, does not include rain 
-  IssmDouble sconv; //rhow_rain/rhoi / 12 months
-
-  //IssmDouble  sealev=0.;         // degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper
-  //IssmDouble  Pfac=0.5,Tdiff=0.5;
-  IssmDouble rtlaps;
-  // IssmDouble lapser=6.5         // lapse rate
-  // IssmDouble desfac = 0.3;      // desert elevation factor
-  // IssmDouble s0p=0.;            // should be set to elevation from precip source
-  // IssmDouble s0t=0.;         // should be set to elevation from temperature source
-  IssmDouble st;             // elevation between altitude of the temp record and current altitude
-  IssmDouble sp;             // elevation between altitude of the prec record and current altitude
-  IssmDouble deselcut=1.0;
-
-  // PDD and PD constants and variables
-  IssmDouble siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
-  IssmDouble signormc = signorm - 0.5;     // sigma of the temperature distribution for cloudy day
-  IssmDouble siglimc, siglim0, siglim0c;
-  IssmDouble PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
-  IssmDouble DT = 0.02;
-  IssmDouble pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
-
-  IssmDouble q, qmpt;   // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
-  IssmDouble qm = 0.;   // snow part of the precipitation 
-  IssmDouble qmt = 0.;  // precipitation without desertification effect adjustment
-  IssmDouble qmp = 0.;  // desertification taken into account
-  IssmDouble pdd = 0.;     
-  IssmDouble frzndd = 0.;  
-
-  IssmDouble tstar;          // monthly mean surface temp
-  IssmDouble Tsum= 0.;       // average summer (JJA) temperature
-  IssmDouble Tsurf = 0.;     // average annual temperature    
-
-  IssmDouble deltm=1./12.;
-  int    ismon[12]={11,0,1,2,3,4,5,6,7,8,9,10};
-
-  IssmDouble snwm;  // snow that could have been melted in a year.
-  IssmDouble snwmf; //  ablation factor for snow per positive degree day.
-  IssmDouble smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
-
-  IssmDouble dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
-  IssmDouble supice,supcap,diffndd;
-  IssmDouble fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
-  IssmDouble pddtj, hmx2;
-  IssmDouble pddsnowfac0=4.3, pddicefac0=8.3;
-  IssmDouble snowfac, icefac;
-
-  sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months
-
-  /*PDD constant*/
-  siglim = 2.5*signorm; 
-  siglimc = 2.5*signormc;
-  siglim0 = siglim/DT + 0.5;
-  siglim0c = siglimc/DT + 0.5;
-  PDup = siglimc+PDCUT;
-
-  // seasonal loop
-  for (iqj = 0; iqj < 12; iqj++){
-    imonth =  ismon[iqj];
-
-    /*********compute lapse rate ****************/
-    st=(s-s0t)/1000.;
-    rtlaps=TdiffTime*rlapslgm + (1.-TdiffTime)*rlaps; // lapse rate
-
-    /*********compute Surface temperature *******/
-    monthlytemperatures[imonth]=monthlytemperatures[imonth] - rtlaps *max(st,sealevTime*0.001);
-    tstar = monthlytemperatures[imonth];
-    Tsurf = tstar*deltm+Tsurf;        
-
-    /*********compute PD ****************/
-    if (tstar < PDup){
-      pd = 1.;
-      if (tstar >= -siglimc){ pd = pds[reCast<int,IssmDouble>(tstar/DT + siglim0c)];}}
-    else { 
-      pd = 0.;}
-
-    /******exp des/elev precip reduction*******/
-    sp=(s-s0p)/1000.-deselcut; // deselev effect is wrt chng in topo
-    if (sp>0.0){q = exp(-desfac*sp);}
-    else {q = 1.0;}
-
-    qmt= qmt + monthlyprec[imonth]*sconv;  //*sconv to convert in m of ice equivalent per month  
-    qmpt= q*monthlyprec[imonth]*sconv;
-    qmp= qmp + qmpt;
-    qm= qm + qmpt*pd;
-
-    /*********compute PDD************/
-    // ndd(month)=-(tstar-pdd(month)) since ndd+pdd gives expectation of
-    // gaussian=T_m, so ndd=-(Tsurf-pdd)
-    if (iqj>5 && iqj<9){ Tsum=Tsum+tstar;} 
-
-    if (tstar >= siglim) {pdd = pdd + tstar*deltm;}
-    else if (tstar> -siglim){
-      pddsig=pdds[reCast<int,IssmDouble>(tstar/DT + siglim0)];
-      pdd = pdd + pddsig*deltm;
-      frzndd = frzndd - (tstar-pddsig)*deltm;}
-    else{frzndd = frzndd - tstar*deltm; }
-
-    /*Assign output pointer*/
-    *(monthlytemperatures+imonth) = monthlytemperatures[imonth];
-    *(monthlyprec+imonth) = monthlyprec[imonth];      
-  } // end of seasonal loop 
-  //******************************************************************
-
-  saccu = qm;
-  prect = qmp;     // total precipitation during 1 year taking into account des. ef.
-  Tsum=Tsum/3;
-
-  snowfac=pddsnowfac0;
-  icefac=pddicefac0;
-  if (pddsnowfac>0) {
-	  if (pddsnowfac<1.65) {
-		  _printf0_("WARNING: Pdd snow factor input, " << pddsnowfac << ", results in a negative value. It will be ignored. \n");
-	  }
-	  else{
-		snowfac=pddsnowfac;
-	  }
-  }
-  if (pddicefac>0) {
-	  if (pddicefac>17.22) {
-		  _printf0_("WARNING: Pdd ice factor input, " << pddicefac << ", results in a negative value. It will be ignored. \n");
-	  }
-	  else{
-	    icefac=pddicefac;
-	  }
-  }
-
-  /***** determine PDD factors *****/
-  if(Tsum< -1.) {
-    snwmf=(2.65+snowfac-pddsnowfac0)*0.001;   //  ablation factor for snow per positive degree day.*0.001 to go from mm to m/ppd
-    smf=17.22*0.001;    //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002)
-  } 
-  else if(Tsum< 10){
-	  snwmf = (0.15*(Tsum+1) + (2.65+snowfac-pddsnowfac0))*0.001;
-	  smf = (((17.22-icefac)/(pow(11,3)))*pow((10.-Tsum),3) + pddicefac0)*0.001;
-	  //JC,smf = (((icefac-pddicefac0)/(Tsum+1))*pow((10.-Tsum),3) + pddicefac0)*0.001;
-  }
-  else{
-    snwmf=snowfac*0.001;
-    smf=icefac*0.001;
-  }
-  //snwmf=0.95*snwmf;
-  //smf=0.95*smf;
-
-  /*****  compute PDD ablation and refreezing *****/
-  pddt = pdd *365;
-  snwm = snwmf*pddt;       // snow that could have been melted in a year
-  hmx2 = min(h,dfrz);   // refreeze active layer max depth: dfrz
-
-  if(snwm < saccu) {
-    water=prect-saccu + snwm; //water=rain + snowmelt
-    //     l 2.2= capillary factor
-    //     Should refreezing be controlled by frzndd or by mean annual Tsurf?
-    //     dCovrLm concept is of warming of active layer (thickness =d@=1-
-    //     >2m)
-    //     problem with water seepage into ice: should be sealed after
-    //     refreezing
-    //     so everything needs to be predicated on 1 year scale, except for
-    //     thermal
-    //     conductivity through ice
-    //     also, need to account that melt season has low accum, so what's
-    //     going to
-    //     hold the meltwater around for refreezing? And melt-time will have
-    //     low seasonal frzndd
-
-    //      Superimposed ice :  Pfeffer et al. 1991, Tarasov 2002
-
-    supice= min(hmx2*CovrLm*frzndd+2.2*(saccu-snwm), water); // superimposed ice
-    supcap=min(2.2*(saccu-snwm),water);
-    runoff=snwm - supice;  //meltwater only, does not include rain
-  }
-  else {  //all snow melted
-    supice= min(hmx2*CovrLm*frzndd, prect );
-    runoff= saccu + smf*(pddt-saccu/snwmf) - supice;
-    supcap=0;
-  }
-  //     pdd melting doesn't cool Tsurf, so ndd refreeze shouldn't warm it
-  //     except pdd melt heat source is atmosphere, while refreeze is
-  //     ground/ice stored interim
-  //     assume pdd=ndd, then melt should equal refreeze and Tsurf should=0
-  //     assume ndd=2*pdd, then all supice is refrozen, but Tsurf should be
-  //     <0
-  //     assume ndd>pdd, little melt => little supice 
-  //     bottom line: compare for Tsurf<0 : supice and no supice case,
-  //     expect Tsurf difference
-  //     except some of cooling flux comes from atmosphere//
-  //     1 dm supice should not raise Tsurf by 1/dCovrLm = 16.675C
-  //     does supice make sense when H< 0.1m? then d=thermoactive ice layer ////
-  //     < 0.1 
-
-  //     make more sense to just use residual pdd-ndd except that pdd
-  //     residual not clear yet
-  //     frzndd should not be used up by refreezing in snow, so stick in
-  //     supcap.
-  diffndd=0;
-  if (frzndd>0) {
-    diffndd=fsupndd*min((supice-supcap)/dCovrLm ,frzndd);
-    frzndd=frzndd-diffndd;
-  }
-  if(runoff<0){
-    saccu= saccu -runoff;
-    smelt = 0;
-    precrunoff=prect-saccu;
-    //here assume pdd residual is 0, => 
-    Tsurf= max(Tsurf,-frzndd);
-  }
-  else {
-    smelt = runoff;
-    precrunoff=prect-max(0.,supice)-saccu;}
-  //here really need pdd balance, try 0.5 fudge factor?
-  //at least runoff>0 => it's fairly warm, so Tsurf is !<<0,
-  //yet from site plots, can be ice free with Tsurf=-5.5C
-  if(Tsurf<0) {
-    Tsurf= min(Tsurf+fsupT*diffndd , 0.);}
-
-  melt[0]=smelt/yts;
-  accu[0]=saccu/yts;
-  B = saccu - smelt;
-  B = B/yts;
-  pddtj=pddt;
-
-  return B;
-}
Index: sm/trunk/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 28275)
+++ 	(revision )
@@ -1,138 +1,0 @@
-/* file:  PddSurfaceMassBlanceSicopolis.cpp
-   Calculating the surface mass balance using the adapted PDD routine from SICOPOLIS.
- */
-
-#include "./elements.h"
-#include "../Numerics/numerics.h"
-#include "../Exceptions/exceptions.h"
-#include <cmath>
-
-IssmDouble PddSurfaceMassBalanceSicopolis(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
-				 IssmDouble* melt, IssmDouble* accu, IssmDouble* melt_star, IssmDouble* t_ampl, IssmDouble* p_ampl,
-				 IssmDouble yts, IssmDouble s, IssmDouble desfac,
-				 IssmDouble s0t, IssmDouble s0p, IssmDouble rlaps,
-				 IssmDouble rho_water,IssmDouble rho_ice){
-
-  int			imonth;				// month counter
-  IssmDouble B;					// output: surface mass balance (m/a IE), melt+accumulation
-  IssmDouble frac_solid, snowfall, rainfall, runoff; 
-  IssmDouble saccu;				// yearly surface accumulation (m/a IE)
-  IssmDouble smelt;				// yearly melt (m/a IE)
-  IssmDouble smelt_star;		// yearly ...
-  IssmDouble precip;				// total precipitation during 1 year
-  IssmDouble sconv;				//rhow_rain/rhoi / 12 months
-  IssmDouble st;					// elevation between altitude of the temp record and current altitude
-  IssmDouble sp;					// elevation between altitude of the prec record and current altitude
-  IssmDouble q;					// q is desert/elev. fact
-  IssmDouble pdd;					// pdd factor (a * degC)
-  IssmDouble tstar;				// monthly temp. after lapse rate correction (degC)
-  IssmDouble precip_star;		// monthly precip after correction (m/a IE)
-  IssmDouble beta1 = 2.73;		// 3 mm IE/(d*deg C),  ablation factor for snow per positive degree day.
-  IssmDouble beta2 = 7.28;		// 8 mm IE/(d*deg C),  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
-  IssmDouble Pmax = 0.6;
-  IssmDouble inv_twelve=1./12.; 
-
-  sconv=(rho_water/rho_ice);		//rhow_rain/rhoi
-
-  /* FIXME betas shoud be user input */
-  beta1=beta1*(0.001*365)*sconv; // (mm WE)/(d*deg C) --> (m IE)/(a*deg C)
-  beta2=beta2*(0.001*365)*sconv; // (mm WE)/(d*deg C) --> (m IE)/(a*deg C)
-
-  /* initalize fields */
-  precip=0.0;
-  tstar=0.0;
-  snowfall=0.0;
-  pdd=0.0;
-  /* seasonal loop */
-  for(imonth=0;imonth<12;imonth++){
-
-    /********* Surface temperature correction *******/    
-    st=(s-s0t)/1000.;
-
-    // FIXME rlaps ??
-	 rlaps=-6.309e-03+(-5.426e-03-(-6.309e-03))*sin((imonth+1-4)*PI/6.0)*1000.0;
-    monthlytemperatures[imonth]=monthlytemperatures[imonth]-rlaps*st;//*max(st,1e-3);
-    tstar=monthlytemperatures[imonth]+t_ampl[0];
-
-    /********* Precipitation correction *************/
-    /* Ref: Vizcaino et al 2010; DOI 10.1007/s00382-009-0591-y */
-    if(s0p<2000.0)
-      q=exp(desfac*(max(s,2000.0)-2000.0));
-	 else
-      q=exp(desfac*(max(s,2000.0)-s0p));
-
-    precip_star=q*monthlyprec[imonth]*sconv*p_ampl[0]*yts; // convert precip from m/s -> m/a
-    precip=precip+precip_star*inv_twelve;
-
-    /********* compute PDD **************************/
-    /* Ref: Calov & Greve 2005 Journal of Glaciology, Vol. 51, No. 172, 2005, Correspondence */
-	 IssmDouble s_stat=5.0;
-    IssmDouble inv_sqrt2pi =1.0/sqrt(2.0*PI);
-    IssmDouble inv_s_stat  =1.0/s_stat;
-    IssmDouble inv_sqrt2   =1.0/sqrt(2.0);
-
-	 #if !defined(_HAVE_ADOLC_)
-    pdd=pdd+(s_stat*inv_sqrt2pi*exp(-0.5*pow(tstar*inv_s_stat,2))
-				 +0.5*tstar*erfc(-tstar*inv_s_stat*inv_sqrt2))*inv_twelve;
-	 #else
-	 _error_("Cannot differentiate erfc, talk to ADOLC folks (http://functions.wolfram.com/GammaBetaErf/Erfc/20/01/)");
-	 #endif
-
-	 /*Partition of precip in solid and liquid parts, Bales et al. (2009) */
-	 IssmDouble temp_rain=7.2;		// Threshold monthly mean temperature for
-											// precipitation = 101% rain, in deg C
-	 IssmDouble temp_snow=-11.6;  // Threshold monthly mean temperature for
-											// precipitation = 100% snow, in deg C
-
-	 IssmDouble coeff1=5.4714e-01;	// Coefficients
-	 IssmDouble coeff2=-9.1603e-02;	// of
-	 IssmDouble coeff3=-3.314e-03;	// the
-	 IssmDouble coeff4= 4.66e-04;		// fifth-order
-	 IssmDouble coeff5=3.8e-05;		// polynomial
-	 IssmDouble coeff6=6.0e-07;		// fit
-
-	 if(tstar>=temp_rain)
-	  frac_solid = 0.0;
-	 else if(tstar<=temp_snow)
-	  frac_solid = 1.0;
-	 else{ 
-		 frac_solid=coeff1+tstar*(coeff2
-					 +tstar*(coeff3+tstar*(coeff4+tstar*(coeff5+tstar*coeff6))));
-	 }
-
-	 snowfall=snowfall+precip_star*frac_solid*inv_twelve;
-  } 
-  /* end of seasonal loop */ 
-
-  rainfall=precip-snowfall;
-  if(snowfall<0.0) snowfall=0.0;   // correction of
-  if(rainfall<0.0) rainfall=0.0;   // negative values
-
-  if(rainfall<=(Pmax*snowfall)){
-	  if((rainfall+beta1*pdd)<=(Pmax*snowfall)) {
-		  smelt_star = rainfall+beta1*pdd;
-		  smelt      = 0.0;
-		  runoff     = smelt;
-	  }
-	  else{
-		  smelt_star = Pmax*snowfall;
-		  smelt      = beta2*(pdd-(smelt_star-rainfall)/beta1);
-		  runoff     = smelt;
-	  }
-  } 
-  else{
-	  smelt_star = Pmax*snowfall;
-	  smelt      = beta2*pdd;
-	  runoff     = smelt+rainfall-Pmax*snowfall;
-  }
-
-  saccu = precip;	
-
-  /* asign output*/
-  melt[0]=runoff/yts;
-  accu[0]=saccu/yts;
-  melt_star[0]=smelt_star/yts;
-  B=(saccu-runoff)/yts;
-
-  return B;
-}
Index: sm/trunk/src/c/shared/Elements/PrintArrays.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/PrintArrays.cpp	(revision 28275)
+++ 	(revision )
@@ -1,107 +1,0 @@
-#include "./elements.h"
-#include "../io/Print/Print.h"
-#include <iomanip>
-using namespace std;
-
-void printarray(IssmPDouble* array,int lines,int cols){
-	_printf_("\n");
-	for(int i=0;i<lines;i++){  
-		_printf_("   [ ");
-		for(int j=0;j<cols;j++) _printf_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
-		_printf_(" ]\n");
-	}  
-	_printf_("\n");
-}
-#ifdef _HAVE_AD_
-void printarray(IssmDouble* array,int lines,int cols){
-	_printf_("\n");
-	for(int i=0;i<lines;i++){  
-		_printf_("   [ ");
-		for(int j=0;j<cols;j++) _printf_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
-		_printf_(" ]\n");
-	}  
-	_printf_("\n");
-}
-#endif
-void printsparsity(IssmPDouble* array,int lines,int cols){
-	int count;
-	_printf_("\n");
-	for(int i=0;i<lines;i++){  
-		_printf_("   [ ");
-		count = 0;
-		for(int j=0;j<cols;j++){
-			if(array[i*cols+j]!=0.0){
-				_printf_( " X"); count++;
-			}
-			else
-			 _printf_( " .");
-		}
-		_printf_(" ] "<<i<<" => "<<count << "\n");
-	}  
-	_printf_("\n");
-}
-void printarray(int* array,int lines,int cols){
-	_printf_("\n");
-	for(int i=0;i<lines;i++){  
-		_printf_("   [ ");
-		for(int j=0;j<cols;j++) _printf_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
-		_printf_(" ]\n");
-	}  
-	_printf_("\n");
-}
-void printarray_matlab(const char* filename,int* array,int lines,int cols){
-	FILE *f = fopen(filename,"w");
-	fprintf(f,"%% Matrix of size %ix%i\n",lines,cols);
-	fprintf(f,"\n");
-	fprintf(f,"A=[...\n");
-	for(int i=0;i<lines;i++){  
-		for(int j=0;j<cols;j++) fprintf(f," %i",array[i*cols+j]);
-		fprintf(f,"\n");
-	}  
-	fprintf(f,"];\n");
-	fclose(f);
-}
-void printarray(bool* array,int lines,int cols){
-	_printf_("\n");
-	for(int i=0;i<lines;i++){  
-		_printf_("   [ ");
-		for(int j=0;j<cols;j++){
-			if(array[i*cols+j]) _printf_( " 1");
-			else _printf_( " 0");
-		}
-		_printf_(" ]\n");
-	}  
-	_printf_("\n");
-}
-void printbinary(int n){
-	unsigned int i=1L<<(sizeof(n)*8-1);
-	while (i>0) {
-		if (n&i)
-		 _printf_("1");
-		else
-		 _printf_("0");
-		i>>=1;
-	}
-}
-
-void InversionStatsHeader(int NJ){
-	//https://cboard.cprogramming.com/c-programming/151930-ascii-table-border.html
-	int width = max(10*NJ,24);
-	_printf0_("\n");
-	_printf0_("┌────┬─────────────────┬────────────┬"); for(int i=0;i<width;i++){_printf0_("─");} _printf0_("┐\n");
-	_printf0_("│Iter│  Cost function  │ Grad. norm │  List of contributions "); for(int i=0;i<width-24;i++){_printf0_(" ");} _printf0_("│\n");
-	_printf0_("├────┼─────────────────┼────────────┼"); for(int i=0;i<width;i++){_printf0_("─");} _printf0_("┤\n");
-}
-void InversionStatsIter(int iter,double J, double Gnorm, double* Jlist, int N){
-	int width = max(10*N,24);
-	_printf0_("│"<<setw(3)<<iter<<" ");
-	_printf0_("│ f(x)="<<setw(10)<<setprecision(5)<<J<<" ");
-	_printf0_("│   "<<setw(8)<<setprecision(3)<<Gnorm<<" │");
-	for(int i=0;i<N;i++) _printf0_(" "<<setw(9)<<setprecision(4)<<Jlist[i]);
-	for(int i=0;i<width-10*N;i++){_printf0_(" ");}
-	_printf0_("│\n");
-}
-void InversionStatsFooter(int NJ){
-	int width = max(10*NJ,24);
-	_printf0_("└────┴─────────────────┴────────────┴");for(int i=0;i<width;i++){_printf0_("─");} _printf0_("┘\n");
-}
Index: /issm/trunk/src/c/shared/Elements/ResolvePointers.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/ResolvePointers.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Elements/ResolvePointers.cpp	(revision 1)
@@ -0,0 +1,59 @@
+/*!\file: ResolvePointers.cpp
+ * \brief go look for objects in a certain dataset, tracking them by their id. 
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../../objects/objects.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/typedefs.h"
+#include "../Exceptions/exceptions.h"
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "ResolvePointers"
+
+void ResolvePointers(Object** objects,int* object_ids,int* object_offsets,int num_objects,DataSet* dataset){
+
+	/*output: */
+
+	/*intermediary: */
+	Object* object=NULL;
+	int i;
+	
+
+	for(i=0;i<num_objects;i++){
+
+
+		/*Check whether existing objects are correct: */
+		if(objects[i]){
+			if(objects[i]->GetId()==object_ids[i]) continue; //this node is good.
+			else objects[i]=NULL; //this node was incorrect, reset it.
+		}
+
+		/*May be the object offsets into objects are valid?: */
+		if(object_offsets[i]!=UNDEF){
+			/* Look at the object_offsets[i]'th node in the nodes dataset. If it has the correct id, 
+			 * we are good: */
+			object=(Object*)dataset->GetObjectByOffset(object_offsets[i]);
+			if (object->GetId()==object_ids[i]){
+				objects[i]=object;
+				continue;
+			}
+			else object_offsets[i]=UNDEF; //object offset was wrong, reset it.
+		}
+
+		/*Now, for objects that did not get resolved, and for which we have no offset, chase them in the dataset, by id: */
+		if(objects[i]==NULL){
+			objects[i]=(Object*)dataset->GetObjectById(object_offsets+i,object_ids[i]); //remember the offset for later on.
+			/*check the id is correct!: */
+			if (objects[i]->GetId()!=object_ids[i])throw ErrorException(__FUNCT__,exprintf("%s%i%s%i%s"," wrong id: ",objects[i]->GetId()," vs ",object_ids[i],"  in resolved pointer!"));
+		}
+	}
+	
+}
+
Index: sm/trunk/src/c/shared/Elements/StressIntensityIntegralWeight.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/StressIntensityIntegralWeight.cpp	(revision 28275)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/* \file StressIntensityIntegralWeight.cpp
- * \Weight to integrate the stress along the ice flow direction to compute the stress intensity factor : Linear Fracture Mechanics (see "Combining damage and fracture mechanics to model calving",Krug 2014 in the appendix) 
- */
-
-#include <math.h>
-
-#include "../Numerics/types.h"
-
-IssmDouble StressIntensityIntegralWeight(IssmDouble depth, IssmDouble water_depth, IssmDouble thickness){
-
-	/*output: */
-	IssmDouble beta;
-
-	/*intermediaries: */
-	IssmDouble M1,M2,M3,x,y,d;
-	const double pi = 3.141592653589793;
-	x    = water_depth/thickness;
-	y    = depth;
-	d    = water_depth;
-
-	M1   = 0.0719768-1.513476*x-61.1001*pow(x,2)+1554.95*pow(x,3)-14583.8*pow(x,4)+71590.7*pow(x,5)-205384*pow(x,6)+356469*pow(x,7)-368270*pow(x,8)+208233*pow(x,9)-49544*pow(x,10);
-	//printf("M1 : %g",M1);
-	M2   = 0.246984+6.47583*x+176.456*pow(x,2)-4058.76*pow(x,3)+37303.8*pow(x,4)-181755*pow(x,5)+520551*pow(x,6)-904370*pow(x,7)+936863*pow(x,8)-531940*pow(x,9)+127291*pow(x,10);
-	//printf("M2 : %g",M2);
-	M3   = 0.529659-22.3235*x+532.074*pow(x,2)-5479.53*pow(x,3)+28592.2*pow(x,4)-81388.6*pow(x,5)+128746*pow(x,6)-106246*pow(x,7)+35780.7*pow(x,8);
-	//printf("M3 : %g",M3);
-
-	beta = 2/sqrt(2*pi*(d-y))*(1+M1*sqrt(1-y/d)+M2*(1-y/d)+M3*pow((1-y/d),1.5));
-
-	return beta;
-}
Index: /issm/trunk/src/c/shared/Elements/elements.h
===================================================================
--- /issm/trunk/src/c/shared/Elements/elements.h	(revision 28275)
+++ /issm/trunk/src/c/shared/Elements/elements.h	(revision 1)
@@ -4,61 +4,13 @@
 
 #ifndef _SHARED_ELEMENTS_H_
-#define _SHARED_ELEMENTS_H_
+#define  _SHARED_ELEMENTS_H_
 
-#include "../Numerics/types.h"
+#include "../../objects/objects.h"
+#include "../../DataSet/DataSet.h"
 
-IssmDouble Cuffey(IssmDouble temperature);
-IssmDouble BuddJacka(IssmDouble temperature);
-IssmDouble CuffeyTemperate(IssmDouble temperature, IssmDouble waterfraction, IssmDouble stressexp);
-IssmDouble Paterson(IssmDouble temperature);
-IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n);
-IssmDouble NyeH2O(IssmDouble temperature);
-IssmDouble NyeCO2(IssmDouble temperature);
-IssmDouble LliboutryDuval(IssmDouble enthalpy, IssmDouble pressure, IssmDouble n, IssmDouble betaCC, IssmDouble referencetemperature, IssmDouble heatcapacity, IssmDouble latentheat);
-// IssmDouble LliboutryDuval(IssmDouble temperature, IssmDouble waterfraction, IssmDouble depth,IssmDouble n);
-IssmDouble EstarLambdaS(IssmDouble epseff, IssmDouble epsprime_norm);
-void EstarOmega(IssmDouble* omega,IssmDouble vx,IssmDouble vy,IssmDouble vz,IssmDouble vmag,IssmDouble* dvx,IssmDouble* dvy,IssmDouble* dvz, IssmDouble* dvmag);
-void EstarStrainrateQuantities(IssmDouble *pepsprime_norm, IssmDouble vx,IssmDouble vy,IssmDouble vz,IssmDouble vmag,IssmDouble* dvx,IssmDouble* dvy,IssmDouble* dvz,IssmDouble* dvmag);
-IssmDouble PddSurfaceMassBalance(IssmDouble* monthlytemperatures,  IssmDouble* monthlyprec,
-				 IssmDouble* pdds, IssmDouble* pds, IssmDouble* melt, IssmDouble* accu, IssmDouble signorm, 
-				 IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble desfac,IssmDouble s0t,
-				 IssmDouble s0p, IssmDouble rlaps, IssmDouble rlapslgm,
-				 IssmDouble TdiffTime,IssmDouble sealevTime,IssmDouble pddsnowfac,IssmDouble pddicefac,
-				 IssmDouble rho_water, IssmDouble rho_ice);
-IssmDouble PddSurfaceMassBalanceSicopolis(IssmDouble* monthlytemperatures,  IssmDouble* monthlyprec,
-				 IssmDouble* melt, IssmDouble* accu, IssmDouble* melt_star, IssmDouble* t_ampl, IssmDouble* p_ampl,
-				 IssmDouble yts, IssmDouble s, IssmDouble desfac,IssmDouble s0t,
-				 IssmDouble s0p, IssmDouble rlaps, IssmDouble rho_water, IssmDouble rho_ice);
-void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
-					     IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime,
-					     IssmDouble* PrecipitationsPresentday,
-					     IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 
-					     IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout);
-void ComputeMungsmTemperaturePrecipitation(IssmDouble TdiffTime, IssmDouble PfacTime,
-					   IssmDouble* PrecipitationsLgm,IssmDouble* PrecipitationsPresentday,
-					   IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 
-					   IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout);
-void ComputeD18OTemperaturePrecipitationFromPD(IssmDouble d018,IssmDouble dpermil,bool isTemperatureScaled,
-			bool isPrecipScaled, IssmDouble f, IssmDouble* PrecipitationPresentday,IssmDouble* TemperaturePresentday,
-			IssmDouble* PrecipitationReconstructed,IssmDouble* TemperatureReconstructed, IssmDouble* monthlytemperaturesout,
-			IssmDouble* monthlyprecout);
-IssmDouble DrainageFunctionWaterfraction(IssmDouble waterfraction, IssmDouble dt=0.);
-IssmDouble StressIntensityIntegralWeight(IssmDouble depth, IssmDouble water_depth, IssmDouble thickness);
+void ResolvePointers(Object** objects,int* object_ids,int* object_offsets,int num_objects,DataSet* dataset);
+double Paterson(double temperature);
+int GetElementNodeData( double* xyz,  Node** nodes, int numgrids);
 
-/*Enthalphy*/
-void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
+#endif //ifndef _SHARED_ELEMENTS_H_
 
-/*Print arrays*/
-void printarray(IssmPDouble* array,int lines,int cols=1);
-#if _HAVE_AD_  && !defined(_WRAPPERS_)
-void printarray(IssmDouble* array,int lines,int cols=1);
-#endif
-void printarray_matlab(const char* filename,int* array,int lines,int cols=1);
-void printarray(int* array,int lines,int cols=1);
-void printarray(bool* array,int lines,int cols=1);
-void printsparsity(IssmPDouble* array,int lines,int cols=1);
-void printbinary(int n);
-void InversionStatsHeader(int NJ);
-void InversionStatsIter(int iter,double J, double Gnorm, double* Jlist, int N);
-void InversionStatsFooter(int NJ);
-#endif //ifndef _SHARED_ELEMENTS_H_
Index: /issm/trunk/src/c/shared/Exceptions/Exceptions.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exceptions/Exceptions.cpp	(revision 28275)
+++ /issm/trunk/src/c/shared/Exceptions/Exceptions.cpp	(revision 1)
@@ -3,93 +3,26 @@
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
 
-#include <cstring>
-#include <cstdio>
-#include <string>
-#include <iostream>
-#include <iomanip>
-#include "./exceptions.h"
+#include "../shared.h"
+#include "../../include/macros.h"
 
-ErrorException::ErrorException(const string & what_arg){/*{{{*/
+ErrorException::ErrorException(const string &what_function,const string &what_arg){
 
-	int len;
-	len           = strlen(what_arg.c_str())+1;
-	what_str      = new char[len];
-	memcpy(what_str,what_arg.c_str(),len);
+	what_str=what_arg;
+	function_name=what_function;
+}
 
-	file_name     = NULL;
-	function_name = NULL;
-	file_line     = 0;
+ErrorException::~ErrorException() throw(){
+}
 
-}/*}}}*/
-ErrorException::ErrorException(int what_rank,const string& what_file, const string& what_function,int what_line, const string& what_arg){/*{{{*/
+const char* ErrorException::what() const throw(){
+	return what_str.c_str();
+}
 
-	/*Intermediaries*/
-	int len;
+void ErrorException::Report(){
 
-	this->rank     = what_rank;
-	this->file_line= what_line;
+	_printf_("%s%s%s",function_name.c_str()," error message: ",what());
+	return;
+}
 
-	len = strlen(what_arg.c_str())+1;
-	this->what_str = new char[len];
-	memcpy(this->what_str,what_arg.c_str(),len);
 
-	len = strlen(what_file.c_str())+1;
-	this->file_name = new char[len];
-	memcpy(this->file_name,what_file.c_str(),len);
-
-	len = strlen(what_function.c_str())+1;
-	this->function_name = new char[len];
-	memcpy(this->function_name,what_function.c_str(),len);
-
-	/*Uncomment if messages do not print properly*/
-	//this->Report();
-}/*}}}*/
-ErrorException::~ErrorException() throw(){/*{{{*/
-	delete [] what_str;
-	delete [] file_name;
-	delete [] function_name;
-}/*}}}*/
-const char* ErrorException::what() const throw(){/*{{{*/
-	return what_str;
-}/*}}}*/
-void ErrorException::Report() const{/*{{{*/
-
-	/*WINDOWS*/
-	if(!this->function_name || this->file_line==0){
-		cerr << "Error message: " << what() << endl;
-		return;
-	}
-
-	cerr <<"\n[" << this->rank<< "] ??? Error using ==> " << this->file_name << ":" << this->file_line << 
-	       "\n[" << this->rank<< "] " << this->function_name << " error message: " << what() << "\n" << endl;
-
-	return;
-}/*}}}*/
-const char* ErrorException::WrapperReport() const{/*{{{*/
-
-	/*Output*/
-	std::ostringstream buffer;
-	char *message = NULL;
-
-	/*WINDOWS*/
-	if(!this->function_name || this->file_line==0){ 
-		buffer << " error message: " << this->what_str;
-	}
-	else{
-		buffer << "\nError in ==> " << this->file_name << ":" << file_line << "\n";
-		buffer << this->function_name << " error message: " << this->what_str;
-	}
-
-	/*Convert std::ostringstream to std::string and then create char* */
-	std::string buffer2 = buffer.str();
-	message = new char[strlen(buffer2.c_str())+1];
-	sprintf(message,"%s",buffer2.c_str());
-
-	return message;
-}/*}}}*/
Index: /issm/trunk/src/c/shared/Exceptions/exceptions.h
===================================================================
--- /issm/trunk/src/c/shared/Exceptions/exceptions.h	(revision 28275)
+++ /issm/trunk/src/c/shared/Exceptions/exceptions.h	(revision 1)
@@ -7,95 +7,30 @@
  */
 
-#ifndef _MY_EXCEPTIONS_H_
-#define _MY_EXCEPTIONS_H_
+#ifndef MY_EXCEPTIONS_H_
+#define MY_EXCEPTIONS_H_
 
 #include <exception>
 #include <string>
-#include <iostream>
-#include <sstream>
-#include <iomanip>
-
 using namespace std;
 
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-/*Only include forward declaration to save compile time*/
-#include <iosfwd>
-#include <sstream>
-
-/*macros: (should move somewhere else)*/
-#include "../io/Comm/IssmComm.h"
-/* _assert_ {{{*/
-/*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
-#ifdef _ISSM_DEBUG_ 
-#define _assert_(statement)\
-  if (!(statement)) _error_("Assertion \""<<#statement<<"\" failed, please report bug at "<<PACKAGE_BUGREPORT)
-#else
-#define _assert_(ignore)\
-  ((void) 0)
-#endif
-/*}}}*/
-/* _error_ {{{*/
-/*new Error exception macro*/
-#ifdef _INTEL_WIN_
-#define _error_(StreamArgs)\
-   do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
-   aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
-   throw ErrorException(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
-#else
-#define _error_(StreamArgs)\
-	do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
-   aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
-   throw ErrorException(IssmComm::GetRank(),__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
-#endif
-/*}}}*/
-/* ExceptionTrapBegin/ExceptionTrapEnd {{{*/
-
-/*The following macros hide the error exception handling in a matlab module. Just put 
- * ExceptionTrapBegin(); and ExceptionTrapEnd(); at the beginning and end of a module, and c++ exceptions 
- * will be trapped. Really nifty!*/
-
-#define ExceptionTrapBegin(); \
-	try{
-
-#define ExceptionTrapEnd(); }\
-	catch(ErrorException &exception){\
-		exception.Report();\
-		return 1;\
-	}\
-	catch(exception& e) {\
-		_printf_("Standard exception: " << e.what() << "\n\n");\
-		return 1;\
-	}\
-	catch(...){\
-		_printf_("An unexpected error occurred \n\n");\
-		return 1;\
-	}
-/*}}}*/
-
-/*ISSM exception class: */
-class ErrorException: public exception{ /*{{{*/
-
-	char* what_str;
-	char* function_name;
-	char* file_name;
-	int   file_line;
-	int   rank;
+/*We derive our classes from the c++ exception class: */
+class ErrorException: public exception {
+	
+	string what_str;
+	string function_name;
 
 	public:
-	/*Windows*/
-	ErrorException(const string &what_arg);
-	/*Linux/macOS*/
-	ErrorException(int what_rank,const string &what_file,const string& what_function,int what_line,const string& what_arg);
+
+	ErrorException(const string &what_function,const string &what_arg);
 	~ErrorException() throw();
+
 	virtual const char *what() const throw();
-	void Report() const;
-	const char* WrapperReport() const;
+
+	void Report();
+
 
 };
-/*}}}*/
+	
+
+char* exprintf(char* format,...);
 #endif
Index: /issm/trunk/src/c/shared/Exceptions/exprintf.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exceptions/exprintf.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Exceptions/exprintf.cpp	(revision 1)
@@ -0,0 +1,30 @@
+/*!\file:  exprintf
+ * \brief this is a modification of the sprintf function. 
+ * Instead of returning an int, it will return the char* itself.
+ * The advantage is to be able to do things like: 
+ * throw ErrorException(__FUNCT__,exprintf("%s%i\n","test failed for id:",id));
+ */ 
+
+
+#include "stdarg.h"
+#include "stdio.h"
+#include "../Alloc/alloc.h"
+
+char* exprintf(char* format,...){
+
+	/*returned string: */
+	char* string=NULL;
+
+	/*Assum nobody will print more that 1024 characters!*/
+	string=(char*)xmalloc(1024*sizeof(char));//assume that nobody will print more than 1024 characters at once.
+                                                                                                                                                                                                     
+	//variable list of arguments
+	va_list ap;
+
+	//First use vsprintf to get the whole input string.
+	va_start(ap,format);
+	vsprintf(string,format,ap); //printf style coding 
+	va_end(ap); 
+
+	return string;
+}
Index: /issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 1)
@@ -0,0 +1,144 @@
+/*!\file:  DomainOutlineRead.cpp
+ * \brief DomainOutlineRead.c: read the grid coordinates defined in a domain 
+ * outline from Argus (.exp file). The first contour in the file is for 
+ * the outside domain outline. The following contours represent holes in
+ * the domain.
+ */
+
+
+#include "stdio.h"
+#include "../Alloc/alloc.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "DomainOutlineRead"
+int DomainOutlineRead(int* pnprof,int** pprofngrids,double*** ppprofx,double*** ppprofy,char* domainname){
+
+	
+	/*Error management: */
+	int noerr=1;
+	int i,j,counter;
+
+	/*I/O: */
+	FILE* fid=NULL;
+	char chardummy[256];
+	int  idummy;
+	double  ddummy;
+
+	/*output: */
+	int nprof; //number of profiles in the domainname file
+	int* profngrids=NULL; //array holding the number of grids for the nprof profiles
+	double** pprofx=NULL; //array of profiles x coordinates
+	double** pprofy=NULL; //array of profiles y coordinates
+
+	/*For each profile: */
+	int n;
+	double* x=NULL;
+	double* y=NULL;
+
+	/*open domain outline file for reading: */
+	if ((fid=fopen(domainname,"r"))==NULL){
+		printf("%s%s%s\n",__FUNCT__," error message: could not find domain file ",domainname);
+		noerr=0; goto cleanupandreturn;
+	}
+
+	/*Do a first pass through the domainname file, to figure out how many profiles 
+	 *we need to read: */
+	nprof=1;
+	for(;;){
+		fscanf(fid,"%s %s\n",chardummy,chardummy);
+		fscanf(fid,"%s %s\n",chardummy,chardummy);
+		fscanf(fid,"%s %s %s %s\n",chardummy,chardummy,chardummy,chardummy);
+		fscanf(fid,"%u %s\n",&n,chardummy);
+		fscanf(fid,"%s %s %s %s %s\n",chardummy,chardummy,chardummy,chardummy,chardummy);
+		for (i=0;i<n;i++){
+			fscanf(fid,"%lf %lf\n",&ddummy,&ddummy);
+		}
+		/*Ok, we have faked one profile reading, check whether we are at the end of the file, otherwise, keep fake reading next profile:*/
+		if (feof(fid)){
+			break;
+		}
+		nprof++;
+	}
+	#ifdef _DEBUG_
+		printf("Number of profiles in domain outline file: %i\n",nprof);
+	#endif
+	
+	/*Allocate and initialize all the profiles: */
+	profngrids=(int*)xmalloc(nprof*sizeof(int));
+	pprofx=(double**)xmalloc(nprof*sizeof(double*));
+	pprofy=(double**)xmalloc(nprof*sizeof(double*));
+	for (i=0;i<nprof;i++){
+		pprofx[i]=NULL;
+		pprofy[i]=NULL;
+	}
+
+	/*Reaset file pointer to beginning of file: */
+	fseek(fid,0,SEEK_SET);
+
+	/*Start reading profiles: */
+	for(counter=0;counter<nprof;counter++){
+
+		/*Skip header: */
+		fscanf(fid,"%s %s\n",chardummy,chardummy);
+		fscanf(fid,"%s %s\n",chardummy,chardummy);
+		fscanf(fid,"%s %s %s %s\n",chardummy,chardummy,chardummy,chardummy);
+		
+		/*Get number of profile grids: */
+		fscanf(fid,"%u %s\n",&n,chardummy);
+	
+		/*Skip next line: */
+		fscanf(fid,"%s %s %s %s %s\n",chardummy,chardummy,chardummy,chardummy,chardummy);
+
+		/*Allocate grids: */
+		x=(double*)xmalloc(n*sizeof(double));
+		y=(double*)xmalloc(n*sizeof(double));
+		
+
+		/*Read grids: */
+		for (i=0;i<n;i++){
+			fscanf(fid,"%lf %lf\n",x+i,y+i);
+		}
+
+		/*Now check that we are dealing with open contours: */
+		if((x[0]==x[n-1]) && (y[0]==y[n-1])){
+			n=n-1;
+		}
+
+		/*Assign pointers: */
+		profngrids[counter]=n;
+		pprofx[counter]=x;
+		pprofy[counter]=y;
+	}
+
+	/*close domain outline file: */
+	fclose(fid);
+
+	
+	#ifdef _DEBUG_
+	for (i=0;i<nprof;i++){
+		printf("Profile #%i\n",i);
+		x=pprofx[i];
+		y=pprofy[i];
+		for (j=0;j<profngrids[i];j++){
+			printf("   %lf %lf\n",x[j],y[j]);
+		}
+	}
+	#endif
+
+
+	cleanupandreturn: 
+	/*Free ressources: */
+	if(!noerr){
+		xfree((void**)&x);
+		xfree((void**)&y);
+		n=-1;
+	}
+	
+	/*Assign output pointers: */
+	*pnprof=nprof;
+	*pprofngrids=profngrids;
+	*ppprofx=pprofx;
+	*ppprofy=pprofy;
+	return noerr;
+}
+
Index: /issm/trunk/src/c/shared/Exp/IsInPoly.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exp/IsInPoly.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Exp/IsInPoly.cpp	(revision 1)
@@ -0,0 +1,81 @@
+/*!\file IsInPoly.c
+ * \brief:  from a contour, determine which nodes are in  domain.
+ */
+
+#include <math.h>
+#include "../../toolkits/toolkits.h"
+#include "./exp.h"
+
+
+int IsInPoly(Vec in,double* xc,double* yc,int numgrids,double* x,double* y,int nods, int edgevalue){
+
+	int i,j;
+	double x0,y0;
+	double value;
+
+	/*Go through all grids of the mesh:*/
+	for (i=MPI_Lowerrow(nods);i<MPI_Upperrow(nods);i++){
+		/*pick up grid: */
+		x0=x[i];
+		y0=y[i];
+		if (pnpoly(numgrids,xc,yc,x0,y0,edgevalue)){
+			value=1;
+		}
+		else{
+			value=0;
+		}
+		VecSetValues(in,1,&i,&value,INSERT_VALUES);
+	}
+}
+
+int IsOutsidePoly(Vec out,double* xc,double* yc,int numgrids,double* x,double* y,int nods,int edgevalue){
+
+	int i,j;
+	double x0,y0;
+	double value;
+
+	/*Go through all grids of the mesh:*/
+	for (i=MPI_Lowerrow(nods);i<MPI_Upperrow(nods);i++){
+		/*pick up grid: */
+		x0=x[i];
+		y0=y[i];
+		if (pnpoly(numgrids,xc,yc,x0,y0,edgevalue)){
+			value=0;
+		}
+		else{
+			value=1;
+		}
+		VecSetValues(out,1,&i,&value,INSERT_VALUES);
+	}
+}
+
+int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue) {
+	int i, j, c = 0;
+	double n1, n2, normp, scalar;
+	
+	/*first test, are they colinear? if yes, is the point in the middle of the segment*/
+	if (edgevalue != 2 ){
+		for (i = 0, j = npol-1; i < npol; j = i++) {
+			n1=pow(yp[i]-yp[j],2.0)+pow(xp[i]-xp[j],2.0);
+			n2=pow(y-yp[j],2.0)+pow(x-xp[j],2.0);
+			normp=pow(n1*n2,0.5);
+			scalar=(yp[i]-yp[j])*(y-yp[j])+(xp[i]-xp[j])*(x-xp[j]);
+
+			if (scalar == normp){
+				if (n2<=n1){
+					c = edgevalue;
+					return c;
+				}
+			}
+		}
+	}
+	/*second test : point is neither on a vertex, nor on a side, where is it ?*/
+	for (i = 0, j = npol-1; i < npol; j = i++) {
+		if ((((yp[i]<=y) && (y<yp[j])) ||
+					((yp[j]<=y) && (y<yp[i]))) &&
+				(x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i])){
+			c = !c;
+		}
+	}
+	return c;
+}
Index: /issm/trunk/src/c/shared/Exp/IsInPolySerial.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exp/IsInPolySerial.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Exp/IsInPolySerial.cpp	(revision 1)
@@ -0,0 +1,30 @@
+/*
+ * IsInPolySerial.c:
+ */
+
+#include <math.h>
+#include "./exp.h"
+
+
+int IsInPolySerial(double* in,double* xc,double* yc,int numgrids,double* x,double* y,int nods, int edgevalue){
+
+	int i,j;
+	double x0,y0;
+
+	/*Go through all grids of the mesh:*/
+	for (i=0;i<nods;i++){
+		if (in[i]){
+			/*this grid already is inside one of the contours, continue*/
+			continue;
+		}
+		/*pick up grid: */
+		x0=x[i];
+		y0=y[i];
+		if (pnpoly(numgrids,xc,yc,x0,y0,edgevalue)){
+			in[i]=1;
+		}
+		else{
+			in[i]=0;
+		}
+	}
+}
Index: sm/trunk/src/c/shared/Exp/exp.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exp/exp.cpp	(revision 28275)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/*!\file:  Exp.cpp
- * \brief Exp.cpp: write the vertex coordinates defined in a domain 
- * outline from Argus (.exp file). The first contour in the file is for 
- * the outside domain outline. 
- */
-#include <stdio.h>
-#include <math.h>
-
-#include "../MemOps/MemOps.h"
-#include "../Exceptions/exceptions.h"
-#include "./exp.h"
-
-int ExpWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,char* domainname){/*{{{*/
-
-	/*I/O: */
-	FILE* fid=NULL;
-
-	/*open domain outline file for writing: */
-	if((fid=fopen(domainname,"w"))==NULL) _error_("could not open domain file " << domainname); 
-
-	/*Start writing profiles: */
-	for(int counter=0;counter<nprof;counter++){
-
-		/*Write header: */
-		fprintf(fid,"## Name:%s\n",domainname);
-		fprintf(fid,"## Icon:0\n");
-		fprintf(fid,"# Points Count	Value\n");
-		fprintf(fid,"%u %s\n",profnvertices[counter]  ,"1.");
-		fprintf(fid,"# X pos	Y pos\n");
-
-		/*Write vertices: */
-		for(int i=0;i<profnvertices[counter];i++){
-			fprintf(fid,"%lf\t%lf\n",pprofx[counter][i],pprofy[counter][i]);
-		}
-
-		/*Write blank line: */
-		if(counter<nprof-1) fprintf(fid,"\n");
-	}
-
-	/*close Exp file: */
-	fclose(fid);
-
-	return 1;
-}/*}}}*/
-int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue){ /*{{{*/
-
-	double x0,y0;
-
-	/*Go through all vertices of the mesh:*/
-	for(int i=0;i<nods;i++){
-		if (in[i]){
-			/*this vertex already is inside one of the contours, continue*/
-			continue;
-		}
-		/*pick up vertex: */
-		x0=x[i];
-		y0=y[i];
-		if (pnpoly(numvertices,xc,yc,x0,y0,edgevalue)){
-			in[i]=1.;
-		}
-		else{
-			in[i]=0.;
-		}
-	}
-
-	return 1;
-}
-/*}}}*/
-/*pnpoly{{{*/
-int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue) {
-	int i, j, c = 0;
-	double n1, n2, normp, scalar;
-
-	/*first test, are they colinear? if yes, is the point in the middle of the segment*/
-	if (edgevalue != 2 ){
-		for (i = 0, j = npol-1; i < npol; j = i++) {
-			n1=pow(yp[i]-yp[j],2.0)+pow(xp[i]-xp[j],2.0);
-			n2=pow(y-yp[j],2.0)+pow(x-xp[j],2.0);
-			normp=pow(n1*n2,0.5);
-			scalar=(yp[i]-yp[j])*(y-yp[j])+(xp[i]-xp[j])*(x-xp[j]);
-
-			if (scalar == normp){
-				if (n2<=n1){
-					c = edgevalue;
-					return c;
-				}
-			}
-		}
-	}
-	/*second test : point is neither on a vertex, nor on a side, where is it ?*/
-	for (i = 0, j = npol-1; i < npol; j = i++) {
-		if ((((yp[i]<=y) && (y<yp[j])) ||
-					((yp[j]<=y) && (y<yp[i]))) &&
-				(x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i])){
-			c = !c;
-		}
-	}
-	return c;
-}/*}}}*/
Index: /issm/trunk/src/c/shared/Exp/exp.h
===================================================================
--- /issm/trunk/src/c/shared/Exp/exp.h	(revision 28275)
+++ /issm/trunk/src/c/shared/Exp/exp.h	(revision 1)
@@ -3,174 +3,15 @@
  */
 
+
 #ifndef _EXP_H_
 #define _EXP_H_
 
-#include <cstring>
-#include "../Numerics/recast.h"
-#include "../Exceptions/exceptions.h"
-#include "../MemOps/MemOps.h"
+#include "../../toolkits/toolkits.h"
 
-int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
-int ExpWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,char* domainname);
+int IsInPoly(Vec in,double* xc,double* yc,int numgrids,double* x,double* y,int nods, int edgevalue);
+int IsInPolySerial(double* in,double* xc,double* yc,int numgrids,double* x,double* y,int nods, int edgevalue);
+int IsOutsidePoly(Vec out,double* xc,double* yc,int numgrids,double* x,double* y,int nods,int edgevalue);
+int DomainOutlineRead(int* pnprof,int** pprofngrids,double*** ppprofx,double*** ppprofy,char* domainname);
 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
 
-template <class doubletype> int IsInPoly(doubletype* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ /*{{{*/
-
-	int i;
-	double x0,y0;
-	doubletype value;
-	double xmin=xc[0];
-	double xmax=xc[0];
-	double ymin=yc[0];
-	double ymax=yc[0];
-
-	/*Get extrema*/
-	for (i=1;i<numvertices;i++){
-		if(xc[i]<xmin) xmin=xc[i];
-		if(xc[i]>xmax) xmax=xc[i];
-		if(yc[i]<ymin) ymin=yc[i];
-		if(yc[i]>ymax) ymax=yc[i];
-	}
-
-	/*Go through all vertices of the mesh:*/
-	for (i=i0;i<i1;i++){
-
-		//Get current value of value[i] -> do not change it if != 0
-		value=in[i];
-		if (reCast<bool,doubletype>(value)){
-			/*this vertex already is inside one of the contours, continue*/
-			continue;
-		}
-
-		/*pick up vertex (x[i],y[i]) and figure out if located inside contour (xc,yc)*/
-		x0=x[i]; y0=y[i];
-		if(x0<xmin || x0>xmax || y0<ymin || y0>ymax){
-			value=0;
-		}
-		else{
-			value=pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
-		}
-		in[i]=value;
-	}
-	 return 1;
-}/*}}}*/
-template <class doubletype> int ExpRead(int* pnprof,int** pprofnvertices,doubletype*** ppprofx,doubletype*** ppprofy,bool** pclosed,char* domainname){ /*{{{*/
-
-	/*indexing: */
-	int i,counter;
-
-	/*I/O: */
-	FILE   *fid = NULL;
-	char    chardummy[256];
-	double  ddummy;
-
-	/*output: */
-	int          nprof;                //number of profiles in the domainname file
-	int         *profnvertices = NULL; //array holding the number of vertices for the nprof profiles
-	doubletype **pprofx        = NULL; //array of profiles x coordinates
-	doubletype **pprofy        = NULL; //array of profiles y coordinates
-	bool        *closed        = NULL; //array holding closed flags for the nprof profiles
-
-	/*For each profile: */
-	int         n;
-	doubletype *x  = NULL;
-	doubletype *y  = NULL;
-	bool        cl;
-
-	/*open domain outline file for reading: */
-	if ((fid=fopen(domainname,"r"))==NULL){
-		_error_("could not find file \"" << domainname<<"\". Make sure that the file and path provided exist.");
-	}
-
-	/*Do a first pass through the domainname file, to figure out how many profiles we need to read: */
-	nprof=1;
-	for(;;){
-		//## Name:filename
-		if(fscanf(fid,"%255s %255s\n",chardummy,chardummy)!=2) _error_("Could not read " << domainname);
-		//## Icon:0
-		if(fscanf(fid,"%255s %255s\n",chardummy,chardummy)!=2) _error_("Could not read " << domainname<<"(Expecting ## Icon:0 and read "<<chardummy<<")");
-		//# Points Count Value
-		if(fscanf(fid,"%255s %255s %255s %255s\n",chardummy,chardummy,chardummy,chardummy)!=4) _error_("Could not read " << domainname);
-		if(fscanf(fid,"%20i %255s\n",&n,chardummy)!=2) _error_("Could not read number of points in "<<domainname);
-		//# X pos Y pos
-		if(fscanf(fid,"%255s %255s %255s %255s %255s\n",chardummy,chardummy,chardummy,chardummy,chardummy)!=5) _error_("Could not read " << domainname);
-		for (i=0;i<n;i++){
-			if(fscanf(fid,"%30lf %30lf\n",&ddummy,&ddummy)!=2){
-				_error_("Could not read coordinate of vertex "<< i <<" of "<<domainname);
-			}
-		}
-		/*check whether we are at the end of the file, otherwise, keep reading next profile:*/
-		if(feof(fid)) break;
-		nprof++;
-	}
-
-	/*Allocate and initialize all the profiles: */
-	profnvertices = xNew<int>(nprof);
-	pprofx        = xNew<doubletype*>(nprof);
-	pprofy        = xNew<doubletype*>(nprof);
-	for (i=0;i<nprof;i++){
-		pprofx[i] = NULL;
-		pprofy[i] = NULL;
-	}
-	closed=xNew<bool>(nprof);
-
-	/*Reset file pointer to beginning of file: */
-	fseek(fid,0,SEEK_SET);
-
-	/*Start reading profiles: */
-	for(counter=0;counter<nprof;counter++){
-
-		/*Skip header: */
-		//## Name:filename
-		if(fscanf(fid,"%255s %255s\n",chardummy,chardummy)!=2) _error_("Could not read " << domainname);
-		//## Icon:0
-		if(fscanf(fid,"%255s %255s\n",chardummy,chardummy)!=2) _error_("Could not read " << domainname);
-		//# Points Count Value
-		if(fscanf(fid,"%255s %255s %255s %255s\n",chardummy,chardummy,chardummy,chardummy)!=4) _error_("Could not read " << domainname);
-
-		/*Get number of profile vertices: */
-		if(fscanf(fid,"%20i %255s\n",&n,chardummy)!=2) _error_("Could not read number of points in "<<domainname);
-
-		/*Skip next line: */
-		//# X pos Y pos
-		if(fscanf(fid,"%255s %255s %255s %255s %255s\n",chardummy,chardummy,chardummy,chardummy,chardummy)!=5) _error_("Could not read " << domainname);
-
-		/*Allocate vertices: */
-		x=xNew<doubletype>(n);
-		y=xNew<doubletype>(n);
-
-		/*Read vertices: */
-		for (i=0;i<n;i++){
-			if(fscanf(fid,"%30lf %30lf\n",&x[i],&y[i])!=2){
-				_error_("Could not read coordinate of vertex "<<i<<" of "<<domainname);
-			}
-		}
-
-		/*Now check that we are dealing with open contours: */
-		cl=false;
-		if((x[0]==x[n-1]) && (y[0]==y[n-1])){
-			cl=true;
-		}
-
-		/*Assign pointers: */
-		profnvertices[counter]=n;
-		pprofx[counter]=x;
-		pprofy[counter]=y;
-		closed[counter]=cl;
-	}
-
-	/*close domain outline file: */
-	fclose(fid);
-
-	/*Assign output pointers: */
-	*pnprof=nprof;
-	*pprofnvertices=profnvertices;
-	*ppprofx=pprofx;
-	*ppprofy=pprofy;
-	if(pclosed) *pclosed=closed;
-	else         xDelete<bool>(closed);
-	return 1;
-
-} /*}}}*/
-
 #endif
Index: /issm/trunk/src/c/shared/Matlab/CheckNumMatlabArguments.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matlab/CheckNumMatlabArguments.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Matlab/CheckNumMatlabArguments.cpp	(revision 1)
@@ -0,0 +1,27 @@
+/*!\file CheckNumMatlabArguments.cpp:
+ * \brief: check number of arguments and report an usage error message.
+ */
+
+#ifdef _SERIAL_
+
+#include "../Exceptions/exceptions.h"
+#include "mex.h"
+
+int CheckNumMatlabArguments(int nlhs,int NLHS, int nrhs,int NRHS, char* __FUNCT__, void (*function)( void )){
+	
+	/*checks on arguments on the matlab side: */
+	if (nrhs==0 && nlhs==0) {
+		/*unless NLHS=0 and NRHS=0, we are just asking for documentation: */
+		if (NRHS==0 && NLHS==0)return 1;
+		/* special case: */
+		function();
+		throw ErrorException(__FUNCT__," usage: see above");
+	}
+	else if ( nlhs!=NLHS || nrhs!=NRHS ) {
+		function(); 
+		throw ErrorException(__FUNCT__," usage error.");
+	}
+	return 1;
+}
+
+#endif
Index: /issm/trunk/src/c/shared/Matlab/ModuleBoot.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matlab/ModuleBoot.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Matlab/ModuleBoot.cpp	(revision 1)
@@ -0,0 +1,30 @@
+/* \file ModuleBoot.cpp
+ * \brief Carry out operations needed to boot, for example, petsc, MPI, plapack, etc ... 
+ * at the beginning of a module
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../../toolkits/toolkits.h"
+
+int my_rank;
+int num_procs;
+
+int ModuleBoot(void){
+	
+	/*Declare my_ rank and num_procs global variables!: */
+	//int argc=2;
+	//char* argv[]={"ISSM","-malloc no",NULL};
+	my_rank==0;
+	num_procs=1;
+
+	/*Initialize Petsc: */
+	PetscInitializeNoArguments();
+	//PetscInitialize(&argc,(char***)&argv,PETSC_NULL,PETSC_NULL);
+	
+	return 1;
+}
Index: /issm/trunk/src/c/shared/Matlab/PrintfFunction.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matlab/PrintfFunction.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Matlab/PrintfFunction.cpp	(revision 1)
@@ -0,0 +1,33 @@
+/*\file PrintfFunction.c
+ *\brief: this function is used by the _printf_ macro, to take into account the 
+ *fact we may be running on a cluster. 
+ */
+
+#include "stdarg.h"
+#include "stdio.h"
+
+int PrintfFunction(char* format,...){
+
+	/*string to be printed: */
+	char string[1024]; //assume that nobody will print more than 1024 characters at once.
+	int  string_size;
+	extern int my_rank;
+	extern int num_procs;
+                                                                                                                                                                                                     
+	//variable list of arguments
+	va_list ap;
+
+	//First use vsprintf to get the whole input string.
+	va_start(ap,format);
+	string_size=vsprintf(string,format,ap); //printf style coding 
+	va_end(ap); 
+
+	//Ok, if we are running in paralle, get node 0 to print
+	#if defined(_PARALLEL_)
+		if(my_rank==0)printf(string);
+	#else
+		printf(string);
+	#endif
+}
+
+
Index: /issm/trunk/src/c/shared/Matlab/matlabshared.h
===================================================================
--- /issm/trunk/src/c/shared/Matlab/matlabshared.h	(revision 1)
+++ /issm/trunk/src/c/shared/Matlab/matlabshared.h	(revision 1)
@@ -0,0 +1,18 @@
+/* \file Matlab.h
+ * \brief  header file for all routines related to matlab.
+ */
+
+#ifndef _MATLAB_SHARED_H_
+#define _MATLAB_SHARED_H_
+
+/*printf: */
+int PrintfFunction(char* format,...);
+int ModuleBoot(void);
+
+#ifdef _SERIAL_
+#include "mex.h"
+	mxArray* mxGetAssignedField(const mxArray* pmxa_array,int number, char* field);
+	int CheckNumMatlabArguments(int nlhs,int NLHS, int nrhs,int NRHS, char* THISFUNCTION, void (*function)( void ));
+#endif
+
+#endif
Index: /issm/trunk/src/c/shared/Matlab/mxGetAssignedField.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matlab/mxGetAssignedField.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Matlab/mxGetAssignedField.cpp	(revision 1)
@@ -0,0 +1,43 @@
+/*!\file: mxGetAssignedField.c: 
+ * \brief: abstract interface on parallel side for i/o, so it ressembles the serial i/o.
+ *
+ * In serial mode, this routine takes care of returning the field coming 
+ * from the model. If largesize is 1, we are running out of core models in 
+ * matlab, and we need to call the subsref private method from the model object
+ * in order to correctly load the data from disk.
+ */
+
+
+#ifdef _SERIAL_
+
+#include "mex.h"
+
+mxArray* mxGetAssignedField(const mxArray* pmxa_array,int number, char* field){
+
+	//output
+	mxArray* mxfield=NULL;
+	
+	//input
+	mxArray*   inputs[2];
+	mxArray*  pindex=NULL;
+	const	char*	fnames[2];
+	mwSize		ndim=2;
+	mwSize		onebyone[2] = {1,1};
+
+	//We want to call the subsasgn method, and get the returned array.This ensures that if we are running 
+	//large sized problems, the data is truly loaded from disk by the model subsasgn class method.
+	inputs[0]=(mxArray*)pmxa_array; //this is the model
+
+	//create index structure used in the assignment (index.type='.' and index.subs='x' for field x for ex)
+	fnames[0] = "type";
+	fnames[1] = "subs";
+	pindex=mxCreateStructArray( ndim,onebyone,2,fnames);
+	mxSetField( pindex, 0, "type",mxCreateString("."));
+	mxSetField( pindex, 0, "subs",mxCreateString(field));
+	inputs[1]=pindex;
+
+	mexCallMATLAB( 1, &mxfield, 2, (mxArray**)inputs, "subsref");
+
+	return mxfield;
+}
+#endif
Index: /issm/trunk/src/c/shared/Matlab/mxGetField.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matlab/mxGetField.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/Matlab/mxGetField.cpp	(revision 1)
@@ -0,0 +1,12 @@
+/* \file mxGetField.c: 
+ * \brief: placeholder for parallel mxGetField dummy routine.
+ * This routine does nothing, just returns a NULL pointer, and is only present in the parallel compilation 
+ * to "mirror" the mxGetField matlab routine. This makes coding of parallel applications a lot easier. 
+ * It is  used in ModelProcessorx/Model.c for example.
+ */
+
+#include <stdio.h>
+
+#ifdef _PARALLEL_
+FILE* mxGetField(FILE* fid,int number, char* field){ return fid; }
+#endif
Index: /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 28275)
+++ /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 1)
@@ -3,96 +3,166 @@
  */ 
 
-/*Headers*/
-/*{{{*/
+/*
+
+	TripleMultiply    Perform triple matrix product a*b*c+d.
+
+
+	Input:
+		double*    a        first matrix
+		int        nrowa    number of rows in a
+		int        ncola    number of columns in a
+		int        itrna    transpose flag for a
+		double*    b        second matrix
+		int        nrowb    number of rows in b
+		int        ncolb    number of columns in b
+		int        itrnb    transpose flag for b
+		double*    c        third matrix
+		int        nrowc    number of rows in c
+		int        ncolc    number of columns in c
+		int        itrnc    transpose flag for c
+		double*    d        addition matrix
+		int        iaddd    addition flag for d
+
+	Output:
+		double*    d        product matrix
+		int                 function return value
+
+*/
+#undef __FUNCT__
+#define __FUNCT__ "TripleMultiply"
+
+#include "./matrix.h"
+#include "../Exceptions/exceptions.h"
+#include "../Alloc/alloc.h"
+#include "../../include/macros.h"
+#include "../Matlab/matlabshared.h"
 #include <stdio.h>
 #include <sys/types.h>
-#include <math.h>
+#include <math.h>     /*  fabs  */
 #include <float.h>    /*  DBL_EPSILON  */
-#include <cstdarg>
-#include <iostream>
-
-#include "./matrix.h"
-#include "../Exceptions/exceptions.h"
-#include "../MemOps/MemOps.h"
-#include "../io/io.h"
-/*}}}*/
-
-int TripleMultiply(IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int nrowc, int ncolc, int itrnc, IssmDouble* d, int iaddd){/*{{{*/
-	/*TripleMultiply    Perform triple matrix product a*b*c+d.*/
-
-	int         idima,idimb,idimc,idimd;
-	IssmDouble  dtemp_static[600];
-	IssmDouble* dtemp_dynamic = NULL;
-	IssmDouble* dtemp         = NULL;
-	_assert_(a && b && c && d);
-
-	/*  set up dimensions for triple product  */
-	if (!itrna){
+
+int TripleMultiply( double* a, int nrowa, int ncola, int itrna, double* b, int nrowb, int ncolb, int itrnb, double* c, int nrowc, int ncolc, int itrnc, double* d, int iaddd){
+	
+	int idima,idimb,idimc,idimd;
+	double* dtemp;
+
+/*  set up dimensions for triple product  */
+
+	if (!itrna) {
 		idima=nrowa;
 		idimb=ncola;
 	}
-	else{
+	else {
 		idima=ncola;
 		idimb=nrowa;
 	}
 
-	if (!itrnb){
-		if (nrowb != idimb) _error_("Matrix A and B inner vectors not equal size.");
+	if (!itrnb) {
+		if (nrowb != idimb) {
+			throw ErrorException(__FUNCT__," Matrix A and B inner vectors not equal size.");
+		}
 		idimc=ncolb;
 	}
-	else{
-		if (ncolb != idimb) _error_("Matrix A and B inner vectors not equal size.");
+	else {
+		if (ncolb != idimb) {
+			throw ErrorException(__FUNCT__,"Matrix A and B inner vectors not equal size.");
+		}
 		idimc=nrowb;
 	}
 
 	if (!itrnc) {
-		if (nrowc != idimc) _error_("Matrix B and C inner vectors not equal size.");
+		if (nrowc != idimc) {
+			throw ErrorException(__FUNCT__,"Matrix B and C inner vectors not equal size.");
+		}
 		idimd=ncolc;
 	}
-	else{
-		if (ncolc != idimc) _error_("Matrix B and C inner vectors not equal size.");
+	else {
+		if (ncolc != idimc) {
+			throw ErrorException(__FUNCT__," Matrix B and C inner vectors not equal size.");
+		}
 		idimd=nrowc;
 	}
 
-	/*Depending on the size of incoming matrices, we might need to use a dynamic allocation*/
-	if(idima*idimc>600){
-		dtemp_dynamic = xNew<IssmDouble>(idima*idimc);
-		dtemp         = dtemp_dynamic;
-	}
-	else{
-		dtemp = &dtemp_static[0];
-	}
-
-	/*  perform the matrix triple product in the order that minimizes the
-		 number of multiplies and the temporary space used, noting that
-		 (a*b)*c requires ac(b+d) multiplies and ac IssmDoubles, and a*(b*c)
-		 requires bd(a+c) multiplies and bd IssmDoubles (both are the same for
-		 a symmetric triple product)  */
-
-	/*  multiply (a*b)*c+d  */
+/*  perform the matrix triple product in the order that minimizes the
+	number of multiplies and the temporary space used, noting that
+	(a*b)*c requires ac(b+d) multiplies and ac doubles, and a*(b*c)
+	requires bd(a+c) multiplies and bd doubles (both are the same for
+	a symmetric triple product)  */
+
+/*  multiply (a*b)*c+d  */
+
 	if (idima*idimc*(idimb+idimd) <= idimb*idimd*(idima+idimc)) {
-		MatrixMultiply(a,nrowa,ncola,itrna,b,nrowb,ncolb,itrnb,dtemp,0);
-		MatrixMultiply(dtemp,idima,idimc,0,c,nrowc,ncolc,itrnc,d,iaddd);
-	}
-
-	/*  multiply a*(b*c)+d  */
-	else{
-		MatrixMultiply(b,nrowb,ncolb,itrnb,c,nrowc,ncolc,itrnc,dtemp,0);
-		MatrixMultiply(a,nrowa,ncola,itrna,dtemp,idimb,idimd,0,d,iaddd);
-	}
-
-	/*Cleanup and return*/
-	xDelete<IssmDouble>(dtemp_dynamic);
-	return 1;
-}/*}}}*/
-int MatrixMultiply(IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int iaddc ){/*{{{*/
-	/*MatrixMultiply    Perform matrix multiplication a*b+c.*/
+		dtemp=(double *) xmalloc(idima*idimc*sizeof(double));
+
+		MatrixMultiply(a    ,nrowa,ncola,itrna,
+				   b    ,nrowb,ncolb,itrnb,
+				   dtemp,0);
+		MatrixMultiply(dtemp,idima,idimc,0    ,
+				   c    ,nrowc,ncolc,itrnc,
+				   d    ,iaddd);
+
+		xfree((void **)&dtemp);
+	}
+
+/*  multiply a*(b*c)+d  */
+
+	else {
+		dtemp=(double *) xmalloc(idimb*idimd*sizeof(double));
+
+		MatrixMultiply(b    ,nrowb,ncolb,itrnb,
+				   c    ,nrowc,ncolc,itrnc,
+				   dtemp,0);
+		MatrixMultiply(a    ,nrowa,ncola,itrna,
+				   dtemp,idimb,idimd,0    ,
+				   d    ,iaddd);
+
+		xfree((void **)&dtemp);
+	}
+}
+
+
+
+
+
+/*
+
+	MatrixMultiply    Perform matrix multiplication a*b+c.
+
+
+	Input:
+		double*    a        first matrix
+		int        nrowa    number of rows in a
+		int        ncola    number of columns in a
+		int        itrna    transpose flag for a
+		double*    b        second matrix
+		int        nrowb    number of rows in b
+		int        ncolb    number of columns in b
+		int        itrnb    transpose flag for b
+		double*    c        addition matrix
+		int        iaddc    addition flag for c
+
+	Output:
+		double*    c        product matrix
+		int                 function return value
+
+*/
+
+int MatrixMultiply( double* a,
+ 				    int nrowa,
+				    int ncola,
+				    int itrna,
+				    double* b,
+				    int nrowb,
+				    int ncolb,
+				    int itrnb,
+				    double* c,
+				    int iaddc )
+{
 	int noerr=1;
 	int i,j,k,ipta,iptb,iptc;
 	int nrowc,ncolc,iinca,jinca,iincb,jincb,ntrma,ntrmb,nterm;
 
-	_assert_(a && b && c);
-
-	/*  set up dimensions and increments for matrix a  */
+/*  set up dimensions and increments for matrix a  */
+
 	if (!itrna) {
 		nrowc=nrowa;
@@ -101,4 +171,5 @@
 		jinca=1;
 	}
+
 	else {
 		nrowc=ncola;
@@ -108,5 +179,6 @@
 	}
 
-	/*  set up dimensions and increments for matrix b  */
+/*  set up dimensions and increments for matrix b  */
+
 	if (!itrnb) {
 		ncolc=ncolb;
@@ -115,4 +187,5 @@
 		jincb=1;
 	}
+
 	else {
 		ncolc=nrowb;
@@ -122,23 +195,33 @@
 	}
 
-	if (ntrma != ntrmb) _error_("Matrix A and B inner vectors not equal size");
-
-	nterm=ntrma;
-
-	/*  zero matrix c, if not being added to product  */
-	if (!iaddc) for (i=0;i<nrowc*ncolc;i++) c[i]=0.;
-
-	/*  perform the matrix multiplication  */
+	if (ntrma != ntrmb) {
+		_printf_("%s -- Matrix A and B inner vectors not equal size.\n",
+				 __func__);
+	    noerr=0;	
+		return noerr;
+	}
+	else
+		nterm=ntrma;
+
+/*  zero matrix c, if not being added to product  */
+
+	if (!iaddc)
+		for (i=0; i<nrowc*ncolc; i++)
+			*(c+i)=0.;
+
+/*  perform the matrix multiplication  */
+
 	iptc=0;
-	for (i=0; i<nrowc; i++){
-		for (j=0; j<ncolc; j++){
+	for (i=0; i<nrowc; i++) {
+		for (j=0; j<ncolc; j++) {
 			ipta=i*iinca;
 			iptb=j*jincb;
 
-			for (k=0; k<nterm; k++){
-				c[iptc]+=a[ipta]*b[iptb];
+			for (k=0; k<nterm; k++) {
+				*(c+iptc)+=*(a+ipta)**(b+iptb);
 				ipta+=jinca;
 				iptb+=iincb;
 			}
+
 			iptc++;
 		}
@@ -146,79 +229,105 @@
 
 	return noerr;
-}/*}}}*/
-int MatrixInverse( IssmDouble* a, int ndim, int nrow, IssmDouble* b, int nvec, IssmDouble* pdet ){/*{{{*/
-	/* MatrixInverse    Perform matrix inversion and linear equation solution.
-
-		This function uses Gaussian elimination on the original matrix
-		augmented by an identity matrix of the same size to calculate
-		the inverse (see for example, "Modern Methods of Engineering
-		Computation", Sec. 6.4).  By noting how the matrices are
-		unpopulated and repopulated, the calculation may be done in place.
-
-		Gaussian elimination is inherently inefficient, and so this is
-		intended for small matrices.  */
+}
+
+
+/*
+
+	MatrixInverse    Perform matrix inversion and linear equation solution.
+
+
+	Input:
+		double*    a        coefficient matrix [ndim][ndim]
+		int        ndim     row and column dimension of a
+		int        nrow     number of rows in a
+		double*    b        right-hand vectors [ndim][nvec] (may be nULL)
+		int        nvec     number of vectors in b (0 for NULL b)
+
+	Output:
+		double*    a        inverted matrix [ndim][ndim]
+		double*    b        solution vectors [ndim][nvec] (may be NULL)
+		double*    pdet     determinant (may be NULL)
+		int                 error flag
+
+	This function uses Gaussian elimination on the original matrix
+	augmented by an identity matrix of the same size to calculate
+	the inverse (see for example, "Modern Methods of Engineering
+	Computation", Sec. 6.4).  By noting how the matrices are
+	unpopulated and repopulated, the calculation may be done in place.
+
+	Gaussian elimination is inherently inefficient, and so this is
+	intended for small matrices.
+
+*/
+
+int MatrixInverse( double* a,
+			       int ndim,
+			       int nrow,
+			       double* b,
+			       int nvec,
+			       double* pdet )
+{
 	int noerr=1;
 	int i,j,k,ipt,jpt,irow,icol,ipiv,ncol;
-	int *pivrc1,*pivrc2,*pindx;
-	IssmDouble pivot,det,dtemp;
+	int (*pivrc)[2],*pindx;
+	double pivot,det,dtemp;
 
 	if (!b && nvec) {
-		_error_("No right-hand side for nvec=" << nvec << ".");
+		_printf_("%s -- No right-hand side for nvec=%d.\n",
+				 __func__,nvec);
 		noerr=0;
 		return noerr;
 	}
 
-	/*In debugging mode, check that we are not dealing with simple matrices*/
-	_assert_(!(ndim==2 && nrow==2));
-	_assert_(!(ndim==3 && nrow==3));
-
-	/*  initialize local variables and arrays  */
+/*  initialize local variables and arrays  */
 
 	ncol=nrow;
 	det=1.;
-	pivrc1 =xNew<int>(nrow);
-	pivrc2 =xNew<int>(nrow);
-	pindx =xNew<int>(nrow);
-
-	/*  loop over the rows/columns of the matrix  */
+
+	pivrc = (int (*)[2]) xmalloc((nrow*2)*sizeof(int));
+	pindx = (int (*)   ) xcalloc( nrow   ,sizeof(int));
+
+/*  loop over the rows/columns of the matrix  */
 
 	for (i=0; i<nrow; i++) {
 
-		/*  search for pivot, finding the term with the greatest magnitude
-			 in the rows/columns not yet used  */
+/*  search for pivot, finding the term with the greatest magnitude
+	in the rows/columns not yet used  */
 
 		pivot=0.;
 		for (j=0; j<nrow; j++)
-		 if (!pindx[j])
-		  for (k=0; k<ncol; k++)
-			if (!pindx[k])
-			 if (fabs(a[j*ndim+k]) > fabs(pivot)) {
-				 irow=j;
-				 icol=k;
-				 pivot=a[j*ndim+k];
-			 }
+			if (!pindx[j])
+				for (k=0; k<ncol; k++)
+					if (!pindx[k])
+						if (fabs(a[j*ndim+k]) > fabs(pivot)) {
+							irow=j;
+							icol=k;
+							pivot=a[j*ndim+k];
+						}
 
 		if (fabs(pivot) < DBL_EPSILON) {
-			xDelete<int>(pivrc1);
-			xDelete<int>(pivrc2);
-			xDelete<int>(pindx);
-			_error_("Pivot " << pivot << " less than machine epsilon");
+			xfree((void **)&pivrc);
+			xfree((void **)&pindx);
+			_printf_("%s -- Pivot %f less than machine epsilon.\n",
+					 __func__,pivot);
 			noerr=0;
 			return noerr;
 		}
 
-		pivrc1[i]=irow;
-		pivrc2[i]=icol;
+		pivrc[i][0]=irow;
+		pivrc[i][1]=icol;
 
 		ipiv=icol;
 		pindx[ipiv]++;
 
-		//		_printf_("pivot for i=" << i << ": irow=" << irow << ", icol=" << icol  << ", pindx[" << ipiv << "]=" << pindx[ipiv] << "\n\n");
-
-		/*  switch rows to put pivot element on diagonal, noting that the
-			 column stays the same and the determinant changes sign  */
+//		_printf_("pivot for i=%d: irow=%d, icol=%d, pindx[%d]=%d\n",
+//				 i,irow,icol,ipiv,pindx[ipiv]);
+
+/*  switch rows to put pivot element on diagonal, noting that the
+	column stays the same and the determinant changes sign  */
 
 		if (irow != icol) {
-			//			_printf_("row switch for i=" << i << ": irow=" << irow << ", icol=" << icol << "\n\n");
+//			_printf_("row switch for i=%d: irow=%d, icol=%d\n",
+//					 i,irow,icol);
 
 			ipt=irow*ndim;
@@ -241,8 +350,8 @@
 		}
 
-		/*  divide pivot row by pivot element, noting that the original
-			 matrix will have 1 on the diagonal, which will be discarded,
-			 and the augmented matrix will start with 1 from the identity
-			 matrix and then have 1/pivot, which is part of the inverse.  */
+/*  divide pivot row by pivot element, noting that the original
+	matrix will have 1 on the diagonal, which will be discarded,
+	and the augmented matrix will start with 1 from the identity
+	matrix and then have 1/pivot, which is part of the inverse.  */
 
 		a[ipiv*ndim+ipiv]=1.;
@@ -250,17 +359,17 @@
 		ipt=ipiv*ndim;
 		for (k=0; k<ncol; k++)
-		 a[ipt+k]/=pivot;
+			a[ipt+k]/=pivot;
 
 		ipt=ipiv*nvec;
 		for (k=0; k<nvec; k++)
-		 b[ipt+k]/=pivot;
-
-		/*  reduce non-pivot rows such that they will have 0 in the pivot
-			 column, which will be discarded, and the augmented matrix will
-			 start with 0 from the identity matrix and then have non-zero
-			 in the corresponding column, which is part of the inverse.
-			 only one column of the augmented matrix is populated at a time,
-			 which corresponds to the only column of the original matrix
-			 being zeroed, so that the inverse may be done in place.  */
+			b[ipt+k]/=pivot;
+
+/*  reduce non-pivot rows such that they will have 0 in the pivot
+	column, which will be discarded, and the augmented matrix will
+	start with 0 from the identity matrix and then have non-zero
+	in the corresponding column, which is part of the inverse.
+	only one column of the augmented matrix is populated at a time,
+	which corresponds to the only column of the original matrix
+	being zeroed, so that the inverse may be done in place.  */
 
 		for (j=0; j<nrow; j++) {
@@ -274,32 +383,33 @@
 				jpt=ipiv*ndim;
 				for (k=0; k<ncol; k++)
-				 a[ipt+k]-=dtemp*a[jpt+k];
+					a[ipt+k]-=dtemp*a[jpt+k];
 
 				ipt=j   *nvec;
 				jpt=ipiv*nvec;
 				for (k=0; k<nvec; k++)
-				 b[ipt+k]-=dtemp*b[jpt+k];
+					b[ipt+k]-=dtemp*b[jpt+k];
 			}
 		}
 
-		/*  for a diagonal matrix, the determinant is the product of the
-			 diagonal terms, and so it may be accumulated from the pivots,
-			 noting that switching rows changes the sign as above  */
+/*  for a diagonal matrix, the determinant is the product of the
+	diagonal terms, and so it may be accumulated from the pivots,
+	noting that switching rows changes the sign as above  */
 
 		det*=pivot;
 	}
 
-	/*  switch columns back in reverse order, noting that a row switch
-		 in the original matrix corresponds to a column switch in the
-		 inverse matrix  */
+/*  switch columns back in reverse order, noting that a row switch
+	in the original matrix corresponds to a column switch in the
+	inverse matrix  */
 
 	for (i=0; i<nrow; i++) {
 		j=(nrow-1)-i;
 
-		if (pivrc1[j] != pivrc2[j]) {
-			irow=pivrc1[j];
-			icol=pivrc2[j];
-
-			//			_printf_("column switch back for j=" << j << ": irow=" << irow << ", icol=" << icol << "\n\n");
+		if (pivrc[j][0] != pivrc[j][1]) {
+			irow=pivrc[j][0];
+			icol=pivrc[j][1];
+
+//			_printf_("column switch back for j=%d: irow=%d, icol=%d\n",
+//					 j,irow,icol);
 
 			ipt=0;
@@ -313,380 +423,10 @@
 	}
 
-	if (pdet) *pdet=det;
-	xDelete<int>(pivrc1);
-	xDelete<int>(pivrc2);
-	xDelete<int>(pindx);
+	if (pdet)
+		*pdet=det;
+
+	xfree((void **)&pivrc);
+	xfree((void **)&pindx);
+
 	return noerr;
-}/*}}}*/
-
-void Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A){/*{{{*/
-	/*Compute determinant of a 2x2 matrix*/
-
-	/*det = a*d - c*b*/
-	*Adet= A[0]*A[3]-A[2]*A[1];
 }
-/*}}}*/
-void Matrix2x2Invert(IssmDouble* Ainv,IssmDouble* A){/*{{{*/
-
-	/*Intermediaries*/
-	IssmDouble det,det_reciprocal;
-
-	/*Compute determinant*/
-	Matrix2x2Determinant(&det,A);
-	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller than machine epsilon");
-
-	/*Multiplication is faster than divsion, so we multiply by the reciprocal*/
-	det_reciprocal = 1./det;  
-
-	/*Compute invert*/
-	Ainv[0]=   A[3]*det_reciprocal; /* =  d/det */
-	Ainv[1]= - A[1]*det_reciprocal; /* = -b/det */
-	Ainv[2]= - A[2]*det_reciprocal; /* = -c/det */
-	Ainv[3]=   A[0]*det_reciprocal; /* =  a/det */
-
-}/*}}}*/
-void Matrix2x2Eigen(IssmDouble* plambda1,IssmDouble* plambda2,IssmDouble* pvx, IssmDouble* pvy,IssmDouble a11, IssmDouble a21,IssmDouble a22){/*{{{*/
-	/*From symetric matrix (a11,a21;a21,a22), get eigen values lambda1 and lambda2 and one eigen vector v*/
-
-	/*Output*/
-	IssmDouble lambda1,lambda2;
-	IssmDouble vx,vy;
-
-	/*To get the eigen values, we must solve the following equation:
-	 *     | a11 - lambda    a21        |
-	 * det |                            | = 0
-	 *     | a21             a22-lambda |
-	 *
-	 * We have to solve the following polynom:
-	 *  lamda^2 + ( -a11 -a22)*lambda + (a11*a22-a21*a21) = 0*/
-
-	/*Compute polynom determinant*/
-	IssmDouble b=-a11-a22;
-	IssmDouble delta=b*b - 4*(a11*a22-a21*a21);
-
-	/*Compute norm of M to avoid round off errors*/
-	IssmDouble normM=a11*a11 + a22*a22 + a21*a21;
-
-	/*1: normM too small: eigen values = 0*/
-	if(normM<1.e-30){
-		lambda1=0.;
-		lambda2=0.;
-		vx=1.;
-		vy=0.;
-	}
-	/*2: delta is small -> double root*/
-	else if (delta < 1.e-5*normM){
-		lambda1=-b/2.;
-		lambda2=-b/2.;
-		vx=1.;
-		vy=0.;
-	}
-	/*3: general case -> two roots*/
-	else{
-		delta   = sqrt(delta);
-		lambda1 = (-b-delta)/2.;
-		lambda2 = (-b+delta)/2.;
-
-		/*Now, one must find the eigen vectors. For that we use the following property of the inner product
-		 *    <Ax,y> = <x,tAy>
-		 * Here, M'(M-lambda*Id) is symmetrical, which gives:
-		 *    \forall (x,y)\in R²xR² <M'x,y> = <M'y,x>
-		 * And we have the following:
-		 *    if y\in Ker(M'), \forall x\in R² <M'x,y> = <x,M'y> = 0
-		 * We have shown that
-		 *    Im(M') \perp Ker(M')
-		 *
-		 * To find the eigen vectors of M, we only have to find two vectors
-		 * of the image of M' and take their perpendicular as long as they are
-		 * not 0.
-		 * To do that, we take the images (1,0) and (0,1):
-		 *  x1 = (a11 - lambda)      x2 = a21
-		 *  y1 = a21                 y2 = (a22-lambda)
-		 *
-		 * We take the vector that has the larger norm and take its perpendicular.*/
-
-		IssmDouble norm1 = (a11-lambda1)*(a11-lambda1) + a21*a21; 
-		IssmDouble norm2 = a21*a21 + (a22-lambda1)*(a22-lambda1);
-
-		if(norm2<norm1){
-			norm1=sqrt(norm1);
-			vx = - a21/norm1;
-			vy = (a11-lambda1)/norm1;
-		}
-		else{
-			norm2=sqrt(norm2);
-			vx = - (a22-lambda1)/norm2;
-			vy = a21/norm2;
-		}
-	}
-
-	/*Assign output*/
-	*plambda1 = lambda1;
-	*plambda2 = lambda2;
-	if(pvx) *pvx = vx;
-	if(pvy) *pvy = vy;
-
-}/*}}}*/
-
-void Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A){/*{{{*/
-	/*Compute determinant of a 3x3 matrix*/
-
-	/*det = a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g)*/
-	*Adet= A[0]*A[4]*A[8]-A[0]*A[5]*A[7]-A[3]*A[1]*A[8]+A[3]*A[2]*A[7]+A[6]*A[1]*A[5]-A[6]*A[2]*A[4];
-}
-/*}}}*/
-IssmDouble Matrix3x3Determinant(IssmDouble a1,IssmDouble a2,IssmDouble a3, IssmDouble b1,IssmDouble b2,IssmDouble b3, IssmDouble c1,IssmDouble c2,IssmDouble c3){/*{{{*/
-	/*Compute determinant of a 3x3 matrix*/
-
-	/*det = a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g)
-	 * a b c   a1 a2 a3
-	 * d e f   b1 b2 b3
-	 * g h i   c1 c2 c3 */
-	return a1*b2*c3-a1*b3*c2-b1*a2*c3+b1*a3*c2+c1*a2*b3-c1*a3*b2;
-}
-/*}}}*/
-void Matrix3x3Invert(IssmDouble* Ainv,IssmDouble* A){/*{{{*/
-
-	/*Intermediaries*/
-	IssmDouble det,det_reciprocal;
-
-	/*Compute determinant*/
-	Matrix3x3Determinant(&det,A);
-	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller than machine epsilon");
-
-	/*Multiplication is faster than divsion, so we multiply by the reciprocal*/
-	det_reciprocal = 1./det;  
-
-	/*Compute invert*/
-	Ainv[0]=(A[4]*A[8]-A[5]*A[7])*det_reciprocal; /* = (e*i-f*h)/det */
-	Ainv[1]=(A[2]*A[7]-A[1]*A[8])*det_reciprocal; /* = (c*h-b*i)/det */
-	Ainv[2]=(A[1]*A[5]-A[2]*A[4])*det_reciprocal; /* = (b*f-c*e)/det */
-	Ainv[3]=(A[5]*A[6]-A[3]*A[8])*det_reciprocal; /* = (f*g-d*i)/det */
-	Ainv[4]=(A[0]*A[8]-A[2]*A[6])*det_reciprocal; /* = (a*i-c*g)/det */
-	Ainv[5]=(A[2]*A[3]-A[0]*A[5])*det_reciprocal; /* = (c*d-a*f)/det */
-	Ainv[6]=(A[3]*A[7]-A[4]*A[6])*det_reciprocal; /* = (d*h-e*g)/det */
-	Ainv[7]=(A[1]*A[6]-A[0]*A[7])*det_reciprocal; /* = (b*g-a*h)/det */
-	Ainv[8]=(A[0]*A[4]-A[1]*A[3])*det_reciprocal; /* = (a*e-b*d)/det */
-}/*}}}*/
-void Matrix3x3Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B){/*{{{*/
-
-	IssmDouble Ainv[3][3];
-
-	Matrix3x3Invert(&Ainv[0][0],A);
-	for(int i=0;i<3;i++) X[i]=Ainv[i][0]*B[0] + Ainv[i][1]*B[1] + Ainv[i][2]*B[2];
-
-}/*}}}*/
-
-void Matrix4x4Determinant(IssmDouble* Adet,IssmDouble* A){/*{{{*/
-	/*Compute determinant of a 4x4 matrix*/
-
-	IssmDouble a1 = A[0*4+0];
-	IssmDouble b1 = A[0*4+1]; 
-	IssmDouble c1 = A[0*4+2];
-	IssmDouble d1 = A[0*4+3];
-
-	IssmDouble a2 = A[1*4+0];
-	IssmDouble b2 = A[1*4+1]; 
-	IssmDouble c2 = A[1*4+2];
-	IssmDouble d2 = A[1*4+3];
-
-	IssmDouble a3 = A[2*4+0]; 
-	IssmDouble b3 = A[2*4+1];
-	IssmDouble c3 = A[2*4+2];
-	IssmDouble d3 = A[2*4+3];
-
-	IssmDouble a4 = A[3*4+0];
-	IssmDouble b4 = A[3*4+1]; 
-	IssmDouble c4 = A[3*4+2];
-	IssmDouble d4 = A[3*4+3];
-
-	*Adet= a1 * Matrix3x3Determinant(b2, b3, b4, c2, c3, c4, d2, d3, d4)
-		  - b1 * Matrix3x3Determinant(a2, a3, a4, c2, c3, c4, d2, d3, d4)
-		  + c1 * Matrix3x3Determinant(a2, a3, a4, b2, b3, b4, d2, d3, d4)
-		  - d1 * Matrix3x3Determinant(a2, a3, a4, b2, b3, b4, c2, c3, c4);
-}
-/*}}}*/
-void Matrix4x4Adjoint(IssmDouble* Aadj,IssmDouble* A){/*{{{*/
-
-    IssmDouble a1 = A[0*4+0];
-    IssmDouble b1 = A[0*4+1]; 
-    IssmDouble c1 = A[0*4+2];
-    IssmDouble d1 = A[0*4+3];
-
-    IssmDouble a2 = A[1*4+0];
-    IssmDouble b2 = A[1*4+1]; 
-    IssmDouble c2 = A[1*4+2];
-    IssmDouble d2 = A[1*4+3];
-
-    IssmDouble a3 = A[2*4+0];
-    IssmDouble b3 = A[2*4+1];
-    IssmDouble c3 = A[2*4+2];
-    IssmDouble d3 = A[2*4+3];
-
-    IssmDouble a4 = A[3*4+0];
-    IssmDouble b4 = A[3*4+1]; 
-    IssmDouble c4 = A[3*4+2];
-    IssmDouble d4 = A[3*4+3];
-
-    /* Row column labeling reversed since we transpose rows & columns*/
-    Aadj[0*4+0]  =   Matrix3x3Determinant(b2, b3, b4, c2, c3, c4, d2, d3, d4);
-    Aadj[1*4+0]  = - Matrix3x3Determinant(a2, a3, a4, c2, c3, c4, d2, d3, d4);
-    Aadj[2*4+0]  =   Matrix3x3Determinant(a2, a3, a4, b2, b3, b4, d2, d3, d4);
-    Aadj[3*4+0]  = - Matrix3x3Determinant(a2, a3, a4, b2, b3, b4, c2, c3, c4);
-
-    Aadj[0*4+1]  = - Matrix3x3Determinant(b1, b3, b4, c1, c3, c4, d1, d3, d4);
-    Aadj[1*4+1]  =   Matrix3x3Determinant(a1, a3, a4, c1, c3, c4, d1, d3, d4);
-    Aadj[2*4+1]  = - Matrix3x3Determinant(a1, a3, a4, b1, b3, b4, d1, d3, d4);
-    Aadj[3*4+1]  =   Matrix3x3Determinant(a1, a3, a4, b1, b3, b4, c1, c3, c4);
-
-    Aadj[0*4+2]  =   Matrix3x3Determinant(b1, b2, b4, c1, c2, c4, d1, d2, d4);
-    Aadj[1*4+2]  = - Matrix3x3Determinant(a1, a2, a4, c1, c2, c4, d1, d2, d4);
-    Aadj[2*4+2]  =   Matrix3x3Determinant(a1, a2, a4, b1, b2, b4, d1, d2, d4);
-    Aadj[3*4+2]  = - Matrix3x3Determinant(a1, a2, a4, b1, b2, b4, c1, c2, c4);
-
-    Aadj[0*4+3]  = - Matrix3x3Determinant(b1, b2, b3, c1, c2, c3, d1, d2, d3);
-    Aadj[1*4+3]  =   Matrix3x3Determinant(a1, a2, a3, c1, c2, c3, d1, d2, d3);
-    Aadj[2*4+3]  = - Matrix3x3Determinant(a1, a2, a3, b1, b2, b3, d1, d2, d3);
-    Aadj[3*4+3]  =   Matrix3x3Determinant(a1, a2, a3, b1, b2, b3, c1, c2, c3);
-}/*}}}*/
-void Matrix4x4Invert(IssmDouble* Ainv,IssmDouble* A){/*{{{*/
-
-	/*Intermediaries*/
-	IssmDouble det,det_reciprocal;
-
-	/*Compute determinant*/
-	Matrix4x4Determinant(&det,A);
-	if(fabs(det) < DBL_EPSILON) _error_("Determinant smaller than machine epsilon");
-
-	/*Multiplication is faster than division, so we multiply by the reciprocal*/
-	det_reciprocal = 1./det;
-
-	/*Compute adjoint matrix*/
-	Matrix4x4Adjoint(Ainv,A);
-
-	/*Scalte adjoint matrix to get inverse*/
-	for(int i=0;i<4*4;i++) Ainv[i] = Ainv[i]*det_reciprocal;
-}/*}}}*/
-void Matrix4x4Solve(IssmDouble* X,IssmDouble* A,IssmDouble *B){/*{{{*/
-	IssmDouble Ainv[4][4];
-
-	Matrix4x4Invert(&Ainv[0][0],A);
-	for(int i=0;i<4;i++) X[i]=Ainv[i][0]*B[0] + Ainv[i][1]*B[1] + Ainv[i][2]*B[2] + Ainv[i][3]*B[3];
-}/*}}}*/
-
-void newcell(IssmDouble** pcell, IssmDouble newvalue, bool top, int m){  /*{{{*/
-
-    IssmDouble* cell=NULL;
-    IssmDouble* dummy=NULL;
-
-    /*recover pointer: */
-    cell=*pcell;
-
-    /*reallocate:*/
-    dummy=xNew<IssmDouble>(m+1);
-
-	/*copy data:*/
-    if(top){
-        dummy[0]=newvalue;
-        for(int i=0;i<m;i++)dummy[i+1]=cell[i];
-    }
-    else{
-        dummy[m]=newvalue;
-        for(int i=0;i<m;i++)dummy[i]=cell[i];
-    }
-
-    /*delete and reassign: */
-    xDelete<IssmDouble>(cell); cell=dummy;
-
-    /*assign output pointer:*/
-    *pcell=cell;
-} /*}}}*/
-IssmDouble  cellsum(IssmDouble* cell, int m){ /*{{{*/
-
-	IssmDouble sum=0;
-
-	for(int i=0;i<m;i++)sum+=cell[i];
-
-	return sum;
-} /*}}}*/
-void celldelete(IssmDouble** pcell, int m, int* indices, int nind){ /*{{{*/
-
-	/*input: */
-	IssmDouble* cell=*pcell;
-
-	/*output: */
-	IssmDouble* newcell=xNew<IssmDouble>(nind);
-
-	for(int i=0;i<nind;i++){
-		newcell[i]=cell[indices[i]];
-	}
-
-	/*free allocation:*/
-	xDelete<IssmDouble>(cell);
-
-	/*assign output pointers: */
-	*pcell=newcell;
-} /*}}}*/
-void cellsplit(IssmDouble** pcell, int m, int i,IssmDouble scale) { /*{{{*/
-
-	/*input: */
-	IssmDouble* cell=*pcell;
-
-	/*output: */
-	IssmDouble* newcell=xNew<IssmDouble>(m+1);
-
-	for(int j=0;j<i;j++)newcell[j]=cell[j]; 
-	newcell[i]=scale*cell[i];
-	newcell[i+1]=scale* cell[i];
-	for(int j=i+2;j<m+1;j++)newcell[j]=cell[j-1];
-
-	/*free allocation:*/
-	xDelete<IssmDouble>(cell);
-
-	/*assign output pointers: */
-	*pcell=newcell;
-} /*}}}*/
-void cellecho(int numcells, int m, ...) { /*{{{*/
-
-	va_list arguments;                     
-	IssmDouble** celllist= NULL;
-
-	/*allocate variable length array: */
-	celllist=xNew<IssmDouble*>(numcells); 
-
-	va_start(arguments,m);
-
-	for ( int x = 0; x < numcells; x++ ){
-		celllist[x]= va_arg ( arguments, IssmDouble*); 
-	}
-	va_end ( arguments );                  
-
-	_printf_("Echo of cell: \n");
-	for(int i=0;i<m;i++){
-		_printf_(i << ": ");
-		for (int j=0;j<numcells;j++)_printf_(setprecision(10) << celllist[j][i] << " ");
-		_printf_("\n");
-	}
-
-	/*deallocate:*/
-	xDelete<IssmDouble*>(celllist);
-
-} /*}}}*/
-void CholeskyRealPositiveDefinite(IssmDouble* Lchol, IssmDouble* A, int ndim) { /*{{{*/
-   /*CholeskyRealPositiveDefinite   computes lower triangular matrix of the Cholesky decomposition of A
-   Follows the Cholesky–Banachiewicz algorithm
-   Lchol should point to an IssmDouble* of same dimensions as A*/
-
-	/*ensure zero-initialization*/
-	for(int i=0;i<(ndim*ndim);i++) Lchol[i]=0;;
-
-	for(int i=0;i<ndim;i++){
-		for(int j=0;j<=i;j++){
-			IssmDouble sum=0.;
-			for(int k=0;k<j;k++) sum += Lchol[i*ndim+k]*Lchol[j*ndim+k];
-			
-			if(i==j) Lchol[i*ndim+j] = sqrt(A[i*ndim+j]-sum);
-			else Lchol[i*ndim+j]     = 1./Lchol[j*ndim+j] * (A[i*ndim+j]-sum);
-		}
-	}
-} /*}}}*/
Index: /issm/trunk/src/c/shared/Matrix/matrix.h
===================================================================
--- /issm/trunk/src/c/shared/Matrix/matrix.h	(revision 28275)
+++ /issm/trunk/src/c/shared/Matrix/matrix.h	(revision 1)
@@ -4,31 +4,13 @@
 
 #ifndef _MATRIXUTILS_H_
-#define _MATRIXUTILS_H_
+#define  _MATRIXUTILS_H_
 
-#include "../Numerics/types.h"
 
-int  TripleMultiply( IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int nrowc, int ncolc, int itrnc, IssmDouble* d, int iaddd);
-int  MatrixMultiply( IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int iaddc );
-int  MatrixInverse( IssmDouble* a, int ndim, int nrow, IssmDouble* b, int nvec, IssmDouble* pdet );
+int TripleMultiply( double* a, int nrowa, int ncola, int itrna, double* b, int nrowb, int ncolb, int itrnb, double* c, int nrowc, int ncolc, int itrnc, double* d, int iaddd);
+int MatrixMultiply( double* a, int nrowa, int ncola, int itrna, double* b, int nrowb, int ncolb, int itrnb, double* c, int iaddc );
+int MatrixInverse( double* a, int ndim, int nrow, double* b, int nvec, double* pdet );
 
-void Matrix2x2Invert(IssmDouble* Ainv, IssmDouble* A);
-void Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A);
-void Matrix2x2Eigen(IssmDouble* plambda1,IssmDouble* plambda2,IssmDouble* pvx, IssmDouble* pvy,IssmDouble a11, IssmDouble a21,IssmDouble a22);
+	
 
-void Matrix3x3Invert(IssmDouble* Ainv, IssmDouble* A);
-void Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A);
-IssmDouble Matrix3x3Determinant( IssmDouble a1,IssmDouble a2,IssmDouble a3, IssmDouble b1,IssmDouble b2,IssmDouble b3, IssmDouble c1,IssmDouble c2,IssmDouble c3);
-void Matrix3x3Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B);
+#endif //ifndef _MATRIXUTILS_H_
 
-void Matrix4x4Adjoint(IssmDouble* Aadj, IssmDouble* A);
-void Matrix4x4Invert(IssmDouble* Ainv, IssmDouble* A);
-void Matrix4x4Determinant(IssmDouble* Adet,IssmDouble* A);
-void Matrix4x4Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B);
-
-void newcell(IssmDouble** pcell, IssmDouble newvalue, bool top, int m);
-IssmDouble  cellsum(IssmDouble* cell, int m);
-void celldelete(IssmDouble** pcell, int m, int* indices, int nind);
-void cellsplit(IssmDouble** pcell, int m, int i,IssmDouble scale);
-void cellecho(int numcells, int m, ...);
-void CholeskyRealPositiveDefinite(IssmDouble* Lchol, IssmDouble* A, int ndim);
-#endif //ifndef _MATRIXUTILS_H_
Index: sm/trunk/src/c/shared/Numerics/BrentSearch.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp	(revision 28275)
+++ 	(revision )
@@ -1,251 +1,0 @@
-/*!\file:  BrentSearch.cpp
- * \brief optimization algorithm
- */ 
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include <float.h>
-#include <iomanip>
-#include <cmath>
-
-#include "../Exceptions/exceptions.h"
-#include "../io/io.h"
-#include "../MemOps/MemOps.h"
-#include "./Verbosity.h"
-#include "./OptPars.h"
-#include "./types.h"
-#include "./isnan.h"
-
-void BrentSearch(IssmDouble** pJ,OptPars optpars,IssmDouble* X0,IssmDouble (*f)(IssmDouble*,void*),IssmDouble (*g)(IssmDouble**,IssmDouble*,void*),void* usr){
-
-	/* This routine is optimizing a given function using Brent's method
-	 * (Golden or parabolic procedure)*/
-
-	/*Intermediary*/
-	int        iter;
-	IssmDouble si,gold,intervalgold,oldintervalgold;
-	IssmDouble parab_num,parab_den,distance;
-	IssmDouble fxmax,fxmin,fxbest;
-	IssmDouble fx,fx1,fx2;
-	IssmDouble x,x1,x2,xm,xbest;
-	IssmDouble tol1,tol2,seps;
-	IssmDouble tolerance = 1.e-4;
-
-	/*Recover parameters:*/
-	int         nsteps  = optpars.nsteps;
-	int         nsize   = optpars.nsize;
-	IssmDouble  xmin    = optpars.xmin;
-	IssmDouble  xmax    = optpars.xmax;
-	int        *maxiter = optpars.maxiter;
-	IssmDouble *cm_jump = optpars.cm_jump;
-
-	/*Initialize gradient and controls*/
-	IssmDouble* G = NULL;
-	IssmDouble* J = xNew<IssmDouble>(nsteps);
-	IssmDouble* X = xNew<IssmDouble>(nsize);
-
-	/*Header of printf*/
-	_printf0_("\n");
-	_printf0_("       x       |  Cost function f(x)  |  List of contributions\n");
-
-	/*start iterations*/
-	for(int n=0;n<nsteps;n++){
-
-		/*Print iteration number*/
-		_printf0_("====================== step "<< n+1 << "/" << nsteps <<" ===============================\n");
-
-		/*Reset some variables*/
-		iter = 0;
-		xmin = 0.;
-		xmax = 1.;
-		bool loop = true;
-		cout<<setprecision(5);
-
-		/*Get current Gradient at xmin=0*/
-		_printf0_(" x = "<<setw(9)<<xmin<<" | ");
-		fxmin = (*g)(&G,X0,usr); if(xIsNan<IssmDouble>(fxmin)) _error_("Function evaluation returned NaN");
-
-		/*Get f(xmax)*/
-		_printf0_(" x = "<<setw(9)<<xmax<<" | ");
-		for(int i=0;i<nsize;i++) X[i]=X0[i]+xmax*G[i];
-		fxmax = (*f)(X,usr); if (xIsNan<IssmDouble>(fxmax)) _error_("Function evaluation returned NaN");
-		//if(VerboseControl()) _printf0_("           N/A    "<<setw(12)<<xmax<<"  "<<setw(12)<<fxmax<<"           N/A         boundary\n");
-
-		/*test if jump option activated and xmin==0*/
-		if(!xIsNan<IssmDouble>(cm_jump[n]) && (xmin==0) && (fxmax/fxmin)<cm_jump[n]){
-			for(int i=0;i<nsize;i++) X0[i]=X0[i]+xmax*G[i];
-			xDelete<IssmDouble>(G);
-			J[n]=fxmax;
-			continue;
-		}
-
-		/*initialize optimization variables*/
-		seps=sqrt(DBL_EPSILON);    //precision of a IssmDouble
-		distance=0.0;              //new_x=old_x + distance
-		gold=0.5*(3.0-sqrt(5.0));  //gold = 1 - golden ratio
-		intervalgold=0.0;          //distance used by Golden procedure
-
-		/*1: initialize the values of the 4 x needed (x1,x2,x,xbest)*/
-		x1=xmin+gold*(xmax-xmin);
-		x2=x1;
-		xbest=x1;
-		x=xbest;
-
-		/*2: call the function to be evaluated*/
-		_printf0_(" x = "<<setw(9)<<x<<" | ");
-		for(int i=0;i<nsize;i++) X[i]=X0[i]+x*G[i];
-		fxbest = (*f)(X,usr); if(xIsNan<IssmDouble>(fxbest)) _error_("Function evaluation returned NaN");
-		iter++;
-
-		/*3: update the other variables*/
-		fx1=fxbest;
-		fx2=fxbest;
-		/*xm is always in the middle of a and b*/
-		xm=0.5*(xmin+xmax);                           
-		/*update tolerances*/
-		tol1=seps*sqrt(pow(xbest,2))+tolerance/3.0;
-		tol2=2.0*tol1;
-
-		/*4: print result*/
-		//if(VerboseControl())
-		 //_printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<xbest<<"  "<<setw(12)<<fxbest<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<"         initial\n");
-		if (!xIsNan<IssmDouble>(cm_jump[n]) && (xmin==0) && ((fxbest/fxmin)<cm_jump[n])){
-			//if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump[n] << "\n");
-			loop=false;
-		}
-
-		while(loop){
-
-			bool goldenflag=true;
-
-			// Is a parabolic fit possible ?
-			if (sqrt(pow(intervalgold,2))>tol1){
-
-				// Yes, so fit parabola
-				goldenflag=false;
-				parab_num=(xbest-x1)*(xbest-x1)*(fxbest-fx2)-(xbest-x2)*(xbest-x2)*(fxbest-fx1);;
-				parab_den=2.0*(xbest-x1)*(fxbest-fx2)-2.0*(xbest-x2)*(fxbest-fx1);
-
-				//reverse p if necessary
-				if(parab_den>0.0){ 
-					parab_num=-parab_num;
-				}
-				parab_den=sqrt(pow(parab_den,2));
-				oldintervalgold=intervalgold;
-				intervalgold=distance;
-
-				// Is the parabola acceptable (we use seps here because in some configuration parab_num==parab_den*(xmax-xbest)
-				// and the result is not repeatable anymore
-				if (( sqrt(pow(parab_num,2)) < sqrt(pow(0.5*parab_den*oldintervalgold,2))) &&
-							(parab_num>parab_den*(xmin-xbest)+seps) && 
-							(parab_num<parab_den*(xmax-xbest)-seps)){
-
-					// Yes, parabolic interpolation step
-					distance=parab_num/parab_den;
-					x=xbest+distance;
-
-					// f must not be evaluated too close to min_x or max_x
-					if (((x-xmin)<tol2) || ((xmax-x)<tol2)){
-						if ((xm-xbest)<0.0) si=-1;
-						else                si=1;
-						//compute new distance
-						distance=tol1*si;
-					}
-				}
-				else{
-					// Not acceptable, must do a golden section step
-					goldenflag=true;
-				}
-			}
-
-			//Golden procedure
-			if(goldenflag){
-				// compute the new distance d
-				if(xbest>=xm){
-					intervalgold=xmin-xbest;    
-				}
-				else{ 
-					intervalgold=xmax-xbest;  
-				}
-				distance=gold*intervalgold;
-			}
-
-			// The function must not be evaluated too close to xbest
-			if(distance<0) si=-1;
-			else           si=1;
-			if(sqrt(pow(distance,2))>tol1) x=xbest+si*sqrt(pow(distance,2));
-			else                           x=xbest+si*tol1;
-
-			//evaluate function on x
-			_printf0_(" x = "<<setw(9)<<x<<" | ");
-			for(int i=0;i<nsize;i++) X[i]=X0[i]+x*G[i];
-			fx = (*f)(X,usr); if(xIsNan<IssmDouble>(fx)) _error_("Function evaluation returned NaN");
-			iter++;
-
-			// Update a, b, xm, x1, x2, tol1, tol2
-			if (fx<=fxbest){
-				if (x>=xbest) xmin=xbest;
-				else          xmax=xbest;
-				x1=x2;    fx1=fx2;
-				x2=xbest; fx2=fxbest;
-				xbest=x;  fxbest=fx;
-			}
-			else{ // fx > fxbest
-				if (x<xbest) xmin=x;
-				else         xmax=x;
-				if ((fx<=fx2) || (x2==xbest)){
-					x1=x2; fx1=fx2;
-					x2=x;  fx2=fx;
-				}
-				else if ( (fx <= fx1) || (x1 == xbest) || (x1 == x2) ){
-					x1=x;  fx1=fx;
-				}
-			}
-			xm = 0.5*(xmin+xmax);
-			tol1=seps*pow(pow(xbest,2),0.5)+tolerance/3.0;
-			tol2=2.0*tol1;
-			//if(VerboseControl())
-			// _printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<x<<"  "<<setw(12)<<fx<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<
-			//			 "         "<<(goldenflag?"golden":"parabolic")<<"\n");
-
-			/*Stop the optimization?*/
-			if (sqrt(pow(xbest-xm,2)) < (tol2-0.5*(xmax-xmin))){
-				//if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'tolx'=" << tolerance << "\n");
-				loop=false;
-			}
-			else if (iter>=maxiter[n]){
-				//if(VerboseControl()) _printf0_("      exiting: Maximum number of iterations has been exceeded  ('maxiter'=" << maxiter[n] << ")\n");
-				loop=false;
-			}
-			else if (!xIsNan<IssmDouble>(cm_jump[n]) && (xmin==0) && ((fxbest/fxmin)<cm_jump[n])){
-				//if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump[n] << "\n");
-				loop=false;
-			}
-			else{
-				//continue
-				loop=true;
-			}
-		}//end while
-
-		//Now, check that the value on the boundaries are not better than current fxbest
-		if (fxbest>fxmin){
-			xbest=optpars.xmin; fxbest=fxmin;
-		}
-		if (fxbest>fxmax){
-			xbest=optpars.xmax; fxbest=fxmax;
-		}
-
-		/*Assign output pointers: */
-		for(int i=0;i<nsize;i++) X0[i]=X0[i]+xbest*G[i];
-		xDelete<IssmDouble>(G);
-		J[n]=fxbest;
-	}
-
-	/*return*/
-	xDelete<IssmDouble>(X);
-	*pJ=J;
-}
Index: /issm/trunk/src/c/shared/Numerics/GaussPoints.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/GaussPoints.cpp	(revision 28275)
+++ /issm/trunk/src/c/shared/Numerics/GaussPoints.cpp	(revision 1)
@@ -1,82 +1,117 @@
 /*  Gauss point structures and prototypes  */
+
+
+#include "./GaussPoints.h"
+#include "../Matlab/matlabshared.h"
+#include "../Alloc/alloc.h"
+#include "../../include/macros.h"
+#include "../Exceptions/exceptions.h"
 #include <math.h>
 #include <float.h>
 
-#include "./GaussPoints.h"
-#include "../MemOps/MemOps.h"
-#include "../Exceptions/exceptions.h"
-#include "../Numerics/constants.h"
-
-/*General Gauss points*/
-void GaussLegendreLinear( IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus){/*{{{*/
-	/* Gauss-Legendre quadrature points.
-
-		The recurrence coefficients for Legendre polynomials on (-1,1)
-		are defined (from the ORTHPOL subroutine RECUR with ipoly=1) as:
-
+/*=======1=========2=========3=========4=========5=========6=========7=========8
+
+	GaussLegendre.c    Gauss-Legendre quadrature points.
+={
+	02/20/03    jes    Initial development.
+	04/10/03    jes    Combination of leggauss and legrecur.
+	04/11/05    jes    Addition of hard-coded values for lower degrees.
+	04/25/05    jes    Addition of allocation.
+
+	Input:
+		int      ngaus     number of Gauss points
+
+	Output:
+		double** pxgaus    abscissas of Gauss points
+							   (allocated below)
+		double** pxwgt     weights of Gauss points
+							   (allocated below)
+		int                function return value
+
+	The recurrence coefficients for Legendre polynomials on (-1,1)
+	are defined (from the ORTHPOL subroutine RECUR with ipoly=1) as:
+	  
 		alpha(i)=0.
 		beta (i)=1./(4.-1./(i-1)^2))
 
-		For degree p, the required number of Gauss-Legendre points is
-		n>=(p+1)/2.*/
-	_assert_(ngaus>0);
-
-	/*Intermediaries*/
-	int i;
-	IssmPDouble *alpha,*beta;
-
-	/*p= 1, npoint= 1*/
-	static IssmPDouble wgt1[]={2.000000000000000};
-	static IssmPDouble xi1[]={0.000000000000000};
-
-	/*p= 3, npoint= 2*/
-	static IssmPDouble wgt2[]={1.000000000000000, 1.000000000000000};
-	static IssmPDouble xi2[]={-0.577350269189626, 0.577350269189626};
-
-	/*p= 5, npoint= 3*/
-	static IssmPDouble wgt3[]={0.555555555555556, 0.888888888888889, 0.555555555555556};
-	static IssmPDouble xi3[]={-0.774596669241483, 0.000000000000000, 0.774596669241483};
-
-	/*p= 7, npoint= 4*/
-	static IssmPDouble wgt4[]={0.347854845137454, 0.652145154862546, 0.652145154862546, 0.347854845137454};
-	static IssmPDouble xi4[]={-0.861136311594053,-0.339981043584856, 0.339981043584856, 0.861136311594053};
-
-	/*npoint= 5*/
-	static IssmPDouble wgt5[]={0.5688888888888889,0.4786286704993665,0.4786286704993665,0.2369268850561891,0.2369268850561891};
-	static IssmPDouble xi5[]={0.0000000000000000,-0.5384693101056831,0.5384693101056831,-0.9061798459386640,0.9061798459386640};
-
-	/*npoint= 6*/
-	static IssmPDouble wgt6[]={0.3607615730481386,0.3607615730481386,0.4679139345726910,0.4679139345726910,0.1713244923791704,0.1713244923791704};
-	static IssmPDouble xi6[]={-0.6612093864662645,0.6612093864662645,-0.2386191860831969,0.2386191860831969,-0.9324695142031521,0.9324695142031521};
-
-	/*npoint= 7*/
-	static IssmPDouble wgt7[]={0.4179591836734694,0.3818300505051189,0.3818300505051189,0.2797053914892766,0.2797053914892766,0.1294849661688697,0.1294849661688697};
-	static IssmPDouble xi7[]={0.0000000000000000,-0.4058451513773972,0.4058451513773972,-0.7415311855993945,0.7415311855993945,-0.9491079123427585,0.9491079123427585};
-
-	static IssmPDouble* wgtp[MAX_LINE_GAUS_PTS]={wgt1 ,wgt2 ,wgt3 ,wgt4, wgt5, wgt6, wgt7};
-	static IssmPDouble* xip [MAX_LINE_GAUS_PTS]={xi1  ,xi2  ,xi3  ,xi4, xi5, xi6, xi7};
-
-	*pxgaus =xNew<IssmPDouble>(ngaus);
-	*pxwgt  =xNew<IssmPDouble>(ngaus);
-
-	/*  check to see if Gauss points need to be calculated  */
-	if(ngaus <= MAX_LINE_GAUS_PTS) {
-
-		/*  copy the points from the static arrays (noting that the pointers
-			 could be returned directly, but then the calling function would
-			 have to know to not free them)  */
-
-		for(i=0; i<ngaus; i++) {
+	For degree p, the required number of Gauss-Legendre points is
+	n>=(p+1)/2.
+
+=========1=========2=========3=========4=========5=========6=========7========*/
+#undef __FUNCT__
+#define __FUNCT__ "GaussLegendre"
+int GaussLegendre( double** pxgaus,
+				   double** pxwgt,
+				   int ngaus )
+{
+	int i,ierr=0;
+	double *alpha,*beta;
+
+/*  p= 1, npoint= 1  */
+
+	static double wgt1[]={
+		 2.000000000000000};
+	static double xi1[]={
+		 0.000000000000000};
+
+/*  p= 3, npoint= 2  */
+
+	static double wgt2[]={
+		 1.000000000000000, 1.000000000000000};
+	static double xi2[]={
+		-0.577350269189626, 0.577350269189626};
+
+/*  p= 5, npoint= 3  */
+
+	static double wgt3[]={
+		 0.555555555555556, 0.888888888888889, 0.555555555555556};
+	static double xi3[]={
+		-0.774596669241483, 0.000000000000000, 0.774596669241483};
+
+/*  p= 7, npoint= 4  */
+
+	static double wgt4[]={
+		 0.347854845137454, 0.652145154862546, 0.652145154862546, 
+		 0.347854845137454};
+	static double xi4[]={
+		-0.861136311594053,-0.339981043584856, 0.339981043584856, 
+		 0.861136311594053};
+
+	static double* wgtp[MAX_LINE_GAUS_PTS]={wgt1 ,wgt2 ,wgt3 ,wgt4 };
+	static double* xip [MAX_LINE_GAUS_PTS]={xi1  ,xi2  ,xi3  ,xi4  };
+
+	static int np[MAX_LINE_GAUS_PTS]={sizeof(wgt1 )/sizeof(double),
+									  sizeof(wgt2 )/sizeof(double),
+									  sizeof(wgt3 )/sizeof(double),
+									  sizeof(wgt4 )/sizeof(double)};
+
+//	_printf_("Gauss-Legendre recurrence coefficients ngaus=%d\n",ngaus);
+
+    *pxgaus = (double *) xmalloc(ngaus*sizeof(double));
+    *pxwgt  = (double *) xmalloc(ngaus*sizeof(double));
+
+/*  check to see if Gauss points need to be calculated  */
+
+	if (ngaus <= MAX_LINE_GAUS_PTS) {
+
+/*  copy the points from the static arrays (noting that the pointers
+	could be returned directly, but then the calling function would
+	have to know to not free them)  */
+
+		for (i=0; i<ngaus; i++) {
 			(*pxgaus)[i]=xip [ngaus-1][i];
 			(*pxwgt )[i]=wgtp[ngaus-1][i];
 		}
 	}
-	else{
-
-		/*  calculate the Gauss points using recurrence relations  */
-		alpha=xNew<IssmPDouble>(ngaus);
-		beta =xNew<IssmPDouble>(ngaus);
-
-		/*  calculate the Legendre recurrence coefficients  */
+
+	else {
+
+/*  calculate the Gauss points using recurrence relations  */
+
+		alpha=(double *) xmalloc(ngaus*sizeof(double));
+		beta =(double *) xmalloc(ngaus*sizeof(double));
+
+/*  calculate the Legendre recurrence coefficients  */
+
 		alpha[0]=0.;
 		beta [0]=2.;
@@ -87,1443 +122,131 @@
 		}
 
-		/*  calculate the Gauss points  */
-		GaussRecur(*pxgaus, *pxwgt, ngaus, alpha, beta );
-		xDelete<IssmPDouble>(beta);
-		xDelete<IssmPDouble>(alpha);
-	}
-}/*}}}*/
-void GaussLegendreTria( int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pwgt, int iord ) {/*{{{*/
-	/*Gauss quadrature points for the triangle.
-
-	  Higher-order points from D.A. Dunavant, "High Degree Efficient
-	  Symmetrical Gaussian Quadrature Rules for the Triangle", IJNME,
-	  Vol. 21, pp. 1129-1148 (1985), as transcribed for Probe rules3.*/
-	_assert_(iord>0);
-
-	/*Intermediaries*/
-	int i,j,ipt,nigaus;
-	IssmPDouble xi,eta;
-	IssmPDouble *xgaus=NULL,*xwgt=NULL,*egaus,*ewgt;
-
-	/*Hardcoded Gauss points declaration*/
-	/*p= 1, npoint= 1{{{*/
-	static IssmPDouble wgt1[]={
-		1.732050807568877};
-	static IssmPDouble l11[]={
-		0.333333333333333};
-	static IssmPDouble l21[]={
-		0.333333333333333};
-	static IssmPDouble l31[]={
-		0.333333333333333};
-	/*}}}*/
-	/*p= 2, npoint= 3  {{{*/
-	static IssmPDouble wgt2[]={
-		0.577350269189625, 0.577350269189625, 0.577350269189625};
-	static IssmPDouble l12[]={
-		0.666666666666667, 0.166666666666667, 0.166666666666667};
-	static IssmPDouble l22[]={
-		0.166666666666667, 0.666666666666667, 0.166666666666667};
-	static IssmPDouble l32[]={
-		0.166666666666667, 0.166666666666667, 0.666666666666667};
-	/*}}}*/
-	/*p= 3, npoint= 4  {{{*/
-	static IssmPDouble wgt3[]={
-		-0.974278579257493, 0.902109795608790, 0.902109795608790, 
-		0.902109795608790};
-	static IssmPDouble l13[]={
-		0.333333333333333, 0.600000000000000, 0.200000000000000, 
-		0.200000000000000};
-	static IssmPDouble l23[]={
-		0.333333333333333, 0.200000000000000, 0.600000000000000, 
-		0.200000000000000};
-	static IssmPDouble l33[]={
-		0.333333333333333, 0.200000000000000, 0.200000000000000, 
-		0.600000000000000};
-	/*}}}*/
-	/*p= 4, npoint= 6  {{{*/
-	static IssmPDouble wgt4[]={
-		0.386908262797819, 0.386908262797819, 0.386908262797819, 
-		0.190442006391807, 0.190442006391807, 0.190442006391807};
-	static IssmPDouble l14[]={
-		0.108103018168070, 0.445948490915965, 0.445948490915965, 
-		0.816847572980459, 0.091576213509771, 0.091576213509771};
-	static IssmPDouble l24[]={
-		0.445948490915965, 0.108103018168070, 0.445948490915965, 
-		0.091576213509771, 0.816847572980459, 0.091576213509771};
-	static IssmPDouble l34[]={
-		0.445948490915965, 0.445948490915965, 0.108103018168070, 
-		0.091576213509771, 0.091576213509771, 0.816847572980459};
-	/*}}}*/
-	/*p= 5, npoint= 7  {{{*/
-	static IssmPDouble wgt5[]={
-		0.389711431702997, 0.229313399254729, 0.229313399254729, 
-		0.229313399254729, 0.218133059367230, 0.218133059367230, 
-		0.218133059367230};
-	static IssmPDouble l15[]={
-		0.333333333333333, 0.059715871789770, 0.470142064105115, 
-		0.470142064105115, 0.797426985353087, 0.101286507323456, 
-		0.101286507323456};
-	static IssmPDouble l25[]={
-		0.333333333333333, 0.470142064105115, 0.059715871789770, 
-		0.470142064105115, 0.101286507323456, 0.797426985353087, 
-		0.101286507323456};
-	static IssmPDouble l35[]={
-		0.333333333333333, 0.470142064105115, 0.470142064105115, 
-		0.059715871789770, 0.101286507323456, 0.101286507323456, 
-		0.797426985353087};
-	/*}}}*/
-	/*p= 6, npoint=12  {{{*/
-	static IssmPDouble wgt6[]={
-		0.202279763184836, 0.202279763184836, 0.202279763184836, 
-		0.088065961139281, 0.088065961139281, 0.088065961139281, 
-		0.143502272432755, 0.143502272432755, 0.143502272432755, 
-		0.143502272432755, 0.143502272432755, 0.143502272432755};
-	static IssmPDouble l16[]={
-		0.501426509658179, 0.249286745170910, 0.249286745170910, 
-		0.873821971016996, 0.063089014491502, 0.063089014491502, 
-		0.053145049844817, 0.053145049844817, 0.310352451033784, 
-		0.636502499121399, 0.310352451033784, 0.636502499121399};
-	static IssmPDouble l26[]={
-		0.249286745170910, 0.501426509658179, 0.249286745170910, 
-		0.063089014491502, 0.873821971016996, 0.063089014491502, 
-		0.310352451033784, 0.636502499121399, 0.053145049844817, 
-		0.053145049844817, 0.636502499121399, 0.310352451033784};
-	static IssmPDouble l36[]={
-		0.249286745170910, 0.249286745170910, 0.501426509658179, 
-		0.063089014491502, 0.063089014491502, 0.873821971016996, 
-		0.636502499121399, 0.310352451033784, 0.636502499121399, 
-		0.310352451033784, 0.053145049844817, 0.053145049844817};
-	/*}}}*/
-	/*p= 7, npoint=13  {{{*/
-	static IssmPDouble wgt7[]={
-		-0.259062916308362, 0.304174548458604, 0.304174548458604, 
-		0.304174548458604, 0.092400122517855, 0.092400122517855, 
-		0.092400122517855, 0.133564951824643, 0.133564951824643, 
-		0.133564951824643, 0.133564951824643, 0.133564951824643, 
-		0.133564951824643};
-	static IssmPDouble l17[]={
-		0.333333333333333, 0.479308067841920, 0.260345966079040, 
-		0.260345966079040, 0.869739794195568, 0.065130102902216, 
-		0.065130102902216, 0.048690315425316, 0.048690315425316, 
-		0.312865496004874, 0.638444188569810, 0.312865496004874, 
-		0.638444188569810};
-	static IssmPDouble l27[]={
-		0.333333333333333, 0.260345966079040, 0.479308067841920, 
-		0.260345966079040, 0.065130102902216, 0.869739794195568, 
-		0.065130102902216, 0.312865496004874, 0.638444188569810, 
-		0.048690315425316, 0.048690315425316, 0.638444188569810, 
-		0.312865496004874};
-	static IssmPDouble l37[]={
-		0.333333333333333, 0.260345966079040, 0.260345966079040, 
-		0.479308067841920, 0.065130102902216, 0.065130102902216, 
-		0.869739794195568, 0.638444188569810, 0.312865496004874, 
-		0.638444188569810, 0.312865496004874, 0.048690315425316, 
-		0.048690315425316};
-	/*}}}*/
-	/*p= 8, npoint=16  {{{*/
-	static IssmPDouble wgt8[]={
-		0.249961964823104, 0.164703541925695, 0.164703541925695, 
-		0.164703541925695, 0.178777729989794, 0.178777729989794, 
-		0.178777729989794, 0.056219767020733, 0.056219767020733, 
-		0.056219767020733, 0.047164287656184, 0.047164287656184, 
-		0.047164287656184, 0.047164287656184, 0.047164287656184, 
-		0.047164287656184};
-	static IssmPDouble l18[]={
-		0.333333333333333, 0.081414823414554, 0.459292588292723, 
-		0.459292588292723, 0.658861384496480, 0.170569307751760, 
-		0.170569307751760, 0.898905543365938, 0.050547228317031, 
-		0.050547228317031, 0.008394777409958, 0.008394777409958, 
-		0.263112829634638, 0.728492392955404, 0.263112829634638, 
-		0.728492392955404};
-	static IssmPDouble l28[]={
-		0.333333333333333, 0.459292588292723, 0.081414823414554, 
-		0.459292588292723, 0.170569307751760, 0.658861384496480, 
-		0.170569307751760, 0.050547228317031, 0.898905543365938, 
-		0.050547228317031, 0.263112829634638, 0.728492392955404, 
-		0.008394777409958, 0.008394777409958, 0.728492392955404, 
-		0.263112829634638};
-	static IssmPDouble l38[]={
-		0.333333333333333, 0.459292588292723, 0.459292588292723, 
-		0.081414823414554, 0.170569307751760, 0.170569307751760, 
-		0.658861384496480, 0.050547228317031, 0.050547228317031, 
-		0.898905543365938, 0.728492392955404, 0.263112829634638, 
-		0.728492392955404, 0.263112829634638, 0.008394777409958, 
-		0.008394777409958};
-	/*}}}*/
-	/*p= 9, npoint=19  {{{*/
-	static IssmPDouble wgt9[]={
-		0.168244134395468, 0.054273292833345, 0.054273292833345, 
-		0.054273292833345, 0.134801255248419, 0.134801255248419, 
-		0.134801255248419, 0.137953930529909, 0.137953930529909, 
-		0.137953930529909, 0.044301833780383, 0.044301833780383, 
-		0.044301833780383, 0.074969289332873, 0.074969289332873, 
-		0.074969289332873, 0.074969289332873, 0.074969289332873, 
-		0.074969289332873};
-	static IssmPDouble l19[]={
-		0.333333333333333, 0.020634961602525, 0.489682519198738, 
-		0.489682519198738, 0.125820817014127, 0.437089591492937, 
-		0.437089591492937, 0.623592928761935, 0.188203535619033, 
-		0.188203535619033, 0.910540973211095, 0.044729513394453, 
-		0.044729513394453, 0.036838412054736, 0.036838412054736, 
-		0.221962989160766, 0.741198598784498, 0.221962989160766, 
-		0.741198598784498};
-	static IssmPDouble l29[]={
-		0.333333333333333, 0.489682519198738, 0.020634961602525, 
-		0.489682519198738, 0.437089591492937, 0.125820817014127, 
-		0.437089591492937, 0.188203535619033, 0.623592928761935, 
-		0.188203535619033, 0.044729513394453, 0.910540973211095, 
-		0.044729513394453, 0.221962989160766, 0.741198598784498, 
-		0.036838412054736, 0.036838412054736, 0.741198598784498, 
-		0.221962989160766};
-	static IssmPDouble l39[]={
-		0.333333333333333, 0.489682519198738, 0.489682519198738, 
-		0.020634961602525, 0.437089591492937, 0.437089591492937, 
-		0.125820817014127, 0.188203535619033, 0.188203535619033, 
-		0.623592928761935, 0.044729513394453, 0.044729513394453, 
-		0.910540973211095, 0.741198598784498, 0.221962989160766, 
-		0.741198598784498, 0.221962989160766, 0.036838412054736, 
-		0.036838412054736};
-	/*}}}*/
-	/*p=10, npoint=25  {{{*/
-	static IssmPDouble wgt10[]={
-		0.157301373584232, 0.063611224790829, 0.063611224790829, 
-		0.063611224790829, 0.078498377595183, 0.078498377595183, 
-		0.078498377595183, 0.126020408629139, 0.126020408629139, 
-		0.126020408629139, 0.126020408629139, 0.126020408629139, 
-		0.126020408629139, 0.049064223302117, 0.049064223302117, 
-		0.049064223302117, 0.049064223302117, 0.049064223302117, 
-		0.049064223302117, 0.016318805873179, 0.016318805873179, 
-		0.016318805873179, 0.016318805873179, 0.016318805873179, 
-		0.016318805873179};
-	static IssmPDouble l110[]={
-		0.333333333333333, 0.028844733232685, 0.485577633383657, 
-		0.485577633383657, 0.781036849029926, 0.109481575485037, 
-		0.109481575485037, 0.141707219414880, 0.141707219414880, 
-		0.307939838764121, 0.550352941820999, 0.307939838764121, 
-		0.550352941820999, 0.025003534762686, 0.025003534762686, 
-		0.246672560639903, 0.728323904597411, 0.246672560639903, 
-		0.728323904597411, 0.009540815400299, 0.009540815400299, 
-		0.066803251012200, 0.923655933587500, 0.066803251012200, 
-		0.923655933587500};
-	static IssmPDouble l210[]={
-		0.333333333333333, 0.485577633383657, 0.028844733232685, 
-		0.485577633383657, 0.109481575485037, 0.781036849029926, 
-		0.109481575485037, 0.307939838764121, 0.550352941820999, 
-		0.141707219414880, 0.141707219414880, 0.550352941820999, 
-		0.307939838764121, 0.246672560639903, 0.728323904597411, 
-		0.025003534762686, 0.025003534762686, 0.728323904597411, 
-		0.246672560639903, 0.066803251012200, 0.923655933587500, 
-		0.009540815400299, 0.009540815400299, 0.923655933587500, 
-		0.066803251012200};
-	static IssmPDouble l310[]={
-		0.333333333333333, 0.485577633383657, 0.485577633383657, 
-		0.028844733232685, 0.109481575485037, 0.109481575485037, 
-		0.781036849029926, 0.550352941820999, 0.307939838764121, 
-		0.550352941820999, 0.307939838764121, 0.141707219414880, 
-		0.141707219414880, 0.728323904597411, 0.246672560639903, 
-		0.728323904597411, 0.246672560639903, 0.025003534762686, 
-		0.025003534762686, 0.923655933587500, 0.066803251012200, 
-		0.923655933587500, 0.066803251012200, 0.009540815400299, 
-		0.009540815400299};
-	/*}}}*/
-	/*p=11, npoint=27  {{{*/
-	static IssmPDouble wgt11[]={
-		0.001605622060698, 0.001605622060698, 0.001605622060698, 
-		0.133626914252765, 0.133626914252765, 0.133626914252765, 
-		0.102750410879760, 0.102750410879760, 0.102750410879760, 
-		0.062673462600454, 0.062673462600454, 0.062673462600454, 
-		0.023659348114362, 0.023659348114362, 0.023659348114362, 
-		0.090650537039958, 0.090650537039958, 0.090650537039958, 
-		0.090650537039958, 0.090650537039958, 0.090650537039958, 
-		0.035866718600836, 0.035866718600836, 0.035866718600836, 
-		0.035866718600836, 0.035866718600836, 0.035866718600836};
-	static IssmPDouble l111[]={
-		-0.069222096541517, 0.534611048270758, 0.534611048270758, 
-		0.202061394068290, 0.398969302965855, 0.398969302965855, 
-		0.593380199137435, 0.203309900431282, 0.203309900431282, 
-		0.761298175434837, 0.119350912282581, 0.119350912282581, 
-		0.935270103777448, 0.032364948111276, 0.032364948111276, 
-		0.050178138310495, 0.050178138310495, 0.356620648261293, 
-		0.593201213428213, 0.356620648261293, 0.593201213428213, 
-		0.021022016536166, 0.021022016536166, 0.171488980304042, 
-		0.807489003159792, 0.171488980304042, 0.807489003159792};
-	static IssmPDouble l211[]={
-		0.534611048270758,-0.069222096541517, 0.534611048270758, 
-		0.398969302965855, 0.202061394068290, 0.398969302965855, 
-		0.203309900431282, 0.593380199137435, 0.203309900431282, 
-		0.119350912282581, 0.761298175434837, 0.119350912282581, 
-		0.032364948111276, 0.935270103777448, 0.032364948111276, 
-		0.356620648261293, 0.593201213428213, 0.050178138310495, 
-		0.050178138310495, 0.593201213428213, 0.356620648261293, 
-		0.171488980304042, 0.807489003159792, 0.021022016536166, 
-		0.021022016536166, 0.807489003159792, 0.171488980304042};
-	static IssmPDouble l311[]={
-		0.534611048270758, 0.534611048270758,-0.069222096541517, 
-		0.398969302965855, 0.398969302965855, 0.202061394068290, 
-		0.203309900431282, 0.203309900431282, 0.593380199137435, 
-		0.119350912282581, 0.119350912282581, 0.761298175434837, 
-		0.032364948111276, 0.032364948111276, 0.935270103777448, 
-		0.593201213428213, 0.356620648261293, 0.593201213428213, 
-		0.356620648261293, 0.050178138310495, 0.050178138310495, 
-		0.807489003159792, 0.171488980304042, 0.807489003159792, 
-		0.171488980304042, 0.021022016536166, 0.021022016536166};
-	/*}}}*/
-	/*p=12, npoint=33  {{{*/
-	static IssmPDouble wgt12[]={
-		0.044567514407799, 0.044567514407799, 0.044567514407799, 
-		0.075677707051848, 0.075677707051848, 0.075677707051848, 
-		0.108873638018933, 0.108873638018933, 0.108873638018933, 
-		0.060268635501892, 0.060268635501892, 0.060268635501892, 
-		0.010680277434033, 0.010680277434033, 0.010680277434033, 
-		0.069925589232074, 0.069925589232074, 0.069925589232074, 
-		0.069925589232074, 0.069925589232074, 0.069925589232074, 
-		0.038723067079683, 0.038723067079683, 0.038723067079683, 
-		0.038723067079683, 0.038723067079683, 0.038723067079683, 
-		0.029992592075802, 0.029992592075802, 0.029992592075802, 
-		0.029992592075802, 0.029992592075802, 0.029992592075802};
-	static IssmPDouble l112[]={
-		0.023565220452390, 0.488217389773805, 0.488217389773805, 
-		0.120551215411079, 0.439724392294460, 0.439724392294460, 
-		0.457579229975768, 0.271210385012116, 0.271210385012116, 
-		0.744847708916828, 0.127576145541586, 0.127576145541586, 
-		0.957365299093579, 0.021317350453210, 0.021317350453210, 
-		0.115343494534698, 0.115343494534698, 0.275713269685514, 
-		0.608943235779788, 0.275713269685514, 0.608943235779788, 
-		0.022838332222257, 0.022838332222257, 0.281325580989940, 
-		0.695836086787803, 0.281325580989940, 0.695836086787803, 
-		0.025734050548330, 0.025734050548330, 0.116251915907597, 
-		0.858014033544073, 0.116251915907597, 0.858014033544073};
-	static IssmPDouble l212[]={
-		0.488217389773805, 0.023565220452390, 0.488217389773805, 
-		0.439724392294460, 0.120551215411079, 0.439724392294460, 
-		0.271210385012116, 0.457579229975768, 0.271210385012116, 
-		0.127576145541586, 0.744847708916828, 0.127576145541586, 
-		0.021317350453210, 0.957365299093579, 0.021317350453210, 
-		0.275713269685514, 0.608943235779788, 0.115343494534698, 
-		0.115343494534698, 0.608943235779788, 0.275713269685514, 
-		0.281325580989940, 0.695836086787803, 0.022838332222257, 
-		0.022838332222257, 0.695836086787803, 0.281325580989940, 
-		0.116251915907597, 0.858014033544073, 0.025734050548330, 
-		0.025734050548330, 0.858014033544073, 0.116251915907597};
-	static IssmPDouble l312[]={
-		0.488217389773805, 0.488217389773805, 0.023565220452390, 
-		0.439724392294460, 0.439724392294460, 0.120551215411079, 
-		0.271210385012116, 0.271210385012116, 0.457579229975768, 
-		0.127576145541586, 0.127576145541586, 0.744847708916828, 
-		0.021317350453210, 0.021317350453210, 0.957365299093579, 
-		0.608943235779788, 0.275713269685514, 0.608943235779788, 
-		0.275713269685514, 0.115343494534698, 0.115343494534698, 
-		0.695836086787803, 0.281325580989940, 0.695836086787803, 
-		0.281325580989940, 0.022838332222257, 0.022838332222257, 
-		0.858014033544073, 0.116251915907597, 0.858014033544073, 
-		0.116251915907597, 0.025734050548330, 0.025734050548330};
-	/*}}}*/
-	/*p=13, npoint=37  {{{*/
-	static IssmPDouble wgt13[]={
-		0.090968907790622, 0.019537784619314, 0.019537784619314, 
-		0.019537784619314, 0.054427130356344, 0.054427130356344, 
-		0.054427130356344, 0.081531965976677, 0.081531965976677, 
-		0.081531965976677, 0.082036138309652, 0.082036138309652, 
-		0.082036138309652, 0.053983743853694, 0.053983743853694, 
-		0.053983743853694, 0.013814441407066, 0.013814441407066, 
-		0.013814441407066, 0.063823305703923, 0.063823305703923, 
-		0.063823305703923, 0.063823305703923, 0.063823305703923, 
-		0.063823305703923, 0.030140218568265, 0.030140218568265, 
-		0.030140218568265, 0.030140218568265, 0.030140218568265, 
-		0.030140218568265, 0.026884523429480, 0.026884523429480, 
-		0.026884523429480, 0.026884523429480, 0.026884523429480, 
-		0.026884523429480};
-	static IssmPDouble l113[]={
-		0.333333333333333, 0.009903630120591, 0.495048184939705, 
-		0.495048184939705, 0.062566729780852, 0.468716635109574, 
-		0.468716635109574, 0.170957326397447, 0.414521336801277, 
-		0.414521336801277, 0.541200855914337, 0.229399572042831, 
-		0.229399572042831, 0.771151009607340, 0.114424495196330, 
-		0.114424495196330, 0.950377217273082, 0.024811391363459, 
-		0.024811391363459, 0.094853828379579, 0.094853828379579, 
-		0.268794997058761, 0.636351174561660, 0.268794997058761, 
-		0.636351174561660, 0.018100773278807, 0.018100773278807, 
-		0.291730066734288, 0.690169159986905, 0.291730066734288, 
-		0.690169159986905, 0.022233076674090, 0.022233076674090, 
-		0.126357385491669, 0.851409537834241, 0.126357385491669, 
-		0.851409537834241};
-	static IssmPDouble l213[]={
-		0.333333333333333, 0.495048184939705, 0.009903630120591, 
-		0.495048184939705, 0.468716635109574, 0.062566729780852, 
-		0.468716635109574, 0.414521336801277, 0.170957326397447, 
-		0.414521336801277, 0.229399572042831, 0.541200855914337, 
-		0.229399572042831, 0.114424495196330, 0.771151009607340, 
-		0.114424495196330, 0.024811391363459, 0.950377217273082, 
-		0.024811391363459, 0.268794997058761, 0.636351174561660, 
-		0.094853828379579, 0.094853828379579, 0.636351174561660, 
-		0.268794997058761, 0.291730066734288, 0.690169159986905, 
-		0.018100773278807, 0.018100773278807, 0.690169159986905, 
-		0.291730066734288, 0.126357385491669, 0.851409537834241, 
-		0.022233076674090, 0.022233076674090, 0.851409537834241, 
-		0.126357385491669};
-	static IssmPDouble l313[]={
-		0.333333333333333, 0.495048184939705, 0.495048184939705, 
-		0.009903630120591, 0.468716635109574, 0.468716635109574, 
-		0.062566729780852, 0.414521336801277, 0.414521336801277, 
-		0.170957326397447, 0.229399572042831, 0.229399572042831, 
-		0.541200855914337, 0.114424495196330, 0.114424495196330, 
-		0.771151009607340, 0.024811391363459, 0.024811391363459, 
-		0.950377217273082, 0.636351174561660, 0.268794997058761, 
-		0.636351174561660, 0.268794997058761, 0.094853828379579, 
-		0.094853828379579, 0.690169159986905, 0.291730066734288, 
-		0.690169159986905, 0.291730066734288, 0.018100773278807, 
-		0.018100773278807, 0.851409537834241, 0.126357385491669, 
-		0.851409537834241, 0.126357385491669, 0.022233076674090, 
-		0.022233076674090};
-	/*}}}*/
-	/*p=14, npoint=42{{{*/
-	static IssmPDouble wgt14[]={
-		0.037903474783419, 0.037903474783419, 0.037903474783419, 
-		0.056791094234956, 0.056791094234956, 0.056791094234956, 
-		0.089675379523011, 0.089675379523011, 0.089675379523011, 
-		0.073027745871103, 0.073027745871103, 0.073027745871103, 
-		0.024999901169244, 0.024999901169244, 0.024999901169244, 
-		0.008527585185524, 0.008527585185524, 0.008527585185524, 
-		0.042722337771116, 0.042722337771116, 0.042722337771116, 
-		0.042722337771116, 0.042722337771116, 0.042722337771116, 
-		0.066807816407881, 0.066807816407881, 0.066807816407881, 
-		0.066807816407881, 0.066807816407881, 0.066807816407881, 
-		0.025004419126360, 0.025004419126360, 0.025004419126360, 
-		0.025004419126360, 0.025004419126360, 0.025004419126360, 
-		0.008677970905831, 0.008677970905831, 0.008677970905831, 
-		0.008677970905831, 0.008677970905831, 0.008677970905831};
-	static IssmPDouble l114[]={
-		0.022072179275643, 0.488963910362179, 0.488963910362179, 
-		0.164710561319092, 0.417644719340454, 0.417644719340454, 
-		0.453044943382323, 0.273477528308839, 0.273477528308839, 
-		0.645588935174913, 0.177205532412543, 0.177205532412543, 
-		0.876400233818255, 0.061799883090873, 0.061799883090873, 
-		0.961218077502598, 0.019390961248701, 0.019390961248701, 
-		0.057124757403648, 0.057124757403648, 0.172266687821356, 
-		0.770608554774996, 0.172266687821356, 0.770608554774996, 
-		0.092916249356972, 0.092916249356972, 0.336861459796345, 
-		0.570222290846683, 0.336861459796345, 0.570222290846683, 
-		0.014646950055654, 0.014646950055654, 0.298372882136258, 
-		0.686980167808088, 0.298372882136258, 0.686980167808088, 
-		0.001268330932872, 0.001268330932872, 0.118974497696957, 
-		0.879757171370171, 0.118974497696957, 0.879757171370171};
-	static IssmPDouble l214[]={
-		0.488963910362179, 0.022072179275643, 0.488963910362179, 
-		0.417644719340454, 0.164710561319092, 0.417644719340454, 
-		0.273477528308839, 0.453044943382323, 0.273477528308839, 
-		0.177205532412543, 0.645588935174913, 0.177205532412543, 
-		0.061799883090873, 0.876400233818255, 0.061799883090873, 
-		0.019390961248701, 0.961218077502598, 0.019390961248701, 
-		0.172266687821356, 0.770608554774996, 0.057124757403648, 
-		0.057124757403648, 0.770608554774996, 0.172266687821356, 
-		0.336861459796345, 0.570222290846683, 0.092916249356972, 
-		0.092916249356972, 0.570222290846683, 0.336861459796345, 
-		0.298372882136258, 0.686980167808088, 0.014646950055654, 
-		0.014646950055654, 0.686980167808088, 0.298372882136258, 
-		0.118974497696957, 0.879757171370171, 0.001268330932872, 
-		0.001268330932872, 0.879757171370171, 0.118974497696957};
-	static IssmPDouble l314[]={
-		0.488963910362179, 0.488963910362179, 0.022072179275643, 
-		0.417644719340454, 0.417644719340454, 0.164710561319092, 
-		0.273477528308839, 0.273477528308839, 0.453044943382323, 
-		0.177205532412543, 0.177205532412543, 0.645588935174913, 
-		0.061799883090873, 0.061799883090873, 0.876400233818255, 
-		0.019390961248701, 0.019390961248701, 0.961218077502598, 
-		0.770608554774996, 0.172266687821356, 0.770608554774996, 
-		0.172266687821356, 0.057124757403648, 0.057124757403648, 
-		0.570222290846683, 0.336861459796345, 0.570222290846683, 
-		0.336861459796345, 0.092916249356972, 0.092916249356972, 
-		0.686980167808088, 0.298372882136258, 0.686980167808088, 
-		0.298372882136258, 0.014646950055654, 0.014646950055654, 
-		0.879757171370171, 0.118974497696957, 0.879757171370171, 
-		0.118974497696957, 0.001268330932872, 0.001268330932872};
-	/*}}}*/
-	/*p=15, npoint=48{{{*/
-	static IssmPDouble wgt15[]={
-		0.003320126005206, 0.003320126005206, 0.003320126005206, 
-		0.076641563419124, 0.076641563419124, 0.076641563419124, 
-		0.088657703045151, 0.088657703045151, 0.088657703045151, 
-		0.041028362044303, 0.041028362044303, 0.041028362044303, 
-		0.023018566716310, 0.023018566716310, 0.023018566716310, 
-		0.008225364846296, 0.008225364846296, 0.008225364846296, 
-		0.066770684377964, 0.066770684377964, 0.066770684377964, 
-		0.066770684377964, 0.066770684377964, 0.066770684377964, 
-		0.047139173172681, 0.047139173172681, 0.047139173172681, 
-		0.047139173172681, 0.047139173172681, 0.047139173172681, 
-		0.003779468865339, 0.003779468865339, 0.003779468865339, 
-		0.003779468865339, 0.003779468865339, 0.003779468865339, 
-		0.037248306609289, 0.037248306609289, 0.037248306609289, 
-		0.037248306609289, 0.037248306609289, 0.037248306609289, 
-		0.013291658531346, 0.013291658531346, 0.013291658531346, 
-		0.013291658531346, 0.013291658531346, 0.013291658531346};
-	static IssmPDouble l115[]={
-		-0.013945833716486, 0.506972916858243, 0.506972916858243, 
-		0.137187291433955, 0.431406354283023, 0.431406354283023, 
-		0.444612710305711, 0.277693644847144, 0.277693644847144, 
-		0.747070217917492, 0.126464891041254, 0.126464891041254, 
-		0.858383228050628, 0.070808385974686, 0.070808385974686, 
-		0.962069659517853, 0.018965170241073, 0.018965170241073, 
-		0.133734161966621, 0.133734161966621, 0.261311371140087, 
-		0.604954466893291, 0.261311371140087, 0.604954466893291, 
-		0.036366677396917, 0.036366677396917, 0.388046767090269, 
-		0.575586555512814, 0.388046767090269, 0.575586555512814, 
-		-0.010174883126571,-0.010174883126571, 0.285712220049916, 
-		0.724462663076655, 0.285712220049916, 0.724462663076655, 
-		0.036843869875878, 0.036843869875878, 0.215599664072284, 
-		0.747556466051838, 0.215599664072284, 0.747556466051838, 
-		0.012459809331199, 0.012459809331199, 0.103575616576386, 
-		0.883964574092416, 0.103575616576386, 0.883964574092416};
-	static IssmPDouble l215[]={
-		0.506972916858243,-0.013945833716486, 0.506972916858243, 
-		0.431406354283023, 0.137187291433955, 0.431406354283023, 
-		0.277693644847144, 0.444612710305711, 0.277693644847144, 
-		0.126464891041254, 0.747070217917492, 0.126464891041254, 
-		0.070808385974686, 0.858383228050628, 0.070808385974686, 
-		0.018965170241073, 0.962069659517853, 0.018965170241073, 
-		0.261311371140087, 0.604954466893291, 0.133734161966621, 
-		0.133734161966621, 0.604954466893291, 0.261311371140087, 
-		0.388046767090269, 0.575586555512814, 0.036366677396917, 
-		0.036366677396917, 0.575586555512814, 0.388046767090269, 
-		0.285712220049916, 0.724462663076655,-0.010174883126571, 
-		-0.010174883126571, 0.724462663076655, 0.285712220049916, 
-		0.215599664072284, 0.747556466051838, 0.036843869875878, 
-		0.036843869875878, 0.747556466051838, 0.215599664072284, 
-		0.103575616576386, 0.883964574092416, 0.012459809331199, 
-		0.012459809331199, 0.883964574092416, 0.103575616576386};
-	static IssmPDouble l315[]={
-		0.506972916858243, 0.506972916858243,-0.013945833716486, 
-		0.431406354283023, 0.431406354283023, 0.137187291433955, 
-		0.277693644847144, 0.277693644847144, 0.444612710305711, 
-		0.126464891041254, 0.126464891041254, 0.747070217917492, 
-		0.070808385974686, 0.070808385974686, 0.858383228050628, 
-		0.018965170241073, 0.018965170241073, 0.962069659517853, 
-		0.604954466893291, 0.261311371140087, 0.604954466893291, 
-		0.261311371140087, 0.133734161966621, 0.133734161966621, 
-		0.575586555512814, 0.388046767090269, 0.575586555512814, 
-		0.388046767090269, 0.036366677396917, 0.036366677396917, 
-		0.724462663076655, 0.285712220049916, 0.724462663076655, 
-		0.285712220049916,-0.010174883126571,-0.010174883126571, 
-		0.747556466051838, 0.215599664072284, 0.747556466051838, 
-		0.215599664072284, 0.036843869875878, 0.036843869875878, 
-		0.883964574092416, 0.103575616576386, 0.883964574092416, 
-		0.103575616576386, 0.012459809331199, 0.012459809331199};
-	/*}}}*/
-	/*p=16, npoint=52  {{{*/
-	static IssmPDouble wgt16[]={
-		0.081191089584902, 0.011095307165226, 0.011095307165226, 
-		0.011095307165226, 0.072244353151393, 0.072244353151393, 
-		0.072244353151393, 0.046577417012049, 0.046577417012049, 
-		0.046577417012049, 0.072975670074230, 0.072975670074230, 
-		0.072975670074230, 0.051961986412307, 0.051961986412307, 
-		0.051961986412307, 0.024595292810646, 0.024595292810646, 
-		0.024595292810646, 0.006205006808607, 0.006205006808607, 
-		0.006205006808607, 0.056764756525753, 0.056764756525753, 
-		0.056764756525753, 0.056764756525753, 0.056764756525753, 
-		0.056764756525753, 0.026497443692048, 0.026497443692048, 
-		0.026497443692048, 0.026497443692048, 0.026497443692048, 
-		0.026497443692048, 0.004133096181263, 0.004133096181263, 
-		0.004133096181263, 0.004133096181263, 0.004133096181263, 
-		0.004133096181263, 0.033055830705140, 0.033055830705140, 
-		0.033055830705140, 0.033055830705140, 0.033055830705140, 
-		0.033055830705140, 0.011864642509229, 0.011864642509229, 
-		0.011864642509229, 0.011864642509229, 0.011864642509229, 
-		0.011864642509229};
-	static IssmPDouble l116[]={
-		0.333333333333333, 0.005238916103123, 0.497380541948438, 
-		0.497380541948438, 0.173061122901295, 0.413469438549352, 
-		0.413469438549352, 0.059082801866017, 0.470458599066991, 
-		0.470458599066991, 0.518892500060958, 0.240553749969521, 
-		0.240553749969521, 0.704068411554854, 0.147965794222573, 
-		0.147965794222573, 0.849069624685052, 0.075465187657474, 
-		0.075465187657474, 0.966807194753950, 0.016596402623025, 
-		0.016596402623025, 0.103575692245252, 0.103575692245252, 
-		0.296555596579887, 0.599868711174861, 0.296555596579887, 
-		0.599868711174861, 0.020083411655416, 0.020083411655416, 
-		0.337723063403079, 0.642193524941505, 0.337723063403079, 
-		0.642193524941505,-0.004341002614139,-0.004341002614139, 
-		0.204748281642812, 0.799592720971327, 0.204748281642812, 
-		0.799592720971327, 0.041941786468010, 0.041941786468010, 
-		0.189358492130623, 0.768699721401368, 0.189358492130623, 
-		0.768699721401368, 0.014317320230681, 0.014317320230681, 
-		0.085283615682657, 0.900399064086661, 0.085283615682657, 
-		0.900399064086661};
-	static IssmPDouble l216[]={
-		0.333333333333333, 0.497380541948438, 0.005238916103123, 
-		0.497380541948438, 0.413469438549352, 0.173061122901295, 
-		0.413469438549352, 0.470458599066991, 0.059082801866017, 
-		0.470458599066991, 0.240553749969521, 0.518892500060958, 
-		0.240553749969521, 0.147965794222573, 0.704068411554854, 
-		0.147965794222573, 0.075465187657474, 0.849069624685052, 
-		0.075465187657474, 0.016596402623025, 0.966807194753950, 
-		0.016596402623025, 0.296555596579887, 0.599868711174861, 
-		0.103575692245252, 0.103575692245252, 0.599868711174861, 
-		0.296555596579887, 0.337723063403079, 0.642193524941505, 
-		0.020083411655416, 0.020083411655416, 0.642193524941505, 
-		0.337723063403079, 0.204748281642812, 0.799592720971327, 
-		-0.004341002614139,-0.004341002614139, 0.799592720971327, 
-		0.204748281642812, 0.189358492130623, 0.768699721401368, 
-		0.041941786468010, 0.041941786468010, 0.768699721401368, 
-		0.189358492130623, 0.085283615682657, 0.900399064086661, 
-		0.014317320230681, 0.014317320230681, 0.900399064086661, 
-		0.085283615682657};
-	static IssmPDouble l316[]={
-		0.333333333333333, 0.497380541948438, 0.497380541948438, 
-		0.005238916103123, 0.413469438549352, 0.413469438549352, 
-		0.173061122901295, 0.470458599066991, 0.470458599066991, 
-		0.059082801866017, 0.240553749969521, 0.240553749969521, 
-		0.518892500060958, 0.147965794222573, 0.147965794222573, 
-		0.704068411554854, 0.075465187657474, 0.075465187657474, 
-		0.849069624685052, 0.016596402623025, 0.016596402623025, 
-		0.966807194753950, 0.599868711174861, 0.296555596579887, 
-		0.599868711174861, 0.296555596579887, 0.103575692245252, 
-		0.103575692245252, 0.642193524941505, 0.337723063403079, 
-		0.642193524941505, 0.337723063403079, 0.020083411655416, 
-		0.020083411655416, 0.799592720971327, 0.204748281642812, 
-		0.799592720971327, 0.204748281642812,-0.004341002614139, 
-		-0.004341002614139, 0.768699721401368, 0.189358492130623, 
-		0.768699721401368, 0.189358492130623, 0.041941786468010, 
-		0.041941786468010, 0.900399064086661, 0.085283615682657, 
-		0.900399064086661, 0.085283615682657, 0.014317320230681, 
-		0.014317320230681};
-	/*}}}*/
-	/*p=17, npoint=61{{{*/
-	static IssmPDouble wgt17[]={
-		0.057914928034477, 0.008822054327014, 0.008822054327014, 
-		0.008822054327014, 0.025410682752829, 0.025410682752829, 
-		0.025410682752829, 0.042176958517489, 0.042176958517489, 
-		0.042176958517489, 0.053879858604088, 0.053879858604088, 
-		0.053879858604088, 0.054138904728481, 0.054138904728481, 
-		0.054138904728481, 0.042981974139367, 0.042981974139367, 
-		0.042981974139367, 0.024345832713105, 0.024345832713105, 
-		0.024345832713105, 0.005533341446715, 0.005533341446715, 
-		0.005533341446715, 0.014063655552443, 0.014063655552443, 
-		0.014063655552443, 0.014063655552443, 0.014063655552443, 
-		0.014063655552443, 0.046428907569036, 0.046428907569036, 
-		0.046428907569036, 0.046428907569036, 0.046428907569036, 
-		0.046428907569036, 0.031973646148520, 0.031973646148520, 
-		0.031973646148520, 0.031973646148520, 0.031973646148520, 
-		0.031973646148520, 0.014682366990538, 0.014682366990538, 
-		0.014682366990538, 0.014682366990538, 0.014682366990538, 
-		0.014682366990538, 0.031684053418215, 0.031684053418215, 
-		0.031684053418215, 0.031684053418215, 0.031684053418215, 
-		0.031684053418215, 0.011545213295771, 0.011545213295771, 
-		0.011545213295771, 0.011545213295771, 0.011545213295771, 
-		0.011545213295771};
-	static IssmPDouble l117[]={
-		0.333333333333333, 0.005658918886452, 0.497170540556774, 
-		0.497170540556774, 0.035647354750751, 0.482176322624625, 
-		0.482176322624625, 0.099520061958437, 0.450239969020782, 
-		0.450239969020782, 0.199467521245206, 0.400266239377397, 
-		0.400266239377397, 0.495717464058095, 0.252141267970953, 
-		0.252141267970953, 0.675905990683077, 0.162047004658461, 
-		0.162047004658461, 0.848248235478508, 0.075875882260746, 
-		0.075875882260746, 0.968690546064356, 0.015654726967822, 
-		0.015654726967822, 0.010186928826919, 0.010186928826919, 
-		0.334319867363658, 0.655493203809423, 0.334319867363658, 
-		0.655493203809423, 0.135440871671036, 0.135440871671036, 
-		0.292221537796944, 0.572337590532020, 0.292221537796944, 
-		0.572337590532020, 0.054423924290583, 0.054423924290583, 
-		0.319574885423190, 0.626001190286228, 0.319574885423190, 
-		0.626001190286228, 0.012868560833637, 0.012868560833637, 
-		0.190704224192292, 0.796427214974071, 0.190704224192292, 
-		0.796427214974071, 0.067165782413524, 0.067165782413524, 
-		0.180483211648746, 0.752351005937729, 0.180483211648746, 
-		0.752351005937729, 0.014663182224828, 0.014663182224828, 
-		0.080711313679564, 0.904625504095608, 0.080711313679564, 
-		0.904625504095608};
-	static IssmPDouble l217[]={
-		0.333333333333333, 0.497170540556774, 0.005658918886452, 
-		0.497170540556774, 0.482176322624625, 0.035647354750751, 
-		0.482176322624625, 0.450239969020782, 0.099520061958437, 
-		0.450239969020782, 0.400266239377397, 0.199467521245206, 
-		0.400266239377397, 0.252141267970953, 0.495717464058095, 
-		0.252141267970953, 0.162047004658461, 0.675905990683077, 
-		0.162047004658461, 0.075875882260746, 0.848248235478508, 
-		0.075875882260746, 0.015654726967822, 0.968690546064356, 
-		0.015654726967822, 0.334319867363658, 0.655493203809423, 
-		0.010186928826919, 0.010186928826919, 0.655493203809423, 
-		0.334319867363658, 0.292221537796944, 0.572337590532020, 
-		0.135440871671036, 0.135440871671036, 0.572337590532020, 
-		0.292221537796944, 0.319574885423190, 0.626001190286228, 
-		0.054423924290583, 0.054423924290583, 0.626001190286228, 
-		0.319574885423190, 0.190704224192292, 0.796427214974071, 
-		0.012868560833637, 0.012868560833637, 0.796427214974071, 
-		0.190704224192292, 0.180483211648746, 0.752351005937729, 
-		0.067165782413524, 0.067165782413524, 0.752351005937729, 
-		0.180483211648746, 0.080711313679564, 0.904625504095608, 
-		0.014663182224828, 0.014663182224828, 0.904625504095608, 
-		0.080711313679564};
-	static IssmPDouble l317[]={
-		0.333333333333333, 0.497170540556774, 0.497170540556774, 
-		0.005658918886452, 0.482176322624625, 0.482176322624625, 
-		0.035647354750751, 0.450239969020782, 0.450239969020782, 
-		0.099520061958437, 0.400266239377397, 0.400266239377397, 
-		0.199467521245206, 0.252141267970953, 0.252141267970953, 
-		0.495717464058095, 0.162047004658461, 0.162047004658461, 
-		0.675905990683077, 0.075875882260746, 0.075875882260746, 
-		0.848248235478508, 0.015654726967822, 0.015654726967822, 
-		0.968690546064356, 0.655493203809423, 0.334319867363658, 
-		0.655493203809423, 0.334319867363658, 0.010186928826919, 
-		0.010186928826919, 0.572337590532020, 0.292221537796944, 
-		0.572337590532020, 0.292221537796944, 0.135440871671036, 
-		0.135440871671036, 0.626001190286228, 0.319574885423190, 
-		0.626001190286228, 0.319574885423190, 0.054423924290583, 
-		0.054423924290583, 0.796427214974071, 0.190704224192292, 
-		0.796427214974071, 0.190704224192292, 0.012868560833637, 
-		0.012868560833637, 0.752351005937729, 0.180483211648746, 
-		0.752351005937729, 0.180483211648746, 0.067165782413524, 
-		0.067165782413524, 0.904625504095608, 0.080711313679564, 
-		0.904625504095608, 0.080711313679564, 0.014663182224828, 
-		0.014663182224828};
-	/*}}}*/
-	/*p=18, npoint=70  {{{*/
-
-	static IssmPDouble wgt18[]={
-		0.053364381350150, 0.015713921277179, 0.015713921277179, 
-		0.015713921277179, 0.032495554156279, 0.032495554156279, 
-		0.032495554156279, 0.033672969465771, 0.033672969465771, 
-		0.033672969465771, 0.048071249104579, 0.048071249104579, 
-		0.048071249104579, 0.055869421169115, 0.055869421169115, 
-		0.055869421169115, 0.043429498443148, 0.043429498443148, 
-		0.043429498443148, 0.026451755176745, 0.026451755176745, 
-		0.026451755176745, 0.011767418126433, 0.011767418126433, 
-		0.011767418126433,-0.003850519950463,-0.003850519950463, 
-		-0.003850519950463, 0.010967196889496, 0.010967196889496, 
-		0.010967196889496, 0.010967196889496, 0.010967196889496, 
-		0.010967196889496, 0.047211440790349, 0.047211440790349, 
-		0.047211440790349, 0.047211440790349, 0.047211440790349, 
-		0.047211440790349, 0.030617090859378, 0.030617090859378, 
-		0.030617090859378, 0.030617090859378, 0.030617090859378, 
-		0.030617090859378, 0.031834201210069, 0.031834201210069, 
-		0.031834201210069, 0.031834201210069, 0.031834201210069, 
-		0.031834201210069, 0.014037809005559, 0.014037809005559, 
-		0.014037809005559, 0.014037809005559, 0.014037809005559, 
-		0.014037809005559, 0.013222699422034, 0.013222699422034, 
-		0.013222699422034, 0.013222699422034, 0.013222699422034, 
-		0.013222699422034, 0.000079999375178, 0.000079999375178, 
-		0.000079999375178, 0.000079999375178, 0.000079999375178, 
-		0.000079999375178};
-	static IssmPDouble l118[]={
-		0.333333333333333, 0.013310382738157, 0.493344808630921, 
-		0.493344808630921, 0.061578811516086, 0.469210594241957, 
-		0.469210594241957, 0.127437208225989, 0.436281395887006, 
-		0.436281395887006, 0.210307658653168, 0.394846170673416, 
-		0.394846170673416, 0.500410862393686, 0.249794568803157, 
-		0.249794568803157, 0.677135612512315, 0.161432193743843, 
-		0.161432193743843, 0.846803545029257, 0.076598227485371, 
-		0.076598227485371, 0.951495121293100, 0.024252439353450, 
-		0.024252439353450, 0.913707265566071, 0.043146367216965, 
-		0.043146367216965, 0.008430536202420, 0.008430536202420, 
-		0.358911494940944, 0.632657968856636, 0.358911494940944, 
-		0.632657968856636, 0.131186551737188, 0.131186551737188, 
-		0.294402476751957, 0.574410971510855, 0.294402476751957, 
-		0.574410971510855, 0.050203151565675, 0.050203151565675, 
-		0.325017801641814, 0.624779046792512, 0.325017801641814, 
-		0.624779046792512, 0.066329263810916, 0.066329263810916, 
-		0.184737559666046, 0.748933176523037, 0.184737559666046, 
-		0.748933176523037, 0.011996194566236, 0.011996194566236, 
-		0.218796800013321, 0.769207005420443, 0.218796800013321, 
-		0.769207005420443, 0.014858100590125, 0.014858100590125, 
-		0.101179597136408, 0.883962302273467, 0.101179597136408, 
-		0.883962302273467,-0.035222015287949,-0.035222015287949, 
-		0.020874755282586, 1.014347260005363, 0.020874755282586, 
-		1.014347260005363};
-	static IssmPDouble l218[]={
-		0.333333333333333, 0.493344808630921, 0.013310382738157, 
-		0.493344808630921, 0.469210594241957, 0.061578811516086, 
-		0.469210594241957, 0.436281395887006, 0.127437208225989, 
-		0.436281395887006, 0.394846170673416, 0.210307658653168, 
-		0.394846170673416, 0.249794568803157, 0.500410862393686, 
-		0.249794568803157, 0.161432193743843, 0.677135612512315, 
-		0.161432193743843, 0.076598227485371, 0.846803545029257, 
-		0.076598227485371, 0.024252439353450, 0.951495121293100, 
-		0.024252439353450, 0.043146367216965, 0.913707265566071, 
-		0.043146367216965, 0.358911494940944, 0.632657968856636, 
-		0.008430536202420, 0.008430536202420, 0.632657968856636, 
-		0.358911494940944, 0.294402476751957, 0.574410971510855, 
-		0.131186551737188, 0.131186551737188, 0.574410971510855, 
-		0.294402476751957, 0.325017801641814, 0.624779046792512, 
-		0.050203151565675, 0.050203151565675, 0.624779046792512, 
-		0.325017801641814, 0.184737559666046, 0.748933176523037, 
-		0.066329263810916, 0.066329263810916, 0.748933176523037, 
-		0.184737559666046, 0.218796800013321, 0.769207005420443, 
-		0.011996194566236, 0.011996194566236, 0.769207005420443, 
-		0.218796800013321, 0.101179597136408, 0.883962302273467, 
-		0.014858100590125, 0.014858100590125, 0.883962302273467, 
-		0.101179597136408, 0.020874755282586, 1.014347260005363, 
-		-0.035222015287949,-0.035222015287949, 1.014347260005363, 
-		0.020874755282586};
-	static IssmPDouble l318[]={
-		0.333333333333333, 0.493344808630921, 0.493344808630921, 
-		0.013310382738157, 0.469210594241957, 0.469210594241957, 
-		0.061578811516086, 0.436281395887006, 0.436281395887006, 
-		0.127437208225989, 0.394846170673416, 0.394846170673416, 
-		0.210307658653168, 0.249794568803157, 0.249794568803157, 
-		0.500410862393686, 0.161432193743843, 0.161432193743843, 
-		0.677135612512315, 0.076598227485371, 0.076598227485371, 
-		0.846803545029257, 0.024252439353450, 0.024252439353450, 
-		0.951495121293100, 0.043146367216965, 0.043146367216965, 
-		0.913707265566071, 0.632657968856636, 0.358911494940944, 
-		0.632657968856636, 0.358911494940944, 0.008430536202420, 
-		0.008430536202420, 0.574410971510855, 0.294402476751957, 
-		0.574410971510855, 0.294402476751957, 0.131186551737188, 
-		0.131186551737188, 0.624779046792512, 0.325017801641814, 
-		0.624779046792512, 0.325017801641814, 0.050203151565675, 
-		0.050203151565675, 0.748933176523037, 0.184737559666046, 
-		0.748933176523037, 0.184737559666046, 0.066329263810916, 
-		0.066329263810916, 0.769207005420443, 0.218796800013321, 
-		0.769207005420443, 0.218796800013321, 0.011996194566236, 
-		0.011996194566236, 0.883962302273467, 0.101179597136408, 
-		0.883962302273467, 0.101179597136408, 0.014858100590125, 
-		0.014858100590125, 1.014347260005363, 0.020874755282586, 
-		1.014347260005363, 0.020874755282586,-0.035222015287949, 
-		-0.035222015287949};
-	/*}}}*/
-	/*p=19, npoint=73  {{{*/
-
-	static IssmPDouble wgt19[]={
-		0.056995437856306, 0.017893352515055, 0.017893352515055, 
-		0.017893352515055, 0.038775849701151, 0.038775849701151, 
-		0.038775849701151, 0.052422467754193, 0.052422467754193, 
-		0.052422467754193, 0.052811905405354, 0.052811905405354, 
-		0.052811905405354, 0.041844983939388, 0.041844983939388, 
-		0.041844983939388, 0.027800807314648, 0.027800807314648, 
-		0.027800807314648, 0.014002903771278, 0.014002903771278, 
-		0.014002903771278, 0.003601560678933, 0.003601560678933, 
-		0.003601560678933, 0.006728804180578, 0.006728804180578, 
-		0.006728804180578, 0.006728804180578, 0.006728804180578, 
-		0.006728804180578, 0.044295745540949, 0.044295745540949, 
-		0.044295745540949, 0.044295745540949, 0.044295745540949, 
-		0.044295745540949, 0.015382176206141, 0.015382176206141, 
-		0.015382176206141, 0.015382176206141, 0.015382176206141, 
-		0.015382176206141, 0.027928534240338, 0.027928534240338, 
-		0.027928534240338, 0.027928534240338, 0.027928534240338, 
-		0.027928534240338, 0.004316169837400, 0.004316169837400, 
-		0.004316169837400, 0.004316169837400, 0.004316169837400, 
-		0.004316169837400, 0.031597525960379, 0.031597525960379, 
-		0.031597525960379, 0.031597525960379, 0.031597525960379, 
-		0.031597525960379, 0.017768353603780, 0.017768353603780, 
-		0.017768353603780, 0.017768353603780, 0.017768353603780, 
-		0.017768353603780, 0.006581669842530, 0.006581669842530, 
-		0.006581669842530, 0.006581669842530, 0.006581669842530, 
-		0.006581669842530};
-	static IssmPDouble l119[]={
-		0.333333333333333, 0.020780025853987, 0.489609987073006, 
-		0.489609987073006, 0.090926214604215, 0.454536892697893, 
-		0.454536892697893, 0.197166638701138, 0.401416680649431, 
-		0.401416680649431, 0.488896691193805, 0.255551654403098, 
-		0.255551654403098, 0.645844115695741, 0.177077942152130, 
-		0.177077942152130, 0.779877893544096, 0.110061053227952, 
-		0.110061053227952, 0.888942751496321, 0.055528624251840, 
-		0.055528624251840, 0.974756272445543, 0.012621863777229, 
-		0.012621863777229, 0.003611417848412, 0.003611417848412, 
-		0.395754787356943, 0.600633794794645, 0.395754787356943, 
-		0.600633794794645, 0.134466754530780, 0.134466754530780, 
-		0.307929983880436, 0.557603261588784, 0.307929983880436, 
-		0.557603261588784, 0.014446025776115, 0.014446025776115, 
-		0.264566948406520, 0.720987025817365, 0.264566948406520, 
-		0.720987025817365, 0.046933578838178, 0.046933578838178, 
-		0.358539352205951, 0.594527068955871, 0.358539352205951, 
-		0.594527068955871, 0.002861120350567, 0.002861120350567, 
-		0.157807405968595, 0.839331473680839, 0.157807405968595, 
-		0.839331473680839, 0.223861424097916, 0.223861424097916, 
-		0.075050596975911, 0.701087978926173, 0.075050596975911, 
-		0.701087978926173, 0.034647074816760, 0.034647074816760, 
-		0.142421601113383, 0.822931324069857, 0.142421601113383, 
-		0.822931324069857, 0.010161119296278, 0.010161119296278, 
-		0.065494628082938, 0.924344252620784, 0.065494628082938, 
-		0.924344252620784};
-	static IssmPDouble l219[]={
-		0.333333333333333, 0.489609987073006, 0.020780025853987, 
-		0.489609987073006, 0.454536892697893, 0.090926214604215, 
-		0.454536892697893, 0.401416680649431, 0.197166638701138, 
-		0.401416680649431, 0.255551654403098, 0.488896691193805, 
-		0.255551654403098, 0.177077942152130, 0.645844115695741, 
-		0.177077942152130, 0.110061053227952, 0.779877893544096, 
-		0.110061053227952, 0.055528624251840, 0.888942751496321, 
-		0.055528624251840, 0.012621863777229, 0.974756272445543, 
-		0.012621863777229, 0.395754787356943, 0.600633794794645, 
-		0.003611417848412, 0.003611417848412, 0.600633794794645, 
-		0.395754787356943, 0.307929983880436, 0.557603261588784, 
-		0.134466754530780, 0.134466754530780, 0.557603261588784, 
-		0.307929983880436, 0.264566948406520, 0.720987025817365, 
-		0.014446025776115, 0.014446025776115, 0.720987025817365, 
-		0.264566948406520, 0.358539352205951, 0.594527068955871, 
-		0.046933578838178, 0.046933578838178, 0.594527068955871, 
-		0.358539352205951, 0.157807405968595, 0.839331473680839, 
-		0.002861120350567, 0.002861120350567, 0.839331473680839, 
-		0.157807405968595, 0.075050596975911, 0.701087978926173, 
-		0.223861424097916, 0.223861424097916, 0.701087978926173, 
-		0.075050596975911, 0.142421601113383, 0.822931324069857, 
-		0.034647074816760, 0.034647074816760, 0.822931324069857, 
-		0.142421601113383, 0.065494628082938, 0.924344252620784, 
-		0.010161119296278, 0.010161119296278, 0.924344252620784, 
-		0.065494628082938};
-	static IssmPDouble l319[]={
-		0.333333333333333, 0.489609987073006, 0.489609987073006, 
-		0.020780025853987, 0.454536892697893, 0.454536892697893, 
-		0.090926214604215, 0.401416680649431, 0.401416680649431, 
-		0.197166638701138, 0.255551654403098, 0.255551654403098, 
-		0.488896691193805, 0.177077942152130, 0.177077942152130, 
-		0.645844115695741, 0.110061053227952, 0.110061053227952, 
-		0.779877893544096, 0.055528624251840, 0.055528624251840, 
-		0.888942751496321, 0.012621863777229, 0.012621863777229, 
-		0.974756272445543, 0.600633794794645, 0.395754787356943, 
-		0.600633794794645, 0.395754787356943, 0.003611417848412, 
-		0.003611417848412, 0.557603261588784, 0.307929983880436, 
-		0.557603261588784, 0.307929983880436, 0.134466754530780, 
-		0.134466754530780, 0.720987025817365, 0.264566948406520, 
-		0.720987025817365, 0.264566948406520, 0.014446025776115, 
-		0.014446025776115, 0.594527068955871, 0.358539352205951, 
-		0.594527068955871, 0.358539352205951, 0.046933578838178, 
-		0.046933578838178, 0.839331473680839, 0.157807405968595, 
-		0.839331473680839, 0.157807405968595, 0.002861120350567, 
-		0.002861120350567, 0.701087978926173, 0.075050596975911, 
-		0.701087978926173, 0.075050596975911, 0.223861424097916, 
-		0.223861424097916, 0.822931324069857, 0.142421601113383, 
-		0.822931324069857, 0.142421601113383, 0.034647074816760, 
-		0.034647074816760, 0.924344252620784, 0.065494628082938, 
-		0.924344252620784, 0.065494628082938, 0.010161119296278, 
-		0.010161119296278};
-	/*}}}*/
-	/*p=20, npoint=79 {{{*/
-	static IssmPDouble wgt20[]={
-		0.057256499746719, 0.001501721280705, 0.001501721280705, 
-		0.001501721280705, 0.020195803723819, 0.020195803723819, 
-		0.020195803723819, 0.039624016090841, 0.039624016090841, 
-		0.039624016090841, 0.052739185030045, 0.052739185030045, 
-		0.052739185030045, 0.053043868444611, 0.053043868444611, 
-		0.053043868444611, 0.042206713977986, 0.042206713977986, 
-		0.042206713977986, 0.027708365070095, 0.027708365070095, 
-		0.027708365070095, 0.013333849876622, 0.013333849876622, 
-		0.013333849876622,-0.001094760895106,-0.001094760895106, 
-		-0.001094760895106, 0.003033053580543, 0.003033053580543, 
-		0.003033053580543, 0.028519670065604, 0.028519670065604, 
-		0.028519670065604, 0.028519670065604, 0.028519670065604, 
-		0.028519670065604, 0.008381451951650, 0.008381451951650, 
-		0.008381451951650, 0.008381451951650, 0.008381451951650, 
-		0.008381451951650, 0.044695409202580, 0.044695409202580, 
-		0.044695409202580, 0.044695409202580, 0.044695409202580, 
-		0.044695409202580, 0.014672360101834, 0.014672360101834, 
-		0.014672360101834, 0.014672360101834, 0.014672360101834, 
-		0.014672360101834, 0.031791643800640, 0.031791643800640, 
-		0.031791643800640, 0.031791643800640, 0.031791643800640, 
-		0.031791643800640, 0.001220064691226, 0.001220064691226, 
-		0.001220064691226, 0.001220064691226, 0.001220064691226, 
-		0.001220064691226, 0.017515684095300, 0.017515684095300, 
-		0.017515684095300, 0.017515684095300, 0.017515684095300, 
-		0.017515684095300, 0.006190192638113, 0.006190192638113, 
-		0.006190192638113, 0.006190192638113, 0.006190192638113, 
-		0.006190192638113};
-	static IssmPDouble l120[]={
-		0.333333333333333,-0.001900928704400, 0.500950464352200, 
-		0.500950464352200, 0.023574084130543, 0.488212957934729, 
-		0.488212957934729, 0.089726636099435, 0.455136681950283, 
-		0.455136681950283, 0.196007481363421, 0.401996259318289, 
-		0.401996259318289, 0.488214180481157, 0.255892909759421, 
-		0.255892909759421, 0.647023488009788, 0.176488255995106, 
-		0.176488255995106, 0.791658289326483, 0.104170855336758, 
-		0.104170855336758, 0.893862072318140, 0.053068963840930, 
-		0.053068963840930, 0.916762569607942, 0.041618715196029, 
-		0.041618715196029, 0.976836157186356, 0.011581921406822, 
-		0.011581921406822, 0.048741583664839, 0.048741583664839, 
-		0.344855770229001, 0.606402646106160, 0.344855770229001, 
-		0.606402646106160, 0.006314115948605, 0.006314115948605, 
-		0.377843269594854, 0.615842614456541, 0.377843269594854, 
-		0.615842614456541, 0.134316520547348, 0.134316520547348, 
-		0.306635479062357, 0.559048000390295, 0.306635479062357, 
-		0.559048000390295, 0.013973893962392, 0.013973893962392, 
-		0.249419362774742, 0.736606743262866, 0.249419362774742, 
-		0.736606743262866, 0.075549132909764, 0.075549132909764, 
-		0.212775724802802, 0.711675142287434, 0.212775724802802, 
-		0.711675142287434,-0.008368153208227,-0.008368153208227, 
-		0.146965436053239, 0.861402717154987, 0.146965436053239, 
-		0.861402717154987, 0.026686063258714, 0.026686063258714, 
-		0.137726978828923, 0.835586957912363, 0.137726978828923, 
-		0.835586957912363, 0.010547719294141, 0.010547719294141, 
-		0.059696109149007, 0.929756171556853, 0.059696109149007, 
-		0.929756171556853};
-	static IssmPDouble l220[]={
-		0.333333333333333, 0.500950464352200,-0.001900928704400, 
-		0.500950464352200, 0.488212957934729, 0.023574084130543, 
-		0.488212957934729, 0.455136681950283, 0.089726636099435, 
-		0.455136681950283, 0.401996259318289, 0.196007481363421, 
-		0.401996259318289, 0.255892909759421, 0.488214180481157, 
-		0.255892909759421, 0.176488255995106, 0.647023488009788, 
-		0.176488255995106, 0.104170855336758, 0.791658289326483, 
-		0.104170855336758, 0.053068963840930, 0.893862072318140, 
-		0.053068963840930, 0.041618715196029, 0.916762569607942, 
-		0.041618715196029, 0.011581921406822, 0.976836157186356, 
-		0.011581921406822, 0.344855770229001, 0.606402646106160, 
-		0.048741583664839, 0.048741583664839, 0.606402646106160, 
-		0.344855770229001, 0.377843269594854, 0.615842614456541, 
-		0.006314115948605, 0.006314115948605, 0.615842614456541, 
-		0.377843269594854, 0.306635479062357, 0.559048000390295, 
-		0.134316520547348, 0.134316520547348, 0.559048000390295, 
-		0.306635479062357, 0.249419362774742, 0.736606743262866, 
-		0.013973893962392, 0.013973893962392, 0.736606743262866, 
-		0.249419362774742, 0.212775724802802, 0.711675142287434, 
-		0.075549132909764, 0.075549132909764, 0.711675142287434, 
-		0.212775724802802, 0.146965436053239, 0.861402717154987, 
-		-0.008368153208227,-0.008368153208227, 0.861402717154987, 
-		0.146965436053239, 0.137726978828923, 0.835586957912363, 
-		0.026686063258714, 0.026686063258714, 0.835586957912363, 
-		0.137726978828923, 0.059696109149007, 0.929756171556853, 
-		0.010547719294141, 0.010547719294141, 0.929756171556853, 
-		0.059696109149007};
-	static IssmPDouble l320[]={
-		0.333333333333333, 0.500950464352200, 0.500950464352200, 
-		-0.001900928704400, 0.488212957934729, 0.488212957934729, 
-		0.023574084130543, 0.455136681950283, 0.455136681950283, 
-		0.089726636099435, 0.401996259318289, 0.401996259318289, 
-		0.196007481363421, 0.255892909759421, 0.255892909759421, 
-		0.488214180481157, 0.176488255995106, 0.176488255995106, 
-		0.647023488009788, 0.104170855336758, 0.104170855336758, 
-		0.791658289326483, 0.053068963840930, 0.053068963840930, 
-		0.893862072318140, 0.041618715196029, 0.041618715196029, 
-		0.916762569607942, 0.011581921406822, 0.011581921406822, 
-		0.976836157186356, 0.606402646106160, 0.344855770229001, 
-		0.606402646106160, 0.344855770229001, 0.048741583664839, 
-		0.048741583664839, 0.615842614456541, 0.377843269594854, 
-		0.615842614456541, 0.377843269594854, 0.006314115948605, 
-		0.006314115948605, 0.559048000390295, 0.306635479062357, 
-		0.559048000390295, 0.306635479062357, 0.134316520547348, 
-		0.134316520547348, 0.736606743262866, 0.249419362774742, 
-		0.736606743262866, 0.249419362774742, 0.013973893962392, 
-		0.013973893962392, 0.711675142287434, 0.212775724802802, 
-		0.711675142287434, 0.212775724802802, 0.075549132909764, 
-		0.075549132909764, 0.861402717154987, 0.146965436053239, 
-		0.861402717154987, 0.146965436053239,-0.008368153208227, 
-		-0.008368153208227, 0.835586957912363, 0.137726978828923, 
-		0.835586957912363, 0.137726978828923, 0.026686063258714, 
-		0.026686063258714, 0.929756171556853, 0.059696109149007, 
-		0.929756171556853, 0.059696109149007, 0.010547719294141, 
-		0.010547719294141};
-	/*}}}*/
-
-	static IssmPDouble* wgtp[MAX_TRIA_SYM_ORD]={
-		wgt1 ,wgt2 ,wgt3 ,wgt4 ,wgt5 ,
-		wgt6 ,wgt7 ,wgt8 ,wgt9 ,wgt10,
-		wgt11,wgt12,wgt13,wgt14,wgt15,
-		wgt16,wgt17,wgt18,wgt19,wgt20};
-	static IssmPDouble* l1p [MAX_TRIA_SYM_ORD]={
-		l11  ,l12  ,l13  ,l14  ,l15  ,
-		l16  ,l17  ,l18  ,l19  ,l110 ,
-		l111 ,l112 ,l113 ,l114 ,l115 ,
-		l116 ,l117 ,l118 ,l119 ,l120 };
-	static IssmPDouble* l2p [MAX_TRIA_SYM_ORD]={
-		l21  ,l22  ,l23  ,l24  ,l25  ,
-		l26  ,l27  ,l28  ,l29  ,l210 ,
-		l211 ,l212 ,l213 ,l214 ,l215 ,
-		l216 ,l217 ,l218 ,l219 ,l220 };
-	static IssmPDouble* l3p [MAX_TRIA_SYM_ORD]={
-		l31  ,l32  ,l33  ,l34  ,l35  ,
-		l36  ,l37  ,l38  ,l39  ,l310 ,
-		l311 ,l312 ,l313 ,l314 ,l315 ,
-		l316 ,l317 ,l318 ,l319 ,l320 };
-
-	static int np[MAX_TRIA_SYM_ORD]={sizeof(wgt1 )/sizeof(IssmPDouble),
-		sizeof(wgt2 )/sizeof(IssmPDouble),
-		sizeof(wgt3 )/sizeof(IssmPDouble),
-		sizeof(wgt4 )/sizeof(IssmPDouble),
-		sizeof(wgt5 )/sizeof(IssmPDouble),
-		sizeof(wgt6 )/sizeof(IssmPDouble),
-		sizeof(wgt7 )/sizeof(IssmPDouble),
-		sizeof(wgt8 )/sizeof(IssmPDouble),
-		sizeof(wgt9 )/sizeof(IssmPDouble),
-		sizeof(wgt10)/sizeof(IssmPDouble),
-		sizeof(wgt11)/sizeof(IssmPDouble),
-		sizeof(wgt12)/sizeof(IssmPDouble),
-		sizeof(wgt13)/sizeof(IssmPDouble),
-		sizeof(wgt14)/sizeof(IssmPDouble),
-		sizeof(wgt15)/sizeof(IssmPDouble),
-		sizeof(wgt16)/sizeof(IssmPDouble),
-		sizeof(wgt17)/sizeof(IssmPDouble),
-		sizeof(wgt18)/sizeof(IssmPDouble),
-		sizeof(wgt19)/sizeof(IssmPDouble),
-		sizeof(wgt20)/sizeof(IssmPDouble)};
-
-	//	_printf0_("GaussLegendreTria: iord=" << iord << "\n");
-
-	/*  check to see if Gauss points need to be calculated  */
-	if (iord <= MAX_TRIA_SYM_ORD) {
-
-		/*  copy the points from the static arrays (noting that the pointers
-			 could be returned directly, but then the calling function would
-			 have to know to not free them)  */
-
-		*pngaus=np[iord-1];
-
-		*pl1  =xNew<IssmDouble>(*pngaus);
-		*pl2  =xNew<IssmDouble>(*pngaus);
-		*pl3  =xNew<IssmDouble>(*pngaus);
-		*pwgt =xNew<IssmDouble>(*pngaus);
-
-		for (i=0; i<*pngaus; i++) {
-			(*pl1 )[i]=l1p [iord-1][i];
-			(*pl2 )[i]=l2p [iord-1][i];
-			(*pl3 )[i]=l3p [iord-1][i];
-			(*pwgt)[i]=wgtp[iord-1][i];
-		}
-	}
-	else {
-
-		/*  calculate the Gauss points from the collapsed quadrilateral  */
-		nigaus =iord/2+1;
-		*pngaus=nigaus*nigaus;
-
-		*pl1  =xNew<IssmDouble>(*pngaus);
-		*pl2  =xNew<IssmDouble>(*pngaus);
-		*pl3  =xNew<IssmDouble>(*pngaus);
-		*pwgt =xNew<IssmDouble>(*pngaus);
-
-		/*  get the gauss points in each direction  */
-		GaussLegendreLinear(&xgaus, &xwgt, nigaus);
-
-		egaus=xgaus;
-		ewgt =xwgt;
-
-		/*  collapse the gauss points into the triangle and transform into
-			 area coordinates  */
-		ipt=0;
-		for (j=0; j<nigaus; j++) {
-			for (i=0; i<nigaus; i++) {
-				xi        =      1./2.*(1.-egaus[j])*xgaus[i];
-				eta       =SQRT3/2.*(1.+egaus[j]);
-				(*pwgt)[ipt]=xwgt[i]*ewgt[j]*(SQRT3/4.*(1.-egaus[j]));
-
-				(*pl1 )[ipt]=(1.-xi-eta/SQRT3)/2.;
-				(*pl2 )[ipt]=(1.+xi-eta/SQRT3)/2.;
-				(*pl3 )[ipt]=       eta/SQRT3;
-
-				ipt++;
-			}
-		}
-		xDelete<IssmPDouble>(xwgt );
-		xDelete<IssmPDouble>(xgaus);
-	}
-
-	//	_printf0_("GaussLegendreTria - ngaus=" << *pngaus << "\n");
-	//	for (i=0; i<*pngaus; i++)
-	//		_printf0_("i=" << i << ": l1gaus=" << (*pl1 )[i] << ",l2gaus=" << (*pl2 )[i] << ",l3gaus=" << (*pl3 )[i]<< ",wgt=" << (*pwgt)[i]<< "\n\n");
-
-	return;
-}/*}}}*/
-void GaussLegendreTetra( int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pl4, IssmDouble** pwgt, int iord ) {/*{{{*/
-	/* Gauss quadrature points for the tetrahedron.
-
-		p=2-3 points from Y. Jinyun, "Symmetric Gaussian Quadrature
-		Formulae for Tetrahedronal Regions", Computer Methods in Applied
-		Mechanics and Engineering, Vol. 43, pp. 349-353 (1984).
-
-		p=4-6 points from P. Keast, "Moderate-Degree Tetrahedral
-		Quadrature Formulas", Computer Methods in Applied Mechanics and
-		Engineering, Vol. 55, pp. 339-348 (1986).*/
-	_assert_(iord>0);
-
-	/*Intermediaries*/
-	int i,j,k,ipt,nigaus;
-	IssmPDouble xi,eta,zeta;
-	IssmPDouble *xgaus=NULL,*xwgt=NULL,*egaus,*ewgt,*zgaus,*zwgt;
-
-	/*Hardcoded Gauss points definition*/
-	/*p= 1, npoint= 1  {{{*/
-	static IssmPDouble wgt1[]={
-		1.000000000000000};
-	static IssmPDouble l11[]={
-		0.250000000000000};
-	static IssmPDouble l21[]={
-		0.250000000000000};
-	static IssmPDouble l31[]={
-		0.250000000000000};
-	static IssmPDouble l41[]={
-		0.250000000000000};
-	/*}}}*/
-	/*p= 2, npoint= 4  {{{*/
-
-	static IssmPDouble wgt2[]={
-		0.250000000000000, 0.250000000000000, 0.250000000000000,
-		0.250000000000000};
-	static IssmPDouble l12[]={
-		0.585410196624969, 0.138196601125011, 0.138196601125011,
-		0.138196601125011};
-	static IssmPDouble l22[]={
-		0.138196601125011, 0.585410196624969, 0.138196601125011,
-		0.138196601125011};
-	static IssmPDouble l32[]={
-		0.138196601125011, 0.138196601125011, 0.585410196624969,
-		0.138196601125011};
-	static IssmPDouble l42[]={
-		0.138196601125011, 0.138196601125011, 0.138196601125011,
-		0.585410196624969};
-	/*}}}*/
-	/*p= 3, npoint= 5  {{{*/
-	static IssmPDouble wgt3[]={
-		-0.800000000000000, 0.450000000000000, 0.450000000000000, 
-		0.450000000000000, 0.450000000000000};
-	static IssmPDouble l13[]={
-		0.250000000000000, 0.500000000000000, 0.166666666666667, 
-		0.166666666666667, 0.166666666666667};
-	static IssmPDouble l23[]={
-		0.250000000000000, 0.166666666666667, 0.500000000000000, 
-		0.166666666666667, 0.166666666666667};
-	static IssmPDouble l33[]={
-		0.250000000000000, 0.166666666666667, 0.166666666666667, 
-		0.500000000000000, 0.166666666666667};
-	static IssmPDouble l43[]={
-		0.250000000000000, 0.166666666666667, 0.166666666666667, 
-		0.166666666666667, 0.500000000000000};
-	/*}}}*/
-	/*p= 4, npoint=11  {{{*/
-
-	static IssmPDouble wgt4[]={
-		-0.013155555555556, 0.007622222222222, 0.007622222222222, 
-		0.007622222222222, 0.007622222222222, 0.024888888888889,
-		0.024888888888889, 0.024888888888889, 0.024888888888889, 
-		0.024888888888889, 0.024888888888889};
-	static IssmPDouble l14[]={
-		0.250000000000000, 0.785714285714286, 0.071428571428571, 
-		0.071428571428571, 0.071428571428571, 0.399403576166799,
-		0.399403576166799, 0.399403576166799, 0.100596423833201, 
-		0.100596423833201, 0.100596423833201};
-	static IssmPDouble l24[]={
-		0.250000000000000, 0.071428571428571, 0.785714285714286, 
-		0.071428571428571, 0.071428571428571, 0.399403576166799,
-		0.100596423833201, 0.100596423833201, 0.399403576166799, 
-		0.399403576166799, 0.100596423833201};
-	static IssmPDouble l34[]={
-		0.250000000000000, 0.071428571428571, 0.071428571428571, 
-		0.785714285714286, 0.071428571428571, 0.100596423833201, 
-		0.399403576166799, 0.100596423833201, 0.399403576166799,
-		0.100596423833201, 0.399403576166799};
-	static IssmPDouble l44[]={
-		0.250000000000000, 0.071428571428571, 0.071428571428571, 
-		0.071428571428571, 0.785714285714286, 0.100596423833201, 
-		0.100596423833201, 0.399403576166799, 0.100596423833201,
-		0.399403576166799, 0.399403576166799};
-	/*}}}*/
-	/*p= 5, npoint=15  {{{*/
-
-	static IssmPDouble wgt5[]={
-		0.030283678097089, 0.006026785714286, 0.006026785714286, 
-		0.006026785714286, 0.006026785714286, 0.011645249086029, 
-		0.011645249086029, 0.011645249086029, 0.011645249086029,
-		0.010949141561386, 0.010949141561386, 0.010949141561386,
-		0.010949141561386, 0.010949141561386, 0.010949141561386};
-	static IssmPDouble l15[]={
-		0.250000000000000, 0.000000000000000, 0.333333333333333, 
-		0.333333333333333, 0.333333333333333, 0.727272727272727, 
-		0.090909090909091, 0.090909090909091, 0.090909090909091, 
-		0.066550153573664, 0.066550153573664, 0.066550153573664, 
-		0.433449846426336, 0.433449846426336, 0.433449846426336};
-	static IssmPDouble l25[]={
-		0.250000000000000, 0.333333333333333, 0.000000000000000, 
-		0.333333333333333, 0.333333333333333, 0.090909090909091, 
-		0.727272727272727, 0.090909090909091, 0.090909090909091, 
-		0.066550153573664, 0.433449846426336, 0.433449846426336, 
-		0.066550153573664, 0.066550153573664, 0.433449846426336};
-	static IssmPDouble l35[]={
-		0.250000000000000, 0.333333333333333, 0.333333333333333, 
-		0.000000000000000, 0.333333333333333, 0.090909090909091, 
-		0.090909090909091, 0.727272727272727, 0.090909090909091, 
-		0.433449846426336, 0.066550153573664, 0.433449846426336, 
-		0.066550153573664, 0.433449846426336, 0.066550153573664};
-	static IssmPDouble l45[]={
-		0.250000000000000, 0.333333333333333, 0.333333333333333, 
-		0.333333333333333, 0.000000000000000, 0.090909090909091, 
-		0.090909090909091, 0.090909090909091, 0.727272727272727, 
-		0.433449846426336, 0.433449846426336, 0.066550153573664, 
-		0.433449846426336, 0.066550153573664, 0.066550153573664};
-	/*}}}*/
-	/*p= 6, npoint=24  {{{*/
-
-	static IssmPDouble wgt6[]={
-		0.006653791709695, 0.006653791709695, 0.006653791709695, 
-		0.006653791709695, 0.001679535175887, 0.001679535175887, 
-		0.001679535175887, 0.001679535175887, 0.009226196923942, 
-		0.009226196923942, 0.009226196923942, 0.009226196923942,
-		0.008035714285714, 0.008035714285714, 0.008035714285714, 
-		0.008035714285714, 0.008035714285714, 0.008035714285714, 
-		0.008035714285714, 0.008035714285714, 0.008035714285714, 
-		0.008035714285714, 0.008035714285714, 0.008035714285714};
-	static IssmPDouble l16[]={
-		0.356191386222545, 0.214602871259152, 0.214602871259152, 
-		0.214602871259152, 0.877978124396166, 0.040673958534611, 
-		0.040673958534611, 0.040673958534611, 0.032986329573173, 
-		0.322337890142276, 0.322337890142276, 0.322337890142276,
-
-		0.063661001875018, 0.063661001875018, 0.063661001875018, 
-		0.063661001875018, 0.063661001875018, 0.063661001875018, 
-		0.269672331458316, 0.603005664791649, 0.269672331458316, 
-		0.603005664791649, 0.269672331458316, 0.603005664791649};
-	static IssmPDouble l26[]={
-		0.214602871259152, 0.356191386222545, 0.214602871259152, 
-		0.214602871259152, 0.040673958534611, 0.877978124396166, 
-		0.040673958534611, 0.040673958534611, 0.322337890142276, 
-		0.032986329573173, 0.322337890142276, 0.322337890142276,
-
-		0.063661001875018, 0.063661001875018, 0.269672331458316, 
-		0.603005664791649, 0.269672331458316, 0.603005664791649, 
-		0.063661001875018, 0.063661001875018, 0.063661001875018, 
-		0.063661001875018, 0.603005664791649, 0.269672331458316};
-	static IssmPDouble l36[]={
-		0.214602871259152, 0.214602871259152, 0.356191386222545, 
-		0.214602871259152, 0.040673958534611, 0.040673958534611, 
-		0.877978124396166, 0.040673958534611, 0.322337890142276, 
-		0.322337890142276, 0.032986329573173, 0.322337890142276,
-
-		0.269672331458316, 0.603005664791649, 0.063661001875018, 
-		0.063661001875018, 0.603005664791649, 0.269672331458316, 
-		0.063661001875018, 0.063661001875018, 0.603005664791649, 
-		0.269672331458316, 0.063661001875018, 0.063661001875018};
-	static IssmPDouble l46[]={
-		0.214602871259152, 0.214602871259152, 0.214602871259152, 
-		0.356191386222545, 0.040673958534611, 0.040673958534611, 
-		0.040673958534611, 0.877978124396166, 0.322337890142276, 
-		0.322337890142276, 0.322337890142276, 0.032986329573173,
-
-		0.603005664791649, 0.269672331458316, 0.603005664791649, 
-		0.269672331458316, 0.063661001875018, 0.063661001875018, 
-		0.603005664791649, 0.269672331458316, 0.063661001875018, 
-		0.063661001875018, 0.063661001875018, 0.063661001875018};
-	/*}}}*/
-
-	static IssmPDouble* wgtp[MAX_TETRA_SYM_ORD]={wgt1,wgt2,wgt3,wgt4,wgt5,wgt6};
-	static IssmPDouble* l1p [MAX_TETRA_SYM_ORD]={l11 ,l12 ,l13 ,l14 ,l15 ,l16 };
-	static IssmPDouble* l2p [MAX_TETRA_SYM_ORD]={l21 ,l22 ,l23 ,l24 ,l25 ,l26 };
-	static IssmPDouble* l3p [MAX_TETRA_SYM_ORD]={l31 ,l32 ,l33 ,l34 ,l35 ,l36 };
-	static IssmPDouble* l4p [MAX_TETRA_SYM_ORD]={l41 ,l42 ,l43 ,l44 ,l45 ,l46 };
-
-	static int np[MAX_TETRA_SYM_ORD]={sizeof(wgt1 )/sizeof(IssmPDouble),
-		sizeof(wgt2 )/sizeof(IssmPDouble),
-		sizeof(wgt3 )/sizeof(IssmPDouble),
-		sizeof(wgt4 )/sizeof(IssmPDouble),
-		sizeof(wgt5 )/sizeof(IssmPDouble),
-		sizeof(wgt6 )/sizeof(IssmPDouble)};
-
-	//	_printf0_("GaussLegendreTetra: iord=" << iord << "\n");
-
-	/*  check to see if Gauss points need to be calculated  */
-	if (iord <= MAX_TETRA_SYM_ORD) {
-
-		/*  copy the points from the static arrays (noting that the pointers
-			 could be returned directly, but then the calling function would
-			 have to know to not free them), and multiply the weights by the
-			 volume of the parametric tetrahedron  */
-
-		*pngaus=np[iord-1];
-
-		*pl1  =xNew<IssmDouble>(*pngaus);
-		*pl2  =xNew<IssmDouble>(*pngaus);
-		*pl3  =xNew<IssmDouble>(*pngaus);
-		*pl4  =xNew<IssmDouble>(*pngaus);
-		*pwgt =xNew<IssmDouble>(*pngaus);
-
-		for (i=0; i<*pngaus; i++) {
-			(*pl1 )[i]=l1p [iord-1][i];
-			(*pl2 )[i]=l2p [iord-1][i];
-			(*pl3 )[i]=l3p [iord-1][i];
-			(*pl4 )[i]=l4p [iord-1][i];
-			(*pwgt)[i]=wgtp[iord-1][i];
-		}
-	}
-	else {
-
-		/*  calculate the Gauss points from the collapsed hexahedron  */
-		nigaus =iord/2+1;
-		*pngaus=nigaus*nigaus*nigaus;
-
-		*pl1  =xNew<IssmDouble>(*pngaus);
-		*pl2  =xNew<IssmDouble>(*pngaus);
-		*pl3  =xNew<IssmDouble>(*pngaus);
-		*pl4  =xNew<IssmDouble>(*pngaus);
-		*pwgt =xNew<IssmDouble>(*pngaus);
-
-		/*  get the gauss points in each direction  */
-		GaussLegendreLinear(&xgaus, &xwgt, nigaus);
-
-		egaus=xgaus;
-		ewgt =xwgt;
-		zgaus=xgaus;
-		zwgt =xwgt;
-
-		/*  collapse the gauss points into the tetrahedron and transform into
-			 volume coordinates  */
-		ipt=0;
-		for (k=0; k<nigaus; k++) {
-			for (j=0; j<nigaus; j++) {
-				for (i=0; i<nigaus; i++) {
-					xi        =1./4.*(1.-egaus[j])*(1.-zgaus[k])*xgaus[i];
-					eta       =1./4./SQRT3
-					  *(5.+3.*egaus[j]-zgaus[k]-3.*egaus[j]*zgaus[k]);
-					zeta      =sqrt(2./3.)*(1.+zgaus[k]);
-					(*pwgt)[ipt]=xwgt[i]*ewgt[j]*zwgt[k]*(SQRT2/16.*(1.-egaus[j])*pow(1.-zgaus[k],2));
-
-					(*pl1 )[ipt]=(1.-xi-eta/SQRT3-zeta/sqrt(6.))/2.;
-					(*pl2 )[ipt]=(1.+xi-eta/SQRT3-zeta/sqrt(6.))/2.;
-					(*pl3 )[ipt]=(      eta         -zeta/sqrt(8.))/SQRT3;
-					(*pl4 )[ipt]=(                   zeta/sqrt(8.))*SQRT3;
-
-					ipt++;
-				}
-			}
-		}
-		xDelete<IssmPDouble>(xwgt );
-		xDelete<IssmPDouble>(xgaus);
-	}
-}/*}}}*/
-void GaussLobatto( IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus ) {/*{{{*/
-	/*Gauss-Lobatto quadrature points.
-
-	  The recurrence coefficients for Legendre polynomials on (-1,1)
-	  are defined (from the ORTHPOL subroutine RECUR with ipoly=1) as:
-
-	  alpha(i)=0.
-	  beta (i)=1./(4.-1./(i-1)^2))
-
-	  and then modified for the Gauss-Lobatto quadrature rule on (-1,1)
-	  (from the ORTHPOL subroutine LOB).
-
-	  For degree p, the required number of Gauss-Lobatto points is
-	  n>=(p+1)/2+1 (one more than Gauss-Legendre).*/
-	_assert_(ngaus>0);
-
-	int i;
-	IssmPDouble *alpha,*beta;
-	IssmPDouble left=-1.,right= 1.;
-	IssmPDouble p0l=0.,p0r=0.,p1l=1.,p1r=1.,pm1l,pm1r,det;
-
-	/*p= 1, npoint= 1 (Gauss-Legendre)*/
-	static IssmPDouble wgt1[]={2.000000000000000};
-	static IssmPDouble xi1[]={0.000000000000000};
-
-	/*p= 1, npoint= 2*/
-	static IssmPDouble wgt2[]={1.000000000000000, 1.000000000000000};
-	static IssmPDouble xi2[]={-1.000000000000000, 1.000000000000000};
-
-	/*p= 3, npoint= 3*/
-	static IssmPDouble wgt3[]={0.333333333333333, 1.333333333333333, 0.333333333333333};
-	static IssmPDouble xi3[]={-1.000000000000000, 0.000000000000000, 1.000000000000000};
-
-	/*p= 5, npoint= 4*/
-	static IssmPDouble wgt4[]={0.166666666666667, 0.833333333333333, 0.833333333333333, 0.166666666666667};
-	static IssmPDouble xi4[]={-1.000000000000000,-0.447213595499958, 0.447213595499958, 1.000000000000000};
-
-	/*p= 7, npoint= 5*/
-	static IssmPDouble wgt5[]={0.100000000000000, 0.544444444444444, 0.711111111111111, 0.544444444444444, 0.100000000000000};
-	static IssmPDouble xi5[]={-1.000000000000000,-0.654653670707977, 0.000000000000000, 0.654653670707977, 1.000000000000000};
-
-	static IssmPDouble* wgtp[MAX_LINE_GLOB_PTS]={wgt1 ,wgt2 ,wgt3 ,wgt4 ,wgt5 };
-	static IssmPDouble* xip [MAX_LINE_GLOB_PTS]={xi1  ,xi2  ,xi3  ,xi4  ,xi5  };
-
-	*pxgaus =xNew<IssmPDouble>(ngaus);
-	*pxwgt  =xNew<IssmPDouble>(ngaus);
-
-	/*  check to see if Gauss points need to be calculated  */
+/*  calculate the Gauss points  */
+
+		if ((ierr=GaussRecur(*pxgaus,
+							 *pxwgt,
+							 ngaus,
+							 alpha,
+							 beta )))
+			_printf_("%s -- Error %d from GaussRecur for ngaus=%d.\n",
+					 __FUNCT__,ierr,ngaus);
+
+		xfree((void **)&beta );
+		xfree((void **)&alpha);
+	}
+
+//	for (i=0; i<ngaus; i++)
+//		_printf_("i=%d: xgaus=%f,xwgt=%f\n",i,(*pxgaus)[i],(*pxwgt)[i]);
+
+	return(ierr);
+}
+
+
+/*=======1=========2=========3=========4=========5=========6=========7=========8
+
+	GaussLobatto.c    Gauss-Lobatto quadrature points.
+
+	03/06/03    jes    Initial development.
+	04/11/03    jes    Combination of leggauss, lobgauss, and legrecur.
+	04/11/05    jes    Addition of hard-coded values for lower degrees.
+	04/25/05    jes    Addition of allocation.
+
+	Input:
+		int      ngaus     number of Gauss points
+
+	Output:
+		double** pxgaus    abscissas of Gauss points
+							   (allocated below)
+		double** pxwgt     weights of Gauss points
+							   (allocated below)
+		int                function return value
+
+	The recurrence coefficients for Legendre polynomials on (-1,1)
+	are defined (from the ORTHPOL subroutine RECUR with ipoly=1) as:
+
+		alpha(i)=0.
+		beta (i)=1./(4.-1./(i-1)^2))
+
+	and then modified for the Gauss-Lobatto quadrature rule on (-1,1)
+	(from the ORTHPOL subroutine LOB).
+
+	For degree p, the required number of Gauss-Lobatto points is
+	n>=(p+1)/2+1 (one more than Gauss-Legendre).
+
+=========1=========2=========3=========4=========5=========6=========7========*/
+
+#undef __FUNCT__
+#define __FUNCT__ "GaussLobatto"
+
+int GaussLobatto( double** pxgaus,
+				  double** pxwgt,
+				  int ngaus )
+{
+	int i,ierr=0;
+	double *alpha,*beta;
+	double left=-1.,right= 1.;
+	double p0l=0.,p0r=0.,p1l=1.,p1r=1.,pm1l,pm1r,det;
+
+/*  p= 1, npoint= 1 (Gauss-Legendre)  */
+
+	static double wgt1[]={
+		 2.000000000000000};
+	static double xi1[]={
+		 0.000000000000000};
+
+/*  p= 1, npoint= 2  */
+
+	static double wgt2[]={
+		 1.000000000000000, 1.000000000000000};
+	static double xi2[]={
+		-1.000000000000000, 1.000000000000000};
+
+/*  p= 3, npoint= 3  */
+
+	static double wgt3[]={
+		 0.333333333333333, 1.333333333333333, 0.333333333333333};
+	static double xi3[]={
+		-1.000000000000000, 0.000000000000000, 1.000000000000000};
+
+/*  p= 5, npoint= 4  */
+
+	static double wgt4[]={
+		 0.166666666666667, 0.833333333333333, 0.833333333333333, 
+		 0.166666666666667};
+	static double xi4[]={
+		-1.000000000000000,-0.447213595499958, 0.447213595499958, 
+		 1.000000000000000};
+
+/*  p= 7, npoint= 5  */
+
+	static double wgt5[]={
+		 0.100000000000000, 0.544444444444444, 0.711111111111111, 
+		 0.544444444444444, 0.100000000000000};
+	static double xi5[]={
+		-1.000000000000000,-0.654653670707977, 0.000000000000000, 
+		 0.654653670707977, 1.000000000000000};
+
+	static double* wgtp[MAX_LINE_GLOB_PTS]={wgt1 ,wgt2 ,wgt3 ,wgt4 ,wgt5 };
+	static double* xip [MAX_LINE_GLOB_PTS]={xi1  ,xi2  ,xi3  ,xi4  ,xi5  };
+
+	static int np[MAX_LINE_GLOB_PTS]={sizeof(wgt1 )/sizeof(double),
+									  sizeof(wgt2 )/sizeof(double),
+									  sizeof(wgt3 )/sizeof(double),
+									  sizeof(wgt4 )/sizeof(double),
+									  sizeof(wgt5 )/sizeof(double)};
+
+//	_printf_("Gauss-Lobatto recurrence coefficients ngaus=%d\n",ngaus);
+
+    *pxgaus = (double *) xmalloc(ngaus*sizeof(double));
+    *pxwgt  = (double *) xmalloc(ngaus*sizeof(double));
+
+/*  check to see if Gauss points need to be calculated  */
+
 	if (ngaus <= MAX_LINE_GLOB_PTS) {
 
-		/*  copy the points from the static arrays (noting that the pointers
-			 could be returned directly, but then the calling function would
-			 have to know to not free them)  */
+/*  copy the points from the static arrays (noting that the pointers
+	could be returned directly, but then the calling function would
+	have to know to not free them)  */
+
 		for (i=0; i<ngaus; i++) {
 			(*pxgaus)[i]=xip [ngaus-1][i];
@@ -1531,11 +254,14 @@
 		}
 	}
+
 	else {
 
-		/*  calculate the Gauss points using recurrence relations  */
-		alpha=xNew<IssmPDouble>(ngaus);
-		beta =xNew<IssmPDouble>(ngaus);
-
-		/*  calculate the Legendre recurrence coefficients  */
+/*  calculate the Gauss points using recurrence relations  */
+
+		alpha=(double *) xmalloc(ngaus*sizeof(double));
+		beta =(double *) xmalloc(ngaus*sizeof(double));
+
+/*  calculate the Legendre recurrence coefficients  */
+
 		alpha[0]=0.;
 		beta [0]=2.;
@@ -1546,5 +272,6 @@
 		}
 
-		/*  calculate the Gauss-Lobatto quadrature formula  */
+/*  calculate the Gauss-Lobatto quadrature formula  */
+
 		for (i=0; i<ngaus-1; i++) {
 			pm1l=p0l;
@@ -1556,46 +283,84 @@
 		}
 
-		/*  Normalize system to prevent underflow:
-			 [ p1l p0l ]{ a } = {left *p1l}
-			 [ p1r p0r ]{ b }   {right*p1r}
-			 dividing by p1l in the first equation and p1r in the second.  */
-
-		//		det=p1l*p0r-p1r*p0l;
+/*  Normalize system to prevent underflow:
+		[ p1l p0l ]{ a } = {left *p1l}
+		[ p1r p0r ]{ b }   {right*p1r}
+	dividing by p1l in the first equation and p1r in the second.  */
+
+//		det=p1l*p0r-p1r*p0l;
 		det=p0r/p1r-p0l/p1l;
-		//		alpha[ngaus-1]=(left*p1l*p0r-right*p1r*p0l)/det;
-		//		beta [ngaus-1]=(right-left)*p1l*p1r/det;
+//		alpha[ngaus-1]=(left*p1l*p0r-right*p1r*p0l)/det;
+//		beta [ngaus-1]=(right-left)*p1l*p1r/det;
 		alpha[ngaus-1]=(left *(p0r/p1r)-right*(p0l/p1l))/det;
 		beta [ngaus-1]=(right          -left           )/det;
 
-		/*  calculate the Gauss points  */
-		GaussRecur(*pxgaus, *pxwgt, ngaus, alpha, beta );
-		xDelete<IssmPDouble>(beta );
-		xDelete<IssmPDouble>(alpha);
-	}
-
-}/*}}}*/
-void GaussRecur( IssmPDouble* zero, IssmPDouble* weight, int n, IssmPDouble* alpha, IssmPDouble* beta ) {/*{{{*/
-	/*Gauss quadrature points from recursion coefficients.
-	 *
-	 *The routine uses the algorithm from the ORTHPOL routine GAUSS, which
-	 *finds the eigenvalues of a tridiagonal matrix.*/
-
-	/*Intermediaries*/
+/*  calculate the Gauss points  */
+
+		if ((ierr=GaussRecur(*pxgaus,
+							 *pxwgt,
+							 ngaus,
+							 alpha,
+							 beta )))
+			_printf_("%s -- Error %d from GaussRecur for ngaus=%d.\n",
+					 __FUNCT__,ierr,ngaus);
+
+		xfree((void **)&beta );
+		xfree((void **)&alpha);
+	}
+
+//	for (i=0; i<ngaus; i++)
+//		_printf_("i=%d: xgaus=%f,xwgt=%f\n",i,(*pxgaus)[i],(*pxwgt)[i]);
+
+	return(ierr);
+}
+
+
+/*=======1=========2=========3=========4=========5=========6=========7=========8
+
+	GaussRecur.c    Gauss quadrature points from recursion coefficients.
+
+	02/20/03    jes    Initial development.
+
+	Input:
+		int     n         number of Gauss points
+		double* alpha     first recursion coefficients
+		double* beta      second recursion coefficients
+
+	Output:
+		double* zero      abscissas of Gauss points
+		double* weight    weights of Gauss points
+		int               function return value
+
+	The routine uses the algorithm from the ORTHPOL routine GAUSS, which
+	finds the eigenvalues of a tridiagonal matrix.
+
+=========1=========2=========3=========4=========5=========6=========7========*/
+#undef __FUNCT__
+#define __FUNCT__ "GaussRecur"
+
+int GaussRecur( double* zero, 
+				double* weight,
+				int n,
+				double* alpha, 
+				double* beta )
+{
 	int i,j,k,l,m,ii,mml,iter;
-	IssmPDouble p,g,r,s,c,f,b;
-	IssmPDouble* work;
-
-	if (n==1){
+	double p,g,r,s,c,f,b;
+	double* work;
+
+//	_printf_("Gauss abscissas and weights n=%d\n",n);
+
+	if ( n == 1 ) {
 		zero[0]  =alpha[0];
 		weight[0]=beta[0];
-		return;
-	}
-
-	work=xNew<IssmPDouble>(n);
+		return 1;
+	}
+
+	work=(double *) xmalloc(n*sizeof(double));
 
 	zero[0]  =alpha[0];
 	weight[0]=1.;
 	work[n-1]=0.;
-	for (i=1; i<=n-1; i++){
+	for (i=1; i<=n-1; i++) {
 		zero[i]=alpha[i];
 		work[i-1]=sqrt(beta[i]);
@@ -1603,23 +368,25 @@
 	}
 
-	for (l=0; l<=n-1; l++){
+	for (l=0; l<=n-1; l++) {
 		iter=0;
 		do {
 
-			/*  Look for a small subdiagonal element.  */
+/*  Look for a small subdiagonal element.  */
+
 			for (m=l; m<=n-1; m++) {
 				if (m == n-1) break;
 				if (fabs(work[m])
-							<= DBL_EPSILON*(fabs(zero[m])+fabs(zero[m+1])))
-				 break;
+					<= DBL_EPSILON*(fabs(zero[m])+fabs(zero[m+1])))
+					break;
 			}
 			p=zero[l];
-			if (m==l) break;
+			if (m == l) break;
 			++iter;
 
-			/*  Form shift.  */
+/*  Form shift.  */
+
 			g=(zero[l+1]-p)/(2.*work[l]);
 			r=sqrt(g*g+1.);
-			//			g=zero[m]-p+work[l]/(g+FortranSign(r,g));
+//			g=zero[m]-p+work[l]/(g+FortranSign(r,g));
 			g=zero[m]-p+work[l]/(g+(g>=0 ? fabs(r) : -fabs(r)));
 			s=1.;
@@ -1628,5 +395,6 @@
 			mml=m-l;
 
-			/*  For i=m-1 step -1 until l do ...  */
+/*  For i=m-1 step -1 until l do ...  */
+
 			for (ii=1; ii<=mml; ii++) {
 				i=m-ii;
@@ -1653,5 +421,6 @@
 				g=c*r-b;
 
-				/*  Form first component of vector.  */
+/*  Form first component of vector.  */
+
 				f=weight[i+1];
 				weight[i+1]=s*weight[i]+c*f;
@@ -1663,20 +432,21 @@
 		} while (iter < MAX_GAUS_ITER);
 		if (iter >= MAX_GAUS_ITER) {
-			xDelete<IssmPDouble>(work);
-			_error_("Max iterations exceeded for l=" << MAX_GAUS_ITER);
+			xfree((void **)&work);
+			throw ErrorException(__FUNCT__,exprintf("%s%i"," Max iterations exceeded for l=",MAX_GAUS_ITER));
 		}
 	}
 
-	/*  Order eigenvalues and eigenvectors.  */
+/*  Order eigenvalues and eigenvectors.  */
+
 	for (i=0;i<n-1;i++) {
 		k=i;
 		p=zero[i];
-		for (j=i+1;j<n;j++){
-			if (zero[j] < p){
+		for (j=i+1;j<n;j++) {
+			if (zero[j] < p) {
 				k=j;
 				p=zero[j];
 			}
 		}
-		if (k > i){
+		if (k > i) {
 			p=zero[i];
 			zero[i]=zero[k];
@@ -1687,10 +457,1780 @@
 		}
 	}
-	for (i=0;i<n;i++){
+	for (i=0;i<n;i++) {
 		weight[i]=beta[0]*weight[i]*weight[i];
 	}
 
-	/*Cleanup*/
-	xDelete<IssmPDouble>(work);
-
-}/*}}}*/
+	xfree((void **)&work);
+
+	return 1;
+}
+
+
+/*=======1=========2=========3=========4=========5=========6=========7=========8
+
+	GaussQuad.c    Gauss quadrature points for the quadrilaterial.
+
+	04/25/05    jes    Initial development (from FaceQuadIntegInit).
+
+	Input:
+		int         nigaus    number of xi gauss points
+		int         njgaus    number of eta gauss points
+
+	Output:
+		double**    pxgaus    abscissas of xi gauss points
+								  (allocated below)
+		double**    pxwgt     weights of xi gauss points
+								  (allocated below)
+		double**    pegaus    abscissas of eta gauss points
+								  (allocated below)
+		double**    pewgt     weights of eta gauss points
+								  (allocated below)
+		int                   function return value
+
+=========1=========2=========3=========4=========5=========6=========7========*/
+#undef __FUNCT__
+#define __FUNCT__ "GaussQuad"
+
+int GaussQuad( double** pxgaus,
+			   double** pxwgt,
+			   double** pegaus,
+			   double** pewgt,
+			   int nigaus,
+			   int njgaus )
+{ 
+	int i,ierr=0;
+
+//	_printf_("GaussQuad: nigaus=%d,njgaus=%d\n",
+//			 nigaus,njgaus);
+
+/*  get the gauss points using the product of two line rules  */
+
+	if ((ierr=GaussLegendre(pxgaus,
+							pxwgt,
+							nigaus))) {
+		_printf_("%s -- Error %d from GaussLegendre for nigaus=%d.\n",
+				 __FUNCT__,ierr,nigaus);
+		return(ierr);
+	}
+//	for (i=0; i<nigaus; i++)
+//		_printf_("i=%d: xgaus=%f,xwgt=%f\n",i,(*pxgaus)[i],(*pxwgt)[i]);
+
+	if ((ierr=GaussLegendre(pegaus,
+							pewgt,
+							njgaus))) {
+		_printf_("%s -- Error %d from GaussLegendre for njgaus=%d.\n",
+				 __FUNCT__,ierr,njgaus);
+		return(ierr);
+	}
+//	for (i=0; i<njgaus; i++)
+//		_printf_("j=%d: egaus=%f,ewgt=%f\n",i,(*pegaus)[i],(*pewgt)[i]);
+
+	return 1;
+}
+
+
+/*=======1=========2=========3=========4=========5=========6=========7=========8
+
+	GaussTria.c    Gauss quadrature points for the triangle.
+
+	08/13/03    jes    Initial development.
+	04/25/05    jes    Combination of GaussTriaSym and GaussTriaColl.
+
+	Input:
+		int         iord      order for the Gauss quadrature
+
+	Output:
+		int*        pngaus    number of Gauss points
+		double**    pl1       first area coordinates of Gauss points
+								  (allocated below)
+		double**    pl2       second area coordinates of Gauss points
+								  (allocated below)
+		double**    pl3       third area coordinates of Gauss points
+								  (allocated below)
+		double**    pwgt      weights of Gauss points
+								  (allocated below)
+		int                   function return value
+
+	Higher-order points from D.A. Dunavant, "High Degree Efficient
+	Symmetrical Gaussian Quadrature Rules for the Triangle", IJNME,
+	Vol. 21, pp. 1129-1148 (1985), as transcribed for Probe rules3.
+
+=========1=========2=========3=========4=========5=========6=========7========*/
+#undef __FUNCT__
+#define __FUNCT__ "GaussTria"
+int GaussTria( int* pngaus,
+			   double** pl1,
+			   double** pl2,
+			   double** pl3,
+			   double** pwgt,
+			   int iord )
+{
+	int i,j,ipt,nigaus,ierr=0;
+	double xi,eta;
+	double *xgaus=NULL,*xwgt=NULL,*egaus,*ewgt;
+
+/*  p= 1, npoint= 1  */
+
+	static double wgt1[]={
+		 1.732050807568877};
+	static double l11[]={
+		 0.333333333333333};
+	static double l21[]={
+		 0.333333333333333};
+	static double l31[]={
+		 0.333333333333333};
+
+/*  p= 2, npoint= 3  */
+
+	static double wgt2[]={
+		 0.577350269189625, 0.577350269189625, 0.577350269189625};
+	static double l12[]={
+		 0.666666666666667, 0.166666666666667, 0.166666666666667};
+	static double l22[]={
+		 0.166666666666667, 0.666666666666667, 0.166666666666667};
+	static double l32[]={
+		 0.166666666666667, 0.166666666666667, 0.666666666666667};
+
+/*  p= 3, npoint= 4  */
+
+	static double wgt3[]={
+		-0.974278579257493, 0.902109795608790, 0.902109795608790, 
+		 0.902109795608790};
+	static double l13[]={
+		 0.333333333333333, 0.600000000000000, 0.200000000000000, 
+		 0.200000000000000};
+	static double l23[]={
+		 0.333333333333333, 0.200000000000000, 0.600000000000000, 
+		 0.200000000000000};
+	static double l33[]={
+		 0.333333333333333, 0.200000000000000, 0.200000000000000, 
+		 0.600000000000000};
+
+/*  p= 4, npoint= 6  */
+
+	static double wgt4[]={
+		 0.386908262797819, 0.386908262797819, 0.386908262797819, 
+		 0.190442006391807, 0.190442006391807, 0.190442006391807};
+	static double l14[]={
+		 0.108103018168070, 0.445948490915965, 0.445948490915965, 
+		 0.816847572980459, 0.091576213509771, 0.091576213509771};
+	static double l24[]={
+		 0.445948490915965, 0.108103018168070, 0.445948490915965, 
+		 0.091576213509771, 0.816847572980459, 0.091576213509771};
+	static double l34[]={
+		 0.445948490915965, 0.445948490915965, 0.108103018168070, 
+		 0.091576213509771, 0.091576213509771, 0.816847572980459};
+
+/*  p= 5, npoint= 7  */
+
+	static double wgt5[]={
+		 0.389711431702997, 0.229313399254729, 0.229313399254729, 
+		 0.229313399254729, 0.218133059367230, 0.218133059367230, 
+		 0.218133059367230};
+	static double l15[]={
+		 0.333333333333333, 0.059715871789770, 0.470142064105115, 
+		 0.470142064105115, 0.797426985353087, 0.101286507323456, 
+		 0.101286507323456};
+	static double l25[]={
+		 0.333333333333333, 0.470142064105115, 0.059715871789770, 
+		 0.470142064105115, 0.101286507323456, 0.797426985353087, 
+		 0.101286507323456};
+	static double l35[]={
+		 0.333333333333333, 0.470142064105115, 0.470142064105115, 
+		 0.059715871789770, 0.101286507323456, 0.101286507323456, 
+		 0.797426985353087};
+
+/*  p= 6, npoint=12  */
+
+	static double wgt6[]={
+		 0.202279763184836, 0.202279763184836, 0.202279763184836, 
+		 0.088065961139281, 0.088065961139281, 0.088065961139281, 
+		 0.143502272432755, 0.143502272432755, 0.143502272432755, 
+		 0.143502272432755, 0.143502272432755, 0.143502272432755};
+	static double l16[]={
+		 0.501426509658179, 0.249286745170910, 0.249286745170910, 
+		 0.873821971016996, 0.063089014491502, 0.063089014491502, 
+		 0.053145049844817, 0.053145049844817, 0.310352451033784, 
+		 0.636502499121399, 0.310352451033784, 0.636502499121399};
+	static double l26[]={
+		 0.249286745170910, 0.501426509658179, 0.249286745170910, 
+		 0.063089014491502, 0.873821971016996, 0.063089014491502, 
+		 0.310352451033784, 0.636502499121399, 0.053145049844817, 
+		 0.053145049844817, 0.636502499121399, 0.310352451033784};
+	static double l36[]={
+		 0.249286745170910, 0.249286745170910, 0.501426509658179, 
+		 0.063089014491502, 0.063089014491502, 0.873821971016996, 
+		 0.636502499121399, 0.310352451033784, 0.636502499121399, 
+		 0.310352451033784, 0.053145049844817, 0.053145049844817};
+
+/*  p= 7, npoint=13  */
+
+	static double wgt7[]={
+		-0.259062916308362, 0.304174548458604, 0.304174548458604, 
+		 0.304174548458604, 0.092400122517855, 0.092400122517855, 
+		 0.092400122517855, 0.133564951824643, 0.133564951824643, 
+		 0.133564951824643, 0.133564951824643, 0.133564951824643, 
+		 0.133564951824643};
+	static double l17[]={
+		 0.333333333333333, 0.479308067841920, 0.260345966079040, 
+		 0.260345966079040, 0.869739794195568, 0.065130102902216, 
+		 0.065130102902216, 0.048690315425316, 0.048690315425316, 
+		 0.312865496004874, 0.638444188569810, 0.312865496004874, 
+		 0.638444188569810};
+	static double l27[]={
+		 0.333333333333333, 0.260345966079040, 0.479308067841920, 
+		 0.260345966079040, 0.065130102902216, 0.869739794195568, 
+		 0.065130102902216, 0.312865496004874, 0.638444188569810, 
+		 0.048690315425316, 0.048690315425316, 0.638444188569810, 
+		 0.312865496004874};
+	static double l37[]={
+		 0.333333333333333, 0.260345966079040, 0.260345966079040, 
+		 0.479308067841920, 0.065130102902216, 0.065130102902216, 
+		 0.869739794195568, 0.638444188569810, 0.312865496004874, 
+		 0.638444188569810, 0.312865496004874, 0.048690315425316, 
+		 0.048690315425316};
+
+/*  p= 8, npoint=16  */
+
+	static double wgt8[]={
+		 0.249961964823104, 0.164703541925695, 0.164703541925695, 
+		 0.164703541925695, 0.178777729989794, 0.178777729989794, 
+		 0.178777729989794, 0.056219767020733, 0.056219767020733, 
+		 0.056219767020733, 0.047164287656184, 0.047164287656184, 
+		 0.047164287656184, 0.047164287656184, 0.047164287656184, 
+		 0.047164287656184};
+	static double l18[]={
+		 0.333333333333333, 0.081414823414554, 0.459292588292723, 
+		 0.459292588292723, 0.658861384496480, 0.170569307751760, 
+		 0.170569307751760, 0.898905543365938, 0.050547228317031, 
+		 0.050547228317031, 0.008394777409958, 0.008394777409958, 
+		 0.263112829634638, 0.728492392955404, 0.263112829634638, 
+		 0.728492392955404};
+	static double l28[]={
+		 0.333333333333333, 0.459292588292723, 0.081414823414554, 
+		 0.459292588292723, 0.170569307751760, 0.658861384496480, 
+		 0.170569307751760, 0.050547228317031, 0.898905543365938, 
+		 0.050547228317031, 0.263112829634638, 0.728492392955404, 
+		 0.008394777409958, 0.008394777409958, 0.728492392955404, 
+		 0.263112829634638};
+	static double l38[]={
+		 0.333333333333333, 0.459292588292723, 0.459292588292723, 
+		 0.081414823414554, 0.170569307751760, 0.170569307751760, 
+		 0.658861384496480, 0.050547228317031, 0.050547228317031, 
+		 0.898905543365938, 0.728492392955404, 0.263112829634638, 
+		 0.728492392955404, 0.263112829634638, 0.008394777409958, 
+		 0.008394777409958};
+
+/*  p= 9, npoint=19  */
+
+	static double wgt9[]={
+		 0.168244134395468, 0.054273292833345, 0.054273292833345, 
+		 0.054273292833345, 0.134801255248419, 0.134801255248419, 
+		 0.134801255248419, 0.137953930529909, 0.137953930529909, 
+		 0.137953930529909, 0.044301833780383, 0.044301833780383, 
+		 0.044301833780383, 0.074969289332873, 0.074969289332873, 
+		 0.074969289332873, 0.074969289332873, 0.074969289332873, 
+		 0.074969289332873};
+	static double l19[]={
+		 0.333333333333333, 0.020634961602525, 0.489682519198738, 
+		 0.489682519198738, 0.125820817014127, 0.437089591492937, 
+		 0.437089591492937, 0.623592928761935, 0.188203535619033, 
+		 0.188203535619033, 0.910540973211095, 0.044729513394453, 
+		 0.044729513394453, 0.036838412054736, 0.036838412054736, 
+		 0.221962989160766, 0.741198598784498, 0.221962989160766, 
+		 0.741198598784498};
+	static double l29[]={
+		 0.333333333333333, 0.489682519198738, 0.020634961602525, 
+		 0.489682519198738, 0.437089591492937, 0.125820817014127, 
+		 0.437089591492937, 0.188203535619033, 0.623592928761935, 
+		 0.188203535619033, 0.044729513394453, 0.910540973211095, 
+		 0.044729513394453, 0.221962989160766, 0.741198598784498, 
+		 0.036838412054736, 0.036838412054736, 0.741198598784498, 
+		 0.221962989160766};
+	static double l39[]={
+		 0.333333333333333, 0.489682519198738, 0.489682519198738, 
+		 0.020634961602525, 0.437089591492937, 0.437089591492937, 
+		 0.125820817014127, 0.188203535619033, 0.188203535619033, 
+		 0.623592928761935, 0.044729513394453, 0.044729513394453, 
+		 0.910540973211095, 0.741198598784498, 0.221962989160766, 
+		 0.741198598784498, 0.221962989160766, 0.036838412054736, 
+		 0.036838412054736};
+
+/*  p=10, npoint=25  */
+
+	static double wgt10[]={
+		 0.157301373584232, 0.063611224790829, 0.063611224790829, 
+		 0.063611224790829, 0.078498377595183, 0.078498377595183, 
+		 0.078498377595183, 0.126020408629139, 0.126020408629139, 
+		 0.126020408629139, 0.126020408629139, 0.126020408629139, 
+		 0.126020408629139, 0.049064223302117, 0.049064223302117, 
+		 0.049064223302117, 0.049064223302117, 0.049064223302117, 
+		 0.049064223302117, 0.016318805873179, 0.016318805873179, 
+		 0.016318805873179, 0.016318805873179, 0.016318805873179, 
+		 0.016318805873179};
+	static double l110[]={
+		 0.333333333333333, 0.028844733232685, 0.485577633383657, 
+		 0.485577633383657, 0.781036849029926, 0.109481575485037, 
+		 0.109481575485037, 0.141707219414880, 0.141707219414880, 
+		 0.307939838764121, 0.550352941820999, 0.307939838764121, 
+		 0.550352941820999, 0.025003534762686, 0.025003534762686, 
+		 0.246672560639903, 0.728323904597411, 0.246672560639903, 
+		 0.728323904597411, 0.009540815400299, 0.009540815400299, 
+		 0.066803251012200, 0.923655933587500, 0.066803251012200, 
+		 0.923655933587500};
+	static double l210[]={
+		 0.333333333333333, 0.485577633383657, 0.028844733232685, 
+		 0.485577633383657, 0.109481575485037, 0.781036849029926, 
+		 0.109481575485037, 0.307939838764121, 0.550352941820999, 
+		 0.141707219414880, 0.141707219414880, 0.550352941820999, 
+		 0.307939838764121, 0.246672560639903, 0.728323904597411, 
+		 0.025003534762686, 0.025003534762686, 0.728323904597411, 
+		 0.246672560639903, 0.066803251012200, 0.923655933587500, 
+		 0.009540815400299, 0.009540815400299, 0.923655933587500, 
+		 0.066803251012200};
+	static double l310[]={
+		 0.333333333333333, 0.485577633383657, 0.485577633383657, 
+		 0.028844733232685, 0.109481575485037, 0.109481575485037, 
+		 0.781036849029926, 0.550352941820999, 0.307939838764121, 
+		 0.550352941820999, 0.307939838764121, 0.141707219414880, 
+		 0.141707219414880, 0.728323904597411, 0.246672560639903, 
+		 0.728323904597411, 0.246672560639903, 0.025003534762686, 
+		 0.025003534762686, 0.923655933587500, 0.066803251012200, 
+		 0.923655933587500, 0.066803251012200, 0.009540815400299, 
+		 0.009540815400299};
+
+/*  p=11, npoint=27  */
+
+	static double wgt11[]={
+		 0.001605622060698, 0.001605622060698, 0.001605622060698, 
+		 0.133626914252765, 0.133626914252765, 0.133626914252765, 
+		 0.102750410879760, 0.102750410879760, 0.102750410879760, 
+		 0.062673462600454, 0.062673462600454, 0.062673462600454, 
+		 0.023659348114362, 0.023659348114362, 0.023659348114362, 
+		 0.090650537039958, 0.090650537039958, 0.090650537039958, 
+		 0.090650537039958, 0.090650537039958, 0.090650537039958, 
+		 0.035866718600836, 0.035866718600836, 0.035866718600836, 
+		 0.035866718600836, 0.035866718600836, 0.035866718600836};
+	static double l111[]={
+		-0.069222096541517, 0.534611048270758, 0.534611048270758, 
+		 0.202061394068290, 0.398969302965855, 0.398969302965855, 
+		 0.593380199137435, 0.203309900431282, 0.203309900431282, 
+		 0.761298175434837, 0.119350912282581, 0.119350912282581, 
+		 0.935270103777448, 0.032364948111276, 0.032364948111276, 
+		 0.050178138310495, 0.050178138310495, 0.356620648261293, 
+		 0.593201213428213, 0.356620648261293, 0.593201213428213, 
+		 0.021022016536166, 0.021022016536166, 0.171488980304042, 
+		 0.807489003159792, 0.171488980304042, 0.807489003159792};
+	static double l211[]={
+		 0.534611048270758,-0.069222096541517, 0.534611048270758, 
+		 0.398969302965855, 0.202061394068290, 0.398969302965855, 
+		 0.203309900431282, 0.593380199137435, 0.203309900431282, 
+		 0.119350912282581, 0.761298175434837, 0.119350912282581, 
+		 0.032364948111276, 0.935270103777448, 0.032364948111276, 
+		 0.356620648261293, 0.593201213428213, 0.050178138310495, 
+		 0.050178138310495, 0.593201213428213, 0.356620648261293, 
+		 0.171488980304042, 0.807489003159792, 0.021022016536166, 
+		 0.021022016536166, 0.807489003159792, 0.171488980304042};
+	static double l311[]={
+		 0.534611048270758, 0.534611048270758,-0.069222096541517, 
+		 0.398969302965855, 0.398969302965855, 0.202061394068290, 
+		 0.203309900431282, 0.203309900431282, 0.593380199137435, 
+		 0.119350912282581, 0.119350912282581, 0.761298175434837, 
+		 0.032364948111276, 0.032364948111276, 0.935270103777448, 
+		 0.593201213428213, 0.356620648261293, 0.593201213428213, 
+		 0.356620648261293, 0.050178138310495, 0.050178138310495, 
+		 0.807489003159792, 0.171488980304042, 0.807489003159792, 
+		 0.171488980304042, 0.021022016536166, 0.021022016536166};
+
+/*  p=12, npoint=33  */
+
+	static double wgt12[]={
+		 0.044567514407799, 0.044567514407799, 0.044567514407799, 
+		 0.075677707051848, 0.075677707051848, 0.075677707051848, 
+		 0.108873638018933, 0.108873638018933, 0.108873638018933, 
+		 0.060268635501892, 0.060268635501892, 0.060268635501892, 
+		 0.010680277434033, 0.010680277434033, 0.010680277434033, 
+		 0.069925589232074, 0.069925589232074, 0.069925589232074, 
+		 0.069925589232074, 0.069925589232074, 0.069925589232074, 
+		 0.038723067079683, 0.038723067079683, 0.038723067079683, 
+		 0.038723067079683, 0.038723067079683, 0.038723067079683, 
+		 0.029992592075802, 0.029992592075802, 0.029992592075802, 
+		 0.029992592075802, 0.029992592075802, 0.029992592075802};
+	static double l112[]={
+		 0.023565220452390, 0.488217389773805, 0.488217389773805, 
+		 0.120551215411079, 0.439724392294460, 0.439724392294460, 
+		 0.457579229975768, 0.271210385012116, 0.271210385012116, 
+		 0.744847708916828, 0.127576145541586, 0.127576145541586, 
+		 0.957365299093579, 0.021317350453210, 0.021317350453210, 
+		 0.115343494534698, 0.115343494534698, 0.275713269685514, 
+		 0.608943235779788, 0.275713269685514, 0.608943235779788, 
+		 0.022838332222257, 0.022838332222257, 0.281325580989940, 
+		 0.695836086787803, 0.281325580989940, 0.695836086787803, 
+		 0.025734050548330, 0.025734050548330, 0.116251915907597, 
+		 0.858014033544073, 0.116251915907597, 0.858014033544073};
+	static double l212[]={
+		 0.488217389773805, 0.023565220452390, 0.488217389773805, 
+		 0.439724392294460, 0.120551215411079, 0.439724392294460, 
+		 0.271210385012116, 0.457579229975768, 0.271210385012116, 
+		 0.127576145541586, 0.744847708916828, 0.127576145541586, 
+		 0.021317350453210, 0.957365299093579, 0.021317350453210, 
+		 0.275713269685514, 0.608943235779788, 0.115343494534698, 
+		 0.115343494534698, 0.608943235779788, 0.275713269685514, 
+		 0.281325580989940, 0.695836086787803, 0.022838332222257, 
+		 0.022838332222257, 0.695836086787803, 0.281325580989940, 
+		 0.116251915907597, 0.858014033544073, 0.025734050548330, 
+		 0.025734050548330, 0.858014033544073, 0.116251915907597};
+	static double l312[]={
+		 0.488217389773805, 0.488217389773805, 0.023565220452390, 
+		 0.439724392294460, 0.439724392294460, 0.120551215411079, 
+		 0.271210385012116, 0.271210385012116, 0.457579229975768, 
+		 0.127576145541586, 0.127576145541586, 0.744847708916828, 
+		 0.021317350453210, 0.021317350453210, 0.957365299093579, 
+		 0.608943235779788, 0.275713269685514, 0.608943235779788, 
+		 0.275713269685514, 0.115343494534698, 0.115343494534698, 
+		 0.695836086787803, 0.281325580989940, 0.695836086787803, 
+		 0.281325580989940, 0.022838332222257, 0.022838332222257, 
+		 0.858014033544073, 0.116251915907597, 0.858014033544073, 
+		 0.116251915907597, 0.025734050548330, 0.025734050548330};
+
+/*  p=13, npoint=37  */
+
+	static double wgt13[]={
+		 0.090968907790622, 0.019537784619314, 0.019537784619314, 
+		 0.019537784619314, 0.054427130356344, 0.054427130356344, 
+		 0.054427130356344, 0.081531965976677, 0.081531965976677, 
+		 0.081531965976677, 0.082036138309652, 0.082036138309652, 
+		 0.082036138309652, 0.053983743853694, 0.053983743853694, 
+		 0.053983743853694, 0.013814441407066, 0.013814441407066, 
+		 0.013814441407066, 0.063823305703923, 0.063823305703923, 
+		 0.063823305703923, 0.063823305703923, 0.063823305703923, 
+		 0.063823305703923, 0.030140218568265, 0.030140218568265, 
+		 0.030140218568265, 0.030140218568265, 0.030140218568265, 
+		 0.030140218568265, 0.026884523429480, 0.026884523429480, 
+		 0.026884523429480, 0.026884523429480, 0.026884523429480, 
+		 0.026884523429480};
+	static double l113[]={
+		 0.333333333333333, 0.009903630120591, 0.495048184939705, 
+		 0.495048184939705, 0.062566729780852, 0.468716635109574, 
+		 0.468716635109574, 0.170957326397447, 0.414521336801277, 
+		 0.414521336801277, 0.541200855914337, 0.229399572042831, 
+		 0.229399572042831, 0.771151009607340, 0.114424495196330, 
+		 0.114424495196330, 0.950377217273082, 0.024811391363459, 
+		 0.024811391363459, 0.094853828379579, 0.094853828379579, 
+		 0.268794997058761, 0.636351174561660, 0.268794997058761, 
+		 0.636351174561660, 0.018100773278807, 0.018100773278807, 
+		 0.291730066734288, 0.690169159986905, 0.291730066734288, 
+		 0.690169159986905, 0.022233076674090, 0.022233076674090, 
+		 0.126357385491669, 0.851409537834241, 0.126357385491669, 
+		 0.851409537834241};
+	static double l213[]={
+		 0.333333333333333, 0.495048184939705, 0.009903630120591, 
+		 0.495048184939705, 0.468716635109574, 0.062566729780852, 
+		 0.468716635109574, 0.414521336801277, 0.170957326397447, 
+		 0.414521336801277, 0.229399572042831, 0.541200855914337, 
+		 0.229399572042831, 0.114424495196330, 0.771151009607340, 
+		 0.114424495196330, 0.024811391363459, 0.950377217273082, 
+		 0.024811391363459, 0.268794997058761, 0.636351174561660, 
+		 0.094853828379579, 0.094853828379579, 0.636351174561660, 
+		 0.268794997058761, 0.291730066734288, 0.690169159986905, 
+		 0.018100773278807, 0.018100773278807, 0.690169159986905, 
+		 0.291730066734288, 0.126357385491669, 0.851409537834241, 
+		 0.022233076674090, 0.022233076674090, 0.851409537834241, 
+		 0.126357385491669};
+	static double l313[]={
+		 0.333333333333333, 0.495048184939705, 0.495048184939705, 
+		 0.009903630120591, 0.468716635109574, 0.468716635109574, 
+		 0.062566729780852, 0.414521336801277, 0.414521336801277, 
+		 0.170957326397447, 0.229399572042831, 0.229399572042831, 
+		 0.541200855914337, 0.114424495196330, 0.114424495196330, 
+		 0.771151009607340, 0.024811391363459, 0.024811391363459, 
+		 0.950377217273082, 0.636351174561660, 0.268794997058761, 
+		 0.636351174561660, 0.268794997058761, 0.094853828379579, 
+		 0.094853828379579, 0.690169159986905, 0.291730066734288, 
+		 0.690169159986905, 0.291730066734288, 0.018100773278807, 
+		 0.018100773278807, 0.851409537834241, 0.126357385491669, 
+		 0.851409537834241, 0.126357385491669, 0.022233076674090, 
+		 0.022233076674090};
+
+/*  p=14, npoint=42  */
+
+	static double wgt14[]={
+		 0.037903474783419, 0.037903474783419, 0.037903474783419, 
+		 0.056791094234956, 0.056791094234956, 0.056791094234956, 
+		 0.089675379523011, 0.089675379523011, 0.089675379523011, 
+		 0.073027745871103, 0.073027745871103, 0.073027745871103, 
+		 0.024999901169244, 0.024999901169244, 0.024999901169244, 
+		 0.008527585185524, 0.008527585185524, 0.008527585185524, 
+		 0.042722337771116, 0.042722337771116, 0.042722337771116, 
+		 0.042722337771116, 0.042722337771116, 0.042722337771116, 
+		 0.066807816407881, 0.066807816407881, 0.066807816407881, 
+		 0.066807816407881, 0.066807816407881, 0.066807816407881, 
+		 0.025004419126360, 0.025004419126360, 0.025004419126360, 
+		 0.025004419126360, 0.025004419126360, 0.025004419126360, 
+		 0.008677970905831, 0.008677970905831, 0.008677970905831, 
+		 0.008677970905831, 0.008677970905831, 0.008677970905831};
+	static double l114[]={
+		 0.022072179275643, 0.488963910362179, 0.488963910362179, 
+		 0.164710561319092, 0.417644719340454, 0.417644719340454, 
+		 0.453044943382323, 0.273477528308839, 0.273477528308839, 
+		 0.645588935174913, 0.177205532412543, 0.177205532412543, 
+		 0.876400233818255, 0.061799883090873, 0.061799883090873, 
+		 0.961218077502598, 0.019390961248701, 0.019390961248701, 
+		 0.057124757403648, 0.057124757403648, 0.172266687821356, 
+		 0.770608554774996, 0.172266687821356, 0.770608554774996, 
+		 0.092916249356972, 0.092916249356972, 0.336861459796345, 
+		 0.570222290846683, 0.336861459796345, 0.570222290846683, 
+		 0.014646950055654, 0.014646950055654, 0.298372882136258, 
+		 0.686980167808088, 0.298372882136258, 0.686980167808088, 
+		 0.001268330932872, 0.001268330932872, 0.118974497696957, 
+		 0.879757171370171, 0.118974497696957, 0.879757171370171};
+	static double l214[]={
+		 0.488963910362179, 0.022072179275643, 0.488963910362179, 
+		 0.417644719340454, 0.164710561319092, 0.417644719340454, 
+		 0.273477528308839, 0.453044943382323, 0.273477528308839, 
+		 0.177205532412543, 0.645588935174913, 0.177205532412543, 
+		 0.061799883090873, 0.876400233818255, 0.061799883090873, 
+		 0.019390961248701, 0.961218077502598, 0.019390961248701, 
+		 0.172266687821356, 0.770608554774996, 0.057124757403648, 
+		 0.057124757403648, 0.770608554774996, 0.172266687821356, 
+		 0.336861459796345, 0.570222290846683, 0.092916249356972, 
+		 0.092916249356972, 0.570222290846683, 0.336861459796345, 
+		 0.298372882136258, 0.686980167808088, 0.014646950055654, 
+		 0.014646950055654, 0.686980167808088, 0.298372882136258, 
+		 0.118974497696957, 0.879757171370171, 0.001268330932872, 
+		 0.001268330932872, 0.879757171370171, 0.118974497696957};
+	static double l314[]={
+		 0.488963910362179, 0.488963910362179, 0.022072179275643, 
+		 0.417644719340454, 0.417644719340454, 0.164710561319092, 
+		 0.273477528308839, 0.273477528308839, 0.453044943382323, 
+		 0.177205532412543, 0.177205532412543, 0.645588935174913, 
+		 0.061799883090873, 0.061799883090873, 0.876400233818255, 
+		 0.019390961248701, 0.019390961248701, 0.961218077502598, 
+		 0.770608554774996, 0.172266687821356, 0.770608554774996, 
+		 0.172266687821356, 0.057124757403648, 0.057124757403648, 
+		 0.570222290846683, 0.336861459796345, 0.570222290846683, 
+		 0.336861459796345, 0.092916249356972, 0.092916249356972, 
+		 0.686980167808088, 0.298372882136258, 0.686980167808088, 
+		 0.298372882136258, 0.014646950055654, 0.014646950055654, 
+		 0.879757171370171, 0.118974497696957, 0.879757171370171, 
+		 0.118974497696957, 0.001268330932872, 0.001268330932872};
+
+/*  p=15, npoint=48  */
+
+	static double wgt15[]={
+		 0.003320126005206, 0.003320126005206, 0.003320126005206, 
+		 0.076641563419124, 0.076641563419124, 0.076641563419124, 
+		 0.088657703045151, 0.088657703045151, 0.088657703045151, 
+		 0.041028362044303, 0.041028362044303, 0.041028362044303, 
+		 0.023018566716310, 0.023018566716310, 0.023018566716310, 
+		 0.008225364846296, 0.008225364846296, 0.008225364846296, 
+		 0.066770684377964, 0.066770684377964, 0.066770684377964, 
+		 0.066770684377964, 0.066770684377964, 0.066770684377964, 
+		 0.047139173172681, 0.047139173172681, 0.047139173172681, 
+		 0.047139173172681, 0.047139173172681, 0.047139173172681, 
+		 0.003779468865339, 0.003779468865339, 0.003779468865339, 
+		 0.003779468865339, 0.003779468865339, 0.003779468865339, 
+		 0.037248306609289, 0.037248306609289, 0.037248306609289, 
+		 0.037248306609289, 0.037248306609289, 0.037248306609289, 
+		 0.013291658531346, 0.013291658531346, 0.013291658531346, 
+		 0.013291658531346, 0.013291658531346, 0.013291658531346};
+	static double l115[]={
+		-0.013945833716486, 0.506972916858243, 0.506972916858243, 
+		 0.137187291433955, 0.431406354283023, 0.431406354283023, 
+		 0.444612710305711, 0.277693644847144, 0.277693644847144, 
+		 0.747070217917492, 0.126464891041254, 0.126464891041254, 
+		 0.858383228050628, 0.070808385974686, 0.070808385974686, 
+		 0.962069659517853, 0.018965170241073, 0.018965170241073, 
+		 0.133734161966621, 0.133734161966621, 0.261311371140087, 
+		 0.604954466893291, 0.261311371140087, 0.604954466893291, 
+		 0.036366677396917, 0.036366677396917, 0.388046767090269, 
+		 0.575586555512814, 0.388046767090269, 0.575586555512814, 
+		-0.010174883126571,-0.010174883126571, 0.285712220049916, 
+		 0.724462663076655, 0.285712220049916, 0.724462663076655, 
+		 0.036843869875878, 0.036843869875878, 0.215599664072284, 
+		 0.747556466051838, 0.215599664072284, 0.747556466051838, 
+		 0.012459809331199, 0.012459809331199, 0.103575616576386, 
+		 0.883964574092416, 0.103575616576386, 0.883964574092416};
+	static double l215[]={
+		 0.506972916858243,-0.013945833716486, 0.506972916858243, 
+		 0.431406354283023, 0.137187291433955, 0.431406354283023, 
+		 0.277693644847144, 0.444612710305711, 0.277693644847144, 
+		 0.126464891041254, 0.747070217917492, 0.126464891041254, 
+		 0.070808385974686, 0.858383228050628, 0.070808385974686, 
+		 0.018965170241073, 0.962069659517853, 0.018965170241073, 
+		 0.261311371140087, 0.604954466893291, 0.133734161966621, 
+		 0.133734161966621, 0.604954466893291, 0.261311371140087, 
+		 0.388046767090269, 0.575586555512814, 0.036366677396917, 
+		 0.036366677396917, 0.575586555512814, 0.388046767090269, 
+		 0.285712220049916, 0.724462663076655,-0.010174883126571, 
+		-0.010174883126571, 0.724462663076655, 0.285712220049916, 
+		 0.215599664072284, 0.747556466051838, 0.036843869875878, 
+		 0.036843869875878, 0.747556466051838, 0.215599664072284, 
+		 0.103575616576386, 0.883964574092416, 0.012459809331199, 
+		 0.012459809331199, 0.883964574092416, 0.103575616576386};
+	static double l315[]={
+		 0.506972916858243, 0.506972916858243,-0.013945833716486, 
+		 0.431406354283023, 0.431406354283023, 0.137187291433955, 
+		 0.277693644847144, 0.277693644847144, 0.444612710305711, 
+		 0.126464891041254, 0.126464891041254, 0.747070217917492, 
+		 0.070808385974686, 0.070808385974686, 0.858383228050628, 
+		 0.018965170241073, 0.018965170241073, 0.962069659517853, 
+		 0.604954466893291, 0.261311371140087, 0.604954466893291, 
+		 0.261311371140087, 0.133734161966621, 0.133734161966621, 
+		 0.575586555512814, 0.388046767090269, 0.575586555512814, 
+		 0.388046767090269, 0.036366677396917, 0.036366677396917, 
+		 0.724462663076655, 0.285712220049916, 0.724462663076655, 
+		 0.285712220049916,-0.010174883126571,-0.010174883126571, 
+		 0.747556466051838, 0.215599664072284, 0.747556466051838, 
+		 0.215599664072284, 0.036843869875878, 0.036843869875878, 
+		 0.883964574092416, 0.103575616576386, 0.883964574092416, 
+		 0.103575616576386, 0.012459809331199, 0.012459809331199};
+
+/*  p=16, npoint=52  */
+
+	static double wgt16[]={
+		 0.081191089584902, 0.011095307165226, 0.011095307165226, 
+		 0.011095307165226, 0.072244353151393, 0.072244353151393, 
+		 0.072244353151393, 0.046577417012049, 0.046577417012049, 
+		 0.046577417012049, 0.072975670074230, 0.072975670074230, 
+		 0.072975670074230, 0.051961986412307, 0.051961986412307, 
+		 0.051961986412307, 0.024595292810646, 0.024595292810646, 
+		 0.024595292810646, 0.006205006808607, 0.006205006808607, 
+		 0.006205006808607, 0.056764756525753, 0.056764756525753, 
+		 0.056764756525753, 0.056764756525753, 0.056764756525753, 
+		 0.056764756525753, 0.026497443692048, 0.026497443692048, 
+		 0.026497443692048, 0.026497443692048, 0.026497443692048, 
+		 0.026497443692048, 0.004133096181263, 0.004133096181263, 
+		 0.004133096181263, 0.004133096181263, 0.004133096181263, 
+		 0.004133096181263, 0.033055830705140, 0.033055830705140, 
+		 0.033055830705140, 0.033055830705140, 0.033055830705140, 
+		 0.033055830705140, 0.011864642509229, 0.011864642509229, 
+		 0.011864642509229, 0.011864642509229, 0.011864642509229, 
+		 0.011864642509229};
+	static double l116[]={
+		 0.333333333333333, 0.005238916103123, 0.497380541948438, 
+		 0.497380541948438, 0.173061122901295, 0.413469438549352, 
+		 0.413469438549352, 0.059082801866017, 0.470458599066991, 
+		 0.470458599066991, 0.518892500060958, 0.240553749969521, 
+		 0.240553749969521, 0.704068411554854, 0.147965794222573, 
+		 0.147965794222573, 0.849069624685052, 0.075465187657474, 
+		 0.075465187657474, 0.966807194753950, 0.016596402623025, 
+		 0.016596402623025, 0.103575692245252, 0.103575692245252, 
+		 0.296555596579887, 0.599868711174861, 0.296555596579887, 
+		 0.599868711174861, 0.020083411655416, 0.020083411655416, 
+		 0.337723063403079, 0.642193524941505, 0.337723063403079, 
+		 0.642193524941505,-0.004341002614139,-0.004341002614139, 
+		 0.204748281642812, 0.799592720971327, 0.204748281642812, 
+		 0.799592720971327, 0.041941786468010, 0.041941786468010, 
+		 0.189358492130623, 0.768699721401368, 0.189358492130623, 
+		 0.768699721401368, 0.014317320230681, 0.014317320230681, 
+		 0.085283615682657, 0.900399064086661, 0.085283615682657, 
+		 0.900399064086661};
+	static double l216[]={
+		 0.333333333333333, 0.497380541948438, 0.005238916103123, 
+		 0.497380541948438, 0.413469438549352, 0.173061122901295, 
+		 0.413469438549352, 0.470458599066991, 0.059082801866017, 
+		 0.470458599066991, 0.240553749969521, 0.518892500060958, 
+		 0.240553749969521, 0.147965794222573, 0.704068411554854, 
+		 0.147965794222573, 0.075465187657474, 0.849069624685052, 
+		 0.075465187657474, 0.016596402623025, 0.966807194753950, 
+		 0.016596402623025, 0.296555596579887, 0.599868711174861, 
+		 0.103575692245252, 0.103575692245252, 0.599868711174861, 
+		 0.296555596579887, 0.337723063403079, 0.642193524941505, 
+		 0.020083411655416, 0.020083411655416, 0.642193524941505, 
+		 0.337723063403079, 0.204748281642812, 0.799592720971327, 
+		-0.004341002614139,-0.004341002614139, 0.799592720971327, 
+		 0.204748281642812, 0.189358492130623, 0.768699721401368, 
+		 0.041941786468010, 0.041941786468010, 0.768699721401368, 
+		 0.189358492130623, 0.085283615682657, 0.900399064086661, 
+		 0.014317320230681, 0.014317320230681, 0.900399064086661, 
+		 0.085283615682657};
+	static double l316[]={
+		 0.333333333333333, 0.497380541948438, 0.497380541948438, 
+		 0.005238916103123, 0.413469438549352, 0.413469438549352, 
+		 0.173061122901295, 0.470458599066991, 0.470458599066991, 
+		 0.059082801866017, 0.240553749969521, 0.240553749969521, 
+		 0.518892500060958, 0.147965794222573, 0.147965794222573, 
+		 0.704068411554854, 0.075465187657474, 0.075465187657474, 
+		 0.849069624685052, 0.016596402623025, 0.016596402623025, 
+		 0.966807194753950, 0.599868711174861, 0.296555596579887, 
+		 0.599868711174861, 0.296555596579887, 0.103575692245252, 
+		 0.103575692245252, 0.642193524941505, 0.337723063403079, 
+		 0.642193524941505, 0.337723063403079, 0.020083411655416, 
+		 0.020083411655416, 0.799592720971327, 0.204748281642812, 
+		 0.799592720971327, 0.204748281642812,-0.004341002614139, 
+		-0.004341002614139, 0.768699721401368, 0.189358492130623, 
+		 0.768699721401368, 0.189358492130623, 0.041941786468010, 
+		 0.041941786468010, 0.900399064086661, 0.085283615682657, 
+		 0.900399064086661, 0.085283615682657, 0.014317320230681, 
+		 0.014317320230681};
+
+/*  p=17, npoint=61  */
+
+	static double wgt17[]={
+		 0.057914928034477, 0.008822054327014, 0.008822054327014, 
+		 0.008822054327014, 0.025410682752829, 0.025410682752829, 
+		 0.025410682752829, 0.042176958517489, 0.042176958517489, 
+		 0.042176958517489, 0.053879858604088, 0.053879858604088, 
+		 0.053879858604088, 0.054138904728481, 0.054138904728481, 
+		 0.054138904728481, 0.042981974139367, 0.042981974139367, 
+		 0.042981974139367, 0.024345832713105, 0.024345832713105, 
+		 0.024345832713105, 0.005533341446715, 0.005533341446715, 
+		 0.005533341446715, 0.014063655552443, 0.014063655552443, 
+		 0.014063655552443, 0.014063655552443, 0.014063655552443, 
+		 0.014063655552443, 0.046428907569036, 0.046428907569036, 
+		 0.046428907569036, 0.046428907569036, 0.046428907569036, 
+		 0.046428907569036, 0.031973646148520, 0.031973646148520, 
+		 0.031973646148520, 0.031973646148520, 0.031973646148520, 
+		 0.031973646148520, 0.014682366990538, 0.014682366990538, 
+		 0.014682366990538, 0.014682366990538, 0.014682366990538, 
+		 0.014682366990538, 0.031684053418215, 0.031684053418215, 
+		 0.031684053418215, 0.031684053418215, 0.031684053418215, 
+		 0.031684053418215, 0.011545213295771, 0.011545213295771, 
+		 0.011545213295771, 0.011545213295771, 0.011545213295771, 
+		 0.011545213295771};
+	static double l117[]={
+		 0.333333333333333, 0.005658918886452, 0.497170540556774, 
+		 0.497170540556774, 0.035647354750751, 0.482176322624625, 
+		 0.482176322624625, 0.099520061958437, 0.450239969020782, 
+		 0.450239969020782, 0.199467521245206, 0.400266239377397, 
+		 0.400266239377397, 0.495717464058095, 0.252141267970953, 
+		 0.252141267970953, 0.675905990683077, 0.162047004658461, 
+		 0.162047004658461, 0.848248235478508, 0.075875882260746, 
+		 0.075875882260746, 0.968690546064356, 0.015654726967822, 
+		 0.015654726967822, 0.010186928826919, 0.010186928826919, 
+		 0.334319867363658, 0.655493203809423, 0.334319867363658, 
+		 0.655493203809423, 0.135440871671036, 0.135440871671036, 
+		 0.292221537796944, 0.572337590532020, 0.292221537796944, 
+		 0.572337590532020, 0.054423924290583, 0.054423924290583, 
+		 0.319574885423190, 0.626001190286228, 0.319574885423190, 
+		 0.626001190286228, 0.012868560833637, 0.012868560833637, 
+		 0.190704224192292, 0.796427214974071, 0.190704224192292, 
+		 0.796427214974071, 0.067165782413524, 0.067165782413524, 
+		 0.180483211648746, 0.752351005937729, 0.180483211648746, 
+		 0.752351005937729, 0.014663182224828, 0.014663182224828, 
+		 0.080711313679564, 0.904625504095608, 0.080711313679564, 
+		 0.904625504095608};
+	static double l217[]={
+		 0.333333333333333, 0.497170540556774, 0.005658918886452, 
+		 0.497170540556774, 0.482176322624625, 0.035647354750751, 
+		 0.482176322624625, 0.450239969020782, 0.099520061958437, 
+		 0.450239969020782, 0.400266239377397, 0.199467521245206, 
+		 0.400266239377397, 0.252141267970953, 0.495717464058095, 
+		 0.252141267970953, 0.162047004658461, 0.675905990683077, 
+		 0.162047004658461, 0.075875882260746, 0.848248235478508, 
+		 0.075875882260746, 0.015654726967822, 0.968690546064356, 
+		 0.015654726967822, 0.334319867363658, 0.655493203809423, 
+		 0.010186928826919, 0.010186928826919, 0.655493203809423, 
+		 0.334319867363658, 0.292221537796944, 0.572337590532020, 
+		 0.135440871671036, 0.135440871671036, 0.572337590532020, 
+		 0.292221537796944, 0.319574885423190, 0.626001190286228, 
+		 0.054423924290583, 0.054423924290583, 0.626001190286228, 
+		 0.319574885423190, 0.190704224192292, 0.796427214974071, 
+		 0.012868560833637, 0.012868560833637, 0.796427214974071, 
+		 0.190704224192292, 0.180483211648746, 0.752351005937729, 
+		 0.067165782413524, 0.067165782413524, 0.752351005937729, 
+		 0.180483211648746, 0.080711313679564, 0.904625504095608, 
+		 0.014663182224828, 0.014663182224828, 0.904625504095608, 
+		 0.080711313679564};
+	static double l317[]={
+		 0.333333333333333, 0.497170540556774, 0.497170540556774, 
+		 0.005658918886452, 0.482176322624625, 0.482176322624625, 
+		 0.035647354750751, 0.450239969020782, 0.450239969020782, 
+		 0.099520061958437, 0.400266239377397, 0.400266239377397, 
+		 0.199467521245206, 0.252141267970953, 0.252141267970953, 
+		 0.495717464058095, 0.162047004658461, 0.162047004658461, 
+		 0.675905990683077, 0.075875882260746, 0.075875882260746, 
+		 0.848248235478508, 0.015654726967822, 0.015654726967822, 
+		 0.968690546064356, 0.655493203809423, 0.334319867363658, 
+		 0.655493203809423, 0.334319867363658, 0.010186928826919, 
+		 0.010186928826919, 0.572337590532020, 0.292221537796944, 
+		 0.572337590532020, 0.292221537796944, 0.135440871671036, 
+		 0.135440871671036, 0.626001190286228, 0.319574885423190, 
+		 0.626001190286228, 0.319574885423190, 0.054423924290583, 
+		 0.054423924290583, 0.796427214974071, 0.190704224192292, 
+		 0.796427214974071, 0.190704224192292, 0.012868560833637, 
+		 0.012868560833637, 0.752351005937729, 0.180483211648746, 
+		 0.752351005937729, 0.180483211648746, 0.067165782413524, 
+		 0.067165782413524, 0.904625504095608, 0.080711313679564, 
+		 0.904625504095608, 0.080711313679564, 0.014663182224828, 
+		 0.014663182224828};
+
+/*  p=18, npoint=70  */
+
+	static double wgt18[]={
+		 0.053364381350150, 0.015713921277179, 0.015713921277179, 
+		 0.015713921277179, 0.032495554156279, 0.032495554156279, 
+		 0.032495554156279, 0.033672969465771, 0.033672969465771, 
+		 0.033672969465771, 0.048071249104579, 0.048071249104579, 
+		 0.048071249104579, 0.055869421169115, 0.055869421169115, 
+		 0.055869421169115, 0.043429498443148, 0.043429498443148, 
+		 0.043429498443148, 0.026451755176745, 0.026451755176745, 
+		 0.026451755176745, 0.011767418126433, 0.011767418126433, 
+		 0.011767418126433,-0.003850519950463,-0.003850519950463, 
+		-0.003850519950463, 0.010967196889496, 0.010967196889496, 
+		 0.010967196889496, 0.010967196889496, 0.010967196889496, 
+		 0.010967196889496, 0.047211440790349, 0.047211440790349, 
+		 0.047211440790349, 0.047211440790349, 0.047211440790349, 
+		 0.047211440790349, 0.030617090859378, 0.030617090859378, 
+		 0.030617090859378, 0.030617090859378, 0.030617090859378, 
+		 0.030617090859378, 0.031834201210069, 0.031834201210069, 
+		 0.031834201210069, 0.031834201210069, 0.031834201210069, 
+		 0.031834201210069, 0.014037809005559, 0.014037809005559, 
+		 0.014037809005559, 0.014037809005559, 0.014037809005559, 
+		 0.014037809005559, 0.013222699422034, 0.013222699422034, 
+		 0.013222699422034, 0.013222699422034, 0.013222699422034, 
+		 0.013222699422034, 0.000079999375178, 0.000079999375178, 
+		 0.000079999375178, 0.000079999375178, 0.000079999375178, 
+		 0.000079999375178};
+	static double l118[]={
+		 0.333333333333333, 0.013310382738157, 0.493344808630921, 
+		 0.493344808630921, 0.061578811516086, 0.469210594241957, 
+		 0.469210594241957, 0.127437208225989, 0.436281395887006, 
+		 0.436281395887006, 0.210307658653168, 0.394846170673416, 
+		 0.394846170673416, 0.500410862393686, 0.249794568803157, 
+		 0.249794568803157, 0.677135612512315, 0.161432193743843, 
+		 0.161432193743843, 0.846803545029257, 0.076598227485371, 
+		 0.076598227485371, 0.951495121293100, 0.024252439353450, 
+		 0.024252439353450, 0.913707265566071, 0.043146367216965, 
+		 0.043146367216965, 0.008430536202420, 0.008430536202420, 
+		 0.358911494940944, 0.632657968856636, 0.358911494940944, 
+		 0.632657968856636, 0.131186551737188, 0.131186551737188, 
+		 0.294402476751957, 0.574410971510855, 0.294402476751957, 
+		 0.574410971510855, 0.050203151565675, 0.050203151565675, 
+		 0.325017801641814, 0.624779046792512, 0.325017801641814, 
+		 0.624779046792512, 0.066329263810916, 0.066329263810916, 
+		 0.184737559666046, 0.748933176523037, 0.184737559666046, 
+		 0.748933176523037, 0.011996194566236, 0.011996194566236, 
+		 0.218796800013321, 0.769207005420443, 0.218796800013321, 
+		 0.769207005420443, 0.014858100590125, 0.014858100590125, 
+		 0.101179597136408, 0.883962302273467, 0.101179597136408, 
+		 0.883962302273467,-0.035222015287949,-0.035222015287949, 
+		 0.020874755282586, 1.014347260005363, 0.020874755282586, 
+		 1.014347260005363};
+	static double l218[]={
+		 0.333333333333333, 0.493344808630921, 0.013310382738157, 
+		 0.493344808630921, 0.469210594241957, 0.061578811516086, 
+		 0.469210594241957, 0.436281395887006, 0.127437208225989, 
+		 0.436281395887006, 0.394846170673416, 0.210307658653168, 
+		 0.394846170673416, 0.249794568803157, 0.500410862393686, 
+		 0.249794568803157, 0.161432193743843, 0.677135612512315, 
+		 0.161432193743843, 0.076598227485371, 0.846803545029257, 
+		 0.076598227485371, 0.024252439353450, 0.951495121293100, 
+		 0.024252439353450, 0.043146367216965, 0.913707265566071, 
+		 0.043146367216965, 0.358911494940944, 0.632657968856636, 
+		 0.008430536202420, 0.008430536202420, 0.632657968856636, 
+		 0.358911494940944, 0.294402476751957, 0.574410971510855, 
+		 0.131186551737188, 0.131186551737188, 0.574410971510855, 
+		 0.294402476751957, 0.325017801641814, 0.624779046792512, 
+		 0.050203151565675, 0.050203151565675, 0.624779046792512, 
+		 0.325017801641814, 0.184737559666046, 0.748933176523037, 
+		 0.066329263810916, 0.066329263810916, 0.748933176523037, 
+		 0.184737559666046, 0.218796800013321, 0.769207005420443, 
+		 0.011996194566236, 0.011996194566236, 0.769207005420443, 
+		 0.218796800013321, 0.101179597136408, 0.883962302273467, 
+		 0.014858100590125, 0.014858100590125, 0.883962302273467, 
+		 0.101179597136408, 0.020874755282586, 1.014347260005363, 
+		-0.035222015287949,-0.035222015287949, 1.014347260005363, 
+		 0.020874755282586};
+	static double l318[]={
+		 0.333333333333333, 0.493344808630921, 0.493344808630921, 
+		 0.013310382738157, 0.469210594241957, 0.469210594241957, 
+		 0.061578811516086, 0.436281395887006, 0.436281395887006, 
+		 0.127437208225989, 0.394846170673416, 0.394846170673416, 
+		 0.210307658653168, 0.249794568803157, 0.249794568803157, 
+		 0.500410862393686, 0.161432193743843, 0.161432193743843, 
+		 0.677135612512315, 0.076598227485371, 0.076598227485371, 
+		 0.846803545029257, 0.024252439353450, 0.024252439353450, 
+		 0.951495121293100, 0.043146367216965, 0.043146367216965, 
+		 0.913707265566071, 0.632657968856636, 0.358911494940944, 
+		 0.632657968856636, 0.358911494940944, 0.008430536202420, 
+		 0.008430536202420, 0.574410971510855, 0.294402476751957, 
+		 0.574410971510855, 0.294402476751957, 0.131186551737188, 
+		 0.131186551737188, 0.624779046792512, 0.325017801641814, 
+		 0.624779046792512, 0.325017801641814, 0.050203151565675, 
+		 0.050203151565675, 0.748933176523037, 0.184737559666046, 
+		 0.748933176523037, 0.184737559666046, 0.066329263810916, 
+		 0.066329263810916, 0.769207005420443, 0.218796800013321, 
+		 0.769207005420443, 0.218796800013321, 0.011996194566236, 
+		 0.011996194566236, 0.883962302273467, 0.101179597136408, 
+		 0.883962302273467, 0.101179597136408, 0.014858100590125, 
+		 0.014858100590125, 1.014347260005363, 0.020874755282586, 
+		 1.014347260005363, 0.020874755282586,-0.035222015287949, 
+		-0.035222015287949};
+
+/*  p=19, npoint=73  */
+
+	static double wgt19[]={
+		 0.056995437856306, 0.017893352515055, 0.017893352515055, 
+		 0.017893352515055, 0.038775849701151, 0.038775849701151, 
+		 0.038775849701151, 0.052422467754193, 0.052422467754193, 
+		 0.052422467754193, 0.052811905405354, 0.052811905405354, 
+		 0.052811905405354, 0.041844983939388, 0.041844983939388, 
+		 0.041844983939388, 0.027800807314648, 0.027800807314648, 
+		 0.027800807314648, 0.014002903771278, 0.014002903771278, 
+		 0.014002903771278, 0.003601560678933, 0.003601560678933, 
+		 0.003601560678933, 0.006728804180578, 0.006728804180578, 
+		 0.006728804180578, 0.006728804180578, 0.006728804180578, 
+		 0.006728804180578, 0.044295745540949, 0.044295745540949, 
+		 0.044295745540949, 0.044295745540949, 0.044295745540949, 
+		 0.044295745540949, 0.015382176206141, 0.015382176206141, 
+		 0.015382176206141, 0.015382176206141, 0.015382176206141, 
+		 0.015382176206141, 0.027928534240338, 0.027928534240338, 
+		 0.027928534240338, 0.027928534240338, 0.027928534240338, 
+		 0.027928534240338, 0.004316169837400, 0.004316169837400, 
+		 0.004316169837400, 0.004316169837400, 0.004316169837400, 
+		 0.004316169837400, 0.031597525960379, 0.031597525960379, 
+		 0.031597525960379, 0.031597525960379, 0.031597525960379, 
+		 0.031597525960379, 0.017768353603780, 0.017768353603780, 
+		 0.017768353603780, 0.017768353603780, 0.017768353603780, 
+		 0.017768353603780, 0.006581669842530, 0.006581669842530, 
+		 0.006581669842530, 0.006581669842530, 0.006581669842530, 
+		 0.006581669842530};
+	static double l119[]={
+		 0.333333333333333, 0.020780025853987, 0.489609987073006, 
+		 0.489609987073006, 0.090926214604215, 0.454536892697893, 
+		 0.454536892697893, 0.197166638701138, 0.401416680649431, 
+		 0.401416680649431, 0.488896691193805, 0.255551654403098, 
+		 0.255551654403098, 0.645844115695741, 0.177077942152130, 
+		 0.177077942152130, 0.779877893544096, 0.110061053227952, 
+		 0.110061053227952, 0.888942751496321, 0.055528624251840, 
+		 0.055528624251840, 0.974756272445543, 0.012621863777229, 
+		 0.012621863777229, 0.003611417848412, 0.003611417848412, 
+		 0.395754787356943, 0.600633794794645, 0.395754787356943, 
+		 0.600633794794645, 0.134466754530780, 0.134466754530780, 
+		 0.307929983880436, 0.557603261588784, 0.307929983880436, 
+		 0.557603261588784, 0.014446025776115, 0.014446025776115, 
+		 0.264566948406520, 0.720987025817365, 0.264566948406520, 
+		 0.720987025817365, 0.046933578838178, 0.046933578838178, 
+		 0.358539352205951, 0.594527068955871, 0.358539352205951, 
+		 0.594527068955871, 0.002861120350567, 0.002861120350567, 
+		 0.157807405968595, 0.839331473680839, 0.157807405968595, 
+		 0.839331473680839, 0.223861424097916, 0.223861424097916, 
+		 0.075050596975911, 0.701087978926173, 0.075050596975911, 
+		 0.701087978926173, 0.034647074816760, 0.034647074816760, 
+		 0.142421601113383, 0.822931324069857, 0.142421601113383, 
+		 0.822931324069857, 0.010161119296278, 0.010161119296278, 
+		 0.065494628082938, 0.924344252620784, 0.065494628082938, 
+		 0.924344252620784};
+	static double l219[]={
+		 0.333333333333333, 0.489609987073006, 0.020780025853987, 
+		 0.489609987073006, 0.454536892697893, 0.090926214604215, 
+		 0.454536892697893, 0.401416680649431, 0.197166638701138, 
+		 0.401416680649431, 0.255551654403098, 0.488896691193805, 
+		 0.255551654403098, 0.177077942152130, 0.645844115695741, 
+		 0.177077942152130, 0.110061053227952, 0.779877893544096, 
+		 0.110061053227952, 0.055528624251840, 0.888942751496321, 
+		 0.055528624251840, 0.012621863777229, 0.974756272445543, 
+		 0.012621863777229, 0.395754787356943, 0.600633794794645, 
+		 0.003611417848412, 0.003611417848412, 0.600633794794645, 
+		 0.395754787356943, 0.307929983880436, 0.557603261588784, 
+		 0.134466754530780, 0.134466754530780, 0.557603261588784, 
+		 0.307929983880436, 0.264566948406520, 0.720987025817365, 
+		 0.014446025776115, 0.014446025776115, 0.720987025817365, 
+		 0.264566948406520, 0.358539352205951, 0.594527068955871, 
+		 0.046933578838178, 0.046933578838178, 0.594527068955871, 
+		 0.358539352205951, 0.157807405968595, 0.839331473680839, 
+		 0.002861120350567, 0.002861120350567, 0.839331473680839, 
+		 0.157807405968595, 0.075050596975911, 0.701087978926173, 
+		 0.223861424097916, 0.223861424097916, 0.701087978926173, 
+		 0.075050596975911, 0.142421601113383, 0.822931324069857, 
+		 0.034647074816760, 0.034647074816760, 0.822931324069857, 
+		 0.142421601113383, 0.065494628082938, 0.924344252620784, 
+		 0.010161119296278, 0.010161119296278, 0.924344252620784, 
+		 0.065494628082938};
+	static double l319[]={
+		 0.333333333333333, 0.489609987073006, 0.489609987073006, 
+		 0.020780025853987, 0.454536892697893, 0.454536892697893, 
+		 0.090926214604215, 0.401416680649431, 0.401416680649431, 
+		 0.197166638701138, 0.255551654403098, 0.255551654403098, 
+		 0.488896691193805, 0.177077942152130, 0.177077942152130, 
+		 0.645844115695741, 0.110061053227952, 0.110061053227952, 
+		 0.779877893544096, 0.055528624251840, 0.055528624251840, 
+		 0.888942751496321, 0.012621863777229, 0.012621863777229, 
+		 0.974756272445543, 0.600633794794645, 0.395754787356943, 
+		 0.600633794794645, 0.395754787356943, 0.003611417848412, 
+		 0.003611417848412, 0.557603261588784, 0.307929983880436, 
+		 0.557603261588784, 0.307929983880436, 0.134466754530780, 
+		 0.134466754530780, 0.720987025817365, 0.264566948406520, 
+		 0.720987025817365, 0.264566948406520, 0.014446025776115, 
+		 0.014446025776115, 0.594527068955871, 0.358539352205951, 
+		 0.594527068955871, 0.358539352205951, 0.046933578838178, 
+		 0.046933578838178, 0.839331473680839, 0.157807405968595, 
+		 0.839331473680839, 0.157807405968595, 0.002861120350567, 
+		 0.002861120350567, 0.701087978926173, 0.075050596975911, 
+		 0.701087978926173, 0.075050596975911, 0.223861424097916, 
+		 0.223861424097916, 0.822931324069857, 0.142421601113383, 
+		 0.822931324069857, 0.142421601113383, 0.034647074816760, 
+		 0.034647074816760, 0.924344252620784, 0.065494628082938, 
+		 0.924344252620784, 0.065494628082938, 0.010161119296278, 
+		 0.010161119296278};
+
+/*  p=20, npoint=79  */
+
+	static double wgt20[]={
+		 0.057256499746719, 0.001501721280705, 0.001501721280705, 
+		 0.001501721280705, 0.020195803723819, 0.020195803723819, 
+		 0.020195803723819, 0.039624016090841, 0.039624016090841, 
+		 0.039624016090841, 0.052739185030045, 0.052739185030045, 
+		 0.052739185030045, 0.053043868444611, 0.053043868444611, 
+		 0.053043868444611, 0.042206713977986, 0.042206713977986, 
+		 0.042206713977986, 0.027708365070095, 0.027708365070095, 
+		 0.027708365070095, 0.013333849876622, 0.013333849876622, 
+		 0.013333849876622,-0.001094760895106,-0.001094760895106, 
+		-0.001094760895106, 0.003033053580543, 0.003033053580543, 
+		 0.003033053580543, 0.028519670065604, 0.028519670065604, 
+		 0.028519670065604, 0.028519670065604, 0.028519670065604, 
+		 0.028519670065604, 0.008381451951650, 0.008381451951650, 
+		 0.008381451951650, 0.008381451951650, 0.008381451951650, 
+		 0.008381451951650, 0.044695409202580, 0.044695409202580, 
+		 0.044695409202580, 0.044695409202580, 0.044695409202580, 
+		 0.044695409202580, 0.014672360101834, 0.014672360101834, 
+		 0.014672360101834, 0.014672360101834, 0.014672360101834, 
+		 0.014672360101834, 0.031791643800640, 0.031791643800640, 
+		 0.031791643800640, 0.031791643800640, 0.031791643800640, 
+		 0.031791643800640, 0.001220064691226, 0.001220064691226, 
+		 0.001220064691226, 0.001220064691226, 0.001220064691226, 
+		 0.001220064691226, 0.017515684095300, 0.017515684095300, 
+		 0.017515684095300, 0.017515684095300, 0.017515684095300, 
+		 0.017515684095300, 0.006190192638113, 0.006190192638113, 
+		 0.006190192638113, 0.006190192638113, 0.006190192638113, 
+		 0.006190192638113};
+	static double l120[]={
+		 0.333333333333333,-0.001900928704400, 0.500950464352200, 
+		 0.500950464352200, 0.023574084130543, 0.488212957934729, 
+		 0.488212957934729, 0.089726636099435, 0.455136681950283, 
+		 0.455136681950283, 0.196007481363421, 0.401996259318289, 
+		 0.401996259318289, 0.488214180481157, 0.255892909759421, 
+		 0.255892909759421, 0.647023488009788, 0.176488255995106, 
+		 0.176488255995106, 0.791658289326483, 0.104170855336758, 
+		 0.104170855336758, 0.893862072318140, 0.053068963840930, 
+		 0.053068963840930, 0.916762569607942, 0.041618715196029, 
+		 0.041618715196029, 0.976836157186356, 0.011581921406822, 
+		 0.011581921406822, 0.048741583664839, 0.048741583664839, 
+		 0.344855770229001, 0.606402646106160, 0.344855770229001, 
+		 0.606402646106160, 0.006314115948605, 0.006314115948605, 
+		 0.377843269594854, 0.615842614456541, 0.377843269594854, 
+		 0.615842614456541, 0.134316520547348, 0.134316520547348, 
+		 0.306635479062357, 0.559048000390295, 0.306635479062357, 
+		 0.559048000390295, 0.013973893962392, 0.013973893962392, 
+		 0.249419362774742, 0.736606743262866, 0.249419362774742, 
+		 0.736606743262866, 0.075549132909764, 0.075549132909764, 
+		 0.212775724802802, 0.711675142287434, 0.212775724802802, 
+		 0.711675142287434,-0.008368153208227,-0.008368153208227, 
+		 0.146965436053239, 0.861402717154987, 0.146965436053239, 
+		 0.861402717154987, 0.026686063258714, 0.026686063258714, 
+		 0.137726978828923, 0.835586957912363, 0.137726978828923, 
+		 0.835586957912363, 0.010547719294141, 0.010547719294141, 
+		 0.059696109149007, 0.929756171556853, 0.059696109149007, 
+		 0.929756171556853};
+	static double l220[]={
+		 0.333333333333333, 0.500950464352200,-0.001900928704400, 
+		 0.500950464352200, 0.488212957934729, 0.023574084130543, 
+		 0.488212957934729, 0.455136681950283, 0.089726636099435, 
+		 0.455136681950283, 0.401996259318289, 0.196007481363421, 
+		 0.401996259318289, 0.255892909759421, 0.488214180481157, 
+		 0.255892909759421, 0.176488255995106, 0.647023488009788, 
+		 0.176488255995106, 0.104170855336758, 0.791658289326483, 
+		 0.104170855336758, 0.053068963840930, 0.893862072318140, 
+		 0.053068963840930, 0.041618715196029, 0.916762569607942, 
+		 0.041618715196029, 0.011581921406822, 0.976836157186356, 
+		 0.011581921406822, 0.344855770229001, 0.606402646106160, 
+		 0.048741583664839, 0.048741583664839, 0.606402646106160, 
+		 0.344855770229001, 0.377843269594854, 0.615842614456541, 
+		 0.006314115948605, 0.006314115948605, 0.615842614456541, 
+		 0.377843269594854, 0.306635479062357, 0.559048000390295, 
+		 0.134316520547348, 0.134316520547348, 0.559048000390295, 
+		 0.306635479062357, 0.249419362774742, 0.736606743262866, 
+		 0.013973893962392, 0.013973893962392, 0.736606743262866, 
+		 0.249419362774742, 0.212775724802802, 0.711675142287434, 
+		 0.075549132909764, 0.075549132909764, 0.711675142287434, 
+		 0.212775724802802, 0.146965436053239, 0.861402717154987, 
+		-0.008368153208227,-0.008368153208227, 0.861402717154987, 
+		 0.146965436053239, 0.137726978828923, 0.835586957912363, 
+		 0.026686063258714, 0.026686063258714, 0.835586957912363, 
+		 0.137726978828923, 0.059696109149007, 0.929756171556853, 
+		 0.010547719294141, 0.010547719294141, 0.929756171556853, 
+		 0.059696109149007};
+	static double l320[]={
+		 0.333333333333333, 0.500950464352200, 0.500950464352200, 
+		-0.001900928704400, 0.488212957934729, 0.488212957934729, 
+		 0.023574084130543, 0.455136681950283, 0.455136681950283, 
+		 0.089726636099435, 0.401996259318289, 0.401996259318289, 
+		 0.196007481363421, 0.255892909759421, 0.255892909759421, 
+		 0.488214180481157, 0.176488255995106, 0.176488255995106, 
+		 0.647023488009788, 0.104170855336758, 0.104170855336758, 
+		 0.791658289326483, 0.053068963840930, 0.053068963840930, 
+		 0.893862072318140, 0.041618715196029, 0.041618715196029, 
+		 0.916762569607942, 0.011581921406822, 0.011581921406822, 
+		 0.976836157186356, 0.606402646106160, 0.344855770229001, 
+		 0.606402646106160, 0.344855770229001, 0.048741583664839, 
+		 0.048741583664839, 0.615842614456541, 0.377843269594854, 
+		 0.615842614456541, 0.377843269594854, 0.006314115948605, 
+		 0.006314115948605, 0.559048000390295, 0.306635479062357, 
+		 0.559048000390295, 0.306635479062357, 0.134316520547348, 
+		 0.134316520547348, 0.736606743262866, 0.249419362774742, 
+		 0.736606743262866, 0.249419362774742, 0.013973893962392, 
+		 0.013973893962392, 0.711675142287434, 0.212775724802802, 
+		 0.711675142287434, 0.212775724802802, 0.075549132909764, 
+		 0.075549132909764, 0.861402717154987, 0.146965436053239, 
+		 0.861402717154987, 0.146965436053239,-0.008368153208227, 
+		-0.008368153208227, 0.835586957912363, 0.137726978828923, 
+		 0.835586957912363, 0.137726978828923, 0.026686063258714, 
+		 0.026686063258714, 0.929756171556853, 0.059696109149007, 
+		 0.929756171556853, 0.059696109149007, 0.010547719294141, 
+		 0.010547719294141};
+
+	static double* wgtp[MAX_TRIA_SYM_ORD]={wgt1 ,wgt2 ,wgt3 ,wgt4 ,wgt5 ,
+										   wgt6 ,wgt7 ,wgt8 ,wgt9 ,wgt10,
+										   wgt11,wgt12,wgt13,wgt14,wgt15,
+										   wgt16,wgt17,wgt18,wgt19,wgt20};
+	static double* l1p [MAX_TRIA_SYM_ORD]={l11  ,l12  ,l13  ,l14  ,l15  ,
+										   l16  ,l17  ,l18  ,l19  ,l110 ,
+										   l111 ,l112 ,l113 ,l114 ,l115 ,
+										   l116 ,l117 ,l118 ,l119 ,l120 };
+	static double* l2p [MAX_TRIA_SYM_ORD]={l21  ,l22  ,l23  ,l24  ,l25  ,
+										   l26  ,l27  ,l28  ,l29  ,l210 ,
+										   l211 ,l212 ,l213 ,l214 ,l215 ,
+										   l216 ,l217 ,l218 ,l219 ,l220 };
+	static double* l3p [MAX_TRIA_SYM_ORD]={l31  ,l32  ,l33  ,l34  ,l35  ,
+										   l36  ,l37  ,l38  ,l39  ,l310 ,
+										   l311 ,l312 ,l313 ,l314 ,l315 ,
+										   l316 ,l317 ,l318 ,l319 ,l320 };
+
+	static int np[MAX_TRIA_SYM_ORD]={sizeof(wgt1 )/sizeof(double),
+									 sizeof(wgt2 )/sizeof(double),
+									 sizeof(wgt3 )/sizeof(double),
+									 sizeof(wgt4 )/sizeof(double),
+									 sizeof(wgt5 )/sizeof(double),
+									 sizeof(wgt6 )/sizeof(double),
+									 sizeof(wgt7 )/sizeof(double),
+									 sizeof(wgt8 )/sizeof(double),
+									 sizeof(wgt9 )/sizeof(double),
+									 sizeof(wgt10)/sizeof(double),
+									 sizeof(wgt11)/sizeof(double),
+									 sizeof(wgt12)/sizeof(double),
+									 sizeof(wgt13)/sizeof(double),
+									 sizeof(wgt14)/sizeof(double),
+									 sizeof(wgt15)/sizeof(double),
+									 sizeof(wgt16)/sizeof(double),
+									 sizeof(wgt17)/sizeof(double),
+									 sizeof(wgt18)/sizeof(double),
+									 sizeof(wgt19)/sizeof(double),
+									 sizeof(wgt20)/sizeof(double)};
+
+//	_printf_("GaussTria: iord=%d\n",iord);
+
+/*  check to see if Gauss points need to be calculated  */
+
+	if (iord <= MAX_TRIA_SYM_ORD) {
+
+/*  copy the points from the static arrays (noting that the pointers
+	could be returned directly, but then the calling function would
+	have to know to not free them)  */
+
+		*pngaus=np[iord-1];
+
+		*pl1  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl2  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl3  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pwgt = (double *) xmalloc(*pngaus*sizeof(double));
+
+		for (i=0; i<*pngaus; i++) {
+			(*pl1 )[i]=l1p [iord-1][i];
+			(*pl2 )[i]=l2p [iord-1][i];
+			(*pl3 )[i]=l3p [iord-1][i];
+			(*pwgt)[i]=wgtp[iord-1][i];
+		}
+	}
+
+	else {
+
+/*  calculate the Gauss points from the collapsed quadrilateral  */
+
+		nigaus =iord/2+1;
+		*pngaus=nigaus*nigaus;
+
+		*pl1  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl2  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl3  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pwgt = (double *) xmalloc(*pngaus*sizeof(double));
+
+/*  get the gauss points in each direction  */
+
+		if ((ierr=GaussLegendre(&xgaus,
+								&xwgt,
+								nigaus))) {
+			_printf_("%s -- Error %d from GaussLegendre for nigaus=%d.\n",
+					 __FUNCT__,ierr,nigaus);
+			return(ierr);
+		}
+
+		egaus=xgaus;
+		ewgt =xwgt;
+
+/*  collapse the gauss points into the triangle and transform into
+	area coordinates  */
+
+		ipt=0;
+		for (j=0; j<nigaus; j++) {
+			for (i=0; i<nigaus; i++) {
+				xi        =      1./2.*(1.-egaus[j])*xgaus[i];
+				eta       =sqrt(3.)/2.*(1.+egaus[j]);
+				(*pwgt)[ipt]=xwgt[i]*ewgt[j]*(sqrt(3.)/4.*(1.-egaus[j]));
+
+				(*pl1 )[ipt]=(1.-xi-eta/sqrt(3.))/2.;
+				(*pl2 )[ipt]=(1.+xi-eta/sqrt(3.))/2.;
+				(*pl3 )[ipt]=       eta/sqrt(3.);
+
+				ipt++;
+			}
+		}
+
+		xfree((void **)&xwgt );
+		xfree((void **)&xgaus);
+	}
+
+//	_printf_("GaussTria - ngaus=%d\n",*pngaus);
+//	for (i=0; i<*pngaus; i++)
+//		_printf_("i=%d: l1gaus=%f,l2gaus=%f,l3gaus=%f,wgt=%f\n",
+//				 i,(*pl1 )[i],(*pl2 )[i],(*pl3 )[i],(*pwgt)[i]);
+
+	return 1;
+}
+
+
+/*=======1=========2=========3=========4=========5=========6=========7=========8
+
+	GaussHexa.c    Gauss quadrature points for the hexahedron.
+
+	04/25/05    jes    Initial development.
+
+	Input:
+		int         nigaus    number of xi gauss points
+		int         njgaus    number of eta gauss points
+		int         nkgaus    number of zeta gauss points
+
+	Output:
+		double**    pxgaus    abscissas of xi gauss points
+								  (allocated below)
+		double**    pxwgt     weights of xi gauss points
+								  (allocated below)
+		double**    pegaus    abscissas of eta gauss points
+								  (allocated below)
+		double**    pewgt     weights of eta gauss points
+								  (allocated below)
+		double**    pzgaus    abscissas of zeta gauss points
+								  (allocated below)
+		double**    pzwgt     weights of zeta gauss points
+								  (allocated below)
+		int                   function return value
+
+=========1=========2=========3=========4=========5=========6=========7========*/
+#undef __FUNCT__ 
+#define __FUNCT__ "GaussHexa"
+int GaussHexa( double** pxgaus,
+			   double** pxwgt,
+			   double** pegaus,
+			   double** pewgt,
+			   double** pzgaus,
+			   double** pzwgt,
+			   int nigaus,
+			   int njgaus,
+			   int nkgaus )
+{ 
+	int i,ierr=0;
+
+//	_printf_("GaussHexa: nigaus=%d,njgaus=%d,nkgaus=%d\n",
+//			 nigaus,njgaus,nkgaus);
+
+/*  get the gauss points using the product of three line rules  */
+
+	if ((ierr=GaussLegendre(pxgaus,
+							pxwgt,
+							nigaus))) {
+		_printf_("%s -- Error %d from GaussLegendre for nigaus=%d.\n",
+				 __FUNCT__,ierr,nigaus);
+		return(ierr);
+	}
+//	for (i=0; i<nigaus; i++)
+//		_printf_("i=%d: xgaus=%f,xwgt=%f\n",i,(*pxgaus)[i],(*pxwgt)[i]);
+
+	if ((ierr=GaussLegendre(pegaus,
+							pewgt,
+							njgaus))) {
+		_printf_("%s -- Error %d from GaussLegendre for njgaus=%d.\n",
+				 __FUNCT__,ierr,njgaus);
+		return(ierr);
+	}
+//	for (i=0; i<njgaus; i++)
+//		_printf_("j=%d: egaus=%f,ewgt=%f\n",i,(*pegaus)[i],(*pewgt)[i]);
+
+	if ((ierr=GaussLegendre(pzgaus,
+							pzwgt,
+							nkgaus))) {
+		_printf_("%s -- Error %d from GaussLegendre for nkgaus=%d.\n",
+				 __FUNCT__,ierr,nkgaus);
+		return(ierr);
+	}
+//	for (i=0; i<nkgaus; i++)
+//		_printf_("k=%d: zgaus=%f,zwgt=%f\n",i,(*pzgaus)[i],(*pzwgt)[i]);
+
+	return 1;
+}
+
+
+/*=======1=========2=========3=========4=========5=========6=========7=========8
+
+	GaussPenta.c    Gauss quadrature points for the pentahedron.
+
+	04/26/05    jes    Initial development.
+
+	Input:
+		int         iord      order for the tria Gauss quadrature
+		int         nkgaus    number of zeta gauss points
+
+	Output:
+		int*        pngaus    number of tria Gauss points
+		double**    pl1       first area coordinates of tria gauss points
+								  (allocated below)
+		double**    pl2       second area coordinates of tria gauss points
+								  (allocated below)
+		double**    pl3       third area coordinates of tria gauss points
+								  (allocated below)
+		double**    pwgt      weights of tria gauss points
+								  (allocated below)
+		double**    pzgaus    abscissas of zeta gauss points
+								  (allocated below)
+		double**    pzwgt     weights of zeta gauss points
+								  (allocated below)
+		int                   function return value
+
+=========1=========2=========3=========4=========5=========6=========7========*/
+#undef __FUNCT__ 
+#define __FUNCT__ "GaussPenta"
+
+int GaussPenta( int* pngaus,
+				double** pl1,
+				double** pl2,
+				double** pl3,
+				double** pwgt,
+				double** pzgaus,
+				double** pzwgt,
+				int iord,
+				int nkgaus )
+{ 
+	int i,ierr=0;
+
+//	_printf_("GaussPenta: iord=%d,nkgaus=%d\n",
+//			 iord,nkgaus);
+
+/*  get the gauss points using the product of triangular and line rules  */
+
+	if ((ierr=GaussTria(pngaus,
+						pl1,
+						pl2,
+						pl3,
+						pwgt,
+						iord))) {
+		_printf_("%s -- Error %d from GaussTria for iord=%d.\n",
+				 __FUNCT__,ierr,iord);
+		return(ierr);
+	}
+//	for (i=0; i<*pngaus; i++)
+//		_printf_("i=%d: l1gaus=%f,l2gaus=%f,l3gaus=%f,wgt=%f\n",
+//				 i,(*pl1 )[i],(*pl2 )[i],(*pl3 )[i],(*pwgt)[i]);
+
+	if ((ierr=GaussLegendre(pzgaus,
+							pzwgt,
+							nkgaus))) {
+		_printf_("%s -- Error %d from GaussLegendre for nkgaus=%d.\n",
+				 __FUNCT__,ierr,nkgaus);
+		return(ierr);
+	}
+//	for (i=0; i<nkgaus; i++)
+//		_printf_("k=%d: zgaus=%f,zwgt=%f\n",i,(*pzgaus)[i],(*pzwgt)[i]);
+
+	return 1;
+}
+
+
+/*=======1=========2=========3=========4=========5=========6=========7=========8
+
+	GaussTetra.c    Gauss quadrature points for the tetrahedron.
+
+	04/22/05    jes    Initial development.
+
+	Input:
+		int         iord     order for the Gauss quadrature
+
+	Output:
+		int*        pngaus    number of Gauss points
+		double**    pl1       first volume coordinates of Gauss points
+								  (allocated below)
+		double**    pl2       second volume coordinates of Gauss points
+								  (allocated below)
+		double**    pl3       third volume coordinates of Gauss points
+								  (allocated below)
+		double**    pl4       third volume coordinates of Gauss points
+								  (allocated below)
+		double**    pwgt      weights of Gauss points
+								  (allocated below)
+		int                   function return value
+
+	p=2-3 points from Y. Jinyun, "Symmetric Gaussian Quadrature
+	Formulae for Tetrahedronal Regions", Computer Methods in Applied
+	Mechanics and Engineering, Vol. 43, pp. 349-353 (1984).
+
+	p=4-6 points from P. Keast, "Moderate-Degree Tetrahedral
+	Quadrature Formulas", Computer Methods in Applied Mechanics and
+	Engineering, Vol. 55, pp. 339-348 (1986).
+
+=========1=========2=========3=========4=========5=========6=========7========*/
+#undef __FUNCT__ 
+#define __FUNCT__ "GaussTetra"
+
+int GaussTetra( int* pngaus,
+				double** pl1,
+				double** pl2,
+				double** pl3,
+				double** pl4,
+				double** pwgt,
+				int iord )
+{
+	int i,j,k,ipt,nigaus,ierr=0;
+	double xi,eta,zeta;
+	double *xgaus=NULL,*xwgt=NULL,*egaus,*ewgt,*zgaus,*zwgt;
+
+/*  p= 1, npoint= 1  */
+
+	static double wgt1[]={
+		 1.000000000000000};
+	static double l11[]={
+		 0.250000000000000};
+	static double l21[]={
+		 0.250000000000000};
+	static double l31[]={
+		 0.250000000000000};
+	static double l41[]={
+		 0.250000000000000};
+
+/*  p= 2, npoint= 4  */
+
+	static double wgt2[]={
+		 0.250000000000000, 0.250000000000000, 0.250000000000000,
+		 0.250000000000000};
+	static double l12[]={
+		 0.585410196624969, 0.138196601125011, 0.138196601125011,
+		 0.138196601125011};
+	static double l22[]={
+		 0.138196601125011, 0.585410196624969, 0.138196601125011,
+		 0.138196601125011};
+	static double l32[]={
+		 0.138196601125011, 0.138196601125011, 0.585410196624969,
+		 0.138196601125011};
+	static double l42[]={
+		 0.138196601125011, 0.138196601125011, 0.138196601125011,
+		 0.585410196624969};
+
+/*  p= 3, npoint= 5  */
+
+	static double wgt3[]={
+		-0.800000000000000, 0.450000000000000, 0.450000000000000, 
+		 0.450000000000000, 0.450000000000000};
+	static double l13[]={
+		 0.250000000000000, 0.500000000000000, 0.166666666666667, 
+		 0.166666666666667, 0.166666666666667};
+	static double l23[]={
+		 0.250000000000000, 0.166666666666667, 0.500000000000000, 
+		 0.166666666666667, 0.166666666666667};
+	static double l33[]={
+		 0.250000000000000, 0.166666666666667, 0.166666666666667, 
+		 0.500000000000000, 0.166666666666667};
+	static double l43[]={
+		 0.250000000000000, 0.166666666666667, 0.166666666666667, 
+		 0.166666666666667, 0.500000000000000};
+
+/*  p= 4, npoint=11  */
+
+	static double wgt4[]={
+		-0.013155555555556, 0.007622222222222, 0.007622222222222, 
+		 0.007622222222222, 0.007622222222222, 0.024888888888889,
+		 0.024888888888889, 0.024888888888889, 0.024888888888889, 
+		 0.024888888888889, 0.024888888888889};
+	static double l14[]={
+		 0.250000000000000, 0.785714285714286, 0.071428571428571, 
+		 0.071428571428571, 0.071428571428571, 0.399403576166799,
+		 0.399403576166799, 0.399403576166799, 0.100596423833201, 
+		 0.100596423833201, 0.100596423833201};
+	static double l24[]={
+		 0.250000000000000, 0.071428571428571, 0.785714285714286, 
+		 0.071428571428571, 0.071428571428571, 0.399403576166799,
+		 0.100596423833201, 0.100596423833201, 0.399403576166799, 
+		 0.399403576166799, 0.100596423833201};
+	static double l34[]={
+		 0.250000000000000, 0.071428571428571, 0.071428571428571, 
+		 0.785714285714286, 0.071428571428571, 0.100596423833201, 
+		 0.399403576166799, 0.100596423833201, 0.399403576166799,
+		 0.100596423833201, 0.399403576166799};
+	static double l44[]={
+		 0.250000000000000, 0.071428571428571, 0.071428571428571, 
+		 0.071428571428571, 0.785714285714286, 0.100596423833201, 
+		 0.100596423833201, 0.399403576166799, 0.100596423833201,
+		 0.399403576166799, 0.399403576166799};
+
+/*  p= 5, npoint=15  */
+
+	static double wgt5[]={
+		 0.030283678097089, 0.006026785714286, 0.006026785714286, 
+		 0.006026785714286, 0.006026785714286, 0.011645249086029, 
+		 0.011645249086029, 0.011645249086029, 0.011645249086029,
+		 0.010949141561386, 0.010949141561386, 0.010949141561386,
+		 0.010949141561386, 0.010949141561386, 0.010949141561386};
+	static double l15[]={
+		 0.250000000000000, 0.000000000000000, 0.333333333333333, 
+		 0.333333333333333, 0.333333333333333, 0.727272727272727, 
+		 0.090909090909091, 0.090909090909091, 0.090909090909091, 
+		 0.066550153573664, 0.066550153573664, 0.066550153573664, 
+		 0.433449846426336, 0.433449846426336, 0.433449846426336};
+	static double l25[]={
+		 0.250000000000000, 0.333333333333333, 0.000000000000000, 
+		 0.333333333333333, 0.333333333333333, 0.090909090909091, 
+		 0.727272727272727, 0.090909090909091, 0.090909090909091, 
+		 0.066550153573664, 0.433449846426336, 0.433449846426336, 
+		 0.066550153573664, 0.066550153573664, 0.433449846426336};
+	static double l35[]={
+		 0.250000000000000, 0.333333333333333, 0.333333333333333, 
+		 0.000000000000000, 0.333333333333333, 0.090909090909091, 
+		 0.090909090909091, 0.727272727272727, 0.090909090909091, 
+		 0.433449846426336, 0.066550153573664, 0.433449846426336, 
+		 0.066550153573664, 0.433449846426336, 0.066550153573664};
+	static double l45[]={
+		 0.250000000000000, 0.333333333333333, 0.333333333333333, 
+		 0.333333333333333, 0.000000000000000, 0.090909090909091, 
+		 0.090909090909091, 0.090909090909091, 0.727272727272727, 
+		 0.433449846426336, 0.433449846426336, 0.066550153573664, 
+		 0.433449846426336, 0.066550153573664, 0.066550153573664};
+
+/*  p= 6, npoint=24  */
+
+	static double wgt6[]={
+		 0.006653791709695, 0.006653791709695, 0.006653791709695, 
+		 0.006653791709695, 0.001679535175887, 0.001679535175887, 
+		 0.001679535175887, 0.001679535175887, 0.009226196923942, 
+		 0.009226196923942, 0.009226196923942, 0.009226196923942,
+		 0.008035714285714, 0.008035714285714, 0.008035714285714, 
+		 0.008035714285714, 0.008035714285714, 0.008035714285714, 
+		 0.008035714285714, 0.008035714285714, 0.008035714285714, 
+		 0.008035714285714, 0.008035714285714, 0.008035714285714};
+	static double l16[]={
+		 0.356191386222545, 0.214602871259152, 0.214602871259152, 
+		 0.214602871259152, 0.877978124396166, 0.040673958534611, 
+		 0.040673958534611, 0.040673958534611, 0.032986329573173, 
+		 0.322337890142276, 0.322337890142276, 0.322337890142276,
+
+		 0.063661001875018, 0.063661001875018, 0.063661001875018, 
+		 0.063661001875018, 0.063661001875018, 0.063661001875018, 
+		 0.269672331458316, 0.603005664791649, 0.269672331458316, 
+		 0.603005664791649, 0.269672331458316, 0.603005664791649};
+	static double l26[]={
+		 0.214602871259152, 0.356191386222545, 0.214602871259152, 
+		 0.214602871259152, 0.040673958534611, 0.877978124396166, 
+		 0.040673958534611, 0.040673958534611, 0.322337890142276, 
+		 0.032986329573173, 0.322337890142276, 0.322337890142276,
+
+		 0.063661001875018, 0.063661001875018, 0.269672331458316, 
+		 0.603005664791649, 0.269672331458316, 0.603005664791649, 
+		 0.063661001875018, 0.063661001875018, 0.063661001875018, 
+		 0.063661001875018, 0.603005664791649, 0.269672331458316};
+	static double l36[]={
+		 0.214602871259152, 0.214602871259152, 0.356191386222545, 
+		 0.214602871259152, 0.040673958534611, 0.040673958534611, 
+		 0.877978124396166, 0.040673958534611, 0.322337890142276, 
+		 0.322337890142276, 0.032986329573173, 0.322337890142276,
+
+		 0.269672331458316, 0.603005664791649, 0.063661001875018, 
+		 0.063661001875018, 0.603005664791649, 0.269672331458316, 
+		 0.063661001875018, 0.063661001875018, 0.603005664791649, 
+		 0.269672331458316, 0.063661001875018, 0.063661001875018};
+	static double l46[]={
+		 0.214602871259152, 0.214602871259152, 0.214602871259152, 
+		 0.356191386222545, 0.040673958534611, 0.040673958534611, 
+		 0.040673958534611, 0.877978124396166, 0.322337890142276, 
+		 0.322337890142276, 0.322337890142276, 0.032986329573173,
+
+		 0.603005664791649, 0.269672331458316, 0.603005664791649, 
+		 0.269672331458316, 0.063661001875018, 0.063661001875018, 
+		 0.603005664791649, 0.269672331458316, 0.063661001875018, 
+		 0.063661001875018, 0.063661001875018, 0.063661001875018};
+
+	static double* wgtp[MAX_TETRA_SYM_ORD]={wgt1 ,wgt2 ,wgt3 ,wgt4 ,wgt5 ,
+											wgt6 };
+	static double* l1p [MAX_TETRA_SYM_ORD]={l11  ,l12  ,l13  ,l14  ,l15  ,
+											l16  };
+	static double* l2p [MAX_TETRA_SYM_ORD]={l21  ,l22  ,l32  ,l24  ,l25  ,
+											l26  };
+	static double* l3p [MAX_TETRA_SYM_ORD]={l31  ,l32  ,l33  ,l34  ,l35  ,
+											l36  };
+	static double* l4p [MAX_TETRA_SYM_ORD]={l41  ,l42  ,l43  ,l44  ,l45  ,
+											l46  };
+
+	static int np[MAX_TETRA_SYM_ORD]={sizeof(wgt1 )/sizeof(double),
+									  sizeof(wgt2 )/sizeof(double),
+									  sizeof(wgt3 )/sizeof(double),
+									  sizeof(wgt4 )/sizeof(double),
+									  sizeof(wgt5 )/sizeof(double),
+									  sizeof(wgt6 )/sizeof(double)};
+
+//	_printf_("GaussTetra: iord=%d\n",iord);
+
+/*  check to see if Gauss points need to be calculated  */
+
+	if (iord <= MAX_TETRA_SYM_ORD) {
+
+/*  copy the points from the static arrays (noting that the pointers
+	could be returned directly, but then the calling function would
+	have to know to not free them), and multiply the weights by the
+	volume of the parametric tetrahedron  */
+
+		*pngaus=np[iord-1];
+
+		*pl1  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl2  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl3  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl4  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pwgt = (double *) xmalloc(*pngaus*sizeof(double));
+
+		for (i=0; i<*pngaus; i++) {
+			(*pl1 )[i]=l1p [iord-1][i];
+			(*pl2 )[i]=l2p [iord-1][i];
+			(*pl3 )[i]=l3p [iord-1][i];
+			(*pl4 )[i]=l4p [iord-1][i];
+			(*pwgt)[i]=wgtp[iord-1][i]*2./3.*sqrt(2.);
+		}
+	}
+
+	else {
+
+/*  calculate the Gauss points from the collapsed hexahedron  */
+
+		nigaus =iord/2+1;
+		*pngaus=nigaus*nigaus*nigaus;
+
+		*pl1  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl2  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl3  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pl4  = (double *) xmalloc(*pngaus*sizeof(double));
+		*pwgt = (double *) xmalloc(*pngaus*sizeof(double));
+
+/*  get the gauss points in each direction  */
+
+		if ((ierr=GaussLegendre(&xgaus,
+								&xwgt,
+								nigaus))) {
+			_printf_("%s -- Error %d from GaussLegendre for nigaus=%d.\n",
+					 __FUNCT__,ierr,nigaus);
+			return(ierr);
+		}
+
+		egaus=xgaus;
+		ewgt =xwgt;
+		zgaus=xgaus;
+		zwgt =xwgt;
+
+/*  collapse the gauss points into the tetrahedron and transform into
+	volume coordinates  */
+
+		ipt=0;
+		for (k=0; k<nigaus; k++) {
+			for (j=0; j<nigaus; j++) {
+				for (i=0; i<nigaus; i++) {
+					xi        =1./4.*(1.-egaus[j])*(1.-zgaus[k])*xgaus[i];
+					eta       =1./4./sqrt(3.)
+							   *(5.+3.*egaus[j]-zgaus[k]-3.*egaus[j]*zgaus[k]);
+					zeta      =sqrt(2./3.)*(1.+zgaus[k]);
+					(*pwgt)[ipt]=xwgt[i]*ewgt[j]*zwgt[k]
+								 *(sqrt(2.)/16.
+							 	   *(1.-egaus[j])*pow(1.-zgaus[k],2.));
+
+					(*pl1 )[ipt]=(1.-xi-eta/sqrt(3.)-zeta/sqrt(6.))/2.;
+					(*pl2 )[ipt]=(1.+xi-eta/sqrt(3.)-zeta/sqrt(6.))/2.;
+					(*pl3 )[ipt]=(      eta         -zeta/sqrt(8.))/sqrt(3.);
+					(*pl4 )[ipt]=(                   zeta/sqrt(8.))*sqrt(3.);
+
+					ipt++;
+				}
+			}
+		}
+
+		xfree((void **)&xwgt );
+		xfree((void **)&xgaus);
+	}
+
+//	_printf_("GaussTetra - ngaus=%d\n",*pngaus);
+//	for (i=0; i<*pngaus; i++)
+//		_printf_("i=%d: l1gaus=%f,l2gaus=%f,l3gaus=%f,l4gaus=%f,wgt=%f\n",
+//				 i,(*pl1 )[i],(*pl2 )[i],(*pl3 )[i],(*pl4 )[i],(*pwgt)[i]);
+
+	return 1;
+}
+
+
+/*
+ * GaussSegment.c: 
+ *
+ * This routine computes gaussian points on a reference segment from -1 to 1.
+ * The order p of integration depends on the number of gaussian points and can be computed from the polynomial degree p that needs to be integrated.
+ * numgauss= (p+1) /2 */
+
+void GaussSegment(double** psegment_coord,double** pgauss_weights,int num_gauss){
+
+	double* segment_coord=NULL;
+	double* gauss_weights=NULL;
+	
+	
+	if (num_gauss==1){
+		//order=1, num_gauss=1. Can integrate polynomials of degree 0 to 1
+
+		gauss_weights=(double*)xmalloc(sizeof(double));
+		gauss_weights[0]= 2.0;
+		
+		segment_coord=(double*)xmalloc(sizeof(double));
+		segment_coord[0]= 0.0;
+		
+	}
+	else if (num_gauss==2){
+		//order=2, num_gauss=3. Can integrate polynomials of degree 0 to 3
+		
+		gauss_weights=(double*)xmalloc(num_gauss*sizeof(double));
+		gauss_weights[0]=1.0;
+		gauss_weights[1]=1.0;
+	
+		segment_coord=(double*)xmalloc(num_gauss*sizeof(double));
+		segment_coord[0]=-0.577350269189626;
+		segment_coord[1]=0.577350269189626;
+	
+	}
+	else if (num_gauss==3){
+		//order=3, num_gauss=4. Can integrate polynomials of degree 0 to 5
+
+		gauss_weights=(double*)xmalloc(num_gauss*sizeof(double));
+		gauss_weights[0]=0.555555555555555556;
+		gauss_weights[1]=0.88888888888889;
+		gauss_weights[2]=0.555555555555555556;
+		
+		segment_coord=(double*)xmalloc(num_gauss*sizeof(double));
+		segment_coord[0]=-0.774596669241483;
+		segment_coord[1]=0.0;
+		segment_coord[2]=0.774596669241483;
+		
+	}
+	else{
+		_printf_("GaussSegment error message: order not supported yet");
+	}
+
+	/*Assign output pointers: */
+	*pgauss_weights=gauss_weights;
+	*psegment_coord=segment_coord;
+	return;
+}
Index: /issm/trunk/src/c/shared/Numerics/GaussPoints.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/GaussPoints.h	(revision 28275)
+++ /issm/trunk/src/c/shared/Numerics/GaussPoints.h	(revision 1)
@@ -3,18 +3,75 @@
  */ 
 
-#include "../../shared/Numerics/types.h"
 #ifndef _GAUSSPOINTS_H
 #define _GAUSSPOINTS_H
 
-#define MAX_LINE_GAUS_PTS    7
-void GaussLegendreLinear(IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus);
-#define MAX_TRIA_SYM_ORD    20
-void GaussLegendreTria(int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pwgt, int iord);
-#define MAX_TETRA_SYM_ORD    6
-void GaussLegendreTetra(int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pl4, IssmDouble** pwgt, int iord);
-#define MAX_LINE_GLOB_PTS    5
-void GaussLobatto(IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus);
+
+#define    MAX_LINE_GAUS_PTS    4
+
+int GaussLegendre( double** pxgaus,
+				   double** pxwgt,
+				   int ngaus );
+
+#define    MAX_LINE_GLOB_PTS    5
+
+int GaussLobatto( double** pxgaus,
+				  double** pxwgt,
+				  int ngaus );
+
 #define MAX_GAUS_ITER   30
-void GaussRecur(IssmPDouble* zero, IssmPDouble* weight, int n, IssmPDouble* alpha, IssmPDouble* beta);
+
+int GaussRecur( double* zero,
+				double* weight,
+				int n,
+				double* alpha,
+				double* beta );
+
+int GaussQuad( double** pxgaus,
+			   double** pxwgt,
+			   double** pegaus,
+			   double** pewgt,
+			   int nigaus,
+			   int njgaus );
+
+#define    MAX_TRIA_SYM_ORD    20
+
+int GaussTria( int* pngaus,
+			   double** pl1,
+			   double** pl2,
+			   double** pl3,
+			   double** pwgt,
+			   int iord );
+
+int GaussHexa( double** pxgaus,
+			   double** pxwgt,
+			   double** pegaus,
+			   double** pewgt,
+			   double** pzgaus,
+			   double** pzwgt,
+			   int nigaus,
+			   int njgaus,
+			   int nkgaus );
+
+int GaussPenta( int* pngaus,
+				double** pl1,
+				double** pl2,
+				double** pl3,
+				double** pwgt,
+				double** pzgaus,
+				double** pzwgt,
+				int iord,
+				int nkgaus );
+
+#define    MAX_TETRA_SYM_ORD    6
+
+int GaussTetra( int* pngaus,
+				double** pl1,
+				double** pl2,
+				double** pl3,
+				double** pl4,
+				double** pwgt,
+				int iord );
+void GaussSegment(double** psegment_coord,double** pgauss_weights,int num_gauss);
 
 #endif
+
Index: sm/trunk/src/c/shared/Numerics/NewtonSolveDnorm.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/NewtonSolveDnorm.cpp	(revision 28275)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#include <math.h>
-#include "./types.h"
-#include "../Exceptions/exceptions.h"
-
-int NewtonSolveDnorm(IssmDouble* pdnorm,IssmDouble c1,IssmDouble c2,IssmDouble c3,IssmDouble n,IssmDouble dnorm){
-	/* solve the following equation using Newton-Raphson
-	 *
-	 *   c1*x^(s-1) + c2*x = c3
-	 *
-	 *   s = (1+n)/n
-	 *
-	 *   we solve y = 10^x:
-	 */
-
-	/*trivial solution*/
-	if(c3==0.){
-		*pdnorm = 0.;
-		return 0;
-	}
-
-	/*Intermediaries*/
-	int        counter = 0;
-	IssmDouble s = (1.+n)/n;
-	IssmDouble y2;
-	IssmDouble threshold = 1.e-12;
-
-	/*Initial guess*/
-	_assert_(dnorm>0.); 
-	IssmDouble y1 = log10(dnorm);
-
-	while(true){
-
-		/*Newton step*/
-		y2 = y1 - (c1*pow(pow(10.,y1),s-1.) + c2*pow(10.,y1) - c3)/((s-1)*c1*log(10.)*pow(pow(10.,y1),s-1.) + c2*log(10.)*pow(10.,y1));
-
-		if( fabs(y2-y1)/(fabs(y2))<threshold ){
-			break;
-		}
-		else{
-			y1=y2;
-			counter++;
-		}
-
-		if(counter>50) break;
-	}
-
-	/*Avoid extremely large values that indicate non convergence*/
-	if(y2>50.) y2 = 50;
-
-	/*Assign output pointer*/
-	*pdnorm = pow(10.,y2);
-	return 0;
-}
Index: sm/trunk/src/c/shared/Numerics/ODE1.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/ODE1.cpp	(revision 28275)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#include <math.h>
-#include "./types.h"
-#include "../Exceptions/exceptions.h"
-
-IssmDouble ODE1(IssmDouble alpha,IssmDouble beta,IssmDouble Si, IssmDouble dt,int method){
-	/* solve the following equation:
-	 *
-	 *   dS/dt = alpha S + beta
-	 *
-	 *   method 0: Forward Euler (explicit)
-	 *   method 1: backward Euler (implicit)
-	 *   method 2: Crank Nicolson
-	 *
-	 *   return S^{i+1} based on  Si, dt, alpha and beta
-	 */
-
-	switch(method){
-		case 0: return Si*(1.+alpha*dt) + beta*dt;
-		case 1: return (Si+beta*dt)/(1.-alpha*dt);
-		case 2: return (Si*(1.+alpha*dt/2.) + beta*dt)/(1-alpha*dt/2.);
-		default: _error_("not supported yet");
-	}
-}
Index: sm/trunk/src/c/shared/Numerics/OptPars.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/OptPars.h	(revision 28275)
+++ 	(revision )
@@ -1,21 +1,0 @@
-/*!\file:  OptPars.h
- * \brief place holder for optimization parameters
- */ 
-
-#ifndef _OPTPARS_H_
-#define _OPTPARS_H_
-
-#include "./types.h"
-
-struct OptPars{
-
-	IssmDouble  xmin;
-	IssmDouble  xmax;
-	IssmDouble *cm_jump;
-	int* maxiter;
-	int  nsteps;
-	int  nsize;
-
-};
-
-#endif
Index: sm/trunk/src/c/shared/Numerics/README
===================================================================
--- /issm/trunk/src/c/shared/Numerics/README	(revision 28275)
+++ 	(revision )
@@ -1,9 +1,0 @@
-
-DO NOT MODIFY the following files:
-- Verbosity.cpp
-- src/m/shared/Verb*.m
-all these files are automatically synchronized with Verbosity.h
-
-TO ADD A VERBOSITY LEVEL:
-add the corresponding line to Verbosity.h
-and execute synchronizing script.
Index: sm/trunk/src/c/shared/Numerics/Synchronize.sh
===================================================================
--- /issm/trunk/src/c/shared/Numerics/Synchronize.sh	(revision 28275)
+++ 	(revision )
@@ -1,156 +1,0 @@
-#!/bin/bash
-#Synchronize Verbosity
-#first remove existing files
-rm $ISSM_DIR/src/m/classes/Verb*.m
-
-echo "Synchronizing Verbosity levels..."
-
-#Get all lines of Verbosity.cpp
-cat Verbosity.h |  grep "bool Verbose" | awk '{print $2}' | sed -e "s/(/ /" | awk '{print $1}' | awk '{ printf "%s %s\n", NR, $0 }' >temp
-#Build header of Verbosity.cpp {{{
-cat <<END > Verbosity.cpp
-/*
-* \file Verbosity.cpp:
-* \brief: Manage verbosity levels
-*
-*   WARNING: DO NOT MODIFY THIS FILE
-*            this file has been automatically generated by Synchronize.sh
-*            Please read README for more information
-*/
-
-/*include*/
-/*{{{*/
-#ifdef HAVE_CONFIG_H
-   #include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-#include "./Verbosity.h"
-#include "../Exceptions/exceptions.h"
-/*}}}*/
-
-/*Verbosityt levels*/
-END
-#}}}
-
-#get number of lines in temp
-NUMBEROFLINES=$(wc -l temp | awk '{printf("%s",$1);}');
-
-# go through the lines of temp
-for (( i=1 ; i<=$NUMBEROFLINES ; i++ )); do
-
-	#Get name of the line i
-	FILENAME=$(cat temp | grep "^[ ]*$i " | awk '{printf("%s",$2);}');
-	LEVELNAME=$(echo $FILENAME | sed -e "s/Verbose//g");
-
-	let POWER=$i-1
-	let BINARY=2**$POWER
-
-	echo "$FILENAME -> 2^$POWER = $BINARY"
-
-	#Add case to verbose.m FIELDS{{{
-	if [ $i -eq 1 ]; then cat <<END >> FIELDS
-		%BEGINFIELDS
-END
-fi
-	cat <<END >> FIELDS
-		$(echo $LEVELNAME | awk {'print tolower($1)'})=false;
-END
-	if [ $i -eq $NUMBEROFLINES ]; then cat <<END >> FIELDS
-		%ENDFIELDS
-END
-fi
-#}}}
-	#Add case to verbose.m VERB2BIN{{{
-	if [ $i -eq 1 ]; then cat <<END >> VERB2BIN
-		%BEGINVERB2BIN
-		binary=0;
-END
-fi
-	cat <<END >> VERB2BIN
-		if (verbose.$(echo $LEVELNAME | awk {'print tolower($1)'})), binary=bitor(binary,$BINARY); end
-END
-	if [ $i -eq $NUMBEROFLINES ]; then cat <<END >> VERB2BIN
-		%ENDVERB2BIN
-END
-fi
-#}}}
-	#Add case to verbose.m BIN2VERB{{{
-	if [ $i -eq 1 ]; then cat <<END >> BIN2VERB
-		%BEGINBIN2VERB
-END
-fi
-	cat <<END >> BIN2VERB
-		if bitand(binary,$BINARY), verbose.$(echo $LEVELNAME | awk {'print tolower($1)'})=true; else verbose.$(echo $LEVELNAME | awk {'print tolower($1)'})=false; end
-END
-	if [ $i -eq $NUMBEROFLINES ]; then cat <<END >> BIN2VERB
-		%ENDBIN2VERB
-END
-fi
-#}}}
-	#Add case to verbose.m DISP{{{
-	if [ $i -eq 1 ]; then cat <<END >> DISP
-		%BEGINDISP
-		disp(sprintf('class ''%s''  = ',class(verbose)));
-END
-fi
-	cat <<END >> DISP
-		disp(sprintf('   %15s : %s','$(echo $LEVELNAME | awk {'print tolower($1)'})',mat2str(verbose.$(echo $LEVELNAME | awk {'print tolower($1)'}))));
-END
-	if [ $i -eq $NUMBEROFLINES ]; then cat <<END >> DISP
-		%ENDDISP
-END
-fi
-#}}}
-	#Add case to Verbosity.cpp {{{
-	cat <<END >> Verbosity.cpp
-bool $FILENAME(void){return (GetVerbosityLevel() & $BINARY);} /* 2^$POWER*/
-END
-	#}}}
-
-done
-
-#Add footer of Verbosity.cpp{{{
-cat <<END >> Verbosity.cpp
-
-/*Verbosity Setup*/
-static int verbositylevel=-1;
-void SetVerbosityLevel(int level){/*{{{*/
-
-	if(level<0) _error_("vebosity level should be a positive integer (user provided " << level << ")");
-
-	verbositylevel = level;
-
-}/*}}}*/
-int  GetVerbosityLevel(void){/*{{{*/
-	_assert_(verbositylevel>=0);
-	return verbositylevel;
-}/*}}}*/
-END
-#}}}
-#Complete verbose.m {{{
-VERBOSEPATH="$ISSM_DIR/src/m/classes/verbose.m"
-cat $VERBOSEPATH  | sed "/%BEGINFIELDS/,$ d"  > temp_begin
-cat $VERBOSEPATH  | sed "1,/%ENDFIELDS/d" > temp_end
-cat temp_begin FIELDS temp_end > $VERBOSEPATH
-rm temp_begin temp_end FIELDS
-
-cat $VERBOSEPATH  | sed "/%BEGINVERB2BIN/,$ d"  > temp_begin
-cat $VERBOSEPATH  | sed "1,/%ENDVERB2BIN/d" > temp_end
-cat temp_begin VERB2BIN temp_end > $VERBOSEPATH
-rm temp_begin temp_end VERB2BIN
-
-cat $VERBOSEPATH  | sed "/%BEGINBIN2VERB/,$ d"  > temp_begin
-cat $VERBOSEPATH  | sed "1,/%ENDBIN2VERB/d" > temp_end
-cat temp_begin BIN2VERB temp_end > $VERBOSEPATH
-rm temp_begin temp_end BIN2VERB
-
-cat $VERBOSEPATH  | sed "/%BEGINDISP/,$ d"  > temp_begin
-cat $VERBOSEPATH  | sed "1,/%ENDDISP/d" > temp_end
-cat temp_begin DISP temp_end > $VERBOSEPATH
-rm temp_begin temp_end DISP
-#}}}
-
-#clean up{{{
-rm temp
-#}}}
Index: sm/trunk/src/c/shared/Numerics/Verbosity.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/Verbosity.cpp	(revision 28275)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
-* \file Verbosity.cpp:
-* \brief: Manage verbosity levels
-*
-*   WARNING: DO NOT MODIFY THIS FILE
-*            this file has been automatically generated by Synchronize.sh
-*            Please read README for more information
-*/
-
-/*include*/
-/*{{{*/
-#ifdef HAVE_CONFIG_H
-   #include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-#include "./Verbosity.h"
-#include "../Exceptions/exceptions.h"
-/*}}}*/
-
-/*Verbosityt levels*/
-bool VerboseMProcessor(void){return (GetVerbosityLevel() & 1);} /* 2^0*/
-bool VerboseModule(void){return (GetVerbosityLevel() & 2);} /* 2^1*/
-bool VerboseSolution(void){return (GetVerbosityLevel() & 4);} /* 2^2*/
-bool VerboseSolver(void){return (GetVerbosityLevel() & 8);} /* 2^3*/
-bool VerboseConvergence(void){return (GetVerbosityLevel() & 16);} /* 2^4*/
-bool VerboseControl(void){return (GetVerbosityLevel() & 32);} /* 2^5*/
-bool VerboseQmu(void){return (GetVerbosityLevel() & 64);} /* 2^6*/
-bool VerboseAutodiff(void){return (GetVerbosityLevel() & 128);} /* 2^7*/
-bool VerboseSmb(void){return (GetVerbosityLevel() & 256);} /* 2^8*/
-
-/*Verbosity Setup*/
-static int verbositylevel=-1;
-void SetVerbosityLevel(int level){/*{{{*/
-
-	if(level<0) _error_("vebosity level should be a positive integer (user provided " << level << ")");
-
-	verbositylevel = level;
-
-}/*}}}*/
-int  GetVerbosityLevel(void){/*{{{*/
-	_assert_(verbositylevel>=0);
-	return verbositylevel;
-}/*}}}*/
Index: sm/trunk/src/c/shared/Numerics/Verbosity.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/Verbosity.h	(revision 28275)
+++ 	(revision )
@@ -1,23 +1,0 @@
-/*!\file:Verbosity.h
- * \brief: Deal with verbosity levels
- */ 
-
-#ifndef _VERBOSITY_H_
-#define _VERBOSITY_H_
-
-/*List of Verbosity levels (Add your own and Synchronize: must begin with "Verbose")*/
-bool VerboseMProcessor(void);
-bool VerboseModule(void);
-bool VerboseSolution(void);
-bool VerboseSolver(void);
-bool VerboseConvergence(void);
-bool VerboseControl(void);
-bool VerboseQmu(void);
-bool VerboseAutodiff(void);
-bool VerboseSmb(void);
-
-/*Setup Verbosity level*/
-void SetVerbosityLevel(int level);
-int  GetVerbosityLevel(void);
-
-#endif
Index: sm/trunk/src/c/shared/Numerics/XZvectorsToCoordinateSystem.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/XZvectorsToCoordinateSystem.cpp	(revision 28275)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#include <math.h>
-
-#include "../MemOps/MemOps.h"
-#include "../Exceptions/exceptions.h"
-#include "../Numerics/types.h"
-#include "./isnan.h"
-
-void XZvectorsToCoordinateSystem(IssmDouble* T,IssmDouble* xzvectors){
-
-	IssmDouble	x[3],y[3],z[3];
-	IssmDouble	x_norm, y_norm, z_norm;
-
-	for(int i=0;i<6;i++){
-		if(xIsNan<IssmDouble>(xzvectors[i])){
-			/*At least one NaN found: default to Id*/
-			T[0*3+0] = 1.0;	T[0*3+1] = 0.0;	T[0*3+2] = 0.0;
-			T[1*3+0] = 0.0;	T[1*3+1] = 1.0;	T[1*3+2] = 0.0;
-			T[2*3+0] = 0.0;	T[2*3+1] = 0.0;	T[2*3+2] = 1.0;
-
-			return;
-		}
-	}
-
-	/* get input {x} (vector in local x-z plane): */
-	x[0] = xzvectors[0];
-	x[1] = xzvectors[1];
-	x[2] = xzvectors[2];
-
-	/* get input {z} (local tangent plane normal vector): */
-	z[0] = xzvectors[3];
-	z[1] = xzvectors[4];
-	z[2] = xzvectors[5];
-
-	/* compute {y} = {z} x {x}: */
-	y[0] =  x[2]*z[1] - x[1]*z[2];
-	y[1] = -x[2]*z[0] + x[0]*z[2];
-	y[2] =  x[1]*z[0] - x[0]*z[1];
-
-	/* normalise {x}, {y} and {z} to form unit vectors {i_hat}, {j_hat} and {k_hat};
-		store in {x}, {y}, and {z}: */
-	x_norm = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
-	y_norm = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2]);
-	z_norm = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2]);
-
-	x[0] = x[0]/x_norm;		x[1] = x[1]/x_norm;		x[2] = x[2]/x_norm;
-	y[0] = y[0]/y_norm;		y[1] = y[1]/y_norm;		y[2] = y[2]/y_norm;
-	z[0] = z[0]/z_norm;		z[1] = z[1]/z_norm;		z[2] = z[2]/z_norm;
-
-	/* Tlg columns are just {i_hat}, {j_hat} and {k_hat}, respectively: */
-	T[0*3+0] = x[0];	T[0*3+1] = y[0];	T[0*3+2] = z[0];
-	T[1*3+0] = x[1];	T[1*3+1] = y[1];	T[1*3+2] = z[1];
-	T[2*3+0] = x[2];	T[2*3+1] = y[2];	T[2*3+2] = z[2];
-}
Index: sm/trunk/src/c/shared/Numerics/constants.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/constants.h	(revision 28275)
+++ 	(revision )
@@ -1,13 +1,0 @@
-/*!\file: constants.h
- * \brief prototypes for constants.h
- */
-
-#ifndef _ISSM_CONSTANTS_H_
-#define _ISSM_CONSTANTS_H_
-
-#define UNDEF -9999
-#define SQRT2 1.414213562373095048801688724209698078569671875376948073176679738
-#define SQRT3 1.732050807568877293527446341505872366942805253810380628055806979
-const double PI=3.141592653589793238462643383279502884197169399375105820974944592308; // Macro definition conflicts with Dakota's declaration of PI
-
-#endif /*_ISSM_CONSTANTS_H_*/
Index: sm/trunk/src/c/shared/Numerics/cross.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/cross.cpp	(revision 28275)
+++ 	(revision )
@@ -1,21 +1,0 @@
-/*!\file:  cross.cpp
- * \brief cross product for 2 vectors
- */ 
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "./types.h"
-
-void cross(IssmDouble* result,IssmDouble* vector1,IssmDouble* vector2){
-
-	/*result,vector1 and vector2 are all assumed to be of size 3: */
-
-	result[0]=vector1[1]*vector2[2]-vector1[2]*vector2[1];
-	result[1]=vector1[2]*vector2[0]-vector1[0]*vector2[2];
-	result[2]=vector1[0]*vector2[1]-vector1[1]*vector2[0];
-
-}
Index: sm/trunk/src/c/shared/Numerics/cubic.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/cubic.cpp	(revision 28275)
+++ 	(revision )
@@ -1,92 +1,0 @@
-#include <math.h>
-
-#include "./numerics.h"
-
-IssmDouble CBRT(IssmDouble Z){
-
-	IssmDouble ret;
-
-	if (Z> 0.0){
-		ret = fabs(pow(fabs(Z),1./3.));
-	}
-	else if(Z< 0.0){
-		ret = - fabs(pow(fabs(Z),1./3.));
-	}
-	else{
-		ret = 0.;
-	}
-	return ret;
-}
-
-int cubic(IssmDouble a,IssmDouble b,IssmDouble c,IssmDouble d, IssmDouble x[3], int* num){
-	/* Find the real roots of linear/quadratic and cubic equations:
-	 *
-	 *   a x^3 + bx^2 + cx + d = 0
-	 *
-	 *   returns the roots in x
-	 *   num is the number of roots */
-
-	/*Some useful constants*/
-	const IssmDouble pi    = 3.1415926535897932;
-	const IssmDouble third = 1./3.;
-
-	/*Intermediaries*/
-	IssmDouble U[3],W,P,Q,delta,phi;
-
-	/* determine the degree of the polynomial */
-	if (a != 0.0){
-		//cubic problem
-		W     = b/a *third;
-		P     = pow((c/a *third - pow(W,2)),3);
-		Q     = -.5 *(2.0*pow(W,3)-(c*W-d)/a );
-		delta = pow(Q,2)+P;
-		if ( delta < 0.0 ){
-			//three real solutions!
-			//Confine the argument of coeffCOS to the interval [-1;1]!
-			phi = acos(min(1.0,max(-1.0,Q/sqrt(-P))));
-			P   = 2.0*pow((-P),(5.e-1*third));
-			for(int i=0;i<3;i++)	U[i] = P*cos((phi+2*((IssmDouble)i)*pi)*third)-W;
-			x[0] = min(U[0], min(U[1], U[2]));
-			x[1] = max(min(U[0], U[1]),max( min(U[0], U[2]), min(U[1], U[2])));
-			x[2] = max(U[0], max(U[1], U[2]));
-			*num = 3;
-		}
-		else{
-			// only one real solution!
-			delta = sqrt(delta);
-			x[0] = CBRT(Q+delta)+CBRT(Q-delta)-W;
-			*num=1;
-		}
-	}
-	else if (b != 0.0){
-		// quadratic problem
-		P     = 0.5*c/b;
-		delta = pow(P,2)-d/b;
-		if (delta > 0.0){
-			// 2 real solutions
-			x[0] = -P - sqrt(delta);
-			x[1] = -P + sqrt(delta);
-			*num = 2;
-		}
-		else{
-			// no real solution
-			*num = 0;
-		}
-	}
-	else if (c != 0.0){
-		//linear equation
-		x[0] = d/c;
-		*num = 1;
-	}
-	else{
-		//no equation
-		*num = 0;
-	}
-
-	/* perform one step of a newton iteration in order to minimize round-off errors */
-	for(int i=0;i<*num;i++){
-		x[i] = x[i] - (d+x[i]*(c+x[i]*(b+x[i]*a)))/(c+x[i]*(2.0*b+x[i]*3.0*a));
-	}
-
-	return 0;
-}
Index: /issm/trunk/src/c/shared/Numerics/extrema.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/extrema.cpp	(revision 28275)
+++ /issm/trunk/src/c/shared/Numerics/extrema.cpp	(revision 1)
@@ -4,40 +4,16 @@
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+	#include "config.h"
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
 #endif
 
-#include "./types.h"
 
-#ifndef _HAVE_CODIPACK_// already defined in codipack headers
-IssmDouble min(IssmDouble a,IssmDouble b){
-	if (a<b)return a;
+double min(double a,double b){
+	if (a<=b)return a;
 	else return b;
 }
-#endif
-int min(int a,int b){
-	if (a<b)return a;
+double max(double a,double b){
+	if (a>=b)return a;
 	else return b;
 }
-#ifndef _HAVE_CODIPACK_// already defined in codipack headers
-IssmDouble max(IssmDouble a,IssmDouble b){
-	if (a>b)return a;
-	else return b;
-}
-#endif
-int max(int a,int b){
-	if (a>b)return a;
-	else return b;
-}
-
-#ifdef _HAVE_AD_
-IssmPDouble  min(IssmPDouble a,IssmPDouble b){
-	if (a<b)return a;
-	else return b;
-}
-IssmPDouble  max(IssmPDouble a,IssmPDouble b){
-	if (a>b)return a;
-	else return b;
-}
-#endif
Index: sm/trunk/src/c/shared/Numerics/isnan.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/isnan.cpp	(revision 28275)
+++ 	(revision )
@@ -1,18 +1,0 @@
-#ifdef HAVE_CONFIG_H
-   #include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-/*Special overloading definitions for AD*/
-#include "./isnan.h"
-
-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
-template <> int xIsNan<adouble> (const adouble& X){ return std::isnan(X.getValue()); }
-template <> int xIsInf<adouble> (const adouble& X){ return std::isinf(X.getValue()); }
-#endif
-
-#if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
-template <> int xIsNan<IssmDouble> (const IssmDouble& X){ return std::isnan(X.getValue()); }
-template <> int xIsInf<IssmDouble> (const IssmDouble& X){ return std::isinf(X.getValue()); }
-#endif
Index: sm/trunk/src/c/shared/Numerics/isnan.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/isnan.h	(revision 28275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#ifndef _XISNAN_H_
-#define _XISNAN_H_
-
-#ifdef HAVE_CONFIG_H
-   #include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-/*cmath defines isnan and isinf*/
-#include <cmath>
-
-#ifdef _INTEL_WIN_
-template <class T> int xIsNan(const T& X){return (X!=X)?1:0;}
-#else
-template <class T> int xIsNan(const T& X){return std::isnan(X); }
-#endif
-template <class T> int xIsInf(const T& X){return std::isinf(X); }
-
-/*Special overloading definitions for AD*/
-
-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
-#include "./types.h"
-template <> int xIsNan<adouble> (const adouble& X);
-template <> int xIsInf<adouble> (const adouble& X);
-#endif
-
-#if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
-#include "./types.h"
-template <> int xIsNan<IssmDouble> (const IssmDouble& X);
-template <> int xIsInf<IssmDouble> (const IssmDouble& X);
-#endif
-
-#endif
Index: sm/trunk/src/c/shared/Numerics/legendre.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/legendre.cpp	(revision 28275)
+++ 	(revision )
@@ -1,265 +1,0 @@
-/*!\file:  legendre.cpp
- \brief compute legendre polynomial at specific x. 
- This is inspired from the p_polynomial_value package, written by John Burkardt (see below 
- for full documentation). 
- Here, we apply the function differently: we assume previous two evaluations are provided, 
- and we compute the level n evaluation: 
-
-*/
-
-/* function v = p_polynomial_value ( m, n, x ) {{{
-
-	%*****************************************************************************80
-	%
-	%% P_POLYNOMIAL_VALUE evaluates the Legendre polynomials P(n,x).
-	%
-	%  Discussion:
-	%
-	%    P(n,1) = 1.
-	%    P(n,-1) = (-1)^N.
-	%    | P(n,x) | <= 1 in [-1,1].
-	%
-	%    The N zeroes of P(n,x) are the abscissas used for Gauss-Legendre
-	%    quadrature of the integral of a function F(X) with weight function 1
-	%    over the interval [-1,1].
-	%
-	%    The Legendre polynomials are orthogonal under the inner product defined
-	%    as integration from -1 to 1:
-	%
-	%      Integral ( -1 <= X <= 1 ) P(I,X) * P(J,X) dX 
-	%        = 0 if I =/= J
-	%        = 2 / ( 2*I+1 ) if I = J.
-	%
-	%    Except for P(0,X), the integral of P(I,X) from -1 to 1 is 0.
-	%
-	%    A function F(X) defined on [-1,1] may be approximated by the series
-	%      C0*P(0,x) + C1*P(1,x) + ... + CN*P(n,x)
-	%    where
-	%      C(I) = (2*I+1)/(2) * Integral ( -1 <= X <= 1 ) F(X) P(I,x) dx.
-	%
-	%    The formula is:
-	%
-	%      P(n,x) = (1/2^N) * sum ( 0 <= M <= N/2 ) C(N,M) C(2N-2M,N) X^(N-2*M)
-	%
-	%  Differential equation:
-	%
-	%    (1-X*X) * P(n,x)'' - 2 * X * P(n,x)' + N * (N+1) = 0
-	%
-	%  First terms:
-	%
-	%    P( 0,x) =      1
-	%    P( 1,x) =      1 X
-	%    P( 2,x) = (    3 X^2 -       1)/2
-	%    P( 3,x) = (    5 X^3 -     3 X)/2
-	%    P( 4,x) = (   35 X^4 -    30 X^2 +     3)/8
-	%    P( 5,x) = (   63 X^5 -    70 X^3 +    15 X)/8
-	%    P( 6,x) = (  231 X^6 -   315 X^4 +   105 X^2 -     5)/16
-	%    P( 7,x) = (  429 X^7 -   693 X^5 +   315 X^3 -    35 X)/16
-	%    P( 8,x) = ( 6435 X^8 - 12012 X^6 +  6930 X^4 -  1260 X^2 +   35)/128
-	%    P( 9,x) = (12155 X^9 - 25740 X^7 + 18018 X^5 -  4620 X^3 +  315 X)/128
-	%    P(10,x) = (46189 X^10-109395 X^8 + 90090 X^6 - 30030 X^4 + 3465 X^2-63)/256
-	%
-	%  Recursion:
-	%
-	%    P(0,x) = 1
-	%    P(1,x) = x
-	%    P(n,x) = ( (2*n-1)*x*P(n-1,x)-(n-1)*P(n-2,x) ) / n
-	%
-	%    P'(0,x) = 0
-	%    P'(1,x) = 1
-	%    P'(N,x) = ( (2*N-1)*(P(N-1,x)+X*P'(N-1,x)-(N-1)*P'(N-2,x) ) / N
-	%
-	%  Licensing:
-	%
-	%    This code is distributed under the GNU LGPL license. 
-	%
-	%  Modified:
-	%
-	%    10 March 2012
-	%
-	%  Author:
-	%
-	%    John Burkardt
-	%
-	%  Reference:
-	%
-	%    Milton Abramowitz, Irene Stegun,
-	%    Handbook of Mathematical Functions,
-	%    National Bureau of Standards, 1964,
-	%    ISBN: 0-486-61272-4,
-	%    LC: QA47.A34.
-	%
-	%    Daniel Zwillinger, editor,
-	%    CRC Standard Mathematical Tables and Formulae,
-	%    30th Edition,
-	%    CRC Press, 1996.
-	%
-	%  Parameters:
-	%
-	%    Input, integer M, the number of evaluation points.
-	%
-	%    Input, integer N, the highest order polynomial to evaluate.
-	%    Note that polynomials 0 through N will be evaluated.
-	%
-	%    Input, real X(M,1), the evaluation points.
-	%
-	%    Output, real V(M,1:N+1), the values of the Legendre polynomials 
-	%    of order 0 through N at the points X.
-	%
-	  if ( n < 0 )
-		v = [];
-		return
-	  end
-
-	  v = ones ( m, n + 1 );
-
-	  if ( n < 1 )
-		return
-	  end
-
-	  v(1:m,2) = x;
-
-	  for i = 2 : n
-
-		v(:,i+1) = ( ( 2 * i - 1 ) * x .* v(:,i)   ...
-					-  (     i - 1 ) *    v(:,i-1) ) ...
-					/  (     i     );
-
-	  end
-	  }}}  */ 
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "./types.h"
-#include "../Exceptions/exceptions.h"
-#include "../MemOps/MemOps.h"
-#include "./recast.h"
-
-IssmDouble *p_polynomial_value ( int m, int n, IssmDouble* x){
-
-	/******************************************************************************{{{/
-	Purpose:
-
-	P_POLYNOMIAL_VALUE evaluates the Legendre polynomials P(n,x).
-
-	Discussion:
-
-	P(n,1) = 1.
-	P(n,-1) = (-1)^N.
-	| P(n,x) | <= 1 in [-1,1].
-
-	The N zeroes of P(n,x) are the abscissas used for Gauss-Legendre
-	quadrature of the integral of a function F(X) with weight function 1
-	over the interval [-1,1].
-
-	The Legendre polynomials are orthogonal under the inner product defined
-	as integration from -1 to 1:
-
-	Integral ( -1 <= X <= 1 ) P(I,X) * P(J,X) dX
-	= 0 if I =/= J
-	= 2 / ( 2*I+1 ) if I = J.
-
-	Except for P(0,X), the integral of P(I,X) from -1 to 1 is 0.
-
-	A function F(X) defined on [-1,1] may be approximated by the series
-	C0*P(0,x) + C1*P(1,x) + ... + CN*P(n,x)
-	where
-	C(I) = (2*I+1)/(2) * Integral ( -1 <= X <= 1 ) F(X) P(I,x) dx.
-
-	The formula is:
-
-	P(n,x) = (1/2^N) * sum ( 0 <= M <= N/2 ) C(N,M) C(2N-2M,N) X^(N-2*M)
-
-	Differential equation:
-
-	(1-X*X) * P(n,x)'' - 2 * X * P(n,x)' + N * (N+1) = 0
-
-	First terms:
-
-	P( 0,x) =      1
-	P( 1,x) =      1 X
-	P( 2,x) = (    3 X^2 -       1)/2
-	P( 3,x) = (    5 X^3 -     3 X)/2
-	P( 4,x) = (   35 X^4 -    30 X^2 +     3)/8
-	P( 5,x) = (   63 X^5 -    70 X^3 +    15 X)/8
-	P( 6,x) = (  231 X^6 -   315 X^4 +   105 X^2 -     5)/16
-	P( 7,x) = (  429 X^7 -   693 X^5 +   315 X^3 -    35 X)/16
-	P( 8,x) = ( 6435 X^8 - 12012 X^6 +  6930 X^4 -  1260 X^2 +   35)/128
-	P( 9,x) = (12155 X^9 - 25740 X^7 + 18018 X^5 -  4620 X^3 +  315 X)/128
-	P(10,x) = (46189 X^10-109395 X^8 + 90090 X^6 - 30030 X^4 + 3465 X^2-63)/256
-
-	Recursion:
-
-	P(0,x) = 1
-	P(1,x) = x
-	P(n,x) = ( (2*n-1)*x*P(n-1,x)-(n-1)*P(n-2,x) ) / n
-
-	P'(0,x) = 0
-	P'(1,x) = 1
-	P'(N,x) = ( (2*N-1)*(P(N-1,x)+X*P'(N-1,x)-(N-1)*P'(N-2,x) ) / N
-
-	Licensing:
-
-	This code is distributed under the GNU LGPL license.
-
-	Modified:
-
-	08 August 2013
-
-	Author:
-
-		John Burkardt
-
-			Reference:
-
-			Milton Abramowitz, Irene Stegun,
-				   Handbook of Mathematical Functions,
-				   National Bureau of Standards, 1964,
-				   ISBN: 0-486-61272-4,
-				   LC: QA47.A34.
-
-					   Daniel Zwillinger, editor,
-				   CRC Standard Mathematical Tables and Formulae,
-				   30th Edition,
-				   CRC Press, 1996.
-
-					   Parameters:
-
-					   Input, int M, the number of evaluation points.
-
-					   Input, int N, the highest order polynomial to evaluate.
-					   Note that polynomials 0 through N will be evaluated.
-
-					   Input, double X[M], the evaluation points.
-
-					   Output, double P_POLYNOMIAL_VALUE[M*(N+1)], the values of the Legendre
-					   polynomials of order 0 through N.
-	}}}*/
-
-	int i,j;
-
-	if(n<0) return NULL;
-
-	IssmDouble* v = xNew<IssmDouble>(m*(n+1));
-
-	for ( i = 0; i < m; i++ ) v[i*(n+1)+0] = 1.0;
-	if ( n < 1 ) return v;
-
-	for ( i = 0; i < m; i++ ) v[i*(n+1)+1] = x[i];
-
-	for ( i = 0; i < m; i++ ) {
-		for ( j = 2; j <= n; j++ ) {
-
-			v[j+i*(n+1)] = ( ( IssmDouble ) ( 2 * j - 1 ) * x[i] * v[(j-1)+i*(n+1)]
-					- ( IssmDouble ) (     j - 1 ) *        v[(j-2)+i*(n+1)] )
-				/ ( IssmDouble ) (     j     );
-
-		}
-	}
-
-	return v;
-}
Index: /issm/trunk/src/c/shared/Numerics/numerics.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/numerics.h	(revision 28275)
+++ /issm/trunk/src/c/shared/Numerics/numerics.h	(revision 1)
@@ -6,40 +6,9 @@
 #define  _NUMERICS_H_
 
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
+#include "./GaussPoints.h"
 
-#include "./Verbosity.h"
-#include "./GaussPoints.h"
-#include "./isnan.h"
-#include "./recast.h"
-#include "./types.h"
-#include "./constants.h"
-#include "./OptPars.h"
-
-#if !defined(_HAVE_CODIPACK_)
-// already defined in codipack headers
-IssmDouble  min(IssmDouble a,IssmDouble b);
-IssmDouble  max(IssmDouble a,IssmDouble b);
-#endif
-
-#ifdef _HAVE_AD_
-IssmPDouble  min(IssmPDouble a,IssmPDouble b);
-IssmPDouble  max(IssmPDouble a,IssmPDouble b);
-#endif
-
-int         min(int a,int b);
-int         max(int a,int b);
-void        BrentSearch(IssmDouble** pJ,OptPars optpars,IssmDouble* X0,IssmDouble (*f)(IssmDouble*,void*),IssmDouble (*g)(IssmDouble**,IssmDouble*,void*),void* usr);
-void        cross(IssmDouble *result,IssmDouble*vector1,IssmDouble*vector2);
-void        XZvectorsToCoordinateSystem(IssmDouble *T,IssmDouble*xzvectors);
-int         cubic(IssmDouble a, IssmDouble b, IssmDouble c, IssmDouble d,IssmDouble X[3], int *num);
-IssmDouble  legendre(IssmDouble Pn1, IssmDouble Pn2, IssmDouble x, int n);
-IssmDouble*  p_polynomial_value ( int m, int n, IssmDouble* x);
-
-int         NewtonSolveDnorm(IssmDouble* pdnorm,IssmDouble c1,IssmDouble c2,IssmDouble c3,IssmDouble n,IssmDouble dnorm);
-IssmDouble  ODE1(IssmDouble alpha,IssmDouble beta,IssmDouble Si, IssmDouble dt,int method);
+double min(double a,double b);
+double max(double a,double b);
 
 #endif //ifndef _NUMERICS_H_
+
Index: sm/trunk/src/c/shared/Numerics/recast.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/recast.h	(revision 28275)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/*
- * recast.h
- *
- *  Created on: Jun 26, 2012
- *      Author: utke
- */
-
-#ifndef _RECAST_H_
-#define _RECAST_H_
-
-#ifdef HAVE_CONFIG_H
-   #include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#if !defined(_HAVE_AD_) || defined(_WRAPPERS_)
-
-template<class To, class From> To reCast(const From& from) {
-    return (To)from;
-}
-
-#else
-#include "./types.h"
-
-template<class To, class From> struct ForPartialSpecialization {
-    static  To reCast(const From& from ) { return (To) from;}
-};
-
-template<class To, class From> To reCast(const From& from) {
-    return ForPartialSpecialization<To,From>::reCast(from);
-}
-/**
- * partial specialization
- */
-#ifdef _HAVE_ADOLC_
-template<class To> struct ForPartialSpecialization<To,adouble> {
-    static  To reCast(const adouble& from ) { return (To) (from.getValue());}
-};
-#endif
-#ifdef _HAVE_CODIPACK_
-template<class To> struct ForPartialSpecialization<To,IssmDouble> {
-	    static  To reCast(const IssmDouble& from ) { return (To) (from.getValue());}
-};
-#endif
-
-#endif
-
-/*Morlighem's change: we do not want dynamic_casts because of performance
- * issue, so for now, we just use C-like cast*/
-template<class To,class From> To xDynamicCast(const From& from) {
-
-	/*C-like cast (fast but not safe)*/
-	return (To) from;
-
-	/*C++ dynamic_cast, poor performance but safer*/
-	//return dynamic_cast<To>(from);
-}
-
-#endif
Index: sm/trunk/src/c/shared/Numerics/types.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/types.h	(revision 28275)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*!\file: types.h
- * \brief prototypes for types.h
- */ 
-
-#ifndef _TYPES_H_
-#define  _TYPES_H_
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include <stdio.h>
-#include <complex>
-
-/*here are our abstracted types: inspired on petsc */
-#if ISSM_USE_64BIT_INDICES == 1
-typedef long long IssmInt;
-#else
-typedef int IssmInt;
-#endif  
-
-#if defined(_HAVE_ADOLC_) &&  !defined(_WRAPPERS_)
-/*ADOLC typedefs*/
-#include "adolc/adolc.h"
-typedef adouble              IssmDouble;  /*for active variables*/
-//typedef acomplex             IssmComplex; /*for active variables*/ /*FIXME!*/
-typedef std::complex<double> IssmComplex; /*for active variables*/ /*FIXME!*/
-typedef double               IssmPDouble; /*for passive variables*/
-typedef std::complex<double> IssmPComplex;/*for passive variables*/
-
-#elif defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
-/*CoDiPack typedefs*/
-#include <codi.hpp>
-//typedef codi::RealReverseIndex          IssmDouble;
-typedef codi::RealReverse               IssmDouble;
-typedef std::complex<codi::RealReverse> IssmComplex;
-typedef double                          IssmPDouble;
-typedef IssmComplex                     IssmPComplex;
-
-#else 
-/*Non-AD typedefs*/
-typedef double               IssmDouble; 
-typedef std::complex<double> IssmComplex; 
-typedef IssmDouble           IssmPDouble;
-typedef IssmComplex          IssmPComplex;
-#endif
-
-#endif //ifndef _TYPES_H_
Index: /issm/trunk/src/c/shared/Sorting/Quicksort.c
===================================================================
--- /issm/trunk/src/c/shared/Sorting/Quicksort.c	(revision 1)
+++ /issm/trunk/src/c/shared/Sorting/Quicksort.c	(revision 1)
@@ -0,0 +1,19 @@
+void swap(int *a, int *b) {
+	int t=*a; *a=*b; *b=t;
+}
+void sort(int arr[], int beg, int end) {
+	  
+	if (end > beg + 1) {
+		int piv = arr[beg], l = beg + 1, r = end;
+		while (l < r)
+		{
+			if (arr[l] <= piv)
+				l++;
+			else
+				swap(&arr[l], &arr[--r]);
+		}
+		swap(&arr[--l], &arr[beg]);
+		sort(arr, beg, l);
+		sort(arr, r, end);
+	}
+}
Index: /issm/trunk/src/c/shared/Sorting/binary_search.cpp
===================================================================
--- /issm/trunk/src/c/shared/Sorting/binary_search.cpp	(revision 28275)
+++ /issm/trunk/src/c/shared/Sorting/binary_search.cpp	(revision 1)
@@ -4,24 +4,24 @@
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+	#include "config.h"
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
 #endif
 
-#include "../Exceptions/exceptions.h"
-#include <stdio.h>
+#undef __FUNCT__ 
+#define __FUNCT__ "binary_search"
 
-int binary_search(int* poffset,int target,int* sorted_integers,int num_integers){ /*{{{*/
+#include "stdio.h"
+
+int binary_search(int* poffset,int target, int* sorted_integers,int num_integers){
 
 	/*output: */
-	int offset=0;  //offset, if found
-	int found=0;   //found=0 if target is not found, 1 otherwise.
+	int offset;  //offset, if found
+	int found=0;  //found=0 if target is not found, 1 otherwise.
 
 	/*intermediary: */
-	int *beg = NULL;
-	int *end = NULL;
-	int *mid = NULL;
-
-	_assert_(sorted_integers);
+	int* beg=NULL;
+	int* end=NULL;
+	int* mid=NULL;
 
 	// point to beginning and end of the array
@@ -40,4 +40,7 @@
 	else{
 		while((beg <= end) && (*mid != target)){
+			#ifdef _DEBUG_
+				printf("1: %i %i %i\n",*beg,*mid,*(end-1));
+			#endif
 			// is the target in lower or upper half?
 			if (target < *mid) {
@@ -49,6 +52,9 @@
 				mid = beg + (end-beg)/2;  //new middle
 			}
+			#ifdef _DEBUG_
+				printf("2: %i %i %i\n",*beg,*mid,*(end-1));
+			#endif
 		}
-
+			  
 		//did we find the target?
 		if (*mid == target) {
@@ -63,6 +69,7 @@
 	/*Assign output pointers:*/
 	*poffset=offset;
-
+	
 	/*Return result: */
 	return found;
-} /*}}}*/
+}
+
Index: /issm/trunk/src/c/shared/Sorting/sorting.h
===================================================================
--- /issm/trunk/src/c/shared/Sorting/sorting.h	(revision 28275)
+++ /issm/trunk/src/c/shared/Sorting/sorting.h	(revision 1)
@@ -6,56 +6,7 @@
 #define  _SORTING_H_
 
-int binary_search(int* poffset,int target,int* sorted_integers,int num_integers);
-template <typename doubletype> int binary_search(int* poffset,doubletype target,doubletype* list,int length){ /*{{{*/
-	/*
-	 *             l[0]  l[1]  l[2]        l[n]  l[n+1]   l[length-1]
-	 *     <-------+-----+-----+-----+ ... +-----+........+-------------->
-	 * offset: -1     0     1     2           n              length -1
-	 *  
-	 *  offset = -1        target < list[0]
-	 *  offset = n         list[n] <= target < list[n+1]
-	 *  offset = length-1  list[length-1] <= target
-	 */
+int binary_search(int* poffset,int target, int* sorted_integers,int num_integers);
 
-	/*output: */
-	int offset = 0;
-	int found  = 0;
-
-	/*intermediary: */
-	int n0 = 0;
-	int n1 = int(length/2);
-	int n2 = length-1;
-
-	if(target<list[n0]){
-		found  = 1;
-		offset = -1;
-	}
-	else if(target>=list[n2]){
-		found  = 1;
-		offset = length-1;
-	}
-	else{
-		for(;;){
-			/*did we find the target?*/
-			if(list[n1]<=target && list[n1+1]>target){
-				found  = 1;
-				offset = n1;
-				break;
-			}
-			else if(target < list[n1]){
-				n2 = n1;
-				n1 = n0 + int((n2-n0)/2);
-			}
-			else{
-				n0 = n1;
-				n1 = n0 + int((n2-n0)/2);
-			}
-		}
-	}
-
-	/*Assign output pointer and return*/
-	*poffset=offset;
-	return found;
-} /*}}}*/
 
 #endif //ifndef _SORTING_H_
+
Index: /issm/trunk/src/c/shared/TriMesh/AssociateSegmentToElement.cpp
===================================================================
--- /issm/trunk/src/c/shared/TriMesh/AssociateSegmentToElement.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/TriMesh/AssociateSegmentToElement.cpp	(revision 1)
@@ -0,0 +1,36 @@
+/*!\file:  AssociateSegmentToElement.cpp
+ * \brief for each segment, look for the corresponding element.
+ */ 
+
+#include "./trimesh.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "AssociateSegmentToElement"
+
+int AssociateSegmentToElement(double** psegments,int nseg, double* index,int nel){
+	
+	/*Error management: */
+	int i;
+	int noerr=1;
+
+	/*Input: */
+	double* segments=NULL;
+
+	/*grid indices: */
+	double A,B;
+
+	/*Recover segments: */
+	segments=*psegments;
+
+	for (i=0;i<nseg;i++){
+		A=*(segments+3*i+0);
+		B=*(segments+3*i+1);
+		*(segments+3*i+2)=FindElement(A,B,index,nel)+1; //matlab indexing.
+	}
+
+	/*Assign output pointers: */
+	*psegments=segments;
+	return noerr;
+}
+
+
Index: /issm/trunk/src/c/shared/TriMesh/GridInsideHole.cpp
===================================================================
--- /issm/trunk/src/c/shared/TriMesh/GridInsideHole.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/TriMesh/GridInsideHole.cpp	(revision 1)
@@ -0,0 +1,55 @@
+/*
+ * GridInsideHole.c:
+ * from a convex set of points, figure out a point that for sure lies inside the profile.
+ */
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GridInsideHole"
+
+#include <math.h>
+#include "./trimesh.h"
+#include "../Exp/exp.h"
+
+#undef M_PI
+#define M_PI 3.141592653589793238462643
+
+int GridInsideHole(double* px0,double* py0,int n,double* x,double* y){
+
+	double flag;
+	double xA,xB,xC,xD,xE;
+	double yA,yB,yC,yD,yE;
+
+	/*Take first and last grids: */
+	xA=x[0];
+	yA=y[0];
+	xB=x[n-1];
+	yB=y[n-1];
+
+	/*Figure out middle of segment [A B]: */
+	xC=(xA+xB)/2;
+	yC=(yA+yB)/2;
+
+	/*D and E are on each side of segment [A B], on the median line between segment [A  B], 
+	 *at an angle of 10 degree (less than the minimum 30 enforced by the quality of the mesh: */
+
+
+	xD=xC+tan(10./180.*M_PI)*(yC-yA);
+	yD=yC+tan(10./180.*M_PI)*(xA-xC);
+
+	xE=xC-tan(10./180.*M_PI)*(yC-yA);
+	yE=yC-tan(10./180.*M_PI)*(xA-xC);
+
+	/*Either E or D is inside profile (x,y): */
+	IsInPolySerial(&flag,&xD,&yD,1,x,y,n,2);
+	if (flag){
+		/*D is inside the poly: */
+		*px0=xD;
+		*py0=yD;
+	}
+	else{
+		/*E is inside the poly: */
+		*px0=xE;
+		*py0=yE;
+	}
+	return 1;
+}
Index: /issm/trunk/src/c/shared/TriMesh/OrderSegments.cpp
===================================================================
--- /issm/trunk/src/c/shared/TriMesh/OrderSegments.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/TriMesh/OrderSegments.cpp	(revision 1)
@@ -0,0 +1,56 @@
+/*
+ * OrderSegments.c: 
+ * reorder segments so that their normals point outside the domain outline.
+ */
+#include "./trimesh.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "OrderSegments"
+
+int OrderSegments(double** psegments,int nseg, double* index,int nel){
+	
+	/*Error management: */
+	int i;
+	int noerr=1;
+
+	/*Input: */
+	double* segments=NULL;
+
+	/*grid indices: */
+	double A,B;
+	/*element indices: */
+	int el;
+
+
+	/*Recover segments: */
+	segments=*psegments;
+
+	for (i=0;i<nseg;i++){
+		A=*(segments+3*i+0);
+		B=*(segments+3*i+1);
+		el=*(segments+3*i+2)-1; //after AssociateSegmentToElement, el was a matlab index, we need the c index now.
+
+		if (*(index+3*el+0)==A){
+			if (*(index+3*el+2)==B){
+				*(segments+3*i+0)=B;
+				*(segments+3*i+1)=A;
+			}
+		}
+		else if (*(index+3*el+1)==A){
+			if (*(index+3*el+0)==B){
+				*(segments+3*i+0)=B;
+				*(segments+3*i+1)=A;
+			}
+		}
+		else{
+			if (*(index+3*el+1)==B){
+				*(segments+3*i+0)=B;
+				*(segments+3*i+1)=A;
+			}
+		}
+	}
+
+	/*Assign output pointers: */
+	*psegments=segments;
+	return noerr;
+}
Index: /issm/trunk/src/c/shared/TriMesh/SplitMeshForRifts.cpp
===================================================================
--- /issm/trunk/src/c/shared/TriMesh/SplitMeshForRifts.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/TriMesh/SplitMeshForRifts.cpp	(revision 1)
@@ -0,0 +1,113 @@
+/*
+ * SplitMeshForRifts.c:
+ */
+#include "./trimesh.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "SplitMeshForRifts"
+
+#include "../Alloc/alloc.h"
+
+int SplitMeshForRifts(int* pnel,double** pindex,int* pnods,double** px,double** py,int* pnsegs,double** psegments,double** psegmentmarkerlist){
+
+	/*Some notes on dimensions: 
+	index  of size nelx3
+	x and y of size nodsx1
+	segments of size nsegsx3*/
+	
+	/*Error management: */
+	int noerr=1;
+	
+	int i,j,k,l;
+	int grid;
+	int el;
+
+	int  nriftsegs;
+	int* riftsegments=NULL; 
+	int* flags=NULL;
+	
+	int  NumGridElementListOnOneSideOfRift;
+	int* GridElementListOnOneSideOfRift=NULL;
+
+	/*Input: */
+	int     nel;
+	double* index=NULL;
+	int     nods;
+	double* x=NULL;
+	double* y=NULL;
+	double* segments=NULL;
+	double*    segmentmarkerlist=NULL;
+	int     nsegs;
+
+	/*Recover input: */
+	nel=*pnel;
+	index=*pindex;
+	nods=*pnods;
+	x=*px;
+	y=*py;
+	nsegs=*pnsegs;
+	segments=*psegments;
+	segmentmarkerlist=*psegmentmarkerlist;
+
+
+	/*Establish list of segments that belong to a rift: */
+	RiftSegmentsFromSegments(&nriftsegs,&riftsegments,nel,index,nsegs,segments); /*riftsegments of size nriftsegsx4 (4 for first element on segment,second element, 
+																				   first grid and second sgrid)*/
+
+	/*Go through all grids of the rift segments, and start splitting the mesh: */
+	flags=(int*)xcalloc(nods,sizeof(int)); //to make sure we don't split the same grids twice!
+	for (i=0;i<nriftsegs;i++){
+		for (j=0;j<2;j++){
+	
+			grid=*(riftsegments+4*i+j+2);
+			if(flags[grid-1]){
+				/*This grid was already split, skip:*/
+				continue;
+			}
+			else{
+				flags[grid-1]=1;
+			}
+
+			if(IsGridOnRift(riftsegments,nriftsegs,grid)){
+			
+				DetermineGridElementListOnOneSideOfRift(&NumGridElementListOnOneSideOfRift,&GridElementListOnOneSideOfRift,i,nriftsegs,riftsegments,grid,index,nel);
+			
+				/*Summary: we have for grid, a list of elements (GridElementListOnOneSideOfRift, of size NumGridElementListOnOneSideOfRift) that all contain grid 
+				 *and that are on the same side of the rift. For all these elements, we clone grid into another grid, and we swap all instances of grid in the triangulation 
+				 *for those elements, to the new grid.*/
+				
+				//augment number of grids 
+				nods=nods+1;
+				//create new grid
+				x=(double*)xrealloc(x,nods*sizeof(double));
+				y=(double*)xrealloc(y,nods*sizeof(double));
+				x[nods-1]=x[grid-1]; //matlab indexing
+				y[nods-1]=y[grid-1]; //matlab indexing
+
+				//change elements owning this grid
+				for (k=0;k<NumGridElementListOnOneSideOfRift;k++){
+					el=GridElementListOnOneSideOfRift[k];
+					for (l=0;l<3;l++){
+						if (*(index+3*el+l)==grid)*(index+3*el+l)=nods; //again, matlab indexing.
+					}
+				}
+			}// if(IsGridOnRift(riftsegments,nriftsegs,grid))
+		} //for(j=0;j<2;j++)
+	} //for (i=0;i<nriftsegs;i++)
+
+	/*update segments: they got modified completely by adding new grids.*/
+	UpdateSegments(&segments,&segmentmarkerlist, &nsegs,index,x,y,riftsegments,nriftsegs);
+
+	cleanup_and_return:
+
+	/*Assign output pointers: */
+	*pnel=nel;
+	*pindex=index;
+	*pnods=nods;
+	*px=x;
+	*py=y;
+	*pnsegs=nsegs;
+	*psegments=segments;
+	*psegmentmarkerlist=segmentmarkerlist;
+	return noerr;
+}
Index: /issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp
===================================================================
--- /issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 1)
+++ /issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 1)
@@ -0,0 +1,1295 @@
+/*
+ * TriMeshUtils: mesh manipulation routines: 
+ */
+
+#include "./trimesh.h"
+
+#include "../Alloc/alloc.h"
+
+
+int IsGridOnRift(int* riftsegments, int nriftsegs, int grid){
+
+	/*Does this grid belong to 4 elements, or just 2? If it belongs to 4 elements, it is inside a rift, 
+	 *if it belongs to 2 elements, it is on the tip of a rift, or it has already been split across the rift (see below).*/
+	
+	int i;
+	int j;
+	int count;
+
+	count=0;
+	for (i=0;i<nriftsegs;i++){
+		for (j=0;j<2;j++){
+			if ((*(riftsegments+4*i+2+j))==grid) count++;
+		}
+	}
+	if (count==2){
+		return 1;
+	}
+	else{
+		return 0;
+	}
+}
+				
+
+int GridElementsList(int** pGridElements, int* pNumGridElements,int grid,double * index,int nel){
+
+	/*From a grid, recover all the elements that are connected to it: */
+	int i,j;
+	int noerr=1;
+
+	int max_number_elements=12;
+	int current_size;
+	int NumGridElements;
+	int* GridElements=NULL;
+	int* GridElementsRealloc=NULL;
+
+	/*From a mesh with 30 degrees minimum angle, we get 12 possible elements that own 
+	 * the grid. We start by allocating GridElements with that size, and realloc 
+	 * more if needed.*/
+
+	current_size=max_number_elements;
+	NumGridElements=0;
+	GridElements=(int*)xmalloc(max_number_elements*sizeof(int));
+
+	for (i=0;i<nel;i++){
+		for (j=0;j<3;j++){
+			if ((int)*(index+3*i+j)==grid){
+				if (NumGridElements<=(current_size-1)){
+					GridElements[NumGridElements]=i;
+					NumGridElements++;
+					break;
+				}
+				else{
+					/*Reallocate another max_number_elements slots in the GridElements: */
+					GridElementsRealloc=(int*)xrealloc(GridElements,(current_size+max_number_elements)*sizeof(int));
+					if (!GridElementsRealloc){
+						noerr=0;
+						goto cleanup_and_return;
+					}
+					current_size+=max_number_elements;
+					GridElements=GridElementsRealloc;
+					GridElements[NumGridElements]=i;
+					NumGridElements++;
+					break;
+				}
+			}
+		}
+	}
+	cleanup_and_return:
+	if(!noerr){
+		xfree((void**)&GridElements);
+	}
+	/*Allocate return pointers: */
+	*pGridElements=GridElements;
+	*pNumGridElements=NumGridElements;
+	return noerr;
+}
+
+
+int IsNeighbor(int el1,int el2,double* index){
+	/*From a triangulation held in index, figure out if elements 1 and 2 have two grids in common: */
+	int i,j;
+	int count=0;
+	for (i=0;i<3;i++){
+		for (j=0;j<3;j++){
+			if (*(index+3*el1+i)==*(index+3*el2+j))count++;
+		}
+	}
+	if (count==2){
+		return 1;
+	}
+	else{
+		return 0;
+	}
+}
+							
+
+int IsOnRift(int el,int nriftsegs,int* riftsegments){
+	/*From a list of elements segments, figure out if el belongs to it: */
+	int i;
+	for (i=0;i<nriftsegs;i++){
+		if ((*(riftsegments+4*i+0)==el) | (*(riftsegments+4*i+1)==el)){
+			return 1;
+		}
+	}
+	return 0;
+}
+
+
+/******************************************************************************************************************************
+                                   RiftSegmentsFromSegments
+******************************************************************************************************************************/
+
+int RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel, double* index, int nsegs,double* segments){
+	
+	int i,counter;
+	int el,el2;
+	
+	int  nriftsegs;
+	int* riftsegments=NULL;
+	int* riftsegments_uncompressed=NULL; 
+	double element_grids[3];
+
+	/*Allocate segmentflags: */
+	riftsegments_uncompressed=(int*)xcalloc(nsegs*5,sizeof(int));
+
+	/*Find the segments that belong to a rift: they are the ones that see two elements. The other ones belong to a boundary 
+	 *or a hole: */
+	nriftsegs=0;
+	for (i=0;i<nsegs;i++){
+		el=(int)*(segments+3*i+2)-1; //element found in AssociateSegmentToElements
+		/*Temporarily set grids belonging to the segments to -1 in the triangulation index, and 
+		 *then  proceed to find another element that owns the segment. If we don't find it, we know 
+		 *we are dealing with a boundary or hole, otherwise, we are dealing with a rift: */
+		element_grids[0]=*(index+3*el+0);
+		element_grids[1]=*(index+3*el+1);
+		element_grids[2]=*(index+3*el+2);
+
+		*(index+3*el+0)=-1;
+		*(index+3*el+1)=-1;
+		*(index+3*el+2)=-1;
+
+		el2=FindElement(*(segments+3*i+0),*(segments+3*i+1),index,nel); 
+
+		/*Restore index: */
+		*(index+3*el+0)=element_grids[0];
+		*(index+3*el+1)=element_grids[1];
+		*(index+3*el+2)=element_grids[2];
+
+		if (el2!=-1){
+			/*el and el2 are on a segment rift, facing one another, plug them into riftsegments_uncompressed: */
+			#ifdef _DEBUG_
+				printf("Elements %i and %i are on a rift\n",el+1,el2+1);
+			#endif
+		    *(riftsegments_uncompressed+5*i+0)=1;
+		    *(riftsegments_uncompressed+5*i+1)=el;
+		    *(riftsegments_uncompressed+5*i+2)=el2;
+		    *(riftsegments_uncompressed+5*i+3)=(int)*(segments+3*i+0);
+		    *(riftsegments_uncompressed+5*i+4)=(int)*(segments+3*i+1);
+			nriftsegs++;
+		}
+	}
+
+	/*Compress riftsegments_uncompressed:*/
+	riftsegments=(int*)xmalloc(nriftsegs*4*sizeof(int));
+	counter=0;
+	for (i=0;i<nsegs;i++){
+		if (*(riftsegments_uncompressed+5*i+0)){
+			*(riftsegments+counter*4+0)=*(riftsegments_uncompressed+5*i+1);
+			*(riftsegments+counter*4+1)=*(riftsegments_uncompressed+5*i+2);
+			*(riftsegments+counter*4+2)=*(riftsegments_uncompressed+5*i+3);
+			*(riftsegments+counter*4+3)=*(riftsegments_uncompressed+5*i+4);
+			counter++;
+		}
+	}
+
+ 	#ifdef _DEBUG_
+	for (i=0;i<nriftsegs;i++){
+		printf("Elements %i and %i are on a rift, joined by grids %i and %i\n",*(riftsegments+4*i+0)+1,*(riftsegments+4*i+1)+1,*(riftsegments+4*i+2),*(riftsegments+4*i+3));
+	}
+	#endif
+	xfree((void**)&riftsegments_uncompressed);
+	
+	/*Assign output pointers: */
+	*priftsegments=riftsegments;
+	*pnriftsegs=nriftsegs;
+}
+
+/******************************************************************************************************************************
+                                   DetermineGridElementListOnOneSideOfRift
+******************************************************************************************************************************/
+
+int DetermineGridElementListOnOneSideOfRift(int* pNumGridElementListOnOneSideOfRift, int** pGridElementListOnOneSideOfRift, int segmentnumber, int nriftsegs, int* riftsegments, int grid,double* index,int nel){
+
+	int noerr=1;
+	int k,l,counter;
+	int newel;
+
+	int* GridElements=NULL;
+	int  NumGridElements;
+
+	/*Output: */
+	int NumGridElementListOnOneSideOfRift;
+	int* GridElementListOnOneSideOfRift=NULL;
+
+	/*Build a list of all the elements connected to this grid: */
+	GridElementsList(&GridElements,&NumGridElements,grid,index,nel);
+	#ifdef _DEBUG_
+		printf("Connected elements for grid %i\n",grid);
+		for (k=0;k<NumGridElements;k++){
+			printf("El %i\n",GridElements[k]+1);
+		}
+	#endif
+			
+	/*Figure out the list of elements  that are on the same side of the rift. To do so, we start from one 
+	 * side of the rift and keep rotating in the same direction:*/
+	GridElementListOnOneSideOfRift=(int*)xmalloc(NumGridElements*sizeof(int));
+	//bootstrap the GridElementListOnOneSideOfRift by filling elements from riftsegments: */
+	GridElementListOnOneSideOfRift[0]=*(riftsegments+4*segmentnumber+0); /*this one does not belong to the same side, but is just there 
+															   for a rotation direction, we 'll take it out when we are 
+															   done rotating*/
+	GridElementListOnOneSideOfRift[1]=*(riftsegments+4*segmentnumber+1);
+	#ifdef _DEBUG_
+	printf("Starting with elements %i and %i for grid %i\n",GridElementListOnOneSideOfRift[0]+1,GridElementListOnOneSideOfRift[1]+1,grid);
+	#endif
+	counter=1;
+	for (;;){
+		/*Find neighbour of element GridElementListOnOneSideOfRift[counter], not 
+		 * equal to GridElementListOnOneSideOfRift[counter-1]*/
+		for (k=0;k<NumGridElements;k++){
+			#ifdef _DEBUG_
+			printf("k: %i GridElements[k]: %i GridElementListOnOneSideOfRift[counter-1]: %i GridElementListOnOneSideOfRift[counter] %i Neighboor %i\n",k,GridElements[k]+1,
+				GridElementListOnOneSideOfRift[counter-1]+1,GridElementListOnOneSideOfRift[counter]+1,IsNeighbor(GridElements[k],GridElementListOnOneSideOfRift[counter],index));
+			#endif
+			if(IsNeighbor(GridElements[k],GridElementListOnOneSideOfRift[counter],index)){
+				/*Verify this element is not already in our list of element on the same side of the rift: */
+				newel=1;
+				for (l=0;l<=counter;l++){
+					if (GridElements[k]==GridElementListOnOneSideOfRift[l]){
+						newel=0;
+						break;
+					}
+				}
+				if (newel){
+					counter++;
+					GridElementListOnOneSideOfRift[counter]=GridElements[k];
+					if (IsOnRift(GridElements[k],nriftsegs,riftsegments)){
+						break;
+					}
+					k=-1;
+				}
+			}
+		}
+		/*Reduce counter by 1 and get rift of first element in GridElementListOnOneSideOfRift:*/
+		NumGridElementListOnOneSideOfRift=counter;
+		for (l=0;l<NumGridElementListOnOneSideOfRift;l++){
+			GridElementListOnOneSideOfRift[l]=GridElementListOnOneSideOfRift[l+1];
+		}
+		#ifdef _DEBUG_
+		printf("Grid %i is owned by  the following elements  on the same side of the rift: \n",grid);
+		for (l=0;l<NumGridElementListOnOneSideOfRift;l++){
+			printf("%i ",GridElementListOnOneSideOfRift[l]+1);
+		}
+		printf("\n");
+		#endif
+		break;
+	}// for (;;)
+
+	/*Free ressources: */
+	xfree((void**)&GridElements);
+	/*Assign output pointers: */
+	*pNumGridElementListOnOneSideOfRift=NumGridElementListOnOneSideOfRift;
+	*pGridElementListOnOneSideOfRift=GridElementListOnOneSideOfRift;
+	return noerr;
+}
+
+/******************************************************************************************************************************
+                                   UpdateSegments
+******************************************************************************************************************************/
+
+int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs){
+
+	int noerr=1;
+	int i,j,k;
+	int el1,el2;
+
+	double* segments=NULL;
+	double*    segmentmarkerlist=NULL;
+	int     nsegs;
+
+	/*Recover input: */
+	segments=*psegments;
+	segmentmarkerlist=*psegmentmarkerlist;
+	nsegs=*pnsegs;
+
+	/*Reallocate segments: */
+	segments=(double*)xrealloc(segments,(nsegs+nriftsegs)*3*sizeof(double));
+	segmentmarkerlist=(double*)xrealloc(segmentmarkerlist,(nsegs+nriftsegs)*sizeof(double));
+
+	/*First, update the existing segments to the new grids :*/
+	for (i=0;i<nriftsegs;i++){
+		el1=*(riftsegments+4*i+0);
+		el2=*(riftsegments+4*i+1);
+		for (j=0;j<nsegs;j++){
+			if (*(segments+3*j+2)==(el1+1)){
+				#ifdef _DEBUG_
+					printf("Segment %i is the same as rift segment %i\n",j,i);
+				#endif
+				/*segment j is the same as rift segment i.Let's update segments[j][:] using  element el1 and the corresponding rift segment.
+				 *Because riftsegments does not represent a list of rift segments anymore (it got heavily modified in SplitElementsForRifts, 
+				 *we can only rely on the position (x,y) of the rift grids to create a segment:*/
+				for (k=0;k<3;k++){
+					if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+0)-1]) & (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
+						*(segments+3*j+0)=*(index+el1*3+k);
+						break;
+					}
+				}
+				for (k=0;k<3;k++){
+					if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+1)-1]) & (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
+						*(segments+3*j+1)=*(index+el1*3+k);
+						break;
+					}
+				}
+				/*Deal with el2: */
+				*(segments+3*(nsegs+i)+2)=el2+1;
+				*(segmentmarkerlist+(nsegs+i))=*(segmentmarkerlist+j);
+				for (k=0;k<3;k++){
+					if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+0)-1]) & (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
+						*(segments+3*(nsegs+i)+0)=*(index+el2*3+k);
+						break;
+					}
+				}
+				for (k=0;k<3;k++){
+					if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+1)-1]) & (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
+						*(segments+3*(nsegs+i)+1)=*(index+el2*3+k);
+						break;
+					}
+				}
+			}
+			if (*(segments+3*j+2)==(el2+1)){
+				#ifdef _DEBUG_
+					printf("Segment %i is the same as rift segment %i\n",j,i);
+				#endif
+				/*segment j is the same as rift segment i.*/
+				/*Let's update segments[j][:] using  element el2 and the corresponding rift segment: */
+				for (k=0;k<3;k++){
+					if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+0)-1]) & (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
+						*(segments+3*j+0)=*(index+el2*3+k);
+						break;
+					}
+				}
+				for (k=0;k<3;k++){
+					if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+1)-1]) & (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
+						*(segments+3*j+1)=*(index+el2*3+k);
+						break;
+					}
+				}
+				/*Deal with el1: */
+				*(segments+3*(nsegs+i)+2)=el1+1;
+				*(segmentmarkerlist+(nsegs+i))=*(segmentmarkerlist+j);
+				for (k=0;k<3;k++){
+					if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+0)-1]) & (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
+						*(segments+3*(nsegs+i)+0)=*(index+el1*3+k);
+						break;
+					}
+				}
+				for (k=0;k<3;k++){
+					if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+1)-1]) & (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
+						*(segments+3*(nsegs+i)+1)=*(index+el1*3+k);
+						break;
+					}
+				}
+			}
+		}
+	}
+	nsegs+=nriftsegs;
+
+	/*Assign output pointers: */
+	*psegments=segments;
+	*psegmentmarkerlist=segmentmarkerlist;
+	*pnsegs=nsegs;
+	
+	return noerr;
+}
+
+/******************************************************************************************************************************
+                                   pnpoly
+******************************************************************************************************************************/
+int pnpoly(int npol, double *xp, double *yp, double x, double y) {
+	int i, j, c = 0;
+	for (i = 0, j = npol-1; i < npol; j = i++) {
+		if ((((yp[i]<=y) && (y<yp[j])) ||
+					((yp[j]<=y) && (y<yp[i]))) &&
+				(x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
+			c = !c;
+	}
+	return c;
+}
+
+/******************************************************************************************************************************
+                                   IsInPoly
+******************************************************************************************************************************/
+int IsInPoly(double* in,double* xc,double* yc,int numgrids,double* x,double* y,int nods){
+
+	int i,j;
+	double x0,y0;
+
+	/*Go through all grids of the mesh:*/
+	for (i=0;i<nods;i++){
+		if (in[i]){
+			/*this grid already is inside one of the contours, continue*/
+			continue;
+		}
+		/*pick up grid: */
+		x0=x[i];
+		y0=y[i];
+		if (pnpoly(numgrids,xc,yc,x0,y0)){
+			in[i]=1;
+		}
+	}
+}
+
+/******************************************************************************************************************************
+                                   FindElement
+******************************************************************************************************************************/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "FindElement"
+
+int FindElement(double A,double B,double* index,int nel){
+
+	int n;
+	int el=-1;
+	#ifdef _DEBUG_
+		printf("Looking for %lf %lf\n",A,B);
+	#endif
+	for (n=0;n<nel;n++){
+		if (((*(index+3*n+0)==A)  || (*(index+3*n+1)==A) || (*(index+3*n+2)==A) ) && ((*(index+3*n+0)==B)  || (*(index+3*n+1)==B) || (*(index+3*n+2)==B))){
+			el=n;
+			#ifdef _DEBUG_
+				printf("Found them: %lf %lf %lf\n",*(index+3*n+0),*(index+3*n+1),*(index+3*n+2));
+			#endif
+			break;
+		}
+	}
+	return el;
+}
+/******************************************************************************************************************************
+                                   SplitRiftSegments
+******************************************************************************************************************************/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "SplitRiftSegments"
+
+int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts){
+
+	/*Using segment markers, wring out the rift segments from the segments. Rift markers are 
+	 *of the form 2+i where i=0 to number of rifts */
+
+	int noerr=1;
+	int i,j,counter;
+
+	/*input: */
+	double* segments=NULL;
+	double* segmentmarkerlist=NULL;
+	int numsegs;
+	
+	/*output: */
+	int* riftsnumsegs=NULL;
+	double** riftssegments=NULL;
+	int new_numsegs;
+	double* new_segments=NULL;
+	double* new_segmentmarkers=NULL;
+
+	/*intermediary: */
+	double* riftsegment=NULL;
+
+	/*Recover input arguments: */
+	segments=*psegments;
+	numsegs=*pnumsegs;
+	segmentmarkerlist=*psegmentmarkerlist;
+
+	/*First, figure out  how many segments will be left in 'segments': */
+	counter=0;
+	for (i=0;i<numsegs;i++){
+		if (segmentmarkerlist[i]==1)counter++; //1 is default marker for non-rifts;
+	}
+	/*Allocate new segments: */
+	new_numsegs=counter;
+	new_segments=(double*)xmalloc(new_numsegs*3*sizeof(double));
+	new_segmentmarkers=(double*)xmalloc(new_numsegs*sizeof(double));
+
+	/*Copy new segments info : */
+	counter=0;
+	for (i=0;i<numsegs;i++){
+		if (segmentmarkerlist[i]==1){
+			*(new_segments+3*counter+0)=*(segments+3*i+0);
+			*(new_segments+3*counter+1)=*(segments+3*i+1);
+			*(new_segments+3*counter+2)=*(segments+3*i+2);
+			new_segmentmarkers[counter]=segmentmarkerlist[i];
+			counter++;
+		}
+	}
+
+	/*Now deal with rift segments: */
+	riftsnumsegs=(int*)xmalloc(numrifts*sizeof(int));
+	riftssegments=(double**)xmalloc(numrifts*sizeof(double*));
+	for (i=0;i<numrifts;i++){
+		/*Figure out how many segments for rift i: */
+		counter=0;
+		for (j=0;j<numsegs;j++){
+			if (segmentmarkerlist[j]==2+i)counter++;
+		}
+		riftsnumsegs[i]=counter;
+		riftsegment=(double*)xmalloc(counter*3*sizeof(double));
+		/*Copy new segments info :*/
+		counter=0;
+		for (j=0;j<numsegs;j++){
+			if (segmentmarkerlist[j]==(2+i)){
+				*(riftsegment+3*counter+0)=*(segments+3*j+0);
+				*(riftsegment+3*counter+1)=*(segments+3*j+1);
+				*(riftsegment+3*counter+2)=*(segments+3*j+2);
+				counter++;
+			}
+		}
+		*(riftssegments+i)=riftsegment;
+	}
+
+	/*Free ressources: */
+	xfree((void**)&segments);
+
+	/*Assign output pointers: */
+	*psegments=new_segments;
+	*psegmentmarkerlist=new_segmentmarkers;
+	*pnumsegs=new_numsegs;
+	*pnumrifts=numrifts;
+	*priftssegments=riftssegments;
+	*priftsnumsegs=riftsnumsegs;
+	return noerr;
+}
+
+/******************************************************************************************************************************
+                                   PairRiftElements
+******************************************************************************************************************************/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "PairRiftElements"
+		
+		
+int PairRiftElements(int** priftsnumpairs, double*** priftspairs,int numrifts,int* riftsnumsegments, double** riftssegments,double* x,double* y){
+
+
+	int noerr=1;
+	int i,j,k;
+
+	/*output: */
+	int* riftsnumpairs=NULL;
+	double** riftspairs=NULL;
+
+	/*intermediary :*/
+	int     numsegs;
+	double* segments=NULL;
+	double* pairs=NULL;
+	int     grid1,grid2,grid3,grid4;
+
+	riftsnumpairs=(int*)xmalloc(numrifts*sizeof(int));
+	riftspairs=(double**)xmalloc(numrifts*sizeof(double*));
+	for (i=0;i<numrifts;i++){
+		segments=riftssegments[i];
+		numsegs=riftsnumsegments[i];
+		riftsnumpairs[i]=numsegs;
+		pairs=(double*)xmalloc(2*numsegs*sizeof(double));
+		for (j=0;j<numsegs;j++){
+			*(pairs+2*j+0)=*(segments+3*j+2); //retrieve element to which this segment belongs.
+			grid1=(int)*(segments+3*j+0)-1; grid2=(int)*(segments+3*j+1)-1;
+			/*Find element facing on other side of rift: */
+			for (k=0;k<numsegs;k++){
+				if (k==j)continue;
+				grid3=(int)*(segments+3*k+0)-1; grid4=(int)*(segments+3*k+1)-1;
+				/*We are trying to find 2 elements, where position of grid3 == position of grid1, and position of grid4 == position of grid2*/
+				if (   (x[grid3]==x[grid1]) && (y[grid3]==y[grid1]) && (x[grid4]==x[grid2]) && (y[grid4]==y[grid2])
+				    || (x[grid3]==x[grid2]) && (y[grid3]==y[grid2]) && (x[grid4]==x[grid1]) && (y[grid4]==y[grid1])  ){
+					/*We found the corresponding element: */
+					*(pairs+2*j+1)=*(segments+3*k+2);
+					break;
+				}
+			}
+		}
+		riftspairs[i]=pairs;
+	}
+
+
+	/*Assign output pointers: */
+	*priftsnumpairs=riftsnumpairs;
+	*priftspairs=riftspairs;
+
+	return noerr;
+}
+
+
+/******************************************************************************************************************************
+                                   RemoveRifts
+******************************************************************************************************************************/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "RemoveRifts"
+		
+double dabs(double x){
+	if (x<0)x=-x;
+	return x;
+}
+int RemoveRifts(double** pindex,double** px,double** py,int* pnods,double** psegments,int* pnumsegs,int numrifts1,int* rifts1numsegs,double** rifts1segments,double** rifts1pairs,int nel){
+
+	int noerr=1;
+	int i,j,k,counter,counter1,counter2;
+
+	/*input: */
+	double* index=NULL;
+	double* x=NULL;
+	double* y=NULL;
+	int     nods;
+	double* segments=NULL;
+	int     numsegs;
+
+	/*intermediary: */
+	double* riftsegments=NULL;
+	double* riftpairs=NULL;
+	int     grid1,grid2,grid3,grid4,temp_grid;
+	double  el1,el2;
+	int     newnods; //temporary # grid counter.
+	double  xmin,ymin;
+	double* xreal=NULL;
+	double* yreal=NULL;
+	int* grids=NULL;
+	int* merginggrids=NULL;
+	int     max_size;
+	int     redundant;
+
+
+	/*Recover input: */
+	index=*pindex;
+	x=*px;
+	y=*py;
+	nods=*pnods;;
+	segments=*psegments;
+	numsegs=*pnumsegs;
+
+	/*initialize newnods : */
+	newnods=nods;
+
+	/*Figure out a unique value to flag x and y for grid removal: */
+	xmin=x[0];
+	ymin=y[0];
+	for (i=0;i<nods;i++){
+		if (x[i]<xmin)xmin=x[i];
+		if (y[i]<ymin)ymin=y[i];
+	}
+	xmin=xmin-dabs(xmin); 
+	ymin=ymin-dabs(ymin);
+
+	/*Initialize two arrays, one for grids that are going to be merged, the other with corresponding grids being merge into: */
+	max_size=0;
+	for (i=0;i<numrifts1;i++){
+		max_size+=rifts1numsegs[i];
+	}
+	grids=(int*)xmalloc(max_size*sizeof(int));
+	merginggrids=(int*)xmalloc(max_size*sizeof(int));
+
+	/*Go through the rifts segments, and identify which grid we are going to merge with its counterpart on the other side 
+	 *of the rift. The way we identify this grid is by looking at the element pairs, and the corresponding grids: */
+	counter=0;
+	for (i=0;i<numrifts1;i++){
+		riftsegments=rifts1segments[i];
+		riftpairs=rifts1pairs[i];
+		for (j=0;j<rifts1numsegs[i];j++){
+			el1=*(riftpairs+2*j+0);
+			el2=*(riftpairs+2*j+1);
+			grid1=(int)*(riftsegments+3*j+0);
+			grid2=(int)*(riftsegments+3*j+1);
+			/*Summary, el1 and el2 are facing one another across the rift. grid1 and grid2 belong to el1 and 
+			 *are located on the rift. Find grid3 and grid4, grids belonging to el2 and located on the rift: */
+			for (k=0;k<rifts1numsegs[i];k++){
+				if (*(riftsegments+3*k+2)==el2){
+					grid3=(int)*(riftsegments+3*k+0);
+					grid4=(int)*(riftsegments+3*k+1);
+					break;
+				}
+			}
+			/* Make sure grid3 faces grid1 and grid4 faces grid2: */
+			if ((x[grid1]==x[grid4]) && (y[grid1]==y[grid4])){
+				/*Swap grid3 and grid4:*/
+				temp_grid=grid3;
+				grid3=grid4;
+				grid4=temp_grid;
+			}
+			/* Is any of these two grid pairs on the tip of a rift, in which case, we don't include it in grids or merginggrids: */
+			if ((grid1==grid3) || (grid2==grid4)){
+				if(grid1!=grid3){
+					/*Add grid1 and grid3 to grids and merginggrids if they have not already been added: */
+					redundant=0;
+					for (k=0;k<counter;k++){
+						if ((merginggrids[k]==grid1) || (grids[k]==grid1))redundant=1;
+					}
+					if(!redundant){
+						/*Ok, add grid1 to grids, and grid3 to merginggrids: */
+						grids[counter]=grid1;
+						merginggrids[counter]=grid3;
+						counter++;
+					}
+				}
+				if(grid2!=grid4){
+					/*Add grid2 and grid4 to grids and merginggrids if they have not already been added: */
+					redundant=0;
+					for (k=0;k<counter;k++){
+						if ((merginggrids[k]==grid2) || (grids[k]==grid2))redundant=1;
+					}
+					if(!redundant){
+						/*Ok, add grid2 to grids, and grid4 to merginggrids: */
+						grids[counter]=grid2;
+						merginggrids[counter]=grid4;
+						counter++;
+					}
+				}
+			}
+			else{
+				/*Check that grid1 is not already present in the merginggrids: */
+				redundant=0;
+				for (k=0;k<counter;k++){
+					if ((merginggrids[k]==grid1) || (grids[k]==grid1))redundant=1;
+				}
+				if(!redundant){
+					/*Ok, add grid1 to grids, and grid3 to merginggrids: */
+					grids[counter]=grid1;
+					merginggrids[counter]=grid3;
+					counter++;
+				}
+				/*Check that grid2 is not already present in the merginggrids: */
+				redundant=0;
+				for (k=0;k<counter;k++){
+					if ((merginggrids[k]==grid1) || (grids[k]==grid1))redundant=1;
+				}
+				if(!redundant){
+					/*Ok, add grid2 to grids, and grid4 to merginggrids: */
+					grids[counter]=grid2;
+					merginggrids[counter]=grid4;
+					counter++;
+				}
+			}
+		}
+	}
+
+	/*Ok, we have counter pairs of grids (grids and merginggrids): start merging grids in the triangulation: */
+	newnods=nods;
+	for (i=0;i<counter;i++){
+		grid1=grids[i];
+		grid3=merginggrids[i];
+		/*Merge grid3 into grid1: */ 
+		x[grid3]=xmin; //flag  for later removal from x
+		y[grid3]=ymin; //flag  for later removal from y
+		newnods--;
+		for (k=0;k<nel;k++){
+			if (*(index+3*k+0)==grid3)*(index+3*k+0)=grid1;
+			if (*(index+3*k+1)==grid3)*(index+3*k+1)=grid1;
+			if (*(index+3*k+2)==grid3)*(index+3*k+2)=grid1;
+		}
+	}
+
+	/*Reallocate x and y: */
+	xreal=(double*)xrealloc(x,newnods*sizeof(double));
+	yreal=(double*)xrealloc(y,newnods*sizeof(double));
+	counter1=0;
+	counter2=0;
+	for (i=0;i<nods;i++){
+		if (x[i]!=xmin){
+			xreal[counter1]=x[i];
+			counter1++;
+		}
+		if (y[i]!=ymin){
+			yreal[counter2]=y[i];
+			counter2++;
+		}
+	}
+	xfree((void**)&x); x=xreal;
+	xfree((void**)&y); y=yreal;
+
+	/*Assign output pointers:*/
+	*pindex=index;
+	*px=x;
+	*py=y;
+	*pnods=newnods;
+	*psegments=segments;
+	*pnumsegs=numsegs;
+
+	return noerr;
+}
+
+/******************************************************************************************************************************
+                                   IsRiftPresent
+******************************************************************************************************************************/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "IsRiftPresent"
+	
+int IsRiftPresent(int* priftflag,int* pnumrifts, double* segmentmarkerlist,int nsegs){
+
+	int i;
+	int noerr=1;
+	
+	/*output: */
+	int riftflag=0;
+	int numrifts=0;
+
+	double maxmark=1; //default marker for regular segments
+
+	/*Any marker >=2 indicates a certain rift: */
+	numrifts=0;
+	for (i=0;i<nsegs;i++){
+		if (segmentmarkerlist[i]>maxmark){
+			numrifts++;
+			maxmark=segmentmarkerlist[i];
+		}
+	}
+	if (numrifts)riftflag=1;
+
+	/*Assign output pointers:*/
+	*priftflag=riftflag;
+	*pnumrifts=numrifts;
+
+	return noerr;
+}
+
+/******************************************************************************************************************************
+                                   OrderRifts
+******************************************************************************************************************************/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "OrderRifts"
+		
+int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y){
+	
+	int noerr=1;
+	int i,j,k,counter;
+
+	/*intermediary: */
+	double* riftsegments=NULL;
+	double* riftpairs=NULL;
+	int numsegs;
+
+	/*ordering and copy: */
+	int*    order=NULL;
+	double* riftsegments_copy=NULL;
+	double* riftpairs_copy=NULL;
+
+	/*grid and element manipulation: */
+	int     grid1,grid2,grid3,grid4,temp_grid,tip1,tip2,grid;
+	double  el1,el2;
+	int     already_ordered=0;
+
+	/*output: */
+	double* riftstips=NULL;
+
+
+	/*Allocate byproduct of this routine, riftstips: */
+	riftstips=(double*)xmalloc(numrifts*2*sizeof(double));
+
+	/*Go through all rifts: */
+	for (i=0;i<numrifts;i++){
+		riftsegments=riftssegments[i];
+		riftpairs=riftspairs[i];
+		numsegs=riftsnumsegments[i];
+	
+			
+		/*Allocate copy of riftsegments and riftpairs, 
+		 *as well as ordering vector: */
+		riftsegments_copy=(double*)xmalloc(numsegs*3*sizeof(double));
+		riftpairs_copy=(double*)xmalloc(numsegs*2*sizeof(double));
+		order=(int*)xmalloc(numsegs*sizeof(int));
+
+		/*First find the tips, using the pairs. If a pair of elements has one grid in common, this grid is a rift tip: */
+		tip1=-1;
+		tip2=-1;
+
+		for (j=0;j<numsegs;j++){
+			el1=*(riftpairs+2*j+0);
+			el2=*(riftpairs+2*j+1);
+			grid1=(int)*(riftsegments+3*j+0);
+			grid2=(int)*(riftsegments+3*j+1);
+			/*Summary, el1 and el2 are facing one another across the rift. grid1 and grid2 belong to el1 and 
+			 *are located on the rift. Find grid3 and grid4, grids belonging to el2 and located on the rift: */
+			for (k=0;k<numsegs;k++){
+				if (*(riftsegments+3*k+2)==el2){
+					grid3=(int)*(riftsegments+3*k+0);
+					grid4=(int)*(riftsegments+3*k+1);
+					break;
+				}
+			}
+			/* Make sure grid3 faces grid1 and grid4 faces grid2: */
+			if ((x[grid1]==x[grid4]) && (y[grid1]==y[grid4])){
+				/*Swap grid3 and grid4:*/
+				temp_grid=grid3;
+				grid3=grid4;
+				grid4=temp_grid;
+			}
+
+			/*Figure out if a tip is on this element: */
+			if (grid3==grid1){
+				/*grid1 is a tip*/
+				if (tip1==-1) {
+					tip1=grid1;
+					continue;
+				}
+				if ((tip2==-1) && (grid1!=tip1)){
+					tip2=grid1;
+					break;
+				}
+			}
+		
+			if (grid4==grid2){
+				/*grid2 is a tip*/
+				if (tip1==-1){
+					tip1=grid2;
+					continue;
+				}
+				if ((tip2==-1) && (grid2!=tip1)){
+					tip2=grid2;
+					break;
+				}
+			}
+		}
+
+		#ifdef _DEBUG_
+			printf("Tips for rift#%i   (%i-%i)\n",i,tip1,tip2);
+		#endif
+		/*Record tips in riftstips: */
+		*(riftstips+2*i+0)=(double)tip1;
+		*(riftstips+2*i+1)=(double)tip2;
+
+
+		/*We have the two tips for this rift.  Go from tip1 to tip2, and figure out the order in which segments are sequential. 
+		 *Because two elements are connected to tip1, we chose one first, which defines the direction we are rotating along the rift. */
+		grid=tip1;
+		for (counter=0;counter<numsegs;counter++){
+			for (j=0;j<numsegs;j++){
+				grid1=(int)*(riftsegments+3*j+0);
+				grid2=(int)*(riftsegments+3*j+1);
+				
+				if ((grid1==grid) || (grid2==grid)){
+					/*Ok, this segment is connected to grid, plug its index into order, unless we already plugged it before: */
+					already_ordered=0;
+					for (k=0;k<counter;k++){
+						if(order[k]==j){
+							already_ordered=1;
+							break;
+						}
+					}
+					if (!already_ordered){
+						order[counter]=j;
+						if(grid1==grid){
+							grid=grid2;
+						}
+						else if(grid2==grid){
+							grid=grid1;
+						}
+						break;
+					}
+				}
+			}
+		}
+
+		#ifdef _DEBUG_
+		for (j=0;j<numsegs;j++){
+			printf("%i\n",order[j]);
+		}
+		#endif
+
+		/*Using the order vector, and the riftsegments_copy and riftspairs_copy, reorder the segments and the pairs: */
+		for (j=0;j<numsegs;j++){
+			*(riftsegments_copy+3*j+0)=*(riftsegments+3*order[j]+0);
+			*(riftsegments_copy+3*j+1)=*(riftsegments+3*order[j]+1);
+			*(riftsegments_copy+3*j+2)=*(riftsegments+3*order[j]+2);
+			*(riftpairs_copy+2*j+0)=*(riftpairs+2*order[j]+0);
+			*(riftpairs_copy+2*j+1)=*(riftpairs+2*order[j]+1);
+		}
+		
+		for (j=0;j<numsegs;j++){
+			*(riftsegments+3*j+0)=*(riftsegments_copy+3*j+0);
+			*(riftsegments+3*j+1)=*(riftsegments_copy+3*j+1);
+			*(riftsegments+3*j+2)=*(riftsegments_copy+3*j+2);
+			*(riftpairs+2*j+0)=*(riftpairs_copy+2*j+0);
+			*(riftpairs+2*j+1)=*(riftpairs_copy+2*j+1);
+		}
+
+		xfree((void**)&order);
+		xfree((void**)&riftsegments_copy);
+		xfree((void**)&riftpairs_copy);
+
+	}
+
+	/*Assign output pointer:*/
+	*priftstips=riftstips;
+	return noerr;
+}
+
+/******************************************************************************************************************************
+                                   PenaltyPairs
+******************************************************************************************************************************/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "PenaltyPairs"
+			
+int PenaltyPairs(double*** priftspenaltypairs,int** priftsnumpenaltypairs,int numrifts,double** riftssegments,
+		int* riftsnumsegs,double** riftspairs,double* riftstips,double* x,double* y){
+		
+
+	int noerr=1;
+	int i,j,k,k0;
+
+	double el1,el2,grid1,grid2,grid3,grid4;
+	double tip1,tip2,temp_grid;
+
+	/*output: */
+	double** riftspenaltypairs=NULL;
+	double*  riftpenaltypairs=NULL;
+	int*     riftsnumpenaltypairs=NULL;
+
+	/*intermediary: */
+	int numsegs;
+	double* riftsegments=NULL;
+	double* riftpairs=NULL;
+	int counter;
+	double normal[2];
+	double length;
+	int    k1,k2;
+
+	/*Allocate: */
+	riftspenaltypairs=(double**)xmalloc(numrifts*sizeof(double*));
+	riftsnumpenaltypairs=(int*)xmalloc(numrifts*sizeof(int));
+
+	for(i=0;i<numrifts;i++){
+		numsegs=riftsnumsegs[i];
+		riftsegments=riftssegments[i];
+		riftpairs=riftspairs[i];
+		tip1=*(riftstips+2*i+0);
+		tip2=*(riftstips+2*i+1);
+
+		/*allocate riftpenaltypairs, and riftnumpenaltypairs: */
+		if((numsegs/2-1)!=0)riftpenaltypairs=(double*)xcalloc((numsegs/2-1)*7,sizeof(double));
+		
+		/*Go through only one flank of the rifts, not counting the tips: */
+		counter=0;
+		for(j=0;j<(numsegs/2);j++){
+			el1=*(riftpairs+2*j+0);
+			el2=*(riftpairs+2*j+1);
+			grid1=*(riftsegments+3*j+0);
+			grid2=*(riftsegments+3*j+1);
+			/*Find segment index to recover grid3 and grid4, facing grid1 and grid2: */
+			k0=-1;
+			for(k=0;k<numsegs;k++){
+				if(*(riftsegments+3*k+2)==el2){
+					k0=k;
+					break;
+				}
+			}
+			grid3=*(riftsegments+3*k0+0);
+			grid4=*(riftsegments+3*k0+1);
+
+			/* Make sure grid3 faces grid1 and grid4 faces grid2: */
+			if ((x[(int)grid1-1]==x[(int)grid4-1]) && (y[(int)grid1-1]==y[(int)grid4-1])){
+				/*Swap grid3 and grid4:*/
+				temp_grid=grid3;
+				grid3=grid4;
+				grid4=temp_grid;
+			}	
+			/*Ok, we have grid1 facing grid3, and grid2 facing grid4. Compute the normal to 
+			 *this segment, and its length: */
+			normal[0]=cos(atan2(x[(int)grid1-1]-x[(int)grid2-1],y[(int)grid2-1]-y[(int)grid1-1]));
+			normal[1]=sin(atan2(x[(int)grid1-1]-x[(int)grid2-1],y[(int)grid2-1]-y[(int)grid1-1]));
+			length=sqrt(pow(x[(int)grid2-1]-x[(int)grid1-1],(double)2)+pow(y[(int)grid2-1]-y[(int)grid1-1],(double)2));
+
+			/*Be careful here, we want penalty loads on each grid, not on each segment. This means we cannot plug grid1,
+			 * grid2, grid3 and grid4 directly into riftpenaltypairs. We need to include grid1, grid2, grid3 and grid4, 
+			 * only once. We'll add the normals and the lengths : */
+
+			if(grid1!=grid3){ //exclude tips from loads
+				k1=-1;
+				for(k=0;k<counter;k++){
+					if( (*(riftpenaltypairs+k*7+0))==grid1){
+						k1=k; 
+						break;
+					}
+				}
+				if(k1==-1){
+					*(riftpenaltypairs+counter*7+0)=grid1;
+					*(riftpenaltypairs+counter*7+1)=grid3;
+					*(riftpenaltypairs+counter*7+2)=el1;
+					*(riftpenaltypairs+counter*7+3)=el2;
+					*(riftpenaltypairs+counter*7+4)=normal[0];
+					*(riftpenaltypairs+counter*7+5)=normal[1];
+					*(riftpenaltypairs+counter*7+6)=length/2;
+					counter++;
+				}
+				else{
+					*(riftpenaltypairs+k1*7+4)+=normal[0];
+					*(riftpenaltypairs+k1*7+5)+=normal[1];
+					*(riftpenaltypairs+k1*7+6)+=length/2;
+				}
+			}
+			if(grid2!=grid4){
+				k2=-1;
+				for(k=0;k<counter;k++){
+					if( (*(riftpenaltypairs+k*7+0))==grid2){
+						k2=k;
+						break;
+					}
+				}
+				if(k2==-1){
+					*(riftpenaltypairs+counter*7+0)=grid2;
+					*(riftpenaltypairs+counter*7+1)=grid4;
+					*(riftpenaltypairs+counter*7+2)=el1;
+					*(riftpenaltypairs+counter*7+3)=el2;
+					*(riftpenaltypairs+counter*7+4)=normal[0];
+					*(riftpenaltypairs+counter*7+5)=normal[1];
+					*(riftpenaltypairs+counter*7+6)=length/2;
+					counter++;
+				}
+				else{
+					*(riftpenaltypairs+k2*7+4)+=normal[0];
+					*(riftpenaltypairs+k2*7+5)+=normal[1];
+					*(riftpenaltypairs+k2*7+6)+=length/2;
+				}
+			}
+		}
+		/*Renormalize normals: */
+		for(j=0;j<counter;j++){
+			double magnitude=sqrt(pow( *(riftpenaltypairs+j*7+4),2) + pow( *(riftpenaltypairs+j*7+5),2) );
+			*(riftpenaltypairs+j*7+4)=*(riftpenaltypairs+j*7+4)/magnitude;
+			*(riftpenaltypairs+j*7+5)=*(riftpenaltypairs+j*7+5)/magnitude;
+		}
+		
+		riftspenaltypairs[i]=riftpenaltypairs;
+		riftsnumpenaltypairs[i]=(numsegs/2-1);
+	}
+			
+
+
+	/*Assign output pointers: */
+	*priftspenaltypairs=riftspenaltypairs;
+	*priftsnumpenaltypairs=riftsnumpenaltypairs;
+
+	return noerr;
+}
+
+/******************************************************************************************************************************
+                                   RemoveCorners
+******************************************************************************************************************************/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "RemoveCorners"
+		
+
+int RemoveCornersFromRifts(double** pindex,int* pnel,double** px,double** py,int* pnods, double* segments,double* segmentmarkers,int num_seg){
+
+	int noerr=1;
+	int i,j,k;
+	double grid1,grid2,grid3;
+	int el;
+
+	/*input: */
+	double* index=NULL;
+	int     nel;
+	double* x=NULL;
+	double* y=NULL;
+	int     nods;
+	double  pair[2];
+	int     pair_count=0;
+	int     triple=0;
+
+	/*Recover input: */
+	index=*pindex;
+	nel=*pnel;
+	x=*px;
+	y=*py;
+	nods=*pnods;
+
+
+	for (i=0;i<num_seg;i++){
+		grid1=*(segments+3*i+0);
+		grid2=*(segments+3*i+1);
+		/*Find all elements connected to [grid1 grid2]: */
+		pair_count=0;
+		for (j=0;j<nel;j++){
+			if (*(index+3*j+0)==grid1){
+				if ((*(index+3*j+1)==grid2) || (*(index+3*j+2)==grid2)){
+					pair[pair_count]=j;
+					pair_count++;
+				}
+			}
+			if (*(index+3*j+1)==grid1){
+				if ((*(index+3*j+0)==grid2) || (*(index+3*j+2)==grid2)){
+					pair[pair_count]=j;
+					pair_count++;
+				}
+			}
+			if (*(index+3*j+2)==grid1){
+				if ((*(index+3*j+0)==grid2) || (*(index+3*j+1)==grid2)){
+					pair[pair_count]=j;
+					pair_count++;
+				}
+			}
+		}
+		/*Ok, we have pair_count elements connected to this segment. For each of these elements, 
+		 *figure out if the third grid also belongs to a segment: */
+		if ((pair_count==0) || (pair_count==1)){ //we only select the rift segments, which belong to  2 elements
+			continue;
+		}
+		else{
+			for (j=0;j<pair_count;j++){
+				el=(int)pair[j];
+				triple=0;
+				/*First find grid3: */
+				if (*(index+3*el+0)==grid1){
+					if (*(index+3*el+1)==grid2)grid3=*(index+3*el+2);
+					else grid3=*(index+3*el+1);
+				}
+				if (*(index+3*el+1)==grid1){
+					if (*(index+3*el+0)==grid2)grid3=*(index+3*el+2);
+					else grid3=*(index+3*el+0);
+				}
+				if (*(index+3*el+2)==grid1){
+					if (*(index+3*el+0)==grid2)grid3=*(index+3*el+1);
+					else grid3=*(index+3*el+0);
+				}
+				/*Ok, we have grid3. Does grid3 belong to a segment? : */
+				for (k=0;k<num_seg;k++){
+					if ((grid3==*(segments+3*k+0)) || (grid3==*(segments+3*k+1))){
+						triple=1;
+						break;
+					}
+				}
+				if(triple==1){
+					/*el is a corner element: we need to split it in 3 triangles: */
+					x=(double*)xrealloc(x,(nods+1)*sizeof(double));
+					y=(double*)xrealloc(y,(nods+1)*sizeof(double));
+					x[nods]=(x[(int)grid1-1]+x[(int)grid2-1]+x[(int)grid3-1])/3;
+					y[nods]=(y[(int)grid1-1]+y[(int)grid2-1]+y[(int)grid3-1])/3;
+
+					index=(double*)xrealloc(index,(nel+2)*3*sizeof(double));
+					/*First, reassign element el: */
+					*(index+3*el+0)=grid1;
+					*(index+3*el+1)=grid2;
+					*(index+3*el+2)=nods+1;
+					/*Other two elements: */
+					*(index+3*nel+0)=grid2;
+					*(index+3*nel+1)=grid3;
+					*(index+3*nel+2)=nods+1;
+
+					*(index+3*(nel+1)+0)=grid3;
+					*(index+3*(nel+1)+1)=grid1;
+					*(index+3*(nel+1)+2)=nods+1;
+					/*we need  to change the segment elements corresponding to el: */
+					for (k=0;k<num_seg;k++){
+						if (*(segments+3*k+2)==(double)(el+1)){
+							if ( ((*(segments+3*k+0)==grid1) && (*(segments+3*k+1)==grid2)) || ((*(segments+3*k+0)==grid2) && (*(segments+3*k+1)==grid1))) *(segments+3*k+2)=(double)(el+1);
+							if ( ((*(segments+3*k+0)==grid2) && (*(segments+3*k+1)==grid3)) || ((*(segments+3*k+0)==grid3) && (*(segments+3*k+1)==grid2))) *(segments+3*k+2)=(double)(nel+1);
+							if ( ((*(segments+3*k+0)==grid3) && (*(segments+3*k+1)==grid1)) || ((*(segments+3*k+0)==grid1) && (*(segments+3*k+1)==grid3))) *(segments+3*k+2)=(double)(nel+2);
+						}
+					}
+
+					nods=nods+1;
+					nel=nel+2;
+					i=0;
+					break;
+				}
+			} //for (j=0;j<pair_count;j++)
+		}
+	}// for (i=0;i<num_seg;i++)
+
+	/*Assign output pointers: */
+	*pindex=index;
+	*pnel=nel;
+	*px=x;
+	*py=y;
+	*pnods=nods;
+
+	return noerr;
+}
Index: /issm/trunk/src/c/shared/TriMesh/trimesh.h
===================================================================
--- /issm/trunk/src/c/shared/TriMesh/trimesh.h	(revision 1)
+++ /issm/trunk/src/c/shared/TriMesh/trimesh.h	(revision 1)
@@ -0,0 +1,42 @@
+/*!\file:  trimesh.h
+ * \brief
+ */ 
+
+#ifndef _SHARED_TRIMESH_H
+#define _SHARED_TRIMESH_H
+
+
+#include "stdio.h"
+#include <math.h>
+
+#define REAL double
+
+int AssociateSegmentToElement(double** psegments,int nseg, double* index,int nel);
+int OrderSegments(double** psegments,int nseg, double* index,int nel);
+		
+int GridInsideHole(double* px0,double* py0,int n,double* x,double* y);
+int FindElement(double A,double B,double* index,int nel);
+
+int SplitMeshForRifts(int* pnel,double** pindex,int* pnods,double** px,double** py,int* pnsegs,double** psegments,double** psegmentmarkerlist);
+
+int IsGridOnRift(int* riftsegments, int nriftsegs, int grid);
+int GridElementsList(int** pGridElements, int* pNumGridElements,int grid,double * index,int nel);
+int IsNeighbor(int el1,int el2,double* index);
+int IsOnRift(int el,int nriftsegs,int* riftsegments);
+int RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel, double* index, int nsegs,double* segments);
+int DetermineGridElementListOnOneSideOfRift(int* pNumGridElementListOnOneSideOfRift, int** pGridElementListOnOneSideOfRift, int segmentnumber, int nriftsegs, int* riftsegments, int grid,double* index,int nel);
+int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs);
+int pnpoly(int npol, double *xp, double *yp, double x, double y);
+int FindElement(double A,double B,double* index,int nel);
+int RemoveRifts(double** pindex,double** px,double** py,int* pnods,double** psegments,int* pnumsegs,int numrifts1,int* rifts1numsegs,double** rifts1segments,double** rifts1pairs,int nel);
+int IsRiftPresent(int* priftflag,int* pnumrifts, double* segmentmarkerlist,int nsegs);
+int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts);
+int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y);
+int PenaltyPairs(double*** priftspenaltypairs,int** priftsnumpenaltypairs,int numrifts,double**  riftssegments,
+		int* riftsnumsegments,double** riftspairs,double* riftstips,double* x,double* y);
+
+int RemoveCornersFromRifts(double** pindex,int* pnel,double** px,double** py,int* pnods, double* segments,double* segmentmarkers,int num_seg);
+int PairRiftElements(int** priftsnumpairs, double*** priftspairs,int numrifts,int* riftsnumsegments, double** riftssegments,double* x,double* y);
+
+
+#endif  /* _SHARED_TRIMESH_H */
Index: /issm/trunk/src/c/shared/shared.h
===================================================================
--- /issm/trunk/src/c/shared/shared.h	(revision 28275)
+++ /issm/trunk/src/c/shared/shared.h	(revision 1)
@@ -3,22 +3,18 @@
  */
 
+
 #ifndef _SHARED_H_
 #define _SHARED_H_
 
-#include "./FSanalyticals/fsanalyticals.h"
-#include "./MemOps/MemOps.h"
-#include "./Bamg/shared.h"
-#include "./Elements/elements.h"
-#include "./Enum/Enum.h"
-#include "./Exceptions/exceptions.h"
-#include "./io/io.h"
-#include "./Exp/exp.h"
-#include "./Matrix/matrix.h"
-#include "./Numerics/numerics.h"
-#include "./Sorting/sorting.h"
-#include "./String/sharedstring.h"
-#include "./Threads/issm_threads.h"
-#include "./Triangle/triangle.h"
-#include "./LatLong/latlong.h"
+#include "Alloc/alloc.h"
+#include "Matlab/matlabshared.h"
+#include "Exceptions/exceptions.h"
+#include "Exp/exp.h"
+#include "TriMesh/trimesh.h"
+#include "Sorting/sorting.h"
+#include "Elements/elements.h"
+#include "Matrix/matrix.h"
+#include "Numerics/numerics.h"
+
 
 #endif
Index: sm/trunk/src/c/toolkits/ToolkitOptions.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/ToolkitOptions.cpp	(revision 28275)
+++ 	(revision )
@@ -1,110 +1,0 @@
-/*! \file ToolkitOptions.cpp
- * \brief  file containing the methods for ToolkitOptions.h
- */
-
-#include <string.h>
-#include "./ToolkitOptions.h"
-#include "../shared/Numerics/types.h"
-#include "../shared/Exceptions/exceptions.h"
-#include "../shared/MemOps/MemOps.h"
-
-#ifdef _DO_NOT_LOAD_GLOBALS_
-char* ToolkitOptions::toolkittype;
-char* ToolkitOptions::toolkitoptions;
-#endif
-
-void  ToolkitOptions::Init(const char* toolkit_in,const char* options){ /*{{{*/
-
-	/*First, avoid a leak: */
-	xDelete<char>(toolkitoptions);
-	xDelete<char>(toolkittype);
-
-	/*copy options into toolkitoptions:*/
-	_assert_(toolkit_in);
-	_assert_(options);
-	toolkittype = xNew<char>(strlen(toolkit_in)+1); 
-	sprintf(toolkittype,"%s",toolkit_in);
-	toolkitoptions = xNew<char>(strlen(options)+1); 
-	sprintf(toolkitoptions,"%s",options);
-}/*}}}*/
-void  ToolkitOptions::Init(){ /*{{{*/
-	toolkittype    = NULL;
-	toolkitoptions = NULL;
-}/*}}}*/
-void  ToolkitOptions::Delete(){ /*{{{*/
-
-	xDelete<char>(toolkitoptions);
-	xDelete<char>(toolkittype);
-
-}/*}}}*/
-char* ToolkitOptions::GetToolkitType(){  /*{{{*/
-
-	if(toolkittype==NULL) _error_("toolkittype not set (may be a mex?)");
-	char* toolkittype_out = xNew<char>(strlen(toolkittype)+1); 
-	sprintf(toolkittype_out,"%s",toolkittype);
-	return toolkittype_out;
-}/*}}}*/
-char* ToolkitOptions::GetToolkitOptionValue(const char* option){  /*{{{*/
-
-	return TokenValue(toolkitoptions,option);
-
-}/*}}}*/
-char* TokenValue(char* tokenlist,const char* target){ /*{{{*/
-
-	/*output:*/
-	char* value=NULL;
-
-	/*intermediary: */
-	char *token         = NULL;
-	char *tokenlistcopy = NULL;
-
-	/*First, because tokenizing destroys a string, copy what we have: */
-	if(tokenlist==NULL) _error_("tokenlist not set (may be a mex?)");
-	tokenlistcopy= xNew<char>(strlen(tokenlist)+1); 
-	sprintf(tokenlistcopy,"%s",tokenlist);
-
-	/*Now go through list of tokens, and look for  target, return value: */
-	token=strtok(tokenlistcopy, " ");
-	while(token != NULL) {
-
-		/*Is this token starting with "-", if so, compare to our target: */
-		if (strncmp(token,"-",1)==0){
-			if (strcmp(token+1,target)==0){
-				/*Ok, we found our target. Get next token: */
-				token = strtok(NULL, " ");
-				/*This token could actually be another option start with "-", just be sure: */
-				if (strncmp(token,"-",1)==0){
-					/*ok, we hit another option, which means our target value is "":*/
-					value= xNew<char>(strlen("")+1); 
-					sprintf(value,"%s","");
-					continue;
-				}
-				else{
-					/*this token is the value we are looking for, copy: */
-					value= xNew<char>(strlen(token)+1); 
-					sprintf(value,"%s",token);
-				}
-			}
-			else{
-				/*we found the wrong target. Go to the next option: */
-				token = strtok(NULL, " ");
-				if (strncmp(token,"-",1)==0){
-					/*this is indeed an option, continue: */
-					continue;
-				}
-				else{
-					/*this is the value of the option, discard it: */
-				}
-			}
-		}
-		else _error_("token list should start with an option, not a value");
-
-		/*Get new token and continue*/
-		token = strtok(NULL, " ");
-	}
-
-	/*Clean up and return*/
-	xDelete<char>(tokenlistcopy);
-	return value;
-}
-/*}}}*/
Index: sm/trunk/src/c/toolkits/ToolkitOptions.h
===================================================================
--- /issm/trunk/src/c/toolkits/ToolkitOptions.h	(revision 28275)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/* \file ToolkitOptions.h
- * \brief  create a class with a static string of options, and static methods to access it
- * This is a way of protecting access to the toolkit options, and to make it accessible everywhere
- * in the code.
- */
-
-#ifndef _TOOLKIT_OPTIONS_H
-#define _TOOLKIT_OPTIONS_H
-
-class ToolkitOptions {
-
-	private:
-		static char* toolkittype;
-		static char* toolkitoptions;
-
-	public:
-		static void  Init(const char* type_in,const char* options);
-		static void  Init(void);
-		static void  Delete(void);
-		static char* GetToolkitType(void);
-		static char* GetToolkitOptionValue(const char* option);
-};
-
-char* TokenValue(char* tokenlist,const char* target);
-
-#endif  /* _TOOLKIT_OPTIONS_H */
Index: /issm/trunk/src/c/toolkits/metis/metisincludes.h
===================================================================
--- /issm/trunk/src/c/toolkits/metis/metisincludes.h	(revision 28275)
+++ /issm/trunk/src/c/toolkits/metis/metisincludes.h	(revision 1)
@@ -6,15 +6,6 @@
 #define _METIS_INCLUDES_H_
 
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
 /*Metis includes: */
 #include <metis.h>
 
-/*our own patches: */
-#include "patches/metispatches.h"
-
 #endif
Index: sm/trunk/src/c/toolkits/mpi/issmmpi.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/mpi/issmmpi.cpp	(revision 28275)
+++ 	(revision )
@@ -1,597 +1,0 @@
-/* \file issmmpi.cpp
- * \brief: implementation of all the mpi wrappers that ISSM requires. The goal is to control
- * which MPI layer we are using at compile time: the standard mpi, the autodiff mpi or no mpi at all.
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include <cassert>
-#include <cstring> // for memcpy
-
-#include "./issmmpi.h"
-
-#if defined(_HAVE_MPI_) && defined(_HAVE_CODIPACK_)
-MpiTypes* mpiTypes;
-#endif
-
-#include "../../shared/Numerics/types.h"
-
-#ifndef _HAVE_MPI_
-ISSM_MPI_Status ourIssmMPIStatusIgnore=0;
-size_t sizeHelper(ISSM_MPI_Datatype type) { /*{{{*/
-
-  switch(type) {
-  case ISSM_MPI_CHAR:
-    return sizeof(char);
-    break;
-  case ISSM_MPI_DOUBLE:
-    return sizeof(double);
-    break;
-  case ISSM_MPI_INT:
-    return sizeof(int);
-    break;
-  default:
-    assert(0);
-    break;
-  }
-  return 0;
-}/*}}}*/
-#endif
-
-int ISSM_MPI_Allgather(void *sendbuf, int sendcount, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcount, ISSM_MPI_Datatype recvtype, ISSM_MPI_Comm comm) {  /*{{{*/
-  int rc=0;
-  assert(sendcount==recvcount || sendtype==recvtype); // we handle only identical representations
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Allgather(sendbuf,
-		    sendcount,
-		    sendtype,
-		    recvbuf,
-		    recvcount,
-		    recvtype,
-		    comm);
-# else
-  rc=MPI_Allgather(sendbuf,
-		   sendcount,
-		   sendtype,
-		   recvbuf,
-		   recvcount,
-		   recvtype,
-		   comm);
-# endif
-#else
-# ifdef _HAVE_AD_
-  if (sendtype==ISSM_MPI_DOUBLE) {
-    IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
-    IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
-    for(int i=0;i<sendcount;++i) activeRecvBuf[i]=activeSendBuf[i];
-  }
-  else
-# endif
-    memcpy(recvbuf,sendbuf,sizeHelper(sendtype)*sendcount);
-#endif
-  return rc;
-} /*}}}*/
-int ISSM_MPI_Allgatherv(void *sendbuf, int sendcount, ISSM_MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, ISSM_MPI_Datatype recvtype, ISSM_MPI_Comm comm) {  /*{{{*/
-  int rc=0;
-  assert(sendtype==recvtype); // we handle only identical representations
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Allgatherv(sendbuf,
-		     sendcount,
-		     sendtype,
-		     recvbuf,
-		     recvcounts,
-		     displs,
-		     recvtype,
-		     comm);
-# else
-  rc=MPI_Allgatherv(sendbuf,
-		    sendcount,
-		    sendtype,
-		    recvbuf,
-		    recvcounts,
-		    displs,
-		    recvtype,
-		    comm);
-# endif
-#else
-  assert(sendcount==recvcounts[0]); // we handle only identical representations
-# ifdef _HAVE_AD_
-  if (sendtype==ISSM_MPI_DOUBLE) {
-    IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
-    IssmDouble* activeRecvBuf=(IssmDouble*)(recvbuf)+displs[0];
-    for(int i=0;i<sendcount;++i) activeRecvBuf[i]=activeSendBuf[i];
-  }
-  else
-# endif
-    memcpy((char*)recvbuf+(sizeHelper(recvtype)*displs[0]),sendbuf,sizeHelper(sendtype)*sendcount);
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Allreduce(void *sendbuf, void *recvbuf, int count, ISSM_MPI_Datatype datatype, ISSM_MPI_Op op, ISSM_MPI_Comm comm){/*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Allreduce(sendbuf,
-		    recvbuf,
-		    count,
-		    datatype,
-		    op,
-		    comm);
-# else
-  rc=MPI_Allreduce(sendbuf,
-		   recvbuf,
-		   count,
-		   datatype,
-		   op,
-		   comm);
-# endif
-#else
-#ifdef _HAVE_AD_
-  if (datatype==ISSM_MPI_DOUBLE) {
-    IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
-    IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
-    for(int i=0;i<count;++i) activeRecvBuf[i]=activeSendBuf[i];
-  }
-  else
-# endif
-    memcpy(recvbuf,sendbuf,sizeHelper(datatype)*count);
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Barrier(ISSM_MPI_Comm comm){  /*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Barrier(comm);
-# else
-  rc=MPI_Barrier(comm);
-# endif
-#else
-// do nothing
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Bcast(void *buffer, int count, ISSM_MPI_Datatype datatype, int root, ISSM_MPI_Comm comm){  /*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Bcast(buffer,
-		count,
-		datatype,
-		root,
-		comm);
-# else
-  rc=MPI_Bcast(buffer,
-	       count,
-	       datatype,
-	       root,
-	       comm);
-# endif
-#else
-// nothing to be done here
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Comm_free(ISSM_MPI_Comm *comm){ /*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  assert(0); // to be implemented
-# else
-  rc=MPI_Comm_free(comm);
-# endif
-#else
-// do nothing
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Comm_rank(ISSM_MPI_Comm comm, int *rank){  /*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-  rc=MPI_Comm_rank(comm,
-		   rank);
-#else
-  *rank=0;
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Comm_size( ISSM_MPI_Comm comm, int *size){ /*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-  rc=MPI_Comm_size(comm,
-		   size);
-#else
-  *size=1;
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Finalize(void){  /*{{{*/
-
-	int rc=0;
-	#ifdef _HAVE_MPI_
-		#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-			#if defined(_HAVE_ADJOINTMPI_)
-				rc=AMPI_Finalize();
-			#elif defined(_HAVE_MEDIPACK_)
-				/*Old implementation*/
-				//TOOL::finalize();
-				/*New implementation*/
-				delete mpiTypes;
-				rc=AMPI_Finalize();
-			#else
-				rc=AMPI_Finalize_NT();
-			#endif
-		#else
-		  rc=MPI_Finalize();
-		#endif
-	#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Gather(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm){  /*{{{*/
-
-  int rc=0;
-  assert(sendtype==recvtype && sendcnt==recvcnt); // we handle only identical representations
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Gather(sendbuf,
-		 sendcnt,
-		 sendtype,
-		 recvbuf,
-		 recvcnt,
-		 recvtype,
-		 root,
-		 comm);
-# else
-  rc=MPI_Gather(sendbuf,
-		sendcnt,
-		sendtype,
-		recvbuf,
-		recvcnt,
-		recvtype,
-		root,
-		comm);
-# endif
-#else
-# ifdef _HAVE_AD_
-  if (sendtype==ISSM_MPI_DOUBLE) {
-    IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
-    IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
-    for(int i=0;i<sendcnt;++i) activeRecvBuf[i]=activeSendBuf[i];
-  }
-  else
-# endif
-    memcpy(recvbuf,sendbuf,sizeHelper(sendtype)*sendcnt);
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Gatherv(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int *recvcnts, int *displs, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm){/*{{{*/
-
-  int rc=0;
-  assert(sendtype==recvtype); // we handle only identical representations
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Gatherv(sendbuf,
-		  sendcnt,
-		  sendtype,
-		  recvbuf,
-		  recvcnts,
-		  displs,
-		  recvtype,
-		  root,
-		  comm);
-# else
-  rc=MPI_Gatherv(sendbuf,
-		 sendcnt,
-		 sendtype,
-		 recvbuf,
-		 recvcnts,
-		 displs,
-		 recvtype,
-		 root,
-		 comm);
-# endif
-#else
-  assert(sendcnt==recvcnts[0]); // we handle only identical representations
-#ifdef _HAVE_AD_
-  if (sendtype==ISSM_MPI_DOUBLE) {
-    IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
-    IssmDouble* activeRecvBuf=(IssmDouble*)(recvbuf)+displs[0];
-    for(int i=0;i<sendcnt;++i) activeRecvBuf[i]=activeSendBuf[i];
-  }
-  else
-# endif
-    memcpy((char*)recvbuf+(sizeHelper(recvtype)*displs[0]),sendbuf,sizeHelper(sendtype)*sendcnt);
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Init(int *argc, char ***argv){  /*{{{*/
-
-	int rc=0;
-	#ifdef _HAVE_MPI_
-		#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-			#if defined(_HAVE_ADJOINTMPI_)
-				rc=AMPI_Init(argc,argv);
-			#elif defined(_HAVE_MEDIPACK_)
-				rc=AMPI_Init(argc,argv);
-				/*Old implementation of Medipack*/
-				//TOOL::init();
-				/*New*/
-				//MpiTypes* mpiTypes;
-				mpiTypes = new MpiTypes();
-			#else
-				rc=AMPI_Init_NT(argc,argv);
-			#endif
-		#else
-			rc=MPI_Init(argc,argv);
-		#endif
-	#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Recv(void *buf, int count, ISSM_MPI_Datatype datatype, int source, int tag, ISSM_MPI_Comm comm, ISSM_MPI_Status *status){ /*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Recv(buf,
-	       count,
-	       datatype,
-	       source,
-	       tag,
-			 #if !defined(_HAVE_ADJOINTMPI_) && !defined(_HAVE_MEDIPACK_)
-	       AMPI_FROM_SEND, // as long as there are no other variants
-			 #endif
-	       comm,
-	       status);
-# else
-  rc=MPI_Recv(buf,
-	      count,
-	      datatype,
-	      source,
-	      tag,
-	      comm,
-	      status);
-# endif
-#else
-// nothing to be done here
-// as long as nobody tries to do anything with 'status'
-// we won't do anything to it here either
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Reduce(void *sendbuf, void *recvbuf, int count, ISSM_MPI_Datatype datatype, ISSM_MPI_Op op, int root, ISSM_MPI_Comm comm){ /*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Reduce(sendbuf,
-		 recvbuf,
-		 count,
-		 datatype,
-		 op,
-		 root,
-		 comm);
-# else
-  rc=MPI_Reduce(sendbuf,
-		recvbuf,
-		count,
-		datatype,
-		op,
-		root,
-		comm);
-# endif
-#else
-# ifdef _HAVE_AD_
-  if (datatype==ISSM_MPI_DOUBLE) {
-    IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
-    IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
-    for(int i=0;i<count;++i) activeRecvBuf[i]=activeSendBuf[i];
-  }
-  else
-# endif
-    memcpy(recvbuf,sendbuf,sizeHelper(datatype)*count);
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Scatter(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm){ /*{{{*/
-
-  int rc=0;
-  assert(sendtype==recvtype && sendcnt==recvcnt); // we handle only identical representations
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Scatter(sendbuf,
-		  sendcnt,
-		  sendtype,
-		  recvbuf,
-		  recvcnt,
-		  recvtype,
-		  root,
-		  comm);
-# else
-  rc=MPI_Scatter(sendbuf,
-		 sendcnt,
-		 sendtype,
-		 recvbuf,
-		 recvcnt,
-		 recvtype,
-		 root,
-		 comm);
-# endif
-#else
-# ifdef _HAVE_AD_
-  if (sendtype==ISSM_MPI_DOUBLE) {
-    IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
-    IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
-    for(int i=0;i<recvcnt;++i) activeRecvBuf[i]=activeSendBuf[i];
-  }
-  else
-# endif
-    memcpy(recvbuf,sendbuf,sizeHelper(sendtype)*recvcnt);
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Scatterv(void *sendbuf, int *sendcnts, int *displs, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm){ /*{{{*/
-
-  int rc=0;
-  assert(sendtype==recvtype); // we handle only identical representations
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Scatterv(sendbuf,
-		   sendcnts,
-		   displs,
-		   sendtype,
-		   recvbuf,
-		   recvcnt,
-		   recvtype,
-		   root,
-		   comm);
-# else
-  rc=MPI_Scatterv(sendbuf,
-		  sendcnts,
-		  displs,
-		  sendtype,
-		  recvbuf,
-		  recvcnt,
-		  recvtype,
-		  root,
-		  comm);
-# endif
-#else
-  assert(sendcnts[0]==recvcnt); // we handle only identical representations
-# ifdef _HAVE_AD_
-  if (sendtype==ISSM_MPI_DOUBLE) {
-    IssmDouble* activeSendBuf=(IssmDouble*)(sendbuf)+displs[0];
-    IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
-    for(int i=0;i<recvcnt;++i) activeRecvBuf[i]=activeSendBuf[i];
-  }
-  else
-# endif
-    memcpy(recvbuf,(char*)sendbuf+(sizeHelper(sendtype)*displs[0]),sizeHelper(sendtype)*recvcnt);
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Send(void *buf, int count, ISSM_MPI_Datatype datatype, int dest, int tag, ISSM_MPI_Comm comm){ /*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Send(buf,
-	       count,
-	       datatype,
-	       dest,
-	       tag,
-			 #if !defined(_HAVE_ADJOINTMPI_) && !defined(_HAVE_MEDIPACK_)
-	       AMPI_TO_RECV, // as long as there are no other variants
-			 #endif
-	       comm);
-# else
-  rc=MPI_Send(buf,
-	      count,
-	      datatype,
-	      dest,
-	      tag,
-	      comm);
-# endif
-#else
-// nothing to be done here
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Isend(void *buf, int count, ISSM_MPI_Datatype datatype, int dest, int tag, ISSM_MPI_Comm comm, ISSM_MPI_Request* req){ /*{{{*/
-
-  int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-  rc=AMPI_Isend(buf,
-	       count,
-	       datatype,
-	       dest,
-	       tag,
-			 #if !defined(_HAVE_ADJOINTMPI_) && !defined(_HAVE_MEDIPACK_)
-	       AMPI_TO_RECV, // as long as there are no other variants
-			 #endif
-	       comm,
-		   req);
-# else
-  rc=MPI_Isend(buf,
-	      count,
-	      datatype,
-	      dest,
-	      tag,
-	      comm,
-	      req);
-# endif
-#else
-// nothing to be done here
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Wait(ISSM_MPI_Request *req, ISSM_MPI_Status *status){/*{{{*/
-	int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-	rc=AMPI_Wait(req, status);
-# else
-	rc=MPI_Wait(req, status);
-# endif
-#else
-// nothing to be done here
-#endif
-	return rc;
-}/*}}}*/
-double ISSM_MPI_Wtime(void){/*{{{*/
-
-#ifdef _HAVE_MPI_
-	return MPI_Wtime();
-#else
-	assert(0); // to be implemented
-	return 0.0;
-#endif
-}/*}}}*/
-void ISSM_MPI_ContiguousInAdolc(size_t aSize) { /*{{{*/
-
-#ifdef _HAVE_ADOLC_
-  ensureContiguousLocations(aSize);
-#else
-  fprintf(stderr, "*** Codipack ISSM_MPI_ContiguousInAdolc()\n");
-#endif
-}/*}}}*/
-int ISSM_MPI_Comm_split(ISSM_MPI_Comm comm, int color, int key, ISSM_MPI_Comm *newcomm){ /*{{{*/
-
-int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-rc=MPI_Comm_split(comm, color, key, newcomm);
-#else
-rc=MPI_Comm_split(comm, color, key, newcomm);
-#endif
-#else
-// nothing to be done here
-#endif
-  return rc;
-}/*}}}*/
-int ISSM_MPI_Intercomm_create(ISSM_MPI_Comm comm,int local_leader,ISSM_MPI_Comm peer_comm, int remote_leader, int tag,ISSM_MPI_Comm *newintercomm){ /*{{{*/
-
-	int rc=0;
-#ifdef _HAVE_MPI_
-#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
-	rc=MPI_Intercomm_create(comm,local_leader,peer_comm,remote_leader,tag,newintercomm);
-#else
-	rc=MPI_Intercomm_create(comm,local_leader,peer_comm,remote_leader,tag,newintercomm);
-#endif
-#else
-	// nothing to be done here
-#endif
-	return rc;
-}/*}}}*/
Index: sm/trunk/src/c/toolkits/mpi/issmmpi.h
===================================================================
--- /issm/trunk/src/c/toolkits/mpi/issmmpi.h	(revision 28275)
+++ 	(revision )
@@ -1,236 +1,0 @@
-/* \file issmmpi.h
- * \brief: header file that defines all the mpi wrappers that ISSM requires. The goal is to control
- * which MPI layer we are using at compile time: the standard mpi, the autodiff mpi or no mpi at all.
- */
-
-#ifndef _ISSM_MPI_H_
-#define _ISSM_MPI_H_
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-#include <cstddef>
-#include <cassert>
-#include "../../shared/Numerics/types.h"
-
-#if defined(_HAVE_MPI_)
-	/*Include header files: {{{*/
-	#if defined(_HAVE_AMPI_) && !defined(_WRAPPERS_)
-		#if defined(_HAVE_ADJOINTMPI_)
-			#include <ampi_tape.hpp>
-
-		#elif defined(_HAVE_MEDIPACK_)
-			#include "medi/medi.hpp"
-			using namespace medi;
-			#if defined(_HAVE_CODIPACK_)
-			/*Old implementation of MeDiPack*/
-			//#include "codi/externals/codiMediPackTypes.hpp"
-			//#define TOOL CoDiPackTool<IssmDouble>
-			//#define AMPI_ADOUBLE TOOL::MPI_TYPE
-			//
-			//#include <codi/externals/codiMpiTypes.hpp>
-			//using MpiTypes = CoDiMpiTypes<IssmDouble>;
-			/*New implementation*/
-			#if _CODIPACK_MAJOR_==2
-			#include <codi/tools/mpi/codiMpiTypes.hpp>
-			using MpiTypes = codi::CoDiMpiTypes<IssmDouble>;
-
-			#elif _CODIPACK_MAJOR_==1
-			#include <codi/externals/codiMpiTypes.hpp>
-			using MpiTypes = CoDiMpiTypes<IssmDouble>;
-
-			#else
-			#error "_CODIPACK_MAJOR_ not supported"
-			#endif
-
-			extern MpiTypes* mpiTypes;
-			#define AMPI_ADOUBLE mpiTypes->MPI_TYPE
-			#elif defined(_HAVE_ADOLC_)
-			#include "adolc/medipacksupport.h"
-			#define TOOL AdolcTool
-			#else
-			#error "don't know about AD tool"
-			#endif
-
-		#else
-			#include <ampi/ampi.h>
-		#endif
-	#elif  _HAVE_PETSC_MPI_ // PETSc now hides their MPI header. It can be reached through PETSc's header file.
-		#include <petsc.h>
-	#else
-		#include <mpi.h>
-	#endif
-	/*}}}*/
-	/*MPI defines: *{{{*/
-
-	// types
-	#if defined(_HAVE_MEDIPACK_) && !defined(_WRAPPERS_)
-	typedef AMPI_Comm     ISSM_MPI_Comm;
-	typedef AMPI_Datatype ISSM_MPI_Datatype;
-	typedef AMPI_Op       ISSM_MPI_Op;
-	typedef AMPI_Status   ISSM_MPI_Status;
-	typedef AMPI_Request  ISSM_MPI_Request;
-	#else
-	typedef MPI_Comm      ISSM_MPI_Comm;
-	typedef MPI_Datatype  ISSM_MPI_Datatype;
-	typedef MPI_Op        ISSM_MPI_Op;
-	typedef MPI_Status    ISSM_MPI_Status;
-	#if defined(_HAVE_AMPI_) && !defined(_WRAPPERS_)
-	typedef AMPI_Request   ISSM_MPI_Request;
-	#else
-	typedef MPI_Request  ISSM_MPI_Request;
-	#endif
-	#endif
-
-	#if defined(_HAVE_MEDIPACK_) && !defined(_WRAPPERS_)
-	#define ISSM_MPI_CHAR          AMPI_CHAR
-	#define ISSM_MPI_DOUBLE        AMPI_ADOUBLE // corresponds to IssmDouble
-	#define ISSM_MPI_PDOUBLE       AMPI_DOUBLE  // corresponds to IssmPDouble
-	#define ISSM_MPI_INT           AMPI_INT
-	#define ISSM_MPI_LONG_LONG_INT AMPI_LONG_LONG_INT
-
-	// operations
-	#define ISSM_MPI_MAX        AMPI_MAX
-	#define ISSM_MPI_MIN        AMPI_MIN
-	#define ISSM_MPI_PROD       AMPI_PROD
-	#define ISSM_MPI_SUM        AMPI_SUM
-
-	// others
-	#define ISSM_MPI_COMM_WORLD    AMPI_COMM_WORLD
-	#define ISSM_MPI_STATUS_IGNORE AMPI_STATUS_IGNORE
-	#define ISSM_MPI_ANY_TAG       AMPI_ANY_TAG
-	#define ISSM_MPI_ANY_SOURCE    AMPI_ANY_SOURCE
-	#define ISSM_MPI_REQUEST_NULL  AMPI_Request()
-
-	#else
-		#if defined(_HAVE_AMPI_) && !defined(_WRAPPERS_)
-			#define ISSM_MPI_DOUBLE    AMPI_ADOUBLE
-		#else
-			#define ISSM_MPI_DOUBLE    MPI_DOUBLE
-		#endif
-		#define ISSM_MPI_PDOUBLE        MPI_DOUBLE
-		#define ISSM_MPI_INT            MPI_INT
-		#define ISSM_MPI_LONG_LONG_INT  MPI_LONG_LONG_INT
-		#define ISSM_MPI_CHAR           MPI_CHAR
-
-		// operations
-		#define ISSM_MPI_MAX        MPI_MAX
-		#define ISSM_MPI_MIN        MPI_MIN
-		#define ISSM_MPI_PROD       MPI_PROD
-		#define ISSM_MPI_SUM        MPI_SUM
-
-		// others
-		#define ISSM_MPI_COMM_WORLD    MPI_COMM_WORLD
-		#define ISSM_MPI_STATUS_IGNORE MPI_STATUS_IGNORE
-		#define ISSM_MPI_ANY_TAG       MPI_ANY_TAG
-		#define ISSM_MPI_ANY_SOURCE    MPI_ANY_SOURCE
-		#if defined(_HAVE_AMPI_) && !defined(_WRAPPERS_)
-			#define ISSM_MPI_REQUEST_NULL  AMPI_Request()
-		#else
-			#define ISSM_MPI_REQUEST_NULL  0
-		#endif
-	#endif
-
-    /*other include files: */
-	#include "./commops/commops.h"
-	/*}}}*/
-#else
-	/*Our ISSM MPI defines: {{{*/
-	// types
-	typedef int  ISSM_MPI_Comm;
-	typedef int  ISSM_MPI_Datatype;
-	typedef int  ISSM_MPI_Op;
-	typedef int  ISSM_MPI_Status;
-	typedef int  ISSM_MPI_Request;
-
-	// data types
-	#define ISSM_MPI_CHAR          1
-	#define ISSM_MPI_DOUBLE        2
-	#define ISSM_MPI_PDOUBLE       3
-	#define ISSM_MPI_INT           4
-	#define ISSM_MPI_LONG_LONG_INT 5
-
-	// operations
-	#define ISSM_MPI_MAX        1
-	#define ISSM_MPI_MIN        2
-	#define ISSM_MPI_PROD       3
-	#define ISSM_MPI_SUM        4
-
-	// others
-	#define ISSM_MPI_COMM_WORLD    1
-	extern ISSM_MPI_Status ourIssmMPIStatusIgnore;
-	#define ISSM_MPI_STATUS_IGNORE &ourIssmMPIStatusIgnore
-	#define ISSM_MPI_ANY_TAG       2
-	#define ISSM_MPI_ANY_SOURCE    3
-	#define ISSM_MPI_REQUEST_NULL  0
-	/*}}}*/
-#endif
-
-/*Dynamically return ISSM_MPI type from variable type */
-template <class T> ISSM_MPI_Datatype TypeToMPIType(){assert(false);};
-template <> inline ISSM_MPI_Datatype TypeToMPIType<IssmDouble>(){return ISSM_MPI_DOUBLE;};
-#if defined(_HAVE_AD_) && !defined(_WRAPPERS_)
-template <> inline ISSM_MPI_Datatype TypeToMPIType<IssmPDouble>(){return ISSM_MPI_PDOUBLE;};
-#endif
-template <> inline ISSM_MPI_Datatype TypeToMPIType<int>(){return ISSM_MPI_INT;};
-template <> inline ISSM_MPI_Datatype TypeToMPIType<char>(){return ISSM_MPI_CHAR;};
-
-template <class T> int ISSM_MPI_Bcast(T *buffer, int count,int root, ISSM_MPI_Comm comm){  /*{{{*/
-
-	int rc=0;
-
-	/*Get MPI type*/
-	ISSM_MPI_Datatype datatype = TypeToMPIType<T>();
-
-#ifdef _HAVE_MPI_
-# ifdef _HAVE_AMPI_
-	rc=AMPI_Bcast(buffer,
-				count,
-				datatype,
-				root,
-				comm);
-# else
-	rc=MPI_Bcast(buffer,
-				count,
-				datatype,
-				root,
-				comm);
-# endif
-#else
-	// nothing to be done here
-#endif
-	return rc;
-}/*}}}*/
-/* interfaces  {{{*/
-int ISSM_MPI_Allgather(void *sendbuf, int sendcount, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcount, ISSM_MPI_Datatype recvtype, ISSM_MPI_Comm comm);
-int ISSM_MPI_Allgatherv(void *sendbuf, int sendcount, ISSM_MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, ISSM_MPI_Datatype recvtype, ISSM_MPI_Comm comm);
-int ISSM_MPI_Allreduce(void *sendbuf, void *recvbuf, int count, ISSM_MPI_Datatype datatype, ISSM_MPI_Op op, ISSM_MPI_Comm comm);
-int ISSM_MPI_Barrier(ISSM_MPI_Comm comm);
-int ISSM_MPI_Bcast(void *buffer, int count, ISSM_MPI_Datatype datatype, int root, ISSM_MPI_Comm comm);
-int ISSM_MPI_Comm_free(ISSM_MPI_Comm *comm);
-int ISSM_MPI_Comm_rank(ISSM_MPI_Comm comm, int *rank);
-int ISSM_MPI_Comm_size( ISSM_MPI_Comm comm, int *size);
-int ISSM_MPI_Finalize(void);
-int ISSM_MPI_Gather(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm);
-int ISSM_MPI_Gatherv(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int *recvcnts, int *displs, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm);
-int ISSM_MPI_Init(int *argc, char ***argv);
-int ISSM_MPI_Recv(void *buf, int count, ISSM_MPI_Datatype datatype, int source, int tag, ISSM_MPI_Comm comm, ISSM_MPI_Status *status);
-int ISSM_MPI_Reduce(void *sendbuf, void *recvbuf, int count, ISSM_MPI_Datatype datatype, ISSM_MPI_Op op, int root, ISSM_MPI_Comm comm);
-int ISSM_MPI_Scatter(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm);
-int ISSM_MPI_Scatterv(void *sendbuf, int *sendcnts, int *displs, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm);
-int ISSM_MPI_Send(void *buf, int count, ISSM_MPI_Datatype datatype, int dest, int tag, ISSM_MPI_Comm comm);
-int ISSM_MPI_Isend(void* buf, int count, ISSM_MPI_Datatype datatype, int dest, int tag, ISSM_MPI_Comm comm, ISSM_MPI_Request* req);
-int ISSM_MPI_Wait(ISSM_MPI_Request* req, ISSM_MPI_Status* status);
-double ISSM_MPI_Wtime(void);
-int ISSM_MPI_Comm_split(ISSM_MPI_Comm comm, int color, int key, ISSM_MPI_Comm *newcomm);
-int ISSM_MPI_Intercomm_create(ISSM_MPI_Comm comm,int local_leader,ISSM_MPI_Comm peer_comm, int remote_leader, int tag,ISSM_MPI_Comm *newintercomm);
-
-// special for Adol-C locations when buffers are allocated with new
-// this could end up in the xNew template specialized for adoubles
-// so as to not litter the code with it.
-void ISSM_MPI_ContiguousInAdolc(size_t aSize);
-/*}}}*/
-
-#endif  //#ifndef _ISSM_MPI_H_
Index: /issm/trunk/src/c/toolkits/mpi/mpiincludes.h
===================================================================
--- /issm/trunk/src/c/toolkits/mpi/mpiincludes.h	(revision 1)
+++ /issm/trunk/src/c/toolkits/mpi/mpiincludes.h	(revision 1)
@@ -0,0 +1,14 @@
+/* \file mpiincludes.h
+ * \brief all includes for MPI layer
+ */
+
+#ifndef _MPI_INCLUDES_H_
+#define _MPI_INCLUDES_H_
+
+/*MPI includes: */
+#include "mpi.h"
+
+/*Patches: */
+#include "./patches/mpipatches.h"
+
+#endif
Index: /issm/trunk/src/c/toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/mpi/patches/MPI_Boundariesfromrange.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/mpi/patches/MPI_Boundariesfromrange.cpp	(revision 1)
@@ -0,0 +1,43 @@
+/*!\file MPI_Boundariesfromrange.cpp
+ * \brief: routine to figure out from a range distribution, the lower and upper 
+ * bounds for the current cpu.
+ */
+
+#include "../../petsc/patches/petscpatches.h"
+#include "./mpipatches.h"
+#include "../../../shared/shared.h"
+
+int MPI_Boundariesfromrange(int* plower_row, int* pupper_row,int range){
+
+	extern int num_procs;
+	extern int my_rank;
+	
+	/*output: */
+	int lower_row,upper_row;
+
+	/*intermediary: */
+	int  i;
+	int* allranges=NULL;
+
+	/*Gather all range values into allranges, for all nodes*/
+	allranges=(int*)xmalloc(num_procs*sizeof(int));
+	MPI_Allgather(&range,1,MPI_INT,allranges,1,MPI_INT,MPI_COMM_WORLD);
+
+
+	/*From all ranges, get lower row and upper row*/
+	lower_row=0;
+	upper_row=lower_row+allranges[0];
+	for (i=1;i<=my_rank;i++){
+		lower_row=lower_row+allranges[i-1];
+		upper_row=upper_row+allranges[i];
+	}
+	
+	/*free: */
+	xfree((void**)&allranges);
+
+	/*Assign output pointers: */
+	*plower_row=lower_row;
+	*pupper_row=upper_row;
+
+	return 1;
+}
Index: /issm/trunk/src/c/toolkits/mpi/patches/MPI_Lowerrow.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/mpi/patches/MPI_Lowerrow.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/mpi/patches/MPI_Lowerrow.cpp	(revision 1)
@@ -0,0 +1,33 @@
+/*!\file MPI_Lowerrow.cpp
+ * \brief: routine to distribute jobs in parallel. 
+ * This handy routine will provide, along with the MPI_Upperrow, a distributed range 
+ * for an index (like i,j, in a for loop). 
+ * Ex: for(i=MPI_Lowerrow(num_procs)0;i<MPI_Upperrow(num_procs);i++)
+ * This ensures easy parallelisation of loops if needed.
+ */
+
+#include "../../petsc/patches/petscpatches.h"
+#include "./mpipatches.h"
+
+int MPI_Lowerrow(int n){
+
+
+	int range;
+	int lower_row;
+	int upper_row;
+	
+
+	/*First, figure out our range : */
+	range=PetscDetermineLocalSize(n);
+
+	/*Now determien upper and lower boundaries: */
+	MPI_Boundariesfromrange(&lower_row,&upper_row,range);
+
+	return lower_row;
+	
+}
+
+
+
+
+
Index: /issm/trunk/src/c/toolkits/mpi/patches/MPI_Upperrow.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/mpi/patches/MPI_Upperrow.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/mpi/patches/MPI_Upperrow.cpp	(revision 1)
@@ -0,0 +1,31 @@
+/*!\file MPI_Upperrow.cpp
+ * \brief: routine to distribute jobs in parallel. 
+ * This handy routine will provide, along with the MPI_Lowrrow, a distributed range 
+ * for an index (like i,j, in a for loop). 
+ * Ex: for(i=MPI_Lowerrow(num_procs)0;i<MPI_Upperrow(num_procs);i++)
+ * This ensures easy parallelisation of loops if needed.
+ */
+
+#include "../../petsc/patches/petscpatches.h"
+#include "./mpipatches.h"
+
+int MPI_Upperrow(int n){
+
+	int range;
+	int lower_row;
+	int upper_row;
+
+	/*First, figure out our range : */
+	range=PetscDetermineLocalSize(n);
+
+	/*Now determien upper and lower boundaries: */
+	MPI_Boundariesfromrange(&lower_row,&upper_row,range);
+
+	return upper_row;
+	
+}
+
+
+
+
+
Index: /issm/trunk/src/c/toolkits/mpi/patches/mpipatches.h
===================================================================
--- /issm/trunk/src/c/toolkits/mpi/patches/mpipatches.h	(revision 1)
+++ /issm/trunk/src/c/toolkits/mpi/patches/mpipatches.h	(revision 1)
@@ -0,0 +1,17 @@
+/*! \file mpipatches.h
+ *  \brief: prototype header for all ISSM add-ons to MPI
+ */
+
+
+#ifndef MPI_PATCHES_H_ 
+#define MPI_PATCHES_H_
+
+
+int MPI_Boundariesfromrange(int* plower_row, int* pupper_row,int range);
+int MPI_Lowerrow(int n);
+int MPI_Upperrow(int n);
+
+
+
+
+#endif
Index: /issm/trunk/src/c/toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp	(revision 1)
@@ -0,0 +1,51 @@
+/*! \file:  GetOwnershipBoundariesFromRange.cpp
+ *  \brief from a local range on each cpu, we determine what 
+ *  lower row and upper row from a matrix a cpu owns.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "../../../shared/shared.h"
+
+#undef __FUNCT__
+#define __FUNCT__ "GetOwnershipBoundariesFromRange"
+
+void GetOwnershipBoundariesFromRange(int* plower_row,int* pupper_row,int range){
+
+	/*externals :*/
+	extern int my_rank;
+	extern int num_procs;
+	
+	/*output: */
+	int lower_row,upper_row;
+	
+	/*intermediary :*/
+	int i;
+	int* allranges=NULL;
+
+	/*Gather all range values into allranges, for all nodes*/
+	allranges=(int*)xmalloc(num_procs*sizeof(int));
+	MPI_Allgather(&range,1,MPI_INT,allranges,1,MPI_INT,MPI_COMM_WORLD);
+
+	/*From all ranges, get lower row and upper row*/
+	lower_row=0;
+	upper_row=lower_row+allranges[0];
+	for (i=1;i<=my_rank;i++){
+		lower_row=lower_row+allranges[i-1];
+		upper_row=upper_row+allranges[i];
+	}
+
+	/*Assign output*/
+	*plower_row=lower_row;
+	*pupper_row=upper_row;
+
+	/*Free ressources:*/
+	xfree((void**)&allranges);
+
+}
Index: /issm/trunk/src/c/toolkits/petsc/patches/ISFree.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/ISFree.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/ISFree.cpp	(revision 1)
@@ -0,0 +1,23 @@
+/*!\file:  ISFree.cpp
+ * \brief wrapper to ISDestroy
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscmat.h"
+#include "petscksp.h"
+
+void ISFree(IS* pis){
+
+	if(*pis)ISDestroy(*pis);
+	*pis=NULL;
+
+}
+
Index: sm/trunk/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp	(revision 28275)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/* \file ISSMToPetscInsertMode.cpp
- * \brief: convert InsertMode from ISSM to Petsc
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-/*Petsc includes: */
-#include <petscksp.h>
-
-/*ISSM includes: */
-#include "../../toolkitsenums.h"
-#include "../../../shared/shared.h"
-
-InsertMode ISSMToPetscInsertMode(InsMode mode){
-
-	switch(mode){
-		case ADD_VAL:  
-			return ADD_VALUES;
-			break;
-		case INS_VAL:
-			return INSERT_VALUES;
-			break;
-		default: 
-			_error_("unknown insert mode!");
-			break;
-	}
-}
Index: sm/trunk/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp	(revision 28275)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/* \file ISSMToPetscMatrixType.cpp
- * \brief: convert MatrixType from ISSM to Petsc
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-/*Petsc includes: */
-#include <petscksp.h>
-
-/*ISSM includes: */
-#include "../../toolkitsenums.h"
-#include "../../../shared/shared.h"
-
-MatType ISSMToPetscMatrixType(MatrixType type){
-
-	switch(type){
-		case DENSE_SEQUENTIAL:  
-			return MATSEQDENSE;
-			break;
-		case SPARSE_SEQUENTIAL:  
-			return MATSEQAIJ;
-			break;
-		default: 
-			_error_("unknown matrix type !");
-			break;
-	}
-}
Index: sm/trunk/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp	(revision 28275)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/* \file ISSMToPetscNormMode.cpp
- * \brief: convert NormMode from ISSM to Petsc
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-/*Petsc includes: */
-#include <petscksp.h>
-
-/*ISSM includes: */
-#include "../../toolkitsenums.h"
-#include "../../../shared/shared.h"
-
-NormType ISSMToPetscNormMode(NormMode mode){
-
-	switch(mode){
-		case NORM_INF:  
-			return NORM_INFINITY;
-			break;
-		case NORM_TWO:  
-			return NORM_2;
-			break;
-		default: 
-			_error_("unknown norm !");
-			break;
-	}
-}
Index: /issm/trunk/src/c/toolkits/petsc/patches/KSPFree.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/KSPFree.cpp	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/patches/KSPFree.cpp	(revision 1)
@@ -4,21 +4,20 @@
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+	#include "config.h"
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
 #endif
 
+
 /*Petsc includes: */
-#include <petscksp.h>
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
 
 void KSPFree(KSP* pksp){
 
-	#if PETSC_VERSION_LT(3,2,0)
 	if(*pksp)KSPDestroy(*pksp);
 	*pksp=NULL;
-	#else
-	if(*pksp)KSPDestroy(pksp);
-	*pksp=NULL;
-	#endif
 
 }
+
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatFree.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatFree.cpp	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatFree.cpp	(revision 1)
@@ -4,21 +4,20 @@
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+	#include "config.h"
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
 #endif
 
+
 /*Petsc includes: */
-#include <petscksp.h>
+#include "petscmat.h"
+#include "petscmat.h"
+#include "petscksp.h"
 
 void MatFree(Mat* pmat){
 
-	#if PETSC_VERSION_LT(3,2,0)
 	if(*pmat)MatDestroy(*pmat);
 	*pmat=NULL;
-	#else
-	if(*pmat)MatDestroy(pmat);
-	*pmat=NULL;
-	#endif
 
 }
+
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatInvert.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 1)
@@ -0,0 +1,76 @@
+/*!\file:  MatInvert.cpp
+ * \brief  invert petsc matrix using LU factorization, and multiple right hand sides.
+ */ 
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "MatInvert"
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+#include "../../../shared/shared.h"
+
+void MatInvert(Mat* pinv, Mat matrix){
+
+
+	/*output: */
+	Mat inv=NULL;
+
+	/*intermediary: */
+	int M,N;
+	double sparsity=.001;
+
+	Mat factored_matrix=NULL;
+	Mat identity=NULL;
+	Vec diagonal=NULL;
+	KSP ksp=NULL;
+	PC pc=NULL;
+
+	/*Some checks: */
+	MatGetSize(matrix,&M,&N);
+	if(M!=N)throw ErrorException(__FUNCT__," trying to invert a non square matrix!");
+
+	/*Create identitiy matrix: */
+	identity=NewMat(M,N,&sparsity,NULL,NULL);
+	diagonal=NewVec(M);
+	VecSet(diagonal,1.0);
+	MatDiagonalSet(identity,diagonal,INSERT_VALUES);
+	MatAssemblyBegin(identity,MAT_FINAL_ASSEMBLY);
+	MatAssemblyEnd(identity,MAT_FINAL_ASSEMBLY);
+	MatConvert(identity, MATMPIDENSE,MAT_REUSE_MATRIX,&identity);
+	
+	/*Initialize inverse: */
+	MatDuplicate(identity,MAT_DO_NOT_COPY_VALUES,&inv);
+
+	/* Compute X=inv(A) by MatMatSolve(), from tests in petsc test27 */
+	KSPCreate(PETSC_COMM_WORLD,&ksp);
+	KSPSetOperators(ksp,matrix,matrix,DIFFERENT_NONZERO_PATTERN);
+	KSPGetPC(ksp,&pc);
+	PCSetType(pc,PCLU);
+	KSPSetUp(ksp);
+	PCGetFactoredMatrix(pc,&factored_matrix);
+	MatMatSolve(factored_matrix,identity,inv);
+
+	/*Assemble inverse: */
+	MatAssemblyBegin(inv,MAT_FINAL_ASSEMBLY);
+	MatAssemblyEnd(inv,MAT_FINAL_ASSEMBLY);
+
+	#ifdef _SERIAL_
+		MatConvert(inv, MATSEQAIJ,MAT_REUSE_MATRIX,&inv);
+	#else
+		MatConvert(inv, MATMPIAIJ,MAT_REUSE_MATRIX,&inv);
+	#endif
+	
+	/*Free ressources:*/
+	MatFree(&identity);
+	VecFree(&diagonal);
+	KSPDestroy(ksp);
+
+	/*Assign output pointers:*/
+	*pinv=inv;
+
+}
+
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatMultPatch.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatMultPatch.cpp	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatMultPatch.cpp	(revision 1)
@@ -4,5 +4,5 @@
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+	#include "config.h"
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
@@ -10,67 +10,61 @@
 
 /*Petsc includes: */
-#include <petscksp.h>
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
 
-#include "../../mpi/issmmpi.h"
 #include "../../../shared/shared.h"
 
 /*Function prototypes: */
-int MatMultCompatible(Mat A,Vec x,ISSM_MPI_Comm comm);
-void VecRelocalize(Vec* outvector,Vec vector,int m,ISSM_MPI_Comm comm);
+int MatMultCompatible(Mat A,Vec x);
+void VecRelocalize(Vec* outvector,Vec vector,int m);
 
-void MatMultPatch(Mat A,Vec X, Vec AX,ISSM_MPI_Comm comm){ //same prototype as MatMult in Petsc
+void MatMultPatch(Mat A,Vec X, Vec AX){ //same prototype as MatMult in Petsc
 
 	int m,n;
-	Vec X_rel=NULL;
+	Vec X_rel;
 
-	_assert_(A); _assert_(X);
-
-	if (MatMultCompatible(A,X,comm)){
+	if (MatMultCompatible(A,X)){
 		MatMult(A,X,AX); 
 	}
 	else{
 		MatGetLocalSize(A,&m,&n);;
-		VecRelocalize(&X_rel,X,n,comm);
+		VecRelocalize(&X_rel,X,n);
 		MatMult(A,X_rel,AX); ;
-		#if PETSC_VERSION_LT(3,2,0)
-		VecDestroy(X_rel);
-		#else
-		VecDestroy(&X_rel);
-		#endif
+		VecDestroy(X_rel);;
 	}
 }
 
-int MatMultCompatible(Mat A,Vec x,ISSM_MPI_Comm comm){
-
+int MatMultCompatible(Mat A,Vec x){
+	
 	/*error management*/
-
+	
 	int local_m,local_n;
-	int range;
+	int lower_row,upper_row,range;
 	int result=1;
 	int sumresult;
-	int num_procs;
-
-	/*recover num_procs:*/
-	ISSM_MPI_Comm_size(comm,&num_procs);
+	extern int num_procs;
 
 	MatGetLocalSize(A,&local_m,&local_n);;
 	VecGetLocalSize(x,&range);;
-
+	
 	if (local_n!=range)result=0;
-
+	
 	/*synchronize result: */
-	ISSM_MPI_Reduce (&result,&sumresult,1,ISSM_MPI_INT,ISSM_MPI_SUM,0,comm );
-	ISSM_MPI_Bcast(&sumresult,1,ISSM_MPI_INT,0,comm);                
+	MPI_Reduce (&result,&sumresult,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
+	MPI_Bcast(&sumresult,1,MPI_INT,0,MPI_COMM_WORLD);                
 	if (sumresult!=num_procs){
 		result=0;
 	}
 	else{
-		result=1;
+		result=1;\
 	}
 	return result;
 }
 
-void VecRelocalize(Vec* poutvector,Vec vector,int m,ISSM_MPI_Comm comm){
+void VecRelocalize(Vec* poutvector,Vec vector,int m){
 
+	int i;
+	
 	/*vector index and vector values*/
 	int* index=NULL;
@@ -80,7 +74,7 @@
 	/*output: */
 	Vec outvector=NULL;
-
+	
 	/*Create outvector with local size m*/
-	VecCreate(comm,&outvector); ; 
+	VecCreate(PETSC_COMM_WORLD,&outvector); ; 
 	VecSetSizes(outvector,m,PETSC_DECIDE); ; 
 	VecSetFromOptions(outvector); ; 
@@ -91,7 +85,7 @@
 	range=upper_row-lower_row+1;
 	if (range){
-		index=xNew<int>(range);
-		values=xNew<double>(range);
-		for (int i=0;i<range;i++){
+		index=(int*)xmalloc(range*sizeof(int));
+		values=(double*)xmalloc(range*sizeof(double));
+		for (i=0;i<range;i++){
 			*(index+i)=lower_row+i;
 		}
@@ -104,7 +98,7 @@
 	VecAssemblyEnd(outvector);; 
 
-	/*Free resources:*/
-	xDelete<int>(index);
-	xDelete<double>(values);	
+	/*Free ressources:*/
+	xfree((void**)&index);
+	xfree((void**)&values);	
 
 	/*Assign output pointers:*/
@@ -112,2 +106,4 @@
 
 }
+
+	
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatPartition.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 1)
@@ -0,0 +1,123 @@
+/*!\file: MatPartition.cpp
+ * \brief partition matrix according to node sets
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+#include "../../../shared/shared.h"
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "MatPartition"
+
+int MatPartition(Mat* poutmatrix,Mat matrixA,double* row_partition_vector,int row_partition_vector_size ,
+		double* col_partition_vector,int col_partition_vector_size){
+
+	int i;
+	
+	/*Petsc matrix*/
+	int d_nz;
+	int o_nz;
+	int* node_rows=NULL;
+	int* node_cols=NULL;
+	int count;
+	IS col_index=NULL;
+	IS row_index=NULL;
+	int lower_row,upper_row,range;
+	int MA,NA; //matrixA dimensions
+	MatType type;
+	int csize;
+
+	/*output*/
+	Mat outmatrix=NULL;
+	
+	/*get input matrix size: */
+	MatGetSize(matrixA,&MA,&NA);
+
+    /*If one of the partitioning row or col vectors has a 0 dimension, we return a NILL matrix. Return it with the same type as matrixA.*/
+	
+    if ((row_partition_vector_size==0) || (col_partition_vector==0)){
+		MatGetType(matrixA,&type);
+		if (strcmp(type,"mpiaij")==0){
+			d_nz=0;
+			o_nz=0;
+			MatCreateMPIAIJ(MPI_COMM_WORLD,PETSC_DETERMINE,PETSC_DETERMINE, 0,0,d_nz,PETSC_NULL,o_nz,PETSC_NULL,&outmatrix);
+		}
+		else if (strcmp(type,"mpidense")==0){
+			MatCreateMPIDense(MPI_COMM_WORLD,PETSC_DETERMINE,PETSC_DETERMINE, 0,0,PETSC_NULL,&outmatrix);
+		}
+		/*Assemble*/
+		MatAssemblyBegin(outmatrix,MAT_FINAL_ASSEMBLY);
+		MatAssemblyEnd(outmatrix,MAT_FINAL_ASSEMBLY);
+	}
+	else{
+		/*Both vectors are non nill, use MatGetSubMatrix to condense out*/
+		/*Figure out which rows each node is going to get from matrix A.*/
+		MatGetOwnershipRange(matrixA,&lower_row,&upper_row);
+		upper_row--;
+		range=upper_row-lower_row+1;
+		#ifdef _DEBUG_
+		 	PetscSynchronizedPrintf(MPI_COMM_WORLD,"My rank %i Range %i",my_rank,range);
+			PetscSynchronizedFlush(MPI_COMM_WORLD);
+		#endif
+			
+		count=0;
+		if (range){
+			node_rows=(int*)xmalloc(range*sizeof(int)); //this is the maximum number of rows one node can extract.
+		
+			for (i=0;i<row_partition_vector_size;i++){
+				if ( ((int)(*(row_partition_vector+i))>=(lower_row+1)) && ((int)(*(row_partition_vector+i))<=(upper_row+1)) ){
+					*(node_rows+count)=(int)*(row_partition_vector+i)-1;
+					count++;
+				}
+			}
+		}
+		else{
+			count=0;
+		}
+		
+		/*Now each node has a node_rows vectors holding which rows they should extract from matrixA. Create an Index Set from node_rows.*/
+		ISCreateGeneral(MPI_COMM_WORLD,count,node_rows,&row_index);
+		#ifdef _DEBUG_
+			ISView(row_index,PETSC_VIEWER_STDOUT_WORLD);
+		#endif
+		
+		/*Same deal for columns*/
+		node_cols=(int*)xmalloc(col_partition_vector_size*sizeof(int));
+		for (i=0;i<col_partition_vector_size;i++){
+			*(node_cols+i)=(int)*(col_partition_vector+i)-1;
+		}
+		ISCreateGeneral(MPI_COMM_WORLD,col_partition_vector_size,node_cols,&col_index);
+		#ifdef _DEBUG_
+			ISView(col_index,PETSC_VIEWER_STDOUT_WORLD);
+		#endif
+
+		/*Call MatGetSubMatrix*/
+		csize=PetscDetermineLocalSize(col_partition_vector_size);
+		if(col_partition_vector_size==row_partition_vector_size){
+			MatGetSubMatrix(matrixA,row_index,col_index,count,MAT_INITIAL_MATRIX,&outmatrix);
+		}
+		else{
+			MatGetSubMatrix(matrixA,row_index,col_index,csize,MAT_INITIAL_MATRIX,&outmatrix);
+		}
+
+	}
+
+	/*Free ressources:*/
+	xfree((void**)&node_rows);
+	xfree((void**)&node_cols);
+	ISFree(&col_index);
+	ISFree(&row_index);
+
+	/*Assign output pointers:*/
+	*poutmatrix=outmatrix;
+}
Index: sm/trunk/src/c/toolkits/petsc/patches/MatToMPISerial.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatToMPISerial.cpp	(revision 28275)
+++ 	(revision )
@@ -1,96 +1,0 @@
-/*!\file MatToMPISerial.cpp
- * \brief gather a Petsc Mat matrix onto all cpus
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../petscincludes.h"
-#include "../../../shared/shared.h"
-
-void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm,bool broadcast){
-
-	int i;
-	int my_rank;
-	int num_procs;
-
-	/*Petsc variables*/
-	PetscInt lower_row,upper_row; 
-	int range;
-	int M,N; //size of matrix
-	ISSM_MPI_Status status;
-	int* idxm=NULL;
-	int* idxn=NULL; 
-	double* local_matrix=NULL; /*matrix local to each node used for temporary holding matrix values*/
-	int buffer[3];
-
-	/*recover my_rank and num_procs:*/
-	ISSM_MPI_Comm_size(comm,&num_procs);
-	ISSM_MPI_Comm_rank(comm,&my_rank);
-
-	/*Output*/
-	double* outmatrix=NULL;
-
-	/*get matrix size: */
-	MatGetSize(matrix,&M,&N);
-
-	/*partition: */
-	MatGetOwnershipRange(matrix,&lower_row,&upper_row);    
-	upper_row--; 
-	range=upper_row-lower_row+1;
-
-	/*Local and global allocation*/
-	if(broadcast || my_rank==0){ 
-		outmatrix=xNew<double>(M*N);
-	}
-
-	if (range){
-		local_matrix=xNew<double>(N*range);
-		idxm=xNew<int>(range);  
-		idxn=xNew<int>(N);  
-
-		for (i=0;i<N;i++){
-			*(idxn+i)=i;
-		}
-		for (i=0;i<range;i++){
-			*(idxm+i)=lower_row+i;
-		}
-
-		MatGetValues(matrix,range,idxm,N,idxn,local_matrix);     
-	}
-
-	/*Now each node holds its local_matrix containing range rows. 
-	 * We send these rows to the matrix on node 0*/
-
-	for (i=1;i<num_procs;i++){
-		if (my_rank==i){ 
-			buffer[0]=my_rank;
-			buffer[1]=lower_row;
-			buffer[2]=range;
-			ISSM_MPI_Send(buffer,3,ISSM_MPI_INT,0,1,comm);   
-			if (range)ISSM_MPI_Send(local_matrix,N*range,ISSM_MPI_PDOUBLE,0,1,comm); 
-		}
-		if (my_rank==0){
-			ISSM_MPI_Recv(buffer,3,ISSM_MPI_INT,i,1,comm,&status); 
-			if (buffer[2])ISSM_MPI_Recv(outmatrix+(buffer[1]*N),N*buffer[2],ISSM_MPI_PDOUBLE,i,1,comm,&status);
-		}
-	} 
-	if (my_rank==0){ 
-		//Still have the local_matrix on node 0 to take care of.
-		if (range) memcpy(outmatrix,local_matrix,N*range*sizeof(double));
-	} 
-
-	if(broadcast){
-		/*Broadcast:*/
-		ISSM_MPI_Bcast(outmatrix,M*N,ISSM_MPI_PDOUBLE,0,comm);
-	}
-
-	/*Assign output pointer: */
-	xDelete<int>(idxm);
-	xDelete<int>(idxn);
-	xDelete<double>(local_matrix);
-	*poutmatrix=outmatrix;
-}
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatToSerial.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatToSerial.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatToSerial.cpp	(revision 1)
@@ -0,0 +1,85 @@
+/*!\file MatToSerial.cpp
+ * \brief gather a Petsc Mat matrix onto cpu 0
+ */
+
+#include "../petscincludes.h"
+#include "../../../shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "MatToSerial"
+void MatToSerial(double** poutmatrix,Mat matrix){
+
+	int i;
+	extern int my_rank;
+	extern int num_procs;
+	
+	/*Petsc variables*/
+	PetscInt lower_row,upper_row; 
+	int range;
+	int M,N; //size of matrix
+	MPI_Status status;
+	int* idxm=NULL;
+	int* idxn=NULL; 
+	double* local_matrix=NULL; /*matrix local to each node used for temporary holding matrix values*/
+	int buffer[3];
+	
+	/*Output*/
+	double* outmatrix=NULL;
+	
+	
+	/*get matrix size: */
+	MatGetSize(matrix,&M,&N);
+
+	/*partition: */
+	MatGetOwnershipRange(matrix,&lower_row,&upper_row);    
+	upper_row--; 
+	range=upper_row-lower_row+1;
+	
+	/*Local and global allocation*/
+	if (my_rank==0)outmatrix=(double*)xmalloc(M*N*sizeof(double));
+	
+	if (range){
+		local_matrix=(double*)xmalloc(N*range*sizeof(double));
+		idxm=(int*)xmalloc(range*sizeof(int));  
+		idxn=(int*)xmalloc(N*sizeof(int));  
+	 
+		for (i=0;i<N;i++){
+			*(idxn+i)=i;
+		}
+		for (i=0;i<range;i++){
+			*(idxm+i)=lower_row+i;
+		}
+	
+		MatGetValues(matrix,range,idxm,N,idxn,local_matrix);     
+	}
+
+	/*Now each node holds its local_matrix containing range rows. 
+	 * We send these rows to the matrix on node 0*/
+	
+	for (i=1;i<num_procs;i++){
+		if (my_rank==i){ 
+			buffer[0]=my_rank;
+			buffer[1]=lower_row;
+			buffer[2]=range;
+			MPI_Send(buffer,3,MPI_INT,0,1,MPI_COMM_WORLD);   
+			if (range)MPI_Send(local_matrix,N*range,MPI_DOUBLE,0,1,MPI_COMM_WORLD); 
+		}
+		if (my_rank==0){
+			MPI_Recv(buffer,3,MPI_INT,i,1,MPI_COMM_WORLD,&status); 
+			if (buffer[2])MPI_Recv(outmatrix+(buffer[1]*N),N*buffer[2],MPI_DOUBLE,i,1,MPI_COMM_WORLD,&status);
+		}
+	} 
+	if (my_rank==0){ 
+		//Still have the local_matrix on node 0 to take care of.
+		memcpy(outmatrix,local_matrix,N*range*sizeof(double));
+
+	} 
+	
+	/*Assign output pointer: */
+	*poutmatrix=outmatrix;
+	
+	xfree((void**)&idxm);
+	xfree((void**)&idxn);
+	xfree((void**)&local_matrix);
+
+}
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp	(revision 1)
@@ -0,0 +1,106 @@
+/* \file MatlabMatrixToDoubleMatrix.cpp
+ * \brief: convert a sparse or dense matlab matrix to a double* pointer
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+#ifdef _SERIAL_
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+/*Matlab includes: */
+#include "mex.h"
+
+#include "../../../shared/shared.h"
+
+int MatlabMatrixToDoubleMatrix(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix){
+
+	int rows, cols;
+	double* mxmatrix_ptr=NULL;
+	int ierr;
+	int i,j;
+
+	/*output: */
+	double* matrix=NULL;
+
+	/*matlab indices: */
+	mwIndex*    ir=NULL;
+	mwIndex*    jc=NULL;
+	double* pr=NULL;
+	int     count;
+	int     nnz;
+	int     nz;
+
+	/*Ok, first check if we are dealing with a sparse or full matrix: */
+	if (mxIsSparse(mxmatrix)){
+
+		/*Dealing with sparse matrix: recover size first: */
+		mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
+		rows=mxGetM(mxmatrix);
+		cols=mxGetN(mxmatrix);
+		nnz=mxGetNzmax(mxmatrix);
+		nz=(int)((double)nnz/(double)rows);
+
+		matrix=(double*)xcalloc(rows*cols,sizeof(double));
+
+		/*Now, get ir,jc and pr: */
+		pr=mxGetPr(mxmatrix);
+		ir=mxGetIr(mxmatrix);
+		jc=mxGetJc(mxmatrix);
+
+		/*Now, start inserting data into double* matrix: */
+		count=0;
+		for(i=0;i<cols;i++){
+			for(j=0;j<(jc[i+1]-jc[i]);j++){
+				*(matrix+rows*ir[count]+i)=pr[count];
+				count++;
+			}
+		}
+
+	}
+	else{
+
+
+		/*Dealing with dense matrix: recover pointer and size: */
+		mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
+		rows=mxGetM(mxmatrix);
+		cols=mxGetN(mxmatrix);
+
+		
+		/*Create serial matrix: */
+		matrix=(double*)xcalloc(rows*cols,sizeof(double));
+
+		for(i=0;i<rows;i++){
+			for(j=0;j<cols;j++){
+				*(matrix+cols*i+j)=*(mxmatrix_ptr+rows*j+i);
+			}
+		}
+		
+		#ifdef _DEBUG_
+		for(i=0;i<rows;i++){
+			for(j=0;j<cols;j++){
+				printf("%g ",*(matrix+cols*i+j));
+			}
+			printf("\n");
+		}
+		#endif
+
+	}
+
+	/*Assign output pointer: */
+	*pmatrix=matrix;
+	*pmatrix_rows=rows;
+	*pmatrix_cols=cols;
+
+	return 1;
+}
+#endif
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp	(revision 1)
@@ -0,0 +1,118 @@
+/* \file MatlabMatrixToPetscMatrix.cpp
+ * \brief: convert a sparse or dense matlab matrix to a serial Petsc matrix:
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+#ifdef _SERIAL_
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+/*Matlab includes: */
+#include "mex.h"
+
+#include "../../../shared/shared.h"
+
+int MatlabMatrixToPetscMatrix(Mat* pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix){
+
+	int rows, cols;
+	double* mxmatrix_ptr=NULL;
+	int ierr;
+	int i,j;
+
+	/*output: */
+	Mat matrix=NULL;
+
+	/*matlab indices: */
+	mwIndex*    ir=NULL;
+	mwIndex*    jc=NULL;
+	double* pr=NULL;
+	int     count;
+	int     nnz;
+	int     nz;
+
+	/*petsc indices: */
+	int* idxm=NULL;
+	int* idxn=NULL;
+	
+	/*Ok, first check if we are dealing with a sparse or full matrix: */
+	if (mxIsSparse(mxmatrix)){
+
+		/*Dealing with sparse matrix: recover size first: */
+		mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
+		rows=mxGetM(mxmatrix);
+		cols=mxGetN(mxmatrix);
+		nnz=mxGetNzmax(mxmatrix);
+		nz=(int)((double)nnz/(double)rows);
+
+		ierr=MatCreateSeqAIJ(PETSC_COMM_SELF,rows,cols,nz,PETSC_NULL,&matrix);CHKERRQ(ierr);
+
+		/*Now, get ir,jc and pr: */
+		pr=mxGetPr(mxmatrix);
+		ir=mxGetIr(mxmatrix);
+		jc=mxGetJc(mxmatrix);
+
+		/*Now, start inserting data into sparse matrix: */
+		count=0;
+		for(i=0;i<cols;i++){
+			for(j=0;j<(jc[i+1]-jc[i]);j++){
+				MatSetValue(matrix,ir[count],i,pr[count],INSERT_VALUES);
+				count++;
+			}
+		}
+
+	}
+	else{
+
+
+		/*Dealing with dense matrix: recover pointer and size: */
+		mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
+		rows=mxGetM(mxmatrix);
+		cols=mxGetN(mxmatrix);
+
+		#ifdef _DEBUG_
+		for(i=0;i<rows;i++){
+			for(j=0;j<cols;j++){
+				printf("%g ",*(mxmatrix_ptr+cols*j+i));
+			}
+			printf("\n");
+		}
+		#endif
+
+		/*Create serial matrix: */
+		ierr=MatCreateSeqDense(PETSC_COMM_SELF,rows,cols,NULL,&matrix);CHKERRQ(ierr);
+
+		/*Insert mxmatrix_ptr values into petsc matrix: */
+		idxm=(int*)xmalloc(rows*sizeof(int));
+		idxn=(int*)xmalloc(cols*sizeof(int));
+
+		for(i=0;i<rows;i++)idxm[i]=i;
+		for(i=0;i<cols;i++)idxn[i]=i;
+
+		ierr=MatSetOption(matrix,MAT_COLUMN_ORIENTED); CHKERRQ(ierr);//matlab is col-oriented.
+		ierr=MatSetValues(matrix,rows,idxm,cols,idxn,mxmatrix_ptr,INSERT_VALUES); CHKERRQ(ierr);
+
+	}
+
+	/*Assemble matrix: */
+	MatAssemblyBegin(matrix,MAT_FINAL_ASSEMBLY); 
+	MatAssemblyEnd(matrix,MAT_FINAL_ASSEMBLY);
+
+
+	/*Assign output pointer: */
+	*pmatrix=matrix;
+	*pmatrix_rows=rows;
+	*pmatrix_cols=cols;
+
+	return 1;
+}
+#endif
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp	(revision 1)
@@ -0,0 +1,91 @@
+/* \file MatlabVectorToDoubleVector.cpp
+ * \brief: convert a sparse or dense matlab vector to a serial vector:
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+#ifdef _SERIAL_
+
+#include <string.h>
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+
+/*Matlab includes: */
+#include "mex.h"
+
+#include "../../../shared/shared.h"
+
+int MatlabVectorToDoubleVector(double** pvector,int* pvector_rows,const mxArray* mxvector){
+
+	int rows, cols;
+	double* mxvector_ptr=NULL;
+	int ierr;
+	int i,j;
+
+	/*output: */
+	double* vector=NULL;
+
+	/*matlab indices: */
+	mwIndex*    ir=NULL;
+	mwIndex*    jc=NULL;
+	double* pr=NULL;
+	int     count;
+	int     nnz;
+	int     nz;
+
+	/*Ok, first check if we are dealing with a sparse or full vector: */
+	if (mxIsSparse(mxvector)){
+
+		/*Dealing with sparse vector: recover size first: */
+		mxvector_ptr=(double*)mxGetPr(mxvector);
+		rows=mxGetM(mxvector);
+		cols=mxGetN(mxvector);
+		nnz=mxGetNzmax(mxvector);
+		nz=(int)((double)nnz/(double)rows);
+
+		vector=(double*)xcalloc(rows,sizeof(double));
+
+		/*Now, get ir,jc and pr: */
+		pr=mxGetPr(mxvector);
+		ir=mxGetIr(mxvector);
+		jc=mxGetJc(mxvector);
+
+		/*Now, start inserting data into sparse vector: */
+		count=0;
+		for(i=0;i<cols;i++){
+			for(j=0;j<(jc[i+1]-jc[i]);j++){
+				vector[ir[count]]=pr[count];
+				count++;
+			}
+		}
+
+	}
+	else{
+
+		/*Dealing with dense vector: recover pointer and size: */
+		mxvector_ptr=(double*)mxGetPr(mxvector);
+		rows=mxGetM(mxvector);
+		cols=mxGetN(mxvector);
+
+		/*allocate and memcpy*/
+		vector=(double*)xmalloc(rows*sizeof(double));
+		memcpy(vector,mxvector_ptr,rows*sizeof(double));
+	}
+
+	/*Assign output pointer: */
+	*pvector=vector;
+	*pvector_rows=rows;
+
+	return 1;
+}
+#endif
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToPetscVector.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToPetscVector.cpp	(revision 1)
@@ -0,0 +1,103 @@
+/* \file MatlabVectorToPetscVector.cpp
+ * \brief: convert a sparse or dense matlab vector to a serial Petsc vector:
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+#ifdef _SERIAL_
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+/*Matlab includes: */
+#include "mex.h"
+
+#include "../../../shared/shared.h"
+
+int MatlabVectorToPetscVector(Vec* pvector,int* pvector_rows,const mxArray* mxvector){
+
+	int rows, cols;
+	double* mxvector_ptr=NULL;
+	int ierr;
+	int i,j;
+
+	/*output: */
+	Vec vector=NULL;
+
+	/*matlab indices: */
+	mwIndex*    ir=NULL;
+	mwIndex*    jc=NULL;
+	double* pr=NULL;
+	int     count;
+	int     nnz;
+	int     nz;
+
+	/*petsc indices: */
+	int* idxm=NULL;
+	
+	/*Ok, first check if we are dealing with a sparse or full vector: */
+	if (mxIsSparse(mxvector)){
+
+		/*Dealing with sparse vector: recover size first: */
+		mxvector_ptr=(double*)mxGetPr(mxvector);
+		rows=mxGetM(mxvector);
+		cols=mxGetN(mxvector);
+		nnz=mxGetNzmax(mxvector);
+		nz=(int)((double)nnz/(double)rows);
+
+		ierr=VecCreateSeq(PETSC_COMM_SELF,rows,&vector);CHKERRQ(ierr);
+
+		/*Now, get ir,jc and pr: */
+		pr=mxGetPr(mxvector);
+		ir=mxGetIr(mxvector);
+		jc=mxGetJc(mxvector);
+
+		/*Now, start inserting data into sparse vector: */
+		count=0;
+		for(i=0;i<cols;i++){
+			for(j=0;j<(jc[i+1]-jc[i]);j++){
+				VecSetValue(vector,ir[count],pr[count],INSERT_VALUES);
+				count++;
+			}
+		}
+
+	}
+	else{
+
+		/*Dealing with dense vector: recover pointer and size: */
+		mxvector_ptr=(double*)mxGetPr(mxvector);
+		rows=mxGetM(mxvector);
+		cols=mxGetN(mxvector);
+
+		/*Create serial vector: */
+		ierr=VecCreateSeq(PETSC_COMM_SELF,rows,&vector);CHKERRQ(ierr);
+
+		/*Insert mxvector_ptr values into petsc vector: */
+		idxm=(int*)xmalloc(rows*sizeof(int));
+
+		for(i=0;i<rows;i++)idxm[i]=i;
+
+		ierr=VecSetValues(vector,rows,idxm,mxvector_ptr,INSERT_VALUES);CHKERRQ(ierr);
+
+	}
+
+	/*Assemble vector: */
+	VecAssemblyBegin(vector);
+	VecAssemblyEnd(vector);
+
+
+	/*Assign output pointer: */
+	*pvector=vector;
+	*pvector_rows=rows;
+
+	return 1;
+}
+#endif
Index: /issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp	(revision 1)
@@ -4,5 +4,5 @@
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+	#include "config.h"
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
@@ -10,112 +10,88 @@
 
 /*Petsc includes: */
-#include <petscksp.h>
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
 
 #include "./petscpatches.h"
+
 #include "../../../shared/shared.h"
-#include "../../mpi/issmmpi.h"
 
-/*NewMat(int M,int N){{{*/
-Mat NewMat(int M,int N,ISSM_MPI_Comm comm){
+
+Mat NewMat(int M,int N,double* psparsity,int* pconnectivity,int* pnumberofdofspernode){
 
 	/*output:*/
 	Mat outmatrix=NULL;
 
-	/*parameters: */
-	double sparsity=0.001; //default
+	/*Recover parameters: */
+	double sparsity=.001; //default
+
+	int    connectivity=10; //default
+	int    numberofdofspernode=2; //default
+
+	/*local sizes: */
 	int    m,n;
-	int    d_nz,o_nz,nnz;
 
-	/*Determine local sizes: */
-	m=DetermineLocalSize(M,comm);
-	n=DetermineLocalSize(N,comm);
-
-	nnz=(int)((double)M*(double)N*sparsity); //number of non zeros.
-	d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
-	o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
-
-	#if PETSC_VERSION_GT(3,2,0)
-	MatCreateAIJ(comm,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 
-	#else
-	MatCreateMPIAIJ(comm,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 
-	#endif
-
-	return outmatrix;
-}
-/*}}}*/
-/*NewMat(int M,int N,double sparsity,ISSM_MPI_Comm comm){{{*/
-Mat NewMat(int M,int N,double sparsity,ISSM_MPI_Comm comm){
-
-	/*output:*/
-	Mat outmatrix=NULL;
-
-	/*parameters: */
-	int    m,n;
+	/*row and col distribution: */
 	int    d_nz,o_nz;
 	int    nnz;
 
 	/*Determine local sizes: */
-	m=DetermineLocalSize(M,comm);
-	n=DetermineLocalSize(N,comm);
+	m=PetscDetermineLocalSize(M);
+	n=PetscDetermineLocalSize(N);
+	
+	/*Branch on what was provided: */
 
-	nnz=(int)((double)M*(double)N*sparsity); //number of non zeros.
-	d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
-	o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
+	if(!psparsity && !pconnectivity && !pnumberofdofspernode){
 
-	#if PETSC_VERSION_GT(3,2,0)
-	if(sparsity==1){
-		MatCreateDense(comm,m,n,M,N,NULL,&outmatrix); 
+		/*Ok, we have our default sparsity, create matrix using this info: */
+
+		nnz=(int)((double)M*(double)N*sparsity); //number of non zeros.
+		d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
+		o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
+
+		MatCreateMPIAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 
+
+	}
+	else if(psparsity){
+		
+		/*Same as above, except we bypass the default sparsity: */
+		if(pconnectivity || pnumberofdofspernode)
+			throw ErrorException(__FUNCT__,exprintf("%s%p%s%p%s%p","cannot determine logic with following set of poniters-> sparsity: ",
+						psparsity," connectivity: ",pconnectivity," numberofdofspernode: ",pnumberofdofspernode));
+
+		sparsity=*psparsity;
+
+		nnz=(int)((double)M*(double)N*sparsity); //number of non zeros.
+		d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
+		o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
+
+		MatCreateMPIAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 
+
+	}
+	else if(pconnectivity &&  pnumberofdofspernode){
+
+		/*entirely different logic. We use the connectivity and numberofdofspernode to figure out how many non-zeros are 
+		 *present per row: */
+
+		if(psparsity)throw ErrorException(__FUNCT__,exprintf("%s%p%s%p%s%p","cannot determine logic with following set of poniters-> sparsity: ",
+						psparsity," connectivity: ",pconnectivity," numberofdofspernode: ",pnumberofdofspernode));
+
+		connectivity=*pconnectivity;
+		numberofdofspernode=*pnumberofdofspernode;
+	
+		/*Figure out number of non zeros per row: */
+		d_nz=(int)connectivity*numberofdofspernode/2;
+		o_nz=(int)connectivity*numberofdofspernode/2;
+		
+		MatCreateMPIAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 
+
 	}
 	else{
-		MatCreateAIJ(comm,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 
+		throw ErrorException(__FUNCT__,exprintf("%s%p%s%p%s%p","cannot determine logic with following set of poniters-> sparsity: ",
+						psparsity," connectivity: ",pconnectivity," numberofdofspernode: ",pnumberofdofspernode));
 	}
-	#else
-	MatCreateMPIAIJ(comm,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 
-	#endif
+
 
 	return outmatrix;
 }
-/*}}}*/
-/*NewMat(int M,int N,int connectivity,int numberofdofspernode){{{*/
-Mat NewMat(int M,int N,int connectivity,int numberofdofspernode,ISSM_MPI_Comm comm){
-
-	/*output:*/
-	Mat outmatrix=NULL;
-
-	/*parameters: */
-	int    m,n;
-	int    d_nz,o_nz;
-
-	#if PETSC_VERSION_MAJOR >= 3 
-	#if defined(_HAVE_PETSCDEV_) || PETSC_VERSION_MINOR >=4
-	MatType type;
-	#else
-	const MatType type;
-	#endif
-	#else
-	MatType type;
-	#endif
-
-	/*Determine local sizes: */
-	m=DetermineLocalSize(M,comm);
-	n=DetermineLocalSize(N,comm);
-
-	/*Figure out number of non zeros per row: */
-	d_nz=(int)connectivity*numberofdofspernode/2;
-	o_nz=(int)connectivity*numberofdofspernode/2;
-
-	MatCreate(comm,&outmatrix);
-	MatSetSizes(outmatrix,m,n,M,N);
-	MatSetFromOptions(outmatrix);
-	MatSetOption(outmatrix,MAT_IGNORE_ZERO_ENTRIES,PETSC_TRUE);
-
-	/*preallocation  according to type: */
-	MatGetType(outmatrix,&type);
-
-	if((strcmp(type,"mpiaij")==0) || (strcmp(type,"mpidense")==0)){
-		MatMPIAIJSetPreallocation(outmatrix,d_nz,NULL,o_nz,NULL);
-	}
-
-	return outmatrix;
-}
-/*}}}*/
Index: /issm/trunk/src/c/toolkits/petsc/patches/NewVec.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/NewVec.cpp	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/patches/NewVec.cpp	(revision 1)
@@ -4,5 +4,5 @@
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+	#include "config.h"
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
@@ -10,11 +10,13 @@
 
 /*Petsc includes: */
-#include <petscksp.h>
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
 
 #include "./petscpatches.h"
-#include "../../mpi/issmmpi.h"
 
-Vec NewVec(int size,ISSM_MPI_Comm comm,bool fromlocalsize){
+Vec NewVec(int size){
 
+	int ierr;
 	int local_size;
 
@@ -23,16 +25,17 @@
 
 	/*determine local size of vector: */
-	if(fromlocalsize){
-		local_size=size;
-	}
-	else{
-		local_size=DetermineLocalSize(size,comm);
-	}
-
-	VecCreate(comm,&vector); 
+	local_size=PetscDetermineLocalSize(size);
+	VecCreate(PETSC_COMM_WORLD,&vector); 
+	
 	VecSetSizes(vector,local_size,PETSC_DECIDE); 
 	VecSetFromOptions(vector); 
-	VecSetOption(vector,VEC_IGNORE_NEGATIVE_INDICES,PETSC_TRUE);
+
+	/*fill with 0: */
+	VecSet(vector,0.0);
 
 	return vector;
 }
+
+
+
+
Index: /issm/trunk/src/c/toolkits/petsc/patches/NewVecFromLocalSize.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/NewVecFromLocalSize.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/NewVecFromLocalSize.cpp	(revision 1)
@@ -0,0 +1,39 @@
+/*!\file NewVecFromLocalSize.cpp
+ * \brief: create distributed Petsc vector, using an already existing distribution
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+#include "./petscpatches.h"
+
+Vec NewVecFromLocalSize(int local_size){
+
+	int ierr;
+
+	/*output: */
+	Vec vector=NULL;
+
+	/*determine local size of vector: */
+	VecCreate(PETSC_COMM_WORLD,&vector); 
+	
+	VecSetSizes(vector,local_size,PETSC_DECIDE); 
+	VecSetFromOptions(vector); 
+
+	/*fill with 0: */
+	VecSet(vector,0.0);
+
+	return vector;
+}
+
+
+
+
Index: /issm/trunk/src/c/toolkits/petsc/patches/PetscDetermineLocalSize.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/PetscDetermineLocalSize.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/PetscDetermineLocalSize.cpp	(revision 1)
@@ -0,0 +1,51 @@
+/* \file PetscDetermineLocalSize.cpp
+ * \brief: routine to determine local size of a global petsc matrix or vector. 
+ */
+
+#include "stdio.h"
+#include <math.h>
+#include "../../../shared/shared.h"
+
+int PetscDetermineLocalSize(int global_size){
+
+	/*output: */
+	int  local_size;
+
+	/*intermediary: */
+	int  i;
+	int  row_rest;
+	int* num_local_rows=NULL;
+
+	/*from MPI: */
+	extern int num_procs;
+	extern int my_rank;
+	
+	/*We are  not bound by any library, just use what seems most logical*/
+	num_local_rows=(int*)xmalloc(num_procs*sizeof(int));    
+
+	for (i=0;i<num_procs;i++){
+
+		/*Here, we use floor. We under distribute rows. The rows 
+		  left  are then redistributed, therefore resulting in a 
+		  more even distribution.*/
+		num_local_rows[i]=(int)floor(global_size/num_procs); 
+	}
+	
+	/*There may be some rows left. Distribute evenly.*/ 
+	row_rest=global_size - num_procs*(int)floor(global_size/num_procs);
+	for (i=0;i<row_rest;i++){
+		num_local_rows[i]++;
+	}
+
+	local_size=num_local_rows[my_rank];
+	
+	/*free ressources: */
+	xfree((void**)&num_local_rows);
+
+	/*return size: */
+	return local_size;
+
+}
+
+
+ 
Index: /issm/trunk/src/c/toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp	(revision 1)
@@ -0,0 +1,155 @@
+/* \file PetscMatrixToMatlabMatrix.cpp
+ * \brief: convert a sparse or dense Petsc matrix into a matlab matrix
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+#ifdef _SERIAL_
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+/*Petsc includes: */
+#include "mex.h"
+
+#include "../../../shared/shared.h"
+#include <string>
+
+
+int PetscMatrixToMatlabMatrix(mxArray** pdataref,Mat matrix){
+
+	int i,j,k;
+
+	/*output: */
+	mxArray* dataref=NULL;
+	mxArray* tdataref=NULL;
+	int    rows,cols;
+
+	int ncols;
+	int nnz=0;
+	int nzmax=0;
+	const int* columns=NULL;
+	const double* column_values=NULL;
+	double* matrix_ptr=NULL;
+
+	/*compress row format: */
+	double* val=NULL;
+	mwIndex*    col_ind=NULL;
+	mwIndex*    row_ptr=NULL;
+
+	/*petsc type: */
+	MatType type;
+	int*    idxm=NULL;
+	int*    idxn=NULL;
+
+	MatGetType(matrix,&type);
+	MatGetSize(matrix,&rows,&cols);
+
+	if (strcmp(type,MATSEQAIJ)==0){
+		
+		/*Dealing with a sparse sequential matrix: build ir, jc and val, as though it was a row comvalessed 
+		 *format, instead of a column comvalessed format. We'll transpose later.*/
+
+		/*First get nnz: */
+		nnz=0;
+		for(i=0;i<rows;i++){
+			MatGetRow(matrix,i,&ncols,&columns,&column_values);
+			nnz+=ncols;
+			MatRestoreRow(matrix,i,&ncols,&columns,&column_values);
+		}
+
+		if(nnz){
+			nzmax=nnz;
+		}
+		else{
+			nzmax=1; //so a null matrix can be returned.
+		}
+
+		val=(double*)xcalloc(nzmax,sizeof(double));
+		col_ind=(mwIndex*)xcalloc(nzmax,sizeof(mwIndex));
+		row_ptr=(mwIndex*)xcalloc((rows+1),sizeof(mwIndex));
+
+		j=0;
+
+		for(i=0;i<rows;i++){
+
+			/*Get row from petsc matrix: */
+			MatGetRow(matrix,i,&ncols,&columns,&column_values);
+
+			#ifdef _DEBUG_
+			for(j=0;j<ncols;j++){
+				printf("%i %i: %g\n",i,columns[j],column_values[j]);
+			}
+			#endif
+
+			/*copy values: */
+			if(ncols)memcpy( val+j, column_values,ncols*sizeof(double));
+			  
+			for(k=0;k<ncols;k++) col_ind[j+k]=(mwIndex)columns[k];
+			row_ptr[i]=(mwIndex)j;
+			
+			j+=ncols;
+			
+			/*restore petsc row, otherwise we are leaking memory: */
+			MatRestoreRow(matrix,i,&ncols,&columns,&column_values);
+		}
+		row_ptr[rows]=(mwIndex)nnz;
+
+		/*Ok, allocate arrays: */
+		dataref = mxCreateSparse((mwSize)0,(mwSize)0,(mwSize)0,mxREAL);
+		
+		if(nnz){
+			/* free first to avoid mem leaks...: */
+			mxFree(mxGetData(dataref));
+			mxFree(mxGetIr(dataref));
+			mxFree(mxGetJc(dataref));
+
+			/* ...then set data: */
+			mxSetM(dataref,(mwSize)cols);
+			mxSetN(dataref,(mwSize)rows);
+			mxSetNzmax(dataref,(mwSize)nzmax);
+			mxSetData( dataref, val);
+			mxSetIr(dataref,col_ind);
+			mxSetJc(dataref,row_ptr);
+		}
+	
+
+	}
+	else{
+		/*Dealing with a dense sequential matrix: recover pointer to the data in the Petsc matrix*/
+
+		idxm=(int*)xmalloc(rows*sizeof(int));
+		idxn=(int*)xmalloc(cols*sizeof(int));
+
+		for(i=0;i<rows;i++)idxm[i]=i;
+		for(i=0;i<cols;i++)idxn[i]=i;
+
+		matrix_ptr=(double*)xmalloc(rows*cols*sizeof(double));
+		MatGetValues(matrix,rows,idxm,cols,idxn,matrix_ptr);
+
+		dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+		mxSetM(dataref,rows);
+		mxSetN(dataref,cols);
+		mxSetPr(dataref,(double*)matrix_ptr);	
+	}
+
+
+	/*Transpose matrcol_indes: */
+	mexCallMATLAB(1,&tdataref,1,&dataref, "'");
+
+
+	/*Assign output pointers: */
+	*pdataref=tdataref;
+
+	return 1;
+}
+
+#endif  //#ifdef _SERIAL_
Index: /issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp	(revision 1)
@@ -1,8 +1,28 @@
-/*!\file PetscOptionsDetermineSolverType.cpp: from the petsc options, determine what kind of solver
- * we are using.
+/*!\file PetscOptionsDetermineSolverType.cpp
+ * \brief: 	Petsc comes with a wide array of solvers, some of them considered external (externally linked libraries). 
+	To activate these solvers, Petsc uses the Options database, which is set at the command line prompt 
+	when launching a Petsc executable (option -mat_type EXTERNALMATRIXTYPE). 
+	
+	We do not use this feature, because once the Cielo server is launched, we cannot go back and modify 
+	the command line arguments. We rely therefore on the use of the options_string sent from the Solver_client 
+	module to the server Solver/ module. On the server side, we receive this options_string and plug it into the 
+	options database using the routine PetscOptionsInsertMultipleSTring. Once this is done, the KSP (Petsc solver) 
+	object registers these options and selects the correct solution method.  
+
+	Now, for external solvers, this does not work, because the choice of external solver needs to be done when launching
+	the Petsc executable ( this way, every matrix created conforms to the external package, and the solver then 
+	knows what to do directly by looking at the type of input matrix ). To circumvent this problem, we 
+	still use the options_string sent by the Solver_client, and we look for the -mat_type option. If we find 
+	a -mat_type option with an argument relating to an external solver, we then convert the solver matrix  
+	to the external type, and the KSP object then knows what to do. 
+
+	This routine parses the options_string and returns the type of external solver being used as an enum. If there is no 
+	external solver used, we return a default enum.
+
+	Note: figure out if first and second should be xfreed.
  */
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+	#include "config.h"
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
@@ -10,5 +30,7 @@
 
 /*Petsc includes: */
-#include <petscksp.h>
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
 
 #include "./petscpatches.h"
@@ -16,63 +38,85 @@
 #include "../../../shared/shared.h"
 
-void PetscOptionsDetermineSolverType(int* psolver_type){
+#undef __FUNCT__
+#define __FUNCT__ "PetscOptionsDetermineSolverType"
 
-	char option[100];
-	#if PETSC_VERSION_LT(3,2,0)
-	PetscTruth flag;
-	#else
-	PetscBool flag;
-	#endif
+void PetscOptionsDetermineSolverType(int* psolver_type,char* options_string){
+
+
+	/*The list of options is going to be pairs of the type "-option option_value"*/
+	PetscToken *token=NULL;
+	char* first=NULL;
+	char* second=NULL;
+	size_t len;
+	int ignore_second;
+	int first_token=1;
 
 	/*output: */
 	int solver_type=PETSCPACKAGE;
 
-	/*retrieve mat_type option: */
-	#if PETSC_VERSION_LT(3,7,0)
-	PetscOptionsGetString(PETSC_NULL,"-mat_type",&option[0],100,&flag);
-	#elif PETSC_VERSION_LT(3,19,0)
-	PetscOptionsGetString(NULL,PETSC_NULL,"-mat_type",&option[0],100,&flag);
-	#else /*newest version*/
-	PetscOptionsGetString(NULL,PETSC_NULLPTR,"-mat_type",&option[0],100,&flag);
-	#endif
 
-	if (strcmp(option,"aijmumps")==0){
-		solver_type=MUMPSPACKAGE_LU;
-	}
-	if (strcmp(option,"sbaijmumps")==0){
-		solver_type=MUMPSPACKAGE_CHOL;
-	}
-	if (strcmp(option,"aijspooles")==0){
-		solver_type=SPOOLESPACKAGE_LU;
-	}
-	if (strcmp(option,"sbaijspooles")==0){
-		solver_type=SPOOLESPACKAGE_CHOL;
-	}
-	if (strcmp(option,"superlu_dist")==0){
-		solver_type=SUPERLUDISTPACKAGE;
-	}
-	if (strcmp(option,"")==0){
-		solver_type=SUPERLUDISTPACKAGE;
+	PetscTokenCreate(options_string,' ',&token);
+	for (;;){
+		
+
+		/*Read next tokens*/
+		if(first_token){
+			PetscTokenFind(token,&first);
+		}
+		PetscTokenFind(token,&second);
+		
+		if (!first){
+			/*We are at the end of options*/
+			break;
+		}
+		if(!second){
+			/*We have no second value, end the token analysis.*/
+			if(first[0]!='-'){
+				/*This is not good, the option does not have '-'! Get out*/
+				throw ErrorException(__FUNCT__,exprintf("%s%s%s","Option ",first," should be preceded by '-'!"));
+			}
+			break;
+		}
+		else{
+			/*Ok, we have a second token coming in. Is it another option, or 'first' option's value?*/
+			if (second[0]=='-'){
+				/*Second is another option, ignore it and prepare next loop step*/
+				first=second;
+				first_token=0;
+			}
+			else{
+				/*Second is 'first' option's value*/
+				PetscStrlen(second,&len);
+				while (len > 0 && (second[len-1] == ' ' || second[len-1] == 'n')) {
+					len--; second[len] = 0;
+				}
+				/*We now have a pair first and second. Check whether first is equal to -mat_type. If so, check 
+				 * the second argument for the name of the external package desired.*/
+				if (strcmp(first,"-mat_type")==0){
+					if (strcmp(second,"aijmumps")==0){
+						solver_type=MUMPSPACKAGE_LU;
+					}
+					if (strcmp(second,"sbaijmumps")==0){
+						solver_type=MUMPSPACKAGE_CHOL;
+					}
+					if (strcmp(second,"aijspooles")==0){
+						solver_type=SPOOLESPACKAGE_LU;
+					}
+					if (strcmp(second,"sbaijspooles")==0){
+						solver_type=SPOOLESPACKAGE_CHOL;
+					}
+					if (strcmp(second,"superlu_dist")==0){
+						solver_type=SUPERLUDISTPACKAGE;
+					}
+				}
+				
+				first_token=1;
+			}
+		}
 	}
 
-	#if PETSC_VERSION_LT(3,7,0)
-	PetscOptionsGetString(PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag);
-   #elif PETSC_VERSION_LT(3,19,0)
-	PetscOptionsGetString(NULL,PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag);
-   #else
-	PetscOptionsGetString(NULL,PETSC_NULLPTR,"-pc_factor_mat_solver_package",&option[0],100,&flag);
-   #endif
+	PetscTokenDestroy(token);
 
-	#if PETSC_VERSION_LT(3,7,0)
-	PetscOptionsGetString(PETSC_NULL,"-issm_option_solver",&option[0],100,&flag);
-   #elif PETSC_VERSION_LT(3,19,0)
-	PetscOptionsGetString(NULL,PETSC_NULL,"-issm_option_solver",&option[0],100,&flag);
-   #else
-	PetscOptionsGetString(NULL,PETSC_NULLPTR,"-issm_option_solver",&option[0],100,&flag);
-   #endif
-
-	if(strcmp(option,"mumps")==0) solver_type=MUMPSPACKAGE_LU;
-	if(strcmp(option,"FS")==0 || strcmp(option,"stokes")==0) solver_type=FSSolverEnum;
-
+	/*Assign output: */
 	*psolver_type=solver_type;
 }
Index: /issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 1)
@@ -0,0 +1,91 @@
+/*!\file PetscOptionsInsertMultipleString.cpp
+ * \brief: create distributed Petsc vector.
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+#include "./petscpatches.h"
+
+#undef __FUNCT__
+#define __FUNCT__ "PetscOptionsInsertMultipleString"
+
+#include "../../../shared/shared.h"
+
+void PetscOptionsInsertMultipleString(char* options_string){
+
+
+	/*The list of options is going to be pairs of the type "-option option_value"*/
+	PetscToken *token=NULL;
+	char* first=NULL;
+	char* second=NULL;
+	char* final=NULL;
+	size_t len;
+	int ignore_second;
+	int first_token=1;
+
+
+	PetscTokenCreate(options_string,' ',&token);
+	for (;;){
+		
+
+		/*Read next tokens*/
+		if(first_token){
+			PetscTokenFind(token,&first);
+		}
+		PetscTokenFind(token,&second);
+		
+		if (!first){
+			/*We are at the end of options*/
+			break;
+		}
+		if(!second){
+			/*We have no second value, just take first
+			 * and set the option, then end the token analysis.*/
+			if(first[0]!='-'){
+				/*This is not good, the option does not have '-'! Get out*/
+				throw ErrorException(__FUNCT__,exprintf("%s%s%s","Option ",first," should be preceded by '-'!"));
+			}
+			/*Reduce first to bare option value*/
+			PetscStrlen(first,&len);
+			while (len > 0 && (first[len-1] == ' ' || first[len-1] == 'n')) {
+				len--; first[len] = 0;
+			}
+			PetscOptionsSetValue(first,second);
+			break;
+		}
+		else{
+			/*Ok, we have a second token coming in. Is it another option, or 'first' option's value?*/
+			if (second[0]=='-'){
+				/*Second is another option, ignore it*/
+				PetscStrlen(first,&len);
+				while (len > 0 && (first[len-1] == ' ' || first[len-1] == 'n')) {
+					len--; first[len] = 0;
+				}
+				PetscOptionsSetValue(first,NULL);
+				/*Preparing next loop step*/
+				first=second;
+				first_token=0;
+			}
+			else{
+				/*Second is 'first' option's value*/
+				PetscStrlen(second,&len);
+				while (len > 0 && (second[len-1] == ' ' || second[len-1] == 'n')) {
+					len--; second[len] = 0;
+				}
+				PetscOptionsSetValue(first,second);
+				first_token=1;
+			}
+		}
+	}
+
+	PetscTokenDestroy(token);
+}
Index: /issm/trunk/src/c/toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/PetscVectorToMatlabVector.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/PetscVectorToMatlabVector.cpp	(revision 1)
@@ -0,0 +1,64 @@
+/* \file PetscVectorToMatlabVector.cpp
+ * \brief: convert a sparse or dense Petsc vector into a matlab vector
+ */
+
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+#ifdef _SERIAL_
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+/*Petsc includes: */
+#include "mex.h"
+
+#include "../../../shared/shared.h"
+#include <string>
+
+
+int PetscVectorToMatlabVector(mxArray** pdataref,Vec vector){
+
+
+	int i;
+	int rows;
+	int* idxm=NULL;
+	double* values=NULL;
+
+	/*output: */
+	mxArray* dataref=NULL;
+
+	/*Get size of vector: */
+	VecGetSize(vector,&rows);
+
+	idxm=(int*)xmalloc(rows*sizeof(int));
+	values=(double*)xmalloc(rows*sizeof(double));
+	for(i=0;i<rows;i++)idxm[i]=i;
+	 
+	VecGetValues(vector,rows,idxm,values);
+
+
+	/*Using values, build a matlab vector: */
+	dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(dataref,rows);
+	mxSetN(dataref,1);
+	mxSetPr(dataref,(double*)values);	
+
+	/*Some logic here to make the vector sparse? Although this could slow down the code quite a bit: */
+
+	/*Assign output pointers: */
+	*pdataref=dataref;
+
+	return 1;
+}
+
+
+#endif  //#ifdef _SERIAL_
+
Index: sm/trunk/src/c/toolkits/petsc/patches/SolverEnum.h
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/SolverEnum.h	(revision 28275)
+++ 	(revision )
@@ -1,17 +1,0 @@
-/*!\file: SolverEnum.h
- * \brief prototypes for SolverEnum.h
- */ 
-
-#ifndef _SOLVERENUM_H_
-#define  _SOLVERENUM_H_
-
-typedef enum{
-	PETSCPACKAGE,
-	MUMPSPACKAGE_LU,
-	MUMPSPACKAGE_CHOL,
-	SPOOLESPACKAGE_LU,
-	SPOOLESPACKAGE_CHOL,
-	SUPERLUDISTPACKAGE,
-} EXTERNALPACKAGES; 
-
-#endif //ifndef _SOLVERENUM_H_
Index: /issm/trunk/src/c/toolkits/petsc/patches/VecFree.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/VecFree.cpp	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/patches/VecFree.cpp	(revision 1)
@@ -4,20 +4,20 @@
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+	#include "config.h"
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
 #endif
 
+
 /*Petsc includes: */
-#include <petscksp.h>
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
 
 void VecFree(Vec* pvec){
 
-	#if PETSC_VERSION_LT(3,2,0)
 	if(*pvec)VecDestroy(*pvec);
-	#else
-	if(*pvec)VecDestroy(pvec);
-	#endif
 	*pvec=NULL;
 
 }
+
Index: /issm/trunk/src/c/toolkits/petsc/patches/VecMerge.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 1)
@@ -0,0 +1,88 @@
+/*!\file:  VecMerge.cpp
+ * \brief merge vector B into A using partitioning vector A(row_partition_vector)=B;
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+#include "./petscpatches.h"
+
+#include "../../../shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "VecMerge"
+void VecMerge(Vec A, Vec B, double* row_partition_vector,int row_partition_size){
+
+	int i;
+	
+	/*Petsc matrix*/
+	int lower_row,upper_row,range;
+	int* idxm=NULL;
+	double* values=NULL;
+
+	/*Vector sizes: */
+	int MA,MB;
+
+	VecGetSize(B,&MB);
+
+	#ifdef _DEBUG_
+		OutputServerMessages(0,0,"\n%s%s\n",STROFFSET,"Row partition vector:");
+		if (my_rank==0){
+			int i;
+			for (i=0;i<row_partition_vector_size;i++){
+				OutputServerMessages(0,0,"%s%lf\n",STROFFSET,*(row_partition_vector+i));
+			}
+		}
+	#endif
+
+	/*If the dimension of the partitioning vector is not the same as that of vector B, we have a problem: */
+	if ( (row_partition_size !=MB) ){
+		throw ErrorException(__FUNCT__,"Dimensions of partitioning vector incompatible with dimensions of input vector\n");
+	}
+
+	/*Get values from vector B and plug them into vector A, using the partitioning vector*/
+	VecGetOwnershipRange(B,&lower_row,&upper_row);
+	upper_row--;
+	range=upper_row-lower_row+1;
+
+	if (range){
+		/*This node owns rows of vector B, get them*/
+		idxm=(int*)xmalloc(range*sizeof(int));
+		values=(double*)xmalloc(range*sizeof(double));
+		for (i=0;i<range;i++){
+			*(idxm+i)=lower_row+i;
+		}
+		VecGetValues(B,range,idxm,values);
+		/*Now, modify idxm using the partition vector, and plug values into A*/
+		for (i=0;i<range;i++){
+			*(idxm+i)=*(row_partition_vector+lower_row+i)-1; //-1 because partition vector comes from Matlab, where indices start at 1.
+		}
+		VecSetValues(A,range,idxm,values,INSERT_VALUES);
+	}
+	
+	/*Assemble vector*/
+	VecAssemblyBegin(A);
+	VecAssemblyEnd(A);
+
+	#ifdef _DEBUG_
+		_printf_("Vector B:\n");
+		fflush(stdout);
+		VecView(B,PETSC_VIEWER_STDOUT_WORLD);
+		_printf_("Merge into  vector A:\n");
+		fflush(stdout);
+		VecView(A,PETSC_VIEWER_STDOUT_WORLD);
+	#endif
+
+	/*Free ressources:*/
+	xfree((void**)&idxm);
+	xfree((void**)&values);
+
+}
Index: /issm/trunk/src/c/toolkits/petsc/patches/VecPartition.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/VecPartition.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/VecPartition.cpp	(revision 1)
@@ -0,0 +1,141 @@
+/*!\file:  VecPartition.cpp
+ * \brief  partition vector according to a node set
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+/*Petsc includes: */
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
+
+#include "../../../shared/shared.h"
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "VecPartition"
+
+void VecPartition(Vec* poutvector,Vec vectorA, double* row_partition_vector, int row_partition_vector_size){
+
+		
+	int i;
+	
+	/*Petsc matrix*/
+	int* node_rows=NULL;
+	double* values=NULL;
+	int count;
+	int lower_row,upper_row,range;
+
+	/*Input*/
+	int MA; //Vector dimension
+
+	/*output*/
+	Vec outvector=NULL;
+
+	
+	/*Get size of input vector: */
+	VecGetSize(vectorA,&MA);
+	
+    /*Condense out*/
+
+    /*If the partitioning row vector has a 0 dimension, we return a NILL vector*/
+    if (row_partition_vector_size==0){
+		VecCreate(PETSC_COMM_WORLD,&outvector);   
+		VecSetSizes(outvector,PETSC_DECIDE,0);
+		VecSetFromOptions(outvector);
+		
+		VecAssemblyBegin(outvector);
+		VecAssemblyEnd(outvector);
+	}
+	else{
+		/*Locally get values and build a new vector which is a subvector*/
+		
+		VecGetOwnershipRange(vectorA,&lower_row,&upper_row);
+		upper_row--;
+		range=upper_row-lower_row+1;
+		#ifdef _DEBUG_
+		 	PetscSynchronizedPrintf(MPI_COMM_WORLD,"My rank %i Range %i\n",my_rank,range);
+			PetscSynchronizedFlush(MPI_COMM_WORLD);
+		#endif
+
+		if (range){
+			node_rows=(int*)xmalloc(range*sizeof(int)); //this is the maximum number of rows one node can extract.
+		
+			count=0;
+			for (i=0;i<row_partition_vector_size;i++){
+				if ( ((int)(*(row_partition_vector+i))>=(lower_row+1)) && ((int)(*(row_partition_vector+i))<=(upper_row+1)) ){
+					*(node_rows+count)=(int)*(row_partition_vector+i)-1;
+					count++;
+				}
+			}
+		}
+		else{
+			count=0;
+		}
+					
+     	if (count){
+			values=(double*)xmalloc(count*sizeof(double)); //holder for the values to be extracted from vectorA
+		}
+		else{
+			xfree((void**)&node_rows); //count=0 means no values was condensed out for this node. null node_rows for use in VecGetValues.
+			values=NULL;
+		}
+
+		#ifdef _DEBUG_
+			PetscSynchronizedPrintf(MPI_COMM_WORLD,"My rank: %i My count: %i node_rows: %p values: %p\n",my_rank,count,node_rows,values);
+			PetscSynchronizedFlush(MPI_COMM_WORLD);
+		#endif 
+
+		if (count){
+			VecGetValues(vectorA,count,node_rows,values);
+		}
+		
+		/*Ok, each node now have count values corresponding to the node_rows extracted values from vectorA.
+		 * From count and values, create a new vector*/
+
+		VecCreate(PETSC_COMM_WORLD,&outvector);    ;
+		VecSetSizes(outvector,count,PETSC_DECIDE);
+		VecSetFromOptions(outvector);
+
+		VecGetOwnershipRange(outvector,&lower_row,&upper_row);
+		upper_row--;
+		range=upper_row-lower_row+1;
+
+		/*Set values using the values vector. First build new node_rows index.*/
+		if (count){
+			for (i=0;i<count;i++){
+				*(node_rows+i)=lower_row+i;
+			}
+		}
+		if (count){
+			VecSetValues(outvector,count,node_rows,values,INSERT_VALUES);
+		}
+		
+		/*Assemble vector*/
+		VecAssemblyBegin(outvector);
+		VecAssemblyEnd(outvector);
+
+		
+	}
+	
+	#ifdef _DEBUG_
+		_printf_("Vector A:\n");
+		fflush(stdout);
+		VecView(vectorA,PETSC_VIEWER_STDOUT_WORLD);
+		_printf_("Partition of vector A:\n");
+		fflush(stdout);
+		VecView(outvector,PETSC_VIEWER_STDOUT_WORLD);
+	#endif
+	
+	/*Assign output pointers:*/
+	*poutvector=outvector;
+
+	/*Free ressources:*/
+	xfree((void**)&node_rows);
+	xfree((void**)&values);
+
+}
Index: /issm/trunk/src/c/toolkits/petsc/patches/VecToMPISerial.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 1)
@@ -3,26 +3,20 @@
  */
 
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
 #include "../petscincludes.h"
 #include "../../../shared/shared.h"
 
-int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm,bool broadcast){
-
+int VecToMPISerial(double** pgathered_vector, Vec vector){
+	
 	int i;
-	int num_procs; 
-	int my_rank;
+	extern int num_procs; 
+	extern int my_rank;
 
 	/*Petsc*/
-	ISSM_MPI_Status status;
+	MPI_Status status;
 	PetscInt lower_row,upper_row; 
 	int range;
 	int * idxn=NULL; 
 	int buffer[3];
-
+	
 	/*intermediary results*/
 	double* local_vector=NULL;
@@ -30,11 +24,7 @@
 	/*input*/
 	int vector_size;
-
+	
 	/*Output*/
 	double* gathered_vector=NULL; //Global vector holding the final assembled vector on all nodes.
-
-	/*recover my_rank and num_procs*/
-	ISSM_MPI_Comm_size(comm,&num_procs);
-	ISSM_MPI_Comm_rank(comm,&my_rank);
 
 	VecGetSize(vector,&vector_size);
@@ -45,8 +35,6 @@
 
 	/*Allocate gathered vector on all nodes .*/
-	if(broadcast || my_rank==0){ 
-		gathered_vector=xNew<double>(vector_size);
-	}
-
+	gathered_vector=(double*)xmalloc(vector_size*sizeof(double));
+	
 	/*Allocate local vectors*/
 	VecGetOwnershipRange(vector,&lower_row,&upper_row);
@@ -55,9 +43,9 @@
 
 	if (range){
-		idxn=xNew<int>(range); 
+		idxn=(int*)xmalloc(range*sizeof(int)); 
 		for (i=0;i<range;i++){
 			*(idxn+i)=lower_row+i;
 		} 
-		local_vector=xNew<double>(range);
+		local_vector=(double*)xmalloc(range*sizeof(double));
 		/*Extract values from MPI vector to serial local_vector on each node*/
 		VecGetValues(vector,range,idxn,local_vector); 
@@ -71,10 +59,13 @@
 			buffer[1]=lower_row;
 			buffer[2]=range;
-			ISSM_MPI_Send(buffer,3,ISSM_MPI_INT,0,1,comm);  
-			if (range)ISSM_MPI_Send(local_vector,range,ISSM_MPI_PDOUBLE,0,1,comm); 
+			MPI_Send(buffer,3,MPI_INT,0,1,MPI_COMM_WORLD);  
+			if (range)MPI_Send(local_vector,range,MPI_DOUBLE,0,1,MPI_COMM_WORLD); 
 		}
 		if (my_rank==0){
-			ISSM_MPI_Recv(buffer,3,ISSM_MPI_INT,i,1,comm,&status); 
-			if (buffer[2])ISSM_MPI_Recv(gathered_vector+buffer[1],buffer[2],ISSM_MPI_PDOUBLE,i,1,comm,&status);
+			MPI_Recv(buffer,3,MPI_INT,i,1,MPI_COMM_WORLD,&status); 
+			#ifdef _DEBUG_
+				_printf_("Received from node %i: %i-%i\n",buffer[0],buffer[1],buffer[2]); 
+			#endif
+			if (buffer[2])MPI_Recv(gathered_vector+buffer[1],buffer[2],MPI_DOUBLE,i,1,MPI_COMM_WORLD,&status);
 		}
 	}
@@ -82,19 +73,17 @@
 	if (my_rank==0){ 
 		//Still have the local_vector on node 0 to take care of.
-		if (range) memcpy(gathered_vector+lower_row,local_vector,range*sizeof(double));
+		if (range)memcpy(gathered_vector+lower_row,local_vector,range*sizeof(double));
 	}
 
-	if(broadcast){
-		/*Now, broadcast gathered_vector from node 0 to other nodes: */
-		ISSM_MPI_Bcast(gathered_vector,vector_size,ISSM_MPI_PDOUBLE,0,comm);
-	}
+	/*Now, broadcast gathered_vector from node 0 to other nodes: */
+	MPI_Bcast(gathered_vector,vector_size,MPI_DOUBLE,0,MPI_COMM_WORLD);
 
 	/*Assign output pointers: */
 	*pgathered_vector=gathered_vector;
-
-	/*Free resources: */
-	xDelete<int>(idxn);
-	xDelete<double>(local_vector);
-
+	
+	/*free ressources: */
+	xfree((void**)&idxn);
+	xfree((void**)&local_vector);
+	
 	return 1;
 }
Index: /issm/trunk/src/c/toolkits/petsc/patches/VecTranspose.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/VecTranspose.cpp	(revision 1)
+++ /issm/trunk/src/c/toolkits/petsc/patches/VecTranspose.cpp	(revision 1)
@@ -0,0 +1,66 @@
+/*! \file VecTranspose.cpp
+ *  \brief: transpose of a petsc vector
+ */
+
+#include "./petscpatches.h"
+#include "../../../shared/shared.h"
+
+int VecTranspose(Vec* ptvector,Vec vector){
+
+	int i;
+	int size;
+	int lower_row,upper_row,range;
+	
+	int* idxm=NULL;
+	double* values=NULL;
+
+	int* tidxm=NULL;
+	double* tvalues=NULL;
+	
+	/*output: */
+	Vec tvector=NULL;
+
+	/*Get size of input vector: */
+	VecGetSize(vector,&size);
+	
+	/*Create new vector of same size: */
+	tvector=NewVec(size);
+
+	/*Extract values locally from input vector: */
+	VecGetOwnershipRange(vector,&lower_row,&upper_row);
+	upper_row--;
+	range=upper_row-lower_row+1;    
+
+	if (range){
+		idxm=(int*)xmalloc(range*sizeof(int)); 
+		tidxm=(int*)xmalloc(range*sizeof(int)); 
+		for (i=0;i<range;i++){
+			*(idxm+i)=lower_row+i;
+		} 
+		values=(double*)xmalloc(range*sizeof(double));
+		tvalues=(double*)xmalloc(range*sizeof(double));
+		
+		VecGetValues(vector,range,idxm,values);
+		
+		/*Transfer values into tidxm, and idxm into tvalues: */
+		for (i=0;i<range;i++){
+			tidxm[i]=(int)values[i];
+			tvalues[i]=(double)idxm[i];
+		}
+		VecSetValues(tvector,range,tidxm,tvalues,INSERT_VALUES);
+	}
+
+	/*Assemble: */
+	VecAssemblyBegin(tvector);
+	VecAssemblyEnd(tvector);
+
+	/*Free ressources: */
+	xfree((void**)&idxm);
+	xfree((void**)&values);
+	xfree((void**)&tidxm);
+	xfree((void**)&tvalues);
+
+	/*Assign output pointers: */
+	*ptvector=tvector;
+	return 1;
+}
Index: /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h	(revision 1)
@@ -6,30 +6,40 @@
 #define _PETSC_PATCHES_H_
 
-#include <petscksp.h>
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
 
-#include "./SolverEnum.h"
-#include "../../toolkitsenums.h"
-#include "../../../shared/io/Comm/IssmComm.h"
 
-class Parameters;
+#ifdef _SERIAL_
+#include "mex.h"
+int MatlabMatrixToPetscMatrix(Mat* matrix,int* prows,int* pcols, const mxArray* mxmatrix);
+int MatlabVectorToPetscVector(Vec* pvector,int* pvector_rows,const mxArray* mxvector);
+int PetscMatrixToMatlabMatrix(mxArray** pdataref,Mat matrix);
+int PetscVectorToMatlabVector(mxArray** pdataref,Vec vector);
+int MatlabMatrixToDoubleMatrix(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix);
+int MatlabVectorToDoubleVector(double** pvector,int* pvector_rows,const mxArray* mxvector);
+#endif
 
-Vec NewVec(int size,ISSM_MPI_Comm comm,bool fromlocalsize=false);
-Mat NewMat(int M,int N,ISSM_MPI_Comm comm);
-Mat NewMat(int M,int N,double sparsity,ISSM_MPI_Comm comm);
-Mat NewMat(int M,int N,int connectivity,int numberofdofspernode, ISSM_MPI_Comm comm);
-
-int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm,bool broadcast=true);
+int PetscDetermineLocalSize(int global_size);
+Vec NewVec(int size);
+Vec NewVecFromLocalSize(int local_size);
+Mat NewMat(int M,int N,double* psparsity,int* pconnectivity,int* pnumberofdofspernode);
+int VecTranspose(Vec* tvector,Vec vector);
+int VecToMPISerial(double** pgathered_vector, Vec vector);
+void GetOwnershipBoundariesFromRange(int* plower_row,int* pupper_row,int range);
 void MatFree(Mat* pmat);
 void ISFree(IS* pis);
 void VecFree(Vec* pvec);
 void KSPFree(KSP* pksp);
-int MatPartition(Mat* poutmatrix,Mat matrixA,double* row_partition_vector,int row_partition_vector_size, double* col_partition_vector,int col_partition_vector_size);
-void PetscOptionsDetermineSolverType(int* psolver_type);
-void MatMultPatch(Mat A,Vec X, Vec AX,ISSM_MPI_Comm comm);
-void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm,bool broadcast=true);
-Vec  SerialToVec(double* vector,int vector_size);
-InsertMode ISSMToPetscInsertMode(InsMode mode);
-NormType ISSMToPetscNormMode(NormMode mode);
-MatType ISSMToPetscMatrixType(MatrixType type);
+void VecPartition(Vec* poutvector,Vec vectorA, double* row_partition_vector, int row_partition_vector_size);
+int MatPartition(Mat* poutmatrix,Mat matrixA,double* row_partition_vector,int row_partition_vector_size ,
+		double* col_partition_vector,int col_partition_vector_size);
+void MatInvert(Mat* pInv, Mat Matrix);
+void PetscOptionsInsertMultipleString(char* options_string);
+void PetscOptionsDetermineSolverType(int* psolver_type,char* options_string);
+void VecMerge(Vec A, Vec B, double* row_partition_vector,int row_partition_size);
+void MatMultPatch(Mat A,Vec X, Vec AX);
+void MatToSerial(double** poutmatrix,Mat matrix);
+
 
 #endif
Index: /issm/trunk/src/c/toolkits/petsc/petscincludes.h
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/petscincludes.h	(revision 28275)
+++ /issm/trunk/src/c/toolkits/petsc/petscincludes.h	(revision 1)
@@ -6,13 +6,11 @@
 #define _PETSC_INCLUDES_H_
 
-#ifdef _HAVE_PETSC_
-
 /*Petsc includes: */
-#include <petscksp.h>
+#include "petscmat.h"
+#include "petscvec.h"
+#include "petscksp.h"
 
 /*our own patches: */
 #include "patches/petscpatches.h"
-#include "objects/petscobjects.h"
 
 #endif
-#endif
Index: /issm/trunk/src/c/toolkits/toolkits.h
===================================================================
--- /issm/trunk/src/c/toolkits/toolkits.h	(revision 28275)
+++ /issm/trunk/src/c/toolkits/toolkits.h	(revision 1)
@@ -6,39 +6,8 @@
 #define _TOOLKITS_H_
 
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#include "./petsc/petscincludes.h"
+#include "./mpi/mpiincludes.h"
+#include "./metis/metisincludes.h"
+#include "./triangle/triangleincludes.h"
+
 #endif
-
-#ifdef _HAVE_PETSC_
-#include "./petsc/petscincludes.h"
-#endif
-
-#include "./mpi/issmmpi.h"
-
-#ifdef _HAVE_METIS_
-#include "./metis/metisincludes.h"
-#endif
-
-#ifdef _HAVE_GSL_
-#include "./gsl/gslincludes.h"
-#endif
-
-#ifdef _HAVE_ADOLC_
-#include "./adolc/adolcincludes.h"
-#endif
-
-#ifdef _HAVE_CODIPACK_
-#include "./codipack/codipackincludes.h"
-#endif
-
-#ifdef _HAVE_TRIANGLE_
-#include "./triangle/triangleincludes.h"
-#endif
-
-#include "./objects/toolkitobjects.h"
-#include "./toolkitsenums.h"
-#include "./issm/issmtoolkit.h"
-#include "./ToolkitOptions.h"
-#endif
Index: sm/trunk/src/c/toolkits/toolkitsenums.h
===================================================================
--- /issm/trunk/src/c/toolkits/toolkitsenums.h	(revision 28275)
+++ 	(revision )
@@ -1,18 +1,0 @@
-/* \file toolkitsenums.h
- * \brief: enums that encompasse all of the toolkit APIs. This mainly maps into PETSC enums.
- */
-
-#ifndef _TOOLKITSENUMS_H_
-#define _TOOLKITSENUMS_H_
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-typedef enum {INS_VAL, ADD_VAL} InsMode;
-typedef enum {NORM_INF,NORM_TWO,NORM_FROB} NormMode;
-typedef enum {DENSE_SEQUENTIAL,SPARSE_SEQUENTIAL} MatrixType;
-
-#endif
Index: /issm/trunk/src/c/toolkits/triangle/triangleincludes.h
===================================================================
--- /issm/trunk/src/c/toolkits/triangle/triangleincludes.h	(revision 28275)
+++ /issm/trunk/src/c/toolkits/triangle/triangleincludes.h	(revision 1)
@@ -7,7 +7,10 @@
 
 #ifdef _C_ //only valid for iso C, not C++
+
 /*Triangle includes: */
 #include "triangle.h"
-#endif //#ifdef _C_
 
 #endif
+
+
+#endif
Index: sm/trunk/src/m/Makefile.am
===================================================================
--- /issm/trunk/src/m/Makefile.am	(revision 28275)
+++ 	(revision )
@@ -1,134 +1,0 @@
-#To generate list of directories
-#
-#find . -type d -exec ls -d {} \;
-
-bin_SCRIPTS =
-if WRAPPERS
-if MATLAB
-if !DEVELOPMENT
-# TODO: There should be a better way of doing this so that manual updating is
-#		not required when a new subdirectory or module is introduced (search
-#		all subdirectories for file type, checking against an exclude list)
-bin_SCRIPTS += \
-	${ISSM_DIR}/src/m/archive/*.m \
-	${ISSM_DIR}/src/m/array/*.m \
-	${ISSM_DIR}/src/m/boundaryconditions/*.m \
-	${ISSM_DIR}/src/m/classes/*.m \
-	${ISSM_DIR}/src/m/classes/clusters/*.m \
-	${ISSM_DIR}/src/m/classes/qmu/*.m \
-	${ISSM_DIR}/src/m/classes/qmu/dakota_method/*.m \
-	${ISSM_DIR}/src/m/consistency/*.m \
-	${ISSM_DIR}/src/m/coordsystems/*.m \
-	${ISSM_DIR}/src/m/dev/issmversion.m \
-	${ISSM_DIR}/src/m/exp/*.m \
-	${ISSM_DIR}/src/m/exp/operation/*.m \
-	${ISSM_DIR}/src/m/extrusion/*.m \
-	${ISSM_DIR}/src/m/geometry/*.m \
-	${ISSM_DIR}/src/m/interp/*.m \
-	${ISSM_DIR}/src/m/inversions/*.m \
-	${ISSM_DIR}/src/m/io/*.m \
-	${ISSM_DIR}/src/m/kml/*.m \
-	${ISSM_DIR}/src/m/materials/*.m \
-	${ISSM_DIR}/src/m/mech/*.m \
-	${ISSM_DIR}/src/m/mesh/*.m \
-	${ISSM_DIR}/src/m/mesh/planet/gmsh/*.m \
-	${ISSM_DIR}/src/m/mesh/planet/spheretri/*.m \
-	${ISSM_DIR}/src/m/mesh/rifts/*.m \
-	${ISSM_DIR}/src/m/miscellaneous/*.m \
-	${ISSM_DIR}/src/m/modules/*.m \
-	${ISSM_DIR}/src/m/modeldata/*.m \
-	${ISSM_DIR}/src/m/os/*.m \
-	${ISSM_DIR}/src/m/parameterization/*.m \
-	${ISSM_DIR}/src/m/partition/*.m \
-	${ISSM_DIR}/src/m/plot/*.m \
-	${ISSM_DIR}/src/m/plot/colormaps/*.m \
-	${ISSM_DIR}/src/m/print/*.m \
-	${ISSM_DIR}/src/m/qmu/*.m \
-	${ISSM_DIR}/src/m/qmu/examples/*.m \
-	${ISSM_DIR}/src/m/qmu/plot/*.m \
-	${ISSM_DIR}/src/m/qmu/setupdesign/*.m \
-	${ISSM_DIR}/src/m/regional/*.m \
-	${ISSM_DIR}/src/m/shp/*.m \
-	${ISSM_DIR}/src/m/solve/*.m \
-	${ISSM_DIR}/src/m/solvers/*.m \
-	${ISSM_DIR}/src/m/string/*.m
-endif
-endif
-
-if PYTHON
-if !DEVELOPMENT
-# TODO: There should be a better way of doing this so that manual updating is
-#		not required when a new subdirectory or module is introduced (search
-#		all subdirectories for file type, checking against an exclude list)
-bin_SCRIPTS += \
-	${ISSM_DIR}/src/m/archive/*.py \
-	${ISSM_DIR}/src/m/array/*.py \
-	${ISSM_DIR}/src/m/boundaryconditions/*.py \
-	${ISSM_DIR}/src/m/classes/*.py \
-	${ISSM_DIR}/src/m/classes/clusters/*.py \
-	${ISSM_DIR}/src/m/classes/qmu/*.py \
-	${ISSM_DIR}/src/m/classes/qmu/dakota_method/*.py \
-	${ISSM_DIR}/src/m/consistency/*.py \
-	${ISSM_DIR}/src/m/coordsystems/*.py \
-	${ISSM_DIR}/src/m/dev/issmversion.py \
-	${ISSM_DIR}/src/m/exp/*.py \
-	${ISSM_DIR}/src/m/extrusion/*.py \
-	${ISSM_DIR}/src/m/geometry/*.py \
-	${ISSM_DIR}/src/m/interp/*.py \
-	${ISSM_DIR}/src/m/inversions/*.py \
-	${ISSM_DIR}/src/m/io/*.py \
-	${ISSM_DIR}/src/m/materials/*.py \
-	${ISSM_DIR}/src/m/mech/*.py \
-	${ISSM_DIR}/src/m/mesh/*.py \
-	${ISSM_DIR}/src/m/mesh/planet/gmsh/*.py \
-	${ISSM_DIR}/src/m/mesh/rifts/*.py \
-	${ISSM_DIR}/src/m/miscellaneous/*.py \
-	${ISSM_DIR}/src/m/modules/*.py \
-	${ISSM_DIR}/src/m/os/*.py \
-	${ISSM_DIR}/src/m/parameterization/*.py \
-	${ISSM_DIR}/src/m/partition/*.py \
-	${ISSM_DIR}/src/m/plot/*.py \
-	${ISSM_DIR}/src/m/plot/colormaps/*.py \
-	${ISSM_DIR}/src/m/qmu/*.py \
-	${ISSM_DIR}/src/m/qmu/setupdesign/*.py \
-	${ISSM_DIR}/src/m/shp/*.py \
-	${ISSM_DIR}/src/m/solve/*.py \
-	${ISSM_DIR}/src/m/solvers/*.py
-endif
-endif
-
-if JAVASCRIPT
-if !DEVELOPMENT
-# TODO: There should be a better way of doing this so that manual updating is
-#		not required when a new subdirectory or module is introduced (search
-#		all subdirectories for file type, checking against an exclude list)
-js_scripts = \
-	${ISSM_DIR}/src/m/array/*.js \
-	${ISSM_DIR}/src/m/boundaryconditions/*.js \
-	${ISSM_DIR}/src/m/classes/*.js \
-	${ISSM_DIR}/src/m/classes/clusters/*.js \
-	${ISSM_DIR}/src/m/consistency/*.js \
-	${ISSM_DIR}/src/m/exp/*.js \
-	${ISSM_DIR}/src/m/extrusion/*.js \
-	${ISSM_DIR}/src/m/geometry/*.js \
-	${ISSM_DIR}/src/m/inversions/*.js \
-	${ISSM_DIR}/src/m/io/*.js \
-	${ISSM_DIR}/src/m/materials/*.js \
-	${ISSM_DIR}/src/m/mesh/*.js \
-	${ISSM_DIR}/src/m/miscellaneous/*.js \
-	${ISSM_DIR}/src/m/parameterization/*.js \
-	${ISSM_DIR}/src/m/plot/*.js \
-	${ISSM_DIR}/src/m/print/*.js \
-	${ISSM_DIR}/src/m/shp/*.js \
-	${ISSM_DIR}/src/m/solve/*.js \
-	${ISSM_DIR}/src/m/solvers/*.js
-bin_SCRIPTS +=  issm-bin.js
-
-issm-bin.js: ${js_scripts}
-	rm -f issm-bin.js
-	cat ${js_scripts} > issm-bin.js
-
-endif
-endif
-
-endif
Index: /issm/trunk/src/m/classes/@acceleratedtriaelem/CreateKMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@acceleratedtriaelem/CreateKMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@acceleratedtriaelem/CreateKMatrix.m	(revision 1)
@@ -0,0 +1,236 @@
+function Ke=CreateKMatrix(element,grids,materials,inputs,analysis_type);
+%CREATEKMATRIX - create the stiffness matrix for acceleratedtriaelem
+%
+%   global finite element stiffness matrix of the whole model
+%   works only for MacAyeal's model
+%
+%   Usage:
+%      Ke=CreateKMatrix(element,grids,materials,inputs,analysis_type)
+%
+%   See also CREATEPVECTOR
+
+
+%keep permanent pieces of stiffness matrix in memory
+global permanent_pieces_of_Ke alpha beta row_location col_location aire
+
+%Ok, this is the accelerated MacAyeal's element. Very particular methodology here! 
+
+%Some variables
+numdof=3*2; %3 grids, 2 degrees of freedom per grid.
+
+%recover extra inputs from users, at current convergence iteration.
+[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+[basal_drag_param basal_drag_is_present]=recover_input(inputs,'drag');
+[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+[surface_param surface_is_present]=recover_input(inputs,'surface');
+[bed_param bed_is_present]=recover_input(inputs,'bed');
+[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+[oldvelocity_param oldvelocity_is_present]=recover_input(inputs,'oldvelocity');
+
+if velocity_is_present,
+	vx=velocity_param(1:6:numdof*element.nods);
+	vy=velocity_param(2:6:numdof*element.nods);
+else
+	vx={};
+	vy={};
+	permanent_pieces_of_Ke={};
+end
+if oldvelocity_is_present,
+	oldvx=oldvelocity_param(1:6:numdof*element.nods);
+	oldvy=oldvelocity_param(2:6:numdof*element.nods);
+else
+	oldvx={};
+	oldvy={};
+end
+if flow_law_is_present,
+	B_list=flow_law_param(1:6:6*element.nods);
+	B_bar=1/3*(B_list(element.index(:,1))+B_list(element.index(:,2))+B_list(element.index(:,3)));
+else
+	B_bar=element.B_bar;
+end
+
+if basal_drag_is_present,
+	drag=basal_drag_param(1:6:6*element.nods);
+else
+	drag=element.drag;
+end
+
+if thickness_is_present,
+	thickness=thickness_param(1:6:6*element.nods);
+else
+	thickness=element.thickness;
+end
+
+thickness_el=thickness(element.index)*[1;1;1]/3;
+
+if surface_is_present,
+	surface=surface_param(1:6:6*element.nods);
+else
+	surface=element.surface;
+end
+
+if bed_is_present,
+	bed=bed_param(1:6:6*element.nods);
+else
+	bed=element.bed;
+end
+
+if isempty(permanent_pieces_of_Ke),
+	%Start building areas
+	aire=zeros(element.nel,1);
+
+	for n=1:element.nel
+		aire(n)=1/2 * det([1 1 1;element.x(element.index(n,:))';element.y(element.index(n,:))']);
+	end
+
+	aire=abs(aire); % if index is sorted from its original value, then aire could be negative
+
+	alpha=zeros(element.nel,3);
+	beta=zeros(element.nel,3);
+	gamma=zeros(element.nel,3);
+
+	for n=1:element.nel
+		X=inv([element.x(element.index(n,:)) element.y(element.index(n,:)) ones(3,1)]);
+		alpha(n,:)=X(1,:);
+		beta(n,:)=X(2,:);
+		gamma(n,:)=X(3,:);
+	end
+
+	clear X
+
+
+	%  Do once and for all the initial computation of matrix-locations:
+	row_location=zeros(4*element.nel*9,1);
+	col_location=zeros(4*element.nel*9,1);
+
+	count=-element.nel+1;
+
+	for i=1:3
+		for j=1:3
+			for k=1:2,
+				for l=1:2,
+					count=count+element.nel;
+					row_location(count:count+element.nel-1)=(element.index(:,i)-1)*numdof+k;
+					col_location(count:count+element.nel-1)=(element.index(:,j)-1)*numdof+l;
+				end
+			end
+		end
+	end
+
+
+	% Create permanent part of stiffness matrix.
+	permanent_pieces_of_Ke=zeros(2*element.nel*9,1);
+
+	count=-element.nel+1;
+
+	for i=1:3
+		for j=1:3
+			for k=1:2,
+				for l=1:2,
+					count=count+element.nel;
+
+					permanent_pieces_of_Ke(count:count+element.nel-1)= thickness_el .* aire.*(...
+					((k==1) & (l==1)).*(2*alpha(:,i).*alpha(:,j) + 1/2*beta(:,i).*beta(:,j)) +...
+					((k==2) & (l==1)).*(alpha(:,j).*beta(:,i) + 1/2*beta(:,j).*alpha(:,i)) + ...
+					((k==1) & (l==2)).*(beta(:,j).*alpha(:,i) + 1/2*alpha(:,j).*beta(:,i)) + ...
+					((k==2) & (l==2)).*(2*beta(:,i).*beta(:,j) + 1/2*alpha(:,i).*alpha(:,j)) ...
+					);
+				end
+			end
+		end
+	end
+	
+end %if isempty(permanent_pieces_of_Ke)
+	
+%Compute viscosity
+viscosity_overshoot=materials(end).constants.viscosity_overshoot;
+newviscosity=viscosity(element.index,element.nel,alpha,beta,vx,vy,B_bar,element.glen_coeff);
+oldviscosity=viscosity(element.index,element.nel,alpha,beta,oldvx,oldvy,B_bar,element.glen_coeff);
+nu_bar=newviscosity+viscosity_overshoot*(newviscosity-oldviscosity);
+
+%Multiply viscosity by permanent_pieces_of_Ke
+count=-element.nel+1;
+
+%Create sparse global matrix terms: 
+Ke_terms=zeros(4*element.nel*9,1);
+
+for i=1:3
+	for j=1:3
+		for k=1:2,
+			for l=1:2,
+				count=count+element.nel;
+				Ke_terms(count:(count+element.nel-1))=nu_bar.*permanent_pieces_of_Ke(count:(count+element.nel-1));
+			end
+		end
+	end
+end
+
+Drag_operator=sparse2(6*element.nods,6*element.nods);
+
+%Create basal stiffness
+if (element.friction_type==2) & velocity_is_present
+
+	%average of p and q over the grids (size nel->nods)
+	pcoeff_grid=zeros(element.nods,1);
+	qcoeff_grid=zeros(element.nods,1);
+	for i=1:element.nods
+		%1: find the elements that contain the grid i
+		neighbors_gridi=[];
+		for j=1:3
+			neighbors_gridi=[neighbors_gridi find(element.index(:,j)==i)'];
+		end
+		numberofneighbors_gridi=length(neighbors_gridi);
+		%2 retrieve the value of p and q over each of these elements. The average is
+		%plugged into dbx_grid
+		qcoeff_grid(i)=sum(element.q(neighbors_gridi))/numberofneighbors_gridi;
+		pcoeff_grid(i)=sum(element.p(neighbors_gridi))/numberofneighbors_gridi;
+	end
+    
+	%Retrieve some parameters needed to compute alpha2 (taub=alpha2*ub)
+	frictionparameters=struct();
+	frictionparameters.element_type='2d';
+	frictionparameters.rho_ice=materials(end).constants.rho_ice;
+	frictionparameters.rho_water=materials(end).constants.rho_water;
+	frictionparameters.g=materials(end).constants.g;	
+	frictionparameters.p=pcoeff_grid;
+	frictionparameters.q=qcoeff_grid;
+	frictionparameters.velocities=[vx vy];
+	frictionparameters.h=thickness;
+	frictionparameters.b=bed;
+	frictionparameters.k=drag;
+
+	alpha2=Getalpha2(frictionparameters);
+
+	drag_operator_value=zeros(2*element.nel*27,1);
+
+	row_location_drag=zeros(2*element.nel*27,1);
+	col_location_drag=zeros(2*element.nel*27,1);
+
+	count=-element.nel+1;
+	    
+	for i=1:3
+		for j=1:3
+			for m=1:3
+				for k=1:2,
+
+					count=count+element.nel;
+			 
+					row_location_drag(count:count+element.nel-1)=(element.index(:,i)-1)*numdof+k;
+					col_location_drag(count:count+element.nel-1)=(element.index(:,j)-1)*numdof+k;
+					drag_operator_value(count:count+element.nel-1)=aire.*(...
+					((i==j) & (j==m)).*alpha2(element.index(:,m))*1/10+...
+					(((i==j) | (j==m) | (i==m)) & ~((i==j) & (j==m))).*alpha2(element.index(:,m))*1/30+...
+					((i~=j) & (j~=m) & (i~=m)).*alpha2(element.index(:,m))*1/60);
+
+				end
+			end
+		end
+	end  
+
+	Drag_operator=sparse2(row_location_drag,col_location_drag,drag_operator_value,6*element.nods,6*element.nods);
+end
+
+%Create final global stiffness matrix
+Ke=globalmatrix;
+Ke.nrows=numdof*element.nods;
+Ke.matrix=Drag_operator+sparse2(row_location,col_location,Ke_terms,6*element.nods,6*element.nods);
Index: /issm/trunk/src/m/classes/@acceleratedtriaelem/CreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@acceleratedtriaelem/CreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@acceleratedtriaelem/CreatePVector.m	(revision 1)
@@ -0,0 +1,108 @@
+function pe=CreatePVector(element,grids,materials,inputs,analysis_type);
+%CREATEPVECTOR - create the load vector for an acceleratedtriaelem
+%
+%   global finite element load vector of the whole model
+%   works only for MaAyeal's model
+%
+%   Usage:
+%      Pe=CreatePVector(element,grids,materials,inputs,analysis_type);
+% 
+%   See also CREATEKMATRIX
+
+global aire alpha beta
+
+%some variables
+numgrids=3;
+NDOF2=2;
+numdof=numgrids*NDOF2;
+
+%recover extra inputs from users, at current convergence iteration.
+[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+[surface_param surface_is_present]=recover_input(inputs,'surface');
+
+
+if thickness_is_present,
+	thickness=thickness_param(1:6:6*element.nods);
+else
+	thickness=element.thickness;
+end
+
+if surface_is_present,
+	surface=surface_param(1:6:6*element.nods);
+else
+	surface=element.surface;
+end
+
+
+%retrieve rho_ice,g and thickness
+matpar=materials(end).constants;
+rho_ice=matpar.rho_ice;
+rho_water=matpar.rho_water;
+g=matpar.g;
+
+%Build length_icefront and normal_icefront:
+%[length_icefront,normal_icefront]=buildicefrontnormal(element.x,element.y,element.index_icefront);
+
+Rhs_x=zeros(element.nel*27,1);
+Rhs_y=zeros(element.nel*27,1);
+Rhs_y=ones(element.nel*27,1);
+row_rhs=zeros(element.nel*27,1);
+
+count=-element.nel+1;
+for i=1:3
+	for n=1:3
+		for m=1:3
+			count=count+element.nel;
+
+			Rhs_x(count:count+element.nel-1)= -rho_ice * g  * ...
+			 thickness(element.index(:,n)).*surface(element.index(:,m)) ...
+			.* aire(:) .* alpha(:,m) * ( (n==i)/6 + (n~=i)/12 );
+
+			Rhs_y(count:count+element.nel-1)= -rho_ice * g  * ...
+			 thickness(element.index(:,n)).*surface(element.index(:,m)) ...
+			.* aire(:) .* beta(:,m) .* ( (n==i)/6 + (n~=i)/12 );
+
+			row_rhs(count:count+element.nel-1)=element.index(:,i);
+
+		end
+	end
+end
+
+Rhs=full([sparse2(row_rhs,ones(element.nel*27,1),Rhs_x,element.nods,1)
+   sparse2(row_rhs,ones(element.nel*27,1),Rhs_y,element.nods,1)]);
+
+%Index icefront is skipped: 
+%for k=1:2
+%	for l=1:2
+%		for j=1:2
+%				Rhs(element.index_icefront(:,k))=Rhs(element.index_icefront(:,k)) + ...
+%(rho_ice*g/2*thickness(element.index_icefront(:,l)).*thickness(element.index_icefront(:,j)) ...
+%+ rho_water*g/2*(element.gridoniceshelf(element.index_icefront(:,k))) ...
+%.*(-min(0,element.bed(element.index_icefront(:,l))).*min(0,element.bed(element.index_icefront(:,j))) ...
+%+min(0,thickness(element.index_icefront(:,l))+element.bed(element.index_icefront(:,l)))...
+%.*min(0,element.thickness(element.index_icefront(:,j))+element.bed(element.index_icefront(:,j)))))...
+%.*normal_icefront(:,1).*length_icefront(:) ...
+%/(4*(l==k & j==k) + 12*(l~=k | j~=k) );
+%
+%				Rhs(element.index_icefront(:,k)+element.nods)=Rhs(element.index_icefront(:,k)+element.nods) + ...
+%(rho_ice*g/2*thickness(element.index_icefront(:,l)).*thickness(element.index_icefront(:,j)) ...
+%+ rho_water*g/2*(element.gridoniceshelf(element.index_icefront(:,k))) ...
+%.*(-min(0,element.bed(element.index_icefront(:,l))).*min(0,element.bed(element.index_icefront(:,j))) ...
+%+min(0,thickness(element.index_icefront(:,l))+element.bed(element.index_icefront(:,l)))...
+%.*min(0,thickness(element.index_icefront(:,j))+element.bed(element.index_icefront(:,j)))))...
+%.*normal_icefront(:,2).*length_icefront(:) ...
+%/(4*(l==k & j==k) + 12*(l~=k | j~=k) );
+%
+%		end
+%	end
+%end
+%
+clear Rhs_x Rhs_y row_rhs
+
+
+%Create global vector.
+pe=globalvector;
+pe.nrows=numdof*element.nods;
+pe.vector=spalloc(6*element.nods,1,2*element.nods);
+pe.vector(1:6:6*element.nods)=Rhs(1:element.nods);
+pe.vector(2:6:6*element.nods)=Rhs(element.nods+1:2*element.nods);
Index: /issm/trunk/src/m/classes/@acceleratedtriaelem/acceleratedtriaelem.m
===================================================================
--- /issm/trunk/src/m/classes/@acceleratedtriaelem/acceleratedtriaelem.m	(revision 1)
+++ /issm/trunk/src/m/classes/@acceleratedtriaelem/acceleratedtriaelem.m	(revision 1)
@@ -0,0 +1,44 @@
+function acceleratedtriaelem = acceleratedtriaelem(varargin)
+%ACCELERATEDTRIAELEM - constructor for acceleratedtriaelem object
+%
+%   Usage:
+%      acceleratedtriaelem = acceleratedtriaelem(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	acceleratedtriaelem.type='acceleratedtriaelem';
+	acceleratedtriaelem.x=NaN;
+	acceleratedtriaelem.y=NaN;
+	acceleratedtriaelem.index=NaN;
+	acceleratedtriaelem.thickness=NaN;
+	acceleratedtriaelem.thickness_el=NaN;
+	acceleratedtriaelem.bed=NaN;
+	acceleratedtriaelem.surface=NaN;
+	acceleratedtriaelem.nods=NaN;
+	acceleratedtriaelem.nel=NaN;
+	acceleratedtriaelem.B_bar=NaN;
+	acceleratedtriaelem.glen_coeff=NaN;
+	acceleratedtriaelem.friction_type=NaN;
+	acceleratedtriaelem.drag=NaN;
+	acceleratedtriaelem.p=NaN;
+	acceleratedtriaelem.q=NaN;
+	acceleratedtriaelem.matid=NaN;
+	acceleratedtriaelem.meanvel=NaN;
+	acceleratedtriaelem.epsvel=NaN;
+	acceleratedtriaelem.index_icefront=NaN;
+	acceleratedtriaelem.gridoniceshelf=NaN;
+	acceleratedtriaelem.elementonicesheet=NaN;
+    
+	acceleratedtriaelem=class(acceleratedtriaelem,'acceleratedtriaelem');
+				
+case 1
+	%If single argument of class acceleratedtriaelem, we have a copy constructor. 
+	if (isa(varargin{1},'acceleratedtriaelem'))
+		acceleratedtriaelem = varargin{1};
+	else
+		error('acceleratedtriaelem constructor error message: copy constructor called on a non ''acceleratedtriaelem'' class object');
+	end 
+otherwise
+	error('acceleratedtriaelem constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@acceleratedtriaelem/display.m
===================================================================
--- /issm/trunk/src/m/classes/@acceleratedtriaelem/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@acceleratedtriaelem/display.m	(revision 1)
@@ -0,0 +1,10 @@
+function display(acceleratedtriaelem)
+%DISPLAY - displays the fields of an accelerated triaelement
+%
+%   echo function for 'acceleratedtriaelem' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   type: %s',acceleratedtriaelem.type));
+disp(sprintf('   nods: %i',acceleratedtriaelem.nods));
+disp(sprintf('   nel: %i',acceleratedtriaelem.nel));
+disp(sprintf('   matid: %i',acceleratedtriaelem.matid));
Index: /issm/trunk/src/m/classes/@acceleratedtriaelem/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@acceleratedtriaelem/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@acceleratedtriaelem/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function acceleratedtriaelem = subsasgn(acceleratedtriaelem,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      acceleratedtriaelem = subsasgn(acceleratedtriaelem,index,val)
+%
+%   See also SUBSREF
+
+acceleratedtriaelem=builtin('subsasgn',acceleratedtriaelem,index,val);
Index: /issm/trunk/src/m/classes/@acceleratedtriaelem/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@acceleratedtriaelem/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@acceleratedtriaelem/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function acceleratedtriaelem = subsref(acceleratedtriaelem,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      acceleratedtriaelem = subsref(acceleratedtriaelem,index)
+% 
+%   See also SUBSASGN
+
+acceleratedtriaelem=builtin('subsref',acceleratedtriaelem,index);
Index: /issm/trunk/src/m/classes/@beamelem/CreateKMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/CreateKMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/CreateKMatrix.m	(revision 1)
@@ -0,0 +1,53 @@
+function Ke=CreateKMatrix(beamelem,grids,materials,inputs,analysis_type)
+%CREATEKMATRIX - create the stiffmess matrix for beamelem
+%
+%   this stiffness matrix works for Hutter's model
+%
+%   Usage:
+%      Ke=CreateKMatrix(beamelem,grids,materials,inputs,analysis_type)
+%
+%   See also CREATEPVECTOR
+
+	if strcmpi(analysis_type,'diagnostic_hutter'),
+
+		Ke=CreateKMatrixHutter(beamelem,grids,materials,inputs);
+
+	else
+		error('CreateKMatrix/beam error message: analysis type not supported yet')
+	end
+end %end function
+
+function Ke=CreateKMatrixHutter(beamelem,grids,materials,inputs)
+
+	%some variables
+	numgrids=2;
+	DOFPERGRID=2;
+	numdof=numgrids*DOFPERGRID; %number of dof for element beamelem.
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(beamelem.g(i)).grid.doflist; %list of dofs in the g-set
+		for j=1:DOFPERGRID,
+			dof=doflist(j);
+			Ke.row_indices((i-1)*DOFPERGRID+j)=dof;
+		end
+		
+		dof=doflist(1);
+	end
+
+
+	if (beamelem.onbed==1),
+		Ke.terms=[ 1  0  0  0
+	               0  1  0  0
+				  -1  0  1  0
+				  0  -1  0  1];
+	else
+		Ke.terms=[ 0  0  0  0
+	               0  0  0  0
+				  -1  0  1  0
+				  0  -1  0  1];
+	end
+end %end function
Index: /issm/trunk/src/m/classes/@beamelem/CreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/CreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/CreatePVector.m	(revision 1)
@@ -0,0 +1,151 @@
+function pe=CreatePVector(beamelem,grids,materials,inputs,analysis_type);
+%CREATEPVECTOR - create the load vector for a beamelem
+%
+%   works only for Hutter's model
+%
+%   Usage:
+%      Pe=CreatePVector(beamelem,grids,materials,inputs,analysis_type);
+% 
+%   See also CREATEKMATRIX
+
+	if strcmpi(analysis_type,'diagnostic_hutter'),
+
+		pe=CreatePVectorHutter(beamelem,grids,materials,inputs);
+
+	else
+		error('beamelem/CreatePVector error message: analysis type not implemented yet')
+	end
+end %end function
+
+function pe=CreatePVectorHutter(beamelem,grids,materials,inputs);
+
+	%some variables
+	numgrids=2;
+	NDOF2=2;
+
+	%Create elementary vector.
+	pe=elemvector(numgrids*NDOF2);
+
+	%recover material
+	matice=materials(beamelem.matid).material;
+	matpar=materials(end).constants;
+
+	%recover material parameters
+	gravity=matpar.g;
+	rho_ice=matpar.rho_ice;
+	n=matice.n;
+
+	%recover extra inputs
+	[surface_param surface_is_present]=recover_input(inputs,'surface');
+	[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+	[B_param B_is_present]=recover_input(inputs,'B');
+	[temperature_param temperature_is_present]=recover_input(inputs,'temperature');
+	[slopesurface_param slopesurface_is_present]=recover_input(inputs,'slopesurface');
+
+	if (~slopesurface_is_present),
+		error('CreatePVector/beamelem error message: slope_surface is missing in inputs');
+	end
+
+	%Get all element grid data:
+	z_list=getgriddata(beamelem,grids);
+	
+	%Initialize inputs
+	surface_list=zeros(numgrids,1);
+	B_list=zeros(numgrids,1);
+	temperature_list=zeros(numgrids,1);
+	slopesurface_list=zeros(numgrids,2);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(beamelem.g(i)).grid.doflist;
+		for j=1:NDOF2,
+			pe.row_indices((i-1)*NDOF2+j)=doflist(j);
+			slopesurface_list(i,j)=slopesurface_param(doflist(j));
+		end
+		dof=doflist(1);
+		if(surface_is_present) surface_list(i)=surface_param(dof);end;
+		if(thickness_is_present) thickness_list(i)=thickness_param(dof);end;
+		if(B_is_present) B_list(i)=B_param(dof);end;
+		if(temperature_is_present) temperature_list(i)=temperature_param(dof);end;
+	end
+
+	%compute slope2 slopex and slopy
+	slope=zeros(2,1);
+	slope(1)=slopesurface_list(1,1); %2 and 1 have the same slopes (mesh has been verticaly extruded)
+	slope(2)=slopesurface_list(1,2);
+	slope2=slope(1)^2+slope(2)^2;
+
+	%compute surface
+	if surface_is_present
+		surface=surface_list(1);
+	else
+		surface=beamelem.s(1);
+	end
+
+	%compute constant_part
+	constant_part=-2*(rho_ice*gravity)^n*(slope2)^((n-1)/2);
+
+	% Get gaussian points and weights.
+	num_gauss=3;
+	[gauss_coords,gauss_weights]=GaussSegment(num_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for ig=1:num_gauss,
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=gauss_coords(ig);
+	
+		%Update material if temperature is provided.
+		if B_is_present,
+			B=GetParameterValue(beamelem,B_list,gauss_coord);
+		elseif temperature_is_present,
+			temperature=GetParameterValue(beamelem,temperature_list,gauss_coord);
+			B=paterson(temperature);
+		else
+			B=matice.B;
+		end
+
+		%compute constant_part
+		z_g=GetParameterValue(beamelem,z_list,gauss_coord);
+
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(beamelem,z_list,gauss_coord);
+		%disp(sprintf('Jacobian determinant: %f\n', Jdet));
+
+		%Get nodal functions
+		l1l2=GetNodalFunctions(beamelem,gauss_coord);
+
+		%Build pe_gaussian vector:
+		pe_gaussian=zeros(numgrids*NDOF2,1);
+
+		for j=1:NDOF2,
+			pe_gaussian(NDOF2+j)=constant_part*((surface-z_g)/B)^n*slope(j)*Jdet*gauss_weight;
+		end
+
+		%Add pe_gaussian vector to pe:
+		for i=1:pe.nrows,
+			pe.terms(i)=pe.terms(i)+pe_gaussian(i);
+		end
+	end %for ig=1:num_area_gauss,
+
+	%Deal with lower surface
+	if (beamelem.onbed==1),
+
+		%compute thickness
+		if thickness_is_present
+			thickness=thickness_list(1);
+		else
+			thickness=beamelem.h(1);
+		end
+
+		%compute ub
+		%constant_part=0;%-1.58*10^-10*rho_ice*gravity*thickness;
+		constant_part=-1.58*10^-10*rho_ice*gravity*thickness;
+		ub=constant_part*slope(1);
+		vb=constant_part*slope(2);
+
+		%Add pe_gg_drag_gaussian to pe
+		pe.terms(1)=pe.terms(1)+ub;
+		pe.terms(2)=pe.terms(2)+vb;
+	end
+end %end function
Index: /issm/trunk/src/m/classes/@beamelem/GetJacobian.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/GetJacobian.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/GetJacobian.m	(revision 1)
@@ -0,0 +1,10 @@
+function J=GetJacobian(beamelem,z_list,gauss_coord)
+%GETJACOBIAN - computes the jacobian for a beamelem
+%
+%   Usage:
+%      J=GetJacobian(beamelem,z_list,gauss_coord)
+%
+%   See also GETJACOBIANDETERMINANT, GETJACOBIANINVERT
+
+%The Jacobian is constant over the element, discard the gaussian points. 
+J=1/2*(z_list(2)-z_list(1));
Index: /issm/trunk/src/m/classes/@beamelem/GetJacobianDeterminant.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/GetJacobianDeterminant.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/GetJacobianDeterminant.m	(revision 1)
@@ -0,0 +1,16 @@
+function Jdet=GetJacobianDeterminant(beamelem,z_list,gauss_l1l2l3),
+%GETJACOBIANDETERMINANT - computes the determinant of the jacobian for a beamelem
+%
+%   Usage:
+%      Jdet=GetJacobianDeterminant(beamelem,z_list,gauss_l1l2l3)
+%
+%   See also GETJACOBIAN, GETJACOBIANINVERT
+
+z1=z_list(1);
+z2=z_list(2);
+
+Jdet=1/2*(z2-z1);
+
+if(Jdet<0),
+	error('negative jacobian determinant!');
+end
Index: /issm/trunk/src/m/classes/@beamelem/GetJacobianInvert.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/GetJacobianInvert.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/GetJacobianInvert.m	(revision 1)
@@ -0,0 +1,11 @@
+function Jinv=GetJacobianInvert(beamelem,z_list,gauss_coord)
+%GETJACOBIANINVERT - computes the invert of the jacobian for a beamelem
+%
+%   Usage:
+%      Jinv=GetJacobianInvert(beamelem,z_list,gauss_coord)
+%
+%   See also GETJACOBIAN, GETJACOBIANDETERMINANT
+
+%Call Jacobian routine to get the jacobian:
+J=GetJacobian(beamelem,z_list,gauss_coord);
+Jinv=J^(-1);
Index: /issm/trunk/src/m/classes/@beamelem/GetNodalFunctions.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/GetNodalFunctions.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/GetNodalFunctions.m	(revision 1)
@@ -0,0 +1,11 @@
+function l1l2=GetNodalFunctions(beamelem,gauss_coord)
+%GETNODALFUNCTIONS - returns the values of the nodal functions at the gaussian point
+%
+%   Usage:
+%      l1l2=GetNodalFunctions(beamelem,gauss_coord)
+%
+%   See also GETNODALFUNCTIONSDEREIVATIVESBASIC, GETNODALFUNCTIONSDEREIVATIVESPARAMS
+
+l1l2=zeros(1,2);
+l1l2(1)=0.5*gauss_coord+0.5;
+l1l2(2)=-0.5*gauss_coord+0.5;
Index: /issm/trunk/src/m/classes/@beamelem/GetNodalFunctionsDerivativesBasic.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/GetNodalFunctionsDerivativesBasic.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/GetNodalFunctionsDerivativesBasic.m	(revision 1)
@@ -0,0 +1,11 @@
+function dh1dh2_basic=GetNodalFunctionsDerivativesBasic(beamelem,z_list,gauss_coord)
+%GETNODALFUNCTIONSDERIVATIVESBASIC - returns the values of the derivatices ot the nodal functions at the gaussian point in the reference element
+%
+%   Usage:
+%   dh1dh2_basic=GetNodalFunctionsDerivativesBasic(beamelem,z_list,gauss_coord)
+%
+%   See also GETNODALFUNCTIONS, GETNODALFUNCTIONSDEREIVATIVESPARAMS
+
+dh1dh2_param=GetNodalFunctionsDerivativesParams(beamelem,gauss_coord); 
+Jinv=GetJacobianInvert(beamelem,z_list, gauss_coord);
+dh1dh2_basic=Jinv*dh1dh2_param;
Index: /issm/trunk/src/m/classes/@beamelem/GetNodalFunctionsDerivativesParams.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/GetNodalFunctionsDerivativesParams.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/GetNodalFunctionsDerivativesParams.m	(revision 1)
@@ -0,0 +1,8 @@
+function dl1dl2=GetNodalFunctionsDerivativesParams(beamelem,gauss_coord)
+%GETNODALFUNCTIONSDERIVATIVESPARAMS - returns the values of the derivatives of the nodal functions at the gaussian point in current element
+%
+%   Usage:
+%      dl1dl2=GetNodalFunctionsDerivativesParams(beamelem,gauss_coord)
+%
+%   See also GETNODALFUNCTIONSDEREIVATIVESBASIC, GETNODALFUNCTIONS
+dl1dl2=[ -1.0/2.0 1.0/2.0]; 
Index: /issm/trunk/src/m/classes/@beamelem/GetParameterValue.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/GetParameterValue.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/GetParameterValue.m	(revision 1)
@@ -0,0 +1,11 @@
+function value=GetParameterValue(beamelem,grid_values,gauss_coord),
+%GETPARAMETERVALUE - returns parameter value at gaussian point specified
+%
+%   Usage:
+%      value=GetParameterValue(beamelem,grid_values,gauss_coord)
+%   
+%   See also GETNODALFUNCTIONS
+
+l1l2=GetNodalFunctions(beamelem,gauss_coord);
+
+value=sum(l1l2.*grid_values');
Index: /issm/trunk/src/m/classes/@beamelem/beamelem.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/beamelem.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/beamelem.m	(revision 1)
@@ -0,0 +1,31 @@
+function beamelem = beamelem(varargin)
+%BEAMELEM - contructor for beamelem objects
+%
+%   Usage:
+%      beamelem = beamelem(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	beamelem.type='beamelem';
+	beamelem.id=NaN;
+	beamelem.matid=NaN;
+	beamelem.g=zeros(2,1);
+	beamelem.h=zeros(2,1);
+	beamelem.s=zeros(2,1);
+	beamelem.b=zeros(2,1);
+	beamelem.k=zeros(2,1);
+	beamelem.onbed=NaN;
+	beamelem.onsurface=NaN;
+	beamelem=class(beamelem,'beamelem');
+				
+case 1
+	%If single argument of class beamelem, we have a copy constructor. 
+	if (isa(varargin{1},'beamelem'))
+		beamelem = varargin{1};
+	else
+		error('beamelem constructor error message: copy constructor called on a non ''beamelem'' class object');
+	end 
+otherwise
+	error('beamelem constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@beamelem/display.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/display.m	(revision 1)
@@ -0,0 +1,16 @@
+function display(beamelem)
+%DISPLAY - displays the fields of a beam element
+%
+%   echo function for 'beamelem' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   type: %s',beamelem.type));
+disp(sprintf('   id: %i',beamelem.id));
+disp(sprintf('   material id: %i',beamelem.matid));
+disp(sprintf('   grid ids: %i %i',beamelem.g(1),beamelem.g(2)));
+disp(sprintf('   thickness: %g %g',beamelem.h(1),beamelem.h(2)));
+disp(sprintf('   surface: %g %g',beamelem.s(1),beamelem.s(2)));
+disp(sprintf('   bedrock: %g %g',beamelem.b(1),beamelem.b(2)));
+disp(sprintf('   drag coeff: %g',beamelem.k));
+disp(sprintf('   onbed: %i',beamelem.onbed));
+disp(sprintf('   onsurface: %i',beamelem.onsurface));
Index: /issm/trunk/src/m/classes/@beamelem/getgriddata.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/getgriddata.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/getgriddata.m	(revision 1)
@@ -0,0 +1,12 @@
+function z=getgriddata(beamelem,grids)
+%INPUT function xyz=getgriddata(beamelem,grids)
+%Create array z of size num_grids x 1 (1 for z)
+%of space coordinates for each grid. 
+
+num_grids=2;
+
+z=zeros(num_grids,1);
+
+for i=1:num_grids,
+	z(i)=grids(beamelem.g(i)).grid.z;
+end
Index: /issm/trunk/src/m/classes/@beamelem/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function beamelem = subsasgn(beamelem,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      beamelem = subsasgn(beamelem,index,val)
+%
+%   See also SUBSREF
+
+beamelem=builtin('subsasgn',beamelem,index,val);
Index: /issm/trunk/src/m/classes/@beamelem/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@beamelem/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@beamelem/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function beamelem = subsref(beamelem,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      beamelem = subsref(beamelem,index)
+% 
+%   See also SUBSASGN
+
+beamelem=builtin('subsref',beamelem,index);
Index: /issm/trunk/src/m/classes/@continuous_design/continuous_design.m
===================================================================
--- /issm/trunk/src/m/classes/@continuous_design/continuous_design.m	(revision 1)
+++ /issm/trunk/src/m/classes/@continuous_design/continuous_design.m	(revision 1)
@@ -0,0 +1,89 @@
+%
+%  definition for the continuous_design class.
+%
+%  [cdv]=continuous_design(varargin)
+%
+classdef continuous_design
+    properties
+        descriptor='';
+        initpt    = NaN;
+        lower     = NaN;
+        upper     = NaN;
+    end
+    
+    methods
+        function [cdv]=continuous_design(varargin)
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object
+
+                case 1
+                    if isa(varargin{1},'continuous_design')
+                        cdv=varargin{1};
+                    else
+                        error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+                            inputname(1),class(varargin{1}),'continuous_design');
+                    end
+
+%  create the object from the input
+
+                otherwise
+                    cdv.descriptor=varargin{1};
+                    cdv.initpt    =varargin{2};
+                    if (nargin >= 3)
+                        cdv.lower     =varargin{3};
+                        if (nargin >= 4)
+                            cdv.upper     =varargin{4};
+                            if (nargin > 4)
+                                warning('continuous_design:extra_arg',...
+                                    'Extra arguments for object of class ''%s''.',...
+                                    class(cdv));
+                            end
+                        end
+                    end
+            end
+
+        end
+        function [desc]  =dvar_desc(cdv)
+            desc=cell(size(cdv));
+            for i=1:numel(cdv)
+                desc(i)=cellstr(cdv(i).descriptor);
+            end
+            desc=allempty(desc);
+        end
+        function [initpt]=dvar_initpt(cdv)
+            initpt=zeros(size(cdv));
+            for i=1:numel(cdv)
+                initpt(i)=cdv(i).initpt;
+            end
+        end
+        function [lower] =dvar_lower(cdv)
+            lower=zeros(size(cdv));
+            for i=1:numel(cdv)
+                lower(i)=cdv(i).lower;
+            end
+            lower=allnan(lower);
+        end
+        function [upper] =dvar_upper(cdv)
+            upper=zeros(size(cdv));
+            for i=1:numel(cdv)
+                upper(i)=cdv(i).upper;
+            end
+            upper=allnan(upper);
+        end
+        function [mean]  =dvar_mean(cdv)
+            mean=[];
+        end
+        function [stddev]=dvar_stddev(cdv)
+            stddev=[];
+        end
+        function [initst]=dvar_initst(cdv)
+            initst=[];
+        end
+    end
+end
Index: /issm/trunk/src/m/classes/@continuous_design/display.m
===================================================================
--- /issm/trunk/src/m/classes/@continuous_design/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@continuous_design/display.m	(revision 1)
@@ -0,0 +1,25 @@
+%
+%  display for the continuous_design class.
+%
+%  []=display(cdv)
+%
+function []=display(cdv)
+
+if ~isa(cdv,'continuous_design')
+    error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+        inputname(1),class(cdv),'continuous_design');
+end
+
+%  display the object
+
+disp(sprintf('\n'));
+for i=1:numel(cdv)
+    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+        class(cdv),inputname(1),string_dim(cdv,i)));
+    disp(sprintf('    descriptor: ''%s'''  ,cdv(i).descriptor));
+    disp(sprintf('        initpt: %g'      ,cdv(i).initpt));
+    disp(sprintf('         lower: %g'      ,cdv(i).lower));
+    disp(sprintf('         upper: %g\n'    ,cdv(i).upper));
+end
+
+end
Index: /issm/trunk/src/m/classes/@continuous_state/continuous_state.m
===================================================================
--- /issm/trunk/src/m/classes/@continuous_state/continuous_state.m	(revision 1)
+++ /issm/trunk/src/m/classes/@continuous_state/continuous_state.m	(revision 1)
@@ -0,0 +1,89 @@
+%
+%  definition for the continuous_state class.
+%
+%  [csv]=continuous_state(varargin)
+%
+classdef continuous_state
+    properties
+        descriptor='';
+        initst    = NaN;
+        lower     = NaN;
+        upper     = NaN;
+    end
+    
+    methods
+        function [csv]=continuous_state(varargin)
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object
+
+                case 1
+                    if isa(varargin{1},'continuous_state')
+                        csv=varargin{1};
+                    else
+                        error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+                            inputname(1),class(varargin{1}),'continuous_state');
+                    end
+
+%  create the object from the input
+
+                otherwise
+                    csv.descriptor=varargin{1};
+                    csv.initst    =varargin{2};
+                    if (nargin >= 3)
+                        csv.lower     =varargin{3};
+                        if (nargin >= 4)
+                            csv.upper     =varargin{4};
+                            if (nargin > 4)
+                                warning('continuous_state:extra_arg',...
+                                    'Extra arguments for object of class ''%s''.',...
+                                    class(csv));
+                            end
+                        end
+                    end
+            end
+
+        end
+        function [desc]  =dvar_desc(csv)
+            desc=cell(size(csv));
+            for i=1:numel(csv)
+                desc(i)=cellstr(csv(i).descriptor);
+            end
+            desc=allempty(desc);
+        end
+        function [initpt]=dvar_initpt(csv)
+            initpt=[];
+        end
+        function [lower] =dvar_lower(csv)
+            lower=zeros(size(csv));
+            for i=1:numel(csv)
+                lower(i)=csv(i).lower;
+            end
+            lower=allnan(lower);
+        end
+        function [upper] =dvar_upper(csv)
+            upper=zeros(size(csv));
+            for i=1:numel(csv)
+                upper(i)=csv(i).upper;
+            end
+            upper=allnan(upper);
+        end
+        function [mean]  =dvar_mean(csv)
+            mean=[];
+        end
+        function [stddev]=dvar_stddev(csv)
+            stddev=[];
+        end
+        function [initst]=dvar_initst(csv)
+            initst=zeros(size(csv));
+            for i=1:numel(csv)
+                initst(i)=csv(i).initst;
+            end
+        end
+    end
+end
Index: /issm/trunk/src/m/classes/@continuous_state/display.m
===================================================================
--- /issm/trunk/src/m/classes/@continuous_state/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@continuous_state/display.m	(revision 1)
@@ -0,0 +1,26 @@
+%
+%  display for the continuous_state class.
+%
+%  []=display(csv)
+%
+function []=display(csv)
+
+if ~isa(csv,'continuous_state')
+    error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+        inputname(1),class(csv),'continuous_state');
+end
+
+%  display the object
+
+disp(sprintf('\n'));
+for i=1:numel(csv)
+    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+        class(csv),inputname(1),string_dim(csv,i)));
+    disp(sprintf('    descriptor: ''%s'''  ,csv(i).descriptor));
+    disp(sprintf('        initst: %g'      ,csv(i).initst));
+    disp(sprintf('         lower: %g'      ,csv(i).lower));
+    disp(sprintf('         upper: %g\n'    ,csv(i).upper));
+end
+
+end
+
Index: /issm/trunk/src/m/classes/@elemmatrix/AddElemMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@elemmatrix/AddElemMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemmatrix/AddElemMatrix.m	(revision 1)
@@ -0,0 +1,19 @@
+function Kgg=AddElemMatrix(Ke,Kgg)
+%ADDELEMMATRIX - adds a particular stiffness matrix to the global system matrix of the model
+%
+%   Usage:
+%      Kgg=AddElemMatrix(Ke,Kgg)
+
+%Non optimized code
+if Ke.nrows~=0,
+	for i=1:Ke.nrows,
+		for j=1:Ke.nrows,
+			Kgg(Ke.row_indices(i),Ke.row_indices(j))=Kgg(Ke.row_indices(i),Ke.row_indices(j))+Ke.terms(i,j);
+		end
+	end
+end
+
+%Optimized code: 
+%if Ke.nrows~=0,
+%	Kgg(Ke.row_indices(1:Ke.nrows),Ke.row_indices(1:Ke.nrows))=Kgg(Ke.row_indices(1:Ke.nrows),Ke.row_indices(1:Ke.nrows))+Ke.terms(1:Ke.nrows,1:Ke.nrows);
+%end
Index: /issm/trunk/src/m/classes/@elemmatrix/display.m
===================================================================
--- /issm/trunk/src/m/classes/@elemmatrix/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemmatrix/display.m	(revision 1)
@@ -0,0 +1,20 @@
+function display(elemmatrix)
+%DISPLAY - displays the fields of an elemmatrix 
+%
+%   echo function for 'elemmatrix' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+
+if ~isnan(elemmatrix.nrows),
+	for i=1:elemmatrix.nrows,
+
+		disp(sprintf('   row: %i',i));
+		disp(sprintf('   local_row_index local_col_index global_row_index global_col_index     value\n'));
+
+		for j=1:elemmatrix.nrows,
+			disp(sprintf('   %8i %16i %16i %16i %16g\n', i, j, elemmatrix.row_indices(i),elemmatrix.row_indices(j),elemmatrix.terms(i,j)));
+		end
+	end
+else
+	disp('elemmatrix object is empty');
+end
Index: /issm/trunk/src/m/classes/@elemmatrix/elemmatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@elemmatrix/elemmatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemmatrix/elemmatrix.m	(revision 1)
@@ -0,0 +1,36 @@
+function elemmatrix = elemmatrix(varargin)
+%ELEMMATRIX - constructor for elemmatrix object
+%
+%   Usage:
+%      elemmatrix = elemmatrix(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	elemmatrix.nrows=NaN;
+	elemmatrix.row_indices=NaN;
+	elemmatrix.terms=NaN;
+	
+	elemmatrix=class(elemmatrix,'elemmatrix');
+case 1
+	%If single argument we have a copy constructor. 
+	argument = varargin{1};
+	if isa(argument,'elemmatrix'),
+		elemmatrix=argument;
+	else 
+		if isnumeric(varargin{1}),
+			numdof=argument;
+			elemmatrix.nrows=numdof;
+			elemmatrix.row_indices=zeros(numdof,1);
+			elemmatrix.terms=zeros(numdof,numdof);
+
+			elemmatrix=class(elemmatrix,'elemmatrix');
+		elseif isstruct(argument),
+			elemmatrix=class(argument,'elemmatrix');
+		else
+			error('elemmmatrix constructor error message: invalid input argument');
+		end
+	end
+otherwise
+	error('elemmatrix constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@elemmatrix/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@elemmatrix/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemmatrix/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function elemmatrix = subsasgn(elemmatrix,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      elemmatrix = subsasgn(elemmatrix,index,val)
+%
+%   See also SUBSREF
+
+elemmatrix=builtin('subsasgn',elemmatrix,index,val);
Index: /issm/trunk/src/m/classes/@elemmatrix/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@elemmatrix/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemmatrix/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function elemmatrix = subsref(elemmatrix,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      elemmatrix = subsref(elemmatrix,index) 
+% 
+%   See also SUBSASGN
+
+elemmatrix=builtin('subsref',elemmatrix,index);
Index: /issm/trunk/src/m/classes/@elemvector/AddElemVector.m
===================================================================
--- /issm/trunk/src/m/classes/@elemvector/AddElemVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemvector/AddElemVector.m	(revision 1)
@@ -0,0 +1,11 @@
+function pg=AddElemVector(pe,pg);
+%ADDELEMVECTOR - adds a particular load vector to the global system vector of the model
+%
+%   Usage:
+%      pg=AddElemVector(pe,pg)
+
+if pe.nrows~=0,
+	for i=1:pe.nrows,
+		pg(pe.row_indices(i))= pg(pe.row_indices(i))+pe.terms(i);
+	end
+end
Index: /issm/trunk/src/m/classes/@elemvector/display.m
===================================================================
--- /issm/trunk/src/m/classes/@elemvector/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemvector/display.m	(revision 1)
@@ -0,0 +1,16 @@
+function display(elemvector)
+%DISPLAY - displays the fields of an elemvector
+%
+%   echo function for 'elemvector' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+
+if ~isnan(elemvector.nrows),
+	for i=1:elemvector.nrows,
+		disp(sprintf('   row:%i\n', i));
+		disp(sprintf('   local_row_index     global_row_index     value\n'));
+		disp(sprintf('   %8i %16i %16g\n', i, elemvector.row_indices(i),elemvector.terms(i)));
+	end
+else
+	disp('elemvector is empty');
+end
Index: /issm/trunk/src/m/classes/@elemvector/elemvector.m
===================================================================
--- /issm/trunk/src/m/classes/@elemvector/elemvector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemvector/elemvector.m	(revision 1)
@@ -0,0 +1,35 @@
+function elemvector = elemvector(varargin)
+%ELEMVECVTOR - constructor for elemenvector object
+%
+%   Usage:
+%      elemvector = elemvector(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	elemvector.nrows=NaN;
+	elemvector.row_indices=NaN;
+	elemvector.terms=NaN;
+	elemvector=class(elemvector,'elemvector');
+				
+case 1
+	argument=varargin{1};
+
+	if isa(argument,'elemvector'),
+		elemvector=argument;
+	else
+		if isnumeric(argument),
+			numdof=argument;
+			elemvector.nrows=numdof;
+			elemvector.row_indices=zeros(numdof,1);
+			elemvector.terms=zeros(numdof,1);
+			elemvector=class(elemvector,'elemvector');
+		elseif isstruct(argument),
+			elemvector=class(argument,'elemvector');
+		else
+			error('elemvector constructor error message: input argument not yet supported.');
+		end
+	end
+otherwise
+	error('elemvector constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@elemvector/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@elemvector/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemvector/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function elemvector = subsasgn(elemvector,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      elemvector = subsasgn(elemvector,index,val)
+%
+%   See also SUBSREF
+
+elemvector=builtin('subsasgn',elemvector,index,val);
Index: /issm/trunk/src/m/classes/@elemvector/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@elemvector/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@elemvector/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function elemvector = subsref(elemvector,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      elemvector = subsref(elemvector,index)
+% 
+%   See also SUBSASGN
+
+elemvector=builtin('subsref',elemvector,index);
Index: /issm/trunk/src/m/classes/@globalmatrix/AddElemMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@globalmatrix/AddElemMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalmatrix/AddElemMatrix.m	(revision 1)
@@ -0,0 +1,7 @@
+function Kgg=AddElemMatrix(Ke,Kgg)
+%ADDELEMMATRIX - returns the global stiffness matrix
+%
+%   Usage:
+%      Kgg=AddElemMatrix(Ke,Kgg)
+
+Kgg=Ke.matrix;
Index: /issm/trunk/src/m/classes/@globalmatrix/display.m
===================================================================
--- /issm/trunk/src/m/classes/@globalmatrix/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalmatrix/display.m	(revision 1)
@@ -0,0 +1,12 @@
+function display(globalmatrix)
+%DISPLAY - displays the fields of a globalmatrix
+%
+%   echo function for 'globalmatrix' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+
+if ~isnan(globalmatrix.nrows),
+	globalmatrix.matrix
+else
+	disp('globalmatrix object is empty');
+end
Index: /issm/trunk/src/m/classes/@globalmatrix/globalmatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@globalmatrix/globalmatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalmatrix/globalmatrix.m	(revision 1)
@@ -0,0 +1,34 @@
+function globalmatrix = globalmatrix(varargin)
+%GLOBALMATRIX - constructor for globalmatrix object
+%
+%   Usage:
+%      globalmatrix = globalmatrix(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	globalmatrix.nrows=NaN;
+	globalmatrix.matrix=NaN;
+	
+	globalmatrix=class(globalmatrix,'globalmatrix');
+case 1
+	%If single argument we have a copy constructor. 
+	argument = varargin{1};
+	if isa(argument,'globalmatrix'),
+		globalmatrix=argument;
+	else 
+		if isnumeric(varargin{1}),
+			numdof=argument;
+			globalmatrix.nrows=numdof;
+			globalmatrix.matrix=sparse(numdof,numdof,0);
+
+			globalmatrix=class(globalmatrix,'globalmatrix');
+		elseif isstruct(argument),
+			globalmatrix=class(argument,'globalmatrix');
+		else
+			error('elemmmatrix constructor error message: invalid input argument');
+		end
+	end
+otherwise
+	error('globalmatrix constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@globalmatrix/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@globalmatrix/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalmatrix/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function globalmatrix = subsasgn(globalmatrix,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      globalmatrix = subsasgn(globalmatrix,index,val)
+%
+%   See also SUBSREF
+
+globalmatrix=builtin('subsasgn',globalmatrix,index,val);
Index: /issm/trunk/src/m/classes/@globalmatrix/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@globalmatrix/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalmatrix/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function globalmatrix = subsref(globalmatrix,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      globalmatrix = subsref(globalmatrix,index)
+% 
+%   See also SUBSASGN
+
+globalmatrix=builtin('subsref',globalmatrix,index);
Index: /issm/trunk/src/m/classes/@globalvector/AddElemVector.m
===================================================================
--- /issm/trunk/src/m/classes/@globalvector/AddElemVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalvector/AddElemVector.m	(revision 1)
@@ -0,0 +1,7 @@
+function pg=AddElemVector(pe,pg);
+%ADDELEMMATRIX - returns the global load vector
+%
+%   Usage:
+%      pg=AddElemVector(pe,pg)
+
+pg=pe.vector;
Index: /issm/trunk/src/m/classes/@globalvector/display.m
===================================================================
--- /issm/trunk/src/m/classes/@globalvector/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalvector/display.m	(revision 1)
@@ -0,0 +1,12 @@
+function display(globalvector)
+%DISPLAY - displays the fields of a globalvector
+%
+%   echo function for 'globalvector' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+
+if ~isnan(globalvector.nrows),
+	globalvector.vector
+else
+	disp('globalvector object is empty');
+end
Index: /issm/trunk/src/m/classes/@globalvector/globalvector.m
===================================================================
--- /issm/trunk/src/m/classes/@globalvector/globalvector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalvector/globalvector.m	(revision 1)
@@ -0,0 +1,30 @@
+function globalvector = globalvector(varargin)
+% globalvector: constructor for globalvector object
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	globalvector.nrows=NaN;
+	globalvector.vector=NaN;
+	
+	globalvector=class(globalvector,'globalvector');
+case 1
+	%If single argument we have a copy constructor. 
+	argument = varargin{1};
+	if isa(argument,'globalvector'),
+		globalvector=argument;
+	else 
+		if isnumeric(varargin{1}),
+			numdof=argument;
+			globalvector.nrows=numdof;
+			globalvector.vector=sparse(numdof,1,0);
+
+			globalvector=class(globalvector,'globalvector');
+		elseif isstruct(argument),
+			globalvector=class(argument,'globalvector');
+		else
+			error('elemmmatrix constructor error message: invalid input argument');
+		end
+	end
+otherwise
+	error('globalvector constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@globalvector/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@globalvector/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalvector/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function globalvector = subsasgn(globalvector,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      globalvector = subsasgn(globalvector,index,val)
+%
+%   See also SUBSREF
+
+globalvector=builtin('subsasgn',globalvector,index,val);
Index: /issm/trunk/src/m/classes/@globalvector/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@globalvector/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@globalvector/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function globalvector = subsref(globalvector,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      globalvector = subsref(globalvector,index)
+% 
+%   See also SUBSASGN
+
+globalvector=builtin('subsref',globalvector,index);
Index: /issm/trunk/src/m/classes/@icefront/CreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@icefront/CreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@icefront/CreatePVector.m	(revision 1)
@@ -0,0 +1,824 @@
+function pe=CreatePVector(load,elements,grids,materials,inputs,analysis_type);
+%CREATEPVECTOR - create the load vector for an icefront
+%
+%   works for the icefront elements, segments or quad elements
+%   this routine can be used for MacAyeal, Pattyn ans Stokes's models
+%
+%   Usage:
+%      pe=CreatePVector(load,elements,grids,materials,inputs,analysis_type)
+% 
+%   See also PENALTYCREATEPVECTOR, PENALTYCREATEKMATRIX
+
+if strcmpi(analysis_type,'diagnostic_horiz'),
+
+	pe=CreatePVectorHoriz(load,elements,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'diagnostic_stokes'),
+
+	pe=CreatePVectorStokes(load,elements,grids,materials,inputs);
+
+else
+	error('CreatePVector error message: only horizontal diagnostic should use icefront objects');
+
+end
+end %end function
+
+function pe=CreatePVectorStokes(load,elements,grids,materials,inputs);
+
+%some variables
+numgrids=4;
+NDOF4=4;
+
+numgridstria=4; %number of grids for the triangles
+NDOF4=4;
+
+
+%Create elementary vector.
+pe=elemvector(numgrids*NDOF4);
+
+%recover element object
+pentaelem=elements(load.eid).element;
+matpar=materials(end).constants;
+
+%recover material parameters
+gravity=matpar.g;
+rho_ice=matpar.rho_ice;
+rho_water=matpar.rho_water;
+
+%recover extra inputs
+[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+[bed_param bed_is_present]=recover_input(inputs,'bed');
+
+%initialize extra inputs
+thickness_list=zeros(6,1);
+bed_list=zeros(6,1);
+
+%Get all element grid data:
+xyz_list=getgriddata(pentaelem,grids);
+
+%Identify which grids are comprised in the segment: 
+for i=1:6,
+	if pentaelem.g(i)==load.g(1),
+		grid1=i;
+	end
+	if pentaelem.g(i)==load.g(2),
+		grid2=i;
+	end
+	if pentaelem.g(i)==load.g(3),
+		grid3=i;
+	end
+	if pentaelem.g(i)==load.g(4),
+		grid4=i;
+	end
+end
+quad_grids=[grid1 grid2 grid3 grid4];
+
+%Build row indices for elementary vector.
+for i=1:numgrids,
+	doflist=grids(load.g(i)).grid.doflist;
+	for j=1:NDOF4,
+		pe.row_indices((i-1)*NDOF4+j)=doflist(j);
+	end
+	dof=doflist(1);
+end
+
+for i=1:6,
+	doflist=grids(pentaelem.g(i)).grid.doflist; dof=doflist(1);
+	if(thickness_is_present) thickness_list(i)=thickness_param(dof);end;
+	if(bed_is_present) bed_list(i)=bed_param(dof);end;
+end
+
+
+%Recover thicknesses and bed at all grids
+if thickness_is_present,
+	thickness=thickness_list(quad_grids);
+	bed=bed_list(quad_grids);
+else
+	thickness=pentaelem.h(quad_grids);
+	bed=pentaelem.b(quad_grids);
+end
+
+%build xyz list for [grid1, grid2,grid3,grid3]
+xyz_list_quad=xyz_list(quad_grids,:);
+
+%Create a new grid in the midle of the quad and add it at the end of the list
+x5=mean(xyz_list_quad(:,1));
+y5=mean(xyz_list_quad(:,2));
+z5=mean(xyz_list_quad(:,3));
+
+xyz_list_quad=[xyz_list_quad; x5 y5 z5];
+
+%Compute four normals (the quad is divided into four triangles)
+V1=cross(xyz_list_quad(1,:)-xyz_list_quad(5,:),xyz_list_quad(2,:)-xyz_list_quad(5,:));
+normal1=1/norm(V1)*V1';
+
+V2=cross(xyz_list_quad(2,:)-xyz_list_quad(5,:),xyz_list_quad(3,:)-xyz_list_quad(5,:));
+normal2=1/norm(V2)*V2';
+
+V3=cross(xyz_list_quad(3,:)-xyz_list_quad(5,:),xyz_list_quad(4,:)-xyz_list_quad(5,:));
+normal3=1/norm(V3)*V3';
+
+V4=cross(xyz_list_quad(4,:)-xyz_list_quad(5,:),xyz_list_quad(1,:)-xyz_list_quad(5,:));
+normal4=1/norm(V4)*V4';
+
+%Create a matrix with the four normals
+normal=[normal1 normal2 normal3 normal4];
+
+%Compute load contribution for this segment:
+if pentaelem.shelf==1,
+	%icefront ends in the water
+	pe.terms=QuadPressureLoadStokes(rho_water,rho_ice,gravity,thickness,bed,normal,xyz_list_quad,1);
+else
+	%icefront ends in the air
+	pe.terms=QuadPressureLoadStokes(rho_water,rho_ice,gravity,thickness,bed,normal,xyz_list_quad,0);
+end
+
+end %End of function
+
+function pe=QuadPressureLoadStokes(rho_water,rho_ice,gravity,thickness,bed,normal,xyz_list_quad,fill);
+
+%The quad is divided into four triangles tria1 tria2 tria3 and tria4 as follows
+%
+%   grid 4 +-----------------+ grid 3
+%          |\2            1 /|
+%          |1\    tria3    /2|
+%          |  \           /  |
+%          |   \         /   |
+%          |    \       /    |
+%          |     \     /     |
+%          |      \ 3 /      |
+%          |tria4  \ / 3     |
+%          |      3 \grid5   |
+%          |       / \       | 
+%          |      / 3 \ tria2|
+%          |     /     \     |
+%          |    /       \    |
+%          |   /         \   |
+%          |  /   tria1   \  |
+%          |2/1           2\1|
+%   grid1  +-----------------+ grid 2
+%
+%
+
+%Build the four normal vectors 
+nx=normal(1,:);
+ny=normal(2,:);
+nz=normal(3,:);
+
+% Get gaussian points and weights. order 2 since we have a product of 2 nodal functions (We use GaussTria since we will build two triangles)
+[num_gauss,first_gauss_area,second_gauss_area,third_gauss_area,gauss_weights]=GaussTria(2);
+
+%Recover the surface of the four nodes
+s=thickness+bed;
+
+%Add surface sor the fifth point (average of the surfaces)
+s(5)=mean(s);
+
+%Recover grid coordinates
+x=xyz_list_quad(:,1);
+y=xyz_list_quad(:,2);
+z=xyz_list_quad(:,3);
+
+%Build triangles in a 2D plan before using reference elements
+
+%Create four triangle elements for each quad
+tria=triaelem;
+
+l12=(x(2)-x(1))^2+(y(2)-y(1))^2+(z(2)-z(1))^2;
+l14=(x(4)-x(1))^2+(y(4)-y(1))^2+(z(4)-z(1))^2;
+l15=(x(5)-x(1))^2+(y(5)-y(1))^2+(z(5)-z(1))^2;
+l23=(x(3)-x(2))^2+(y(3)-y(2))^2+(z(3)-z(2))^2;
+l25=(x(5)-x(2))^2+(y(5)-y(2))^2+(z(5)-z(2))^2;
+l34=(x(4)-x(3))^2+(y(4)-y(3))^2+(z(4)-z(3))^2;
+l35=(x(5)-x(3))^2+(y(5)-y(3))^2+(z(5)-z(3))^2;
+l45=(x(5)-x(4))^2+(y(5)-y(4))^2+(z(5)-z(4))^2;
+cos_theta_triangle1=(l15+l12-l25)/(2*sqrt(l12*l15));
+cos_theta_triangle2=(l25+l23-l35)/(2*sqrt(l23*l25));
+cos_theta_triangle3=(l35+l34-l45)/(2*sqrt(l34*l35));
+cos_theta_triangle4=(l45+l14-l15)/(2*sqrt(l14*l45));
+
+%First triangle : nodes 1, 2 and 5
+x1tria1=0;
+y1tria1=0;
+x2tria1=sqrt(l12);
+y2tria1=0;
+x3tria1=cos_theta_triangle1*sqrt(l15);
+y3tria1=sqrt(1-cos_theta_triangle1^2)*sqrt(l15);
+
+xyz_tria1=[x1tria1 y1tria1; x2tria1 y2tria1; x3tria1 y3tria1];
+
+%Second triangle : nodes 2, 3 and 5
+x1tria2=0;
+y1tria2=0;
+x2tria2=sqrt(l23);
+y2tria2=0;
+x3tria2=cos_theta_triangle2*sqrt(l25);
+y3tria2=sqrt(1-cos_theta_triangle2^2)*sqrt(l25);
+
+xyz_tria2=[x1tria2 y1tria2; x2tria2 y2tria2; x3tria2 y3tria2];
+
+%Third triangle : nodes 3, 4 and 5
+x1tria3=0;
+y1tria3=0;
+x2tria3=sqrt(l34);
+y2tria3=0;
+x3tria3=cos_theta_triangle3*sqrt(l35);
+y3tria3=sqrt(1-cos_theta_triangle3^2)*sqrt(l35);
+
+xyz_tria3=[x1tria3 y1tria3; x2tria3 y2tria3; x3tria3 y3tria3];
+
+%Fourth triangle : nodes 4, 1 and 5
+x1tria4=0;
+y1tria4=0;
+x2tria4=sqrt(l14);
+y2tria4=0;
+x3tria4=cos_theta_triangle4*sqrt(l45);
+y3tria4=sqrt(1-cos_theta_triangle4^2)*sqrt(l45);
+
+xyz_tria4=[x1tria4 y1tria4; x2tria4 y2tria4; x3tria4 y3tria4];
+
+%Create a list xyz_tria with coordinates of every triangle
+
+xyz_tria=[xyz_tria1; xyz_tria2; xyz_tria3; xyz_tria4];
+
+%Initialize load vector
+pe=zeros(16,1);
+
+%Start  looping on the triangle's gaussian points: 
+for ig=1:num_gauss,
+	
+	 %Get the value of nodal functions for each gauss point (nodal functions of the triangle to calculate z_g)
+	 gauss_coord=[first_gauss_area(ig) second_gauss_area(ig) third_gauss_area(ig)];
+	 l1l2l3_tria=GetNodalFunctions(tria,gauss_coord);
+	 
+	 %Get the coordinates of gauss point for each triangle in penta/quad
+	 r_tria=gauss_coord(2)-gauss_coord(1);
+	 s_tria=-3/sqrt(3)*(gauss_coord(1)+gauss_coord(2)-2/3);
+ 
+	 %Coordinates of gauss points in the reference triangle
+	 r_quad(1,1)=r_tria;
+	 s_quad(1,1)=1/sqrt(3)*s_tria-2/3;
+	 r_quad(2,1)=-1/sqrt(3)*s_tria+2/3;
+	 s_quad(2,1)=r_tria;
+	 r_quad(3,1)=-r_tria;
+	 s_quad(3,1)=-1/sqrt(3)*s_tria+2/3;
+	 r_quad(4,1)=1/sqrt(3)*s_tria-2/3;
+	 s_quad(4,1)=-r_tria;
+
+	 %Get the nodal function of the quad for the gauss points of each triangle
+	 l1l4_tria=1/4*[(r_quad-1).*(s_quad-1) -(r_quad+1).*(s_quad-1) (r_quad+1).*(s_quad+1) -(r_quad-1).*(s_quad+1)];
+
+	 %Compute jacobian of each triangle
+	 for i=1:4
+	complete_list=zeros(3,3); %a third coordinate is needed for the jacobian determinant calculation, here it is zero
+	complete_list(1:3,1:2)=xyz_tria(3*i-2:3*i,:);
+	J(i)=GetJacobianDeterminant(tria,complete_list,l1l2l3_tria);
+	 end
+
+	 %Calculation of the z coordinate for the gaussian point ig for each triangle
+	 z_g(1)=z(1)*l1l2l3_tria(1)+z(2)*l1l2l3_tria(2)+z(5)*l1l2l3_tria(3);
+	 z_g(2)=z(2)*l1l2l3_tria(1)+z(3)*l1l2l3_tria(2)+z(5)*l1l2l3_tria(3);
+	 z_g(3)=z(3)*l1l2l3_tria(1)+z(4)*l1l2l3_tria(2)+z(5)*l1l2l3_tria(3);
+	 z_g(4)=z(4)*l1l2l3_tria(1)+z(1)*l1l2l3_tria(2)+z(5)*l1l2l3_tria(3);
+
+	 %Loop on the triangles
+	 for i=1:4
+
+	%Loop on the grids of the quad
+	air_pressure_tria=0;
+
+	%Now deal with water pressure
+	if fill==1, %icefront ends in water
+		water_level_above_g_tria=min(0,z_g(i));              % 0 if the gaussian point is above water level
+		water_pressure_tria=rho_water*gravity*water_level_above_g_tria;
+	elseif fill==0,
+		water_pressure_tria=0;
+	else
+		error('QuadPressureLoad error message: unknow fill type for icefront boundary condition');
+	end
+
+	%Add pressure from triangle i
+	%Loop on the grids of the quad
+	for j=1:4
+		pressure_tria(j) = water_pressure_tria + air_pressure_tria;
+	end
+
+	pe=pe+J(i)*gauss_weights(ig)*...
+	[ pressure_tria(1)*l1l4_tria(i,1)*nx(i)
+	  pressure_tria(1)*l1l4_tria(i,1)*ny(i)
+	  pressure_tria(1)*l1l4_tria(i,1)*nz(i)
+	  0
+	  pressure_tria(2)*l1l4_tria(i,2)*nx(i)
+	  pressure_tria(2)*l1l4_tria(i,2)*ny(i)
+	  pressure_tria(2)*l1l4_tria(i,2)*nz(i)
+	  0
+	  pressure_tria(3)*l1l4_tria(i,3)*nx(i)
+	  pressure_tria(3)*l1l4_tria(i,3)*ny(i)
+	  pressure_tria(3)*l1l4_tria(i,3)*nz(i)
+	  0
+	  pressure_tria(4)*l1l4_tria(i,4)*nx(i)
+	  pressure_tria(4)*l1l4_tria(i,4)*ny(i)
+	  pressure_tria(4)*l1l4_tria(i,4)*nz(i)
+	  0 ];
+
+   end
+
+end
+
+end %End of function
+
+function pe=CreatePVectorHoriz(load,elements,grids,materials,inputs);
+
+	global element_debug  element_debugid
+
+
+	if strcmpi(load.type,'segment'),
+		%check that the element is onbed (collapsed formulation) otherwise:pe=0
+		if strcmpi(elements(load.eid).element.type,'pentaelem'),
+			if  ~elements(load.eid).element.onbed
+				pe=elemvector(0);
+				return;
+			end
+		end
+
+		%some variables
+		numgrids=2;
+		NDOF2=2;
+
+		%Create elementary vector.
+		pe=elemvector(numgrids*NDOF2);
+
+		%recover element object
+		triaelem=elements(load.eid).element;
+		matpar=materials(end).constants;
+
+		if (element_debug & triaelem.id==element_debugid),
+			disp(sprintf('%s%i','Inside icefront load  connected to element ',triaelem.id));
+		end
+
+		%recover material parameters
+		gravity=matpar.g;
+		rho_ice=matpar.rho_ice;
+		rho_water=matpar.rho_water;
+		
+		%recover extra inputs
+		[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+		[bed_param bed_is_present]=recover_input(inputs,'bed');
+			
+		%Get all element grid data:
+		xyz_list=getgriddata(triaelem,grids);
+
+		%initialize extra inputs
+		thickness_list=zeros(3,1);
+		bed_list=zeros(3,1);
+
+		%Identify which grids are comprised in the segment: 
+		for i=1:3,
+			if triaelem.g(i)==load.g(1),
+				grid1=i;
+			end
+			if triaelem.g(i)==load.g(2),
+				grid2=i;
+			end
+		end
+
+		%Build row indices for elementary vector.
+		for i=1:numgrids,
+			doflist=grids(load.g(i)).grid.doflist;
+			for j=1:NDOF2,
+				pe.row_indices((i-1)*NDOF2+j)=doflist(j);
+			end
+		end
+		
+		for i=1:3,
+			doflist=grids(triaelem.g(i)).grid.doflist; dof=doflist(1);
+			if(thickness_is_present),
+				thickness_list(i)=thickness_param(dof);
+			else
+				thickness_list(i)=triaelem.h(i);
+			end
+			if(bed_is_present),
+				bed_list(i)=bed_param(dof);
+			else
+				bed_list(i)=triaelem.b(i);
+			end;
+		end
+
+		%Recover thicknesses and bed at grid1 and grid2: 
+		if thickness_is_present,
+			thickness=[thickness_list(grid1) thickness_list(grid2)];
+			bed=[bed_list(grid1) bed_list(grid2)];
+		else
+			thickness=[triaelem.h(grid1) triaelem.h(grid2)];
+			bed=[triaelem.b(grid1) triaelem.b(grid2)];
+		end
+
+		%Recover grid coordinates
+		x1=xyz_list(grid1,1);
+		y1=xyz_list(grid1,2);
+		x2=xyz_list(grid2,1);
+		y2=xyz_list(grid2,2);
+
+		%Compute length and normal of segment
+		normal=zeros(2,1);
+		normal(1)=cos(atan2(x1-x2,y2-y1));
+		normal(2)=sin(atan2(x1-x2,y2-y1));
+		length=sqrt((x2-x1)^2+(y2-y1)^2);
+
+		%Compute load contribution for this segment:
+		if triaelem.shelf==1,
+			%icefront ends in the water
+			fill=1;
+		else
+			%icefront ends in the air
+			fill=0;
+		end
+		pe.terms=SegmentPressureLoad(rho_water,rho_ice,gravity,thickness,bed,normal,length,fill);
+		
+		if (element_debug & triaelem.id==element_debugid),
+
+			disp(sprintf('\nicefront load'));
+			disp(sprintf('grids %i %i',grid1,grid2));
+			disp(sprintf('rho_water %g',rho_water));
+			disp(sprintf('rho_ice %g',rho_ice));
+			disp(sprintf('gravity %g',gravity));
+			disp(sprintf('thickness (%g,%g)',thickness(1),thickness(2)));
+			disp(sprintf('bed (%g,%g)',bed(1),bed(2)));
+			disp(sprintf('normal (%g,%g)',normal(1),normal(2)));
+			disp(sprintf('length %g',length));
+			disp(sprintf('fill %i',fill));
+			
+			disp(sprintf('      pe_g->terms\n'));
+			pe.terms
+		end
+
+	elseif strcmpi(load.type,'quad'),
+
+		%some variables
+		numgrids=4;
+		NDOF2=2;
+
+		numgridstria=4; %number of grids for the triangles
+		NDOF2=2;
+
+
+		%Create elementary vector.
+		pe=elemvector(numgrids*NDOF2);
+
+		%recover element object
+		pentaelem=elements(load.eid).element;
+		matpar=materials(end).constants;
+
+		%recover material parameters
+		gravity=matpar.g;
+		rho_ice=matpar.rho_ice;
+		rho_water=matpar.rho_water;
+		
+		%recover extra inputs
+		[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+		[bed_param bed_is_present]=recover_input(inputs,'bed');
+
+		%initialize extra inputs
+		thickness_list=zeros(6,1);
+		bed_list=zeros(6,1);
+
+		%Get all element grid data:
+		xyz_list=getgriddata(pentaelem,grids);
+
+		%Identify which grids are comprised in the segment: 
+		for i=1:6,
+			if pentaelem.g(i)==load.g(1),
+				grid1=i;
+			end
+			if pentaelem.g(i)==load.g(2),
+				grid2=i;
+			end
+			if pentaelem.g(i)==load.g(3),
+				grid3=i;
+			end
+			if pentaelem.g(i)==load.g(4),
+				grid4=i;
+			end
+		end
+		quad_grids=[grid1 grid2 grid3 grid4];
+
+		%Build row indices for elementary vector.
+		for i=1:numgrids,
+			doflist=grids(load.g(i)).grid.doflist;
+			for j=1:NDOF2,
+				pe.row_indices((i-1)*NDOF2+j)=doflist(j);
+			end
+			dof=doflist(1);
+		end
+
+		for i=1:6,
+			doflist=grids(pentaelem.g(i)).grid.doflist; dof=doflist(1);
+			if(thickness_is_present) thickness_list(i)=thickness_param(dof);end;
+			if(bed_is_present) bed_list(i)=bed_param(dof);end;
+		end
+
+
+		%Recover thicknesses and bed at all grids
+		if thickness_is_present,
+			thickness=thickness_list(quad_grids);
+			bed=bed_list(quad_grids);
+		else
+			thickness=pentaelem.h(quad_grids);
+			bed=pentaelem.b(quad_grids);
+		end
+
+		%build xyz list for [grid1, grid2,grid3,grid3]
+		xyz_list_quad=xyz_list(quad_grids,:);
+
+		%Create a new grid in the midle of the quad and add it at the end of the list
+		x5=mean(xyz_list_quad(:,1));
+		y5=mean(xyz_list_quad(:,2));
+		z5=mean(xyz_list_quad(:,3));
+
+		xyz_list_quad=[xyz_list_quad; x5 y5 z5];
+
+		%Compute four normals (the quad is divided into four triangles)
+		V1=cross(xyz_list_quad(1,:)-xyz_list_quad(5,:),xyz_list_quad(2,:)-xyz_list_quad(5,:));
+		normal1=1/norm(V1)*V1';
+		
+		V2=cross(xyz_list_quad(2,:)-xyz_list_quad(5,:),xyz_list_quad(3,:)-xyz_list_quad(5,:));
+		normal2=1/norm(V2)*V2';
+
+		V3=cross(xyz_list_quad(3,:)-xyz_list_quad(5,:),xyz_list_quad(4,:)-xyz_list_quad(5,:));
+		normal3=1/norm(V3)*V3';
+		
+		V4=cross(xyz_list_quad(4,:)-xyz_list_quad(5,:),xyz_list_quad(1,:)-xyz_list_quad(5,:));
+		normal4=1/norm(V4)*V4';
+
+		%Create a matrix with the four normals
+		normal=[normal1 normal2 normal3 normal4];
+
+		%Compute load contribution for this segment:
+		if pentaelem.shelf==1,
+			%icefront ends in the water
+			pe.terms=QuadPressureLoad(rho_water,rho_ice,gravity,thickness,bed,normal,xyz_list_quad,1);
+		else
+			%icefront ends in the air
+			pe.terms=QuadPressureLoad(rho_water,rho_ice,gravity,thickness,bed,normal,xyz_list_quad,0);
+		end
+
+		if (element_debug & pentaelem.id==element_debugid),
+			disp(sprintf('      pe_g->terms\n'));
+			pe.terms
+		end
+
+	else
+		error('unsupported element type')
+	end
+	
+	end %End of function
+
+	function pe=QuadPressureLoad(rho_water,rho_ice,gravity,thickness,bed,normal,xyz_list_quad,fill);
+
+	%The quad is divided into four triangles tria1 tria2 tria3 and tria4 as follows
+	%
+	%   grid 4 +-----------------+ grid 3
+	%          |\2            1 /|
+	%          |1\    tria3    /2|
+	%          |  \           /  |
+	%          |   \         /   |
+	%          |    \       /    |
+	%          |     \     /     |
+	%          |      \ 3 /      |
+	%          |tria4  \ / 3     |
+	%          |      3 \grid5   |
+	%          |       / \       | 
+	%          |      / 3 \ tria2|
+	%          |     /     \     |
+	%          |    /       \    |
+	%          |   /         \   |
+	%          |  /   tria1   \  |
+	%          |2/1           2\1|
+	%   grid1  +-----------------+ grid 2
+	%
+	%
+
+	%Build the four normal vectors 
+	nx=normal(1,:);
+	ny=normal(2,:);
+
+	% Get gaussian points and weights. order 2 since we have a product of 2 nodal functions (We use GaussTria since we will build two triangles)
+	[num_gauss,first_gauss_area,second_gauss_area,third_gauss_area,gauss_weights]=GaussTria(2);
+
+	%Recover the surface of the four nodes
+	s=thickness+bed;
+
+	%Add surface sor the fifth point (average of the surfaces)
+	s(5)=mean(s);
+
+	%Recover grid coordinates
+	x=xyz_list_quad(:,1);
+	y=xyz_list_quad(:,2);
+	z=xyz_list_quad(:,3);
+
+	%Build triangles in a 2D plan before using reference elements
+
+	%Create four triangle elements for each quad
+	tria=triaelem;
+
+	l12=(x(2)-x(1))^2+(y(2)-y(1))^2+(z(2)-z(1))^2;
+	l14=(x(4)-x(1))^2+(y(4)-y(1))^2+(z(4)-z(1))^2;
+	l15=(x(5)-x(1))^2+(y(5)-y(1))^2+(z(5)-z(1))^2;
+	l23=(x(3)-x(2))^2+(y(3)-y(2))^2+(z(3)-z(2))^2;
+	l25=(x(5)-x(2))^2+(y(5)-y(2))^2+(z(5)-z(2))^2;
+	l34=(x(4)-x(3))^2+(y(4)-y(3))^2+(z(4)-z(3))^2;
+	l35=(x(5)-x(3))^2+(y(5)-y(3))^2+(z(5)-z(3))^2;
+	l45=(x(5)-x(4))^2+(y(5)-y(4))^2+(z(5)-z(4))^2;
+	cos_theta_triangle1=(l15+l12-l25)/(2*sqrt(l12*l15));
+	cos_theta_triangle2=(l25+l23-l35)/(2*sqrt(l23*l25));
+	cos_theta_triangle3=(l35+l34-l45)/(2*sqrt(l34*l35));
+	cos_theta_triangle4=(l45+l14-l15)/(2*sqrt(l14*l45));
+
+	%First triangle : nodes 1, 2 and 5
+	x1tria1=0;
+	y1tria1=0;
+	x2tria1=sqrt(l12);
+	y2tria1=0;
+	x3tria1=cos_theta_triangle1*sqrt(l15);
+	y3tria1=sqrt(1-cos_theta_triangle1^2)*sqrt(l15);
+
+	xyz_tria1=[x1tria1 y1tria1; x2tria1 y2tria1; x3tria1 y3tria1];
+
+	%Second triangle : nodes 2, 3 and 5
+	x1tria2=0;
+	y1tria2=0;
+	x2tria2=sqrt(l23);
+	y2tria2=0;
+	x3tria2=cos_theta_triangle2*sqrt(l25);
+	y3tria2=sqrt(1-cos_theta_triangle2^2)*sqrt(l25);
+
+	xyz_tria2=[x1tria2 y1tria2; x2tria2 y2tria2; x3tria2 y3tria2];
+
+	%Third triangle : nodes 3, 4 and 5
+	x1tria3=0;
+	y1tria3=0;
+	x2tria3=sqrt(l34);
+	y2tria3=0;
+	x3tria3=cos_theta_triangle3*sqrt(l35);
+	y3tria3=sqrt(1-cos_theta_triangle3^2)*sqrt(l35);
+
+	xyz_tria3=[x1tria3 y1tria3; x2tria3 y2tria3; x3tria3 y3tria3];
+
+	%Fourth triangle : nodes 4, 1 and 5
+	x1tria4=0;
+	y1tria4=0;
+	x2tria4=sqrt(l14);
+	y2tria4=0;
+	x3tria4=cos_theta_triangle4*sqrt(l45);
+	y3tria4=sqrt(1-cos_theta_triangle4^2)*sqrt(l45);
+
+	xyz_tria4=[x1tria4 y1tria4; x2tria4 y2tria4; x3tria4 y3tria4];
+
+	%Create a list xyz_tria with coordinates of every triangle
+
+	xyz_tria=[xyz_tria1; xyz_tria2; xyz_tria3; xyz_tria4];
+
+	%Initialize load vector
+	pe=zeros(8,1);
+
+	%Start  looping on the triangle's gaussian points: 
+	for ig=1:num_gauss,
+		
+		 %Get the value of nodal functions for each gauss point (nodal functions of the triangle to calculate z_g)
+		 gauss_coord=[first_gauss_area(ig) second_gauss_area(ig) third_gauss_area(ig)];
+		 l1l2l3_tria=GetNodalFunctions(tria,gauss_coord);
+		 
+		 %Get the coordinates of gauss point for each triangle in penta/quad
+		 r_tria=gauss_coord(2)-gauss_coord(1);
+		 s_tria=-3/sqrt(3)*(gauss_coord(1)+gauss_coord(2)-2/3);
+	 
+		 %Coordinates of gauss points in the reference triangle
+		 r_quad(1,1)=r_tria;
+		 s_quad(1,1)=1/sqrt(3)*s_tria-2/3;
+		 r_quad(2,1)=-1/sqrt(3)*s_tria+2/3;
+		 s_quad(2,1)=r_tria;
+		 r_quad(3,1)=-r_tria;
+		 s_quad(3,1)=-1/sqrt(3)*s_tria+2/3;
+		 r_quad(4,1)=1/sqrt(3)*s_tria-2/3;
+		 s_quad(4,1)=-r_tria;
+
+		 %Get the nodal function of the quad for the gauss points of each triangle
+		 l1l4_tria=1/4*[(r_quad-1).*(s_quad-1) -(r_quad+1).*(s_quad-1) (r_quad+1).*(s_quad+1) -(r_quad-1).*(s_quad+1)];
+
+		 %Compute jacobian of each triangle
+		 for i=1:4
+		complete_list=zeros(3,3); %a third coordinate is needed for the jacobian determinant calculation, here it is zero
+		complete_list(1:3,1:2)=xyz_tria(3*i-2:3*i,:);
+		J(i)=GetJacobianDeterminant(tria,complete_list,l1l2l3_tria);
+		 end
+
+		 %Calculation of the z coordinate for the gaussian point ig for each triangle
+		 z_g(1)=z(1)*l1l2l3_tria(1)+z(2)*l1l2l3_tria(2)+z(5)*l1l2l3_tria(3);
+		 z_g(2)=z(2)*l1l2l3_tria(1)+z(3)*l1l2l3_tria(2)+z(5)*l1l2l3_tria(3);
+		 z_g(3)=z(3)*l1l2l3_tria(1)+z(4)*l1l2l3_tria(2)+z(5)*l1l2l3_tria(3);
+		 z_g(4)=z(4)*l1l2l3_tria(1)+z(1)*l1l2l3_tria(2)+z(5)*l1l2l3_tria(3);
+
+		 %Loop on the triangles
+		 for i=1:4
+
+		%Loop on the grids of the quad
+		%Calculate the ice pressure
+		for j=1:4
+			ice_pressure_tria(j)=gravity*rho_ice*(s(j)-z_g(i));
+		end
+		air_pressure_tria=0;
+
+		%Now deal with water pressure
+		if fill==1, %icefront ends in water
+		water_level_above_g_tria=min(0,z_g(i));              % 0 if the gaussian point is above water level
+		water_pressure_tria=rho_water*gravity*water_level_above_g_tria;
+
+		elseif fill==0,
+		water_pressure_tria=0;
+
+		else
+		error('QuadPressureLoad error message: unknow fill type for icefront boundary condition');
+		end
+
+		%Add pressure from triangle i
+		%Loop on the grids of the quad
+		for j=1:4
+			pressure_tria(j) = ice_pressure_tria(j) + water_pressure_tria + air_pressure_tria;
+		end
+
+		pe=pe+J(i)*gauss_weights(ig)*...
+		[ pressure_tria(1)*l1l4_tria(i,1)*nx(i)
+		  pressure_tria(1)*l1l4_tria(i,1)*ny(i)
+		  pressure_tria(2)*l1l4_tria(i,2)*nx(i)
+		  pressure_tria(2)*l1l4_tria(i,2)*ny(i)
+		  pressure_tria(3)*l1l4_tria(i,3)*nx(i)
+		  pressure_tria(3)*l1l4_tria(i,3)*ny(i)
+		  pressure_tria(4)*l1l4_tria(i,4)*nx(i)
+		  pressure_tria(4)*l1l4_tria(i,4)*ny(i)];
+
+	   end
+
+	end
+
+	end
+
+
+
+	function pe=SegmentPressureLoad(rho_water,rho_ice,gravity,thickness,bed,normal,length,fill);
+
+	%Build the normal vector
+	nx=normal(1,1);
+	ny=normal(2,1);
+
+	% Get gaussian points and weights. order 2 since we have a product of 2 nodal functions
+	num_gauss=3;
+	[segment_gauss_coord, gauss_weights]=GaussSegment(num_gauss);
+
+	%Recover the thickness and z_b of the two nodes
+	h1=thickness(1);
+	b1=bed(1);
+	h2=thickness(2);
+	b2=bed(2);
+
+	%Compute jacobian of segment
+	Jdet=1/2*length;
+
+	%Initialize load vector
+	pe=zeros(4,1);
+
+	%Start  looping on segments's gaussian points: 
+	for ig=1:num_gauss,
+
+		thickness=h1*(1+segment_gauss_coord(ig))/2+h2*(1-segment_gauss_coord(ig))/2;
+		bed=b1*(1+segment_gauss_coord(ig))/2+b2*(1-segment_gauss_coord(ig))/2;
+		
+		if fill==1, %icefront ends in water
+			ice_pressure=1.0/2.0*gravity*rho_ice*thickness^2;
+			air_pressure=0;
+
+			%Now deal with water pressure
+			surface_under_water=min(0,thickness+bed); % 0 if the top of the glacier is above water level
+			base_under_water=min(0,bed);              % 0 if the bottom of the glacier is above water level
+			water_pressure=1.0/2.0*gravity*rho_water*(surface_under_water^2 - base_under_water^2);
+
+		elseif fill==0,
+			ice_pressure=1.0/2.0*gravity*rho_ice*thickness^2;
+			air_pressure=0;
+			water_pressure=0;
+
+		else
+			error('SegmentPressureLoad error message: unknow fill type for icefront boundary condition');
+		end
+
+		pressure = ice_pressure + water_pressure + air_pressure;
+		
+
+		pe=pe+pressure*Jdet*gauss_weights(ig)*...
+		[ (1+segment_gauss_coord(ig))/2*nx
+		  (1+segment_gauss_coord(ig))/2*ny
+		  (1-segment_gauss_coord(ig))/2*nx
+		  (1-segment_gauss_coord(ig))/2*ny];
+
+	end
+
+end %End of function
Index: /issm/trunk/src/m/classes/@icefront/PenaltyConstrain.m
===================================================================
--- /issm/trunk/src/m/classes/@icefront/PenaltyConstrain.m	(revision 1)
+++ /issm/trunk/src/m/classes/@icefront/PenaltyConstrain.m	(revision 1)
@@ -0,0 +1,11 @@
+function [icefront unstable]=PenaltyConstrain(icefront,grids,materials,inputs)
+%PENALTYCONSTRAIN - returns 0
+%
+%   there is no unstable element on the icefront
+%
+%   Usage:
+%      [icefront unstable]=PenaltyConstrain(icefront,grids,materials,inputs)
+% 
+%   See also PENALTYCREATEKMATRIX, PENALTYCREATEKMATRIX
+
+unstable=0;
Index: /issm/trunk/src/m/classes/@icefront/PenaltyCreateKMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@icefront/PenaltyCreateKMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@icefront/PenaltyCreateKMatrix.m	(revision 1)
@@ -0,0 +1,11 @@
+function Ke=PenaltyCreateKMatrix(icefront,grids,materials,inputs,analysis_type,kmax);
+%PENALTYCREATEKMATRIX - creates en empty matrix
+%
+%   there is no penalty in stiffness matrix to apply on the icefront
+%
+%   Usage:
+%      Ke=PenaltyCreateKMatrix(icefront,grids,materials,inputs,analysis_type,kmax)
+% 
+%   See also CREATEPVECTOR, PENALTYCREATEPVECTOR, PENALTYCONTRAIN
+
+Ke=elemmatrix(0);
Index: /issm/trunk/src/m/classes/@icefront/PenaltyCreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@icefront/PenaltyCreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@icefront/PenaltyCreatePVector.m	(revision 1)
@@ -0,0 +1,11 @@
+function Pe=PenaltyCreatePVector(icefront,grids,materials,inputs,analysis_type,kmax);
+%PENALTYCREATEPVECTOR - creates en empty vector
+%
+%   there is no penalty in load vector to apply on the icefront
+%
+%   Usage:
+%      Pe=PenaltyCreatePVector(icefront,grids,materials,inputs,analysis_type,kmax)
+% 
+%   See also CREATEPVECTOR, PENALTYCREATEKMATRIX, PENALTYCONTRAIN
+
+Pe=elemvector(0);
Index: /issm/trunk/src/m/classes/@icefront/display.m
===================================================================
--- /issm/trunk/src/m/classes/@icefront/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@icefront/display.m	(revision 1)
@@ -0,0 +1,14 @@
+function display(icefront)
+%DISPLAY - displays the fields of an icefront element
+%
+%   echo function for 'icefront' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   eid: %i',icefront.eid));
+if strcmpi(icefront.type,'segment'),
+	disp(sprintf('   g: %i %i',icefront.g(1),icefront.g(2)));
+else
+	disp(sprintf('   g: %i %i %i %i',icefront.g(1),icefront.g(2),icefront.g(3),icefront.g(4)));
+end
+disp(sprintf('   rho_water: %g',icefront.rho_water));
+disp(sprintf('   type: %s',icefront.type));
Index: /issm/trunk/src/m/classes/@icefront/icefront.m
===================================================================
--- /issm/trunk/src/m/classes/@icefront/icefront.m	(revision 1)
+++ /issm/trunk/src/m/classes/@icefront/icefront.m	(revision 1)
@@ -0,0 +1,24 @@
+function icefront = icefront(varargin)
+%ICEFRONT - constructor for icefront object
+%
+%   Usage:
+%      icefront = icefront(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	icefront.eid=NaN;
+	icefront.g=zeros(4,1);
+	icefront.rho_water=NaN;
+	icefront.type='segment'; %segment or quad, depending on whether we are running '2d' or '3d'
+	icefront=class(icefront,'icefront');
+case 1
+	%If single argument of class icefront, we have a copy constructor. 
+	if (isa(varargin{1},'icefront'))
+		icefront = varargin{1};
+	else
+		error('icefront constructor error message: copy constructor called on a non ''icefront'' class object');
+	end 
+otherwise
+	error('icefront constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@icefront/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@icefront/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@icefront/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function icefront = subsasgn(icefront,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      icefront = subsasgn(icefront,index,val)
+%
+%   See also SUBSREF
+
+icefront=builtin('subsasgn',icefront,index,val);
Index: /issm/trunk/src/m/classes/@icefront/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@icefront/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@icefront/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function icefront = subsref(icefront,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      icefront = subsref(icefront,index)
+% 
+%   See also SUBSASGN
+
+icefront=builtin('subsref',icefront,index);
Index: /issm/trunk/src/m/classes/@least_squares_term/display.m
===================================================================
--- /issm/trunk/src/m/classes/@least_squares_term/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@least_squares_term/display.m	(revision 1)
@@ -0,0 +1,25 @@
+%
+%  display for the least_squares_term class.
+%
+%  []=display(lst)
+%
+function []=display(lst)
+
+if ~isa(lst,'least_squares_term')
+    error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+        inputname(1),class(lst),'least_squares_term');
+end
+
+%  display the object
+
+disp(sprintf('\n'));
+for i=1:numel(lst)
+    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+        class(lst),inputname(1),string_dim(lst,i)));
+    disp(sprintf('    descriptor: ''%s'''  ,lst(i).descriptor));
+    disp(sprintf('    scale_type: ''%s'''  ,lst(i).scale_type));
+    disp(sprintf('         scale: %g'      ,lst(i).scale));
+    disp(sprintf('        weight: %g\n'    ,lst(i).weight));
+end
+
+end
Index: /issm/trunk/src/m/classes/@least_squares_term/least_squares_term.m
===================================================================
--- /issm/trunk/src/m/classes/@least_squares_term/least_squares_term.m	(revision 1)
+++ /issm/trunk/src/m/classes/@least_squares_term/least_squares_term.m	(revision 1)
@@ -0,0 +1,84 @@
+%
+%  definition for the least_squares_term class.
+%
+%  [lst]=least_squares_term(varargin)
+%
+classdef least_squares_term
+    properties
+        descriptor='';
+        scale_type='none';
+        scale     = 1.;
+        weight    = 1.;
+    end
+    
+    methods
+        function [lst]=least_squares_term(varargin)
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if  (nargin == 1) && isa(varargin{1},'least_squares_term')
+                        lst=varargin{1};
+                    else
+                        lst.descriptor=varargin{1};
+
+                        if (nargin >= 2)
+                            lst.scale_type=varargin{2};
+                            if (nargin >= 3)
+                                lst.scale     =varargin{3};
+                                if (nargin >= 4)
+                                    lst.weight    =varargin{4};
+
+                                    if (nargin > 4)
+                                        warning('objective_function:extra_arg',...
+                                            'Extra arguments for object of class ''%s''.',...
+                                            class(lst));
+                                    end
+                                end
+                            end
+                        end
+                    end
+            end
+
+        end
+        function [desc]  =dresp_desc(lst)
+            desc=cell(size(lst));
+            for i=1:numel(lst)
+                desc(i)=cellstr(lst(i).descriptor);
+            end
+        end
+        function [stype ]=dresp_stype(lst)
+            stype=cell(size(lst));
+            for i=1:numel(lst)
+                stype(i)=cellstr(lst(i).scale_type);
+            end
+        end
+        function [scale] =dresp_scale(lst)
+            scale=zeros(size(lst));
+            for i=1:numel(lst)
+                scale(i)=lst(i).scale;
+            end
+        end
+        function [weight]=dresp_weight(lst)
+            weight=zeros(size(lst));
+            for i=1:numel(lst)
+                weight(i)=lst(i).weight;
+            end
+        end
+        function [lower] =dresp_lower(lst)
+            lower=[];
+        end
+        function [upper] =dresp_upper(lst)
+            upper=[];
+        end
+        function [target]=dresp_target(lst)
+            target=[];
+        end
+    end
+end
Index: /issm/trunk/src/m/classes/@matice/GetViscosity2.m
===================================================================
--- /issm/trunk/src/m/classes/@matice/GetViscosity2.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matice/GetViscosity2.m	(revision 1)
@@ -0,0 +1,40 @@
+function mu2=GetViscosity2(matice,epsilon)
+%GETVISCOSITY2 - returns viscosity for control method
+%
+%   Return viscosity in 2d, for triaelem, used in the inverse control methods.
+%   Careful, this is not the visocsity used by the diagnostic equations!
+%	                                  2*(1-n)/2n
+%	 mu2= -------------------------------------------------------------------
+%	      2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(3n-1)/2n]
+%	 
+%	 where mu2 is the viscotiy, (u,v) the velocity 
+%	 vector, and n the flow law exponent.
+%	 
+%	 If epsilon is NULL, it means this is the first time Emg is being run, and we 
+%	 return 10^14, initial viscosity.
+%	
+%   usage:
+%      mu2=getviscosity2(matice,epsilon)
+
+eps0=10^-27;
+if matice.n==1,
+	error('control method not implemented yet for viscous case');
+else
+	%Non linear creep
+	if norm(epsilon,2)~=0, 
+
+		n=matice.n;
+
+		exx=epsilon(1,:);
+		eyy=epsilon(2,:);
+		exy=epsilon(3,:);
+
+		%Build viscosity: mu2=2*B/(2*A^e):
+		A=exx.^2+eyy.^2+exy.^2+exx.*eyy+eps0^2;
+		e=(3*n-1)/2/n;
+		mu2=(2*(1-n)/2/n*ones(1,size(epsilon,2)))./(2*A.^e);
+	else
+		mu2=10^14*size(epsilon,2);
+	end
+end
+
Index: /issm/trunk/src/m/classes/@matice/GetViscosity2d.m
===================================================================
--- /issm/trunk/src/m/classes/@matice/GetViscosity2d.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matice/GetViscosity2d.m	(revision 1)
@@ -0,0 +1,43 @@
+function mu=GetViscosity2d(matice,epsilon)
+%GETVISCOSITY2D - returns viscosity from a tensor, using Glen's flow law
+%
+%   From a string tensor and a material object, return viscosity, using Glen's flow law.
+%	                                  2*B
+%	 mu= -------------------------------------------------------------------
+%	      2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
+%	 
+%	 where mu is the viscotiy, B the flow law parameter , (u,v) the velocity 
+%	 vector, and n the flow law exponent.
+%	 
+%	 If epsilon is NULL, it means this is the first time Emg is being run, and we 
+%	 return 10^14, initial viscosity.
+%
+%   This routine is appropriate for 2d elements.
+%	
+%   Usage:
+%      mu=GetViscosity2d(matice,epsilon)
+
+eps0=10^-27;
+if matice.n==1,
+	%Viscous behaviour.  mu=*B;
+	mu=matice.B;
+else
+	%Non linear creep
+	if norm(epsilon,2)~=0, 
+
+		B=matice.B;
+		n=matice.n;
+
+		exx=epsilon(1);
+		eyy=epsilon(2);
+		exy=epsilon(3);
+
+		%Build viscosity: mu=2*B/(2*A^e):
+		A=exx^2+eyy^2+exy^2+exx*eyy+eps0^2;
+		e=(n-1)/2/n;
+		mu=2*B/(2*A^e);
+
+	else
+		mu=10^14;
+	end
+end
Index: /issm/trunk/src/m/classes/@matice/GetViscosity3d.m
===================================================================
--- /issm/trunk/src/m/classes/@matice/GetViscosity3d.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matice/GetViscosity3d.m	(revision 1)
@@ -0,0 +1,68 @@
+function mu=GetViscosity3d(matice,epsilon)
+%GETVISCOSITY3D - returns viscosity from a tensor, using Glen's flow law
+%
+%   From a string tensor and a material object, return viscosity, using Glen's flow law.
+%	                                  2*B
+%   mu= -------------------------------------------------------------------
+%	        2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
+%	 
+%   where mu is the viscotiy, B the flow law parameter , (u,v) the velocity 
+%   vector, and n the flow law exponent.
+%	 
+%   If epsilon is NULL, it means this is the first time Emg is being run, and we 
+%   return 10^14, initial viscosity.
+%	
+%   This routine is appropriate for 3d elements.
+%	
+%   Usage:
+%      mu=GetViscosity3d(matice,epsilon)
+
+eps0=10^-27;
+if matice.n==1,
+	%Viscous behaviour.  mu=B;
+	mu=matice.B;
+else
+	%Non linear creep
+	if norm(epsilon,2)~=0
+
+		if size(epsilon,1)==5,
+			B=matice.B;
+			n=matice.n;
+
+			exx=epsilon(1);
+			eyy=epsilon(2);
+			exy=epsilon(3);
+			exz=epsilon(4);
+			eyz=epsilon(5);
+
+			%Build viscosity: mu=2*B/(2*A^e):
+			A=exx^2+eyy^2+exy^2+exx*eyy+exz^2+eyz^2+eps0^2;
+			e=(n-1)/2/n;
+			mu=2*B/(2*A^e);
+	
+		elseif size(epsilon,1)==6,
+			B=matice.B;
+			n=matice.n;
+
+			exx=epsilon(1);
+			eyy=epsilon(2);
+			ezz=epsilon(3);
+			exy=epsilon(4);
+			exz=epsilon(5);
+			eyz=epsilon(6);
+
+			%Build viscosity: mu=2*B/(2*A^e):
+			A=exx^2+eyy^2+exy^2+exx*eyy+exz^2+eyz^2+eps0^2;
+			e=(n-1)/2/n;
+			mu=2*B/(2*A^e);
+
+		else
+			error('GetViscosity3d error message : wrong size of epsilon');
+		end
+
+	else
+		%If epsilon==0, mu=minimum viscosity 
+		mu=10^14;
+	end
+end
+
Index: /issm/trunk/src/m/classes/@matice/display.m
===================================================================
--- /issm/trunk/src/m/classes/@matice/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matice/display.m	(revision 1)
@@ -0,0 +1,9 @@
+function display(matice)
+%DISPLAY - displays the fields of a matice element
+%
+%   echo function for 'matice' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   id: %i',matice.id));
+disp(sprintf('   B: %g',matice.B));
+disp(sprintf('   n: %i',matice.n));
Index: /issm/trunk/src/m/classes/@matice/matice.m
===================================================================
--- /issm/trunk/src/m/classes/@matice/matice.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matice/matice.m	(revision 1)
@@ -0,0 +1,24 @@
+function matice = matice(varargin)
+%MATICE - constructor for matice object
+%
+%   Usage:
+%      matice = matice(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	matice.id=NaN;
+	matice.B=NaN;
+	matice.n=NaN;
+	matice=class(matice,'matice');
+				
+case 1
+	%If single argument of class matice, we have a copy constructor. 
+	if (isa(varargin{1},'matice'))
+		matice = varargin{1};
+	else
+		error('matice constructor error message: copy constructor called on a non ''matice'' class object');
+	end 
+otherwise
+	error('matice constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@matice/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@matice/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matice/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function matice = subsasgn(matice,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      matice = subsasgn(matice,index,val)
+%
+%   See also SUBSREF
+
+matice=builtin('subsasgn',matice,index,val);
Index: /issm/trunk/src/m/classes/@matice/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@matice/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matice/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function matice = subsref(matice,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      matice = subsref(matice,index)
+% 
+%   See also SUBSASGN
+
+matice=builtin('subsref',matice,index);
Index: /issm/trunk/src/m/classes/@matpar/display.m
===================================================================
--- /issm/trunk/src/m/classes/@matpar/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matpar/display.m	(revision 1)
@@ -0,0 +1,17 @@
+function display(matpar)
+%DISPLAY - displays the fields of a matpar element
+%
+%   echo function for 'matpar' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   rho_ice: %g',matpar.rho_ice));
+disp(sprintf('   rho_water: %g',matpar.rho_water));
+disp(sprintf('   heatcapacity: %g',matpar.heatcapacity));
+disp(sprintf('   thermalconductivity: %g',matpar.thermalconductivity));
+disp(sprintf('   meltingpoint: %i',matpar.meltingpoint));
+disp(sprintf('   latentheat: %i',matpar.latentheat));
+disp(sprintf('   beta: %i',matpar.beta));
+disp(sprintf('   mixed_layer_capacity: %i',matpar.mixed_layer_capacity));
+disp(sprintf('   thermal_exchange_velocity: %i',matpar.thermal_exchange_velocity));
+disp(sprintf('   viscosity_overshoot: %i',matpar.viscosity_overshoot));
+disp(sprintf('   g: %g',matpar.g));
Index: /issm/trunk/src/m/classes/@matpar/matpar.m
===================================================================
--- /issm/trunk/src/m/classes/@matpar/matpar.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matpar/matpar.m	(revision 1)
@@ -0,0 +1,32 @@
+function matpar = matpar(varargin)
+%MATPAR - constructor for matpar object
+%
+%   Usage:
+%      matpar= matpar(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	matpar.rho_ice=NaN;
+	matpar.rho_water=NaN;
+	matpar.heatcapacity=NaN;
+	matpar.thermalconductivity=NaN;
+	matpar.meltingpoint=NaN;
+	matpar.latentheat=NaN;
+	matpar.beta=NaN;
+	matpar.mixed_layer_capacity=NaN;
+	matpar.thermal_exchange_velocity=NaN;
+	matpar.g=9.81;
+	matpar.viscosity_overshoot=0.3;
+	matpar=class(matpar,'matpar');
+				
+case 1
+	%If single argument of class matpar, we have a copy constructor. 
+	if (isa(varargin{1},'matpar'))
+		matpar = varargin{1};
+	else
+		error('matpar constructor error message: copy constructor called on a non ''matpar'' class object');
+	end 
+otherwise
+	error('matpar constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@matpar/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@matpar/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matpar/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function matice = subsasgn(matice,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      matice = subsasgn(matice,index,val)
+%
+%   See also SUBSREF
+
+matice=builtin('subsasgn',matice,index,val);
Index: /issm/trunk/src/m/classes/@matpar/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@matpar/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@matpar/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function matice = subsref(matice,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      matice = subsref(matice,index)
+% 
+%   See also SUBSASGN
+
+matice=builtin('subsref',matice,index);
Index: /issm/trunk/src/m/classes/@model/activaterepository.m
===================================================================
--- /issm/trunk/src/m/classes/@model/activaterepository.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/activaterepository.m	(revision 1)
@@ -0,0 +1,34 @@
+function md=activaterepository(md)
+%ACTIVATEREPOSITORY - save the model fields separately
+%
+%   This function is required when a matlab session 
+%   is running low on memory, or when a model is very large. 
+%   By activating a repository (for example, 'repository.model'), 
+%   the model fields will each separately be saved and accessed when 
+%   needed. This will limit the memory use at the maximum; 
+%
+%   Usage:
+%      md=activaterepository(md)
+
+
+%for each field of the model, we create an equivalent variable, with the same name, which we 
+%save in the repository. 
+
+modelfields=fields(md);
+
+%then save each of the big fields in their respective files
+for i=1:length(modelfields),
+	field=char(modelfields(i));
+	eval([field '=md.' field ';']);
+
+	%anything NaN, will be saved 
+
+	if isnumeric(eval(field)),
+		if isnan(eval(field)),
+			if exist(['.' md.repository '.' field],'file');
+				error(['Repository ' md.repository ' already exists! Delete all files starting with .' md.repository ' in your directory, before activating a new repository']);
+			end
+			eval(['save .' md.repository '.' field ' ' field]);
+		end
+	end
+end
Index: /issm/trunk/src/m/classes/@model/deletemodel.m
===================================================================
--- /issm/trunk/src/m/classes/@model/deletemodel.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/deletemodel.m	(revision 1)
@@ -0,0 +1,5 @@
+function deletemodel(md)
+%DELETEMODEL - delete a model
+%
+%   Do not use
+
Index: /issm/trunk/src/m/classes/@model/display.m
===================================================================
--- /issm/trunk/src/m/classes/@model/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/display.m	(revision 1)
@@ -0,0 +1,64 @@
+function display(a)
+%DISPLAY - display the fields of a model
+%
+%   echo function for 'model' class
+	
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('%s%s%s','   Mesh: type ''',inputname(1),'.mesh'' to display'));
+disp(sprintf('%s%s%s','   Boundary conditions: type ''',inputname(1),'.bc'' to display'));
+
+if(a.numrifts)disp(sprintf('      rifts: %i',a.numrifts));end
+
+disp(sprintf('%s%s%s','   Observations: type ''',inputname(1),'.obs'' to display'));
+disp(sprintf('%s%s%s','   Materials: type ''',inputname(1),'.mat'' to display'));
+disp(sprintf('%s%s%s','   Parameters: type ''',inputname(1),'.par'' to display'));
+disp(sprintf('%s%s%s','   Solution parameters: type ''',inputname(1),'.solpar'' to display'));
+disp(sprintf('%s%s%s','   Results: type ''',inputname(1),'.res'' to display'));
+disp(sprintf('%s%s%s','   ExpPar: type ''',inputname(1),'.exppar'' to display'));
+disp(sprintf('%s%s%s','   Qmu: type ''',inputname(1),'.qmu'' to display'));
+
+%Diverse
+disp(sprintf('   Miscellaneous:'));
+if isempty(a.name),
+	disp(sprintf('      name: N/A'));
+else
+	disp(sprintf('      name: %s',a.name));
+end
+
+%notes: a.notes is a cell array of strings
+if isempty(a.notes),
+	disp(sprintf('      notes: N/A'));
+else
+	if iscell(a.notes),
+		strings=a.notes;
+		for i=1:length(strings),
+			string=char(strings(i));
+			if i==1,
+				disp(sprintf('      notes: %s',string));
+			else
+				disp(sprintf('             %s',string));
+			end
+		end
+	elseif ischar(a.notes),
+		disp(sprintf('      notes: %s',a.notes));
+	else
+		disp('display error message: ''notes'' for model is neither a cell array of string, nor a string. Cannot display.');
+	end
+end
+
+%repository
+if ~isempty(a.repository),
+	disp(sprintf('      repository: %s',a.repository));
+end
+
+
+end
+
+function struct_display(structure,offset)
+disp(sprintf('%s',[offset '1x' num2str(size(structure,2)) ' struct array with fields:']));
+structure_fields=fields(structure);
+for i=1:length(structure_fields),
+	disp(sprintf('%s',[offset '   ' structure_fields{i}]));
+end
+
+end
Index: /issm/trunk/src/m/classes/@model/fieldcount.m
===================================================================
--- /issm/trunk/src/m/classes/@model/fieldcount.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/fieldcount.m	(revision 1)
@@ -0,0 +1,8 @@
+function numFields = fieldcount(modelObj)
+%FIELDCOUNT - determine the number of fields in an model object
+%
+%   determines the number of fields in an model object
+%   Used by model child class methods
+%   Do not use
+
+numFields = length(fieldnames(modelObj));
Index: /issm/trunk/src/m/classes/@model/get.m
===================================================================
--- /issm/trunk/src/m/classes/@model/get.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/get.m	(revision 1)
@@ -0,0 +1,22 @@
+function val = get(a, propName)
+%GET - gets model propertie from a specified object ans returns the value
+% 
+%   Usage:
+%      val = get(a, propName)
+
+switch propName
+case 'numberofelements'
+	val = a.numberofelements;
+case 'numberofgrids'
+	val = a.numberofgrids;
+case 'elements' 
+	val = a.elements;
+case 'x' 
+	val = a.x;
+case 'y' 
+	val = a.y;
+case 'z' 
+	val = a.z;
+otherwise
+	error(['get error message: ' propName,' is not a valid model property'])
+end
Index: /issm/trunk/src/m/classes/@model/model.m
===================================================================
--- /issm/trunk/src/m/classes/@model/model.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/model.m	(revision 1)
@@ -0,0 +1,301 @@
+function md = model(varargin)
+%MODEL - constructor for a model
+%
+%   Usage:
+%      md = model(varargin)
+
+switch nargin
+
+case 0
+	% if no input arguments, create a default object
+
+	%Model general information
+	md.notes='';
+	md.name='';
+	md.counter=0; %1 mesh, 2 geography, 3 parameterize
+	md.domainoutline=NaN;
+	md.riftoutline=NaN;
+	md.iceshelfoutline=NaN;
+	md.icesheetoutline=NaN;
+	md.parameterfile=NaN;
+	
+	%Mesh
+	md.type='2d';
+	md.numberofelements=0;
+	md.numberofgrids=0;
+	md.elements=NaN;
+	md.elements_type=NaN;
+	md.x=NaN;
+	md.y=NaN;
+	md.z=NaN;
+	md.bed_slopex=NaN;
+	md.bed_slopey=NaN;
+	md.surface_slopex=NaN;
+	md.surface_slopey=NaN;
+
+	%Initial 2d mesh 
+	md.numberofelements2d=0;
+	md.numberofgrids2d=0;
+	md.elements2d=NaN;
+	md.elements_type2d=NaN;
+	md.x2d=NaN;
+	md.y2d=NaN;
+	md.z2d=NaN;
+		
+	%Elements
+	md.elementonhutter=NaN;
+	md.elementonmacayeal=NaN;
+	md.elementonpattyn=NaN;
+	md.elementonstokes=NaN;
+
+	%Nodes
+	md.gridonhutter=NaN;
+	md.gridonmacayeal=NaN;
+	md.gridonpattyn=NaN;
+	md.gridonstokes=NaN;
+
+	%Stokes mesh
+	md.stokesreconditioning=10^13;
+	
+	%Penalties
+	md.penalties=NaN;
+	md.penalty_offset=3;   %penalty=Kmax*10^penalty_offset
+	md.penalty_melting=10^7;%penalty used to keep T<Tpmp
+	md.penalty_lock=10;
+	md.segments=NaN;       %private member, not displayed
+	md.segmentmarkers=NaN; %private member, not displayed
+	md.rifts=NaN;
+	md.numrifts=0;
+
+	%Projections
+	md.uppergrids=NaN;
+	md.lowergrids=NaN;
+	md.deadgrids=NaN;
+	
+	%Extrusion
+	md.numlayers=0;
+	md.elementonbed=NaN;
+	md.elementonsurface=NaN;
+	md.gridonbed=NaN;
+	md.gridonsurface=NaN;
+	md.minh=1;
+	md.firn_layer=NaN;
+	md.dof=NaN;
+
+	%Extraction
+	md.extractedgrids=NaN;
+	md.extractedelements=NaN;
+	
+	%Materials parameters
+	md.rho_ice=0;
+	md.rho_water=0;
+	md.heatcapacity=2093;
+	md.latentheat=3.34*10^5; %(J/kg);
+	md.thermalconductivity=2.4; %(W/m/K)
+	md.meltingpoint=273.15; %The melting point of ice at 1 atmosphere of pressure in K
+	md.beta=9.8*10^-8; %dependence of melting on pressure.
+	md.mixed_layer_capacity=3974; %J/kg/K
+	md.thermal_exchange_velocity=1.00*10^-4; %m/s
+	
+	%Physical parameters
+	md.g=0;
+	md.yts=365*24*3600;
+	md.drag=NaN;
+	md.drag_type=2;
+	md.p=NaN;
+	md.q=NaN;
+	md.B=NaN;
+	md.n=NaN;
+
+	%Geometrical parameters
+	md.elementoniceshelf=NaN;
+	md.elementonicesheet=NaN;
+	md.gridoniceshelf=NaN;
+	md.gridonicesheet=NaN;
+	md.surface=NaN;
+	md.thickness=NaN;
+	md.new_thickness=NaN;
+	md.bed=NaN;
+
+	%Boundary conditions
+	md.gridonboundary=NaN;
+	%Diagnostic
+	md.segmentonneumann_diag=NaN;
+	md.neumannvalues_diag=NaN;
+	md.gridondirichlet_diag=NaN;
+	md.dirichletvalues_diag=NaN;
+
+	%Thermal
+	md.min_thermal_constraints=0; %minimum number of unstable thermal constraints
+	md.gridondirichlet_thermal=NaN;
+	md.dirichletvalues_thermal=NaN;
+
+	%Transient
+	md.segmentonneumann_prog=NaN;
+	md.neumannvalues_prog=NaN;
+	md.segmentonneumann_prog2=NaN;
+	md.neumannvalues_prog2=NaN;
+	md.gridondirichlet_prog=NaN;
+	md.dirichletvalues_prog=NaN;
+
+	%Observations
+	md.vx_obs=NaN;
+	md.vy_obs=NaN;
+	md.vel_obs=NaN;
+	md.accumulation=NaN;
+	md.geothermalflux=NaN;
+	md.observed_temperature=NaN;
+
+	%Statics parameters
+	md.eps_rel=0;
+	md.eps_abs=0;
+	md.acceleration=0;
+	md.sparsity=0;
+	md.connectivity=10;
+	md.lowmem=0;
+	md.viscosity_overshoot=0.3;
+	
+	%Transient parameters
+	md.dt=0;
+	md.ndt=0;
+	md.artificial_diffusivity=0;
+	md.transient_results=NaN;
+	md.thermaltransient_results=NaN;
+	md.timestepping=0; %no adaptative time stepping by default.
+	md.deltaH=10^-2; %meters
+	md.DeltaH=50; %meters
+	md.deltaT=10^-2; %K
+	md.DeltaT=1; %K
+	md.timeacc=2;
+	md.timedec=.5;
+
+
+	%Control
+	md.control_type='drag';
+	md.cont_vx=NaN;
+	md.cont_vy=NaN;
+	md.cont_vz=NaN;
+	md.cont_vel=NaN;
+	md.cont_parameters=NaN;
+	md.cont_J=[];
+	md.nsteps=0;
+	md.maxiter=[];
+	md.tolx=0;
+	md.optscal=[];
+	md.mincontrolconstraint=0;
+	md.maxcontrolconstraint=2000;
+	md.fit=[];
+	md.epsvel=eps;
+	md.meanvel=0;
+	
+	%Output parameters
+	md.parameteroutput={};
+	md.viscousheating=NaN;
+	md.pressure_elem=NaN;
+	md.stress=NaN;
+	md.stress_surface=NaN;
+	md.stress_bed=NaN;
+	md.deviatoricstress=NaN;
+	md.strainrate=NaN;
+	md.plot=1;
+	
+	%debugging
+	md.debug=1;
+	md.element_debug=0;
+	md.element_debugid=NaN;
+
+	%Results fields
+	md.vx=NaN;
+	md.vy=NaN;
+	md.vz=NaN;
+	md.vel=NaN;
+	md.temperature=NaN; %temperature solution vector
+	md.melting=NaN;
+	md.pressure=NaN;
+
+	%Parallelisation parameters
+	md.cluster='none';
+	md.np=0;
+	md.time=0;
+	md.queue='';
+	md.exclusive=0;
+	md.scheduler_configuration='local';
+	md.outlog=' ';
+	md.errlog=' ';
+	md.alloc_cleanup=1;
+	md.waitonlock=0;
+
+	%mesh2grid
+	md.mesh2grid_parameters={'vel'};
+	md.mesh2grid_interpolation={'node'};
+	md.mesh2grid_filter={'average'};
+	md.mesh2grid_cornereast=0;
+	md.mesh2grid_cornernorth=0;
+	md.mesh2grid_xposting=1000;
+	md.mesh2grid_yposting=1000;
+	md.mesh2grid_nlines=1000;
+	md.mesh2grid_ncolumns=1000;
+	md.mesh2grid_windowsize=1;
+	md.mesh2grid_results=NaN;
+	md.dummy=NaN;
+
+	%mesh 
+	md.mesh_domainoutline='';
+	md.mesh_riftoutline='';
+	md.mesh_resolution=NaN;
+
+	%Cielo parameters 
+	md.solverstring=' -mat_type aijmumps -ksp_type preonly -pc_type lu -mat_mumps_icntl_14 40 ';
+	
+	%Needed for running in parallel
+	md.analysis_type='';
+
+	%management of large models
+	md.repository='';
+
+	%radar power images
+	md.sarpwr=NaN;
+	md.sarxm=NaN;
+	md.sarym=NaN;
+
+	%qmu
+	md.variables=struct([]);
+	md.responses=struct([]);
+	md.dakotaresults=NaN;
+	md.dakotain =NaN;
+	md.dakotaout=NaN;
+	md.dakotadat=NaN;
+%	md.method               ='sampling';
+	md.seed                 =1234;
+	md.samples              =10;
+	md.sample_type          ='lhs';
+	md.method               ='local reliability';
+	md.interval_type        ='forward';
+	md.fd_gradient_step_size= 0.01;
+	md.evaluation_concurrency= 2;
+	md.npart                 = 1;
+
+	md.analysis_driver    ='';
+	md.analysis_components='';
+
+	%Solver options
+	%ice
+	md.solver_type='general';
+	%output
+	md=class(md,'model');
+				
+case 1
+	%If single argument of class model, we have a copy constructor. 
+	if (isa(varargin{1},'model'))
+		md = varargin{1};
+	elseif (isa(varargin{1},'char'))
+		%user gave us the name of the repository, this model is going to be large! 
+		md=model;
+		md.repository=varargin{1};
+		md=activaterepository(md);
+	else
+		error('model constructor error message: copy constructor called on a non ''model'' class object');
+	end 
+otherwise
+	error('model constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@model/set.m
===================================================================
--- /issm/trunk/src/m/classes/@model/set.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/set.m	(revision 1)
@@ -0,0 +1,28 @@
+function a = set(a,varargin)
+%SET - set model properties and return the updated object
+% 
+%   Usage:
+%      a = set(a,varargin)
+
+propertyArgIn = varargin;
+while length(propertyArgIn) >= 2,
+	prop = propertyArgIn{1};
+	val = propertyArgIn{2};
+	propertyArgIn = propertyArgIn(3:end);
+	switch prop
+	case 'numberofelements'
+		a.numberofelements = val;
+	case 'numberofgrids'
+		a.numberofgrids = val;
+	case 'elements'
+		a.elements = val;
+	case 'x'
+		a.x = val;
+	case 'y'
+		a.y = val;
+	case 'z'
+		a.z = val;
+	otherwise
+		error(['set error message: ' prop,' is not a valid model property'])
+	end
+end
Index: /issm/trunk/src/m/classes/@model/structtomodel.m
===================================================================
--- /issm/trunk/src/m/classes/@model/structtomodel.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/structtomodel.m	(revision 1)
@@ -0,0 +1,17 @@
+function md=structtomodel(md,structmd)
+%STRUCTTIMODEL - convert a structure into a model. 
+%
+%   This function will take all the fields in structmd and copy them to corresponding
+%   fields in the md @model class instance. If the field does not exist in md, it is dropped.
+%
+%   Usage:
+%      md=structtomodel(md,structmd)
+
+structfields=fields(structmd);
+for i=1:length(structfields),
+	field=structfields(i);field=field{1};
+	fieldval=getfield(structmd,field);
+	if isfield(struct(md),field),
+		md=setfield(md,field,fieldval);
+	end
+end
Index: /issm/trunk/src/m/classes/@model/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@model/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/subsasgn.m	(revision 1)
@@ -0,0 +1,31 @@
+function md = subsasgn(md,index,val)
+%SUBSASGN - handle indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      md = subsasgn(md,index,val)
+%
+%   See also SUBSREF
+
+if ~isempty(md.repository),
+	field=index(1).subs;
+	if exist(['.' md.repository '.' field],'file'),
+		if length(index)==1,
+			%save val in corresponding repository
+			eval([field '=val;']);
+			eval(['save .' md.repository '.' field ' ' field]);
+		else
+			%load field from file
+			load(['.' md.repository '.' field],'-mat');
+			fieldval=eval(field);
+			eval([field '=builtin(''subsasgn'',fieldval,index(2),val);']);
+			eval(['save .' md.repository '.' field ' ' field]);
+		end
+	else
+		md=builtin('subsasgn',md,index,val);
+	end
+else
+	md=builtin('subsasgn',md,index,val);
+end
Index: /issm/trunk/src/m/classes/@model/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@model/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@model/subsref.m	(revision 1)
@@ -0,0 +1,51 @@
+function result = subsref(md,index)
+%SUBSREF - handle indexed references to model objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      result = subsref(md,index)
+% 
+%   See also SUBSASGN
+
+if length(index)==1,
+	index1=index(1);
+	if(strcmp(index1.subs,'res')), displayresults(md);return; end
+	if(strcmp(index1.subs,'solpar')), displaysolutionparameters(md);return; end
+	if(strcmp(index1.subs,'bc')), displaybc(md);return; end
+	if(strcmp(index1.subs,'mesh')), displaymesh(md);return; end
+	if(strcmp(index1.subs,'par')), displayparameters(md);return; end
+	if(strcmp(index1.subs,'parallel')), displayparallel(md);return; end
+	if(strcmp(index1.subs,'control')), displaycontrol(md);return; end
+	if(strcmp(index1.subs,'exppar')), displayexppar(md);return; end
+	if(strcmp(index1.subs,'obs')), displayobservations(md);return; end
+	if(strcmp(index1.subs,'mat')), displaymaterials(md);return; end
+	if(strcmp(index1.subs,'qmu')), displayqmu(md);return; end
+
+	if ~isempty(md.repository),
+		%load variable needed, if necessary
+		if exist(['.' md.repository '.' index1.subs],'file'),
+			structure=load(['.' md.repository '.' index1.subs],'-mat');
+			eval(['result=structure.' index1.subs ';']);
+		else
+			%the file does not exist, just return built in value
+			result=builtin('subsref',md,index);
+		end
+	else
+		%return built in value
+		result=builtin('subsref',md,index);
+	end
+else
+	if ~isempty(md.repository),
+		if exist(['.' md.repository '.' index(1).subs],'file'),
+			%load variable needed
+			variable=load(['.' md.repository '.' index(1).subs],'-mat');
+		
+			%use temporary structure.
+			result=builtin('subsref',variable,index);
+		else
+			result=builtin('subsref',md,index);
+		end
+	else
+		result=builtin('subsref',md,index);
+	end
+end
Index: /issm/trunk/src/m/classes/@node/display.m
===================================================================
--- /issm/trunk/src/m/classes/@node/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@node/display.m	(revision 1)
@@ -0,0 +1,16 @@
+function display(node)
+%DISPLAY - displays the fields of a node element
+%
+%   echo function for 'node' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   id: %i',node.id));
+disp(sprintf('   x: %g',node.x));
+disp(sprintf('   y: %g',node.y));
+disp(sprintf('   z: %g',node.z));
+disp(sprintf('   doflist: %i %i %i %i %i %i',node.doflist(1),node.doflist(2),node.doflist(3),node.doflist(4),node.doflist(5),node.doflist(6)));
+disp(sprintf('   gridset: %s',node.gridset));
+disp(sprintf('   border: %i',node.border));
+disp(sprintf('   onbed: %i',node.onbed));
+disp(sprintf('   uppergrid: %i',node.uppergrid));
+disp(sprintf('   lowergrid: %i',node.lowergrid));
Index: /issm/trunk/src/m/classes/@node/node.m
===================================================================
--- /issm/trunk/src/m/classes/@node/node.m	(revision 1)
+++ /issm/trunk/src/m/classes/@node/node.m	(revision 1)
@@ -0,0 +1,31 @@
+function node = node(varargin)
+%NODE - constructor for node object
+%
+%   Usage:
+%      node = node(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	node.id=NaN;
+	node.x=NaN;
+	node.y=NaN;
+	node.z=NaN;
+	node.doflist=zeros(6,1); %6 degrees of freedom available per node.
+	node.gridset='';
+	node.onbed=NaN;
+	node.border=0; %border flag: 1 implies this grid belongs to the metis partition borders (See ModelProcessor.m for more details)
+	node.uppergrid=NaN;
+	node.lowergrid=NaN;
+	node=class(node,'node');
+				
+case 1
+	%If single argument of class node, we have a copy constructor. 
+	if (isa(varargin{1},'node'))
+		node = varargin{1};
+	else
+		error('node constructor error message: copy constructor called on a non ''node'' class object');
+	end 
+otherwise
+	error('node constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@node/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@node/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@node/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function node = subsasgn(node,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      node = subsasgn(node,index,val)
+%
+%   See also SUBSREF
+
+node=builtin('subsasgn',node,index,val);
Index: /issm/trunk/src/m/classes/@node/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@node/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@node/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function node = subsref(node,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      node = subsref(node,index)
+% 
+%   See also SUBSASGN
+
+node=builtin('subsref',node,index);
Index: /issm/trunk/src/m/classes/@nonlinear_equality_constraint/display.m
===================================================================
--- /issm/trunk/src/m/classes/@nonlinear_equality_constraint/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@nonlinear_equality_constraint/display.m	(revision 1)
@@ -0,0 +1,25 @@
+%
+%  display for the nonlinear_equality_constraint class.
+%
+%  []=display(nec)
+%
+function []=display(nec)
+
+if ~isa(nec,'nonlinear_equality_constraint')
+    error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+        inputname(1),class(nec),'nonlinear_equality_constraint');
+end
+
+%  display the object
+
+disp(sprintf('\n'));
+for i=1:numel(nec)
+    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+        class(nec),inputname(1),string_dim(nec,i)));
+    disp(sprintf('    descriptor: ''%s'''  ,nec(i).descriptor));
+    disp(sprintf('        target: %g'      ,nec(i).target));
+    disp(sprintf('    scale_type: ''%s'''  ,nec(i).scale_type));
+    disp(sprintf('         scale: %g\n'    ,nec(i).scale));
+end
+
+end
Index: /issm/trunk/src/m/classes/@nonlinear_equality_constraint/nonlinear_equality_constraint.m
===================================================================
--- /issm/trunk/src/m/classes/@nonlinear_equality_constraint/nonlinear_equality_constraint.m	(revision 1)
+++ /issm/trunk/src/m/classes/@nonlinear_equality_constraint/nonlinear_equality_constraint.m	(revision 1)
@@ -0,0 +1,88 @@
+%
+%  constructor for the nonlinear_equality_constraint class.
+%
+%  [nec]=nonlinear_equality_constraint(varargin)
+%
+classdef nonlinear_equality_constraint
+    properties
+        descriptor='';
+        target    = NaN;
+        scale_type='none';
+        scale     = 1.;
+    end
+    
+    methods
+        function [nec]=nonlinear_equality_constraint(varargin)
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object
+
+                case 1
+                    if isa(varargin{1},'nonlinear_equality_constraint')
+                        nec=varargin{1};
+                    else
+                        error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+                            inputname(1),class(varargin{1}),'nonlinear_equality_constraint');
+                    end
+
+%  create the object from the input
+
+                otherwise
+                    nec.descriptor=varargin{1};
+                    nec.target    =varargin{2};
+
+                    if (nargin >= 3)
+                        nec.scale_type=varargin{3};
+                        if (nargin >= 4)
+                            nec.scale     =varargin{4};
+
+                            if (nargin > 4)
+                                warning('objective_function:extra_arg',...
+                                    'Extra arguments for object of class ''%s''.',...
+                                    class(nec));
+                            end
+                        end
+                    end
+            end
+
+        end
+        function [desc]  =dresp_desc(nec)
+            desc=cell(size(nec));
+            for i=1:numel(nec)
+                desc(i)=cellstr(nec(i).descriptor);
+            end
+        end
+        function [stype ]=dresp_stype(nec)
+            stype=cell(size(nec));
+            for i=1:numel(nec)
+                stype(i)=cellstr(nec(i).scale_type);
+            end
+        end
+        function [scale] =dresp_scale(nec)
+            scale=zeros(size(nec));
+            for i=1:numel(nec)
+                scale(i)=nec(i).scale;
+            end
+        end
+        function [weight]=dresp_weight(nec)
+            weight=[];
+        end
+        function [lower] =dresp_lower(nec)
+            lower=[];
+        end
+        function [upper] =dresp_upper(nec)
+            upper=[];
+        end
+        function [target]=dresp_target(nec)
+            target=zeros(size(nec));
+            for i=1:numel(nec)
+                target(i)=nec(i).target;
+            end
+        end
+    end
+end
Index: /issm/trunk/src/m/classes/@nonlinear_inequality_constraint/display.m
===================================================================
--- /issm/trunk/src/m/classes/@nonlinear_inequality_constraint/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@nonlinear_inequality_constraint/display.m	(revision 1)
@@ -0,0 +1,26 @@
+%
+%  display for the nonlinear_inequality_constraint class.
+%
+%  []=display(nic)
+%
+function []=display(nic)
+
+if ~isa(nic,'nonlinear_inequality_constraint')
+    error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+        inputname(1),class(nic),'nonlinear_inequality_constraint');
+end
+
+%  display the object
+
+disp(sprintf('\n'));
+for i=1:numel(nic)
+    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+        class(nic),inputname(1),string_dim(nic,i)));
+    disp(sprintf('    descriptor: ''%s'''  ,nic(i).descriptor));
+    disp(sprintf('         lower: %g'      ,nic(i).lower));
+    disp(sprintf('         upper: %g'      ,nic(i).upper));
+    disp(sprintf('    scale_type: ''%s'''  ,nic(i).scale_type));
+    disp(sprintf('         scale: %g\n'    ,nic(i).scale));
+end
+
+end
Index: /issm/trunk/src/m/classes/@nonlinear_inequality_constraint/nonlinear_inequality_constraint.m
===================================================================
--- /issm/trunk/src/m/classes/@nonlinear_inequality_constraint/nonlinear_inequality_constraint.m	(revision 1)
+++ /issm/trunk/src/m/classes/@nonlinear_inequality_constraint/nonlinear_inequality_constraint.m	(revision 1)
@@ -0,0 +1,93 @@
+%
+%  constructor for the nonlinear_inequality_constraint class.
+%
+%  [nic]=nonlinear_inequality_constraint(varargin)
+%
+classdef nonlinear_inequality_constraint
+    properties
+        descriptor='';
+        lower     = NaN;
+        upper     = NaN;
+        scale_type='none';
+        scale     = 1.;
+    end
+    
+    methods
+        function [nic]=nonlinear_inequality_constraint(varargin)
+
+            switch nargin
+
+ %  create a default object
+
+                case 0
+
+%  copy the object
+
+                case 1
+                    if isa(varargin{1},'nonlinear_inequality_constraint')
+                        nic=varargin{1};
+                    else
+                        error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+                            inputname(1),class(varargin{1}),'nonlinear_inequality_constraint');
+                    end
+
+%  create the object from the input
+
+                otherwise
+                    nic.descriptor=varargin{1};
+                    nic.lower     =varargin{2};
+                    nic.upper     =varargin{3};
+
+                    if (nargin >= 4)
+                        nic.scale_type=varargin{4};
+                        if (nargin >= 5)
+                            nic.scale     =varargin{5};
+
+                            if (nargin > 5)
+                                warning('objective_function:extra_arg',...
+                                    'Extra arguments for object of class ''%s''.',...
+                                    class(nic));
+                            end
+                        end
+                    end
+            end
+
+        end
+        function [desc]  =dresp_desc(nic)
+            desc=cell(size(nic));
+            for i=1:numel(nic)
+                desc(i)=cellstr(nic(i).descriptor);
+            end
+        end
+        function [stype ]=dresp_stype(nic)
+            stype=cell(size(nic));
+            for i=1:numel(nic)
+                stype(i)=cellstr(nic(i).scale_type);
+            end
+        end
+        function [scale] =dresp_scale(nic)
+            scale=zeros(size(nic));
+            for i=1:numel(nic)
+                scale(i)=nic(i).scale;
+            end
+        end
+        function [weight]=dresp_weight(nic)
+            weight=[];
+        end
+        function [lower] =dresp_lower(nic)
+            lower=zeros(size(nic));
+            for i=1:numel(nic)
+                lower(i)=nic(i).lower;
+            end
+        end
+        function [upper] =dresp_upper(nic)
+            upper=zeros(size(nic));
+            for i=1:numel(nic)
+                upper(i)=nic(i).upper;
+            end
+        end
+        function [target]=dresp_target(nic)
+            target=[];
+        end
+    end
+end
Index: /issm/trunk/src/m/classes/@normal_uncertain/display.m
===================================================================
--- /issm/trunk/src/m/classes/@normal_uncertain/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@normal_uncertain/display.m	(revision 1)
@@ -0,0 +1,26 @@
+%
+%  display for the normal_uncertain class.
+%
+%  []=display(nuv)
+%
+function []=display(nuv)
+
+if ~isa(nuv,'normal_uncertain')
+    error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+        inputname(1),class(nuv),'normal_uncertain');
+end
+
+%  display the object
+
+disp(sprintf('\n'));
+for i=1:numel(nuv)
+    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+        class(nuv),inputname(1),string_dim(nuv,i)));
+    disp(sprintf('    descriptor: ''%s'''  ,nuv(i).descriptor));
+    disp(sprintf('          mean: %g'      ,nuv(i).mean));
+    disp(sprintf('        stddev: %g'      ,nuv(i).stddev));
+    disp(sprintf('         lower: %g'      ,nuv(i).lower));
+    disp(sprintf('         upper: %g\n'    ,nuv(i).upper));
+end
+
+end
Index: /issm/trunk/src/m/classes/@normal_uncertain/normal_uncertain.m
===================================================================
--- /issm/trunk/src/m/classes/@normal_uncertain/normal_uncertain.m	(revision 1)
+++ /issm/trunk/src/m/classes/@normal_uncertain/normal_uncertain.m	(revision 1)
@@ -0,0 +1,100 @@
+%
+%  definition for the normal_uncertain class.
+%
+%  [nuv]=normal_uncertain(varargin)
+%
+classdef normal_uncertain
+    properties
+        descriptor='';
+        mean      = NaN;
+        stddev    = NaN;
+        lower     = NaN;
+        upper     = NaN;
+    end
+    
+    methods
+        function [nuv]=normal_uncertain(varargin)
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object
+
+                case 1
+                    if isa(varargin{1},'normal_uncertain')
+                        nuv=varargin{1};
+                    else
+                        error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+                            inputname(1),class(varargin{1}),'normal_uncertain');
+                    end
+
+%  not enough arguments
+
+                case 2
+                    error('Construction of ''%s'' class object requires at least %d inputs.',...
+                        'normal_uncertain',3)
+
+%  create the object from the input
+
+                otherwise
+                    nuv.descriptor=varargin{1};
+                    nuv.mean      =varargin{2};
+                    nuv.stddev    =varargin{3};
+                    if (nargin >= 4)
+                        nuv.lower     =varargin{4};
+                        if (nargin >= 5)
+                            nuv.upper     =varargin{5};
+                            if (nargin > 5)
+                                warning('normal_uncertain:extra_arg',...
+                                    'Extra arguments for object of class ''%s''.',...
+                                    class(nuv));
+                            end
+                        end
+                    end
+            end
+
+        end
+        function [desc]  =dvar_desc(nuv)
+            desc=cell(size(nuv));
+            for i=1:numel(nuv)
+                desc(i)=cellstr(nuv(i).descriptor);
+            end
+            desc=allempty(desc);
+        end
+        function [initpt]=dvar_initpt(nuv)
+            initpt=[];
+        end
+        function [lower] =dvar_lower(nuv)
+            lower=zeros(size(nuv));
+            for i=1:numel(nuv)
+                lower(i)=nuv(i).lower;
+            end
+            lower=allnan(lower);
+        end
+        function [upper] =dvar_upper(nuv)
+            upper=zeros(size(nuv));
+            for i=1:numel(nuv)
+                upper(i)=nuv(i).upper;
+            end
+            upper=allnan(upper);
+        end
+        function [mean]  =dvar_mean(nuv)
+            mean=zeros(size(nuv));
+            for i=1:numel(nuv)
+                mean(i)=nuv(i).mean;
+            end
+        end
+        function [stddev]=dvar_stddev(nuv)
+            stddev=zeros(size(nuv));
+            for i=1:numel(nuv)
+                stddev(i)=nuv(i).stddev;
+            end
+        end
+        function [initst]=dvar_initst(nuv)
+            initst=[];
+        end
+    end
+end
Index: /issm/trunk/src/m/classes/@objective_function/display.m
===================================================================
--- /issm/trunk/src/m/classes/@objective_function/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@objective_function/display.m	(revision 1)
@@ -0,0 +1,25 @@
+%
+%  display for the objective_function class.
+%
+%  []=display(of)
+%
+function []=display(of)
+
+if ~isa(of,'objective_function')
+    error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+        inputname(1),class(of),'objective_function');
+end
+
+%  display the object
+
+disp(sprintf('\n'));
+for i=1:numel(of)
+    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+        class(of),inputname(1),string_dim(of,i)));
+    disp(sprintf('    descriptor: ''%s'''  ,of(i).descriptor));
+    disp(sprintf('    scale_type: ''%s'''  ,of(i).scale_type));
+    disp(sprintf('         scale: %g'      ,of(i).scale));
+    disp(sprintf('        weight: %g\n'    ,of(i).weight));
+end
+
+end
Index: /issm/trunk/src/m/classes/@objective_function/objective_function.m
===================================================================
--- /issm/trunk/src/m/classes/@objective_function/objective_function.m	(revision 1)
+++ /issm/trunk/src/m/classes/@objective_function/objective_function.m	(revision 1)
@@ -0,0 +1,84 @@
+%
+%  definition for the objective_function class.
+%
+%  [of]=objective_function(varargin)
+%
+classdef objective_function
+    properties
+        descriptor='';
+        scale_type='none';
+        scale     = 1.;
+        weight    = 1.;
+    end
+    
+    methods
+        function [of]=objective_function(varargin)
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if  (nargin == 1) && isa(varargin{1},'objective_function')
+                        of=varargin{1};
+                    else
+                        of.descriptor=varargin{1};
+
+                        if (nargin >= 2)
+                            of.scale_type=varargin{2};
+                            if (nargin >= 3)
+                                of.scale     =varargin{3};
+                                if (nargin >= 4)
+                                    of.weight    =varargin{4};
+
+                                    if (nargin > 4)
+                                        warning('objective_function:extra_arg',...
+                                            'Extra arguments for object of class ''%s''.',...
+                                            class(of));
+                                    end
+                                end
+                            end
+                        end
+                    end
+            end
+
+        end
+        function [desc]  =dresp_desc(of)
+            desc=cell(size(of));
+            for i=1:numel(of)
+                desc(i)=cellstr(of(i).descriptor);
+            end
+        end
+        function [stype ]=dresp_stype(of)
+            stype=cell(size(of));
+            for i=1:numel(of)
+                stype(i)=cellstr(of(i).scale_type);
+            end
+        end
+        function [scale] =dresp_scale(of)
+            scale=zeros(size(of));
+            for i=1:numel(of)
+                scale(i)=of(i).scale;
+            end
+        end
+        function [weight]=dresp_weight(of)
+            weight=zeros(size(of));
+            for i=1:numel(of)
+                weight(i)=of(i).weight;
+            end
+        end
+        function [lower] =dresp_lower(of)
+            lower=[];
+        end
+        function [upper] =dresp_upper(of)
+            upper=[];
+        end
+        function [target]=dresp_target(of)
+            target=[];
+        end
+    end
+end
Index: /issm/trunk/src/m/classes/@pengrid/CreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@pengrid/CreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pengrid/CreatePVector.m	(revision 1)
@@ -0,0 +1,9 @@
+function pe=CreatePVector(pengrid,elements,grids,materials,inputs,analysis_type);
+%CREATEPVECTOR - create an empty load vector for a pengrid 
+%
+%   Usage:
+%      pe=CreatePVector(load,elements,grids,materials,inputs,analysis_type)
+% 
+%   See also PENALTYCREATEPVECTOR, PENALTYCREATEKMATRIX
+
+pe=elemvector(0);
Index: /issm/trunk/src/m/classes/@pengrid/PenaltyConstrain.m
===================================================================
--- /issm/trunk/src/m/classes/@pengrid/PenaltyConstrain.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pengrid/PenaltyConstrain.m	(revision 1)
@@ -0,0 +1,48 @@
+function [pengrid unstable]=PenaltyConstrain(pengrid,grids,materials,inputs)
+%PENALTYCONSTRAIN - indicate if a penalty on a grid is stable
+%
+%   The penalty is stable if it doesn't change during to successive iterations.   
+%
+%   Usage:
+%      [pengrid unstable]=PenaltyConstrain(pengrid,grids,materials,inputs)
+% 
+%   See also PENALTYCREATEKMATRIX, PENALTYCREATEKMATRIX
+
+%First recover beta, pressure and temperature vectors;
+[pressure_param pressure_is_present]=recover_input(inputs,'pressure');
+[temperature_param temperature_is_present]=recover_input(inputs,'temperature');
+
+if (~pressure_is_present  | ~temperature_is_present),
+	error('PenaltyConstrain error message: missing input parameters');
+end
+
+%Recover pressure and temperature at the grid
+doflist=grids(pengrid.grid).grid.doflist; %list of dofs in the g-set
+dof=doflist(1);
+
+pressure=pressure_param(dof);
+temperature=temperature_param(dof);
+
+%Compute pressure melting point
+matpar=materials(end).constants;
+meltingpoint=matpar.meltingpoint;
+beta=matpar.beta;
+
+t_pmp=meltingpoint-beta*pressure;
+
+%Figure out if temperature is over melting_point, in which case, this penalty needs to be activated.
+if temperature>t_pmp,
+	active=1;
+else
+	active=0;
+end
+
+%Figure out stability of this penalty
+if pengrid.active==active,
+	unstable=0;
+else
+	unstable=1;
+end
+	
+%Set penalty flag
+pengrid.active=active;
Index: /issm/trunk/src/m/classes/@pengrid/PenaltyCreateKMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@pengrid/PenaltyCreateKMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pengrid/PenaltyCreateKMatrix.m	(revision 1)
@@ -0,0 +1,108 @@
+function Ke=PenaltyCreateKMatrix(pengrid,grids,materials,inputs,analysis_type,kmax)
+%PENALTYCREATEKMATRIX - creates a penalty matrix for a particular grid
+%
+%   This routine applies for thermal, melting, and Stokes solution.
+%
+%   Usage:
+%      Ke=PenaltyCreateKMatrix(pengrid,grids,materials,inputs,analysis_type,kmax)
+% 
+%   See also CREATEPVECTOR, PENALTYCREATEPVECTOR, PENALTYCONTRAIN
+
+	if (strcmpi(analysis_type,'thermaltransient') | strcmpi(analysis_type,'thermalsteady')),
+
+		Ke=CreateKMatrixThermal(pengrid,grids,materials,inputs,kmax);
+
+	elseif strcmpi(analysis_type,'diagnostic_stokes') 
+
+		Ke=CreateKMatrixStokes(pengrid,grids,materials,inputs,kmax);
+
+	elseif strcmpi(analysis_type,'melting')
+
+		Ke=CreateKMatrixMelting(pengrid,grids,materials,inputs,kmax);
+
+	end
+end %end function
+
+function Ke=CreateKMatrixThermal(pengrid,grids,materials,inputs,kmax)
+
+	if ~pengrid.active,
+		Ke=elemmatrix(0);
+		return;
+	else
+		
+		%initialize stiffness matrix
+		Ke=elemmatrix(1);
+
+		%Build linear indices for elementary stiffness matrix.
+		doflist=grids(pengrid.grid).grid.doflist; %list of dofs in the g-set
+		dof=doflist(1);
+		Ke.row_indices=dof;
+			
+		Ke.terms(1,1)=kmax*10^(pengrid.penalty_offset);
+	end
+
+end %function
+
+function Ke=CreateKMatrixMelting(pengrid,grids,materials,inputs,kmax)
+	
+	%First recover beta, pressure and temperature vectors;
+	[pressure_param pressure_is_present]=recover_input(inputs,'pressure');
+	[temperature_param temperature_is_present]=recover_input(inputs,'temperature');
+
+	if (~temperature_is_present | ~pressure_is_present),
+		error('CreatePVectorMelting error message: missing input parameters');
+	end
+
+	%Recover pressure  at the grid and initialize elementary vector dof.
+	doflist=grids(pengrid.grid).grid.doflist; %list of dofs in the g-set
+	dof=doflist(1);
+	pressure=pressure_param(dof);
+	temperature=temperature_param(dof);
+
+	%Compute pressure melting point
+	matpar=materials(end).constants;
+	meltingpoint=matpar.meltingpoint;
+	beta=matpar.beta;
+	t_pmp=meltingpoint-beta*pressure;
+
+	%Add penalty load
+	if temperature>t_pmp %melting
+		Ke=elemmatrix(0);
+
+	else                 %no melting
+		%If T<Tpmp, there must be no melting. Therefore, melting should be  constrained to 0 when T<Tpmp
+		%instead of using spcs, one uses penalties
+		Ke=elemmatrix(1);
+		Ke.row_indices=dof;
+		Ke.terms(1,1)=kmax*10^pengrid.penalty_offset;
+	end	
+
+end %function
+
+function Ke=CreateKMatrixStokes(pengrid,grids,materials,inputs,kmax)
+
+	%First recover beta, pressure and temperature vectors;
+	[slope_param slope_is_present]=recover_input(inputs,'slopebed');
+	
+	if ~slope_is_present,
+		error('CreatePVectorStokes error message: missing input parameters');
+	end
+	
+	%Recover slope at the grid and initialize elementary vector dof.
+	slope=zeros(1,2);
+	doflist=grids(pengrid.grid).grid.doflist; %list of dofs in the g-set
+	slope(1,1)=slope_param(doflist(1));
+	slope(1,2)=slope_param(doflist(2));
+
+	%Create elementary matrix
+	Ke=elemmatrix(3);
+	for i=1:3,
+		Ke.row_indices(i)=doflist(i);
+	end
+
+	%Add penalty to contrain wb (wb=ub*db/dx+vb*db/dy)
+	Ke.terms(3,1)=-slope(1,1)*kmax*10^pengrid.penalty_offset;
+	Ke.terms(3,2)=-slope(1,2)*kmax*10^pengrid.penalty_offset;
+	Ke.terms(3,3)=1*kmax*10^pengrid.penalty_offset;
+
+end %function
Index: /issm/trunk/src/m/classes/@pengrid/PenaltyCreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@pengrid/PenaltyCreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pengrid/PenaltyCreatePVector.m	(revision 1)
@@ -0,0 +1,116 @@
+function pe=PenaltyCreatePVector(pengrid,grids,materials,inputs,analysis_type,kmax);
+%PENALTYCREATEPVECTOR - creates a penalty vector for a particular grid
+%
+%   This routine applies for thermal, melting, and Stokes solution.
+%
+%   Usage:
+%      pe=PenaltyCreatePVector(pengrid,grids,materials,inputs,analysis_type,kmax)
+% 
+%   See also CREATEPVECTOR, PENALTYCREATEKMATRIX, PENALTYCONTRAIN
+
+	if (strcmpi(analysis_type,'thermaltransient') | strcmpi(analysis_type,'thermalsteady')),
+
+		pe=PenaltyCreatePVectorThermal(pengrid,grids,materials,inputs,kmax);
+
+	elseif strcmpi(analysis_type,'diagnostic_stokes')
+
+		pe=PenaltyCreatePVectorDiagnosticStokes(pengrid,grids,materials,inputs,kmax);
+
+	elseif strcmpi(analysis_type,'melting')
+
+		pe=PenaltyCreatePVectorMelting(pengrid,grids,materials,inputs,kmax);
+
+	end
+end %end function
+
+function pe=PenaltyCreatePVectorDiagnosticStokes(pengrid,grids,materials,inputs,kmax);
+	
+	pe=elemvector(0);
+
+end %end function
+
+function pe=PenaltyCreatePVectorThermal(pengrid,grids,materials,inputs,kmax);
+	
+	if ~pengrid.active,
+		pe=elemvector(0);
+	else
+		
+		%initialize load vector
+		pe=elemvector(1);
+
+		%First recover pressure
+		[pressure_param pressure_is_present]=recover_input(inputs,'pressure');
+
+		if (~pressure_is_present),
+			error('CreatePVectorThermal error message: missing pressure as input');
+		end
+
+		%Recover pressure  at the grid and initialize elementary vector dof.
+		doflist=grids(pengrid.grid).grid.doflist; %list of dofs in the g-set
+		dof=doflist(1);
+		pe.row_indices=dof;
+		pressure=pressure_param(dof);
+
+		%Compute pressure melting point
+		matpar=materials(end).constants;
+		meltingpoint=matpar.meltingpoint;
+		beta=matpar.beta;
+		t_pmp=meltingpoint-beta*pressure;
+
+		%Add penalty load
+		pe.terms(1)=kmax*10^(pengrid.penalty_offset)*t_pmp;
+	end
+end %end function
+
+
+function pe=PenaltyCreatePVectorMelting(pengrid,grids,materials,inputs,kmax);
+			
+	%initialize load vector
+	pe=elemvector(1);
+
+	%First recover beta, pressure and temperature vectors;
+	[pressure_param pressure_is_present]=recover_input(inputs,'pressure');
+	[temperature_param temperature_is_present]=recover_input(inputs,'temperature');
+	[melting_offset melting_offset_is_present]=recover_input(inputs,'melting_offset');
+	if ~pengrid.thermal_steadystate,
+		[dt dt_is_present]=recover_input(inputs,'dt');
+		if ~dt_is_present
+			error('CreatePVectorMelting error message: missing dt');
+		end
+	end
+
+	if (~temperature_is_present | ~pressure_is_present | ~melting_offset_is_present),
+		error('CreatePVectorMelting error message: missing input parameters');
+	end
+
+	%Recover pressure  at the grid and initialize elementary vector dof.
+	doflist=grids(pengrid.grid).grid.doflist; %list of dofs in the g-set
+	dof=doflist(1);
+	pe.row_indices=dof;
+	pressure=pressure_param(dof);
+	temperature=temperature_param(dof);
+
+	%Recover parameters
+	matpar=materials(end).constants;
+	meltingpoint=matpar.meltingpoint;
+	beta=matpar.beta;
+	heatcapacity=matpar.heatcapacity;
+	latentheat=matpar.latentheat;
+
+	%Compute pressure melting point
+	t_pmp=meltingpoint-beta*pressure;
+
+	%Add penalty load
+	%This time, the penalty must have the same value as the one used for the thermal computation
+	%so that the corresponding melting can be computed correctly
+	%In the thermal computation, we used kmax=melting_offset, and the same penalty_offset
+	if temperature<t_pmp %no melting
+		pe.terms(1)=0;
+	else
+		if pengrid.thermal_steadystate,
+			pe.terms(1)=melting_offset*10^(pengrid.penalty_offset)*(temperature-t_pmp);
+		else
+			pe.terms(1)=melting_offset*10^(pengrid.penalty_offset)*(temperature-t_pmp)/dt;
+		end
+	end
+end %end function
Index: /issm/trunk/src/m/classes/@pengrid/display.m
===================================================================
--- /issm/trunk/src/m/classes/@pengrid/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pengrid/display.m	(revision 1)
@@ -0,0 +1,14 @@
+function display(pengrid)
+%DISPLAY - displays the fields of a pengrid element
+%
+%   a pengrid element is a penalty applied on a grid
+%
+%   echo function for 'pengrid' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   id: %i',pengrid.id));
+disp(sprintf('   dof: %i',pengrid.dof));
+disp(sprintf('   grid: %i',pengrid.grid));
+disp(sprintf('   active: %g',pengrid.active));
+disp(sprintf('   penalty_offset: %g',pengrid.penalty_offset));
+disp(sprintf('   thermal_steadystate: %i',pengrid.thermal_steadystate));
Index: /issm/trunk/src/m/classes/@pengrid/pengrid.m
===================================================================
--- /issm/trunk/src/m/classes/@pengrid/pengrid.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pengrid/pengrid.m	(revision 1)
@@ -0,0 +1,29 @@
+function pengrid = pengrid(varargin)
+%PENGRID - constructor for pengrid object
+%
+%   a pengrid object is a penalty applied on a grid
+%
+%   Usage:
+%      pengrid = pengrid(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	pengrid.id=NaN;
+	pengrid.dof=NaN;
+	pengrid.grid=NaN;
+	pengrid.active=0;
+	pengrid.penalty_offset=NaN;
+	pengrid.thermal_steadystate=1;
+	
+	pengrid=class(pengrid,'pengrid');
+case 1
+	%If single argument of class pengrid, we have a copy constructor. 
+	if (isa(varargin{1},'pengrid'))
+		pengrid = varargin{1};
+	else
+		error('pengrid constructor error message: copy constructor called on a non ''pengrid'' class object');
+	end 
+otherwise
+	error('pengrid constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@pengrid/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@pengrid/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pengrid/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function pengrid = subsasgn(pengrid,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      pengrid = subsasgn(pengrid,index,val)
+%
+%   See also SUBSREF
+
+pengrid=builtin('subsasgn',pengrid,index,val);
Index: /issm/trunk/src/m/classes/@pengrid/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@pengrid/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pengrid/subsref.m	(revision 1)
@@ -0,0 +1,11 @@
+function pengrid = subsref(pengrid,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%
+%   Usage:
+%      pengrid = subsref(pengrid,index)
+% 
+%   See also SUBSASGN
+
+pengrid=builtin('subsref',pengrid,index);
Index: /issm/trunk/src/m/classes/@penpair/CreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@penpair/CreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@penpair/CreatePVector.m	(revision 1)
@@ -0,0 +1,14 @@
+function pe=PenaltyCreatePVector(penpair,elements,grids,materials,inputs,analysis_type,kmax);
+%CREATEPVECTOR - create an empty load vector for a pengrid 
+%
+%   penalty loads are expressed as penalty stiffnesses input in the global 
+%   stiffness matrix. Therefore, penalty load is not a right hand side therm -> return empty vector.
+%
+%   Usage:
+%      pe=CreatePVector(load,elements,grids,materials,inputs,analysis_type)
+% 
+%   See also PENALTYCREATEPVECTOR, PENALTYCREATEKMATRIX
+
+%penalty loads are expressed as penalty stiffnesses input in the global 
+%stiffness matrix. Therefore, penalty load is not a right hand side therm -> return empty vector.
+pe=elemvector(0);
Index: /issm/trunk/src/m/classes/@penpair/PenaltyConstrain.m
===================================================================
--- /issm/trunk/src/m/classes/@penpair/PenaltyConstrain.m	(revision 1)
+++ /issm/trunk/src/m/classes/@penpair/PenaltyConstrain.m	(revision 1)
@@ -0,0 +1,12 @@
+function [penpair, unstable]=PenaltyConstrain(penpair,grids,materials,inputs)
+%PENALTYCONSTRAIN - returns 0
+%
+%   there is no unstable element between grids
+%
+%   Usage:
+%      [penpair, unstable]=PenaltyConstrain(penpair,grids,materials,inputs)
+% 
+%   See also PENALTYCREATEKMATRIX, PENALTYCREATEKMATRIX
+
+unstable=0;
+
Index: /issm/trunk/src/m/classes/@penpair/PenaltyCreateKMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@penpair/PenaltyCreateKMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@penpair/PenaltyCreateKMatrix.m	(revision 1)
@@ -0,0 +1,30 @@
+function Ke=PenaltyCreateKMatrix(penpair,grids,materials,inputs,analysis_type,kmax)
+%PENALTYCREATEKMATRIX - creates a penalty matrix for a particular grid
+%
+%   penpair is, as the name describes, a penalty load between two grids, for a certain degree of freedom.
+%   This is the same as adding a infinitely stiff spring element between two grids, for a certain degree 
+%   of freedom. The goal is to make the value of that dof identical on both grids. 
+%   In order to do so, we add a stiffness matrix of the type [1 -1 ; -1 1]*lambda, where lambda is a penalty 
+%
+%   Usage:
+%      Ke=PenaltyCreateKMatrix(penpair,grids,materials,inputs,analysis_type,kmax)
+% 
+%   See also CREATEPVECTOR, PENALTYCREATEPVECTOR, PENALTYCONTRAIN
+ 
+%parameters
+numgrids=2;
+
+%initialize stiffness matrix
+Ke=elemmatrix(2);
+
+%Build linear indices for elementary stiffness matrix.
+for i=1:numgrids,
+	doflist=grids(penpair.grids(i)).grid.doflist; %list of dofs in the g-set
+	dof=doflist(penpair.dof);
+	Ke.row_indices(i)=dof;
+end
+
+Ke.terms(1,1)=kmax*10^penpair.penalty_offset;
+Ke.terms(1,2)=-kmax*10^penpair.penalty_offset;
+Ke.terms(2,1)=-kmax*10^penpair.penalty_offset;
+Ke.terms(2,2)=kmax*10^penpair.penalty_offset;
Index: /issm/trunk/src/m/classes/@penpair/PenaltyCreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@penpair/PenaltyCreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@penpair/PenaltyCreatePVector.m	(revision 1)
@@ -0,0 +1,14 @@
+function pe=PenaltyCreatePVector(penpair,grids,materials,inputs,analysis_type,kmax);
+%PENALTYCREATEPVECTOR - creates en empty vector
+%
+%   penalty loads are expressed as penalty stiffnesses input in the global 
+%   stiffness matrix. Therefore, penalty load is not a right hand side therm -> return empty vector.
+%
+%   Usage:
+%      Pe=PenaltyCreatePVector(icefront,grids,materials,inputs,analysis_type,kmax)
+% 
+%   See also CREATEPVECTOR, PENALTYCREATEKMATRIX, PENALTYCONTRAIN
+
+pe=elemvector(0);
+
+end
Index: /issm/trunk/src/m/classes/@penpair/display.m
===================================================================
--- /issm/trunk/src/m/classes/@penpair/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@penpair/display.m	(revision 1)
@@ -0,0 +1,12 @@
+function display(penpair)
+%DISPLAY - displays the fields of a penpair element
+%
+%   a pengrid element is a penalty applied between several grids
+%
+%   echo function for 'penpair' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   id: %i',penpair.id));
+disp(sprintf('   dof: %i',penpair.dof));
+disp(sprintf('   grids: [%i %i]',penpair.grids(1),penpair.grids(2)));
+disp(sprintf('   penalty_offset: %g',penpair.penalty_offset));
Index: /issm/trunk/src/m/classes/@penpair/penpair.m
===================================================================
--- /issm/trunk/src/m/classes/@penpair/penpair.m	(revision 1)
+++ /issm/trunk/src/m/classes/@penpair/penpair.m	(revision 1)
@@ -0,0 +1,27 @@
+function penpair = penpair(varargin)
+%PENPAIR- constructor for penpair object
+%
+%   a penpair object is a penalty applied between several grids
+%
+%   Usage:
+%      penpair = penpair(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	penpair.id=NaN;
+	penpair.dof=NaN;
+	penpair.grids=zeros(2,1);
+	penpair.penalty_offset=NaN;
+	
+	penpair=class(penpair,'penpair');
+case 1
+	%If single argument of class penpair, we have a copy constructor. 
+	if (isa(varargin{1},'penpair'))
+		penpair = varargin{1};
+	else
+		error('penpair constructor error message: copy constructor called on a non ''penpair'' class object');
+	end 
+otherwise
+	error('penpair constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@penpair/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@penpair/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@penpair/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function penpair = subsasgn(penpair,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      penpair = subsasgn(penpair,index,val)
+%
+%   See also SUBSREF
+
+penpair=builtin('subsasgn',penpair,index,val);
Index: /issm/trunk/src/m/classes/@penpair/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@penpair/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@penpair/subsref.m	(revision 1)
@@ -0,0 +1,11 @@
+function penpair = subsref(penpair,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%
+%   Usage:
+%      penpair = subsref(penpair,index)
+% 
+%   See also SUBSASGN
+
+penpair=builtin('subsref',penpair,index);
Index: /issm/trunk/src/m/classes/@pentaelem/CreateKMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/CreateKMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/CreateKMatrix.m	(revision 1)
@@ -0,0 +1,1122 @@
+function Ke=CreateKMatrix(pentaelem,grids,materials,inputs,analysis_type)
+%CREATEKMATRIX - create the stiffmess matrix for pentaelem
+%
+%   this stiffness matrix works for MacAyeal, Pattyn's  and Stokes' model ,
+%   thermal model (transient ans steady), prognostic, melting and 
+%   for the computation of the bed slope and surface slope
+%
+%   Usage:
+%      Ke=CreateKMatrix(pentaelem,grids,materials,inputs,analysis_type)
+%
+%   See also CREATEPVECTOR
+
+if strcmpi(analysis_type,'diagnostic_horiz'),
+
+	Ke=CreateKMatrixHoriz(pentaelem,grids,materials,inputs,analysis_type);
+
+elseif strcmpi(analysis_type,'diagnostic_vert'),
+
+	Ke=CreateKMatrixVert(pentaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'diagnostic_basevert'),
+
+	Ke=CreateKMatrixBaseVert(pentaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'prognostic'),
+
+	Ke=CreateKMatrixPrognostic(pentaelem,grids,materials,inputs);
+
+elseif (strcmpi(analysis_type,'thermaltransient') | strcmpi(analysis_type,'thermalsteady')),
+
+	Ke=CreateKMatrixThermal(pentaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'melting')
+
+	Ke=CreateKMatrixMelting(pentaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'diagnostic_stokes'),
+
+	Ke=CreateKMatrixStokes(pentaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y') | strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+
+	Ke=CreateKMatrixSlopeCompute(pentaelem,grids,materials,inputs,analysis_type);
+
+
+end
+end %end function
+
+function Ke=CreateKMatrixSlopeCompute(pentaelem,grids,materials,inputs,analysis_type)
+
+	%We are dealing with a collapsed formulation on the lower triangle of the penta, 
+	%only on the bedrock.
+
+	if strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y'),
+		if pentaelem.onbed~=1,
+			Ke=elemmatrix(0);
+			return;
+		end
+	elseif strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+		if pentaelem.onsurface~=1,
+			Ke=elemmatrix(0);
+			return;
+		end
+	end
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids); 
+
+	%Just keep the first 3 grids
+	if strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y'),
+		xyz_list=xyz_list(1:3,:);
+	elseif strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+		xyz_list=xyz_list(4:6,:);
+	end	
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		if strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y'),
+			doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		elseif strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+			doflist=grids(pentaelem.g(i+3)).grid.doflist; %list of dofs in the g-set: last three grids
+		end
+		dof=doflist(1);
+		Ke.row_indices(i)=dof;
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	for ig=1:num_gauss2D,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L matrix if viscous basal drag present:
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+   
+		DL_scalar=gauss_weight*Jdettria;
+
+		%Do the triple product tL*D*L. 
+		Ke_gg_gaussian=L'*DL_scalar*L;
+		
+		%Add Ke_gg_drag_gaussian to Ke
+		Ke.terms=Ke.terms+Ke_gg_gaussian;
+	end
+
+end %end function
+
+function Ke=CreateKMatrixStokes(pentaelem,grids,materials,inputs,analysis_type)
+
+%some variables
+numgrids=6;
+DOFPERGRID=4;
+numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+numgrids2d=3;
+numdof2d=numgrids2d*DOFPERGRID; %number of dof for friction element triaelem.
+
+%some parameters
+MAXSLOPE=.06;  %any element with slope>MAXSLOPE is considered a "rock" element, with infinite stiffness.
+MOUNTAINKEXPONENT=10; % "infinite" stiffness is going to be  10^MOUNTAINKEXPONENT
+
+%Create elementary stiffness matrix 
+Ke=elemmatrix(numdof);
+
+%recover material
+matice=materials(pentaelem.matid).material;
+matpar=materials(end).constants;
+
+%recover material parameters
+gravity=matpar.g;
+viscosity_overshoot=matpar.viscosity_overshoot;
+rho_ice=matpar.rho_ice;
+rho_water=matpar.rho_water;
+
+%recover conditioning number for the matrix
+conditioning=pentaelem.reconditioning_number;
+
+%recover extra inputs from users, at current convergence iteration.
+[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+[basal_drag_param basal_drag_is_present]=recover_input(inputs,'drag');
+[bed_param bed_is_present]=recover_input(inputs,'bed');
+[temperature_param temperature_is_present]=recover_input(inputs,'temperature');
+[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+
+%initialize extra arrays if some inputs are present
+if velocity_is_present,
+	vxvyvz_list=zeros(numgrids,3);
+end
+B_list=zeros(numgrids,1);
+bed_list=zeros(numgrids,1);
+thickness_list=zeros(numgrids,1);
+K_list=zeros(numgrids,1);
+temperature_list=zeros(numgrids,1);
+
+%Get all element grid data:
+xyz_list=getgriddata(pentaelem,grids);
+
+%Build linear indices for elementary stiffness matrix.
+for i=1:numgrids,
+	doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+	for j=1:DOFPERGRID,
+		dof=doflist(j);
+		Ke.row_indices((i-1)*DOFPERGRID+j)=dof;
+		if j<4, %the fourth dof corresponds to pressure and not velocity
+			if velocity_is_present, vxvyvz_list(i,j)=velocity_param(dof); end;
+		end
+	end
+	
+	dof=doflist(1);
+	if(thickness_is_present) thickness_list(i)=thickness_param(dof);end;
+	if(bed_is_present) bed_list(i)=bed_param(dof);end;
+	if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	if(basal_drag_is_present), K_list(i)=basal_drag_param(dof);end;
+	if(temperature_is_present) temperature_list(i)=temperature_param(dof);end;
+end
+
+% Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 
+%get tria gaussian points as well as segment gaussian points. For tria gaussian 
+%points, order of integration is 2, because we need to integrate the product tB*D*B' 
+%which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian 
+%points, same deal, which yields 3 gaussian points.
+area_order=5;
+num_vert_gauss=5;
+[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+Ke_temp=zeros(27,27);
+
+%Start  looping on the number of gaussian points:
+for igarea=1:num_area_gauss,
+	for igvert=1:num_vert_gauss,
+		%Pick up the gaussian point and its weight:
+		gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+		gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+
+		%Get strain rate, if velocity has been supplied: 
+		if velocity_is_present,
+			epsilon=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord);
+		else
+			epsilon=zeros(6,1);
+		end
+		%disp(sprintf('Epsilon: %f %f %f\n',epsilon(1),epsilon(2),epsilon(3)));
+		
+		%Update material parameter that deals with ice rigidity. The update depends either on the 
+		%temperature (if we are running thermal, or transient), or on B (if we are running inverse 
+		%control methods on B). The latter prevails. 
+		
+		%Update material if temperature is provided.
+		if temperature_is_present,
+			temperature=GetParameterValueStokes(pentaelem,temperature_list,gauss_coord);
+			matice.B=paterson(temperature);
+		end
+
+		%Update material if flow law is specified. This will erase the previous change 
+		%on B when temperature is provided. 
+		if flow_law_is_present,
+			B_param=GetParameterValueStokes(pentaelem,B_list,gauss_coord);
+			matice.B=B_param; clear B_param.
+		end
+
+		%Get viscosity at last two iterations: 
+		viscosity=GetViscosity3d(matice,epsilon);
+		%disp(sprintf('Element id %i Viscosity: %g \n',pentaelem.id,viscosity));
+
+		%Get B and Bprime matrices:
+		B=GetBStokes(pentaelem,xyz_list,gauss_coord);
+		Bprime=GetBprimeStokes(pentaelem,xyz_list,gauss_coord);
+
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+		%disp(sprintf('Jacobian determinant: %f\n', Jdet));
+
+		% Build the D matrix: we plug the gaussian weight, the viscosity, and the jacobian determinant 
+		% onto this scalar matrix, so that we win some computational time: */
+		D=gauss_weight*Jdet*diag([viscosity*ones(6,1);-conditioning*ones(2,1)]);
+
+		% Do the triple product tB*D*Bprime: 
+		Ke_gg_gaussian=B'*D*Bprime;
+
+		%Add Ke_gg_gaussian to Ke_temp: 
+		Ke_temp=Ke_temp+Ke_gg_gaussian;
+
+	end %for igarea=1:num_area_gauss,
+end %for igvert=1:num_vert_gauss,
+
+%Deal with 2d friction at the bedrock interface
+if (pentaelem.onbed==1 & (pentaelem.shelf==0))
+
+	%build alpha^2 of each of the 3 grids of the triangle
+	if (pentaelem.friction_type==2),  %friction_type=2 implies viscous, friction_type=1 implies plastic
+	
+		%Retrieve some parameters needed to compute alpha2 (taub=alpha2*ub)
+		frictionparameters=struct();
+		frictionparameters.element_type='3d';
+		frictionparameters.rho_ice=rho_ice;
+		frictionparameters.rho_water=rho_water;
+		frictionparameters.g=gravity;	
+		frictionparameters.p=pentaelem.p;
+		frictionparameters.q=pentaelem.q;
+
+		if velocity_is_present,
+			frictionparameters.velocities=vxvyvz_list(1:3,:);
+		else
+			frictionparameters.velocities=zeros(3,3);
+		end
+		if thickness_is_present,
+			frictionparameters.h=thickness_list(1:3);
+		else
+			frictionparameters.h=pentaelem.h(1:3);
+		end
+		if bed_is_present,
+			frictionparameters.b=bed_list(1:3);
+		else
+			frictionparameters.b=pentaelem.b(1:3);
+		end
+		if basal_drag_is_present,
+			frictionparameters.k=K_list(1:3);
+		else
+			frictionparameters.k=pentaelem.k(1:3);
+		end
+
+		alpha2=Getalpha2(frictionparameters);
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	for ig=1:num_gauss2D,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord_tria=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		gauss_coord_penta=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig) -1];
+
+		%Get the Jacobian determinant
+		xyz_list_tria=xyz_list(1:3,:);
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list_tria,gauss_coord_tria);
+
+		%Get L and Lprime matrix if viscous basal drag present:
+		L=GetLStokes(triaelem,gauss_coord_tria);
+		Lprime=GetLprimeStokes(triaelem,xyz_list,gauss_coord_tria,gauss_coord_penta);
+
+		%Build normal vector to the surface pointing outward the glacier system
+		n=zeros(3,1);
+		normal=cross((xyz_list_tria(1,:)-xyz_list_tria(3,:)),(xyz_list_tria(3,:)-xyz_list_tria(2,:)));
+		n(1)=1/norm(normal)*normal(1);
+		n(2)=1/norm(normal)*normal(2);
+		n(3)=1/norm(normal)*normal(3);
+
+		%Get strain rate, if velocity has been supplied: 
+		if velocity_is_present,
+			epsilon=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord_penta);
+		else
+			epsilon=zeros(6,1);
+		end
+
+
+		%Update material if temperature is provided.
+		if temperature_is_present,
+			temperature=GetParameterValueStokes(pentaelem,temperature_list,gauss_coord_penta);
+			matice.B=paterson(temperature);
+		end
+
+		%Get viscosity at last two iterations: 
+		viscosity=GetViscosity3d(matice,epsilon);
+		%disp(sprintf('Element id %i Viscosity: %g \n',pentaelem.id,viscosity));
+
+
+		%Get alpha2 on current gaussian point
+		alpha2_g=GetParameterValue(triaelem,alpha2,gauss_coord_tria);
+
+		%Create DL diagonal matrix
+		DL=diag([alpha2_g*[1;1;-n(1)*n(3);-n(2)*n(3);-n(1)*n(3);-n(2)*n(3)]; -viscosity*[n(1);n(2);n(3);n(1)/2.0;n(2)/2.0];conditioning*[n(1);n(2);n(3)]])*gauss_weight*Jdettria;
+
+		%Create stiffness matrix for drag
+		Ke_gg_drag_gaussian=L'*DL*Lprime;
+
+		%Add Ke_gg_drag_gaussian Ke 
+		Ke_temp(1:12,1:12)=Ke_temp(1:12,1:12)+Ke_gg_drag_gaussian;
+	end
+end%ends friction
+
+%Reduce the matrix
+Ke_reduced=ReduceMatrixStokes(pentaelem,Ke_temp);
+
+%Add the components of the matrix for the 6 grids 
+Ke.terms=Ke.terms+Ke_reduced;
+
+end%end function
+
+
+function Ke=CreateKMatrixVert(pentaelem,grids,materials,inputs)
+
+	%some variables
+	numgrids=6;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	numgrids2d=3;
+	numdof2d=numgrids2d*DOFPERGRID; %number of dof for friction element triaelem.
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		dof=doflist(3); %z degree of freedom
+		Ke.row_indices(i)=dof;
+	end
+
+	% Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 
+	%get tria gaussian points as well as segment gaussian points. For tria gaussian 
+	%points, order of integration is 2, because we need to integrate the product tB*D*B' 
+	%which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian 
+	%points, same deal, which yields 3 gaussian points.
+	area_order=2;
+	num_vert_gauss=2;
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		for igvert=1:num_vert_gauss,
+			%Pick up the gaussian point and its weight:
+			gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+			gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+			
+			%Get B and Bprime matrices:
+			B=GetB_vert(pentaelem,xyz_list,gauss_coord);
+			Bprime=GetBprime_vert(pentaelem,gauss_coord);
+
+			%Get Jacobian determinant:
+			Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+			%disp(sprintf('Jacobian determinant: %f\n', Jdet));
+
+			D=gauss_weight*Jdet;
+
+			% Do the triple product tB*D*Bprime: 
+			Ke_gg_gaussian=B'*D*Bprime;
+
+			%Add Ke_gg_gaussian to Ke: 
+			Ke.terms=Ke.terms+Ke_gg_gaussian;
+			
+		end %for ig=1:num_area_gauss,
+	  end %for ig=1:num_vert_gauss,
+
+	%Deal with upper surface integration: 
+
+	if (pentaelem.onsurface==1),
+		
+		%Get the coordinates of the three grids
+		xyz_list_tria=xyz_list(4:6,:);
+
+		% Get gaussian points and weights.
+		[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+		%Build normal vector to the surface
+		normal=cross((xyz_list_tria(1,:)-xyz_list_tria(3,:)),(xyz_list_tria(2,:)-xyz_list_tria(3,:)));
+		nz=1/norm(normal)*normal(3);
+
+		for ig=1:num_gauss2D,
+
+			%Pick up the gaussian point and its weight:
+			gauss_weight=gauss_weights(ig);
+			gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+			
+			%Get the Jacobian determinant
+			Jdettria=GetJacobianDeterminant(triaelem,xyz_list_tria,gauss_coord);
+
+			%Get L matrix if viscous basal drag present:
+			L=GetL(triaelem,gauss_coord,DOFPERGRID);
+	   
+			DL_scalar=gauss_weight*Jdettria*nz;
+
+			%Do the triple product tL*D*L. Do not forget the '-' sign!
+			Ke_gg_vert_gaussian=-L'*DL_scalar*L;
+			
+
+			%Add Ke_gg_drag_gaussian to Ke
+			Ke.terms(4:6,4:6)=Ke.terms(4:6,4:6)+Ke_gg_vert_gaussian;
+		end
+	end%ends friction
+
+end %end function
+
+function Ke=CreateKMatrixBaseVert(pentaelem,grids,materials,inputs)
+
+	%We are dealing with a collapsed formulation on the lower triangle of the penta, 
+	%only on the bedrock.
+	if pentaelem.onbed~=1,
+		Ke=elemmatrix(0);
+		return;
+	end
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids); 
+
+	%Just keep the first 3 grids
+	xyz_list=xyz_list(1:3,:);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		dof=doflist(3); %z degree of freedom
+		Ke.row_indices(i)=dof;
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	for ig=1:num_gauss2D,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L matrix if viscous basal drag present:
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+   
+		DL_scalar=gauss_weight*Jdettria;
+
+		%Do the triple product tL*D*L. 
+		Ke_gg_vert_gaussian=L'*DL_scalar*L;
+		
+		%Add Ke_gg_drag_gaussian to Ke
+		Ke.terms=Ke.terms+Ke_gg_vert_gaussian;
+	end
+
+end %end function
+
+
+
+
+function Ke=CreateKMatrixThermal(pentaelem,grids,materials,inputs)
+
+
+	%some variables
+	numgrids=6;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	%recover material
+	matice=materials(pentaelem.matid).material;
+	matpar=materials(end).constants;
+
+	%recover material parameters
+	gravity=matpar.g;
+	rho_ice=matpar.rho_ice;
+	rho_water=matpar.rho_water;
+	heatcapacity=matpar.heatcapacity;
+	thermalconductivity=matpar.thermalconductivity;
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids);
+
+	%recover extra inputs from users, at current convergence iteration.
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[dt dt_is_present]=recover_input(inputs,'dt');
+	if (~velocity_is_present )
+		error('CreateKMatrixThermal error message: missing velocity parameter!');
+	end
+	if (~dt_is_present & ~pentaelem.thermal_steadystate)
+		error('CreateKMatrixThermal error message: transient thermal solution requires present of time step as parameter!');
+	end
+
+	%initialize vxvyvz_list 
+	vxvyvz_list=zeros(numgrids,3);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+
+		doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		for j=1:3,
+			dof=doflist(j);
+			vxvyvz_list(i,j)=velocity_param(dof);
+		end	
+		dof=doflist(1);
+		Ke.row_indices(i)=dof;
+		
+	end
+
+	% Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 
+	%get tria gaussian points as well as segment gaussian points. For tria gaussian 
+	%points, order of integration is 2, because we need to integrate the product tB*D*B' 
+	%which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian 
+	%points, same deal, which yields 3 gaussian points.
+	area_order=2;
+	num_vert_gauss=2;
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		for igvert=1:num_vert_gauss,
+			%Pick up the gaussian point and its weight:
+			gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+			gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+
+			%Get Jacobian determinant:
+			Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+			%disp(sprintf('Jacobian determinant: %f\n', Jdet));
+			    
+			%conduction
+
+			%Get B and Bprime matrices:
+			Bconduct=GetB_conduct(pentaelem,xyz_list,gauss_coord);
+
+			% Build the D matrix
+			D=gauss_weight*Jdet*(thermalconductivity/(rho_ice*heatcapacity))*eye(3);
+
+			% Do the triple product tB*D*B: 
+			if pentaelem.thermal_steadystate,
+				Kconduct=Bconduct'*D*Bconduct;
+			else
+				Kconduct=dt*Bconduct'*D*Bconduct;
+			end
+
+			%advection 
+
+			%Get B and Bprime matrices:
+			Badvec=GetB_advec(pentaelem,gauss_coord);
+			Bprimeadvec=GetBprime_advec(pentaelem,xyz_list,gauss_coord);
+
+			% Build the D matrix
+			vx=GetParameterValue(pentaelem,vxvyvz_list(:,1),gauss_coord);
+			vy=GetParameterValue(pentaelem,vxvyvz_list(:,2),gauss_coord);
+			vz=GetParameterValue(pentaelem,vxvyvz_list(:,3),gauss_coord);
+
+			D=gauss_weight*Jdet*[vx,0,0; 0,vy,0; 0,0,vz];
+
+			% Do the triple product tB*D*Bprime: 
+			if pentaelem.thermal_steadystate,
+				Kadvec=Badvec'*D*Bprimeadvec;
+			else
+				Kadvec=dt*Badvec'*D*Bprimeadvec;
+			end
+
+			%transient 
+			if pentaelem.thermal_steadystate,
+				Ktransient=0;
+			else
+				L=GetNodalFunctions(pentaelem,gauss_coord);
+				Ktransient=L'*L*gauss_weight*Jdet;
+			end
+
+			%Add all contributions to Ke: 
+			Ke.terms=Ke.terms+Kadvec+Kconduct+Ktransient;
+			%Ke.terms=Ke.terms+Kconduct+Ktransient;
+
+		end %for ig=1:vert_gauss,
+	end %for ig=1:num_area_gauss,
+			
+	%Ice/ocean heat exchange flux on ice shelf base 
+	if (pentaelem.onbed & pentaelem.shelf),
+
+		%recover material parameters
+		mixed_layer_capacity=matpar.mixed_layer_capacity;
+		thermal_exchange_velocity=matpar.thermal_exchange_velocity;
+
+		% Get gaussian points and weights.
+		[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+		for ig=1:num_gauss2D,
+
+			%Pick up the gaussian point and its weight:
+			gauss_weight=gauss_weights(ig);
+			gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+			
+			%Get the Jacobian determinant
+			xyz_list_tria=xyz_list(1:3,:);
+			Jdettria=GetJacobianDeterminant(triaelem,xyz_list_tria,gauss_coord);
+			
+			%Get nodal functions value
+			l1l2l3=GetNodalFunctions(triaelem,gauss_coord);
+
+			%Compute the elementary load vector
+			if pentaelem.thermal_steadystate,
+				Ke_ocean_gaussian=l1l2l3'*gauss_weight*Jdettria*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(heatcapacity*rho_ice)*l1l2l3;
+			else
+				Ke_ocean_gaussian=l1l2l3'*dt*gauss_weight*Jdettria*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(heatcapacity*rho_ice)*l1l2l3;
+			end
+
+			%Add Ke_gg_drag_gaussian to Ke
+			Ke.terms(1:3,1:3)=Ke.terms(1:3,1:3)+Ke_ocean_gaussian;
+		end
+	end%ends ice/ocean exchange flux 
+
+
+end %end function
+
+
+
+
+
+
+
+function Ke=CreateKMatrixHoriz(pentaelem,grids,materials,inputs,analysis_type);
+
+global element_debug  element_debugid
+
+%Figure out if this pentaelem is collapsed. If so, then bailout, except if it is at the 
+%bedrock, in which case we spawn a tria element using the 3 first grids, and use it to build 
+%the stiffness matrix. 
+if pentaelem.collapse & ~pentaelem.onbed
+
+	Ke=elemmatrix(0);
+	return;
+
+elseif pentaelem.collapse & pentaelem.onbed
+        
+
+	Ke=PentaCollapseIntoTriaMatrix(pentaelem, grids, materials, inputs, analysis_type);
+
+	%That's it, element will get destroyed upon return, and we have the correct 
+	%collapsed stiffness matrix. 
+	return;
+
+else 
+
+	%implement standard penta element.
+
+	%some variables
+	numgrids=6;
+	DOFPERGRID=2;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	numgrids2d=3;
+	numdof2d=numgrids2d*DOFPERGRID; %number of dof for friction element triaelem.
+
+
+	%some parameters
+	MAXSLOPE=.06;  %any element with slope>MAXSLOPE is considered a "rock" element, with infinite stiffness.
+	MOUNTAINKEXPONENT=10; % "infinite" stiffness is going to be  10^MOUNTAINKEXPONENT
+
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%recover material
+	matice=materials(pentaelem.matid).material;
+	matpar=materials(end).constants;
+
+	%recover material parameters
+	gravity=matpar.g;
+	viscosity_overshoot=matpar.viscosity_overshoot;
+	rho_ice=matpar.rho_ice;
+	rho_water=matpar.rho_water;
+
+	%recover extra inputs from users, at current convergence iteration.
+	[basal_drag_param basal_drag_is_present]=recover_input(inputs,'drag');
+	[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+	[surface_param surface_is_present]=recover_input(inputs,'surface');
+	[bed_param bed_is_present]=recover_input(inputs,'bed');
+	[temperature_param temperature_is_present]=recover_input(inputs,'temperature');
+	[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[oldvelocity_param oldvelocity_is_present]=recover_input(inputs,'oldvelocity');
+
+	%initialize extra arrays if some inputs are present
+	if velocity_is_present,
+		vxvy_list=zeros(numgrids,2);
+	end
+	if oldvelocity_is_present,
+		oldvxvy_list=zeros(numgrids,2);
+	end
+
+	B_list=zeros(numgrids,1);
+	K_list=zeros(numgrids,1);
+	thickness_list=zeros(numgrids,1);
+	surface_list=zeros(numgrids,1);
+	bed_list=zeros(numgrids,1);
+	temperature_list=zeros(numgrids,1);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		for j=1:DOFPERGRID,
+			dof=doflist(j);
+			Ke.row_indices((i-1)*DOFPERGRID+j)=dof;
+			if velocity_is_present, vxvy_list(i,j)=velocity_param(dof); end;
+			if oldvelocity_is_present, oldvxvy_list(i,j)=oldvelocity_param(dof); end;
+		end
+		
+		dof=doflist(1);
+		if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+		if(basal_drag_is_present), K_list(i)=basal_drag_param(dof);end;
+		if(thickness_is_present) thickness_list(i)=thickness_param(dof);end;
+		if(surface_is_present) surface_list(i)=surface_param(dof);end;
+		if(bed_is_present) bed_list(i)=bed_param(dof);end;
+		if(temperature_is_present) temperature_list(i)=temperature_param(dof);end;
+
+	end
+
+		% Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 
+	%get tria gaussian points as well as segment gaussian points. For tria gaussian 
+	%points, order of integration is 2, because we need to integrate the product tB*D*B' 
+	%which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian 
+	%points, same deal, which yields 3 gaussian points.
+	area_order=5;
+	num_vert_gauss=5;
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		for igvert=1:num_vert_gauss,
+		%Pick up the gaussian point and its weight:
+		gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+		gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+	
+		%Compute thickness at gaussian point from t1,t2 and t3 fields in the element itself
+		if thickness_is_present,
+			thickness=GetParameterValue(pentaelem,thickness_list,gauss_coord);
+		else
+			thickness=GetParameterValue(pentaelem,pentaelem.h,gauss_coord);
+		end
+
+		%Get strain rate, if velocity has been supplied: 
+		if velocity_is_present,
+			epsilon=GetStrainRate(pentaelem,vxvy_list,xyz_list,gauss_coord);
+		else
+			epsilon=zeros(5,1);
+		end
+		if oldvelocity_is_present,
+			oldepsilon=GetStrainRate(pentaelem,oldvxvy_list,xyz_list,gauss_coord);
+		else
+			oldepsilon=zeros(5,1);
+		end
+
+		%disp(sprintf('Epsilon: %f %f %f\n',epsilon(1),epsilon(2),epsilon(3)));
+		
+		%Update material parameter that deals with ice rigidity. The update depends either on the 
+		%temperature (if we are running thermal, or transient), or on B (if we are running inverse 
+		%control methods on B). The latter prevails. 
+
+		%Update material if temperature is provided.
+		if temperature_is_present,
+			temperature=GetParameterValue(pentaelem,temperature_list,gauss_coord);
+			matice.B=paterson(temperature);
+		end
+
+		%Update material if flow law is specified. This will erase the previous change 
+		%on B when temperature is provided. 
+		if flow_law_is_present,
+			B_param=GetParameterValue(pentaelem,B_list,gauss_coord);
+			matice.B=B_param; clear B_param.
+		end
+
+		%Get viscosity at last two iterations: 
+		newviscosity=GetViscosity3d(matice,epsilon);
+		oldviscosity=GetViscosity3d(matice,oldepsilon);
+		viscosity=newviscosity+viscosity_overshoot*(newviscosity-oldviscosity);
+		%disp(sprintf('Element id %i Viscosity: %g \n',pentaelem.id,viscosity));
+
+		%Get B and Bprime matrices:
+		B=GetB_horiz(pentaelem,xyz_list,gauss_coord);
+		Bprime=GetBprime_horiz(pentaelem,xyz_list,gauss_coord);
+		
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+		%disp(sprintf('Jacobian determinant: %f\n', Jdet));
+
+		% Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant 
+		% onto this scalar matrix, so that we win some computational time: */
+		D=viscosity*gauss_weight*Jdet*diag(ones(5,1));
+	  
+
+		% Do the triple product tB*D*Bprime: 
+		Ke_gg_gaussian=B'*D*Bprime;
+
+		%Add Ke_gg_gaussian to Ke: 
+		Ke.terms=Ke.terms+Ke_gg_gaussian;
+		
+		end %for ig=1:num_area_gauss,
+	  end %for ig=1:num_vert_gauss,
+
+		
+	  
+
+	%Deal with 2d friction at the bedrock interface
+
+	if (pentaelem.onbed==1 & (pentaelem.shelf==0))
+
+		%build alpha^2 of each of the 3 grids of the triangle
+		if (pentaelem.friction_type==2),  %friction_type=2 implies viscous, friction_type=1 implies plastic
+		
+			%Retrieve some parameters needed to compute alpha2 (taub=alpha2*ub)
+			frictionparameters=struct();
+			frictionparameters.element_type='3d';
+			frictionparameters.rho_ice=rho_ice;
+			frictionparameters.rho_water=rho_water;
+			frictionparameters.g=gravity;	
+			frictionparameters.p=pentaelem.p;
+			frictionparameters.q=pentaelem.q;
+
+			if velocity_is_present,
+				frictionparameters.velocities=vxvy_list(1:3,:);
+			else
+				frictionparameters.velocities=zeros(3,2);
+			end
+			if thickness_is_present,
+				frictionparameters.h=thickness_list(1:3);
+			else
+				frictionparameters.h=pentaelem.h(1:3);
+			end
+			if bed_is_present,
+				frictionparameters.b=bed_list(1:3);
+			else
+				frictionparameters.b=pentaelem.b(1:3);
+			end
+			if basal_drag_is_present,
+				frictionparameters.k=K_list(1:3);
+			else
+				frictionparameters.k=pentaelem.k(1:3);
+			end
+
+			alpha2=Getalpha2(frictionparameters);
+		end
+
+		% Get gaussian points and weights.
+		[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+		for ig=1:num_gauss2D,
+
+			%Pick up the gaussian point and its weight:
+			gauss_weight=gauss_weights(ig);
+			gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+			gauss_coord_penta=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig) -1];
+			
+			%Get the Jacobian determinant
+			xyz_list_tria=xyz_list(1:3,:);
+			Jdettria=GetJacobianDeterminant(triaelem,xyz_list_tria,gauss_coord);
+
+			%Get L if viscous basal drag present:
+			L=GetL(triaelem,gauss_coord,DOFPERGRID);
+	   
+			%Get alpha2 on current gaussian point
+			alpha2_g=GetParameterValue(triaelem,alpha2,gauss_coord);
+
+			%Build D
+			DL_scalar=alpha2_g*gauss_weight*Jdettria;
+			DL=diag(DL_scalar*ones(2,1));
+
+			%Do the triple product tL*D*L
+			Ke_gg_drag_gaussian=L'*DL*L;
+
+			%Add Ke_gg_drag_gaussian to Ke
+			Ke.terms(1:6,1:6)=Ke.terms(1:6,1:6)+Ke_gg_drag_gaussian;
+		end
+	end%ends friction
+
+	
+end %elseif pentaelem.collapse & pentaelem.onbed
+end%ends function
+
+function Ke=CreateKMatrixPrognostic(pentaelem,grids,materials,inputs)
+
+	%We are dealing with a collapsed formulation on the lower triangle of the penta, 
+	%only on the bedrock.
+	
+	if pentaelem.onbed~=1,
+		Ke=elemmatrix(0);
+		return;
+	end
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids); 
+
+	%Just keep the first 3 grids
+	xyz_list=xyz_list(1:3,:);
+
+	%recover extra inputs from users, at current convergence iteration.
+	[dt dt_is_present]=recover_input(inputs,'dt');
+	[velocity_average_param velocity_average_is_present]=recover_input(inputs,'velocity_average');
+
+	%check on all parameters
+	if ((~dt_is_present) | (~velocity_average_is_present)),
+		error('CreateKMatrixPrognostic error message: missing input parameters!');
+	end
+	
+	%initialize parameter lists (for our 3 grids)
+	vxvy_list=zeros(numgrids,2);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		
+		Ke.row_indices(i)=doflist(1);
+	
+		vxvy_list(i,:)=velocity_average_param(doflist(1:2));
+	end
+
+	%Create Artificial diffusivity if asked
+	if pentaelem.artificial_diffusivity,
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,[1/3 1/3 1/3]);
+
+		%Build K matrix (artificial diffusivity matrix)
+		v_gauss=1/3*(vxvy_list(1,:)+vxvy_list(2,:)+vxvy_list(3,:));
+		K=Jdettria^(1/2)/2*[abs(v_gauss(1)) 0 ; 0 abs(v_gauss(2))];
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	for ig=1:num_gauss2D,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L matrix if viscous basal drag present:
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+
+		DL_scalar=gauss_weight*Jdettria;
+
+		%Do the triple product tL*D*L. 
+		Ke_gg_gaussian=L'*DL_scalar*L;
+
+		%Get B matrix 
+		B=GetB_prog(triaelem,xyz_list,gauss_coord);
+		
+		%Get Bprime matrix 
+		Bprime=GetBprime_prog(triaelem,xyz_list,gauss_coord);
+
+		%Get u, v and their derivatives at gauss point
+		u_g=GetParameterValue(triaelem,vxvy_list(:,1),gauss_coord);
+		v_g=GetParameterValue(triaelem,vxvy_list(:,2),gauss_coord);
+		du_g=GetParameterDerivativeValue(triaelem,vxvy_list(:,1),xyz_list,gauss_coord);
+		dv_g=GetParameterDerivativeValue(triaelem,vxvy_list(:,2),xyz_list,gauss_coord);
+		dux_g=du_g(1);
+		dvy_g=dv_g(2);
+		
+		DL_scalar=dt*gauss_weight*Jdettria;
+
+		%Create DL and DLprime matrix
+		DL=DL_scalar*[dux_g, 0; 0, dvy_g];
+		DLprime=DL_scalar*[u_g, 0; 0, v_g];
+
+		%Do the triple product tL*D*L. 
+		Ke_gg_thickness=B'*DL*B+B'*DLprime*Bprime;	
+
+		%Add Ke_gg_drag_gaussian and Ke_gg_gaussian to Ke
+		Ke.terms=Ke.terms+Ke_gg_gaussian+Ke_gg_thickness;
+
+		%Add artificial diffusivity  if requested
+		if pentaelem.artificial_diffusivity,
+
+			%Do the triple product tL*D*L. 
+			Ke_gg_gaussian=Bprime'*DL_scalar*K*Bprime;
+			
+			%Add Ke_gg_drag_gaussian to Ke
+			Ke.terms=Ke.terms+Ke_gg_gaussian;
+		end
+	end
+
+end %end function
+
+function Ke=CreateKMatrixMelting(pentaelem,grids,materials,inputs)
+
+	%We are dealing with a collapsed formulation on the lower triangle of the penta, 
+	%only on the bedrock.
+	if pentaelem.onbed~=1,
+		Ke=elemmatrix(0);
+		return;
+	end
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%recover material
+	matpar=materials(end).constants;
+
+	%recover material parameters
+	latentheat=matpar.latentheat;
+	heatcapacity=matpar.heatcapacity;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids); 
+
+	%Just keep the first 3 grids
+	xyz_list=xyz_list(1:3,:);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		dof=doflist(1); %melting is 1st degree of freedom
+		Ke.row_indices(i)=dof;
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	for ig=1:num_gauss2D,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L matrix if viscous basal drag present:
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+   
+		DL_scalar=latentheat/heatcapacity*gauss_weight*Jdettria;
+
+		%Do the triple product tL*D*L. 
+		Ke_gg_vert_gaussian=L'*DL_scalar*L;
+		
+		%Add Ke_gg_drag_gaussian to Ke
+		Ke.terms=Ke.terms+Ke_gg_vert_gaussian;
+	end
+
+end %end function
Index: /issm/trunk/src/m/classes/@pentaelem/CreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/CreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/CreatePVector.m	(revision 1)
@@ -0,0 +1,1198 @@
+function pe=CreatePVector(pentaelem,grids,materials,inputs,analysis_type);
+%CREATEPVECTOR - create the load vector for pentaelem
+%
+%   this load vector works for MacAyeal, Pattyn's  and Stokes' model ,
+%   thermal model (transient ans steady), prognostic, melting and 
+%   for the computation of the bed slope and surface slope
+%
+%   Usage:
+%      pe=CreatePVector(pentaelem,grids,materials,inputs,analysis_type)
+%
+%   See also CREATEKMATRIX
+
+
+if strcmpi(analysis_type,'diagnostic_horiz'),
+
+	pe=CreatePVectorHoriz(pentaelem,grids,materials,inputs,analysis_type);
+
+elseif strcmpi(analysis_type,'diagnostic_vert'),
+
+	pe=CreatePVectorVert(pentaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'diagnostic_basevert'),
+
+	pe=CreatePVectorBaseVert(pentaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'prognostic'),
+
+	pe=CreatePVectorPrognostic(pentaelem,grids,materials,inputs);
+
+elseif (strcmpi(analysis_type,'thermalsteady') | strcmpi(analysis_type,'thermaltransient')),
+
+	pe=CreatePVectorThermal(pentaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'melting')
+
+	pe=elemvector(0);
+
+elseif strcmpi(analysis_type,'diagnostic_stokes'),
+
+	pe=CreatePVectorStokes(pentaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y') | strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+
+	pe=CreatePVectorSlopeCompute(pentaelem,grids,materials,inputs,analysis_type);
+
+
+end
+end %end function
+
+function pe=CreatePVectorStokes(pentaelem,grids,materials,inputs,analysis_type);
+
+%some variables
+numgrids=6;
+numgrids2d=3;
+NDOF4=4;
+
+%Create elementary vector.
+pe=elemvector(numgrids*NDOF4);
+
+%recover material
+matice=materials(pentaelem.matid).material;
+matpar=materials(end).constants;
+
+%recover material parameters
+gravity=matpar.g;
+viscosity_overshoot=matpar.viscosity_overshoot;
+rho_ice=matpar.rho_ice;
+rho_water=matpar.rho_water;
+
+%recover conditioning number for the matrix
+conditioning=pentaelem.reconditioning_number;
+
+%recover extra inputs
+[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+[temperature_param temperature_is_present]=recover_input(inputs,'temperature');
+[surface_param surface_is_present]=recover_input(inputs,'surface');
+[bed_param bed_is_present]=recover_input(inputs,'bed');
+[melting_param melting_is_present]=recover_input(inputs,'melting');
+[basal_drag_param basal_drag_is_present]=recover_input(inputs,'drag');
+[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+
+%Get all element grid data:
+xyz_list=getgriddata(pentaelem,grids);
+
+%Initialize inputs
+if velocity_is_present,
+	vxvyvz_list=zeros(numgrids,3);
+end
+B_list=zeros(numgrids,1);
+basal_drag_list=zeros(numgrids,1);
+melting_list=zeros(numgrids,1);
+thickness_list=zeros(numgrids,1);
+surface_list=zeros(numgrids,1);
+bed_list=zeros(numgrids,1);
+temperature_list=zeros(numgrids,1);
+
+%Build row indices for elementary vector.
+for i=1:numgrids,
+	
+	doflist=grids(pentaelem.g(i)).grid.doflist;
+	for j=1:NDOF4,
+		dof=doflist(j);
+		pe.row_indices((i-1)*NDOF4+j)=dof;
+		if j<4, %the fourth dof corresponds to pressure and not velocity
+			if velocity_is_present, vxvyvz_list(i,j)=velocity_param(dof); end;
+		end
+	end
+	dof=doflist(1);
+	if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	if(thickness_is_present) thickness_list(i)=thickness_param(dof);end;
+	if(temperature_is_present) temperature_list(i)=temperature_param(dof);end;
+	if(surface_is_present) surface_list(i)=surface_param(dof);end;
+	if(bed_is_present) bed_list(i)=bed_param(dof);end;
+	if(melting_is_present) melting_list(i)=melting_param(dof);end;
+	if(basal_drag_is_present) basal_drag_list(i)=basal_drag_param(dof);end;
+
+end
+
+% Get gaussian points and weights 
+area_order=5;
+num_vert_gauss=5;
+[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+%for i=1:num_gauss,
+%	disp(sprintf('Gauss coord %i: %f %f %f Weight: %f\n',i,first_gauss_area_coord(i),second_gauss_area_coord(i),third_gauss_area_coord(i),gauss_weights(i)));
+%end
+%
+pe_temp=zeros(27,1);
+Kebubble_temp=zeros(27,3);
+
+%Start  looping on the number of gaussian points:
+for igarea=1:num_area_gauss,
+	for igvert=1:num_vert_gauss,
+		%Pick up the gaussian point and its weight:
+		gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+		gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+
+		%In case we have plastic basal drag, compute plastic stress at gaussian point from k1, k2 and k3 fields in the 
+		%element itself: 
+		if (~pentaelem.shelf) & (pentaelem.friction_type==1),
+			if basal_drag_is_present,
+				plastic_stress=GetParameterValueStokes(pentaelem,basal_drag_list,gauss_coord);
+			else
+				plastic_stress=GetParameterValueStokes(pentaelem,pentaelem.k,gauss_coord);
+			end
+		end
+
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+		%disp(sprintf('Jacobian determinant: %f\n', Jdet));
+
+		%Get nodal functions
+		l1l7=GetNodalFunctionsStokes(pentaelem,gauss_coord);
+
+		%Build pe_gaussian vector:
+		pe_gaussian=zeros(numgrids*NDOF4+3,1);
+
+		if(~pentaelem.shelf) & (pentaelem.friction_type==1),
+			for i=1:numgrids+1,
+				for j=1:2,
+					pe_gaussian((i-1)*NDOF4+j)=-plastic_stress*Jdet*gauss_weight*l1l7(i);
+				end
+				pe_gaussian((i-1)*NDOF4+3)=-rho_ice*gravity*Jdet*gauss_weight*l1l7(i);
+			end
+		else
+			for i=1:numgrids+1,
+				pe_gaussian((i-1)*NDOF4+3)=-rho_ice*gravity*Jdet*gauss_weight*l1l7(i);
+			end
+		end
+
+		%Add pe_gaussian vector to pe:
+		pe_temp=pe_temp+pe_gaussian;
+
+		%Compute the bubble part of the elementary stiffness matrix
+		
+		%Get strain rate, if velocity has been supplied: 
+		if velocity_is_present,
+			epsilon=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord);
+		else
+			epsilon=zeros(6,1);
+		end
+		%disp(sprintf('Epsilon: %f %f %f\n',epsilon(1),epsilon(2),epsilon(3),epsilon(4),epsilon(5),epsilon(6)));
+		
+		%Update material parameter that deals with ice rigidity. The update depends either on the 
+		%temperature (if we are running thermal, or transient), or on B (if we are running inverse 
+		%control methods on B). The latter prevails. 
+		
+		%Update material if temperature is provided.
+		if temperature_is_present,
+			temperature=GetParameterValueStokes(pentaelem,temperature_list,gauss_coord);
+			matice.B=paterson(temperature);
+		end
+
+		%Update material if flow law is specified. This will erase the previous change 
+		%on B when temperature is provided. 
+		if flow_law_is_present,
+			B_param=GetParameterValueStokes(pentaelem,B_list,gauss_coord);
+			matice.B=B_param; clear B_param.
+		end
+
+		%Get viscosity at last two iterations: 
+		viscosity=GetViscosity3d(matice,epsilon);
+		%disp(sprintf('Element id %i Viscosity: %g \n',pentaelem.id,viscosity));
+
+		%Get B and Bprime matrices:
+		B=GetBStokes(pentaelem,xyz_list,gauss_coord);
+		Bprime=GetBprimeStokes(pentaelem,xyz_list,gauss_coord);
+		Bprime_bubble=Bprime(:,25:27);
+
+		% Build the D matrix: we plug the gaussian weight, the viscosity, and the jacobian determinant 
+		% onto this scalar matrix, so that we win some computational time: */
+		D=gauss_weight*Jdet*diag([viscosity*ones(6,1);-conditioning*ones(2,1)]);
+
+		% Do the triple product tB*D*Bprime: 
+		Ke_gg_gaussian=B'*D*Bprime_bubble;
+
+		%Add Ke_gg_gaussian to Ke_temp: 
+		Kebubble_temp=Kebubble_temp+Ke_gg_gaussian;
+
+	end %for igarea=1:num_area_gauss,
+end %for igvert=1:num_vert_gauss,
+
+%Deal with water pressure integration: 
+
+if (pentaelem.onbed==1 & pentaelem.shelf==1),
+
+	%Plug the grids on surface into the triaelem
+	if thickness_is_present,
+		thickness=thickness_list(1:3);
+	else			
+		thickness=pentaelem.h(1:3);
+	end
+	if bed_is_present,
+		bed=bed_list(1:3);
+	else			
+		bed=pentaelem.b(1:3);
+	end
+	if basal_drag_is_present,
+		basal_drag=basal_drag_list(1:3);
+	else			
+		basal_drag=pentaelem.k(1:3);
+	end
+
+	%Get the coordinates of the three grids
+	xyz_list_tria=xyz_list(1:3,:);
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	%Build normal vector to the surface pointing outward the glacier system
+	n=zeros(3,1);
+	normal=cross((xyz_list_tria(1,:)-xyz_list_tria(3,:)),(xyz_list_tria(3,:)-xyz_list_tria(2,:)));
+	n(1)=1/norm(normal)*normal(1);
+	n(2)=1/norm(normal)*normal(2);
+	n(3)=1/norm(normal)*normal(3);
+
+	pe_gg_water=zeros(27,1);
+
+	for ig=1:num_gauss2D,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+	
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list_tria,gauss_coord);
+
+		%Get bed at gaussian point
+		bed_gg=GetParameterValue(triaelem,bed,gauss_coord);
+		
+		%Get L matrix 
+		L=GetL(triaelem,gauss_coord,1);
+   
+		%Compute pressure
+		pressure=gravity*rho_water*bed_gg;
+
+		%Compute elementary load vector
+		for i=1:numgrids2d,
+			for j=1:3,
+				pe_gg_water((i-1)*NDOF4+j)=pe_gg_water((i-1)*NDOF4+j)+pressure*gauss_weight*Jdettria*L(i)*n(j);
+			end
+		end
+	end
+
+	%Add pe_gaussian vector to pe:
+	pe_temp=pe_temp+pe_gg_water;
+
+end%ends of water pressure
+
+%Create reduced vector 
+pe_reduced=ReduceVectorStokes(pentaelem,Kebubble_temp, pe_temp);
+
+pe.terms=pe.terms+pe_reduced;
+
+end %end function
+
+
+function pe=CreatePVectorSlopeCompute(pentaelem,grids,materials,inputs,analysis_type);
+
+	%We are dealing with a collapsed formulation on the lower triangle of the penta, 
+	%only on the bedrock.
+	if strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y'),
+		if pentaelem.onbed~=1,
+			pe=elemvector(0);
+			return;
+		end
+	elseif strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+		if pentaelem.onsurface~=1,
+			pe=elemvector(0);
+			return;
+		end
+	end
+	
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	%Create elementary stiffness matrix 
+	pe=elemvector(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids); 
+
+	%Just keep the first 3 grids and recover extra inputs
+	if strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y'),
+		xyz_list=xyz_list(1:3,:);
+		[param param_is_present]=recover_input(inputs,'bed');
+	elseif strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+		xyz_list=xyz_list(4:6,:);
+		[param param_is_present]=recover_input(inputs,'surface');
+	end
+
+	param_list=zeros(numgrids,1);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		if strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y'),
+			doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		elseif strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+			doflist=grids(pentaelem.g(i+3)).grid.doflist; %list of dofs in the g-set: last three grids
+		end	
+		if(param_is_present) param_list(i)=param(doflist(1));end;
+		dof=doflist(1);
+		pe.row_indices(i)=dof;
+	end
+
+	if param_is_present, 
+		param=param_list(1:3); 
+	else 
+		if strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y'),
+			param=pentaelem.b(1:3); 
+		elseif strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+			param=pentaelem.s(4:6); 
+		end
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	%for icesheets
+	for ig=1:num_gauss2D,
+	
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		
+		%Get bed slope
+		dparam=GetParameterDerivativeValue(triaelem,param,xyz_list,gauss_coord);
+		dparamdx=dparam(1);
+		dparamdy=dparam(2);
+
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L: 
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+
+		%Build gaussian vector 
+		if strcmp(analysis_type,'bed_slope_compute_x') | strcmp(analysis_type,'surface_slope_compute_x'), 
+			pe_g_gaussian=Jdettria*gauss_weight*dparamdx*L';
+		elseif strcmp(analysis_type,'bed_slope_compute_y') | strcmp(analysis_type,'surface_slope_compute_y'),
+			pe_g_gaussian=Jdettria*gauss_weight*dparamdy*L';
+		end
+
+		%Add Ke_gg_drag_gaussian to Ke
+		pe.terms=pe.terms+pe_g_gaussian;
+	end
+
+end %end function
+
+
+
+function pe=CreatePVectorBaseVert(pentaelem,grids,materials,inputs);
+
+	%We are dealing with a collapsed formulation on the lower triangle of the penta, 
+	%only on the bedrock.
+	if pentaelem.onbed~=1,
+		pe=elemvector(0);
+		return;
+	end
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	%recover material parameters
+	matice=materials(pentaelem.matid).material;
+	matpar=materials(end).constants;
+	rho_ice=matpar.rho_ice;
+	rho_water=matpar.rho_water;
+	di=rho_ice/rho_water;
+
+	%Create elementary stiffness matrix 
+	pe=elemvector(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids); 
+
+	%Just keep the first 3 grids
+	xyz_list=xyz_list(1:3,:);
+
+	%recover extra inputs
+	[bed_param bed_is_present]=recover_input(inputs,'bed');
+	[melting_param melting_is_present]=recover_input(inputs,'melting');
+	[accumulation_param accumulation_is_present]=recover_input(inputs,'accumulation');
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[velocity_average_param velocity_average_is_present]=recover_input(inputs,'velocity_average');
+	[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+	if (~velocity_is_present | ~velocity_average_is_present),
+		error('CreatePVector error message: no input velocity!');
+	end
+
+	%initialize velocity array
+	vxvy_list=zeros(numgrids,2);
+	vxvy_average_list=zeros(numgrids,2);
+	bed_list=zeros(numgrids,1);
+	melting_list=zeros(numgrids,1);
+	accumulation_list=zeros(numgrids,1);
+	thickness_list=zeros(numgrids,1);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		for j=1:2,
+			dof=doflist(j);
+			vxvy_list(i,j)=velocity_param(dof);
+			vxvy_average_list(i,j)=velocity_average_param(dof);
+		end
+		if(bed_is_present) bed_list(i)=bed_param(doflist(1));end;
+		if(melting_is_present) melting_list(i)=melting_param(doflist(1));end;
+		if(accumulation_is_present) accumulation_list(i)=accumulation_param(doflist(1));end;
+		if(thickness_is_present) thickness_list(i)=thickness_param(doflist(1));end;
+		dof=doflist(3); %z degree of freedom
+		pe.row_indices(i)=dof;
+	end
+
+	if bed_is_present, bed=bed_list(1:3); else bed=pentaelem.b(1:3); end
+	if thickness_is_present, thickness=thickness_list(1:3); else thickness=pentaelem.h(1:3); end
+	if melting_is_present, melting=melting_list(1:3); else melting=pentaelem.melting(1:3); end
+	if accumulation_is_present, accumulation=accumulation_list(1:3); else accumulation=pentaelem.accumulation(1:3); end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	%for icesheets
+	for ig=1:num_gauss2D,
+	
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		
+		%Get melting at gaussian point.
+		melting_gauss=GetParameterValue(triaelem,melting,gauss_coord);
+		
+		%Get velocity at gaussian point.
+		vx=GetParameterValue(triaelem,vxvy_list(:,1),gauss_coord);
+		vy=GetParameterValue(triaelem,vxvy_list(:,2),gauss_coord);
+
+		%Get bed slope
+		db=GetParameterDerivativeValue(triaelem,bed,xyz_list,gauss_coord);
+		dbdx=db(1);
+		dbdy=db(2);
+
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L: 
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+
+		%Build gaussian vector 
+		pe_g_basevert_gaussian=Jdettria*gauss_weight*(vx*dbdx+vy*dbdy-melting_gauss)*L';
+
+		%Add Ke_gg_drag_gaussian to Ke
+		pe.terms=pe.terms+pe_g_basevert_gaussian;
+	end
+
+	%for iceshelves, vertical velocity at the base is determined using the hydrostatic equilibrium -> we add a corrective term 
+	%to the icesheet term.
+	if pentaelem.shelf,
+
+		%build the vector thickness*velocity_average
+		HU=thickness.*vxvy_average_list(:,1);
+		HV=thickness.*vxvy_average_list(:,2);
+
+		for ig=1:num_gauss2D,
+	
+			%Pick up the gaussian point and its weight:
+			gauss_weight=gauss_weights(ig);
+			gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+			
+			%get div(H*Vel)
+			dHU=GetParameterDerivativeValue(triaelem,HU,xyz_list,gauss_coord);
+			dHV=GetParameterDerivativeValue(triaelem,HV,xyz_list,gauss_coord);
+			divHVel=dHU(1)+dHV(2);
+
+			%Get melting and accumulation at gaussian point.
+			melting_gauss=GetParameterValue(triaelem,melting,gauss_coord);
+			accumulation_gauss=GetParameterValue(triaelem,accumulation,gauss_coord);
+
+			%Get L: 
+			L=GetL(triaelem,gauss_coord,DOFPERGRID);
+
+			%Get the Jacobian determinant
+			Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+			%Build gaussian vector 
+			pe_g_basevert_iceshelf_gaussian=Jdettria*gauss_weight*(-di*(-divHVel+accumulation_gauss-melting_gauss))*L';
+			
+			%Add Ke_gg_drag_gaussian to Ke
+			pe.terms=pe.terms+pe_g_basevert_iceshelf_gaussian;
+		end
+	end
+end %end function
+
+function pe=CreatePVectorVert(pentaelem,grids,materials,inputs);
+
+	%some variables
+	numgrids=6;
+	NDOF1=1;
+	NDOF2=2;
+
+	%Create elementary vector.
+	pe=elemvector(numgrids*NDOF1);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	if ~velocity_is_present,
+		error('CreatePVector error message: no input velocity!');
+	end
+
+	%initialize velocity array
+	vxvy_list=zeros(numgrids,2);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist;
+		for j=1:NDOF2,
+			dof=doflist(j);
+			vxvy_list(i,j)=velocity_param(dof);
+		end
+		dof=doflist(3);
+		pe.row_indices(i)=dof;
+	end
+
+	% Get gaussian points and weights 
+	area_order=2;
+	num_vert_gauss=2;
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+	    for igvert=1:num_vert_gauss,
+		%Pick up the gaussian point and its weight:
+		gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+		gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+
+		%Get velocity derivative, with respect to x and y: 
+		dudx=GetParameterDerivativeValue(pentaelem,vxvy_list(:,1),xyz_list,gauss_coord); dudx=dudx(1);
+		dvdy=GetParameterDerivativeValue(pentaelem,vxvy_list(:,2),xyz_list,gauss_coord); dvdy=dvdy(2);
+
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+		%disp(sprintf('Jacobian determinant: %f\n', Jdet));
+
+		%Get nodal functions
+		l1l6=GetNodalFunctions(pentaelem,gauss_coord);
+
+	    pe.terms=pe.terms+l1l6'*(dudx+dvdy)*Jdet*gauss_weight;
+
+	    end %for ig=1:num_area_gauss,
+	end %for ig=1:num_vert_gauss,
+
+end %end function
+
+function pe=CreatePVectorThermal(pentaelem,grids,materials,inputs)
+
+	%some variables
+	NDOF1=1;
+	numgrids=6;
+
+	%Create elementary vector.
+	pe=elemvector(numgrids*NDOF1);
+
+	%recover material parameters
+	matice=materials(pentaelem.matid).material;
+	matpar=materials(end).constants;
+
+	rho_ice=matpar.rho_ice;
+	rho_water=matpar.rho_water;
+	gravity=matpar.g;
+	heatcapacity=matpar.heatcapacity;
+	beta=matpar.beta;
+	meltingpoint=matpar.meltingpoint;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+	[basal_drag_param basal_drag_is_present]=recover_input(inputs,'drag');
+	[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+	[surface_param surface_is_present]=recover_input(inputs,'surface');
+	[bed_param bed_is_present]=recover_input(inputs,'bed');
+	[temperature_param temperature_is_present]=recover_input(inputs,'temperature');
+	[dt dt_is_present]=recover_input(inputs,'dt');
+	[pressure_param pressure_is_present]=recover_input(inputs,'pressure');
+	
+	%we need velocities to compute thermal profiles (even if it is a zero 
+	%vector). 
+	if ~velocity_is_present,
+		error('CreatePVectorThermal error message: input velocity not present!');
+	end
+	if ~dt_is_present & ~pentaelem.thermal_steadystate,
+		error('CreatePVectorThermal error message: transient thermal solution requires present of time step as parameter!');
+	end
+	if ~temperature_is_present & ~pentaelem.thermal_steadystate,
+		error('CreatePVectorThermal error message: transient thermal solution requires temperature at previous iteration!');
+	end
+	if ~pressure_is_present,
+		error('CreatePVectorThermal error message: thermal solution requires pressure');
+	end
+
+
+
+	%initialize vxvyvz_list
+	vxvyvz_list=zeros(numgrids,3); 
+	B_list=zeros(numgrids,1);
+	K_list=zeros(numgrids,1);
+	thickness_list=zeros(numgrids,1);
+	surface_list=zeros(numgrids,1);
+	bed_list=zeros(numgrids,1);
+	temperature_list=zeros(numgrids,1);
+	pressure_list=zeros(numgrids,1);
+
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist;
+		for j=1:3,
+			dof=doflist(j);
+			vxvyvz_list(i,j)=velocity_param(dof);
+		end	
+		dof=doflist(1);
+		pe.row_indices(i)=dof;
+		if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+		if(basal_drag_is_present), K_list(i)=basal_drag_param(dof);end;
+		if(thickness_is_present) thickness_list(i)=thickness_param(dof);end;
+		if(surface_is_present) surface_list(i)=surface_param(dof);end;
+		if(bed_is_present) bed_list(i)=bed_param(dof);end;
+		if(temperature_is_present) temperature_list(i)=temperature_param(dof);end;
+		if (pressure_is_present) pressure_list(i)=pressure_param(dof); end;
+	end
+	vxvy_list= vxvyvz_list(:,1:2);
+
+	% Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 
+	%get tria gaussian points as well as segment gaussian points. For tria gaussian 
+	%points, order of integration is 2, because we need to integrate the product tB*D*B' 
+	%which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian 
+	%points, same deal, which yields 3 gaussian points.
+	area_order=2;
+	num_vert_gauss=3;
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		for igvert=1:num_vert_gauss,
+			%Pick up the gaussian point and its weight:
+			gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+			gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+		   
+			%Update material if temperature is provided
+			if temperature_is_present,
+				temperature=GetParameterValue(pentaelem,temperature_list,gauss_coord);
+				matice.B=paterson(temperature);
+			end
+ 
+			%Build Deformational heating
+			epsilon=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord);
+			viscosity=GetViscosity3d(matice,epsilon); 
+
+			%Build the strain rate matrix
+			epsilon_matrix=[epsilon(1) epsilon(4) epsilon(5)
+					epsilon(4) epsilon(2) epsilon(6)
+					epsilon(5) epsilon(6) epsilon(3)];
+
+			epsilon_e=effective_value(epsilon_matrix);
+
+			phi=2*viscosity*epsilon_e^2;
+
+			%Get Jacobian determinant:
+			Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+
+			%Get nodal functions
+			l1l6=GetNodalFunctions(pentaelem,gauss_coord);
+
+			%Build pe_gaussian vector:
+			pe_gaussian_deformational=zeros(numgrids*NDOF1,1);
+
+			if pentaelem.thermal_steadystate,
+				pe_gaussian_deformational=phi/(rho_ice*heatcapacity)*Jdet*gauss_weight*l1l6';
+			else
+				pe_gaussian_deformational=dt*phi/(rho_ice*heatcapacity)*Jdet*gauss_weight*l1l6';
+			end
+
+			%transient
+			if pentaelem.thermal_steadystate,
+				pe_gaussian_transient=0;
+			else
+				pe_gaussian_transient=temperature*Jdet*gauss_weight*l1l6';
+			end
+
+			%*Add pe_gaussian vector to pe:
+			pe.terms=pe.terms+pe_gaussian_deformational+pe_gaussian_transient;
+
+		end %for ig=1:vert_gauss,
+	end %for ig=1:num_area_gauss,
+
+	%Ice/ocean heat exchange flux on ice shelf base 
+	if (pentaelem.onbed & pentaelem.shelf),
+
+		%recover material parameters
+		mixed_layer_capacity=matpar.mixed_layer_capacity;
+		thermal_exchange_velocity=matpar.thermal_exchange_velocity;
+
+		%pressure of the 3 active grids
+		pressure_tria=pressure_list(1:3);
+
+		% Get gaussian points and weights.
+		[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+		for ig=1:num_gauss2D,
+
+			%Pick up the gaussian point and its weight:
+			gauss_weight=gauss_weights(ig);
+			gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+			
+			%Get the Jacobian determinant
+			xyz_list_tria=xyz_list(1:3,:);
+			Jdettria=GetJacobianDeterminant(triaelem,xyz_list_tria,gauss_coord);
+			
+			%Get nodal functions value
+			l1l2l3=GetNodalFunctions(triaelem,gauss_coord);
+
+			%Calculate pressure melting point at gaussian point
+			pressure_g=GetParameterValue(triaelem,pressure_tria,gauss_coord);
+			t_pmp=meltingpoint-beta*pressure_g;
+
+			%Compute the elementary load vector
+			if pentaelem.thermal_steadystate,
+				pe_ocean_gaussian=gauss_weight*Jdettria*rho_water*mixed_layer_capacity*thermal_exchange_velocity*t_pmp/(heatcapacity*rho_ice)*l1l2l3';
+			else
+				pe_ocean_gaussian=dt*gauss_weight*Jdettria*rho_water*mixed_layer_capacity*thermal_exchange_velocity*t_pmp/(heatcapacity*rho_ice)*l1l2l3';
+			end
+
+			%Add Ke_gg_drag_gaussian to Ke
+			pe.terms(1:3)=pe.terms(1:3)+pe_ocean_gaussian;
+		end
+	end%ends ice/ocean exchange flux 
+
+	%Geothermal flux on ice sheet base and basal friction G+tau_b.ub
+	if (pentaelem.onbed & ~pentaelem.shelf),
+
+		%Plug the grids on bed into the triaelem
+		geothermalflux=pentaelem.geothermalflux(1:3,1);
+
+		%Get the basal friction tau_b.u_b=alpha2*ub^2
+		basal_friction=zeros(3,1);
+		if (pentaelem.friction_type==2),  %friction_type=2 implies viscous, friction_type=1 implies plastic
+
+			%Retrieve some parameters needed to compute alpha2 (taub=alpha2*ub)
+			frictionparameters=struct();
+			frictionparameters.element_type='3d';
+			frictionparameters.rho_ice=rho_ice;
+			frictionparameters.rho_water=rho_water;
+			frictionparameters.g=gravity;	
+			frictionparameters.p=pentaelem.p;
+			frictionparameters.q=pentaelem.q;
+			frictionparameters.velocities=vxvy_list(1:3,:);
+
+			if thickness_is_present,
+				frictionparameters.h=thickness_list(1:3,:);
+			else
+				frictionparameters.h=pentaelem.h(1:3,:);
+			end
+			if(bed_is_present),
+				frictionparameters.b=bed_list(1:3,:);
+			else
+				frictionparameters.b=pentaelem.b(1:3,:);
+			end
+			if basal_drag_is_present,
+				frictionparameters.k=K_list(1:3,:);
+			else
+				frictionparameters.k=pentaelem.k(1:3,:);
+			end
+
+			alpha2=Getalpha2(frictionparameters);
+	
+			%We need the velocity magnitude to evaluate the basal stress:
+			u_b2=vxvy_list(1:3,1).^2+vxvy_list(1:3,2).^2;
+
+			%Compute basal friction
+			basal_friction=alpha2.*u_b2;
+		end
+
+		% Get gaussian points and weights.
+		[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+		for ig=1:num_gauss2D,
+
+			%Pick up the gaussian point and its weight:
+			gauss_weight=gauss_weights(ig);
+			gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+			
+			%Get the Jacobian determinant
+			xyz_list_tria=xyz_list(1:3,:);
+			Jdettria=GetJacobianDeterminant(triaelem,xyz_list_tria,gauss_coord);
+			
+			%Get geothermal flux and basal friction
+			G_g=GetParameterValue(triaelem,geothermalflux,gauss_coord);
+			basal_friction_g=GetParameterValue(triaelem,basal_friction,gauss_coord);
+			
+			%Get nodal functions value
+			l1l2l3=GetNodalFunctions(triaelem,gauss_coord);
+
+			%Compute the elementary load vector
+			if pentaelem.thermal_steadystate,
+				pe_geo_gaussian=gauss_weight*Jdettria*(basal_friction_g+G_g)/(heatcapacity*rho_ice)*l1l2l3';
+			else
+				pe_geo_gaussian=dt*gauss_weight*Jdettria*(basal_friction_g+G_g)/(heatcapacity*rho_ice)*l1l2l3';
+			end
+
+			%Add Ke_gg_drag_gaussian to Ke
+			pe.terms(1:3)=pe.terms(1:3)+pe_geo_gaussian;
+		end
+	end%ends geothermal 
+
+
+end %end function
+
+
+function pe=CreatePVectorHoriz(pentaelem,grids,materials,inputs,analysis_type);
+
+	%Figure out if this pentaelem is collapsed. If so, then bailout, except if it is at the 
+	%bedrock, in which case we spawn a tria element using the 3 first grids, and use it to build 
+	%the load vector
+
+	if pentaelem.collapse & ~pentaelem.onbed
+
+		pe=elemvector(0);
+		return;
+
+	elseif pentaelem.collapse & pentaelem.onbed
+
+		%we collapse the penta into its base tria, and use the tria to build the stiffness matrix.
+		element=triaelem;
+		element.type='triaelem';
+		element.id=NaN; %not needed here, we are going to destroy this triaelem very soon.
+		element.matid=pentaelem.matid; %same materials, not dependent on element.
+		element.g=pentaelem.g(1:3); %first three grids correspond to the base of the penta element.
+		element.h=pentaelem.h(1:3);
+		element.s=pentaelem.s(1:3);
+		element.b=pentaelem.b(1:3);
+		element.friction_type=pentaelem.friction_type;
+		element.k=pentaelem.k(1:3);
+		element.p=pentaelem.p;
+		element.q=pentaelem.q;
+		element.shelf=pentaelem.shelf;
+		element.meanvel=pentaelem.meanvel;
+		element.epsvel=pentaelem.epsvel;
+		element.acceleration=pentaelem.acceleration;
+
+		%Call CreateKMatrix for this new element.
+		pe=CreatePVector(element,grids,materials,inputs,analysis_type);
+
+		%That's it, element will get destroyed upon return, and we have the correct 
+		%collapsed stiffness matrix. 
+		return;
+
+	else 
+
+		%implement standard penta element.
+
+			
+		%some variables
+		numgrids=6;
+		numgrids2d=3;
+		NDOF2=2;
+
+		%Create elementary vector.
+		pe=elemvector(numgrids*NDOF2);
+
+		%recover material
+		matice=materials(pentaelem.matid).material;
+		matpar=materials(end).constants;
+
+		%recover material parameters
+		gravity=matpar.g;
+		rho_ice=matpar.rho_ice;
+		rho_water=matpar.rho_water;
+
+		%recover extra inputs
+		[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+		[surface_param surface_is_present]=recover_input(inputs,'surface');
+		[bed_param bed_is_present]=recover_input(inputs,'bed');
+		[melting_param melting_is_present]=recover_input(inputs,'melting');
+		[basal_drag_param basal_drag_is_present]=recover_input(inputs,'drag');
+	
+		%Get all element grid data:
+		xyz_list=getgriddata(pentaelem,grids);
+		
+		%Initialize inputs
+		basal_drag_list=zeros(numgrids,1);
+		melting_list=zeros(numgrids,1);
+		thickness_list=zeros(numgrids,1);
+		surface_list=zeros(numgrids,1);
+		bed_list=zeros(numgrids,1);
+		temperature_list=zeros(numgrids,1);
+
+		%Build row indices for elementary vector.
+		for i=1:numgrids,
+			
+			doflist=grids(pentaelem.g(i)).grid.doflist;
+			for j=1:NDOF2,
+				pe.row_indices((i-1)*NDOF2+j)=doflist(j);
+			end
+			dof=doflist(1);
+			if(thickness_is_present) thickness_list(i)=thickness_param(dof);end;
+			if(surface_is_present) surface_list(i)=surface_param(dof);end;
+			if(bed_is_present) bed_list(i)=bed_param(dof);end;
+			if(melting_is_present) melting_list(i)=melting_param(dof);end;
+			if(basal_drag_is_present) basal_drag_list(i)=basal_drag_param(dof);end;
+
+		end
+
+%We consider that we have hydrostatic equilibrium for Pattyn's model, so no reason to have a water pressure ... to decide !!!
+%		%Deal with water pressure integration: 
+%
+%		if (pentaelem.onbed==1 & pentaelem.shelf==1),
+%			
+%			%Create the element at the upper base of pentaelem, which is a triangle
+%			triabed=triaelem;
+%
+%			%Plug the grids on surface into the triaelem
+%			triabed.g=pentaelem.g(1:3);
+%			if thickness_is_present,
+%				triabed.h=thickness_list(1:3);
+%			else			
+%				triabed.h=pentaelem.h(1:3);
+%			end
+%			if bed_is_present,
+%				triabed.b=bed_list(1:3);
+%			else			
+%				triabed.b=pentaelem.b(1:3);
+%			end
+%			if basal_drag_is_present,
+%				triabed.k=basal_drag_list(1:3);
+%			else			
+%				triabe.k=pentaelem.k(1:3);
+%			end
+%
+%
+%			%Get the coordinates of the three grids
+%			xyz_list_tria=xyz_list(1:3,:);
+%
+%			% Get gaussian points and weights.
+%			[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+%
+%			%Build normal vector to the surface
+%			n=zeros(2,1);
+%			normal=cross((xyz_list_tria(1,:)-xyz_list_tria(3,:)),(xyz_list_tria(2,:)-xyz_list_tria(3,:)));
+%			n(1)=1/norm(normal)*normal(1);
+%			n(2)=1/norm(normal)*normal(2);
+%
+%			for ig=1:num_gauss2D,
+%
+%				%Pick up the gaussian point and its weight:
+%				gauss_weight=gauss_weights(ig);
+%				gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+%				
+%				%Get the Jacobian determinant
+%				Jdettria=GetJacobianDeterminant(triabed,xyz_list_tria,gauss_coord);
+%
+%				%Get thickness and bed at gaussian point
+%				thickness_gg=GetParameterValue(triabed,triabed.h,gauss_coord);
+%				bed_gg=GetParameterValue(triabed,triabed.b,gauss_coord);
+%				
+%				%Get L matrix 
+%				L=GetL(triabed,gauss_coord,1);
+%		   
+%				%Calculate pressure
+%				pressure=gravity*(rho_ice*thickness_gg+rho_water*bed_gg)*gauss_weight*Jdettria;
+%
+%				%Calculate elementary load vector
+%				for i=1:numgrids2d,
+%				    for j=1:NDOF2,
+%					pe_gg_water((i-1)*NDOF2+j)=pressure*L(i)*n(j);
+%				    end
+%				end
+%
+%				%Add pe_gaussian vector to pe:
+%				for i=1:numgrids2d*NDOF2,
+%					pe.terms(i)=pe.terms(i)+pe_gg_water(i);
+%				end
+%			end
+%		end%ends of water pressure
+
+		% Get gaussian points and weights 
+		area_order=2;
+		num_vert_gauss=3;
+		[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+		%for i=1:num_gauss,
+		%	disp(sprintf('Gauss coord %i: %f %f %f Weight: %f\n',i,first_gauss_area_coord(i),second_gauss_area_coord(i),third_gauss_area_coord(i),gauss_weights(i)));
+		%end
+
+		%Start  looping on the number of gaussian points:
+		for igarea=1:num_area_gauss,
+			for igvert=1:num_vert_gauss,
+				%Pick up the gaussian point and its weight:
+				gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+				gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+			    
+				%Compute thickness at gaussian point from t1,t2 and t3 fields in the element itself
+				if thickness_is_present,
+					thickness=GetParameterValue(pentaelem,thickness_list,gauss_coord);
+				else
+					thickness=GetParameterValue(pentaelem,pentaelem.h,gauss_coord);
+				end
+				%disp(sprintf('Thickness: %f\n', thickness));
+
+				if surface_is_present,
+					slope=GetParameterDerivativeValue(pentaelem,surface_list,xyz_list,gauss_coord);
+				else
+					slope=GetParameterDerivativeValue(pentaelem,pentaelem.s,xyz_list,gauss_coord);
+				end
+				%disp(sprintf('Slope: sx %f sy %f\n',slope(1),slope(2)));
+
+				%In case we have plastic basal drag, compute plastic stress at gaussian point from k1, k2 and k3 fields in the 
+				%element itself: 
+				if (~pentaelem.shelf) & (pentaelem.friction_type==1),
+					if basal_drag_is_present,
+						plastic_stress=GetParameterValue(pentaelem,basal_drag_list,gauss_coord);
+					else			
+						plastic_stress=GetParameterValue(pentaelem,pentaelem.k,gauss_coord);
+					end
+				end
+
+				%Get Jacobian determinant:
+				Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+				%disp(sprintf('Jacobian determinant: %f\n', Jdet));
+
+				%Get nodal functions
+				l1l6=GetNodalFunctions(pentaelem,gauss_coord);
+
+				%Compute driving stress: 
+				driving_stress_baseline=rho_ice*gravity;
+
+				%Build pe_gaussian vector:
+				pe_gaussian=zeros(numgrids*NDOF2,1);
+
+				if(~pentaelem.shelf) & (pentaelem.friction_type==1),
+					for i=1:numgrids,
+						for j=1:NDOF2,
+							pe_gaussian((i-1)*NDOF2+j)=(-driving_stress_baseline*slope(j)-plastic_stress)*Jdet*gauss_weight*l1l6(i);
+						end
+					end
+				else
+					for i=1:numgrids,
+						for j=1:NDOF2,
+							pe_gaussian((i-1)*NDOF2+j)=-driving_stress_baseline*slope(j)*Jdet*gauss_weight*l1l6(i);
+						end
+					end
+				end
+
+				%Add pe_gaussian vector to pe:
+				for i=1:pe.nrows,
+					pe.terms(i)=pe.terms(i)+pe_gaussian(i);
+				end
+
+			end %for ig=1:num_area_gauss,
+		end %for ig=1:num_vert_gauss,
+	end % elseif pentaelem.collapse & pentaelem.onbed
+end %end function
+
+
+
+
+function pe=CreatePVectorPrognostic(pentaelem,grids,materials,inputs);
+
+	%We are dealing with a collapsed formulation on the lower triangle of the penta, 
+	%only on the bedrock.
+	if pentaelem.onbed~=1,
+		pe=elemvector(0);
+		return;
+	end
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	%Create elementary stiffness matrix 
+	pe=elemvector(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids); 
+
+	%Just keep the first 3 grids
+	xyz_list=xyz_list(1:3,:);
+
+	%recover extra inputs from users, at current convergence iteration.
+	[accumulation_param accumulation_is_present]=recover_input(inputs,'accumulation');
+	[melting_param melting_is_present]=recover_input(inputs,'melting');
+	[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+	[dt dt_is_present]=recover_input(inputs,'dt');
+
+	%check on all parameters
+	if ( ~accumulation_is_present | ~melting_is_present | ~thickness_is_present | ~dt_is_present),
+		error('CreateKMatrixPrognostic error message: missing input parameters!');
+	end
+		
+	%initialize parameter lists (for our 3 grids)
+	thickness_list=zeros(numgrids,1);
+	accumulation_list=zeros(numgrids,1);
+	melting_list=zeros(numgrids,1);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		dof=doflist(1); %first degree of freedom
+		
+		pe.row_indices(i)=dof;
+	
+		%recover thickness_list on first dof of every grid.
+		thickness_list(i)=thickness_param(dof);
+		melting_list(i)=melting_param(dof);
+		accumulation_list(i)=accumulation_param(dof);
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	for ig=1:num_gauss2D,
+	
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		
+		%Get melting at gaussian point
+		melting=GetParameterValue(triaelem,melting_list,gauss_coord);
+	
+		%Get accumulation at gaussian point
+		accumulation=GetParameterValue(triaelem,accumulation_list,gauss_coord);
+
+		%Get thickness at gaussian point
+		thickness=GetParameterValue(triaelem,thickness_list,gauss_coord);
+
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L: 
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+
+		%Build gaussian vector 
+		pe_g_gaussian=Jdettria*gauss_weight*(thickness+dt*(accumulation-melting))*L';
+
+		%Add Ke_gg_drag_gaussian to Ke
+		pe.terms=pe.terms+pe_g_gaussian;
+	end
+
+end %end function
Index: /issm/trunk/src/m/classes/@pentaelem/DeviatoricStress.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/DeviatoricStress.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/DeviatoricStress.m	(revision 1)
@@ -0,0 +1,80 @@
+function deviatoricstress=DeviatoricStress(pentaelem,grids,materials,inputs)
+%DEVIATORICSTRESS - computes the deviatoric stress of a pentaelem
+% 
+%   Usage:
+%      deviatoricstress=DeviatoricStress(pentaelem,grids,materials,inputs)
+
+	%initialize
+	deviatoricstress=zeros(6,1);
+	volume=0;
+
+	%some variables
+	NDOF1=1;
+	numgrids=6;
+
+	%recover material parameters
+	matice=materials(pentaelem.matid).material;
+	B=matice.B;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+
+	%we need velocities to compute thermal profiles (even if it is a zero 
+	%vector). 
+	if ~velocity_is_present,
+		error('DeviatoricStress error message: input velocity not present!');
+	end
+
+	%initialize vxvyvz_list
+	vxvyvz_list=zeros(numgrids,3);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist;
+		for j=1:3,
+			dof=doflist(j);
+			vxvyvz_list(i,j)=velocity_param(dof);
+		end
+		dof=doflist(1);
+		if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	end
+	
+	%Update material parameter that deals with ice rigidity: 
+	if flow_law_is_present,
+		B_param=GetParameterValue(pentaelem,B_list,gauss_coord);
+		matice.B=B_param; clear B_param.
+	end
+	
+	% Get gaussian points and weights 
+	area_order=2;
+	num_vert_gauss=2;
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		for igvert=1:num_vert_gauss,
+
+			%Pick up the gaussian point and its weight:
+			gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+			gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+		    
+			%Build Stress
+			strainrate_g=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord);
+			viscosity=GetViscosity3d(matice,strainrate_g);
+			deviatoricstress_g=viscosity*strainrate_g;
+
+			%Get Jacobian determinant:
+			Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+
+			deviatoricstress=deviatoricstress+deviatoricstress_g*Jdet*gauss_weight;
+			volume=volume+Jdet*gauss_weight;
+
+		end %for ig=1:vert_gauss,
+	end %for ig=1:num_area_gauss,
+
+%Divide deviatoricstress, integrated over volume, by volume.
+deviatoricstress=deviatoricstress/volume;
Index: /issm/trunk/src/m/classes/@pentaelem/GetBStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetBStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetBStokes.m	(revision 1)
@@ -0,0 +1,67 @@
+function B=GetBStokes(pentaelem,xyz_list,gauss_coord)
+%GETBSTOKES - computes the B matrix for Stokes' diagnostic
+%
+%   Compute B  matrix. B=[B1 B2 B3 B4 B5 B6 Bb] where Bi is of size numgrids*NDOF
+%   For grid i, Bi can be expressed in the basic coordinate system by:
+%   Bi_basic=[ dh/dx          0             0       0  ]
+%            [   0           dh/dy           0       0  ]
+%            [   0             0           dh/dy     0  ]
+%            [ 1/2*dh/dy    1/2*dh/dx        0       0  ]
+%            [ 1/2*dh/dz       0         1/2*dh/dx   0  ]
+%            [   0          1/2*dh/dz    1/2*dh/dy   0  ]
+%            [   0             0             0       h  ]
+%            [ dh/dx         dh/dy         dh/dz     0  ]
+%   where h is the interpolation function for grid i.
+%   Same thing for Bb except the last column that does not exist.
+% 
+%   Usage:
+%      B=GetBStokes(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETBPRIMESTOKES, CREATEKMATRIX
+
+	num_grids=6;	 % the bubble in not included
+	NDOF4=4;
+
+	l1l6=GetNodalFunctions(pentaelem, gauss_coord);
+	dh1dh7_basic=GetNodalFunctionsDerivativesBasicStokes(pentaelem,xyz_list,gauss_coord);
+
+	%Build B:
+	B=zeros(8,NDOF4*num_grids+3);
+	for i=1:num_grids+1,
+		B(1,NDOF4*(i-1)+1)=dh1dh7_basic(1,i);
+		B(1,NDOF4*(i-1)+2)=0;
+		B(1,NDOF4*(i-1)+3)=0;
+
+		B(2,NDOF4*(i-1)+1)=0;
+		B(2,NDOF4*(i-1)+2)=dh1dh7_basic(2,i);
+		B(2,NDOF4*(i-1)+3)=0;
+
+		B(3,NDOF4*(i-1)+1)=0;
+		B(3,NDOF4*(i-1)+2)=0;
+		B(3,NDOF4*(i-1)+3)=dh1dh7_basic(3,i);
+
+		B(4,NDOF4*(i-1)+1)=dh1dh7_basic(2,i)/2;
+		B(4,NDOF4*(i-1)+2)=dh1dh7_basic(1,i)/2;	
+		B(4,NDOF4*(i-1)+3)=0;
+
+		B(5,NDOF4*(i-1)+1)=dh1dh7_basic(3,i)/2;
+		B(5,NDOF4*(i-1)+2)=0;
+		B(5,NDOF4*(i-1)+3)=dh1dh7_basic(1,i)/2;
+
+		B(6,NDOF4*(i-1)+1)=0;
+		B(6,NDOF4*(i-1)+2)=dh1dh7_basic(3,i)/2;
+		B(6,NDOF4*(i-1)+3)=dh1dh7_basic(2,i)/2;
+
+		B(7,NDOF4*(i-1)+1)=0;
+		B(7,NDOF4*(i-1)+2)=0;
+		B(7,NDOF4*(i-1)+3)=0;
+
+		B(8,NDOF4*(i-1)+1)=dh1dh7_basic(1,i);
+		B(8,NDOF4*(i-1)+2)=dh1dh7_basic(2,i);
+		B(8,NDOF4*(i-1)+3)=dh1dh7_basic(3,i);
+	end
+	
+	%Add the columns corresponding to pressure (not for the bubble)
+	for i=1:num_grids,
+		B(7,NDOF4*(i-1)+4)=l1l6(i);
+	end
Index: /issm/trunk/src/m/classes/@pentaelem/GetB_advec.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetB_advec.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetB_advec.m	(revision 1)
@@ -0,0 +1,27 @@
+function B=GetB_advec(pentaelem,gauss_coord)
+%GETB_ADVEC - compute the B matrix for advection in thermal model
+%
+%   Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size numgrids*NDOF
+%	 For grid i, Bi can be expressed in the basic coordinate system by :
+%   Bi_basic=[Li]
+%            [Li]
+%            [Li]
+%	 where h is the interpolation function for grid i.
+%
+%   Usage:
+%      B=GetB_advec(pentaelem,gauss_coord)
+%
+%   See also GETB_CONDUCT, GETBPRIME_ADVEC, CREATEKMATRIX
+
+num_grids=6;	
+
+l1l6=GetNodalFunctions(pentaelem,gauss_coord);
+    
+%Build B:
+B=zeros(3,num_grids);
+    
+for i=1:num_grids,
+	B(1,i)=l1l6(i);
+	B(2,i)=l1l6(i);
+	B(3,i)=l1l6(i);
+end
Index: /issm/trunk/src/m/classes/@pentaelem/GetB_conduct.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetB_conduct.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetB_conduct.m	(revision 1)
@@ -0,0 +1,25 @@
+function B=GetB_conduct(pentaelem,xyz_list,gauss_coord)
+%GETB_CONDUCT - compute the B matrix for conduction in thermal model
+%
+%   Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size numgrids*NDOF
+%   For grid i, Bi can be expressed in the basic coordinate system by:
+%   Bi_basic=[dh/dx]
+%            [dh/dy]
+%            [dh/dz]
+%   where h is the interpolation function for grid i.
+%
+%   Usage:
+%      B=GetB_conduct(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETB_ADVEC, GETBPRIME_ADVEC, CREATEKMATRIX
+
+num_grids=6;	
+
+dh1dh6_basic=GetNodalFunctionsDerivativesBasic(pentaelem,xyz_list,gauss_coord);
+%Build B:
+B=zeros(3,num_grids);
+for i=1:num_grids,
+	B(1,i)=dh1dh6_basic(1,i);
+	B(2,i)=dh1dh6_basic(2,i);
+	B(3,i)=dh1dh6_basic(3,i);
+end
Index: /issm/trunk/src/m/classes/@pentaelem/GetB_horiz.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetB_horiz.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetB_horiz.m	(revision 1)
@@ -0,0 +1,35 @@
+function B=GetB_horiz(pentaelem,xyz_list,gauss_coord)
+%GETB_HORIZ - compute the B matrix for the horizontal velocity of Pattyn's model
+%
+%   Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size numgrids*NDOF
+%   For grid i, Bi can be expressed in the basic coordinate system by:
+%   Bi_basic=[ dh/dx          0     ]
+%            [   0          dh/dy   ]
+%            [ 1/2*dh/dy  1/2*dh/dx ]
+%            [ 1/2*dh/dz      0     ]
+%            [   0        1/2*dh/dz ]
+%   where h is the interpolation function for grid i.
+%
+%   Usage:
+%      B=GetB_horiz(pentaelem,xyz_list,gauss_coord)
+% 
+%   See also GETBPRIME_HORIZ, CREATEKMATRIX
+
+	num_grids=6;	
+	NDOF2=2;
+
+	dh1dh6_basic=GetNodalFunctionsDerivativesBasic(pentaelem,xyz_list,gauss_coord);
+	%Build B:
+	B=zeros(5,NDOF2*num_grids);
+	for i=1:num_grids,
+		B(1,NDOF2*(i-1)+1)=dh1dh6_basic(1,i);
+		B(1,NDOF2*(i-1)+2)=0;
+		B(2,NDOF2*(i-1)+1)=0;
+		B(2,NDOF2*(i-1)+2)=dh1dh6_basic(2,i);
+		B(3,NDOF2*(i-1)+1)=dh1dh6_basic(2,i)/2;
+		B(3,NDOF2*(i-1)+2)=dh1dh6_basic(1,i)/2;	
+		B(4,NDOF2*(i-1)+1)=dh1dh6_basic(3,i)/2;
+		B(4,NDOF2*(i-1)+2)=0;
+		B(5,NDOF2*(i-1)+1)=0;
+		B(5,NDOF2*(i-1)+2)=dh1dh6_basic(3,i)/2;
+	end
Index: /issm/trunk/src/m/classes/@pentaelem/GetB_vert.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetB_vert.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetB_vert.m	(revision 1)
@@ -0,0 +1,17 @@
+function B=GetB_vert(pentaelem,xyz_list,gauss_coord)
+%GETB_VERT - compute the B matrix for vertical velocity of diagnostic
+%
+%   Compute B  matrix. B=[dh1/dz dh2/dz dh3/dz dh4/dz dh5/dz dh6/dz];
+%   where hi is the interpolation function for grid i.
+%
+%   Usage:
+%      B=GetB_vert(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETBPRIME_VERT, CREATEKMATRIX 
+
+	dh1dh6_basic=GetNodalFunctionsDerivativesBasic(pentaelem,xyz_list,gauss_coord);
+	%Build B:
+	B=zeros(1,6);
+	for i=1:6,
+		B(1,i)=dh1dh6_basic(3,i);
+	end
Index: /issm/trunk/src/m/classes/@pentaelem/GetBprimeStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetBprimeStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetBprimeStokes.m	(revision 1)
@@ -0,0 +1,69 @@
+function Bprime=GetBprimeStokes(pentaelem,xyz_list,gauss_coord)
+%GETBPRIMESTOKES - computes the Bprime matrix for Stokes' diagnostic
+%
+%   Compute B'  matrix. B'=[B1' B2' B3' B4' B5' B6' Bb'] where Bi' is of size 3*NDOF2. 
+%   For grid i, Bi' can be expressed in the basic coordinate system by:
+%   Bi_basic'=[ dh/dx   0          0       0]
+%             [   0      dh/dy      0       0]
+%             [   0      0         dh/dz    0]
+%             [  dh/dy   dh/dx      0       0]
+%             [  dh/dz   0        dh/dx     0]
+%             [   0      dh/dz    dh/dy     0]
+%             [  dh/dx   dh/dy    dh/dz     0]
+%             [   0      0          0       h]
+%   where h is the interpolation function for grid i.
+%
+%   Same thing for the bubble fonction except that there is no fourth column
+%
+%   Usage:
+%      Bprime=GetBprimeStokes(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETBSTOKES, CREATEKMATRIX
+
+	num_grids=6;%bubble function not included	
+	NDOF4=4;
+
+	l1l6=GetNodalFunctions(pentaelem,gauss_coord);
+	dh1dh7_basic=GetNodalFunctionsDerivativesBasicStokes(pentaelem,xyz_list,gauss_coord);
+
+	%Build Bprime:
+	Bprime=zeros(8,NDOF4*num_grids+3);
+	for i=1:num_grids+1,
+		Bprime(1,NDOF4*(i-1)+1)=dh1dh7_basic(1,i);
+		Bprime(1,NDOF4*(i-1)+2)=0;
+		Bprime(1,NDOF4*(i-1)+3)=0;
+
+		Bprime(2,NDOF4*(i-1)+1)=0;
+		Bprime(2,NDOF4*(i-1)+2)=dh1dh7_basic(2,i);
+		Bprime(2,NDOF4*(i-1)+3)=0;
+
+		Bprime(3,NDOF4*(i-1)+1)=0;
+		Bprime(3,NDOF4*(i-1)+2)=0;
+		Bprime(3,NDOF4*(i-1)+3)=dh1dh7_basic(3,i);
+
+		Bprime(4,NDOF4*(i-1)+1)=dh1dh7_basic(2,i);
+		Bprime(4,NDOF4*(i-1)+2)=dh1dh7_basic(1,i);		
+		Bprime(4,NDOF4*(i-1)+3)=0;
+
+		Bprime(5,NDOF4*(i-1)+1)=dh1dh7_basic(3,i);
+		Bprime(5,NDOF4*(i-1)+2)=0;
+		Bprime(5,NDOF4*(i-1)+3)=dh1dh7_basic(1,i);
+
+		Bprime(6,NDOF4*(i-1)+1)=0;
+		Bprime(6,NDOF4*(i-1)+2)=dh1dh7_basic(3,i);
+		Bprime(6,NDOF4*(i-1)+3)=dh1dh7_basic(2,i);
+
+		Bprime(7,NDOF4*(i-1)+1)=dh1dh7_basic(1,i);
+		Bprime(7,NDOF4*(i-1)+2)=dh1dh7_basic(2,i);
+		Bprime(7,NDOF4*(i-1)+3)=dh1dh7_basic(3,i);
+
+		Bprime(8,NDOF4*(i-1)+1)=0;
+		Bprime(8,NDOF4*(i-1)+2)=0;
+		Bprime(8,NDOF4*(i-1)+3)=0;
+	end
+
+	%Added the column for pressure
+	for i=1:num_grids,
+		Bprime(8,NDOF4*(i-1)+4)=l1l6(i);
+
+	end
Index: /issm/trunk/src/m/classes/@pentaelem/GetBprime_advec.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetBprime_advec.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetBprime_advec.m	(revision 1)
@@ -0,0 +1,25 @@
+function B=GetBprime_advec(pentaelem,xyz_list,gauss_coord)
+%GETBPRIME_ADVEC - compute the Bprime matrix for advection in thermal model
+%
+%   Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size numgrids*NDOF
+%   For grid i, Bi can be expressed in the basic coordinate system by:
+%   Bi_basic=[dh/dx]
+%            [dh/dy]
+%            [dh/dz]
+%   where h is the interpolation function for grid i.
+%
+%   Usage:
+%      B=GetBprime_advec(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETB_CONDUCT, GETB_ADVEC, CREATEKMATRIX
+
+num_grids=6;	
+
+dh1dh6_basic=GetNodalFunctionsDerivativesBasic(pentaelem,xyz_list,gauss_coord);
+%Build B:
+B=zeros(3,num_grids);
+for i=1:num_grids,
+	B(1,i)=dh1dh6_basic(1,i);
+	B(2,i)=dh1dh6_basic(2,i);
+	B(3,i)=dh1dh6_basic(3,i);
+end
Index: /issm/trunk/src/m/classes/@pentaelem/GetBprime_horiz.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetBprime_horiz.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetBprime_horiz.m	(revision 1)
@@ -0,0 +1,37 @@
+function Bprime=GetBprime_horiz(pentaelem,xyz_list,gauss_coord)
+%GETBPRIME_HORIZ - compute the Bprime matrix for horizontal velocities in Pattyn's model
+%
+%   Compute B'  matrix. B'=[B1' B2' B3' B4' B5' B6'] where Bi' is of size 3*NDOF2. 
+%   For grid i, Bi' can be expressed in the basic coordinate system by:
+%   Bi_basic'=[ 2*dh/dx    dh/dy ]
+%             [   dh/dx   2*dh/dy]
+%             [   dh/dy   dh/dx  ]
+%             [   dh/dz      0   ]
+%             [   0       dh/dz  ]
+%   where h is the interpolation function for grid i.
+%
+%   Usage:
+%      Bprime=GetBprime_horiz(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETB_HORIZ, CREATEKMATRIX
+
+	num_grids=6;	
+	NDOF2=2;
+
+	dh1dh6_basic=GetNodalFunctionsDerivativesBasic(pentaelem,xyz_list,gauss_coord);
+
+	%Build Bprime:
+	Bprime=zeros(3,NDOF2*num_grids);
+	for i=1:num_grids,
+		Bprime(1,NDOF2*(i-1)+1)=2*dh1dh6_basic(1,i);
+		Bprime(1,NDOF2*(i-1)+2)=  dh1dh6_basic(2,i);
+		Bprime(2,NDOF2*(i-1)+1)=  dh1dh6_basic(1,i);
+		Bprime(2,NDOF2*(i-1)+2)=2*dh1dh6_basic(2,i);
+		Bprime(3,NDOF2*(i-1)+1)=dh1dh6_basic(2,i);
+		Bprime(3,NDOF2*(i-1)+2)=dh1dh6_basic(1,i);		
+		Bprime(4,NDOF2*(i-1)+1)=dh1dh6_basic(3,i);
+		Bprime(4,NDOF2*(i-1)+2)=0;
+		Bprime(5,NDOF2*(i-1)+1)=0;
+		Bprime(5,NDOF2*(i-1)+2)=dh1dh6_basic(3,i);
+
+	end
Index: /issm/trunk/src/m/classes/@pentaelem/GetBprime_vert.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetBprime_vert.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetBprime_vert.m	(revision 1)
@@ -0,0 +1,12 @@
+function Bprime=GetBprime_vert(pentaelem,gauss_coord);
+%GETBPRIME_VERT - compute the Bprime matrix for vertical velocity of diagnostic
+%
+%   This matrix corresponds exactly to the nodeal functions at gaussian point
+%
+%   Usage:
+%      Bprime=GetBprime_vert(pentaelem,gauss_coord)
+%
+%   See also GETB_VERT, CREATEKMATRIX, GETNODALFUNCTIONS
+
+%Get nodals functions in basic coordinate system: 
+Bprime=GetNodalFunctions(pentaelem,gauss_coord);
Index: /issm/trunk/src/m/classes/@pentaelem/GetJacobian.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetJacobian.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetJacobian.m	(revision 1)
@@ -0,0 +1,45 @@
+function J=GetJacobian(pentaelem,xyz_list,gauss_coord)
+%GETJACOBIAN - computes the jacobian for a pentaelem
+%
+%   Usage:
+%      J=GetJacobian(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETJACOBIANDETERMINANT, GETJACOBIANINVERT
+
+%The Jacobian is constant over the element, discard the gaussian points. 
+
+J=zeros(3,3);
+sqrt3=sqrt(3.0);
+
+%grids coordinates	
+coord1=xyz_list(1,:)';
+coord2=xyz_list(2,:)';
+coord3=xyz_list(3,:)';
+coord4=xyz_list(4,:)';
+coord5=xyz_list(5,:)';
+coord6=xyz_list(6,:)';
+
+%Gauss point coordinate in reference element
+r=gauss_coord(1,2) - gauss_coord(1,1);
+s= - 3.0/sqrt3 *(gauss_coord(1,1)+gauss_coord(1,2) - 2.0/3.0);
+zeta=gauss_coord(1,4);
+
+%Computation of the jacobian on this gauss point
+J(:,1)=1.0/4.0* (-coord1+coord2-coord4+coord5) + 1.0/4.0 *(coord1-coord2-coord4+coord5)*zeta;
+J(:,2)=sqrt3/12.0 *(-coord1-coord2+2*coord3-coord4-coord5+2*coord6) +  sqrt3/12.0* (coord1+coord2-2*coord3-coord4-coord5+2*coord6)*zeta;
+J(:,3)=1.0/4.0* (coord1-coord2-coord4+coord5)*r +  sqrt3/12.0 *(coord1+coord2-2*coord3-coord4-coord5+2*coord6)*s + 1/6.0 *(-coord1-coord2-coord3+coord4+coord5+coord6) ;
+
+%Faster than :
+%J(1,1)=1.0/4.0* (-x1+x2-x4+x5) + 1.0/4.0 *(x1-x2-x4+x5)*zeta;
+%J(2,1)=1.0/4.0 *(-y1+y2-y4+y5) + 1.0/4.0 *(y1-y2-y4+y5)*zeta;
+%J(3,1)=1.0/4.0 *(-z1+z2-z4+z5) + 1.0/4.0 *(z1-z2-z4+z5)*zeta;
+
+%J(1,2)=sqrt3/12.0 *(-x1-x2+2*x3-x4-x5+2*x6) +  sqrt3/12.0* (x1+x2-2*x3-x4-x5+2*x6)*zeta;
+%J(2,2)=sqrt3/12.0 *(-y1-y2+2*y3-y4-y5+2*y6) +  sqrt3/12.0* (y1+y2-2*y3-y4-y5+2*y6)*zeta;
+%J(3,2)=sqrt3/12.0 *(-z1-z2+2*z3-z4-z5+2*z6) +  sqrt3/12.0* (z1+z2-2*z3-z4-z5+2*z6)*zeta;
+
+%J(1,3)=1.0/4.0* (x1-x2-x4+x5)*r +  sqrt3/12.0 *(x1+x2-2*x3-x4-x5+2*x6)*s + 1/6.0 *(-x1-x2-x3+x4+x5+x6) ;
+%J(2,3)=1.0/4.0* (y1-y2-y4+y5)*r +  sqrt3/12.0 *(y1+y2-2*y3-y4-y5+2*y6)*s + 1/6.0 *(-y1-y2-y3+y4+y5+y6) ;
+%J(3,3)=1.0/4.0* (z1-z2-z4+z5)*r +  sqrt3/12.0 *(z1+z2-2*z3-z4-z5+2*z6)*s + 1/6.0 *(-z1-z2-z3+z4+z5+z6) ;
+
+
Index: /issm/trunk/src/m/classes/@pentaelem/GetJacobianDeterminant.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetJacobianDeterminant.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetJacobianDeterminant.m	(revision 1)
@@ -0,0 +1,13 @@
+function Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord),
+%GETJACOBIANDETERMINANT - computes the determinant of the jacobian for a pentaelem
+%
+%   Usage:
+%      Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETJACOBIAN, GETJACOBIANINVERT
+
+J=GetJacobian(pentaelem,xyz_list,gauss_coord);
+Jdet=det(J);
+if(Jdet<0),
+	error('negative jacobian determinant!')
+end
Index: /issm/trunk/src/m/classes/@pentaelem/GetJacobianInvert.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetJacobianInvert.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetJacobianInvert.m	(revision 1)
@@ -0,0 +1,12 @@
+function Jinv=GetJacobianInvert(pentaelem,xyz_list,gauss_coord)
+%GETJACOBIANINVERT - computes the invert of the jacobian for a pentaelem
+%
+%   Usage:
+%      Jinv=GetJacobianInvert(pentaelem,z_list,gauss_coord)
+%
+%   See also GETJACOBIAN, GETJACOBIANDETERMINANT
+
+%Call Jacobian routine to get the jacobian:*/
+J=GetJacobian(pentaelem,xyz_list,gauss_coord);
+
+Jinv=J^(-1);
Index: /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctions.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctions.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctions.m	(revision 1)
@@ -0,0 +1,10 @@
+function l1l6=GetNodalFunctions(pentaelem,gauss_coord)
+%GETNODALFUNCTIONS - return the values of nodal functions at gaussian point on the reference element
+%
+%   Usage:
+%      l1l6=GetNodalFunctions(pentaelem,gauss_coord)
+%
+%   See also GETNODALFUNCTIONSSTOKES, GETNODALFUNCTIONSDERIVATIVESPARAMS, GETNODALFUNCTIONSDERIVATIVESBASIC
+
+l1l6=[gauss_coord(1,1)*(1- gauss_coord(1,4))/2,  gauss_coord(1,2)*(1- gauss_coord(1,4))/2,  gauss_coord(1,3)*(1- gauss_coord(1,4))/2, ...
+    gauss_coord(1,1)*(1+ gauss_coord(1,4))/2,  gauss_coord(1,2)*(1+gauss_coord(1,4))/2,  gauss_coord(1,3)*(1+ gauss_coord(1,4))/2];
Index: /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsBubbleStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsBubbleStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsBubbleStokes.m	(revision 1)
@@ -0,0 +1,9 @@
+function lbubble=GetNodalFunctionsBubbleStokes(pentaelem,gauss_coord)
+%GETNODALFUNCTIONSBUBBLESTOKES - return the value of the bubble nodal function at the gaussian point
+%
+%   Usage:
+%      lbubble=GetNodalFunctionsBubbleStokes(pentaelem,gauss_coord)
+%
+%   See also GETNODALFUNCTIONSDERIVATIVESBASICSTOKES, GETNODALFUNCTIONSDERIVATIVESPARAMSTOKES
+
+lbubble=27*gauss_coord(1,1)*gauss_coord(1,2)*gauss_coord(1,3)*(1-gauss_coord(1,4))*(1+gauss_coord(1,4));
Index: /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesBasic.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesBasic.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesBasic.m	(revision 1)
@@ -0,0 +1,28 @@
+function dh1dh6_basic=GetNodalFunctionsDerivativesBasic(pentaelem,xyz_list,gauss_coord)
+%GETNODALFUNCTIONSDERIVATIVESBASIC - return the values of the nodal functions derivatives on the current element
+%
+%   Usage:
+%      dh1dh6_basic=GetNodalFunctionsDerivativesBasic(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETNODALFUNCTIONS, GETNODALFUNCTIONSDERIVATIVESPARAMS, GETNODALFUNCTIONSDERIVATIVESBASICSTOKES
+
+num_grids=6;
+
+%Get derivative values with respect to parametric coordinate system:
+dh1dh6_param=GetNodalFunctionsDerivativesParams(pentaelem,gauss_coord); 
+	
+%Get Jacobian invert: 
+Jinv=GetJacobianInvert(pentaelem,xyz_list, gauss_coord);
+	
+%Build dh1dh6_basic: 
+% [dhi/dx]= Jinv'*[dhi/dr]
+% [dhi/dy]       [dhi/ds]
+% [dhi/dz]       [dhi/dzeta]
+
+dh1dh6_basic=zeros(3,num_grids);	
+
+for i=1:num_grids,
+	dh1dh6_basic(1,i)=Jinv(1,1)*dh1dh6_param(1,i)+Jinv(2,1)*dh1dh6_param(2,i)+Jinv(3,1)*dh1dh6_param(3,i);
+	dh1dh6_basic(2,i)=Jinv(1,2)*dh1dh6_param(1,i)+Jinv(2,2)*dh1dh6_param(2,i)+Jinv(3,2)*dh1dh6_param(3,i);
+	dh1dh6_basic(3,i)=Jinv(1,3)*dh1dh6_param(1,i)+Jinv(2,3)*dh1dh6_param(2,i)+Jinv(3,3)*dh1dh6_param(3,i);
+end
Index: /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesBasicStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesBasicStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesBasicStokes.m	(revision 1)
@@ -0,0 +1,28 @@
+function dh1dh7_basic=GetNodalFunctionsDerivativesBasicStokes(pentaelem,xyz_list,gauss_coord)
+%GETNODALFUNCTIONSDERIVATIVESBASICSTOKES - return the values of nodal functions derivatives on the current element
+%
+%   Usage:
+%      dh1dh7_basic=GetNodalFunctionsDerivativesBasicStokes(pentaelem,xyz_list,gauss_coord)
+%
+%   See also GETNODALFUNCTIONSSTOKES, GETNODALFUNCTIONSDERIVATIVESPARAMSSTOKES, GETNODALFUNCTIONSDERIVATIVESBASIC
+
+num_grids=7;
+
+%Get derivative values with respect to parametric coordinate system:
+dh1dh7_param=GetNodalFunctionsDerivativesParamsStokes(pentaelem,gauss_coord); 
+	
+%Get Jacobian invert: 
+Jinv=GetJacobianInvert(pentaelem,xyz_list, gauss_coord);
+	
+%Build dh1dh7_basic: 
+% [dhi/dx]= Jinv'*[dhi/dr]
+% [dhi/dy]       [dhi/ds]
+% [dhi/dz]       [dhi/dzeta]
+
+dh1dh7_basic=zeros(3,num_grids);	
+
+for i=1:num_grids,
+	dh1dh7_basic(1,i)=Jinv(1,1)*dh1dh7_param(1,i)+Jinv(2,1)*dh1dh7_param(2,i)+Jinv(3,1)*dh1dh7_param(3,i);
+	dh1dh7_basic(2,i)=Jinv(1,2)*dh1dh7_param(1,i)+Jinv(2,2)*dh1dh7_param(2,i)+Jinv(3,2)*dh1dh7_param(3,i);
+	dh1dh7_basic(3,i)=Jinv(1,3)*dh1dh7_param(1,i)+Jinv(2,3)*dh1dh7_param(2,i)+Jinv(3,3)*dh1dh7_param(3,i);
+end
Index: /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesParams.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesParams.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesParams.m	(revision 1)
@@ -0,0 +1,48 @@
+function dl1dl6=GetNodalFunctionsDerivativesParams(pentaelem,gauss_coord)
+%GETNODALFUNCTIONSDERIVATIVESPARAMS - return the values of nodal functions derivatives on the reference element
+%	
+%   Usage:
+%      dl1dl6=GetNodalFunctionsDerivativesParams(pentaelem,gauss_coord)
+%
+%   See also GETNODALFUNCTIONS, GETNODALFUNCTIONSDERIVATIVESBASIC, GETNODALFUNCTIONSDERIVATIVESPARAMSSTOKES
+
+sqrt3=sqrt(3.0);
+
+%Gauss point coordinate in reference element
+r=gauss_coord(1,2) - gauss_coord(1,1);
+s= - 3.0/sqrt3 *(gauss_coord(1,1)+gauss_coord(1,2) - 2.0/3.0);
+zeta=gauss_coord(1,4);
+
+num_grids=6;
+dl1dl6=zeros(3,num_grids);
+
+%First nodal function:
+dl1dl6(1,1)=-1.0/2.0*(1-zeta)/2;
+dl1dl6(2,1)=-sqrt3/6*(1-zeta)/2;
+dl1dl6(3,1)=-1.0/2.0*(-1.0/2.0*r-sqrt3/6*s+1/3);
+
+%Second nodal function:
+dl1dl6(1,2)=1.0/2.0*(1-zeta)/2;
+dl1dl6(2,2)=-sqrt3/6*(1-zeta)/2;
+dl1dl6(3,2)=-1.0/2.0*(1.0/2.0*r-sqrt3/6*s+1/3);
+
+%Third nodal function:
+dl1dl6(1,3)=0;
+dl1dl6(2,3)=sqrt3/3.0*(1-zeta)/2;
+dl1dl6(3,3)=-1.0/2.0*(sqrt3/3.0*s+1/3);
+
+%Fourth nodal function:
+dl1dl6(1,4)=-1.0/2.0*(1+zeta)/2;
+dl1dl6(2,4)=-sqrt3/6*(1+zeta)/2;
+dl1dl6(3,4)=1.0/2.0*(-1.0/2.0*r-sqrt3/6*s+1/3);
+
+%Fifth nodal function:
+dl1dl6(1,5)=1.0/2.0*(1+zeta)/2;
+dl1dl6(2,5)=-sqrt3/6*(1+zeta)/2;
+dl1dl6(3,5)=1.0/2.0*(1.0/2.0*r-sqrt3/6*s+1/3);
+
+%Sixth nodal function:
+dl1dl6(1,6)=0;
+dl1dl6(2,6)=sqrt3/3.0*(1+zeta)/2;
+dl1dl6(3,6)=1.0/2.0*(sqrt3/3.0*s+1/3);
+
Index: /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesParamsStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesParamsStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsDerivativesParamsStokes.m	(revision 1)
@@ -0,0 +1,52 @@
+function dl1dl7=GetNodalFunctionsDerivativesParamsStokes(pentaelem,gauss_coord)
+%GETNODALFUNCTIONSDERIVATIVESPARAMSSTOKES - return the values of the nodal functions derivatives on the reference element
+%
+%   Usage:
+%      dl1dl7=GetNodalFunctionsDerivativesParamsStokes(pentaelem,gauss_coord)
+%
+%   See also GETNODALFUNCTIONSDERIVATIVESPARAMS, GETNODALFUNCTIONSDERIVATIVESBASICSTOKES, GETNODALFUNCTIONSSTOKES
+
+sqrt3=sqrt(3.0);
+
+%Gauss point coordinate in reference element
+r=gauss_coord(1,2) - gauss_coord(1,1);
+s= - 3.0/sqrt3 *(gauss_coord(1,1)+gauss_coord(1,2) - 2.0/3.0);
+zeta=gauss_coord(1,4);
+
+num_grids=7;
+dl1dl7=zeros(3,num_grids);
+
+%First nodal function:
+dl1dl7(1,1)=-1.0/2.0*(1-zeta)/2;
+dl1dl7(2,1)=-sqrt3/6*(1-zeta)/2;
+dl1dl7(3,1)=-1.0/2.0*(-1.0/2.0*r-sqrt3/6*s+1/3);
+
+%Second nodal function:
+dl1dl7(1,2)=1.0/2.0*(1-zeta)/2;
+dl1dl7(2,2)=-sqrt3/6*(1-zeta)/2;
+dl1dl7(3,2)=-1.0/2.0*(1.0/2.0*r-sqrt3/6*s+1/3);
+
+%Third nodal function:
+dl1dl7(1,3)=0;
+dl1dl7(2,3)=sqrt3/3.0*(1-zeta)/2;
+dl1dl7(3,3)=-1.0/2.0*(sqrt3/3.0*s+1/3);
+
+%Fourth nodal function:
+dl1dl7(1,4)=-1.0/2.0*(1+zeta)/2;
+dl1dl7(2,4)=-sqrt3/6*(1+zeta)/2;
+dl1dl7(3,4)=1.0/2.0*(-1.0/2.0*r-sqrt3/6*s+1/3);
+
+%Fifth nodal function:
+dl1dl7(1,5)=1.0/2.0*(1+zeta)/2;
+dl1dl7(2,5)=-sqrt3/6*(1+zeta)/2;
+dl1dl7(3,5)=1.0/2.0*(1.0/2.0*r-sqrt3/6*s+1/3);
+
+%Sixth nodal function:
+dl1dl7(1,6)=0;
+dl1dl7(2,6)=sqrt3/3.0*(1+zeta)/2;
+dl1dl7(3,6)=1.0/2.0*(sqrt3/3.0*s+1/3);
+
+%Seventh nodal function:
+dl1dl7(1,7)=9.0/2.0*r*(1.0+zeta)*(zeta-1.0)*(sqrt3*s+1.0);
+dl1dl7(2,7)=9.0/4.0*(1+zeta)*(1-zeta)*(sqrt3*s^2-2.0*s-sqrt3*r^2);
+dl1dl7(3,7)=27*gauss_coord(1,1)*gauss_coord(1,2)*gauss_coord(1,3)*(-2.0*zeta);
Index: /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetNodalFunctionsStokes.m	(revision 1)
@@ -0,0 +1,12 @@
+function l1l6=GetNodalFunctionsStokes(pentaelem,gauss_coord)
+%GETNODALFUNCTIONSSTOKES - return the values of nodal functions at gaussian point on reference element
+%
+%   Usage:
+%      l1l6=GetNodalFunctionsStokes(pentaelem,gauss_coord)
+%
+%   See also GETNODALFUNCTIONS, GETNODALFUNCTIONSBUBBLESTOKES
+
+lbubble=GetNodalFunctionsBubbleStokes(pentaelem, gauss_coord);
+
+l1l6=[gauss_coord(1,1)*(1- gauss_coord(1,4))/2,  gauss_coord(1,2)*(1- gauss_coord(1,4))/2,  gauss_coord(1,3)*(1- gauss_coord(1,4))/2, ...
+    gauss_coord(1,1)*(1+ gauss_coord(1,4))/2,  gauss_coord(1,2)*(1+gauss_coord(1,4))/2,  gauss_coord(1,3)*(1+ gauss_coord(1,4))/2, lbubble];
Index: /issm/trunk/src/m/classes/@pentaelem/GetParameterDerivativeValue.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetParameterDerivativeValue.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetParameterDerivativeValue.m	(revision 1)
@@ -0,0 +1,21 @@
+function derivatives=GetParameterDerivativeValue(pentaelem,grid_values,xyz_list,gauss_coord),
+%GETPARAMETERDERIVATIVEVALUE - return the derivative value of a parameter at a specified point
+%
+%   From grid values of parameter, return parameter derivative value at gaussian point specified by gauss_coord:
+%   For example, if p is the parameter,
+%   dp/dx=p1*dh1/dx+p2*dh2/dx+p3*dh3/dx+p4*dh4/dx+p5*dh5/dx+p5*dh5/dx
+%   dp/dy=p1*dh1/dy+p2*dh2/dy+p3*dh3/dy+p4*dh4/dy+p5*dh5/dy+p5*dh5/dy
+%   dp/dz=p1*dh1/dz+p2*dh2/dz+p3*dh3/dz+p4*dh4/dz+p5*dh5/dz+p5*dh5/dz
+%
+%   Usage:
+%      derivatives=GetParameterDerivativeValue(pentaelem,grid_values,xyz_list,gauss_coord)
+%
+%   See also GETPARAMETERVALUE
+
+derivatives=zeros(3,1);
+
+%Get dh1dh6 in basic coordinate system:
+dh1dh6=GetNodalFunctionsDerivativesBasic(pentaelem,xyz_list, gauss_coord);
+derivatives(1)=sum(grid_values'.*dh1dh6(1,:));
+derivatives(2)=sum(grid_values'.*dh1dh6(2,:));
+derivatives(3)=sum(grid_values'.*dh1dh6(3,:));
Index: /issm/trunk/src/m/classes/@pentaelem/GetParameterValue.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetParameterValue.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetParameterValue.m	(revision 1)
@@ -0,0 +1,11 @@
+function value=GetParameterValue(pentaelem,grid_values,gauss_coord),
+%GETPARAMETERVALUE - return a parameter value on a specified point
+%
+%   Usage:
+%      value=GetParameterValue(pentaelem,grid_values,gauss_coord)
+%
+%   See also GETPARAMETERVALUESTOKES, GETPARAMETERDERIVATIVEVALUE
+
+l1l6=GetNodalFunctions(pentaelem,gauss_coord);
+
+value=sum(l1l6.*grid_values');
Index: /issm/trunk/src/m/classes/@pentaelem/GetParameterValueStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetParameterValueStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetParameterValueStokes.m	(revision 1)
@@ -0,0 +1,12 @@
+function value=GetParameterValue(pentaelem,grid_values,gauss_coord),
+%GETPARAMETERVALUESTOKES - return a parameter value at a specified point
+%
+%   Usage:
+%      value=GetParameterValue(pentaelem,grid_values,gauss_coord)
+%
+%   See also GETPARAMETERVALUESTOKES, GETPARAMETERDERIVATIVEVALUE
+
+l1l7=GetNodalFunctionsStokes(pentaelem,gauss_coord);
+l1l6=l1l7(1:6);
+
+value=sum(l1l6.*grid_values');
Index: /issm/trunk/src/m/classes/@pentaelem/GetStrainRate.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetStrainRate.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetStrainRate.m	(revision 1)
@@ -0,0 +1,18 @@
+function epsilon=GetStrainRate(pentaelem,vxvy_list,xyz_list,gauss_coord)
+%GETSTRAINRATE - return the strain rate of a pentaelem
+%
+%   This function return the strain rate needed for Glen's flow law for the element pentaelem
+%   The strain rate epsilon is calculated thanks to the formula epsilon=B*U
+%   Where epsilon=[exx eyy exy exz eyz] and U=[u1;v1;..;u6;v6]
+%   The matrix B is the same as in K=tBDBprime
+%
+%   Usage:
+%      epsilon=GetStrainRate(pentaelem,vxvy_list,xyz_list,gauss_coord)
+%
+%   See also GETSTRAINRATESTOKES, GETB_HORIZ
+
+B=GetB_horiz(pentaelem,xyz_list,gauss_coord);
+vxvy_list_transp=vxvy_list';
+U=[vxvy_list_transp(1:2,1);vxvy_list_transp(1:2,2);vxvy_list_transp(1:2,3);vxvy_list_transp(1:2,4);vxvy_list_transp(1:2,5);vxvy_list_transp(1:2,6)];
+
+epsilon=B*U;
Index: /issm/trunk/src/m/classes/@pentaelem/GetStrainRateStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/GetStrainRateStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/GetStrainRateStokes.m	(revision 1)
@@ -0,0 +1,20 @@
+function epsilon=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord)
+%GETSTRAINRATESTOKES - return the strain rate for pentaelem with stokes' disgnostic
+% 
+%   This function return the strain rate needed for Glen's flow law for the element pentaelem
+%   The strain rate epsilon is calculated thanks to the formula epsilon=B*U
+%   Where epsilon=[exx eyy ezz exy exz eyz] and U=[u1;v1;..;u6;v6]
+%   The matrix B is the same as in K=tBDBprime
+%
+%   Usage:
+%      epsilon=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord)
+% 
+%   See also GETSTRAINRATE, GETBSTOKES
+
+B=GetBStokes(pentaelem,xyz_list,gauss_coord);
+B_reduced=B(1:6,[1:3 5:7 9:11 13:15 17:19 21:23]);
+
+vxvyvz_list_transp=vxvyvz_list';
+U=[vxvyvz_list_transp(:,1);vxvyvz_list_transp(:,2);vxvyvz_list_transp(:,3);vxvyvz_list_transp(:,4);vxvyvz_list_transp(:,5);vxvyvz_list_transp(:,6)];
+
+epsilon=B_reduced*U; %for the six principal grids
Index: /issm/trunk/src/m/classes/@pentaelem/PentaCollapseIntoTriaMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/PentaCollapseIntoTriaMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/PentaCollapseIntoTriaMatrix.m	(revision 1)
@@ -0,0 +1,33 @@
+function Ke=PentaCollapseIntoTriaMatrix(pentaelem,grids,materials,inputs,analysis_type);
+%PENTACOLLAPSEINTOTRIAMATRIX - collapse a pentaelem into a tria and create a stiffness matrix for ths element
+%
+%   This routine creates a fake triaelem from the pentaelem and then call the routine
+%   to create a stiffness matrix fot this triaelem.
+%   It is usefull when running MacAyeal's model on a 3d mesh.
+%
+%   Usage:
+%      Ke=PentaCollapseIntoTriaMatrix(pentaelem,grids,materials,inputs,analysis_type)
+%
+%   See also PENTACOLLAPSEINTOTRIAVECTOR, CREATEKMATRIX
+
+	%we collapse the penta into its base tria, and use the tria to build the stiffness matrix.
+	element=triaelem;
+	element.type='triaelem';
+	element.id=NaN; %not needed here, we are going to destroy this triaelem very soon.
+	element.matid=pentaelem.matid; %same materials, not dependent on element.
+	element.g=pentaelem.g(1:3); %first three grids correspond to the base of the penta element.
+	element.h=pentaelem.h(1:3);
+	element.s=pentaelem.s(1:3);
+	element.b=pentaelem.b(1:3);
+	element.friction_type=pentaelem.friction_type;
+	element.k=pentaelem.k(1:3);
+	element.p=pentaelem.p;
+	element.q=pentaelem.q;
+	element.shelf=pentaelem.shelf;
+	element.meanvel=pentaelem.meanvel;
+	element.epsvel=pentaelem.epsvel;
+	element.acceleration=pentaelem.acceleration;
+
+	%Call CreateKMatrix for this new element.
+	Ke=CreateKMatrix(element,grids,materials,inputs,analysis_type);
+
Index: /issm/trunk/src/m/classes/@pentaelem/PentaCollapseIntoTriaVector.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/PentaCollapseIntoTriaVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/PentaCollapseIntoTriaVector.m	(revision 1)
@@ -0,0 +1,33 @@
+function Pe=PentaCollapseIntoTriaVector(pentaelem,grids,materials,inputs,analysis_type);
+%PENTACOLLAPSEINTOTRIAVECTOR - collapse a pentaelem into a tria and create a load vector for ths element
+%
+%   This routine creates a fake triaelem from the pentaelem and then call the routine
+%   to create a load vector fot this triaelem.
+%   It is usefull when running MacAyeal's model on a 3d mesh.
+%
+%   Usage:
+%      Pe=PentaCollapseIntoTriaVector(pentaelem,grids,materials,inputs,analysis_type)
+%
+%   See also PENTACOLLAPSEINTOTRIAMATRIX, CREATEPVECTOR
+
+	%we collapse the penta into its base tria, and use the tria to build the stiffness matrix.
+	element=triaelem;
+	element.type='triaelem';
+	element.id=NaN; %not needed here, we are going to destroy this triaelem very soon.
+	element.matid=pentaelem.matid; %same materials, not dependent on element.
+	element.g=pentaelem.g(1:3); %first three grids correspond to the base of the penta element.
+	element.h=pentaelem.h(1:3);
+	element.s=pentaelem.s(1:3);
+	element.b=pentaelem.b(1:3);
+	element.friction_type=pentaelem.friction_type;
+	element.k=pentaelem.k(1:3);
+	element.p=pentaelem.p;
+	element.q=pentaelem.q;
+	element.shelf=pentaelem.shelf;
+	element.meanvel=pentaelem.meanvel;
+	element.epsvel=pentaelem.epsvel;
+	element.acceleration=pentaelem.acceleration;
+
+	%Call CreateKMatrix for this new element.
+	Pe=CreatePVector(element,grids,materials,inputs,analysis_type);
+
Index: /issm/trunk/src/m/classes/@pentaelem/ReduceMatrixStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/ReduceMatrixStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/ReduceMatrixStokes.m	(revision 1)
@@ -0,0 +1,29 @@
+function Ke_reduced=ReduceMatrixStokes(pentaelem,Ke_temp)
+%REDUCEMATRIXSTOKES - compute a reduced matrix to get rid of the bubble grid
+%
+%   This function return the reduced elementary matrix, so that we ca
+%   solve the problem without having a grid in the middle of the pentaelem
+%           [                |    ]
+%           [                |    ]
+%   Ke_temp=[      Kii       | Kib]
+%           [                |    ]
+%           [----------------+----]
+%           [      Kbi       | Kbb]
+%   indice b represents the bubble function (node in the middle of the penta
+%   indice i represents the other nodes (the six principal nodes of the penta)
+%   So that the elementary reduced matrix is Ke_reduced=Kii-Kib*Kbb^-1*Kbi
+%   See theoryguide for more informations
+%
+%   Usage:
+%      Ke_reduced=ReduceMatrixStokes(pentaelem,Ke_temp)
+%
+%   See also REDUCEVECTORSTOKES, CREATEKMATRIX
+
+%Create the four matrices
+Kii=Ke_temp(1:24,1:24);
+Kib=Ke_temp(1:24,25:27);
+Kbi=Ke_temp(25:27,1:24);
+Kbb=Ke_temp(25:27,25:27);
+
+%Add the components of the matrix for the 6 grids 
+Ke_reduced=Kii-Kib*Kbb^-1*Kbi;
Index: /issm/trunk/src/m/classes/@pentaelem/ReduceVectorStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/ReduceVectorStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/ReduceVectorStokes.m	(revision 1)
@@ -0,0 +1,29 @@
+function pe_reduced=ReduceVectorStokes(pentaelem,Kebubble_temp,pe_temp)
+%REDUCEVECTORSTOKES -  compute a reduced vector to get rid of the bubble grid
+%
+%   This function return the reduced elementary load vector, so that we ca
+%   solve the problem without having a grid in the middle of the pentaelem
+%            [     ]		            [       ]
+%            [     ]	            	[       ]
+%   Kebubble=[ Kib ]   and  Pe_temp=[  Pi   ]
+%            [     ]	             	[       ]
+%            [-----]		            [-------]
+%            [ Kbb ]            		[  Pb   ]
+%   indice b represents the bubble function (node in the middle of the penta
+%   indice i represents the other nodes (the six principal nodes of the penta)
+%   So that the elementary reduced load vector is pe_reduced=Pi-Kib*Kbb^-1*Pb
+%   See theoryguide for more informations
+% 
+%   Usage: 
+%      pe_reduced=ReduceVectorStokes(pentaelem,Kebubble_temp,pe_temp)
+%
+%   See also REDUCEMATRIXSTOKES, CREATEPVECTOR
+
+%Create load vector whithout using the bubble function
+Kib=Kebubble_temp(1:24,:);
+Kbb=Kebubble_temp(25:27,:);
+
+Pi=pe_temp(1:24,:);
+Pb=pe_temp(25:27,:);
+
+pe_reduced=Pi-Kib*Kbb^-1*Pb;
Index: /issm/trunk/src/m/classes/@pentaelem/StrainRate.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/StrainRate.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/StrainRate.m	(revision 1)
@@ -0,0 +1,67 @@
+function strainrate=StrainRate(pentaelem,grids,materials,inputs)
+%STRAINRATE - compute the strain rate on each element
+%
+%  Usage:
+%      strainrate=StrainRate(pentaelem,grids,materials,inputs)
+%
+%   See also GETSTRAINRATE, GETSTRAINRATESTOKES
+
+	%initialize
+	strainrate=zeros(6,1);
+	volume=0;
+
+	%some variables
+	NDOF1=1;
+	numgrids=6;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+
+	%we need velocities to compute thermal profiles (even if it is a zero 
+	%vector). 
+	if ~velocity_is_present,
+		error('StrainRate error message: input velocity not present!');
+	end
+
+	%initialize vxvyvz_list
+	vxvyvz_list=zeros(numgrids,3);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist;
+		for j=1:3,
+			dof=doflist(j);
+			vxvyvz_list(i,j)=velocity_param(dof);
+		end	
+		dof=doflist(1);
+	end
+	
+	% Get gaussian points and weights 
+	area_order=2;
+	num_vert_gauss=2;
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		for igvert=1:num_vert_gauss,
+			%Pick up the gaussian point and its weight:
+			gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+			gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+		    
+			%Build strainrate
+			strainrate_g=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord);
+
+			%Get Jacobian determinant:
+			Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+
+			strainrate=strainrate+strainrate_g*Jdet*gauss_weight;
+			volume=volume+Jdet*gauss_weight;
+
+		end %for ig=1:vert_gauss,
+	end %for ig=1:num_area_gauss,
+
+%Divide strainrate, integrated over volume, by volume.
+strainrate=strainrate/volume;
Index: /issm/trunk/src/m/classes/@pentaelem/Stress.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/Stress.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/Stress.m	(revision 1)
@@ -0,0 +1,108 @@
+function stress=Stress(pentaelem,grids,materials,inputs)
+%STRESS - compute the stress on each element
+%
+%   Usage:
+%      stress=Stress(pentaelem,grids,materials,inputs)
+%
+%   See also STRESSBED, STRESSSURFACE, GETSTRAINRATE, GETSTRAINRATESTOKES, GETVISCOSITY3D
+
+	%initialize
+	stress=zeros(6,1);
+	volume=0;
+
+	%some variables
+	NDOF1=1;
+	numgrids=6;
+
+	%recover material parameters
+	matice=materials(pentaelem.matid).material;
+	matpar=materials(end).constants;
+
+	gravity=matpar.g;
+	rho_ice=matpar.rho_ice;
+	B=matice.B;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[surface_param surface_is_present]=recover_input(inputs,'surface');
+	[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+	[elementonstokes_param elementonstokes_is_present]=recover_input(inputs,'elementonstokes');
+
+	%we need velocities to compute thermal profiles (even if it is a zero 
+	%vector). 
+	if ~velocity_is_present &~elementonstokes_is_present
+		error('Stress error message: missing inputs!');
+	end
+
+	%initialize vxvyvz_list
+	vxvyvz_list=zeros(numgrids,3);
+	pressure=zeros(numgrids,1);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist;
+		for j=1:3,
+			dof=doflist(j);
+			vxvyvz_list(i,j)=velocity_param(dof);
+		end
+		pressure(i)=velocity_param(doflist(4));	
+		dof=doflist(1);
+		if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+		if(surface_is_present) surface_list(i)=surface_param(dof);end;
+	end
+	
+	%Update material parameter that deals with ice rigidity: 
+	if flow_law_is_present,
+		B_param=GetParameterValue(pentaelem,B_list,gauss_coord);
+		matice.B=B_param; clear B_param.
+	end
+	
+	% Get gaussian points and weights 
+	area_order=2;
+	num_vert_gauss=2;
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		for igvert=1:num_vert_gauss,
+
+			%Pick up the gaussian point and its weight:
+			gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+			gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+		    
+			%Build deviatoric stress 
+			strainrate_g=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord);
+			viscosity=GetViscosity3d(matice,strainrate_g);
+			deviatoricstress=viscosity*strainrate_g;
+
+			%Build Pressure
+			if elementonstokes_param(pentaelem.id)==stokesenum();
+				pressure_g=GetParameterValue(pentaelem,pressure,gauss_coord);
+			else %use pattyn's and MacAyeal's assumption: P=sigma_zz'+rho_ice*g*(s-z)
+				z_av=mean(xyz_list(:,3));
+				if surface_is_present,
+					s_av=mean(surface_list);
+				else
+					s_av=mean(pentaelem.s);
+				end
+				pressure_g=deviatoricstress(3)+rho_ice*gravity*(s_av-z_av);
+			end
+
+			%Build stress
+			stress_g=deviatoricstress;
+			stress_g([1;2;3],1)=stress_g(1:3,1)-pressure_g;         %stress=deviatoricstress-pressure
+
+			%Get Jacobian determinant:
+			Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+
+			stress=stress+stress_g*Jdet*gauss_weight;
+			volume=volume+Jdet*gauss_weight;
+
+		end %for ig=1:vert_gauss,
+	end %for ig=1:num_area_gauss,
+
+%Divide stress, integrated over volume, by volume.
+stress=stress/volume;
Index: /issm/trunk/src/m/classes/@pentaelem/StressBed.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/StressBed.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/StressBed.m	(revision 1)
@@ -0,0 +1,118 @@
+function [stress_bed,normal]=StressBed(pentaelem,grids,materials,inputs)
+%STRESSBED - compute the stress on the bed
+%
+%   This routine compute the stress_bed of each element, return NaN if not on bed
+%
+%   Usage:
+%      [stress_bed,normal]=StressBed(pentaelem,grids,materials,inputs)
+%
+%   See also STRESS, STRESSSURFACE, GETSTRAINRATE, GETVISCOSITY3D
+
+if ~pentaelem.onbed
+	stress_bed=NaN;
+	normal=NaN;
+	return
+end
+
+%initialize
+stress_bed=zeros(6,1);
+volume=0;
+
+%some variables
+NDOF1=1;
+numgrids=6;
+
+%recover material parameters
+matice=materials(pentaelem.matid).material;
+matpar=materials(end).constants;
+gravity=matpar.g;
+rho_ice=matpar.rho_ice;
+B=matice.B;
+
+%Get all element grid data:
+xyz_list=getgriddata(pentaelem,grids);
+
+%recover extra inputs
+[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+[surface_param surface_is_present]=recover_input(inputs,'surface');
+[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+[elementonstokes_param elementonstokes_is_present]=recover_input(inputs,'elementonstokes');
+
+%we need velocities to compute thermal profiles (even if it is a zero 
+%vector). 
+if ~velocity_is_present &~elementonstokes_is_present
+	error('Stress error message: missing inputs!');
+end
+
+%initialize vxvyvz_list
+vxvyvz_list=zeros(numgrids,3);
+pressure=zeros(numgrids,1);
+
+%Build row indices for elementary vector.
+for i=1:numgrids,
+	doflist=grids(pentaelem.g(i)).grid.doflist;
+	for j=1:3,
+		dof=doflist(j);
+		vxvyvz_list(i,j)=velocity_param(dof);
+	end
+	pressure(i)=velocity_param(doflist(4));	
+	dof=doflist(1);
+	if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	if(surface_is_present) surface_list(i)=surface_param(dof);end;
+end
+
+%Update material parameter that deals with ice rigidity: 
+if flow_law_is_present,
+	B_param=GetParameterValue(pentaelem,B_list,gauss_coord);
+	matice.B=B_param; clear B_param.
+end
+
+% Get gaussian points and weights 
+[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights]=GaussTria(2);
+
+%Start  looping on the number of gaussian points:
+for igarea=1:num_area_gauss,
+
+	%Pick up the gaussian point and its weight:
+	gauss_weight=area_gauss_weights(igarea);
+	gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea), -1];
+    
+	%Build deviatoric stress_bed 
+	strainrate_g=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord);
+	viscosity=GetViscosity3d(matice,strainrate_g);
+	deviatoricstress_bed=viscosity*strainrate_g;
+
+	%Build Pressure
+	if elementonstokes_param(pentaelem.id)==stokesenum(),
+		pressure_g=GetParameterValue(pentaelem,pressure,gauss_coord);
+	else %use pattyn's and MacAyeal's assumption: P=sigma_zz'+rho_ice*g*(s-z)
+		z_av=mean(xyz_list(:,3));
+		if surface_is_present,
+			s_av=mean(surface_list);
+		else
+			s_av=mean(pentaelem.s);
+		end
+		pressure_g=deviatoricstress_bed(3)+rho_ice*gravity*(s_av-z_av);
+	end
+
+	%Build stress_bed
+	stress_bed_g=deviatoricstress_bed;
+	stress_bed_g([1;2;3],1)=stress_bed_g(1:3,1)-pressure_g;         %stress_bed=deviatoricstress_bed-pressure
+
+	%Get Jacobian determinant:
+	Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+
+	stress_bed=stress_bed+stress_bed_g*Jdet*gauss_weight;
+	volume=volume+Jdet*gauss_weight;
+
+end %for ig=1:num_area_gauss,
+
+%Divide stress_bed, integrated over volume, by volume.
+stress_bed=stress_bed/volume;
+
+%Build normal
+normal=zeros(3,1);
+n=cross((xyz_list(1,:)-xyz_list(3,:)),(xyz_list(3,:)-xyz_list(2,:)));
+normal(1)=1/norm(n)*n(1);
+normal(2)=1/norm(n)*n(2);
+normal(3)=1/norm(n)*n(3);
Index: /issm/trunk/src/m/classes/@pentaelem/StressSurface.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/StressSurface.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/StressSurface.m	(revision 1)
@@ -0,0 +1,118 @@
+function [stress_surface,normal]=StressSurface(pentaelem,grids,materials,inputs)
+%STRESSSURFACE - compute the stress on the surface
+%
+%   This routine compute the stress_surface of each element, return NaN if not on surface
+%
+%   Usage:
+%      [stress_surface,normal]=StressSurface(pentaelem,grids,materials,inputs)
+%
+%   See also STRESS, STRESSBED, GETSTRAINRATE, GETVISCOSITY3D
+
+if ~pentaelem.onsurface
+	stress_surface=NaN;
+	normal=NaN;
+	return
+end
+
+%initialize
+stress_surface=zeros(6,1);
+volume=0;
+
+%some variables
+NDOF1=1;
+numgrids=6;
+
+%recover material parameters
+matice=materials(pentaelem.matid).material;
+matpar=materials(end).constants;
+gravity=matpar.g;
+rho_ice=matpar.rho_ice;
+B=matice.B;
+
+%Get all element grid data:
+xyz_list=getgriddata(pentaelem,grids);
+
+%recover extra inputs
+[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+[surface_param surface_is_present]=recover_input(inputs,'surface');
+[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+[elementonstokes_param elementonstokes_is_present]=recover_input(inputs,'elementonstokes');
+
+%we need velocities to compute thermal profiles (even if it is a zero 
+%vector). 
+if ~velocity_is_present &~elementonstokes_is_present
+	error('Stress error message: missing inputs!');
+end
+
+%initialize vxvyvz_list
+vxvyvz_list=zeros(numgrids,3);
+pressure=zeros(numgrids,1);
+
+%Build row indices for elementary vector.
+for i=1:numgrids,
+	doflist=grids(pentaelem.g(i)).grid.doflist;
+	for j=1:3,
+		dof=doflist(j);
+		vxvyvz_list(i,j)=velocity_param(dof);
+	end
+	pressure(i)=velocity_param(doflist(4));	
+	dof=doflist(1);
+	if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	if(surface_is_present) surface_list(i)=surface_param(dof);end;
+end
+
+%Update material parameter that deals with ice rigidity: 
+if flow_law_is_present,
+	B_param=GetParameterValue(pentaelem,B_list,gauss_coord);
+	matice.B=B_param; clear B_param.
+end
+
+% Get gaussian points and weights 
+[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights]=GaussTria(2);
+
+%Start  looping on the number of gaussian points:
+for igarea=1:num_area_gauss,
+
+	%Pick up the gaussian point and its weight:
+	gauss_weight=area_gauss_weights(igarea);
+	gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea), 1];
+    
+	%Build deviatoric stress_surface 
+	strainrate_g=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord);
+	viscosity=GetViscosity3d(matice,strainrate_g);
+	deviatoricstress_surface=viscosity*strainrate_g;
+
+	%Build Pressure
+	if elementonstokes_param(pentaelem.id)==stokesenum(),
+		pressure_g=GetParameterValue(pentaelem,pressure,gauss_coord);
+	else %use pattyn's and MacAyeal's assumption: P=sigma_zz'+rho_ice*g*(s-z)
+		z_av=mean(xyz_list(:,3));
+		if surface_is_present,
+			s_av=mean(surface_list);
+		else
+			s_av=mean(pentaelem.s);
+		end
+		pressure_g=deviatoricstress_surface(3)+rho_ice*gravity*(s_av-z_av);
+	end
+
+	%Build stress_surface
+	stress_surface_g=deviatoricstress_surface;
+	stress_surface_g([1;2;3],1)=stress_surface_g(1:3,1)-pressure_g;         %stress_surface=deviatoricstress_surface-pressure
+
+	%Get Jacobian determinant:
+	Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+
+	stress_surface=stress_surface+stress_surface_g*Jdet*gauss_weight;
+	volume=volume+Jdet*gauss_weight;
+
+end %for ig=1:num_area_gauss,
+
+%Divide stress_surface, integrated over volume, by volume.
+stress_surface=stress_surface/volume;
+
+%Build normal
+normal=zeros(3,1);
+n=cross((xyz_list(4,:)-xyz_list(5,:)),(xyz_list(6,:)-xyz_list(5,:)));
+normal(1)=1/norm(n)*n(1);
+normal(2)=1/norm(n)*n(2);
+normal(3)=1/norm(n)*n(3);
Index: /issm/trunk/src/m/classes/@pentaelem/ViscousHeating.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/ViscousHeating.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/ViscousHeating.m	(revision 1)
@@ -0,0 +1,96 @@
+function viscousheating=ViscousHeating(pentaelem,grids,materials,inputs)
+%VISCOUSHEATING - compute the viscous heating on each pentaelem
+%
+%   Usage:
+%      viscousheating=ViscousHeating(pentaelem,grids,materials,inputs)
+%
+%   See also GETSTRAINRATE, GETVISCOSITY3D
+
+	%initialize
+	viscousheating=0;
+	volume=0;
+
+	%some variables
+	NDOF1=1;
+	numgrids=6;
+
+	%recover material parameters
+	matice=materials(pentaelem.matid).material;
+	B=matice.B;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(pentaelem,grids);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+
+	%we need velocities to compute thermal profiles (even if it is a zero 
+	%vector). 
+	if ~velocity_is_present,
+		error('ViscousHeating error message: input velocity not present!');
+	end
+
+	%initialize vxvyvz_list
+	vxvyvz_list=zeros(numgrids,3);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(pentaelem.g(i)).grid.doflist;
+		for j=1:3,
+			dof=doflist(j);
+			vxvyvz_list(i,j)=velocity_param(dof);
+		end	
+		dof=doflist(1);
+		if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	end
+	
+	%Update material parameter that deals with ice rigidity: 
+	if flow_law_is_present,
+		B_param=GetParameterValue(pentaelem,B_list,gauss_coord);
+		matice.B=B_param; clear B_param.
+	end
+
+	% Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 
+	%get tria gaussian points as well as segment gaussian points. For tria gaussian 
+	%points, order of integration is 2, because we need to integrate the product tB*D*B' 
+	%which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian 
+	%points, same deal, which yields 3 gaussian points.
+	area_order=2;
+	num_vert_gauss=3;
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		for igvert=1:num_vert_gauss,
+			%Pick up the gaussian point and its weight:
+			gauss_weight=area_gauss_weights(igarea)*vert_gauss_weights(igvert);
+			gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea) vert_gauss_coord(igvert)];
+		    
+			%Build Deformational heating
+			epsilon=GetStrainRateStokes(pentaelem,vxvyvz_list,xyz_list,gauss_coord);
+			viscosity=GetViscosity3d(matice,epsilon); 
+
+			%Build the strain rate matrix
+			epsilon_matrix=[epsilon(1) epsilon(4) epsilon(5)
+					epsilon(4) epsilon(2) epsilon(6)
+					epsilon(5) epsilon(6) epsilon(3)];
+
+			epsilon_e=effective_value(epsilon_matrix);
+
+			phi=2*viscosity*epsilon_e^2;
+
+			%Get Jacobian determinant:
+			Jdet=GetJacobianDeterminant(pentaelem,xyz_list,gauss_coord);
+
+			viscousheating=viscousheating+phi*Jdet*gauss_weight;
+			volume=volume+Jdet*gauss_weight;
+
+		end %for ig=1:vert_gauss,
+	end %for ig=1:num_area_gauss,
+
+%Divide viscousheating, integrated over volume, by volume.
+viscousheating=viscousheating/volume;
+
+
+end %end function
Index: /issm/trunk/src/m/classes/@pentaelem/display.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/display.m	(revision 1)
@@ -0,0 +1,29 @@
+function display(pentaelem)
+%DISPLAY - displays the fields of a penta element
+%
+%   echo function for 'pentaelem' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   type: %s',pentaelem.type));
+disp(sprintf('   id: %i',pentaelem.id));
+disp(sprintf('   material id: %i',pentaelem.matid));
+disp(sprintf('   grid ids: %i %i %i %i %i %i',pentaelem.g(1),pentaelem.g(2),pentaelem.g(3),pentaelem.g(4),pentaelem.g(5),pentaelem.g(6)));
+disp(sprintf('   thickness: %g %g %g %g %g %g',pentaelem.h(1),pentaelem.h(2),pentaelem.h(3),pentaelem.h(4),pentaelem.h(5),pentaelem.h(6)));
+disp(sprintf('   surface: %g %g %g %g %g %g',pentaelem.s(1),pentaelem.s(2),pentaelem.s(3),pentaelem.s(4),pentaelem.s(5),pentaelem.s(6)));
+disp(sprintf('   bedrock: %g %g %g %g %g %g',pentaelem.b(1),pentaelem.b(2),pentaelem.b(3),pentaelem.b(4),pentaelem.b(5),pentaelem.b(6)));
+disp(sprintf('   friction type: %i',pentaelem.friction_type));
+disp(sprintf('   p: %i',pentaelem.p));
+disp(sprintf('   q: %i',pentaelem.q));
+disp(sprintf('   drag coeff: %g %g %g',pentaelem.k(1),pentaelem.k(2),pentaelem.k(3)));
+disp(sprintf('   shelf: %i',pentaelem.shelf));
+disp(sprintf('   onbed: %i',pentaelem.onbed));
+disp(sprintf('   onsurface: %i',pentaelem.onsurface));
+disp(sprintf('   meanvel: %g',pentaelem.meanvel));
+disp(sprintf('   epsvel: %g',pentaelem.epsvel));
+disp(sprintf('   acceleration (use MacAyeal''s accelerated formulation''): %g',pentaelem.acceleration));
+disp(sprintf('   collapse (collapse penta into tria at the base): %g',pentaelem.collapse));
+disp(sprintf('   melting: %g %g %g',pentaelem.melting(1),pentaelem.melting(2),pentaelem.melting(3)));
+disp(sprintf('   accumulation: %g %g %g',pentaelem.accumulation(1),pentaelem.accumulation(2),pentaelem.accumulation(3)));
+disp(sprintf('   geothermalflux: %g %g %g',pentaelem.geothermalflux(1),pentaelem.geothermalflux(2),pentaelem.geothermalflux(3)));
+disp(sprintf('   artificial_diffusivity: %s',pentaelem.artificial_diffusivity));
+disp(sprintf('   thermal_steadystate: %i',pentaelem.thermal_steadystate));
Index: /issm/trunk/src/m/classes/@pentaelem/getgriddata.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/getgriddata.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/getgriddata.m	(revision 1)
@@ -0,0 +1,18 @@
+function xyz=getgriddata(pentaelem,grids)
+%GETGRIDDATA - create an array of space coordinates for the grids
+%
+%   Create array xyz of size num_grids x 3 (3 for x,y and z)
+%   of space coordinates for each grid. 
+%
+%   Usage:
+%      xyz=getgriddata(pentaelem,grids)
+
+num_grids=6;
+
+xyz=zeros(num_grids,3);
+
+for i=1:num_grids,
+	xyz(i,1)=grids(pentaelem.g(i)).grid.x;
+	xyz(i,2)=grids(pentaelem.g(i)).grid.y;
+	xyz(i,3)=grids(pentaelem.g(i)).grid.z;
+end
Index: /issm/trunk/src/m/classes/@pentaelem/pentaelem.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/pentaelem.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/pentaelem.m	(revision 1)
@@ -0,0 +1,46 @@
+function pentaelem = pentaelem(varargin)
+%PENTAELEM - contructor for pentaelem objects
+%
+%   Usage:
+%      pentaelem = pentaelem(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	pentaelem.type='pentaelem';
+	pentaelem.id=NaN;
+	pentaelem.matid=NaN;
+	pentaelem.g=zeros(6,1);
+	pentaelem.h=zeros(6,1);
+	pentaelem.s=zeros(6,1);
+	pentaelem.b=zeros(6,1);
+	pentaelem.friction_type=2;
+	pentaelem.k=zeros(6,1);
+	pentaelem.p=1;
+	pentaelem.q=1;
+	pentaelem.shelf=NaN;
+	pentaelem.onbed=NaN;
+	pentaelem.onsurface=NaN;
+	pentaelem.meanvel=NaN;
+	pentaelem.epsvel=NaN;
+	pentaelem.acceleration=0;
+	pentaelem.collapse=0;
+	pentaelem.melting=zeros(6,1);
+	pentaelem.accumulation=zeros(6,1);
+	pentaelem.geothermalflux=zeros(6,1);
+	pentaelem.artificial_diffusivity='no';
+	pentaelem.thermal_steadystate=1;
+	pentaelem.reconditioning_number=NaN;
+	
+	pentaelem=class(pentaelem,'pentaelem');
+				
+case 1
+	%If single argument of class pentaelem, we have a copy constructor. 
+	if (isa(varargin{1},'pentaelem'))
+		pentaelem = varargin{1};
+	else
+		error('pentaelem constructor error message: copy constructor called on a non ''pentaelem'' class object');
+	end 
+otherwise
+	error('pentaelem constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@pentaelem/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function pentaelem = subsasgn(pentaelem,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      pentaelem = subsasgn(pentaelem,index,val)
+%
+%   See also SUBSREF
+
+pentaelem=builtin('subsasgn',pentaelem,index,val);
Index: /issm/trunk/src/m/classes/@pentaelem/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@pentaelem/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@pentaelem/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function pentaelem = subsref(pentaelem,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      pentaelem = subsref(pentaelem,index)
+% 
+%   See also SUBSASGN
+
+pentaelem=builtin('subsref',pentaelem,index);
Index: /issm/trunk/src/m/classes/@response_function/display.m
===================================================================
--- /issm/trunk/src/m/classes/@response_function/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@response_function/display.m	(revision 1)
@@ -0,0 +1,26 @@
+%
+%  display for the response_function class.
+%
+%  []=display(rf)
+%
+function []=display(rf)
+
+if ~isa(rf,'response_function')
+    error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
+        inputname(1),class(rf),'response_function');
+end
+
+%  display the object
+
+disp(sprintf('\n'));
+for i=1:numel(rf)
+    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+        class(rf),inputname(1),string_dim(rf,i)));
+    disp(sprintf('    descriptor: ''%s'''  ,rf(i).descriptor));
+    disp(sprintf('         respl: %s'      ,string_vec(rf(i).respl)));
+    disp(sprintf('         probl: %s'      ,string_vec(rf(i).probl)));
+    disp(sprintf('          rell: %s'      ,string_vec(rf(i).rell)));
+    disp(sprintf('         grell: %s\n'    ,string_vec(rf(i).grell)));
+end
+
+end
Index: /issm/trunk/src/m/classes/@response_function/response_function.m
===================================================================
--- /issm/trunk/src/m/classes/@response_function/response_function.m	(revision 1)
+++ /issm/trunk/src/m/classes/@response_function/response_function.m	(revision 1)
@@ -0,0 +1,95 @@
+%
+%  definition for the response_function class.
+%
+%  [rf]=response_function(varargin)
+%
+classdef response_function
+    properties
+        descriptor='';
+        respl     =[];
+        probl     =[];
+        rell      =[];
+        grell     =[];
+    end
+    
+    methods
+        function [rf]=response_function(varargin)
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if  (nargin == 1) && isa(varargin{1},'response_function')
+                        rf=varargin{1};
+                    else
+                        rf.descriptor=varargin{1};
+
+                        if (nargin >= 2)
+                            rf.respl     =varargin{2};
+                            if (nargin >= 3)
+                                rf.probl     =varargin{3};
+                                if (nargin >= 4)
+                                    rf.rell      =varargin{4};
+                                    if (nargin >= 5)
+                                        rf.grell     =varargin{5};
+
+                                        if (nargin > 5)
+                                            warning('response_function:extra_arg',...
+                                                'Extra arguments for object of class ''%s''.',...
+                                                class(rf));
+                                        end
+                                    end
+                                end
+                            end
+                        end
+                    end
+            end
+
+        end
+        function [desc]  =dresp_desc(rf)
+            desc=cell(size(rf));
+            for i=1:numel(rf)
+                desc(i)=cellstr(rf(i).descriptor);
+            end
+        end
+        function [stype ]=dresp_stype(rf)
+            stype={};
+        end
+        function [scale] =dresp_scale(rf)
+            scale=[];
+        end
+        function [weight]=dresp_weight(rf)
+            weight=[];
+        end
+        function [lower] =dresp_lower(rf)
+            lower=[];
+        end
+        function [upper] =dresp_upper(rf)
+            upper=[];
+        end
+        function [target]=dresp_target(rf)
+            target=[];
+        end
+        function [respl,probl,rell,grell]=dresp_levels(rf)
+            respl=cell(size(rf));
+            probl=cell(size(rf));
+            rell =cell(size(rf));
+            grell=cell(size(rf));
+            for i=1:numel(rf)
+                respl(i)={rf(i).respl};
+                probl(i)={rf(i).probl};
+                rell (i)={rf(i).rell};
+                grell(i)={rf(i).grell};
+            end
+            respl=allempty(respl);
+            probl=allempty(probl);
+            rell =allempty(rell);
+            grell=allempty(grell);
+        end
+    end
+end
Index: /issm/trunk/src/m/classes/@rgb/display.m
===================================================================
--- /issm/trunk/src/m/classes/@rgb/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@rgb/display.m	(revision 1)
@@ -0,0 +1,9 @@
+function display(rgb)
+%DISPLAY - displays the fields of a rgb element
+%
+%   echo function for 'rgb' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   grid: %i',rgb.grid));
+disp(sprintf('   dof: %g',rgb.dof));
+disp(sprintf('   value: %g',rgb.value));
Index: /issm/trunk/src/m/classes/@rgb/rgb.m
===================================================================
--- /issm/trunk/src/m/classes/@rgb/rgb.m	(revision 1)
+++ /issm/trunk/src/m/classes/@rgb/rgb.m	(revision 1)
@@ -0,0 +1,25 @@
+function rgb = rgb(varargin)
+%RGB - constructor for rgb object
+%
+%   Usage:
+%      rgb = rgb(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	rgb.type='rgb';
+	rgb.grid1=NaN; 
+	rgb.grid2=NaN;
+	rgb.dof=NaN; 
+	rgb=class(rgb,'rgb');
+				
+case 1
+	%If single argument of class rgb, we have a copy constructor. 
+	if (isa(varargin{1},'rgb'))
+		rgb = varargin{1};
+	else
+		error('rgb constructor error message: copy constructor called on a non ''rgb'' class object');
+	end 
+otherwise
+	error('rgb constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@rgb/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@rgb/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@rgb/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function rgb = subsasgn(rgb,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      rgb = subsasgn(rgb,index,val)
+%
+%   See also SUBSREF
+
+rgb=builtin('subsasgn',rgb,index,val);
Index: /issm/trunk/src/m/classes/@rgb/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@rgb/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@rgb/subsref.m	(revision 1)
@@ -0,0 +1,11 @@
+function rgb = subsref(rgb,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%
+%   Usage:
+%      rgb = subsref(rgb,index)
+% 
+%   See also SUBSASGN
+
+rgb=builtin('subsref',rgb,index);
Index: /issm/trunk/src/m/classes/@singelem/CreateKMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@singelem/CreateKMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@singelem/CreateKMatrix.m	(revision 1)
@@ -0,0 +1,44 @@
+function Ke=CreateKMatrix(singelem,grids,materials,inputs,analysis_type)
+%CREATEKMATRIX - create the stiffmess matrix for singelem
+%
+%   this stiffness matrix works for Hutter's model
+%
+%   Usage:
+%      Ke=CreateKMatrix(singelem,grids,materials,inputs,analysis_type)
+%
+%   See also CREATEPVECTOR
+
+
+	if strcmpi(analysis_type,'diagnostic_hutter'),
+
+		Ke=CreateKMatrixHutter(singelem,grids,materials,inputs);
+
+	else
+		error('CreateKMatrix/beam error message: analysis type not supported yet')
+	end
+end %end function
+
+function Ke=CreateKMatrixHutter(singelem,grids,materials,inputs)
+
+	%some variables
+	numgrids=1;
+	DOFPERGRID=2;
+	numdof=numgrids*DOFPERGRID; %number of dof for element singelem.
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(singelem.g(i)).grid.doflist; %list of dofs in the g-set
+		for j=1:DOFPERGRID,
+			dof=doflist(j);
+			Ke.row_indices((i-1)*DOFPERGRID+j)=dof;
+		end
+		
+		dof=doflist(1);
+	end
+
+	Ke.terms=eye(2);
+
+end %end function
Index: /issm/trunk/src/m/classes/@singelem/CreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@singelem/CreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@singelem/CreatePVector.m	(revision 1)
@@ -0,0 +1,100 @@
+function pe=CreatePVector(singelem,grids,materials,inputs,analysis_type);
+%CREATEPVECTOR - create the load vector for a singelem
+%
+%   works only for Hutter's model
+%
+%   Usage:
+%      Pe=CreatePVector(singelem,grids,materials,inputs,analysis_type);
+% 
+%   See also CREATEKMATRIX
+
+
+	if strcmpi(analysis_type,'diagnostic_hutter'),
+
+		pe=CreatePVectorHutter(singelem,grids,materials,inputs);
+
+	else
+		error('singelem/CreatePVector error message: analysis type not implemented yet')
+	end
+end %end function
+
+function pe=CreatePVectorHutter(singelem,grids,materials,inputs);
+
+	%some variables
+	numgrids=1;
+	NDOF2=2;
+
+	%Create elementary vector.
+	pe=elemvector(numgrids*NDOF2);
+
+	%recover material
+	matice=materials(singelem.matid).material;
+	matpar=materials(end).constants;
+
+	%recover material parameters
+	gravity=matpar.g;
+	rho_ice=matpar.rho_ice;
+	n=matice.n;
+
+	%recover extra inputs
+	[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+	[B_param B_is_present]=recover_input(inputs,'B');
+	[temperature_param temperature_is_present]=recover_input(inputs,'temperature');
+	[slopesurface_param slopesurface_is_present]=recover_input(inputs,'slopesurface');
+
+	if ~slopesurface_is_present,
+		error('CreatePVector/singelem error message: slope_surface is missing in inputs');
+	end
+
+	%Initialize inputs
+	B_list=zeros(numgrids,1);
+	temperature_list=zeros(numgrids,1);
+	slopesurface_list=zeros(numgrids,2);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(singelem.g(i)).grid.doflist;
+		for j=1:NDOF2,
+			pe.row_indices((i-1)*NDOF2+j)=doflist(j);
+			slopesurface_list(i,j)=slopesurface_param(doflist(j));
+		end
+		dof=doflist(1);
+		if(thickness_is_present) thickness_list(i)=thickness_param(dof);end;
+		if(B_is_present) B_list(i)=B_param(dof);end;
+		if(temperature_is_present) temperature_list(i)=temperature_param(dof);end;
+	end
+
+	%compute slope2 slopex and slopy
+	slope=zeros(2,1);
+	slope(1)=slopesurface_list(1,1); %2 and 1 have the same slopes (mesh has been verticaly extruded)
+	slope(2)=slopesurface_list(1,2);
+	slope2=slope(1)^2+slope(2)^2;
+
+	%compute thickness
+	if thickness_is_present
+		thickness=thickness_list(1);
+	else
+		thickness=singelem.h(1);
+	end
+
+	%compute ub
+	ub=-1.58*10^-10*rho_ice*gravity*thickness*slope(1);
+	vb=-1.58*10^-10*rho_ice*gravity*thickness*slope(2);
+
+	%compute constant_part
+	constant_part=-2*(rho_ice*gravity)^n*(slope2)^((n-1)/2);
+
+	%Update material if temperature is provided.
+	if B_is_present,
+		B=GetParameterValue(singelem,B_list,gauss_coord);
+	elseif temperature_is_present,
+		temperature=GetParameterValue(singelem,temperature_list,gauss_coord);
+		B=paterson(temperature);
+	else
+		B=matice.B;
+	end
+
+	pe.terms(1)=ub-2*(rho_ice*gravity)^n*(slope2)^((n-1)/2)*thickness^(n)/(B^n*(n+1))*slope(1);
+	pe.terms(2)=vb-2*(rho_ice*gravity)^n*(slope2)^((n-1)/2)*thickness^(n)/(B^n*(n+1))*slope(2);
+
+end %end function
Index: /issm/trunk/src/m/classes/@singelem/display.m
===================================================================
--- /issm/trunk/src/m/classes/@singelem/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@singelem/display.m	(revision 1)
@@ -0,0 +1,12 @@
+function display(singelem)
+%DISPLAY - displays the fields of a sing element
+%
+%   echo function for 'singelem' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   type: %s',singelem.type));
+disp(sprintf('   id: %i',singelem.id));
+disp(sprintf('   material id: %i',singelem.matid));
+disp(sprintf('   grid ids: %i %i',singelem.g(1)));
+disp(sprintf('   thickness: %g %g',singelem.h(1)));
+disp(sprintf('   drag coeff: %g',singelem.k));
Index: /issm/trunk/src/m/classes/@singelem/singelem.m
===================================================================
--- /issm/trunk/src/m/classes/@singelem/singelem.m	(revision 1)
+++ /issm/trunk/src/m/classes/@singelem/singelem.m	(revision 1)
@@ -0,0 +1,27 @@
+function singelem = singelem(varargin)
+%SINGELEM - contructor for singelem objects
+%
+%   Usage:
+%      singelem = singelem(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	singelem.type='singelem';
+	singelem.id=NaN;
+	singelem.matid=NaN;
+	singelem.g=zeros(2,1);
+	singelem.h=zeros(2,1);
+	singelem.k=zeros(2,1);
+	singelem=class(singelem,'singelem');
+				
+case 1
+	%If single argument of class singelem, we have a copy constructor. 
+	if (isa(varargin{1},'singelem'))
+		singelem = varargin{1};
+	else
+		error('singelem constructor error message: copy constructor called on a non ''singelem'' class object');
+	end 
+otherwise
+	error('singelem constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@singelem/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@singelem/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@singelem/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function singelem = subsasgn(singelem,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      singelem = subsasgn(singelem,index,val)
+%
+%   See also SUBSREF
+
+singelem=builtin('subsasgn',singelem,index,val);
Index: /issm/trunk/src/m/classes/@singelem/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@singelem/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@singelem/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function singelem = subsref(singelem,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      singelem = subsref(singelem,index)
+% 
+%   See also SUBSASGN
+
+singelem=builtin('subsref',singelem,index);
Index: /issm/trunk/src/m/classes/@spc/display.m
===================================================================
--- /issm/trunk/src/m/classes/@spc/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@spc/display.m	(revision 1)
@@ -0,0 +1,9 @@
+function display(spc)
+%DISPLAY - displays the fields of an spc
+%
+%   echo function for 'spc' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   grid: %i',spc.grid));
+disp(sprintf('   dof: %g',spc.dof));
+disp(sprintf('   value: %g',spc.value));
Index: /issm/trunk/src/m/classes/@spc/spc.m
===================================================================
--- /issm/trunk/src/m/classes/@spc/spc.m	(revision 1)
+++ /issm/trunk/src/m/classes/@spc/spc.m	(revision 1)
@@ -0,0 +1,25 @@
+function spc = spc(varargin)
+%SPC - constructor for spc object
+%
+%   Usage:
+%      spc = spc(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	spc.type='spc';
+	spc.grid=NaN; %grid number for this constraint
+	spc.dof=NaN; %c is the dof for the corresponding constraint ( 1<=c<=6, for all (x,y,z) deformations + (x,y,z) rotations)
+	spc.value=NaN; %d is the value of the constraint.
+	spc=class(spc,'spc');
+				
+case 1
+	%If single argument of class spc, we have a copy constructor. 
+	if (isa(varargin{1},'spc'))
+		spc = varargin{1};
+	else
+		error('spc constructor error message: copy constructor called on a non ''spc'' class object');
+	end 
+otherwise
+	error('spc constructor error message: 0 of 1 argument only in input.');
+end
Index: /issm/trunk/src/m/classes/@spc/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@spc/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@spc/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function spc = subsasgn(spc,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      spc = subsasgn(spc,index,val)
+%
+%   See also SUBSREF
+
+spc=builtin('subsasgn',spc,index,val);
Index: /issm/trunk/src/m/classes/@spc/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@spc/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@spc/subsref.m	(revision 1)
@@ -0,0 +1,11 @@
+function spc = subsref(spc,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%
+%   Usage:
+%      spc = subsref(spc,index)
+% 
+%   See also SUBSASGN
+
+spc=builtin('subsref',spc,index);
Index: /issm/trunk/src/m/classes/@tetraelem/GetJacobian.m
===================================================================
--- /issm/trunk/src/m/classes/@tetraelem/GetJacobian.m	(revision 1)
+++ /issm/trunk/src/m/classes/@tetraelem/GetJacobian.m	(revision 1)
@@ -0,0 +1,43 @@
+function J=GetJacobian(tetraelem,xyz_list,gauss_coord)
+%GETJACOBIAN- computes the jacobian for a tetraelem
+%
+%   Usage:
+%      J=GetJacobian(tetraelem,z_list,gauss_coord)
+%
+%   See also GETJACOBIANDETERMINANT
+
+%The Jacobian is constant over the element, discard the gaussian points. 
+
+J=zeros(3,3);
+sqrt3=sqrt(3.0);
+sqrt6=sqrt(6);
+
+%grids coordinates	
+x1=xyz_list(1,1);
+y1=xyz_list(1,2);
+z1=xyz_list(1,3);
+
+x2=xyz_list(2,1);
+y2=xyz_list(2,2);
+z2=xyz_list(2,3);
+
+x3=xyz_list(3,1);
+y3=xyz_list(3,2);
+z3=xyz_list(3,3);
+
+x4=xyz_list(4,1);
+y4=xyz_list(4,2);
+z4=xyz_list(4,3);
+
+%Computation of the jacobian on this gauss point
+J(1,1)=1.0/2.0* (-x1+x2);
+J(2,1)=1.0/2.0* (-y1+y2);
+J(3,1)=1.0/2.0* (-z1+z2);
+
+J(1,2)=1.0/(2*sqrt3)* (-x1+x2+2*x3);
+J(2,2)=1.0/(2*sqrt3)* (-y1+y2+2*y3);
+J(3,2)=1.0/(2*sqrt3)* (-z1+z2+2*z3);
+
+J(1,3)=1.0/(2*sqrt6)* (-x1-x2-x3+x4);
+J(2,3)=1.0/(2*sqrt6)* (-y1-y2-y3+y4);
+J(3,3)=1.0/(2*sqrt6)* (-z1-z2-z3+z4);
Index: /issm/trunk/src/m/classes/@tetraelem/GetJacobianDeterminant.m
===================================================================
--- /issm/trunk/src/m/classes/@tetraelem/GetJacobianDeterminant.m	(revision 1)
+++ /issm/trunk/src/m/classes/@tetraelem/GetJacobianDeterminant.m	(revision 1)
@@ -0,0 +1,13 @@
+function Jdet=GetJacobianDeterminant(tetraelem,xyz_list,gauss_coord),
+%GETJACOBIANDETERMINANT - computes the determinant of the jacobian for a tetraelem
+%
+%   Usage:
+%      Jdet=GetJacobianDeterminant(tetraelem,z_list,gauss_coord)
+%
+%   See also GETJACOBIAN
+
+J=GetJacobian(tetraelem,xyz_list,gauss_coord);
+Jdet=det(J);
+if(Jdet<0),
+	error('GetJacobianDeterminantTetra error message: negative jacobian determinant!')
+end
Index: /issm/trunk/src/m/classes/@triaelem/CreateKMatrix.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/CreateKMatrix.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/CreateKMatrix.m	(revision 1)
@@ -0,0 +1,494 @@
+function Ke=CreateKMatrix(triaelem,grids,materials,inputs,analysis_type);
+%CREATEKMATRIX - create the stiffmess matrix for triaelem
+%
+%   this stiffness matrix works for MacAyeal's model, prognostic
+%   and for the computation of the bed slope and surface slope
+%
+%   Usage:
+%      Ke=CreateKMatrix(triaelem,grids,materials,inputs,analysis_type)
+%
+%   See also CREATEPVECTOR
+
+	if strcmpi(analysis_type,'diagnostic_horiz'),
+
+		Ke=CreateKMatrixHoriz(triaelem,grids,materials,inputs);
+
+	elseif strcmpi(analysis_type,'diagnostic_vert'),
+
+		Ke=CreateKMatrixVert(triaelem,grids,materials,inputs);
+
+	elseif strcmpi(analysis_type,'temperature'),
+
+		Ke=CreateKMatrixThermal(triaelem,grids,materials,inputs);
+
+	elseif strcmpi(analysis_type,'prognostic'),
+
+		Ke=CreateKMatrixPrognostic(triaelem,grids,materials,inputs);
+
+	elseif strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y') | strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+
+		Ke=CreateKMatrixSlopeCompute(triaelem,grids,materials,inputs);
+
+	end
+end %end function
+
+
+function Ke=CreateKMatrixVert(triaelem,grids,materials,inputs)
+error('CreateKMatrix error message: Vertical analysis not implemented yet');
+end %end function
+
+
+function Ke=CreateKMatrixPrognostic(triaelem,grids,materials,inputs)
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element triaelem.
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(triaelem,grids); 
+
+	%recover extra inputs from users, at current convergence iteration.
+	[dt dt_is_present]=recover_input(inputs,'dt');
+	[velocity_average_param velocity_average_is_present]=recover_input(inputs,'velocity_average');
+
+	%check on all parameters
+	if ((~dt_is_present) | (~velocity_average_is_present)),
+		error('CreateKMatrixPrognostic error message: missing input parameters!');
+	end
+	
+	%initialize parameter lists (for our 3 grids)
+	vxvy_list=zeros(numgrids,2);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(triaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		Ke.row_indices(i)=doflist(1);
+		vxvy_list(i,:)=velocity_average_param(doflist(1:2));
+	end
+
+	%Create Artificial diffusivity once for all if requested
+	if triaelem.artificial_diffusivity,
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,[1/3 1/3 1/3]);
+
+		%Build K matrix (artificial diffusivity matrix)
+		v_gauss=1/3*(vxvy_list(1,:)+vxvy_list(2,:)+vxvy_list(3,:));
+		K=Jdettria^(1/2)/2*[abs(v_gauss(1)) 0 ; 0 abs(v_gauss(2))];		
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	for ig=1:num_gauss2D,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L matrix if viscous basal drag present:
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+
+		DL_scalar=gauss_weight*Jdettria;
+
+		%Do the triple product tL*D*L. 
+		Ke_gg_gaussian=L'*DL_scalar*L;
+
+		%Get B matrix 
+		B=GetB_prog(triaelem,xyz_list,gauss_coord);
+		
+		%Get Bprime matrix 
+		Bprime=GetBprime_prog(triaelem,xyz_list,gauss_coord);
+
+		%Get u, v and their derivatives at gauss point
+		u_g=GetParameterValue(triaelem,vxvy_list(:,1),gauss_coord);
+		v_g=GetParameterValue(triaelem,vxvy_list(:,2),gauss_coord);
+		du_g=GetParameterDerivativeValue(triaelem,vxvy_list(:,1),xyz_list,gauss_coord);
+		dv_g=GetParameterDerivativeValue(triaelem,vxvy_list(:,2),xyz_list,gauss_coord);
+		dux_g=du_g(1);
+		dvy_g=dv_g(2);
+		
+		DL_scalar=dt*gauss_weight*Jdettria;
+
+		%Create DL and DLprime matrix
+		DL=DL_scalar*[dux_g, 0; 0, dvy_g];
+		DLprime=DL_scalar*[u_g, 0; 0, v_g];
+
+		%Do the triple product tL*D*L. 
+		Ke_gg_thickness=B'*DL*B+B'*DLprime*Bprime;
+
+		%Add Ke_gg_drag_gaussian and Ke_gg_gaussian to Ke
+		Ke.terms=Ke.terms+Ke_gg_gaussian+Ke_gg_thickness;
+
+		%Add artificial diffusivity  if requested
+		if triaelem.artificial_diffusivity,
+
+			%Do the triple product tL*D*L. 
+			Ke_gg_gaussian=Bprime'*DL_scalar*K*Bprime;
+			
+			%Add Ke_gg_drag_gaussian to Ke
+			Ke.terms=Ke.terms+Ke_gg_gaussian;
+		end
+	end
+end %end function
+
+
+function Ke=CreateKMatrixThermal(triaelem,grids,materials,inputs)
+error('CreateKMatrix error message: Thermal analysis not implemented yet');
+end %end function
+
+
+function Ke=CreateKMatrixSlopeCompute(triaelem,grids,materials,inputs)
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element pentaelem.
+
+	%Create elementary stiffness matrix 
+	Ke=elemmatrix(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(triaelem,grids); 
+
+	%Just keep the first 3 grids
+	xyz_list=xyz_list(1:3,:);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(triaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		dof=doflist(1);
+		Ke.row_indices(i)=dof;
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	for ig=1:num_gauss2D,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L matrix if viscous basal drag present:
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+   
+		DL_scalar=gauss_weight*Jdettria;
+
+		%Do the triple product tL*D*L. 
+		Ke_gg_gaussian=L'*DL_scalar*L;
+		
+		%Add Ke_gg_drag_gaussian to Ke
+		Ke.terms=Ke.terms+Ke_gg_gaussian;
+	end
+
+end %end function
+
+
+
+function Ke=CreateKMatrixHoriz(triaelem,grids,materials,inputs);
+
+global element_debug  element_debugid
+
+
+%Check if MacAyeal's acceleration is not on? 
+if triaelem.acceleration==1,
+	Ke=elemmatrix(0);
+	return;
+end
+
+%some variables
+numgrids=3;
+DOFPERGRID=2;
+numdof=numgrids*DOFPERGRID; %number of dof for element triaelem.
+
+%some parameters
+MAXSLOPE=.06;  %any element with slope>MAXSLOPE is considered a "rock" element, with infinite stiffness.
+MOUNTAINKEXPONENT=10; % "infinite" stiffness is going to be  10^MOUNTAINKEXPONENT
+
+%Create elementary stiffness matrix 
+Ke=elemmatrix(numdof);
+
+%recover material
+matice=materials(triaelem.matid).material;
+matpar=materials(end).constants;
+
+%recover material parameters
+gravity=matpar.g;
+viscosity_overshoot=matpar.viscosity_overshoot;
+rho_ice=matpar.rho_ice;
+rho_water=matpar.rho_water;
+
+%recover extra inputs from users, at current convergence iteration.
+[basal_drag_param basal_drag_is_present]=recover_input(inputs,'drag');
+[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+[surface_param surface_is_present]=recover_input(inputs,'surface');
+[bed_param bed_is_present]=recover_input(inputs,'bed');
+[temperature_average_param temperature_average_is_present]=recover_input(inputs,'temperature_average');
+[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+[oldvelocity_param oldvelocity_is_present]=recover_input(inputs,'oldvelocity');
+
+%initialize extra arrays if some inputs are present
+vxvy_list=zeros(numgrids,2);
+oldvxvy_list=zeros(numgrids,2);
+
+B_list=zeros(numgrids,1);
+K_list=zeros(numgrids,1);
+thickness_list=zeros(numgrids,1);
+surface_list=zeros(numgrids,1);
+bed_list=zeros(numgrids,1);
+temperature_average_list=zeros(numgrids,1);
+
+
+%Get all element grid data:
+xyz_list=getgriddata(triaelem,grids);
+
+
+%Build linear indices for elementary stiffness matrix.
+for i=1:numgrids,
+	doflist=grids(triaelem.g(i)).grid.doflist; %list of dofs in the g-set
+	for j=1:DOFPERGRID,
+		dof=doflist(j);
+		Ke.row_indices((i-1)*DOFPERGRID+j)=dof;
+		if velocity_is_present, vxvy_list(i,j)=velocity_param(dof); end;
+		if oldvelocity_is_present, oldvxvy_list(i,j)=oldvelocity_param(dof); end;
+	end
+	
+	dof=doflist(1);
+	if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	if(basal_drag_is_present), 
+		K_list(i)=basal_drag_param(dof);
+	else
+		K_list(i)=triaelem.k(i);
+	end
+	if(thickness_is_present),
+		thickness_list(i)=thickness_param(dof);
+	else
+		thickness_list(i)=triaelem.h(i);
+	end
+	if(surface_is_present),
+		surface_list(i)=surface_param(dof);
+	else
+		surface_list(i)=triaelem.s(i);
+	end
+	if(bed_is_present),
+		bed_list(i)=bed_param(dof);
+	else
+		bed_list(i)=triaelem.b(i);
+	end
+	if(temperature_average_is_present) temperature_average_list(i)=temperature_average_param(dof);end;
+end
+if (element_debug & triaelem.id==element_debugid),
+	disp(sprintf('El id %i TriaElemnet input list before gaussian loop: \n',element_debugid)); 
+	disp(sprintf('   rho_ice: %g ',rho_ice));
+	disp(sprintf('   gravity: %g',gravity));
+	disp(sprintf('   rho_water: %g',rho_water));
+	disp(sprintf('   Velocity: '));
+	for i=1:3,
+		disp(sprintf('      grid %i  [%g,%g]',i,vxvy_list(i,1),vxvy_list(i,2)));
+	end
+	disp(sprintf('   B [%g %g %g ]',B_list(1),B_list(2),B_list(3)));
+	disp(sprintf('   K [%g %g %g ]',K_list(1),K_list(2),K_list(3)));
+	disp(sprintf('   thickness [%g %g %g]',thickness_list(1),thickness_list(2),thickness_list(3)));
+	disp(sprintf('   surface [%g %g %g ]',surface_list(1),surface_list(2),surface_list(3)));
+	disp(sprintf('   bed [%g %g %g]',bed_list(1),bed_list(2),bed_list(3)));
+	if(temperature_average_is_present)disp(sprintf('   temperature_average [%g %g %g]',temperature_average_list(1),temperature_average_list(2),temperature_average_list(3)));end;
+end
+
+
+
+alpha2_list=zeros(3,1);
+%Build alpha2 used by drag staffness matrix
+if (~triaelem.shelf & triaelem.friction_type==2)
+    
+	%Retrieve some parameters needed to compute alpha2 (taub=alpha2*ub)
+	frictionparameters=struct();
+	frictionparameters.element_type='2d';
+	frictionparameters.rho_ice=rho_ice;
+	frictionparameters.rho_water=rho_water;
+	frictionparameters.g=gravity;	
+	frictionparameters.p=triaelem.p;
+	frictionparameters.q=triaelem.q;
+
+	 if velocity_is_present,
+		frictionparameters.velocities=vxvy_list;
+	else
+		frictionparameters.velocities=zeros(3,2);
+	end
+	frictionparameters.h=thickness_list;
+	frictionparameters.b=bed_list;
+	frictionparameters.k=K_list;
+
+	alpha2=Getalpha2(frictionparameters);
+	if (element_debug & triaelem.id==element_debugid),
+		disp(sprintf('   alpha2_list (%g %g %g )',alpha2_list(1),alpha2_list(2),alpha2_list(3)));
+	end
+end
+
+% Get gaussian points and weights. Order of integration is 2, because we need to integrate the product tB*D*B' 
+%which is a polynomial of degree 3 (see GaussTria for more details) 
+
+[num_gauss,first_gauss_area_coord,second_gauss_area_coord,third_gauss_area_coord,gauss_weights]=GaussTria(2);
+    
+if (element_debug & triaelem.id==element_debugid),
+	disp(sprintf('   gaussian points: '));
+	for i=1:num_gauss,
+		disp(sprintf('    %g %g %g : %g',first_gauss_area_coord(i),second_gauss_area_coord(i),third_gauss_area_coord(i),gauss_weights(i)));
+	end
+end
+    
+%Start  looping on the number of gaussian points:
+for ig=1:num_gauss,
+	%Pick up the gaussian point and its weight:
+	gauss_weight=gauss_weights(ig);
+	gauss_l1l2l3=[first_gauss_area_coord(ig) second_gauss_area_coord(ig) third_gauss_area_coord(ig)];
+
+	%Compute thickness at gaussian point from t1,t2 and t3 fields in the element itself
+	if thickness_is_present,
+		thickness=GetParameterValue(triaelem,thickness_list,gauss_l1l2l3);
+	else
+		thickness=GetParameterValue(triaelem,triaelem.h,gauss_l1l2l3);
+	end
+	%disp(sprintf('Thickness: %f\n', thickness));
+
+	%If we have a slope > 6% for this element,  it means  we are on a mountain. In this particular case, 
+	%velocity should be = 0. To achieve this result, we set k to a very low value.
+	slopevector=zeros(2,1);
+	if(~triaelem.shelf),
+	
+		if surface_is_present,
+			slopevector=GetParameterDerivativeValue(triaelem,surface_list,xyz_list,gauss_l1l2l3);
+		else
+			slopevector=GetParameterDerivativeValue(triaelem,triaelem.s,xyz_list,gauss_l1l2l3);
+		end
+		slope_magnitude=sqrt(slopevector(1)^2+slopevector(2)^2);
+
+		if (slope_magnitude>MAXSLOPE),
+			K=10^(-MOUNTAINKEXPONENT);
+		end
+	end
+	
+	%Get strain rate, if velocity has been supplied: 
+	if velocity_is_present,
+ 		epsilon=GetStrainRate(triaelem,vxvy_list,xyz_list,gauss_l1l2l3);
+	else
+ 		epsilon=zeros(3,1);
+	end
+	if oldvelocity_is_present,
+ 		oldepsilon=GetStrainRate(triaelem,oldvxvy_list,xyz_list,gauss_l1l2l3);
+	else
+ 		oldepsilon=zeros(3,1);
+	end
+
+	%disp(sprintf('Epsilon: %f %f %f\n',epsilon(1),epsilon(2),epsilon(3)));
+	
+	%Update material if temperature is provided.
+	if temperature_average_is_present,
+		temperature_average=GetParameterValue(triaelem,temperature_average_list,gauss_l1l2l3);
+		matice.B=paterson(temperature_average);
+	end
+
+	%Update material if flow law is specified. This will erase the previous change 
+	%on B when temperature is provided. 
+	if flow_law_is_present,
+		B_param=GetParameterValue(triaelem,B_list,gauss_l1l2l3);
+		matice.B=B_param; clear B_param.
+	end
+
+
+	%Get viscosity at last two iterations: 
+ 	newviscosity=GetViscosity2d(matice,epsilon);
+ 	oldviscosity=GetViscosity2d(matice,oldepsilon);
+	viscosity=newviscosity+viscosity_overshoot*(newviscosity-oldviscosity);
+
+	%Get Jacobian determinant:
+	Jdet=GetJacobianDeterminant(triaelem,xyz_list,gauss_l1l2l3);
+
+	% Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant 
+	% onto this scalar matrix, so that we win some computational time: */
+	D=viscosity*thickness*gauss_weight*Jdet*diag(ones(numgrids,1));
+
+	if (element_debug & triaelem.id==element_debugid),
+		disp(sprintf('   gaussian loop %i\n',ig));
+		disp(sprintf('      thickness %g',thickness));
+		disp(sprintf('      slope (%g,%g)',slopevector(1),slopevector(2)));
+		disp(sprintf('      alpha2_list (%g,%g,%g)',alpha2_list(1),alpha2_list(2),alpha2_list(3)));
+		disp(sprintf('      epsilon (%g,%g,%g)',epsilon(1),epsilon(2),epsilon(3)));
+		disp(sprintf('      Matice: '));
+		matice
+		disp(sprintf('\n      viscosity: %g ',viscosity));
+		disp(sprintf('      jacobian: %g ',Jdet));
+		disp(sprintf('      gauss_weight: %g ',gauss_weight));
+	end
+
+
+	%Get B and Bprime matrices:
+	B=GetB(triaelem,xyz_list,gauss_l1l2l3);
+	Bprime=GetBprime(triaelem,xyz_list,gauss_l1l2l3);
+
+	%Get L matrix if viscous basal drag present:
+	L=zeros(2,DOFPERGRID*numgrids);
+	if (triaelem.friction_type==2 && triaelem.shelf==0),
+		L=GetL(triaelem,gauss_l1l2l3,DOFPERGRID);
+	end
+
+	
+	% Do the triple product tB*D*Bprime: 
+	Ke_gg_gaussian=B'*D*Bprime;
+
+	%Add Ke_gg_gaussian to Ke: 
+	Ke.terms=Ke.terms+Ke_gg_gaussian;
+
+	%Now, take care of the basal friction if there is any
+	alpha2_g=0;
+	if (~triaelem.shelf) & (triaelem.friction_type==2),
+ 
+		%compute alpha2 for the current gaussian point
+		alpha2_g=GetParameterValue(triaelem,alpha2,gauss_l1l2l3);
+        
+		if velocity_is_present
+			DL_scalar=alpha2_g*gauss_weight*Jdet;
+		else
+			DL_scalar=0;
+		end
+        
+		DL=diag(DL_scalar*ones(2,1));
+
+		%Do the triple product tL*D*L
+		Ke_gg_drag_gaussian=L'*DL*L;
+
+		%Add Ke_gg_drag_gaussian to Ke: 
+		Ke.terms=Ke.terms+Ke_gg_drag_gaussian;
+	end
+
+	if (element_debug & triaelem.id==element_debugid),
+		disp(sprintf('      alpha2 %g\n',alpha2_g));
+		disp(sprintf('B:\n'));
+		B
+		disp(sprintf('Bprime:\n'));
+		Bprime
+		disp(sprintf('L:\n'));
+		L
+	end
+
+end %for ig=1:num_gauss,
+	
+if (element_debug & triaelem.id==element_debugid),
+	disp(sprintf('Ke_gg->terms:\n'));
+	Ke.terms
+	disp(sprintf('Ke_gg->row_indices:\n'));
+	Ke.row_indices'
+end
+
+end %end function
+
Index: /issm/trunk/src/m/classes/@triaelem/CreatePVector.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/CreatePVector.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/CreatePVector.m	(revision 1)
@@ -0,0 +1,350 @@
+function pe=CreatePVector(triaelem,grids,materials,inputs,analysis_type);
+%CREATEPVECTOR - create the load vector for triaelem
+%
+%   this load vector works for MacAyeal's model, prognostic
+%   and for the computation of the bed slope and surface slope
+%
+%   Usage:
+%      pe=CreatePVector(triaelem,grids,materials,inputs,analysis_type)
+%
+%   See also CREATEKMATRIX
+
+if strcmpi(analysis_type,'diagnostic_horiz'),
+
+	pe=CreatePVectorHoriz(triaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'diagnostic_vert'),
+
+	pe=CreatePVectorVert(triaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'temperature'),
+
+	pe=CreatePVectorThermal(triaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'prognostic'),
+
+	pe=CreatePVectorPrognostic(triaelem,grids,materials,inputs);
+
+elseif strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y') | strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+
+	pe=CreatePVectorSlopeCompute(triaelem,grids,materials,inputs,analysis_type);
+
+end
+end %end function
+
+function pe=CreatePVectorVert(triaelem,grids,materials,inputs)
+error('CreatePVector error message: Vertical analysis not implemented yet');
+end %end function
+
+function pe=CreatePVectorThermal(triaelem,grids,materials,inputs)
+error('CreatePVector error message: Thermal analysis not implemented yet');
+end %end function
+
+function pe=CreatePVectorSlopeCompute(triaelem,grids,materials,inputs,analysis_type);
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element triaelem.
+
+	%Create elementary stiffness matrix 
+	pe=elemvector(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(triaelem,grids); 
+
+	%Just keep the first 3 grids
+	xyz_list=xyz_list(1:3,:);
+
+	%recover extra inputs
+	if strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y') ,
+		[param param_is_present]=recover_input(inputs,'bed');
+	elseif strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+		[param param_is_present]=recover_input(inputs,'surface');
+	end
+
+	param_list=zeros(numgrids,1);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(triaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		if(param_is_present) param_list(i)=param(doflist(1));end;
+		dof=doflist(1);
+		pe.row_indices(i)=dof;
+	end
+
+	if param_is_present, 
+		param=param_list(1:3); 
+	else 
+		if strcmpi(analysis_type,'bed_slope_compute_x') | strcmpi(analysis_type,'bed_slope_compute_y') ,
+			param=triaelem.b(1:3); 
+		elseif strcmpi(analysis_type,'surface_slope_compute_x') | strcmpi(analysis_type,'surface_slope_compute_y'),
+			param=triaelem.s(1:3); 
+		end
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	%for icesheets
+	for ig=1:num_gauss2D,
+	
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		
+		%Get bed slope
+		dparam=GetParameterDerivativeValue(triaelem,param,xyz_list,gauss_coord);
+		dparamdx=dparam(1);
+		dparamdy=dparam(2);
+
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L: 
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+
+		%Build gaussian vector 
+		if strcmp(analysis_type,'bed_slope_compute_x') | strcmp(analysis_type,'surface_slope_compute_x'),
+			pe_g_gaussian=Jdettria*gauss_weight*dparamdx*L';
+		elseif strcmp(analysis_type,'bed_slope_compute_y')|  strcmp(analysis_type,'surface_slope_compute_y'),
+			pe_g_gaussian=Jdettria*gauss_weight*dparamdy*L';
+		end
+
+		%Add Ke_gg_drag_gaussian to Ke
+		pe.terms=pe.terms+pe_g_gaussian;
+	end
+
+end %end function
+
+
+function pe=CreatePVectorHoriz(triaelem,grids,materials,inputs);
+
+	global element_debug  element_debugid
+
+	%Check if MacAyeal's acceleration is not on? 
+	if triaelem.acceleration==1,
+		pe={};
+	end
+
+	%some variables
+	numgrids=3;
+	NDOF2=2;
+
+	%Create elementary vector.
+	pe=elemvector(numgrids*NDOF2);
+
+	%recover material
+	matice=materials(triaelem.matid).material;
+	matpar=materials(end).constants;
+
+	%recover material parameters
+	gravity=matpar.g;
+	rho_ice=matpar.rho_ice;
+
+	%recover extra inputs
+	[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+	[surface_param surface_is_present]=recover_input(inputs,'surface');
+	[bed_param bed_is_present]=recover_input(inputs,'bed');
+	[basal_drag_param basal_drag_is_present]=recover_input(inputs,'drag');
+		
+	%Get all element grid data:
+	xyz_list=getgriddata(triaelem,grids);
+
+	%initialize extra inputs
+	K_list=zeros(numgrids,1);
+	thickness_list=zeros(numgrids,1);
+	surface_list=zeros(numgrids,1);
+	bed_list=zeros(numgrids,1);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(triaelem.g(i)).grid.doflist;
+		for j=1:NDOF2,
+			pe.row_indices((i-1)*NDOF2+j)=doflist(j);
+		end
+		dof=doflist(1);
+		if(thickness_is_present),
+			thickness_list(i)=thickness_param(dof);
+		else
+			thickness_list(i)=triaelem.h(i);
+		end
+		if(surface_is_present),
+			surface_list(i)=surface_param(dof);
+		else
+			surface_list(i)=triaelem.s(i);
+		end;
+		if(bed_is_present),
+			bed_list(i)=bed_param(dof);
+		else
+			bed_list(i)=triaelem.b(i);
+		end
+		if(basal_drag_is_present),
+			K_list(i)=basal_drag_param(dof);
+		else
+			K_list(i)=triaelem.k(i);
+		end
+	end
+
+	if (element_debug & triaelem.id==element_debugid),
+		disp(sprintf('gravity %g\n',gravity));
+		disp(sprintf('rho_ice %g\n',rho_ice));
+		disp(sprintf('thickness_list (%g,%g,%g)\n',thickness_list(1),thickness_list(2),thickness_list(3)));
+		disp(sprintf('surface_list (%g,%g,%g)\n',surface_list(1),surface_list(2),surface_list(3)));
+		disp(sprintf('bed_list (%g,%g,%g)\n',bed_list(1),bed_list(2),bed_list(3)));
+		disp(sprintf('K_list (%g,%g,%g)\n',K_list(1),K_list(2),K_list(3)));
+	end
+
+	% Get gaussian points and weights 
+	[num_gauss,first_gauss_area_coord,second_gauss_area_coord,third_gauss_area_coord,gauss_weights]=GaussTria(2);
+
+	if (element_debug & triaelem.id==element_debugid),
+		disp(sprintf('   gaussian points: '));
+		for i=1:num_gauss,
+			disp(sprintf('    %g %g %g : %g',first_gauss_area_coord(i),second_gauss_area_coord(i),third_gauss_area_coord(i),gauss_weights(i)));
+		end
+	end
+ 
+	%Start  looping on the number of gaussian points:
+	for ig=1:num_gauss,
+		%Pick up the gaussian point:
+		gauss_weight=gauss_weights(ig);
+		gauss_l1l2l3=[first_gauss_area_coord(ig) second_gauss_area_coord(ig) third_gauss_area_coord(ig)];
+
+		%Compute thickness at gaussian point from t1,t2 and t3 fields in the element itself
+		thickness=GetParameterValue(triaelem,thickness_list,gauss_l1l2l3);
+
+		slopevector=GetParameterDerivativeValue(triaelem,surface_list,xyz_list,gauss_l1l2l3);
+
+		%In case we have plastic basal drag, compute plastic stress at gaussian point from k1, k2 and k3 fields in the 
+		%element itself: 
+		if (~triaelem.shelf) & (triaelem.friction_type==1),
+			plastic_stress=GetParameterValue(triaelem,K_list,gauss_l1l2l3);
+		end
+
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(triaelem,xyz_list,gauss_l1l2l3);
+
+		%Get nodal functions
+		l1l2l3=GetNodalFunctions(triaelem,gauss_l1l2l3);
+
+		%Compute driving stress: 
+		driving_stress_baseline=rho_ice*gravity*thickness;
+	
+		if (element_debug & triaelem.id==element_debugid),
+			disp(sprintf('      gaussian %i\n',ig));
+			disp(sprintf('      thickness %g\n',thickness));
+			disp(sprintf('      slope(%g,%g)\n',slopevector(1),slopevector(2)));
+			disp(sprintf('      Jdet %g\n',Jdet));
+			disp(sprintf('      gaussweigth %g\n',gauss_weight));
+			disp(sprintf('      l1l2l3 (%g,%g,%g)\n',l1l2l3(1),l1l2l3(2),l1l2l3(3)));
+			if(triaelem.friction_type==1), disp(sprintf('      plastic_stress(%g)\n',plastic_stress));end;
+		end
+
+		%Build pe_gaussian vector:
+		pe_gaussian=zeros(numgrids*NDOF2,1);
+
+		if(~triaelem.shelf) & (triaelem.friction_type==1),
+			for i=1:numgrids,
+				for j=1:NDOF2,
+					pe_gaussian((i-1)*NDOF2+j)=(-driving_stress_baseline*slopevector(j)-plastic_stress)*Jdet*gauss_weight*l1l2l3(i); 
+				end
+			end
+		else
+			for i=1:numgrids,
+				for j=1:NDOF2,
+					pe_gaussian((i-1)*NDOF2+j)=-driving_stress_baseline*slopevector(j)*Jdet*gauss_weight*l1l2l3(i);
+				end
+			end
+		end
+
+		%*Add pe_gaussian vector to pe: 
+		for i=1:pe.nrows,
+			pe.terms(i)=pe.terms(i)+pe_gaussian(i);
+		end
+
+	end %for ig=1:num_gauss,
+		
+	if (element_debug & triaelem.id==element_debugid),
+		disp(sprintf('      pe_g->terms\n',ig));
+		pe.terms
+		disp(sprintf('      pe_g->row_indices\n',ig));
+		pe.row_indices
+	end
+
+end %end function
+
+function pe=CreatePVectorPrognostic(triaelem,grids,materials,inputs);
+
+	%some variables
+	numgrids=3;
+	DOFPERGRID=1;
+	numdof=numgrids*DOFPERGRID; %number of dof for element triaelem.
+
+	%Create elementary stiffness matrix 
+	pe=elemvector(numdof);
+
+	%Get all element grid data:
+	xyz_list=getgriddata(triaelem,grids); 
+
+	%recover extra inputs from users, at current convergence iteration.
+	[accumulation_param accumulation_is_present]=recover_input(inputs,'accumulation');
+	[melting_param melting_is_present]=recover_input(inputs,'melting');
+	[thickness_param thickness_is_present]=recover_input(inputs,'thickness');
+	[dt dt_is_present]=recover_input(inputs,'dt');
+
+	%check on all parameters
+	if ( ~accumulation_is_present | ~melting_is_present | ~thickness_is_present | ~dt_is_present),
+		error('CreateKMatrixPrognostic error message: missing input parameters!');
+	end
+	
+	%initialize parameter lists (for our 3 grids)
+	thickness_list=zeros(numgrids,1);
+	accumulation_list=zeros(numgrids,1);
+	melting_list=zeros(numgrids,1);
+
+	%Build linear indices for elementary stiffness matrix.
+	for i=1:numgrids,
+		doflist=grids(triaelem.g(i)).grid.doflist; %list of dofs in the g-set
+		dof=doflist(1); %first degree of freedom
+		
+		pe.row_indices(i)=dof;
+	
+		%recover thickness_list on first dof of every grid.
+		thickness_list(i)=thickness_param(dof);
+		melting_list(i)=melting_param(dof);
+		accumulation_list(i)=accumulation_param(dof);
+	end
+
+	% Get gaussian points and weights.
+	[num_gauss2D,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,gauss_weights]=GaussTria(2);
+
+	for ig=1:num_gauss2D,
+	
+		%Pick up the gaussian point and its weight:
+		gauss_weight=gauss_weights(ig);
+		gauss_coord=[first_area_gauss_coord(ig) second_area_gauss_coord(ig) third_area_gauss_coord(ig)];
+		
+		%Get melting at gaussian point
+		melting=GetParameterValue(triaelem,melting_list,gauss_coord);
+	
+		%Get accumulation at gaussian point
+		accumulation=GetParameterValue(triaelem,accumulation_list,gauss_coord);
+
+		%Get thickness at gaussian point
+		thickness=GetParameterValue(triaelem,thickness_list,gauss_coord);
+
+		%Get the Jacobian determinant
+		Jdettria=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		%Get L: 
+		L=GetL(triaelem,gauss_coord,DOFPERGRID);
+
+		%Build gaussian vector 
+		pe_g_gaussian=Jdettria*gauss_weight*(thickness+dt*(accumulation-melting))*L';
+
+		%Add Ke_gg_drag_gaussian to Ke
+		pe.terms=pe.terms+pe_g_gaussian;
+	end
+
+end %end function
Index: /issm/trunk/src/m/classes/@triaelem/DeviatoricStress.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/DeviatoricStress.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/DeviatoricStress.m	(revision 1)
@@ -0,0 +1,78 @@
+function deviatoricstress=DeviatoricStress(triaelem,grids,materials,inputs)
+%DEVIATORICSTRESS - computes the deviatoric stress of a triaelem
+% 
+%   Usage:
+%      deviatoricstress=DeviatoricStress(triaelem,grids,materials,inputs)
+
+	%initialize
+	deviatoricstress=zeros(3,1);
+	volume=0;
+
+	%some variables
+	NDOF1=1;
+	numgrids=3;
+
+	%recover material parameters
+	matice=materials(triaelem.matid).material;
+	B=matice.B;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(triaelem,grids);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+
+	%we need velocities to compute thermal profiles (even if it is a zero 
+	%vector). 
+	if ~velocity_is_present,
+		error('DeviatoricStress error message: input velocity not present!');
+	end
+
+	%initialize vxvyvz_list
+	vxvy_list=zeros(numgrids,2);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(triaelem.g(i)).grid.doflist;
+		for j=1:2,
+			dof=doflist(j);
+			vxvy_list(i,j)=velocity_param(dof);
+		end
+		dof=doflist(1);
+		if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	end
+	
+	%Update material parameter that deals with ice rigidity: 
+	if flow_law_is_present,
+		B_param=GetParameterValue(triaelem,B_list,gauss_coord);
+		matice.B=B_param; clear B_param.
+	end
+	
+	% Get gaussian points and weights 
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights]=GaussTria(2);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=area_gauss_weights(igarea);
+		gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea)];
+	    
+		%Build Stress
+		deviatoricstress_g=zeros(3,1);
+		epsilon=GetStrainRate(triaelem,vxvy_list,xyz_list,gauss_coord);
+		viscosity=GetViscosity2d(matice,epsilon);
+		deviatoricstress_g=viscosity*epsilon;
+
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		deviatoricstress=deviatoricstress+deviatoricstress_g*Jdet*gauss_weight;
+
+		volume=volume+Jdet*gauss_weight;
+
+	end %for ig=1:num_area_gauss,
+
+%Divide deviatoricstress, integrated over volume, by volume.
+deviatoricstress=deviatoricstress/volume;
Index: /issm/trunk/src/m/classes/@triaelem/GetB.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetB.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetB.m	(revision 1)
@@ -0,0 +1,10 @@
+function B=GetB(triaelem,xyz_list,gauss_l1l2l3)
+%GETB - compute B matrix for the diagnostci solution
+%
+%   Usage:
+%      B=GetB(triaelem,xyz_list,gauss_l1l2l3)
+% 
+%   See also GETBPRIME, CREATEKMATRIX
+
+d=GetNodalFunctionsDerivativesBasic(triaelem,xyz_list,gauss_l1l2l3);
+B=[d(1,1) 0 d(1,2) 0 d(1,3) 0 ; 0 d(2,1) 0 d(2,2) 0 d(2,3) ;  d(2,1)/2 d(1,1)/2 d(2,2)/2 d(1,2)/2 d(2,3)/2 d(1,3)/2];
Index: /issm/trunk/src/m/classes/@triaelem/GetB_prog.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetB_prog.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetB_prog.m	(revision 1)
@@ -0,0 +1,24 @@
+function B=GetB_prog(triaelem,xyz_list,gauss_coord)
+%GETB_PROG - compute Bprime matrix for a prognostic 
+%
+%   Compute B  matrix. B=[B1 B2 B3 ] where Bi is of size numgrids*NDOF
+%   For grid i, Bi can be expressed in the basic coordinate system by:
+%   Bi_basic=[h]
+%            [h]
+%   where h is the interpolation function for grid i.
+%
+%   Usage:
+%      B=GetB_prog(triaelem,xyz_list,gauss_coord)
+%
+%   See also GETBPRIME_PROG, CREATEKMATRIX
+
+num_grids=3;
+
+%Get l1l2l3 in basic coordinate system: 
+l1l2l3=GetNodalFunctions(triaelem,gauss_coord);
+
+B=zeros(2,num_grids);
+for i=1:num_grids,
+	B(1,i)=l1l2l3(i);
+	B(2,i)=l1l2l3(i);
+end
Index: /issm/trunk/src/m/classes/@triaelem/GetBprime.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetBprime.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetBprime.m	(revision 1)
@@ -0,0 +1,30 @@
+function Bprime=GetBprime(triaelem,xyz_list,gauss_l1l2l3)
+%GETBPRIME - compute the Bprime matrix for a diagnostic solution
+%
+%   Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 
+%   For grid i, Bi' can be expressed in the basic coordinate system by:
+%   Bi_basic'=[ 2*dh/dx    dh/dy ]
+%             [   dh/dx   2*dh/dy]
+%             [   dh/dy   dh/dx  ]
+%   where h is the interpolation function for grid i.
+%
+%   Usage:
+%      Bprime=GetBprime(triaelem,xyz_list,gauss_l1l2l3)
+% 
+%   See also GETB, CREATEKMATRIX
+
+	num_grids=3;	
+	NDOF2=2;
+
+	dh1dh2dh3_basic=GetNodalFunctionsDerivativesBasic(triaelem,xyz_list,gauss_l1l2l3);
+
+	%Build Bprime:
+	Bprime=zeros(3,NDOF2*num_grids);
+	for i=1:num_grids,
+		Bprime(1,NDOF2*(i-1)+1)=2*dh1dh2dh3_basic(1,i);
+		Bprime(1,NDOF2*(i-1)+2)=  dh1dh2dh3_basic(2,i);
+		Bprime(2,NDOF2*(i-1)+1)=  dh1dh2dh3_basic(1,i);
+		Bprime(2,NDOF2*(i-1)+2)=2*dh1dh2dh3_basic(2,i);
+		Bprime(3,NDOF2*(i-1)+1)=dh1dh2dh3_basic(2,i);
+		Bprime(3,NDOF2*(i-1)+2)=dh1dh2dh3_basic(1,i);
+	end
Index: /issm/trunk/src/m/classes/@triaelem/GetBprime_prog.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetBprime_prog.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetBprime_prog.m	(revision 1)
@@ -0,0 +1,23 @@
+function B=GetBprime_prog(triaelem,xyz_list,gauss_coord)
+%GETBPRIME_PROG - compute the B matrix for a prognostic
+%
+%   Compute B  matrix. B=[B1 B2 B3 ] where Bi is of size numgrids*NDOF
+%   For grid i, Bi can be expressed in the basic coordinate system by:
+%   Bi_basic=[dh/dx]
+%            [dh/dy]
+%   where h is the interpolation function for grid i.
+%
+%   Usage:
+%      B=GetBprime_prog(triaelem,xyz_list,gauss_coord)
+%
+%   See also GETB_PROG, CREATEKMATRIX 
+
+	num_grids=3;	
+
+	dh1dh6_basic=GetNodalFunctionsDerivativesBasic(triaelem,xyz_list,gauss_coord);
+	%Build B:
+	B=zeros(2,num_grids);
+	for i=1:num_grids,
+		B(1,i)=dh1dh6_basic(1,i);
+		B(2,i)=dh1dh6_basic(2,i);
+	end
Index: /issm/trunk/src/m/classes/@triaelem/GetJacobian.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetJacobian.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetJacobian.m	(revision 1)
@@ -0,0 +1,31 @@
+function J=GetJacobian(triaelem,xyz_list,gauss_l1l2l3)
+%GETJACOBIAN - computes the jacobian for a triaelem
+%
+%   Usage:
+%      J=GetJacobian(triaelem,xyz_list,gauss_coord)
+%
+%   See also GETJACOBIANDETERMINANT, GETJACOBIANINVERT
+
+%The Jacobian is constant over the element, discard the gaussian points. 
+
+%Non optimized version 
+%J=zeros(2,2);
+%	
+%x1=xyz_list(1,1);
+%y1=xyz_list(1,2);
+%x2=xyz_list(2,1);
+%y2=xyz_list(2,2);
+%x3=xyz_list(3,1);
+%y3=xyz_list(3,2);
+%
+%J(1,1)=1.0/2.0*(x2-x1);
+%J(1,2)=sqrt(3.0)/6.0*(2*x3-x1-x2);
+%J(2,1)=1.0/2.0*(y2-y1);
+%J(2,2)=sqrt(3.0)/6.0*(2*y3-y1-y2);
+
+
+%Same code, a little optimized
+J=[	  1.0/2.0*(xyz_list(2,1)-xyz_list(1,1))	sqrt(3.0)/6.0*(2*xyz_list(3,1)-xyz_list(1,1)-xyz_list(2,1))
+	  1.0/2.0*(xyz_list(2,2)-xyz_list(1,2))	sqrt(3.0)/6.0*(2*xyz_list(3,2)-xyz_list(1,2)-xyz_list(2,2))];
+
+
Index: /issm/trunk/src/m/classes/@triaelem/GetJacobianDeterminant.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetJacobianDeterminant.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetJacobianDeterminant.m	(revision 1)
@@ -0,0 +1,23 @@
+function Jdet=GetJacobianDeterminant(triaelem,xyz_list,gauss_l1l2l3),
+%GETJACOBIANDETERMINANT - computes the determinant of the jacobian for a triaelem
+%
+%   Usage:
+%      Jdet=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord)
+%
+%   See also GETJACOBIAN, GETJACOBIANINVERT
+
+x1=xyz_list(1,1);
+y1=xyz_list(1,2);
+z1=xyz_list(1,3);
+x2=xyz_list(2,1);
+y2=xyz_list(2,2);
+z2=xyz_list(2,3);
+x3=xyz_list(3,1);
+y3=xyz_list(3,2);
+z3=xyz_list(3,3);
+
+Jdet=sqrt(3)/6.0*sqrt(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1))^2+((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1))^2+((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1))^2);
+
+if(Jdet<0),
+	error('negative jacobian determinant!');
+end
Index: /issm/trunk/src/m/classes/@triaelem/GetJacobianInvert.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetJacobianInvert.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetJacobianInvert.m	(revision 1)
@@ -0,0 +1,11 @@
+function Jinv=GetJacobianInvert(triaelem,xyz_list,gauss_l1l2l3)
+%GETJACOBIANINVERT - computes the invert of the jacobian for a triaelem
+%
+%   Usage:
+%      Jinv=GetJacobianInvert(triaelem,z_list,gauss_coord)
+%
+%   See also GETJACOBIAN, GETJACOBIANDETERMINANT
+
+%Call Jacobian routine to get the jacobian:*/
+J=GetJacobian(triaelem,xyz_list,gauss_l1l2l3);
+Jinv=J^(-1);
Index: /issm/trunk/src/m/classes/@triaelem/GetL.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetL.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetL.m	(revision 1)
@@ -0,0 +1,70 @@
+function L=GetL(triaelem,gauss_l1l2l3,numdof)
+%GETL - compute L matrix for a diagnostic 
+%
+%Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
+%For grid i, Li can be expressed in the basic coordinate system by:
+%
+%   numdof=1: 
+%   Li_basic=h;
+%
+%   numdof=2:
+%   Li_basic=[ h    0  ]
+%            [   0   h ]
+%   numdof=4:
+%   Li_basic=[ h    0     0    0 ]
+%            [ 0    h     0    0 ]
+%            [ 0    0     0    0 ]
+%            [ 0    0     0    0 ]
+%   where h is the interpolation function for grid i.
+%
+%   Usage:
+%      L=GetL(triaelem,gauss_l1l2l3,numdof)
+%
+%   See also CREATEKMATRIX, GETLSTOKES, GETLPRIMESTOKES
+
+num_grids=3;
+
+%Get l1l2l3 in basic coordinate system: 
+l1l2l3=GetNodalFunctions(triaelem,gauss_l1l2l3);
+
+%Build L:
+if numdof==1,
+	L=zeros(1,num_grids);
+	for i=1:num_grids,
+		L(i)=l1l2l3(i);
+	end
+elseif numdof==2,
+	L=zeros(numdof,numdof*num_grids);
+
+	for i=1:num_grids,
+		L(1,numdof*(i-1)+1)=l1l2l3(i); 
+		L(1,numdof*(i-1)+2)=0;
+
+		L(2,numdof*(i-1)+1)=0;
+		L(2,numdof*(i-1)+2)=l1l2l3(i);
+	end
+elseif numdof==4,
+	L=zeros(4,numdof*num_grids);
+
+	for i=1:num_grids,
+		L(1,numdof*(i-1)+1)=l1l2l3(i); 
+		L(1,numdof*(i-1)+2)=0;
+		L(1,numdof*(i-1)+3)=0;
+		L(1,numdof*(i-1)+4)=0;
+
+		L(2,numdof*(i-1)+1)=0;
+		L(2,numdof*(i-1)+2)=l1l2l3(i);
+		L(2,numdof*(i-1)+3)=0;
+		L(2,numdof*(i-1)+4)=0;
+
+		L(3,numdof*(i-1)+1)=0;
+		L(3,numdof*(i-1)+2)=0;
+		L(3,numdof*(i-1)+3)=0;
+		L(3,numdof*(i-1)+4)=0;
+
+		L(4,numdof*(i-1)+1)=0;
+		L(4,numdof*(i-1)+2)=0;
+		L(4,numdof*(i-1)+3)=0;
+		L(4,numdof*(i-1)+4)=0;
+	end
+end
Index: /issm/trunk/src/m/classes/@triaelem/GetLStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetLStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetLStokes.m	(revision 1)
@@ -0,0 +1,52 @@
+function L=GetLStokes(triaelem,gauss_l1l2l3)
+%GETLSTOKES - compute L matrix for stokes diagnostic
+%
+%   Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof. 
+%   For grid i, Li can be expressed in the basic coordinate system by:
+%   Li_basic=[ h    0    0   0]
+%	          [ 0    h    0   0]
+%            [ 0    0    h   0]
+%            [ 0    0    h   0]
+%            [ h    0    0   0]
+%            [ 0    h    0   0]
+%            [ h    0    0   0]
+%            [ 0    h    0   0]
+%            [ 0    0    h   0]
+%            [ 0    0    h   0]
+%            [ 0    0    h   0]
+%            [ h    0    0   0]
+%            [ 0    h    0   0]
+%            [ 0    0    h   0]
+%   where h is the interpolation function for grid i.
+% 
+%   Usage:
+%
+%   See also GETL, GETLPRIMESTOKES, CREATEKMATRIX
+
+numdof=4;
+num_grids=3;
+
+%Get l1l2l3 in basic coordinate system: 
+l1l2l3=GetNodalFunctions(triaelem,gauss_l1l2l3);
+
+%Build L:
+L=zeros(12,numdof*num_grids);
+
+for i=1:num_grids,
+	L(1,numdof*(i-1)+1)=l1l2l3(i); 
+	L(2,numdof*(i-1)+2)=l1l2l3(i);
+	L(3,numdof*(i-1)+3)=l1l2l3(i); 
+	L(4,numdof*(i-1)+3)=l1l2l3(i); 
+	L(5,numdof*(i-1)+1)=l1l2l3(i); 
+	L(6,numdof*(i-1)+2)=l1l2l3(i); 
+	L(7,numdof*(i-1)+1)=l1l2l3(i); 
+	L(8,numdof*(i-1)+2)=l1l2l3(i); 
+	L(9,numdof*(i-1)+3)=l1l2l3(i); 
+	L(10,numdof*(i-1)+3)=l1l2l3(i); 
+	L(11,numdof*(i-1)+3)=l1l2l3(i); 
+	L(12,numdof*(i-1)+1)=l1l2l3(i); 
+	L(13,numdof*(i-1)+2)=l1l2l3(i); 
+	L(14,numdof*(i-1)+3)=l1l2l3(i); 
+	
+%other terms are 0
+end
Index: /issm/trunk/src/m/classes/@triaelem/GetLprimeStokes.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetLprimeStokes.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetLprimeStokes.m	(revision 1)
@@ -0,0 +1,56 @@
+function Lprime=GetLprimeStokes(triaelem,xyz_list,gauss_coord_tria,gauss_coord_penta)
+%GETLPRIMESTOKES - compute Lprime matrix for stokes diagnostic
+%
+%   Compute Lprime  matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 
+%   For grid i, Lpi can be expressed in the basic coordinate system by:
+%   Lpi_basic=[ h    0    0   0]
+%             [ 0    h    0   0]
+%             [ h    0    0   0]
+%             [ 0    h    0   0]
+%             [ 0    0    h   0]
+%             [ 0    0    h   0]
+%             [ 0    0  dh/dz 0]
+%             [ 0    0  dh/dz 0]
+%             [ 0    0  dh/dz 0]
+%             [dh/dz 0  dh/dx 0]
+%             [ 0 dh/dz dh/dy 0]
+%             [ 0    0    0   h]
+%             [ 0    0    0   h]
+%             [ 0    0    0   h]
+%   where h is the interpolation function for grid i.
+%
+%   Usage:
+%      Lprime=GetLprimeStokes(triaelem,xyz_list,gauss_coord_tria,gauss_coord_penta)
+%
+%   See also GETLSTOKES, GETL, CREATEKMATRIX
+
+numdof=4;
+num_grids=3;
+
+%Get l1l2l3 in basic coordinate system: 
+l1l2l3=GetNodalFunctions(triaelem,gauss_coord_tria);
+dh1dh6=GetNodalFunctionsDerivativesBasic(pentaelem,xyz_list,gauss_coord_penta);
+
+%Build Lprime:
+Lprime=zeros(12,numdof*num_grids);
+
+for i=1:num_grids,
+	Lprime(1,numdof*(i-1)+1)=l1l2l3(i); 
+	Lprime(2,numdof*(i-1)+2)=l1l2l3(i);
+	Lprime(3,numdof*(i-1)+1)=l1l2l3(i); 
+	Lprime(4,numdof*(i-1)+2)=l1l2l3(i); 
+	Lprime(5,numdof*(i-1)+3)=l1l2l3(i); 
+	Lprime(6,numdof*(i-1)+3)=l1l2l3(i); 
+	Lprime(7,numdof*(i-1)+3)=dh1dh6(3,i); 
+	Lprime(8,numdof*(i-1)+3)=dh1dh6(3,i); 
+	Lprime(9,numdof*(i-1)+3)=dh1dh6(3,i); 
+	Lprime(10,numdof*(i-1)+3)=dh1dh6(1,i); 
+	Lprime(10,numdof*(i-1)+1)=dh1dh6(3,i); 
+	Lprime(11,numdof*(i-1)+3)=dh1dh6(2,i); 
+	Lprime(11,numdof*(i-1)+2)=dh1dh6(3,i); 
+	Lprime(12,numdof*(i-1)+4)=l1l2l3(i); 
+	Lprime(13,numdof*(i-1)+4)=l1l2l3(i); 
+	Lprime(14,numdof*(i-1)+4)=l1l2l3(i); 
+	
+%other terms are 0
+end
Index: /issm/trunk/src/m/classes/@triaelem/GetNodalFunctions.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetNodalFunctions.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetNodalFunctions.m	(revision 1)
@@ -0,0 +1,9 @@
+function l1l2l3=GetNodalFunctions(triaelem,gauss_l1l2l3)
+%GETNODALFUNCTIONS - return the values of nodal functions at gaussian point on the reference element
+%
+%   Usage:
+%      l1l2l3=GetNodalFunctions(triaelem,gauss_l1l2l3)
+%
+%   See also GETNODALFUNCTIONSDERIVATIVESPARAMS, GETNODALFUNCTIONSDERIVATIVESBASIC
+
+l1l2l3=gauss_l1l2l3;
Index: /issm/trunk/src/m/classes/@triaelem/GetNodalFunctionsDerivativesBasic.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetNodalFunctionsDerivativesBasic.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetNodalFunctionsDerivativesBasic.m	(revision 1)
@@ -0,0 +1,12 @@
+function dh1dh2dh3_basic=GetNodalFunctionsDerivativesBasic(triaelem,xyz_list,gauss_l1l2l3)
+%GETNODALFUNCTIONSDERIVATIVESBASIC - return the values of the nodal functions derivatives on the current element
+%
+%   Usage:
+%      dh1dh2dh3_basic=GetNodalFunctionsDerivativesBasic(triaelem,xyz_list,gauss_l1l2l3)
+%
+%   See also GETNODALFUNCTIONS, GETNODALFUNCTIONSDERIVATIVESPARAMS
+
+dh1dh2dh3_param=GetNodalFunctionsDerivativesParams(triaelem,gauss_l1l2l3); 
+Jinv=GetJacobianInvert(triaelem,xyz_list, gauss_l1l2l3);
+dh1dh2dh3_basic(1,1:3)=Jinv(1,1)*dh1dh2dh3_param(1,1:3)+Jinv(2,1)*dh1dh2dh3_param(2,1:3);
+dh1dh2dh3_basic(2,1:3)=Jinv(1,2)*dh1dh2dh3_param(1,1:3)+Jinv(2,2)*dh1dh2dh3_param(2,1:3);
Index: /issm/trunk/src/m/classes/@triaelem/GetNodalFunctionsDerivativesParams.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetNodalFunctionsDerivativesParams.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetNodalFunctionsDerivativesParams.m	(revision 1)
@@ -0,0 +1,10 @@
+function dl1dl2dl3=GetNodalFunctionsDerivativesParams(triaelem,gauss_l1l2l3)
+%GETNODALFUNCTIONSDERIVATIVESPARAMS - return the values of nodal functions derivatives on the reference element
+%	
+%   Usage:
+%      dl1dl2dl3=GetNodalFunctionsDerivativesParams(triaelem,gauss_l1l2l3)
+%
+%   See also GETNODALFUNCTIONS, GETNODALFUNCTIONSDERIVATIVESBASIC
+
+dl1dl2dl3=[ -1.0/2.0 1.0/2.0  0 ; -1.0/(2.0*sqrt(3.0)) -1.0/(2.0*sqrt(3.0)) 1.0/sqrt(3.0)];
+
Index: /issm/trunk/src/m/classes/@triaelem/GetParameterDerivativeValue.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetParameterDerivativeValue.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetParameterDerivativeValue.m	(revision 1)
@@ -0,0 +1,20 @@
+function derivatives=GetParameterDerivativeValue(triaelem,grid_values,xyz_list,gauss_l1l2l3),
+%GETPARAMETERDERIVATIVEVALUE - return the derivative value of a parameter at a specified point
+%
+%   From grid values of parameter, return parameter derivative value at gaussian point specified by gauss_l1l2l3:
+%   For example, if p is the parameter,
+%   dp/dx=p1*dh1/dx+p2*dh2/dx+p3*dh3/dx
+%   dp/dx=p1*dh1/dx+p2*dh2/dx+p3*dh3/dx
+%
+%   Usage:
+%      derivatives=GetParameterDerivativeValue(triaelem,grid_values,xyz_list,gauss_l1l2l3)
+% 
+%   See also GETPARAMETERVALUE
+
+derivatives=zeros(2,1);
+
+%Get dh1dh2dh3 in basic coordinate system:
+dh1dh2dh3_basic=GetNodalFunctionsDerivativesBasic(triaelem,xyz_list, gauss_l1l2l3);
+
+derivatives(1)=sum(grid_values'.*dh1dh2dh3_basic(1,:));
+derivatives(2)=sum(grid_values'.*dh1dh2dh3_basic(2,:));
Index: /issm/trunk/src/m/classes/@triaelem/GetParameterValue.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetParameterValue.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetParameterValue.m	(revision 1)
@@ -0,0 +1,11 @@
+function value=GetParameterValue(triaelem,grid_values,gauss_l1l2l3),
+%GETPARAMETERVALUE - return a parameter value on a specified point
+%
+%   Usage:
+%      value=GetParameterValue(triaelem,grid_values,gauss_l1l2l3)
+%
+%   See also GETPARAMETERDERIVATIVEVALUE
+
+l1l2l3=GetNodalFunctions(triaelem,gauss_l1l2l3);
+
+value=sum(l1l2l3.*grid_values');
Index: /issm/trunk/src/m/classes/@triaelem/GetStrainRate.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/GetStrainRate.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/GetStrainRate.m	(revision 1)
@@ -0,0 +1,19 @@
+function epsilon=GetStrainRate(triaelem,vxvy_list,xyz_list,gauss_l1l2l3)
+%GETSTRAINRATE - return the strain rate of a pentaelem
+%
+%   This function return the strain rate needed for Glen's flow law for the element pentaelem
+%   The strain rate epsilon is calculated thanks to the formula epsilon=B*U
+%   Where epsilon=[exx eyy exy] and U=[u1;v1;..;u3;v3]
+%   The matrix B is the same as in K=tBDBprime
+%
+%   Usage:
+%      epsilon=GetStrainRate(pentaelem,vxvy_list,xyz_list,gauss_coord)
+%
+%   See also GETB
+
+B=GetB(triaelem,xyz_list,gauss_l1l2l3);
+
+vxvy_list_transp=vxvy_list';
+U=[vxvy_list_transp(1:2,1);vxvy_list_transp(1:2,2);vxvy_list_transp(1:2,3)];
+
+epsilon=B*U;
Index: /issm/trunk/src/m/classes/@triaelem/StrainRate.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/StrainRate.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/StrainRate.m	(revision 1)
@@ -0,0 +1,64 @@
+function strainrate=StrainRate(triaelem,grids,materials,inputs)
+%STRAINRATE - compute the strain rate on each element
+%
+%  Usage:
+%      strainrate=StrainRate(triaelem,grids,materials,inputs)
+%
+%   See also GETSTRAINRATE, GETVISCOSITY2D
+
+	%initialize
+	strainrate=zeros(3,1);
+	volume=0;
+
+	%some variables
+	NDOF1=1;
+	numgrids=3;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(triaelem,grids);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+
+	%we need velocities to compute thermal profiles (even if it is a zero 
+	%vector). 
+	if ~velocity_is_present,
+		error('StrainRate error message: input velocity not present!');
+	end
+
+	%initialize vxvyvz_list
+	vxvy_list=zeros(numgrids,2);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(triaelem.g(i)).grid.doflist;
+		for j=1:2,
+			dof=doflist(j);
+			vxvy_list(i,j)=velocity_param(dof);
+		end	
+		dof=doflist(1);
+	end
+	
+	% Get gaussian points and weights 
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights]=GaussTria(2);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		%Pick up the gaussian point and its weight:
+		gauss_weight=area_gauss_weights(igarea);
+		gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea)];
+	    
+		%Build Deformational heating
+		epsilon=GetStrainRate(triaelem,vxvy_list,xyz_list,gauss_coord);
+		viscosity=GetViscosity2d(matice,epsilon); 
+
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		strainrate=strainrate+epsilon*Jdet*gauss_weight;
+
+		volume=volume+Jdet*gauss_weight;
+	end %for ig=1:num_area_gauss,
+
+%Divide strainrate, integrated over volume, by volume.
+strainrate=strainrate/volume;
Index: /issm/trunk/src/m/classes/@triaelem/Stress.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/Stress.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/Stress.m	(revision 1)
@@ -0,0 +1,85 @@
+function stress=Stress(triaelem,grids,materials,inputs)
+%STRESS - compute the stress on each element
+%
+%   Usage:
+%      stress=Stress(triaelem,grids,materials,inputs)
+%
+%   See also GETSTRAINRATE, GETVISCOSITY2D
+
+	%initialize
+	stress=zeros(3,1);
+	volume=0;
+
+	%some variables
+	NDOF1=1;
+	numgrids=3;
+
+	%recover material parameters
+	matice=materials(triaelem.matid).material;
+	B=matice.B;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(triaelem,grids);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+
+	%we need velocities to compute thermal profiles (even if it is a zero 
+	%vector). 
+	if ~velocity_is_present,
+		error('Stress error message: input velocity not present!');
+	end
+
+	%initialize vxvyvz_list
+	vxvy_list=zeros(numgrids,2);
+	pressure=zeros(numgrids,1);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(triaelem.g(i)).grid.doflist;
+		for j=1:2,
+			dof=doflist(j);
+			vxvy_list(i,j)=velocity_param(dof);
+		end
+		pressure(i)=velocity_param(doflist(4));	
+		dof=doflist(1);
+		if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	end
+	
+	%Update material parameter that deals with ice rigidity: 
+	if flow_law_is_present,
+		B_param=GetParameterValue(triaelem,B_list,gauss_coord);
+		matice.B=B_param; clear B_param.
+	end
+	
+	% Get gaussian points and weights 
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights]=GaussTria(2);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+
+		%Pick up the gaussian point and its weight:
+		gauss_weight=area_gauss_weights(igarea);
+		gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea)];
+	    
+		%Build Stress
+		stress_g=zeros(3,1);
+		epsilon=GetStrainRate(triaelem,vxvy_list,xyz_list,gauss_coord);
+		viscosity=GetViscosity2d(matice,epsilon);
+		pressure_g=GetParameterValue(triaelem,pressure,gauss_coord);
+		deviatoricstress=viscosity*epsilon;
+		stress_g=deviatoricstress;
+		stress_g([1;2],1)=stress_g(1:2,1)-pressure_g;         %stress=deviatoricstress-pressure
+
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		stress=stress+stress_g*Jdet*gauss_weight;
+
+		volume=volume+Jdet*gauss_weight;
+
+	end %for ig=1:num_area_gauss,
+
+%Divide stress, integrated over volume, by volume.
+stress=stress/volume;
Index: /issm/trunk/src/m/classes/@triaelem/ViscousHeating.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/ViscousHeating.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/ViscousHeating.m	(revision 1)
@@ -0,0 +1,93 @@
+function viscousheating=ViscousHeating(triaelem,grids,materials,inputs)
+%VISCOUSHEATING - compute the viscous heating on each triaelem
+%
+%   Usage:
+%      viscousheating=ViscousHeating(triaelem,grids,materials,inputs)
+%
+%   See also GETSTRAINRATE, GETVISCOSITY3D
+
+
+	%initialize
+	viscousheating=0;
+	volume=0;
+
+	%some variables
+	NDOF1=1;
+	numgrids=3;
+
+	%recover material parameters
+	matice=materials(triaelem.matid).material;
+	B=matice.B;
+
+	%Get all element grid data:
+	xyz_list=getgriddata(triaelem,grids);
+
+	%recover extra inputs
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	[flow_law_param flow_law_is_present]=recover_input(inputs,'B');
+
+	%we need velocities to compute thermal profiles (even if it is a zero 
+	%vector). 
+	if ~velocity_is_present,
+		error('ViscousHeating error message: input velocity not present!');
+	end
+
+	%initialize vxvyvz_list
+	vxvy_list=zeros(numgrids,2);
+
+	%Build row indices for elementary vector.
+	for i=1:numgrids,
+		doflist=grids(triaelem.g(i)).grid.doflist;
+		for j=1:2,
+			dof=doflist(j);
+			vxvy_list(i,j)=velocity_param(dof);
+		end	
+		dof=doflist(1);
+		if(flow_law_is_present), B_list(i) = flow_law_param(dof);end;
+	end
+	
+	%Update material parameter that deals with ice rigidity: 
+	if flow_law_is_present,
+		B_param=GetParameterValue(triaelem,B_list,gauss_coord);
+		matice.B=B_param; clear B_param.
+	end
+
+	% Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 
+	%get tria gaussian points as well as segment gaussian points. For tria gaussian 
+	%points, order of integration is 2, because we need to integrate the product tB*D*B' 
+	%which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian 
+	%points, same deal, which yields 3 gaussian points.
+	[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights]=GaussTria(2);
+
+	%Start  looping on the number of gaussian points:
+	for igarea=1:num_area_gauss,
+		%Pick up the gaussian point and its weight:
+		gauss_weight=area_gauss_weights(igarea);
+		gauss_coord=[first_area_gauss_coord(igarea) second_area_gauss_coord(igarea) third_area_gauss_coord(igarea)];
+	    
+		%Build Deformational heating
+		epsilon=GetStrainRate(triaelem,vxvy_list,xyz_list,gauss_coord);
+		viscosity=GetViscosity2d(matice,epsilon); 
+
+		%Build the strain rate matrix
+		epsilon_matrix=[epsilon(1) epsilon(3)
+				epsilon(3) epsilon(2)];
+
+		epsilon_e=effective_value(epsilon_matrix);
+
+		phi=2*viscosity*epsilon_e^2;
+
+		%Get Jacobian determinant:
+		Jdet=GetJacobianDeterminant(triaelem,xyz_list,gauss_coord);
+
+		viscousheating=viscousheating+phi*Jdet*gauss_weight;
+
+		volume=volume+Jdet*gauss_weight;
+
+	end %for ig=1:num_area_gauss,
+
+%Divide viscousheating, integrated over volume, by volume.
+viscousheating=viscousheating/volume;
+
+
+end %end function
Index: /issm/trunk/src/m/classes/@triaelem/display.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/display.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/display.m	(revision 1)
@@ -0,0 +1,22 @@
+function display(triaelem)
+%DISPLAY - displays the fields of a tria element
+%
+%   echo function for 'triaelem' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   type: %s',triaelem.type));
+disp(sprintf('   id: %i',triaelem.id));
+disp(sprintf('   material id: %i',triaelem.matid));
+disp(sprintf('   grid ids: %i %i %i',triaelem.g(1),triaelem.g(2),triaelem.g(3)));
+disp(sprintf('   grids thickness: %g %g %g',triaelem.h(1),triaelem.h(2),triaelem.h(3)));
+disp(sprintf('   grids surface: %g %g %g',triaelem.s(1),triaelem.s(2),triaelem.s(3)));
+disp(sprintf('   grids bedrock: %g %g %g',triaelem.b(1),triaelem.b(2),triaelem.b(3)));
+disp(sprintf('   friction type: %i',triaelem.friction_type));
+disp(sprintf('   p: %i',triaelem.p));
+disp(sprintf('   q: %i',triaelem.q));
+disp(sprintf('   drag coeff: %g %g %g',triaelem.k(1),triaelem.k(2),triaelem.k(3)));
+disp(sprintf('   shelf: %i',triaelem.shelf));
+disp(sprintf('   meanvel: %g',triaelem.meanvel));
+disp(sprintf('   epsvel: %g',triaelem.epsvel));
+disp(sprintf('   artificial_diffusivity: %i',triaelem.artificial_diffusivity));
+disp(sprintf('   acceleration: %i',triaelem.acceleration));
Index: /issm/trunk/src/m/classes/@triaelem/getgriddata.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/getgriddata.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/getgriddata.m	(revision 1)
@@ -0,0 +1,18 @@
+function xyz=getgriddata(triaelem,grids)
+%GETGRIDDATA - create an array of space coordinates for the grids
+%
+%   Create array xyz of size num_grids x 3 (3 for x,y and z)
+%   of space coordinates for each grid. 
+%
+%   Usage:
+%      xyz=getgriddata(triaelem,grids)
+
+num_grids=3;
+
+xyz=zeros(num_grids,3);
+
+for i=1:num_grids,
+	xyz(i,1)=grids(triaelem.g(i)).grid.x;
+	xyz(i,2)=grids(triaelem.g(i)).grid.y;
+	xyz(i,3)=grids(triaelem.g(i)).grid.z;
+end
Index: /issm/trunk/src/m/classes/@triaelem/subsasgn.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/subsasgn.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/subsasgn.m	(revision 1)
@@ -0,0 +1,12 @@
+function triaelem = subsasgn(triaelem,index,val)
+%SUBSASGN - handles indexed assignments to objects
+%
+%   the first argument is the object, the second argument a structure array
+%   the third one is the value
+%
+%   Usage:
+%      triaelem = subsasgn(triaelem,index,val)
+%
+%   See also SUBSREF
+
+triaelem=builtin('subsasgn',triaelem,index,val);
Index: /issm/trunk/src/m/classes/@triaelem/subsref.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/subsref.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/subsref.m	(revision 1)
@@ -0,0 +1,10 @@
+function triaelem = subsref(triaelem,index)
+%SUBSREF - handles indexed references to objects
+%
+%   the first argument is the object and the second one a structure array
+%   Usage:
+%      triaelem = subsref(triaelem,index)
+% 
+%   See also SUBSASGN
+
+triaelem=builtin('subsref',triaelem,index);
Index: /issm/trunk/src/m/classes/@triaelem/triaelem.m
===================================================================
--- /issm/trunk/src/m/classes/@triaelem/triaelem.m	(revision 1)
+++ /issm/trunk/src/m/classes/@triaelem/triaelem.m	(revision 1)
@@ -0,0 +1,38 @@
+function triaelem = triaelem(varargin)
+%BEAMELEM - contructor for triaelem objects
+%
+%   Usage:
+%      triaelem = triaelem(varargin)
+
+switch nargin
+case 0
+	% if no input arguments, create a default object
+	triaelem.type='triaelem';
+	triaelem.id=NaN;
+	triaelem.matid=NaN;
+	triaelem.g=zeros(3,1);
+	triaelem.h=zeros(3,1);
+	triaelem.s=zeros(3,1);
+	triaelem.b=zeros(3,1);
+	triaelem.friction_type=2;
+	triaelem.k=zeros(3,1);
+	triaelem.p=1;
+	triaelem.q=1;
+	triaelem.shelf=NaN;
+	triaelem.meanvel=NaN;
+	triaelem.epsvel=NaN;
+	triaelem.artificial_diffusivity=0;
+	triaelem.acceleration=0;
+	
+	triaelem=class(triaelem,'triaelem');
+				
+case 1
+	%If single argument of class triaelem, we have a copy constructor. 
+	if (isa(varargin{1},'triaelem'))
+		triaelem = varargin{1};
+	else
+		error('triaelem constructor error message: copy constructor called on a non ''triaelem'' class object');
+	end 
+otherwise
+	error('triaelem constructor error message: 0 of 1 argument only in input.');
+end
Index: sm/trunk/src/m/classes/SMBarma.m
===================================================================
--- /issm/trunk/src/m/classes/SMBarma.m	(revision 28275)
+++ 	(revision )
@@ -1,276 +1,0 @@
-%SMBarma Class definition
-%
-%   Usage:
-%      SMBarma=SMBarma();
-
-classdef SMBarma
-	properties (SetAccess=public)
-		num_basins        = 0;
-		num_breaks        = 0;
-		num_params        = 0;
-		arma_timestep     = 0;
-		ar_order			 = 0;
-		arlag_coefs       = NaN;
-		ma_order			 = 0;
-		malag_coefs       = NaN;
-		polynomialparams  = NaN;
-		datebreaks        = NaN;
-		basin_id			 = NaN;
-		lapserates        = NaN;
-		elevationbins     = NaN;
-		refelevation      = NaN;
-		steps_per_step    = 1;
-		averaging			= 0;
-		requested_outputs = {};
-	end
-	methods
-		function self = SMBarma(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			%Nothing for now
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-			if (self.ar_order==0)
-				self.ar_order = 1; %dummy 1 value for autoregression
-				self.arlag_coefs      = zeros(self.num_basins,self.ar_order); %autoregression coefficients all set to 0 
-				disp('      smb.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0');
-			end
-			if (self.ma_order==0)
-				self.ma_order = 1; %dummy 1 value for moving-average
-				self.malag_coefs      = zeros(self.num_basins,self.ma_order); %moving-average coefficients all set to 0 
-				disp('      smb.ma_order (order of moving-average model) not specified: order of moving-average model set to 0');
-			end
-			if (self.arma_timestep==0)
-				self.arma_timestep = md.timestepping.time_step; %ARMA model has no prescribed time step
-				disp('      smb.arma_timestep (timestep of ARMA model) not specified: set to md.timestepping.time_step');
-			end
-			if isnan(self.arlag_coefs)
-				self.arlag_coefs = zeros(self.num_basins,self.ar_order); %autoregression model of order 0 
-				disp('      smb.arlag_coefs (AR lag coefficients) not specified: order of autoregressive model set to 0');
-			end
-			if isnan(self.malag_coefs)
-				self.malag_coefs = zeros(self.num_basins,self.ma_order); %autoregression model of order 0 
-				disp('      smb.malag_coefs (MA lag coefficients) not specified: order of moving-average model set to 0');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.ar_order    = 0.0; %autoregression model of order 0
-			self.ma_order    = 0.0; %moving-average model of order 0
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses),
-				nbas = md.smb.num_basins;
-				nprm = md.smb.num_params;
-				nbrk = md.smb.num_breaks;
-				md = checkfield(md,'fieldname','smb.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
-				md = checkfield(md,'fieldname','smb.num_params','numel',1,'NaN',1,'Inf',1,'>',0);
-				md = checkfield(md,'fieldname','smb.num_breaks','numel',1,'NaN',1,'Inf',1,'>=',0);
-				md = checkfield(md,'fieldname','smb.basin_id','Inf',1,'>=',0,'<=',nbas,'size',[md.mesh.numberofelements,1]);
-				if(nbas>1 && nbrk>=1 && nprm>1)
-					md = checkfield(md,'fieldname','smb.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1,nprm],'numel',nbas*(nbrk+1)*nprm); 
-				elseif(nbas==1)
-					md = checkfield(md,'fieldname','smb.polynomialparams','NaN',1,'Inf',1,'size',[nprm,nbrk+1],'numel',nbas*(nbrk+1)*nprm);
-				elseif(nbrk==0)
-					md = checkfield(md,'fieldname','smb.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nprm],'numel',nbas*(nbrk+1)*nprm);
-				elseif(nprm==1)
-					md = checkfield(md,'fieldname','smb.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1],'numel',nbas*(nbrk+1)*nprm);
-				end
-				md = checkfield(md,'fieldname','smb.ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-				md = checkfield(md,'fieldname','smb.ma_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-				md = checkfield(md,'fieldname','smb.arma_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %arma time step cannot be finer than ISSM timestep
-				md = checkfield(md,'fieldname','smb.arlag_coefs','NaN',1,'Inf',1,'size',[nbas,md.smb.ar_order]);
-				md = checkfield(md,'fieldname','smb.malag_coefs','NaN',1,'Inf',1,'size',[nbas,md.smb.ma_order]);
-				
-				if(nbrk>0)
-					md = checkfield(md,'fieldname','smb.datebreaks','NaN',1,'Inf',1,'size',[nbas,nbrk]);
-				elseif(numel(md.smb.datebreaks)==0 || all(isnan(md.smb.datebreaks)))
-					;
-				else
-					error('md.smb.num_breaks is 0 but md.smb.datebreaks is not empty');
-				end
-				if (any(isnan(md.smb.refelevation)==0) || numel(md.smb.refelevation)>1)
-					md = checkfield(md,'fieldname','smb.refelevation','NaN',1,'Inf',1,'>=',0,'size',[1,nbas],'numel',nbas);
-				end
-				nbas     = size(md.smb.lapserates,1);
-				nbins    = size(md.smb.lapserates,2);
-				ntmlapse = size(md.smb.lapserates,3);
-				if(ntmlapse>1 && ntmlapse~=12)
-					error('3rd dimension of md.smb.lapserates must be of size 1 or 12 (for monthly lapse rates)');
-				end
-				if (any(isnan(reshape(md.smb.lapserates,[1,nbas*nbins*ntmlapse]))==0) || numel(md.smb.lapserates)>1)
-					md = checkfield(md,'fieldname','smb.lapserates','NaN',1,'Inf',1,'size',[nbas,nbins,ntmlapse],'numel',nbas*nbins*ntmlapse);
-					md = checkfield(md,'fieldname','smb.elevationbins','NaN',1,'Inf',1,'size',[nbas,max(1,nbins-1),ntmlapse],'numel',nbas*max(1,nbins-1)*ntmlapse);
-					if(issorted(md.smb.elevationbins,2)==0)
-						error('md.smb.elevationbins should have rows in order of increasing elevation');
-					end
-				elseif (isnan(md.smb.elevationbins(1,1,1))==0 || numel(md.smb.elevationbins)>1)
-					%elevationbins specified but not lapserates: this will inevitably lead to inconsistencies
-					nbas     = size(md.smb.elevationbins,1);
-					nbins    = size(md.smb.elevationbins,2);
-					nbins    = nbins+1;
-					ntmlapse = size(md.smb.elevationbins,3);
-					md = checkfield(md,'fieldname','smb.lapserates','NaN',1,'Inf',1,'size',[nbas,max(1,nbins-1),ntmlapse],'numel',nbas*nbins*ntmlapse);
-					md = checkfield(md,'fieldname','smb.elevationbins','NaN',1,'Inf',1,'size',[nbas,max(1,nbins-1),ntmlapse],'numel',nbas*max(1,nbins-1)*ntmlapse);
-				end
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-			fielddisplay(self,'num_basins','number of different basins [unitless]');
-			fielddisplay(self,'basin_id','basin number assigned to each element [unitless]');
-			fielddisplay(self,'num_breaks','number of different breakpoints in the piecewise-polynomial (separating num_breaks+1 periods)');
-			fielddisplay(self,'num_params','number of different parameters in the piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)');
-			fielddisplay(self,'polynomialparams','coefficients for the polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders');
-			disp(sprintf('%51s  ex: polyparams=cat(3,intercepts,trendlinearcoefs,trendquadraticcoefs)',' '));
-			fielddisplay(self,'datebreaks','dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]');
-			fielddisplay(self,'ar_order','order of the autoregressive model [unitless]');
-			fielddisplay(self,'ma_order','order of the moving-average model [unitless]');
-			fielddisplay(self,'arma_timestep','time resolution of the ARMA model [yr]');
-			fielddisplay(self,'arlag_coefs','basin-specific vectors of AR lag coefficients [unitless]');
-			fielddisplay(self,'malag_coefs','basin-specific vectors of MA lag coefficients [unitless]');
-			fielddisplay(self,'lapserates','basin-specific SMB lapse rates applied in each elevation bin, 1 row per basin, 1 column per bin, dimension 3 can be of size 12 to prescribe monthly varying values [m ice eq yr^-1 m^-1] (default: no lapse rate)');
-			fielddisplay(self,'elevationbins','basin-specific separations between elevation bins, 1 row per basin, 1 column per limit between bins, dimension 3 can be of size 12 to prescribe monthly varying values [m] (default: no basin separation)');
-			fielddisplay(self,'refelevation','basin-specific reference elevations at which SMB is calculated, and from which SMB is downscaled using lapserates (default: basin mean elevation) [m]');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-			nbas = md.smb.num_basins;
-			nprm = md.smb.num_params;
-			nper = md.smb.num_breaks+1;
-
-			templapserates    = md.smb.lapserates;
-			tempelevationbins = md.smb.elevationbins;
-			temprefelevation  = md.smb.refelevation;
-			nbas     = size(md.smb.lapserates,1);
-			nbins    = size(md.smb.lapserates,2);
-			ntmlapse = size(md.smb.lapserates,3);
-			if(any(isnan(reshape(md.smb.lapserates,[1,nbas*nbins*ntmlapse]))))
-				templapserates = zeros(md.smb.num_basins,2,12);
-				disp('      smb.lapserates not specified: set to 0');
-			   tempelevationbins = zeros(md.smb.num_basins,1,12); %dummy elevation bins
-			elseif(ntmlapse==1)
-				templapserates    = repmat(templapserates,1,1,12); %same values each month
-				tempelevationbins = repmat(tempelevationbins,1,1,12); %same values each month
-			end
-			nbas     = size(templapserates,1);
-			nbins    = size(templapserates,2);
-			ntmlapse = size(templapserates,3);
-			if(any(isnan(md.smb.refelevation)))
-				temprefelevation = zeros(1,md.smb.num_basins);
-				areas = GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
-				for ii=1:md.smb.num_basins
-					indices = find(md.smb.basin_id==ii);
-					elemsh  = zeros(numel(indices),1);
-					for jj=1:numel(indices)
-						elemsh(jj) = mean(md.geometry.surface(md.mesh.elements(indices(jj),:)));
-					end
-					temprefelevation(ii) = sum(areas(indices).*elemsh)/sum(areas(indices));
-				end
-				if(any(reshape(templapserates,[1,nbas*nbins*12])~=0))
-					disp('      smb.refelevation not specified: Reference elevations set to mean surface elevation of basins');
-				end
-			end
-			temp2dlapserates    = zeros(nbas,nbins*12);
-			temp2delevationbins = zeros(nbas,max(1,nbins-1)*12);
-			for(ii=[1:12])
-				jj = 1+(ii-1)*nbins;
-				temp2dlapserates(:,jj:jj+nbins-1)    = templapserates(:,:,ii);
-				kk = 1+(ii-1)*(nbins-1);
-				temp2delevationbins(:,kk:kk+nbins-2) = tempelevationbins(:,:,ii);
-			end
-
-			% Scale the parameters %
-			polyparamsScaled   = md.smb.polynomialparams;
-			polyparams2dScaled = zeros(nbas,nper*nprm);
-			if(nprm>1)
-				% Case 3D %
-				if(nbas>1 && nper>1)
-					for(ii=[1:nprm])
-						polyparamsScaled(:,:,ii) = polyparamsScaled(:,:,ii)*((1/yts)^(ii));
-					end
-					% Fit in 2D array %
-					for(ii=[1:nprm])
-						jj = 1+(ii-1)*nper;
-						polyparams2dScaled(:,jj:jj+nper-1) = polyparamsScaled(:,:,ii);
-					end
-				% Case 2D and higher-order params at increasing row index %
-				elseif(nbas==1)
-					for(ii=[1:nprm])
-						polyparamsScaled(ii,:) = polyparamsScaled(ii,:)*((1/yts)^(ii));
-					end
-					% Fit in row array %
-					for(ii=[1:nprm])
-						jj = 1+(ii-1)*nper;
-						polyparams2dScaled(1,jj:jj+nper-1) = polyparamsScaled(ii,:);
-					end
-				% Case 2D and higher-order params at incrasing column index %
-				elseif(nper==1)
-					for(ii=[1:nprm])
-						polyparamsScaled(:,ii) = polyparamsScaled(:,ii)*((1/yts)^(ii));
-					end
-					% 2D array is already in correct format %
-					polyparams2dScaled = polyparamsScaled;
-				end
-			else
-				polyparamsScaled   = polyparamsScaled*(1/yts);
-				% 2D array is already in correct format %
-				polyparams2dScaled = polyparamsScaled;
-			end
-			if(nper==1) %a single period (no break date)
-				dbreaks = zeros(nbas,1); %dummy
-			else
-				dbreaks = md.smb.datebreaks;
-			end
-
-			WriteData(fid,prefix,'name','md.smb.model','data',13,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','num_basins','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','num_params','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','num_breaks','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ar_order','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ma_order','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','arma_timestep','format','Double','scale',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','basin_id','data',self.basin_id-1,'name','md.smb.basin_id','format','IntMat','mattype',2); %0-indexed
-			WriteData(fid,prefix,'data',polyparams2dScaled,'name','md.smb.polynomialparams','format','DoubleMat');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','arlag_coefs','format','DoubleMat','name','md.smb.arlag_coefs','yts',yts); 
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','malag_coefs','format','DoubleMat','name','md.smb.malag_coefs','yts',yts);
-			WriteData(fid,prefix,'data',dbreaks,'name','md.smb.datebreaks','format','DoubleMat','scale',yts);
-			WriteData(fid,prefix,'data',temp2dlapserates,'format','DoubleMat','name','md.smb.lapserates','scale',1./yts,'yts',yts);
-			WriteData(fid,prefix,'data',temp2delevationbins,'format','DoubleMat','name','md.smb.elevationbins');
-			WriteData(fid,prefix,'data',temprefelevation,'format','DoubleMat','name','md.smb.refelevation');
-			WriteData(fid,prefix,'data',nbins,'format','Integer','name','md.smb.num_bins');
-			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];											%remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)];	%add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBarma.py
===================================================================
--- /issm/trunk/src/m/classes/SMBarma.py	(revision 28275)
+++ 	(revision )
@@ -1,288 +1,0 @@
-import numpy as np
-
-from checkfield import *
-from fielddisplay import fielddisplay
-from GetAreas import *
-from project3d import *
-from WriteData import *
-
-class SMBarma(object):
-    """SMBarma class definition
-
-    Usage:
-        SMBarma = SMBarma()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.num_basins = 0
-        self.num_params = 0
-        self.num_breaks = 0
-        self.polynomialparams = np.nan
-        self.ar_order = 0
-        self.ma_order = 0
-        self.arlag_coefs = np.nan
-        self.ma_order = 0
-        self.malag_coefs = np.nan
-        self.polynomialparams = np.nan
-        self.datebreaks = np.nan
-        self.basin_id = np.nan
-        self.lapserates = np.nan
-        self.elevationbins = np.nan
-        self.refelevation = np.nan
-        self.datebreaks = np.nan
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = []
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of different basins [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin number assigned to each element [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'num_breaks', 'number of different breakpoints in the piecewise-polynomial (separating num_breaks+1 periods)'))
-        s += '{}\n'.format(fielddisplay(self, 'num_params', 'number of different parameters in the piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)'))
-        s += '{}\n'.format(fielddisplay(self, 'polynomialparams', 'coefficients for the polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders, ex: polyparams=cat(num_params,intercepts,trendlinearcoefs,trendquadraticcoefs)'))
-        s += '{}\n'.format(fielddisplay(self, 'datebreaks', 'dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'ar_order', 'order of the autoregressive model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'ma_order', 'order of the moving-average model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'arma_timestep', 'time resolution of the ARMA model [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'arlag_coefs', 'basin-specific vectors of AR lag coefficients [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'malag_coefs', 'basin-specific vectors of MA lag coefficients [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'lapserates', 'basin-specific SMB lapse rates applied in each elevation bin, 1 row per basin, 1 column per bin, dimension 3 can be of size 12 to prescribe monthly varying values [m ice eq yr^-1 m^-1] (default: no lapse rate)'))
-        s += '{}\n'.format(fielddisplay(self, 'elevationbins', 'basin-specific separations between elevation bins, 1 row per basin, 1 column per limit between bins, dimension 3 can be of size 12 to prescribe monthly varying values [m] (default: no basin separation)'))
-        s += '{}\n'.format(fielddisplay(self, 'refelevation', 'basin-specific reference elevations at which SMB is calculated, and from which SMB is downscaled using lapserates (default: basin mean elevation) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.ar_order = 0.0 # Autoregression model of order 0
-        self.ma_order = 0.0 # Moving-average model of order 0
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self # Nothing for now
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if self.ar_order == 0:
-            self.ar_order = 1 # Dummy 1 value for autoregression
-            self.arlag_coefs = np.zeros((self.num_basins, self.ar_order)) # Autoregression coefficients all set to 0
-            print('      smb.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0')
-        if self.ma_order == 0:
-            self.ma_order = 1 # Dummy 1 value for moving-average
-            self.malag_coefs = np.zeros((self.num_basins, self.ma_order)) # Moving-average coefficients all set to 0
-            print('      smb.ma_order (order of moving-average model) not specified: order of moving-average model set to 0')
-        if self.arma_timestep == 0:
-            self.arma_timestep = md.timestepping.time_step # ARMA model has no prescribed time step
-            print('      smb.arma_timestep (timestep of ARMA model) not specified: set to md.timestepping.time_step')
-        if np.all(np.isnan(self.arlag_coefs)):
-            self.arlag_coefs = np.zeros((self.num_basins, self.ar_order)) # Autoregression model of order 0
-            print('      smb.arlag_coefs (AR lag coefficients) not specified: order of autoregressive model set to 0')
-        if np.all(np.isnan(self.malag_coefs)):
-            self.arlag_coefs = np.zeros((self.num_basins, self.ma_order)) # Moving-average model of order 0
-            print('      smb.malag_coefs (MA lag coefficients) not specified: order of moving-average model set to 0')
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        """
-        TODO:
-        - Ensure that checks on shape of self.lapserates are same as those under MATLAB as matrix addressing is quite different here
-        """
-        if 'MasstransportAnalysis' in analyses:
-            nbas = md.smb.num_basins
-            nprm = md.smb.num_params
-            nbrk = md.smb.num_breaks
-            md = checkfield(md, 'fieldname', 'smb.num_basins', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
-            md = checkfield(md, 'fieldname', 'smb.num_params', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
-            md = checkfield(md, 'fieldname', 'smb.num_breaks', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-            md = checkfield(md, 'fieldname', 'smb.basin_id', 'Inf', 1, '>=', 0, '<=', md.smb.num_basins, 'size', [md.mesh.numberofelements])
-            # if len(np.shape(self.polynomialparams)) == 1:
-            #     self.polynomialparams = np.array([[self.polynomialparams]])
-            if nbas > 1 and nbrk >= 1 and nprm > 1:
-                md = checkfield(md, 'fieldname', 'smb.polynomialparams', 'NaN', 1, 'Inf', 1, 'size', [nbas, nbrk + 1, nprm], 'numel', nbas * (nbrk + 1) * nprm)
-            elif nbas == 1:
-                md = checkfield(md, 'fieldname', 'smb.polynomialparams', 'NaN', 1, 'Inf', 1, 'size', [nprm, nbrk + 1], 'numel', nbas * (nbrk + 1) * nprm)
-            elif nbrk == 0:
-                md = checkfield(md, 'fieldname', 'smb.polynomialparams', 'NaN', 1, 'Inf', 1, 'size', [nbas, nprm], 'numel', nbas * (nbrk + 1) * nprm)
-            elif nprm == 1:
-                md = checkfield(md, 'fieldname', 'smb.polynomialparams', 'NaN', 1, 'Inf', 1, 'size', [nbas, nbrk], 'numel', nbas * (nbrk + 1) * nprm)
-            md = checkfield(md, 'fieldname', 'smb.ar_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-            md = checkfield(md, 'fieldname', 'smb.ma_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-            md = checkfield(md, 'fieldname', 'smb.arma_timestep', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', md.timestepping.time_step) # Autoregression time step cannot be finer than ISSM timestep
-            md = checkfield(md, 'fieldname', 'smb.arlag_coefs', 'NaN', 1, 'Inf', 1, 'size', [nbas, md.smb.ar_order])
-            md = checkfield(md, 'fieldname', 'smb.malag_coefs', 'NaN', 1, 'Inf', 1, 'size', [nbas, md.smb.ma_order])
-            if nbrk > 0:
-                md = checkfield(md, 'fieldname', 'smb.datebreaks', 'NaN', 1, 'Inf', 1, 'size', [nbas,nbrk])
-            elif np.size(md.smb.datebreaks) == 0 or np.all(np.isnan(md.smb.datebreaks)):
-                pass
-            else:
-                raise RuntimeError('md.smb.num_breaks is 0 but md.smb.datebreaks is not empty')
-
-            if np.any(np.isnan(self.refelevation) is False) or np.size(self.refelevation) > 1:
-                if len(np.shape(self.refelevation)) == 1:
-                    self.refelevation = np.array([self.refelevation])
-                md = checkfield(md, 'fieldname', 'smb.refelevation', 'NaN', 1, 'Inf', 1, '>=', 0, 'size', [1, nbas], 'numel', nbas)
-
-            if (np.any(np.isnan(self.lapserates) is False) or np.size(self.lapserates) > 1):
-                nbas = md.smb.num_basins
-                if len(np.shape(self.lapserates)) == 1:
-                    nbins = 1
-                    self.lapserates = np.reshape(self.lapserates,[nbas,nbins,1])
-                elif(len(np.shape(self.lapserates)) == 2):
-                    nbins = np.shape(self.lapserates)[1]
-                    self.lapserates = np.reshape(self.lapserates,[nbas,nbins,1])
-                elif(len(np.shape(self.lapserates)) == 3):
-                    nbins = np.shape(self.lapserates)[1]
-                ntmlapse = np.shape(self.lapserates)[2]
-                if len(np.shape(self.elevationbins)) < 3:
-                    self.elevationbins = np.reshape(self.elevationbins,[nbas,max(1,nbins-1),ntmlapse])
-                md = checkfield(md, 'fieldname', 'smb.lapserates', 'NaN', 1, 'Inf', 1, 'size', [nbas,nbins,ntmlapse], 'numel', md.smb.num_basins*nbins*ntmlapse)
-                md = checkfield(md, 'fieldname', 'smb.elevationbins', 'NaN', 1, 'Inf', 1, 'size', [nbas,max(1,nbins-1),ntmlapse], 'numel', nbas*max(1,nbins-1)*ntmlapse)
-                for rr in range(nbas):
-                    if(np.all(self.elevationbins[rr,0:-1]<=self.elevationbins[rr,1:])==False):
-                        raise TypeError('md.smb.elevationbins should have rows in order of increasing elevation')
-            elif (np.any(np.isnan(self.elevationbins) is False) or np.size(self.elevationbins) > 1):
-                # Elevationbins specified but not lapserates: this will inevitably lead to inconsistencies
-                nbas = md.smb.num_basins
-                if len(np.shape(self.elevationbins)) == 1:
-                    nbins = 1
-                    self.elevationbins = np.reshape(self.elevationbins,[nbas,nbins,1])
-                elif(len(np.shape(self.lapserates)) == 2):
-                    nbins = np.shape(self.elevationbins)[1]
-                    self.elevationbins = np.reshape(self.elevationbins,[nbas,nbins,1])
-                elif(len(np.shape(self.lapserates)) == 3):
-                    nbins = np.shape(self.lapserates)[1]
-                nbins = nbins - 1
-                ntmlapse = np.shape(self.lapserates)[2]
-                md = checkfield(md, 'fieldname', 'smb.lapserates', 'NaN', 1, 'Inf', 1, 'size', [nbas, nbins * ntmlapse], 'numel', nbas * nbins * ntmlapse)
-                md = checkfield(md, 'fieldname', 'smb.elevationbins', 'NaN', 1, 'Inf', 1, 'size', [nbas, max(1, nbins - 1) * ntmlapse], 'numel', nbas * max(1, nbins - 1) * ntmlapse)
-
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        nbas = md.smb.num_basins
-        nprm = md.smb.num_params
-        nper = md.smb.num_breaks + 1
-        if(np.any(np.isnan(md.smb.lapserates))):
-            templapserates = np.zeros((nbas, 2, 12))
-            print('      smb.lapserates not specified: set to 0')
-            tempelevationbins = np.zeros((nbas, 1, 12)) # Dummy elevation bins
-            nbins    = 2
-            ntmlapse = 12
-        else:
-            if len(np.shape(md.smb.lapserates)) == 1:
-                nbins    = 1
-                ntmlapse = 1
-            elif len(np.shape(md.smb.lapserates)) == 2:
-                nbins    = np.shape(md.smb.lapserates)[1]
-                ntmlapse = 1
-            elif len(np.shape(md.smb.lapserates)) == 3:
-                nbins    = np.shape(md.smb.lapserates)[1]
-                ntmlapse = np.shape(md.smb.lapserates)[2]
-            templapserates    = np.reshape(md.smb.lapserates,[nbas, nbins, ntmlapse])
-            tempelevationbins = np.reshape(md.smb.elevationbins, [nbas, max(1, nbins - 1), ntmlapse])
-        temprefelevation  = np.copy(md.smb.refelevation)
-        # Scale the parameters
-        polyparamsScaled   = np.copy(md.smb.polynomialparams)
-        polyparams2dScaled = np.zeros((nbas, nper * nprm))
-        if nprm > 1:
-            # Case 3D
-            if nbas > 1 and nper > 1:
-                for ii in range(nprm):
-                    polyparamsScaled[:, :, ii] = polyparamsScaled[:, :, ii] * (1 / yts) ** (ii + 1)
-                # Fit in 2D array
-                for ii in range(nprm):
-                    polyparams2dScaled[:, ii * nper:(ii + 1) * nper] = 1 * polyparamsScaled[:, :, ii]
-            # Case 2D and higher-order params at increasing row index
-            elif nbas == 1:
-                for ii in range(nprm):
-                    polyparamsScaled[ii, :] = polyparamsScaled[ii, :] * (1 / yts) ** (ii + 1)
-                # Fit in row array
-                for ii in range(nprm):
-                    polyparams2dScaled[0, ii * nper:(ii + 1) * nper] = 1 * polyparamsScaled[ii, :]
-            # Case 2D and higher-order params at increasing column index
-            elif nper == 1:
-                for ii in range(nprm):
-                    polyparamsScaled[:, ii] = polyparamsScaled[:, ii] * (1 / yts) ** (ii + 1)
-                # 2D array is already in correct format
-                polyparams2dScaled = np.copy(polyparamsScaled)
-        else:
-            polyparamsScaled   = polyparamsScaled * (1 / yts)
-            # 2D array is already in correct format
-            polyparams2dScaled = np.copy(polyparamsScaled)
-
-        if nper == 1:
-            dbreaks = np.zeros((nbas, 1))
-        else:
-            dbreaks = np.copy(md.smb.datebreaks)
-
-        if ntmlapse == 1:
-            templapserates    = np.repeat(templapserates, 12, axis = 2)
-            tempelevationbins = np.repeat(tempelevationbins, 12, axis = 2)
-        if np.any(np.isnan(md.smb.refelevation)):
-            temprefelevation = np.zeros((nbas)).reshape(1, nbas)
-            areas = GetAreas(md.mesh.elements, md.mesh.x, md.mesh.y)
-            for ii, bid in enumerate(np.unique(md.smb.basin_id)):
-                indices = np.where(md.smb.basin_id == bid)[0]
-                elemsh = np.zeros((len(indices)))
-                for jj in range(len(indices)):
-                    elemsh[jj] = np.mean(md.geometry.surface[md.mesh.elements[indices[jj], :] - 1])
-                temprefelevation[0, ii] = np.sum(areas[indices] * elemsh) / np.sum(areas[indices])
-            if(np.any(templapserates != 0)):
-                print('      smb.refelevation not specified: Reference elevations set to mean surface elevation of basins')
-        nbins = np.shape(templapserates)[1]
-        temp2dlapserates    = np.zeros((nbas, nbins * 12))
-        temp2delevationbins = np.zeros((nbas, max(12, (nbins - 1) * 12)))
-        for ii in range(12):
-            temp2dlapserates[:, ii * nbins:(ii + 1) * nbins] = templapserates[:, :, ii]
-            temp2delevationbins[:, ii * (nbins - 1):(ii + 1) * (nbins - 1)] = tempelevationbins[:, :, ii]
-
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 13, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'num_basins', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'num_breaks', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'num_params', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ar_order', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ma_order', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'arma_timestep', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'basin_id', 'data', self.basin_id - 1, 'name', 'md.smb.basin_id', 'format', 'IntMat', 'mattype', 2)  # 0-indexed
-        WriteData(fid, prefix, 'data', polyparams2dScaled, 'name', 'md.smb.polynomialparams', 'format', 'DoubleMat')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'arlag_coefs', 'format', 'DoubleMat', 'name', 'md.smb.arlag_coefs', 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'malag_coefs', 'format', 'DoubleMat', 'name', 'md.smb.malag_coefs', 'yts', yts)
-        WriteData(fid, prefix, 'data', dbreaks, 'name', 'md.smb.datebreaks', 'format', 'DoubleMat','scale',yts)
-        WriteData(fid, prefix, 'data', temp2dlapserates, 'name', 'md.smb.lapserates', 'format', 'DoubleMat', 'scale', 1 / yts, 'yts', yts)
-        WriteData(fid, prefix, 'data', temp2delevationbins, 'name', 'md.smb.elevationbins', 'format', 'DoubleMat')
-        WriteData(fid, prefix, 'data', temprefelevation, 'name', 'md.smb.refelevation', 'format', 'DoubleMat')
-        WriteData(fid, prefix, 'data', nbins, 'name', 'md.smb.num_bins', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-
-    # }}}
Index: sm/trunk/src/m/classes/SMBcomponents.m
===================================================================
--- /issm/trunk/src/m/classes/SMBcomponents.m	(revision 28275)
+++ 	(revision )
@@ -1,107 +1,0 @@
-%SMBcomponents Class definition
-%
-%   Usage:
-%      SMBcomponents=SMBcomponents();
-
-classdef SMBcomponents
-	properties (SetAccess=public)
-		accumulation      = NaN;
-		runoff            = NaN;
-		evaporation       = NaN;
-		steps_per_step    = 1;
-		averaging         = 0;
-		requested_outputs = {};
-	end
-	methods
-		function self = SMBcomponents(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters (SMB=accumulation-runoff-evaporation) :'));
-			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
-			fielddisplay(self,'runoff','amount of ice melt lost from the ice column [m/yr ice eq]');
-			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-		end % }}}
-		function self = extrude(self,md) % {{{
-
-			self.accumulation=project3d(md,'vector',self.accumulation,'type','node');
-			self.runoff=project3d(md,'vector',self.runoff,'type','node');
-			self.evaporation=project3d(md,'vector',self.evaporation,'type','node');
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-
-			list = {'SmbMassBalance'};
-
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.accumulation)
-				self.accumulation=zeros(md.mesh.numberofvertices,1);
-				disp('      no smb.accumulation specified: values set as zero');
-			end
-			if isnan(self.evaporation)
-				self.evaporation=zeros(md.mesh.numberofvertices,1);
-				disp('      no smb.evaporation specified: values set as zero');
-			end
-			if isnan(self.runoff)
-				self.runoff=zeros(md.mesh.numberofvertices,1);
-				disp('      no smb.runoff specified: values set as zero');
-			end
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.accumulation','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.runoff','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.evaporation','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.accumulation','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.runoff','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.evaporation','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                            %remove 'default' from outputs
-				outputs	 = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%output default:
-			self.requested_outputs={'default'};
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBcomponents.py
===================================================================
--- /issm/trunk/src/m/classes/SMBcomponents.py	(revision 28275)
+++ 	(revision )
@@ -1,105 +1,0 @@
-import numpy as np
-
-from checkfield import *
-from fielddisplay import fielddisplay
-from project3d import *
-from WriteData import *
-
-
-class SMBcomponents(object):
-    """SMBCOMPONENTS class definition
-
-    Usage:
-        SMBcomponents = SMBcomponents()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.accumulation = np.nan
-        self.runoff = np.nan
-        self.evaporation = np.nan
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = []
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters (SMB=accumulation-runoff-evaporation) :\n'
-        s += '{}\n'.format(fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'runoff', 'amount of ice melt lost from the ice column [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.accumulation = project3d(md, 'vector', self.accumulation, 'type', 'node')
-        self.runoff = project3d(md, 'vector', self.runoff, 'type', 'node')
-        self.evaporation = project3d(md, 'vector', self.evaporation, 'type', 'node')
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.accumulation)):
-            self.accumulation = np.zeros((md.mesh.numberofvertices))
-            print('      no SMB.accumulation specified: values set as zero')
-        if np.all(np.isnan(self.evaporation)):
-            self.evaporation = np.zeros((md.mesh.numberofvertices))
-            print('      no SMB.evaporation specified: values set as zero')
-        if np.all(np.isnan(self.runoff)):
-            self.runoff = np.zeros((md.mesh.numberofvertices))
-            print('      no SMB.runoff specified: values set as zero')
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.accumulation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.runoff', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        if 'BalancethicknessAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.runoff', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accumulation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoff', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.requested_outputs = ['default']
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/SMBd18opdd.m
===================================================================
--- /issm/trunk/src/m/classes/SMBd18opdd.m	(revision 28275)
+++ 	(revision )
@@ -1,208 +1,0 @@
-%SMBd18opdd Class definition
-%
-%   Usage:
-%      SMBd18opdd=SMBd18opdd();
-
-classdef SMBd18opdd
-	properties (SetAccess=public)
-
-		desfac                    = 0;
-		s0p                       = NaN;
-		s0t                       = NaN;
-		rlaps                     = 0;
-		rlapslgm                  = 0;
-		dpermil                   = 0;
-		f                         = 0;
-		Tdiff                     = NaN;
-		sealev                    = NaN;
-		ismungsm                  = 0;
-		isd18opd                  = 0;
-		issetpddfac               = 0;
-		istemperaturescaled       = 1;
-		isprecipscaled            = 1;
-		delta18o                  = NaN;
-		delta18o_surface          = NaN;
-		temperatures_presentday   = NaN;
-		precipitations_presentday = NaN;
-		temperatures_reconstructed = NaN;
-		precipitations_reconstructed = NaN;
-		pddfac_snow               = NaN;
-		pddfac_ice                = NaN;
-		steps_per_step            = 1;
-		averaging                 = 0;
-		requested_outputs         = {};
-	end
-	methods
-		function self = SMBd18opdd(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			if(self.isd18opd),self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node');end
-			if(self.isd18opd),self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node');end
-			if(self.istemperaturescaled==0),self.temperatures_reconstructed=project3d(md,'vector',self.temperatures_reconstructed,'type','node');end
-			if(self.isprecipscaled==0),self.precipitations_reconstructed=project3d(md,'vector',self.precipitations_reconstructed,'type','node');end
-			self.s0p=project3d(md,'vector',self.s0p,'type','node');
-			self.s0t=project3d(md,'vector',self.s0t,'type','node');
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-
-			list = {'SmbMassBalance'};
-
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.s0p),
-				self.s0p=zeros(md.mesh.numberofvertices,1);
-				disp('      no SMBd18opdd.s0p specified: values set as zero');
-			end
-			if isnan(self.s0t),
-				self.s0t=zeros(md.mesh.numberofvertices,1);
-				disp('      no SMBd18opdd.s0t specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.ismungsm   = 0;
-			self.isd18opd   = 1;
-			self.istemperaturescaled = 1;
-			self.isprecipscaled = 1;
-			self.desfac     = 0.5;
-			self.rlaps      = 6.5;
-			self.rlapslgm   = 6.5;
-			self.dpermil    = 2.4;
-			self.f          = 0.169;
-			self.issetpddfac = 0;
-			self.requested_outputs={'default'};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',1);
-				md = checkfield(md,'fieldname','smb.s0p','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','smb.s0t','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','smb.rlapslgm','>=',0,'numel',1);
-
-				if(self.isd18opd==1)
-					md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.delta18o','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
-					md = checkfield(md,'fieldname','smb.dpermil','>=',0,'numel',1);
-					md = checkfield(md,'fieldname','smb.f','>=',0,'numel',1);
-					if(self.istemperaturescaled==0)
-						lent=size(self.temperatures_reconstructed,2);
-						multt=ceil(lent/12)*12;
-						md = checkfield(md,'fieldname','smb.temperatures_reconstructed','size',[md.mesh.numberofvertices+1 multt],'NaN',1,'Inf',1,'timeseries',1);
-					end
-					if(self.isprecipscaled==0)
-						lenp=size(self.temperatures_reconstructed,2);
-						multp=ceil(lent/12)*12;
-						md = checkfield(md,'fieldname','smb.precipitations_reconstructed','size',[md.mesh.numberofvertices+1 multt],'NaN',1,'Inf',1,'timeseries',1);
-					end
-				end
-				if(self.issetpddfac==1)
-					md = checkfield(md,'fieldname','smb.pddfac_snow','>=',0,'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.pddfac_ice','>=',0,'NaN',1,'Inf',1);
-				end
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-
-			disp(sprintf('\n   PDD and deltaO18 parameters:'));
-			fielddisplay(self,'isd18opd','is delta18o parametrisation from present day temperature and precipitation activated (0 or 1, default is 0)');
-			fielddisplay(self,'issetpddfac','is user passing in defined pdd factors (0 or 1, default is 0)');
-			fielddisplay(self,'desfac','desertification elevation factor (between 0 and 1, default is 0.5) [m]');
-			fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]');
-			fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]');
-			fielddisplay(self,'rlaps','present day lapse rate [degree/km]');
-			if(self.isd18opd==1)
-				fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm/d18opd is activated');
-				fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o/mungsm/d18opd is activated');
-				fielddisplay(self,'istemperaturescaled','if delta18o parametrisation from present day temperature and precipitation is activated, is temperature scaled to delta18o value? (0 or 1, default is 1)');
-				fielddisplay(self,'isprecipscaled','if delta18o parametrisation from present day temperature and precipitation is activated, is precip scaled to delta18o value? (0 or 1, default is 1)');
-				if(self.istemperaturescaled==0)
-					fielddisplay(self,'temperatures_reconstructed','monthly historical surface temperatures [K], required if delta18o/mungsm/d18opd is activated and istemperaturescaled is not activated');
-				end
-				if(self.isprecipscaled==0)
-					fielddisplay(self,'precipitations_reconstructed','monthly historical precipitation [m/yr water eq], required if delta18o/mungsm/d18opd is activated and isprecipscaled is not activated');
-				end
-				fielddisplay(self,'delta18o','delta18o [per mil], required if pdd is activated and d18opd activated');
-				fielddisplay(self,'dpermil','degree per mil, required if d18opd is activated');
-				fielddisplay(self,'f','precip/temperature scaling factor, required if d18opd is activated');
-			end
-			if(self.issetpddfac==1)
-				fielddisplay(self,'pddfac_snow','Pdd factor for snow for all the domain [mm ice equiv/day/degree C]');
-				fielddisplay(self,'pddfac_ice','Pdd factor for ice for all the domain [mm ice equiv/day/degree C]');
-			end
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-			% No need to display rlapslgm, Tdiff, ismungsm
-			% as they are not used in this case but are still needed as default values in
-			% PositiveDegreeDay (Tria.cpp) used in that case
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',5,'format','Integer');
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismungsm','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isd18opd','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','issetpddfac','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlapslgm','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
-
-			if self.isd18opd
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','istemperaturescaled','format','Boolean');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','isprecipscaled','format','Boolean');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','dpermil','format','Double');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','f','format','Double');
-				if self.istemperaturescaled==0
-					WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_reconstructed','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				end
-				if self.isprecipscaled==0
-					WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_reconstructed','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				end
-			end
-			if self.issetpddfac==1
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','pddfac_snow','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','pddfac_ice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			end
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBd18opdd.py
===================================================================
--- /issm/trunk/src/m/classes/SMBd18opdd.py	(revision 28275)
+++ 	(revision )
@@ -1,208 +1,0 @@
-import numpy as np
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-from project3d import project3d
-
-
-class SMBd18opdd(object):
-    """
-    SMBd18opdd Class definition
-
-       Usage:
-          SMBd18opdd = SMBd18opdd()
-    """
-    def __init__(self, *args):  # {{{
-        self.desfac = 0.
-        self.s0p = float('NaN')
-        self.s0t = float('NaN')
-        self.rlaps = 0.
-        self.rlapslgm = 0.
-        self.dpermil = 0.
-        self.f = 0.
-        self.Tdiff = float('NaN')
-        self.sealev = float('NaN')
-        self.ismungsm = 0
-        self.isd18opd = 0
-        self.issetpddfac = 0
-        self.istemperaturescaled = 0
-        self.isprecipscaled = 0
-        self.delta18o = float('NaN')
-        self.delta18o_surface = float('NaN')
-        self.temperatures_presentday = float('NaN')
-        self.precipitations_presentday = float('NaN')
-        self.temperatures_reconstructed = float('NaN')
-        self.precipitations_reconstructed = float('NaN')
-        self.pddfac_snow = float('NaN')
-        self.pddfac_ice = float('NaN')
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = []
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'isd18opd', 'is delta18o parametrisation from present day temperature and precipitation activated (0 or 1, default is 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'issetpddfac', 'is user passing in defined pdd factors (0 or 1, default is 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'desfac', 'desertification elevation factor (between 0 and 1, default is 0.5) [m]'))
-        s += '{}\n'.format(ielddisplay(self, 's0p', 'should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 's0t', 'should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'rlaps', 'present day lapse rate [degree/km]'))
-
-        if self.isd18opd:
-            s += '{}\n'.format(fielddisplay(self, 'temperatures_presentday', 'monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))
-            s += '{}\n'.format(fielddisplay(self, 'precipitations_presentday', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-            s += '{}\n'.format(fielddisplay(self, 'istemperaturescaled', 'if delta18o parametrisation from present day temperature and precipitation is activated, is temperature scaled to delta18o value? (0 or 1, default is 1)'))
-            s += '{}\n'.format(fielddisplay(self, 'isprecipscaled', 'if delta18o parametrisation from present day temperature and precipitation is activated, is precipitation scaled to delta18o value? (0 or 1, default is 1)'))
-
-            if self.istemperaturescaled == 0:
-                s += '{}\n'.format(fielddisplay(self, 'temperatures_reconstructed', 'monthly historical surface temperatures [K], required if delta18o/mungsm/d18opd is activated and istemperaturescaled is not activated'))
-
-            if self.isprecipscaled == 0:
-                s += '{}\n'.format(fielddisplay(self, 'precipitations_reconstructed', 'monthly historical precipitation [m/yr water eq], required if delta18o/mungsm/d18opd is activated and isprecipscaled is not activated'))
-
-            s += '{}\n'.format(fielddisplay(self, 'delta18o', 'delta18o [per mil], required if pdd is activated and delta18o activated'))
-            s += '{}\n'.format(fielddisplay(self, 'dpermil', 'degree per mil, required if d18opd is activated'))
-            s += '{}\n'.format(fielddisplay(self, 'f', 'precip/temperature scaling factor, required if d18opd is activated'))
-
-        if self.issetpddfac == 1:
-            s += '{}\n'.format(fielddisplay(self, 'pddfac_snow', 'Pdd factor for snow for all the domain [mm ice equiv/day/degree C]'))
-            s += '{}\n'.format(fielddisplay(self, 'pddfac_ice', 'Pdd factor for ice for all the domain [mm ice equiv/day/degree C]'))
-
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-    def extrude(self, md):  # {{{
-        if self.isd18opd:
-            self.temperatures_presentday = project3d(md, 'vector', self.temperatures_presentday, 'type', 'node')
-        if self.isd18opd:
-            self.precipitations_presentday = project3d(md, 'vector', self.precipitations_presentday, 'type', 'node')
-        if self.istemperaturescaled == 0:
-            self.temperatures_reconstructed = project3d(md, 'vector', self.temperatures_reconstructed, 'type', 'node')
-        if self.isprecipscaled == 0:
-            self.precipitations_reconstructed = project3d(md, 'vector', self.precipitations_reconstructed, 'type', 'node')
-        self.s0p = project3d(md, 'vector', self.s0p, 'type', 'node')
-        self.s0t = project3d(md, 'vector', self.s0t, 'type', 'node')
-        return self
-    # }}}
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.s0p)):
-            self.s0p = np.zeros((md.mesh.numberofvertices))
-            print("      no SMBd18opdd.s0p specified: values set as zero")
-
-        if np.all(np.isnan(self.s0t)):
-            self.s0t = np.zeros((md.mesh.numberofvertices))
-            print("      no SMBd18opdd.s0t specified: values set as zero")
-        return self
-    # }}}
-    def setdefaultparameters(self):  # {{{
-        # pdd method not used in default mode
-        self.ismungsm = 0
-        self.isd18opd = 1
-        self.istemperaturescaled = 1
-        self.isprecipscaled = 1
-        self.desfac = 0.5
-        self.rlaps = 6.5
-        self.rlapslgm = 6.5
-        self.dpermil = 2.4
-        self.f = 0.169
-        self.issetpddfac = 0
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.desfac', '<=', 1, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'smb.s0p', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'smb.s0t', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'smb.rlaps', '>=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'smb.rlapslgm', '>=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-
-            if self.isd18opd:
-                lent = float(np.size(self.temperatures_presentday, 1))
-                lenp = float(np.size(self.precipitations_presentday, 1))
-                multt = np.ceil(lent / 12.) * 12.
-                multp = np.ceil(lenp / 12.) * 12.
-                md = checkfield(md, 'fieldname', 'smb.temperatures_presentday', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.precipitations_presentday', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-
-                if self.istemperaturescaled == 0:
-                    lent = float(np.size(self.temperatures_reconstructed, 1))
-                    multt = np.ceil(lent / 12.) * 12.
-                    md = checkfield(md, 'fieldname', 'smb.temperatures_reconstructed', 'size', [md.mesh.numberofvertices + 1, multt], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-
-                if self.isprecipscaled == 0:
-                    lenp = float(np.size(self.precipitations_reconstructed, 1))
-                    multp = np.ceil(lent / 12.) * 12.
-                    md = checkfield(md, 'fieldname', 'smb.precipitations_reconstructed', 'size', [md.mesh.numberofvertices + 1, multp], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-
-                md = checkfield(md, 'fieldname', 'smb.delta18o', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
-                md = checkfield(md, 'fieldname', 'smb.dpermil', '>=', 0, 'numel', [1])
-                md = checkfield(md, 'fieldname', 'smb.f', '>=', 0, 'numel', [1])
-
-            if self.issetpddfac:
-                md = checkfield(md, 'fieldname', 'smb.pddfac_snow', '>=', 0, 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.pddfac_ice', '>=', 0, 'NaN', 1, 'Inf', 1)
-
-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 5, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ismungsm', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isd18opd', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'issetpddfac', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'desfac', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0p', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0t', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlaps', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlapslgm', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tdiff', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'sealev', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        if self.isd18opd:
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_presentday', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_presentday', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'istemperaturescaled', 'format', 'Boolean')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isprecipscaled', 'format', 'Boolean')
-
-            if self.istemperaturescaled == 0:
-                WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_reconstructed', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-
-            if self.isprecipscaled == 0:
-                WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_reconstructed', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'delta18o', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dpermil', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'f', 'format', 'Double')
-
-        if self.issetpddfac:
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pddfac_snow', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pddfac_ice', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/SMBdebrisEvatt.m
===================================================================
--- /issm/trunk/src/m/classes/SMBdebrisEvatt.m	(revision 28275)
+++ 	(revision )
@@ -1,204 +1,0 @@
-%SMBdebrisEvatt Class definition
-%
-%   Usage:
-%      SMBdebrisEvatt=SMBdebrisEvatt();
-
-classdef SMBdebrisEvatt
-	properties (SetAccess=public)
-
-		precipitation  = NaN;
-		temperature   = NaN;
-		dsradiation    = NaN;
-                dlradiation    = NaN;
-                windspeed      = NaN;
-                airhumidity    = NaN;
-		precipitation_anomaly = NaN;
-		temperature_anomaly   = NaN;
-		dsradiation_anomaly   = NaN;
-		dlradiation_anomaly   = NaN;
-		windspeed_anomaly     = NaN;
-		airhumidity_anomaly   = NaN;
-		s0t                   = NaN;
-		snowheight            = NaN;
-		qlaps                 = 0;
-		rlaps                 = 0;
-		dsgrad		      = 0;
-		dlgrad		      = 0;
-		windspeedgrad	      = 0;
-		humiditygrad	      = 0;
-		isAnderson	      = 0;
-		iscryokarst	      = 0;
-		AndersonD0	      = 0;
-		steps_per_step        = 1;
-		averaging             = 0;
-		requested_outputs     = {};
-		icealbedo	      = NaN;
-		snowalbedo            = NaN;
-		debrisalbedo	      = NaN;
-	end
-	methods
-		function self = SMBdebrisEvatt(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.precipitation=project3d(md,'vector',self.precipitation,'type','node');
-			self.temperature=project3d(md,'vector',self.temperature,'type','node');
-			self.dsradiation=project3d(md,'vector',self.dsradiation,'type','node');
-			self.dlradiation=project3d(md,'vector',self.dlradiation,'type','node');
-			self.windspeed=project3d(md,'vector',self.windspeed,'type','node');
-			self.airhumidity=project3d(md,'vector',self.airhumidity,'type','node');
-			self.temperature_anomaly=project3d(md,'vector',self.temperature_anomaly,'type','node');
-                        self.precipitation_anomaly=project3d(md,'vector',self.precipitation_anomaly,'type','node');
-			self.dsradiation_anomaly=project3d(md,'vector',self.temperature_anomaly,'type','node');
-	                self.dlradiation_anomaly=project3d(md,'vector',self.temperature_anomaly,'type','node');
-         	        self.windspeed_anomaly=project3d(md,'vector',self.temperature_anomaly,'type','node');
-                	self.airhumidity_anomaly=project3d(md,'vector',self.temperature_anomaly,'type','node');
-
-			self.s0t=project3d(md,'vector',self.s0t,'type','node');
-			self.snowheight=project3d(md,'vector',self.snowheight,'type','node');
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.s0t),
-				self.s0t=zeros(md.mesh.numberofvertices,1);
-				disp('      no SMBdebrisEvatt.s0t specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.qlaps         = 0.1;
-			self.rlaps         = 7.4;
-			self.dsgrad	   = 13.;
-			self.dlgrad	   = 29;
-			self.windspeedgrad = -0.2;
-			self.humiditygrad  = 0;
-			self.icealbedo	   = 0.3;
-			self.snowalbedo    = 0.75;
-		 	self.debrisalbedo  = 0.07;
-			self.isAnderson    = 0;
-			self.iscryokarst   = 0;
-			self.AndersonD0    = 0.5;
-			self.requested_outputs={'default'};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if (strcmp(solution,'TransientSolution') & md.transient.issmb == 0), return; end
-
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.temperature','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 365]);
-				md = checkfield(md,'fieldname','smb.precipitation','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 365]);
-				md = checkfield(md,'fieldname','smb.dsradiation','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 365]);
-				md = checkfield(md,'fieldname','smb.dlradiation','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 365]);
-				md = checkfield(md,'fieldname','smb.windspeed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 365]);
-				md = checkfield(md,'fieldname','smb.airhumidity','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 365]);
-				md = checkfield(md,'fieldname','smb.snowheight','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging', 'numel', [1], 'values', [0, 1, 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-			md = checkfield(md,'fieldname','smb.icealbedo','>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','smb.snowalbedo','>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','smb.debrisalbedo','>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','smb.isAnderson','numel', [1], 'values', [0, 1]);
-			md = checkfield(md,'fieldname','smb.iscryokarst','numel', [1], 'values', [0, 1]);
-
-		end % }}}
-		function disp(self) % {{{
-	
-			disp(sprintf('Evatt et al. (2015) Debris Model (doi: 10.3189/2015JoG14J235)'));
-			disp(sprintf('If isAnderson==1 -> Eq. 6 from Ferguson & Vieli (2021) ist taken (https://doi.org/10.5194/tc-15-3377-2021)'));
-			disp(sprintf('If iscryokarst==1 -> Eqs. 9,10 from Ferguson & Vieli (2021) are taken (https://doi.org/10.5194/tc-15-3377-2021)'));
-			disp(sprintf('Clean-ice SMB is taken from the Evatt et al. (2015) EBM with debris=0'));
-
-			fielddisplay(self,'isAnderson','do we use the Anderson parametrization (default is 0)');
-			fielddisplay(self,'iscryokarst','do we use a cryokarst parametrization (default is 0)');
-			fielddisplay(self,'temperature',' surface temperature [K]');
-			fielddisplay(self,'precipitation',' surface precipitation [m/yr water eq]');
-			fielddisplay(self,'dsradiation',' downwelling shortwave radiation [W m-2]');
-                        fielddisplay(self,'dlradiation',' downwelling longwave radiation [W m-2]');
-			fielddisplay(self,'windspeed',' surface wind speed [m s-1]');
-                        fielddisplay(self,'airhumidity',' near-surface specific humidity [kg kg-1]');
-			fielddisplay(self,'temperature_anomaly','anomaly to  reference temperature (additive)');
-                        fielddisplay(self,'precipitation_anomaly','anomaly to  precipitation (multiplicative)');
-                        fielddisplay(self,'dsradiation_anomaly','anomaly to  reference downwelling shortwave radiation');
-                        fielddisplay(self,'dlradiation_anomaly','anomaly to  reference downwelling longwave radiation (additive');
-                        fielddisplay(self,'windspeed_anomaly','anomaly to  reference surface wind speed (additive)');
-                        fielddisplay(self,'airhumidity_anomaly','anomaly to  reference near-surface specific humidity (additive)');
-
-			fielddisplay(self,'s0t','should be set to elevation from RCM/GCM source (between 0 and a few 1000s m, default is 0) [m]');
-			fielddisplay(self,'snowheight','guess of snowheight at the end of the summer, will be further evolved');
-			fielddisplay(self,'rlaps','present day temperature lapse rate (default is 7.4 degree/km)');
-			fielddisplay(self,'dsgrad','present day SW height gradient (default is 1.3 W/m^2/km)');
-			fielddisplay(self,'dlgrad','present day LW height gradient (default is 2.9 W/m^2/km)');
-			fielddisplay(self,'windspeedgrad','present day wind speed height gradient (default is 0.02 m/s/km)');
-			fielddisplay(self,'humiditygrad','present day humidity height gradient (default is 0)');
-			fielddisplay(self,'qlaps','precip change (default is 0.1/km');
-			fielddisplay(self,'icealbedo','albedo for ice (default is 0.3)');
-			fielddisplay(self,'snowalbedo','albedo for snow (default is 0.75)');
-			fielddisplay(self,'debrisalbedo','albedo for debris (default is 0.07)');
-			fielddisplay(self,'AndersonD0','parameter to represent the debris effect (default is 0.5)');
-			fielddisplay(self,'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self,'averaging','averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested (TemperaturePDD, SmbAccumulation, SmbMelt, SmbSummerMelt, SmbAlbedo, SmbSummerAlbedo, SmbSnowheight)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',14,'format','Integer');
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','qlaps','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','snowheight','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dsgrad','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dlgrad','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','windspeedgrad','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','humiditygrad','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','icealbedo','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','snowalbedo','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','debrisalbedo','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isAnderson','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','iscryokarst','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','AndersonD0','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dsradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dlradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','windspeed','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','airhumidity','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperature_anomaly','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-                        WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation_anomaly','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dsradiation_anomaly','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dlradiation_anomaly','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','windspeed_anomaly','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','airhumidity_anomaly','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer')
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBdebrisML.m
===================================================================
--- /issm/trunk/src/m/classes/SMBdebrisML.m	(revision 28275)
+++ 	(revision )
@@ -1,73 +1,0 @@
-%SMBdebrisML Class definition
-%
-%   Usage:
-%      SMBdebrisML=SMBdebrisML();
-
-classdef SMBdebrisML
-	properties (SetAccess=public)
-		steps_per_step=1;
-		averaging=0;
-		requested_outputs      = {};
-	end
-	methods
-		function self = SMBdebrisML(varargin) % {{{
-			switch nargin
-				case 0
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('SMBdebrisML');
-						list2 = fieldnames(inputstruct);
-						for i=1:length(list1)
-							fieldname = list1{i};
-							if ismember(fieldname,list2),
-								self.(fieldname) = inputstruct.(fieldname);
-							end
-						end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',14,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBforcing.js
===================================================================
--- /issm/trunk/src/m/classes/SMBforcing.js	(revision 28275)
+++ 	(revision )
@@ -1,82 +1,0 @@
-//SMBforcing Class definition
-//
-//   Usage:
-//      SMB=SMBforcing();
-
-function SMBforcing(){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		this.requested_outputs=['default'];
-	} // }}}
-	this.disp = function(){ // {{{
-		console.log(sprintf('   surface forcings parameters:'));
-		fielddisplay(this,'mass_balance','surface mass balance [m/yr ice eq]');
-		fielddisplay(this,'steps_per_step', 'number of smb steps per time step');
-		fielddisplay(this,'requested_outputs','additional outputs requested');
-		fielddisplay(this,'averaging','averaging methods from short to long steps');
-		console.log(sprintf('%51s  0: Arithmetic (default)',' '));
-		console.log(sprintf('%51s  1: Geometric',' '));
-		console.log(sprintf('%51s  2: Harmonic',' '));
-	} // }}}
-	this.defaultoutputs = function(){ // {{{
-		return 'SmbMassBalance';
-	}//}}}
-    this.classname = function(){ // {{{
-        return "SMBforcing";
-    } // }}}
-    this.extrude = function(md) {//{{{
-        this.mass_balance=project3d(md,'vector',this.mass_balance,'type','node');
-        return this;
-    }//}}}
-    this.initialize = function(md) {// {{{
-
-        if (isNaN(this.mass_balance)){
-            this.mass_balance=NewArrayFill(md.mesh.numberofvertices,0);
-            console.log('      no smb.mass_balance specified: values set as zero');
-        }
-
-    } // }}}
-    this.checkconsistency = function(md,solution,analyses) { //{{{
-		if (solution=='TransientSolution' && md.transient.issmb == 0) return;
-        if(ArrayAnyEqual(ArrayIsMember('MasstransportAnalysis',analyses),1)){
-            checkfield(md,'fieldname','smb.mass_balance','timeseries',1,'NaN',1,'Inf',1);
-        }
-        if(ArrayAnyEqual(ArrayIsMember('BalancethicknessAnalysis',analyses),1)){
-            checkfield(md,'fieldname','smb.mass_balance','size',[md.mesh.numberofvertices,1],'NaN',1,'Inf',1);
-        }
-		checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-		checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-		checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0,1,2]);
-    } // }}}
-    this.marshall=function(md,prefix,fid) { //{{{
-
-        var yts=md.constants.yts;
-
-        WriteData(fid,prefix,'name','md.smb.model','data',1,'format','Integer');
-        WriteData(fid,prefix,'object',this,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'object',this,'fieldname','steps_per_step','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','averaging','format','Integer');
-
-        //process requested outputs
-        var outputs = this.requested_outputs.slice();
-        for (var i=0;i<outputs.length;i++){
-            if (outputs[i] == 'default') {
-                outputs.splice(i,1);
-                var newoutputs=this.defaultoutputs(md);
-                for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-            }
-        }
-        WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-    }//}}}
-    this.fix=function() { //{{{
-    }//}}}
-	//properties 
-    // {{{
-	this.mass_balance 	   = NaN;
-	this.requested_outputs = [];
-	this.steps_per_step    = 1;
-	this.averaging         = 0;
-	this.setdefaultparameters();
-    // }}}
-}
Index: sm/trunk/src/m/classes/SMBforcing.m
===================================================================
--- /issm/trunk/src/m/classes/SMBforcing.m	(revision 28275)
+++ 	(revision )
@@ -1,100 +1,0 @@
-%SMBforcing Class definition
-%
-%   Usage:
-%      SMB=SMBforcing();
-
-classdef SMBforcing
-	properties (SetAccess=public)
-		mass_balance      = NaN;
-		steps_per_step    = 1;
-		requested_outputs = {};
-		averaging         = 0;
-	end
-	methods
-		function self = SMBforcing(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('SMBforcing');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.mass_balance=project3d(md,'vector',self.mass_balance,'type','node');
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.mass_balance)
-				self.mass_balance=zeros(md.mesh.numberofvertices,1);
-				disp('      no smb.mass_balance specified: values set as zero');
-			end
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			if (strcmp(solution,'TransientSolution') & md.transient.issmb == 0), return; end
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.mass_balance','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.mass_balance','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-			fielddisplay(self,'mass_balance','surface mass balance [m/yr ice eq]');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-			fielddisplay(self,'averaging','averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.smb.mass_balance'],self.mass_balance);
-			writejscellstring(fid,[modelname '.smb.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%output default:
-			self.requested_outputs={'default'};
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBforcing.py
===================================================================
--- /issm/trunk/src/m/classes/SMBforcing.py	(revision 28275)
+++ 	(revision )
@@ -1,92 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class SMBforcing(object):
-    """SMBFORCING class definition
-
-    Usage:
-        SMB = SMBforcing()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.mass_balance = np.nan
-        self.steps_per_step = 1
-        self.requested_outputs = []
-        self.averaging = 0
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            # TODO: Replace the following with constructor
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.mass_balance = project3d(md, 'vector', self.mass_balance, 'type', 'node')
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.mass_balance)):
-            self.mass_balance = np.zeros((md.mesh.numberofvertices))
-            print("      no smb.mass_balance specified: values set as zero")
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if solution == 'TransientSolution' and not md.transient.issmb:
-            return
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.mass_balance', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        if 'BalancethicknessAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.mass_balance', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'mass_balance', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        self.requested_outputs = ['SmbMassBalance']
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/SMBgemb.m
===================================================================
--- /issm/trunk/src/m/classes/SMBgemb.m	(revision 28275)
+++ 	(revision )
@@ -1,612 +1,0 @@
-%SMBgemb Class definition.
-%   This is the class that hosts all the inputs for the Alberta Glacier Surface Mass Balance Model
-%   Alex Gardner, University of Alberta.
-%
-%   Usage:
-%      SMBgemb=SMBgemb();
-
-classdef SMBgemb
-	properties (SetAccess=public)
-		% {{{
-		%each one of these properties is a transient forcing to the GEMB model, loaded from meteorological data derived
-		%from an automatic weather stations (AWS). Each property is therefore a matrix, of size (numberofvertices x number
-		%of time steps. )
-
-		%solution choices
-		isgraingrowth       = 0;
-		isalbedo            = 0;
-		isshortwave         = 0;
-		isthermal           = 0;
-		isaccumulation      = 0;
-		ismelt              = 0;
-		isdensification     = 0;
-		isturbulentflux     = 0;
-		isconstrainsurfaceT = 0;
-		isdeltaLWup         = 0;
-
-		%inputs:
-		Ta    = NaN; %2 m air temperature, in Kelvin
-		V     = NaN; %wind speed (m/s-1)
-		dswrf = NaN; %downward shortwave radiation flux [W/m^2]
-		dlwrf = NaN; %downward longwave radiation flux [W/m^2]
-		P     = NaN; %precipitation [mm w.e. / m^2]
-		eAir  = NaN; %screen level vapor pressure [Pa]
-		pAir  = NaN; %surface pressure [Pa]
-
-		Tmean = NaN; %mean annual temperature [K]
-		Vmean = NaN; %mean annual wind velocity [m s-1]
-		C     = NaN; %mean annual snow accumulation [kg m-2 yr-1]
-		Tz    = NaN; %height above ground at which temperature (T) was sampled [m]
-		Vz    = NaN; %height above ground at which wind (V) was sampled [m]
-
-		%optional inputs:
-		aValue = NaN; %Albedo forcing at every element.  Used only if aIdx == 0, or density exceeds adThresh
-		teValue = NaN; %Outward longwave radiation thermal emissivity forcing at every element (default in code is 1). 
-		               %Used only if eIdx== 0, or effective grain radius exceeds teThresh
-		dulwrfValue = NaN; %Delta with which to perturn the long wave radiation upwards. Use if isdeltaLWup is true;  
-
-		% Initialization of snow properties
-		Dzini = NaN; %cell depth (m)
-		Dini = NaN; %snow density (kg m-3)
-		Reini = NaN; %effective grain size (mm)
-		Gdnini = NaN; %grain dendricity (0-1)
-		Gspini = NaN; %grain sphericity (0-1)
-		ECini = NaN; %evaporation/condensation (kg m-2)
-		Wini = NaN; %Water content (kg m-2)
-		Aini = NaN; %albedo (0-1)
-		Adiffini = NaN; %albedo, diffusive radiation (0-1)
-		Tini = NaN; %snow temperature (K)
-		Sizeini = NaN; %Number of layers
-
-		%settings:
-		aIdx   = NaN; %method for calculating albedo and subsurface absorption (default is 1)
-		% 0: direct input from aValue parameter, no use of adThresh
-		% 1: effective grain radius [Gardner & Sharp, 2009]
-		% 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003]], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
-		% 3: density and cloud amount [Greuell & Konzelmann, 1994]
-		% 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
-
-		eIdx   = NaN; %method for calculating emissivity (default is 1)
-		% 0: direct input from teValue parameter, no use of teThresh
-		% 1: default value of 1, in areas with grain radius below teThresh
-		% 2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface
-
-		tcIdx   = NaN; %method for calculating thermal conductivity (default is 1)
-		% 1: after Sturm et al, 1997
-		% 2: after Calonne et al., 2011
-
-		swIdx  = NaN; %apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 0, if swIdx=1 and aIdx=2, function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002))
-
-		denIdx = NaN; %densification model to use (default is 2):
-		% 1 = emperical model of Herron and Langway (1980)
-		% 2 = semi-emperical model of Anthern et al. (2010)
-		% 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
-		% 4 = DO NOT USE: emperical model of Li and Zwally (2004)
-		% 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
-		% 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
-		% 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
-
-		dsnowIdx = NaN; %model for fresh snow accumulation density (default is 1):
-		% 0 = Original GEMB value, 150 kg/m^3
-		% 1 = Antarctica value of fresh snow density, 350 kg/m^3
-		% 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)
-		% 3 = Antarctica model of Kaspers et al. (2004)
-		% 4 = Greenland model of Kuipers Munneke et al. (2015)
-
-		zTop  = NaN; % depth over which grid length is constant at the top of the snopack (default 10) [m]
-		dzTop = NaN; % initial top vertical grid spacing (default .05) [m]
-		dzMin = NaN; % initial min vertical allowable grid spacing (default dzMin/2) [m]
-
-		zY    = NaN; % strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]
-		zMax = NaN; %initial max model depth (default is min(thickness,250)) [m]
-		zMin = NaN; %initial min model depth (default is min(thickness,130)) [m]
-		outputFreq = NaN; %output frequency in days (default is monthly, 30)
-
-		%specific albedo parameters:
-		%Method 1
-		dswdiffrf = NaN; %downward diffusive shortwave radiation flux [W/m^2]
-		szaValue = NaN; %Solar Zenith Angle [degree]
-		cotValue = NaN; %Cloud Optical Thickness
-		ccsnowValue = NaN; %concentration of light absorbing carbon for snow [ppm1]
-		cciceValue = NaN; %concentration of light absorbing carbon for ice [ppm1]
-		%Method 1 and 2:
-		aSnow = NaN; % new snow albedo (0.64 - 0.89)
-		aIce  = NaN; % range 0.27-0.58 for old snow
-		%Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
-		cldFrac = NaN; % average cloud amount
-		%Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
-		t0wet = NaN; % time scale for wet snow (15-21.9)
-		t0dry = NaN; % warm snow timescale (30)
-		K     = NaN; % time scale temperature coef. (7)
-		adThresh = NaN; %Apply aIdx method to all areas with densities below this value,
-		%or else apply direct input value from aValue, allowing albedo to be altered.
-		%Default value is rho water (1023 kg m-3).
-		teThresh = NaN; %Apply eIdx method to all areas with grain radii above this value (mm),
-		%or else apply direct input value from teValue, allowing emissivity to be altered.
-		%Default value is a effective grain radius of 10 mm.
-
-		%densities:
-		InitDensityScaling= NaN; %initial scaling factor multiplying the density of ice, which describes the density of the snowpack.
-
-		%thermal:
-		ThermoDeltaTScaling= NaN; %scaling factor to multiply the thermal diffusion timestep (delta t)
-
-		steps_per_step = 1;
-		averaging = 0;
-		requested_outputs      = {};
-
-		%Several fields are missing from the standard GEMB model, which are 
-		%captured intrinsically by ISSM.
-		%dateN: that's the last row of the above fields.
-		%dt:    included in dateN. Not an input.
-		%elev:  this is taken from the ISSM surface itself.
-
-	end % }}}
-	methods
-		function self = SMBgemb(varargin) % {{{
-			switch nargin
-				case 2
-					mesh=varargin{1};
-					geometry=varargin{2};
-					self=setdefaultparameters(self,mesh,geometry);
-				otherwise
-					error('constructor not supported: need geometry and mesh to set defaults');
-			end
-		end % }}}
-		function disp(self) % {{{
-
-			disp(sprintf('   surface forcings for SMB GEMB model :'));
-
-			fielddisplay(self,'isgraingrowth','run grain growth module (default true)');
-			fielddisplay(self,'isalbedo','run albedo module (default true)');
-			fielddisplay(self,'isshortwave','run short wave module (default true)');
-			fielddisplay(self,'isthermal','run thermal module (default true)');
-			fielddisplay(self,'isaccumulation','run accumulation module (default true)');
-			fielddisplay(self,'ismelt','run melting  module (default true)');
-			fielddisplay(self,'isdensification','run densification module (default true)');
-			fielddisplay(self,'isturbulentflux','run turbulant heat fluxes module (default true)');
-			fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)');
-			fielddisplay(self,'isdeltaLWup','set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)'); 
-			fielddisplay(self,'Ta','2 m air temperature, in Kelvin');
-			fielddisplay(self,'V','wind speed (m s-1)');
-			fielddisplay(self,'dswrf','downward shortwave radiation flux [W/m^2]');
-			fielddisplay(self,'dswdiffrf','downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]');
-			fielddisplay(self,'dlwrf','downward longwave radiation flux [W/m^2]');
-			fielddisplay(self,'P','precipitation [mm w.e. / m^2]');
-			fielddisplay(self,'eAir','screen level vapor pressure [Pa]');
-			fielddisplay(self,'pAir','surface pressure [Pa]');
-			fielddisplay(self,'Tmean','mean annual temperature [K]');
-			fielddisplay(self,'C','mean annual snow accumulation [kg m-2 yr-1]');
-			fielddisplay(self,'Vmean','mean annual wind speed [m s-1] (default 10 m/s)');
-			fielddisplay(self,'Tz','height above ground at which temperature (T) was sampled [m]');
-			fielddisplay(self,'Vz','height above ground at which wind (V) was sampled [m]');
-			fielddisplay(self,'zTop','depth over which grid length is constant at the top of the snopack (default 10) [m]');
-			fielddisplay(self,'dzTop','initial top vertical grid spacing (default .05) [m] ');
-			fielddisplay(self,'dzMin','initial min vertical allowable grid spacing (default dzMin/2) [m] ');
-			fielddisplay(self,'zMax','initial max model depth (default is min(thickness,250)) [m]');
-			fielddisplay(self,'zMin','initial min model depth (default is min(thickness,130)) [m]');
-			fielddisplay(self,'zY','strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]');
-			fielddisplay(self,'InitDensityScaling',{'initial scaling factor multiplying the density of ice','which describes the density of the snowpack.'});
-			fielddisplay(self,'ThermoDeltaTScaling',{'scaling factor to multiply the thermal diffusion timestep (delta t)'});
-			fielddisplay(self,'outputFreq','output frequency in days (default is monthly, 30)');
-			fielddisplay(self,'adThresh',{'Apply aIdx method to all areas with densities below this value,','or else apply direct input value from aValue, allowing albedo to be altered.'});
-			fielddisplay(self,'aIdx',{'method for calculating albedo and subsurface absorption (default is 1)',...
-				'0: direct input from aValue parameter',...
-				'1: effective grain radius [Gardner & Sharp, 2009]',...
-				'2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',...
-				'3: density and cloud amount [Greuell & Konzelmann, 1994]',...
-				'4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
-
-			fielddisplay(self,'dulwrfValue','Specified bias to be applied to the outward long wave radiation every element (W/m-2, +upward)');
-			fielddisplay(self,'teValue','Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)');
-			fielddisplay(self,'teThresh',{'Apply eIdx method to all areas with effective grain radius above this value (mm),','or else apply direct input value from teValue, allowing emissivity to be altered.'});
-			fielddisplay(self,'eIdx',{'method for calculating emissivity (default is 1)',...
-				'0: direct input from teValue parameter, no use of teThresh',...
-				'1: default value of 1, in areas with grain radius below teThresh',...
-				'2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface'});
-
-			fielddisplay(self,'tcIdx',{'method for calculating thermal conductivity (default is 1)',...
-				'1: after Sturm et al, 1997',...
-				'2: after Calonne et al., 2011'});
-
-			%snow properties init
-			fielddisplay(self,'Dzini','Initial cell depth when restart [m]');
-			fielddisplay(self,'Dini','Initial snow density when restart [kg m-3]');
-			fielddisplay(self,'Reini','Initial grain size when restart [mm]');
-			fielddisplay(self,'Gdnini','Initial grain dendricity when restart [-]');
-			fielddisplay(self,'Gspini','Initial grain sphericity when restart [-]');
-			fielddisplay(self,'ECini','Initial evaporation/condensation when restart [kg m-2]');
-			fielddisplay(self,'Wini','Initial snow water content when restart [kg m-2]');
-			fielddisplay(self,'Aini','Initial albedo when restart [-]');
-			fielddisplay(self,'Adiffini','Initial diffusive radiation albedo when restart (default to 1) [-]');
-			fielddisplay(self,'Tini','Initial snow temperature when restart [K]');
-			fielddisplay(self,'Sizeini','Initial number of layers when restart [-]');
-
-			%additional albedo parameters:
-			fielddisplay(self,'aValue','Albedo forcing at every element');
-			switch self.aIdx
-				case {1 2}
-					fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)');
-					fielddisplay(self,'aIce','albedo of ice (0.27-0.58)');
-					if self.aIdx==1
-						fielddisplay(self,'szaValue','Solar Zenith Angle [degree]');
-						fielddisplay(self,'cotValue','Cloud Optical Thickness');
-						fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]');
-						fielddisplay(self,'cciceValue','concentration of light absorbing carbon for ice [ppm1]');
-					end
-				case 3
-					fielddisplay(self,'cldFrac','average cloud amount');
-				case 4
-					fielddisplay(self,'t0wet','time scale for wet snow (15-21.9) [d]');
-					fielddisplay(self,'t0dry','warm snow timescale (30) [d]');
-					fielddisplay(self,'K','time scale temperature coef. (7) [d]');
-			end
-
-			fielddisplay(self,'swIdx','apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 0, if swIdx=1 and aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]');
-			fielddisplay(self,'denIdx',{'densification model to use (default is 2):',...
-				'1 = emperical model of Herron and Langway (1980)',...
-				'2 = semi-emperical model of Anthern et al. (2010)',...
-				'3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)',...
-				'4 = DO NOT USE: emperical model of Li and Zwally (2004)',...
-				'5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',...
-				'6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',...
-				'7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)'});
-			fielddisplay(self,'dsnowIdx',{'model for fresh snow accumulation density (default is 1):',...
-				'0 = Original GEMB value, 150 kg/m^3',...
-				'1 = Antarctica value of fresh snow density, 350 kg/m^3',...
-				'2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',...
-				'3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',...
-				'4 = Greenland model of Kuipers Munneke et al. (2015)'});
-
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-
-			self.Ta=project3d(md,'vector',self.Ta,'type','element');
-			self.V=project3d(md,'vector',self.V,'type','element');
-			self.dswrf=project3d(md,'vector',self.dswrf,'type','element');
-			self.dlwrf=project3d(md,'vector',self.dlwrf,'type','element');
-			self.P=project3d(md,'vector',self.P,'type','element');
-			self.eAir=project3d(md,'vector',self.eAir,'type','element');
-			self.pAir=project3d(md,'vector',self.pAir,'type','element');
-
-			if ~isnan(self.Dzini)
-				self.Dzini=project3d(md,'vector',self.Dzini,'type','element');
-			end
-			if ~isnan(self.Dini)
-				self.Dini=project3d(md,'vector',self.Dini,'type','element');
-			end
-			if ~isnan(self.Reini)
-				self.Reini=project3d(md,'vector',self.Reini,'type','element');
-			end
-			if ~isnan(self.Gdnini)
-				self.Gdnini=project3d(md,'vector',self.Gdnini,'type','element');
-			end
-			if ~isnan(self.Gspini)
-				self.Gspini=project3d(md,'vector',self.Gspini,'type','element');
-			end
-			if ~isnan(self.ECini)
-				self.ECini=project3d(md,'vector',self.ECini,'type','element');
-			end
-			if ~isnan(self.Wini)
-				self.Wini=project3d(md,'vector',self.Wini,'type','element');
-			end
-			if ~isnan(self.Aini)
-				self.Aini=project3d(md,'vector',self.Aini,'type','element');
-			end
-			if ~isnan(self.Adiffini)
-				self.Adiffini=project3d(md,'vector',self.Adiffini,'type','element');
-			end
-			if ~isnan(self.Tini)
-				self.Tini=project3d(md,'vector',self.Tini,'type','element');
-			end
-
-			if ~isnan(self.dswdiffrf)
-				self.dswdiffrf=project3d(md,'vector',self.dswdiffrf,'type','element');
-			end
-			if ~isnan(self.szaValue)
-				self.szaValue=project3d(md,'vector',self.szaValue,'type','element');
-			end
-			if ~isnan(self.cotValue)
-				self.cotValue=project3d(md,'vector',self.cotValue,'type','element');
-			end
-			if ~isnan(self.ccsnowValue)
-				self.ccsnowValue=project3d(md,'vector',self.ccsnowValue,'type','element');
-			end
-			if ~isnan(self.cciceValue)
-				self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element');
-			end
-			if ~isnan(self.aValue)
-				self.aValue=project3d(md,'vector',self.aValue,'type','element');
-			end
-			if ~isnan(self.teValue)
-				self.teValue=project3d(md,'vector',self.teValue,'type','element');
-			end
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance','SmbAccumulatedMassBalance'};
-		end % }}}
-		function self = setdefaultparameters(self,mesh,geometry) % {{{
-
-			self.isgraingrowth=1;
-			self.isalbedo=1;
-			self.isshortwave=1;
-			self.isthermal=1;
-			self.isaccumulation=1;
-			self.ismelt=1;
-			self.isdensification=1;
-			self.isturbulentflux=1;
-			self.isconstrainsurfaceT=0;
-			self.isdeltaLWup=0;
-
-			self.aIdx = 1;
-			self.eIdx = 1;
-			self.tcIdx = 1;
-			self.swIdx = 0;
-			self.denIdx = 2;
-			self.dsnowIdx = 1;
-			self.zTop=10*ones(mesh.numberofelements,1);
-			self.dzTop = .05* ones (mesh.numberofelements,1);
-			self.dzMin = self.dzTop/2;
-			self.InitDensityScaling = 1.0;
-			self.ThermoDeltaTScaling = 1/11;
-
-			self.Vmean=10.0*ones(mesh.numberofelements,1);
-
-			self.zMax=250*ones(mesh.numberofelements,1);
-			self.zMin=130*ones(mesh.numberofelements,1);
-			self.zY = 1.025*ones(mesh.numberofelements,1);
-			self.outputFreq = 30;
-
-			%additional albedo parameters
-			self.aSnow = 0.85;
-			self.aIce = 0.48;
-			self.cldFrac = 0.1;
-			self.t0wet = 15;
-			self.t0dry = 30;
-			self.K = 7;
-			self.adThresh = 1023;
-			self.teThresh = 10;
-
-			self.teValue = ones(mesh.numberofelements,1);
-			self.aValue = self.aSnow*ones(mesh.numberofelements,1);
-			self.dulwrfValue = zeros(mesh.numberofelements,1);
-
-			self.dswdiffrf=0.0*ones(mesh.numberofelements,1);
-			self.szaValue=0.0*ones(mesh.numberofelements,1);
-			self.cotValue=0.0*ones(mesh.numberofelements,1);
-			self.ccsnowValue=0.0*ones(mesh.numberofelements,1);
-			self.cciceValue=0.0*ones(mesh.numberofelements,1);
-
-			self.Dzini=0.05*ones(mesh.numberofelements,2);
-			self.Dini=910.0*ones(mesh.numberofelements,2);
-			self.Reini=2.5*ones(mesh.numberofelements,2);
-			self.Gdnini=0.0*ones(mesh.numberofelements,2);
-			self.Gspini=0.0*ones(mesh.numberofelements,2);
-			self.ECini=0.0*ones(mesh.numberofelements,1);
-			self.Wini=0.0*ones(mesh.numberofelements,2);
-			self.Aini=self.aSnow*ones(mesh.numberofelements,2);
-			self.Adiffini=ones(mesh.numberofelements,2);
-			self.Tini=273.15*ones(mesh.numberofelements,2);
-			% 		/!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh).
-			% 		If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp
-			self.Sizeini=2*ones(mesh.numberofelements,1);
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','smb.isgraingrowth','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isalbedo','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isshortwave','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isthermal','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isaccumulation','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.ismelt','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isdensification','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isturbulentflux','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isconstrainsurfaceT','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isdeltaLWup','values',[0 1]);
-
-			md = checkfield(md,'fieldname','smb.Ta','timeseries',1,'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
-			md = checkfield(md,'fieldname','smb.V','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<',45,'size',size(self.Ta)); %max 500 km/h
-			md = checkfield(md,'fieldname','smb.dswrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1400,'size',size(self.Ta));
-			md = checkfield(md,'fieldname','smb.dswdiffrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1400);
-			md = checkfield(md,'fieldname','smb.dlwrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'size',size(self.Ta));
-			md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',200,'size',size(self.Ta));
-			md = checkfield(md,'fieldname','smb.eAir','timeseries',1,'NaN',1,'Inf',1,'size',size(self.Ta));
-
-			md = checkfield(md,'fieldname','smb.Tmean','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
-			md = checkfield(md,'fieldname','smb.C','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','smb.Vmean','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0);
-			md = checkfield(md,'fieldname','smb.Tz','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0,'<=',5000);
-			md = checkfield(md,'fieldname','smb.Vz','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0,'<=',5000);
-
-			md = checkfield(md,'fieldname','smb.teValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
-			md = checkfield(md,'fieldname','smb.dulwrfValue','timeseries',1,'NaN',1,'Inf',1);
-
-			md = checkfield(md,'fieldname','smb.aIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4]);
-			md = checkfield(md,'fieldname','smb.eIdx','NaN',1,'Inf',1,'values',[0,1,2]);
-			md = checkfield(md,'fieldname','smb.tcIdx','NaN',1,'Inf',1,'values',[1,2]);
-			md = checkfield(md,'fieldname','smb.swIdx','NaN',1,'Inf',1,'values',[0,1]);
-			md = checkfield(md,'fieldname','smb.denIdx','NaN',1,'Inf',1,'values',[1,2,3,4,5,6,7]);
-			md = checkfield(md,'fieldname','smb.dsnowIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4]);
-
-			md = checkfield(md,'fieldname','smb.zTop','NaN',1,'Inf',1,'>=',0);
-			md = checkfield(md,'fieldname','smb.dzTop','NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','smb.dzMin','NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','smb.zY','NaN',1,'Inf',1,'>=',1);
-			md = checkfield(md,'fieldname','smb.outputFreq','NaN',1,'Inf',1,'>',0,'<',10*365); %10 years max
-			md = checkfield(md,'fieldname','smb.InitDensityScaling','NaN',1,'Inf',1,'>=',0,'<=',1);
-			md = checkfield(md,'fieldname','smb.ThermoDeltaTScaling','NaN',1,'Inf',1,'>=',0,'<=',1);
-			md = checkfield(md,'fieldname','smb.adThresh','NaN',1,'Inf',1,'>=',0);
-			md = checkfield(md,'fieldname','smb.teThresh','NaN',1,'Inf',1,'>=',0);
-
-			md = checkfield(md,'fieldname','smb.aValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
-			switch self.aIdx,
-				case {1 2}
-					md = checkfield(md,'fieldname','smb.aSnow','NaN',1,'Inf',1,'>=',.64,'<=',.89);
-					md = checkfield(md,'fieldname','smb.aIce','NaN',1,'Inf',1,'>=',.27,'<=',.58);
-					if self.aIdx==1
-						md = checkfield(md,'fieldname','smb.szaValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',90);
-						md = checkfield(md,'fieldname','smb.cotValue','timeseries',1,'NaN',1,'Inf',1,'>=',0);
-						md = checkfield(md,'fieldname','smb.ccsnowValue','timeseries',1,'NaN',1,'Inf',1,'>=',0);
-						md = checkfield(md,'fieldname','smb.cciceValue','timeseries',1,'NaN',1,'Inf',1,'>=',0);
-					end
-				case 3
-					md = checkfield(md,'fieldname','smb.cldFrac','NaN',1,'Inf',1,'>=',0,'<=',1);
-				case 4
-					md = checkfield(md,'fieldname','smb.t0wet','NaN',1,'Inf',1,'>=',15,'<=',21.9);
-					md = checkfield(md,'fieldname','smb.t0dry','NaN',1,'Inf',1,'>=',30,'<=',30);
-					md = checkfield(md,'fieldname','smb.K','NaN',1,'Inf',1,'>=',7,'<=',7);
-			end
-
-			%check zTop is < local thickness:
-			he=sum(md.geometry.thickness(md.mesh.elements),2)/size(md.mesh.elements,2);
-			if any(he<self.zTop),
-				error('SMBgemb consistency check error: zTop should be smaller than local ice thickness');
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',8,'format','Integer');
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isalbedo','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isshortwave','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isthermal','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isaccumulation','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismelt','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdensification','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isturbulentflux','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isconstrainsurfaceT','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdeltaLWup','format','Boolean');
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dswrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dswdiffrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dlwrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','P','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','eAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','pAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tmean','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','C','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Vmean','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tz','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Vz','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','zTop','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dzTop','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dzMin','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','zY','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMax','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMin','format','DoubleMat','mattype',2);
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIdx','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','eIdx','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','tcIdx','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','swIdx','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','denIdx','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dsnowIdx','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','InitDensityScaling','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ThermoDeltaTScaling','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','outputFreq','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aSnow','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIce','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','cldFrac','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','t0wet','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','t0dry','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','K','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','adThresh','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','teThresh','format','Double');
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','teValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dulwrfValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ccsnowValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','cciceValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-
-			%snow properties init
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Dzini','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Dini','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Reini','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Gdnini','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Gspini','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ECini','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Wini','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Aini','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Adiffini','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tini','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Sizeini','format','IntMat','mattype',2);
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
-			%figure out dt from forcings:
-			if (any(md.smb.P(end,:) - md.smb.Ta(end,:) ~= 0) | ...
-					any(md.smb.V(end,:) - md.smb.Ta(end,:) ~= 0) | ...
-					any(md.smb.dswrf(end,:) - md.smb.Ta(end,:) ~= 0) | ...
-					any(md.smb.dlwrf(end,:) - md.smb.Ta(end,:) ~= 0) | ...
-					any(md.smb.eAir(end,:) - md.smb.Ta(end,:) ~= 0) | ...
-					any(md.smb.pAir(end,:) - md.smb.Ta(end,:) ~= 0))
-				error('All GEMB forcings (Ta, P, V, dswrf, dlwrf, eAir, pAir) must have the same time steps in the final row!');
-			end
-			if size(md.smb.teValue,2)>1 & any(md.smb.teValue(end,:) - md.smb.Ta(end,:) ~= 0)
-				error('If GEMB forcing teValue is transient, it must have the same time steps as input Ta in the final row!');
-			end
-			if size(md.smb.dswdiffrf,2)>1 & any(md.smb.dswdiffrf(end,:) - md.smb.Ta(end,:) ~= 0)
-				error('If GEMB forcing dswdiffrf is transient, it must have the same time steps as input Ta in the final row!');
-			end
-			if size(md.smb.dulwrfValue,2)>1 & any(md.smb.dulwrfValue(end,:) - md.smb.Ta(end,:) ~= 0)
-				error('If GEMB forcing dulwrfValue is transient, it must have the same time steps as input Ta in the final row!');
-			end
-			if size(md.smb.aValue,2)>1 & any(md.smb.aValue(end,:) - md.smb.Ta(end,:) ~= 0)
-				error('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!');
-			end
-			if size(md.smb.szaValue,2)>1 & any(md.smb.szaValue(end,:) - md.smb.Ta(end,:) ~= 0)
-				error('If GEMB forcing szaValue is transient, it must have the same time steps as input Ta in the final row!');
-			end
-			if size(md.smb.cotValue,2)>1 & any(md.smb.cotValue(end,:) - md.smb.Ta(end,:) ~= 0)
-				error('If GEMB forcing cotValue is transient, it must have the same time steps as input Ta in the final row!');
-			end
-			if size(md.smb.ccsnowValue,2)>1 & any(md.smb.ccsnowValue(end,:) - md.smb.Ta(end,:) ~= 0)
-				error('If GEMB forcing ccsnowValue is transient, it must have the same time steps as input Ta in the final row!');
-			end
-			if size(md.smb.cciceValue,2)>1 & any(md.smb.cciceValue(end,:) - md.smb.Ta(end,:) ~= 0)
-				error('If GEMB forcing cciceValue is transient, it must have the same time steps as input Ta in the final row!');
-			end
-			time=self.Ta(end,:); %assume all forcings are on the same time step
-			dtime=diff(time,1);
-			dt=min(dtime);
-
-			WriteData(fid,prefix,'data',dt,'name','md.smb.dt','format','Double','scale',yts);
-
-			% Check if smb_dt goes evenly into transient core time step
-			if (mod(md.timestepping.time_step,dt) >= 1e-10)
-				error('smb_dt/dt = %f. The number of SMB time steps in one transient core time step has to be an an integer',md.timestepping.time_step/dt);
-			end
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBgemb.py
===================================================================
--- /issm/trunk/src/m/classes/SMBgemb.py	(revision 28275)
+++ 	(revision )
@@ -1,583 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class SMBgemb(object):
-    """SMBGEMB class definition
-
-    Usage:
-        SMB = SMBgemb()
-    """
-
-    def __init__(self, *args):  # {{{
-        """Each one of these properties is a transient forcing to the GEMB 
-        model, loaded from meteorological data derived from an automatic 
-        weather stations (AWS). Each property is therefore a matrix, of size 
-        (numberofvertices x number of time steps.
-        """
-
-        #solution choices
-        self.isgraingrowth       = 0
-        self.isalbedo            = 0
-        self.isshortwave         = 0
-        self.isthermal           = 0
-        self.isaccumulation      = 0
-        self.ismelt              = 0
-        self.isdensification     = 0
-        self.isturbulentflux     = 0
-        self.isconstrainsurfaceT = 0
-        self.isdeltaLWup         = 0
-
-        # Inputs
-        self.Ta                     = np.nan    # 2 m air temperature, in Kelvin
-        self.V                      = np.nan    # wind speed (m/s-1)
-        self.dswrf                  = np.nan    # downward shortwave radiation flux [W/m^2]
-        self.dlwrf                  = np.nan    # downward longwave radiation flux [W/m^2]
-        self.P                      = np.nan    # precipitation [mm w.e. / m^2]
-        self.eAir                   = np.nan    # screen level vapor pressure [Pa]
-        self.pAir                   = np.nan    # surface pressure [Pa]
-
-        self.Tmean                  = np.nan    # mean annual temperature [K]
-        self.Vmean                  = np.nan    # mean annual wind velocity [m s-1]
-        self.C                      = np.nan    # mean annual snow accumulation [kg m-2 yr-1]
-        self.Tz                     = np.nan    # height above ground at which temperature (T) was sampled [m]
-        self.Vz                     = np.nan    # height above ground at which wind (V) was sampled [m]
-
-        # Optional inputs
-        self.aValue                 = np.nan    # Albedo forcing at every element. Used only if aIdx == 0, or density exceeds adThresh.
-        self.teValue                = np.nan    # Outward longwave radiation thermal emissivity forcing at every element (default in code is 1), Used only if eIdx== 0, or effective grain radius exceeds teThresh
-        dulwrfValue                 = np.nan    #Delta with which to perturn the long wave radiation upwards. Use if isdeltaLWup is true
-
-        # Initialization of snow properties
-        self.Dzini                  = np.nan    # cell depth (m)
-        self.Dini                   = np.nan    # snow density (kg m-3)
-        self.Reini                  = np.nan    # effective grain size (mm)
-        self.Gdnini                 = np.nan    # grain dendricity (0-1)
-        self.Gspini                 = np.nan    # grain sphericity (0-1)
-        self.ECini                  = np.nan    # evaporation/condensation (kg m-2)
-        self.Wini                   = np.nan    # Water content (kg m-2)
-        self.Aini                   = np.nan    # albedo (0-1)
-        self.Adiffini               = np.nan    # albedo, diffusive radiation (0-1)
-        self.Tini                   = np.nan    # snow temperature (K)
-        self.Sizeini                = np.nan    # Number of layers
-
-        # Settings
-        self.aIdx                   = np.nan    # method for calculating albedo and subsurface absorption (default is 1)
-        # 0: direct input from aValue parameter, no use of adThresh
-        # 1: effective grain radius [Gardner & Sharp, 2009]
-        # 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
-        # 3: density and cloud amount [Greuell & Konzelmann, 1994]
-        # 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
-        
-        self.eIdx                   = np.nan    #method for calculating emissivity (default is 1)
-        # 0: direct input from teValue parameter, no use of teThresh
-        # 1: default value of 1, in areas with grain radius below teThresh
-        # 2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface
-
-        self.tcIdx                   = np.nan    #method for calculating thermal conductivity (default is 1)
-        # 1: after Sturm et al, 1997
-        # 2: after Calonne et al., 2011 
-
-        self.swIdx                  = np.nan    # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 0, if swIdx=1 and aIdx=2, function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)) 
-
-        self.denIdx                 = np.nan    # densification model to use (default is 2):
-        # 1 = emperical model of Herron and Langway (1980)
-        # 2 = semi-emperical model of Anthern et al. (2010)
-        # 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
-        # 4 = DO NOT USE: emperical model of Li and Zwally (2004)
-        # 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
-        # 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
-        # 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
-
-        self.dsnowIdx               = np.nan    # model for fresh snow accumulation density (default is 1):
-        # 0 = Original GEMB value, 150 kg/m^3
-        # 1 = Antarctica value of fresh snow density, 350 kg/m^3
-        # 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)
-        # 3 = Antarctica model of Kaspers et al. (2004)
-        # 4 = Greenland model of Kuipers Munneke et al. (2015)
-
-        self.zTop                   = np.nan    # depth over which grid length is constant at the top of the snopack (default 10) [m]
-        self.dzTop                  = np.nan    # initial top vertical grid spacing (default .05) [m]
-        self.dzMin                  = np.nan    # initial min vertical allowable grid spacing (default dzMin/2) [m]
-
-        self.zY                     = np.nan    # strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]
-        self.zMax                   = np.nan    # initial max model depth (default is min(thickness, 250)) [m]
-        self.zMin                   = np.nan    # initial min model depth (default is min(thickness, 130)) [m]
-        self.outputFreq             = np.nan    # output frequency in days (default is monthly, 30)
-
-        # Specific albedo parameters
-        # Method 1
-        self.dswdiffrf              = np.nan    # downward diffusive shortwave radiation flux [W/m^2]
-        self.szaValue               = np.nan    # Solar Zenith Angle [degree]
-        self.cotValue               = np.nan    # Cloud Optical Thickness
-        self.ccsnowValue            = np.nan    # concentration of light absorbing carbon for snow [ppm1]
-        self.cciceValue             = np.nan    # concentration of light absorbing carbon for ice [ppm1]
-        # Method 1 and 2
-        self.aSnow                  = np.nan    # new snow albedo (0.64 - 0.89)
-        self.aIce                   = np.nan    # range 0.27-0.58 for old snow
-        #Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
-        self.cldFrac                = np.nan    # average cloud amount
-        #Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
-        self.t0wet                  = np.nan    # time scale for wet snow (15-21.9)
-        self.t0dry                  = np.nan    # warm snow timescale (30)
-        self.K                      = np.nan    # time scale temperature coef. (7)
-        self.adThresh               = np.nan    # Apply aIdx method to all areas with densities below this value,
-        # or else apply direct input value from aValue, allowing albedo to be altered.
-        # Default value is rho water (1023 kg m-3).
-        teThresh                    = np.nan    #Apply eIdx method to all areas with grain radii above this value (mm),
-        #or else apply direct input value from teValue, allowing emissivity to be altered.
-        #Default value is a effective grain radius of 10 mm.
-
-        # Densities
-        self.InitDensityScaling     = np.nan    # initial scaling factor multiplying the density of ice, which describes the density of the snowpack.
-
-        # Thermal
-        self.ThermoDeltaTScaling    = np.nan    # scaling factor to multiply the thermal diffusion timestep (delta t)
-
-        self.steps_per_step         = 1
-        self.averaging              = 0
-        self.requested_outputs      = []
-
-        #Several fields are missing from the standard GEMB model, which are 
-        #captured intrinsically by ISSM.
-        #dateN: that's the last row of the above fields.
-        #dt:    included in dateN. Not an input.
-        #elev:  this is taken from the ISSM surface itself.
-
-        nargin = len(args)
-        if nargin == 2:
-            mesh = args[0]
-            geometry = args[1]
-            self.setdefaultparameters(mesh, geometry)
-        else:
-            raise Exception('constructor not supported: need mesh and geometry to set defaults')
-        # }}}
-
-    def __repr__(self):  # {{{
-        #string = "   surface forcings parameters:"
-        #string = "#s\n#s"%(string, fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]'))
-        #string = "#s\n#s"%(string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        s = '   surface forcings for SMB GEMB model :\n'
-        s += '{}\n'.format(fielddisplay(self, 'isgraingrowth', 'run grain growth module (default true)'))
-        s += '{}\n'.format(fielddisplay(self, 'isalbedo', 'run albedo module (default true)'))
-        s += '{}\n'.format(fielddisplay(self, 'isshortwave', 'run short wave module (default true)'))
-        s += '{}\n'.format(fielddisplay(self, 'isthermal', 'run thermal module (default true)'))
-        s += '{}\n'.format(fielddisplay(self, 'isaccumulation', 'run accumulation module (default true)'))
-        s += '{}\n'.format(fielddisplay(self, 'ismelt', 'run melting  module (default true)'))
-        s += '{}\n'.format(fielddisplay(self, 'isdensification', 'run densification module (default true)'))
-        s += '{}\n'.format(fielddisplay(self, 'isturbulentflux', 'run turbulant heat fluxes module (default true)'))
-        s += '{}\n'.format(fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)'))
-        s += '{}\n'.format(fielddisplay(self, 'isdeltaLWup', 'set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)'))
-        s += '{}\n'.format(fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin'))
-        s += '{}\n'.format(fielddisplay(self, 'V', 'wind speed (m s-1)'))
-        s += '{}\n'.format(fielddisplay(self, 'dswrf', 'downward shortwave radiation flux [W/m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'dswdiffrf', 'downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'dlwrf', 'downward longwave radiation flux [W/m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'P', 'precipitation [mm w.e. / m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'eAir', 'screen level vapor pressure [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'pAir', 'surface pressure [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'Tmean', 'mean annual temperature [K]'))
-        s += '{}\n'.format(fielddisplay(self, 'C', 'mean annual snow accumulation [kg m-2 yr-1]'))
-        s += '{}\n'.format(fielddisplay(self, 'Vmean', 'mean annual temperature [m s-1] (default 10 m/s)'))
-        s += '{}\n'.format(fielddisplay(self, 'Tz', 'height above ground at which temperature (T) was sampled [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'Vz', 'height above ground at which wind (V) eas sampled [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'zTop', 'depth over which grid length is constant at the top of the snopack (default 10) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'dzTop', 'initial top vertical grid spacing (default .05) [m] '))
-        s += '{}\n'.format(fielddisplay(self, 'dzMin', 'initial min vertical allowable grid spacing (default dzMin/2) [m] '))
-        s += '{}\n'.format(fielddisplay(self, 'zMax', 'initial max model depth (default is min(thickness, 500)) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'zMin', 'initial min model depth (default is min(thickness, 30)) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'zY', 'strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]'))
-        s += '{}\n'.format(fielddisplay(self, 'InitDensityScaling', ['initial scaling factor multiplying the density of ice', 'which describes the density of the snowpack.']))
-        s += '{}\n'.format(fielddisplay(self, 'ThermoDeltaTScaling', 'scaling factor to multiply the thermal diffusion timestep (delta t)'))
-        s += '{}\n'.format(fielddisplay(self, 'outputFreq', 'output frequency in days (default is monthly, 30)'))
-        s += '{}\n'.format(fielddisplay(self, 'adThresh', 'Apply aIdx method to all areas with densities below this value, ', 'or else apply direct input value from aValue, allowing albedo to be altered.'))
-        s += '{}\n'.format(fielddisplay(self, 'aIdx', ['method for calculating albedo and subsurface absorption (default is 1)',
-            '0: direct input from aValue parameter',
-            '1: effective grain radius [Gardner & Sharp, 2009]',
-            '2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',
-            '3: density and cloud amount [Greuell & Konzelmann, 1994]',
-            '4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
-
-        s += '{}\n'.format(fielddisplay(self, 'dulwrfValue', 'Specified bias to be applied to the outward long wave radiation every element (W/m-2, +upward)'))
-        s += '{}\n'.format(fielddisplay(self, 'teValue', 'Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'teThresh', ['Apply eIdx method to all areas with effective grain radius above this value (mm),', 'or else apply direct input value from teValue, allowing emissivity to be altered.']))
-        s += '{}\n'.format(fielddisplay(self, 'eIdx', ['method for calculating emissivity (default is 1)',
-            '0: direct input from teValue parameter, no use of teThresh',
-            '1: default value of 1, in areas with grain radius below teThresh',
-            '2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface']))
-        s += '{}\n'.format(fielddisplay(self, 'tcIdx', ['method for calculating thermal conductivity (default is 1)',
-            '1: after Sturm et al, 1997',
-            '2: after Calonne et al., 2011']))
-
-        # Snow properties init
-        s += '{}\n'.format(fielddisplay(self, 'Dzini', 'Initial cell depth when restart [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'Dini', 'Initial snow density when restart [kg m-3]'))
-        s += '{}\n'.format(fielddisplay(self, 'Reini', 'Initial grain size when restart [mm]'))
-        s += '{}\n'.format(fielddisplay(self, 'Gdnini', 'Initial grain dricity when restart [-]'))
-        s += '{}\n'.format(fielddisplay(self, 'Gspini', 'Initial grain sphericity when restart [-]'))
-        s += '{}\n'.format(fielddisplay(self, 'ECini', 'Initial evaporation/condensation when restart [kg m-2]'))
-        s += '{}\n'.format(fielddisplay(self, 'Wini', 'Initial snow water content when restart [kg m-2]'))
-        s += '{}\n'.format(fielddisplay(self, 'Aini', 'Initial albedo when restart [-]'))
-        s += '{}\n'.format(fielddisplay(self, 'Adiffini', 'Initial diffusive radiation albedo when restart (default to 1) [-]'))
-        s += '{}\n'.format(fielddisplay(self, 'Tini', 'Initial snow temperature when restart [K]'))
-        s += '{}\n'.format(fielddisplay(self, 'Sizeini', 'Initial number of layers when restart [-]'))
-
-        # Additional albedo parameters
-        s += '{}\n'.format(fielddisplay(self, 'aValue', 'Albedo forcing at every element'))
-        if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
-            s += '{}\n'.format(fielddisplay(self, 'aSnow', 'new snow albedo (0.64 - 0.89)'))
-            s += '{}\n'.format(fielddisplay(self, 'aIce', 'albedo of ice (0.27-0.58)'))
-            if self.aIdx == 1:
-                s += '{}\n'.format(fielddisplay(self,'szaValue','Solar Zenith Angle [degree]'))
-                s += '{}\n'.format(fielddisplay(self,'cotValue','Cloud Optical Thickness'))
-                s += '{}\n'.format(fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]'))
-                s += '{}\n'.format(fielddisplay(self,'cciceValue','concentration of light absorbing carbon for ice [ppm1]'))
-        elif self.aIdx == 3:
-            s += '{}\n'.format(fielddisplay(self, 'cldFrac', 'average cloud amount'))
-        elif self.aIdx == 4:
-            s += '{}\n'.format(fielddisplay(self, 't0wet', 'time scale for wet snow (15-21.9) [d]'))
-            s += '{}\n'.format(fielddisplay(self, 't0dry', 'warm snow timescale (30) [d]'))
-            s += '{}\n'.format(fielddisplay(self, 'K', 'time scale temperature coef. (7) [d]'))
-
-        s += '{}\n'.format(fielddisplay(self, 'swIdx', 'apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 0, if swIdx=1 and aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]'))
-        s += '{}\n'.format(fielddisplay(self, 'denIdx', ['densification model to use (default is 2):',
-            '1 = emperical model of Herron and Langway (1980)',
-            '2 = semi-emperical model of Anthern et al. (2010)',
-            '3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)',
-            '4 = DO NOT USE: emperical model of Li and Zwally (2004)',
-            '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',
-            '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',
-            '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)']))
-        s += '{}\n'.format(fielddisplay(self, 'dsnowIdx', ['model for fresh snow accumulation density (default is 1):',
-            '0 = Original GEMB value, 150 kg/m^3',
-            '1 = Antarctica value of fresh snow density, 350 kg/m^3',
-            '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',
-            '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',
-            '4 = Greenland model of Kuipers Munneke et al. (2015)']))
-
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.Ta = project3d(md, 'vector', self.Ta, 'type', 'element')
-        self.V = project3d(md, 'vector', self.V, 'type', 'element')
-        self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'element')
-        self.dlwrf = project3d(md, 'vector', self.dlwrf, 'type', 'element')
-        self.P = project3d(md, 'vector', self.P, 'type', 'element')
-        self.eAir = project3d(md, 'vector', self.eAir, 'type', 'element')
-        self.pAir = project3d(md, 'vector', self.pAir, 'type', 'element')
-
-        if not np.isnan(self.Dzini):
-            self.self.Dzini=project3d(md,'vector',self.self.Dzini,'type','element');
-        if not np.isnan(self.Dini):
-            self.self.Dini=project3d(md,'vector',self.Dini,'type','element');
-        if not np.isnan(self.Reini):
-            self.self.Reini=project3d(md,'vector',self.Reini,'type','element');
-        if not np.isnan(self.Gdnini):
-            self.Gdnini=project3d(md,'vector',self.Gdnini,'type','element');
-        if not np.isnan(self.Gspini):
-            self.Gspini=project3d(md,'vector',self.Gspini,'type','element');
-        if not np.isnan(self.ECini):
-            self.ECini=project3d(md,'vector',self.ECini,'type','element');
-        if not np.isnan(self.Wini):
-            self.Wini=project3d(md,'vector',self.Wini,'type','element');
-        if not np.isnan(self.Aini):
-            self.Aini=project3d(md,'vector',self.Aini,'type','element');
-        if not np.isnan(self.Adiffini):
-            self.Adiffini=project3d(md,'vector',self.Adiffini,'type','element');
-        if not np.isnan(self.Tini):
-            self.Tini=project3d(md,'vector',self.Tini,'type','element');
-
-        if not np.isnan(self.dswdiffrf):
-            self.dswdiffrf=project3d(md,'vector',self.dswdiffrf,'type','element');
-        if not np.isnan(self.szaValue):
-            self.szaValue=project3d(md,'vector',self.szaValue,'type','element');
-        if not np.isnan(self.cotValue):
-            self.cotValue=project3d(md,'vector',self.cotValue,'type','element');
-        if not np.isnan(self.ccsnowValue):
-            self.ccsnowValue=project3d(md,'vector',self.ccsnowValue,'type','element');
-        if not np.isnan(self.cciceValue):
-            self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element');
-
-        if not np.isnan(self.aValue):
-            self.aValue = project3d(md, 'vector', self.aValue, 'type', 'element')
-        if not np.isnan(self.teValue):
-            self.teValue = project3d(md, 'vector', self.teValue, 'type', 'element')
-
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance','SmbAccumulatedMassBalance']
-    # }}}
-
-    def setdefaultparameters(self, mesh, geometry):  # {{{
-        self.isgraingrowth = 1
-        self.isalbedo = 1
-        self.isshortwave = 1
-        self.isthermal = 1
-        self.isaccumulation = 1
-        self.ismelt = 1
-        self.isdensification = 1
-        self.isturbulentflux = 1
-        self.isconstrainsurfaceT = 0
-        self.isdeltaLWup = 0
-
-        self.aIdx = 1
-        self.eIdx = 1
-        self.tcIdx = 1
-        self.swIdx = 0 
-        self.denIdx = 2
-        self.dsnowIdx = 1
-        self.zTop = 10 * np.ones((mesh.numberofelements,))
-        self.dzTop = 0.05 * np.ones((mesh.numberofelements,))
-        self.dzMin = self.dzTop / 2
-        self.InitDensityScaling = 1.0
-        self.ThermoDeltaTScaling = 1 / 11.0
-
-        self.Vmean = 10 * np.ones((mesh.numberofelements,))
-
-        self.zMax = 250 * np.ones((mesh.numberofelements,))
-        self.zMin = 130 * np.ones((mesh.numberofelements,))
-        self.zY = 1.025 * np.ones((mesh.numberofelements,))
-        self.outputFreq = 30
-
-        # Additional albedo parameters
-        self.aSnow = 0.85
-        self.aIce = 0.48
-        self.cldFrac = 0.1
-        self.t0wet = 15
-        self.t0dry = 30
-        self.K = 7
-        self.adThresh = 1023
-        self.teThresh = 10
-
-        self.teValue = np.ones((mesh.numberofelements,))
-        self.aValue = self.aSnow * np.ones(mesh.numberofelements,)
-        self.dulwrfValue = np.zeros((mesh.numberofelements,))
-
-        self.dswdiffrf = 0.0 * np.ones(mesh.numberofelements,)
-        self.szaValue = 0.0 * np.ones(mesh.numberofelements,)
-        self.cotValue = 0.0 * np.ones(mesh.numberofelements,)
-        self.ccsnowValue = 0.0 * np.ones(mesh.numberofelements,)
-        self.cciceValue = 0.0 * np.ones(mesh.numberofelements,)
-
-        self.Dzini = 0.05 * np.ones((mesh.numberofelements, 2))
-        self.Dini = 910.0 * np.ones((mesh.numberofelements, 2))
-        self.Reini = 2.5 * np.ones((mesh.numberofelements, 2))
-        self.Gdnini = 0.0 * np.ones((mesh.numberofelements, 2))
-        self.Gspini = 0.0 * np.ones((mesh.numberofelements, 2))
-        self.ECini = 0.0 * np.ones((mesh.numberofelements,))
-        self.Wini = 0.0 * np.ones((mesh.numberofelements, 2))
-        self.Aini = 0.0 * np.ones((mesh.numberofelements, 2))
-        self.Adiffini = np.ones((mesh.numberofelements, 2))
-        self.Tini = 273.15 * np.ones((mesh.numberofelements, 2))
-        #       /!\ Default value of Tini must be equal to Tmean but don't know 
-        #           Tmean yet (computed when atmospheric forcings are 
-        #           interpolated on mesh).
-        #           If initialization without restart, this value will be 
-        #           overwritten when snow parameters are retrieved in 
-        #           Element.cpp
-        self.Sizeini = 2 * np.ones((mesh.numberofelements,))
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):    # {{{
-
-        md = checkfield(md, 'fieldname', 'smb.isgraingrowth', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.isalbedo', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.isshortwave', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.isthermal', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.isaccumulation', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.ismelt', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.isdensification', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.isturbulentflux', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.isdeltaLWup', 'values',[0, 1])
-        md = checkfield(md, 'fieldname', 'smb.isconstrainsurfaceT', 'values', [0, 1])
-
-        md = checkfield(md, 'fieldname', 'smb.Ta', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>', 273 - 100, '<', 273 + 100)  #-100/100 celsius min/max value
-        md = checkfield(md, 'fieldname', 'smb.V', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '<', 45, 'size', np.shape(self.Ta))  #max 500 km/h
-        md = checkfield(md, 'fieldname', 'smb.dswrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1400, 'size', np.shape(self.Ta))
-        md = checkfield(md, 'fieldname', 'smb.dswdiffrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1400)
-        md = checkfield(md, 'fieldname', 'smb.dlwrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, 'size', np.shape(self.Ta))
-        md = checkfield(md, 'fieldname', 'smb.P', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 200, 'size', np.shape(self.Ta))
-        md = checkfield(md, 'fieldname', 'smb.eAir', 'timeseries', 1, 'NaN', 1, 'Inf', 1, 'size', np.shape(self.Ta))
-
-        md = checkfield(md, 'fieldname', 'smb.Tmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '>', 273 - 100, '<', 273 + 100)  #-100/100 celsius min/max value
-        md = checkfield(md, 'fieldname', 'smb.C', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> ', 0)
-        md = checkfield(md, 'fieldname', 'smb.Vmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0)
-        md = checkfield(md, 'fieldname', 'smb.Tz', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 5000)
-        md = checkfield(md, 'fieldname', 'smb.Vz', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 5000)
-
-        md = checkfield(md, 'fieldname', 'smb.teValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
-        md = checkfield(md, 'fieldname', 'smb.dulwrfValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-
-        md = checkfield(md, 'fieldname', 'smb.aIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2, 3, 4])
-        md = checkfield(md, 'fieldname', 'smb.eIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'smb.tcIdx', 'NaN', 1, 'Inf', 1, 'values', [1, 2])
-        md = checkfield(md, 'fieldname', 'smb.swIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.denIdx', 'NaN', 1, 'Inf', 1, 'values', [1, 2, 3, 4, 5, 6, 7])
-        md = checkfield(md, 'fieldname', 'smb.dsnowIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2, 3, 4])
-
-        md = checkfield(md, 'fieldname', 'smb.zTop', 'NaN', 1, 'Inf', 1, '> = ', 0)
-        md = checkfield(md, 'fieldname', 'smb.dzTop', 'NaN', 1, 'Inf', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'smb.dzMin', 'NaN', 1, 'Inf', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'smb.zY', 'NaN', 1, 'Inf', 1, '> = ', 1)
-        md = checkfield(md, 'fieldname', 'smb.outputFreq', 'NaN', 1, 'Inf', 1, '>', 0, '<', 10 * 365)  #10 years max
-        md = checkfield(md, 'fieldname', 'smb.InitDensityScaling', 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1)
-        md = checkfield(md, 'fieldname', 'smb.ThermoDeltaTScaling', 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1)
-        md = checkfield(md, 'fieldname', 'smb.adThresh', 'NaN', 1, 'Inf', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'smb.teThresh', 'NaN', 1, 'Inf',1,'>=',0)
-        
-        md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
-        if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
-            md = checkfield(md, 'fieldname', 'smb.aSnow', 'NaN', 1, 'Inf', 1, '> = ', .64, '< = ', .89)
-            md = checkfield(md, 'fieldname', 'smb.aIce', 'NaN', 1, 'Inf', 1, '> = ', .27, '< = ', .58)
-            if self.aIdx == 1:
-                md = checkfield(md,'fieldname','smb.szaValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',90)
-                md = checkfield(md,'fieldname','smb.cotValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
-                md = checkfield(md,'fieldname','smb.ccsnowValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
-                md = checkfield(md,'fieldname','smb.cciceValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
-        elif self.aIdx == 3:
-            md = checkfield(md, 'fieldname', 'smb.cldFrac', 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1)
-        elif self.aIdx == 4:
-            md = checkfield(md, 'fieldname', 'smb.t0wet', 'NaN', 1, 'Inf', 1, '> = ', 15, '< = ', 21.9)
-            md = checkfield(md, 'fieldname', 'smb.t0dry', 'NaN', 1, 'Inf', 1, '> = ', 30, '< = ', 30)
-            md = checkfield(md, 'fieldname', 'smb.K', 'NaN', 1, 'Inf', 1, '> = ', 7, '< = ', 7)
-
-        # Check zTop is < local thickness
-        he = np.sum(md.geometry.thickness[md.mesh.elements - 1], axis=1) / np.size(md.mesh.elements, 1)
-        if np.any(he < self.zTop):
-            raise IOError('SMBgemb consistency check error: zTop should be smaller than local ice thickness')
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):    # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 8, 'format', 'Integer')
-
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isgraingrowth', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isalbedo', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isshortwave', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isthermal', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isaccumulation', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ismelt', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdensification', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isturbulentflux', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isconstrainsurfaceT', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdeltaLWup','format','Boolean')
-
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Ta', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'V', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dswrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dswdiffrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dlwrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'P', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'eAir', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pAir', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tmean', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'C', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Vmean', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tz', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Vz', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'zTop', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dzTop', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dzMin', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'zY', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'zMax', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'zMin', 'format', 'DoubleMat', 'mattype', 2)
-
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aIdx', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'eIdx', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'tcIdx', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'swIdx', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'denIdx', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dsnowIdx', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'InitDensityScaling', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ThermoDeltaTScaling', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'outputFreq', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aSnow', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aIce', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'cldFrac', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 't0wet', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 't0dry', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'K', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'adThresh', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'teThresh', 'format', 'Double')
-
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'teValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid,prefix,'object',self,'class','smb','fieldname','dulwrfValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-        WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-        WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-        WriteData(fid,prefix,'object',self,'class','smb','fieldname','ccsnowValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-        WriteData(fid,prefix,'object',self,'class','smb','fieldname','cciceValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-
-        #snow properties init
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Dzini', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Dini', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Reini', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Gdnini', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Gspini', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ECini', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Wini', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Aini', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Adiffini', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tini', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Sizeini', 'format', 'IntMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-        # Figure out dt from forcings
-        if (np.any(self.P[-1] - self.Ta[-1] != 0) | np.any(self.V[-1] - self.Ta[-1] != 0) | np.any(self.dswrf[-1] - self.Ta[-1] != 0) | np.any(self.dlwrf[-1] - self.Ta[-1] != 0) | np.any(self.eAir[-1] - self.Ta[-1] != 0) | np.any(self.pAir[-1] - self.Ta[-1] != 0)):
-            raise IOError('All GEMB forcings (Ta, P, V, dswrf, dlwrf, eAir, pAir) must have the same time steps in the final row!')
-
-        if ((np.ndim(self.teValue)>1) & np.any(self.teValue[-1] - self.Ta[-1] != 0)):
-            raise IOError('If GEMB forcing teValue is transient, it must have the same time steps as input Ta in the final row!')
-        if ((np.ndim(self.dswdiffrf)>1) & np.any(self.dswdiffrf[-1] - self.Ta[-1] != 0)):
-            raise IOError('If GEMB forcing dswdiffrf is transient, it must have the same time steps as input Ta in the final row!')
-        if ((np.ndim(self.aValue)>1) & np.any(self.aValue[-1] - self.Ta[-1] != 0)):
-            raise IOError('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!')
-        if ((np.ndim(self.dulwrfValue)>1) & np.any(self.dulwrfValue[-1] - self.Ta[-1] != 0)):
-            raise IOError('If GEMB forcing dulwrfValue is transient, it must have the same time steps as input Ta in the final row!')
-        if ((np.ndim(self.szaValue)>1) & np.any(self.szaValue[-1] - self.Ta[-1] != 0)):
-            raise IOError('If GEMB forcing szaValue is transient, it must have the same time steps as input Ta in the final row!')
-        if ((np.ndim(self.cotValue)>1) & np.any(self.cotValue[-1] - self.Ta[-1] != 0)):
-            raise IOError('If GEMB forcing cotValue is transient, it must have the same time steps as input Ta in the final row!')
-        if ((np.ndim(self.ccsnowValue)>1) & np.any(self.ccsnowValue[-1] - self.Ta[-1] != 0)):
-            raise IOError('If GEMB forcing ccsnowValue is transient, it must have the same time steps as input Ta in the final row!')
-        if ((np.ndim(self.cciceValue)>1) & np.any(self.cciceValue[-1] - self.Ta[-1] != 0)):
-            raise IOError('If GEMB forcing cciceValue is transient, it must have the same time steps as input Ta in the final row!')
-
-        time = self.Ta[-1]  # Assume all forcings are on the same time step
-        dtime = np.diff(time, n=1, axis=0)
-        dt = min(dtime)
-
-        WriteData(fid, prefix, 'data', dt, 'name', 'md.smb.dt', 'format', 'Double', 'scale', yts)
-
-        # Check if smb_dt goes evenly into transient core time step
-        if (md.timestepping.time_step % dt >= 1e-10):
-            raise IOError('smb_dt/dt = {}. The number of SMB time steps in one transient core time step has to be an an integer'.format(md.timestepping.time_step / dt))
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/SMBgradients.m
===================================================================
--- /issm/trunk/src/m/classes/SMBgradients.m	(revision 28275)
+++ 	(revision )
@@ -1,99 +1,0 @@
-%SMBgradients Class definition
-%
-%   Usage:
-%      SMBgradients=SMBgradients();
-
-classdef SMBgradients
-	properties (SetAccess=public)
-		href              = NaN;
-		smbref            = NaN;
-		b_pos             = NaN;
-		b_neg             = NaN;
-		steps_per_step    = 1;
-		averaging         = 0;
-		requested_outputs = {};
-	end
-	methods
-		function self = SMBgradients(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-
-			%Nothing for now
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			%Nothing done for now
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%output default:
-			self.requested_outputs={'default'};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.href','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.smbref','timeseries',1,'NaN',1,'Inf',1);
-				if max(max(abs(md.smb.smbref(1:end-1,:))))<1
-					disp('!!! Warning: SMBgradients now expects smbref to be in m/yr ice eq. instead of mm/yr water eq.');
-				end
-				md = checkfield(md,'fieldname','smb.b_pos','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.b_neg','timeseries',1,'NaN',1,'Inf',1);
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-
-			disp(sprintf('\n   SMB gradients parameters:'));
-			fielddisplay(self,'href','reference elevation from which deviation is used to calculate SMB adjustment in smb gradients method [m]');
-			fielddisplay(self,'smbref','reference smb from which deviation is calculated in smb gradients method [m/yr ice equiv]');
-			fielddisplay(self,'b_pos','slope of hs - smb regression line for accumulation regime required if smb gradients is activated');
-			fielddisplay(self,'b_neg','slope of hs - smb regression line for ablation regime required if smb gradients is activated');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',6,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','href','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts, ...
-				  'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                                %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBgradients.py
===================================================================
--- /issm/trunk/src/m/classes/SMBgradients.py	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-import numpy as np
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class SMBgradients(object):
-    """SMBgradients Class definition
-
-    Usage:
-        SMBgradients = SMBgradients();
-    """
-
-    def __init__(self):  # {{{
-        self.href = np.nan
-        self.smbref = np.nan
-        self.b_pos = np.nan
-        self.b_neg = np.nan
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = []
-
-        # Set defaults
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'issmbgradients', 'is smb gradients method activated (0 or 1, default is 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'href', 'reference elevation from which deviation is used to calculate SMB adjustment in smb gradients method'))
-        s += '{}\n'.format(fielddisplay(self, 'smbref', 'reference smb from which deviation is calculated in smb gradients method [m/yr ice equiv]'))
-        s += '{}\n'.format(fielddisplay(self, 'b_pos', 'slope of hs - smb regression line for accumulation regime required if smb gradients is activated'))
-        s += '{}\n'.format(fielddisplay(self, 'b_neg', 'slope of hs - smb regression line for ablation regime required if smb gradients is activated'))
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        # Nothing for now
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Output default
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def initialize(self, md):  # {{{
-        # Nothing for now
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.href', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.smbref', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            if np.max(np.max(np.abs(md.smb.smbref[0:-1,]))) < 1:
-                print('!!! Warning: SMBgradients now expects smbref to be in m/yr ice eq. instead of mm/yr water eq.')
-            md = checkfield(md, 'fieldname', 'smb.b_pos', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.b_neg', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 6, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'href', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'smbref', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_pos', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_neg', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/SMBgradientscomponents.m
===================================================================
--- /issm/trunk/src/m/classes/SMBgradientscomponents.m	(revision 28275)
+++ 	(revision )
@@ -1,103 +1,0 @@
-%SMBgradientscomponents Class definition
-%
-%   Usage:
-%      SMBgradientscomponents=SMBgradientscomponents();
-
-classdef SMBgradientscomponents
-	properties (SetAccess=public)
-
-		accuref           = NaN;
-		accualti          = NaN;
-		accugrad          = NaN;
-		runoffref         = NaN;
-		runoffalti        = NaN;
-		runoffgrad        = NaN;
-		steps_per_step    = 1;
-		averaging         = 0;
-		requested_outputs = {};
-	end
-	methods
-		function self=SMBgradientscomponents(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-
-		function self = extrude(self,md) % {{{
-
-		%Nothing for now
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-		%Nothing done for now
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%output default:
-			self.requested_outputs={'default'};
-
-		end % }}}
-		function	md=checkconsistency(self,md,solution,analyses) % {{{
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.accuref','singletimeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.accualti','numel',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.accugrad','singletimeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.runoffref','singletimeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.runoffalti','numel',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.runoffgrad','singletimeseries',1,'NaN',1,'Inf',1);
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1);
-		end % }}}
-
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-			disp(sprintf('\n   SMB gradients components parameters:'));
-			fielddisplay(self,'accuref',' reference value of the accumulation');
-			fielddisplay(self,'accualti',' Altitude at which the accumulation is equal to the reference value');
-			fielddisplay(self,'accugrad',' Gradient of the variation of the accumulation (0 for uniform accumulation)');
-			fielddisplay(self,'runoffref',' reference value of the runoff m w.e. y-1 (temperature times ddf)');
-			fielddisplay(self,'runoffalti',' Altitude at which the runoff is equal to the reference value');
-			fielddisplay(self,'runoffgrad',' Gradient of the variation of the runoff (0 for uniform runoff) m w.e. m-1 y-1 (lpase rate times ddf)');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid)    % {{{
-
-			WriteData(fid,prefix,'name','md.smb.model','data',11,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','accuref','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1./md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','accualti','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','accugrad','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1./md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoffref','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1./md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoffalti','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoffgrad','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1./md.constants.yts);
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
-
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBgradientscomponents.py
===================================================================
--- /issm/trunk/src/m/classes/SMBgradientscomponents.py	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class SMBgradientscomponents(object):
-    """
-    SMBgradients Class definition
-
-       Usage:
-          SMBgradients = SMBgradientscomponents();
-    For now it has accumulation, runoff ans retention which could be aither refreezing and/or evaporation
-    """
-
-    def __init__(self):  # {{{
-        self.accuref = float('NaN')
-        self.accualti = float('NaN')
-        self.accugrad = float('NaN')
-        self.runoffref = float('NaN')
-        self.runoffalti = float('NaN')
-        self.runoffgrad = float('NaN')
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = ['default']
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "   surface forcings parameters:"
-        string = "%s\n%s" % (string, fielddisplay(self, 'accuref', ' reference value of the accumulation'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'accualti', ' Altitude at which the accumulation is equal to the reference value'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'accugrad', ' Gradient of the variation of the accumulation (0 for uniform accumulation)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'runoffref', ' reference value of the runoff m w.e. y-1 (temperature times ddf)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'runoffalti', ' Altitude at which the runoff is equal to the reference value'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'runoffgrad', ' Gradient of the variation of the runoff (0 for uniform runoff) m w.e. m-1 y-1 (lapse rate times ddf)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)')
-        string = "%s\n\t\t%s" % (string, '1: Geometric')
-        string = "%s\n\t\t%s" % (string, '2: Harmonic')
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        #Nothing for now
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        list = ['SmbMassBalance']
-        if self.steps_per_step > 1:
-            list.extend(['SmbMassBalanceSubstep'])
-        return list
-    # }}}
-
-    def initialize(self, md):  # {{{
-        #Nothing for now
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.accualti', 'numel', [1], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.accuref', 'singletimeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.accugrad', 'singletimeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.runoffalti', 'numel', [1], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.runoffref', 'singletimeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.runoffgrad', 'singletimeseries', 1, 'NaN', 1, 'Inf', 1)
-
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):    # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 11, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accuref', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', yts, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accugrad', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', yts, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accualti', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoffref', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', yts, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoffgrad', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', yts, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoffalti', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-
-    # }}}
Index: sm/trunk/src/m/classes/SMBgradientsela.m
===================================================================
--- /issm/trunk/src/m/classes/SMBgradientsela.m	(revision 28275)
+++ 	(revision )
@@ -1,102 +1,0 @@
-%SMBgradientsela Class definition
-%
-%   Usage:
-%      SMBgradientsela=SMBgradientsela();
-
-classdef SMBgradientsela
-	properties (SetAccess=public)
-		ela               = NaN;
-		b_pos             = NaN;
-		b_neg             = NaN;
-		b_max             = NaN;
-		b_min             = NaN;
-		steps_per_step    = 1;
-		averaging         = 0;
-		requested_outputs = {};
-	end
-	methods
-		function self = SMBgradientsela(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-
-		%Nothing for now
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-		%Nothing done for now
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%output default:
-			self.b_max=9999;
-			self.b_min=-9999;
-			self.requested_outputs={'default'};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.ela','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.b_pos','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.b_neg','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.b_max','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.b_min','timeseries',1,'NaN',1,'Inf',1);
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-
-			disp(sprintf('\n   SMB gradients ela parameters:'));
-			fielddisplay(self,'ela',' equilibrium line altitude from which deviation is used to calculate smb using the smb gradients ela method [m a.s.l.]');
-			fielddisplay(self,'b_pos',' vertical smb gradient (dB/dz) above ela');
-			fielddisplay(self,'b_neg',' vertical smb gradient (dB/dz) below ela');
-			fielddisplay(self,'b_max',' upper cap on smb rate, default: 9999 (no cap) [m ice eq./yr] ');
-			fielddisplay(self,'b_min',' lower cap on smb rate, default: -9999 (no cap) [m ice eq./yr]');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',9,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ela','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_max','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_min','format','DoubleMat','mattype',1,'scale',1./yts, ...
-				  'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBgradientsela.py
===================================================================
--- /issm/trunk/src/m/classes/SMBgradientsela.py	(revision 28275)
+++ 	(revision )
@@ -1,103 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class SMBgradientsela(object):
-    """SMBGRADIENTSELA class definition
-
-    Usage:
-        SMBgradientsela = SMBgradientsela()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.ela = float('NaN')
-        self.b_pos = float('NaN')
-        self.b_neg = float('NaN')
-        self.b_max = float('NaN')
-        self.b_min = float('NaN')
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = []
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            error('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "   surface forcings parameters:"
-        string += '\n   SMB gradients ela parameters:'
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'ela', ' equilibrium line altitude from which deviation is used to calculate smb using the smb gradients ela method [m a.s.l.]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'b_pos', ' vertical smb gradient (dB/dz) above ela'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'b_neg', ' vertical smb gradient (dB/dz) below ela'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'b_max', ' upper cap on smb rate, default: 9999 (no cap) [m ice eq./yr]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'b_min', ' lower cap on smb rate, default: -9999 (no cap) [m ice eq./yr]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)')
-        string = "%s\n\t\t%s" % (string, '1: Geometric')
-        string = "%s\n\t\t%s" % (string, '2: Harmonic')
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        #Nothing for now
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-
-    def initialize(self, md):  # {{{
-        #Nothing for now
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.b_max = 9999
-        self.b_min = -9999
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):    # {{{
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.ela', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.b_pos', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.b_neg', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.b_max', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.b_min', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):    # {{{
-
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 9, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ela', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_pos', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_neg', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_max', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_min', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-
-    # }}}
Index: sm/trunk/src/m/classes/SMBhenning.m
===================================================================
--- /issm/trunk/src/m/classes/SMBhenning.m	(revision 28275)
+++ 	(revision )
@@ -1,89 +1,0 @@
-%SMBhenning Class definition
-%
-%   Usage:
-%      SMBhenning=SMBhenning();
-
-classdef SMBhenning
-	properties (SetAccess=public)
-		smbref = NaN;
-		steps_per_step=1;
-		averaging=0;
-		requested_outputs      = {};
-	end
-	methods
-		function self = SMBhenning(varargin) % {{{
-			switch nargin
-				case 0
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('SMBhenning');
-						list2 = fieldnames(inputstruct);
-						for i=1:length(list1)
-							fieldname = list1{i};
-							if ismember(fieldname,list2),
-								self.(fieldname) = inputstruct.(fieldname);
-							end
-						end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-
-			self.smbref=project3d(md,'vector',self.smbref,'type','node');
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.smbref)
-				self.smbref=zeros(md.mesh.numberofvertices,1);
-				disp('      no smb.smbref specified: values set as zero');
-			end
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.smbref','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.smbref','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-			fielddisplay(self,'smbref','reference smb from which deviation is calculated [m/yr ice eq]');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',7,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBhenning.py
===================================================================
--- /issm/trunk/src/m/classes/SMBhenning.py	(revision 28275)
+++ 	(revision )
@@ -1,92 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class SMBforcing(object):
-    """SMBhenning class definition
-
-    Usage:
-        SMBhenning = SMBhenning()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.smbref = np.nan
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = []
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            # TODO: Replace the following with constructor
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.smbref = project3d(md, 'vector', self.smbref, 'type', 'node')
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.smbref)):
-            self.smbref = np.zeros((md.mesh.numberofvertices))
-            print("      no smb.smbref specified: values set as zero")
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if solution == 'TransientSolution' and not md.transient.issmb:
-            return
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.mass_balance', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        if 'BalancethicknessAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.mass_balance', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'mass_balance', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        self.requested_outputs = ['default']
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/SMBmeltcomponents.m
===================================================================
--- /issm/trunk/src/m/classes/SMBmeltcomponents.m	(revision 28275)
+++ 	(revision )
@@ -1,116 +1,0 @@
-%SMBmeltcomponents Class definition
-%
-%   Usage:
-%      SMBmeltcomponents=SMBmeltcomponents();
-
-classdef SMBmeltcomponents
-	properties (SetAccess=public)
-		accumulation = NaN;
-		evaporation = NaN;
-		melt = NaN;
-		refreeze = NaN;
-		steps_per_step = 1;
-		averaging = 0;
-		requested_outputs= {};
-	end
-	methods
-		function self = SMBmeltcomponents(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters with melt (SMB=accumulation-evaporation-melt+refreeze) :'));
-			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
-			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
-			fielddisplay(self,'melt','amount of ice melt in ice column [m/yr ice eq]');
-			fielddisplay(self,'refreeze','amount of ice melt refrozen in ice column [m/yr ice eq]');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-		end % }}}
-		function self = extrude(self,md) % {{{
-
-			self.accumulation=project3d(md,'vector',self.accumulation,'type','node');
-			self.evaporation=project3d(md,'vector',self.evaporation,'type','node');
-			self.melt=project3d(md,'vector',self.melt,'type','node');
-			self.refreeze=project3d(md,'vector',self.refreeze,'type','node');
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.accumulation)
-				self.accumulation=zeros(md.mesh.numberofvertices,1);
-				disp('      no smb.accumulation specified: values set as zero');
-			end
-			if isnan(self.evaporation)
-				self.evaporation=zeros(md.mesh.numberofvertices,1);
-				disp('      no smb.evaporation specified: values set as zero');
-			end
-			if isnan(self.refreeze)
-				self.refreeze=zeros(md.mesh.numberofvertices,1);
-				disp('      no smb.refreeze specified: values set as zero');
-			end
-			if isnan(self.melt)
-				self.melt=zeros(md.mesh.numberofvertices,1);
-				disp('      no smb.melt specified: values set as zero');
-			end
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.accumulation','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.evaporation','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.refreeze','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.melt','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.accumulation','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.evaporation','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.refreeze','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.melt','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',3,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','refreeze','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%output default:
-			self.requested_outputs={'default'};
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBmeltcomponents.py
===================================================================
--- /issm/trunk/src/m/classes/SMBmeltcomponents.py	(revision 28275)
+++ 	(revision )
@@ -1,120 +1,0 @@
-import numpy as np
-
-from checkfield import *
-from fielddisplay import fielddisplay
-from project3d import *
-from WriteData import *
-
-
-class SMBmeltcomponents(object):
-    """SMBMELTCOMPONENTS class definition
-
-    Usage:
-        SMBmeltcomponents = SMBmeltcomponents();
-    """
-
-    def __init__(self, *args):  # {{{
-        self.accumulation      = np.nan
-        self.evaporation       = np.nan
-        self.melt              = np.nan
-        self.refreeze          = np.nan
-        self.steps_per_step    = 1
-        self.averaging         = 0
-        self.requested_outputs = []
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            error('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters with melt (SMB = accumulation-evaporation-melt+refreeze) :\n'
-        s += '{}\n'.format(fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'melt', 'amount of ice melt in the ice column [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'refreeze', 'amount of ice melt refrozen in the ice column [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.accumulation = project3d(md, 'vector', self.accumulation, 'type', 'node')
-        self.evaporation = project3d(md, 'vector', self.evaporation, 'type', 'node')
-        self.melt = project3d(md, 'vector', self.melt, 'type', 'node')
-        self.refreeze = project3d(md, 'vector', self.refreeze, 'type', 'node')
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.accumulation)):
-            self.accumulation = np.zeros((md.mesh.numberofvertices))
-            print("      no smb.accumulation specified: values set as zero")
-
-        if np.all(np.isnan(self.evaporation)):
-            self.evaporation = np.zeros((md.mesh.numberofvertices))
-            print("      no smb.evaporation specified: values set as zero")
-
-        if np.all(np.isnan(self.refreeze)):
-            self.refreeze = np.zeros((md.mesh.numberofvertices))
-            print("      no smb.refreeze specified: values set as zero")
-
-        if np.all(np.isnan(self.melt)):
-            self.melt = np.zeros((md.mesh.numberofvertices))
-            print("      no smb.melt specified: values set as zero")
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.accumulation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.refreeze', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.melt', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-
-        if 'BalancethicknessAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.refreeze', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.melt', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):  # {{{
-
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 3, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accumulation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'melt', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'refreeze', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.requested_outputs = ['default']
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/SMBpdd.m
===================================================================
--- /issm/trunk/src/m/classes/SMBpdd.m	(revision 28275)
+++ 	(revision )
@@ -1,221 +1,0 @@
-%SMBpdd Class definition
-%
-%   Usage:
-%      SMBpdd=SMBpdd();
-
-classdef SMBpdd
-	properties (SetAccess=public)
-		precipitation             = NaN;
-		monthlytemperatures       = NaN;
-		desfac                    = 0;
-		s0p                       = NaN;
-		s0t                       = NaN;
-		rlaps                     = 0;
-		rlapslgm                  = 0;
-		Pfac                      = NaN;
-		Tdiff                     = NaN;
-		sealev                    = NaN;
-		isdelta18o                = 0;
-		ismungsm                  = 0;
-		issetpddfac               = 0;
-		delta18o                  = NaN;
-		delta18o_surface          = NaN;
-		temperatures_presentday   = NaN;
-		temperatures_lgm          = NaN;
-		precipitations_presentday = NaN;
-		precipitations_lgm        = NaN;
-		pddfac_snow               = NaN;
-		pddfac_ice                = NaN;
-		steps_per_step            = 1;
-		averaging                 = 0;
-		requested_outputs         = {};
-	end
-	methods
-		function self = SMBpdd(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			if(self.isdelta18o==0 & self.ismungsm==0),self.precipitation=project3d(md,'vector',self.precipitation,'type','node');end
-			if(self.isdelta18o==0 & self.ismungsm==0),self.monthlytemperatures=project3d(md,'vector',self.monthlytemperatures,'type','node');end
-			if(self.isdelta18o),self.temperatures_lgm=project3d(md,'vector',self.temperatures_lgm,'type','node');end
-			if(self.isdelta18o),self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node');end
-			if(self.isdelta18o),self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node');end
-			if(self.isdelta18o),self.precipitations_lgm=project3d(md,'vector',self.precipitations_lgm,'type','node');end
-			if(self.ismungsm),self.temperatures_lgm=project3d(md,'vector',self.temperatures_lgm,'type','node');end
-			if(self.ismungsm),self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node');end
-			if(self.ismungsm),self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node');end
-			if(self.ismungsm),self.precipitations_lgm=project3d(md,'vector',self.precipitations_lgm,'type','node');end
-			self.s0p=project3d(md,'vector',self.s0p,'type','node');
-			self.s0t=project3d(md,'vector',self.s0t,'type','node');
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.s0p),
-				self.s0p=zeros(md.mesh.numberofvertices,1);
-				disp('      no SMBpdd.s0p specified: values set as zero');
-			end
-			if isnan(self.s0t),
-				self.s0t=zeros(md.mesh.numberofvertices,1);
-				disp('      no SMBpdd.s0t specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		  self.isdelta18o = 0;
-		  self.ismungsm   = 0;
-		  self.desfac     = 0.5;
-		  self.rlaps      = 6.5;
-		  self.rlapslgm   = 6.5;
-		  self.issetpddfac = 0;
-		  self.requested_outputs={'default'};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',1);
-				md = checkfield(md,'fieldname','smb.s0p','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','smb.s0t','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','smb.rlapslgm','>=',0,'numel',1);
-				if(self.isdelta18o==0 & self.ismungsm==0)
-					md = checkfield(md,'fieldname','smb.monthlytemperatures','timeseries',1,'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.precipitation','timeseries',1,'NaN',1,'Inf',1);
-				elseif(self.isdelta18o==1)
-					md = checkfield(md,'fieldname','smb.delta18o','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
-					md = checkfield(md,'fieldname','smb.delta18o_surface','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
-					md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.temperatures_lgm','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.precipitations_lgm','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.Tdiff','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
-					md = checkfield(md,'fieldname','smb.sealev','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
-				elseif(self.ismungsm==1)
-					md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.temperatures_lgm','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.precipitations_lgm','size',[md.mesh.numberofvertices 12],'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.Pfac','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
-					md = checkfield(md,'fieldname','smb.Tdiff','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
-					md = checkfield(md,'fieldname','smb.sealev','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
-				end
-				if(self.issetpddfac==1)
-					md = checkfield(md,'fieldname','smb.pddfac_snow','>=',0,'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','smb.pddfac_ice','>=',0,'NaN',1,'Inf',1);
-				end
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-
-			disp(sprintf('\n   PDD and deltaO18 parameters:'));
-			fielddisplay(self,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)');
-			fielddisplay(self,'ismungsm','is temperature and precipitation mungsm parametrisation activated (0 or 1, default is 0)');
-			fielddisplay(self,'issetpddfac','is user passing in defined pdd factors (0 or 1, default is 0)');
-			fielddisplay(self,'desfac','desertification elevation factor (between 0 and 1, default is 0.5) [m]');
-			fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]');
-			fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]');
-			fielddisplay(self,'rlaps','present day lapse rate [degree/km]');
-			fielddisplay(self,'rlapslgm','LGM lapse rate [degree/km]');
-			if(self.isdelta18o==0 & self.ismungsm==0)
-				fielddisplay(self,'monthlytemperatures',['monthly surface temperatures [K], required if pdd is activated and delta18o not activated']);
-				fielddisplay(self,'precipitation',['monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o or mungsm not activated']);
-			elseif(self.isdelta18o==1)
-				fielddisplay(self,'delta18o','delta18o [per mil], required if pdd is activated and delta18o activated');
-				fielddisplay(self,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated');
-				fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated');
-				fielddisplay(self,'temperatures_lgm','monthly LGM surface temperatures [K], required if delta18o or mungsm is activated');
-				fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o/mungsm is activated');
-				fielddisplay(self,'precipitations_lgm','monthly surface precipitation [m/yr water eq], required if delta18o/mungsm is activated');
-				fielddisplay(self,'Tdiff','time interpolation parameter for temperature, 1D(year), required if mungsm is activated');
-				fielddisplay(self,'sealev','sea level [m], 1D(year), required if mungsm is activated');
-			elseif(self.ismungsm==1)
-				fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated');
-				fielddisplay(self,'temperatures_lgm','monthly LGM surface temperatures [K], required if delta18o or mungsm is activated');
-				fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o/mungsm is activated');
-				fielddisplay(self,'precipitations_lgm','monthly surface precipitation [m/yr water eq], required if delta18o/mungsm is activated');
-				fielddisplay(self,'Pfac','time interpolation parameter for precipitation, 1D(year), required if mungsm is activated');
-				fielddisplay(self,'Tdiff','time interpolation parameter for temperature, 1D(year), required if mungsm is activated');
-				fielddisplay(self,'sealev','sea level [m], 1D(year), required if mungsm is activated');
-			end
-			if(self.issetpddfac==1)
-				fielddisplay(self,'pddfac_snow','Pdd factor for snow for all the domain [mm ice equiv/day/degree C]');
-				fielddisplay(self,'pddfac_ice','Pdd factor for ice for all the domain [mm ice equiv/day/degree C]');
-			end
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',4,'format','Integer');
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdelta18o','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','issetpddfac','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismungsm','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlapslgm','format','Double');
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
-			if(self.isdelta18o==0 & self.ismungsm==0)
-				%WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			elseif self.isdelta18o
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o_surface','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-			elseif self.ismungsm
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','Pfac','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-			end
-			if self.issetpddfac==1
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','pddfac_snow','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','pddfac_ice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			end
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBpdd.py
===================================================================
--- /issm/trunk/src/m/classes/SMBpdd.py	(revision 28275)
+++ 	(revision )
@@ -1,234 +1,0 @@
-import numpy as np
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-from project3d import project3d
-
-
-class SMBpdd(object):
-    """
-    SMBpdd Class definition
-
-       Usage:
-          SMBpdd = SMBpdd()
-    """
-
-    def __init__(self):  # {{{
-        self.precipitation = float('NaN')
-        self.monthlytemperatures = float('NaN')
-        self.desfac = 0.
-        self.s0p = float('NaN')
-        self.s0t = float('NaN')
-        self.rlaps = 0.
-        self.rlapslgm = 0.
-        self.Pfac = float('NaN')
-        self.Tdiff = float('NaN')
-        self.sealev = float('NaN')
-        self.isdelta18o = 0
-        self.ismungsm = 0
-        self.issetpddfac = 0
-        self.delta18o = float('NaN')
-        self.delta18o_surface = float('NaN')
-        self.temperatures_presentday = float('NaN')
-        self.temperatures_lgm = float('NaN')
-        self.precipitations_presentday = float('NaN')
-        self.precipitations_lgm = float('NaN')
-        self.pddfac_snow = float('NaN')
-        self.pddfac_ice = float('NaN')
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = []
-
-        # Set defaults
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "   surface forcings parameters:"
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'isdelta18o', 'is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'ismungsm', 'is temperature and precipitation mungsm parametrisation activated (0 or 1, default is 0)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'issetpddfac', 'is user passing in defined pdd factors (0 or 1, default is 0)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'desfac', 'desertification elevation factor (between 0 and 1, default is 0.5) [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 's0p', 'should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 's0t', 'should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'rlaps', 'present day lapse rate [degree/km]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'rlapslgm', 'LGM lapse rate [degree/km]'))
-        if not (self.isdelta18o and self.ismungsm):
-            string = "%s\n%s" % (string, fielddisplay(self, 'monthlytemperatures', 'monthly surface temperatures [K], required if pdd is activated and delta18o not activated'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'precipitation', 'monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o or mungsm not activated'))
-            if self.isdelta18o:
-                string = "%s\n%s" % (string, fielddisplay(self, 'delta18o', 'delta18o [per mil], required if pdd is activated and delta18o activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'delta18o_surface', 'surface elevation of the delta18o site, required if pdd is activated and delta18o activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_presentday', 'monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_lgm', 'monthly LGM surface temperatures [K], required if delta18o or mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_presentday', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_lgm', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'Tdiff', 'time interpolation parameter for temperature, 1D(year), required if mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'sealev', 'sea level [m], 1D(year), required if mungsm is activated'))
-
-            if self.ismungsm:
-                string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_presentday', 'monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_lgm', 'monthly LGM surface temperatures [K], required if delta18o or mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_presentday', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_lgm', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'Pfac', 'time interpolation parameter for precipitation, 1D(year), required if mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'Tdiff', 'time interpolation parameter for temperature, 1D(year), required if mungsm is activated'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'sealev', 'sea level [m], 1D(year), required if mungsm is activated'))
-                
-        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)')
-        string = "%s\n\t\t%s" % (string, '1: Geometric')
-        string = "%s\n\t\t%s" % (string, '2: Harmonic')
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        if not (self.isdelta18o and self.ismungsm):
-            self.precipitation = project3d(md, 'vector', self.precipitation, 'type', 'node')
-            self.monthlytemperatures = project3d(md, 'vector', self.monthlytemperatures, 'type', 'node')
-
-        if self.isdelta18o:
-            self.temperatures_lgm = project3d(md, 'vector', self.temperatures_lgm, 'type', 'node')
-            self.temperatures_presentday = project3d(md, 'vector', self.temperatures_presentday, 'type', 'node')
-            self.precipitations_presentday = project3d(md, 'vector', self.precipitations_presentday, 'type', 'node')
-            self.precipitations_lgm = project3d(md, 'vector', self.precipitations_lgm, 'type', 'node')
-
-        if self.ismungsm:
-            self.temperatures_lgm = project3d(md, 'vector', self.temperatures_lgm, 'type', 'node')
-            self.temperatures_presentday = project3d(md, 'vector', self.temperatures_presentday, 'type', 'node')
-            self.precipitations_presentday = project3d(md, 'vector', self.precipitations_presentday, 'type', 'node')
-            self.precipitations_lgm = project3d(md, 'vector', self.precipitations_lgm, 'type', 'node')
-
-        if self.issetpddfac:
-            self.pddfac_snow = project3d(md, 'vector', self.pddfac_snow, 'type', 'node')
-        if self.issetpddfac:
-            self.pddfac_ice = project3d(md, 'vector', self.pddfac_ice, 'type', 'node')
-        self.s0p = project3d(md, 'vector', self.s0p, 'type', 'node')
-        self.s0t = project3d(md, 'vector', self.s0t, 'type', 'node')
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.s0p)):
-            self.s0p = np.zeros((md.mesh.numberofvertices))
-            print("      no SMBpdd.s0p specified: values set as zero")
-
-        if np.all(np.isnan(self.s0t)):
-            self.s0t = np.zeros((md.mesh.numberofvertices))
-            print("      no SMBpdd.s0t specified: values set as zero")
-
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #pdd method not used in default mode
-        self.isdelta18o = 0
-        self.ismungsm = 0
-        self.desfac = 0.5
-        self.rlaps = 6.5
-        self.rlapslgm = 6.5
-        self.issetpddfac = 0
-        self.requested_outputs = ['default']
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):    # {{{
-
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.desfac', '<=', 1, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'smb.s0p', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'smb.s0t', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'smb.rlaps', '>=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'smb.rlapslgm', '>=', 0, 'numel', [1])
-
-            if (self.isdelta18o == 0 and self.ismungsm == 0):
-                md = checkfield(md, 'fieldname', 'smb.monthlytemperatures', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-                md = checkfield(md, 'fieldname', 'smb.precipitation', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            elif self.isdelta18o:
-                md = checkfield(md, 'fieldname', 'smb.delta18o', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
-                md = checkfield(md, 'fieldname', 'smb.delta18o_surface', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
-                md = checkfield(md, 'fieldname', 'smb.temperatures_presentday', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.temperatures_lgm', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.precipitations_presentday', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.precipitations_lgm', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.Tdiff', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
-                md = checkfield(md, 'fieldname', 'smb.sealev', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
-            elif self.ismungsm:
-                md = checkfield(md, 'fieldname', 'smb.temperatures_presentday', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.temperatures_lgm', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.precipitations_presentday', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.precipitations_lgm', 'size', [md.mesh.numberofvertices, 12], 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.Pfac', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
-                md = checkfield(md, 'fieldname', 'smb.Tdiff', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
-                md = checkfield(md, 'fieldname', 'smb.sealev', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
-
-            if self.issetpddfac:
-                md = checkfield(md, 'fieldname', 'smb.pddfac_snow', '>=', 0, 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'smb.pddfac_ice', '>=', 0, 'NaN', 1, 'Inf', 1)
-
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):    # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 4, 'format', 'Integer')
-
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdelta18o', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ismungsm', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'issetpddfac', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'desfac', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0p', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0t', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlaps', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlapslgm', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        if (self.isdelta18o == 0 and self.ismungsm == 0):
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'monthlytemperatures', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        elif self.isdelta18o:
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_presentday', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_lgm', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_presentday', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_lgm', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'delta18o_surface', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'delta18o', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tdiff', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'sealev', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-        elif self.ismungsm:
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_presentday', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_lgm', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_presentday', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_lgm', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Pfac', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tdiff', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'sealev', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
-
-        if self.issetpddfac:
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pddfac_snow', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pddfac_ice', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-
-        #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-
-    # }}}
Index: sm/trunk/src/m/classes/SMBpddSicopolis.m
===================================================================
--- /issm/trunk/src/m/classes/SMBpddSicopolis.m	(revision 28275)
+++ 	(revision )
@@ -1,147 +1,0 @@
-%SMBpddSicopolis Class definition
-%
-%   Usage:
-%      SMBpddSicopolis=SMBpddSicopolis();
-
-classdef SMBpddSicopolis
-	properties (SetAccess=public)
-
-		precipitation         = NaN;
-		monthlytemperatures   = NaN;
-		temperature_anomaly   = NaN;
-		precipitation_anomaly = NaN;
-		smb_corr              = NaN;
-		desfac                = 0;
-		s0p                   = NaN;
-		s0t                   = NaN;
-		rlaps                 = 0;
-		isfirnwarming         = 0;
-		steps_per_step        = 1
-		averaging             = 0
-		requested_outputs     = {};
-	end
-	methods
-		function self = SMBpddSicopolis(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.precipitation=project3d(md,'vector',self.precipitation,'type','node');
-			self.monthlytemperatures=project3d(md,'vector',self.monthlytemperatures,'type','node');
-			self.temperature_anomaly=project3d(md,'vector',self.temperature_anomaly,'type','node');
-			self.precipitation_anomaly=project3d(md,'vector',self.precipitation_anomaly,'type','node');
-			self.smb_corr=project3d(md,'vector',self.smb_corr,'type','node');
-			self.s0p=project3d(md,'vector',self.s0p,'type','node');
-			self.s0t=project3d(md,'vector',self.s0t,'type','node');
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.s0p),
-				self.s0p=zeros(md.mesh.numberofvertices,1);
-				disp('      no SMBpddSicopolis.s0p specified: values set as zero');
-			end
-			if isnan(self.s0t),
-				self.s0t=zeros(md.mesh.numberofvertices,1);
-				disp('      no SMBpddSicopolis.s0t specified: values set as zero');
-			end
-			if isnan(self.temperature_anomaly),
-				self.temperature_anomaly=zeros(md.mesh.numberofvertices,1);
-				disp('      no SMBpddSicopolis.temperature_anomaly specified: values set as zero');
-			end
-			if isnan(self.precipitation_anomaly),
-				self.precipitation_anomaly=ones(md.mesh.numberofvertices,1);
-				disp('      no SMBpddSicopolis.precipitation_anomaly specified: values set as ones');
-			end
-			if isnan(self.smb_corr),
-				self.smb_corr=zeros(md.mesh.numberofvertices,1);
-				disp('      no SMBpddSicopolis.smb_corr specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.isfirnwarming = 1;
-			self.desfac        = -log(2.0)/1000;
-			self.rlaps         = 7.4;
-			self.requested_outputs={'default'};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if (strcmp(solution,'TransientSolution') & md.transient.issmb == 0), return; end
-
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',1);
-				md = checkfield(md,'fieldname','smb.s0p','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','smb.s0t','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','smb.monthlytemperatures','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 12]);
-				md = checkfield(md,'fieldname','smb.precipitation','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 12]);
-
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging', 'numel', [1], 'values', [0, 1, 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-
-			disp(sprintf('\n   SICOPOLIS PDD scheme (Calov & Greve, 2005) :'));
-			fielddisplay(self,'monthlytemperatures','monthly surface temperatures [K]');
-			fielddisplay(self,'precipitation','monthly surface precipitation [m/yr water eq]');
-			fielddisplay(self,'temperature_anomaly','anomaly to monthly reference temperature (additive; [K])');
-			fielddisplay(self,'precipitation_anomaly','anomaly to monthly precipitation (multiplicative, e.g. q=q0*exp(0.070458*DeltaT) after Huybrechts (2002)); [no unit])');
-			fielddisplay(self,'smb_corr','correction of smb after PDD call [m/a]');
-			fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]');
-			fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]');
-			fielddisplay(self,'rlaps','present day lapse rate (default is 7.4 degree/km)');
-			fielddisplay(self,'desfac','desertification elevation factor (default is -log(2.0)/1000)');
-			fielddisplay(self,'isfirnwarming','is firnwarming (Reeh 1991) activated (0 or 1, default is 1)');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self,'averaging','averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested (TemperaturePDD, SmbAccumulation, SmbMelt)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',10,'format','Integer');
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isfirnwarming','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double');
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperature_anomaly','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation_anomaly','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','smb_corr','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
-			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBpddSicopolis.py
===================================================================
--- /issm/trunk/src/m/classes/SMBpddSicopolis.py	(revision 28275)
+++ 	(revision )
@@ -1,146 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from helpers import *
-from MatlabFuncs import *
-from project3d import project3d
-from WriteData import WriteData
-
-
-class SMBpddSicopolis(object):
-    """SMBPDDSICOPOLIS class definition
-
-    Usage:
-        SMBpddSicopolis = SMBpddSicopolis()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.precipitation = np.nan
-        self.monthlytemperatures = np.nan
-        self.temperature_anomaly = np.nan
-        self.precipitation_anomaly = np.nan
-        self.smb_corr = np.nan
-        self.desfac = 0
-        self.s0p = np.nan
-        self.s0t = np.nan
-        self.rlaps = 0
-        self.isfirnwarming = 0
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = []
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters:\n'
-        s += '   SICOPOLIS PDD scheme (Calov & Greve, 2005):\n'
-        s += '{}\n'.format(fielddisplay(self, 'monthlytemperatures', 'monthly surface temperatures [K]'))
-        s += '{}\n'.format(fielddisplay(self, 'precipitation', 'monthly surface precipitation [m/yr water eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'temperature_anomaly', 'anomaly to monthly reference temperature (additive [K])'))
-        s += '{}\n'.format(fielddisplay(self, 'precipitation_anomaly', 'anomaly to monthly precipitation (multiplicative, e.g. q = q0*exp(0.070458*DeltaT) after Huybrechts (2002)) [no unit])'))
-        s += '{}\n'.format(fielddisplay(self, 'smb_corr', 'correction of smb after PDD call [m/a]'))
-        s += '{}\n'.format(fielddisplay(self, 's0p', 'should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 's0t', 'should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'rlaps', 'present day lapse rate (default is 7.4 degree/km)'))
-        s += '{}\n'.format(fielddisplay(self, 'desfac', 'desertification elevation factor (default is -log(2.0)/1000)'))
-        s += '{}\n'.format(fielddisplay(self, 'isfirnwarming', 'is firnwarming (Reeh 1991) activated (0 or 1, default is 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested (TemperaturePDD, SmbAccumulation, SmbMelt)'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.precipitation = project3d(md, 'vector', self.precipitation, 'type', 'node')
-        self.monthlytemperatures = project3d(md, 'vector', self.monthlytemperatures, 'type', 'node')
-        self.temperature_anomaly = project3d(md, 'vector', self.temperature_anomaly, 'type', 'node')
-        self.precipitation_anomaly = project3d(md, 'vector', self.precipitation_anomaly, 'type', 'node')
-        self.smb_corr = project3d(md, 'vector', self.smb_corr, 'type', 'node')
-        self.s0p = project3d(md, 'vector', self.s0p, 'type', 'node')
-        self.s0t = project3d(md, 'vector', self.s0t, 'type', 'node')
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        listing = ['SmbMassBalance']
-        return listing
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.isnan(self.s0p):
-            self.s0p = np.zeros((md.mesh.numberofvertices, ))
-            print('      no SMBpddSicopolis.s0p specified: values set as zero')
-
-        if np.isnan(self.s0t):
-            self.s0t = np.zeros((md.mesh.numberofvertices, ))
-            print('      no SMBpddSicopolis.s0t specified: values set as zero')
-
-        if np.isnan(self.temperature_anomaly):
-            self.temperature_anomaly = np.zeros((md.mesh.numberofvertices, ))
-            print('      no SMBpddSicopolis.temperature_anomaly specified: values set as zero')
-
-        if np.isnan(self.precipitation_anomaly):
-            self.precipitation_anomaly = np.ones((md.mesh.numberofvertices, ))
-            print('      no SMBpddSicopolis.precipitation_anomaly specified: values set as ones')
-
-        if np.isnan(self.smb_corr):
-            self.smb_corr = np.zeros((md.mesh.numberofvertices, ))
-            print('      no SMBpddSicopolis.smb_corr specified: values set as zero')
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.isfirnwarming = 1
-        self.desfac = -np.log(2.0) / 1000
-        self.rlaps = 7.4
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if solution == 'TransientSolution' and not md.transient.issmb:
-            return
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.desfac', '<=', 1, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'smb.s0p', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1])
-            md = checkfield(md, 'fieldname', 'smb.s0t', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1])
-            md = checkfield(md, 'fieldname', 'smb.rlaps', '>=', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'smb.monthlytemperatures', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 12])
-            md = checkfield(md, 'fieldname', 'smb.precipitation', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 12])
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 10, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isfirnwarming', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'desfac', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0p', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0t', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlaps', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'monthlytemperatures', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperature_anomaly', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitation_anomaly', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'smb_corr', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/SMBsemic.m
===================================================================
--- /issm/trunk/src/m/classes/SMBsemic.m	(revision 28275)
+++ 	(revision )
@@ -1,366 +1,0 @@
-%SMBsemic Class definition
-%
-%   Usage:
-%      SMBsemic=SMBsemic();
-
-classdef SMBsemic
-	properties (SetAccess=public)
-		dailysnowfall		= NaN;
-		dailyrainfall		= NaN;
-		dailydsradiation	= NaN;
-		dailydlradiation	= NaN;
-		dailywindspeed		= NaN;
-		dailypressure		= NaN;
-		dailyairdensity		= NaN;
-		dailyairhumidity	= NaN;
-		dailytemperature	= NaN;
-		Tamp              = NaN;
-		mask              = NaN;
-		hice              = NaN;
-		hsnow             = NaN;
-		qmr               = NaN;
-		desfac				= 0;
-		desfacElevation   = 0;
-		rlaps				= 0;
-		rdl					= 0;
-		s0gcm				= NaN;
-		steps_per_step		= 1;
-		averaging			= 0;
-		requested_outputs	= {};
-
-		hcrit             = 0;
-		rcrit             = 0;
-
-		% albedo
-		albedo            = 0; % required for first energy balance calculation of SEMIC
-		albedo_snow       = 0; % required for ISBA method
-		albedo_scheme     = 0; 
-		alb_smax = NaN;
-		alb_smin = NaN;
-		albi = NaN;
-		albl = NaN;
-
-		% albedo parameters depending on albedo_scheme
-		% for slater 
-		tmin = NaN;
-		tmax = NaN;
-
-		% for isba & denby method
-		mcrit = NaN;
-
-		% for isba
-		tau_a = NaN;
-		tau_f = NaN;
-		wcrit = NaN;
-
-		% for alex
-		tmid = NaN;
-		afac = NaN;
-
-		% method
-		ismethod  = 0;
-	end
-	methods
-		function self = SMBsemic(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.dailysnowfall=project3d(md,'vector',self.dailysnowfall,'type','node');
-			self.dailyrainfall=project3d(md,'vector',self.dailyrainfall,'type','node');
-			self.dailydsradiation=project3d(md,'vector',self.dailydsradiation,'type','node');
-			self.dailydlradiation=project3d(md,'vector',self.dailydlradiation,'type','node');
-			self.dailywindspeed=project3d(md,'vector',self.dailywindspeed,'type','node');
-			self.dailypressure=project3d(md,'vector',self.dailypressure,'type','node');
-			self.dailyairdensity=project3d(md,'vector',self.dailyairdensity,'type','node');
-			self.dailyairhumidity=project3d(md,'vector',self.dailyairhumidity,'type','node');
-			self.dailytemperature=project3d(md,'vector',self.dailytemperature,'type','node');
-			self.s0gcm=project3d(md,'vector',self.s0gcm,'type','node');
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function list = outputlists(self,md) % {{{
-			if self.ismethod == 1
-				list = {'default','SmbMassBalance','SmbMassBalanceSnow','SmbMassBalanceIce',...
-					'SmbMassBalanceSemic','SmbMelt','SmbRefreeze','SmbAccumulation',...
-					'SmbHIce','SmbHSnow','SmbAlbedo','SmbAlbedoSnow','TemperatureSEMIC',...
-					'SmbSemicQmr','TotalSmb','TotalSmbMelt','TotalSmbRefreeze'};
-			else
-				list = {'default','SmbMassBalance'};
-			end
-		end % }}}
-		function self = initialize(self,md) % {{{
-			% Explain
-			%  initialize SEMIC smb values, such as s0gcm(surface elevation), albedo,
-			% albedo_snow, hice, hsnow, Tamp... values.
-			% 
-			%
-			% Usage
-			%  md.smb = initialize(md.smb,md);
-
-			if isnan(self.s0gcm)
-				if ~isnan(md.geometry.surface) & (numel(md.geometry.surface) == md.mesh.numberofvertices)
-					self.s0gcm=md.geometry.surface;
-					disp('      no SMBsemic.s0gcm specified: values from md.geometry.surface');
-				else
-					self.s0gcm=zeros(md.mesh.numberofvertices,1);
-					disp('      no SMBsemic.s0gcm specified: values set as zero');
-				end
-			end
-			if isnan(self.mask)
-				self.mask = 2*ones(md.mesh.numberofvertices,1);
-				disp('      no SMBsemic.mask specified: values set as 2 for ice');
-			end
-
-			% update each values.
-			if isnan(self.Tamp)
-				self.Tamp= 3*ones(md.mesh.numberofvertices,1);
-				disp('      no SMBsemic.Tamp specified: values set as 3.0');
-			end
-			self.albedo     = 0.8*ones(md.mesh.numberofvertices,1);
-			self.albedo_snow= 0.5*ones(md.mesh.numberofvertices,1);
-			self.hice       = 10*ones(md.mesh.numberofvertices,1);
-			self.hsnow      = 5*ones(md.mesh.numberofvertices,1);
-			self.qmr        = zeros(md.mesh.numberofvertices,1);
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			% albedo parameters
-			self.albedo_scheme   = 0;
-			self.alb_smax = 0.79;
-			self.alb_smin = 0.6;
-			self.albi = 0.41;
-			self.albl = 0.07;
-
-			% albedo parameters for?
-			% for slater
-			self.tmin  = 263.15;
-			self.tmax  = 273.15;
-			% for isba & denby
-			self.mcrit = 6e-8;
-			% for isba
-			self.tau_a = 0.008;
-			self.tau_f = 0.24;
-			self.wcrit = 15.0;
-			% for alex
-			self.tmid  = 273.35;
-			self.afac  = -0.18;
-
-			self.hcrit = 0.028;% from Krapp et al. (2017)
-			self.rcrit = 0.85; % from Krapp et al. (2017)
-		
-			self.desfac		      = -log(2.0)/1000;
-			self.desfacElevation = 2000;
-			self.rlaps		      = 7.4;
-			self.rdl			      = 0.29;
-
-			self.ismethod        = 0;
-			self.requested_outputs={'default'};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses)
-				md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',1);
-				md = checkfield(md,'fieldname','smb.s0gcm','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','smb.rdl','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','smb.dailysnowfall','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.dailyrainfall','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.dailydsradiation','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.dailydlradiation','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.dailywindspeed','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.dailypressure','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.dailyairdensity','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.dailyairhumidity','timeseries',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','smb.dailytemperature','timeseries',1,'NaN',1,'Inf',1);
-
-				% TODO: transient model should be merged with SEMIC developed by Ruckamp et al. (2018)
-
-				md = checkfield(md,'fieldname','smb.ismethod','numel',1,'values',[0,1]);
-				if self.ismethod == 1 % transient mode
-					md = checkfield(md,'fieldname','smb.desfacElevation','>=',0,'numel',1);
-
-					md = checkfield(md,'fieldname','smb.albedo_scheme','NaN',1,'Inf',1,'numel',1,'values',[0,1,2,3,4]);
-					md = checkfield(md,'fieldname','smb.alb_smax','>=',0,'NaN',1,'Inf',1,'numel',1);
-					md = checkfield(md,'fieldname','smb.mask','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1],'values',[0,1,2]);
-
-					% initial values
-					md = checkfield(md,'fieldname','smb.albedo','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-					md = checkfield(md,'fieldname','smb.albedo_snow','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-					md = checkfield(md,'fieldname','smb.alb_smax','>=',0,'<=',1,'NaN',1,'Inf',1,'numel',1);
-					md = checkfield(md,'fieldname','smb.alb_smin','<=',1,'NaN',1,'Inf',1,'numel',1);
-					md = checkfield(md,'fieldname','smb.albi','>=',0,'<=',1,'NaN',1,'Inf',1,'numel',1);
-					md = checkfield(md,'fieldname','smb.albl','>=',0,'<=',1,'NaN',1,'Inf',1,'numel',1);
-					md = checkfield(md,'fieldname','smb.hice','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-					md = checkfield(md,'fieldname','smb.hsnow','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-					md = checkfield(md,'fieldname','smb.qmr','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				end
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-			% check requested_outputs
-			if self.ismethod==1
-				for i = 1:length(self.requested_outputs)
-					if ~any(strcmpi(self.requested_outputs{i},self.outputlists))
-						error(sprintf('ERROR: %s requested_output is not available',self.requested_outputs{i}));
-					end
-				end
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters:'));
-
-			disp(sprintf('   Interface for coupling GCM data to the energy balance model SEMIC (Krapp et al (2017) https://doi.org/10.5194/tc-11-1519-2017).'));
-			disp(sprintf('   The implemented coupling uses daily mean GCM input to calculate yearly mean smb, accumulation, ablation, and surface temperature.'));
-			disp(sprintf('   smb and temperatures are updated every year'));
-			disp(sprintf('\n   SEMIC parameters:'));
-			fielddisplay(self,'dailysnowfall','daily surface dailysnowfall [m/s]');
-			fielddisplay(self,'dailyrainfall','daily surface dailyrainfall [m/s]');
-			fielddisplay(self,'dailydsradiation','daily downwelling shortwave radiation [W/m2]');
-			fielddisplay(self,'dailydlradiation','daily downwelling longwave radiation [W/m2]');
-			fielddisplay(self,'dailywindspeed','daily surface wind speed [m/s]');
-			fielddisplay(self,'dailypressure','daily surface pressure [Pa]');
-			fielddisplay(self,'dailyairdensity','daily air density [kg/m3]');
-			fielddisplay(self,'dailyairhumidity','daily air specific humidity [kg/kg]');
-			fielddisplay(self,'dailytemperature','daily surface air temperature [K]');
-			fielddisplay(self,'rlaps','present day lapse rate (default is 7.4 [degree/km]; Erokhina et al. 2017)');
-			fielddisplay(self,'desfac','desertification elevation factor (default is -log(2.0)/1000 [1/km]; Vizcaino et al. 2010)');
-			fielddisplay(self,'rdl','longwave downward radiation decrease (default is 0.29 [W/m^2/km]; Marty et al. 2002)');
-			fielddisplay(self,'s0gcm','GCM reference elevation; (default is 0) [m]');
-			fielddisplay(self,'albedo_scheme','albedom scheme. 0: none, 1: (default is 0)');
-
-			fielddisplay(self,'ismethod','method for calculating SMB with SEMIC. Default version of SEMIC is really slow. 0: steady, 1: transient (default: 0)');
-			if self.ismethod == 1 % transient mode
-				fielddisplay(self,'desfacElevation','desertification elevation (default is 2000 m; Vizcaino et al. 2010)');
-				fielddisplay(self,'Tamp','amplitude of diurnal cycle [K]');
-				fielddisplay(self,'albedo','initial albedo [no unit]');
-				fielddisplay(self,'albedo_snow','initial albedo for snow [no unit]');
-				fielddisplay(self,'hice','initial thickness of ice [unit: m]');
-				fielddisplay(self,'hsnow','initial thickness of snow [unit: m]');
-				fielddisplay(self,'mask','masking for albedo. 0: ocean, 1: land, 2: ice (default: 2)');
-				fielddisplay(self,'hcrit','critical snow height for albedo [unit: m]');
-				fielddisplay(self,'rcrit','critical refreezing height for albedo [no unit]');
-
-				disp(sprintf('\nSEMIC albedo parameters.'));
-				fielddisplay(self,'albedo_scheme','albedo scheme for SEMIC. 0: none, 1: slater, 2: isba, 3: denby, 4: alex (default is 0)');
-				fielddisplay(self,'alb_smax','maximum snow albedo (default: 0.79)');
-				fielddisplay(self,'alb_smin','minimum snow albedo (default: 0.6)');
-				fielddisplay(self,'albi','background albedo for bare ice (default: 0.41)');
-				fielddisplay(self,'albl','background albedo for bare land (default: 0.07)');
-			end
-			% albedo_scheme - 0: none, 1: slater, 2: isba, 3: denby, 4: alex.
-         if self.albedo_scheme == 0
-            disp(sprintf('\n\tSEMIC snow albedo parameter of None.'));
-				disp(sprintf('\t   albedo of snow is updated from albedo snow max (alb_smax).'));
-            disp(sprintf('\t   alb_snow = abl_smax'));
-			elseif self.albedo_scheme == 1
-				disp(sprintf('\n\tSEMIC snow albedo parameters of Slater et al, (1998).'));
-				disp(sprintf('\t   alb = alb_smax - (alb_smax - alb_smin)*tm^(3.0)'))
-				disp(sprintf('\t   tm  = 1 (tsurf > 273.15 K)'));
-				disp(sprintf('\t         tm = f*(tsurf-tmin) (tmin <= tsurf < 273.15)'));
-				disp(sprintf('\t         0 (tsurf < tmin)'));
-				disp(sprintf('\t   f = 1/(273.15-tmin)'));
-				fielddisplay(self,'tmin','minimum temperature for which albedo decline become effective. (default: 263.15 K)[unit: K])');
-				fielddisplay(self,'tmax','maxmium temperature for which albedo decline become effective. This value should be fixed. (default: 273.15 K)[unit: K])');
-			elseif self.albedo_scheme == 2
-				disp(sprintf('\n\tSEMIC snow albedo parameters for ISBA.? where is citation?'));
-				fielddisplay(self,'mcrit','critical melt rate (default: 6e-8) [unit: m/sec]');
-				fielddisplay(self,'wcrit','critical liquid water content (default: 15) [unit: kg/m2]');
-				fielddisplay(self,'tau_a','dry albedo decline [unit: 1/day]');
-				fielddisplay(self,'tau_f','wet albedo decline [unit: 1/day]');
-			elseif self.albedo_scheme == 3
-				disp(sprintf('\n\tSEMIC snow albedo parameters for Denby et al. (2002 Tellus)'));
-				fielddisplay(self,'mcrit','critical melt rate (default: 6e-8) [unit: m/sec]');
-			elseif self.albedo_scheme == 4
-				disp(sprintf('\n\tSEMIC snow albedo parameters for Alex.?'));
-				fielddisplay(self,'afac','[unit: ?]');
-				fielddisplay(self,'tmid','[unit: ?]');
-			else
-				error(sprintf('ERROR: %d is not supported albedom scheme.',self.albedo_scheme))
-			end
-
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.smb.model','data',12,'format','Integer');
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismethod','format','Integer','values',[0, 1]);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfacElevation','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0gcm','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rdl','format','Double');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailysnowfall','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyrainfall','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailydsradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailydlradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailywindspeed','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailypressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyairdensity','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyairhumidity','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailytemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			% TODO: transient mode should be merged with SEMIC developed by Ruckamp et al. (2018).
-			if self.ismethod == 1% transient mode
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tamp','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','mask','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','hice','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','hsnow','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','qmr','format','DoubleMat','mattype',1);
-
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','hcrit','format','Double');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','rcrit','format','Double');
-
-				%albedo
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','albedo','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','albedo_snow','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','albedo_scheme','format','Integer');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','albi','format','Double');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','albl','format','Double');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','alb_smin','format','Double');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','alb_smax','format','Double');
-
-				%albedo parameters for ?
-				%for slater
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','tmin','format','Double');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','tmax','format','Double');
-				%for isba & denby
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','mcrit','format','Double');
-				%for isba
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','wcrit','format','Double');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','tau_a','format','Double');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','tau_f','format','Double');
-				%for alex
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','tmid','format','Double');
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','afac','format','Double');
-			end
-
-			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos)
-				outputs(pos) = []; %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/SMBsemic.py
===================================================================
--- /issm/trunk/src/m/classes/SMBsemic.py	(revision 28275)
+++ 	(revision )
@@ -1,333 +1,0 @@
-from math import log
-
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class SMBsemic(object):
-    """SMBsemic class definition
-
-    Usage:
-        SMBsemic = SMBsemic()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.dailysnowfall = np.nan
-        self.dailyrainfall = np.nan
-        self.dailydsradiation = np.nan
-        self.dailydlradiation = np.nan
-        self.dailypressure = np.nan
-        self.dailyairdensity = np.nan
-        self.dailyairhumidity = np.nan
-        self.dailytemperature = np.nan
-        self.Tamp = np.nan
-        self.mask = np.nan
-        self.hice = np.nan
-        self.hsnow = np.nan
-        self.desfac = 0
-        self.desfacElevation = 0
-        self.rlaps = 0
-        self.rdl = 0
-        self.s0gcm = np.nan
-        self.steps_per_step = 1
-        self.averaging = 0
-        self.requested_outputs = []
-
-        self.hcrit = 0
-        self.rcrit = 0
-
-        # albedo
-        self.albedo = 0 # required for first energy balance calculation of SEMIC
-        self.albedo_snow = 0 # required for ISBA method
-        self.albedo_scheme = 0
-        self.alb_smax = np.nan
-        self.alb_smin = np.nan
-        self.albi = np.nan
-        self.albl = np.nan
-
-        # albedo parameters depending on albedo_scheme
-        # for slater
-        self.tmin = np.nan
-        self.tmax = np.nan
-
-        # for isba & denby method
-        self.mcrit = np.nan
-
-        # for isba
-        self.tau_a = np.nan
-        self.tau_f = np.nan
-        self.wcrit = np.nan
-
-        # for alex
-        self.tmid = np.nan
-        self.afac = np.nan
-
-        # method
-        self.ismethod = 0
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters:\n'
-        s += '   Interface for coupling GCM data to the energy balance model SEMIC (Krapp et al (2017) https://doi.org/10.5194/tc-11-1519-2017).\n'
-        s += '   The implemented coupling uses daily mean GCM input to calculate yearly mean smb, accumulation, ablation, and surface temperature.\n'
-        s += '   smb and temperatures are updated every year\n'
-        s += '\n   SEMIC parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'dailysnowfall', 'daily surface dailysnowfall [m/s]'))
-        s += '{}\n'.format(fielddisplay(self, 'dailyrainfall', 'daily surface dailyrainfall [m/s]'))
-        s += '{}\n'.format(fielddisplay(self, 'dailydsradiation', 'daily downwelling shortwave radiation [W/m2]'))
-        s += '{}\n'.format(fielddisplay(self, 'dailydlradiation', 'daily downwelling longwave radiation [W/m2]'))
-        s += '{}\n'.format(fielddisplay(self, 'dailywindspeed', 'daily surface wind speed [m/s]'))
-        s += '{}\n'.format(fielddisplay(self, 'dailypressure', 'daily surface pressure [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'dailyairdensity', 'daily air density [kg/m3]'))
-        s += '{}\n'.format(fielddisplay(self, 'dailyairhumidity', 'daily air specific humidity [kg/kg]'))
-        s += '{}\n'.format(fielddisplay(self, 'rlaps', 'present day lapse rate (default is 7.4 [degree/km]; Erokhina et al. 2017)'))
-        s += '{}\n'.format(fielddisplay(self, 'desfac', 'desertification elevation factor (default is -log(2.0)/1000 [1/km]; Vizcaino et al. 2010)'))
-        s += '{}\n'.format(fielddisplay(self, 'rdl', 'longwave downward radiation decrease (default is 0.29 [W/m^2/km]; Marty et al. 2002)'))
-        s += '{}\n'.format(fielddisplay(self, 's0gcm', 'GCM reference elevation; (default is 0) [m]'))
-        s += '{}\n'.format(fielddisplay(self,'ismethod','method for calculating SMB with SEMIC. Default version of SEMIC is really slow. 0: steady, 1: transient (default: 0)'))
-        if self.ismethod: # transient mode
-            s += '{}\n'.format(fielddisplay(self,'desfacElevation','desertification elevation (default is 2000 m; Vizcaino et al. 2010)'))
-            s += '{}\n'.format(fielddisplay(self,'Tamp','amplitude of diurnal cycle [K]'))
-            s += '{}\n'.format(fielddisplay(self,'albedo','initial albedo [no unit]'))
-            s += '{}\n'.format(fielddisplay(self,'albedo_snow','initial albedo for snow [no unit]'))
-            s += '{}\n'.format(fielddisplay(self,'hice','initial thickness of ice [unit: m]'))
-            s += '{}\n'.format(fielddisplay(self,'hsnow','initial thickness of snow [unit: m]'))
-            s += '{}\n'.format(fielddisplay(self,'mask','masking for albedo. 0: ocean, 1: land, 2: ice (default: 2)'))
-            s += '{}\n'.format(fielddisplay(self,'hcrit','critical snow height for albedo [unit: m]'))
-            s += '{}\n'.format(fielddisplay(self,'rcrit','critical refreezing height for albedo [no unit]'))
-
-            s += '\nSEMIC albedo parameters.\n'
-            s += '{}\n'.format(fielddisplay(self,'albedo_scheme','albedo scheme for SEMIC. 0: none, 1: slater, 2: isba, 3: denby, 4: alex (default is 0)'))
-            s += '{}\n'.format(fielddisplay(self,'alb_smax','maximum snow albedo (default: 0.79)'))
-            s += '{}\n'.format(fielddisplay(self,'alb_smin','minimum snow albedo (default: 0.6)'))
-            s += '{}\n'.format(fielddisplay(self,'albi','background albedo for bare ice (default: 0.41)'))
-            s += '{}\n'.format(fielddisplay(self,'albl','background albedo for bare land (default: 0.07)'))
-        # albedo_scheme - 0: none, 1: slater, 2: isba, 3: denby, 4: alex.
-        if self.albedo_scheme == 0:
-            s += '\n\tSEMIC snow albedo parameter of None.\n'
-				s += '\t   albedo of snow is updated from albedo snow max (alb_smax).\n'
-            s += '\t   alb_snow = abl_smax \n '
-        elif self.albedo_scheme == 1:
-            s += '\n\tSEMIC snow albedo parameters of Slater et al, (1998).\n'
-            s += '\t   alb = alb_smax - (alb_smax - alb_smin)*tm^(3.0)\n'
-            s += '\t   tm  = 1 (tsurf > 273.15 K)\n'
-            s += '\t         tm = f*(tsurf-tmin) (tmin <= tsurf < 273.15)\n'
-            s += '\t         0 (tsurf < tmin)\n'
-            s += '\t   f = 1/(273.15-tmin)\n'
-            s += '{}\n'.format(fielddisplay(self, 'tmin', 'minimum temperature for which albedo decline become effective. (default: 263.15 K)[unit: K])'))
-            s += '{}\n'.format(fielddisplay(self, 'tmax', 'maxmium temperature for which albedo decline become effective. This value should be fixed. (default: 273.15 K)[unit: K])'))
-        elif self.albedo_scheme == 2:
-            s += '\n\tSEMIC snow albedo parameters of ISBA.? where is citation?\n'
-            s += '{}\n'.format(fielddisplay(self, 'mcrit', 'critical melt rate (default: 6e-8) [unit: m/sec]'))
-            s += '{}\n'.format(fielddisplay(self, 'wcrit', 'critical liquid water content (default: 15) [unit: kg/m2]'))
-            s += '{}\n'.format(fielddisplay(self, 'tau_a', 'dry albedo decline [unit: 1/day]'))
-            s += '{}\n'.format(fielddisplay(self, 'tau_f', 'wet albedo decline [unit: 1/day]'))
-        elif self.albedo_scheme == 3:
-            s += '\n\tSEMIC snow albedo parameters of Denby et al. (2002 Tellus)\n'
-            s += '{}\n'.format(fielddisplay(self,'mcrit','critical melt rate (defaut: 6e-8) [unit: m/sec]'))
-        elif self.albedo_scheme == 4:
-            s += '\n\tSEMIC snow albedo parameters of Alex.?\n'
-            s += '{}\n'.format(fielddisplay(self,'afac','[unit: ?]'))
-            s += '{}\n'.format(fielddisplay(self,'tmid','[unit: ?]'))
-        else:
-            raise Exception('ERROR: {} is not supported albedo scheme.'.format(self.albedo_scheme))
-
-        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        s += '\t\t{}\n'.format('0: Arithmetic (default)')
-        s += '\t\t{}\n'.format('1: Geometric')
-        s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.dailysnowfall = project3d(md, 'vector', self.dailysnowfall, 'type', 'node')
-        self.dailyrainfall = project3d(md, 'vector', self.dailyrainfall, 'type', 'node')
-        self.dailydsradiation = project3d(md, 'vector', self.dailydsradiation, 'type', 'node')
-        self.dailydlradiation = project3d(md, 'vector', self.dailydlradiation, 'type', 'node')
-        self.dailywindspeed = project3d(md, 'vector', self.dailywindspeed, 'type', 'node')
-        self.dailypressure = project3d(md, 'vector', self.dailypressure, 'type', 'node')
-        self.dailyairdensity = project3d(md, 'vector', self.dailyairdensity, 'type', 'node')
-        self.dailyairhumidity = project3d(md, 'vector', self.dailyairhumidity, 'type', 'node')
-        self.dailytemperature = project3d(md, 'vector', self.dailytemperature, 'type', 'node')
-        self.s0gcm = project3d(md, 'vector', self.s0gcm, 'type', 'node')
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
-    # }}}
-
-    def outputlists(self, md):  # {{{
-        if self.ismethod:
-            list = ['default','SmbMassBalance', 'SmbMassBalanceSnow', 'SmbMassBalanceIce',
-                  'SmbMassBalanceSecmi', 'SmbMelt', 'SmbRefreeze','SmbAccumulation',
-                  'SmbHIce', 'SmbHSnow', 'SmbAlbedo', 'SmbAlbedoSnow', 'TemperatureSEMIC',
-                  'SmbSemicQmr', 'TotalSmb', 'TotalSmbMelt', 'TotalSmbRefreeze']
-        else:
-            list = ['default','SmbMassBalance']
-        return list
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.s0gcm)):
-            self.s0gcm = np.zeros((md.mesh.numberofvertices))
-            print('      no SMBsemic.s0gcm specified: values set as zero')
-
-        self.Tamp = 3 * np.ones((md.mesh.numberofvertices,))
-        #self.albedo = 0.8 * np.ones((md.mesh.numberofvertices,))
-        #self.albedo_snow = 0.5 * np.ones((md.mesh.numberofvertices,))
-        self.hice = np.zeros((md.mesh.numberofvertices,))
-        self.hsnow = 5 * np.ones((md.mesh.numberofvertices,))
-
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        # albedo parameters
-        self.albedo_scheme = 0
-        self.alb_smax = 0.79
-        self.alb_smin = 0.6
-        self.albi = 0.41
-        self.albl = 0.07
-
-        # albedo parameters for?
-        # for slater
-        self.tmin = 263.15
-        self.tmax = 273.15
-
-        # for isba & denby
-        self.mcrit = 6e-8
-
-        # for isba
-        self.tau_a = 0.008
-        self.tau_f = 0.24
-        self.wcrit = 15.0
-
-        # for alex
-        self.tmid = 273.35
-        self.afac = -0.18
-
-        self.hcrit = 0.028 # from Krapp et al. (2017)
-        self.rcrit = 0.85 # from Krapp et al. (2017)
-
-        self.desfac = -log(2.0) / 1000
-        self.desfacElevation = 2000
-        self.rlaps = 7.4
-        self.rdl = 0.29
-
-        self.ismethod = 0
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'MasstransportAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'smb.desfac', '<=', 1, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'smb.s0gcm', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1])
-            md = checkfield(md, 'fieldname', 'smb.rlaps', '>=', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'smb.rdl', '>=', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'smb.dailysnowfall', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.dailyrainfall', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.dailydsradiation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.dailydlradiation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.dailywindspeed', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.dailypressure', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.dailyairdensity', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.dailyairhumidity', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.dailytemperature', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-
-            # TODO: transient model should be merged with SEMIC developed by Ruckamp et al. (2018)
-            md = checkfield(md, 'fieldname', 'smb.ismethod', 'numel', 1, 'values', [0, 1])
-            if self.ismethod: # transient mode
-                md = checkfield(md, 'fieldname', 'smb.desfacElevation', '>=', 0, 'numel', 1)
-                md = checkfield(md, 'fieldname', 'smb.albedo_scheme', 'NaN', 1, 'Inf', 1, 'numel', 1, 'values', [0, 1, 2, 3, 4])
-                md = checkfield(md, 'fieldname', 'smb.alb_smax', '>=', 0, 'NaN', 1, 'Inf', 1, 'numel', 1)
-                md = checkfield(md, 'fieldname', 'smb.mask', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1], 'values', [0, 1, 2])
-
-                # initial values
-                md = checkfield(md, 'fieldname', 'smb.albedo', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1])
-                md = checkfield(md, 'fieldname', 'smb.albedo_snow', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1])
-                md = checkfield(md, 'fieldname', 'smb.alb_smax', '>=', 0, '<=', 1, 'NaN', 1, 'Inf', 1, 'numel', 1)
-                md = checkfield(md, 'fieldname', 'smb.alb_smin', '>=', 0, '<=', 1, 'NaN', 1, 'Inf', 1, 'numel', 1)
-                md = checkfield(md, 'fieldname', 'smb.albi', '>=', 0, '<=', 1, 'NaN', 1, 'Inf', 1, 'numel', 1)
-                md = checkfield(md, 'fieldname', 'smb.albl', '>=', 0, '<=', 1, 'NaN', 1, 'Inf', 1, 'numel', 1)
-                md = checkfield(md, 'fieldname', 'smb.hice', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1])
-                md = checkfield(md, 'fieldname', 'smb.hsnow', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1])
-        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 12, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ismethod', 'format', 'Integer', 'values', [0, 1])
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'desfac', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'desfacElevation', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 's0gcm', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'rlaps', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'rdl', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'dailysnowfall', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'dailyrainfall', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'dailydsradiation', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'dailydlradiation', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'dailywindspeed', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'dailypressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'dailyairdensity', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'dailyairhumidity', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class' ,'smb', 'fieldname', 'dailytemperature', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        # TODO: transient mode should be merged with SEMIC developed by Ruckamp et al. (2018).
-        if self.ismethod: # transient mode
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tamp', 'format', 'DoubleMat', 'mattype', 1)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'mask', 'format', 'DoubleMat', 'mattype', 1)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'hice', 'format', 'DoubleMat', 'mattype', 1)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'hsnow', 'format', 'DoubleMat', 'mattype', 1)
-
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'hcrit', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rcrit', 'format', 'Double')
-
-            # albedo
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'albedo', 'format', 'DoubleMat', 'mattype', 1)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'albedo_snow', 'format', 'DoubleMat', 'mattype', 1)
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'albedo_scheme', 'format', 'Integer')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'albi', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'albl', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'alb_smin', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'alb_smax', 'format', 'Double')
-
-            # albedo parameters for ?
-            # for slater
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'tmin', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'tmax', 'format', 'Double')
-            # for isba & denby
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'mcrit', 'format', 'Double')
-            # for isba
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'wcrit', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'tau_a', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'tau_f', 'format', 'Double')
-            # for alex
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'tmid', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'afac', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/additionalsolidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/additionalsolidearthsolution.m	(revision 28275)
+++ 	(revision )
@@ -1,43 +1,0 @@
-%ADDITIONALSOLIDEARTHSOLUTION class definition
-%
-%   Usage:
-%      addsol=additionalsolidearthsolution();
-
-classdef additionalsolidearthsolution < solidearthsolution
-	properties (SetAccess=public) 
-	end
-	methods
-		function self = additionalsolidearthsolution(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.setdefaultparameters@solidearthsolution();
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
-				error('additionalsolidearthsolution checkconsistency error message: need to run GRD solution if you are supplying a GRD additional pattern solution');
-			end
-			self.checkconsistency@solidearthsolution(md,solution,analyses);
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   external: additionalsolidearth solution:'));
-			self.disp@solidearthsolution();
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'data',1,'name','md.solidearth.external.nature','format','Integer'); %code 1 for additionalsolidearthsolution class
-			self.marshall@solidearthsolution(prefix,md,fid);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			self.savemodeljs@solidearthsolution(fid,modelname);
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/adm1qn3inversion.m
===================================================================
--- /issm/trunk/src/m/classes/adm1qn3inversion.m	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-%ADM1QN3INVERSION class definition
-%
-%   Usage:
-%      adm1qn3inversion=adm1qn3inversion();
-
-classdef adm1qn3inversion
-	properties (SetAccess=public) 
-		iscontrol                   = 0
-		maxsteps                    = 0
-		maxiter                     = 0
-		dxmin                       = 0
-		dfmin_frac                  = 0
-		gttol                       = 0
-
-	end
-	methods
-		function self = adm1qn3inversion(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(adm1qn3inversion(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-
-			%parameter to be inferred by control methods (only
-			%drag and B are supported yet)
-			%self.control_parameters={'FrictionCoefficient'};
-
-			%number of iterations
-			self.maxsteps=20;
-			self.maxiter=40;
-
-			%m1qn3 parameters
-			self.dxmin      = 0.1;
-			self.dfmin_frac = 1.;
-			self.gttol      = 1e-4;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~self.iscontrol, return; end
-
-			if ~IssmConfig('_HAVE_M1QN3_'),
-				md = checkmessage(md,['M1QN3 has not been installed, ISSM needs to be reconfigured and recompiled with M1QN3']);
-			end
-
-			md = checkfield(md,'fieldname','inversion.iscontrol','values',[0 1]);
-			md = checkfield(md,'fieldname','inversion.maxsteps','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.maxiter','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.dxmin','numel',1,'>',0);
-         md = checkfield(md,'fieldname','inversion.dfmin_frac','numel',1,'>=',0., '<=', 1.);
-			md = checkfield(md,'fieldname','inversion.gttol','numel',1,'>',0);
-
-	end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   adm1qn3inversion parameters:'));
-			fielddisplay(self,'iscontrol','is inversion activated?');
-			fielddisplay(self,'maxsteps','maximum number of iterations (gradient computation)');
-			fielddisplay(self,'maxiter','maximum number of Function evaluation (forward run)');
-			fielddisplay(self,'dxmin','convergence criterion: two points less than dxmin from eachother (sup-norm) are considered identical');
-         fielddisplay(self,'dfmin_frac','expected reduction of J during the first step (e.g., 0.3=30% reduction in cost function)');
-			fielddisplay(self,'gttol','convergence criterion: ||g(X)||/||g(X0)|| (g(X0): gradient at initial guess X0)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');
-			WriteData(fid,prefix,'name','md.inversion.type','data',4,'format','Integer');
-			if ~self.iscontrol, return; end
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','dxmin','format','Double');
-         WriteData(fid,prefix,'object',self,'class','inversion','fieldname','dfmin_frac','format','Double');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double');
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.inversion.iscontrol'],self.iscontrol);
-			writejsdouble(fid,[modelname '.inversion.maxsteps'],self.maxsteps);
-			writejsdouble(fid,[modelname '.inversion.maxiter'],self.maxiter);
-			writejsdouble(fid,[modelname '.inversion.dxmin'],self.dxmin);
-         writejsdouble(fid,[modelname '.inversion.dfmin_frac'],self.dfmin_frac);
-			writejsdouble(fid,[modelname '.inversion.gttol'],self.gttol);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/age.m
===================================================================
--- /issm/trunk/src/m/classes/age.m	(revision 28275)
+++ 	(revision )
@@ -1,115 +1,0 @@
-%AGE class definition
-%
-%   Usage:
-%      age=age();
-
-classdef age
-	properties (SetAccess=public)
-		 spcage                 = NaN;
-		 stabilization          = 0;
-		 requested_outputs      = {};
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. If the input is a struct it is an old version of this class and
-			% old fields must be recovered (make sure they are in the deprecated
-			% model properties)
-
-			if verLessThan('matlab','7.9'),
-				disp('Warning: your matlab version is old and there is a risk that load does not work correctly');
-				disp('         if the model is not loaded correctly, rename temporarily loadobj so that matlab does not use it');
-
-				% This is a Matlab bug: all the fields of md have their default value
-				% Example of error message:
-				% Warning: Error loading an object of class 'model':
-				% Undefined function or method 'exist' for input arguments of type 'cell'
-				%
-				% This has been fixed in MATLAB 7.9 (R2009b) and later versions
-			end
-
-			if isstruct(self)
-				disp('Recovering age from older version');
-				self = structtoobj(age(),self);
-			end
-		end% }}}
-	end
-	methods
-		function self = age(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('age');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.spcage=project3d(md,'vector',self.spcage,'type','node');
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-
-			list = {'Age'};
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Type of stabilization to use 0:nothing 1:artificial_diffusivity
-			self.stabilization=2;
-
-			%default output
-			self.requested_outputs={'default'};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('AgeAnalysis',analyses) |  (strcmp(solution,'TransientSolution') & md.transient.isage==0), return; end
-			if dimension(md.mesh)~=3
-				md = checkmessage(md,['age model only supported in 3D']);
-			end
-
-			md = checkfield(md,'fieldname','age.spcage','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','age.stabilization','values',[0 1 2 4 5]);
-			md = checkfield(md,'fieldname','age.requested_outputs','stringrow',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Masstransport solution parameters:'));
-			fielddisplay(self,'spcage','Age constraint (NaN means no constraint) [yr]');
-			fielddisplay(self,'stabilization','0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 4: flux corrected transport, 5: streamline upwind Petrov-Galerkin (SUPG)');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'fieldname','spcage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.age.requested_outputs','format','StringArray');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.age.spcage'],self.spcage);
-			writejsdouble(fid,[modelname '.age.stabilization'],self.stabilization);
-			writejscellstring(fid,[modelname '.age.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/amr.js
===================================================================
--- /issm/trunk/src/m/classes/amr.js	(revision 28275)
+++ 	(revision )
@@ -1,134 +1,0 @@
-//AMR class definition
-//
-//   Usage:
-//      amr=new amr();
-
-function amr (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//hmin and hmax
-		this.hmin								= 100.;
-		this.hmax								= 100.e3;
-
-		//fields
-		this.fieldname							= "Vel";
-		this.err								= 3.;
-
-		//keep metric?
-		this.keepmetric							= 1;
-
-		//control of element lengths
-		this.gradation							= 1.5;
-
-		//other criterias
-		this.groundingline_resolution			= 500.;
-		this.groundingline_distance				= 0;
-		this.icefront_resolution				= 500;
-		this.icefront_distance					= 0;
-		this.thicknesserror_resolution			= 500;
-		this.thicknesserror_threshold			= 0;
-		this.thicknesserror_groupthreshold 		= 0;
-		this.thicknesserror_maximum				= 0;
-		this.deviatoricerror_resolution			= 500;	
-		this.deviatoricerror_threshold			= 0;	
-		this.deviatoricerror_groupthreshold		= 0;	
-		this.deviatoricerror_maximum			= 0;	
-
-		//is restart? This calls femmodel->ReMesh() before first time step. 
-		this.restart							= 0;
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   amr parameters:'));
-		fielddisplay(this,'hmin','minimum element length');
-		fielddisplay(this,'hmax','maximum element length');
-		fielddisplay(this,'fieldname','name of input that will be used to compute the metric (should be an input of FemModel)');
-		fielddisplay(this,'keepmetric','indicates whether the metric should be kept every remeshing time');
-		fielddisplay(this,'gradation','maximum ratio between two adjacent edges');
-		fielddisplay(this,'groundingline_resolution','element length near the grounding line');
-		fielddisplay(this,'groundingline_distance','distance around the grounding line which elements will be refined');
-		fielddisplay(this,'icefront_resolution','element length near the ice front');
-		fielddisplay(this,'icefront_distance','distance around the ice front which elements will be refined');
-		fielddisplay(this,'thicknesserror_resolution','element length when thickness error estimator is used');
-		fielddisplay(this,'thicknesserror_threshold','maximum threshold thickness error permitted');
-		fielddisplay(this,'thicknesserror_groupthreshold','maximum group threshold thickness error permitted');
-		fielddisplay(this,'thicknesserror_maximum','maximum thickness error permitted');
-		fielddisplay(this,'deviatoricerror_resolution','element length when deviatoric stress error estimator is used');
-		fielddisplay(this,'deviatoricerror_threshold','maximum threshold deviatoricstress error permitted');
-		fielddisplay(this,'deviatoricerror_groupthreshold','maximum group threshold deviatoricstress error permitted');
-		fielddisplay(this,'deviatoricerror_maximum','maximum deviatoricstress error permitted');
-		fielddisplay(this,'deviatoricerror_maximum','maximum deviatoricstress error permitted');
-		fielddisplay(this,'restart','indicates if ReMesh() will call before first time step');
-	}// }}}
-	this.classname= function(){// {{{
-		return "amr";
-
-	}// }}}
-	this.checkconsistency = function(md,solution,analyses) { //{{{
-		checkfield(md,'fieldname','amr.hmax','numel',[1],'>',0,'NaN',1);
-		checkfield(md,'fieldname','amr.hmin','numel',[1],'>',0,'<',this.hmax,'NaN',1);
-		checkfield(md,'fieldname','amr.keepmetric','numel',[1],'>=',0,'<=',1,'NaN',1);
-		checkfield(md,'fieldname','amr.gradation','numel',[1],'>=',1.1,'<=',5,'NaN',1);
-		checkfield(md,'fieldname','amr.groundingline_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1);
-		checkfield(md,'fieldname','amr.groundingline_distance','numel',[1],'>=',0,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','amr.icefront_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1);
-		checkfield(md,'fieldname','amr.icefront_distance','numel',[1],'>=',0,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','amr.thicknesserror_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1);
-		checkfield(md,'fieldname','amr.thicknesserror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-		checkfield(md,'fieldname','amr.thicknesserror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-		checkfield(md,'fieldname','amr.thicknesserror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','amr.deviatoricerror_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1);
-		checkfield(md,'fieldname','amr.deviatoricerror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-		checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-		checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','amr.restart','numel',[1],'>=',0,'<=',1,'NaN',1);
-	} // }}}
-	this.marshall=function(md,prefix,fid) { //{{{
-		WriteData(fid,prefix,'name','md.amr.type','data',1,'format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','hmin','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','hmax','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','fieldname','format','String');
-		WriteData(fid,prefix,'object',this,'fieldname','err','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','keepmetric','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','gradation','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','groundingline_resolution','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','groundingline_distance','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','icefront_resolution','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','icefront_distance','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_resolution','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_threshold','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_groupthreshold','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_maximum','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_resolution','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_threshold','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_groupthreshold','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_maximum','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','restart','format','Integer');
-	}//}}}
-	this.fix=function() { //{{{
-	}//}}}
-	//properties 
-	// {{{
-	this.hmin								= 0.;
-	this.hmax								= 0.;
-	this.fieldname							= "";
-	this.err								= 0.;
-	this.keepmetric							= 0;
-	this.gradation							= 0.;
-	this.groundingline_resolution			= 0.;
-	this.groundingline_distance				= 0.;
-	this.icefront_resolution				= 0.;
-	this.icefront_distance					= 0.;
-	this.thicknesserror_resolution			= 0.;
-	this.thicknesserror_threshold			= 0.;
-	this.thicknesserror_groupthreshold		= 0.;
-	this.thicknesserror_maximum				= 0.;
-	this.deviatoricerror_resolution			= 0.;
-	this.deviatoricerror_threshold			= 0.;
-	this.deviatoricerror_groupthreshold		= 0.;
-	this.deviatoricerror_maximum			= 0.;
-	this.restart							= 0.;
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/amr.m
===================================================================
--- /issm/trunk/src/m/classes/amr.m	(revision 28275)
+++ 	(revision )
@@ -1,175 +1,0 @@
-%AMR Class definition
-%
-%   Usage:
-%      md.amr=amr();
-
-classdef amr
-	properties (SetAccess=public) 
-		hmin = 0.; 
-		hmax = 0.;
-		fieldname = '';
-		err = 0.;
-		keepmetric = 0;
-		gradation = 0.;
-		groundingline_resolution = 0.;
-		groundingline_distance = 0.;
-		icefront_resolution = 0.;
-		icefront_distance = 0.;
-		thicknesserror_resolution = 0.;
-		thicknesserror_threshold = 0.;
-		thicknesserror_groupthreshold = 0.;
-		thicknesserror_maximum = 0.;
-		deviatoricerror_resolution = 0.;
-		deviatoricerror_threshold = 0.;
-		deviatoricerror_groupthreshold = 0.;
-		deviatoricerror_maximum = 0.;
-		restart=0.;
-	end
-	methods (Static)
- 		function self = loadobj(self) % {{{
-         % This function is directly called by matlab when a model object is
-         % loaded. Update old properties here
-
-         if verLessThan('matlab','7.9'),
-            disp('Warning: your matlab version is old and there is a risk that load does not work correctly');
-            disp('         if the model is not loaded correctly, rename temporarily loadobj so that matlab does not use it');
-
-            % This is a Matlab bug: all the fields of md have their default value
-            % Example of error message:
-            % Warning: Error loading an object of class 'model':
-            % Undefined function or method 'exist' for input arguments of type 'cell'
-            %
-            % This has been fixed in MATLAB 7.9 (R2009b) and later versions
-         end
-
-         %2017 September 15th
-         if isstruct(self),
-            disp('WARNING: updating amr. Now the default is amr with bamg');
-            disp('         some old fields were not converted');
-            disp('         see the new fields typing md.amr and modify them properly');
-            obj2 = self;
-            self = amr();
-            %Converting region_level_max to groundingline_distance
-            if(obj2.region_level_max>0 && obj2.region_level_1>obj2.region_level_max)
-               self.groundingline_distance	= obj2.region_level_max;
-					self.keepmetric					= 0;
-					self.fieldname						= 'None';
-            end
-         end
-      end% }}}
-	end
-	methods
-		function self = amr(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%hmin and hmax
-			self.hmin=100.;
-			self.hmax=100.e3;
-
-			%fields
-			self.fieldname ='Vel';
-			self.err=3.;
-
-			%keep metric?
-			self.keepmetric=1;
-
-			%control of element lengths
-			self.gradation=1.5;
-
-			%other criteria
-			self.groundingline_resolution=500.;
-			self.groundingline_distance=0.;
-			self.icefront_resolution=500.;
-			self.icefront_distance=0.;
-			self.thicknesserror_resolution=500.;
-			self.thicknesserror_threshold=0.;
-			self.thicknesserror_groupthreshold=0.;
-			self.thicknesserror_maximum=0.;
-			self.deviatoricerror_resolution=500.;
-			self.deviatoricerror_threshold=0.;
-			self.deviatoricerror_groupthreshold=0.;
-			self.deviatoricerror_maximum=0.;
-			
-			%is restart? This calls femmodel->ReMesh() before first time step. 
-			self.restart=0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','amr.hmax','numel',[1],'>',0,'NaN',1);
-			md = checkfield(md,'fieldname','amr.hmin','numel',[1],'>',0,'<',self.hmax,'NaN',1);
-			%md = checkfield(md,'fieldname','amr.fieldname','string',[1]);
-			md = checkfield(md,'fieldname','amr.keepmetric','numel',[1],'>=',0,'<=',1,'NaN',1);
-			md = checkfield(md,'fieldname','amr.gradation','numel',[1],'>=',1.1,'<=',5,'NaN',1);
-			md = checkfield(md,'fieldname','amr.groundingline_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1);
-			md = checkfield(md,'fieldname','amr.groundingline_distance','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','amr.icefront_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1);
-			md = checkfield(md,'fieldname','amr.icefront_distance','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','amr.thicknesserror_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1);
-			md = checkfield(md,'fieldname','amr.thicknesserror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-			md = checkfield(md,'fieldname','amr.thicknesserror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-			md = checkfield(md,'fieldname','amr.thicknesserror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','amr.deviatoricerror_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1);
-			md = checkfield(md,'fieldname','amr.deviatoricerror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-			md = checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-			md = checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','amr.restart','numel',[1],'>=',0,'<=',1,'NaN',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   amr parameters:'));
-
-			fielddisplay(self,'hmin',['minimum element length']);
-			fielddisplay(self,'hmax',['maximum element length']);
-			fielddisplay(self,'fieldname',['name of input that will be used to compute the metric (should be an input of FemModel)']);
-			fielddisplay(self,'keepmetric',['indicates whether the metric should be kept every remeshing time']);
-			fielddisplay(self,'gradation',['maximum ratio between two adjacent edges']);
-			fielddisplay(self,'groundingline_resolution',['element length near the grounding line']);
-			fielddisplay(self,'groundingline_distance',['distance around the grounding line which elements will be refined']);
-			fielddisplay(self,'icefront_resolution',['element length near the ice front']);
-			fielddisplay(self,'icefront_distance',['distance around the ice front which elements will be refined']);
-			fielddisplay(self,'thicknesserror_resolution',['element length when thickness error estimator is used']);
-			fielddisplay(self,'thicknesserror_threshold',['maximum threshold thickness error permitted']);
-			fielddisplay(self,'thicknesserror_groupthreshold',['maximum group threshold thickness error permitted']);
-			fielddisplay(self,'thicknesserror_maximum',['maximum thickness error permitted']);
-			fielddisplay(self,'deviatoricerror_resolution',['element length when deviatoric stress error estimator is used']);
-			fielddisplay(self,'deviatoricerror_threshold',['maximum threshold deviatoricstress error permitted']);
-			fielddisplay(self,'deviatoricerror_groupthreshold',['maximum group threshold deviatoricstress error permitted']);
-			fielddisplay(self,'deviatoricerror_maximum',['maximum deviatoricstress error permitted']);
-			fielddisplay(self,'restart',['indicates if ReMesh() will call before first time step']);
-		end % }}}
-			function savemodeljs(self,fid,modelname) % {{{
-			%error('not implemented yet!');
-		end % }}}
-	function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'name','md.amr.type','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','hmin','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','hmax','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','fieldname','format','String');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','err','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','keepmetric','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','gradation','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','groundingline_resolution','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','groundingline_distance','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','icefront_resolution','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','icefront_distance','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_resolution','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_threshold','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_groupthreshold','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_maximum','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_resolution','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_threshold','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_groupthreshold','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_maximum','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','restart','format','Integer');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/amr.py
===================================================================
--- /issm/trunk/src/m/classes/amr.py	(revision 28275)
+++ 	(revision )
@@ -1,135 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class amr(object):
-    """AMR Class definition
-
-    Usage:
-        amr = amr()
-    """
-
-    def __init__(self):  # {{{
-        self.hmin = 0
-        self.hmax = 0
-        self.fieldname = ''
-        self.err = 0
-        self.keepmetric = 0
-        self.gradation = 0
-        self.groundingline_resolution = 0
-        self.groundingline_distance = 0
-        self.icefront_resolution = 0
-        self.icefront_distance = 0
-        self.thicknesserror_resolution = 0
-        self.thicknesserror_threshold = 0
-        self.thicknesserror_groupthreshold = 0
-        self.thicknesserror_maximum = 0
-        self.deviatoricerror_resolution = 0
-        self.deviatoricerror_threshold = 0
-        self.deviatoricerror_groupthreshold = 0
-        self.deviatoricerror_maximum = 0
-        self.restart = 0
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   amr parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'hmin', 'minimum element length'))
-        s += '{}\n'.format(fielddisplay(self, 'hmax', 'maximum element length'))
-        s += '{}\n'.format(fielddisplay(self, 'fieldname', 'name of input that will be used to compute the metric (should be an input of FemModel)'))
-        s += '{}\n'.format(fielddisplay(self, 'keepmetric', 'indicates whether the metric should be kept every remeshing time'))
-        s += '{}\n'.format(fielddisplay(self, 'gradation', 'maximum ratio between two adjacent edges'))
-        s += '{}\n'.format(fielddisplay(self, 'groundingline_resolution', 'element length near the grounding line'))
-        s += '{}\n'.format(fielddisplay(self, 'groundingline_distance', 'distance around the grounding line which elements will be refined'))
-        s += '{}\n'.format(fielddisplay(self, 'icefront_resolution', 'element length near the ice front'))
-        s += '{}\n'.format(fielddisplay(self, 'icefront_distance', 'distance around the ice front which elements will be refined'))
-        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_resolution', 'element length when thickness error estimator is used'))
-        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_threshold', 'maximum threshold thickness error permitted'))
-        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_groupthreshold', 'maximum group threshold thickness error permitted'))
-        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_maximum', 'maximum thickness error permitted'))
-        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_resolution', 'element length when deviatoric stress error estimator is used'))
-        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_threshold', 'maximum threshold deviatoricstress error permitted'))
-        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_groupthreshold', 'maximum group threshold deviatoric stress error permitted'))
-        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_maximum', 'maximum deviatoricstress error permitted'))
-        s += '{}\n'.format(fielddisplay(self, 'restart', 'indicates if ReMesh() will call before first time step'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.hmin = 100
-        self.hmax = 100e3
-
-        # Fields
-        self.fieldname = 'Vel'
-        self.err = 3
-
-        # Keep metric?
-        self.keepmetric = 1
-
-        # Control of element lengths
-        self.gradation = 1.5
-
-        # Other criteria
-        self.groundingline_resolution = 500
-        self.groundingline_distance = 0
-        self.icefront_resolution = 500
-        self.icefront_distance = 0
-        self.thicknesserror_resolution = 500
-        self.thicknesserror_threshold = 0
-        self.thicknesserror_groupthreshold = 0
-        self.thicknesserror_maximum = 0
-        self.deviatoricerror_resolution = 500
-        self.deviatoricerror_threshold = 0
-        self.deviatoricerror_groupthreshold = 0
-        self.deviatoricerror_maximum = 0
-
-        # Is restart? This calls femmodel->ReMesh() before first time step.
-        self.restart = 0
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'amr.hmax', 'numel', [1], '>', 0, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.hmin', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.keepmetric', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.gradation', 'numel', [1], '>=', 1.1, '<=', 5, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.groundingline_resolution', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.groundingline_distance', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'amr.icefront_resolution', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.icefront_distance', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'amr.thicknesserror_resolution', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.thicknesserror_threshold', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.thicknesserror_groupthreshold', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.thicknesserror_maximum', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'amr.deviatoricerror_resolution', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.deviatoricerror_threshold', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.deviatoricerror_groupthreshold', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
-        md = checkfield(md, 'fieldname', 'amr.deviatoricerror_maximum', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'amr.restart', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
-        return md
-   # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.amr.type', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hmin', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hmax', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'fieldname', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'err', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'keepmetric', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'gradation', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundingline_resolution', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundingline_distance', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'icefront_resolution', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'icefront_distance', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thicknesserror_resolution', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thicknesserror_threshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thicknesserror_groupthreshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thicknesserror_maximum', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deviatoricerror_resolution', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deviatoricerror_threshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deviatoricerror_groupthreshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deviatoricerror_maximum', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'amr', 'fieldname', 'restart', 'format', 'Integer')
-    # }}}
Index: sm/trunk/src/m/classes/amrneopz.m
===================================================================
--- /issm/trunk/src/m/classes/amrneopz.m	(revision 28275)
+++ 	(revision )
@@ -1,159 +1,0 @@
-%AMRNEOPZ Class definition
-%
-%   Usage:
-%      md.amr=amrneopz();
-
-classdef amrneopz
-	properties (SetAccess=public) 
-		level_max								= 0; 
-		gradation								= 0;
-      lag										= 0;
-		groundingline_distance				= 0;
-      icefront_distance						= 0;
-      thicknesserror_threshold			= 0;
-      thicknesserror_groupthreshold 	= 0;
-      thicknesserror_maximum				= 0;
-		deviatoricerror_threshold			= 0;
-		deviatoricerror_groupthreshold	= 0;
-		deviatoricerror_maximum				= 0;
-		restart									= 0;
-	end
-   methods (Static)
-      %function self = loadobj(self) % {{{
-         % This function is directly called by matlab when a model object is
-         % loaded. Update old properties here
-
-			%if verLessThan('matlab','7.9'),
-         %   disp('Warning: your matlab version is old and there is a risk that load does not work correctly');
-         %   disp('         if the model is not loaded correctly, rename temporarily loadobj so that matlab does not use it');
-
-            % This is a Matlab bug: all the fields of md have their default value
-            % Example of error message:
-            % Warning: Error loading an object of class 'model':
-            % Undefined function or method 'exist' for input arguments of type 'cell'
-            %
-            % This has been fixed in MATLAB 7.9 (R2009b) and later versions
-			%end
-
-         %2017 September 15th
-         %if isstruct(self),
-         %   disp('WARNING: updating amr');
-         %   disp('         md.amr.region_level_max is now md.amr.radius_level_max');
-         %   disp('         md.amr.region_level_1 is not being used; now gradation is used instead');
-         %   obj2 						= self;
-         %   self 						= amr();
-         %   %Converting region_level_1 to gradation
-			%	if(obj2.region_level_max>0 && obj2.region_level_1>obj2.region_level_max) 
-			%		alpha=0;
-			%		if(obj2.level_max>1) alpha=log(obj2.region_level_1/obj2.region_level_max)/(obj2.level_max-1);end
-			%		self.radius_level_max			= obj2.region_level_max;
-			%		self.level_max						= obj2.level_max;
-			%		self.gradation						= exp(alpha);
-         %   	self.lag								= 1.0;
-			%		self.groundingline_distance 	= 0;
-			%		self.icefront_distance 			= 0;
-			%		self.thicknesserror_threshold = 0;
-			%		self.deviatoricerror_threshold= 0;
-			%	end
-         %end
-
-			%2017 November 24th
-			%radius_level_max was deleted!
-
-			%2017 December 18th
-			%group threshold was inserted
-
-      %end% }}}
-   end
-	methods
-		function self = amrneopz(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%filter parameters:
-			self.level_max								= 2;
-			self.gradation								= 1.5;
-			self.lag										= 1.1;
-		
- 			%other criterias
-         self.groundingline_distance			= 10000;
-         self.icefront_distance					= 0;
-         self.thicknesserror_threshold			= 0;
-         self.thicknesserror_groupthreshold	= 0;
-			self.thicknesserror_maximum			= 0; 
-			self.deviatoricerror_threshold		= 0;
-			self.deviatoricerror_groupthreshold = 0;
-			self.deviatoricerror_maximum			= 0;
-			self.restart								= 0;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','amr.level_max','numel',[1],'>=',0,'<=',5);
-   		md = checkfield(md,'fieldname','amr.gradation','numel',[1],'>=',1.1,'<=',5.0,'NaN',1);
-   		md = checkfield(md,'fieldname','amr.lag','numel',[1],'>=',1.0,'<=',3.0,'NaN',1);
-         md = checkfield(md,'fieldname','amr.groundingline_distance','numel',[1],'>=',0,'NaN',1,'Inf',1);
-         md = checkfield(md,'fieldname','amr.icefront_distance','numel',[1],'>=',0,'NaN',1,'Inf',1);
-         md = checkfield(md,'fieldname','amr.thicknesserror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-         md = checkfield(md,'fieldname','amr.thicknesserror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-         md = checkfield(md,'fieldname','amr.thicknesserror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','amr.deviatoricerror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1);			
-			md = checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);			
-         md = checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);		
-		   md = checkfield(md,'fieldname','amr.restart','numel',[1],'>=',0,'<=',1,'NaN',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   amrneopz parameters:'));
-
-			fielddisplay(self,'level_max',['maximum refinement level (1, 2, 3, 4 or 5)']);
-			fielddisplay(self,'gradation',['maximum ratio between two adjacent edges']);
-			fielddisplay(self,'lag',['lag used to unrefine the elements']);
-         fielddisplay(self,'groundingline_distance',['distance around the grounding line which elements will be refined']);
-         fielddisplay(self,'icefront_distance',['distance around the ice front which elements will be refined']);
-         fielddisplay(self,'thicknesserror_threshold',['maximum threshold thickness error permitted']);
-         fielddisplay(self,'thicknesserror_groupthreshold',['maximum group threshold thickness error permitted']);
-         fielddisplay(self,'thicknesserror_maximum',['maximum thickness error permitted']);
-			fielddisplay(self,'deviatoricerror_threshold',['maximum threshold deviatoricstress error permitted']);
-			fielddisplay(self,'deviatoricerror_groupthreshold',['maximum group threshold deviatoricstress error permitted']);
-			fielddisplay(self,'deviatoricerror_maximum',['maximum deviatoricstress error permitted']);
-         fielddisplay(self,'restart',['indicates if ReMesh() will call before first time step']);
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'name','md.amr.type','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','level_max','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','gradation','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','lag','format','Double');
-         WriteData(fid,prefix,'object',self,'class','amr','fieldname','groundingline_distance','format','Double');
-         WriteData(fid,prefix,'object',self,'class','amr','fieldname','icefront_distance','format','Double');
-         WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_threshold','format','Double');
-         WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_groupthreshold','format','Double');
-         WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_maximum','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_threshold','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_groupthreshold','format','Double');
-			WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_maximum','format','Double');
-		   WriteData(fid,prefix,'object',self,'class','amr','fieldname','restart','format','Integer');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.amr.level_max'],self.level_max);
-			writejsdouble(fid,[modelname '.amr.gradation'],self.gradation);
-			writejsdouble(fid,[modelname '.amr.lag'],self.lag);
-			writejsdouble(fid,[modelname '.amr.groundingline_distance'],self.groundingline_distance);
-			writejsdouble(fid,[modelname '.amr.icefront_distance'],self.icefront_distance);
-			writejsdouble(fid,[modelname '.amr.thicknesserror_threshold'],self.thicknesserror_threshold);
-			writejsdouble(fid,[modelname '.amr.thicknesserror_groupthreshold'],self.thicknesserror_threshold);
-			writejsdouble(fid,[modelname '.amr.thicknesserror_maximum'],self.thicknesserror_maximum);
-			writejsdouble(fid,[modelname '.amr.deviatoricerror_threshold'],self.deviatoricerror_threshold);
-			writejsdouble(fid,[modelname '.amr.deviatoricerror_groupthreshold'],self.deviatoricerror_threshold);
-			writejsdouble(fid,[modelname '.amr.deviatoricerror_maximum'],self.deviatoricerror_maximum);
-			writejsdouble(fid,[modelname '.amr.restart'],self.restart);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/autodiff.js
===================================================================
--- /issm/trunk/src/m/classes/autodiff.js	(revision 28275)
+++ 	(revision )
@@ -1,240 +1,0 @@
-//AUTODIFF class definition
-//
-//   Usage:
-//      autodiff=new autodiff();
-
-function autodiff (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		this.obufsize     = 524288;
-		this.lbufsize     = 524288;
-		this.cbufsize     = 524288;
-		this.tbufsize     = 524288;
-		this.gcTriggerRatio=2.0;
-		this.gcTriggerMaxSize=65536;
-		this.tapeAlloc    = 15000000;
-
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   automatic differentiation parameters:'));
-		fielddisplay(this,'isautodiff','indicates if the automatic differentiation is activated');
-		fielddisplay(this,'dependents','list of dependent variables');
-		fielddisplay(this,'independents','list of independent variables');
-		fielddisplay(this,'driver',"ADOLC driver ('fos_forward' or 'fov_forward')");
-		fielddisplay(this,'obufsize','Number of operations per buffer (==OBUFSIZE in usrparms.h)');
-		fielddisplay(this,'lbufsize','Number of locations per buffer (==LBUFSIZE in usrparms.h)');
-		fielddisplay(this,'cbufsize','Number of values per buffer (==CBUFSIZE in usrparms.h)');
-		fielddisplay(this,'tbufsize','Number of taylors per buffer (<=TBUFSIZE in usrparms.h)');
-		fielddisplay(this,'gcTriggerRatio','free location block sorting/consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio');
-		fielddisplay(this,'gcTriggerMaxSize','free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize');
-		fielddisplay(this,'tapeAlloc','Iteration count of a priori memory allocation of the AD tape');
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "autodiff";
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses){ //{{{
-
-			//Early return 
-			if (!this.isautodiff) return; 
-
-			//Driver value:
-			checkfield(md,'fieldname','autodiff.driver','values',['fos_forward','fov_forward','fov_forward_all','fos_reverse','fov_reverse','fov_reverse_all']);
-			
-			//buffer values: 
-			checkfield(md,'fieldname','autodiff.obufsize','>=',16);
-			checkfield(md,'fieldname','autodiff.lbufsize','>=',16);
-			checkfield(md,'fieldname','autodiff.cbufsize','>=',16);
-			checkfield(md,'fieldname','autodiff.tbufsize','>=',16);
-			checkfield(md,'fieldname','autodiff.gcTriggerRatio','>=',0);
-			checkfield(md,'fieldname','autodiff.gcTriggerMaxSize','>=',65536);
-			checkfield(md,'fieldname','autodiff.tapeAlloc','>=',0);
-
-			//go through our dependents and independents and check consistency: 
-			for (var i=0;i<this.dependents.length;i++){
-				dep=this.dependents[i];
-				dep.checkconsistency(md,solution,analyses);
-			}
-			for (var i=0;i<this.independents.length;i++){
-				indep=this.independents[i];
-				indep.checkconsistency(md,i,solution,analyses,this.driver);
-			}
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			WriteData(fid,prefix,'object',this,'fieldname','isautodiff','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','driver','format','String');
-
-			//early return
-			if (!this.isautodiff){
-				WriteData(fid,prefix,'data',false,'name','md.autodiff.mass_flux_segments_present','format','Boolean');
-				WriteData(fid,prefix,'data',false,'name','md.autodiff.keep','format','Boolean');
-				return;
-			}
-
-			//buffer sizes {{{
-			WriteData(fid,prefix,'object',this,'fieldname','obufsize','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','lbufsize','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','cbufsize','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','tbufsize','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','gcTriggerRatio','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','gcTriggerMaxSize','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','tapeAlloc','format','Integer');
-			//}}}
-			//process dependent variables {{{
-			num_dependent_objects=this.dependents.length;
-			WriteData(fid,prefix,'data',num_dependent_objects,'name','md.autodiff.num_dependent_objects','format','Integer');
-
-			if(num_dependent_objects){
-				var names=[];
-				types=NewArrayFill(num_dependent_objects,0);
-				indices=NewArrayFill(num_dependent_objects,0);
-
-				for (var i=0;i<num_dependent_objects;i++){
-					dep=this.dependents[i];
-
-					names.push(dep.name);
-					types[i]=dep.typetoscalar();
-					indices[i]=dep.index;
-				}
-				WriteData(fid,prefix,'data',names,'name','md.autodiff.dependent_object_names','format','StringArray');
-				WriteData(fid,prefix,'data',types,'name','md.autodiff.dependent_object_types','format','IntMat','mattype',3);
-				WriteData(fid,prefix,'data',indices,'name','md.autodiff.dependent_object_indices','format','IntMat','mattype',3);
-			}
-			//}}}
-			//process independent variables {{{
-			num_independent_objects=this.independents.length;
-			WriteData(fid,prefix,'data',num_independent_objects,'name','md.autodiff.num_independent_objects','format','Integer');
-
-			if(num_independent_objects){
-				names=NewArrayFill(num_independent_objects,0);
-				types=NewArrayFill(num_independent_objects,0);
-
-				for (var i=0;i<num_independent_objects;i++){
-					indep=this.independents[i];
-
-					names[i]=indep.name;
-					types[i]=indep.typetoscalar();
-				}
-				WriteData(fid,prefix,'data',names,'name','md.autodiff.independent_object_names','format','StringArray');
-				WriteData(fid,prefix,'data',types,'name','md.autodiff.independent_object_types','format','IntMat','mattype',3);
-			}
-			//}}}
-			//if driver is fos_forward, build index:  {{{
-			if (this.driver == 'fos_forward'){
-				var index=0;
-
-				for (var i=0;i<num_independent_objects;i++){
-					indep=this.independents[i];
-					if (!(isNaN(indep.fos_forward_index))){
-						index=index+indep.fos_forward_index;
-						break;
-					}
-					else{
-						if (indep.type=='scalar') index=index+1;
-						else index=index+indep.nods;
-					}
-				}
-				index=index-1; //get c-index numbering going
-				WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_forward_index','format','Integer');
-			}
-			//}}}
-			//if driver is fos_reverse, build index:  {{{
-			if (this.driver  == 'fos_reverse'){
-				var index=0;
-
-				for (var i=0;i<num_dependent_objects;i++){
-					dep=this.dependents[i];
-					if (!(isNaN(dep.fos_reverse_index))){
-						index=index+dep.fos_reverse_index;
-						break;
-					}
-					else{
-						if (dep.type =='scalar') index=index+1;
-						else index=index+dep.nods;
-					}
-				}
-				index=index-1; //get c-index numbering going
-				WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_reverse_index','format','Integer');
-			}
-			//}}}
-			//if driver is fov_forward, build indices:  {{{
-			if (this.driver == 'fov_forward'){
-				var indices=0;
-
-				for (var i=0;i<num_independent_objects;i++){
-					indep=this.independents[i];
-					if (!indep.fos_forward_index.length){
-						indices=indices+indep.fov_forward_indices;
-						break;
-					}
-					else{
-						if (indep.type =='scalar') indices=indices+1;
-						else indices=indices+indep.nods;
-					}
-				}
-				indices=indices-1; //get c-indices numbering going
-				WriteData(fid,prefix,'data',indices,'name','md.autodiff.fov_forward_indices','format','IntMat','mattype',3);
-			}
-			//}}}
-			//deal with mass fluxes:  {{{
-			mass_flux_segments=[];
-			for (var i=0;i<num_dependent_objects;i++){
-				dep=this.dependents[i];
-				if (dep.name =='MassFlux'){
-					mass_flux_segments.push(dep.segments);
-				}
-			}
-			if (mass_flux_segments.length){
-				WriteData(fid,prefix,'data',mass_flux_segments,'name','md.autodiff.mass_flux_segments','format','MatArray');
-				flag=true;
-			}
-			else flag=false;
-			WriteData(fid,prefix,'data',flag,'name','md.autodiff.mass_flux_segments_present','format','Boolean');
-			//}}}
-			//deal with trace keep on: {{{
-			keep=false;
-
-			//From ADOLC userdoc: 
-			// The optional integer argument keep of trace on determines whether the numerical values of all active variables are 
-			// recorded in a buffered temporary array or file called the taylor stack. This option takes effect if keep = 1 and 
-			// prepares the scene for an immediately following gradient evaluation by a call to a routine implementing the reverse 
-			// mode as described in the Section 4 and Section 5. 
-			//
-
-			if (this.driver.length<=3) keep=false; //there is no "_reverse" string within the driver string: 
-			else{
-				if (this.driver.splice(4) == '_reverse') keep=true;
-				else keep=false;
-			}
-			WriteData(fid,prefix,'data',keep,'name','md.autodiff.keep','format','Boolean');
-			//}}}
-		}//}}}
-		this.fix=function() { //{{{
-			this.obufsize=NullFix(this.obufsize,NaN);
-			this.lbufsize=NullFix(this.lbufsize,NaN);
-			this.cbufsize=NullFix(this.cbufsize,NaN);
-			this.tbufsize=NullFix(this.tbufsize,NaN);
-			this.gcTriggerRatio=NullFix(this.gcTriggerRatio,NaN);
-			this.gcTriggerMaxSize=NullFix(this.gcTriggerMaxSize,NaN);
-			this.tapeAlloc=NullFix(this.tapeAlloc,NaN);
-		}//}}}
-	//properties 
-	// {{{
-	this.isautodiff   = false;
-	this.dependents   = [];
-	this.independents = [];
-	this.driver       = 'fos_forward';
-	this.obufsize     = NaN;
-	this.lbufsize     = NaN;
-	this.cbufsize     = NaN;
-	this.tbufsize     = NaN;
-	this.gcTriggerRatio = NaN;
-	this.gcTriggerMaxSize = NaN;
-	this.tapeAlloc = NaN;
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/autodiff.m
===================================================================
--- /issm/trunk/src/m/classes/autodiff.m	(revision 28275)
+++ 	(revision )
@@ -1,242 +1,0 @@
-%AUTODIFF class definition
-%
-%   Usage:
-%      autodiff=autodiff();
-
-classdef autodiff
-	properties (SetAccess=public)  
-		% {{{ 
-		isautodiff   = false;
-		dependents   = {};
-		independents = {};
-		driver       = 'fos_forward';
-		obufsize     = NaN;
-		lbufsize     = NaN;
-		cbufsize     = NaN;
-		tbufsize     = NaN;
-		gcTriggerRatio = NaN;
-		gcTriggerMaxSize = NaN;
-		tapeAlloc = NaN;
-		end
-		%}}}
-	methods
-		function self = autodiff(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		self.obufsize     = 524288;
-		self.lbufsize     = 524288;
-		self.cbufsize     = 524288;
-		self.tbufsize     = 524288;
-		self.gcTriggerRatio=2.0;
-		self.gcTriggerMaxSize=65536;
-		self.tapeAlloc    = 15000000;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return 
-			if ~self.isautodiff, return; end
-
-			%Driver value:
-			md = checkfield(md,'fieldname','autodiff.driver','values',{'fos_forward','fov_forward','fov_forward_all','fos_reverse','fov_reverse','fov_reverse_all'});
-			
-			%buffer values: 
-			md = checkfield(md,'fieldname','autodiff.obufsize','>=',16);
-			md = checkfield(md,'fieldname','autodiff.lbufsize','>=',16);
-			md = checkfield(md,'fieldname','autodiff.cbufsize','>=',16);
-			md = checkfield(md,'fieldname','autodiff.tbufsize','>=',16);
-			md = checkfield(md,'fieldname','autodiff.gcTriggerRatio','>=',0);
-			md = checkfield(md,'fieldname','autodiff.gcTriggerMaxSize','>=',65536);
-			md = checkfield(md,'fieldname','autodiff.tapeAlloc','>=',0);
-
-			%go through our dependents and independents and check consistency: 
-			for i=1:numel(self.dependents),
-				dep=self.dependents{i};
-				if isempty(dep)
-					md = checkmessage(md,['md.autodiff.dependents{' num2str(i) '} is empty!']);
-				else
-					md=checkconsistency(dep,md,solution,analyses);
-				end
-			end
-			for i=1:numel(self.independents),
-				indep=self.independents{i};
-				if isempty(indep)
-					md = checkmessage(md,['md.autodiff.independents{' num2str(i) '} is empty!']);
-				else
-					md=checkconsistency(indep,md,i,solution,analyses,self.driver);
-				end
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   automatic differentiation parameters:'));
-			fielddisplay(self,'isautodiff','indicates if the automatic differentiation is activated');
-			fielddisplay(self,'dependents','list of dependent variables');
-			fielddisplay(self,'independents','list of independent variables');
-			fielddisplay(self,'driver','ADOLC driver (''fos_forward'' or ''fov_forward'')');
-			fielddisplay(self,'obufsize','Number of operations per buffer (==OBUFSIZE in usrparms.h)');
-			fielddisplay(self,'lbufsize','Number of locations per buffer (==LBUFSIZE in usrparms.h)');
-			fielddisplay(self,'cbufsize','Number of values per buffer (==CBUFSIZE in usrparms.h)');
-			fielddisplay(self,'tbufsize','Number of taylors per buffer (<=TBUFSIZE in usrparms.h)');
-			fielddisplay(self,'gcTriggerRatio','free location block sorting/consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio');
-			fielddisplay(self,'gcTriggerMaxSize','free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize');
-			fielddisplay(self,'tapeAlloc','Iteration count of a priori memory allocation of the AD tape');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'object',self,'fieldname','isautodiff','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','driver','format','String');
-
-			%early return
-			if ~self.isautodiff,
-				WriteData(fid,prefix,'data',false,'name','md.autodiff.mass_flux_segments_present','format','Boolean');
-				WriteData(fid,prefix,'data',false,'name','md.autodiff.keep','format','Boolean');
-				return;
-			end
-
-			%buffer sizes {{{
-			WriteData(fid,prefix,'object',self,'fieldname','obufsize','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','lbufsize','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','cbufsize','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','tbufsize','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','gcTriggerRatio','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','gcTriggerMaxSize','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','tapeAlloc','format','Integer');
-			%}}}
-			%process dependent variables {{{
-			num_dependent_objects=numel(self.dependents);
-			WriteData(fid,prefix,'data',num_dependent_objects,'name','md.autodiff.num_dependent_objects','format','Integer');
-
-			if(num_dependent_objects),
-				names={};
-				for i=1:num_dependent_objects,
-					dep=self.dependents{i};
-					names{i}=dep.name;
-				end
-				WriteData(fid,prefix,'data',names,'name','md.autodiff.dependent_object_names','format','StringArray');
-			end
-			%}}}
-			%process independent variables {{{
-			num_independent_objects=numel(self.independents);
-			WriteData(fid,prefix,'data',num_independent_objects,'name','md.autodiff.num_independent_objects','format','Integer');
-			for i=1:num_independent_objects
-				indep=self.independents{i};
-				WriteData(fid,prefix,'data',indep.name,'name','md.autodiff.independent_name','format','String');
-				WriteData(fid,prefix,'data',indep.typetoscalar(),'name','md.autodiff.independent_type','format','Integer');
-				WriteData(fid,prefix,'data',indep.min_parameters,'name','md.autodiff.independent_min_parameters','format','DoubleMat','mattype',3);
-				WriteData(fid,prefix,'data',indep.max_parameters,'name','md.autodiff.independent_max_parameters','format','DoubleMat','mattype',3);
-				WriteData(fid,prefix,'data',indep.control_scaling_factor,'name','md.autodiff.independent_scaling_factor','format','Double');
-				WriteData(fid,prefix,'data',indep.control_size,'name','md.autodiff.independent_control_size','format','Integer');
-			end
-			%}}}
-			%if driver is fos_forward, build index:  {{{
-			if strcmpi(self.driver,'fos_forward'),
-				index=0;
-
-				for i=1:num_independent_objects,
-					indep=self.independents{i};
-					if ~isnan(indep.fos_forward_index),
-						index=index+indep.fos_forward_index;
-						break;
-					else
-						if strcmpi(indep.type,'scalar'),
-							index=index+1;
-						else
-							index=index+indep.nods;
-						end
-					end
-				end
-				index=index-1; %get c-index numbering going
-				WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_forward_index','format','Integer');
-			end
-			%}}}
-			%if driver is fos_reverse, build index:  {{{
-			if strcmpi(self.driver,'fos_reverse'),
-				index=0;
-
-				for i=1:num_dependent_objects,
-					dep=self.dependents{i};
-					if ~isnan(dep.fos_reverse_index),
-						index=index+dep.fos_reverse_index;
-						break;
-					else
-						index=index+1;
-					end
-				end
-				index=index-1; %get c-index numbering going
-				WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_reverse_index','format','Integer');
-			end
-			%}}}
-			%if driver is fov_forward, build indices:  {{{
-			if strcmpi(self.driver,'fov_forward'),
-				indices=0;
-
-				for i=1:num_independent_objects,
-					indep=self.independents{i};
-					if ~isempty(indep.fos_forward_index),
-						indices=indices+indep.fov_forward_indices;
-						break;
-					else
-						if strcmpi(indep.type,'scalar'),
-							indices=indices+1;
-						else
-							indices=indices+indep.nods;
-						end
-					end
-				end
-				indices=indices-1; %get c-indices numbering going
-				WriteData(fid,prefix,'data',indices,'name','md.autodiff.fov_forward_indices','format','IntMat','mattype',3);
-			end
-			%}}}
-			%deal with mass fluxes:  {{{
-			mass_flux_segments=cell(0,1);
-			for i=1:num_dependent_objects,
-				dep=self.dependents{i};
-				if strcmpi(dep.name,'MassFlux'),
-					mass_flux_segments{end+1,1}=dep.segments;
-				end
-			end
-			if ~isempty(mass_flux_segments), 
-				WriteData(fid,prefix,'data',mass_flux_segments,'name','md.autodiff.mass_flux_segments','format','MatArray');
-				flag=true;
-			else
-				flag=false;
-			end
-			WriteData(fid,prefix,'data',flag,'name','md.autodiff.mass_flux_segments_present','format','Boolean');
-			%}}}
-			%deal with trace keep on: {{{
-			keep=false;
-
-			%From ADOLC userdoc: 
-			% The optional integer argument keep of trace on determines whether the numerical values of all active variables are 
-			% recorded in a buffered temporary array or file called the taylor stack. This option takes effect if keep = 1 and 
-			% prepares the scene for an immediately following gradient evaluation by a call to a routine implementing the reverse 
-			% mode as described in the Section 4 and Section 5. 
-			%
-
-			if length(self.driver)<=3,
-				keep=false; %there is no "_reverse" string within the driver string: 
-			else
-				if strncmpi(self.driver(4:end),'_reverse',8),
-					keep=true;
-				else
-					keep=false;
-				end
-			end
-			WriteData(fid,prefix,'data',keep,'name','md.autodiff.keep','format','Boolean');
-			%}}}
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			%do nothing for now
-			if self.isautodiff,
-				error('autodiff savemodeljs error message: not implemented yet!');
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/autodiff.py
===================================================================
--- /issm/trunk/src/m/classes/autodiff.py	(revision 28275)
+++ 	(revision )
@@ -1,209 +1,0 @@
-import numpy as np
-from dependent import dependent
-from independent import independent
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-from MatlabArray import *
-
-
-class autodiff(object):
-    """autodiff class definition
-
-    Usage:
-        autodiff = autodiff()
-    """
-    def __init__(self, *args):  # {{{
-        self.isautodiff = False
-        self.dependents = []
-        self.independents = []
-        self.driver = 'fos_forward'
-        self.obufsize = np.nan
-        self.lbufsize = np.nan
-        self.cbufsize = np.nan
-        self.tbufsize = np.nan
-        self.gcTriggerMaxSize = np.nan
-        self.gcTriggerRatio = np.nan
-        self.tapeAlloc = np.nan
-        if not len(args):
-            self.setdefaultparameters()
-        else:
-            raise RuntimeError("constructor not supported")
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '      automatic differentiation parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'isautodiff', "indicates if the automatic differentiation is activated"))
-        s += '{}\n'.format(fielddisplay(self, 'dependents', "list of dependent variables"))
-        s += '{}\n'.format(fielddisplay(self, 'independents', "list of independent variables"))
-        s += '{}\n'.format(fielddisplay(self, 'driver', "ADOLC driver ('fos_forward' or 'fov_forward')"))
-        s += '{}\n'.format(fielddisplay(self, 'obufsize', "Number of operations per buffer (== OBUFSIZE in usrparms.h)"))
-        s += '{}\n'.format(fielddisplay(self, 'lbufsize', "Number of locations per buffer (== LBUFSIZE in usrparms.h)"))
-        s += '{}\n'.format(fielddisplay(self, 'cbufsize', "Number of values per buffer (== CBUFSIZE in usrparms.h)"))
-        s += '{}\n'.format(fielddisplay(self, 'tbufsize', "Number of taylors per buffer (<=TBUFSIZE in usrparms.h)"))
-        s += '{}\n'.format(fielddisplay(self, 'gcTriggerRatio', "free location block sorting / consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio"))
-        s += '{}\n'.format(fielddisplay(self, 'gcTriggerMaxSize', "free location block sorting / consolidation triggered if the allocated locations exceed gcTriggerMaxSize)"))
-        s += '{}\n'.format(fielddisplay(self, 'tapeAlloc', 'Iteration count of a priori memory allocation of the AD tape'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.obufsize = 524288
-        self.lbufsize = 524288
-        self.cbufsize = 524288
-        self.tbufsize = 524288
-        self.gcTriggerRatio = 2.0
-        self.gcTriggerMaxSize = 65536
-        self.tapeAlloc = 15000000
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if not self.isautodiff:
-            return md
-
-        md = checkfield(md, 'fieldname', 'autodiff.obufsize', '>=', 524288)
-        md = checkfield(md, 'fieldname', 'autodiff.lbufsize', '>=', 524288)
-        md = checkfield(md, 'fieldname', 'autodiff.cbufsize', '>=', 524288)
-        md = checkfield(md, 'fieldname', 'autodiff.tbufsize', '>=', 524288)
-        md = checkfield(md, 'fieldname', 'autodiff.gcTriggerRatio', '>=', 2.0)
-        md = checkfield(md, 'fieldname', 'autodiff.gcTriggerMaxSize', '>=', 65536)
-        md = checkfield(md, 'fieldname', 'autodiff.tapeAlloc', '>=', 0)
-
-        # Driver value
-        md = checkfield(md, 'fieldname', 'autodiff.driver', 'values', ['fos_forward', 'fov_forward', 'fov_forward_all', 'fos_reverse', 'fov_reverse', 'fov_reverse_all'])
-
-        # Go through our dependents and independents and check consistency
-        for dep in self.dependents:
-            dep.checkconsistency(md, solution, analyses)
-        for i, indep in enumerate(self.independents):
-            indep.checkconsistency(md, i, solution, analyses, self.driver)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isautodiff', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'driver', 'format', 'String')
-
-        # Early return
-        if not self.isautodiff:
-            WriteData(fid, prefix, 'data', False, 'name', 'md.autodiff.mass_flux_segments_present', 'format', 'Boolean')
-            WriteData(fid, prefix, 'data', False, 'name', 'md.autodiff.keep', 'format', 'Boolean')
-            return
-
-        # Buffer sizes
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'obufsize', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'lbufsize', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'cbufsize', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'tbufsize', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'gcTriggerRatio', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'gcTriggerMaxSize', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'tapeAlloc', 'format', 'Integer')
-
-        # Process dependent variables
-        num_dependent_objects = len(self.dependents)
-        WriteData(fid, prefix, 'data', num_dependent_objects, 'name', 'md.autodiff.num_dependent_objects', 'format', 'Integer')
-
-        if num_dependent_objects:
-            names = []
-            for i, dep in enumerate(self.dependents):
-                names.append(dep.name)
-
-            WriteData(fid, prefix, 'data', names, 'name', 'md.autodiff.dependent_object_names', 'format', 'StringArray')
-
-        # Process independent variables
-        num_independent_objects = len(self.independents)
-        WriteData(fid, prefix, 'data', num_independent_objects, 'name', 'md.autodiff.num_independent_objects', 'format', 'Integer')
-
-        for indep in self.independents:
-            WriteData(fid, prefix, 'data', indep.name, 'name', 'md.autodiff.independent_name', 'format', 'String')
-            WriteData(fid, prefix, 'data', indep.typetoscalar(), 'name', 'md.autodiff.independent_type', 'format', 'Integer')
-            WriteData(fid, prefix, 'data', indep.min_parameters, 'name','md.autodiff.independent_min_parameters','format', 'DoubleMat', 'mattype', 3)
-            WriteData(fid, prefix, 'data', indep.max_parameters, 'name', 'md.autodiff.independent_max_parameters', 'format', 'DoubleMat', 'mattype', 3)
-            WriteData(fid, prefix, 'data', indep.control_scaling_factor, 'name', 'md.autodiff.independent_scaling_factor', 'format', 'Double')
-            WriteData(fid, prefix, 'data', indep.control_size, 'name', 'md.autodiff.independent_control_size', 'format', 'Integer')
-
-        # If driver is fos_forward, build index
-        if strcmpi(self.driver, 'fos_forward'):
-            index = 0
-
-            for indep in self.independents:
-                if not np.isnan(indep.fos_forward_index):
-                    index += indep.fos_forward_index
-                    break
-                else:
-                    if strcmpi(indep.type, 'scalar'):
-                        index += 1
-                    else:
-                        index += indep.nods
-
-            index -= 1  # get c-index numbering going
-            WriteData(fid, prefix, 'data', index, 'name', 'md.autodiff.fos_forward_index', 'format', 'Integer')
-
-        # If driver is fos_reverse, build index
-        if strcmpi(self.driver, 'fos_reverse'):
-            index = 0
-
-            for dep in self.dependents:
-                if not np.isnan(dep.fos_reverse_index):
-                    index += dep.fos_reverse_index
-                    break
-                else:
-                    index += 1
-
-            index -= 1  # get c-index numbering going
-            WriteData(fid, prefix, 'data', index, 'name', 'md.autodiff.fos_reverse_index', 'format', 'Integer')
-
-        # If driver is fov_forward, build indices
-        if strcmpi(self.driver, 'fov_forward'):
-            indices = 0
-
-            for indep in self.independents:
-                if indep.fos_forward_index:
-                    indices += indep.fov_forward_indices
-                    break
-                else:
-                    if strcmpi(indep.type, 'scalar'):
-                        indices += 1
-                    else:
-                        indices += indep.nods
-
-            indices -= 1  # get c-indices numbering going
-            WriteData(fid, prefix, 'data', indices, 'name', 'md.autodiff.fov_forward_indices', 'format', 'IntMat', 'mattype', 3)
-
-        # Deal with mass fluxes
-        mass_flux_segments = [dep.segments for dep in self.dependents if strcmpi(dep.name, 'MassFlux')]
-
-        if mass_flux_segments:
-            WriteData(fid, prefix, 'data', mass_flux_segments, 'name', 'md.autodiff.mass_flux_segments', 'format', 'MatArray')
-            flag = True
-        else:
-            flag = False
-        WriteData(fid, prefix, 'data', flag, 'name', 'md.autodiff.mass_flux_segments_present', 'format', 'Boolean')
-
-        # Deal with trace keep on
-        keep = False
-
-        # From ADOLC userdoc:
-        # The optional integer argument keep of trace on determines whether the 
-        # numerical values of all active variables are recorded in a buffered 
-        # temporary array or file called the taylor stack. This option takes 
-        # effect if keep = 1 and prepares the scene for an immediately 
-        # following gradient evaluation by a call to a routine implementing the 
-        # reverse mode as described in the Section 4 and Section 5.
-        #
-        if len(self.driver) <= 3:
-            keep = False  # there is no "_reverse" string within the driver string
-        else:
-            if strncmpi(self.driver[3:], '_reverse', 8):
-                keep = True
-            else:
-                keep = False
-        WriteData(fid, prefix, 'data', keep, 'name', 'md.autodiff.keep', 'format', 'Boolean')
-    # }}}
-
-        return
-    # }}}
Index: sm/trunk/src/m/classes/balancethickness.js
===================================================================
--- /issm/trunk/src/m/classes/balancethickness.js	(revision 28275)
+++ 	(revision )
@@ -1,64 +1,0 @@
-//BALANCETHICKNESS class definition
-//
-//   Usage:
-//      balancethickness=new balancethickness();
-
-function balancethickness (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//Type of stabilization used
-		this.stabilization=1;
-
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   balance thickness solution parameters:'));
-
-		fielddisplay(this,'spcthickness','thickness constraints (NaN means no constraint) [m]');
-		fielddisplay(this,'thickening_rate','ice thickening rate used in the mass conservation (dh/dt) [m/yr]');
-		fielddisplay(this,'stabilization',"0: None, 1: SU, 2: SSA's artificial diffusivity, 3:DG");
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "balancethickness";
-
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses){ // {{{
-			//Early return
-			if (solution!='BalancethicknessSolution')return;
-
-			checkfield(md,'fieldname','balancethickness.spcthickness');
-			checkfield(md,'fieldname','balancethickness.thickening_rate','size',[md.mesh.numberofvertices ,1],'NaN',1,'Inf',1);
-			checkfield(md,'fieldname','balancethickness.stabilization','size',[1, 1],'values',[0, 1, 2 ,3]);
-			//checkfield(md,'fieldname','balancethickness.omega','size',[md.mesh.numberofvertices ,1],'NaN',1,'Inf',1,'>=',0);
-		} //}}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			var yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',this,'fieldname','spcthickness','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1/yts);
-			WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
-
-			WriteData(fid,prefix,'object',this,'fieldname','slopex','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','slopey','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','omega','format','DoubleMat','mattype',1);
-
-		}//}}}
-		this.fix=function() { //{{{
-			this.spcthickness=NullFix(this.spcthickness,NaN);
-			this.thicknening_rate=NullFix(this.thicknening_rate,NaN);
-			this.omega=NullFix(this.omega,NaN);
-		}//}}}
-	//properties 
-	// {{{
-	this.spcthickness      = NaN;
-	this.thickening_rate   = NaN;
-	this.stabilization     = 0;
-
-	this.omega             = NaN;
-	this.slopex            = NaN;
-	this.slopey            = NaN;
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/balancethickness.m
===================================================================
--- /issm/trunk/src/m/classes/balancethickness.m	(revision 28275)
+++ 	(revision )
@@ -1,70 +1,0 @@
-%BALANCETHICKNESS class definition
-%
-%   Usage:
-%      balancethickness=balancethickness();
-
-classdef balancethickness
-	properties (SetAccess=public) 
-		spcthickness      = NaN;
-		thickening_rate   = NaN;
-		stabilization     = 0;
-
-		omega             = NaN;
-		slopex            = NaN;
-		slopey            = NaN;
-	end
-	methods
-		function self = balancethickness(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Type of stabilization used
-			self.stabilization=1;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if ~strcmp(solution,'BalancethicknessSolution'), return; end
-
-			md = checkfield(md,'fieldname','balancethickness.spcthickness');
-			md = checkfield(md,'fieldname','balancethickness.thickening_rate','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','balancethickness.stabilization','size',[1 1],'values',[0 1 2 3]);
-
-			%md = checkfield(md,'fieldname','balancethickness.omega','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1,'>=',0);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   balance thickness solution parameters:'));
-
-			fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint) [m]');
-			fielddisplay(self,'thickening_rate','ice thickening rate used in the mass conservation (dh/dt) [m/yr]');
-			fielddisplay(self,'stabilization','0: None, 1: SU, 2: SSA''s artificial diffusivity, 3:DG');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer');
-
-			WriteData(fid,prefix,'object',self,'fieldname','slopex','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','slopey','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','omega','format','DoubleMat','mattype',1);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.balancethickness.spcthickness'],self.spcthickness);
-			writejs1Darray(fid,[modelname '.balancethickness.thickening_rate'],self.thickening_rate);
-			writejsdouble(fid,[modelname '.balancethickness.stabilization'],self.stabilization);
-			writejs1Darray(fid,[modelname '.balancethickness.omega'],self.omega);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/balancethickness.py
===================================================================
--- /issm/trunk/src/m/classes/balancethickness.py	(revision 28275)
+++ 	(revision )
@@ -1,62 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class balancethickness(object):
-    """
-    BALANCETHICKNESS class definition
-
-       Usage:
-          balancethickness = balancethickness()
-    """
-
-    def __init__(self):  # {{{
-        self.spcthickness = float('NaN')
-        self.thickening_rate = float('NaN')
-        self.stabilization = 0
-        self.omega = float('NaN')
-        self.slopex = float('NaN')
-        self.slopey = float('NaN')
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = '   balance thickness solution parameters:'
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'spcthickness', 'thickness constraints (NaN means no constraint) [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'thickening_rate', 'ice thickening rate used in the mass conservation (dh / dt) [m / yr]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', "0: None, 1: SU, 2: SSA's artificial diffusivity, 3:DG"))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #Type of stabilization used
-        self.stabilization = 1
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if not solution == 'BalancethicknessSolution':
-            return md
-
-        md = checkfield(md, 'fieldname', 'balancethickness.spcthickness')
-        md = checkfield(md, 'fieldname', 'balancethickness.thickening_rate', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'balancethickness.stabilization', 'size', [1], 'values', [0, 1, 2, 3])
-    #md = checkfield(md, 'fieldname', 'balancethickness.omega', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1, '>=', 0)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thickening_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'slopex', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'slopey', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'omega', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
Index: sm/trunk/src/m/classes/bamggeom.js
===================================================================
--- /issm/trunk/src/m/classes/bamggeom.js	(revision 28275)
+++ 	(revision )
@@ -1,49 +1,0 @@
-//BAMGGEOM class definition
-//
-//   Usage:
-//      bamggeom(varargin)
-
-function bamggeom(){
-	//methods
-	this.constructor = function(args) {// {{{
-		//BAMGGEOM - constructor for bamggeom object
-		//
-		//   Usage:
-		//      bamggeom = bamggeom(varargin)
-
-		//initialize list
-        switch (args.length) {
-            case 0:
-				//if no input arguments, create a default object
-                break;
-            case 1:
-                var object = args[0];
-                for (var field in object) {
-                    if (object.hasOwnProperty(field)) {
-                        this[field] = object[field];
-                    }
-                }
-                break;
-            default:
-				throw Error('bamggeom constructor error message: unknown type of constructor call');
-        }
-	}// }}}
-    this.disp= function(){// {{{
-        disp(sprintf('\n%s = \n', 'bamggeom'));
-        disp(this);
-    }// }}}
-
-    //properties 
-    // {{{
-    this.Vertices           = [];
-    this.Edges              = [];
-    this.TangentAtEdges     = [];
-    this.Corners            = [];
-    this.RequiredVertices   = [];
-    this.RequiredEdges      = [];
-    this.CrackedEdges       = [];
-    this.SubDomains         = [];
-
-	this.constructor(arguments);
-    //}}}
-}
Index: sm/trunk/src/m/classes/bamggeom.m
===================================================================
--- /issm/trunk/src/m/classes/bamggeom.m	(revision 28275)
+++ 	(revision )
@@ -1,51 +1,0 @@
-%BAMGGEOM class definition
-%
-%   Usage:
-%      bamggeom(varargin)
-
-classdef bamggeom
-	properties (SetAccess=public) 
-		% {{{
-		Vertices=[];
-		Edges=[];
-		TangentAtEdges=[];
-		Corners=[];
-		RequiredVertices=[];
-		RequiredEdges=[];
-		CrackedEdges=[];
-		SubDomains=[];
-		% }}}
-	end
-	methods
-		function bg = bamggeom(varargin)% {{{
-		%BAMGGEOM - constructor for bamggeom object
-		%
-		%   Usage:
-		%      bamggeom = bamggeom(varargin)
-
-		switch nargin
-			case 0
-				% if no input arguments, create a default object
-
-			case 1
-
-				bg=bamggeom;
-				object=varargin{1};
-				fields=fieldnames(object);
-				for i=1:length(fields)
-					field=fields{i};
-					if ismember(field,properties('bamggeom')),
-						bg.(field)=object.(field);
-					end
-				end
-
-			otherwise
-				error('bamggeom constructor error message: unknown type of constructor call');
-			end
-		end%}}}
-		function display(bg)% {{{
-			disp(sprintf('\n%s = \n',inputname(1)));
-			disp(struct(bg))
-		end%}}}
-	end
-end
Index: sm/trunk/src/m/classes/bamggeom.py
===================================================================
--- /issm/trunk/src/m/classes/bamggeom.py	(revision 28275)
+++ 	(revision )
@@ -1,47 +1,0 @@
-import numpy as np
-
-
-class bamggeom(object):
-    """
-    BAMGGEOM class definition
-
-       Usage:
-          bamggeom(varargin)
-    """
-
-    def __init__(self, *args):  # {{{
-        self.Vertices = np.empty((0, 3))
-        self.Edges = np.empty((0, 3))
-        self.TangentAtEdges = np.empty((0, 4))
-        self.Corners = np.empty((0, 1))
-        self.RequiredVertices = np.empty((0, 1))
-        self.RequiredEdges = np.empty((0, 1))
-        self.CrackedEdges = np.empty((0, 0))
-        self.SubDomains = np.empty((0, 4))
-
-        if not len(args):
-            # if no input arguments, create a default object
-            pass
-
-        elif len(args) == 1:
-            object = args[0]
-            for field in list(object.keys()):
-                if field in vars(self):
-                    setattr(self, field, object[field])
-
-        else:
-            raise TypeError("bamggeom constructor error message: unknown type of constructor call")
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = "class '%s' object '%s'=\n" % (type(self), 'self')
-        s += "    Vertices: %s\n" % str(self.Vertices)
-        s += "    Edges: %s\n" % str(self.Edges)
-        s += "    TangentAtEdges: %s\n" % str(self.TangentAtEdges)
-        s += "    Corners: %s\n" % str(self.Corners)
-        s += "    RequiredVertices: %s\n" % str(self.RequiredVertices)
-        s += "    RequiredEdges: %s\n" % str(self.RequiredEdges)
-        s += "    CrackedEdges: %s\n" % str(self.CrackedEdges)
-        s += "    SubDomains: %s\n" % str(self.SubDomains)
-        return s
-    # }}}
Index: sm/trunk/src/m/classes/bamgmesh.js
===================================================================
--- /issm/trunk/src/m/classes/bamgmesh.js	(revision 28275)
+++ 	(revision )
@@ -1,57 +1,0 @@
-//BAMGMESH class definition
-//
-//   Usage:
-//      bamgmesh(varargin)
-
-function bamgmesh(){
-	//methods
-	this.constructor = function(args) {// {{{
-		//BAMGMESH - constructor for bamgmesh object
-		//
-		//   Usage:
-		//      bamgmesh = bamgmesh(varargin)
-
-		//initialize list
-        switch (args.length) {
-            case 0:
-				//if no input arguments, create a default object
-                break;
-            case 1:
-                var object = args[0];
-                for (var field in object) {
-                    if (object.hasOwnProperty(field)) {
-                        this[field] = object[field];
-                    }
-                }
-                break;
-            default:
-				throw Error('bamggeom constructor error message: unknown type of constructor call');
-        }
-	}// }}}
-    this.disp= function(){// {{{
-        disp(sprintf('\n%s = \n', 'bamgmesh'));
-        disp(this);
-    }// }}}
-
-    //properties 
-    // {{{
-    this.Vertices                   = [];
-    this.Edges                      = [];
-    this.Triangles                  = [];
-    this.IssmEdges                  = [];
-    this.IssmSegments               = [];
-    this.VerticesOnGeomVertex       = [];
-    this.VerticesOnGeomEdge         = [];
-    this.EdgesOnGeomEdge            = [];
-    this.SubDomains                 = [];
-    this.SubDomainsFromGeom         = [];
-    this.ElementConnectivity        = [];
-    this.NodalConnectivity          = [];
-    this.NodalElementConnectivity   = [];
-    this.CrackedVertices            = [];
-    this.CrackedEdges               = [];
-    this.PreviousNumbering          = [];
-
-	this.constructor(arguments);
-    //}}}
-}
Index: sm/trunk/src/m/classes/bamgmesh.m
===================================================================
--- /issm/trunk/src/m/classes/bamgmesh.m	(revision 28275)
+++ 	(revision )
@@ -1,55 +1,0 @@
-%BAMGMESH class definition
-%
-%   Usage:
-%      bamgmesh(varargin)
-
-classdef bamgmesh
-	properties (SetAccess=public) 
-		% {{{
-		Vertices=[];
-		Edges=[];
-		Triangles=[];
-		IssmEdges=[];
-		IssmSegments=[];
-		VerticesOnGeomVertex=[];
-		VerticesOnGeomEdge=[];
-		EdgesOnGeomEdge=[];
-		SubDomains=[];
-		SubDomainsFromGeom=[];
-		ElementConnectivity=[];
-		NodalConnectivity=[];
-		NodalElementConnectivity=[];
-		CrackedVertices=[];
-		CrackedEdges=[];
-		PreviousNumbering=[];
-		% }}}
-	end
-	methods
-		function bg = bamgmesh(varargin)% {{{
-
-		switch nargin
-			case 0
-				% if no input arguments, create a default object
-
-			case 1
-
-				bg=bamgmesh;
-				object=varargin{1};
-				fields=fieldnames(object);
-				for i=1:length(fields)
-					field=fields{i};
-					if ismember(field,properties('bamgmesh')),
-						bg.(field)=object.(field);
-					end
-				end
-
-			otherwise
-				error('bamgmesh constructor error message: unknown type of constructor call');
-			end
-		end%}}}
-		function display(bm)% {{{
-			disp(sprintf('\n%s = \n',inputname(1)));
-			disp(struct(bm))
-		end%}}}
-	end
-end
Index: sm/trunk/src/m/classes/bamgmesh.py
===================================================================
--- /issm/trunk/src/m/classes/bamgmesh.py	(revision 28275)
+++ 	(revision )
@@ -1,60 +1,0 @@
-import numpy as np
-
-
-class bamgmesh(object):
-    """BAMGMESH class definition
-
-    Usage:
-        bamgmesh(varargin)
-    """
-
-    def __init__(self, *args):  # {{{
-        self.Vertices = np.empty((0, 3))
-        self.Edges = np.empty((0, 3))
-        self.Triangles = np.empty((0, 0))
-        self.IssmEdges = np.empty((0, 0))
-        self.IssmSegments = np.empty((0, 0))
-        self.VerticesOnGeomVertex = np.empty((0, 0))
-        self.VerticesOnGeomEdge = np.empty((0, 0))
-        self.EdgesOnGeomEdge = np.empty((0, 0))
-        self.SubDomains = np.empty((0, 4))
-        self.SubDomainsFromGeom = np.empty((0, 0))
-        self.ElementConnectivity = np.empty((0, 0))
-        self.NodalConnectivity = np.empty((0, 0))
-        self.NodalElementConnectivity = np.empty((0, 0))
-        self.CrackedVertices = np.empty((0, 0))
-        self.CrackedEdges = np.empty((0, 0))
-
-        if not len(args):
-            # if no input arguments, create a default object
-            pass
-
-        elif len(args) == 1:
-            object = args[0]
-            for field in list(object.keys()):
-                if field in vars(self):
-                    setattr(self, field, object[field])
-
-        else:
-            raise TypeError("bamgmesh constructor error message: unknown type of constructor call")
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = "class '%s' object '%s' = \n" % (type(self), 'self')
-        s += "    Vertices: %s\n" % str(self.Vertices)
-        s += "    Edges: %s\n" % str(self.Edges)
-        s += "    Triangles: %s\n" % str(self.Triangles)
-        s += "    IssmEdges: %s\n" % str(self.IssmEdges)
-        s += "    IssmSegments: %s\n" % str(self.IssmSegments)
-        s += "    VerticesOnGeomVertex: %s\n" % str(self.VerticesOnGeomVertex)
-        s += "    VerticesOnGeomEdge: %s\n" % str(self.VerticesOnGeomEdge)
-        s += "    EdgesOnGeomEdge: %s\n" % str(self.EdgesOnGeomEdge)
-        s += "    SubDomains: %s\n" % str(self.SubDomains)
-        s += "    SubDomainsFromGeom: %s\n" % str(self.SubDomainsFromGeom)
-        s += "    ElementConnectivity: %s\n" % str(self.ElementConnectivity)
-        s += "    NodalConnectivity: %s\n" % str(self.NodalConnectivity)
-        s += "    NodalElementConnectivity: %s\n" % str(self.NodalElementConnectivity)
-        s += "    CrackedVertices: %s\n" % str(self.CrackedVertices)
-        s += "    CrackedEdges: %s\n" % str(self.CrackedEdges)
-        return s
-    # }}}
Index: sm/trunk/src/m/classes/basalforcings.js
===================================================================
--- /issm/trunk/src/m/classes/basalforcings.js	(revision 28275)
+++ 	(revision )
@@ -1,80 +1,0 @@
-//BASAL FORCINGS class definition
-//
-//   Usage:
-//      basalforcings=basalforcings();
-
-function basalforcings(){
-	//methods
-	this.setdefaultparameters = function() {//{{{
-
-	} // }}}
-	this.disp = function(){ // {{{
-		console.log(sprintf('   basal forcings parameters:'));
-
-		fielddisplay(this,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-		fielddisplay(this,'floatingice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-		fielddisplay(this,'geothermalflux','geothermal heat flux [W/m^2]');
-
-	} // }}}
-    this.extrude = function(md) {//{{{
-        this.groundedice_melting_rate=project3d(md,'vector',this.groundedice_melting_rate,'type','node','layer',1); 
-        this.floatingice_melting_rate=project3d(md,'vector',this.floatingice_melting_rate,'type','node','layer',1); 
-        this.geothermalflux=project3d(md,'vector',this.geothermalflux,'type','node','layer',1); //bedrock only gets geothermal flux
-        return this;
-    }//}}}
-	this.classname = function(){ // {{{
-		return "basalforcings";
-	} // }}}
-		this.initialize = function (md){ // {{{
-
-			if (isNaN(this.groundedice_melting_rate)){
-				this.groundedice_melting_rate=NewArrayFill(md.mesh.numberofvertices,0);
-				console.log('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			}
-
-			if (isNaN(this.floatingice_melting_rate)){
-				this.floatingice_melting_rate=NewArrayFill(md.mesh.numberofvertices,0);
-				console.log('      no basalforcings.floatingice_melting_rate specified: values set as zero');
-			}
-
-		} // }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-
-			if(ArrayAnyEqual(ArrayIsMember('MasstransportAnalysis',analyses),1)){
-				if (!(solution=='TransientSolution' & md.trans.ismasstransport==0)){
-					checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-					checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				}
-			}
-
-			if(ArrayAnyEqual(ArrayIsMember('BalancethicknessAnalysis',analyses),1)){
-				checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			}
-			if(ArrayAnyEqual(ArrayIsMember('ThermalAnalysis',analyses),1)){
-				if (!(solution=='TransientSolution' & md.trans.isthermal==0)){
-					checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-					checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-					checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-				}
-			}
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			var yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',this,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',this,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties
-	//{{{
-	this.groundedice_melting_rate  = NaN;
-	this.floatingice_melting_rate  = NaN;
-	this.geothermalflux            = NaN;
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/basalforcings.m
===================================================================
--- /issm/trunk/src/m/classes/basalforcings.m	(revision 28275)
+++ 	(revision )
@@ -1,90 +1,0 @@
-%BASAL FORCINGS class definition
-%
-%   Usage:
-%      basalforcings=basalforcings();
-
-classdef basalforcings
-	properties (SetAccess=public) 
-		groundedice_melting_rate  = NaN;
-		floatingice_melting_rate  = NaN;
-		perturbation_melting_rate = NaN;
-		geothermalflux            = NaN;
-	end
-	methods
-		function self = basalforcings(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self =structtoobj(basalforcings(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   basal forcings parameters:'));
-
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'floatingice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'perturbation_melting_rate','(optional) perturbation in basal melting rate under floating ice [m/yr]');
-			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
-			self.floatingice_melting_rate=project3d(md,'vector',self.floatingice_melting_rate,'type','node','layer',1); 
-			self.perturbation_melting_rate=project3d(md,'vector',self.perturbation_melting_rate,'type','node','layer',1); 
-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.groundedice_melting_rate),
-				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			end
-
-			if isnan(self.floatingice_melting_rate),
-				self.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.floatingice_melting_rate specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.ismasstransport==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			end
-			if ismember('ThermalAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isthermal==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-			end
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts)
-			WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts)
-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','perturbation_melting_rate','format','DoubleMat','name','md.basalforcings.perturbation_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.basalforcings.groundedice_melting_rate'],self.groundedice_melting_rate);
-			writejs1Darray(fid,[modelname '.basalforcings.floatingice_melting_rate'],self.floatingice_melting_rate);
-			writejs1Darray(fid,[modelname '.basalforcings.perturbation_melting_rate'],self.perturbation_melting_rate);
-			writejs1Darray(fid,[modelname '.basalforcings.geothermalflux'],self.geothermalflux);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/basalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/basalforcings.py	(revision 28275)
+++ 	(revision )
@@ -1,71 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class basalforcings(object):
-    """BASAL FORCINGS class definition
-
-    Usage:
-        basalforcings = basalforcings()
-    """
-
-    def __init__(self):  # {{{
-        self.groundedice_melting_rate = np.nan
-        self.floatingice_melting_rate = np.nan
-        self.perturbation_melting_rate = np.nan
-        self.geothermalflux = np.nan
-
-        self.setdefaultparameters()
-    # }}}
-    def __repr__(self):  # {{{
-        s = '   basal forcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'floatingice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'perturbation_melting_rate', '(optional) perturbation in basal melting rate under floating ice [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'geothermalflux', 'geothermal heat flux [W/m^2]'))
-        return s
-    # }}}
-    def extrude(self, md):  # {{{
-        self.groundedice_melting_rate = project3d(md, 'vector', self.groundedice_melting_rate, 'type', 'node', 'layer', 1)
-        self.perturbation_melting_rate = project3d(md, 'vector', self.perturbation_melting_rate, 'type', 'node', 'layer', 1)
-        self.floatingice_melting_rate = project3d(md, 'vector', self.floatingice_melting_rate, 'type', 'node', 'layer', 1)
-        self.geothermalflux = project3d(md, 'vector', self.geothermalflux, 'type', 'node', 'layer', 1) # Bedrock only gets geothermal flux
-        return self
-    # }}}
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.groundedice_melting_rate)):
-            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
-            print('      no basalforcings.groundedice_melting_rate specified: values set as zero')
-        if np.all(np.isnan(self.floatingice_melting_rate)):
-            self.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
-            print('      no basalforcings.floatingice_melting_rate specified: values set as zero')
-        return self
-    # }}}
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        if 'BalancethicknessAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'ThermalAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isthermal:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.geothermalflux', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'floatingice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'perturbation_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.perturbation_melting_rate', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-    # }}}
Index: sm/trunk/src/m/classes/basalforcingsbeckmanngoosse.m
===================================================================
--- /issm/trunk/src/m/classes/basalforcingsbeckmanngoosse.m	(revision 28275)
+++ 	(revision )
@@ -1,145 +1,0 @@
-%BECKMANNGOOSSE BASAL FORCINGS class definition
-%
-%   Usage:
-%      basalforcingsbeckmanngoosse=basalforcingsbeckmanngoosse();
-
-classdef basalforcingsbeckmanngoosse
-	properties (SetAccess=public) 
-		groundedice_melting_rate  = NaN;
-		geothermalflux            = NaN;
-		meltrate_factor           = 0.;
-		ocean_temp                = 0.;
-		ocean_salinity            = NaN;
-		ocean_thermalforcing      = NaN;
-		isthermalforcing          = 0;
-	end
-	methods
-		function createxml(self,fid) % {{{
-			fprintf(fid, '\n\n');
-			fprintf(fid, '%s\n', '<!-- basalforcings -->');
-		        fprintf(fid,'%s%s%s%s%s\n%s\n%s\n','<parameter key ="geothermalflux" type="',class(self.geothermalflux),'" default="',num2str(self.geothermalflux),'">', '     <section name="basalforcings" />','     <help> geothermal heat flux [W/m^2] </help>','</parameter>');
-			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','<parameter key ="melting_rate" type="',class(self.melting_rate),'" default="',num2str(self.melting_rate),'">','     <section name="basalforcings" />','     <help> basal melting rate (positive if melting) [m/yr] </help>','</parameter>');
-			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','<parameter key ="ocean_temp" type="',class(self.ocean_temp),'" default="',num2str(self.ocean_temp),'">','     <section name="basalforcings" />','     <help> ocean_temp [degC] </help>','</parameter>');
-		        fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','<parameter key ="ocean_salinity" type="',class(self.ocean_salinity),'" default="',num2str(self.ocean_salinity),'">','     <section name="basalforcings" />','     <help> ocean_salinity [psu] </help>','</parameter>');
-		        fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','<parameter key ="ocean_thermalforcing" type="',class(self.ocean_thermalforcing),'" default="',num2str(self.ocean_thermalforcing),'">','     <section name="basalforcings" />','     <help> ocean_thermalforcing [K] </help>','</parameter>');
-        	end % }}}
-		function self = extrude(self,md) % {{{
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
-		end % }}}
-		function self = basalforcingsbeckmanngoosse(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(basalforcingsbeckmanngoosse(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.groundedice_melting_rate),
-				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			end
-			if isnan(self.ocean_temp),
-				self.ocean_temp=-1.7*ones(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.ocean_temp specified: values set as -1.7degC');
-			end
-			if isnan(self.ocean_salinity),
-				self.ocean_salinity=35.0*ones(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.ocean_salinity specified: values set as 35 psu');
-			end
-
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default values for melting parameterization
-			self.meltrate_factor        = 0.5;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if(self.isthermalforcing==0)
-				if(any(~isnan(self.ocean_thermalforcing)))
-					error('basalforcingsbeckmanngoosse has isthermalforcing=0 but has specified entries for ocean_thermalforcing (should be unused)');
-				end
-			elseif(self.isthermalforcing==1)
-				if(any(self.ocean_temp~=0) || any(~isnan(self.ocean_salinity)))
-					error('basalforcingsbeckmanngoosse has isthermalforcing=1 but has specified entries for ocean_temp or ocean_salinity (should be unused)');
-				end
-				if(strcmp(class(md.frontalforcings),'frontalforcingsrignot') && ~isequal(md.frontalforcings.thermalforcing,self.ocean_thermalforcing))
-					error('basalforcing.ocean_thermalforcing is not consistent with frontalforcings.thermalforcing')
-				end
-				if(strcmp(class(md.frontalforcings),'frontalforcingsrignotarma') && any(~isnan(self.ocean_thermalforcing)))
-					error('basalforcings has specified entries for ocean_thermalforcing, but frontalforcingsrignotarma already calculates thermalforcing internally')
-				end
-			end
-
-
-			if ismember('MasstransportAnalysis',analyses) & ~(solution=='TransientSolution' & md.transient.ismasstransport==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'universal',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','basalforcings.isthermalforcing','values',[0 1]);
-				if(self.isthermalforcing==0)
-					md = checkfield(md,'fieldname','basalforcings.ocean_temp','NaN',1,'Inf',1,'timeseries',1);
-					md = checkfield(md,'fieldname','basalforcings.ocean_salinity','NaN',1,'Inf',1,'timeseries',1);	
-				elseif(self.isthermalforcing==1 && ~strcmp(class(md.frontalforcings),'frontalforcingsrignotarma'))
-					md = checkfield(md,'fieldname','basalforcings.ocean_thermalforcing','NaN',1,'Inf',1,'timeseries',1);	
-				end
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'universal',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','basalforcings.isthermalforcing','values',[0 1]);
-				if(self.isthermalforcing==0)
-					md = checkfield(md,'fieldname','basalforcings.ocean_temp','NaN',1,'Inf',1,'timeseries',1);
-					md = checkfield(md,'fieldname','basalforcings.ocean_salinity','NaN',1,'Inf',1,'timeseries',1);	
-				elseif(self.isthermalforcing==1 && ~strcmp(class(md.frontalforcings),'frontalforcingsrignotarma'))
-					md = checkfield(md,'fieldname','basalforcings.ocean_thermalforcing','NaN',1,'Inf',1,'timeseries',1);	
-				end
-			end
-			if ismember('ThermalAnalysis',analyses) & ~(solution=='TransientSolution' & md.transient.isthermal==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-				md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'universal',1,'NaN',1,'Inf',1);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Beckmann & Goosse (2003) basal melt parameterization:'));
-
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) (m/yr)');
-			fielddisplay(self,'geothermalflux','geothermal heat flux (W/m^2)');
-			fielddisplay(self,'meltrate_factor','Melt-rate rate factor');
-			fielddisplay(self,'isthermalforcing','whether to use ocean_temp and ocean_salinity (0) or ocean_thermalforcing (1) (default:0)');
-			fielddisplay(self,'ocean_temp','ocean temperature (degC)');
-			fielddisplay(self,'ocean_salinity','ocean salinity (psu)');
-			fielddisplay(self,'ocean_thermalforcing','ocean thermalforcing (K)');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=365.2422*24.0*3600.0;
-
-			floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
-			T_f=(0.0939 - 0.057 * md.basalforcings.ocean_salinity + 7.64e-4 * md.geometry.base);
-			ocean_heat_flux = 1.5 * md.materials.rho_water * md.materials.mixed_layer_capacity * md.materials.thermal_exchange_velocity  * (md.basalforcings.ocean_temp - T_f);
-			floatingice_melting_rate=ocean_heat_flux/(md.materials.latentheat*md.materials.rho_ice);
-
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',8,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)
-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
-			WriteData(fid,prefix,'object',self,'fieldname','meltrate_factor','format','DoubleMat','mattype',1,'name','md.basalforcings.meltrate_factor');
-			WriteData(fid,prefix,'object',self,'fieldname','isthermalforcing','format','Boolean');
-			if(self.isthermalforcing==0)
-				WriteData(fid,prefix,'object',self,'fieldname','ocean_temp','format','DoubleMat','name','md.basalforcings.ocean_temp','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
-				WriteData(fid,prefix,'object',self,'fieldname','ocean_salinity','format','DoubleMat','name','md.basalforcings.ocean_salinity','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
-			elseif(self.isthermalforcing==1)
-				WriteData(fid,prefix,'object',self,'fieldname','ocean_thermalforcing','format','DoubleMat','name','md.basalforcings.ocean_thermalforcing','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/basalforcingsismip6.m
===================================================================
--- /issm/trunk/src/m/classes/basalforcingsismip6.m	(revision 28275)
+++ 	(revision )
@@ -1,107 +1,0 @@
-%ISMIP6 BASAL FORCINGS class definition
-%
-%   Usage:
-%      basalforcingsismip6=basalforcingsismip6();
-
-classdef basalforcingsismip6
-	properties (SetAccess=public) 
-		num_basins                = 0;
-		basin_id                  = NaN;
-		gamma_0                   = 0.;
-		tf                        = NaN;
-		tf_depths                 = NaN;
-		delta_t                   = NaN;
-		islocal                   = 0;
-		geothermalflux            = NaN;
-		groundedice_melting_rate  = NaN;
-		melt_anomaly              = NaN;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.basin_id=project3d(md,'vector',self.basin_id,'type','element','layer',1);
-			%self.tf=project3d(md,'vector',self.tf,'type','element','layer',1);
-			%self.delta_t=project3d(md,'vector',self.delta_t,'type','element','layer',1);
-			self.tf=project3d(md,'vector',self.tf,'type','node');
-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','element','layer',1); %bedrock only gets geothermal flux
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1);
-			self.melt_anomaly=project3d(md,'vector',self.melt_anomaly,'type','element','layer',1); %bedrock only gets geothermal flux
-		end % }}}
-		function self = basalforcingsismip6(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=setdefaultparameters(self);
-					self=structtoobj(self,varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = initialize(self,md) % {{{
-			if self.gamma_0 == 0,
-				self.gamma_0 = 14477;
-				disp('      no basalforcings.gamma_0 specified: value set to 14477 m/yr');
-			end
-			if isnan(self.groundedice_melting_rate),
-				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.gamma_0 = 14477; %m/yr
-			self.islocal = false;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','basalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','basalforcings.basin_id','Inf',1,'>=',0,'<=',md.basalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','basalforcings.gamma_0','numel',1,'NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','basalforcings.tf_depths','NaN',1,'Inf',1,'size',[1,NaN],'<=',0);
-			md = checkfield(md,'fieldname','basalforcings.delta_t','NaN',1,'Inf',1,'numel',md.basalforcings.num_basins,'size',[1,md.basalforcings.num_basins]);
-			md = checkfield(md,'fieldname','basalforcings.islocal','values',[0 1]);
-			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'>=',0,'timeseries',1);
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-			if length(md.basalforcings.melt_anomaly)>1,
-				md = checkfield(md,'fieldname','basalforcings.melt_anomaly','NaN',1,'Inf',1,'timeseries',1);
-			end
-
-			md = checkfield(md,'fieldname','basalforcings.tf','size',[1,1,numel(md.basalforcings.tf_depths)]);
-			for i=1:numel(md.basalforcings.tf_depths)
-				md = checkfield(md,'fieldname',['basalforcings.tf{' num2str(i) '}'],'field',md.basalforcings.tf{i},'size',[md.mesh.numberofvertices+1 NaN],'NaN',1,'Inf',1,'>=',0,'timeseries',1);
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   ISMIP6 basal melt rate parameterization:'));
-			fielddisplay(self,'num_basins','number of basins the model domain is partitioned into [unitless]');
-			fielddisplay(self,'basin_id','basin number assigned to each node (unitless)');
-			fielddisplay(self,'gamma_0','melt rate coefficient (m/yr)');
-			fielddisplay(self,'tf_depths','elevation of vertical layers in ocean thermal forcing dataset');
-			fielddisplay(self,'tf','thermal forcing (ocean temperature minus freezing point) (degrees C)');
-			fielddisplay(self,'delta_t','Ocean temperature correction per basin (degrees C)');
-			fielddisplay(self,'islocal','boolean to use the local version of the ISMIP6 melt rate parameterization (default false)');
-			fielddisplay(self,'geothermalflux','geothermal heat flux (W/m^2)');
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) (m/yr)');
-			fielddisplay(self,'melt_anomaly','floating ice basal melt anomaly (m/yr)');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',7,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','basin_id','data',self.basin_id-1,'name','md.basalforcings.basin_id','format','IntMat','mattype',2);   %0-indexed
-			WriteData(fid,prefix,'object',self,'fieldname','gamma_0','format','Double','scale',1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','tf_depths','format','DoubleMat','name','md.basalforcings.tf_depths');
-			WriteData(fid,prefix,'object',self,'fieldname','tf','format','MatArray','name','md.basalforcings.tf','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','delta_t','format','DoubleMat','name','md.basalforcings.delta_t','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','islocal','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','name','md.basalforcings.geothermalflux','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','melt_anomaly','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/basalforcingspico.m
===================================================================
--- /issm/trunk/src/m/classes/basalforcingspico.m	(revision 28275)
+++ 	(revision )
@@ -1,113 +1,0 @@
-%PICO BASAL FORCINGS class definition
-%
-%   Usage:
-%      basalforcingspico=basalforcingspico();
-
-classdef basalforcingspico
-	properties (SetAccess=public) 
-		num_basins                = 0;
-		basin_id                  = NaN;
-		maxboxcount               = 0;
-		overturning_coeff         = NaN;
-		gamma_T                   = 0.;
-		farocean_temperature      = NaN;
-		farocean_salinity         = NaN;
-		isplume                   = 0;
-		geothermalflux            = NaN;
-		groundedice_melting_rate  = NaN;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.basin_id=project3d(md,'vector',self.basin_id,'type','element','layer',1);
-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','element','layer',1); %bedrock only gets geothermal flux
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1);
-		end % }}}
-		function self = basalforcingspico(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=setdefaultparameters(self);
-					self=structtoobj(self,varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = initialize(self,md) % {{{
-			if isnan(self.maxboxcount),
-	            self.maxboxcount = 5;
-		   			disp('      no maximum number of boxes set, setting value to 5');
-		   end
-			if isnan(self.overturning_coeff)
-				self.overturning_coeff = 1e6*ones(md.mesh.numberofvertices,1); %m^3/s
-				disp('      no overturning strength set, setting value to 1e6');
-			end
-			if isnan(self.gamma_T)
-				self.gamma_T = 2e-5; %m/s
-				disp('      no turbulent temperature exchange velocity set, setting value to 2e-5');
-			end
-			if isnan(self.groundedice_melting_rate),
-				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.maxboxcount       = 5;
-			self.overturning_coeff = 1e6; %m^3/s
-			self.gamma_T           = 2e-5; %m/s
-			self.isplume           = false;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-				md = checkfield(md,'fieldname','basalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
-				md = checkfield(md,'fieldname','basalforcings.basin_id','Inf',1,'>=',0,'<=',md.basalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
-				md = checkfield(md,'fieldname','basalforcings.maxboxcount','numel',1,'NaN',1,'Inf',1,'>',0);
-				if numel(self.overturning_coeff)==1
-					md = checkfield(md,'fieldname','basalforcings.overturning_coeff','numel',1,'NaN',1,'Inf',1,'>',0);
-				else
-					md = checkfield(md,'fieldname','basalforcings.overturning_coeff','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1,'>',0);
-				end
-				md = checkfield(md,'fieldname','basalforcings.gamma_T','numel',1,'NaN',1,'Inf',1,'>',0);
-				md = checkfield(md,'fieldname','basalforcings.farocean_temperature','NaN',1,'Inf',1,'size',[md.basalforcings.num_basins+1 NaN]);
-				md = checkfield(md,'fieldname','basalforcings.farocean_salinity','NaN',1,'Inf',1,'>',0,'size',[md.basalforcings.num_basins+1 NaN]);
-				md = checkfield(md,'fieldname','basalforcings.isplume','values',[0 1]);
-				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'>=',0,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   PICO basal melt rate parameterization:'));
-			fielddisplay(self,'num_basins','number of basins the model domain is partitioned into [unitless]');
-			fielddisplay(self,'basin_id','basin number assigned to each node [unitless]');
-			fielddisplay(self,'maxboxcount','maximum number of boxes initialized under all ice shelves');
-			fielddisplay(self,'overturning_coeff','overturning strength [m^3/s]');
-			fielddisplay(self,'gamma_T','turbulent temperature exchange velocity [m/s]');
-			fielddisplay(self,'farocean_temperature','depth averaged ocean temperature in front of the ice shelf for basin i [K]');
-			fielddisplay(self,'farocean_salinity','depth averaged ocean salinity in front of the ice shelf for basin i [psu]');
-			fielddisplay(self,'isplume','boolean to use buoyant plume melt rate parameterization from Lazeroms et al., 2018 (default false)');
-			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',5,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','maxboxcount','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','overturning_coeff','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','gamma_T','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','farocean_temperature','format','DoubleMat','name','md.basalforcings.farocean_temperature','timeserieslength',md.basalforcings.num_basins+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','farocean_salinity','format','DoubleMat','name','md.basalforcings.farocean_salinity','timeserieslength',md.basalforcings.num_basins+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','basin_id','data',self.basin_id-1,'name','md.basalforcings.basin_id','format','IntMat','mattype',2);   %Change to 0-indexing
-			WriteData(fid,prefix,'object',self,'fieldname','isplume','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','name','md.basalforcings.geothermalflux','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/basin.m
===================================================================
--- /issm/trunk/src/m/classes/basin.m	(revision 28275)
+++ 	(revision )
@@ -1,230 +1,0 @@
-%BASIN class definition
-%
-%   Usage:
-%      basin=basin();
-
-classdef basin
-	properties (SetAccess=public) 
-		boundaries        = {};
-		name              = '';
-		continent         = '';
-		proj              = epsg2proj(4326);
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. Update old properties here
-		end% }}}
-	end
-	methods
-		function self = basin(varargin) % {{{
-			self=setdefaultparameters(self);
-
-			if nargin>0,
-				options=pairoptions(varargin{:}); 
-		
-				%recover field values: 
-				self.boundaries=getfieldvalue(options,'boundaries',{});
-				self.name=getfieldvalue(options,'name','');
-				self.continent=getfieldvalue(options,'continent','');
-
-				%figure out projection string: 
-				if exist(options,'epsg'),
-					if exist(options,'proj'),
-						error(['Error in constructor for basin ' self.name '. Cannot supply epsg and proj at the same time!']);
-					end
-					epsg=getfieldvalue(options,'epsg');
-					proj=epsg2proj(epsg); %convert to PROJ.4 format
-				elseif exist(options,'proj'),
-					if exist(options,'epsg'),
-						error(['Error in constructor for basin ' self.name '. Cannot supply proj and epsg at the same time!']);
-					end
-					proj=getfieldvalue(options,'proj');
-				else
-					proj='+proj=longlat +datum=WGS84 +no_defs';
-				end
-
-				self.proj=proj;
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.name='';
-			self.continent='';
-			self.proj='+proj=longlat +datum=WGS84 +no_defs'; %EPSG 4326
-			self.boundaries={};
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   basin parameters:'));
-			fielddisplay(self,'continent','continent name');
-			fielddisplay(self,'name','basin name');
-			fielddisplay(self,'proj','basin projection string (follows PROJ.4 standard)');
-			fielddisplay(self,'boundaries','list of boundary objects');
-			for i=1:length(self.boundaries),
-				disp(sprintf('             boundary #%i: %s',i,self.boundaries{i}.name));
-			end
-
-		end % }}}
-		function boolean=isnameany(self,varargin) % {{{
-			boolean=0;
-			for  i=1:length(varargin),
-				if strcmpi(self.name,varargin{i}), 
-					boolean=1;
-					break;
-				end
-			end
-		end % }}}
-		function boolean=iscontinentany(self,varargin) % {{{
-			boolean=0;
-			for  i=1:length(varargin),
-				if strcmpi(self.continent,varargin{i}), 
-					boolean=1;
-					break;
-				end
-			end
-		end % }}}
-		function output=outputname(self,varargin) % {{{
-		
-			%recover options
-			options=pairoptions(varargin{:});
-			extension=getfieldvalue(options,'extension',1);
-
-			[path,name,ext]=fileparts(self.name);
-			if extension,
-				output=[name ext];
-			else
-				output=name;
-			end
-		end % }}}
-		function plot(self,varargin) % {{{
-	
-			%add option: 
-			for i=1:length(self.boundaries),
-				self.boundaries{i}.plot('proj',self.proj,varargin{:});
-			end
-
-		end % }}}
-		function plot3d(self,varargin) % {{{
-	
-			%add option: 
-			for i=1:length(self.boundaries),
-				self.boundaries{i}.plot3d(varargin{:});
-			end
-
-		end % }}}
-		function out=contour(self,varargin) % {{{
-		
-			%recover options
-			options=pairoptions(varargin{:});
-			x=[];
-			y=[];
-
-			%go through boundaries, recover edges and project them in the basin epsg reference frame: 
-			for i=1:length(self.boundaries),
-				boundary=self.boundaries{i};
-				contour=boundary.edges();
-				[contour.x,contour.y]=gdaltransform(contour.x,contour.y,boundary.proj,self.proj);
-				x=[x;contour.x];
-				y=[y;contour.y];
-			end
-
-			%close the contour: 
-			if x(end)~=x(1) | y(end)~=y(1), 
-				x(end+1)=x(1); y(end+1)=y(1);
-			end
-
-			out.x=x;
-			out.y=y;
-			out.nods=length(x);
-		end % }}}
-		function checkconsistency(self,varargin) % {{{
-		
-			%recover options
-			options=pairoptions(varargin{:});
-
-			%figure out if two boundaries are identical: 
-			for i=1:length(self.boundaries),
-				namei=self.boundaries{i}.shpfilename; 
-				for j=i+1:length(self.boundaries),
-					namej=self.boundaries{j}.shpfilename; 
-					if strcmpi(namei,namej),
-						error(['Basin ' self.name ' has two identical boundaries named ' namei ]);
-					end
-				end
-			end
-
-			%go through boundaries and check their consistency: 
-			for i=1:length(self.boundaries),
-				boundary=self.boundaries{i};
-				boundary.checkconsistency();
-			end
-		end % }}}
-		function contourplot(self,varargin) % {{{
-			contour=self.contour();
-			plot(contour.x,contour.y,'r*-');
-
-		end % }}}
-		function output=shapefilecrop(self,varargin) % {{{
-
-			%recover options
-			options=pairoptions(varargin{:});
-			threshold=getfieldvalue(options,'threshold',.65); %.65 degrees lat,long
-			inshapefile=getfieldvalue(options,'shapefile');
-			outputshapefile=getfieldvalue(options,'outputshapefile','');
-
-			if (exist(options,'epsgshapefile') & exist(options,'projshapefile')), 
-				error('Basin shapefilecrop error message: cannot specify epsgshapefile and projshapefile at the same time');
-			end
-			if exist(options,'epsgshapefile'),
-				projshapefile=epsg2proj(getfieldvalue(options,'epsgshapefile'));
-			elseif exist(options,'projshapefile'),
-				projshapefile=getfieldvalue(options,'projshapefile');
-			else
-				error('Basin shapefilecrop error message: epsgshapefile or projshapefile should be specified');
-			end
-
-			%create list of contours that have critical length > threshold (in lat,long):
-			contours=shpread(inshapefile);
-			llist=[];
-			for i=1:length(contours),
-				contour=contours(i);
-				carea=polyarea(contour.x,contour.y);
-				clength=sqrt(carea);
-				if clength<threshold,
-					llist=[llist;i];
-				end
-			end
-			contours(llist)=[];
-
-			%project onto reference frame:
-			for i=1:length(contours),
-				h=contours(i);
-				[h.x,h.y]=gdaltransform(h.x,h.y,projshapefile,self.proj);
-				contours(i).x=h.x;
-				contours(i).y=h.y;
-			end
-
-			%only keep the contours that are inside the basin (take centroids): 
-			ba=self.contour();
-			flags=zeros(length(contours),1);
-			for i=1:length(contours),
-				h=contours(i); 
-				isin=inpolygon(h.x,h.y,ba.x,ba.y);
-				if ~isempty(find(isin==0)),
-					flags(i)=1;
-				end
-			end
-
-			pos=find(flags);
-			contours(pos)=[];
-
-			%Two options: 
-			if strcmpi(outputshapefile,''),
-				output=contours;
-			else
-				shpwrite(contours,outputshapefile);
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/basin.py
===================================================================
--- /issm/trunk/src/m/classes/basin.py	(revision 28275)
+++ 	(revision )
@@ -1,255 +1,0 @@
-from collections import OrderedDict
-import math
-
-from bamg import bamg
-import matplotlib.path as path
-import numpy as np
-
-from boundary import boundary
-from epsg2proj import epsg2proj
-from fielddisplay import fielddisplay
-from gdaltransform import gdaltransform
-from helpers import fileparts
-from inpolygon import inpolygon
-from laea import laea
-from pairoptions import pairoptions
-from polyarea import polyarea
-from shpread import shpread
-
-
-class basin(object):  # {{{
-    """BASIN class definition
-
-    Usage:
-        basin = basin()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.boundaries = []
-        self.name       = ''
-        self.continent  = ''
-        self.proj       = epsg2proj(4326)
-
-        self.setdefaultparameters()
-
-        if len(args):
-            options = pairoptions(*args)
-
-            #recover field values
-            self.boundaries = options.getfieldvalue('boundaries', [])
-            self.name = options.getfieldvalue('name', '')
-            self.continent = options.getfieldvalue('continent', '')
-
-            # figure out projection string
-            if options.exist('epsg'):
-                if options.exist('proj'):
-                    raise RuntimeError('Error in constructor for basin %s. Cannot supply epsg and proj at the same time!'.format(self.name))
-                epsg = options.getfieldvalue('epsg', '')
-                proj = epsg2proj(epsg)#convert to PROJ.4 format
-            elif options.exist('proj'):
-                if options.exist('epsg'):
-                    raise RuntimeError('Error in constructor for basin {}. Cannot supply proj and epsg at the same time!'.format(self.name))
-                proj = options.getfieldvalue('proj', '')
-            else:
-                proj = '+proj=longlat +datum=WGS84 +no_defs'
-
-            self.proj = proj
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   basin parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'continent', 'continent name'))
-        s += '{}\n'.format(fielddisplay(self, 'name', 'basin name'))
-        s += '{}\n'.format(fielddisplay(self, 'proj', 'basin projection string (follows PROJ.4 standard'))
-        s += '{}\n'.format(fielddisplay(self, 'boundaries','list of boundary objects'))
-        for i in range(len(self.boundaries)):
-            s += '             boundary #{}: {}\n'.format((i + 1), self.boundaries[i])
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.name       = ''
-        self.continent  = ''
-        self.proj       = '+proj=longlat +datum=WGS84 +no_defs' #EPSG 4326
-        self.boundaries = []
-
-        return self
-    # }}}
-
-    def isnameany(self, *args):  # {{{
-        boolean = 0
-        for arg in args:
-            if type(arg) in [np.ndarray, list]:
-                for name in arg:
-                    if name == self.name:
-                        boolean = 1
-                        break
-            elif arg == self.name:
-                boolean = 1
-                break
-        return boolean
-    # }}}
-
-    def iscontinentany(self, *args):  # {{{
-        boolean = 0
-        for arg in args:
-            if type(arg) in [np.ndarray, list]:
-                for continent in arg:
-                    if continent == self.continent:
-                        boolean = 1
-                        break
-            elif arg == self.continent:
-                boolean = 1
-                break
-        return boolean
-    # }}}
-
-    def outputname(self, *args):  # {{{
-        #recover options
-        options = pairoptions(*args)
-        extension = options.getfieldvalue('extension', 1)
-
-        path, name, ext = fileparts(*args)
-        if extension:
-            output = '{}{}'.format(name, ext)
-        else:
-            output = name
-
-        return output
-    # }}}
-
-    def plot(self, *args):  # {{{
-        #add option
-        for i in range(len(self.boundaries)):
-            self.boundaries[i].plot('proj', self.proj, *args)
-    # }}}
-
-    def plot3d(self, *args):  # {{{
-        #add option
-        for i in range(len(self.boundaries)):
-            self.boundaries[i].plot3d(*args)
-    # }}}
-
-    def contour(self, *args):  # {{{
-        #recover options
-        options = pairoptions(*args)
-        x = []
-        y = []
-
-        #go through boundaries, recover edges and project them in the basin epsg reference frame
-        for i in range(len(self.boundaries)):
-            boundary = self.boundaries[i]
-            contours = boundary.edges() # NOTE: Differs from MATLAB in that shpread returns a list
-            for j in range(len(contours)):
-                contours[j]['x'], contours[j]['y'] = gdaltransform(contours[j]['x'], contours[j]['y'], boundary.proj, self.proj)
-                if x == []:
-                    x = np.array(contours[j]['x'])
-                    y = np.array(contours[j]['y'])
-                else:
-                    x = np.concatenate((x, contours[j]['x']), axis=0)
-                    y = np.concatenate((y, contours[j]['y']), axis=0)
-
-        #close the contour
-        if x[-1] != x[0] or y[-1] != y[0]:
-            x = np.append(x, x[0])
-            y = np.append(y, y[0])
-
-        out = OrderedDict()
-        out['x'] = x
-        out['y'] = y
-        out['nods'] = len(x)
-
-        return out
-    # }}}
-
-    def checkconsistency(self, *args):  # {{{
-        #recover options
-        options = pairoptions(*args)
-
-        #figure out if two boundaries are identical
-        for i in range(len(self.boundaries)):
-            namei = self.boundaries[i].shpfilename
-            for j in range(1, len(self.boundaries)):
-                namej = self.boundaries[j].shpfilename
-                if namei == namej:
-                    raise RuntimeError('Basin {} has two identical boundaries named {}'.format(self.name, namei))
-
-        #go through boundaries and check their consistency
-        for i in range(len(self.boundaries)):
-            boundary == self.boundaries[i]
-            boundary.checkconsistency()
-    # }}}
-
-    def contourplot(self, *args):  # {{{
-        contour = self.contour()
-        plot(contour.x, contour.y, 'r*-')
-    # }}}
-
-    def shapefilecrop(self, *args):  # {{{
-        #recover options
-        options = pairoptions(*args)
-        threshold = options.getfieldvalue('threshold', .65) #.65 degrees lat, long
-        inshapefile = options.getfieldvalue('shapefile')
-        outputshapefile = options.getfieldvalue('outputshapefile', '')
-
-        if options.exist('epsgshapefile') and options.exist('projshapefile'):
-            raise RuntimeError('Basin shapefilecrop error messgae: cannot specify epsgshapefile and projshapefile at the same time')
-
-        if options.exist('epsgshapefile'):
-            projshapefile = epsg2proj(options.getfieldvalue('epsgshapefile'))
-        elif options.exist('projshapefile'):
-            projshapefile = options.getfieldvalue('projshapefile')
-        else:
-            raise RuntimeError('Basin shapefilecrop error message: epsgshapefile or projshapefile should be specified')
-
-        #create list of contours that have critical length > threshold (in lat, long)
-        contours = shpread(inshapefile)
-        llist = []
-        for i in range(len(contours)):
-            contour = contours[i]
-            carea = polyarea(contour['x'], contour['y'])
-            clength = math.sqrt(carea)
-            if clength < threshold:
-                llist.append(i)
-
-        contours_above_threshold = []
-        for i in range(len(contours)):
-            if i not in llist:
-                contours_above_threshold.append(contours[i])
-        contours = contours_above_threshold
-
-        #project onto reference frame
-        for i in range(len(contours)):
-            h = contours[i]
-            h['x'], h['y'] = gdaltransform(h['x'], h['y'], projshapefile, self.proj)
-            contours[i]['x'] = h['x']
-            contours[i]['y'] = h['y']
-
-        #only keep the contours that are inside the basin (take centroids)
-        ba = self.contour()
-        flags = np.zeros(len(contours))
-        for i in range(len(contours)):
-            h = contours[i]
-            isin = inpolygon(h['x'], h['y'], ba['x'], ba['y'])
-            if len(np.where(isin == 0)[0]):
-                flags[i] = 1
-
-        pos = flags.nonzero()[0]
-
-        contours_in_basin = []
-        for i in range(len(contours)):
-            if i not in pos:
-                contours_in_basin.append(contours[i])
-        contours = contours_in_basin
-
-        #Two options
-        output = None
-        if outputshapefile == '':
-            output = contours
-        else:
-            shpwrite(contours, outputshapefile)
-
-        return output
-    # }}}
-# }}}
Index: sm/trunk/src/m/classes/boundary.m
===================================================================
--- /issm/trunk/src/m/classes/boundary.m	(revision 28275)
+++ 	(revision )
@@ -1,243 +1,0 @@
-%BOUNDARY class definition
-%
-%   Usage:
-%      boundary=boundary();
-
-classdef boundary
-	properties (SetAccess=public) 
-		shppath           = '';
-		shpfilename       = '';
-		orientation       = 'normal';  %other value is 'reverse'
-		proj              = epsg2proj(4326); %Proj4.0  projection string. , default is WGS 84 (corresponds to epsg 4326)
-
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. Update old properties here
-		end% }}}
-	end
-	methods
-		function self = boundary(varargin) % {{{
-			self=setdefaultparameters(self);
-
-			if nargin > 0,
-				options=pairoptions(varargin{:});
-
-				%recover field values: 
-				self.shppath=getfieldvalue(options,'shppath','');
-				self.shpfilename=getfieldvalue(options,'shpfilename','');
-				self.orientation=getfieldvalue(options,'orientation','normal');
-
-				%figure out projection string: 
-				if exist(options,'epsg'),
-					if exist(options,'proj'),
-						error(['Error in constructor for boundary ' self.shppath '. Cannot supply epsg and proj at the same time!']);
-					end
-					epsg=getfieldvalue(options,'epsg');
-					proj=epsg2proj(epsg); % convert to PROJ.4 format
-				elseif exist(options,'proj'),
-					if exist(options,'epsg'),
-						error(['Error in constructor for boundary ' self.shppath '. Cannot supply proj and epsg at the same time!']);
-					end
-					proj=getfieldvalue(options,'proj');
-				else
-					proj= '+proj=longlat +datum=WGS84 +no_defs';
-				end
-				self.proj=proj;
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		self.shppath='';
-		self.shpfilename='';
-		self.orientation='normal';
-		self.proj='+proj=longlat +datum=WGS84 +no_defs'; %EPSG 4326
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   boundary parameters:'));
-
-			fielddisplay(self,'shppath','path to filename for this boundary');
-			fielddisplay(self,'shpfilename','shape file name');
-			fielddisplay(self,'orientation','orientation (default is ''normal'', can be ''reverse'')');
-			fielddisplay(self,'proj','shape file projection string (follows PROJ.4 standard)');
-
-		end % }}}
-		function output=name(self) % {{{
-			output=self.shpfilename;
-		end % }}}
-		function output=edges(self) % {{{
-
-			%read domain:
-			[path,name,ext]=fileparts(self.shpfilename);
-			if ~strcmpi(ext,'shp'),
-				ext='shp';
-			end
-			output=shpread([self.shppath '/' name '.' ext]);
-			
-			%do we reverse? 
-			if strcmpi(self.orientation,'reverse'),
-				output.x=flipud(output.x);
-				output.y=flipud(output.y);
-			end
-		end % }}}
-		function plot(self,varargin) % {{{
-			%recover options
-		
-			options=pairoptions(varargin{:});
-
-			%parse input:
-			figurenumber=getfieldvalue(options,'figure',1);
-			color=getfieldvalue(options,'color','r');
-			linewidth=getfieldvalue(options,'linewidth',1);
-			markersize=getfieldvalue(options,'markersize',1);
-			unitmultiplier=getfieldvalue(options,'unit',1);
-			radius=getfieldvalue(options,'radius',6371012);
-			aboveground=getfieldvalue(options,'aboveground',1000);
-			offset=getfieldvalue(options,'offset',.1);
-			fontsize=getfieldvalue(options,'fontsize',10);
-			label=getfieldvalue(options,'label','on');
-
-			if exist(options,'epsg'),
-				if exist(options,'proj'),
-					error('Boundary plot error message: cannot specify epsg and proj at the same time for plot projection');
-				end
-				proj=epsg2proj(getfieldvalue(options,'epsg'));
-			elseif exist(options,'proj'),
-				proj=getfieldvalue(options,'proj');
-			else
-				proj=epsg2proj(4326);
-			end
-
-			%read domain:
-			[path,name,ext]=fileparts(self.shpfilename);
-			if ~strcmpi(ext,'shp'),
-				ext='shp';
-			end
-			domain=shpread([self.shppath '/' name '.' ext]);
-
-			%convert boundary to another reference frame: {{{
-			for i=1:length(domain),
-				try, 
-					[x,y] = gdaltransform(domain(i).x,domain(i).y,self.proj,proj);
-				catch me
-					disp(me.message());
-					self.disp();
-				end
-				domain(i).x=x; domain(i).y=y;
-			end
-
-			for i=1:length(domain),
-				hold on;
-				x=domain(i).x*unitmultiplier;
-				y=domain(i).y*unitmultiplier;
-				if length(x)==1,
-					p=plot(x,y,'k*'); 
-					set(p,'MarkerSize',markersize,'Color',color);
-					if strcmpi(label,'on'),
-						t=text(x,y,self.shpfilename,'FontSize',fontsize);
-					end
-				else
-					p=plot(x,y,'k-'); 
-					set(p,'MarkerSize',markersize,'Color',color);
-					if strcmpi(label,'on'),
-						text(sum(x)/length(x),sum(y)/length(y),self.shpfilename,'FontSize',fontsize);
-					end
-				end
-				set(p,'Color',color);
-				set(p,'LineWidth',linewidth);
-			end
-			%}}}
-		end % }}}
-		function checkconsistency(self,varargin) % {{{
-			%recover options
-			options=pairoptions(varargin{:});
-			tolerance=getfieldvalue(options,'tolerance',1e-5);
-		
-			%recover edges: 
-			edges=self.edges();
-
-			if strcmpi(edges.Geometry,'Point'),
-				return;
-			else
-				%check we don't have two identical vertices: 
-				x=edges.x; y=edges.y; 
-				distance=sqrt( (x(1:end-1)-x(2:end)).^2+(y(1:end-1)-y(2:end)).^2); 
-				dmax=max(distance);
-				isidentical=find(distance<dmax*tolerance);
-				if ~isempty(isidentical),
-					error(['boundary ' shpfilename ' has two vertices extremely close to one another']);
-				end
-			end
-		end % }}}
-		function plot3d(self,varargin) % {{{
-			%recover options
-		
-			options=pairoptions(varargin{:});
-
-			%parse input:
-			figurenumber=getfieldvalue(options,'figure',1);
-			color=getfieldvalue(options,'color','r');
-			linewidth=getfieldvalue(options,'linewidth',1);
-			markersize=getfieldvalue(options,'markersize',1);
-			unitmultiplier=getfieldvalue(options,'unit',1);
-			radius=getfieldvalue(options,'radius',6371012);
-			aboveground=getfieldvalue(options,'aboveground',1000);
-			offset=getfieldvalue(options,'offset',.1);
-			fontsize=getfieldvalue(options,'fontsize',10);
-			label=getfieldvalue(options,'label','on');
-
-			if exist(options,'epsg'),
-				if exist(options,'proj'),
-					error('Boundary plot error message: cannot specify epsg and proj at the same time for plot projection');
-				end
-				proj=epsg2proj(getfieldvalue(options,'epsg'));
-			elseif exist(options,'proj'),
-				proj=getfieldvalue(options,'proj');
-			else
-				proj=epsg2proj(4326);
-			end
-
-			%read domain:
-			[path,name,ext]=fileparts(self.shpfilename);
-			if ~strcmpi(ext,'shp'),
-				ext='shp';
-			end
-			domain=shpread([self.shppath '/' name '.' ext]);
-
-			for i=1:length(domain),
-				try, 
-					[lat,long] = gdaltransform(domain(i).x,domain(i).y,self.proj,'EPSG:4326');
-				catch me
-					disp(me.message());
-					self.disp();
-				end
-				domain(i).x=long; domain(i).y=lat;
-			end
-
-			for i=1:length(domain),
-
-				%project on x,y,z reference frame.
-				[x,y,z]=AboveGround(domain(i).x,domain(i).y,radius,aboveground);
-				[xt,yt,zt]=AboveGround(domain(i).x+offset,domain(i).y+offset,radius,300000);
-				hold on;
-				if length(x)==1,
-					p=plot3(x,y,z,'k*'); 
-					set(p,'MarkerSize',markersize);
-					if strcmpi(label,'on'),
-						t=text(xt,yt,zt,self.shpfilename,'FontSize',fontsize);
-					end
-				else
-					p=plot3(x,y,z,'k-'); 
-					mid=floor(length(xt)/2);
-					if strcmpi(label,'on'),
-						text(xt(mid),yt(mid),zt(mid),self.shpfilename,'FontSize',fontsize);
-					end
-				end
-				set(p,'Color',color);
-				set(p,'LineWidth',linewidth);
-
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/boundary.py
===================================================================
--- /issm/trunk/src/m/classes/boundary.py	(revision 28275)
+++ 	(revision )
@@ -1,184 +1,0 @@
-import math
-
-import numpy as np
-
-from epsg2proj import epsg2proj
-from fielddisplay import fielddisplay
-from helpers import *
-from pairoptions import pairoptions
-from shpread import shpread
-
-
-class boundary(object):  # {{{
-    """BOUNDARY class definition
-
-    Usage:
-        boundary = boundary()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.boundaries = []
-        self.name       = ''
-        self.continent  = ''
-        self.proj       = epsg2proj(4326)
-
-        self.setdefaultparameters()
-
-        if len(args):
-            options = pairoptions(*args)
-
-            #recover field values
-            self.shppath = options.getfieldvalue('shppath', '')
-            self.shpfilename = options.getfieldvalue('shpfilename', '')
-            self.orientation = options.getfieldvalue('orientation', 'normal')
-
-            # If shppath is missing trailing slash, add it
-            if self.shppath[-1] != '/':
-                self.shppath += '/'
-
-            #figure out projection string:
-            if options.exist('epsg'):
-                if options.exist('proj'):
-                    raise RuntimeError('Error in constructor for boundary {}. Cannot supply epsg and proj at the same time!'.format(self.shppath))
-                epsg = options.getfieldvalue('epsg')
-                proj = epsg2proj(epsg) # convert to PROJ.4 format
-            elif options.exist('proj'):
-                if options.exist('epsg'):
-                    raise RuntimeError('Error in constructor for boundary {}. Cannot supply proj and epsg at the same time!'.format(self.shppath))
-                proj = options.getfieldvalue('proj')
-            else:
-                proj = '+proj=longlat +datum=WGS84 +no_defs'
-
-            self.proj = proj
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   boundary parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'shppath', 'path to filename for this boundary'))
-        s += '{}\n'.format(fielddisplay(self, 'shpfilename', 'shape file name'))
-        s += '{}\n'.format(fielddisplay(self, 'orientation', 'orientation (default is \'normal\', can be \'reverse\')'))
-        s += '{}\n'.format(fielddisplay(self, 'proj', 'shape file projection string (follows PROJ.4 standard)'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.shppath = ''
-        self.shpfilename = ''
-        self.orientation = 'normal'
-        self.proj = '+proj=longlat +datum=WGS84 +no_defs' #EPSG 4326
-
-        return self
-    # }}}
-
-    def name(self):  # {{{
-        output = self.shpfilename
-
-        return output
-    # }}}
-
-    def edges(self):  # {{{
-        #read domain
-        path, name, ext = fileparts(self.shpfilename)
-        if ext != '.shp':
-            ext = '.shp'
-        output = shpread('{}{}{}'.format(self.shppath, name, ext))
-
-        #do we reverse?
-        if self.orientation == 'reverse':
-            for i in range(len(output)):
-                output[i]['x'] = np.flipud(output[i]['x'])
-                output[i]['y'] = np.flipud(output[i]['y'])
-
-        return output
-    # }}}
-
-    def plot(self, *args):  # {{{
-        #recover options
-        options = pairoptions(*args)
-
-        #parse input
-        # TODO: Sort out what options we should set (see 
-        # src/m/classes/boundary.m)
-        
-        if options.exist('epsg'):
-            if options.exist('proj'):
-                raise RuntimeError('Boundary plot error message: cannot specify epsg and proj at the same time for plot projection')
-            proj = epsg2proj(options.getfieldvalue('epsg'))
-        elif options.exist('proj'):
-            proj = options.getfieldvalue('proj')
-        else:
-            proj = epsg2proj(4326)
-
-        #read domain
-        path, name, ext = fileparts(self.shpfilename)
-        if ext != '.shp':
-            ext = '.shp'
-        domain = shpread('{}{}{}'.format(self.shppath, name, ext))
-
-        #convert boundary to another reference frame #{{{
-        for i in range(len(domain)):
-            try:
-                x, y = gdaltransform(domain[i]['x'], domain[i]['y'], self.proj, proj)
-            except error as e:
-                print(e)
-                print(self)
-
-        # TODO: Figure out how to recover figure here: do we pass 'fig' and 
-        # 'ax' in args?
-        #for i in range(len(domain)):
-            # x = domain[i].x * unitmultiplier
-            # y = domain[i].y * unitmultiplier
-            # if len(x) == 1:
-        # }}}
-
-        #TODO: Finish translating from MATLAB after test2004.py runs without plot
-    # }}}
-
-    def checkconsistency(self, *args):  # {{{
-        #recover options
-        options = pairoptions(*args)
-        tolerance = getfieldvalue(options, 'tolerance', 1e-5)
-
-        #recover edges
-        edges = self.edges()
-
-        if edges.Geometry == 'Point':
-            return
-        else:
-            #check that we don't have two identical vertices
-            x = edges.x
-            y = edges.y
-            distance = math.sqrt((x[:-2] - x[1:-1]) ** 2 + (y[:-2] - y[1:-1]) ** 2)
-            dmax = distance.max()
-            isidentical = np.where(np.asarray(distance) < dmax * tolerance)
-            for elem in isidentical: # distance should be a 1D array, but return from np.where is a tuple of arrays
-                if len(elem) != 0:
-                    raise Exception('boundary {} has two vertices extermely close to one another'.format(shpfilename))
-
-    def plot3d(self, *args):  # {{{
-        #recover options
-        options = pairoptions(*args)
-
-        #parse input
-        # TODO: Sort out what options we should set (see 
-        # src/m/classes/boundary.m)
-        
-        if options.exist('epsg'):
-            if options.exist('proj'):
-                raise RuntimeError('Boundary plot error message: cannot specify epsg and proj at the same time for plot projection')
-            proj = epsg2proj(options.getfieldvalue('epsg'))
-        elif options.exist('proj'):
-            proj = options.getfieldvalue('proj')
-        else:
-            proj = epsg2proj(4326)
-
-        #read domain
-        path, name, ext = fileparts(self.shpfilename)
-        if ext != '.shp':
-            ext = '.shp'
-        domain = shpread('{}{}{}'.format(self.shppath, name, ext))
-
-        #TODO: Finish translating from MATLAB after test2004.py runs without plot
-    # }}}
-# }}}
Index: sm/trunk/src/m/classes/calving.js
===================================================================
--- /issm/trunk/src/m/classes/calving.js	(revision 28275)
+++ 	(revision )
@@ -1,46 +1,0 @@
-//CALVING class definition
-//
-//   Usage:
-//      calving=new calving();
-
-function calving (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   Calving parameters:'));
-		fielddisplay(this,'calvingrate','calving rate at given location [m/a]');
-
-	}// }}}
-    this.extrude = function(md) {//{{{
-        this.calvingrate=project3d(md,'vector',this.calvingrate,'type','node');
-        return this;
-    }//}}}
-	this.classname= function(){// {{{
-		return "calving";
-	}// }}}
-	this.checkconsistency = function(md,solution,analyses) { // {{{
-		//Early return
-		if (solution!='TransientSolution' | md.trans.ismovingfront==0) return;
-
-		checkfield(md,'fieldname','calving.calvingrate(1:md.mesh.numberofvertices,:)','>=',0,'timeseries',1,'NaN',1,'Inf',1);
-	} //}}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			var yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-		}//}}}
-		this.fix=function() { //{{{
-			this.calvingrate=NullFix(this.calvingrate,NaN);
-			this.meltingrate=NullFix(this.meltingrate,NaN);
-		}//}}}
-	//properties 
-	// {{{
-
-	this.calvingrate   = NaN;
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/calving.m
===================================================================
--- /issm/trunk/src/m/classes/calving.m	(revision 28275)
+++ 	(revision )
@@ -1,56 +1,0 @@
-%CALVING class definition
-%
-%   Usage:
-%      calving=calving();
-
-classdef calving
-	properties (SetAccess=public) 
-		calvingrate   = NaN;
-	end
-	methods
-		function self = calving(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calving');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.calvingrate=project3d(md,'vector',self.calvingrate,'type','node');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.calvingrate','>=',0,'timeseries',1,'NaN',1,'Inf',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving parameters:'));
-			fielddisplay(self,'calvingrate','calving rate at given location [m/a]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.calving.calvingrate'],self.calvingrate);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calving.py
===================================================================
--- /issm/trunk/src/m/classes/calving.py	(revision 28275)
+++ 	(revision )
@@ -1,51 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class calving(object):
-    """CALVING class definition
-
-    Usage:
-        calving = calving()
-    """
-
-    def __init__(self):  # {{{
-        self.calvingrate = np.nan
-        #self.setdefaultparameters() # Uncomment if/when setdefaultparameters is used
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Calving parameters:'
-        s += '{}\n'.format(fielddisplay(self, 'calvingrate', 'calving rate at given location [m/a]'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.calvingrate = project3d(md, 'vector', self.calvingrate, 'type', 'node')
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if solution != 'TransientSolution' or not md.transient.ismovingfront:
-            return md
-
-        md = checkfield(md, 'fieldname', 'calving.calvingrate', '>=', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'calvingrate', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts, 'scale', 1. / yts)
-    # }}}
Index: sm/trunk/src/m/classes/calvingcalvingmip.m
===================================================================
--- /issm/trunk/src/m/classes/calvingcalvingmip.m	(revision 28275)
+++ 	(revision )
@@ -1,57 +1,0 @@
-%CALVINGCALVINGMIP class definition
-%   For calvingMIP laws and coefficients
-%   Usage:
-%      calvingcalvingmip=calvingcalvingmip();
-
-classdef calvingcalvingmip
-	properties (SetAccess=public) 
-		min_thickness = 0.;
-		experiment = 1;
-	end
-	methods
-		function self = calvingcalvingmip(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvingcalvingmip');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			%For now we turn this off by setting the threshold to 0
-			self.min_thickness = 0.;
-
-			self.experiment = 1;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1);
-			md = checkfield(md,'fieldname','calving.experiment','values',[0, 1, 2, 3, 4, 5]);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   CalvingMIP parameters:'));
-			fielddisplay(self,'experiment','Experiment in CalvingMIP');
-			fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',12,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','experiment','format','Integer');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvingcrevassedepth.m
===================================================================
--- /issm/trunk/src/m/classes/calvingcrevassedepth.m	(revision 28275)
+++ 	(revision )
@@ -1,62 +1,0 @@
-%CALVINCREVASSEDEPTH class definition
-%
-%   Usage:
-%      calvingcrevassedepth=calvingcrevassedepth();
-
-classdef calvingcrevassedepth
-	properties (SetAccess=public) 
-		crevasse_opening_stress=1;
-		crevasse_threshold     =1.;
-		water_height = 0.;
-	end
-	methods
-		function self = calvingcrevassedepth(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvingcrevassedepth');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			
-			crevasse_threshold      = 1.;
-			crevasse_opening_stress = 1;
-         self.water_height       = 0.;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.crevasse_opening_stress','numel',[1],'values',[0,1]);
-         md = checkfield(md,'fieldname','calving.crevasse_threshold','numel',[1],'>',0,'<=',1);
-			md = checkfield(md,'fieldname','calving.water_height','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving Pi parameters:'));
-			fielddisplay(self,'crevasse_opening_stress','0: stress only in the ice-flow direction, 1: max principal');
-			fielddisplay(self,'crevasse_threshold','ratio of full thickness to calve (e.g. 0.75 is for 75% of the total ice thickness)');
-			fielddisplay(self,'water_height','water height in the crevasse [m]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',6,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','crevasse_opening_stress','format','Integer');
-         WriteData(fid,prefix,'object',self,'fieldname','crevasse_threshold','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','water_height','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvingcrevassedepth.py
===================================================================
--- /issm/trunk/src/m/classes/calvingcrevassedepth.py	(revision 28275)
+++ 	(revision )
@@ -1,51 +1,0 @@
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-#from project3d import project3d # Uncomment if/when extrude is implemented
-from WriteData import WriteData
-
-
-class calvingcrevassedepth(object):
-    """CALVINCREVASSEDEPTH class definition
-
-    Usage:
-        calvingcrevassedepth = calvingcrevassedepth()
-    """
-
-    def __init__(self):  # {{{
-        self.crevasse_opening_stress = 1
-        self.crevasse_threshold      = 1.
-        self.water_height            = 0.
-
-        #self.setdefaultparameters() # Uncomment if/when setdefaultparameters is used
-    # }}}
-    def __repr__(self):  # {{{
-        s = '   Calving Pi parameters:'
-        s += '{}\n'.format(fielddisplay(self, 'crevasse_opening_stress', '0: stress only in the ice-flow direction, 1: max principal'))
-        s += '{}\n'.format(fielddisplay(self, 'crevasse_threshold', 'ratio of full thickness to calve (e.g. 0.75 is for 75% of the total ice thickness)'))
-        s += '{}\n'.format(fielddisplay(self, 'water_height', 'water height in the crevasse [m]'))
-        return s
-    # }}}
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if solution != 'TransientSolution' or not md.transient.ismovingfront:
-            return md
-
-        md = checkfield(md, 'fieldname', 'calving.crevasse_opening_stress', 'numel', [1], 'values', [0,1])
-        md = checkfield(md, 'fieldname', 'calving.crevasse_threshold', 'numel', [1], '>', 0., '<=', 1.)
-        md = checkfield(md, 'fieldname', 'calving.water_height', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0) 
-
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 6, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'crevasse_opening_stress', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'crevasse_threshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'water_height', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-    # }}}
Index: sm/trunk/src/m/classes/calvingdev.py
===================================================================
--- /issm/trunk/src/m/classes/calvingdev.py	(revision 28275)
+++ 	(revision )
@@ -1,61 +1,0 @@
-from fielddisplay import fielddisplay
-from project3d import project3d
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class calvingdev(object):
-    """
-    CALVINGDEV class definition
-
-       Usage:
-          calvingdev = calvingdev()
-    """
-
-    def __init__(self):  # {{{
-
-        self.stress_threshold_groundedice = 0.
-        self.stress_threshold_floatingice = 0.
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = '   Calving Pi parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_groundedice', 'sigma_max applied to grounded ice only [Pa]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_floatingice', 'sigma_max applied to floating ice only [Pa]'))
-
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #Default sigma max
-        self.stress_threshold_groundedice = 1e6
-        self.stress_threshold_floatingice = 150e3
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
-            return
-
-        md = checkfield(md, 'fieldname', 'calving.stress_threshold_groundedice', '>', 0, 'nan', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'calving.stress_threshold_floatingice', '>', 0, 'nan', 1, 'Inf', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold_groundedice', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold_floatingice', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
Index: sm/trunk/src/m/classes/calvingdev2.m
===================================================================
--- /issm/trunk/src/m/classes/calvingdev2.m	(revision 28275)
+++ 	(revision )
@@ -1,62 +1,0 @@
-%CALVINGDEV2 class definition
-%
-%   Usage:
-%      calvingdev2=calvingdev2();
-
-classdef calvingdev2
-	properties (SetAccess=public) 
-		stress_threshold_groundedice = 0.;
-		stress_threshold_floatingice = 0.;
-		height_above_floatation = 0.;
-	end
-	methods
-		function self = calvingdev2(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvingdev2');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Default sigma max
-			self.stress_threshold_groundedice = 1.e6;
-			self.stress_threshold_floatingice = 150.e3;
-			self.height_above_floatation= 0.;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','calving.height_above_floatation','<=',0);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving Dev2 parameters:'));
-			fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]');
-			fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]');
-			fielddisplay(self,'height_above_floatation','height above floatation that the ice tongue must reach before it can calve [m]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',7,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1, 'yts', md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','height_above_floatation', 'format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvinghab.m
===================================================================
--- /issm/trunk/src/m/classes/calvinghab.m	(revision 28275)
+++ 	(revision )
@@ -1,53 +1,0 @@
-%CALVINGHAB class definition
-%
-%   Usage:
-%      calvinghab=calvinghab();
-
-classdef calvinghab
-	properties (SetAccess=public) 
-		flotation_fraction = 0.;
-	end
-	methods
-		function self = calvinghab(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvinghab');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%fraction q = .15 of the flotation thickness at the terminus by default
-			self.flotation_fraction = 0.15;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.flotation_fraction','>=',0,'NaN',1,'Inf',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving Pi parameters:'));
-			fielddisplay(self,'flotation_fraction','fraction of flotation thickness at the terminus');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',5,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','flotation_fraction','format','DoubleMat','mattype',1);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvinglevermann.m
===================================================================
--- /issm/trunk/src/m/classes/calvinglevermann.m	(revision 28275)
+++ 	(revision )
@@ -1,54 +1,0 @@
-%CALVINGLEVERMANN class definition
-%
-%   Usage:
-%      calvinglevermann=calvinglevermann();
-
-classdef calvinglevermann
-	properties (SetAccess=public) 
-		coeff         = NaN;
-	end
-	methods
-		function self = calvinglevermann(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvinglevermann');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.coeff=project3d(md,'vector',self.coeff,'type','node');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Proportionality coefficient in Levermann model
-			self.coeff=2e13;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.coeff','>',0,'size',[md.mesh.numberofvertices 1]);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving Levermann parameters:'));
-			fielddisplay(self,'coeff','proportionality coefficient in Levermann model');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',3,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','coeff','format','DoubleMat','mattype',1);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvinglevermann.py
===================================================================
--- /issm/trunk/src/m/classes/calvinglevermann.py	(revision 28275)
+++ 	(revision )
@@ -1,53 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-from project3d import project3d
-
-
-class calvinglevermann(object):
-    """
-    CALVINGLEVERMANN class definition
-
-       Usage:
-          calvinglevermann = calvinglevermann()
-    """
-
-    def __init__(self):  # {{{
-
-        self.coeff = float('NaN')
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = '   Calving Levermann parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'coeff', 'proportionality coefficient in Levermann model'))
-
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.coeff = project3d(md, 'vector', self.coeff, 'type', 'node')
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #Proportionality coefficient in Levermann model
-        self.coeff = 2e13
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
-            return md
-
-        md = checkfield(md, 'fieldname', 'calving.coeff', 'size', [md.mesh.numberofvertices], '>', 0)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 3, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'coeff', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
Index: sm/trunk/src/m/classes/calvingminthickness.m
===================================================================
--- /issm/trunk/src/m/classes/calvingminthickness.m	(revision 28275)
+++ 	(revision )
@@ -1,53 +1,0 @@
-%CALVINGMINTHICKNESS class definition
-%
-%   Usage:
-%      calvingminthickness=calvingminthickness();
-
-classdef calvingminthickness
-	properties (SetAccess=public) 
-		min_thickness = 0.;
-	end
-	methods
-		function self = calvingminthickness(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvingminthickness');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%minimum thickness is 100 m by default
-			self.min_thickness=100.;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.min_thickness','>',0,'NaN',1,'Inf',1,'numel',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving Minimum thickness:'));
-			fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',4,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvingminthickness.py
===================================================================
--- /issm/trunk/src/m/classes/calvingminthickness.py	(revision 28275)
+++ 	(revision )
@@ -1,50 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class calvingminthickness(object):
-    """
-    CALVINGMINTHICKNESS class definition
-
-       Usage:
-          calvingminthickness = calvingminthickness()
-    """
-
-    def __init__(self):  # {{{
-
-        self.min_thickness = 0.
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = '   Calving Minimum thickness:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'min_thickness', 'minimum thickness below which no ice is allowed'))
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #minimum thickness is 100 m by default
-        self.min_thickness = 100.
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
-            return
-
-        md = checkfield(md, 'fieldname', 'calving.min_thickness', '>', 0, 'NaN', 1, 'Inf', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 4, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_thickness', 'format', 'Double')
-    # }}}
Index: sm/trunk/src/m/classes/calvingparameterization.m
===================================================================
--- /issm/trunk/src/m/classes/calvingparameterization.m	(revision 28275)
+++ 	(revision )
@@ -1,100 +1,0 @@
-%CALVINGPARAMETERIZATION class definition
-%   For test calving laws and coefficients
-%   Usage:
-%      calvingparameterization=calvingparameterization();
-
-classdef calvingparameterization
-	properties (SetAccess=public) 
-		min_thickness = 0.;
-		use_param = 0;
-		theta = 0.;
-		alpha = 0;
-		xoffset = 0;
-		yoffset = 0;
-		vel_upperbound = 8000;
-		vel_threshold = 6000;
-		vel_lowerbound = 0;
-	end
-	methods
-		function self = calvingparameterization(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvingparameterization');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			%For now we turn this off by setting the threshold to 0
-			self.min_thickness = 0.;
-
-			%Parameters for the spatial temporal separation
-			%The coefficient follows: gamma= f(x)
-			% 0 - f(x) = y_{o} + \alpha (x+x_{o})
-			% 1 - f(x)=y_{o}-\frac{\theta}{2}\tanh(\alpha(x+x_{o}))
-			self.use_param = 0;
-			% the amplifier
-			self.theta = 0;
-			% the slope alpha
-			self.alpha = 0;
-			% offset in x-axis
-			self.xoffset = 0;
-			% offset in y-axis
-			self.yoffset = 0;
-			% velocity thresholds to reduce calving rate
-			self.vel_upperbound = 6000; % m/a
-			self.vel_lowerbound = 0; % m/a
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1);
-			md = checkfield(md,'fieldname','calving.use_param','values',[-1, 0, 1, 2, 3, 4, 5]);
-			md = checkfield(md,'fieldname','calving.theta','NaN',1,'Inf',1,'numel',1);
-			md = checkfield(md,'fieldname','calving.alpha','NaN',1,'Inf',1,'numel',1);
-			md = checkfield(md,'fieldname','calving.xoffset','NaN',1,'Inf',1,'numel',1);
-			md = checkfield(md,'fieldname','calving.yoffset','NaN',1,'Inf',1,'numel',1);
-			md = checkfield(md,'fieldname','calving.vel_lowerbound','NaN',1,'Inf',1,'numel',1);
-			md = checkfield(md,'fieldname','calving.vel_threshold','NaN',1,'Inf',1,'numel',1);
-			md = checkfield(md,'fieldname','calving.vel_upperbound','NaN',1,'Inf',1,'numel',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving test parameters:'));
-			fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]');
-			fielddisplay(self,'use_param','-1 - just use frontal ablation rate, 0 - f(x) = y_{o} + \alpha (x+x_{o}), 1 - f(x)=y_{o}-\frac{\theta}{2}\tanh(\alpha(x+x_{o})), 2 - tanh(thickness), 3 - tanh(normalized vel), 4 - tanh(truncated vel), 5 - linear(truncated vel)');
-			fielddisplay(self,'theta','the amplifier');
-			fielddisplay(self,'alpha','the slope');
-			fielddisplay(self,'xoffset','offset in x-axis');
-			fielddisplay(self,'yoffset','offset in y-axis');
-			fielddisplay(self,'vel_lowerbound','lowerbound of ice velocity to reduce the calving rate [m/a]');
-			fielddisplay(self,'vel_threshold','threshold of ice velocity to reduce the calving rate [m/a]');
-			fielddisplay(self,'vel_upperbound','upperbound of ice velocity to reduce the calving rate [m/a]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',9,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','use_param','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','theta','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','xoffset','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','yoffset','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','vel_lowerbound','format','Double','scale', 1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','vel_threshold','format','Double','scale', 1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','vel_upperbound','format','Double','scale', 1./yts);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvingparameterization.py
===================================================================
--- /issm/trunk/src/m/classes/calvingparameterization.py	(revision 28275)
+++ 	(revision )
@@ -1,111 +1,0 @@
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class calvingparameterization(object):
-    """calvingparameterization class definition
-    For test calving laws and coefficients
-
-    Usage:
-        calvingparameterization = calvingparameterization()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.min_thickness = 0
-        self.use_param = 0
-        self.theta = 0
-        self.alpha = 0
-        self.xoffset = 0
-        self.yoffset = 0
-        self.vel_upperbound = 0
-        self.vel_threshold = 0
-        self.vel_lowerbound = 0
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            # TODO: Replace the following with constructor
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Calving test parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'min_thickness', 'minimum thickness below which no ice is allowed [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'use_param', '-1 - just use frontal ablation rate, 0 - f(x) = y_{o} + \alpha (x+x_{o}), 1 - f(x)=y_{o}-\frac{\theta}{2}\tanh(\alpha(x+x_{o})), 2 - tanh(thickness), 3 - tanh(normalized vel), 4 - tanh(truncated vel), 5 - linear(truncated vel)'))
-        s += '{}\n'.format(fielddisplay(self, 'theta', 'the amplifier'))
-        s += '{}\n'.format(fielddisplay(self, 'alpha', 'the slope'))
-        s += '{}\n'.format(fielddisplay(self, 'xoffset', 'offset in x-axis'))
-        s += '{}\n'.format(fielddisplay(self, 'yoffset', 'offset in y-axis'))
-        s += '{}\n'.format(fielddisplay(self, 'vel_lowerbound', 'lowerbound of ice velocity to reduce the calving rate [m/a]'))
-        s += '{}\n'.format(fielddisplay(self, 'vel_threshold', 'threshold of ice velocity to reduce the calving rate [m/a]'))
-        s += '{}\n'.format(fielddisplay(self, 'vel_upperbound', 'upperbound of ice velocity to reduce the calving rate [m/a]'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # For now we turn this off by setting the threshold to 0
-        self.min_thickness = 0.
-
-        # Parameters for the spatial temporal separation
-        # The coefficient follows: gamma= f(x)
-        # 0 - f(x) = y_{o} + \alpha (x+x_{o})
-        # 1 - f(x)=y_{o}-\frac{\theta}{2}\tanh(\alpha(x+x_{o}))
-        self.use_param = 0
-
-        # The amplifier
-        self.theta = 0
-
-        # The slope alpha
-        self.alpha = 0
-
-        # Offset in x-axis
-        self.xoffset
-
-        # Offset in y-axis
-        self.yoffset
-
-        # Velocity thresholds to reduce calving rate
-        self.vel_upperbound = 6000 # m/a
-        self.vel_lowerbound = 0 # m/a
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if not solution == 'TransientSolution' or not md.transient.ismovingfront:
-            return
-
-        md = checkfield(md, 'fieldname', 'calving.min_thickness', '>=', 0, 'NaN', 1, 'Inf', 1, 'numel', 1)
-        md = checkfield(md, 'fieldname', 'calving.use_param', 'values', [-1, 0, 1, 2, 3, 4, 5])
-        md = checkfield(md, 'fieldname', 'calving.theta', 'NaN', 1, 'Inf', 1, 'numel', 1)
-        md = checkfield(md, 'fieldname', 'calving.alpha', 'NaN', 1, 'Inf', 1, 'numel', 1)
-        md = checkfield(md, 'fieldname', 'calving.xoffset', 'NaN', 1, 'Inf', 1, 'numel', 1)
-        md = checkfield(md, 'fieldname', 'calving.yoffset', 'NaN', 1, 'Inf', 1, 'numel', 1)
-        md = checkfield(md, 'fieldname', 'calving.vel_lowerbound', 'NaN', 1, 'Inf', 1, 'numel', 1)
-        md = checkfield(md, 'fieldname', 'calving.vel_threshold', 'NaN', 1, 'Inf', 1, 'numel', 1)
-        md = checkfield(md, 'fieldname', 'calving.vel_upperbound', 'NaN', 1, 'Inf', 1, 'numel', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 9, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_thickness', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'use_param', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'theta', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'alpha', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'xoffset', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'yoffset', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vel_lowerbound', 'format', 'Double', 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vel_threshold','format', 'Double', 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vel_upperbound', 'format', 'Double', 'scale', 1. / yts)
-    # }}}
Index: sm/trunk/src/m/classes/calvingpollard.m
===================================================================
--- /issm/trunk/src/m/classes/calvingpollard.m	(revision 28275)
+++ 	(revision )
@@ -1,52 +1,0 @@
-%CALVINGPOLLARD class definition
-%
-%   Usage:
-%      calvingpollard=calvingpollard();
-
-classdef calvingpollard
-	properties (SetAccess=public) 
-		rc = 0.;
-	end
-	methods
-		function self = calvingpollard(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvingpollard');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			return;
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Default from Pollard and DeConto 2015
-			self.rc = .75;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.rc','>',0,'<=',1,'numel',1);
-		end % }}}
-		function disp(self) % {{
-			disp(sprintf('   Calving Pollard and DeConto parameters:'));
-			fielddisplay(self,'rc','critical depth/thickness ratio (default is 0.75) ');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.calving.law','data',10,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','rc','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvingtest.m
===================================================================
--- /issm/trunk/src/m/classes/calvingtest.m	(revision 28275)
+++ 	(revision )
@@ -1,54 +1,0 @@
-%CALVINGTEST class definition
-%  For testing calving laws and coefficients
-%   Usage:
-%      calvingtest=calvingtest();
-
-classdef calvingtest
-	properties (SetAccess=public)
-		speedfactor = 1;
-		independentrate = 0;
-	end
-	methods
-		function self = calvingtest(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvingtest');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.speedfactor = 1;
-			self.independentrate = 0;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-			md = checkfield(md,'fieldname','calving.speedfactor','>=',0,'NaN',1,'Inf',1, 'singletimeseries', 1);
-			md = checkfield(md,'fieldname','calving.independentrate','NaN',1,'Inf',1, 'singletimeseries', 1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving test parameters:'));
-			fielddisplay(self,'speedfactor','calving rate is proportional to the ice velocity (e.g. speedfactor=1 -> calving front should not move)');
-			fielddisplay(self,'independentrate','calving rate is independent of the ice velocity.');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',8,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','speedfactor','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','independentrate','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1./yts);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvingvonmises.m
===================================================================
--- /issm/trunk/src/m/classes/calvingvonmises.m	(revision 28275)
+++ 	(revision )
@@ -1,65 +1,0 @@
-%CALVINGVONMISES class definition
-%
-%   Usage:
-%      calvingvonmises=calvingvonmises();
-
-classdef calvingvonmises
-	properties (SetAccess=public) 
-		stress_threshold_groundedice = 0.;
-		stress_threshold_floatingice = 0.;
-		min_thickness = 0.;
-	end
-	methods
-		function self = calvingvonmises(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvingvonmises');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Default sigma max
-			self.stress_threshold_groundedice = 1e6;
-			self.stress_threshold_floatingice = 150e3;
-
-			%For now we turn this off by setting the threshold to 0
-			self.min_thickness = 0.;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1,'size','universal');
-			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1,'size','universal');
-			md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving VonMises parameters:'));
-			fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]');
-			fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]');
-			fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/calvingvonmises.py
===================================================================
--- /issm/trunk/src/m/classes/calvingvonmises.py	(revision 28275)
+++ 	(revision )
@@ -1,63 +1,0 @@
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class calvingvonmises(object):
-    """CALVINGVONMISES class definition
-
-    Usage:
-        calvingvonmises = calvingvonmises()
-    """
-
-    def __init__(self):  # {{{
-        self.stress_threshold_groundedice = 0
-        self.stress_threshold_floatingice = 0
-        self.min_thickness = 0
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Calving VonMises parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'stress_threshold_groundedice', 'sigma_max applied to grounded ice only [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'stress_threshold_floatingice', 'sigma_max applied to floating ice only [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'min_thickness', 'minimum thickness below which no ice is allowed [m]'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Default sigma max
-        self.stress_threshold_groundedice = 1e6
-        self.stress_threshold_floatingice = 150e3
-
-        # Turn off min_thickness by default
-        self.min_thickness = 0.
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if solution == 'TransientSolution' or not md.transient.ismovingfront:
-            return
-
-        md = checkfield(md, 'fieldname', 'calving.stress_threshold_groundedice', '>', 0, 'nan', 1, 'Inf', 1, 'size', 'universal')
-        md = checkfield(md, 'fieldname', 'calving.stress_threshold_floatingice', '>', 0, 'nan', 1, 'Inf', 1, 'size', 'universal')
-        md = checkfield(md, 'fieldname', 'calving.min_thickness', '>=', 0, 'NaN', 1, 'Inf', 1, 'numel', [1])
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold_groundedice', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts )
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold_floatingice', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_thickness', 'format', 'Double')
-    # }}}
Index: sm/trunk/src/m/classes/calvingvonmisesAD.m
===================================================================
--- /issm/trunk/src/m/classes/calvingvonmisesAD.m	(revision 28275)
+++ 	(revision )
@@ -1,82 +1,0 @@
-%CALVINGVONMISESAD class definition
-%
-%   Usage:
-%      calvingvonmisesAD=calvingvonmisesAD();
-
-classdef calvingvonmisesAD
-	properties (SetAccess=public) 
-		basin_id							  = NaN;
-		num_basins           = 0;
-		stress_threshold_groundedice = 0.;
-		stress_threshold_floatingice = 0.;
-		min_thickness = 0.;
-	end
-	methods
-		function self = calvingvonmises(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('calvingvonmisesAD');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.basin_id             = NaN;
-			num_basins           = 0;
-			
-			%Default sigma max
-			self.stress_threshold_groundedice = 1e6;
-			self.stress_threshold_floatingice = 150e3;
-
-			%For now we turn this off by setting the threshold to 0
-			self.min_thickness = 0.;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','calving.basin_id','Inf',1,'>=',0,'<=',md.frontalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','frontalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1,'size',[md.calving.num_basins 1]);
-			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1,'size',[md.calving.num_basins 1]);
-			%md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1,'size',[1 1]);
-			%md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1,'size',[1 1]);
-			md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Calving VonMises (AD) parameters:'));
-			fielddisplay(self,'basin_id','basin ID for elements');
-			fielddisplay(self,'num_basins', 'number of basins');
-			fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]');
-			fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]');
-			fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.calving.law','data',11,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','basin_id','data',self.basin_id-1,'name','md.calving.basin_id','format','IntMat','mattype',2); %0-indexed
-			%WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			%WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			%WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','Double');
-			%WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat');
-			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat');
-			WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/cfdragcoeffabsgrad.m
===================================================================
--- /issm/trunk/src/m/classes/cfdragcoeffabsgrad.m	(revision 28275)
+++ 	(revision )
@@ -1,77 +1,0 @@
-%CFDRAGCOEFFABSGRAD class definition
-%
-%   Usage:
-%      cfdragcoeffabsgrad=cfdragcoeffabsgrad();
-%      cfdragcoeffabsgrad=cfdragcoeffabsgrad('name','SurfaceAltimetry',...
-%                    'definitionstring','Outputdefinition1',... 
-%							'model_string','Surface',...
-%                    'weights',ones(md.mesh.numberofvertices,1),...
-%                    'weights_string','WeightsSurfaceObservations');
-%
-%
-
-classdef cfdragcoeffabsgrad
-	properties (SetAccess=public)
-		%cfdragcoeffabsgrad
-		name               = '';
-		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		weights            = NaN; %weight coefficients for every vertex
-		weights_string     = ''; %string to identify this particular set of weights
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.weights)
-				self.weights=project3d(md,'vector',self.weights,'type','node');
-			end
-		end % }}}
-		function self = cfdragcoeffabsgrad(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.weights=getfieldvalue(options,'weights',NaN);
-				self.weights_string=getfieldvalue(options,'weights_string','');
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('cfdragcoeffabsgrad error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-
-			md = checkfield(md,'fieldname','self.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   TimeMisfit:\n'));
-
-			fielddisplay(self,'name','identifier for this cfdragcoeffabsgrad response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'weights','weights (at vertices) to apply to the cfdragcoeffabsgrad');
-			fielddisplay(self,'weights_string','string for weights for identification purposes');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-		WriteData(fid,prefix,'data',self.name,'name','md.cfdragcoeffabsgrad.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cfdragcoeffabsgrad.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.weights,'name','md.cfdragcoeffabsgrad.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.weights_string,'name','md.cfdragcoeffabsgrad.weights_string','format','String');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/cfdragcoeffabsgradtransient.m
===================================================================
--- /issm/trunk/src/m/classes/cfdragcoeffabsgradtransient.m	(revision 28275)
+++ 	(revision )
@@ -1,69 +1,0 @@
-%CFDRAGCOEFFABSGRADTRANSIENT class definition
-%
-%   Usage:
-%      cfdragcoeffabsgradtransient=cfdragcoeffabsgradtransient();
-%      cfdragcoeffabsgradtransient=cfdragcoeffabsgradtransient('name','SurfaceAltimetry',...
-%                    'definitionstring','Outputdefinition1',... 
-%                    'weights',ones(md.mesh.numberofvertices+1,1));
-%
-%
-
-classdef cfdragcoeffabsgradtransient
-	properties (SetAccess=public)
-		%cfdragcoeffabsgrad
-		name               = '';
-		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		weights            = NaN; %weight coefficients for every vertex
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.weights)
-				self.weights=project3d(md,'vector',self.weights,'type','node');
-			end
-		end % }}}
-		function self = cfdragcoeffabsgradtransient(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.weights=getfieldvalue(options,'weights',NaN);
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('cfdragcoeffabsgrad error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:200
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-			md = checkfield(md,'fieldname','self.weights','field',self.weights,'size',[md.mesh.numberofvertices+1 NaN],'NaN',1,'Inf',1);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   TimeMisfit:\n'));
-
-			fielddisplay(self,'name','identifier for this cfdragcoeffabsgradtransient response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'weights','weights (at vertices) to apply to the cfdragcoeffabsgradtransient');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-		WriteData(fid,prefix,'data',self.name,'name','md.cfdragcoeffabsgradtransient.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cfdragcoeffabsgradtransient.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.weights,'name','md.cfdragcoeffabsgradtransient.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/cflevelsetmisfit.m
===================================================================
--- /issm/trunk/src/m/classes/cflevelsetmisfit.m	(revision 28275)
+++ 	(revision )
@@ -1,102 +1,0 @@
-%MISFIT class definition
-%
-%   Usage:
-%      cflevelsetmisfit=cflevelsetmisfit();
-%      cflevelsetmisfit=cflevelsetmisfit('name','CalvingFrontPosition',...
-%                    'definitionstring','Outputdefinition1',... 
-%							'model_string','MaskIceLevelset',...
-%                    'observation_string','LevelsetObservations',...
-%                    'observation',md.mask.ice_levelset,...
-%                    'weights',ones(md.mesh.numberofvertices,1),...
-%                    'weights_string','WeightsLevelsetObservations',...
-%							'datatime',time);
-%
-%
-
-classdef cflevelsetmisfit
-	properties (SetAccess=public)
-		%cflevelsetmisfit
-		name               = '';
-		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		model_string       = ''; %string for field that is modeled
-		observation        = NaN; %observed field that we compare the model against
-		observation_string = ''; %string for observed field.
-		weights            = NaN; %weight coefficients for every vertex
-		weights_string     = ''; %string to identify this particular set of weights
-		datatime				 = 0; %time in years from start that the data is from 
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.weights)
-				self.weights=project3d(md,'vector',self.weights,'type','node');
-			end
-			if ~isnan(self.observation)
-				self.observation=project3d(md,'vector',self.observation,'type','node');
-			end
-		end % }}}
-		function self = cflevelsetmisfit(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.model_string=getfieldvalue(options,'model_string');
-				self.observation=getfieldvalue(options,'observation',NaN);
-				self.observation_string=getfieldvalue(options,'observation_string');
-				self.weights=getfieldvalue(options,'weights',NaN);
-				self.weights_string=getfieldvalue(options,'weights_string','');
-				self.datatime = getfieldvalue(options, 'datatime');
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.datatime = 0;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('cflevelsetmisfit error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-
-			md = checkfield(md,'fieldname','self.observation','field',self.observation,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','self.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','self.datatime','field',self.datatime,'<=',md.timestepping.final_time);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   TimeMisfit:\n'));
-
-			fielddisplay(self,'name','identifier for this cflevelsetmisfit response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'model_string','string for field that is modeled');
-			fielddisplay(self,'observation','observed field that we compare the model against');
-			fielddisplay(self,'observation_string','observation string');
-			fielddisplay(self,'weights','weights (at vertices) to apply to the cflevelsetmisfit');
-			fielddisplay(self,'weights_string','string for weights for identification purposes');
-			fielddisplay(self,'datatime','time to compare data to model for misfit');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-		WriteData(fid,prefix,'data',self.name,'name','md.cflevelsetmisfit.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cflevelsetmisfit.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.model_string,'name','md.cflevelsetmisfit.model_string','format','String');
-		WriteData(fid,prefix,'data',self.observation,'name','md.cflevelsetmisfit.observation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.observation_string,'name','md.cflevelsetmisfit.observation_string','format','String');
-		WriteData(fid,prefix,'data',self.weights,'name','md.cflevelsetmisfit.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.weights_string,'name','md.cflevelsetmisfit.weights_string','format','String');
-		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cflevelsetmisfit.datatime','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/cfrheologybbarabsgrad.m
===================================================================
--- /issm/trunk/src/m/classes/cfrheologybbarabsgrad.m	(revision 28275)
+++ 	(revision )
@@ -1,78 +1,0 @@
-%CFRHEOLOGYBBARABSGRAD class definition
-%
-%   Usage:
-%      cfrheologybbarabsgrad=cfdragcoeffabsgrad();
-%      cfrheologybbarabsgrad=cfdragcoeffabsgrad('name','SurfaceAltimetry',...
-%                    'definitionstring','Outputdefinition1',... 
-%							'model_string','Surface',...
-%                    'weights',ones(md.mesh.numberofvertices,1),...
-%                    'weights_string','WeightsSurfaceObservations');
-%
-%
-
-classdef cfrheologybbarabsgrad
-	properties (SetAccess=public)
-		%cfrheologybbarabsgrad
-		name               = '';
-		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		weights            = NaN; %weight coefficients for every vertex
-		weights_string     = ''; %string to identify this particular set of weights
-		cumulated          = NaN; %do we cumulate cfrheologybbarabsgrad through time?
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.weights)
-				self.weights=project3d(md,'vector',self.weights,'type','node');
-			end
-		end % }}}
-		function self = cfrheologybbarabsgrad(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.weights=getfieldvalue(options,'weights',NaN);
-				self.weights_string=getfieldvalue(options,'weights_string','');
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('cfrheologybbarabsgrad error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:200
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-
-			md = checkfield(md,'fieldname','self.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   TimeMisfit:\n'));
-
-			fielddisplay(self,'name','identifier for this cfrheologybbarabsgrad response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'weights','weights (at vertices) to apply to the cfrheologybbarabsgrad');
-			fielddisplay(self,'weights_string','string for weights for identification purposes');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-		WriteData(fid,prefix,'data',self.name,'name','md.cfrheologybbarabsgrad.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cfrheologybbarabsgrad.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.weights,'name','md.cfrheologybbarabsgrad.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.weights_string,'name','md.cfrheologybbarabsgrad.weights_string','format','String');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/cfrheologybbarabsgradtransient.m
===================================================================
--- /issm/trunk/src/m/classes/cfrheologybbarabsgradtransient.m	(revision 28275)
+++ 	(revision )
@@ -1,68 +1,0 @@
-%CFRHEOLOGYBBARABSGRADTRANSIENT class definition
-%
-%   Usage:
-%      cfrheologybbarabsgradtransient=cfdragcoeffabsgradtransient();
-%      cfrheologybbarabsgradtransient=cfdragcoeffabsgradtransient('name','SurfaceAltimetry',...
-%                    'definitionstring','Outputdefinition1',... 
-%                    'weights',ones(md.mesh.numberofvertices+1,1))%
-%
-
-classdef cfrheologybbarabsgradtransient
-	properties (SetAccess=public)
-		%cfrheologybbarabsgrad
-		name               = '';
-		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		weights            = NaN; %weight coefficients for every vertex
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.weights)
-				self.weights=project3d(md,'vector',self.weights,'type','node');
-			end
-		end % }}}
-		function self = cfrheologybbarabsgradtransient(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.weights=getfieldvalue(options,'weights',NaN);
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('cfrheologybbarabsgradtransient error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:200
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-			md = checkfield(md,'fieldname','self.weights','field',self.weights,'size',[md.mesh.numberofvertices+1 NaN],'NaN',1,'Inf',1);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   TimeMisfit:\n'));
-
-			fielddisplay(self,'name','identifier for this cfrheologybbarabsgrad response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'weights','weights (at vertices) to apply to the cfrheologybbarabsgrad');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-		WriteData(fid,prefix,'data',self.name,'name','md.cfrheologybbarabsgradtransient.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cfrheologybbarabsgradtransient.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.weights,'name','md.cfrheologybbarabsgradtransient.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/cfsurfacelogvel.m
===================================================================
--- /issm/trunk/src/m/classes/cfsurfacelogvel.m	(revision 28275)
+++ 	(revision )
@@ -1,105 +1,0 @@
-%MISFIT class definition
-%
-%   Usage:
-%      cfsurfacelogvel=cfsurfacelogvel();
-%      cfsurfacelogvel=cfsurfacelogvel('name','SurfaceAltimetry',...
-%                    'definitionstring','Outputdefinition1',... 
-%                    'observation_string','SurfaceObservations',...
-%                    'observation',md.geometry.surface,...
-%                    'weights',ones(md.mesh.numberofvertices,1),...
-%                    'weights_string','WeightsSurfaceObservations',...
-%							'datatime',time);
-%
-%
-
-classdef cfsurfacelogvel
-	properties (SetAccess=public)
-		%cfsurfacelogvel
-		name               = '';
-		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		vxobs					 = NaN; %observed field that we compare the model against
-		vxobs_string		 = ''; %string for observed field.
-		vyobs			       = NaN; %observed field that we compare the model against
-		vyobs_string		 = ''; %string for observed field.
-		weights            = NaN; %weight coefficients for every vertex
-		weights_string     = ''; %string to identify this particular set of weights
-		datatime				 = 0; %time in years from start that the data is from 
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.weights)
-				self.weights=project3d(md,'vector',self.weights,'type','node');
-			end
-			if ~isnan(self.vxobs)
-				self.vxobs=project3d(md,'vector',self.vxobs,'type','node');
-			end
-		end % }}}
-		function self = cfsurfacelogvel(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.vxobs=getfieldvalue(options,'vxobs',NaN);
-				self.vyobs=getfieldvalue(options,'vyobs',NaN);
-				self.vxobs_string=getfieldvalue(options,'vxobs_string');			
-				self.vyobs_string=getfieldvalue(options,'vyobs_string');
-				self.weights=getfieldvalue(options,'weights',NaN);
-				self.weights_string=getfieldvalue(options,'weights_string','');
-				self.datatime = getfieldvalue(options, 'datatime');
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.datatime = 0;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('cfsurfacelogvel error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-
-			md = checkfield(md,'fieldname','self.vxobs','field',self.vxobs,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','self.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','self.datatime','field',self.datatime,'<=',md.timestepping.final_time);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   TimeMisfit:\n'));
-
-			fielddisplay(self,'name','identifier for this cfsurfacelogvel response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'vxobs','observed field that we compare the model against');
-			fielddisplay(self,'vxobs_string','observation string');
-			fielddisplay(self,'weights','weights (at vertices) to apply to the cfsurfacelogvel');
-			fielddisplay(self,'weights_string','string for weights for identification purposes');
-			fielddisplay(self,'datatime','time to compare data to model for misfit');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-		WriteData(fid,prefix,'data',self.name,'name','md.cfsurfacelogvel.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cfsurfacelogvel.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.vxobs,'name','md.cfsurfacelogvel.vxobs','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-		WriteData(fid,prefix,'data',self.vxobs_string,'name','md.cfsurfacelogvel.vxobs_string','format','String');
-		WriteData(fid,prefix,'data',self.vyobs,'name','md.cfsurfacelogvel.vyobs','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-		WriteData(fid,prefix,'data',self.vyobs_string,'name','md.cfsurfacelogvel.vyobs_string','format','String');
-		WriteData(fid,prefix,'data',self.weights,'name','md.cfsurfacelogvel.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.weights_string,'name','md.cfsurfacelogvel.weights_string','format','String');
-		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacelogvel.datatime','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/cfsurfacesquare.m
===================================================================
--- /issm/trunk/src/m/classes/cfsurfacesquare.m	(revision 28275)
+++ 	(revision )
@@ -1,102 +1,0 @@
-%MISFIT class definition
-%
-%   Usage:
-%      cfsurfacesquare=cfsurfacesquare();
-%      cfsurfacesquare=cfsurfacesquare('name','SurfaceAltimetry',...
-%                    'definitionstring','Outputdefinition1',... 
-%							'model_string','Surface',...
-%                    'observation_string','SurfaceObservations',...
-%                    'observation',md.geometry.surface,...
-%                    'weights',ones(md.mesh.numberofvertices,1),...
-%                    'weights_string','WeightsSurfaceObservations',...
-%							'datatime',time);
-%
-%
-
-classdef cfsurfacesquare
-	properties (SetAccess=public)
-		%cfsurfacesquare
-		name               = '';
-		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		model_string       = ''; %string for field that is modeled
-		observation        = NaN; %observed field that we compare the model against
-		observation_string = ''; %string for observed field.
-		weights            = NaN; %weight coefficients for every vertex
-		weights_string     = ''; %string to identify this particular set of weights
-		datatime				 = 0; %time in years from start that the data is from 
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.weights)
-				self.weights=project3d(md,'vector',self.weights,'type','node');
-			end
-			if ~isnan(self.observation)
-				self.observation=project3d(md,'vector',self.observation,'type','node');
-			end
-		end % }}}
-		function self = cfsurfacesquare(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.model_string=getfieldvalue(options,'model_string');
-				self.observation=getfieldvalue(options,'observation',NaN);
-				self.observation_string=getfieldvalue(options,'observation_string');
-				self.weights=getfieldvalue(options,'weights',NaN);
-				self.weights_string=getfieldvalue(options,'weights_string','');
-				self.datatime = getfieldvalue(options, 'datatime');
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.datatime = 0;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('cfsurfacesquare error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-
-			md = checkfield(md,'fieldname','self.observation','field',self.observation,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','self.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','self.datatime','field',self.datatime,'<=',md.timestepping.final_time);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   TimeMisfit:\n'));
-
-			fielddisplay(self,'name','identifier for this cfsurfacesquare response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'model_string','string for field that is modeled');
-			fielddisplay(self,'observation','observed field that we compare the model against');
-			fielddisplay(self,'observation_string','observation string');
-			fielddisplay(self,'weights','weights (at vertices) to apply to the cfsurfacesquare');
-			fielddisplay(self,'weights_string','string for weights for identification purposes');
-			fielddisplay(self,'datatime','time to compare data to model for misfit');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-		WriteData(fid,prefix,'data',self.name,'name','md.cfsurfacesquare.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cfsurfacesquare.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.model_string,'name','md.cfsurfacesquare.model_string','format','String');
-		WriteData(fid,prefix,'data',self.observation,'name','md.cfsurfacesquare.observation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.observation_string,'name','md.cfsurfacesquare.observation_string','format','String');
-		WriteData(fid,prefix,'data',self.weights,'name','md.cfsurfacesquare.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.weights_string,'name','md.cfsurfacesquare.weights_string','format','String');
-		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacesquare.datatime','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/cfsurfacesquaretransient.m
===================================================================
--- /issm/trunk/src/m/classes/cfsurfacesquaretransient.m	(revision 28275)
+++ 	(revision )
@@ -1,83 +1,0 @@
-%MISFIT class definition
-%
-%   Usage:
-%      cfsurfacesquaretransient=cfsurfacesquaretransient();
-%      cfsurfacesquaretransient=cfsurfacesquaretransient('name','SurfaceAltimetry',...
-%                    'definitionstring','Outputdefinition1',... 
-%							'model_string','Surface',...
-%                    'observations',[md.geometry.surface;0],...
-%                    'weights',ones(md.mesh.numberofvertices+1,1));
-%
-%
-
-classdef cfsurfacesquaretransient
-	properties (SetAccess=public)
-		%cfsurfacesquaretransient
-		name                = '';
-		definitionstring    = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		model_string        = ''; %string for field that is modeled
-		observations        = NaN;%observed field that we compare the model against
-		weights             = NaN;%weight coefficients for every vertex
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.weights)
-				self.weights=project3d(md,'vector',self.weights,'type','node');
-			end
-			if ~isnan(self.observations)
-				self.observations=project3d(md,'vector',self.observations,'type','node');
-			end
-		end % }}}
-		function self = cfsurfacesquaretransient(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name                = getfieldvalue(options,'name','');
-				self.definitionstring    = getfieldvalue(options,'definitionstring');
-				self.model_string        = getfieldvalue(options,'model_string');
-				self.observations        = getfieldvalue(options,'observations',NaN);
-				self.weights             = getfieldvalue(options,'weights',NaN);
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('cfsurfacesquaretransient error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-			md = checkfield(md,'fieldname','self.observations','field',self.observations,'size',[md.mesh.numberofvertices+1 NaN],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','self.weights','field',self.weights,'size',[md.mesh.numberofvertices+1 NaN],'NaN',1,'Inf',1);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   cfsurfacesquaretransient:\n'));
-
-			fielddisplay(self,'name','identifier for this cfsurfacesquaretransient response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'model_string','string for field that is modeled');
-			fielddisplay(self,'observations','observed field that we compare the model against');
-			fielddisplay(self,'weights','weights (at vertices) to apply to the cfsurfacesquaretransient');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-		WriteData(fid,prefix,'data',self.name,'name','md.cfsurfacesquaretransient.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cfsurfacesquaretransient.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.model_string,'name','md.cfsurfacesquaretransient.model_string','format','String');
-		WriteData(fid,prefix,'data',self.observations,'name','md.cfsurfacesquaretransient.observations','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.weights,'name','md.cfsurfacesquaretransient.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/constants.js
===================================================================
--- /issm/trunk/src/m/classes/constants.js	(revision 28275)
+++ 	(revision )
@@ -1,65 +1,0 @@
-//CONSTANTS class definition
-//
-//   Usage:
-//      constants=constants();
-
-function constants() {
-	//methods 
-		this.setdefaultparameters = function (){ //{{{
-
-			//acceleration due to gravity (m/s^2)
-			this.g=9.81;
-
-			//Earth's rotation speed 
-			this.omega = 7.292*1e-5;
-
-			//converstion from year to seconds
-			this.yts=365.*24.*3600.;
-
-			//the reference temperature for enthalpy model (cf Aschwanden)
-			this.referencetemperature=223.15;
-
-			//gravitational constant: 
-			this.gravitational_constant = 6.67259e-11;
-		}// }}}
-		this.disp = function () { //{{{
-			console.log(sprintf("   Constants parameters:")); 
-			
-			fielddisplay(this,'g','gravitational acceleration [m/s^2]');
-			fielddisplay(this,'omega','angular velocity of Earth [rad/s]');
-			fielddisplay(this,'yts','number of seconds in a year [s/yr]');
-			fielddisplay(this,'referencetemperature','reference temperature used in the enthalpy model [K]');
-			fielddisplay(this,'gravitational_constant','Newtonian constant of gravitation [m^3/kg/s^2]');
-
-		} //}}}
-		this.classname = function () { //{{{
-			return "constants";
-
-		} //}}}
-		this.checkconsistency = function(md,solution,analyses) {//% {{{
-
-			checkfield(md,'fieldname','constants.g','>=',0,'size',[1,1]); //We allow 0 for validation tests
-			checkfield(md,'fieldname','constants.omega','>=',0,'size',[1,1]);
-			checkfield(md,'fieldname','constants.yts','>',0,'size',[1,1]);
-			checkfield(md,'fieldname','constants.referencetemperature','size',[1,1]);
-			checkfield(md,'fieldname','constants.gravitational_constant','size',[1,1]);
-
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'fieldname','g','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','yts','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','referencetemperature','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','gravitational_constant','format','Double');
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-		this.g						  = 0.;
-		this.omega					  = 0.;
-		this.yts					  = 0.;
-		this.referencetemperature	  = 0.;
-		this.gravitational_constant   = 0.;
-		this.setdefaultparameters();
-		//}}}
-}
Index: sm/trunk/src/m/classes/constants.m
===================================================================
--- /issm/trunk/src/m/classes/constants.m	(revision 28275)
+++ 	(revision )
@@ -1,76 +1,0 @@
-%CONSTANTS class definition
-%
-%   Usage:
-%      constants=constants();
-
-classdef constants
-	properties (SetAccess=public) 
-		g                      = 0.;
-		omega                  = 0.;
-		yts                    = 0.;
-		referencetemperature   = 0.;
-		gravitational_constant = 0.;
-	end
-	methods
-		function self = constants(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%acceleration due to gravity (m/s^2)
-			self.g=9.81;
-
-			%Earth's rotation speed 
-			self.omega = 7.292*1e-5;
-
-			%converstion from year to seconds
-			self.yts=365.*24.*3600.;
-
-			%the reference temperature for enthalpy model (cf Aschwanden)
-			self.referencetemperature=223.15;
-		
-			%gravitational constant: 
-			self.gravitational_constant = 6.67259e-11;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','constants.g','>=',0,'size',[1 1]); %We allow 0 for validation tests
-			md = checkfield(md,'fieldname','constants.omega','>=',0,'size',[1 1]);
-			md = checkfield(md,'fieldname','constants.yts','>',0,'size',[1 1]);
-			md = checkfield(md,'fieldname','constants.referencetemperature','size',[1 1]);
-			md = checkfield(md,'fieldname','constants.gravitational_constant','size',[1 1]);
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   constants parameters:'));
-
-			fielddisplay(self,'g','gravitational acceleration [m/s^2]');
-			fielddisplay(self,'omega','angular velocity of Earth [rad/s]');
-			fielddisplay(self,'yts','number of seconds in a year [s/yr]');
-			fielddisplay(self,'referencetemperature','reference temperature used in the enthalpy model [K]');
-			fielddisplay(self,'gravitational_constant','Newtonian constant of gravitation [m^3/kg/s^2]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','g','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','yts','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','referencetemperature','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','gravitational_constant','format','Double');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.constants.g'],self.g);
-			writejsdouble(fid,[modelname '.constants.omega'],self.omega);
-			writejsdouble(fid,[modelname '.constants.yts'],self.yts);
-			writejsdouble(fid,[modelname '.constants.referencetemperature'],self.referencetemperature);
-			writejsdouble(fid,[modelname '.constants.gravitational_constant'],self.gravitational_constant);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/constants.py
===================================================================
--- /issm/trunk/src/m/classes/constants.py	(revision 28275)
+++ 	(revision )
@@ -1,64 +1,0 @@
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class constants(object):
-    """CONSTANTS class definition
-
-       Usage:
-          constants = constants()
-    """
-
-    def __init__(self):  # {{{
-        self.g                      = 0.
-        self.omega                  = 0.
-        self.yts                    = 0.
-        self.referencetemperature   = 0.
-        self.gravitational_constant = 0.;
-
-        #set defaults
-        self.setdefaultparameters()
-    # }}}
-    def __repr__(self):  # {{{
-        s = '   constants parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'g', 'gravitational acceleration [m/s^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'omega', 'angular velocity of Earth [rad/s]'))
-        s += '{}\n'.format(fielddisplay(self, 'yts', 'number of seconds in a year [s/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'referencetemperature', 'reference temperature used in the enthalpy model [K]'))
-        s += '{}\n'.format(fielddisplay(self, 'gravitational_constant', 'Newtonian constant of gravitation [m^3/kg/s^2]'))
-        return s
-    # }}}
-    def setdefaultparameters(self):  # {{{
-        # Acceleration due to gravity (m / s^2)
-        self.g = 9.81
-
-        # Earth's rotation speed
-        self.omega = 7.292 * 1e-5
-
-        # Converstion from year to seconds
-        self.yts = 365.0 * 24.0 * 3600.0
-
-        # The reference temperature for enthalpy model (cf Aschwanden)
-        self.referencetemperature = 223.15
-
-        # Gravitational constant:
-        self.gravitational_constant = 6.67259e-11
-
-        return self
-    # }}}
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'constants.g', '>=', 0, 'size', [1]) # We allow 0 for validation tests
-        md = checkfield(md, 'fieldname', 'constants.omega', '>=', 0, 'size', [1])
-        md = checkfield(md, 'fieldname', 'constants.yts', '>', 0, 'size', [1])
-        md = checkfield(md, 'fieldname', 'constants.referencetemperature', 'size', [1])
-        md = checkfield(md, 'fieldname', 'constants.gravitational_constant','size',[1]);
-
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'g', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'yts', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'referencetemperature', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'gravitational_constant', 'format', 'Double');
-    # }}}
Index: sm/trunk/src/m/classes/damage.js
===================================================================
--- /issm/trunk/src/m/classes/damage.js	(revision 28275)
+++ 	(revision )
@@ -1,168 +1,0 @@
-//DAMAGE class definition
-//
-//   Usage:
-//      damage=new damage();
-
-function damage (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		
-		//damage parameters: 
-		this.isdamage=0;
-		this.D=0;
-		this.law=0;
-
-		this.max_damage=1-1e-5; //if damage reaches 1, solve becomes singular, as viscosity becomes nil
-
-		//Type of stabilization used
-		this.stabilization=4;
-
-		//Maximum number of iterations
-		this.maxiter=100;
-
-		//finite element interpolation
-		this.elementinterp='P1';
-
-		//damage evolution parameters 
-		this.stress_threshold=1.3e5;
-		this.kappa=2.8;
-		this.healing=0;
-		this.c1=0;
-		this.c2=0;
-		this.c3=0;
-		this.c4=0;
-		this.equiv_stress=0;
-
-		//output default:
-		this.requested_outputs=['default'];
-
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   Damage:\n'));
-
-		fielddisplay(this,'isdamage','is damage mechanics being used? {true,false}');
-		if (this.isdamage){
-			fielddisplay(this,'law',"damage law ['0: analytical','1: pralong']");
-			fielddisplay(this,'D','damage tensor (scalar)');
-			fielddisplay(this,'spcdamage','damage constraints (NaN means no constraint)');
-			fielddisplay(this,'max_damage','maximum possible damage (0<=max_damage<1)');
-
-			fielddisplay(this,'stabilization','0: no stabilization, 1: artificial diffusion, 2: SUPG (not working), 4: flux corrected transport');
-			fielddisplay(this,'maxiter','maximum number of non linear iterations');
-			fielddisplay(this,'elementinterp',"interpolation scheme for finite elements {'P1','P2'}");
-			fielddisplay(this,'stress_threshold','stress threshold for damage initiation [Pa]');
-			fielddisplay(this,'kappa','ductility parameter for stress softening and damage');
-			fielddisplay(this,'c1','damage parameter 1');
-			fielddisplay(this,'c2','damage parameter 2');
-			fielddisplay(this,'c3','damage parameter 3');
-			fielddisplay(this,'c4','damage parameter 4');
-			fielddisplay(this,'healing','damage healing parameter');
-			fielddisplay(this,'equiv_stress','0: von Mises, 1: max principal');
-			fielddisplay(this,'requested_outputs','additional outputs requested');
-		}
-	}// }}}
-    this.extrude = function(md) {//{{{
-        this.D=project3d(md,'vector',this.D,'type','node');
-        this.spcdamage=project3d(md,'vector',this.spcdamage,'type','node');
-        return this;
-    }//}}}
-	this.classname= function(){// {{{
-		return "damage";
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-			
-			checkfield(md,'fieldname','damage.isdamage','values',[1,0]);
-			if (this.isdamage){
-				checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2]);
-				checkfield(md,'fieldname','damage.D','>=',0,'<=',this.max_damage,'size',[md.mesh.numberofvertices ,1]);
-				checkfield(md,'fieldname','damage.spcdamage','Inf',1,'timeseries',1);
-				checkfield(md,'fieldname','damage.max_damage','<',1,'>=',0);
-				checkfield(md,'fieldname','damage.stabilization','numel',[1],'values',[0, 1, 2, 4]);
-				checkfield(md,'fieldname','damage.maxiter','>=0',0);
-				checkfield(md,'fieldname','damage.elementinterp','values',['P1','P2']);
-				checkfield(md,'fieldname','damage.stress_threshold','>=',0);
-				checkfield(md,'fieldname','damage.kappa','>',1);
-				checkfield(md,'fieldname','damage.healing','>=',0);
-				checkfield(md,'fieldname','damage.c1','>=',0);
-				checkfield(md,'fieldname','damage.c2','>=',0);
-				checkfield(md,'fieldname','damage.c3','>=',0);
-				checkfield(md,'fieldname','damage.c4','>=',0);
-				checkfield(md,'fieldname','damage.equiv_stress','numel',[1],'values',[0, 1]);
-				checkfield(md,'fieldname','damage.requested_outputs','stringrow',1);
-			}
-			else if (this.law!=0){
-				if (solution=='DamageEvolutionSolution'){
-					throw Error('Invalid evolution law (md.damage.law) for a damage solution');
-				}
-			}
-		} //}}}
-		this.marshall=function(md,prefix,fid) { //{{{
-		
-			WriteData(fid,prefix,'object',this,'fieldname','isdamage','format','Boolean');
-			if (this.isdamage){
-				WriteData(fid,prefix,'object',this,'fieldname','law','format','Integer');
-				WriteData(fid,prefix,'object',this,'fieldname','D','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',this,'fieldname','spcdamage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',this,'fieldname','max_damage','format','Double');
-
-				WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
-				WriteData(fid,prefix,'object',this,'fieldname','maxiter','format','Integer');
-				WriteData(fid,prefix,'name','md.damage.elementinterp','data',this.elementinterp,'format','String');
-				WriteData(fid,prefix,'object',this,'fieldname','stress_threshold','format','Double');
-				WriteData(fid,prefix,'object',this,'fieldname','kappa','format','Double');
-				WriteData(fid,prefix,'object',this,'fieldname','c1','format','Double');
-				WriteData(fid,prefix,'object',this,'fieldname','c2','format','Double');
-				WriteData(fid,prefix,'object',this,'fieldname','c3','format','Double');
-				WriteData(fid,prefix,'object',this,'fieldname','c4','format','Double');
-				WriteData(fid,prefix,'object',this,'fieldname','healing','format','Double');
-				WriteData(fid,prefix,'object',this,'fieldname','equiv_stress','format','Integer');
-			}
-
-			//process requested outputs
-			var outputs = this.requested_outputs;
-			for (var i=0;i<outputs.length;i++){
-				if (outputs[i] == 'default') {
-					outputs.splice(i,1);
-					outputs.push(this.defaultoutputs(md));
-				}
-			}
-			if (this.isdamage){
-				WriteData(fid,prefix,'data',outputs,'name','md.damage.requested_outputs','format','StringArray');
-			}
-
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-		this.defaultoutputs = function(md){ //{{{
-
-			if (md.mesh.domaintype() == '2Dhorizontal') return 'DamageDbar';
-			else return 'DamageD';
-
-		}//}}}
-	//properties 
-	// {{{
-	this.isdamage            = 0;
-	this.D                   = NaN;
-	this.law                 = 0;
-	this.spcdamage           = NaN; 
-	this.max_damage          = 0;
-
-	//numerical
-	this.stabilization       = 0;
-	this.maxiter             = 0;
-	this.elementinterp       = '';
-
-	//general parameters for evolution law: 
-	this.stress_threshold    = 0;
-	this.kappa               = 0;
-	this.c1                  = 0;
-	this.c2                  = 0;
-	this.c3                  = 0;
-	this.c4                  = 0;
-	this.healing             = 0;
-	this.equiv_stress		  = 0;
-	this.requested_outputs   = [];
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/damage.m
===================================================================
--- /issm/trunk/src/m/classes/damage.m	(revision 28275)
+++ 	(revision )
@@ -1,192 +1,0 @@
-%DAMAGEICE class definition
-%
-%   Usage:
-%      damage=damage();
-
-classdef damage
-	properties (SetAccess=public)  
-		%damage 
-		isdamage            = 0;
-		D                   = NaN;
-		law                 = 0;
-		spcdamage           = NaN; 
-		max_damage          = 0;
-	
-		%numerical
-		stabilization       = 0;
-		maxiter             = 0;
-		elementinterp       = '';
-		
-		%general parameters for evolution law: 
-		stress_threshold    = 0;
-		stress_ubound       = 0;
-		kappa               = 0;
-		c1                  = 0;
-		c2                  = 0;
-		c3                  = 0;
-		c4                  = 0;
-		healing             = 0;
-		equiv_stress		  = 0;
-		requested_outputs   = {};
-	end
-	methods
-		function self = damage(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('damage');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.D=project3d(md,'vector',self.D,'type','node');
-			self.spcdamage=project3d(md,'vector',self.spcdamage,'type','node');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%damage parameters: 
-			self.isdamage=0;
-			self.D=0;
-			self.law=0;
-			
-			self.max_damage=1-1e-5; %if damage reaches 1, solve becomes singular, as viscosity becomes nil
-		
-			%Type of stabilization used
-			self.stabilization=4;
-			
-			%Maximum number of iterations
-			self.maxiter=100;
-
-			%finite element interpolation
-			self.elementinterp='P1';
-
-			%damage evolution parameters 
-			self.stress_threshold=1.3e5;
-			self.kappa=2.8;
-			self.healing=0;
-			self.c1=0;
-			self.c2=0;
-			self.c3=0;
-			self.c4=0;
-			self.equiv_stress=0;
-
-			 %output default:
-			 self.requested_outputs={'default'};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			
-			md = checkfield(md,'fieldname','damage.isdamage','values',[1,0]);
-			if self.isdamage,
-				md = checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2,3]);
-				md = checkfield(md,'fieldname','damage.D','>=',0,'<=',self.max_damage,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','damage.spcdamage','Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','damage.max_damage','<',1,'>=',0);
-				md = checkfield(md,'fieldname','damage.stabilization','numel',[1],'values',[0 1 2 4]);
-				md = checkfield(md,'fieldname','damage.maxiter','>=0',0);
-				md = checkfield(md,'fieldname','damage.elementinterp','values',{'P1','P2'});
-				md = checkfield(md,'fieldname','damage.stress_threshold','>=',0);
-				md = checkfield(md,'fieldname','damage.stress_ubound','>=',0);
-				md = checkfield(md,'fieldname','damage.kappa','>',1);
-				md = checkfield(md,'fieldname','damage.healing','>=',0);
-				md = checkfield(md,'fieldname','damage.c1','>=',0);
-				md = checkfield(md,'fieldname','damage.c2','>=',0);
-				md = checkfield(md,'fieldname','damage.c3','>=',0);
-				md = checkfield(md,'fieldname','damage.c4','>=',0);
-				md = checkfield(md,'fieldname','damage.equiv_stress','numel',[1],'values',[0 1]);
-				md = checkfield(md,'fieldname','damage.requested_outputs','stringrow',1);
-			elseif (self.law~=0),
-				if (strcmp(solution,'DamageEvolutionSolution')),
-					error('Invalid evolution law (md.damage.law) for a damage solution');
-				end
-			end
-		end % }}}
-		function list=defaultoutputs(self,md) % {{{
-
-			if strcmp(domaintype(md.mesh),'2Dhorizontal'),
-            list = {'DamageDbar'};
-         else
-            list = {'DamageD'};
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Damage:\n'));
-
-			fielddisplay(self,'isdamage','is damage mechanics being used? {true,false}');
-			if self.isdamage,
-				fielddisplay(self,'law','damage law {''0: analytical'',''1: pralong''}');
-				fielddisplay(self,'D','damage tensor (scalar)');
-				fielddisplay(self,'spcdamage','damage constraints (NaN means no constraint)');
-				fielddisplay(self,'max_damage','maximum possible damage (0<=max_damage<1)');
-				
-				fielddisplay(self,'stabilization','0: no stabilization, 1: artificial diffusion, 2: SUPG (not working), 4: flux corrected transport');
-				fielddisplay(self,'maxiter','maximum number of non linear iterations');
-				fielddisplay(self,'elementinterp','interpolation scheme for finite elements {''P1'',''P2''}');
-				fielddisplay(self,'stress_threshold','stress threshold for damage initiation (Pa)');
-				fielddisplay(self,'stress_ubound','stress upper bound for damage healing (Pa), arctan law');
-				fielddisplay(self,'kappa','ductility parameter for stress softening and damage');
-				fielddisplay(self,'c1','damage parameter 1');
-				fielddisplay(self,'c2','damage parameter 2');
-				fielddisplay(self,'c3','damage parameter 3');
-				fielddisplay(self,'c4','damage parameter 4');
-				fielddisplay(self,'healing','damage healing parameter');
-				fielddisplay(self,'equiv_stress','0: von Mises, 1: max principal');
-				fielddisplay(self,'requested_outputs','additional outputs requested');
-			end
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-		
-			WriteData(fid,prefix,'object',self,'fieldname','isdamage','format','Boolean');
-			if self.isdamage,
-				WriteData(fid,prefix,'object',self,'fieldname','law','format','Integer');
-				WriteData(fid,prefix,'object',self,'fieldname','D','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'fieldname','spcdamage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'fieldname','max_damage','format','Double');
-
-				WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer');
-				WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer');
-				WriteData(fid,prefix,'name','md.damage.elementinterp','data',self.elementinterp,'format','String');
-				WriteData(fid,prefix,'object',self,'fieldname','stress_threshold','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','stress_ubound','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','kappa','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','c1','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','c2','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','c3','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','c4','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','healing','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','equiv_stress','format','Integer');
-			end
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			if self.isdamage,
-				WriteData(fid,prefix,'data',outputs,'name','md.damage.requested_outputs','format','StringArray');
-			end
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.damage.isdamage'],self.isdamage);
-			if self.isdamage,
-				error('savemodeljs error message: not implemented  yet!');
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/damage.py
===================================================================
--- /issm/trunk/src/m/classes/damage.py	(revision 28275)
+++ 	(revision )
@@ -1,169 +1,0 @@
-from fielddisplay import fielddisplay
-from project3d import project3d
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class damage(object):
-    """
-    DAMAGE class definition
-
-       Usage:
-          damage = damage()
-    """
-
-    def __init__(self, *args):  # {{{
-        #damage:
-        self.isdamage = 0.
-        self.D = float('NaN')
-        self.law = float('NaN')
-        self.spcdamage = float('NaN')
-        self.max_damage = float('NaN')
-
-        #numerical
-        self.stabilization = float('NaN')
-        self.maxiter = float('NaN')
-        self.elementinterp = ''
-
-        #general parameters for evolution law:
-        self.stress_threshold = float('NaN')
-        self.stress_ubound = float('NaN')
-        self.kappa = float('NaN')
-        self.c1 = float('NaN')
-        self.c2 = float('NaN')
-        self.c3 = float('NaN')
-        self.c4 = float('NaN')
-        self.healing = float('NaN')
-        self.equiv_stress = float('NaN')
-        self.requested_outputs = []
-
-        if not len(args):
-            self.setdefaultparameters()
-        else:
-            raise RuntimeError("constructor not supported")
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Damage:\n'
-        s += "%s\n" % fielddisplay(self, "isdamage", "is damage mechanics being used? [0 (default) or 1]")
-        if self.isdamage:
-            s += "%s\n" % fielddisplay(self, "D", "damage tensor (scalar for now)")
-            s += "%s\n" % fielddisplay(self, "law", "damage law ['0: analytical', '1: pralong']")
-            s += "%s\n" % fielddisplay(self, "spcdamage", "damage constraints (NaN means no constraint)")
-            s += "%s\n" % fielddisplay(self, "max_damage", "maximum possible damage (0 <=max_damage < 1)")
-            s += "%s\n" % fielddisplay(self, "stabilization", "0: no stabilization, 1: artificial diffusion, 2: SUPG (not working), 4: flux corrected transport")
-            s += "%s\n" % fielddisplay(self, "maxiter", "maximum number of non linear iterations")
-            s += "%s\n" % fielddisplay(self, "elementinterp", "interpolation scheme for finite elements [''P1'', ''P2'']")
-            s += "%s\n" % fielddisplay(self, "stress_threshold", "stress threshold for damage initiation (Pa)")
-            s += "%s\n" % fielddisplay(self, "stress_ubound", "stress upper bound for damage healing (Pa)")
-            s += "%s\n" % fielddisplay(self, "kappa", "ductility parameter for stress softening and damage [ > 1]")
-            s += "%s\n" % fielddisplay(self, "c1", "damage parameter 1 ")
-            s += "%s\n" % fielddisplay(self, "c2", "damage parameter 2 ")
-            s += "%s\n" % fielddisplay(self, "c3", "damage parameter 3 ")
-            s += "%s\n" % fielddisplay(self, "c4", "damage parameter 4 ")
-            s += "%s\n" % fielddisplay(self, "healing", "damage healing parameter")
-            s += "%s\n" % fielddisplay(self, "equiv_stress", "0: von Mises, 1: max principal")
-            s += "%s\n" % fielddisplay(self, 'requested_outputs', 'additional outputs requested')
-
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        if self.isdamage:
-            self.D = project3d(md, 'vector', self.D, 'type', 'node')
-            self.spcdamage = project3d(md, 'vector', self.spcdamage, 'type', 'node')
-            return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #damage parameters:
-        self.isdamage = 0
-        self.D = 0
-        self.law = 0
-        self.max_damage = 1 - 1e-5  #if damage reaches 1, solve becomes singular, as viscosity becomes nil
-        #Type of stabilization used
-        self.stabilization = 4
-        #Maximum number of iterations
-        self.maxiter = 100
-        #finite element interpolation
-        self.elementinterp = 'P1'
-        #damage evolution parameters
-        self.stress_threshold = 1.3e5
-        self.kappa = 2.8
-        self.c1 = 0
-        self.c2 = 0
-        self.c3 = 0
-        self.c4 = 0
-        self.healing = 0
-        self.equiv_stress = 0
-        #output default:
-        self.requested_outputs = ['default']
-
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        if md.mesh.domaintype().lower() == '2dhorizontal':
-            list = ['DamageDbar']
-        else:
-            list = ['DamageD']
-        return list
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'damage.isdamage', 'numel', [1], 'values', [0, 1])
-        if self.isdamage:
-            md = checkfield(md, 'fieldname', 'damage.D', '>=', 0, '<=', self.max_damage, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'damage.max_damage', '<', 1, '>=', 0)
-            md = checkfield(md, 'fieldname', 'damage.law', 'numel', [1], 'values', [0, 1, 2, 3])
-            md = checkfield(md, 'fieldname', 'damage.spcdamage', 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'damage.stabilization', 'numel', [1], 'values', [0, 1, 2, 4])
-            md = checkfield(md, 'fieldname', 'damage.maxiter', ' >= 0', 0)
-            md = checkfield(md, 'fieldname', 'damage.elementinterp', 'values', ['P1', 'P2'])
-            md = checkfield(md, 'fieldname', 'damage.stress_threshold', '>=', 0)
-            md = checkfield(md, 'fieldname', 'damage.stress_ubound', '>=', 0)
-            md = checkfield(md, 'fieldname', 'damage.kappa', '>', 1)
-            md = checkfield(md, 'fieldname', 'damage.healing', '>=', 0)
-            md = checkfield(md, 'fieldname', 'damage.c1', '>=', 0)
-            md = checkfield(md, 'fieldname', 'damage.c2', '>=', 0)
-            md = checkfield(md, 'fieldname', 'damage.c3', '>=', 0)
-            md = checkfield(md, 'fieldname', 'damage.c4', '>=', 0)
-            md = checkfield(md, 'fieldname', 'damage.healing', '>=', 0)
-            md = checkfield(md, 'fieldname', 'damage.equiv_stress', 'numel', [1], 'values', [0, 1])
-            md = checkfield(md, 'fieldname', 'damage.requested_outputs', 'stringrow', 1)
-        elif self.law != 0:
-            if (solution == 'DamageEvolutionSolution'):
-                raise RuntimeError('Invalid evolution law (md.damage.law) for a damage solution')
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdamage', 'format', 'Boolean')
-        if self.isdamage:
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'D', 'format', 'DoubleMat', 'mattype', 1)
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'law', 'format', 'Integer')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'spcdamage', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'max_damage', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'format', 'Integer')
-            WriteData(fid, prefix, 'name', 'md.damage.elementinterp', 'data', self.elementinterp, 'format', 'String')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_ubound', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'kappa', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'c1', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'c2', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'c3', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'c4', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'healing', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'equiv_stress', 'format', 'Integer')
-
-    #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        if self.isdamage:
-            WriteData(fid, prefix, 'data', outputs, 'name', 'md.damage.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/debris.m
===================================================================
--- /issm/trunk/src/m/classes/debris.m	(revision 28275)
+++ 	(revision )
@@ -1,175 +1,0 @@
-%DEBRIS class definition
-%
-%   Usage:
-%      debris=debris();
-
-classdef debris
-	properties (SetAccess=public)
-		spcthickness             = NaN;
-		min_thickness            = 0;
-		stabilization            = 0;
-		packingfraction          = 0;
-		removalmodel             = 0;
-		displacementmodel        = 0;
-		max_displacementvelocity = 0;
-		removal_slope_threshold  = 0;
-		removal_stress_threshold = 0;
-		vertex_pairing           = NaN;
-		requested_outputs        = {};
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. If the input is a struct it is an old version of this class and
-			% old fields must be recovered (make sure they are in the deprecated
-			% model properties)
-
-			if verLessThan('matlab','7.9'),
-				disp('Warning: your matlab version is old and there is a risk that load does not work correctly');
-				disp('         if the model is not loaded correctly, rename temporarily loadobj so that matlab does not use it');
-
-				% This is a Matlab bug: all the fields of md have their default value
-				% Example of error message:
-				% Warning: Error loading an object of class 'model':
-				% Undefined function or method 'exist' for input arguments of type 'cell'
-				%
-				% This has been fixed in MATLAB 7.9 (R2009b) and later versions
-			end
-
-			if isstruct(self)
-				disp('Recovering debris from older version');
-				self = structtoobj(debris(),self);
-			end
-		end% }}}
-	end
-	methods
-		function self = debris(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('debris');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.spcthickness=project3d(md,'vector',self.spcthickness,'type','node');
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-
-			list = {'DebrisThickness','DebrisMaskNodeActivation','VxDebris','VyDebris'};
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
-			self.stabilization=2;
-
-			%Minimum debris thickness that can be used
-			self.min_thickness=0;
-
-			%Fraction of debris covered in the ice
-			self.packingfraction=0.01;
-
-			%Type of frontal debris removal
-			self.removalmodel=0;
-
-			%Type of debris displacement
-			self.displacementmodel=0;
-
-			%Slope threshold for removalmodel (1)
-			self.removal_slope_threshold=0;
-
-			%Stress threshold for removalmodel (2)
-			self.removal_stress_threshold=0;
-
-			%Max velocity for displacementmodel (1)
-			self.max_displacementvelocity=0;
-
-			%default output
-			self.requested_outputs={'default'};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('MasstransportAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isdebris==0), return; end
-
-			md = checkfield(md,'fieldname','debris.spcthickness');
-			md = checkfield(md,'fieldname','debris.stabilization','values',[0 1 2 3 4 5]);
-			md = checkfield(md,'fieldname','debris.min_thickness','>=',0);
-			md = checkfield(md,'fieldname','debris.packingfraction','>=',0);
-			md = checkfield(md,'fieldname','debris.removalmodel','values',[0 1 2]);
-			md = checkfield(md,'fieldname','debris.displacementmodel','values',[0 1 2]);
-			md = checkfield(md,'fieldname','debris.max_displacementvelocity','>=',0);
-			md = checkfield(md,'fieldname','debris.removal_slope_threshold','>=',0);
-			md = checkfield(md,'fieldname','debris.removal_stress_threshold','>=',0);
-			md = checkfield(md,'fieldname','debris.requested_outputs','stringrow',1);
-			if ~any(isnan(md.stressbalance.vertex_pairing)),
-				md = checkfield(md,'fieldname','stressbalance.vertex_pairing','>',0);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   debris solution parameters:'));
-			fielddisplay(self,'spcthickness','debris thickness constraints (NaN means no constraint) [m]');
-			fielddisplay(self,'min_thickness','minimum debris thickness allowed [m]');
-			fielddisplay(self,'packingfraction','fraction of debris covered in the ice');
-			fielddisplay(self,'stabilization','0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: streamline upwind Petrov-Galerkin (SUPG)');
-			fielddisplay(self,'removalmodel','frontal removal of debris. 0: no removal, 1: Slope-triggered debris removal, 2: driving-stress triggered debris removal');
-			fielddisplay(self,'displacementmodel','debris displacement. 0: no displacement, 1: additional debris velocity above the critical slope/stress threshold');
-			fielddisplay(self,'max_displacementvelocity','maximum velocity of debris transport (v_ice + v_displacement) (m/a)');
-			fielddisplay(self,'removal_slope_threshold','critical slope (degrees) for removalmodel (1)');
-			fielddisplay(self,'removal_stress_threshold','critical stress (Pa) for removalmodel (2)');
-
-			disp(sprintf('\n      %s','Penalty options:'));
-			fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','removalmodel','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','displacementmodel','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','max_displacementvelocity','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','removal_slope_threshold','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','removal_stress_threshold','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','packingfraction','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.debris.requested_outputs','format','StringArray');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.debris.spcthickness'],self.spcthickness);
-			writejsdouble(fid,[modelname '.debris.min_thickness'],self.min_thickness);
-			writejsdouble(fid,[modelname '.debris.stabilization'],self.stabilization);
-			writejsdouble(fid,[modelname '.debris.removalmodel'],self.removalmodel);
-			writejsdouble(fid,[modelname '.debris.displacementmodel'],self.displacementmodel);
-			writejsdouble(fid,[modelname '.debris.max_displacementvelocity'],self.displacementmodel);
-			writejsdouble(fid,[modelname '.debris.removal_slope_threshold'],self.removal_slope_threshold);
-			writejsdouble(fid,[modelname '.debris.removal_stress_threshold'],self.removal_stress_threshold);
-			writejsdouble(fid,[modelname '.debris.packingfraction'],self.packingfraction);
-			writejs2Darray(fid,[modelname '.debris.vertex_pairing'],self.vertex_pairing);
-			writejsdouble(fid,[modelname '.debris.penalty_factor'],self.penalty_factor);
-			writejscellstring(fid,[modelname '.debris.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/debris.py
===================================================================
--- /issm/trunk/src/m/classes/debris.py	(revision 28275)
+++ 	(revision )
@@ -1,136 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class debris(object):
-    """debris class definition
-
-    Usage:
-        debris = debris()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.spcthickness = np.nan
-        self.min_thickness = 0
-        self.stabilization = 0
-        self.packingfraction = 0
-        self.removalmodel = 0
-        self.displacementmodel = 0
-        self.max_displacementvelocity = 0
-        self.removal_slope_threshold = 0
-        self.removal_stress_threshold = 0
-        self.vertex_pairing = np.nan
-        self.requested_outputs = []
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            # TODO: Replace the following with constructor
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   debris solution parameters:\n'
-        s += '{}\n'.format(fielddisplay(self,'spcthickness','debris thickness constraints (NaN means no constraint) [m]'))
-        s += '{}\n'.format(fielddisplay(self,'min_thickness','minimum debris thickness allowed [m]'))
-        s += '{}\n'.format(fielddisplay(self,'packingfraction','fraction of debris covered in the ice'))
-        s += '{}\n'.format(fielddisplay(self,'stabilization','0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: streamline upwind Petrov-Galerkin (SUPG)'))
-        s += '{}\n'.format(fielddisplay(self,'removalmodel','frontal removal of debris. 0: no removal, 1: Slope-triggered debris removal, 2: driving-stress triggered debris removal'))
-        s += '{}\n'.format(fielddisplay(self,'displacementmodel','debris displacement. 0: no displacement, 1: ...'))
-        s += '{}\n'.format(fielddisplay(self,'max_displacementvelocity','maximum velocity of debris transport (v_ice + v_displacement) (m/a)'))
-        s += '{}\n'.format(fielddisplay(self,'removal_slope_threshold','critical slope (degrees) for removalmodel (1)'))
-        s += '{}\n'.format(fielddisplay(self,'removal_stress_threshold','critical stress (Pa) for removalmodel (2)'))
-
-        s += '\n      {}\n'.format('Penalty options:')
-        s += '{}\n'.format(fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized'))
-        s += '{}\n'.format(fielddisplay(self,'requested_outputs','additional outputs requested'))
-        return s
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['DebrisThickness', 'DebrisMaskNodeActivation', 'VxDebris', 'VyDebris']
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
-        self.stabilization = 2
-
-        # Minimum debris thickness that can be used
-        self.min_thickness = 0
-
-        # Fraction of debris covered in the ice
-        self.packingfraction = 0.01
-
-        # Type of frontal debris removal
-        self.removalmodel = 0
-
-        # Type of debris displacement
-        self.displacementmodel = 0
-
-        # Slope threshold for removalmodel (1)
-        self.removal_slope_threshold = 0
-
-        # Stress threshold for removalmodel (2)
-        self.removal_stress_threshold = 0
-
-        # Max velocity for displacementmodel (1)
-        self.max_displacementvelocity = 0
-
-        # Default output
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if not 'MasstransportAnalysis' in analyses or solution == 'TransientSolution' and not md.transient.isdebris:
-            return md
-
-        md = checkfield(md, 'fieldname', 'debris.spcthickness')
-        md = checkfield(md, 'fieldname', 'debris.stabilization', 'values', [0, 1, 2, 3, 4, 5])
-        md = checkfield(md, 'fieldname', 'debris.min_thickness', '>=', 0)
-        md = checkfield(md, 'fieldname', 'debris.packingfraction', '>=', 0)
-        md = checkfield(md, 'fieldname', 'debris.removalmodel', 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'debris.displacementmodel', 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'debris.max_displacementvelocity', '>=', 0)
-        md = checkfield(md, 'fieldname', 'debris.removal_slope_threshold', '>=', 0)
-        md = checkfield(md, 'fieldname', 'debris.removal_stress_threshold', '>=', 0)
-        md = checkfield(md, 'fieldname', 'debris.requested_outputs', 'stringrow', 1)
-
-        if not np.any(np.isnan(md.stressbalance.vertex_pairing)) and len(md.stressbalance.vertex_pairing) > 0:
-            md = checkfield(md, 'fieldname', 'stressbalance.vertex_pairing', '>', 0)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_thickness', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'removalmodel', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementmodel', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'max_displacementvelocity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'removal_slope_threshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'removal_stress_threshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'packingfraction', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vertex_pairing', 'format', 'DoubleMat', 'mattype', 3)
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.debris.requested_outputs', 'format', 'StringArray')
-    # }}}
-
-    def extrude(self, md):  #{{{
-        self.spcthickness = project3d(md, 'vector', self.spcthickness, 'type', 'node')
-        return
-    # }}}
Index: sm/trunk/src/m/classes/debug.js
===================================================================
--- /issm/trunk/src/m/classes/debug.js	(revision 28275)
+++ 	(revision )
@@ -1,35 +1,0 @@
-//DEBUG class definition
-//
-//   Usage:
-//      debug=new debug();
-
-function debug (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-	}// }}}
-	this.classname= function(){// {{{
-		return "debug";
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   debug parameters:'));
-		console.log(sprintf('   debug parameters:'));
-
-		fielddisplay(this,'valgrind','use Valgrind to debug (0 or 1)');
-		fielddisplay(this,'gprof','use gnu-profiler to find out where the time is spent');
-		fielddisplay(this,'profiling','enables profiling (memory, flops, time)');
-
-	}// }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'fieldname','profiling','format','Boolean');
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-
-	//properties 
-	// {{{
-	this.valgrind = false;
-	this.gprof    = false;
-	this.profiling = false;
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/debug.m
===================================================================
--- /issm/trunk/src/m/classes/debug.m	(revision 28275)
+++ 	(revision )
@@ -1,43 +1,0 @@
-%DEBUG class definition
-%
-%   Usage:
-%      debug=debug();
-
-classdef debug
-	properties (SetAccess=public) 
-		valgrind = false;
-		gprof    = false;
-		profiling = false;
-	end
-	methods
-		function self = debug(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-				end
-			end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   debug parameters:'));
-
-			fielddisplay(self,'valgrind','use Valgrind to debug (0 or 1)');
-			fielddisplay(self,'gprof','use gnu-profiler to find out where the time is spent');
-			fielddisplay(self,'profiling','enables profiling (memory, flops, time)');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','profiling','format','Boolean');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.debug.valgrind'],self.valgrind);
-			writejsdouble(fid,[modelname '.debug.gprof'],self.gprof);
-			writejsdouble(fid,[modelname '.debug.profiling'],self.profiling);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/debug.py
===================================================================
--- /issm/trunk/src/m/classes/debug.py	(revision 28275)
+++ 	(revision )
@@ -1,38 +1,0 @@
-from fielddisplay import fielddisplay
-from WriteData import *
-
-
-class debug(object):
-    """
-    DEBUG class definition
-
-       Usage:
-          debug = debug()
-    """
-
-    def __init__(self):  # {{{
-        self.valgrind = False
-        self.gprof = False
-        self.profiling = False
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "   debug parameters:"
-
-        string = "%s\n%s" % (string, fielddisplay(self, "valgrind", "use Valgrind to debug (0 or 1)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "gprof", "use gnu - profiler to find out where the time is spent"))
-        string = "%s\n%s" % (string, fielddisplay(self, 'profiling', 'enables profiling (memory, flops, time)'))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'profiling', 'format', 'Boolean')
-    # }}}
Index: sm/trunk/src/m/classes/dependent.m
===================================================================
--- /issm/trunk/src/m/classes/dependent.m	(revision 28275)
+++ 	(revision )
@@ -1,73 +1,0 @@
-%DEPENDENT class definition
-%
-%   Usage:
-%      dependent=dependent();
-
-classdef dependent
-	properties (SetAccess=public) 
-		name                 = '';
-		fos_reverse_index    = NaN;
-		exp                  = '';
-		segments             = [];
-		nods                 = 0;
-	end
-	methods
-		function self = dependent(varargin) % {{{
-
-			%use provided options to change fields
-			options=pairoptions(varargin{:});
-
-			self.name=getfieldvalue(options,'name','');
-			self.exp=getfieldvalue(options,'exp','');
-			self.segments=getfieldvalue(options,'segments',[]);
-			self.nods=getfieldvalue(options,'nods',0);
-
-			%if name is mass flux: 
-			if strcmpi(self.name,'MassFlux'),
-				%make sure that we supplied a file and that it exists! 
-				if exist(self.exp)~=2,
-					error('dependent checkconsistency: specified ''exp'' file does not exist!');
-				end
-				%process the file and retrieve segments
-				mesh=getfieldvalue(options,'mesh');
-				self.segments=MeshProfileIntersection(mesh.elements,mesh.x,mesh.y,self.exp);
-			end
-		end
-		%}}}
-		function self = setdefaultparameters(self) % {{{
-			%do nothing
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			if strcmpi(self.name,'MassFlux'),
-				if isempty(self.segments),
-					error('dependent checkconsistency error: need segments to compute this dependent response');
-				end
-				if self.index<=0,
-					error('dependent checkconsistency error: index for segments should be >=1');
-				end
-			end
-			if ~isnan(self.fos_reverse_index),
-				if ~strcmpi(driver,'fos_reverse'),
-					error('cannot declare a dependent with a fos_reverse_index when the driver is not fos_reverse!');
-				end
-				if self.nods==0,
-					error('dependent checkconsistency error: nods should be set to the size of the independent variable');
-				end
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   dependent variable:'));
-
-			fielddisplay(self,'name','variable name (must match corresponding String)');
-			if ~isnan(self.fos_reverse_index),
-				fielddisplay(self,'fos_reverse_index','index for fos_reverse driver of ADOLC');
-			end
-			if ~isempty(self.exp),
-				fielddisplay(self,'exp','file needed to compute dependent variable');
-				fielddisplay(self,'segments','mass flux segments');
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/dependent.py
===================================================================
--- /issm/trunk/src/m/classes/dependent.py	(revision 28275)
+++ 	(revision )
@@ -1,77 +1,0 @@
-import os.path
-import numpy as np
-from pairoptions import pairoptions
-from fielddisplay import fielddisplay
-from MatlabFuncs import *
-from MeshProfileIntersection import MeshProfileIntersection
-
-
-class dependent(object):
-    """
-    DEPENDENT class definition
-
-       Usage:
-          dependent = dependent()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.name = ''
-        self.fos_reverse_index = float('NaN')
-        self.exp = ''
-        self.segments = []
-        self.index = -1
-        self.nods = 0
-
-    #set defaults
-        self.setdefaultparameters()
-
-    #use provided options to change fields
-        options = pairoptions(*args)
-
-        self.name = options.getfieldvalue('name', '')
-        self.exp = options.getfieldvalue('exp', '')
-        self.segments = options.getfieldvalue('segments', [])
-        self.index = options.getfieldvalue('index', -1)
-        self.nods = options.getfieldvalue('nods', 0)
-
-        #if name is mass flux:
-        if strcmpi(self.name, 'MassFlux'):
-            #make sure that we supplied a file and that it exists!
-            if not os.path.exists(self.exp):
-                raise IOError("dependent checkconsistency: specified 'exp' file does not exist!")
-            #process the file and retrieve segments
-            mesh = options.getfieldvalue('mesh')
-            self.segments = MeshProfileIntersection(mesh.elements, mesh.x, mesh.y, self.exp)[0]
-    # }}}
-    def __repr__(self):  # {{{
-        s = "   dependent variable:\n"
-
-        s += "%s\n" % fielddisplay(self, 'name', "variable name (must match corresponding String)")
-
-        if not np.isnan(self.fos_reverse_index):
-            s += "%s\n" % fielddisplay(self, 'fos_reverse_index', "index for fos_reverse driver of ADOLC")
-        if self.exp:
-            s += "%s\n" % fielddisplay(self, 'exp', "file needed to compute dependent variable")
-            s += "%s\n" % fielddisplay(self, 'segments', "mass flux segments")
-
-        return s
-    # }}}
-    def setdefaultparameters(self):  # {{{
-        #do nothing
-        return self
-    # }}}
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if strcmpi(self.name, 'MassFlux'):
-            if not self.segments:
-                raise RuntimeError("dependent checkconsistency error: need segments to compute this dependent response")
-            if self.index < 0:
-                raise RuntimeError("dependent checkconsistency error: index for segments should be >= 0")
-
-        if not np.isnan(self.fos_reverse_index):
-            if not strcmpi(driver, 'fos_reverse'):
-                raise TypeError("cannot declare a dependent with a fos_reverse_index when the driver is not fos_reverse!")
-            if self.nods == 0:
-                raise TypeError("dependent checkconsistency error: nods should be set to the size of the independent variable")
-
-        return md
-    # }}}
Index: sm/trunk/src/m/classes/dsl.js
===================================================================
--- /issm/trunk/src/m/classes/dsl.js	(revision 28275)
+++ 	(revision )
@@ -1,61 +1,0 @@
-class dsl {//{{{
-	/**
-	 * DSL class definition
-	 *
-	 * Usage:
-	 *     dsl=dsl();
-	 * 
-	 * TODO:
-	 * - Implement from struct constructor (see dsl.m)?
-	 */
-	constructor() {//{{{
-		this.global_average_thermosteric_sea_level; // Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m)
-		this.sea_surface_height_above_geoid; // Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m)
-		this.sea_water_pressure_at_sea_floor; // Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!)
-
-		let nargs = arguments.length;
-		if (nargs == 0) {
-			this.setdefaultparameters();
-		} else {
-			error('constructor not supported');
-		}
-	} //}}}
-
-	setdefaultparameters() {//{{{
-		this.global_average_thermosteric_sea_level = NaN;
-		this.sea_surface_height_above_geoid = NaN;
-		this.sea_water_pressure_at_sea_floor = NaN;
-	} //}}}
-
-	checkconsistency(md, solution, analyses) {//{{{
-		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc) || !md.transient.isoceantransport) {
-			return md;
-		}
-
-		md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1);
-		md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1);
-		md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1);
-
-		if (md.solidearth.settings.compute_bp_grd) {
-			md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'empty', 1);
-		}
-
-		return md;
-	} //}}}
-
-	disp() {//{{{
-		console.log('WARNING: dsl::disp is not yet implemented');
-	} //}}}
-
-	marshall(md, prefix, fid) {//{{{
-		WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'timeserieslength', 2, 'yts', md.constants.yts); // mattype 2, because we are sending a GMSL value identical everywhere on each element
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts); // mattype 1 because we specify DSL at vertex locations
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts); // mattype 1 because we specify bottom pressure at vertex locations
-	} //}}}
-
-	extrude(md) {//{{{
-		this.sea_surface_height_above_geoid = project3d(md, 'vector', this.sea_surface_height_above_geoid, 'type', 'node', 'layer', 1);
-		this.sea_water_pressure_at_sea_floor = project3d(md, 'vector', this.sea_water_pressure_at_sea_floor, 'type', 'node', 'layer', 1);
-	} //}}}
-} //}}}
Index: sm/trunk/src/m/classes/dsl.m
===================================================================
--- /issm/trunk/src/m/classes/dsl.m	(revision 28275)
+++ 	(revision )
@@ -1,90 +1,0 @@
-%DSL class definition
-%
-%   Usage:
-%      dsl=dsl(); %dynamic sea level class, based on CMIP5 outputs
-
-classdef dsl
-	properties (SetAccess=public) 
-
-		global_average_thermosteric_sea_level; %Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).
-		sea_surface_height_above_geoid; %Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).
-		sea_water_pressure_at_sea_floor; %Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).
-
-	end
-	methods
-		function self = dsl(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(dsl(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.global_average_thermosteric_sea_level=NaN;
-			self.sea_surface_height_above_geoid=NaN;
-			self.sea_water_pressure_at_sea_floor=NaN;
-
-		end % }}}
-		function disp(self) % {{{
-
-			disp(sprintf('   dsl parameters:'));
-			fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).');
-			fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).');
-			fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).');
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc == 0) | (md.transient.isoceantransport==0),
-				return;
-			end
-			md = checkfield(md,'fieldname','dsl.global_average_thermosteric_sea_level','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','dsl.sea_surface_height_above_geoid','NaN',1,'Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','NaN',1,'Inf',1,'timeseries',1);
-			
-			if md.solidearth.settings.compute_bp_grd==1, 
-				md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','empty',1);
-			end
-			
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','DoubleMat','mattype',2,'timeseries',1,'timeserieslength',2,'yts',yts); %mattype 2, because we are sending a GMSL value identical everywhere on each element. 
-			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); %mattype 1 because we specify DSL at vertex locations.
-			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); %mattype 1 because we specify bottom pressure at vertex locations.
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.sea_surface_height_above_geoid=project3d(md,'vector',self.sea_surface_height_above_geoid,'type','node','layer',1);
-			self.sea_water_pressure_at_sea_floor=project3d(md,'vector',self.sea_water_pressure_at_sea_floor,'type','node','layer',1);
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.global_average_thermosteric_sea_level)
-				self.global_average_thermosteric_sea_level=[0;0];
-				disp('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero');
-			end
-			if isnan(self.sea_surface_height_above_geoid)
-				self.sea_surface_height_above_geoid=[zeros(md.mesh.numberofvertices,1);0];
-				disp('      no dsl.sea_surface_height_above_geoid specified: transient values set at zero');
-			end
-			if isnan(self.sea_water_pressure_at_sea_floor)
-				self.sea_water_pressure_at_sea_floor=[zeros(md.mesh.numberofvertices,1);0];
-				disp('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero');
-			end
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
-			writejs1Darray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
-			writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/dsl.py
===================================================================
--- /issm/trunk/src/m/classes/dsl.py	(revision 28275)
+++ 	(revision )
@@ -1,81 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class dsl(object):
-    """DSL - class definition
-
-    Usage:
-        dsl = dsl() # dynamic sea level class, based on CMIP5 outputs
-    """
-
-    def __init__(self, *args):  #{{{
-        self.global_average_thermosteric_sea_level = np.nan  # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).
-        self.sea_surface_height_above_geoid = np.nan  # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).
-        self.sea_water_pressure_at_sea_floor = np.nan  #  Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = '   dsl parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).'))
-        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_above_geoid', 'Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).'))
-        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_at_sea_floor', 'Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        self.global_average_thermosteric_sea_level = np.nan
-        self.sea_surface_height_above_geoid = np.nan
-        self.sea_water_pressure_at_sea_floor = np.nan
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        # Early return
-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (not md.transient.isoceantransport):
-            return md
-        md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-
-        if md.solidearth.settings.compute_bp_grd:
-            md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'empty', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):   #{{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'timeserieslength', 2, 'yts', yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element.
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)  # mattype 1 because we specify DSL at vertex locations.
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)  # mattype 1 because we specify bottom pressure at vertex locations.
-    # }}}
-
-    def extrude(self, md):  #{{{
-        self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node', 'layer', 1)
-        self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-
-    def initialize(self, md):  #{{{
-        if np.isnan(self.global_average_thermosteric_sea_level):
-            self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
-            print('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero')
-
-        if np.isnan(self.sea_surface_height_above_geoid):
-            self.sea_surface_height_above_geoid = np.append(np.zeros((md.mesh.numberofvertices, 1)), 0).reshape(-1, 1)
-            print('      no dsl.sea_surface_height_above_geoid specified: transient values set at zero')
-
-        if np.isnan(self.sea_water_pressure_at_sea_floor):
-            self.sea_water_pressure_at_sea_floor = np.append(np.zeros((md.mesh.numberofvertices, 1)), 0).reshape(-1, 1)
-            print('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero')
-    # }}}
Index: sm/trunk/src/m/classes/dslmme.m
===================================================================
--- /issm/trunk/src/m/classes/dslmme.m	(revision 28275)
+++ 	(revision )
@@ -1,86 +1,0 @@
-%DSLMME class definition
-%
-%   Usage:
-%      dsl=dslmme(); %dynamic sea level class based on a multi-model ensemble of CMIP5 outputs
-
-classdef dslmme
-	properties (SetAccess=public) 
-
-		modelid; %index into the multi-model ensemble, determine which field will be used.
-		global_average_thermosteric_sea_level; %Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
-		sea_surface_height_above_geoid; %Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
-		sea_water_pressure_at_sea_floor; %Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
-
-	end
-	methods
-		function self = dslmme(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(dsl(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.modelid=0;
-			self.global_average_thermosteric_sea_level={};
-			self.sea_surface_height_above_geoid={};
-			self.sea_water_pressure_at_sea_floor={};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc == 0) | (md.transient.isoceantransport==0),
-				return;
-			end
-			for i=1:length(self.global_average_thermosteric_sea_level),
-				md = checkfield(md,'field',self.global_average_thermosteric_sea_level{i},'NaN',1,'Inf',1);
-				md = checkfield(md,'field',self.sea_surface_height_above_geoid{i},'NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'field',self.sea_water_pressure_at_sea_floor{i},'NaN',1,'Inf',1,'timeseries',1);
-			end
-			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.global_average_thermosteric_sea_level));
-
-			if md.solidearth.settings.compute_bp_grd==1, 
-				md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','empty',1);
-			end
-
-		end % }}}
-		function disp(self) % {{{
-
-			disp(sprintf('   dsl mme parameters:'));
-			fielddisplay(self,'modelid','index into the multi-model ensemble, determine which field will be used.');
-			fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.');
-			fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.');
-			fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'name','md.dsl.model','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
-			WriteData(fid,prefix,'name','md.dsl.nummodels','data',length(self.global_average_thermosteric_sea_level),'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','MatArray','timeseries',1,'timeserieslength',2);
-			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_at_sea_floor','format','MatArray','timeserieslength',md.mesh.numberofvertices+1);
-			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_above_geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1);
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-			for i=1:length(self.global_average_thermosteric_sea_level),
-				self.sea_surface_height_above_geoid{i}=project3d(md,'vector',self.sea_surface_height_above_geoid{i},'type','node','layer',1);
-				self.sea_water_pressure_at_sea_floor{i}=project3d(md,'vector',self.sea_water_pressure_at_sea_floor{i},'type','node','layer',1);
-			end
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			
-			writejsdouble(fid,[modelname '.dsl.modelid'],self.modelid);
-			writejscellarray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
-			writejscellarray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
-			writejs1Darray(fid,[modelname '.dsl.compute_fingerprints'],self.compute_fingerprints);
-			writejscellarray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/dslmme.py
===================================================================
--- /issm/trunk/src/m/classes/dslmme.py	(revision 28275)
+++ 	(revision )
@@ -1,71 +1,0 @@
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class dslmme(object):
-    """DSLMME class definition
-
-    Usage:
-        dsl = dslmme() #dynamic sea level class based on a multi-model ensemble of CMIP5 outputs
-    """
-
-    def __init__(self, *args):  #{{{
-        self.modelid = 0  # Index into the multi-model ensemble, determine which field will be used
-        self.global_average_thermosteric_sea_level = [] # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
-        self.sea_surface_height_above_geoid = [] # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
-        self.sea_water_pressure_at_sea_floor = [] #Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   dsl mme parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'modelid', 'index into the multi-model ensemble, determines which field will be used.'))
-        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.'))
-        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_above_geoid', 'Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.'))
-        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_at_sea_floor', 'Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (not md.transient.isoceantransport):
-            return md
-
-        for i in range(len(self.global_average_thermosteric_sea_level)):
-            md = checkfield(md, 'field', self.global_average_thermosteric_sea_level[i], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'field', self.sea_surface_height_above_geoid[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 1, '<=', len(self.global_average_thermosteric_sea_level))
-
-        if self.solidearth.settings.compute_bp_grd:
-            md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor, 'empty', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'modelid', 'format', 'Double')
-        WriteData(fid, prefix, 'name', 'md.dsl.nummodels', 'data', len(self.global_average_thermosteric_sea_level), 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'MatArray', 'timeseries', 1, 'timeserieslength', 2)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1)
-    # }}}
-
-    def extrude(self, md):  #{{{
-        for i in range(len(self.global_average_thermosteric_sea_level)):
-            self.sea_surface_height_above_geoid[i] = project3d(md, 'vector', self.self.sea_surface_height_above_geoid[i], 'type', 'node', 'layer', 1)
-            self.sea_water_pressure_at_sea_floor[i] = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor[i], 'type', 'node', 'layer', 1)
-
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/esa.js
===================================================================
--- /issm/trunk/src/m/classes/esa.js	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-//ESA class definition
-//
-//   Usage:
-//      esa=esa();
-
-function esa(){
-	//methods
-		this.setdefaultparameters = function (){ //{{{
-		
-		//numerical discretization accuracy
-		this.degacc=.01;
-	
-		//computational flags:
-		this.hemisphere=0;
-
-		//output default:
-		this.requested_outputs=['default'];
-
-		//transitions should be a cell array of vectors: 
-		this.transitions=[];
-		
-		}// }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-
-			//Early return
-			if(ArrayAnyEqual(ArrayIsMember('EsaAnalysis',analyses),0))return;
-			
-			md = checkfield(md,'fieldname','esa.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements, 1]);
-			md = checkfield(md,'fieldname','esa.love_h','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','esa.love_l','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','esa.hemisphere','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','esa.degacc','size',[1, 1],'>=',1e-10);
-			md = checkfield(md,'fieldname','esa.requested_outputs','stringrow',1);
-			
-			//check that love numbers are provided at the same level of accuracy: 
-			if (this.love_h.length != this.love_l.length){
-				throw Error('esa error message: love numbers should be provided at the same level of accuracy');
-			}
-
-		} // }}}
-		this.defaultoutputs = function(md){ // {{{
-			return ['EsaUmotion'];
-		}//}}}
-		this.classname= function(){// {{{
-			return "esa";
-		}// }}}
-		this.disp= function(){// {{{
-			
-		console.log(sprintf('   esa solution parameters:'));
-
-		fielddisplay(this,'deltathickness','thickness change: ice height equivalent [m]');
-		fielddisplay(this,'love_h','load Love number for radial displacement');
-		fielddisplay(this,'love_l','load Love number for horizontal displacements'); 
-		fielddisplay(this,'hemisphere','North-south, East-west components of 2-D horiz displacement vector: -1 south, 1 north'); 
-		fielddisplay(this,'degacc',"accuracy (default .01 deg) for numerical discretization of the Green's functions");
-		fielddisplay(this,'transitions','indices into parts of the mesh that will be icecaps');
-		fielddisplay(this,'requested_outputs','additional outputs requested (default: EsaUmotion)');
-		} //}}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			WriteData(fid,prefix,'object',this,'fieldname','deltathickness','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',this,'fieldname','love_h','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','love_l','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','hemisphere','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','degacc','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','transitions','format','MatArray');
-
-			//process requested outputs
-			var outputs = this.requested_outputs;
-			for (var i=0;i<outputs.length;i++){
-				if (outputs[i] == 'default') {
-					outputs.splice(i,1);
-					var newoutputs=this.defaultoutputs(md);
-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-				}
-			}
-			WriteData(fid,prefix,'data',outputs,'name','md.esa.requested_outputs','format','StringArray');
-		}//}}}
-		this.fix=function() { //{{{
-			this.deltathickness=NullFix(this.deltathickness,NaN);
-			this.love_h=NullFix(this.love_h,NaN);
-			this.love_l=NullFix(this.love_l,NaN);
-			this.hemisphere=NullFix(this.hemisphere,NaN);
-			this.degacc=NullFix(this.degacc,NaN);
-		}//}}}
-	//properties
-	//{{{
-	this.deltathickness = NaN;
-	this.love_h         = 0; //provided by PREM model
-	this.love_l         = 0; //idam
-	this.hemisphere     = 0;
-	this.degacc         = 0;
-	this.requested_outputs = [];
-	this.transitions    = [];
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/esa.m
===================================================================
--- /issm/trunk/src/m/classes/esa.m	(revision 28275)
+++ 	(revision )
@@ -1,108 +1,0 @@
-%ESA class definition
-%
-%   Usage:
-%      esa=esa();
-
-classdef esa
-	properties (SetAccess=public) 
-		deltathickness = NaN;
-		love_h         = 0; %provided by PREM model
-		love_l         = 0; %ideam
-		degacc         = 0;
-		hemisphere		= 0;
-		requested_outputs      = {};
-		transitions    = {};
-	end
-	methods
-		function self = esa(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		
-		%numerical discretization accuracy
-		self.degacc=.01;
-	
-		%computational flags:
-		self.hemisphere=0;
-
-		%output default:
-		self.requested_outputs={'default'};
-
-		%transitions should be a cell array of vectors: 
-		self.transitions={};
-		
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('EsaAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','esa.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','esa.love_h','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','esa.love_l','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','esa.hemisphere','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','esa.degacc','size',[1 1],'>=',1e-10);
-			md = checkfield(md,'fieldname','esa.requested_outputs','stringrow',1);
-
-			%check that love numbers are provided at the same level of accuracy: 
-			if (size(self.love_h,1)~=size(self.love_l,1)),
-				error('esa error message: love numbers should be provided at the same level of accuracy');
-			end
-
-			%cross check that whereever we have an ice load, the mask is <0 on each vertex: 
-			pos=find(self.deltathickness);
-			maskpos=md.mask.ice_levelset(md.mesh.elements(pos,:)); 
-			[els,vertices]=find(maskpos>0);
-			if length(els),
-				error('esa checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!');
-			end
-
-		end % }}}
-		function list=defaultoutputs(self,md) % {{{
-			list = {'EsaUmotion'};
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   esa parameters:'));
-
-			fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]');
-			fielddisplay(self,'love_h','load Love number for radial displacement');
-			fielddisplay(self,'love_l','load Love number for horizontal displacements');
-			fielddisplay(self,'hemisphere','North-south, East-west components of 2-D horiz displacement vector: -1 south, 1 north'); 
-			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
-			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
-			fielddisplay(self,'requested_outputs','additional outputs requested (e.g., EsaUmotion, EsaStrainratexx, EsaRotationrate)');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','love_l','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','hemisphere','format','Integer'); 
-			WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray');
-			
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.esa.requested_outputs','format','StringArray');
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.esa.deltathickness'],self.deltathickness);
-			writejs1Darray(fid,[modelname '.esa.love_h'],self.love_h);
-			writejs1Darray(fid,[modelname '.esa.love_l'],self.love_l);
-			writejsdouble(fid,[modelname '.esa.hemisphere'],self.hemisphere); 
-			writejsdouble(fid,[modelname '.esa.degacc'],self.degacc);
-			writejscellstring(fid,[modelname '.esa.requested_outputs'],self.requested_outputs);
-			writejscellarray(fid,[modelname '.esa.transitions'],self.transitions);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/esa.py
===================================================================
--- /issm/trunk/src/m/classes/esa.py	(revision 28275)
+++ 	(revision )
@@ -1,93 +1,0 @@
-from fielddisplay import fielddisplay
-from MatlabFuncs import *
-from model import *
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class esa(object):
-    """
-    ESA class definition
-
-        Usage:
-          esa = esa();
-    """
-
-    def __init__(self):  # {{{
-        self.deltathickness = float('NaN')
-        self.love_h = 0  #provided by PREM model()
-        self.love_l = 0  #ideam
-        self.hemisphere = 0
-        self.degacc = 0
-        self.requested_outputs = []
-        self.transitions = []
-
-    #set defaults
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = '   esa parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'deltathickness', 'thickness change: ice height equivalent [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'love_h', 'load Love number for radial displacement'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'love_l', 'load Love number for horizontal displaements'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'hemisphere', 'North-south, East-west components of 2-D horiz displacement vector:-1 south, 1 north'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'degacc', 'accuracy (default .01 deg) for numerical discretization of the Green''s functions'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'transitions', 'indices into parts of the mesh that will be icecaps'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested (default: EsaUmotion)'))
-
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #numerical discretization accuracy
-        self.degacc = 0.01
-        #computational flags:
-        self.hemisphere = 0
-        #output default:
-        self.requested_outputs = ['default']
-        #transitions should be a cell array of vectors:
-        self.transitions = []
-        #default output
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if (solution != 'EsaAnalysis'):
-            return md
-
-        md = checkfield(md, 'fieldname', 'esa.deltathickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements, 1])
-        md = checkfield(md, 'fieldname', 'esa.love_h', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'esa.love_l', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'esa.hemisphere', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'esa.degacc', 'size', [1, 1], '>=', 1e-10)
-        md = checkfield(md, 'fieldname', 'esa.requested_outputs', 'stringrow', 1)
-
-    #check that love numbers are provided at the same level of accuracy:
-        if (size(self.love_h, 0) != size(self.love_l, 0)):
-            error('esa error message: love numbers should be provided at the same level of accuracy')
-        return md
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['EsaUmotion']
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deltathickness', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_h', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_l', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hemisphere', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray')
-
-    #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.esa.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/flowequation.js
===================================================================
--- /issm/trunk/src/m/classes/flowequation.js	(revision 28275)
+++ 	(revision )
@@ -1,160 +1,0 @@
-//FLOWEQUATION class definition
-//
-//   Usage:
-//      flowequation=new flowequation();
-
-function flowequation (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		//P1 for SSA
-		this.fe_SSA= 'P1';
-
-		//P1 for HO
-		this.fe_HO= 'P1';
-
-		//MINI condensed element for FS by default
-		this.fe_FS = 'MINIcondensed';
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   flow equation parameters:'));
-
-		fielddisplay(this,'isSIA','is the Shallow Ice Approximation (SIA) used ?');
-		fielddisplay(this,'isSSA','is the Shelfy-Stream Approximation (SSA) used ?');
-		fielddisplay(this,'isL1L2','is the L1L2 approximation used ?');
-		fielddisplay(this,'isMOLHO','is the MOno-Layer Higher-Order (MOLHO) approximation used?');
-		fielddisplay(this,'isHO','is the Higher-Order (HO) approximation used ?');
-		fielddisplay(this,'isFS','are the Full-FS (FS) equations used ?');
-		fielddisplay(this,'isNitscheBC','is weakly imposed condition used?');
-		fielddisplay(this,'FSNitscheGamma','Gamma value for the Nitsche term (default: 1e6)');
-		fielddisplay(this,'fe_SSA',"Finite Element for SSA  'P1', 'P1bubble' 'P1bubblecondensed' 'P2'");
-		fielddisplay(this,'fe_HO', "Finite Element for HO   'P1' 'P1bubble' 'P1bubblecondensed' 'P1xP2' 'P2xP1' 'P2'");
-		fielddisplay(this,'fe_FS', "Finite Element for FS   'P1P1' (debugging only) 'P1P1GLS' 'MINIcondensed' 'MINI' 'TaylorHood' 'XTaylorHood'");
-		fielddisplay(this,'vertex_equation','flow equation for each vertex');
-		fielddisplay(this,'element_equation','flow equation for each element');
-		fielddisplay(this,'borderSSA',"vertices on SSA's border (for tiling)");
-		fielddisplay(this,'borderHO',"vertices on HO's border (for tiling)");
-		fielddisplay(this,'borderFS',"vertices on FS' border (for tiling)");
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "flowequation";
-
-	}// }}}
-	this.extrude = function(md) {//{{{
-		this.element_equation=project3d(md,'vector',this.element_equation,'type','element');
-		this.vertex_equation=project3d(md,'vector',this.vertex_equation,'type','node');
-		this.borderSSA=project3d(md,'vector',this.borderSSA,'type','node');
-		this.borderHO=project3d(md,'vector',this.borderHO,'type','node');
-		this.borderFS=project3d(md,'vector',this.borderFS,'type','node');
-		return this;
-    }//}}}
-		this.checkconsistency = function(md,solution,analyses) {//{{{
-
-			//Early return
-			if ( ((!ArrayAnyEqual(ArrayIsMember('StressbalanceAnalysis',analyses),1)) & (!ArrayAnyEqual(ArrayIsMember('StressbalanceSIAAnalysis',analyses),1))) | 
-					(solution=='TransientSolution' & md.trans.isstressbalance==0)
-			   ) return ;
-
-			checkfield(md,'fieldname','flowequation.isSIA','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','flowequation.isMOLHO','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','flowequation.isNitscheBC','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','flowequation.FSNitscheGamma','numel',[1], '>=', 0);
-			checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2','P2bubble']);
-			checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4']);
-			checkfield(md,'fieldname','flowequation.fe_FS' ,'values',['P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart','LACrouzeixRaviart']);
-			checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>=',0.);
-			checkfield(md,'fieldname','flowequation.augmented_lagrangian_rlambda','numel',[1],'>=',0.);
-			checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>=',0.);
-			checkfield(md,'fieldname','flowequation.augmented_lagrangian_rholambda','numel',[1],'>=',0.);
-			checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5);
-			checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices, 1],'values',[0, 1]);
-			checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices, 1],'values',[0, 1]);
-			checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices, 1],'values',[0, 1]);
-			if (md.mesh.domaintype() == '2Dhorizontal'){
-				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[1,2]);
-				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[1,2]);
-			}
-			else if (md.mesh.domaintype() == '3Dsurface'){
-				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[1,2]);
-				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[1,2]);
-			}
-			else if (md.mesh.domaintype() =='2Dvertical'){
-				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[2,4,5]);
-				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[2,4,5]);
-			}
-			else if (md.mesh.domaintype() =='3D'){
-				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[0,1,2,3,4,5,6,7,8]);
-				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[0,1,2,3,4,5,6,7,8]);
-			}
-			else throw Error('Case not supported yet');
-			
-			if (!(this.isSIA | this.isSSA | this.isL1L2 | this.isMOLHO | this.isHO | this.isFS)){
-				checkmessage(md,['no element types set for this model']);
-			}
-			if(ArrayAnyEqual(ArrayIsMember('StressbalanceSIAAnalysis', analyses),1)){
-				if (ArrayAnyEqual(this.element_equation,1)){
-					if(this.vertex_equation & ArrayAnyBelowStrict(md.mask.groundedice_levelset)){
-						console.log(sprintf("\n !!! Warning: SIA's model is not consistent on ice shelves !!!\n"));
-					}
-				}
-			}
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'fieldname','isSIA','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isSSA','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isL1L2','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isMOLHO','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isHO','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isFS','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isNitscheBC','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','FSNitscheGamma','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','fe_SSA','data',this.fe_SSA,'format','String');
-			WriteData(fid,prefix,'object',this,'fieldname','fe_HO','data',this.fe_HO,'format','String');
-			WriteData(fid,prefix,'object',this,'fieldname','fe_FS','data',this.fe_FS,'format','String');
-
-			WriteData(fid,prefix,'object',this,'fieldname','augmented_lagrangian_r','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','augmented_lagrangian_rhop','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','augmented_lagrangian_rlambda','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','augmented_lagrangian_rholambda','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','XTH_theta','data',this.XTH_theta ,'format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','borderSSA','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','borderHO','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','borderFS','format','DoubleMat','mattype',1);
-
-			//convert approximations to integers 
-			WriteData(fid,prefix,'data',this.vertex_equation,'name','md.flowequation.vertex_equation','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'data',this.element_equation,'name','md.flowequation.element_equation','format','DoubleMat','mattype',2);
-
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-	this.isSIA                          = 0;
-	this.isSSA                          = 0;
-	this.isL1L2                         = 0;
-	this.isMOLHO                         = 0;
-	this.isHO                           = 0;
-	this.isFS                           = 0;
-	this.isNitscheBC                    = 0;
-	this.FSNitscheGamma                 = 1e6;
-	this.fe_SSA                         = '';
-	this.fe_HO                          = '';
-	this.fe_FS                          = '';
-	this.augmented_lagrangian_r         = 1.;
-	this.augmented_lagrangian_rhop      = 1.;
-	this.augmented_lagrangian_rlambda   = 1.;
-	this.augmented_lagrangian_rholambda = 1.;
-	this.XTH_theta                      = 0.;
-	this.vertex_equation                = NaN;
-	this.element_equation               = NaN;
-	this.borderSSA                      = NaN;
-	this.borderHO                       = NaN;
-	this.borderFS                       = NaN;
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/flowequation.m
===================================================================
--- /issm/trunk/src/m/classes/flowequation.m	(revision 28275)
+++ 	(revision )
@@ -1,221 +1,0 @@
-%FLOWEQUATION class definition
-%
-%   Usage:
-%      flowequation=flowequation();
-
-classdef flowequation
-	properties (SetAccess=public) 
-		isSIA                          = 0;
-		isSSA                          = 0;
-		isL1L2                         = 0;
-		isMOLHO                         = 0;
-		isHO                           = 0;
-		isFS                           = 0;
-		isNitscheBC                    = 0;
-		FSNitscheGamma                 = 1e6;
-		fe_SSA                         = '';
-		fe_HO                          = '';
-		fe_FS                          = '';
-		augmented_lagrangian_r         = 1.;
-		augmented_lagrangian_rhop      = 1.;
-		augmented_lagrangian_rlambda   = 1.;
-		augmented_lagrangian_rholambda = 1.;
-		XTH_theta                      = 0.;
-		vertex_equation                = NaN;
-		element_equation               = NaN;
-		borderSSA                      = NaN;
-		borderHO                       = NaN;
-		borderFS                       = NaN;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. If the input is a struct it is an old version of this class and
-			% old fields must be recovered (make sure they are in the deprecated
-			% model properties)
-
-			if verLessThan('matlab','7.9'),
-				disp('Warning: your matlab version is old and there is a risk that load does not work correctly');
-				disp('         if the model is not loaded correctly, rename temporarily loadobj so that matlab does not use it');
-
-				% This is a Matlab bug: all the fields of md have their default value
-				% Example of error message:
-				% Warning: Error loading an object of class 'model':
-				% Undefined function or method 'exist' for input arguments of type 'cell'
-				%
-				% This has been fixed in MATLAB 7.9 (R2009b) and later versions
-			end
-
-			if isstruct(self)
-				disp('Recovering flowequation from older version');
-				objstruct = self;
-				self = structtoobj(flowequation(),objstruct);
-
-				%2013 July 23rd
-				if isfield(objstruct,'ishutter'),      self.isSIA     = objstruct.ishutter;       end; 
-				if isfield(objstruct,'ismacayeal'),    self.isSSA     = objstruct.ismacayeal;     end; 
-				if isfield(objstruct,'ispattyn'),      self.isHO      = objstruct.ispattyn;       end; 
-				if isfield(objstruct,'isstokes'),      self.isFS      = objstruct.isstokes;       end; 
-				if isfield(objstruct,'bordermacayeal'),self.borderSSA = objstruct.bordermacayeal; end; 
-				if isfield(objstruct,'borderpattyn'),  self.borderHO  = objstruct.borderpattyn;   end; 
-				if isfield(objstruct,'borderstokes'),  self.borderFS  = objstruct.borderstokes;   end; 
-
-				%May 31 2022
-				if isfield(objstruct,'isMLHO')
-					self.isMOLHO = objstruct.isMLHO;
-				end
-			end
-
-
-		end% }}}
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.element_equation=project3d(md,'vector',self.element_equation,'type','element');
-			self.vertex_equation=project3d(md,'vector',self.vertex_equation,'type','node');
-			self.borderSSA=project3d(md,'vector',self.borderSSA,'type','node');
-			self.borderHO=project3d(md,'vector',self.borderHO,'type','node');
-			self.borderFS=project3d(md,'vector',self.borderFS,'type','node');
-		end % }}}
-		function self = flowequation(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%P1 for SSA
-			self.fe_SSA= 'P1';
-
-			%P1 for HO
-			self.fe_HO= 'P1';
-
-			%MINI condensed element for FS by default
-			self.fe_FS = 'MINIcondensed';
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if (~ismember('StressbalanceAnalysis',analyses) & ~ismember('StressbalanceSIAAnalysis',analyses)) | (strcmp(solution,'TransientSolution') & md.transient.isstressbalance==0), return; end
-
-			md = checkfield(md,'fieldname','flowequation.isSIA','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','flowequation.isMOLHO','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','flowequation.isNitscheBC','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','flowequation.FSNitscheGamma','numel',[1], '>=', 0.);
-			md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2','P2bubble'});
-			md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P1xP4','P2xP4'});
-			md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart','LACrouzeixRaviart'});
-			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>=',0.);
-			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rlambda','numel',[1],'>=',0.);
-			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>=',0.);
-			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rholambda','numel',[1],'>=',0.);
-			md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5);
-			md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			if strcmp(domaintype(md.mesh),'2Dhorizontal')
-				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1,2,4]);
-				md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1,2,4]);
-			elseif strcmp(domaintype(md.mesh),'3Dsurface')
-				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]);
-				md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]);
-			elseif strcmp(domaintype(md.mesh),'2Dvertical')
-				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[2,5,6]);
-				md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[2,5,6]);
-			elseif strcmp(domaintype(md.mesh),'3D'),
-				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:9]);
-				md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:9]);
-			else
-				error('Case not supported yet');
-			end
-			if ~(self.isSIA || self.isSSA || self.isL1L2 || self.isMOLHO || self.isHO || self.isFS),
-				md = checkmessage(md,['no element types set for this model']);
-			end
-			if ismember('StressbalanceSIAAnalysis',analyses),
-				if any(self.element_equation==1),
-					if(self.vertex_equation & md.mask.ocean_levelset<0.),
-						disp(sprintf('\n !!! Warning: SIA''s model is not consistent on ice shelves !!!\n'));
-					end
-				end
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   flow equation parameters:'));
-
-			fielddisplay(self,'isSIA','is the Shallow Ice Approximation (SIA) used?');
-			fielddisplay(self,'isSSA','is the Shelfy-Stream Approximation (SSA) used?');
-			fielddisplay(self,'isL1L2','is the L1L2 approximation used?');
-			fielddisplay(self,'isMOLHO','is the MOno-Layer Higher-Order (MOLHO) approximation used?');
-			fielddisplay(self,'isHO','is the Higher-Order (HO) approximation used?');
-			fielddisplay(self,'isFS','are the Full-FS (FS) equations used?');
-			fielddisplay(self,'isNitscheBC','is weakly imposed condition used?');
-			fielddisplay(self,'FSNitscheGamma','Gamma value for the Nitsche term (default: 1e6)');
-			fielddisplay(self,'fe_SSA','Finite Element for SSA  ''P1'', ''P1bubble'' ''P1bubblecondensed'' ''P2''');
-			fielddisplay(self,'fe_HO', 'Finite Element for HO   ''P1'' ''P1bubble'' ''P1bubblecondensed'' ''P1xP2'' ''P2xP1'' ''P2''');
-			fielddisplay(self,'fe_FS', 'Finite Element for FS   ''P1P1'' (debugging only) ''P1P1GLS'' ''MINIcondensed'' ''MINI'' ''TaylorHood'' ''XTaylorHood''');
-			fielddisplay(self,'vertex_equation','flow equation for each vertex');
-			fielddisplay(self,'element_equation','flow equation for each element');
-			fielddisplay(self,'borderSSA','vertices on SSA''s border (for tiling)');
-			fielddisplay(self,'borderHO','vertices on HO''s border (for tiling)');
-			fielddisplay(self,'borderFS','vertices on FS'' border (for tiling)');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','isSIA','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isSSA','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isL1L2','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isMOLHO','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isHO','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isFS','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isNitscheBC','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','FSNitscheGamma','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','fe_SSA','data',self.fe_SSA,'format','String');
-			WriteData(fid,prefix,'object',self,'fieldname','fe_HO' ,'data',self.fe_HO,'format','String');
-			WriteData(fid,prefix,'object',self,'fieldname','fe_FS' ,'data',self.fe_FS,'format','String');
-			WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_r','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rhop','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rlambda','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rholambda','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','XTH_theta','data',self.XTH_theta ,'format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','borderSSA','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','borderHO','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','borderFS','format','DoubleMat','mattype',1);
-			%convert approximations to enums
-			WriteData(fid,prefix,'data',self.vertex_equation,'name','md.flowequation.vertex_equation','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'data',self.element_equation,'name','md.flowequation.element_equation','format','DoubleMat','mattype',2);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.flowequation.isSIA'],self.isSIA);
-			writejsdouble(fid,[modelname '.flowequation.isSSA'],self.isSSA);
-			writejsdouble(fid,[modelname '.flowequation.isL1L2'],self.isL1L2);
-			writejsdouble(fid,[modelname '.flowequation.isMOLHO'],self.isMOLHO);
-			writejsdouble(fid,[modelname '.flowequation.isHO'],self.isHO);
-			writejsdouble(fid,[modelname '.flowequation.isFS'],self.isFS);
-         writejsstring(fid,[modelname '.flowequation.isNitscheBC'],self.isNitscheBC);
-         writejsstring(fid,[modelname '.flowequation.FSNitscheGamma'],self.FSNitscheGamma);
-         writejsstring(fid,[modelname '.flowequation.fe_SSA'],self.fe_SSA);
-			writejsstring(fid,[modelname '.flowequation.fe_HO'],self.fe_HO);
-			writejsstring(fid,[modelname '.flowequation.fe_FS'],self.fe_FS);
-			writejsdouble(fid,[modelname '.flowequation.augmented_lagrangian_r'],self.augmented_lagrangian_r);
-			writejsdouble(fid,[modelname '.flowequation.augmented_lagrangian_rhop'],self.augmented_lagrangian_rhop);
-			writejsdouble(fid,[modelname '.flowequation.augmented_lagrangian_rlambda'],self.augmented_lagrangian_rlambda);
-			writejsdouble(fid,[modelname '.flowequation.augmented_lagrangian_rholambda'],self.augmented_lagrangian_rholambda);
-			writejsdouble(fid,[modelname '.flowequation.XTH_theta'],self.XTH_theta);
-			writejs1Darray(fid,[modelname '.flowequation.vertex_equation'],self.vertex_equation);
-			writejs1Darray(fid,[modelname '.flowequation.element_equation'],self.element_equation);
-			writejs1Darray(fid,[modelname '.flowequation.borderSSA'],self.borderSSA);
-			writejs1Darray(fid,[modelname '.flowequation.borderHO'],self.borderHO);
-			writejs1Darray(fid,[modelname '.flowequation.borderFS'],self.borderFS);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/flowequation.py
===================================================================
--- /issm/trunk/src/m/classes/flowequation.py	(revision 28275)
+++ 	(revision )
@@ -1,155 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-import MatlabFuncs as m
-from project3d import project3d
-from WriteData import WriteData
-
-
-class flowequation(object):
-    """FLOWEQUATION class definition
-
-    Usage:
-        flowequation = flowequation()
-    """
-
-    def __init__(self):  # {{{
-        self.isSIA = 0
-        self.isSSA = 0
-        self.isL1L2 = 0
-        self.isMOLHO = 0
-        self.isHO = 0
-        self.isFS = 0
-        self.isNitscheBC = 0
-        self.FSNitscheGamma = 1e6
-        self.fe_SSA = ''
-        self.fe_HO = ''
-        self.fe_FS = ''
-        self.augmented_lagrangian_r = 1
-        self.augmented_lagrangian_rhop = 1
-        self.augmented_lagrangian_rlambda = 1
-        self.augmented_lagrangian_rholambda = 1
-        self.XTH_theta = 0
-        self.vertex_equation = np.nan
-        self.element_equation = np.nan
-        self.borderSSA = np.nan
-        self.borderHO = np.nan
-        self.borderFS = np.nan
-        
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   flow equation parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'isSIA', "is the Shallow Ice Approximation (SIA) used?"))
-        s += '{}\n'.format(fielddisplay(self, 'isSSA', "is the Shelfy-Stream Approximation (SSA) used?"))
-        s += '{}\n'.format(fielddisplay(self, 'isL1L2', "are L1L2 equations used?"))
-        s += '{}\n'.format(fielddisplay(self, 'isMOLHO', "are MOno-layer Higher-Order (MOLHO) equations used?"))
-        s += '{}\n'.format(fielddisplay(self, 'isHO', "is the Higher-Order (HO) approximation used?"))
-        s += '{}\n'.format(fielddisplay(self, 'isFS', "are the Full-FS (FS) equations used?"))
-        s += '{}\n'.format(fielddisplay(self, 'isNitscheBC', "is weakly imposed condition used?"))
-        s += '{}\n'.format(fielddisplay(self, 'FSNitscheGamma', "Gamma value for the Nitsche term (default: 1e6)"))
-        s += '{}\n'.format(fielddisplay(self, 'fe_SSA', "Finite Element for SSA: 'P1', 'P1bubble' 'P1bubblecondensed' 'P2'"))
-        s += '{}\n'.format(fielddisplay(self, 'fe_HO', "Finite Element for HO:  'P1', 'P1bubble', 'P1bubblecondensed', 'P1xP2', 'P2xP1', 'P2', 'P2bubble', 'P1xP3', 'P2xP4'"))
-        s += '{}\n'.format(fielddisplay(self, 'fe_FS', "Finite Element for FS:  'P1P1' (debugging only) 'P1P1GLS' 'MINIcondensed' 'MINI' 'TaylorHood' 'LATaylorHood' 'XTaylorHood'"))
-        s += '{}\n'.format(fielddisplay(self, 'vertex_equation', "flow equation for each vertex"))
-        s += '{}\n'.format(fielddisplay(self, 'element_equation', "flow equation for each element"))
-        s += '{}\n'.format(fielddisplay(self, 'borderSSA', "vertices on SSA's border (for tiling)"))
-        s += '{}\n'.format(fielddisplay(self, 'borderHO', "vertices on HO's border (for tiling)"))
-        s += '{}\n'.format(fielddisplay(self, 'borderFS', "vertices on FS' border (for tiling)"))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # P1 for SSA
-        self.fe_SSA = 'P1'
-
-        # P1 for HO
-        self.fe_HO = 'P1'
-
-        # MINI condensed element for FS by default
-        self.fe_FS = 'MINIcondensed'
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.element_equation = project3d(md, 'vector', self.element_equation, 'type', 'element')
-        self.vertex_equation = project3d(md, 'vector', self.vertex_equation, 'type', 'node')
-        self.borderSSA = project3d(md, 'vector', self.borderSSA, 'type', 'node')
-        self.borderHO = project3d(md, 'vector', self.borderHO, 'type', 'node')
-        self.borderFS = project3d(md, 'vector', self.borderFS, 'type', 'node')
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if ('StressbalanceAnalysis' not in analyses and 'StressbalanceSIAAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isstressbalance):
-            return md
-        md = checkfield(md, 'fieldname', 'flowequation.isSIA', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.isSSA', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.isL1L2', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.isMOLHO', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.isHO', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.isFS', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.isNitscheBC', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.FSNitscheGamma', 'numel', [1], '>=', 0.)
-        md = checkfield(md, 'fieldname', 'flowequation.fe_SSA', 'values', ['P1', 'P1bubble', 'P1bubblecondensed', 'P2', 'P2bubble'])
-        md = checkfield(md, 'fieldname', 'flowequation.fe_HO', 'values', ['P1', 'P1bubble', 'P1bubblecondensed', 'P1xP2', 'P2xP1', 'P2', 'P2bubble', 'P1xP3', 'P2xP4'])
-        md = checkfield(md, 'fieldname', 'flowequation.fe_FS', 'values', ['P1P1', 'P1P1GLS', 'MINIcondensed', 'MINI', 'TaylorHood', 'LATaylorHood', 'XTaylorHood', 'OneLayerP4z', 'CrouzeixRaviart', 'LACrouzeixRaviart'])
-        md = checkfield(md, 'fieldname', 'flowequation.borderSSA', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.borderHO', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.borderFS', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'flowequation.augmented_lagrangian_r', 'numel', [1], '>', 0.)
-        md = checkfield(md, 'fieldname', 'flowequation.augmented_lagrangian_rhop', 'numel', [1], '>', 0.)
-        md = checkfield(md, 'fieldname', 'flowequation.augmented_lagrangian_rlambda', 'numel', [1], '>', 0.)
-        md = checkfield(md, 'fieldname', 'flowequation.augmented_lagrangian_rholambda', 'numel', [1], '>', 0.)
-        md = checkfield(md, 'fieldname', 'flowequation.XTH_theta', 'numel', [1], '>=', 0., '<', .5)
-        if m.strcmp(md.mesh.domaintype(), '2Dhorizontal'):
-            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', [1, 2, 4])
-            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [1, 2, 4])
-        elif m.strcmp(md.mesh.domaintype(), '3Dsurface'):
-            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', np.arange(1, 2 + 1))
-            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', np.arange(1, 2 + 1))
-        elif m.strcmp(md.mesh.domaintype(), '2Dvertical'):
-            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', [2, 5, 6])
-            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [2, 5, 6])
-        elif m.strcmp(md.mesh.domaintype(), '3D'):
-            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', np.arange(0, 9 + 1))
-            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', np.arange(0, 9 + 1))
-        else:
-            raise RuntimeError('Case not supported yet')
-
-        if not (self.isSIA or self.isSSA or self.isL1L2 or self.isMOLHO or self.isHO or self.isFS):
-            md.checkmessage("no element types set for this model")
-        if 'StressbalanceSIAAnalysis' in analyses:
-            if any(self.element_equation == 1):
-                if np.any(np.logical_and(self.vertex_equation, md.mask.ocean_levelset)):
-                    print("\n !!! Warning: SIA's model is not consistent on ice shelves !!!\n")
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isSIA', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isSSA', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isL1L2', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isMOLHO', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isHO', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isFS', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isNitscheBC', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'FSNitscheGamma', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe_SSA', 'data', self.fe_SSA, 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe_HO', 'data', self.fe_HO, 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe_FS', 'data', self.fe_FS, 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'augmented_lagrangian_r', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'augmented_lagrangian_rhop', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'augmented_lagrangian_rlambda', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'augmented_lagrangian_rholambda', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'XTH_theta', 'data', self.XTH_theta, 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'borderSSA', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'borderHO', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'borderFS', 'format', 'DoubleMat', 'mattype', 1)
-        # Convert approximations to enums
-        WriteData(fid, prefix, 'data', self.vertex_equation, 'name', 'md.flowequation.vertex_equation', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'data', self.element_equation, 'name', 'md.flowequation.element_equation', 'format', 'DoubleMat', 'mattype', 2)
-    # }}}
Index: sm/trunk/src/m/classes/fourierlove.js
===================================================================
--- /issm/trunk/src/m/classes/fourierlove.js	(revision 28275)
+++ 	(revision )
@@ -1,146 +1,0 @@
-//FOURIERLOVE class definition
-//
-//   Usage:
-//      md.love=fourierlove();
-
-function fourierlove (){
-	//methods
-	this.extrude = function(md) { // {{{
-		return this;
-	} // }}}
-	this.setdefaultparameters = function() { // {{{
-		//we setup an elastic love number computation by default.
-			this.nfreq=1; 
-			this.frequencies=[0]; //Hz
-			this.sh_nmax=256; // .35 degree, 40 km at the equator.
-			this.sh_nmin=1;
-			// work on matlab script for computing g0 for given Earth's structure. 
-			this.g0=9.81; // m/s^2; 
-			this.r0=6371*1e3; //m;
-			this.mu0=1e11; // Pa
-			this.Gravitational_Constant=6.67259e-11; // m^3 kg^-1 s^-2
-			this.allow_layer_deletion=1;
-			this.underflow_tol=1e-16; //threshold of deep to surface love number ratio to trigger the deletion of layer 
-			this.integration_steps_per_layer=100;
-			this.istemporal=0;
-			this.n_temporal_iterations=8;
-			this.time=[0]; //s
-			this.love_kernels=0; 
-			this.forcing_type = 11; // surface loading
-			this.inner_core_boundary=1;
-			this.core_mantle_boundary=2;
-			this.complex_computation=0;
-	} // }}}
-	this.disp = function() { // {{{
-		fielddisplay(this,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]');
-		fielddisplay(this,'frequencies','frequencies sampled (convention defaults to 0 for the elastic case) [Hz]');
-		fielddisplay(this,'sh_nmax','maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)');
-		fielddisplay(this,'sh_nmin','minimum spherical harmonic degree (default 1)');
-		fielddisplay(this,'g0','adimensioning constant for gravity (default 10) [m/s^2]');
-		fielddisplay(this,'r0','adimensioning constant for radius (default 6371*10^3) [m]');
-		fielddisplay(this,'mu0','adimensioning constant for stress (default 10^11) [Pa]');
-		fielddisplay(this,'Gravitational_Constant','Newtonian constant of gravitation (default 6.67259e-11 [m^3 kg^-1 s^-2])');
-		fielddisplay(this,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)');
-		fielddisplay(this,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default 2.2204460492503131E-016)');
-		fielddisplay(this,'integration_steps_per_layer','number of radial steps to propagate the yi system from the bottom to the top of each layer (default 100)');
-		fielddisplay(this,'istemporal','1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency');
-		fielddisplay(this,'n_temporal_iterations','max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default 8)');
-		fielddisplay(this,'time','time vector for deformation if istemporal (default 0) [s]');
-		fielddisplay(this,'love_kernels','compute love numbers at depth? (default 0)');
-		fielddisplay(this,'forcing_type','integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction ');
-		fielddisplay(this,'inner_core_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default 1)');
-		fielddisplay(this,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default 2)'); 
-
-	} // }}}
-	this.checkconsistency = function(md,solution,analyses) { // {{{
-
-		if (ArrayAnyEqual(ArrayIsMember('LoveAnalysis',analyses),1)) return; 
-
-		checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',md.love.nfreq);
-		checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','love.Gravitational_Constant','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','love.allow_layer_deletion','values',[0, 1]);
-		checkfield(md,'fieldname','love.underflow_tol','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','love.integration_steps_per_layer','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','love.love_kernels','values',[0, 1]);
-		checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
-		checkfield(md,'fieldname','love.complex_computation','NaN',1,'Inf',1,'numel',1,'values',[0, 1]);
-
-		checkfield(md,'fieldname','love.istemporal','values',[0, 1]);
-
-		if (md.love.istemporal==1){
-			checkfield(md,'fieldname','love.n_temporal_iterations','NaN',1,'Inf',1,'numel',1,'>',0);
-			checkfield(md,'fieldname','love.time','NaN',1,'Inf',1,'numel',md.love.nfreq/2/md.love.n_temporal_iterations);
-		}
-		if (md.love.sh_nmin<=1 && md.love.forcing_type==9 || md.love.forcing_type==5 || md.love.forcing_type==1) {
-			throw 'Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.';
-		}
-
-		//need 'litho' material: 
-		console.log('md.fourierlove check consistency only paritally implemented for litho material');
-		/*
-		if ~isa(md.materials,'materials') | ~sum(strcmpi(md.materials.nature,'litho'))
-			error('Need a "litho" material to run a Fourier Love number analysis');
-		end
-
-		mat=find(strcmpi(md.materials.nature,'litho'));
-		if (md.love.forcing_type<=4) {
-			checkfield(md,'fieldname','love.inner_core_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
-		} else if (md.love.forcing_type<=8) {
-			checkfield(md,'fieldname','love.core_mantle_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
-		} */
-	} // }}}
-	this.marshall = function(md,prefix,fid) { // {{{
-	
-		WriteData(fid,prefix,'object',this,'fieldname','nfreq','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','frequencies','format','DoubleMat','mattype',3);
-		WriteData(fid,prefix,'object',this,'fieldname','sh_nmax','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','sh_nmin','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','g0','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','r0','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','mu0','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','Gravitational_Constant','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','allow_layer_deletion','format','Boolean');
-		WriteData(fid,prefix,'object',this,'fieldname','underflow_tol','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','integration_steps_per_layer','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','istemporal','format','Boolean');
-		WriteData(fid,prefix,'object',this,'fieldname','n_temporal_iterations','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','complex_computation','format','Boolean');
-		//note: no need to marshall the time vector, we have frequencies
-		WriteData(fid,prefix,'object',this,'fieldname','love_kernels','format','Boolean');
-		WriteData(fid,prefix,'object',this,'fieldname','forcing_type','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','inner_core_boundary','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','core_mantle_boundary','format','Integer');
-
-	} // }}}
-	//properties 
-	// {{{
-	this.nfreq                		= NaN;
-	this.frequencies          		= NaN;
-	this.sh_nmax              		= NaN;
-	this.sh_nmin              		= NaN;
-	this.g0                   		= NaN; 
-	this.r0                   		= NaN; 
-	this.mu0                  		= NaN;
-	this.Gravitational_Constant 	= 0;
-	this.allow_layer_deletion 		= NaN;
-	this.underflow_tol              = 0;
-	this.integration_steps_per_layer= 0;
-	this.istemporal		   			= 0;
-	this.n_temporal_iterations	  	= 0;
-	this.time			            = 0;
-	this.love_kernels 				= NaN;
-	this.forcing_type         		= NaN;
-	this.inner_core_boundary	    = 0;
-	this.core_mantle_boundary	    = 0;
-	this.complex_computation        = 0;
-	
-	//set defaults
-	this.setdefaultparameters();
-	// }}}
-}
Index: sm/trunk/src/m/classes/fourierlove.m
===================================================================
--- /issm/trunk/src/m/classes/fourierlove.m	(revision 28275)
+++ 	(revision )
@@ -1,189 +1,0 @@
-%FOURIERLOVE class definition
-%
-%   Usage:
-%      md.love=fourierlove();
-
-classdef fourierlove
-	properties (SetAccess=public) 
-		nfreq						= 0;
-		frequencies					= 0;
-		sh_nmax						= 0;
-		sh_nmin						= 0;
-		g0							= 0;
-		r0							= 0;
-		mu0							= 0;
-		Gravitational_Constant		= 0;
-		chandler_wobble				= 0;
-		allow_layer_deletion		= 0;
-		underflow_tol				= 0;
-		pw_threshold				= 0;
-		integration_steps_per_layer	= 0;
-		istemporal					= 0;
-		n_temporal_iterations		= 0;
-		time						= 0;
-		love_kernels				= 0;
-		forcing_type				= 0;
-		inner_core_boundary			= 0;
-		core_mantle_boundary		= 0;
-		complex_computation			= 0;
-
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. Update old properties here
-		end% }}}
-	end
-	methods
-		function self = fourierlove(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			%we setup an elastic love number computation by default.
-			self.nfreq=1; 
-			self.frequencies=[0]; %Hz
-			self.sh_nmax=256; % .35 degree, 40 km at the equator.
-			self.sh_nmin=1;
-			% work on matlab script for computing g0 for given Earth's structure. 
-			self.g0=9.81; % m/s^2; 
-			self.r0=6371*1e3; %m;
-			self.mu0=1e11; % Pa
-			self.Gravitational_Constant=6.67259e-11; % m^3 kg^-1 s^-2
-			self.chandler_wobble=0;
-			self.allow_layer_deletion=1;
-			self.underflow_tol=1e-16; %threshold of deep to surface love number ratio to trigger the deletion of layer 
-			self.pw_threshold=1e-3; %if relative variation across frequencies is smaller than this ratio, the post-widder transform for time-dependent love numbers is bypassed 
-			self.integration_steps_per_layer=100;
-			self.istemporal=0;
-			self.n_temporal_iterations=8;
-			self.time=[0]; %s
-			self.love_kernels=0; 
-			self.forcing_type = 11; % surface loading
-			self.inner_core_boundary=1;
-			self.core_mantle_boundary=2;
-			self.complex_computation=0;
-		end % }}}
-		function disp(self) % {{{
-			fielddisplay(self,'nfreq','number of frequencies sampled (default: 1, elastic) [Hz]');
-			fielddisplay(self,'frequencies','frequencies sampled (convention defaults to 0 for the elastic case) [Hz]');
-			fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)');
-			fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default: 1)');
-			fielddisplay(self,'g0','adimensioning constant for gravity (default: 10) [m/s^2]');
-			fielddisplay(self,'r0','adimensioning constant for radius (default: 6371*10^3) [m]');
-			fielddisplay(self,'mu0','adimensioning constant for stress (default: 10^11) [Pa]');
-			fielddisplay(self,'Gravitational_Constant','Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])');
-			fielddisplay(self,'chandler_wobble','includes the inertial terms for the chandler wobble in the rotational feedback love numbers, only for forcing_type=11 (default: 0) (/!\ 1 is untested yet)');
-			fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)');			
-			fielddisplay(self,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default: 1e-16)');
-			fielddisplay(self,'pw_threshold','if relative variation across frequencies is smaller than this ratio, the post-widder transform for time-dependent love numbers is bypassed (default (1e-3)');
-			fielddisplay(self,'integration_steps_per_layer','number of radial steps to propagate the yi system from the bottom to the top of each layer (default: 100)');
-			fielddisplay(self,'istemporal',{'1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency'});
-			fielddisplay(self,'n_temporal_iterations','max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default: 8)');
-			fielddisplay(self,'time','time vector for deformation if istemporal (default: 0) [s]');
-			fielddisplay(self,'love_kernels','compute love numbers at depth? (default: 0)');
-			fielddisplay(self,'forcing_type',{'integer indicating the nature and depth of the forcing for the Love number calculation (default: 11):','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction '});
-			fielddisplay(self,'inner_core_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default: 1)');
-			fielddisplay(self,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)'); 
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('LoveAnalysis',analyses), return; end
-
-			md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',md.love.nfreq);
-			md = checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.Gravitational_Constant','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.chandler_wobble','values',[0 1]);
-			md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0 1]);
-			md = checkfield(md,'fieldname','love.underflow_tol','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.pw_threshold','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.integration_steps_per_layer','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.love_kernels','values',[0 1]);
-			md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
-			md = checkfield(md,'fieldname','love.complex_computation','NaN',1,'Inf',1,'numel',1,'values',[0 1]);
-
-			md = checkfield(md,'fieldname','love.istemporal','values',[0 1]);
-			if md.love.istemporal==1
-				md = checkfield(md,'fieldname','love.n_temporal_iterations','NaN',1,'Inf',1,'numel',1,'>',0);
-				md = checkfield(md,'fieldname','love.time','NaN',1,'Inf',1,'numel',md.love.nfreq/2/md.love.n_temporal_iterations);
-			end
-			if md.love.sh_nmin<=1 & (md.love.forcing_type==1 || md.love.forcing_type==5 || md.love.forcing_type==9)
-				error(['Degree 1 not supported for forcing type ' num2str(md.love.forcing_type) '. Use sh_min>=2 for this kind of calculation.'])
-			end
-
-			if md.love.chandler_wobble==1
-				disp('Warning, Chandler Wobble in Love number calculator has not been validated yet');
-			end
-
-			%need 'litho' material: 
-			if ~isa(md.materials,'materials') | ~sum(strcmpi(md.materials.nature,'litho'))
-				error('Need a ''litho'' material to run a Fourier Love number analysis');
-			end
-
-			mat=find(strcmpi(md.materials.nature,'litho'));
-			if md.love.forcing_type<=4
-				md = checkfield(md,'fieldname','love.inner_core_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
-			elseif md.love.forcing_type<=8
-				md = checkfield(md,'fieldname','love.core_mantle_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
-			end
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'object',self,'fieldname','nfreq','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','frequencies','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','sh_nmax','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','sh_nmin','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','g0','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','r0','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','mu0','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','Gravitational_Constant','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','chandler_wobble','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','allow_layer_deletion','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','underflow_tol','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','pw_threshold','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','integration_steps_per_layer','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','istemporal','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','n_temporal_iterations','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','complex_computation','format','Boolean');
-			%note: no need to marshall the time vector, we have frequencies
-			WriteData(fid,prefix,'object',self,'fieldname','love_kernels','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','inner_core_boundary','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','core_mantle_boundary','format','Integer');
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			error('not implemented yet!');
-		end % }}}
-		function self=build_frequencies_from_time(self) % {{{
-			if ~self.istemporal
-				error('cannot build frequencies for temporal love numbers if love.istemporal==0')
-			end
-			disp('Temporal love numbers: Overriding md.love.nfreq and md.love.frequencies');
-			self.nfreq=length(self.time)*2*self.n_temporal_iterations;
-			self.frequencies=zeros(self.nfreq,1);
-			for i=1:length(self.time)
-				for j=1:2*self.n_temporal_iterations
-					if self.time(i)==0
-						self.frequencies((i-1)*2*self.n_temporal_iterations +j) =0; % convention to avoid marshalling infinite numbers
-					else
-						self.frequencies((i-1)*2*self.n_temporal_iterations +j) = j*log(2)/self.time(i)/2/pi;
-					end
-				end
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/fourierlove.py
===================================================================
--- /issm/trunk/src/m/classes/fourierlove.py	(revision 28275)
+++ 	(revision )
@@ -1,194 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class fourierlove(object):
-    """FOURIERLOVE - class definition
-
-    Usage:
-        md.love = fourierlove()
-    """
-
-    def __init__(self):  # {{{
-        self.nfreq = 0
-        self.frequencies = 0
-        self.sh_nmax = 0
-        self.sh_nmin = 0
-        self.g0 = 0
-        self.r0 = 0
-        self.mu0 = 0
-        self.Gravitational_Constant = 0
-        self.chandler_wobble = 0
-        self.allow_layer_deletion = 0
-        self.underflow_tol = 0
-        self.pw_threshold = 0
-        self.integration_steps_per_layer = 0
-        self.istemporal = 0
-        self.n_temporal_iterations = 0
-        self.time = 0
-        self.love_kernels = 0
-        self.forcing_type = 0
-        self.inner_core_boundary = 0
-        self.core_mantle_boundary = 0
-        self.complex_computation = 0
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        # TODO:
-        # - Correct display to match MATLAB
-        #
-        s = '{}\n'.format(fielddisplay(self, 'nfreq', 'number of frequencies sampled (default: 1, elastic) [Hz]'))
-        s += '{}\n'.format(fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
-        s += '{}\n'.format(fielddisplay(self, 'sh_nmax', 'maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)'))
-        s += '{}\n'.format(fielddisplay(self, 'sh_nmin', 'minimum spherical harmonic degree (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'g0', 'adimensioning constant for gravity (default: 10) [m/s^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'r0', 'adimensioning constant for radius (default: 6371*10^3) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'mu0', 'adimensioning constant for stress (default: 10^11) [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'Gravitational_Constant', 'Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])'))
-        s += '{}\n'.format(fielddisplay(self, 'chandler_wobble', 'includes the inertial terms for the chandler wobble in the rotational feedback love numbers, only for forcing_type=11 (default: 0) (/!\\ 1 has not been validated yet)'))
-        s += '{}\n'.format(fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'pw_threshold', 'if relative variation across frequencies is smaller than this ratio, the post-widder transform for time-dependent love numbers is bypassed (default (1e-3)'))
-        s += '{}\n'.format(fielddisplay(self, 'chandler_wobble', 'includes the inertial terms for the chandler wobble in the rotational feedback love numbers, only for forcing_type=11 (default: 0) (/!\\ 1 is untested)'))
-        s += '{}\n'.format(fielddisplay(self, 'integration_steps_per_layer', 'number of radial steps to propagate the yi system from the bottom to the top of each layer (default: 100)'))
-        s += '{}\n'.format(fielddisplay(self, 'istemporal', ['1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency']))
-        s += '{}\n'.format(fielddisplay(self, 'n_temporal_iterations', 'max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default: 8)'))
-        s += '{}\n'.format(fielddisplay(self, 'time', 'time vector for deformation if istemporal (default: 0) [s]'))
-        s += '{}\n'.format(fielddisplay(self, 'love_kernels', 'compute love numbers at depth? (default: 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'forcing_type', 'integer indicating the nature and depth of the forcing for the Love number calculation (default: 11):'))
-        s += '{}\n'.format('                                                     1:  Inner core boundary -- Volumic Potential')
-        s += '{}\n'.format('                                                     2:  Inner core boundary -- Pressure')
-        s += '{}\n'.format('                                                     3:  Inner core boundary -- Loading')
-        s += '{}\n'.format('                                                     4:  Inner core boundary -- Tangential traction')
-        s += '{}\n'.format('                                                     5:  Core mantle boundary -- Volumic Potential')
-        s += '{}\n'.format('                                                     6:  Core mantle boundary -- Pressure')
-        s += '{}\n'.format('                                                     7:  Core mantle boundary -- Loading')
-        s += '{}\n'.format('                                                     8:  Core mantle boundary -- Tangential traction')
-        s += '{}\n'.format('                                                     9:  Surface -- Volumic Potential')
-        s += '{}\n'.format('                                                     10: Surface -- Pressure')
-        s += '{}\n'.format('                                                     11: Surface -- Loading')
-        s += '{}\n'.format('                                                     12: Surface -- Tangential traction ')
-        s += '{}\n'.format(fielddisplay(self, 'inner_core_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'core_mantle_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # We setup an elastic love number computation by default
-        self.nfreq = 1
-        self.frequencies = [0] # Hz
-        self.sh_nmax = 256 # .35 degree, 40 km at the equator
-        self.sh_nmin = 1
-        # Work on Python script for computing g0 for given Earth's structure
-        self.g0 = 9.81 # m/s^2
-        self.r0 = 6371 * 1e3 # m
-        self.mu0 = 1e11 # Pa
-        self.Gravitational_Constant = 6.67259e-11 # m^3 kg^-1 s^-2
-        self.chandler_wobble = 0
-        self.allow_layer_deletion = 1
-        self.underflow_tol = 1e-16 # Threshold of deep to surface love number ratio to trigger the deletion of layer
-        self.pw_threshold = 1e-3 # If relative variation across frequencies is smaller than this ratio, the post-widder transform for time-dependent love numbers is bypassed 
-        self.integration_steps_per_layer = 100
-        self.istemporal = 0
-        self.n_temporal_iterations = 8
-        self.time = [0] # s
-        self.love_kernels = 0
-        self.forcing_type = 11 # Surface loading
-        self.inner_core_boundary = 1
-        self.core_mantle_boundary = 2
-        self.complex_computation = 0
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'LoveAnalysis' not in analyses:
-            return md
-
-        md = checkfield(md, 'fieldname', 'love.nfreq', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.frequencies', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq)
-        md = checkfield(md, 'fieldname', 'love.sh_nmax', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.sh_nmin', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.g0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.r0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.mu0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.Gravitational_Constant', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.chandler_wobble', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'love.allow_layer_deletion', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'love.underflow_tol', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.pw_threshold', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.integration_steps_per_layer', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.love_kernels', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'love.forcing_type', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', 12)
-        md = checkfield(md, 'fieldname', 'love.complex_computation', 'NaN', 1, 'Inf', 1, 'numel', 1, 'values', [0, 1])
-
-        md = checkfield(md, 'fieldname', 'love.istemporal', 'values', [0, 1])
-
-        if md.love.istemporal:
-            md = checkfield(md, 'fieldname', 'love.n_temporal_iterations', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-            md = checkfield(md, 'fieldname', 'love.time', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq / 2 / md.love.n_temporal_iterations)
-        if md.love.sh_nmin <= 1 and (md.love.forcing_type == 1 or md.love.forcing_type == 5 or md.love.forcing_type == 9):
-            raise RuntimeError('Degree 1 not supported for forcing type {}. Use sh_min >= 2 for this kind of calculation.'.format(md.love.forcing_type))
-
-        if md.love.chandler_wobble  == 1:
-            print('Warning: Chandler wobble in Love number calculator has not been validated yet')
-
-        # Need 'litho' material
-        if md.materials.__class__.__name__ != 'materials' or 'litho' not in md.materials.nature:
-            raise RuntimeError('Need a \'litho\' material to run a Fourier Love number analysis')
-
-        mat = np.where(np.array(md.materials.nature) == 'litho')[0]
-        if md.love.forcing_type <= 4:
-            md = checkfield(md, 'fieldname', 'love.inner_core_boundary', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', md.materials[mat].numlayers)
-        elif md.love.forcing_type <= 8:
-            md = checkfield(md, 'fieldname', 'love.core_mantle_boundary', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', md.materials[mat].numlayers)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'nfreq', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'frequencies', 'format', 'DoubleMat', 'mattype',3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmax', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmin', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'g0', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'r0', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'mu0', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'Gravitational_Constant', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'chandler_wobble', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'allow_layer_deletion', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'underflow_tol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'pw_threshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'integration_steps_per_layer', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'istemporal', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'n_temporal_iterations', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'complex_computation', 'format', 'Boolean')
-        # Note: no need to marshall the time vector, we have frequencies
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_kernels', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'forcing_type', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'inner_core_boundary', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'core_mantle_boundary', 'format', 'Integer')
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def build_frequencies_from_time(self):  # {{{
-        if not self.istemporal:
-            raise RuntimeError('cannot build frequencies for temporal love numbers if love.istemporal==0')
-        print('Temporal love numbers: Overriding md.love.nfreq and md.love.frequencies')
-        self.nfreq = len(self.time) * 2 * self.n_temporal_iterations
-        self.frequencies = np.zeros((self.nfreq,))
-        for i in range(len(self.time)):
-            for j in range(2 * self.n_temporal_iterations):
-                if self.time[i] == 0:
-                    self.frequencies[(i - 1) * 2 * self.n_temporal_iterations + j] = 0 # Convention to avoid marshalling infinite numbers
-                else:
-                    self.frequencies[(i - 1) * 2 * self.n_temporal_iterations + j] = j * np.log(2) / self.time[i] / 2 / np.pi
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/friction.js
===================================================================
--- /issm/trunk/src/m/classes/friction.js	(revision 28275)
+++ 	(revision )
@@ -1,106 +1,0 @@
-//FRICTION class definition
-//
-//   Usage:
-//      friction=friction();
-
-function friction (){
-	//methods
-	this.setdefaultparameters = function(){ // {{{
-
-	} // }}}
-	this.disp= function (){// {{{
-		console.log(sprintf('Basal shear stress parameters: Sigma_b = coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p)'));
-		fielddisplay(this,'coefficient','friction coefficient [SI]');
-		fielddisplay(this,'p','p exponent');
-		fielddisplay(this,'q','q exponent');
-		fielddisplay(this,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
-		fielddisplay(this,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)');
-		fielddisplay(this,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
-	} // }}}
-	this.extrude = function(md) {//{{{
-		this.coefficient = project3d(md, 'vector', this.coefficient, 'type', 'node', 'layer', 1);
-		this.p = project3d(md, 'vector', this.p, 'type', 'element');
-		this.q = project3d(md, 'vector', this.q, 'type', 'element');
-		switch (this.coupling) {
-			case 0:
-			case 1:
-				this.effective_pressure=project3d(md, 'vector', this.effective_pressure, 'type', 'node', 'layer', 1);
-				break;
-			case 2:
-				console.error('not implemented yet');
-				break;
-			default:	
-				console.error('not supported yet');
-		}
-		return this;
-	}//}}}
-	this.classname= function (){// {{{
-		return "friction";
-	} // }}}
-		this.checkconsistency = function(md,solution,analyses){ //{{{
-
-			//Early return
-			if ((!ArrayAnyEqual(ArrayIsMember('StressbalanceAnalysis',analyses),1)) & (!ArrayAnyEqual(ArrayIsMember('StressbalanceAnalysis',analyses),1))){
-				return; 
-			}
-			checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
-			checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
-			checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
-			checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0, 1, 2]);
-			checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
-			switch (this.coupling) {
-				case 0:
-				case 1:
-					checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
-					break;
-				case 2:
-					console.error('not implemented yet');
-					break;
-				default:	
-					console.error('not supported yet');
-			}
-
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			var yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer');
-			let mattype,tsl;
-			if ((size(this.coefficient,0)==md.mesh.numberofvertices | size(this.coefficient,1)==md.mesh.numberofvertices+1)) {
-				mattype=1;
-				tsl = md.mesh.numberofvertices;
-			} else {
-				mattype=2;
-				tsl = md.mesh.numberofelements;
-			}
-			WriteData(fid,prefix,'object',this,'fieldname','coefficient','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',this,'fieldname','p','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',this,'fieldname','q','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',this,'fieldname','coupling','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','friction','fieldname','effective_pressure_limit','format','Double');
-			switch (this.coupling) {
-				case 0:
-					break;
-				case 1:
-					WriteData(fid,prefix,'class','friction','object',this,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-					break;
-				case 2:
-					console.error('not implemented yet');
-					break;
-				default:
-					console.error('not supported yet');		
-			}
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	//{{{
-	this.coefficient			  = NaN;
-	this.p						  = NaN;
-	this.q						  = NaN;
-	this.coupling				  = 0;
-	this.effective_pressure 	  = NaN;
-	this.effective_pressure_limit = 0;
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/friction.m
===================================================================
--- /issm/trunk/src/m/classes/friction.m	(revision 28275)
+++ 	(revision )
@@ -1,98 +1,0 @@
-%FRICTION class definition
-%
-%	Usage:
-%		friction=friction();
-
-classdef friction
-	properties (SetAccess=public) 
-		coefficient              = NaN;
-		p                        = NaN;
-		q                        = NaN;
-		coupling                 = 0;
-		linearize                = 0;
-		effective_pressure       = NaN;
-		effective_pressure_limit = 0;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1);
-			self.p=project3d(md,'vector',self.p,'type','element');
-			self.q=project3d(md,'vector',self.q,'type','element');
-			if self.coupling==3 || self.coupling==4
-				self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
-			end
-		end % }}}
-		function self = friction(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(friction(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.linearize = 0;
-			self.coupling  = 0;
-			self.effective_pressure_limit = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			if (strcmp(solution,'TransientSolution') &  md.transient.isstressbalance ==0 & md.transient.isthermal == 0), return; end
-
-			md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.linearize','numel',[1],'values',[0:2]);
-			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0:4]);
-			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
-         if self.coupling==3
-            md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('Basal shear stress parameters: Sigma_b = coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p)'));
-			fielddisplay(self,'coefficient','friction coefficient [SI]');
-			fielddisplay(self,'p','p exponent');
-			fielddisplay(self,'q','q exponent');
-			fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: use coupled model (not implemented yet)');
-			fielddisplay(self,'linearize','0: not linearized, 1: interpolated linearly, 2: constant per element (default is 0)');
-			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
-			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer');
-			if(size(self.coefficient,1)==md.mesh.numberofvertices | size(self.coefficient,1)==md.mesh.numberofvertices+1),
-				mattype=1;
-				tsl = md.mesh.numberofvertices;
-			else
-				mattype=2;
-				tsl = md.mesh.numberofelements;
-			end
-			WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','linearize','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-			if self.coupling==3 || self.coupling==4
-				WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			end
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.friction.coefficient'],self.coefficient);
-			writejs1Darray(fid,[modelname '.friction.p'],self.p);
-			writejs1Darray(fid,[modelname '.friction.q'],self.q);
-			writejs1Darray(fid,[modelname '.friction.coupling'],self.coupling);
-			writejs1Darray(fid,[modelname '.friction.linearize'],self.linearize);
-			writejs1Darray(fid,[modelname '.friction.effective_pressure'],self.effective_pressure);
-			writejs1Darray(fid,[modelname '.friction.effective_pressure_limit'],self.effective_pressure_limit);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/friction.py
===================================================================
--- /issm/trunk/src/m/classes/friction.py	(revision 28275)
+++ 	(revision )
@@ -1,88 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class friction(object):
-    """friction class definition
-
-    Usage:
-        friction = friction()
-    """
-
-    def __init__(self):  # {{{
-        self.coefficient = np.nan
-        self.p = np.nan
-        self.q = np.nan
-        self.coupling = 0
-        self.linearize = 0
-        self.effective_pressure = np.nan
-        self.effective_pressure_limit = 0
-        self.setdefaultparameters()
-    # }}}
-    def __repr__(self):  # {{{
-        s = 'Basal shear stress parameters: Sigma_b = coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b,\n'
-        s += '(effective stress Neff = rho_ice * g * thickness + rho_water * g * base, r = q / p and s = 1 / p)\n'
-        s += '{}\n'.format(fielddisplay(self, 'coefficient', 'friction coefficient [SI]'))
-        s += '{}\n'.format(fielddisplay(self, 'p', 'p exponent'))
-        s += '{}\n'.format(fielddisplay(self, 'q', 'q exponent'))
-        s += '{}\n'.format(fielddisplay(self, 'coupling', 'Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
-        s += '{}\n'.format(fielddisplay(self, 'linearize', '0: not linearized, 1: interpolated linearly, 2: constant per element (default is 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'effective_pressure_limit', 'Neff do not allow to fall below a certain limit: effective_pressure_limit * rho_ice * g * thickness (default 0)'))
-        return s
-    # }}}
-    def setdefaultparameters(self):  # {{{
-        self.linearize = 0
-        self.coupling = 0
-        self.effective_pressure_limit = 0
-        return self
-    # }}}
-    def extrude(self, md):  # {{{
-        self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
-        self.p = project3d(md, 'vector', self.p, 'type', 'element')
-        self.q = project3d(md, 'vector', self.q, 'type', 'element')
-        if self.coupling in[3, 4]:
-            self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-    def defaultoutputs(self, md):  # {{{
-        list = []
-        return list
-    # }}}
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-            return md
-        if solution == 'TransientSolution' and not md.transient.isstressbalance and not md.transient.isthermal:
-            return md
-        md = checkfield(md, 'fieldname', 'friction.coefficient', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.q', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'friction.p', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'friction.linearize', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'friction.coupling', 'numel', [1], 'values', [0, 1, 2, 3, 4])
-        md = checkfield(md, 'fieldname', 'friction.effective_pressure_limit', 'numel', [1], '>=', 0)
-        if self.coupling == 3:
-            md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 1, 'format', 'Integer')
-        if type(self.coefficient) in [np.ndarray] and (self.coefficient.shape[0] == md.mesh.numberofvertices or self.coefficient.shape[0] == (md.mesh.numberofvertices + 1)):
-            mattype = 1
-            tsl = md.mesh.numberofvertices
-        else:
-            mattype = 2
-            tsl = md.mesh.numberofelements
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', mattype, 'timeserieslength', tsl + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'p', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'linearize', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
-        if self.coupling == 3 or self.coupling == 4:
-            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-    # }}}
Index: sm/trunk/src/m/classes/frictioncoulomb.m
===================================================================
--- /issm/trunk/src/m/classes/frictioncoulomb.m	(revision 28275)
+++ 	(revision )
@@ -1,96 +1,0 @@
-%FRICTIONCOULOMB class definition
-%
-%   Usage:
-%      frictioncoulomb=frictioncoulomb();
-
-classdef frictioncoulomb
-	properties (SetAccess=public) 
-		coefficient        = NaN;
-		p                  = NaN;
-		q                  = NaN;
-		coefficientcoulomb = NaN;
-		coupling	= 0;
-		effective_pressure = NaN;
-		effective_pressure_limit = 0;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1);
-			self.coefficientcoulomb=project3d(md,'vector',self.coefficientcoulomb,'type','node','layer',1);
-			self.p=project3d(md,'vector',self.p,'type','element');
-			self.q=project3d(md,'vector',self.q,'type','element');
-			switch self.coupling
-				case 0
-				case 1
-					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
-				case 2
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');		
-			end
-		end % }}}
-		function self = frictioncoulomb(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.effective_pressure_limit = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.coefficientcoulomb','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);			
-			switch self.coupling
-				case 0
-				case 1
-					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
-				case 2
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');		
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('Basal shear stress parameters: Sigma_b = min( coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b\n, coefficientcoulomb^2 * Neff) (effective stress Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p, floatation thickness h_f=max(0,-rho_sw / rho_i * bed))'));
-			fielddisplay(self,'coefficient','power law (Weertman) friction coefficient [SI]');
-			fielddisplay(self,'coefficientcoulomb','Coulomb friction coefficient [SI]');
-			fielddisplay(self,'p','p exponent');
-			fielddisplay(self,'q','q exponent');
-			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
-			fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)');
-			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');	
-			end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'name','md.friction.law','data',7,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','coefficientcoulomb','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-			switch self.coupling
-				case 0
-				case 1
-					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				case 2
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');		
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictioncoulomb.py
===================================================================
--- /issm/trunk/src/m/classes/frictioncoulomb.py	(revision 28275)
+++ 	(revision )
@@ -1,92 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class frictioncoulomb(object):
-    """FRICTIONCOULOMB class definition
-
-    Usage:
-        frictioncoulomb = frictioncoulomb()
-    """
-
-    def __init__(self):  # {{{
-        self.coefficient = np.nan
-        self.coefficientcoulomb = np.nan
-        self.p = np.nan
-        self.q = np.nan
-        self.coupling = 0
-        self.effective_pressure = np.nan
-        self.effective_pressure_limit = 0
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = 'Basal shear stress parameters: Sigma_b = min(coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b,\n'
-        s += 'coefficientcoulomb^2 * Neff), (effective stress Neff = rho_ice * g * thickness + rho_water * g * bed, r = q / p and s = 1 / p).\n'
-        s += '{}\n'.format(fielddisplay(self, "coefficient", "power law (Weertman) friction coefficient [SI]"))
-        s += '{}\n'.format(fielddisplay(self, "coefficientcoulomb", "Coulomb friction coefficient [SI]"))
-        s += '{}\n'.format(fielddisplay(self, "p", "p exponent"))
-        s += '{}\n'.format(fielddisplay(self, "q", "q exponent"))
-        s += '{}\n'.format(fielddisplay(self, 'coupling', 'Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)'))
-        s += '{}\n'.format(fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'effective_pressure_limit', 'Neff do not allow to fall below a certain limit: effective_pressure_limit * rho_ice * g * thickness (default 0)'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.effective_pressure_limit = 0
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
-        self.coefficientcoulomb = project3d(md, 'vector', self.coefficientcoulomb, 'type', 'node', 'layer', 1)
-        self.p = project3d(md, 'vector', self.p, 'type', 'element')
-        self.q = project3d(md, 'vector', self.q, 'type', 'element')
-        if self.coupling == 1:
-            self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
-        elif self.coupling == 2:
-            raise ValueError('not implemented yet')
-        elif self.coupling > 2:
-            raise ValueError('not supported yet')
-        return self
-    # }}}
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-            return md
-        md = checkfield(md, 'fieldname', 'friction.coefficient', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.coefficientcoulomb', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.q', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'friction.p', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'friction.coupling', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'friction.effective_pressure_limit', 'numel', [1], '>=', 0)
-        if self.coupling == 1:
-            md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        elif self.coupling == 2:
-            raise ValueError('not implemented yet')
-        elif self.coupling > 2:
-            raise ValueError('not supported yet')
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 7, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficientcoulomb', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'p', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
-        if self.coupling == 1:
-            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        elif self.coupling == 2:
-            raise ValueError('not implemented yet')
-        elif self.coupling > 2:
-            raise ValueError('not supported yet')
-    # }}}
Index: sm/trunk/src/m/classes/frictioncoulomb2.m
===================================================================
--- /issm/trunk/src/m/classes/frictioncoulomb2.m	(revision 28275)
+++ 	(revision )
@@ -1,102 +1,0 @@
-%FRICTIONCOULOMB2 class definition
-%
-%   Usage:
-%      frictioncoulomb=frictioncoulomb2();
-
-classdef frictioncoulomb2
-	properties (SetAccess=public) 
-		C                        = NaN;
-		m                        = NaN;
-		coupling                 = 0;
-		effective_pressure       = NaN;
-		effective_pressure_limit = 0;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			if isstruct(self)
-				disp('Recovering frictioncoulomb2 from older version');
-				if isfield(self,'coefficient')
-					self.C = self.coefficient;
-				end
-				self = structtoobj(frictioncoulomb2(),self);
-			end
-		end% }}}
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.C=project3d(md,'vector',self.C,'type','node','layer',1);
-			self.m=project3d(md,'vector',self.m,'type','element');
-			switch self.coupling
-				case 0
-				case 1
-					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
-				case 2
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');		
-			end
-		end % }}}
-		function self = frictioncoulomb(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.effective_pressure_limit = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);			
-			switch self.coupling
-				case 0
-				case 1
-					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
-				case 2
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');		
-			end
-		end % }}}
-		function disp(self) % {{{
-         disp('Coulomb limited sliding law parameters:');
-         disp(' ');
-         disp('                     C^2 |u_b|^(m-1) * (.5*N)           ');
-         disp('      tau_b = - _________________________________   u_b ');
-         disp('                (C^(2/m) |u_b| + (0.5*N)^(1/m) )^m      ');
-         disp(' ');
-			fielddisplay(self,'C','friction coefficient [SI]');
-			fielddisplay(self,'m','m exponent (Weertman would be 1/3)');
-			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
-			fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled (not implemented yet)');
-			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');	
-			end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'name','md.friction.law','data',13,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','m','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-			switch self.coupling
-				case 0
-				case 1
-					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				case 2
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');		
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionhydro.m
===================================================================
--- /issm/trunk/src/m/classes/frictionhydro.m	(revision 28275)
+++ 	(revision )
@@ -1,90 +1,0 @@
-%FRICTIONWEERTMAN class definition
-%
-%   Usage:
-%      friction=frictionhydro();
-
-classdef frictionhydro
-	properties (SetAccess=public) 
-		coupling           = 0;
-		q                  = NaN;
-		C                  = NaN;
-		As                 = NaN;
-		effective_pressure = NaN;
-		effective_pressure_limit = 0;
-	end
-	methods
-		function self = frictionhydro(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.effective_pressure_limit = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.C','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.As','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
-			switch self.coupling
-				case 0
-				case 1
-					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
-				case 2
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');		
-			end
-	    end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.q=project3d(md,'vector',self.q,'type','element');
-			self.C=project3d(md,'vector',self.C,'type','element');
-			self.As=project3d(md,'vector',self.As,'type','element');
-			switch self.coupling
-				case 0
-				case 1
-					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
-				case 2
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');		
-			end
-	  end % }}}
-		function disp(self) % {{{
-			disp(sprintf('Effective Pressure based friction law described in Gagliardini 2007'));
-			fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)');
-			fielddisplay(self,'q','friction law exponent q>=1');
-			fielddisplay(self,'C','friction law max value [SI]');
-			fielddisplay(self,'As','Sliding Parameter without cavitation [m Pa^-n s^-1]');
-			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
-			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.friction.law','data',3,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','As','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-			switch self.coupling
-				case 0
-				case 1
-					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				case 2
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');		
-			end
-	  end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionhydro.py
===================================================================
--- /issm/trunk/src/m/classes/frictionhydro.py	(revision 28275)
+++ 	(revision )
@@ -1,83 +1,0 @@
-import numpy as np
-from project3d import project3d
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class frictionhydro(object):
-    """
-    friction hydro is the friction law from Schoof 2005 or Gagliardini2007
-
-    Usage:
-        friction = frictionhydro()
-    """
-    def __init__(self):  # {{{
-        self.coupling = 0
-        self.q = np.nan
-        self.C = np.nan
-        self.As = np.nan
-        self.effective_pressure = np.nan
-        self.effective_pressure_limit = 0
-        #set defaults
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = 'Effective Pressure based friction law described in Gagliardini 2007'
-        string = "%s\n%s" % (string, fielddisplay(self, 'coupling', 'Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'q', 'friction law exponent q >= 1'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'C', 'friction law max value (Iken bound)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'As', 'Sliding Parameter without cavitation [m Pa^ - n s^ - 1]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'effective_pressure_limit', 'Neff do not allow to fall below a certain limit: effective_pressure_limit * rho_ice * g * thickness (default 0)'))
-
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.q = project3d(md, 'vector', self.q, 'type', 'element')
-        self.C = project3d(md, 'vector', self.C, 'type', 'element')
-        self.As = project3d(md, 'vector', self.As, 'type', 'element')
-        if self.coupling in[3, 4]:
-            self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
-        elif self.coupling > 4:
-            raise ValueError('md.friction.coupling larger than 4, not supported yet')
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.coupling = 0
-        self.effective_pressure = np.nan
-        self.effective_pressure_limit = 0
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        #Early return
-        if 'StressbalanceAnalysis' in analyses and 'ThermalAnalysis' in analyses:
-            return md
-
-        md = checkfield(md, 'fieldname', 'friction.coupling', 'numel', [1], 'values', [0, 1, 2, 3, 4])
-        md = checkfield(md, 'fieldname', 'friction.q', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'friction.C', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'friction.As', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'friction.effective_pressure_limit', 'numel', [1], '>=', 0)
-        if self.coupling == 3:
-            md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        elif self.coupling > 4:
-            raise ValueError('md.friction.coupling larger than 4, not supported yet')
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 3, 'format', 'Integer')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'C', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'As', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
-        if self.coupling in[3, 4]:
-            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        elif self.coupling > 4:
-            raise ValueError('md.friction.coupling larger than 4, not supported yet')
-    # }}}
Index: sm/trunk/src/m/classes/frictionjosh.m
===================================================================
--- /issm/trunk/src/m/classes/frictionjosh.m	(revision 28275)
+++ 	(revision )
@@ -1,66 +1,0 @@
-%FRICTIONTEMP class definition
-%
-%   Usage:
-%      frictionjosh=frictionjosh();
-
-classdef frictionjosh
-	properties (SetAccess=public) 
-		coefficient = NaN;
-		pressure_adjusted_temperature = NaN;
-		gamma      = 0.;
-		effective_pressure_limit = 0;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1);
-			self.pressure_adjusted_temperature=project3d(md,'vector',self.pressure_adjusted_temperature,'type','node','layer',1);
-		end % }}}
-		function self = frictionjosh(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(frictionjosh(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Default gamma: 1
-			self.gamma = 1.;
-
-			%Default 0
-			self.effective_pressure_limit = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-
-			md = checkfield(md,'fieldname','friction.coefficient','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.pressure_adjusted_temperature','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.gamma','numel',1,'NaN',1,'Inf',1,'>',0.);
-			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
-
-			%Check that temperature is provided
-			md = checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size','universal');
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('Basal shear stress parameters: tau_b = coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b * 1/f(T)\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p)'));
-			fielddisplay(self,'coefficient','friction coefficient [SI]');
-			fielddisplay(self,'pressure_adjusted_temperature','friction pressure_adjusted_temperature (T - Tpmp) [K]');
-			fielddisplay(self,'gamma','(T - Tpmp)/gamma [K]');
-			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'name','md.friction.law','data',9,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','pressure_adjusted_temperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','gamma','format','Double');
-			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionjosh.py
===================================================================
--- /issm/trunk/src/m/classes/frictionjosh.py	(revision 28275)
+++ 	(revision )
@@ -1,74 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class frictionjosh(object):
-    """FRICTIONJOSH class definition
-
-    Usage:
-        frictionjosh = frictionjosh()
-    """
-
-    def __init__(self):  # {{{
-        self.coefficient = np.nan
-        self.pressure_adjusted_temperature = np.nan
-        self.gamma = 0
-        self.effective_pressure_limit = 0
-
-        self.setdefaultparameters()
-        #self.requested_outputs = []
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = 'Basal shear stress parameters: Sigma_b = coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b,\n'
-        s += '(effective stress Neff = rho_ice * g * thickness + rho_water * g * base, r = q / p and s = 1 / p)\n'
-        s += '{}\n'.format(fielddisplay(self, "coefficient", "friction coefficient [SI]"))
-        s += '{}\n'.format(fielddisplay(self, 'pressure_adjusted_temperature', 'friction pressure_adjusted_temperature (T - Tpmp) [K]'))
-        s += '{}\n'.format(fielddisplay(self, 'gamma', '(T - Tpmp)/gamma [K]'))
-        s += '{}\n'.format(fielddisplay(self, 'effective_pressure_limit', 'Neff do not allow to fall below a certain limit: effective_pressure_limit * rho_ice * g * thickness (default 0)'))
-        #s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
-        self.pressure_adjusted_temperature = project3d(md, 'vector', self.pressure_adjusted_temperature, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.gamma = 1.
-        #self.requested_outputs = ['default']
-        self.effective_pressure_limit = 0
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        list = []
-        return list
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-            return md
-        md = checkfield(md, 'fieldname', 'friction.coefficient', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.pressure_adjusted_temperature','NaN',1,'Inf',1)
-        md = checkfield(md, 'fieldname', 'friction.gamma','numel',1,'NaN',1,'Inf',1,'>',0.)
-        md = checkfield(md, 'fieldname', 'friction.effective_pressure_limit', 'numel', [1], '>=', 0)
-        # Check that temperature is provided
-        md = checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size','universal')
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid,prefix,'name','md.friction.law','data',9,'format','Integer')
-        WriteData(fid,prefix,'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-        WriteData(fid,prefix,'class','friction','object',self,'fieldname','pressure_adjusted_temperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-        WriteData(fid,prefix,'class','friction','object',self,'fieldname','gamma','format','Double')
-        WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double')
-    # }}}
Index: sm/trunk/src/m/classes/frictionpism.m
===================================================================
--- /issm/trunk/src/m/classes/frictionpism.m	(revision 28275)
+++ 	(revision )
@@ -1,75 +1,0 @@
-%FRICTIONPISM class definition
-%
-%   Usage:
-%      frictionpism=frictionpism();
-
-classdef frictionpism
-	properties (SetAccess=public) 
-		pseudoplasticity_exponent            = 0.;
-		threshold_speed                      = 0.;
-		delta                                = 0.;
-		void_ratio                           = 0.;
-		till_friction_angle                  = NaN;
-		sediment_compressibility_coefficient = NaN;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.till_friction_angle=project3d(md,'vector',self.till_friction_angle,'type','node','layer',1);
-         self.sediment_compressibility_coefficient=project3d(md,'vector',self.sediment_compressibility_coefficient,'type','node','layer',1);
-		end % }}}
-		function self = frictionpism(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(frictionpism(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-         self.pseudoplasticity_exponent = 0.6;
-         self.threshold_speed           = 100.;
-         self.delta                     = 0.02;
-         self.void_ratio                = 0.69;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			if (strcmp(solution,'TransientSolution') &  md.transient.isstressbalance ==0 & md.transient.isthermal == 0), return; end
-
-			md = checkfield(md,'fieldname','friction.pseudoplasticity_exponent','numel',[1],'>',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.threshold_speed','numel',[1],'>',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.delta','numel',[1],'>',0,'<',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.void_ratio','numel',[1],'>',0,'<',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.till_friction_angle','NaN',1,'Inf',1,'<',360.,'>',0.,'size',[md.mesh.numberofvertices 1]); %User should give angle in degrees, Matlab calculates in rad
-			md = checkfield(md,'fieldname','friction.sediment_compressibility_coefficient','NaN',1,'Inf',1,'<',1.,'>',0.,'size',[md.mesh.numberofvertices 1]);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('Basal shear stress parameters for the PISM friction law (See Aschwanden et al. 2016 for more details)'));
-			fielddisplay(self,'pseudoplasticity_exponent','pseudoplasticity exponent [dimensionless]');
-			fielddisplay(self,'threshold_speed','threshold speed [m/yr]');
-			fielddisplay(self,'delta','lower limit of the effective pressure, expressed as a fraction of overburden pressure [dimensionless]');
-			fielddisplay(self,'void_ratio','void ratio at a reference effective pressure [dimensionless]');
-			fielddisplay(self,'till_friction_angle','till friction angle [deg], recommended default: 30 deg');
-			fielddisplay(self,'sediment_compressibility_coefficient','coefficient of compressibility of the sediment [dimensionless], recommended default: 0.12');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.friction.law','data',10,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','pseudoplasticity_exponent','format','Double');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','threshold_speed','format','Double','scale',1./yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','delta','format','Double');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','void_ratio','format','Double');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','till_friction_angle','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','sediment_compressibility_coefficient','format','DoubleMat','mattype',1);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-         error('not implemented yet!');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionpism.py
===================================================================
--- /issm/trunk/src/m/classes/frictionpism.py	(revision 28275)
+++ 	(revision )
@@ -1,76 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class frictionpism(object):
-    """FRICTIONPISM class definition
-
-    Usage:
-        frictionpism = frictionpism()
-    """
-
-    def __init__(self):
-        self.pseudoplasticity_exponent = 0.
-        self.threshold_speed = 0.
-        self.delta = 0.
-        self.void_ratio = 0.
-        self.till_friction_angle = np.nan
-        self.sediment_compressibility_coefficient = np.nan
-
-        self.setdefaultparameters()
-        self.requested_outputs = []
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.till_friction_angle = project3d(md, 'vector', self.till_friction_angle, 'type', 'node', 'layer', 1)
-        self.sediment_compressibility_coefficient = project3d(md, 'vector', self.sediment_compressibility_coefficient, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.pseudoplasticity_exponent = 0.6
-        self.threshold_speed = 100.
-        self.delta = 0.02
-        self.void_ratio = 0.69
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-            return md
-        if solution == 'TransientSolution' and not md.transient.isstressbalance and not md.transient.isthermal:
-            return md
-        md = checkfield(md, 'fieldname', 'friction.pseudoplasticity_exponent', 'numel', [1], '>', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.threshold_speed', 'numel', [1], '>', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.delta', 'numel', [1], '>', 0, '<', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.void_ratio', 'numel', [1], '>', 0, '<', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.till_friction_angle', 'NaN', 1, 'Inf', 1, '<', 360., '>', 0., 'size', [md.mesh.numberofvertices])  #User should give angle in degrees, Matlab calculates in rad
-        md = checkfield(md, 'fieldname', 'friction.sediment_compressibility_coefficient', 'NaN', 1, 'Inf', 1, '<', 1., '>', 0., 'size', [md.mesh.numberofvertices])
-        return md
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = 'Basal shear stress parameters for the PISM friction law (See Aschwanden et al. 2016 for more details)\n'
-        s += "{}\n".format(fielddisplay(self, 'pseudoplasticity_exponent', 'pseudoplasticity exponent [dimensionless]'))
-        s += "{}\n".format(fielddisplay(self, 'threshold_speed', 'threshold speed [m / yr]'))
-        s += "{}\n".format(fielddisplay(self, 'delta', 'lower limit of the effective pressure, expressed as a fraction of overburden pressure [dimensionless]'))
-        s += "{}\n".format(fielddisplay(self, 'void_ratio', 'void ratio at a reference effective pressure [dimensionless]'))
-        s += "{}\n".format(fielddisplay(self, 'till_friction_angle', 'till friction angle [deg], recommended default: 30 deg'))
-        s += "{}\n".format(fielddisplay(self, 'sediment_compressibility_coefficient', 'coefficient of compressibility of the sediment [dimensionless], recommended default: 0.12'))
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 10, 'format', 'Integer')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'pseudoplasticity_exponent', 'format', 'Double')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'threshold_speed', 'format', 'Double', 'scale', 1. / yts)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'delta', 'format', 'Double')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'void_ratio', 'format', 'Double')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'till_friction_angle', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'sediment_compressibility_coefficient', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
Index: sm/trunk/src/m/classes/frictionregcoulomb.m
===================================================================
--- /issm/trunk/src/m/classes/frictionregcoulomb.m	(revision 28275)
+++ 	(revision )
@@ -1,61 +1,0 @@
-%FRICTIONREGCOULOMB class definition
-%
-%   Usage:
-%      frictionregcoulomb=frictionregcoulomb();
-
-classdef frictionregcoulomb
-	properties (SetAccess=public) 
-		C  = NaN;
-		u0 = 0.;
-		m  = NaN;
-	end
-	methods
-		function self = frictionregcoulomb(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(frictionregcoulomb(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.C    = project3d(md,'vector',self.C,'type','node');
-			self.m    = project3d(md,'vector',self.m,'type','element');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.u0 = 1000;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>=',0.);
-			md = checkfield(md,'fieldname','friction.u0','NaN',1,'Inf',1,'>',0.,'numel',1);
-			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'>',0.,'size',[md.mesh.numberofelements,1]);
-		end % }}}
-		function disp(self) % {{{
-			%See Joughin et al. 2019 (equivalent form by Matt Trevers, poster at AGU 2022) https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2019GL082526
-			disp('Regularized Couloub friction law (Joughin et al., 2019) parameters:');
-			disp('   Regularized Couloub friction law reads:');
-			disp('                       C^2 |u|^(1/m)         ');
-			disp('      tau_b = -  ____________________________');
-			disp('                        (|u|/u0 + 1)^(1/m)   ');
-			disp(' ');
-			fielddisplay(self,'C','friction coefficient [SI]');
-			fielddisplay(self,'m','m exponent (set to m=3 in original paper)');
-			fielddisplay(self,'u0','velocity controling plastic limit');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.friction.law','data',14,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','u0','format','Double','scale',1/yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionregcoulomb2.m
===================================================================
--- /issm/trunk/src/m/classes/frictionregcoulomb2.m	(revision 28275)
+++ 	(revision )
@@ -1,66 +1,0 @@
-%FRICTIONREGCOULOMB2 class definition
-%
-%   Usage:
-%      frictionregcoulomb=frictionregcoulomb();
-
-classdef frictionregcoulomb2
-	properties (SetAccess=public) 
-		C  = NaN;
-		K  = NaN;
-		m  = NaN;
-		effective_pressure_limit = 0;
-	end
-	methods
-		function self = frictionregcoulomb2(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(frictionregcoulomb2(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.C    = project3d(md,'vector',self.C,'type','node');
-			self.m    = project3d(md,'vector',self.m,'type','element');
-			self.K    = project3d(md,'vector',self.K,'type','node');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.effective_pressure_limit = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>=',0.);
-			md = checkfield(md,'fieldname','friction.K','NaN',1,'Inf',1,'>',0.);
-			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'>',0.,'size',[md.mesh.numberofelements,1]);
-			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
-		end % }}}
-		function disp(self) % {{{
-			%See Zoet and Iverson 2020 or Choi et al., 2022 
-			disp('Regularized Couloub friction law 2  parameters:');
-			disp('   Regularized Couloub friction law reads:');
-			disp('                       C N |u|^(1/m)         ');
-			disp('      tau_b = -  ____________________________');
-			disp('                        (|u| + (K*N)^m)^(1/m)   ');
-			disp(' ');
-			fielddisplay(self,'C','friction coefficient [SI]');
-			fielddisplay(self,'m','m exponent');
-			fielddisplay(self,'K','(K*N)^m to be velocity controling plastic limit');
-			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.friction.law','data',15,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','K','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionschoof.m
===================================================================
--- /issm/trunk/src/m/classes/frictionschoof.m	(revision 28275)
+++ 	(revision )
@@ -1,82 +1,0 @@
-%FRICTIONSCHOOF class definition
-%
-%   Usage:
-%      frictionschoof=frictionschoof();
-
-classdef frictionschoof
-	properties (SetAccess=public) 
-		C                        = NaN;
-		Cmax                     = NaN;
-		m                        = NaN;
-		coupling                 = 0;
-		effective_pressure       = NaN;
-		effective_pressure_limit = 0;
-	end
-	methods
-		function self = frictionschoof(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(frictionschoof(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.C    = project3d(md,'vector',self.C,'type','node');
-			self.Cmax = project3d(md,'vector',self.Cmax,'type','node');
-			self.m    = project3d(md,'vector',self.m,'type','element');
-			if self.coupling==3 || self.coupling==4
-				self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-         self.coupling = 0;
-			self.effective_pressure_limit = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>=',0.);
-			md = checkfield(md,'fieldname','friction.Cmax','timeseries',1,'NaN',1,'Inf',1,'>',0.);
-			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'>',0.,'size',[md.mesh.numberofelements,1]);
-			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
-         md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0:4]);
-         if self.coupling==3
-            md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
-         end
-		end % }}}
-		function disp(self) % {{{
-			%See Brondex et al. 2019 https://www.the-cryosphere.net/13/177/2019/
-			disp('Schoof sliding law parameters:');
-			disp('   Schoof''s sliding law reads:');
-			disp('                         C^2 |u_b|^(m-1)                ');
-			disp('      tau_b = - _____________________________   u_b   ');
-			disp('               (1+(C^2/(Cmax N))^1/m |u_b| )^m          ');
-			disp(' ');
-			fielddisplay(self,'C','friction coefficient [SI]');
-			fielddisplay(self,'Cmax','Iken''s bound (typically between 0.17 and 0.84) [SI]');
-			fielddisplay(self,'m','m exponent (generally taken as m = 1/n = 1/3)');
-			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
-         fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: use coupled model (not implemented yet)');
-			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.friction.law','data',11,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','Cmax','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-         WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
-         if self.coupling==3 || self.coupling==4
-            WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-         end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionschoof.py
===================================================================
--- /issm/trunk/src/m/classes/frictionschoof.py	(revision 28275)
+++ 	(revision )
@@ -1,84 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from structtoobj import structtoobj
-from WriteData import WriteData
-
-
-class frictionschoof(object):
-    """FRICTIONSCHOOF class definition
-
-    Usage:
-        friction = frictionschoof()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.C                        = np.nan
-        self.Cmax                     = np.nan
-        self.m                        = np.nan
-        self.coupling                 = 0
-        self.effective_pressure       = np.nan
-        self.effective_pressure_limit = 0
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            self = structtoobj(self, args[0])
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-    def __repr__(self):  # {{{
-        # See Brondex et al. 2019 https://www.the-cryosphere.net/13/177/2019/
-        s = 'Schoof sliding law parameters:\n'
-        s += '   Schoof\'s sliding law reads:\n'
-        s += '                         C^2 |u_b|^(m-1)                \n'
-        s += '      tau_b = - _____________________________   u_b   \n'
-        s += '               (1+(C^2/(Cmax N))^1/m |u_b| )^m          \n'
-        s += '\n'
-        s += "{}\n".format(fielddisplay(self, 'C', 'friction coefficient [SI]'))
-        s += "{}\n".format(fielddisplay(self, 'Cmax', 'Iken\'s bound (typically between 0.17 and 0.84) [SI]'))
-        s += "{}\n".format(fielddisplay(self, 'm', 'm exponent (generally taken as m = 1/n = 1/3)'))
-        s += '{}\n'.format(fielddisplay(self, 'coupling', 'Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
-        s += '{}\n'.format(fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
-        s += "{}\n".format(fielddisplay(self, 'effective_pressure_limit', 'fNeff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)'))
-        return s
-    # }}}
-    def setdefaultparameters(self):  # {{{
-        self.effective_pressure_limit = 0
-        return self
-    # }}}
-    def extrude(self, md):  # {{{
-        self.C = project3d(md, 'vector', self.C, 'type', 'node')
-        self.Cmax = project3d(md, 'vector', self.Cmax, 'type', 'node')
-        self.m = project3d(md, 'vector', self.m, 'type', 'element')
-        if self.coupling in [3, 4]:
-            self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-            return md
-        md = checkfield(md, 'fieldname', 'friction.C', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>',0.)
-        md = checkfield(md, 'fieldname', 'friction.Cmax', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>', 0.)
-        md = checkfield(md, 'fieldname', 'friction.m', 'NaN', 1, 'Inf', 1, '>', 0., 'size', [md.mesh.numberofelements, 1])
-        md = checkfield(md, 'fieldname', 'friction.effective_pressure_limit', 'numel', [1], '>=', 0)
-        md = checkfield(md, 'fieldname', 'friction.coupling', 'numel', [1], 'values', [0, 1, 2, 3, 4])
-        if self.coupling == 3:
-            md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 11, 'format', 'Integer')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'C', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'Cmax', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'm', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
-        if self.coupling == 3 or self.coupling == 4:
-            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-    # }}}
Index: sm/trunk/src/m/classes/frictionshakti.m
===================================================================
--- /issm/trunk/src/m/classes/frictionshakti.m	(revision 28275)
+++ 	(revision )
@@ -1,43 +1,0 @@
-%FRICTIONSHAKTI class definition
-%
-%   Usage:
-%      friction=frictionshakti();
-
-classdef frictionshakti
-	properties (SetAccess=public) 
-		coefficient = NaN;
-	end
-	methods
-		function self = frictionshakti(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(frictionshakti(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1);
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('Basal shear stress parameters: Sigma_b = coefficient^2 * Neff * u_b\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*(head-b))'));
-			fielddisplay(self,'coefficient','friction coefficient [SI]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.friction.law','data',8,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionshakti.py
===================================================================
--- /issm/trunk/src/m/classes/frictionshakti.py	(revision 28275)
+++ 	(revision )
@@ -1,54 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from structtoobj import structtoobj
-from WriteData import WriteData
-
-
-class frictionshakti(object):
-    """FRICTIONSHAKTI class definition
-
-    Usage:
-        friction = frictionshakti()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.coefficient = np.nan
-        
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            self = structtoobj(self, args[0])
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = 'Basal shear stress parameters: Sigma_b = coefficient^2 * Neff * u_b\n'
-        s += '(effective stress Neff = rho_ice * g * thickness + rho_water * g * (head - b))\n'
-        s += '{}\n'.format(fielddisplay(self, 'coefficient', 'friction coefficient [SI]'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-            return md
-        md = checkfield(md, 'fieldname', 'friction.coefficient', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 8, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-    # }}}
Index: sm/trunk/src/m/classes/frictiontemp.m
===================================================================
--- /issm/trunk/src/m/classes/frictiontemp.m	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-%FRICTIONTEMP class definition
-%
-%   Usage:
-%      frictiontemp=frictiontemp();
-
-classdef frictiontemp
-	properties (SetAccess=public) 
-		gamma       = 0;
-		coefficient = NaN;
-		p           = NaN;
-		q           = NaN;
-		coupling    = 0;
-		effective_pressure = NaN;
-		effective_pressure_limit = 0;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1);
-			self.p=project3d(md,'vector',self.p,'type','element');
-			self.q=project3d(md,'vector',self.q,'type','element');
-			switch self.coupling
-				case 0
-				case 1
-				case 2
-				case 3
-					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
-				case 4
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');
-			end
-		end % }}}
-		function self = frictiontemp(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(frictiontemp(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%By default gamma = 1;
-			self.gamma = 1;
-			self.coupling = 0;
-			self.effective_pressure_limit = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-
-			md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.gamma','NaN',2,'Inf',1,'numel',1,'>',0.);
-			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
-
-			%Check that temperature is provided
-			md = checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size','universal');
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('Basal shear stress parameters: tau_b = coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b * 1/f(T)\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p)'));
-			fielddisplay(self,'gamma','submelt sliding parameter f(T) = exp((T-Tpmp)/gamma)');
-			fielddisplay(self,'coefficient','frictiontemp coefficient [SI]');
-			fielddisplay(self,'p','p exponent');
-			fielddisplay(self,'q','q exponent');
-			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
-			fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)');
-			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'name','md.friction.law','data',4,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','gamma','format','Double');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','p','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-			switch self.coupling
-				case 0
-				case 1
-				case 2
-				case 3
-					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				case 4
-					error('not implemented yet');
-				otherwise
-					error('not supported yet');
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictiontsai.m
===================================================================
--- /issm/trunk/src/m/classes/frictiontsai.m	(revision 28275)
+++ 	(revision )
@@ -1,65 +1,0 @@
-%FRICTIONTSAI class definition
-%
-%   Usage:
-%      frictiontsai=frictiontsai();
-
-classdef frictiontsai
-	properties (SetAccess=public) 
-		C = NaN;
-		f = NaN;
-		m = NaN;
-		effective_pressure_limit = 0;
-	end
-	methods
-		function self = frictiontsai(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(frictiontsai(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			md.friction.C    = project3d(md,'vector',md.friction.C,'type','node','layer',1);
-			md.friction.f = project3d(md,'vector',md.friction.f,'type','node','layer',1);
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.effective_pressure_limit = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>',0.);
-			md = checkfield(md,'fieldname','friction.f','timeseries',1,'NaN',1,'Inf',1,'>',0.);
-			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'>',0.,'size',[md.mesh.numberofelements,1]);
-			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
-		end % }}}
-		function disp(self) % {{{
-			%See Brondex et al. 2017 
-			disp('Tsai sliding law parameters:');
-			disp('   Tsai''s sliding law reads:');
-			disp('     ');
-			disp('      tau_b = -  min(C |ub|^(m-1) , f N) u_b   ');
-			disp('                                                   ');
-			disp(' ');
-			fielddisplay(self,'C','friction coefficient [SI]');
-			fielddisplay(self,'f','Iken''s bound (typically between 0.17 and 0.84) [SI]');
-			fielddisplay(self,'m','m exponent (generally taken as m = 1/n = 1/3)');
-			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.friction.law','data',12,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','f','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionwaterlayer.m
===================================================================
--- /issm/trunk/src/m/classes/frictionwaterlayer.m	(revision 28275)
+++ 	(revision )
@@ -1,64 +1,0 @@
-%FRICTIONWATERLAYER class definition
-%
-%   Usage:
-%      frictionwaterlayer=frictionwaterlayer();
-
-classdef frictionwaterlayer
-	properties (SetAccess=public) 
-		coefficient = NaN;
-		f           = NaN;
-		p           = NaN;
-		q           = NaN;
-		water_layer = NaN;
-	end
-	methods
-		function self = frictionwaterlayer(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(frictionwaterlayer(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-
-			md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.f','size',[1 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','thermal.spctemperature','Inf',1,'timeseries',1,'>=',0.);
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1);
-			self.p=project3d(md,'vector',self.p,'type','element');
-			self.q=project3d(md,'vector',self.q,'type','element');
-			self.water_layer=project3d(md,'vector',self.water_layer,'type','node','layer',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('Basal shear stress parameters: tau_b = coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b * 1/f(T)\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*(bed+water_layer), r=q/p and s=1/p)'));
-			fielddisplay(self,'coefficient','frictiontemp coefficient [SI]');
-			fielddisplay(self,'f','f variable for effective pressure');
-			fielddisplay(self,'p','p exponent');
-			fielddisplay(self,'q','q exponent');
-			fielddisplay(self,'water_layer','water thickness at the base of the ice (m)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'name','md.friction.law','data',5,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','f','format','Double');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','p','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','water_layer','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionwaterlayer.py
===================================================================
--- /issm/trunk/src/m/classes/frictionwaterlayer.py	(revision 28275)
+++ 	(revision )
@@ -1,72 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from structtoobj import structtoobj
-from WriteData import WriteData
-
-
-class frictionwaterlayer(object):
-    """FRICTIONWATERLAYER class definition
-
-    Usage:
-        friction = frictionwaterlayer(md)
-    """
-
-    def __init__(self, *args):  # {{{
-        self.coefficient = np.nan
-        self.f = np.nan
-        self.p = np.nan
-        self.q = np.nan
-        self.water_layer = np.nan
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            self = structtoobj(self, args[0])
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = 'Basal shear stress parameters: tau_b = coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b * 1 / f(T)\n(effective stress Neff = rho_ice * g * thickness + rho_water * g * (bed + water_layer), r = q / p and s = 1 / p)\n'
-        s = "{}\n".format(fielddisplay(self, 'coefficient', 'frictiontemp coefficient [SI]'))
-        s = "{}\n".format(fielddisplay(self, 'f', 'f variable for effective pressure'))
-        s = "{}\n".format(fielddisplay(self, 'p', 'p exponent'))
-        s = "{}\n".format(fielddisplay(self, 'q', 'q exponent'))
-        s = "{}\n".format(fielddisplay(self, 'water_layer', 'water thickness at the base of the ice (m)'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        # Early return
-        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-            return
-        md = checkfield(md, 'fieldname', 'friction.coefficient', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.f', 'size', [1], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.q', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'friction.p', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'thermal.spctemperature', 'Inf', 1, 'timeseries', 1, '>=', 0.)
-        return md
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
-        self.p = project3d(md, 'vector', self.p, 'type', 'element')
-        self.q = project3d(md, 'vector', self.q, 'type', 'element')
-        self.water_layer = project3d(md, 'vector', self.water_layer, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 5, 'format', 'Integer')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'f', 'format', 'Double')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'p', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'water_layer', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-    # }}}
Index: sm/trunk/src/m/classes/frictionweertman.m
===================================================================
--- /issm/trunk/src/m/classes/frictionweertman.m	(revision 28275)
+++ 	(revision )
@@ -1,65 +1,0 @@
-%FRICTIONWEERTMAN class definition
-%
-%   Usage:
-%      frictionweertman=frictionweertman();
-
-classdef frictionweertman
-	properties (SetAccess=public) 
-		C = NaN;
-		m = NaN;
-		linearize  = 0;
-	end
-   methods (Static)
-      function self = loadobj(self) % {{{
-			disp('Warning: the Weertman friciton law is updated to Sigma_b = C^2*|u_b|^(1/m-1)*u_b, since 2020-08-10');
-		end
-	end %}}}
-	methods
-		function self = frictionweertman(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			disp('-------------- file: frictionweertman.m line: 27'); 
-			self.C=project3d(md,'vector',self.C,'type','node','layer',1);
-			self.m=project3d(md,'vector',self.m,'type','element');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.linearize = 0;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','friction.linearize','numel',[1],'values',[0:2]);
-		end % }}}
-		function disp(self) % {{{
-			disp('Weertman sliding law parameters:');
-			disp('   Weertman''s sliding law reads:');
-			disp('      v_b = C_w * Sigma_b^m');
-			disp('   In ISSM, this law is rewritten as:');
-			disp('      Sigma_b = C^2 * |u_b|^(1/m-1) * u_b');
-			disp('   where C_w=C^(-2m)');
-			disp(' ');
-			fielddisplay(self,'C','friction coefficient [SI]');
-			fielddisplay(self,'m','m exponent');
-			fielddisplay(self,'linearize','0: not linearized, 1: interpolated linearly, 2: constant per element (default is 0)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.friction.law','data',2,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','linearize','format','Integer');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frictionweertman.py
===================================================================
--- /issm/trunk/src/m/classes/frictionweertman.py	(revision 28275)
+++ 	(revision )
@@ -1,56 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class frictionweertman(object):
-    """
-    FRICTIONWEERTMAN class definition
-
-       Usage:
-          frictionweertman = frictionweertman()
-    """
-
-    def __init__(self):  # {{{
-        self.C = float('NaN')
-        self.m = float('NaN')
-        self.linearize = 0
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "Weertman sliding law parameters: Sigma_b = C^(- 1 / m) * |u_b|^(1 / m - 1) * u_b"
-
-        string = "%s\n%s" % (string, fielddisplay(self, "C", "friction coefficient [SI]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "m", "m exponent"))
-        string = "%s\n%s" % (string, fielddisplay(self, "linearize", "0: not linearized, 1: interpolated linearly, 2: constant per element (default is 0)"))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.linearize = 0
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-
-        #Early return
-        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-            return md
-
-        md = checkfield(md, 'fieldname', 'friction.C', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'friction.m', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'friction.linearize', 'numel', [1], 'values', [0, 1, 2])
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'C', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'm', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'linearize', 'format', 'Integer')
-    # }}}
Index: sm/trunk/src/m/classes/frictionweertmantemp.m
===================================================================
--- /issm/trunk/src/m/classes/frictionweertmantemp.m	(revision 28275)
+++ 	(revision )
@@ -1,56 +1,0 @@
-%FRICTIONWEERTMAN class definition
-%
-%   Usage:
-%      frictionweertmantemp=frictionweertmantemp();
-
-classdef frictionweertmantemp
-	properties (SetAccess=public) 
-		gamma = 0;
-		C = NaN;
-		m = NaN;
-	end
-   methods (Static)
-      function self = loadobj(self) % {{{
-			disp('Warning: the Weertman friciton law is updated to Sigma_b = C^2*|u_b|^(1/m-1)*u_b, since 2020-08-10');
-			disp(' and friction coefficient in the temprature dependent version is updated accordingly.');
-		end
-	end %}}}
-	methods
-		function self = frictionweertmantemp(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-		end % }}}
-		function disp(self) % {{{
-			disp('Weertman sliding law parameters:');
-			disp('      Sigma_b = C^2 * |u_b|^(1/m-1)  u_b * 1/f(T)');
-			disp(' ');
-			fielddisplay(self,'gamma','submelt sliding parameter f(T) = exp((T-Tpmp)/gamma)');
-			fielddisplay(self,'C','friction coefficient [SI]');
-			fielddisplay(self,'m','m exponent');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.friction.law','data',6,'format','Integer');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','gamma','format','Double');
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
-			
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frontalforcings.js
===================================================================
--- /issm/trunk/src/m/classes/frontalforcings.js	(revision 28275)
+++ 	(revision )
@@ -1,41 +1,0 @@
-//FRONTAL FORCINGS Class definition
-//
-//   Usage:
-//      frontalforcings=frontalforcings();
-
-function frontalforcings(){
-	//methods
-    this.classname = function(){ // {{{
-        return "frontalforcings";
-    } // }}}
-    this.extrude = function(md) {//{{{
-		this.meltingrate=project3d(md,'vector',this.meltingrate,'type','node');
-        return this;
-    }//}}}
-	this.setdefaultparameters = function(){// {{{
-		this.meltingrate   = NaN;
-	} // }}}
-    this.checkconsistency = function(md,solution,analyses) { //{{{
-		//Early return
-		if (!solution=='TransientSolution' || md.transient.ismovingfront == 0) return;
-
-		md = checkfield(md,'fieldname','frontalforcings.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-
-    } // }}}
-	this.disp = function(){ // {{{
-		console.log(sprintf('   Frontalforcings parameters:'));
-		fielddisplay(this,'meltingrate','melting rate at given location [m/a]');
-	} // }}}
-    this.marshall=function(md,prefix,fid) { //{{{
-		let yts=md.constants.yts;
-		WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',1,'format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-    }//}}}
-    this.fix=function() { //{{{
-    }//}}}
-	//properties 
-    // {{{
-	this.meltingrate   = NaN;
-	this.setdefaultparameters();
-    // }}}
-}
Index: sm/trunk/src/m/classes/frontalforcings.m
===================================================================
--- /issm/trunk/src/m/classes/frontalforcings.m	(revision 28275)
+++ 	(revision )
@@ -1,63 +1,0 @@
-%FRONTALFORCINGS class definition
-%
-%   Usage:
-%      frontalforcings=frontalforcings();
-
-classdef frontalforcings
-	properties (SetAccess=public) 
-		meltingrate   = NaN;
-		ablationrate   = NaN;
-	end
-	methods
-		function self = frontalforcings(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('frontalforcings');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
-			self.ablationrate=project3d(md,'vector',self.ablationrate,'type','node');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			meltingrate   = NaN;
-			ablationrate   = NaN;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','frontalforcings.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-			if ~isnan(md.frontalforcings.ablationrate)
-				md = checkfield(md,'fieldname','frontalforcings.ablationrate','Inf',1,'timeseries',1);
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Frontalforcings parameters:'));
-			fielddisplay(self,'meltingrate','melting rate at given location [m/a]');
-			fielddisplay(self,'ablationrate','frontal ablation rate at given location [m/a], it contains both calving and melting');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-			if ~isnan(md.frontalforcings.ablationrate)
-				WriteData(fid,prefix,'object',self,'fieldname','ablationrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frontalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/frontalforcings.py	(revision 28275)
+++ 	(revision )
@@ -1,67 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class frontalforcings(object):
-    """frontalforcings class definition
-
-    Usage:
-        frontalforcings = frontalforcings()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.meltingrate = np.nan
-        self.ablationrate = np.nan
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            # TODO: Replace the following with constructor
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Frontalforcings parameters:'
-        s += '{}\n'.format(fielddisplay(self, 'meltingrate', 'melting rate at given location [m/a]'))
-        s += '{}\n'.format(fielddisplay(self, 'ablationrate', 'frontal ablation rate at given location [m/a], it contains both calving and melting'))
-
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.meltingrate = project3d(md, 'vector', self.meltingrate, 'type', 'node')
-        self.ablationrate = project3d(md, 'vector', self.ablationrate, 'type', 'node')
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.meltingrate = np.nan
-        self.ablationrate = np.nan
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
-            return md
-
-        md = checkfield(md, 'fieldname', 'frontalforcings.meltingrate', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
-        if not np.isnan(md.frontalforcings.ablationrate):
-            md = checkfield(md, 'fieldname', 'frontalforcings.ablationrate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.frontalforcings.parameterization', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'meltingrate', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts, 'scale', 1. / yts)
-        if not np.isnan(md.frontalforcings.ablationrate):
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'ablationrate', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts, 'scale', 1. / yts)
-    # }}}
Index: sm/trunk/src/m/classes/frontalforcingsrignot.m
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignot.m	(revision 28275)
+++ 	(revision )
@@ -1,67 +1,0 @@
-%FRONTAL FORCINGS rignot class definition
-%
-%   Usage:
-%      frontalforcingsrignot=frontalforcingsrignot();
-
-classdef frontalforcingsrignot
-	properties (SetAccess=public) 
-		basin_id             = NaN;
-		num_basins           = 0;
-		subglacial_discharge = NaN;
-		thermalforcing       = NaN;
-	end
-	methods
-		function self = frontalforcingsrignot(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('frontalforcingsrignot');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		    % nothing for now
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			basin_id             = NaN;
-			num_basins           = 0;
-			subglacial_discharge = NaN;
-			thermalforcing       = NaN;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','frontalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','frontalforcings.basin_id','Inf',1,'>=',0,'<=',md.frontalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'NaN',1,'Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','frontalforcings.thermalforcing','NaN',1,'Inf',1,'timeseries',1);
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Frontalforcings parameters:'));
-			fielddisplay(self,'basin_id','basin ID for elements');
-			fielddisplay(self,'num_basins', 'number of basins');
-			fielddisplay(self,'subglacial_discharge','sum of subglacial discharge for each basin [m^3/d]');
-			fielddisplay(self,'thermalforcing','thermal forcing [∘C]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','basin_id','data',self.basin_id-1,'name','md.frontalforcings.basin_id','format','IntMat','mattype',2); %0-indexed
-			WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','thermalforcing','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frontalforcingsrignot.py
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignot.py	(revision 28275)
+++ 	(revision )
@@ -1,70 +1,0 @@
-# -*- coding: utf-8 -*-
-
-import numpy as np
-
-from checkfield import checkfield
-from WriteData import WriteData
-from fielddisplay import fielddisplay
-
-
-class frontalforcingsrignot(object):
-    """FRONTALFORCINGSRIGNOT class definition
-
-    Usage:
-        frontalforcingsrignot = frontalforcingsrignot()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.basin_id = np.nan
-        self.num_basins = 0
-        self.subglacial_discharge = np.nan
-        self.thermalforcing = np.nan
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            error('constructor not supported')
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Frontalforcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin ID for elements'))
-        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of basins'))
-        s += '{}\n'.format(fielddisplay(self, 'subglacial_discharge', 'sum of subglacial discharge for each basin [m/d]'))
-        s += '{}\n'.format(fielddisplay(self, 'thermalforcing', 'thermal forcing [∘C]'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.basin_id = np.nan
-        self.num_basins = 0
-        self.subglacial_discharge = np.nan
-        self.thermalforcing = np.nan
-
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
-            return md
-
-        md = checkfield(md, 'fieldname', 'frontalforcings.num_basins', 'numel', [1], 'NaN', 1, 'Inf', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'frontalforcings.basin_id', 'Inf', 1, '>=', 0, '<=', md.frontalforcings.num_basins, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'frontalforcings.subglacial_discharge', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'frontalforcings.thermalforcing', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.frontalforcings.parameterization', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'basin_id', 'data', self.basin_id - 1, 'name', 'md.frontalforcings.basin_id', 'format', 'IntMat', 'mattype', 2)  # 0-indexed
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'num_basins', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'subglacial_discharge', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thermalforcing', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-    # }}}
Index: sm/trunk/src/m/classes/frontalforcingsrignotarma.m
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignotarma.m	(revision 28275)
+++ 	(revision )
@@ -1,368 +1,0 @@
-%FRONTAL FORCINGS rignot arma class definition
-%
-%   Usage:
-%      frontalforcingsrignotarma=frontalforcingsrignotarma();
-
-classdef frontalforcingsrignotarma
-	properties (SetAccess=public) 
-		num_basins               = 0;
-		num_params               = 0;
-		num_breaks               = 0;
-		polynomialparams         = NaN;
-		datebreaks               = NaN;
-		ar_order                 = 0;
-		ma_order                 = 0;
-		arma_timestep            = 0;
-		arlag_coefs              = NaN;
-		malag_coefs              = NaN;
-		monthlyvals_intercepts   = NaN;
-		monthlyvals_trends       = NaN;
-		monthlyvals_numbreaks    = 0;
-		monthlyvals_datebreaks   = NaN;
-		basin_id                 = NaN;
-		subglacial_discharge     = NaN;
-		isdischargearma          = 0;
-		sd_ar_order              = 0;
-		sd_ma_order              = 0;
-		sd_arma_timestep         = 0;
-		sd_arlag_coefs           = NaN;
-		sd_malag_coefs           = NaN;
-		sd_monthlyfrac           = NaN;
-		sd_num_breaks            = 0;
-		sd_num_params            = 0;
-		sd_polynomialparams      = NaN;
-		sd_datebreaks            = NaN;
-	end
-	methods
-		function self = frontalforcingsrignotarma(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('frontalforcingsrignotarma');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-		    % nothing for now
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.basin_id             = NaN;
-			self.num_basins           = 0;
-			self.subglacial_discharge = NaN;
-			self.ar_order             = 0.0; %autoregression model of order 0
-			self.ma_order             = 0.0; %moving-average model of order 0
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-         %Early return
-         if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-         nbas  = md.frontalforcings.num_basins;
-         nprm  = md.frontalforcings.num_params;
-         nbrk  = md.frontalforcings.num_breaks;
-         nMbrk = md.frontalforcings.monthlyvals_numbreaks;
-         md = checkfield(md,'fieldname','frontalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
-         md = checkfield(md,'fieldname','frontalforcings.num_params','numel',1,'NaN',1,'Inf',1,'>',0);
-         md = checkfield(md,'fieldname','frontalforcings.num_breaks','numel',1,'NaN',1,'Inf',1,'>=',0);
-         md = checkfield(md,'fieldname','frontalforcings.basin_id','Inf',1,'>=',0,'<=',md.frontalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
-         if(nbas>1 && nbrk>=1 && nprm>1)
-            md = checkfield(md,'fieldname','frontalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1,nprm],'numel',nbas*(nbrk+1)*nprm);
-         elseif(nbas==1)
-            md = checkfield(md,'fieldname','frontalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nprm,nbrk+1],'numel',nbas*(nbrk+1)*nprm);
-         elseif(nbrk==0)
-            md = checkfield(md,'fieldname','frontalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nprm],'numel',nbas*(nbrk+1)*nprm);
-         elseif(nprm==1)
-            md = checkfield(md,'fieldname','frontalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1],'numel',nbas*(nbrk+1)*nprm);
-         end
-         md = checkfield(md,'fieldname','frontalforcings.ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-         md = checkfield(md,'fieldname','frontalforcings.ma_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-         md = checkfield(md,'fieldname','frontalforcings.arma_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %ARMA time step cannot be finer than ISSM timestep
-         md = checkfield(md,'fieldname','frontalforcings.arlag_coefs','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.ar_order]);
-         md = checkfield(md,'fieldname','frontalforcings.malag_coefs','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.ma_order]);
-         if(nbrk>0)
-            md = checkfield(md,'fieldname','frontalforcings.datebreaks','NaN',1,'Inf',1,'size',[nbas,nbrk]);
-         elseif(numel(md.frontalforcings.datebreaks)==0 || all(isnan(md.frontalforcings.datebreaks)))
-            ;
-         else
-            error('md.frontalforcings.num_breaks is 0 but md.frontalforcings.datebreaks is not empty');
-         end
-
-			%%% Check if some monthly forcings are provided %%%
-			if((numel(md.frontalforcings.monthlyvals_intercepts)>1 || ~isnan(md.frontalforcings.monthlyvals_intercepts)) || (numel(md.frontalforcings.monthlyvals_trends)>1 || ~isnan(md.frontalforcings.monthlyvals_trends)) || (numel(md.frontalforcings.monthlyvals_datebreaks)>1 || ~isnan(md.frontalforcings.monthlyvals_datebreaks)))
-				isMonthly = true;
-			else
-				isMonthly = false;
-			end
-			if(numel(md.frontalforcings.monthlyvals_trends)>1 || ~isnan(md.frontalforcings.monthlyvals_trends))
-				isMonthlyTrend = true;
-			else
-				isMonthlyTrend = false;
-			end
-			if(isMonthly)
-            md = checkfield(md,'fieldname','frontalforcings.monthlyvals_numbreaks','numel',1,'NaN',1,'Inf',1,'>=',0);
-			   if(nbas>1 && nMbrk>=1)
-               md = checkfield(md,'fieldname','frontalforcings.monthlyvals_intercepts','NaN',1,'Inf',1,'size',[nbas,12,nMbrk+1],'numel',nbas*(nMbrk+1)*12);
-			   	if(isMonthlyTrend)
-			   		md = checkfield(md,'fieldname','frontalforcings.monthlyvals_trends','NaN',1,'Inf',1,'size',[nbas,12,nMbrk+1],'numel',nbas*(nMbrk+1)*12);
-			   	end
-			   elseif(nbas==1)
-               md = checkfield(md,'fieldname','frontalforcings.monthlyvals_intercepts','NaN',1,'Inf',1,'size',[nMbrk+1,12],'numel',nbas*(nMbrk+1)*12);
-			   	if(isMonthlyTrend)
-			   		md = checkfield(md,'fieldname','frontalforcings.monthlyvals_trends','NaN',1,'Inf',1,'size',[nMbrk+1,12],'numel',nbas*(nMbrk+1)*12);
-               end
-			   elseif(nMbrk==0)
-               md = checkfield(md,'fieldname','frontalforcings.monthlyvals_intercepts','NaN',1,'Inf',1,'size',[nbas,12],'numel',nbas*(nMbrk+1)*12);
-			   	if(isMonthlyTrend)
-			   		md = checkfield(md,'fieldname','frontalforcings.monthlyvals_trends','NaN',1,'Inf',1,'size',[nbas,12],'numel',nbas*(nMbrk+1)*12);
-               end
-			   end
-			   if(nMbrk>0)
-               md = checkfield(md,'fieldname','frontalforcings.monthlyvals_datebreaks','NaN',1,'Inf',1,'size',[nbas,nMbrk]);
-            elseif(numel(md.frontalforcings.monthlyvals_datebreaks)==0 || all(isnan(md.frontalforcings.monthlyvals_datebreaks)))
-               ;
-            else
-               error('md.frontalforcings.monthlyvals_numbreaks is 0 but md.frontalforcings.monthlyvals_datebreaks is not empty');
-            end
-		   end
-
-			%%% Checking subglacial discharge %%%
-			md = checkfield(md,'fieldname','frontalforcings.isdischargearma','values',[0 1]);
-			if(~self.isdischargearma)
-				md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'NaN',1,'Inf',1,'timeseries',1);
-			else
-				sdnbrk  = md.frontalforcings.sd_num_breaks; 
-				sdnprm  = md.frontalforcings.sd_num_params;
-				md = checkfield(md,'fieldname','frontalforcings.sd_ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-				md = checkfield(md,'fieldname','frontalforcings.sd_ma_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-         	md = checkfield(md,'fieldname','frontalforcings.sd_arma_timestep','numel',1,'NaN',1,'Inf',1,'>=',max(1,md.timestepping.time_step)); %ARMA time step cannot be finer than ISSM timestep and annual timestep
-         	md = checkfield(md,'fieldname','frontalforcings.sd_arlag_coefs','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.sd_ar_order]);
-         	md = checkfield(md,'fieldname','frontalforcings.sd_malag_coefs','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.sd_ma_order]);
-         	md = checkfield(md,'fieldname','frontalforcings.sd_monthlyfrac','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,12]);
-				if(any(abs(sum(self.sd_monthlyfrac,2)-1)>1e-3))
-					error('the 12 entries for each basin of md.frontalforcings.sd_monthlyfrac should add up to 1');
-				end
-	         md = checkfield(md,'fieldname','frontalforcings.sd_num_params','numel',1,'NaN',1,'Inf',1,'>',0);
-		      md = checkfield(md,'fieldname','frontalforcings.sd_num_breaks','numel',1,'NaN',1,'Inf',1,'>=',0);
-	         if(nbas>1 && sdnbrk>=1 && sdnprm>1)
-	            md = checkfield(md,'fieldname','frontalforcings.sd_polynomialparams','NaN',1,'Inf',1,'size',[nbas,sdnbrk+1,sdnprm],'numel',nbas*(sdnbrk+1)*sdnprm);
-	         elseif(nbas==1)
-	            md = checkfield(md,'fieldname','frontalforcings.sd_polynomialparams','NaN',1,'Inf',1,'size',[sdnprm,sdnbrk+1],'numel',nbas*(sdnbrk+1)*sdnprm);
-	         elseif(sdnbrk==0)
-	            md = checkfield(md,'fieldname','frontalforcings.sd_polynomialparams','NaN',1,'Inf',1,'size',[nbas,sdnprm],'numel',nbas*(sdnbrk+1)*sdnprm);
-	         elseif(sdnprm==1)
-	            md = checkfield(md,'fieldname','frontalforcings.sd_polynomialparams','NaN',1,'Inf',1,'size',[nbas,sdnbrk+1],'numel',nbas*(sdnbrk+1)*sdnprm);
-	         end
-	         if(sdnbrk>0)
-	            md = checkfield(md,'fieldname','frontalforcings.sd_datebreaks','NaN',1,'Inf',1,'size',[nbas,sdnbrk]);
-	         elseif(numel(md.frontalforcings.sd_datebreaks)==0 || all(isnan(md.frontalforcings.sd_datebreaks)))
-	            ;
-	         else
-	            error('md.frontalforcings.sd_num_breaks is 0 but md.frontalforcings.sd_datebreaks is not empty');
-	         end
-
-  			end
-
-      end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Frontalforcings parameters:'));
-			fielddisplay(self,'num_basins','number of different basins');
-         fielddisplay(self,'basin_id','basin number assigned to each element [unitless]');
-			fielddisplay(self,'num_breaks','number of different breakpoints in the piecewise-polynomial (separating num_breaks+1 periods)');
-			fielddisplay(self,'num_params','number of different parameters in the piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)');
-         fielddisplay(self,'polynomialparams','coefficients for the polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders');
-			disp(sprintf('%51s  ex: polyparams=cat(3,intercepts,trendlinearcoefs,trendquadraticcoefs)',' '));
-         fielddisplay(self,'datebreaks','dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]');
-         fielddisplay(self,'ar_order','order of the autoregressive model [unitless]');
-         fielddisplay(self,'ma_order','order of the moving-average model [unitless]');
-         fielddisplay(self,'arma_timestep','time resolution of the autoregressive model [yr]');
-         fielddisplay(self,'arlag_coefs','basin-specific vectors of AR lag coefficients [unitless]');
-         fielddisplay(self,'malag_coefs','basin-specific vectors of MA lag coefficients [unitless]');
-         fielddisplay(self,'monthlyvals_intercepts','intercept of basin-specific piecewise-linear monthly values of TF added at corresponding month (default: all 0) [°C]');
-         fielddisplay(self,'monthlyvals_trends','trends in basin-specific piecewise-linear monthly values of TF added at corresponding month (default: all 0) [°C/yr]');
-         fielddisplay(self,'monthlyvals_numbreaks','number of breakpoints in the piecewise-linear functions of monthly values');
-         fielddisplay(self,'monthlyvals_datebreaks','dates at which the breakpoints in the piecewise-linear monthly values occur (1 row per basin)');
-         fielddisplay(self,'isdischargearma','whether an ARMA model is also used for the subglacial discharge (if 0: subglacial_discharge is used, if 1: sd_ parameters are used)');
-         fielddisplay(self,'subglacial_discharge','sum of subglacial discharge for each basin [m^3/d]');
-			disp(sprintf('%51s  if isdischargearma is 1, sd_variables are used (sd arma model variable: sum of subglacial discharge for each basin [m^3/d])',' '));
-         fielddisplay(self,'sd_ar_order','order of the subglacial discharge autoregressive model [unitless]');
-         fielddisplay(self,'sd_ma_order','order of the subglacial discharge moving-average model [unitless]');
-         fielddisplay(self,'sd_arma_timestep','time resolution of the subglacial discharge autoregressive model [yr]');
-         fielddisplay(self,'sd_arlag_coefs','basin-specific vectors of AR lag coefficients for subglacial discharge [unitless]');
-         fielddisplay(self,'sd_malag_coefs','basin-specific vectors of MA lag coefficients for subglacial discharge [unitless]');
-         fielddisplay(self,'sd_monthlyfrac','basin-specific vectors of 12 values with fraction of the annual discharge occuring every month [unitless]');
-			fielddisplay(self,'sd_num_params','number of different parameters in the subglacial discharge piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)');
-			fielddisplay(self,'sd_num_breaks','number of different breakpoints in the subglacial discharge piecewise-polynomial (separating sd_num_breaks+1 periods)');
-         fielddisplay(self,'sd_datebreaks','dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]');
-         fielddisplay(self,'sd_polynomialparams','coefficients for the sd_polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders');
- 		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-			%%% Deal with polynomial %%%
-			nbas  = md.frontalforcings.num_basins;
-			nprm  = md.frontalforcings.num_params;
-			nper  = md.frontalforcings.num_breaks+1;
-			% Scale the parameters %
-			polyparamsScaled   = md.frontalforcings.polynomialparams;
-			polyparams2dScaled = zeros(nbas,nper*nprm);
-			if(nprm>1)
-				% Case 3D %
-				if(nbas>1 && nper>1)
-					for(ii=[1:nprm])
-						polyparamsScaled(:,:,ii) = polyparamsScaled(:,:,ii)*((1/yts)^(ii-1));
-					end
-					% Fit in 2D array %
-					for(ii=[1:nprm])
-						jj = 1+(ii-1)*nper;
-						polyparams2dScaled(:,jj:jj+nper-1) = polyparamsScaled(:,:,ii);
-					end
-				% Case 2D and higher-order params at increasing row index %
-				elseif(nbas==1)
-					for(ii=[1:nprm])
-						polyparamsScaled(ii,:) = polyparamsScaled(ii,:)*((1/yts)^(ii-1));
-					end
-					% Fit in row array %
-					for(ii=[1:nprm])
-						jj = 1+(ii-1)*nper;
-						polyparams2dScaled(1,jj:jj+nper-1) = polyparamsScaled(ii,:);
-					end
-				% Case 2D and higher-order params at incrasing column index %
-				elseif(nper==1)
-					for(ii=[1:nprm])
-						polyparamsScaled(:,ii) = polyparamsScaled(:,ii)*((1/yts)^(ii-1));
-					end
-					% 2D array is already in correct format %
-					polyparams2dScaled = polyparamsScaled;
-				end
-			else
-				% 2D array is already in correct format and no need for scaling %
-				polyparams2dScaled = polyparamsScaled;
-			end
-			if(nper==1) %a single period (no break date)
-				dbreaks = zeros(nbas,1); %dummy
-			else
-				dbreaks = md.frontalforcings.datebreaks;
-			end
-
-			%%% Deal with monthly effects %%%
-			nMper = md.frontalforcings.monthlyvals_numbreaks+1;
-			if((numel(md.frontalforcings.monthlyvals_intercepts)<=1 && isnan(md.frontalforcings.monthlyvals_intercepts)))
-				interceptsM = zeros(nbas,12); %monthly intercepts not provided, set to 0
-				trendsM     = zeros(nbas,12); %set monthly trends also to 0
-			else
-				interceptsM3d = md.frontalforcings.monthlyvals_intercepts;
-				if((numel(md.frontalforcings.monthlyvals_trends)<=1 && isnan(md.frontalforcings.monthlyvals_trends)))
-					trendsM3d = 0*interceptsM3d; %monthly trends not provided, set to 0
-				else
-					trendsM3d = md.frontalforcings.monthlyvals_trends;
-				end
-			end
-			% Create 2D arrays from 3D arrays if needed %
-			if(nMper>1 && (numel(md.frontalforcings.monthlyvals_intercepts)>1 || ~isnan(md.frontalforcings.monthlyvals_intercepts)))
-				interceptsM = zeros(nbas,12*nMper);
-				trendsM     = zeros(nbas,12*nMper);
-				for(ii=[1:nMper])
-					jj = 1+(ii-1)*12;
-					interceptsM(:,jj:jj+12-1) = interceptsM3d(:,:,ii);
-					trendsM(:,jj:jj+12-1)     = trendsM3d(:,:,ii);
-				end
-			elseif(nMper==1 && (numel(md.frontalforcings.monthlyvals_intercepts)>1 || ~isnan(md.frontalforcings.monthlyvals_intercepts))) 
-				interceptsM = interceptsM3d;
-				trendsM     = trendsM3d;
-			end
-			if(nMper==1) %a single period (no break date)
-				dMbreaks = zeros(nbas,1); %dummy
-			else
-				dMbreaks = md.frontalforcings.monthlyvals_datebreaks;
-			end
-
-			%%% Deal with the subglacial discharge polynomial %%%
-			if(self.isdischargearma)
-				sdnprm  = md.frontalforcings.sd_num_params;
-				sdnper  = md.frontalforcings.sd_num_breaks+1;
-				sdpolyparamsScaled   = md.frontalforcings.sd_polynomialparams;
-	         sdpolyparams2dScaled = zeros(nbas,sdnper*sdnprm);
-	         if(sdnprm>1)
-	            % Case 3D %
-	            if(nbas>1 && sdnper>1)
-	               for(ii=[1:sdnprm])
-	                  sdpolyparamsScaled(:,:,ii) = sdpolyparamsScaled(:,:,ii)*((1/yts)^(ii-1));
-	               end
-	               % Fit in 2D array %
-	               for(ii=[1:sdnprm])
-	                  jj = 1+(ii-1)*sdnper;
-	                  sdpolyparams2dScaled(:,jj:jj+sdnper-1) = sdpolyparamsScaled(:,:,ii);
-	               end
-	            % Case 2D and higher-order params at increasing row index %
-	            elseif(nbas==1)
-	               for(ii=[1:sdnprm])
-	                  sdpolyparamsScaled(ii,:) = sdpolyparamsScaled(ii,:)*((1/yts)^(ii-1));
-	               end
-	               % Fit in row array %
-	               for(ii=[1:sdnprm])
-	                  jj = 1+(ii-1)*sdnper;
-	                  sdpolyparams2dScaled(1,jj:jj+sdnper-1) = sdpolyparamsScaled(ii,:);
-	               end
-	            % Case 2D and higher-order params at incrasing column index %
-	            elseif(sdnper==1)
-	               for(ii=[1:sdnprm])
-	                  sdpolyparamsScaled(:,ii) = sdpolyparamsScaled(:,ii)*((1/yts)^(ii-1));
-	               end
-	               % 2D array is already in correct format %
-						sdpolyparams2dScaled = sdpolyparamsScaled;
-	            end
-	         else
-					% 2D array is already in correct format and no need for scaling %
-               sdpolyparams2dScaled = sdpolyparamsScaled;
-	         end
-	         if(sdnper==1) %a single period (no break date)
-	            sd_dbreaks = zeros(nbas,1); %dummy
-	         else
-	            sd_dbreaks = md.frontalforcings.sd_datebreaks;
-	         end
-			end
-
-			WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',3,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','num_basins','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','num_breaks','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','num_params','format','Integer');
-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_order','format','Integer');
-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ma_order','format','Integer');
-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','arma_timestep','format','Double','scale',yts);
-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','basin_id','data',self.basin_id-1,'name','md.frontalforcings.basin_id','format','IntMat','mattype',2); %0-indexed
-         WriteData(fid,prefix,'data',polyparams2dScaled,'name','md.frontalforcings.polynomialparams','format','DoubleMat');
-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','arlag_coefs','format','DoubleMat','name','md.frontalforcings.arlag_coefs','yts',yts);
-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','malag_coefs','format','DoubleMat','name','md.frontalforcings.malag_coefs','yts',yts);
-         WriteData(fid,prefix,'data',dbreaks,'name','md.frontalforcings.datebreaks','format','DoubleMat','scale',yts);
-			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','monthlyvals_numbreaks','format','Integer');
-         WriteData(fid,prefix,'data',dMbreaks,'name','md.frontalforcings.monthlyvals_datebreaks','format','DoubleMat','scale',yts);
-         WriteData(fid,prefix,'data',interceptsM,'name','md.frontalforcings.monthlyvals_intercepts','format','DoubleMat');
-         WriteData(fid,prefix,'data',trendsM,'name','md.frontalforcings.monthlyvals_trends','format','DoubleMat','scale',1/yts);
-			WriteData(fid,prefix,'object',self,'fieldname','isdischargearma','format','Boolean');
-			if(self.isdischargearma==0)
-				WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			else
-				WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_num_breaks','format','Integer');
-				WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_num_params','format','Integer');
-	         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_ar_order','format','Integer');
-	         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_ma_order','format','Integer');
-	         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_arma_timestep','format','Double','scale',yts);
-				WriteData(fid,prefix,'data',sdpolyparams2dScaled,'name','md.frontalforcings.sd_polynomialparams','format','DoubleMat');
-	         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_arlag_coefs','format','DoubleMat','name','md.frontalforcings.sd_arlag_coefs','yts',yts);
-	         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_malag_coefs','format','DoubleMat','name','md.frontalforcings.sd_malag_coefs','yts',yts);
-	         WriteData(fid,prefix,'data',sd_dbreaks,'name','md.frontalforcings.sd_datebreaks','format','DoubleMat','scale',yts);
-	         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_monthlyfrac','format','DoubleMat','name','md.frontalforcings.sd_monthlyfrac','yts',yts);
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/frontalforcingsrignotarma.py
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignotarma.py	(revision 28275)
+++ 	(revision )
@@ -1,329 +1,0 @@
-# -*- coding: utf-8 -*-
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from MatlabFuncs import *
-from WriteData import WriteData
-
-
-class frontalforcingsrignotarma(object):
-    """FRONTALFORCINGSRIGNOTARMA class definition
-
-    Usage:
-        frontalforcingsrignotarma = frontalforcingsrignotarma()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.num_basins = 0
-        self.num_params = 0
-        self.num_breaks = 0
-        self.polynomialparams = np.nan
-        self.datebreaks       = np.nan
-        self.ar_order = 0
-        self.ma_order = 0
-        self.arma_timestep = 0
-        self.arlag_coefs = np.nan
-        self.malag_coefs = np.nan
-        self.monthlyvals_intercepts = np.nan
-        self.monthlyvals_trends = np.nan
-        self.monthlyvals_numbreaks = 0
-        self.monthlyvals_datebreaks = np.nan
-        self.basin_id = np.nan
-        self.subglacial_discharge = np.nan
-        self.isdischargearma = 0
-        self.sd_ar_order = 0
-        self.sd_ma_order = 0
-        self.sd_arma_timestep = 0
-        self.sd_arlag_coefs = np.nan
-        self.sd_malag_coefs = np.nan
-        self.sd_monthlyfrac = np.nan
-        self.sd_num_breaks  = 0
-        self.sd_num_params  = 0
-        self.sd_polynomialparams = np.nan
-        self.sd_datebreaks = np.nan
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            error('constructor not supported')
-
-    def __repr__(self):  # {{{
-        s = '   Frontalforcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of different basins [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin number assigned to each element [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'num_breaks', 'number of different breakpoints in the piecewise-polynomial (separating num_breaks+1 periods)'))
-        s += '{}\n'.format(fielddisplay(self, 'num_params', 'number of different parameters in the piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)'))
-        s += '{}\n'.format(fielddisplay(self, 'polynomialparams', 'coefficients for the polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders, ex: polyparams=cat(num_params,intercepts,trendlinearcoefs,trendquadraticcoefs)'))
-        s += '{}\n'.format(fielddisplay(self, 'datebreaks', 'dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'ar_order', 'order of the autoregressive model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'ma_order', 'order of the moving-average model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'arma_timestep', 'time resolution of the ARMA model [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'arlag_coefs', 'basin-specific vectors of AR lag coefficients [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'malag_coefs', 'basin-specific vectors of MA lag coefficients [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'isdischargearma','whether an ARMA model is also used for the subglacial discharge (if 0: subglacial_discharge is used, if 1: sd_ parameters are used)'))
-        s += '{}\n'.format(fielddisplay(self, 'subglacial_discharge', 'sum of subglacial discharge for each basin [m/d]'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_ar_order','order of the subglacial discharge autoregressive model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_ma_order','order of the subglacial discharge moving-average model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_arma_timestep','time resolution of the subglacial discharge autoregressive model [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_arlag_coefs','basin-specific vectors of AR lag coefficients for subglacial discharge [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_malag_coefs','basin-specific vectors of MA lag coefficients for subglacial discharge [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_monthlyfrac','basin-specific vectors of 12 values with fraction of the annual discharge occuring every month [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_num_params','number of different parameters in the subglacial discharge piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_num_breaks','number of different breakpoints in the subglacial discharge piecewise-polynomial (separating sd_num_breaks+1 periods)'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_datebreaks','dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'sd_polynomialparams','coefficients for the sd_polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.basin_id = np.nan
-        self.num_basins = 0
-        self.subglacial_discharge = np.nan
-        self.ar_order = 0.0  # Autoregression model of order 0
-        self.ma_order = 0.0  # Moving-average model of order 0
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if not (solution == 'TransientSolution') or not md.transient.ismovingfront:
-            return md
-
-        nbas  = md.frontalforcings.num_basins;
-        nprm  = md.frontalforcings.num_params;
-        nbrk  = md.frontalforcings.num_breaks;
-        nMbrk = md.frontalforcings.monthlyvals_numbreaks;
-        md = checkfield(md, 'fieldname', 'frontalforcings.num_basins', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'frontalforcings.num_params', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'frontalforcings.num_breaks', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'frontalforcings.basin_id', 'Inf', 1, '>=', 0, '<=', md.frontalforcings.num_basins, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'frontalforcings.subglacial_discharge', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        if len(np.shape(self.polynomialparams)) == 1:
-            self.polynomialparams = np.array([[self.polynomialparams]])
-        if(nbas>1 and nbrk>=1 and nprm>1):
-            md = checkfield(md,'fieldname','frontalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1,nprm],'numel',nbas*(nbrk+1)*nprm)
-        elif(nbas==1):
-            md = checkfield(md,'fieldname','frontalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nprm,nbrk+1],'numel',nbas*(nbrk+1)*nprm)
-        elif(nbrk==0):
-            md = checkfield(md,'fieldname','frontalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nprm],'numel',nbas*(nbrk+1)*nprm)
-        elif(nprm==1):
-            md = checkfield(md,'fieldname','frontalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk],'numel',nbas*(nbrk+1)*nprm)
-        md = checkfield(md, 'fieldname', 'frontalforcings.ar_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'frontalforcings.ma_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'frontalforcings.arma_timestep', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', md.timestepping.time_step) # ARMA time step cannot be finer than ISSM timestep
-        md = checkfield(md, 'fieldname', 'frontalforcings.arlag_coefs', 'NaN', 1, 'Inf', 1, 'size', [md.frontalforcings.num_basins, md.frontalforcings.ar_order])
-        md = checkfield(md, 'fieldname', 'frontalforcings.malag_coefs', 'NaN', 1, 'Inf', 1, 'size', [md.frontalforcings.num_basins, md.frontalforcings.ma_order])
-        if(nbrk>0):
-            md = checkfield(md, 'fieldname', 'frontalforcings.datebreaks', 'NaN', 1, 'Inf', 1, 'size', [nbas,nbrk])
-        elif(np.size(md.frontalforcings.datebreaks)==0 or np.all(np.isnan(md.frontalforcings.datebreaks))):
-            pass
-        else:
-            raise RuntimeError('md.frontalforcings.num_breaks is 0 but md.frontalforcings.datebreaks is not empty')
-        
-
-        ### Check if some monthly forcings are provided ###
-        if(np.all(np.isnan(md.frontalforcings.monthlyvals_intercepts))==False or np.all(np.isnan(md.frontalforcings.monthlyvals_trends))==False or np.all(np.isnan(md.frontalforcings.monthlyvals_datebreaks))==False):
-            isMonthly = True
-        else:
-            isMonthly = False
-        if(np.all(np.isnan(md.frontalforcings.monthlyvals_datebreaks))):
-            isMonthlyTrend = True
-        else:
-            isMonthlyTrend = False
-        if(isMonthly):
-            md = checkfield(md, 'fieldname', 'frontalforcings.monthlyvals_numbreaks', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-            if(nbas>1 and nMbrk>=1):
-                md = checkfield(md,'fieldname','frontalforcings.monthlyvals_intercepts','NaN',1,'Inf',1,'size',[nbas,12,nMbrk+1],'numel',nbas*(nMbrk+1)*12)
-                if(isMonthlyTrend):
-                    md = checkfield(md,'fieldname','frontalforcings.monthlyvals_trends','NaN',1,'Inf',1,'size',[nbas,12,nMbrk+1],'numel',nbas*(nMbrk+1)*12)
-            elif(nbas==1):
-               md = checkfield(md,'fieldname','frontalforcings.monthlyvals_intercepts','NaN',1,'Inf',1,'size',[nMbrk+1,12],'numel',nbas*(nMbrk+1)*12)
-               if(isMonthlyTrend):
-                  md = checkfield(md,'fieldname','frontalforcings.monthlyvals_trends','NaN',1,'Inf',1,'size',[nMbrk+1,12],'numel',nbas*(nMbrk+1)*12)
-            elif(nMbrk==0):
-               md = checkfield(md,'fieldname','frontalforcings.monthlyvals_intercepts','NaN',1,'Inf',1,'size',[nbas,12],'numel',nbas*(nMbrk+1)*12)
-               if(isMonthlyTrend):
-                  md = checkfield(md,'fieldname','frontalforcings.monthlyvals_trends','NaN',1,'Inf',1,'size',[nbas,12],'numel',nbas*(nMbrk+1)*12)
-        if(nMbrk>0):
-            md = checkfield(md, 'fieldname', 'frontalforcings.monthlyvals_datebreaks', 'NaN', 1, 'Inf', 1, 'size', [nbas,nMbrk])
-        elif(np.size(md.frontalforcings.monthlyvals_datebreaks)==0 or np.all(np.isnan(md.frontalforcings.monthlyvals_datebreaks))):
-            pass
-        else:
-            raise RuntimeError('md.frontalforcings.monthlyvals_numbreaks is 0 but md.frontalforcings.monthlyvals_datebreaks is not empty')
-
-        ### Chacking subglacial discharge ###
-        md = checkfield(md, 'fieldname', 'frontalforcings.isdischargearma', 'values', [0, 1])
-        if(self.isdischargearma==0):
-            md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'NaN',1,'Inf',1,'timeseries',1)
-        else:
-            sdnbrk  = md.frontalforcings.sd_num_breaks
-            sdnprm  = md.frontalforcings.sd_num_params
-            md = checkfield(md,'fieldname','frontalforcings.sd_ar_order','numel',1,'NaN',1,'Inf',1,'>=',0)
-            md = checkfield(md,'fieldname','frontalforcings.sd_ma_order','numel',1,'NaN',1,'Inf',1,'>=',0)
-            md = checkfield(md,'fieldname','frontalforcings.sd_arma_timestep','numel',1,'NaN',1,'Inf',1,'>=',max(1,md.timestepping.time_step)) #ARMA time step cannot be finer than ISSM timestep and annual timestep
-            md = checkfield(md,'fieldname','frontalforcings.sd_arlag_coefs','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.sd_ar_order])
-            md = checkfield(md,'fieldname','frontalforcings.sd_malag_coefs','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.sd_ma_order])
-            md = checkfield(md,'fieldname','frontalforcings.sd_monthlyfrac','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,12])
-            if(np.any(abs(np.sum(self.sd_monthlyfrac,axis=1)-1)>1e-3)):
-                raise RuntimeError('the 12 entries for each basin of md.frontalforcings.sd_monthlyfrac should add up to 1')
-            md = checkfield(md,'fieldname','frontalforcings.sd_num_params','numel',1,'NaN',1,'Inf',1,'>',0)
-            md = checkfield(md,'fieldname','frontalforcings.sd_num_breaks','numel',1,'NaN',1,'Inf',1,'>=',0)
-            if len(np.shape(self.sd_polynomialparams)) == 1:
-                self.sd_polynomialparams = np.array([[self.sd_polynomialparams]])
-            if(nbas>1 and sdnbrk>=1 and sdnprm>1):
-                md = checkfield(md,'fieldname','frontalforcings.sd_polynomialparams','NaN',1,'Inf',1,'size',[nbas,sdnbrk+1,sdnprm],'numel',nbas*(sdnbrk+1)*sdnprm)
-            elif(nbas==1):
-                md = checkfield(md,'fieldname','frontalforcings.sd_polynomialparams','NaN',1,'Inf',1,'size',[nprm,nbrk+1],'numel',nbas*(sdnbrk+1)*sdnprm)
-            elif(sdnbrk==0):
-                md = checkfield(md,'fieldname','frontalforcings.sd_polynomialparams','NaN',1,'Inf',1,'size',[nbas,sdnprm],'numel',nbas*(sdnbrk+1)*sdnprm)
-            elif(sdnprm==1):
-                md = checkfield(md,'fieldname','frontalforcings.sd_polynomialparams','NaN',1,'Inf',1,'size',[nbas,sdnbrk],'numel',nbas*(sdnbrk+1)*sdnprm)
-            if(sdnbrk>0):
-                md = checkfield(md, 'fieldname', 'frontalforcings.sd_datebreaks', 'NaN', 1, 'Inf', 1, 'size', [nbas,sdnbrk])
-            elif(np.size(md.frontalforcings.sd_datebreaks)==0 or np.all(np.isnan(md.frontalforcings.sd_datebreaks))):
-                pass
-            else:
-                raise RuntimeError('md.frontalforcings.sd_num_breaks is 0 but md.frontalforcings.sd_datebreaks is not empty')
-
-        return md
-    # }}}
-
-    def extrude(self, md):  # {{{
-        # Nothing for now
-        return self
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        nbas = md.frontalforcings.num_basins;
-        nprm = md.frontalforcings.num_params;
-        nper = md.frontalforcings.num_breaks+1;
-        # Scale the parameters #
-        polyparamsScaled   = np.copy(md.frontalforcings.polynomialparams)
-        polyparams2dScaled = np.zeros((nbas,nper*nprm))
-        if(nprm>1):
-            # Case 3D #
-            if(nbas>1 and nper>1):
-                for ii in range(nprm):
-                    polyparamsScaled[:,:,ii] = polyparamsScaled[:,:,ii]*(1/yts)**ii
-                # Fit in 2D array #
-                for ii in range(nprm):
-                    polyparams2dScaled[:,ii*nper:(ii+1)*nper] = 1*polyparamsScaled[:,:,ii]
-            # Case 2D and higher-order params at increasing row index #
-            elif(nbas==1):
-                for ii in range(nprm):
-                    polyparamsScaled[ii,:] = polyparamsScaled[ii,:]*(1/yts)**ii
-                # Fit in row array #
-                for ii in range(nprm):
-                    polyparams2dScaled[0,ii*nper:(ii+1)*nper] = 1*polyparamsScaled[ii,:]
-            # Case 2D and higher-order params at incrasing column index #
-            elif(nper==1):
-                for ii in range(nprm):
-                    polyparamsScaled[:,ii] = polyparamsScaled[:,ii]*(1/yts)**ii
-                # 2D array is already in correct format #
-                polyparams2dScaled = np.copy(polyparamsScaled)
-        else:
-            # 2D array is already in correct format and no need for scaling #
-            polyparams2dScaled = np.copy(polyparamsScaled)
-        if(nper==1):
-            dbreaks = np.zeros((nbas,1))
-        else:
-            dbreaks = np.copy(md.frontalforcings.datebreaks)
-
-        ### Deal with montly effects ###
-        nMper = md.frontalforcings.monthlyvals_numbreaks+1
-        if(np.any(np.isnan(md.frontalforcings.monthlyvals_intercepts))):
-            interceptsM = np.zeros((nbas,12)) #monthly intercepts not provided, set to 0
-            trendsM     = np.zeros((nbas,12)) #set monthly trends also to 0
-        else:
-            interceptsM3d = md.frontalforcings.monthlyvals_intercepts
-            if(np.any(np.isnan(md.frontalforcings.monthlyvals_trends))):
-                trendsM3d = 0*interceptsM3d #monthly trends not provided, set to 0
-            else:
-                trendsM3d = md.frontalforcings.monthlyvals_trends
-        # Create 2D arrays from 3D arrays if needed #
-        if(nMper>1 and np.all(np.isnan(md.frontalforcings.monthlyvals_intercepts))==False):
-            interceptsM = np.zeros((nbas,12*nMper)) 
-            trendsM     = np.zeros((nbas,12*nMper))
-            for ii in range(nMper):
-                interceptsM[:,ii*12:(ii+1)*12] = 1*interceptsM3d[:,:,ii]
-                trendsM[:,ii*12:(ii+1)*12] = 1*trendsM3d[:,:,ii]
-        elif(nMper==1 and np.all(np.isnan(md.frontalforcings.monthlyvals_intercepts))==False):
-            interceptsM = 1*interceptsM3d
-            trendsM     = 1*trendsM3d
-        if(nMper==1):
-            dMbreaks = np.zeros((nbas,1))
-        else:
-            dMbreaks = np.copy(md.frontalforcings.monthlyvals_datebreaks)
-
-        ### Deal with the subglacial discharge polynomial ###
-        if(self.isdischargearma):
-            sdnprm  = md.frontalforcings.sd_num_params
-            sdnper  = md.frontalforcings.sd_num_breaks+1
-            sdpolyparamsScaled   = np.copy(md.frontalforcings.sd_polynomialparams)
-            sdpolyparams2dScaled = np.zeros((nbas,sdnper*sdnprm))
-            if(sdnprm>1):
-                # Case 3D #
-                if(nbas>1 and sdnper>1):
-                    for ii in range(sdnprm):
-                        sdpolyparamsScaled[:,:,ii] = sdpolyparamsScaled[:,:,ii]*(1/yts)**ii
-                    # Fit in 2D array #
-                    for ii in range(sdnprm):
-                        sdpolyparams2dScaled[:,ii*sdnper:(ii+1)*sdnper] = 1*sdpolyparamsScaled[:,:,ii]
-                # Case 2D and higher-order params at increasing row index #
-                elif(nbas==1):
-                    for ii in range(sdnprm):
-                        sdpolyparamsScaled[ii,:] = sdpolyparamsScaled[ii,:]*(1/yts)**ii
-                    # Fit in row array #
-                    for ii in range(nprm):
-                        sdpolyparams2dScaled[0,ii*sdnper:(ii+1)*sdnper] = 1*sdpolyparamsScaled[ii,:]
-                # Case 2D and higher-order params at incrasing column index #
-                elif(sdnper==1):
-                    for ii in range(sdnprm):
-                        sdpolyparamsScaled[:,ii] = sdpolyparamsScaled[:,ii]*(1/yts)**ii
-                    # 2D array is already in correct format #
-                    sdpolyparams2dScaled = np.copy(sdpolyparamsScaled)
-            else:
-                # 2D array is already in correct format and no need for scaling #
-                sdpolyparams2dScaled = np.copy(sdpolyparamsScaled)
-            if(sdnper==1):
-                sd_dbreaks = np.zeros((nbas,1))
-            else:
-                sd_dbreaks = np.copy(md.frontalforcings.sd_datebreaks)
-
-
-
-
-        WriteData(fid, prefix, 'name', 'md.frontalforcings.parameterization', 'data', 3, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'num_basins', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'num_breaks', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'num_params', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'ar_order', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'ma_order', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'arma_timestep', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'basin_id', 'data', self.basin_id - 1, 'name', 'md.frontalforcings.basin_id', 'format', 'IntMat', 'mattype', 2)  # 0-indexed
-        WriteData(fid, prefix, 'data', polyparams2dScaled, 'name', 'md.frontalforcings.polynomialparams', 'format', 'DoubleMat')
-        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'arlag_coefs', 'format', 'DoubleMat', 'name', 'md.frontalforcings.arlag_coefs', 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'malag_coefs', 'format', 'DoubleMat', 'name', 'md.frontalforcings.malag_coefs', 'yts', yts)
-        WriteData(fid, prefix, 'data', dbreaks, 'name', 'md.frontalforcings.datebreaks', 'format', 'DoubleMat','scale',yts)
-        WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','monthlyvals_numbreaks','format','Integer')
-        WriteData(fid,prefix,'data',dMbreaks,'name','md.frontalforcings.monthlyvals_datebreaks','format','DoubleMat','scale',yts)
-        WriteData(fid,prefix,'data',interceptsM,'name','md.frontalforcings.monthlyvals_intercepts','format','DoubleMat')
-        WriteData(fid,prefix,'data',trendsM,'name','md.frontalforcings.monthlyvals_trends','format','DoubleMat','scale',1/yts)
-        WriteData(fid,prefix,'object',self,'fieldname','isdischargearma','format','Boolean')
-        if(self.isdischargearma==0):
-            WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'subglacial_discharge', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        else:
-            WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_num_breaks','format','Integer')
-            WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_num_params','format','Integer')
-            WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_ar_order','format','Integer')
-            WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_ma_order','format','Integer')
-            WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_arma_timestep','format','Double','scale',yts)
-            WriteData(fid,prefix,'data',sdpolyparams2dScaled,'name','md.frontalforcings.sd_polynomialparams','format','DoubleMat')
-            WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_arlag_coefs','format','DoubleMat','name','md.frontalforcings.sd_arlag_coefs','yts',yts)
-            WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_malag_coefs','format','DoubleMat','name','md.frontalforcings.sd_malag_coefs','yts',yts)
-            WriteData(fid,prefix,'data',sd_dbreaks,'name','md.frontalforcings.sd_datebreaks','format','DoubleMat','scale',yts)
-            WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','sd_monthlyfrac','format','DoubleMat','name','md.frontalforcings.sd_monthlyfrac','yts',yts)
-    # }}}
-
-
Index: sm/trunk/src/m/classes/geometry.js
===================================================================
--- /issm/trunk/src/m/classes/geometry.js	(revision 28275)
+++ 	(revision )
@@ -1,75 +1,0 @@
-//GEOMETRY class definition
-//
-//   Usage:
-//      geometry=geometry();
-
-function geometry(){
-	//methods 
-		this.setdefaultparameters = function (){ //{{{
-		}// }}}
-		this.disp = function () { //{{{
-			console.log(sprintf("   Geometry parameters:"));
-
-			fielddisplay(this,'surface','ice upper surface elevation [m]');
-			fielddisplay(this,'thickness','ice thickness [m]');
-			fielddisplay(this,'base','ice base elevation [m]');
-			fielddisplay(this,'bed','bed elevation [m]');
-		} //}}}
-        this.extrude = function(md) {//{{{
-            this.surface=project3d(md,'vector',this.surface,'type','node');
-            this.thickness=project3d(md,'vector',this.thickness,'type','node');
-            this.hydrostatic_ratio=project3d(md,'vector',this.hydrostatic_ratio,'type','node');
-            this.base=project3d(md,'vector',this.base,'type','node');
-            this.bed=project3d(md,'vector',this.bed,'type','node');
-            return this;
-        }//}}}
-		this.classname = function () { //{{{
-			return 'geometry';
-		} //}}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-
-			if ((solution=='TransientSolution' & md.trans.isgia) | (solution=='GiaSolution')){
-				checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1,'>=',0);
-			}
-			else{
-				checkfield(md,'fieldname','geometry.surface'  ,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				checkfield(md,'fieldname','geometry.base'      ,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				checkfield(md,'fieldname','geometry.thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1],'>',0);
-				for(var i=0;i<md.mesh.numberofvertices;i++){
-					if (Math.abs(md.geometry.thickness[i]-md.geometry.surface[i]+md.geometry.base[i])>Math.pow(10,9)){
-						checkmessage(md,'equality thickness=surface-base violated');
-						break;
-					}
-				}
-				if (solution=='TransientSolution' & md.trans.isgroundingline){
-					checkfield(md,'fieldname','geometry.bed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				}
-			}
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			let length_thickness=size(this.thickness,0);
-			if (length_thickness==md.mesh.numberofvertices || length_thickness==md.mesh.numberofvertices+1) {
-				WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			} else if (length_thickness==md.mesh.numberofelements || length_thickness==md.mesh.numberofelements+1) {
-				WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			} else {
-				error('geometry thickness time series should be a vertex or element time series');
-			}
-			WriteData(fid,prefix,'object',this,'fieldname','surface','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','base','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','bed','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1);
-		}//}}}
-		this.fix=function() { //{{{
-			this.hydrostatic_ratio=NullFix(this.hydrostatic_ratio,NaN);
-		}//}}}
-	//properties 
-	// {{{
-		this.surface           = NaN;
-		this.thickness         = NaN;
-		this.base              = NaN;
-		this.bed               = NaN;
-		this.hydrostatic_ratio = NaN;
-		this.setdefaultparameters();
-		//}}}
-}
Index: sm/trunk/src/m/classes/geometry.m
===================================================================
--- /issm/trunk/src/m/classes/geometry.m	(revision 28275)
+++ 	(revision )
@@ -1,111 +1,0 @@
-%GEOMETRY class definition
-%
-%   Usage:
-%      geometry=geometry();
-
-classdef geometry
-	properties (SetAccess=public) 
-		surface           = NaN;
-		thickness         = NaN;
-		base              = NaN;
-		bed               = NaN;
-		hydrostatic_ratio = NaN;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. Update old properties here
-
-			%2014 March 26th
-			if isstruct(self),
-				disp('WARNING: updating geometry');
-				disp('         md.geometry.bed        is now md.geometry.base');
-				disp('         md.geometry.bathymetry is now md.geometry.bed');
-				obj2 = self;
-				self = geometry();
-				self.surface    = obj2.surface;
-				self.thickness  = obj2.thickness;
-				self.base       = obj2.bed;
-				self.bed        = obj2.bathymetry;
-			end
-
-		end% }}}
-	end
-	methods
-		function self = geometry(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if strcmpi(solution,'LoveSolution'),
-				return; 
-			else
-				md = checkfield(md,'fieldname','geometry.surface' ,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','geometry.base'      ,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','geometry.thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>=',0);
-				if any(abs(self.thickness-self.surface+self.base)>10^-9),
-					md = checkmessage(md,['equality thickness=surface-base violated']);
-				end 
-				if strcmp(solution,'TransientSolution') & md.transient.isgroundingline,
-					md = checkfield(md,'fieldname','geometry.bed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-					if any(self.bed-self.base>10^-12),
-						md = checkmessage(md,['base<bed on one or more vertex']);
-					end 
-					pos = find(md.mask.ocean_levelset>0);
-					if any(abs(self.bed(pos)-self.base(pos))>10^-9),
-						md = checkmessage(md,['equality base=bed on grounded ice violated']);
-					end 
-					md = checkfield(md,'fieldname','geometry.bed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				end
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   geometry parameters:'));
-
-			fielddisplay(self,'surface','ice upper surface elevation [m]');
-			fielddisplay(self,'thickness','ice thickness [m]');
-			fielddisplay(self,'base','ice base elevation [m]');
-			fielddisplay(self,'bed','bed elevation [m]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			length_thickness=size(self.thickness,1);
-			if length_thickness==md.mesh.numberofvertices | length_thickness==md.mesh.numberofvertices+1,
-				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			elseif length_thickness==md.mesh.numberofelements | length_thickness==md.mesh.numberofelements+1,
-				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			else
-				error('geometry thickness time series should be a vertex or element time series');
-			end
-
-			WriteData(fid,prefix,'object',self,'fieldname','surface','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','base','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','bed','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1);
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.surface=project3d(md,'vector',self.surface,'type','node');
-			self.thickness=project3d(md,'vector',self.thickness,'type','node');
-			self.hydrostatic_ratio=project3d(md,'vector',self.hydrostatic_ratio,'type','node');
-			self.base=project3d(md,'vector',self.base,'type','node');
-			self.bed=project3d(md,'vector',self.bed,'type','node');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.geometry.surface'],self.surface);
-			writejs1Darray(fid,[modelname '.geometry.thickness'],self.thickness);
-			writejs1Darray(fid,[modelname '.geometry.base'],self.base);
-			writejs1Darray(fid,[modelname '.geometry.bed'],self.bed);
-			writejs1Darray(fid,[modelname '.geometry.hydrostatic_ratio'],self.hydrostatic_ratio);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/geometry.py
===================================================================
--- /issm/trunk/src/m/classes/geometry.py	(revision 28275)
+++ 	(revision )
@@ -1,88 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class geometry(object):
-    """GEOMETRY class definition
-
-    Usage:
-        geometry = geometry()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.surface = np.nan
-        self.thickness = np.nan
-        self.base = np.nan
-        self.bed = np.nan
-        self.hydrostatic_ratio = np.nan
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   geometry parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'surface', 'ice upper surface elevation [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'thickness', 'ice thickness [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'base', 'ice base elevation [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'bed', 'bed elevation [m]'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if solution == 'LoveSolution':
-            return md
-        else:
-            md = checkfield(md, 'fieldname', 'geometry.surface', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'geometry.base', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'geometry.thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>=', 0)
-            if any(abs(self.thickness - self.surface + self.base) > 1e-9):
-                md.checkmessage('equality thickness = surface-base violated')
-            if solution == 'TransientSolution' and md.transient.isgroundingline:
-                md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-                if np.any(self.bed - self.base > 1e-12):
-                    md.checkmessage('base < bed on one or more vertex')
-                pos = np.where(md.mask.ocean_levelset > 0)
-                if np.any(np.abs(self.bed[pos] - self.base[pos]) > 1e-9):
-                    md.checkmessage('equality base = bed on grounded ice violated')
-                md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        if isinstance(self.thickness, (list, np.ndarray)):
-            length_thickness = len(self.thickness)
-        else:
-            length_thickness = 1
-
-        if (length_thickness == md.mesh.numberofvertices) or (length_thickness == md.mesh.numberofvertices + 1):
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        elif (length_thickness == md.mesh.numberofelements) or (length_thickness == md.mesh.numberofelements + 1):
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
-        else:
-            raise RuntimeError('geometry thickness time series should be a vertex or element time series')
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'surface', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'base', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'bed', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hydrostatic_ratio', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.surface = project3d(md, 'vector', self.surface, 'type', 'node')
-        self.thickness = project3d(md, 'vector', self.thickness, 'type', 'node')
-        self.hydrostatic_ratio = project3d(md, 'vector', self.hydrostatic_ratio, 'type', 'node')
-        self.base = project3d(md, 'vector', self.base, 'type', 'node')
-        self.bed = project3d(md, 'vector', self.bed, 'type', 'node')
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/giacaron.m
===================================================================
--- /issm/trunk/src/m/classes/giacaron.m	(revision 28275)
+++ 	(revision )
@@ -1,301 +1,0 @@
-%GIA class definition for Caron model (Caron et al, Geophysical Journal International, 2017)
-%
-%	Usage:
-%		giacaron=giacaron();
-classdef giacaron
-	properties (SetAccess=public) 
-		
-		%Physical constants
-		gravitational_constant= NaN;
-		surface_radius = NaN;
-		core_mantle_boudary_radius= NaN;
-		inner_core_boudary_radius= NaN;
-		stress_norm= NaN;
-		gravity_norm= NaN;
-		radius_norm= NaN;
-		
-		%Numerical parameters
-		allow_layer_deletion=NaN;
-		verbose_mode=NaN;
-		
-		%GIA problem setup
-		forcing_type=NaN;
-		isincompressible=NaN;
-		benchmark_mode=NaN;
-		calculate_sea_level=NaN;
-		calculate_rotational_feedback=NaN;
-		subtract_present_day=NaN;
-		ntime=NaN;
-		nphi=NaN;
-
-		%Earth model
-		numlayers   = NaN;
-		radius      = NaN;
-		lame_mu     = NaN;
-		lame_lambda = NaN;
-		issolid     = NaN;
-		density     = NaN; 
-		viscosity   = NaN; 
-		isburger    = NaN; 
-		transient_viscosity    = NaN; 
-		transient_mu		   = NaN; 
-		
-		%Ice history
-		ice_model_identifier=NaN;
-		ice_model_ntime=NaN;
-		nice_sheets=NaN;
-		
-	end
-	methods
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = giacaron(varargin) % {{{
-			switch nargin
-				case 0
-				otherwise
-					options=pairoptions(varargin{:});
-					body=getfieldvalue(options,'body');
-					if strcmpi(body,'earth'), 
-						self.numlayers=getfieldvalue(options,'numlayers',5);
-						self.calculate_sea_level=true;
-						%[self.radius,self.lame_mu, self.lame_lambda, self.issolid, self.density, ...
-						%self.viscosity, self.isburger, self.transient_viscosity, self.transient_mu]=...
-						%modelinit(self.numlayers);
-					elseif strcmpi(body,'europa'), 
-						error('giacaron constructor error message: ''europa'' body not implemented yet!');
-					else 
-						error('giacaron constructor error message: body not implemented yet!');
-					end
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			 %Physical constants
-			gravitational_constant= 6.67259e-11;
-			stress_norm= 1e12;
-			gravity_norm= 10;
-			radius_norm= 1.0;
-
-			%Numerical parameters
-			allow_layer_deletion=true;
-			verbose_mode=false;
-
-			%GIA problem setup
-			forcing_type=11;
-			isincompressible=false;
-			benchmark_mode=false;
-			calculate_sea_level=false;
-			calculate_rotational_feedback=true;
-			subtract_present_day=true;
-
-			%Earth model
-			isburger    = false(self.numlayers,1); 
-			
-			%Ice history
-			nice_sheets=1;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('GiaAnalysis',analyses), return; end
-			% Physical constants			
-			md = checkfield(md,'fieldname','gia.gravitational_constant','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','gia.surface_radius','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','gia.core_mantle_boundary_radius','Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','gia.inner_core_boundary_radius','Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','gia.radius_norm','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','gia.stress_norm','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','gia.gravity_norm','NaN',1,'Inf',1,'numel',1,'>',0);
-
-			%Numerical parameters
-			md = checkfield(md,'fieldname','gia.allow_layer_deletion','values',[0 1]);
-			md = checkfield(md,'fieldname','gia.verbose_mode','values',[0 1]);
-
-			%GIA problem setup
-			md = checkfield(md,'fieldname','gia.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
-			md = checkfield(md,'fieldname','gia.isincompressible','values',[0 1]);
-			md = checkfield(md,'fieldname','gia.benchmark_mode','values',[0 1]);
-			md = checkfield(md,'fieldname','gia.calculate_sea_level','values',[0 1]);
-			md = checkfield(md,'fieldname','gia.calculate_rotational_feedback','values',[0 1]);
-			md = checkfield(md,'fieldname','gia.subtract_present_day','values',[0 1]);
-			md = checkfield(md,'fieldname','gia.ntime','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','gia.ntheta','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','gia.nphi','numel',1,'values', self.ntheta*2);
-		
-			%Ice history
-			md = checkfield(md,'fieldname','gia.ice_model_identifier', 'stringrow', 1, 'size', [1 3]);
-			md = checkfield(md,'fieldname','gia.ice_model_ntime', 'NaN', 1, 'Inf', 1, 'numel', 1);
-			md = checkfield(md,'fieldname','gia.nice_sheets', 'NaN', 1, 'Inf', 1, '>', 0, 'numel', 1);
-			
-			%Earth parameters
-			md = checkfield(md,'fieldname','gia.numlayers','NaN',1,'Inf',1,'>',0,'numel',1);
-			md = checkfield(md,'fieldname','gia.radius','NaN',1,'Inf',1,'size',[md.gia.numlayers 1],'>',0);
-			md = checkfield(md,'fieldname','gia.lame_mu','NaN',1,'Inf',1,'size',[md.gia.numlayers 1],'>',0);
-			md = checkfield(md,'fieldname','gia.lame_lambda','NaN',1,'Inf',1,'size',[md.gia.numlayers 1],'>',0);
-			md = checkfield(md,'fieldname','gia.issolid','NaN',1,'Inf',1,'size',[md.gia.numlayers 1],'>',0,'<',2);
-			md = checkfield(md,'fieldname','gia.density','NaN',1,'Inf',1,'size',[md.gia.numlayers 1],'>',0);
-			md = checkfield(md,'fieldname','gia.viscosity','NaN',1,'Inf',1,'size',[md.gia.numlayers 1],'>',0);
-			md = checkfield(md,'fieldname','gia.isburger','NaN',1,'Inf',1,'size',[md.gia.numlayers 1],'>',0,'<',2);
-			md = checkfield(md,'fieldname','gia.transient_viscosity','NaN',1,'Inf',1,'size',[md.gia.numlayers 1],'>',0);
-			md = checkfield(md,'fieldname','gia.transient_mu','NaN',1,'Inf',1,'size',[md.gia.numlayers 1],'>',0);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   giacaron parameters:'));
-			
-			% Physical constants			
-			fielddisplay(self,'gravitational_constant', 'Newton''s Gravitational constant, should be equal to approximately 6.67e-11 [m^3.kg^-1.s^-2]');
-			fielddisplay(self,'surface_radius','NaN', 'Planet outer surface radius [m]');
-			fielddisplay(self,'core_mantle_boundary_radius', 'Planet core mantle boundary radius (optional) [m]'); 
-			fielddisplay(self,'inner_core_boundary_radius','Planet inner core boundary radius (optional) [m]'); 
-			fielddisplay(self,'radius_norm', 'length normalization constant [m] (default 1.0)');
-			fielddisplay(self,'stress_norm', 'stress normalization constant [Pa] (default 1e12)');
-			fielddisplay(self,'gravity_norm', 'gravity normalization constant [m.s^-2] (default 10)');
-
-			%Numerical parameters
-			fielddisplay(self,'allow_layer_deletion', 'boolean allowing the migration of the starting integration radius while increasing the spherical harmonic degree  (default true)');
-			fielddisplay(self,'verbose_mode', 'boolean allowing the program to write more details on terminal (default false)')
-
-			%GIA problem setup
-			fielddisplay(self,'forcing_type','integer indicating the nature and depth of the forcing for the Love number calculation: 1: ICB -- Volumic Potential,  2:  ICB -- Pressure,	3:  ICB -- Loading,    4:  ICB -- Tangential traction, 	5:  CMB -- Volumic Potential,  6:  CMB -- Pressure	7:  CMB -- Loading,  8:  CMB -- Tangential traction,	9: SURF -- Volumic Potential, 10: SURF -- Pressure, 11: SURF -- Loading,  12: SURF -- Tangential traction (default 11)'); 
-			fielddisplay(self,'isincompressible', 'boolean approximating the mantle rheology to an incompressible body, sets Lame_lambda to 5e14 Pa (default false)');
-			fielddisplay(self,'benchmark_mode', 'boolean to enter benchmark mode, writes a lot of outputs from the midst of the calculation (default false)');
-			fielddisplay(self,'calculate_sea_level', 'boolean allowing the sea level equation solving (default false)');
-			fielddisplay(self,'calculate_rotational_feedback', 'boolean allowing the calculation of rotational feedback (default true)');
-			fielddisplay(self,'subtract_present_day', 'boolean, subtracts the present day signal so the calculation is expressed as the difference with the present-day topography, geoid and sea level (default true)');
-			fielddisplay(self,'ntime', 'number of time steps')
-			fielddisplay(self,'ntheta', 'size of grid in latitude') 
-			fielddisplay(self,'nphi', 'size of grid in longitude (should always be ntheta*2)');
-
-			%Ice history
-			fielddisplay(self,'ice_model_identifier', 'string identifier for the ice model (3 characters)')
-			fielddisplay(self,'ice_model_ntime', 'number of time steps in the original ice model, is used to interpolate the model on the desired time')
-			fielddisplay(self,'nice_sheets', 'number of ice regions to be scaled independently')
-
-			%Earth parameters
-			fielddisplay(self,'numlayers','number of layers (default 5)');
-			fielddisplay(self,'radius','array describing the radius for each interface (numlayers+1) [m]');
-			fielddisplay(self,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]');
-			fielddisplay(self,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]');
-			fielddisplay(self,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
-			fielddisplay(self,'density','array describing each layer''s density (numlayers) [kg/m^3]');
-			fielddisplay(self,'viscosity','array describing each layer''s viscosity (numlayers) [Pa.s]');
-			fielddisplay(self,'isburger','array describing whether we adopt a MaxWell (0) or Burgers (1) rheology (default 0)');
-			fielddisplay(self,'transient_viscosity','array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
-			fielddisplay(self,'transient_mu','array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.gia.model','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',10^3); %from km to m
-			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','format','Integer');
-
-			%Physical constants
-			WriteData(fid,prefix,'object',self,'fieldname','gravitational_constant','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','surface_radius ','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','core_mantle_boudary_radius','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','inner_core_boudary_radius','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','stress_norm','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','gravity_norm','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','radius_norm','format','Double');
-
-			%Numerical parameters
-			WriteData(fid,prefix,'object',self,'fieldname','allow_layer_deletion','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','verbose_mode','format','Boolean');
-		
-			%GIA problem setup
-			WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','isincompressible','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','benchmark_mode','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','calculate_sea_level','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','calculate_rotational_feedback','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','subtract_present_day','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','ntime','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','ntheta','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','nphi','format','Integer');
-
-			%Earth model
-			WriteData(fid,prefix,'object',self,'fieldname','numlayers','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','radius','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','lame_mu','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','lame_lambda ','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','issolid','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','density','format','DoubleMat','mattype',1); 
-			WriteData(fid,prefix,'object',self,'fieldname','viscosity','format','DoubleMat','mattype',1); 
-			WriteData(fid,prefix,'object',self,'fieldname','isburger','format','BooleanMat','mattype',1); 
-			WriteData(fid,prefix,'object',self,'fieldname','transient_viscosity','format','DoubleMat','mattype',1); 
-			WriteData(fid,prefix,'object',self,'fieldname','transient_mu','format','DoubleMat','mattype',1); 
-		
-			%Inversion
-%			dataset_type_dentifier= NaN
-			WriteData(fid,prefix,'object',self,'fieldname','ndata_std','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','ndata_minimum_val ','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','ndata_maximum_val ','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','ndata_total','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','n_forward_models','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','ice_coefficients_solving ','format','String');
-			WriteData(fid,prefix,'object',self,'fieldname','ninverse_parameters','format','Integer');
-		
-			%Ice history
-			WriteData(fid,prefix,'object',self,'fieldname','ice_model_identifier','format','String');
-			WriteData(fid,prefix,'object',self,'fieldname','ice_model_ntime','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','nice_sheets','format','Integer');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			%Physical constants
-			writejsdouble(fid,[modelname '.gia.gravitational_constant'],self.gravitational_constant);
-			writejsdouble(fid,[modelname '.gia.surface_radius'],self.surface_radius);
-			writejsdouble(fid,[modelname '.gia.core_mantle_boudary_radius'],self.core_mantle_boudary_radius);
-			writejsdouble(fid,[modelname '.gia.inner_core_boudary_radius'],self.inner_core_boudary_radius);
-			writejsdouble(fid,[modelname '.gia.stress_norm'],self.stress_norm);
-			writejsdouble(fid,[modelname '.gia.gravity_norm'],self.gravity_norm);
-			writejsdouble(fid,[modelname '.gia.radius_norm'],self.radius_norm);
-		
-			%Numerical parameters
-			writejsdouble(fid,[modelname '.gia.allow_layer_deletion'],self.allow_layer_deletion);
-			writejsdouble(fid,[modelname '.gia.verbose_mode'],self.verbose_mode);
-		
-			%GIA problem setup
-			writejsdouble(fid,[modelname '.gia.forcing_type'],self.forcing_type);
-			writejsdouble(fid,[modelname '.gia.isincompressible'],self.isincompressible);
-			writejsdouble(fid,[modelname '.gia.benchmark_mode'],self.benchmark_mode);
-			writejsdouble(fid,[modelname '.gia.calculate_sea_level'],self.calculate_sea_level);
-			writejsdouble(fid,[modelname '.gia.calculate_rotational_feedback'],self.calculate_rotational_feedback);
-			writejsdouble(fid,[modelname '.gia.subtract_present_day'],self.subtract_present_day);
-			writejsdouble(fid,[modelname '.gia.ntime'],self.ntime);
-			writejsdouble(fid,[modelname '.gia.ntheta'],self.ntheta);
-			writejsdouble(fid,[modelname '.gia.nphi'],self.nphi);
-
-			%Earth model
-			writejsdouble(fid,[modelname '.gia.numlayers'],self.numlayers);
-			writejsdouble(fid,[modelname '.gia.radius'],self.radius);
-			writejsdouble(fid,[modelname '.gia.lame_mu'],self.lame_mu);
-			writejsdouble(fid,[modelname '.gia.lame_lambda'],self.lame_lambda);
-			writejsdouble(fid,[modelname '.gia.issolid'],self.issolid);
-			writejsdouble(fid,[modelname '.gia.density'],self.density); 
-			writejsdouble(fid,[modelname '.gia.viscosity'],self.viscosity); 
-			writejsdouble(fid,[modelname '.gia.isburger'],self.isburger); 
-			writejsdouble(fid,[modelname '.gia.transient_viscosity'],self.transient_viscosity); 
-			writejsdouble(fid,[modelname '.gia.transient_mu'],self.transient_mu); 
-		
-		%Inversion
-%		 dataset_type_dentifier= NaN
-%			writejsdouble(fid,[modelname '.gia.ndata_std'],self.ndata_std);
-%			writejsdouble(fid,[modelname '.gia.ndata_minimum_val'],self.ndata_minimum_val);
-%			writejsdouble(fid,[modelname '.gia.ndata_maximum_val'],self.ndata_maximum_val);
-%			writejsdouble(fid,[modelname '.gia.ndata_total'],self.ndata_total);
-%			writejsdouble(fid,[modelname '.gia.n_forward_models'],self.n_forward_models);
-%			writejsdouble(fid,[modelname '.gia.ice_coefficients_solving'],self.ice_coefficients_solving);
-%			writejsdouble(fid,[modelname '.gia.ninverse_parameters'],self.ninverse_parameters);
-		
-			%Ice history
-			writejsdouble(fid,[modelname '.gia.ice_model_identifier'],self.ice_model_identifier);
-			writejsdouble(fid,[modelname '.gia.ice_model_ntime'],self.ice_model_ntime);
-			writejsdouble(fid,[modelname '.gia.nice_sheets'],self.nice_sheets);
-			writejsdouble(fid,[modelname '.gia.mantle_viscosity'],self.mantle_viscosity);
-			writejsdouble(fid,[modelname '.gia.lithosphere_thickness'],self.lithosphere_thickness);
-			writejsdouble(fid,[modelname '.gia.cross_section_shape'],self.cross_section_shape);
-			
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/giacaron.py
===================================================================
--- /issm/trunk/src/m/classes/giacaron.py	(revision 28275)
+++ 	(revision )
@@ -1,53 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class giacaron(object):
-    """
-    GIA class definition for Caron model (Caron et al, Geophysical Journal 
-    International, 2017)
-
-       Usage:
-          giacaron = giacaron()
-    """
-
-    def __init__(self, *args):  # {{{
-        #Physical constants
-        self.gravitational_constant         = np.nan
-        self.surface_radius                 = np.nan
-        self.core_mantle_boudary_radius     = np.nan
-        self.inner_core_boudary_radius      = np.nan
-        self.stress_norm                    = np.nan
-        self.gravity_norm                   = np.nan
-        self.radius_norm                    = np.nan
-
-        #Numerical parameters
-        self.allow_layer_deletion           = np.nan
-        self.verbose_mode                   = np.nan
-
-        #GIA problem setup
-        self.forcing_type                   = np.nan
-        self.isincompressible               = np.nan
-        self.benchmark_mode                 = np.nan
-        self.calculate_sea_level            = np.nan
-        self.calculate_rotational_feedback  = np.nan
-        self.subtract_present_day           = np.nan
-        self.ntime                          = np.nan
-        self.nphi                           = np.nan
-
-        #Earth model
-        
-
-
-
-        nargin = len(args)
-
-        if nargin == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
Index: sm/trunk/src/m/classes/groundingline.js
===================================================================
--- /issm/trunk/src/m/classes/groundingline.js	(revision 28275)
+++ 	(revision )
@@ -1,61 +1,0 @@
-//GROUNDINGLINE class definition
-//
-//   Usage:
-//      groundingline=new groundingline();
-
-function groundingline (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		//Type of migration
-		this.migration				= 'SubelementMigration';
-		this.friction_interpolation	= 'SubelementFriction1';
-		this.melt_interpolation		= 'NoMeltOnPartiallyFloating';
-
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   grounding line migration parameters:'));
-		fielddisplay(this,'migration',"type of grounding line migration: 'SubelementMigration','SoftMigration','AggressiveMigration','Contact' or 'None'");
-		fielddisplay(this,'friction_interpolation',"type of friction interpolation forpartially floating elements: 'NoFrictionOnPartiallyFloating','SubelementFriction1' or 'SubelementFriction2'");
-		fielddisplay(this,'melt_interpolation',"type of melt interpolation forpartially floating elements: 'NoMeltOnPartiallyFloating','FullMeltOnPartiallyFloating','SubelementMelt1' or 'SubelementMelt2'");
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "groundingline";
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) {// {{{
-
-			checkfield(md,'fieldname','groundingline.migration','values',['None', 'AggressiveMigration', 'SoftMigration', 'Contact', 'GroundingOnly']);
-			checkfield(md,'fieldname','groundingline.friction_interpolation','values',['NoFrictionOnPartiallyFloating', 'SubelementFriction1', 'SubelementFriction2']);
-			checkfield(md,'fieldname','groundingline.melt_interpolation','values',['NoMeltOnPartiallyFloating', 'SubelementMelt1', 'SubelementMelt2', 'FullMeltOnPartiallyFloating']);
-
-			if (this.migration !='None'){
-				if (isNaN(md.geometry.bed)){
-					md.checkmessage('requesting grounding line migration, but bathymetry is absent!');
-				}
-				for (var i=0;i<md.mesh.numberofvertices;i++){
-					if(md.mask.groundedice_levelset[i]>0){
-						md.checkmessage('base not equal to bed on grounded ice!');
-						break;
-					}
-					if(md.geometry.bed[i] - md.geometry.base[i] > Math.pow(10,-9)){
-						checkmessage(md,'bed superior to base on floating ice!');
-						break;
-					}
-				}
-			}
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'data',this.migration,'name','md.groundingline.migration','format','String');
-			WriteData(fid,prefix,'data',this.friction_interpolation,'name','md.groundingline.friction_interpolation','format','String');
-			WriteData(fid,prefix,'data',this.melt_interpolation,'name','md.groundingline.melt_interpolation','format','String');
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-	this.migration              = '';
-	this.friction_interpolation = '';
-	this.melt_interpolation     = '';
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/groundingline.m
===================================================================
--- /issm/trunk/src/m/classes/groundingline.m	(revision 28275)
+++ 	(revision )
@@ -1,90 +1,0 @@
-%GROUNDINGLINE class definition
-%
-%   Usage:
-%      groundingline=groundingline();
-
-classdef groundingline
-	properties (SetAccess=public) 
-		migration              = '';
-		friction_interpolation = '';
-		melt_interpolation     = '';
-		requested_outputs      = {};
-	end
-	methods
-		function self = groundingline(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Type of migration
-			self.migration             = 'SubelementMigration';
-			self.friction_interpolation= 'SubelementFriction1';
-			self.melt_interpolation    = 'NoMeltOnPartiallyFloating';
-			%default output
-         self.requested_outputs     = {'default'};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','groundingline.migration','values',{'None' 'SubelementMigration' 'AggressiveMigration' 'SoftMigration' 'Contact' 'GroundingOnly'});
-			md = checkfield(md,'fieldname','groundingline.friction_interpolation','values',{'NoFrictionOnPartiallyFloating' 'SubelementFriction1' 'SubelementFriction2'});
-			md = checkfield(md,'fieldname','groundingline.melt_interpolation','values',{'NoMeltOnPartiallyFloating' 'SubelementMelt1' 'SubelementMelt2' 'FullMeltOnPartiallyFloating'});
-			md = checkfield(md,'fieldname','groundingline.requested_outputs','stringrow',1);
-
-			if ~strcmp(self.migration,'None') & strcmp(solution,'TransientSolution') & md.transient.isgroundingline==1,
-				if isnan(md.geometry.bed),
-					md = checkmessage(md,['requesting grounding line migration, but bathymetry is absent!']);
-				end
-				pos=find(md.mask.ocean_levelset>0. & md.mask.ice_levelset<=0);
-				if any(abs(md.geometry.base(pos)-md.geometry.bed(pos))>10^-10),
-					md = checkmessage(md,['base not equal to bed on grounded ice!']);
-				end
-				pos=find(md.mask.ocean_levelset<=0. & md.mask.ice_levelset<=0);
-				if any(md.geometry.bed(pos) - md.geometry.base(pos) > 10^-9),
-					md = checkmessage(md,['bed superior to base on floating ice!']);
-				end
-			end
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-      
-			list = {'Surface','Base','MaskOceanLevelset'};
-         
-      end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   grounding line migration parameters:'));
-			fielddisplay(self,'migration','type of grounding line migration: ''SoftMigration'',''SubelementMigration'',''AggressiveMigration'',''Contact'' or ''None''');
-			fielddisplay(self,'friction_interpolation','type of friction interpolation for partially floating elements: ''NoFrictionOnPartiallyFloating'',''SubelementFriction1'', or ''SubelementFriction2''');
-			fielddisplay(self,'melt_interpolation','type of melt interpolation for partially floating elements: ''NoMeltOnPartiallyFloating'',''SubelementMelt1'',''SubelementMelt2'', or ''FullMeltOnPartiallyFloating''');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'data',self.migration,'name','md.groundingline.migration','format','String');
-			WriteData(fid,prefix,'data',self.friction_interpolation,'name','md.groundingline.friction_interpolation','format','String');
-			WriteData(fid,prefix,'data',self.melt_interpolation,'name','md.groundingline.melt_interpolation','format','String');
-			
-			%process requested outputs
-         outputs = self.requested_outputs;
-         pos  = find(ismember(outputs,'default'));
-         if ~isempty(pos),
-            outputs(pos) = [];                         %remove 'default' from outputs
-            outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-         end
-			WriteData(fid,prefix,'data',outputs,'name','md.groundingline.requested_outputs','format','StringArray')
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsstring(fid,[modelname '.groundingline.migration'],self.migration);
-			writejsstring(fid,[modelname '.groundingline.friction_interpolation'],self.friction_interpolation);
-			writejsstring(fid,[modelname '.groundingline.melt_interpolation'],self.melt_interpolation);
-			writejscellstring(fid,[modelname '.groundingline.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/groundingline.py
===================================================================
--- /issm/trunk/src/m/classes/groundingline.py	(revision 28275)
+++ 	(revision )
@@ -1,82 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-import MatlabFuncs as m
-from WriteData import WriteData
-
-
-class groundingline(object):
-    """
-    GROUNDINGLINE class definition
-
-       Usage:
-          groundingline = groundingline()
-    """
-
-    def __init__(self):  # {{{
-        self.migration = ''
-        self.friction_interpolation = ''
-        self.melt_interpolation = ''
-        self.requested_outptuts = []
-
-        # Set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   grounding line migration parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'migration', 'type of grounding line migration: \'SoftMigration\', \'SubelementMigration\', \'AggressiveMigration\', \'Contact\', \'None\''))
-        s += '{}\n'.format(fielddisplay(self, 'migration', 'type of friction interpolation on partially floating elements: ''SubelementFriction1'', ''SubelementFriction2'', ''NoFrictionOnPartiallyFloating'''))
-        s += '{}\n'.format(fielddisplay(self, 'migration', 'type of melt interpolation on partially floating elements: \'SubelementMelt1\', \'SubelementMelt2\', \'NoMeltOnPartiallyFloating\', \'FullMeltOnPartiallyFloating\''))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['Surface', 'Base','MaskOceanLevelset']
-
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Type of migration
-        self.migration = 'SubelementMigration'
-        self.friction_interpolation = 'SubelementFriction1'
-        self.melt_interpolation = 'NoMeltOnPartiallyFloating'
-        # Default output
-        self.requested_outputs = ['default']
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'groundingline.migration', 'values', ['None', 'SubelementMigration', 'AggressiveMigration', 'SoftMigration', 'Contact', 'GroundingOnly'])
-        md = checkfield(md, 'fieldname', 'groundingline.friction_interpolation', 'values', ['SubelementFriction1', 'SubelementFriction2', 'NoFrictionOnPartiallyFloating'])
-        md = checkfield(md, 'fieldname', 'groundingline.melt_interpolation', 'values', ['SubelementMelt1', 'SubelementMelt2', 'NoMeltOnPartiallyFloating', 'FullMeltOnPartiallyFloating'])
-        md = checkfield(md, 'fieldname', 'groundingline.requested_outputs', 'stringrow', 1)
-
-        if(not m.strcmp(self.migration, 'None') and md.transient.isgroundingline and solution == 'TransientSolution'):
-            if np.any(np.isnan(md.geometry.bed)):
-                md.checkmessage("requesting grounding line migration, but bathymetry is absent!")
-            pos = np.nonzero(md.mask.ocean_levelset > 0.)[0]
-            if any(np.abs(md.geometry.base[pos] - md.geometry.bed[pos]) > pow(10, -10)):
-                md.checkmessage("base not equal to bed on grounded ice!")
-            if any(md.geometry.bed - md.geometry.base > pow(10, -9)):
-                md.checkmessage("bed superior to base on floating ice!")
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'data', self.migration, 'name', 'md.groundingline.migration', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.friction_interpolation, 'name', 'md.groundingline.friction_interpolation', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.melt_interpolation, 'name', 'md.groundingline.melt_interpolation', 'format', 'String')
-        
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.groundingline.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/hydrologyarmapw.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologyarmapw.m	(revision 28275)
+++ 	(revision )
@@ -1,190 +1,0 @@
-%HYDROLOGYARMAPW class definition
-%
-%   Usage:
-%      hydrologyarmapw=hydrologyarmapw();
-
-classdef hydrologyarmapw
-	properties (SetAccess=public) 
-		num_basins               = 0;
-      num_params               = 0;
-      num_breaks               = 0;
-		basin_id                 = NaN;
-      monthlyfactors           = NaN;
-		polynomialparams         = NaN;
-		ar_order                 = 0;
-      ma_order                 = 0;
-      arma_timestep            = 0;
-		arlag_coefs              = NaN;
-      malag_coefs              = NaN;
-		datebreaks               = NaN;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.basin_id    = project3d(md,'vector',self.basin_id,'type','element');
-		end % }}}
-		function self = hydrologyarmapw(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(self,varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'FrictionWaterPressure'};
-		end % }}}    
-		function self = setdefaultparameters(self) % {{{
-			%No default parameters
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('HydrologyArmapwAnalysis',analyses)
-				return;
-			end
-
-			nbas  = md.hydrology.num_basins;
-         nprm  = md.hydrology.num_params;
-         nbrk  = md.hydrology.num_breaks;
-
-			md = checkfield(md,'fieldname','hydrology.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','hydrology.num_breaks','numel',1,'NaN',1,'Inf',1,'>=',0);
-			md = checkfield(md,'fieldname','hydrology.num_params','numel',1,'NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','hydrology.basin_id','Inf',1,'>=',0,'<=',md.hydrology.num_basins,'size',[md.mesh.numberofelements,1]);
-			
-			% Check if monthly factors are provided %
-			if(numel(md.hydrology.monthlyfactors)>1 || ~isnan(md.hydrology.monthlyfactors))
-				md = checkfield(md,'fieldname','hydrology.monthlyfactors','NaN',1,'Inf',1,'size',[md.hydrology.num_basins,12]);
-				isseasonality = false;
-				for(rr=[1:md.hydrology.num_basins])
-					for(cc=[1:12])
-						if(md.hydrology.monthlyfactors(rr,cc)~=1)
-							isseasonality = true;
-						end
-					end
-				end
-				if(isseasonality && md.timestepping.time_step>=1)
-					error('md.timestepping.time_step is too large to use hydrologyarmapw() with monthlyfactors');
-				end
-			end
-
-			if(nbas>1 && nbrk>=1 && nprm>1)
-            md = checkfield(md,'fieldname','hydrology.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1,nprm],'numel',nbas*(nbrk+1)*nprm);
-         elseif(nbas==1)
-            md = checkfield(md,'fieldname','hydrology.polynomialparams','NaN',1,'Inf',1,'size',[nprm,nbrk+1],'numel',nbas*(nbrk+1)*nprm);
-         elseif(nbrk==0)
-            md = checkfield(md,'fieldname','hydrology.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nprm],'numel',nbas*(nbrk+1)*nprm);
-         elseif(nprm==1)
-            md = checkfield(md,'fieldname','hydrology.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1],'numel',nbas*(nbrk+1)*nprm);
-         end
-
-			md = checkfield(md,'fieldname','hydrology.ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-         md = checkfield(md,'fieldname','hydrology.ma_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-         md = checkfield(md,'fieldname','hydrology.arma_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %ARMA time step cannot be finer than ISSM timestep
-         md = checkfield(md,'fieldname','hydrology.arlag_coefs','NaN',1,'Inf',1,'size',[md.hydrology.num_basins,md.hydrology.ar_order]);
-         md = checkfield(md,'fieldname','hydrology.malag_coefs','NaN',1,'Inf',1,'size',[md.hydrology.num_basins,md.hydrology.ma_order]);
-
-			if(nbrk>0)
-            md = checkfield(md,'fieldname','hydrology.datebreaks','NaN',1,'Inf',1,'size',[nbas,nbrk]);
-         elseif(numel(md.hydrology.datebreaks)==0 || all(isnan(md.hydrology.datebreaks)))
-            ;
-         else
-            error('md.hydrology.num_breaks is 0 but md.hydrology.datebreaks is not empty');
-         end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   hydrologyarmapw'));
-			disp(sprintf('   subglacial water pressure is calculated as Pw=monthlyfactor[month]*(rho_water*g*bed+Pw_arma) where Pw_arma is the perturbation calculated as an ARMA process'));
-			disp(sprintf('   polynomialparams includes the constant, linear trend, quadratic trend, etc. of the ARMA process'));
-			disp(sprintf('   arlag_coefs and malag_coefs include the coefficients of the ARMA process'));
-			fielddisplay(self,'num_basins','number of different basins');
-			fielddisplay(self,'basin_id','basin number assigned to each element');
-			fielddisplay(self,'num_breaks','number of different breakpoints in the piecewise-polynomial (separating num_breaks+1 periods)');
-         fielddisplay(self,'num_params','number of different parameters in the piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)');
-			fielddisplay(self,'monthlyfactors','monthly multiplicative factor on the subglacial water pressure, specified per basin (size:[num_basins,12])');
-			fielddisplay(self,'polynomialparams','coefficients for the polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders');
-         disp(sprintf('%51s  ex: polyparams=cat(3,intercepts,trendlinearcoefs,trendquadraticcoefs)',' '));
-         fielddisplay(self,'datebreaks','dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]');
-         fielddisplay(self,'ar_order','order of the autoregressive model [unitless]');
-         fielddisplay(self,'ma_order','order of the moving-average model [unitless]');
-         fielddisplay(self,'arma_timestep','time resolution of the autoregressive model [yr]');
-         fielddisplay(self,'arlag_coefs','basin-specific vectors of AR lag coefficients [unitless]');
-         fielddisplay(self,'malag_coefs','basin-specific vectors of MA lag coefficients [unitless]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-         %%% Deal with polynomial %%%
-         nbas  = md.hydrology.num_basins;
-         nprm  = md.hydrology.num_params;
-         nper  = md.hydrology.num_breaks+1;
-         % Scale the parameters %
-         polyparamsScaled   = md.hydrology.polynomialparams;
-         polyparams2dScaled = zeros(nbas,nper*nprm);
-         if(nprm>1)
-            % Case 3D %
-            if(nbas>1 && nper>1)
-               for(ii=[1:nprm])
-                  polyparamsScaled(:,:,ii) = polyparamsScaled(:,:,ii)*((1/yts)^(ii-1));
-               end
-               % Fit in 2D array %
-               for(ii=[1:nprm])
-                  jj = 1+(ii-1)*nper;
-                  polyparams2dScaled(:,jj:jj+nper-1) = polyparamsScaled(:,:,ii);
-               end
-            % Case 2D and higher-order params at increasing row index %
-            elseif(nbas==1)
-               for(ii=[1:nprm])
-                  polyparamsScaled(ii,:) = polyparamsScaled(ii,:)*((1/yts)^(ii-1));
-               end
-               % Fit in row array %
-               for(ii=[1:nprm])
-                  jj = 1+(ii-1)*nper;
-                  polyparams2dScaled(1,jj:jj+nper-1) = polyparamsScaled(ii,:);
-               end
-            % Case 2D and higher-order params at incrasing column index %
-            elseif(nper==1)
-               for(ii=[1:nprm])
-                  polyparamsScaled(:,ii) = polyparamsScaled(:,ii)*((1/yts)^(ii-1));
-               end
-               % 2D array is already in correct format %
-               polyparams2dScaled = polyparamsScaled;
-            end
-         else
-            % 2D array is already in correct format and no need for scaling %
-            polyparams2dScaled = polyparamsScaled;
-         end
-         if(nper==1) %a single period (no break date)
-            dbreaks = zeros(nbas,1); %dummy
-         else
-            dbreaks = md.hydrology.datebreaks;
-         end
-
-			% If no monthlyfactors provided: set them all to 1 %
-			if(numel(md.hydrology.monthlyfactors)==1)
-				tempmonthlyfactors = ones(nbas,12);
-			else
-				tempmonthlyfactors = md.hydrology.monthlyfactors;
-			end
-
-			WriteData(fid,prefix,'name','md.hydrology.model','data',7,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','num_basins','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','num_breaks','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','num_params','format','Integer');
-         WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','basin_id','data',self.basin_id-1,'name','md.hydrology.basin_id','format','IntMat','mattype',2); %0-indexed
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','ar_order','format','Integer');
-         WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','ma_order','format','Integer');
-         WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','arma_timestep','format','Double','scale',yts);
-         WriteData(fid,prefix,'data',polyparams2dScaled,'name','md.hydrology.polynomialparams','format','DoubleMat');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','arlag_coefs','format','DoubleMat','name','md.hydrology.arlag_coefs','yts',yts);
-         WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','malag_coefs','format','DoubleMat','name','md.hydrology.malag_coefs','yts',yts);
-			WriteData(fid,prefix,'data',dbreaks,'name','md.hydrology.datebreaks','format','DoubleMat','scale',yts);
-			WriteData(fid,prefix,'data',tempmonthlyfactors,'name','md.hydrology.monthlyfactors','format','DoubleMat');
-			WriteData(fid,prefix,'data',{'FrictionWaterPressure'},'name','md.hydrology.requested_outputs','format','StringArray');
-		end % }}}
-	end
-end
-
Index: sm/trunk/src/m/classes/hydrologyarmapw.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologyarmapw.py	(revision 28275)
+++ 	(revision )
@@ -1,174 +1,0 @@
-import numpy as np
-
-from checkfield import *
-from fielddisplay import fielddisplay
-from project3d import *
-from WriteData import *
-from GetAreas import *
-
-class hydrologyarmapw(object):
-    """HYDROLOGYARMAPW class definition
-
-    Usage:
-        hydrologyarmapw = hydrologyarmapw()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.num_basins = 0
-        self.num_params = 0
-        self.num_breaks = 0
-        self.polynomialparams = np.nan
-        self.arma_timestep = 0
-        self.ar_order = 0
-        self.ma_order = 0
-        self.arlag_coefs = np.nan
-        self.malag_coefs = np.nan
-        self.datebreaks = np.nan
-        self.basin_id = np.nan
-        self.monthlyfactors = np.nan
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   hydrologyarmapw\n'
-        s += 'subglacial water pressure is calculated as Pw=monthlyfactor[month]*(rho_water*g*bed+Pw_arma) where Pw_arma is the perturbation calculated as an ARMA process\n'
-        s += 'polynomialparams includes the constant, linear trend, quadratic trend, etc. of the ARMA process\n'
-        s += 'arlag_coefs and malag_coefs include the coefficients of the ARMA process\n'
-        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of different basins [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin number assigned to each element [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'num_breaks', 'number of different breakpoints in the piecewise-polynomial (separating num_breaks+1 periods)'))
-        s += '{}\n'.format(fielddisplay(self, 'num_params', 'number of different parameters in the piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)'))
-        s += '{}\n'.format(fielddisplay(self, 'monthlyfactors', 'monthly multiplicative factor on the subglacial water pressure, specified per basin (size:[num_basins,12])'))
-        s += '{}\n'.format(fielddisplay(self, 'polynomialparams', 'coefficients for the polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders, ex: polyparams=cat(num_params,intercepts,trendlinearcoefs,trendquadraticcoefs)'))
-        s += '{}\n'.format(fielddisplay(self, 'datebreaks', 'dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'ar_order', 'order of the autoregressive model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'ma_order', 'order of the moving-average model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'arma_timestep', 'time resolution of the ARMA model [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'arlag_coefs', 'basin-specific vectors of AR lag coefficients [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'malag_coefs', 'basin-specific vectors of MA lag coefficients [unitless]'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # No default parameters
-        return self # Nothing for now
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.basin_id = project3d(md,'vector',self.basin_id,'type','element')
-        return self # Nothing for now
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['FrictionWaterPressure']
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if 'HydrologyArmapwAnalysis' not in analyses:
-            return md
-
-        nbas = md.hydrology.num_basins
-        nprm = md.hydrology.num_params
-        nbrk = md.hydrology.num_breaks
-        
-        md = checkfield(md, 'fieldname', 'hydrology.num_basins', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.num_params', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.num_breaks', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.basin_id', 'Inf', 1, '>=', 0, '<=', md.hydrology.num_basins, 'size', [md.mesh.numberofelements])
-
-        # Check if monthlyfactors are provided
-        if(np.size(md.hydrology.monthlyfactors)>1 or np.all(np.isnan(md.hydrology.monthlyfactors))==False):
-            md = checkfield(md,'fieldname','hydrology.monthlyfactors','NaN',1,'Inf',1,'size',[md.hydrology.num_basins,12])
-            if(np.any(md.hydrology.monthlyfactors!=1) and md.timestepping.time_step>=1):
-                raise RuntimeError('md.timestepping.time_step is too large to use hydrologyarmapw() with monthlyfactors')
-
-        if len(np.shape(self.polynomialparams)) == 1:
-            self.polynomialparams = np.array([[self.polynomialparams]])
-        if(nbas>1 and nbrk>=1 and nprm>1):
-            md = checkfield(md,'fieldname','hydrology.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1,nprm],'numel',nbas*(nbrk+1)*nprm) 
-        elif(nbas==1):
-            md = checkfield(md,'fieldname','hydrology.polynomialparams','NaN',1,'Inf',1,'size',[nprm,nbrk+1],'numel',nbas*(nbrk+1)*nprm) 
-        elif(nbrk==0):
-            md = checkfield(md,'fieldname','hydrology.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nprm],'numel',nbas*(nbrk+1)*nprm)
-        elif(nprm==1):
-            md = checkfield(md,'fieldname','hydrology.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1],'numel',nbas*(nbrk+1)*nprm)
-        md = checkfield(md, 'fieldname', 'hydrology.ar_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.ma_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.arma_timestep', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', md.timestepping.time_step) # Autoregression time step cannot be finer than ISSM timestep
-        md = checkfield(md, 'fieldname', 'hydrology.arlag_coefs', 'NaN', 1, 'Inf', 1, 'size', [md.hydrology.num_basins, md.hydrology.ar_order])
-        md = checkfield(md, 'fieldname', 'hydrology.malag_coefs', 'NaN', 1, 'Inf', 1, 'size', [md.hydrology.num_basins, md.hydrology.ma_order])
-        if(nbrk>0):
-            md = checkfield(md, 'fieldname', 'hydrology.datebreaks', 'NaN', 1, 'Inf', 1, 'size', [nbas,nbrk])
-        elif(np.size(md.hydrology.datebreaks)==0 or np.all(np.isnan(md.hydrology.datebreaks))):
-            pass
-        else:
-            raise RuntimeError('md.hydrology.num_breaks is 0 but md.hydrology.datebreaks is not empty')
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        nbas = md.hydrology.num_basins;
-        nprm = md.hydrology.num_params;
-        nper = md.hydrology.num_breaks+1;
-        # Scale the parameters #
-        polyparamsScaled   = np.copy(md.hydrology.polynomialparams)
-        polyparams2dScaled = np.zeros((nbas,nper*nprm))
-        if(nprm>1):
-            # Case 3D #
-            if(nbas>1 and nper>1):
-                for ii in range(nprm):
-                    polyparamsScaled[:,:,ii] = polyparamsScaled[:,:,ii]*(1/yts)**(ii)
-                # Fit in 2D array #
-                for ii in range(nprm):
-                    polyparams2dScaled[:,ii*nper:(ii+1)*nper] = 1*polyparamsScaled[:,:,ii]
-            # Case 2D and higher-order params at increasing row index #
-            elif(nbas==1):
-                for ii in range(nprm):
-                    polyparamsScaled[ii,:] = polyparamsScaled[ii,:]*(1/yts)**(ii)
-                # Fit in row array #
-                for ii in range(nprm):
-                    polyparams2dScaled[0,ii*nper:(ii+1)*nper] = 1*polyparamsScaled[ii,:]
-            # Case 2D and higher-order params at incrasing column index #
-            elif(nper==1):
-                for ii in range(nprm):
-                    polyparamsScaled[:,ii] = polyparamsScaled[:,ii]*(1/yts)**(ii)
-                # 2D array is already in correct format #
-                polyparams2dScaled = np.copy(polyparamsScaled)
-        else:
-            # 2D array is already in correct format and no need for scaling#
-            polyparams2dScaled = np.copy(polyparamsScaled)
-        
-        if(nper==1):
-            dbreaks = np.zeros((nbas,1))
-        else:
-            dbreaks = np.copy(md.hydrology.datebreaks)
-
-        # If no monthlyfactors provided: set them all to 1 #
-        if(np.size(md.hydrology.monthlyfactors)==1):
-            tempmonthlyfactors = np.ones((nbas,12))
-        else:
-            tempmonthlyfactors = np.copy(md.hydrology.monthlyfactors)
-
-        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 7, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'num_basins', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'num_breaks', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'num_params', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'ar_order', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'ma_order', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'arma_timestep', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'basin_id', 'data', self.basin_id - 1, 'name', 'md.hydrology.basin_id', 'format', 'IntMat', 'mattype', 2)  # 0-indexed
-        WriteData(fid, prefix, 'data', polyparams2dScaled, 'name', 'md.hydrology.polynomialparams', 'format', 'DoubleMat')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'arlag_coefs', 'format', 'DoubleMat', 'name', 'md.hydrology.arlag_coefs', 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'malag_coefs', 'format', 'DoubleMat', 'name', 'md.hydrology.malag_coefs', 'yts', yts)
-        WriteData(fid, prefix, 'data', dbreaks, 'name', 'md.hydrology.datebreaks', 'format', 'DoubleMat','scale',yts)
-        WriteData(fid,prefix,'data',tempmonthlyfactors,'name','md.hydrology.monthlyfactors','format','DoubleMat')
-        WriteData(fid,prefix,'data',{'FrictionWaterPressure'},'name','md.hydrology.requested_outputs','format','StringArray')
-
-    # }}}
Index: sm/trunk/src/m/classes/hydrologydc.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologydc.m	(revision 28275)
+++ 	(revision )
@@ -1,272 +1,0 @@
-
-%Hydrologydc class definition
-%
-%   Usage:
-%      hydrologydc=hydrologydc();
-
-classdef hydrologydc
-	properties (SetAccess=public)
-		water_compressibility    = 0;
-		isefficientlayer         = 0;
-		penalty_factor           = 0;
-		penalty_lock             = 0;
-		rel_tol                  = 0;
-		max_iter                 = 0;
-		steps_per_step           = 0;
-		step_adapt               = 0;
-		averaging                = 0;
-		sedimentlimit_flag       = 0;
-		sedimentlimit            = 0;
-		transfer_flag            = 0;
-		unconfined_flag          = 0;
-		leakage_factor           = 0;
-		basal_moulin_input       = NaN;
-		requested_outputs        = {};
-
-		spcsediment_head         = NaN;
-		mask_thawed_node         = NaN;
-		sediment_transmitivity   = NaN;
-		sediment_compressibility = 0;
-		sediment_porosity        = 0;
-		sediment_thickness       = 0;
-
-
-		spcepl_head              = NaN;
-		mask_eplactive_node      = NaN;
-		epl_compressibility      = 0;
-		epl_porosity             = 0;
-		epl_initial_thickness    = 0;
-		epl_colapse_thickness    = 0;
-		epl_thick_comp           = 0;
-		epl_max_thickness        = 0;
-		epl_conductivity         = 0;
-		eplflip_lock             = 0;
-	end
-	methods
-		function self = extrude(self,md)    % {{{
-			self.spcsediment_head=project3d(md,'vector',self.spcsediment_head,'type','node','layer',1);
-			self.sediment_transmitivity=project3d(md,'vector',self.sediment_transmitivity,'type','node','layer',1);
-			self.basal_moulin_input=project3d(md,'vector',self.basal_moulin_input,'type','node','layer',1);
-			self.mask_thawed_node=project3d(md,'vector',self.mask_thawed_node,'type','node','layer',1);
-			if(self.isefficientlayer==1);
-				self.spcepl_head=project3d(md,'vector',self.spcepl_head,'type','node','layer',1);
-				self.mask_eplactive_node=project3d(md,'vector',self.mask_eplactive_node,'type','node','layer',1);
-			end
-		end    % }}}
-		function self = hydrologydc(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end% }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SedimentHead','SedimentHeadResidual','EffectivePressure'};
-			if self.isefficientlayer,
-				list=[list,{'EplHead','HydrologydcMaskEplactiveNode','HydrologydcMaskEplactiveElt','EplHeadSlopeX','EplHeadSlopeY','HydrologydcEplThickness'}];
-			end
-			if self.steps_per_step>1 | self.step_adapt,
-				list = [list,'EffectivePressureSubstep','SedimentHeadSubstep'];
-				if self.isefficientlayer,
-					list = [list,'EplHeadSubstep','HydrologydcEplThicknessSubstep'];
-				end
-			end
-		end % }}}
-		function self = initialize(self,md) % {{{
-			self.epl_colapse_thickness = self.sediment_transmitivity/self.epl_conductivity;
-			if isnan(self.basal_moulin_input),
-				self.basal_moulin_input=zeros(md.mesh.numberofvertices,1);
-				disp('      no hydrology.basal_moulin_input specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self)% {{{
-			%Parameters from de Fleurian 2014
-			self.water_compressibility    = 5.04e-10;
-			self.isefficientlayer         = 1;
-			self.penalty_factor           = 3;
-			self.penalty_lock             = 0;
-			self.rel_tol                  = 1.0e-06;
-			self.max_iter                 = 100;
-			self.steps_per_step           = 1;
-			self.step_adapt               = 0;
-			self.averaging                = 0;
-			self.sedimentlimit_flag       = 0;
-			self.sedimentlimit            = 0;
-			self.transfer_flag            = 1;
-			self.unconfined_flag          = 0;
-			self.leakage_factor           = 1.0e-10;
-			self.requested_outputs        = {'default'};
-
-
-			self.sediment_compressibility = 1.0e-08;
-			self.sediment_porosity        = 0.4;
-			self.sediment_thickness       = 20.0;
-			self.sediment_transmitivity   = 8.0e-04;
-
-			self.epl_compressibility      = 1.0e-08;
-			self.epl_conductivity         = 8.0e-02;
-			self.epl_porosity             = 0.4;
-			self.epl_initial_thickness    = 1.0;
-			self.epl_colapse_thickness    = self.sediment_transmitivity/self.epl_conductivity;
-			self.epl_thick_comp           = 1;
-			self.epl_max_thickness        = 5.0;
-			self.eplflip_lock             = 0;
-		end  % }}}
-		function md = checkconsistency(self,md,solution,analyses)% {{{
-		%Early return
-			if ~ismember('HydrologyDCInefficientAnalysis',analyses) & ~ismember('HydrologyDCEfficientAnalysis',analyses),
-				return;
-			end
-
-			md = checkfield(md,'fieldname','hydrology.water_compressibility','>',0,'numel',1);
-			md = checkfield(md,'fieldname','hydrology.isefficientlayer','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','hydrology.penalty_factor','>',0,'numel',1);
-			md = checkfield(md,'fieldname','hydrology.penalty_lock','>=',0,'numel',1);
-			md = checkfield(md,'fieldname','hydrology.rel_tol','>',0,'numel',1);
-			md = checkfield(md,'fieldname','hydrology.max_iter','>',0,'numel',1);
-			md = checkfield(md,'fieldname','hydrology.steps_per_step','>',0,'numel',1);
-			md = checkfield(md,'fieldname','hydrology.step_adapt','numel',1,'values',[0 1]);
-			md = checkfield(md,'fieldname','hydrology.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','hydrology.sedimentlimit_flag','numel',[1],'values',[0 1 2 3]);
-			md = checkfield(md,'fieldname','hydrology.transfer_flag','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','hydrology.unconfined_flag','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
-			if self.sedimentlimit_flag==1,
-				md = checkfield(md,'fieldname','hydrology.sedimentlimit','>',0,'numel',1);
-			end
-			if self.transfer_flag==1,
-				md = checkfield(md,'fieldname','hydrology.leakage_factor','>',0,'numel',1);
-			end
-			md = checkfield(md,'fieldname','hydrology.basal_moulin_input','NaN',1,'Inf',1,'timeseries',1);
-
-			md = checkfield(md,'fieldname','hydrology.spcsediment_head','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','hydrology.sediment_compressibility','>',0,'numel',1);
-			md = checkfield(md,'fieldname','hydrology.sediment_porosity','>',0,'numel',1);
-			md = checkfield(md,'fieldname','hydrology.sediment_thickness','>',0,'numel',1);
-			md = checkfield(md,'fieldname','hydrology.sediment_transmitivity','>=',0,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','hydrology.mask_thawed_node','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-
-			if self.isefficientlayer==1,
-				md = checkfield(md,'fieldname','hydrology.spcepl_head','Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','hydrology.mask_eplactive_node','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-				md = checkfield(md,'fieldname','hydrology.epl_compressibility','>',0,'numel',1);
-				md = checkfield(md,'fieldname','hydrology.epl_porosity','>',0,'numel',1);
-				md = checkfield(md,'fieldname','hydrology.epl_initial_thickness','>',0,'numel',1);
-				md = checkfield(md,'fieldname','hydrology.epl_colapse_thickness','>',0,'numel',1);
-				md = checkfield(md,'fieldname','hydrology.epl_thick_comp','numel',[1],'values',[0 1]);
-				md = checkfield(md,'fieldname','hydrology.epl_max_thickness','>',0,'numel',1);
-				md = checkfield(md,'fieldname','hydrology.epl_conductivity','>',0,'numel',1);
-				md = checkfield(md,'fieldname','hydrology.eplflip_lock','>=',0,'numel',1);
-				if (self.epl_colapse_thickness>self.epl_initial_thickness),
-					md = checkmessage(md,'Colapsing thickness for EPL larger than initial thickness');
-				end
-			end
-		end% }}}
-		function disp(self)% {{{
-			disp(sprintf('   hydrology Dual Porous Continuum Equivalent parameters:'));
-			disp(sprintf('   - general parameters'));
-			fielddisplay(self,'water_compressibility','compressibility of water [Pa^-1]');
-			fielddisplay(self,'isefficientlayer','do we use an efficient drainage system [1: true; 0: false]');
-			fielddisplay(self,'penalty_factor','exponent of the value used in the penalisation method [dimensionless]');
-			fielddisplay(self,'penalty_lock','stabilize unstable constraints that keep zigzagging after n iteration (default is 0, no stabilization)');
-			fielddisplay(self,'rel_tol','tolerance of the nonlinear iteration for the transfer between layers [dimensionless]');
-			fielddisplay(self,'max_iter','maximum number of nonlinear iteration');
-			fielddisplay(self,'steps_per_step','number of hydrology steps per timestep');
-			fielddisplay(self,'step_adapt', 'adaptative sub stepping  [1: true 0: false] default is 0');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%55s  0: Arithmetic (default)'));
-			disp(sprintf('%55s  0: Geometric'));
-			disp(sprintf('%55s  0: Harmonic'));
-			fielddisplay(self,'sedimentlimit_flag','what kind of upper limit is applied for the inefficient layer');
-			disp(sprintf('%55s  0: no limit',' '));
-			disp(sprintf('%55s  1: user defined: %s',' ','sedimentlimit'));
-			disp(sprintf('%55s  2: hydrostatic pressure',' '));
-			disp(sprintf('%55s  3: normal stress',' '));
-			if self.sedimentlimit_flag==1,
-				fielddisplay(self,'sedimentlimit','user defined upper limit for the inefficient layer [m]');
-			end
-			fielddisplay(self,'transfer_flag','what kind of transfer method is applied between the layers');
-			disp(sprintf('%55s  0: no transfer',' '));
-			disp(sprintf('%55s  1: constant leakage factor: %s',' ','leakage_factor'));
-			if self.transfer_flag==1,
-				fielddisplay(self,'leakage_factor','user defined leakage factor [m]');
-			end
-			fielddisplay(self,'unconfined_flag','Do you want unconfined scheme to be used (transitory)');
-			disp(sprintf('%55s  0: confined only',' '));
-			disp(sprintf('%55s  1: confined unconfined'));
-      fielddisplay(self,'requested_outputs','additional outputs requested');
-			fielddisplay(self,'basal_moulin_input','water flux at a given point [m3 s-1]');
-			disp(sprintf('   - for the sediment layer'));
-			fielddisplay(self,'spcsediment_head','sediment water head constraints (NaN means no constraint) [m above MSL]');
-			fielddisplay(self,'sediment_compressibility','sediment compressibility [Pa^-1]');
-			fielddisplay(self,'sediment_porosity','sediment [dimensionless]');
-			fielddisplay(self,'sediment_thickness','sediment thickness [m]');
-			fielddisplay(self,'sediment_transmitivity','sediment transmitivity [m^2/s]');
-      fielddisplay(self,'mask_thawed_node','deactivate (0) hydrology on frozen nodes');
-
-			if self.isefficientlayer==1,
-				disp(sprintf('   - for the epl layer'));
-				fielddisplay(self,'spcepl_head','epl water head constraints (NaN means no constraint) [m above MSL]');
-				fielddisplay(self,'mask_eplactive_node','active (1) or not (0) EPL');
-				fielddisplay(self,'epl_compressibility','epl compressibility [Pa^-1]');
-				fielddisplay(self,'epl_porosity','epl [dimensionless]');
-				fielddisplay(self,'epl_initial_thickness','epl initial thickness [m]');
-				fielddisplay(self,'epl_colapse_thickness','epl colapsing thickness [m]');
-				fielddisplay(self,'epl_thick_comp','epl thickness computation flag');
-				fielddisplay(self,'epl_max_thickness','epl maximal thickness [m]');
-				fielddisplay(self,'epl_conductivity','epl conductivity [m^2/s]');
-				fielddisplay(self,'eplflip_lock','lock the epl activation to avoid fli-floping (default is 0, no stabilization)');
-			end
-		end % }}}
-		function marshall(self,prefix,md,fid)% {{{
-			WriteData(fid,prefix,'name','md.hydrology.model','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','water_compressibility','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','isefficientlayer','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','rel_tol','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','max_iter','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','step_adapt','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','sedimentlimit_flag','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','transfer_flag','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','unconfined_flag','format','Integer');
-			if self.sedimentlimit_flag==1,
-				WriteData(fid,prefix,'object',self,'fieldname','sedimentlimit','format','Double');
-			end
-			if self.transfer_flag==1,
-				WriteData(fid,prefix,'object',self,'fieldname','leakage_factor','format','Double');
-			end
-			WriteData(fid,prefix,'object',self,'fieldname','basal_moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-
-			WriteData(fid,prefix,'object',self,'fieldname','spcsediment_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','sediment_compressibility','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','sediment_porosity','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','sediment_thickness','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','sediment_transmitivity','format','DoubleMat','mattype',1');
-			WriteData(fid,prefix,'object',self,'fieldname','mask_thawed_node','format','DoubleMat','mattype',1);
-			if self.isefficientlayer==1,
-				WriteData(fid,prefix,'object',self,'fieldname','spcepl_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'fieldname','mask_eplactive_node','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'fieldname','epl_compressibility','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','epl_porosity','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','epl_initial_thickness','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','epl_colapse_thickness','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','epl_thick_comp','format','Integer');
-				WriteData(fid,prefix,'object',self,'fieldname','epl_max_thickness','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','epl_conductivity','format','Double');
-				WriteData(fid,prefix,'object',self,'fieldname','eplflip_lock','format','Integer');
-			end
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];  %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
-		end% }}}
-	end
-end
Index: sm/trunk/src/m/classes/hydrologydc.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologydc.py	(revision 28275)
+++ 	(revision )
@@ -1,277 +1,0 @@
-import numpy as np
-from project3d import project3d
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class hydrologydc(object):
-    """HYDROLOGYDC class definition
-
-    Usage:
-        hydrologydc = hydrologydc()
-    """
-
-    def __init__(self):  # {{{
-        self.water_compressibility = 0
-        self.isefficientlayer = 0
-        self.penalty_factor = 0
-        self.penalty_lock = 0
-        self.rel_tol = 0
-        self.max_iter = 0
-        self.steps_per_step = 0
-        self.step_adapt = 0
-        self.averaging = 0
-        self.sedimentlimit_flag = 0
-        self.sedimentlimit = 0
-        self.transfer_flag = 0
-        self.unconfined_flag = 0
-        self.leakage_factor = 0
-        self.basal_moulin_input = np.nan
-        self.requested_outputs = []
-
-        self.spcsediment_head = np.nan
-        self.mask_thawed_node = np.nan
-        self.sediment_transmitivity = np.nan
-        self.sediment_compressibility = 0
-        self.sediment_porosity = 0
-        self.sediment_thickness = 0
-
-        self.spcepl_head = np.nan
-        self.mask_eplactive_node = np.nan
-        self.epl_compressibility = 0
-        self.epl_porosity = 0
-        self.epl_initial_thickness = 0
-        self.epl_colapse_thickness = 0
-        self.epl_thick_comp = 0
-        self.epl_max_thickness = 0
-        self.epl_conductivity = 0
-        self.eplflip_lock = 0
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        # TODO:
-        # - Convert all formatting to calls to <string>.format (see any
-        #   already converted <class>.__repr__ method for examples)
-        #
-        string = '   hydrology Dual Porous Continuum Equivalent parameters:'
-        string = ' - general parameters'
-        string = "%s\n%s" % (string, fielddisplay(self, 'water_compressibility', 'compressibility of water [Pa^ - 1]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isefficientlayer', 'do we use an efficient drainage system [1: true 0: false]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'penalty_factor', 'exponent of the value used in the penalisation method [dimensionless]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'penalty_lock', 'stabilize unstable constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'rel_tol', 'tolerance of the nonlinear iteration for the transfer between layers [dimensionless]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'max_iter', 'maximum number of nonlinear iteration'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of hydrology steps per time step'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'step_adapt', 'adaptative sub stepping  [1: true 0: false] default is 0'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)')
-        string = "%s\n\t\t%s" % (string, '1: Geometric')
-        string = "%s\n\t\t%s" % (string, '2: Harmonic')
-        string = "%s\n%s" % (string, fielddisplay(self, 'basal_moulin_input', 'water flux at a given point [m3 s - 1]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'sedimentlimit_flag', 'what kind of upper limit is applied for the inefficient layer'))
-        string = "%s\n\t\t%s" % (string, '0: no limit')
-        string = "%s\n\t\t%s" % (string, '1: user defined sedimentlimit')
-        string = "%s\n\t\t%s" % (string, '2: hydrostatic pressure')
-        string = "%s\n\t\t%s" % (string, '3: normal stress')
-
-        if self.sedimentlimit_flag == 1:
-            string = "%s\n%s" % (string, fielddisplay(self, 'sedimentlimit', 'user defined upper limit for the inefficient layer [m]'))
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'transfer_flag', 'what kind of transfer method is applied between the layers'))
-        string = "%s\n\t\t%s" % (string, '0: no transfer')
-        string = "%s\n\t\t%s" % (string, '1: constant leakage factor: leakage_factor')
-
-        if self.transfer_flag == 1:
-            string = "%s\n%s" % (string, fielddisplay(self, 'leakage_factor', 'user defined leakage factor [m]'))
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'unconfined_flag', 'using an unconfined scheme or not (transitory)'))
-        string = "%s\n\t\t%s" % (string, '0: Confined only')
-        string = "%s\n\t\t%s" % (string, '1: Confined - Unconfined')
-
-        string = "%s\n%s" % (string, ' - for the sediment layer')
-        string = "%s\n%s" % (string, fielddisplay(self, 'spcsediment_head', 'sediment water head constraints (NaN means no constraint) [m above MSL]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'sediment_compressibility', 'sediment compressibility [Pa^ - 1]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'sediment_porosity', 'sediment [dimensionless]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'sediment_thickness', 'sediment thickness [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'sediment_transmitivity', 'sediment transmitivity [m^2 / s]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'mask_thawed_node', 'IDS is deactivaed (0) on frozen nodes'))
-
-        if self.isefficientlayer == 1:
-            string = "%s\n%s" % (string, ' - for the epl layer')
-            string = "%s\n%s" % (string, fielddisplay(self, 'spcepl_head', 'epl water head constraints (NaN means no constraint) [m above MSL]'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'mask_eplactive_node', 'active (1) or not (0) EPL'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'epl_compressibility', 'epl compressibility [Pa^ - 1]'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'epl_porosity', 'epl [dimensionless]'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'epl_max_thickness', 'epl maximal thickness [m]'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'epl_initial_thickness', 'epl initial thickness [m]'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'epl_colapse_thickness', 'epl colapsing thickness [m]'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'epl_thick_comp', 'epl thickness computation flag'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'epl_conductivity', 'epl conductivity [m^2 / s]'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'eplflip_lock', 'lock epl activity to avoid flip - floping (default is 0, no stabilization)'))
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.spcsediment_head = project3d(md, 'vector', self.spcsediment_head, 'type', 'node', 'layer', 1)
-        self.sediment_transmitivity = project3d(md, 'vector', self.sediment_transmitivity, 'type', 'node', 'layer', 1)
-        self.basal_moulin_input = project3d(md, 'vector', self.basal_moulin_input, 'type', 'node', 'layer', 1)
-        self.mask_thawed_node = project3d(md, 'vector', self.mask_thawed_node, 'type', 'node', 'layer', 1)
-        if self.isefficientlayer == 1:
-            self.spcepl_head = project3d(md, 'vector', self.spcepl_head, 'type', 'node', 'layer', 1)
-            self.mask_eplactive_node = project3d(md, 'vector', self.mask_eplactive_node, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #Parameters from de Fleurian 2014
-        self.water_compressibility = 5.04e-10
-        self.isefficientlayer = 1
-        self.penalty_factor = 3
-        self.penalty_lock = 0
-        self.rel_tol = 1.0e-06
-        self.max_iter = 100
-        self.steps_per_step = 1
-        self.step_adapt = 0
-        self.averaging = 0
-        self.sedimentlimit_flag = 0
-        self.sedimentlimit = 0
-        self.transfer_flag = 1
-        self.unconfined_flag = 0
-        self.leakage_factor = 1.0e-10
-        self.requested_outputs = ['default']
-        self.sediment_compressibility = 1.0e-08
-        self.sediment_porosity = 0.4
-        self.sediment_thickness = 20.0
-        self.sediment_transmitivity = 8.0e-04
-
-        self.epl_compressibility = 1.0e-08
-        self.epl_conductivity = 8.0e-02
-        self.epl_porosity = 0.4
-        self.epl_initial_thickness = 1.0
-        self.epl_colapse_thickness = self.sediment_transmitivity / self.epl_conductivity
-        self.epl_thick_comp = 1
-        self.epl_max_thickness = 5.0
-        self.eplflip_lock = 0
-
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        list = ['SedimentHead', 'SedimentHeadResidual', 'EffectivePressure']
-        if self.isefficientlayer == 1:
-            list.extend(['EplHead', 'HydrologydcMaskEplactiveNode', 'HydrologydcMaskEplactiveElt', 'EplHeadSlopeX', 'EplHeadSlopeY', 'HydrologydcEplThickness'])
-        if self.steps_per_step > 1 or self.step_adapt:
-            list.extend(['EffectivePressureSubstep', 'SedimentHeadSubstep'])
-            if self.isefficientlayer == 1:
-                list.extend(['EplHeadSubstep', 'HydrologydcEplThicknessSubstep'])
-        return list
-    # }}}
-
-    def initialize(self, md):  # {{{
-        self.epl_colapse_thickness = self.sediment_transmitivity / self.epl_conductivity
-        if np.all(np.isnan(self.basal_moulin_input)):
-            self.basal_moulin_input = np.zeros((md.mesh.numberofvertices))
-            print("      no hydrology.basal_moulin_input specified: values set as zero")
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if 'HydrologyDCInefficientAnalysis' not in analyses and 'HydrologyDCEfficientAnalysis' not in analyses:
-            return md
-
-        md = checkfield(md, 'fieldname', 'hydrology.water_compressibility', 'numel', [1], '>', 0.)
-        md = checkfield(md, 'fieldname', 'hydrology.isefficientlayer', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'hydrology.penalty_factor', '>', 0., 'numel', [1])
-        md = checkfield(md, 'fieldname', 'hydrology.penalty_lock', '>=', 0., 'numel', [1])
-        md = checkfield(md, 'fieldname', 'hydrology.rel_tol', '>', 0., 'numel', [1])
-        md = checkfield(md, 'fieldname', 'hydrology.max_iter', '>', 0., 'numel', [1])
-        md = checkfield(md, 'fieldname', 'hydrology.steps_per_step', '>=', 1, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'hydrology.step_adapt', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'hydrology.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'hydrology.sedimentlimit_flag', 'numel', [1], 'values', [0, 1, 2, 3])
-        md = checkfield(md, 'fieldname', 'hydrology.transfer_flag', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'hydrology.unconfined_flag', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'hydrology.requested_outputs', 'stringrow', 1)
-
-        if self.sedimentlimit_flag == 1:
-            md = checkfield(md, 'fieldname', 'hydrology.sedimentlimit', '>', 0., 'numel', [1])
-
-        if self.transfer_flag == 1:
-            md = checkfield(md, 'fieldname', 'hydrology.leakage_factor', '>', 0., 'numel', [1])
-
-        md = checkfield(md, 'fieldname', 'hydrology.basal_moulin_input', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.spcsediment_head', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.sediment_compressibility', '>', 0., 'numel', [1])
-        md = checkfield(md, 'fieldname', 'hydrology.sediment_porosity', '>', 0., 'numel', [1])
-        md = checkfield(md, 'fieldname', 'hydrology.sediment_thickness', '>', 0., 'numel', [1])
-        md = checkfield(md, 'fieldname', 'hydrology.sediment_transmitivity', '>=', 0, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'hydrology.mask_thawed_node', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
-        if self.isefficientlayer == 1:
-            md = checkfield(md, 'fieldname', 'hydrology.spcepl_head', 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'hydrology.mask_eplactive_node', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
-            md = checkfield(md, 'fieldname', 'hydrology.epl_compressibility', '>', 0., 'numel', [1])
-            md = checkfield(md, 'fieldname', 'hydrology.epl_porosity', '>', 0., 'numel', [1])
-            md = checkfield(md, 'fieldname', 'hydrology.epl_max_thickness', 'numel', [1], '>', 0.)
-            md = checkfield(md, 'fieldname', 'hydrology.epl_initial_thickness', 'numel', [1], '>', 0.)
-            md = checkfield(md, 'fieldname', 'hydrology.epl_colapse_thickness', 'numel', [1], '>', 0.)
-            md = checkfield(md, 'fieldname', 'hydrology.epl_thick_comp', 'numel', [1], 'values', [0, 1])
-            md = checkfield(md, 'fieldname', 'hydrology.eplflip_lock', '>=', 0., 'numel', [1])
-            if self.epl_colapse_thickness > self.epl_initial_thickness:
-                md.checkmessage('Colapsing thickness for EPL larger than initial thickness')
-            md = checkfield(md, 'fieldname', 'hydrology.epl_conductivity', 'numel', [1], '>', 0.)
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'water_compressibility', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isefficientlayer', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_factor', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_lock', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'rel_tol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'max_iter', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'step_adapt', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sedimentlimit_flag', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'transfer_flag', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'unconfined_flag', 'format', 'Integer')
-        if self.sedimentlimit_flag == 1:
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'sedimentlimit', 'format', 'Double')
-
-        if self.transfer_flag == 1:
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'leakage_factor', 'format', 'Double')
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'basal_moulin_input', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcsediment_head', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_compressibility', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_porosity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_thickness', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_transmitivity', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'mask_thawed_node', 'format', 'DoubleMat', 'mattype', 1)
-
-        if self.isefficientlayer == 1:
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'spcepl_head', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'mask_eplactive_node', 'format', 'DoubleMat', 'mattype', 1)
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_compressibility', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_porosity', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_max_thickness', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_initial_thickness', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_colapse_thickness', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_thick_comp', 'format', 'Integer')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_conductivity', 'format', 'Double')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'eplflip_lock', 'format', 'Integer')
-
-    #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/hydrologyglads.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologyglads.m	(revision 28275)
+++ 	(revision )
@@ -1,169 +1,0 @@
-%HYDROLOGYGLADS class definition
-%
-%   Usage:
-%      hydrologyglads=hydrologyglads();
-
-classdef hydrologyglads
-	properties (SetAccess=public) 
-		%Sheet
-		pressure_melt_coefficient = 0.;
-		sheet_conductivity        = NaN;
-		cavity_spacing            = 0.;
-		bump_height               = NaN;
-		omega                     = 0; 
-		sheet_alpha               = NaN; 
-		sheet_beta                = NaN; 
-
-		%Channels
-		ischannels           = 0;
-		channel_conductivity = NaN;
-		channel_sheet_width  = 0.;
-		channel_alpha        = NaN; 
-		channel_beta         = NaN; 
-
-		%Other
-		spcphi               = NaN;
-		moulin_input         = NaN;
-		neumannflux          = NaN;
-		englacial_void_ratio = 0.;
-		requested_outputs    = {};
-		melt_flag            = 0;
-		istransition         = 0;
-	end
-	methods
-		function self = hydrologyglads(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(self,varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'EffectivePressure','HydraulicPotential','HydrologySheetThickness','ChannelArea','ChannelDischarge'};
-		end % }}}    
-
-		function self = setdefaultparameters(self) % {{{
-
-			%Sheet parameters
-			self.pressure_melt_coefficient = 7.5e-8; %K/Pa (See table 1 in Erder et al. 2013)
-			self.cavity_spacing = 2.; %m
-			self.sheet_alpha = 5.0/4.0;
-			self.sheet_beta = 3.0/2.0;
-			self.omega = 1./2000.; 
-
-			%Channel parameters
-			self.ischannels=false;
-			self.channel_conductivity = 5.e-2; %Dow's default, Table uses 0.1
-			self.channel_sheet_width = 2.; %m
-			self.channel_alpha = 5.0/4.0;
-			self.channel_beta = 3.0/2.0;
-
-			%Otherself.omega = 1./2000.; 
-			self.englacial_void_ratio = 1.e-5;% Dow's default, Table from Werder et al. uses 1e-3;
-			self.requested_outputs={'default'};
-			self.melt_flag=0;
-			self.istransition = 0; %by default use GlaDS default turbulent code
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('HydrologyGladsAnalysis',analyses)
-				return;
-			end
-
-			%Sheet
-			md = checkfield(md,'fieldname','hydrology.pressure_melt_coefficient','numel',[1],'>=',0);
-			md = checkfield(md,'fieldname','hydrology.sheet_conductivity','size',[md.mesh.numberofvertices 1],'>',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.cavity_spacing','numel',[1],'>',0);
-			md = checkfield(md,'fieldname','hydrology.bump_height','size',[md.mesh.numberofvertices 1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.omega', 'numel', [1], '>=', 0); 
-			md = checkfield(md,'fieldname','hydrology.sheet_alpha', 'numel', [1], '>', 0); 
-			md = checkfield(md,'fieldname','hydrology.sheet_beta', 'numel', [1], '>', 0); 
-
-			%Channels
-			md = checkfield(md,'fieldname','hydrology.ischannels','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','hydrology.channel_conductivity','size',[md.mesh.numberofvertices 1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.channel_sheet_width','numel',[1],'>=',0);
-			md = checkfield(md,'fieldname','hydrology.channel_alpha', 'numel', [1], '>', 0); 
-			md = checkfield(md,'fieldname','hydrology.channel_beta', 'numel', [1], '>', 0); 
-
-			%Other
-			md = checkfield(md,'fieldname','hydrology.spcphi','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','hydrology.englacial_void_ratio','numel',[1],'>=',0);
-			md = checkfield(md,'fieldname','hydrology.moulin_input','>=',0,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.neumannflux','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
-			md = checkfield(md,'fieldname','hydrology.melt_flag','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','hydrology.istransition','numel',[1],'values',[0 1]);
-			if self.melt_flag==1 || self.melt_flag==2
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   GlaDS (hydrologyglads) solution parameters:'));
-			disp(sprintf('      SHEET'));
-			fielddisplay(self,'pressure_melt_coefficient','Pressure melt coefficient (c_t) [K Pa^-1]');
-			fielddisplay(self,'sheet_conductivity','sheet conductivity (k) [m^(7/4) kg^(-1/2)]');
-			fielddisplay(self,'sheet_alpha','First sheet-flow exponent (alpha_s) []'); 
-			fielddisplay(self,'sheet_beta','Second sheet-flow exponent (beta_s) []'); 
-			fielddisplay(self,'cavity_spacing','cavity spacing (l_r) [m]');
-			fielddisplay(self,'bump_height','typical bump height (h_r) [m]');
-			fielddisplay(self,'omega','transition parameter (omega) []'); 
-			disp(sprintf('      CHANNELS'));
-			fielddisplay(self,'ischannels','Do we allow for channels? 1: yes, 0: no');
-			fielddisplay(self,'channel_conductivity','channel conductivity (k_c) [m^(3/2) kg^(-1/2)]');
-			fielddisplay(self,'channel_alpha','First channel-flow exponent (alpha_s) []'); 
-			fielddisplay(self,'channel_beta','Second channel-flow exponent (beta_s) []'); 
-			fielddisplay(self,'channel_sheet_width','channel sheet width [m]');
-			disp(sprintf('      OTHER'));
-			fielddisplay(self,'spcphi','Hydraulic potential Dirichlet constraints [Pa]');
-			fielddisplay(self,'neumannflux','water flux applied along the model boundary (m^2/s)');
-			fielddisplay(self,'moulin_input','moulin input (Q_s) [m^3/s]');
-			fielddisplay(self,'englacial_void_ratio','englacial void ratio (e_v)');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-			fielddisplay(self,'melt_flag','User specified basal melt? 0: no (default), 1: use md.basalforcings.groundedice_melting_rate');
-			fielddisplay(self,'istransition','do we use standard [0, default] or transition model [1]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			%Marshall model code first
-			WriteData(fid,prefix,'name','md.hydrology.model','data',5,'format','Integer');
-
-						%Sheet
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','pressure_melt_coefficient','format','Double');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','sheet_conductivity','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','cavity_spacing','format','Double');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','bump_height','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','omega','format','Double'); 
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','sheet_alpha','format','Double'); 
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','sheet_beta','format','Double'); 
-
-			%Channels
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','ischannels','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','channel_conductivity','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','channel_sheet_width','format','Double');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','channel_alpha','format','Double'); 
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','channel_beta','format','Double'); 
-
-			%Others
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','spcphi','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','neumannflux','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','englacial_void_ratio','format','Double');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','melt_flag','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','istransition','format','Boolean');
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];  %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/hydrologyglads.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologyglads.py	(revision 28275)
+++ 	(revision )
@@ -1,186 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class hydrologyglads(object):
-    """hydrologyglads class definition
-
-    Usage:
-        hydrologyglads = hydrologyglads()
-    """
-
-    def __init__(self, *args):  # {{{
-       # Sheet
-        self.pressure_melt_coefficient = 0.
-        self.sheet_conductivity = np.nan
-        self.cavity_spacing = 0.
-        self.bump_height = np.nan
-        self.omega = 0.;
-        self.sheet_alpha = np.nan; 
-        self.sheet_beta = np.nan; 
-
-        # Channels
-        self.ischannels = 0
-        self.channel_conductivity = np.nan
-        self.channel_sheet_width = 0.
-        self.channel_alpha = np.nan; 
-        self.channel_beta = np.nan; 
-
-        # Other
-        self.spcphi = np.nan
-        self.moulin_input = np.nan
-        self.neumannflux = np.nan
-        self.englacial_void_ratio = 0.
-        self.requested_outputs = []
-        self.melt_flag = 0
-        self.istransition = 0
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            # TODO: Replace the following with constructor
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-        # }}}
-
-    def __repr__(self):  # {{{
-        s = '   GlaDS (hydrologyglads) solution parameters:\n'
-        s = '\t--SHEET\n'
-        s += '{}\n'.format(fielddisplay(self, 'pressure_melt_coefficient', 'Pressure melt coefficient (c_t) [K Pa^ - 1]'))
-        s += '{}\n'.format(fielddisplay(self, 'sheet_conductivity', 'sheet conductivity (k) [m^(7 / 4) kg^(- 1 / 2)]'))
-        s += '{}\n'.format(fielddisplay(self, 'sheet_alpha', 'First sheet-flow exponent (alpha_s) []')) #TH
-        s += '{}\n'.format(fielddisplay(self, 'sheet_beta', 'Second sheet-flow exponent (beta_s) []')) #TH
-        s += '{}\n'.format(fielddisplay(self, 'cavity_spacing', 'cavity spacing (l_r) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'bump_height', 'typical bump height (h_r) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'omega', 'transition parameter (omega) []')) #TH
-        s = '\t--CHANNELS\n'
-        s += '{}\n'.format(fielddisplay(self, 'ischannels', 'Do we allow for channels? 1: yes, 0: no'))
-        s += '{}\n'.format(fielddisplay(self, 'channel_conductivity', 'channel conductivity (k_c) [m^(3 / 2) kg^(- 1 / 2)]'))
-        s += '{}\n'.format(fielddisplay(self, 'channel_sheet_width', 'channel sheet width [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'channel_alpha', 'First channel-flow exponent (alpha_s) []')) #TH
-        s += '{}\n'.format(fielddisplay(self, 'channel_beta', 'Second channel-flow exponent (beta_s) []')) #TH
-        s = '\t--OTHER\n'
-        s += '{}\n'.format(fielddisplay(self, 'spcphi', 'Hydraulic potential Dirichlet constraints [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'neumannflux', 'water flux applied along the model boundary (m^2 / s)'))
-        s += '{}\n'.format(fielddisplay(self, 'moulin_input', 'moulin input (Q_s) [m^3 / s]'))
-        s += '{}\n'.format(fielddisplay(self, 'englacial_void_ratio', 'englacial void ratio (e_v)'))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        s += '{}\n'.format(fielddisplay(self, 'melt_flag', 'User specified basal melt? 0: no (default), 1: use md.basalforcings.groundedice_melting_rate'))
-        s += '{}\n'.format(fielddisplay(self, 'istransition','do we use standard [0, default] or transition model [1]'))
-        return string
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        list = ['EffectivePressure', 'HydraulicPotential', 'HydrologySheetThickness', 'ChannelArea', 'ChannelDischarge']
-        return list
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.sheet_conductivity = project3d(md, 'vector', self.sheet_conductivity, 'type', 'node', 'layer', 1)
-        self.bump_height = project3d(md, 'vector', self.bump_height, 'type', 'node', 'layer', 1)
-
-        # Other
-        self.spcphi = project3d(md, 'vector', self.spcphi, 'type', 'node', 'layer', 1)
-        self.moulin_input = project3d(md, 'vector', self.moulin_input, 'type', 'node', 'layer', 1)
-        self.neumannflux = project3d(md, 'vector', self.neumannflux, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Sheet parameters
-        self.pressure_melt_coefficient = 7.5e-8  #K / Pa (See table 1 in Erder et al. 2013)
-        self.cavity_spacing = 2.  #m
-        self.sheet_alpha = 5.0/4.0;
-        self.sheet_beta = 3.0/2.0;
-        self.omega = 1./2000.; 
-
-        # Channel parameters
-        self.ischannels = False
-        self.channel_conductivity = 5.e-2  #Dow's default, Table uses 0.1
-        self.channel_sheet_width = 2.  #m
-        self.channel_alpha = 5.0/4.0;
-        self.channel_beta = 3.0/2.0;
-
-        # Other
-        self.englacial_void_ratio = 1.e-5  #Dow's default, Table from Werder et al. uses 1e-3
-        self.requested_outputs = ['default']
-        self.melt_flag = 0
-        self.istransition = 0  #by default use turbulent physics
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'HydrologyGladsAnalysis' not in analyses:
-            return md
-
-        # Sheet
-        md = checkfield(md, 'fieldname', 'hydrology.pressure_melt_coefficient', 'numel', [1], '>=', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.sheet_conductivity', 'size', [md.mesh.numberofvertices], '>', 0, 'np.nan', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.cavity_spacing', 'numel', [1], '>', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.bump_height', 'size', [md.mesh.numberofvertices], '>=', 0, 'np.nan', 1, 'Inf', 1)
-        md = checkfield(md,'fieldname','hydrology.omega', 'numel', [1], '>=', 0); 
-        md = checkfield(md,'fieldname','hydrology.sheet_alpha', 'numel', [1], '>', 0); 
-        md = checkfield(md,'fieldname','hydrology.sheet_beta', 'numel', [1], '>', 0); 
-
-        # Channels
-        md = checkfield(md, 'fieldname', 'hydrology.ischannels', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'hydrology.channel_conductivity', 'size', [md.mesh.numberofvertices], '>', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.channel_sheet_width', 'numel', [1], '>=', 0)
-        md = checkfield(md,'fieldname','hydrology.channel_alpha', 'numel', [1], '>', 0); 
-        md = checkfield(md,'fieldname','hydrology.channel_beta', 'numel', [1], '>', 0); 
-
-        # Other
-        md = checkfield(md, 'fieldname', 'hydrology.spcphi', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.englacial_void_ratio', 'numel', [1], '>=', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.moulin_input', '>=', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.neumannflux', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.requested_outputs', 'stringrow', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.melt_flag', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'hydrology.istransition', 'numel', [1], 'values', [0, 1])
-        if self.melt_flag == 1 or self.melt_flag == 2:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        # Marshall model code first
-        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 5, 'format', 'Integer')
-
-       # Sheet
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'pressure_melt_coefficient', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'sheet_conductivity', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'cavity_spacing', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'bump_height', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','omega','format','Double'); 
-        WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','sheet_alpha','format','Double'); 
-        WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','sheet_beta','format','Double'); 
-
-        # Channels
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'ischannels', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'channel_conductivity', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'channel_sheet_width', 'format', 'Double')
-        WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','channel_alpha','format','Double'); 
-        WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','channel_beta','format','Double'); 
-
-        # Others
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'spcphi', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'neumannflux', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'moulin_input', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'englacial_void_ratio', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'melt_flag', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'istransition', 'format', 'Boolean')
-
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/hydrologypism.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologypism.m	(revision 28275)
+++ 	(revision )
@@ -1,56 +1,0 @@
-%HYDROLOGYPISM class definition
-%
-%   Usage:
-%      hydrologypism=hydrologypism();
-
-classdef hydrologypism
-	properties (SetAccess=public) 
-		drainage_rate   = NaN;
-		watercolumn_max = NaN;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = hydrologypism(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(self,varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'Watercolumn'};
-		end % }}}    
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('HydrologyPismAnalysis',analyses)
-				return;
-			end
-
-			md = checkfield(md,'fieldname','hydrology.drainage_rate','Inf',1,'NaN',1,'>=',0,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','friction.watercolumn_max','NaN',1,'Inf',1,'>',0.,'size',[md.mesh.numberofvertices 1]);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   hydrologypism solution parameters:'));
-			fielddisplay(self,'drainage_rate','fixed drainage rate [mm/yr]');
-			fielddisplay(self,'watercolumn_max','maximum water column height [m], recommended default: 2 m');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.hydrology.model','data',4,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','drainage_rate','format','DoubleMat','mattype',1,'scale',1./(1000.*yts)); %from mm/yr to m/s
-			WriteData(fid,prefix,'class','hydrology','object',self,'fieldname','watercolumn_max','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'data',{'Watercolumn'},'name','md.hydrology.requested_outputs','format','StringArray');
-		end % }}}
-	end
-end
-
Index: sm/trunk/src/m/classes/hydrologypism.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologypism.py	(revision 28275)
+++ 	(revision )
@@ -1,57 +1,0 @@
-import numpy as np
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class hydrologypism(object):
-    """
-    HydrologyPism class definition
-
-    Usage:
-      hydrologypism = hydrologypism()
-    """
-
-    def __init__(self):  # {{{
-        self.drainage_rate = np.nan
-        self.watercolumn_max = np.nan
-
-        # set defaults
-        self.setdefaultparameters()
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        list = ['Watercolumn']
-        return list
-
-    def setdefaultparameters(self):  # {{{
-        return self
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-
-        #Early return
-        if 'HydrologyPismAnalysis' not in analyses:
-            return
-
-        md = checkfield(md, 'fieldname', 'hydrology.drainage_rate', 'Inf', 1, 'NaN', 1, '>=', 0, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'friction.watercolumn_max', 'NaN', 1, 'Inf', 1, '>', 0., 'size', [md.mesh.numberofvertices])
-
-    def __repr__(self):  # {{{
-        string = '   hydrologypism solution parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'drainage_rate', 'fixed drainage rate [mm / yr]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'watercolumn_max', 'maximum water column height [m], recommended default: 2 m'))
-        return string
-        # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 4, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'drainage_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / (1000. * yts))  #from mm / yr to m / s
-        WriteData(fid, prefix, 'class', 'hydrology', 'object', self, 'fieldname', 'watercolumn_max', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'data', {'Watercolumn'}, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/hydrologyshakti.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshakti.m	(revision 28275)
+++ 	(revision )
@@ -1,114 +1,0 @@
-%HYDROLOGYSHAKTI class definition
-%
-%   Usage:
-%      hydrologyshakti=hydrologyshakti();
-
-classdef hydrologyshakti
-	properties (SetAccess=public) 
-		head            = NaN;
-		gap_height      = NaN;
-		bump_spacing    = NaN;
-		bump_height     = NaN;
-		englacial_input = NaN;
-		moulin_input    = NaN;
-		reynolds        = NaN;
-		spchead         = NaN;
-		neumannflux     = NaN;
-		relaxation      = 0;
-		storage         = 0;
-		requested_outputs = {};
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.head = project3d(md, 'vector', self.head , 'type', 'node');
-			self.gap_height = project3d(md, 'vector', self.gap_height, 'type', 'element');
-			self.bump_spacing = project3d(md, 'vector', self.bump_spacing, 'type', 'element');
-			self.bump_height = project3d(md, 'vector', self.bump_height, 'type', 'element');
-			self.englacial_input = project3d(md, 'vector', self.englacial_input, 'type', 'node');
-			self.moulin_input = project3d(md, 'vector', self.moulin_input, 'type', 'node');
-			self.reynolds = project3d(md, 'vector', self.reynolds, 'type', 'element');
-			self.neumannflux = project3d(md, 'vector', self.neumannflux, 'type', 'element');
-			self.spchead = project3d(md, 'vector', self.spchead, 'type', 'node');
-		end % }}}
-		function self = hydrologyshakti(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(self,varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'HydrologyHead','HydrologyGapHeight','EffectivePressure','HydrologyBasalFlux','DegreeOfChannelization'};
-		end % }}}    
-
-		function self = setdefaultparameters(self) % {{{
-			% Set under-relaxation parameter to be 1 (no under-relaxation of nonlinear iteration)	
-			self.relaxation=1;
-			self.storage=0;
-			self.requested_outputs={'default'};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('HydrologyShaktiAnalysis',analyses)
-				return;
-			end
-
-			md = checkfield(md,'fieldname','hydrology.head','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.gap_height','>=',0,'size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.bump_spacing','>',0,'size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.bump_height','>=',0,'size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.englacial_input','>=',0,'NaN',1,'Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','hydrology.moulin_input','>=',0,'NaN',1,'Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','hydrology.reynolds','>',0,'size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.neumannflux','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','hydrology.spchead','size',[md.mesh.numberofvertices 1]);	
-			md = checkfield(md,'fieldname','hydrology.relaxation','>=',0);	
-			md = checkfield(md,'fieldname','hydrology.storage','>=',0);
-			md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   hydrologyshakti solution parameters:'));
-			fielddisplay(self,'head','subglacial hydrology water head (m)');
-			fielddisplay(self,'gap_height','height of gap separating ice to bed (m)');
-			fielddisplay(self,'bump_spacing','characteristic bedrock bump spacing (m)');
-			fielddisplay(self,'bump_height','characteristic bedrock bump height (m)');
-			fielddisplay(self,'englacial_input','liquid water input from englacial to subglacial system (m/yr)');
-			fielddisplay(self,'moulin_input','liquid water input from moulins (at the vertices) to subglacial system (m^3/s)');
-			fielddisplay(self,'reynolds','Reynolds'' number');
-			fielddisplay(self,'neumannflux','water flux applied along the model boundary (m^2/s)');
-			fielddisplay(self,'spchead','water head constraints (NaN means no constraint) (m)');
-			fielddisplay(self,'relaxation','under-relaxation coefficient for nonlinear iteration');
-			fielddisplay(self,'storage','englacial storage coefficient (void ratio)');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.hydrology.model','data',3,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','head','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','gap_height','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','bump_spacing','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','bump_height','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','englacial_input','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','reynolds','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','neumannflux','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','spchead','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','relaxation','format','Double');
-			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','storage','format','Double');
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];  %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
-		end % }}}
-	end
-end
-
Index: sm/trunk/src/m/classes/hydrologyshakti.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshakti.py	(revision 28275)
+++ 	(revision )
@@ -1,108 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class hydrologyshakti(object):
-    """
-    HYDROLOGYSHAKTI class definition
-
-       Usage:
-          hydrologyshakti = hydrologyshakti()
-    """
-
-    def __init__(self):  # {{{
-        self.head = float('NaN')
-        self.gap_height = float('NaN')
-        self.bump_spacing = float('NaN')
-        self.bump_height = float('NaN')
-        self.englacial_input = float('NaN')
-        self.moulin_input = float('NaN')
-        self.reynolds = float('NaN')
-        self.spchead = float('NaN')
-        self.neumannflux = float('NaN')
-        self.relaxation = 0
-        self.storage = 0
-        self.requested_outputs = []
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-    def __repr__(self):  # {{{
-        string = '   hydrologyshakti solution parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'head', 'subglacial hydrology water head (m)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'gap_height', 'height of gap separating ice to bed (m)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'bump_spacing', 'characteristic bedrock bump spacing (m)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'bump_height', 'characteristic bedrock bump height (m)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'englacial_input', 'liquid water input from englacial to subglacial system (m / yr)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'moulin_input', 'liquid water input from moulins (at the vertices) to subglacial system (m^3 / s)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'reynolds', 'Reynolds'' number'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'neumannflux', 'water flux applied along the model boundary (m^2 / s)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'spchead', 'water head constraints (NaN means no constraint) (m)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'relaxation', 'under - relaxation coefficient for nonlinear iteration'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'storage', 'englacial storage coefficient (void ratio)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Set under - relaxation parameter to be 1 (no under - relaxation of nonlinear iteration)
-        self.relaxation = 1
-        self.storage = 0
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        list = ['HydrologyHead', 'HydrologyGapHeight', 'EffectivePressure', 'HydrologyBasalFlux', 'DegreeOfChannelization']
-        return list
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if 'HydrologyShaktiAnalysis' not in analyses:
-            return md
-
-        md = checkfield(md, 'fieldname', 'hydrology.head', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.gap_height', '>=', 0, 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.bump_spacing', '>', 0, 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.bump_height', '>=', 0, 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.englacial_input', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.moulin_input', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.reynolds', '>', 0, 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.neumannflux', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.spchead', 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'hydrology.relaxation', '>=', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.storage', '>=', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.requested_outputs', 'stringrow', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 3, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'head', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'gap_height', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'bump_spacing', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'bump_height', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'englacial_input', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'moulin_input', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'reynolds', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'neumannflux', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'spchead', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'relaxation', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'storage', 'format', 'Double')
-    #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/hydrologyshreve.js
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshreve.js	(revision 28275)
+++ 	(revision )
@@ -1,74 +1,0 @@
-class hydrologyshreve {//{{{
-	/**
-	 * HYDROLOGYSHREVE class definition
-	 *
-	 * Usage:
-	 *     hydrologyshreve = hydrologyshreve();
-	 */
-	constructor() {//{{{
-		this.spcwatercolumn = NaN;
-		this.stabilization = 0;
-		this.requested_outputs = [];
-
-		if (arguments.length == 0) {
-			this.setdefaultparameters();
-		} else {
-			error('constructor not supported');
-		}
-	} //}}}
-
-	disp() {//{{{
-		console.log(sprintf('   hydrologyshreve solution parameters:'));
-		fielddisplay(this, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]');
-		fielddisplay(this, 'stabilization', 'artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.');
-		fielddisplay(this, 'requested_outputs', 'additional outputs requested');
-	} //}}}
-
-	setdefaultparameters() {//{{{
-		// Type of stabilization to use 0:nothing 1:artificial_diffusivity
-		this.stabilization = 1;
-		this.requested_outputs = ['default'];
-	} //}}}
-
-	checkconsistency(md, solution, analyses) {//{{{
-		// Early return
-		if (!analyses.contains('HydrologyShreveAnalysis') || (solution == 'TransientSolution' && !md.transient.ishydrology)) {
-			return md;
-		}
-		md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1);
-		md = checkfield(md, 'fieldname', 'hydrology.stabilization', '>=', 0);
-		return md;
-	} //}}}
-
-	defaultoutputs(md) {//{{{
-		return ['Watercolumn', 'HydrologyWaterVx', 'HydrologyWaterVy'];
-	} //}}}
-
-	marshall(md, prefix, fid) {//{{{
-		WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts);
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'stabilization', 'format', 'Double');
-
-		// Process requested outputs
-		let outputs = this.requested_outputs;
-		let pos = find(ismember(outputs, 'default'));
-		if (pos.length) {
-			/*
-			NOTE: In order to handle case where user has added 'default' more 
-			than once to this.requested_outputs, need to remove elements by 
-			index in reverse order.
-			*/
-			for (let i = (pos.length - 1); i >= 0; --i) {
-				outputs.splice(pos[i], 1);
-			}
-			let default_outputs = this.defaultoutputs(md);
-			for (let i = 0; i < default_outputs.length; ++i) {
-				outputs.push(default_outputs[i]);
-			}
-		}
-		WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray');
-	} //}}}
-
-	extrude(md) {//{{{
-	} //}}}
-} //}}}
Index: sm/trunk/src/m/classes/hydrologyshreve.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshreve.m	(revision 28275)
+++ 	(revision )
@@ -1,68 +1,0 @@
-%HYDROLOGYSHREVE class definition
-%
-%   Usage:
-%      hydrologyshreve=hydrologyshreve();
-
-classdef hydrologyshreve
-	properties (SetAccess=public) 
-		spcwatercolumn     = NaN;
-		stabilization      = 0;
-		requested_outputs  = {};
-	end
-	methods
-		function self = hydrologyshreve(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(self,varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   hydrologyshreve solution parameters:'));
-			fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
-			fielddisplay(self,'stabilization','artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Type of stabilization to use 0:nothing 1:artificial_diffusivity
-			self.stabilization     = 1;
-			self.requested_outputs = {'default'};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if ~ismember('HydrologyShreveAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.ishydrology==0), return; end
-
-			md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','hydrology.stabilization','>=',0);
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'Watercolumn','HydrologyWaterVx','HydrologyWaterVy'};
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.hydrology.model','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Double');
-			outputs = self.requested_outputs;
-			pos = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = []; %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.hydrology.spcwatercolumn'],self.spcwatercolumn);
-			writejsdouble(fid,[modelname '.hydrology.stabilization'],self.stabilization);
-
-		end % }}}
-	end
-end
-
Index: sm/trunk/src/m/classes/hydrologyshreve.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshreve.py	(revision 28275)
+++ 	(revision )
@@ -1,71 +1,0 @@
-import numpy as np
-
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class hydrologyshreve(object):
-    """HYDROLOGYSHREVE class definition
-
-    Usage:
-        hydrologyshreve = hydrologyshreve()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.spcwatercolumn = np.nan
-        self.stabilization = 0
-        self.requested_outputs = []
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            self.setdefaultparameters(args)
-        else:
-            raise RuntimeError('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   hydrologyshreve solution parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'stabilization', 'artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.'))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Type of stabilization to use 0:nothing 1:artificial_diffusivity
-        self.stabilization = 1
-        self.requested_outputs = ['default']
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if 'HydrologyShreveAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.ishydrology):
-            return md
-
-        md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'hydrology.stabilization', '>=', 0)
-        return md
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['Watercolumn', 'HydrologyWaterVx', 'HydrologyWaterVy']
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Double')
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices):
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/hydrologytws.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologytws.m	(revision 28275)
+++ 	(revision )
@@ -1,63 +1,0 @@
-%HYDROLOGYTWS class definition
-%
-%   Usage:
-%      hydrologytws=hydrologytws();
-
-classdef hydrologytws
-	properties (SetAccess=public) 
-		spcwatercolumn     = NaN;
-		requested_outputs  = {};
-	end
-	methods
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = hydrologytws(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(self,varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {''};
-		end % }}}
-
-		function self = setdefaultparameters(self) % {{{
-			self.requested_outputs = {'default'};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('HydrologyTwsAnalysis',analyses)
-				return;
-			end
-			md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   hydrologytws solution parameters:'));
-			fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.hydrology.model','data',6,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];  %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.hydrology.spcwatercolumn'],self.spcwatercolumn);
-
-		end % }}}
-	end
-end
-
Index: sm/trunk/src/m/classes/hydrologytws.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologytws.py	(revision 28275)
+++ 	(revision )
@@ -1,64 +1,0 @@
-import numpy as np
-
-from structtoobj import structtoobj
-
-class hydrologytws(object):
-    """HYDROLOGYTWS class definition
-
-    Usage:
-        hydrologytws = hydrologytws()
-    """
-
-    def __init__(self):  # {{{
-        self.spcwatercolumn = np.nan
-        self.requested_outputs = np.nan
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            self = structtoobj(self, args[0])
-        else:
-            raise RuntimeError('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   hydrologytws solution parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['']
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.requested_outputs = ['defualt']
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'HydrologyTwsAnalysis' not in analyses:
-            return
-        md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1)
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 6, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        outputs = self.requested_outputs
-        pos  = find(ismember(outputs,'default'))
-        if not len(pos):
-            outputs[pos] = [];  # remove 'default' from outputs
-            outputs.extend(defaultoutputs(self, md)) # add defaults
-        end
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
-    # }}}
-
-
Index: sm/trunk/src/m/classes/independent.m
===================================================================
--- /issm/trunk/src/m/classes/independent.m	(revision 28275)
+++ 	(revision )
@@ -1,91 +1,0 @@
-%INDEPENDENT class definition
-%
-%   Usage:
-%      independent=independent();
-
-classdef independent
-	properties (SetAccess=public) 
-		name			               = '';
-		type					         = '';
-		fos_forward_index			   = NaN;
-		fov_forward_indices			= [];
-		nods								= 0;
-		min_parameters					= NaN;
-		max_parameters					= NaN;
-		control_scaling_factor     = NaN;
-		control_size					= 0;
-
-	end
-	methods
-		function self = independent(varargin) % {{{
-
-			%use provided options to change fields
-			options=pairoptions(varargin{:});
-
-			%OK get other fields
-			self=AssignObjectFields(pairoptions(varargin{:}),self);
-
-			if(self.control_size == 0)
-				self.control_size = 1;
-			end
-
-
-		end
-		%}}}
-		function self = setdefaultparameters(self) % {{{
-			%do nothing
-
-		end % }}}
-		function md = checkconsistency(self,md,i,solution,analyses,driver) % {{{
-			if ~isnan(self.fos_forward_index),
-				if ~strcmpi(driver,'fos_forward'),
-					error('cannot declare an independent with a fos_forward_index when the driver is not fos_forward!');
-				end
-				if self.nods==0,
-					error('independent checkconsistency error: nods should be set to the size of the independent variable');
-				end
-			end
-
-			if ~isempty(self.fov_forward_indices),
-				if ~strcmpi(driver,'fov_forward'),
-					error('cannot declare an independent with fov_forward_indices when the driver is not fov_forward!');
-				end
-				if self.nods==0,
-					error('independent checkconsistency error: nods should be set to the size of the independent variable');
-				end
-				md = checkfield(md,'fieldname',['autodiff.independents{' num2str(i) '}.fov_forward_indices'],'>=',1,'<=',self.nods,'size',[NaN 1]);
-				%md = checkfield(md,'fieldname',['autodiff.independents{' num2str(i) '}.min_parameters'],'size',[md.mesh.numberofvertices 1]);
-				%md = checkfield(md,'fieldname',['autodiff.independents{' num2str(i) '}.max_parameters'],'size',[md.mesh.numberofvertices 1]);
-				%md = checkfield(md,'fieldname',['autodiff.independents{' num2str(i) '}.control_scaling_factors'],'size',[1 1],'>',0,'NaN',1,'Inf',1);
-
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   independent variable:'));
-
-			fielddisplay(self,'name','variable name (must match corresponding String)');
-			fielddisplay(self,'type','type of variable (''vertex'' or ''scalar'')');
-			fielddisplay(self,'nods','size of independent variables');
-			fielddisplay(self,'control_size','number of timesteps');
-			fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'control_scaling_factor','order of magnitude of each control (useful for multi-parameter optimization)');
-			if ~isnan(self.fos_forward_index),
-				fielddisplay(self,'fos_forward_index','index for fos_foward driver of ADOLC');
-			end
-			if ~isnan(self.fov_forward_indices),
-				fielddisplay(self,'fov_forward_indices','indices for fov_foward driver of ADOLC');
-			end
-		end % }}}
-		function scalartype=typetoscalar(self) % {{{
-			if strcmpi(self.type,'scalar'),
-				scalartype=0;
-			elseif strcmpi(self.type,'vertex'),
-				scalartype=1;
-			elseif strcmpi(self.type,'matrix'),
-				scalartype=1;
-			else error([self.type ' not supported yet!']);
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/independent.py
===================================================================
--- /issm/trunk/src/m/classes/independent.py	(revision 28275)
+++ 	(revision )
@@ -1,90 +1,0 @@
-import numpy as np
-from pairoptions import pairoptions
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from MatlabFuncs import *
-
-
-class independent(object):
-    """independent class definition
-
-    Usage:
-        independent = independent()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.name = ''
-        self.type = ''
-        self.fos_forward_index = np.nan
-        self.fov_forward_indices = np.array([])
-        self.nods = 0
-        self.min_parameters = np.nan
-        self.max_parameters = np.nan
-        self.control_scaling_factor = np.nan
-        self.control_size = 0
-
-        # Set defaults
-        self.setdefaultparameters()
-
-        # Use provided options to change fields
-        options = pairoptions(*args)
-
-        # Get other fields
-        self = options.AssignObjectFields(self)
-
-        if self.control_size == 0:
-            self.control_size = 1
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   independent variable:\n'
-
-        s += '{}\n'.format(fielddisplay(self, 'name', 'variable name (must match corresponding String)'))
-        s += '{}\n'.format(fielddisplay(self, 'type', 'type of variable (\'vertex\' or \'scalar\')'))
-        s += '{}\n'.format(fielddisplay(self, 'nods', 'size of independent variables'))
-        s += '{}\n'.format(fielddisplay(self, 'control_size', 'number of timesteps'))
-        s += '{}\n'.format(fielddisplay(self, 'min_parameters', 'absolute minimum acceptable value of the inversed parameter on each vertex'))
-        s += '{}\n'.format(fielddisplay(self, 'max_parameters', 'absolute maximum acceptable value of the inversed parameter on each vertex'))
-        s += '{}\n'.format(fielddisplay(self, 'control_scaling_factor', 'order of magnitude of each control (useful for multi-parameter optimization)'))
-        if not np.isnan(self.fos_forward_index):
-            s += '{}\n'.format(fielddisplay(self, 'fos_forward_index', 'index for fos_foward driver of ADOLC'))
-        if np.any(np.logical_not(np.isnan(self.fov_forward_indices))):
-            s += '{}\n'.format(fielddisplay(self, 'fov_forward_indices', 'indices for fov_foward driver of ADOLC'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Do nothing
-        return self
-    # }}}
-
-    def checkconsistency(self, md, i, solution, analyses, driver):  # {{{
-        if not np.isnan(self.fos_forward_index):
-            if not strcmpi(driver, 'fos_forward'):
-                raise TypeError('cannot declare an independent with a fos_forward_index when the driver is not fos_forward!')
-            if self.nods == 0:
-                raise TypeError('independent checkconsistency error: nods should be set to the size of the independent variable')
-
-        if len(self.fov_forward_indices) > 0:
-            if not strcmpi(driver, 'fov_forward'):
-                raise TypeError('cannot declare an independent with fov_forward_indices when the driver is not fov_forward!')
-            if self.nods == 0:
-                raise TypeError('independent checkconsistency error: nods should be set to the size of the independent variable')
-            md = checkfield(md, 'fieldname', 'autodiff.independents[%d].fov_forward_indices' % i, '>=', 1, '<=', self.nods)
-
-        return md
-    # }}}
-
-    def typetoscalar(self):  # {{{
-        if strcmpi(self.type, 'scalar'):
-            scalartype = 0
-        elif strcmpi(self.type, 'vertex'):
-            scalartype = 1
-        elif strcmpi(self.type, 'matrix'):
-            scalartype = 1
-        else:
-            raise TypeError('{} not supported yet!'.format(self.type))
-
-        return scalartype
-    # }}}
Index: sm/trunk/src/m/classes/initialization.js
===================================================================
--- /issm/trunk/src/m/classes/initialization.js	(revision 28275)
+++ 	(revision )
@@ -1,207 +1,0 @@
-//INITIALIZATION class definition
-//
-//   Usage:
-//      initialization=new initialization();
-
-function initialization (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   initial field values:'));
-
-		fielddisplay(this,'vx','x component of velocity [m/yr]');
-		fielddisplay(this,'vy','y component of velocity [m/yr]');
-		fielddisplay(this,'vz','z component of velocity [m/yr]');
-		fielddisplay(this,'vel','velocity norm [m/yr]');
-		fielddisplay(this,'pressure','pressure field [Pa]');
-		fielddisplay(this,'temperature','temperature [K]');
-		fielddisplay(this,'enthalpy','enthalpy [J]');
-		fielddisplay(this,'waterfraction','fraction of water in the ice');
-		fielddisplay(this,'sediment_head','sediment water head of subglacial system [m]');
-		fielddisplay(this,'epl_head','epl water head of subglacial system [m]');
-		fielddisplay(this,'epl_thickness','epl layer thickness [m]');
-		fielddisplay(this,'watercolumn','subglacial water sheet thickness (for Shreve and GlaDS) [m]');
-		fielddisplay(this,'hydraulic_potential','Hydraulic potential (for GlaDS) [Pa]');
-		fielddisplay(this,'channelarea','subglacial water channel area (for GlaDS) [m2]');
-		fielddisplay(this,'sample','Realization of a Gaussian random field');
-		fielddisplay(this,'bottompressure','Bottom pressures');
-		fielddisplay(this,'dsl','Dynamic sea level.');
-		fielddisplay(this,'str','Steric sea level.');
-
-	}// }}}
-    this.extrude = function(md) {//{{{
-        this.vx=project3d(md,'vector',this.vx,'type','node');
-        this.vy=project3d(md,'vector',this.vy,'type','node');
-        this.vz=project3d(md,'vector',this.vz,'type','node');
-        this.vel=project3d(md,'vector',this.vel,'type','node');
-        this.temperature=project3d(md,'vector',this.temperature,'type','node');
-        this.waterfraction=project3d(md,'vector',this.waterfraction,'type','node');
-        this.watercolumn=project3d(md,'vector',this.watercolumn,'type','node','layer',1);
-        this.sediment_head=project3d(md,'vector',this.sediment_head,'type','node','layer',1);
-        this.epl_head=project3d(md,'vector',this.epl_head,'type','node','layer',1);
-        this.epl_thickness=project3d(md,'vector',this.epl_thickness,'type','node','layer',1);
-
-        //Lithostatic pressure by default
-        this.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
-        return this;
-    }//}}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-			if(ArrayAnyEqual(ArrayIsMember('StressbalanceAnalysis',analyses),1)){
-				if (!(isNaN(md.initialization.vx) | isNaN(md.initialization.vy))){
-					checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-					checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				}
-			}
-			if(ArrayAnyEqual(ArrayIsMember('MasstransportAnalysis',analyses),1)){
-				checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			}
-			if(ArrayAnyEqual(ArrayIsMember('OceantransportAnalysis',analyses),1)){
-				if (strcmp(solution,'TransientSolution') && md.transient.isslc && md.transient.isoceantransport) {
-					checkfield(md,'fieldname','initialization.bottompressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-					checkfield(md,'fieldname','initialization.dsl','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-					checkfield(md,'fieldname','initialization.str','NaN',1,'Inf',1,'size',[1, 1]);
-				}
-			}
-			if(ArrayAnyEqual(ArrayIsMember('BalancethicknessSolution',analyses),1) & (solution=='BalancethicknessSolution')){
-				checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				//Triangle with zero velocity
-				for(var i=0;i<md.mesh.numberofelements;i++){
-					var sum=0;
-					for(var j=0;j<md.mesh.elements[0].length;j++){
-						if  ((md.initialization.vx[md.mesh.elements[i][j]-1]==0) & (md.initialization.vy[md.mesh.elements[i][j]-1]==0)) sum+=1;
-					}
-					if (sum==md.mesh.elements[0].length){
-						md.checkmessage('at least one triangle has all its vertices with a zero velocity');
-					}
-				}
-			}
-			if ((ArrayAnyEqual(ArrayIsMember('ThermalAnalysis',analyses),1)) && !strcmp(solution,'TransientSolution') && md.transient.isthermal == 0){
-				checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				if (md.mesh.dimension()==3) {
-					checkfield(md,'fieldname','initialization.vz','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				}
-				checkfield(md,'fieldname','initialization.pressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size','universal');
-			}
-			if (ArrayAnyEqual(ArrayIsMember('EnthalpyAnalysis',analyses),1) && md.thermal.isenthalpy){
-				checkfield(md,'fieldname','initialization.waterfraction','>=',0,'size','universal');
-				checkfield(md,'fieldname','initialization.watercolumn'  ,'>=',0,'size','universal');
-			}
-			if (ArrayAnyEqual(ArrayIsMember('HydrologyShreveAnalysis',analyses),1)){
-				if (md.hydrology.type() == 'hydrologyshreve'){
-					checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
-				}
-			}
-			if (ArrayAnyEqual(ArrayIsMember('HydrologyTwsAnalysis',analyses),1)){
-				if (md.hydrology.type() == 'hydrologytws'){
-					checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
-				}
-			}
-			if (ArrayAnyEqual(ArrayIsMember('SealevelchangeAnalysis',analyses),1)){
-				if (strcmp(solution,'TransientSolution') && md.transient.isslc) {
-					checkfield(md,'fieldname','initialization.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				}
-			}
-			if (ArrayAnyEqual(ArrayIsMember('HydrologyGlaDSAnalysis',analyses),1)){
-				if (md.hydrology.type() == 'hydrologyglads'){
-					checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-					checkfield(md,'fieldname','initialization.hydraulic_potential','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-					checkfield(md,'fieldname','initialization.channelarea','NaN',1,'Inf',1,'>=',0,'size',[md.mesh.numberofedges, 1]);
-				}
-			}
-			if (ArrayAnyEqual(ArrayIsMember('HydrologyDCInefficientAnalysis',analyses),1)){
-				if (md.hydrology.type() == 'hydrologydc'){
-					checkfield(md,'fieldname','initialization.sediment_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				}
-			}
-			if (ArrayAnyEqual(ArrayIsMember('HydrologyDCEfficientAnalysis',analyses),1)){
-				if (md.hydrology.type() == 'hydrologydc'){
-					if (md.hydrology.isefficientlayer==1){
-						checkfield(md,'fieldname','initialization.epl_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
-						checkfield(md,'fieldname','initialization.epl_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
-					}
-				}
-			}
-			if (ArrayAnyEqual(ArrayIsMember('SamplingAnalysis',analyses),1) && !strcmp(solution,'TransientSolution')&& md.transient.issampling == 0){
-				if (!isNaN(md.initialization.sample)) {
-					checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				}
-			}
-		} //}}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			var yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',this,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',this,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',this,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',this,'fieldname','pressure','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','sealevel','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',this,'fieldname','bottompressure','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','str','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','dsl','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','temperature','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','waterfraction','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','sediment_head','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','epl_head','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','epl_thickness','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','watercolumn','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','channelarea','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','hydraulic_potential','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','sample','format','DoubleMat','mattype',1);
-
-			if (md.thermal.isenthalpy){
-				let enthalpy;
-				if (isNaN(self.enthalpy) && this.enthalpy.length <= 1) {
-					tpmp=NewArrayFill(md.mesh.numberofvertices,0);
-					for (var i=0;i<md.mesh.numberofvertices;i++) tpmp[i]= md.materials.meltingpoint - md.materials.beta*md.initialization.pressure[i];
-					enthalpy=NewArrayFill(md.mesh.numberofvertices,0); 
-					for (var i=0;i<md.mesh.numberofvertices;i++)enthalpy[i] = md.materials.heatcapacity*(md.initialization.temperature[i]-md.constants.referencetemperature);
-					for (var i=0;i<md.mesh.numberofvertices;i++)if(md.initialization.temperature[i]>=tpmp[i]){
-						enthalpy[i] = md.materials.heatcapacity*(tpmp[i] - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction[i];
-					}
-				} else {
-					enthalpy = this.enthalpy;
-				}
-				WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy');
-			}
-		}//}}}
-		this.fix=function(md) { //{{{
-			this.vx=FloatFix(this.vx,md.mesh.numberofvertices); 
-			this.vy=FloatFix(this.vx,md.mesh.numberofvertices); 
-			this.vy=FloatFix(this.vx,md.mesh.numberofvertices); 
-			this.waterfraction=NullFix(this.waterfraction,NaN);
-			this.sediment_head=NullFix(this.sediment_head,NaN);
-			this.epl_head=NullFix(this.epl_head,NaN);
-			this.epl_thickness=NullFix(this.epl_thickness,NaN);
-			this.watercolumn=NullFix(this.watercolumn,NaN);
-		}//}}}
-	//properties 
-	// {{{
-	this.vx                  = NaN;
-	this.vy                  = NaN;
-	this.vz                  = NaN;
-	this.vel                 = NaN;
-	this.pressure            = NaN;
-	this.temperature         = NaN;
-	this.enthalpy            = NaN;
-	this.waterfraction       = NaN;
-	this.sediment_head       = NaN;
-	this.epl_head            = NaN;
-	this.epl_thickness       = NaN;
-	this.watercolumn         = NaN;
-	this.hydraulic_potential = NaN;
-	this.channelarea         = NaN;
-	this.sealevel            = NaN;
-	this.bottompressure      = NaN;
-	this.dsl                 = NaN;
-	this.str                 = NaN;
-	this.sample              = NaN;
-	this.setdefaultparameters();
-
-	//}}}
-}
Index: sm/trunk/src/m/classes/initialization.m
===================================================================
--- /issm/trunk/src/m/classes/initialization.m	(revision 28275)
+++ 	(revision )
@@ -1,243 +1,0 @@
-%INITIALIZATION class definition
-%
-%   Usage:
-%      initialization=initialization();
-
-classdef initialization
-	properties (SetAccess=public) 
-		vx                  = NaN;
-		vy                  = NaN;
-		vz                  = NaN;
-		vel                 = NaN;
-		pressure            = NaN;
-		temperature         = NaN;
-		enthalpy            = NaN;
-		waterfraction       = NaN;
-		sediment_head       = NaN;
-		epl_head            = NaN;
-		epl_thickness       = NaN;
-		watercolumn         = NaN;
-		hydraulic_potential = NaN;
-		channelarea         = NaN;
-		sealevel            = NaN;
-		bottompressure      = NaN;
-		dsl                 = NaN;
-		str                 = NaN;
-		sample              = NaN;
-		debris              = NaN;
-		age                 = NaN;
-	end
-	methods
-		function self = initialization(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			if ismember('StressbalanceAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isstressbalance == 0),
-				if numel(md.initialization.vx)>1 | numel(md.initialization.vy)>1
-					md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-					md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				end
-			end
-			if ismember('MasstransportAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.ismasstransport == 0),
-				md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			end
-			if ismember('OceantransportAnalysis',analyses) 
-				if strcmp(solution,'TransientSolution') & md.transient.isslc & md.transient.isoceantransport,
-					md = checkfield(md,'fieldname','initialization.bottompressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-					md = checkfield(md,'fieldname','initialization.dsl','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-					md = checkfield(md,'fieldname','initialization.str','NaN',1,'Inf',1,'size',[1 1]);
-				end
-			end
-			if ismember('BalancethicknessAnalysis',analyses) & strcmp(solution,'BalancethicknessSolution'),
-				md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				%Triangle with zero velocity
-				if any(sum(abs(md.initialization.vx(md.mesh.elements)),2)==0 & sum(abs(md.initialization.vy(md.mesh.elements)),2)==0 & min(md.mask.ice_levelset(md.mesh.elements),[],2)<0)
-					md = checkmessage(md,'at least one triangle has all its vertices with a zero velocity');
-				end
-			end
-			if ismember('ThermalAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isthermal == 0),
-				md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				if dimension(md.mesh)==3
-					md = checkfield(md,'fieldname','initialization.vz','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				end
-				md = checkfield(md,'fieldname','initialization.pressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size','universal');
-			end
-			if (ismember('EnthalpyAnalysis',analyses) & md.thermal.isenthalpy)
-				md = checkfield(md,'fieldname','initialization.waterfraction','>=',0,'size','universal');
-				md = checkfield(md,'fieldname','initialization.watercolumn'  ,'>=',0,'size','universal');
-				pos=find(md.initialization.waterfraction>0.);
-				if(~isempty(pos)),
-					%md = checkfield(md,'fieldname', 'delta Tpmp', 'field',abs(md.initialization.temperature(pos)-(md.materials.meltingpoint-md.materials.beta*md.initialization.pressure(pos))),'<',1e-11,...
-					%'message','set temperature to pressure melting point at locations with waterfraction>0');
-				end
-			end
-			if ismember('HydrologyShreveAnalysis',analyses),
-				if isa(md.hydrology,'hydrologyshreve'),
-					if (strcmp(solution,'TransientSolution') & md.transient.ishydrology) | strcmp(solution,'HydrologySolution'),
-						md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-					end
-				end
-			end
-			if ismember('HydrologyTwsAnalysis',analyses),
-				if isa(md.hydrology,'hydrologytws'),
-					md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				end
-			end
-			if ismember('SealevelchangeAnalysis',analyses),
-				if strcmp(solution,'TransientSolution') & md.transient.isslc,
-					md = checkfield(md,'fieldname','initialization.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				end
-			end
-			if ismember('HydrologyGlaDSAnalysis',analyses),
-				if isa(md.hydrology,'hydrologyglads'),
-					md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-					md = checkfield(md,'fieldname','initialization.hydraulic_potential','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-					md = checkfield(md,'fieldname','initialization.channelarea','NaN',1,'Inf',1,'>=',0,'size',[md.mesh.numberofedges 1]);
-				end
-			end
-			if ismember('HydrologyDCInefficientAnalysis',analyses),
-				if isa(md.hydrology,'hydrologydc'),
-					md = checkfield(md,'fieldname','initialization.sediment_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				end
-			end
-			if ismember('HydrologyDCEfficientAnalysis',analyses),
-				if isa(md.hydrology,'hydrologydc'),
-					if md.hydrology.isefficientlayer==1,
-						md = checkfield(md,'fieldname','initialization.epl_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-						md = checkfield(md,'fieldname','initialization.epl_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-					end
-				end
-			end
-			if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0),
-				if ~isnan(md.initialization.sample)
-					md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				end
-			end
-			if ismember('DebrisAnalysis',analyses),
-				if ~isnan(md.initialization.debris)
-					md = checkfield(md,'fieldname','initialization.debris','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				end
-			end
-			if ismember('AgeAnalysis',analyses),
-				if ~isnan(md.initialization.age)
-					md = checkfield(md,'fieldname','initialization.age','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				end
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   initial field values:'));
-
-			fielddisplay(self,'vx','x component of velocity [m/yr]');
-			fielddisplay(self,'vy','y component of velocity [m/yr]');
-			fielddisplay(self,'vz','z component of velocity [m/yr]');
-			fielddisplay(self,'vel','velocity norm [m/yr]');
-			fielddisplay(self,'pressure','pressure field [Pa]');
-			fielddisplay(self,'temperature','temperature [K]');
-			fielddisplay(self,'enthalpy','enthalpy [J]');
-			fielddisplay(self,'waterfraction','fraction of water in the ice');
-			fielddisplay(self,'sediment_head','sediment water head of subglacial system [m]');
-			fielddisplay(self,'epl_head','epl water head of subglacial system [m]');
-			fielddisplay(self,'epl_thickness','epl layer thickness [m]');
-			fielddisplay(self,'watercolumn','subglacial water sheet thickness (for Shreve and GlaDS) [m]');
-			fielddisplay(self,'hydraulic_potential','Hydraulic potential (for GlaDS) [Pa]');
-			fielddisplay(self,'channelarea','subglacial water channel area (for GlaDS) [m2]');
-			fielddisplay(self,'sample','Realization of a Gaussian random field');
-			fielddisplay(self,'bottompressure','Bottom pressures');
-			fielddisplay(self,'dsl','Dynamic sea level.');
-			fielddisplay(self,'str','Steric sea level.');
-			fielddisplay(self,'debris','Surface debris layer [m]');
-			fielddisplay(self,'age','Initial age [yr]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','sealevel','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','bottompressure','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','str','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','dsl','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','temperature','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','waterfraction','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','sediment_head','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','epl_head','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','epl_thickness','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','watercolumn','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','channelarea','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','hydraulic_potential','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','debris','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','age','format','DoubleMat','mattype',1,'scale',yts);
-
-			if md.thermal.isenthalpy,
-				if numel(self.enthalpy) <= 1,
-					%reconstruct enthalpy
-					tpmp = md.materials.meltingpoint - md.materials.beta*md.initialization.pressure;
-					pos  = find(md.initialization.waterfraction>0.);
-					enthalpy      = md.materials.heatcapacity*(md.initialization.temperature-md.constants.referencetemperature);
-					enthalpy(pos) = md.materials.heatcapacity*(tpmp(pos) - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction(pos);
-				else
-					enthalpy = self.enthalpy;
-				end
-				WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.vx=project3d(md,'vector',self.vx,'type','node');
-			self.vy=project3d(md,'vector',self.vy,'type','node');
-			self.vz=project3d(md,'vector',self.vz,'type','node');
-			self.vel=project3d(md,'vector',self.vel,'type','node');
-			self.temperature=project3d(md,'vector',self.temperature,'type','node');
-			self.enthalpy=project3d(md,'vector',self.enthalpy,'type','node');
-			self.waterfraction=project3d(md,'vector',self.waterfraction,'type','node');
-			self.watercolumn=project3d(md,'vector',self.watercolumn,'type','node','layer',1);
-			self.sediment_head=project3d(md,'vector',self.sediment_head,'type','node','layer',1);
-			self.epl_head=project3d(md,'vector',self.epl_head,'type','node','layer',1);
-			self.epl_thickness=project3d(md,'vector',self.epl_thickness,'type','node','layer',1);
-			self.sealevel=project3d(md,'vector',self.sealevel,'type','node','layer',1);
-			self.bottompressure=project3d(md,'vector',self.bottompressure,'type','node','layer',1);
-			self.dsl=project3d(md,'vector',self.dsl,'type','node','layer',1);
-			self.str=project3d(md,'vector',self.str,'type','node','layer',1);
-			self.str=project3d(md,'vector',self.debris,'type','node','layer',1);
-			self.str=project3d(md,'vector',self.age,'type','node','layer',1);
-
-			%Lithostatic pressure by default
-			self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.initialization.vx'],self.vx);
-			writejs1Darray(fid,[modelname '.initialization.vy'],self.vy);
-			writejs1Darray(fid,[modelname '.initialization.vz'],self.vz);
-			writejs1Darray(fid,[modelname '.initialization.vel'],self.vel);
-			writejs1Darray(fid,[modelname '.initialization.pressure'],self.pressure);
-			writejs1Darray(fid,[modelname '.initialization.temperature'],self.temperature);
-			writejs1Darray(fid,[modelname '.initialization.enthalpy'],self.enthalpy);
-			writejs1Darray(fid,[modelname '.initialization.waterfraction'],self.waterfraction);
-			writejs1Darray(fid,[modelname '.initialization.sediment_head'],self.sediment_head);
-			writejs1Darray(fid,[modelname '.initialization.epl_head'],self.epl_head);
-			writejs1Darray(fid,[modelname '.initialization.epl_thickness'],self.epl_thickness);
-			writejs1Darray(fid,[modelname '.initialization.watercolumn'],self.watercolumn);
-			writejs1Darray(fid,[modelname '.initialization.hydraulic_potential'],self.hydraulic_potential);
-			writejs1Darray(fid,[modelname '.initialization.channel'],self.channelarea);
-			writejs1Darray(fid,[modelname '.initialization.sample'],self.sample);
-			writejs1Darray(fid,[modelname '.initialization.debris'],self.debris);
-			writejs1Darray(fid,[modelname '.initialization.age'],self.age);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/initialization.py
===================================================================
--- /issm/trunk/src/m/classes/initialization.py	(revision 28275)
+++ 	(revision )
@@ -1,199 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class initialization(object):
-    """initialization class definition
-
-    Usage:
-        initialization = initialization()
-    """
-
-    def __init__(self):  #{{{
-        self.vx                  = np.nan
-        self.vy                  = np.nan
-        self.vz                  = np.nan
-        self.vel                 = np.nan
-        self.pressure            = np.nan
-        self.temperature         = np.nan
-        self.enthalpy            = np.nan
-        self.waterfraction       = np.nan
-        self.sediment_head       = np.nan
-        self.epl_head            = np.nan
-        self.epl_thickness       = np.nan
-        self.watercolumn         = np.nan
-        self.hydraulic_potential = np.nan
-        self.channelarea         = np.nan
-        self.sealevel            = np.nan
-        self.bottompressure      = np.nan
-        self.dsl                 = np.nan
-        self.str                 = np.nan
-        self.sample              = np.nan
-        self.debris              = np.nan
-        self.age                 = np.nan
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = '   initial field values:\n'
-        s += '{}\n'.format(fielddisplay(self, 'vx', 'x component of velocity [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vy', 'y component of velocity [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vz', 'z component of velocity [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vel', 'velocity norm [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'pressure', 'pressure [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'temperature', 'temperature [K]'))
-        s += '{}\n'.format(fielddisplay(self, 'enthalpy', 'enthalpy [J]'))
-        s += '{}\n'.format(fielddisplay(self, 'waterfraction', 'fraction of water in the ice'))
-        s += '{}\n'.format(fielddisplay(self, 'watercolumn', 'thickness of subglacial water [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'sediment_head', 'sediment water head of subglacial system [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'epl_head', 'epl water head of subglacial system [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'epl_thickness', 'thickness of the epl [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'hydraulic_potential', 'Hydraulic potential (for GlaDS) [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'channelarea', 'subglaciale water channel area (for GlaDS) [m2]'))
-        s += '{}\n'.format(fielddisplay(self, 'sample', 'Realization of a Gaussian random field'))
-        s += '{}\n'.format(fielddisplay(self, 'debris', 'Surface debris layer [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'age', 'Initial age [yr]'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        return
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        if 'StressbalanceAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isstressbalance:
-            if not np.any(np.logical_or(np.isnan(md.initialization.vx), np.isnan(md.initialization.vy))):
-                if np.size(md.initialization.vx) > 1 or np.size(md.initialization.vy) > 1:
-                    md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-                    md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport:
-            md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'OceantransportAnalysis' in analyses:
-            if solution == 'TransientSolution' and md.transient.isslc and md.transient.isoceantransport:
-                md = checkfield(md, 'fieldname', 'initialization.bottompressure', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-                md = checkfield(md, 'fieldname', 'initialization.dsl', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-                md = checkfield(md, 'fieldname', 'initialization.str', 'NaN', 1, 'Inf', 1, 'size', [1])
-        if 'BalancethicknessAnalysis' in analyses and solution == 'BalancethicknessSolution':
-            md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            # Triangle with zero velocity
-            if np.any(np.logical_and(np.sum(np.abs(md.initialization.vx[md.mesh.elements - 1]), axis=1).reshape(-1, 1) == 0, np.sum(np.abs(md.initialization.vy[md.mesh.elements - 1]), axis=1).reshape(-1, 1) == 0, np.min(md.mask.ice_levelset[md.mesh.elements - 1], axis=1).reshape(-1, 1) < 0)):
-                md.checkmessage('at least one triangle has all its vertices with a zero velocity')
-        if 'ThermalAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isthermal:
-            md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'initialization.temperature', 'NaN', 1, 'Inf', 1, 'size', 'universal')
-            if md.mesh.dimension() == 3:
-                md = checkfield(md, 'fieldname', 'initialization.vz', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'initialization.pressure', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'EnthalpyAnalysis' in analyses and md.thermal.isenthalpy:
-            md = checkfield(md, 'fieldname', 'initialization.waterfraction', '>=', 0, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'initialization.watercolumn', '>=', 0, 'size', [md.mesh.numberofvertices])
-            pos = np.nonzero(md.initialization.waterfraction > 0.)[0]
-            if(pos.size):
-                md = checkfield(md, 'fieldname', 'delta Tpmp', 'field', np.absolute(md.initialization.temperature[pos] - (md.materials.meltingpoint - md.materials.beta * md.initialization.pressure[pos])), '<', 1e-11, 'message', 'set temperature to pressure melting point at locations with waterfraction > 0')
-        if 'HydrologyShreveAnalysis' in analyses:
-            if type(md.hydrology).__name__ == 'hydrologyshreve':
-                if (solution == 'TransientSolution' and md.transient.ishydrology) or solution == 'HydrologySolution':
-                    md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'HydrologyTwsAnalysis' in analyses:
-            if type(md.hydrology).__name__ == 'hydrologytws':
-                md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'SealevelchangeAnalysis' in analyses:
-            if solution == 'TransientSolution' and md.transient.isslc:
-                md = checkfield(md, 'fieldname', 'initialization.sealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'HydrologyGlaDSAnalysis' in analyses:
-            if type(md.hydrology).__name__ == 'hydrologyglads':
-                md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-                md = checkfield(md, 'fieldname', 'initialization.hydraulic_potential', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-                md = checkfield(md, 'fieldname', 'initialization.channelarea', 'NaN', 1, 'Inf', 1, '>=', 0, 'size', [md.mesh.numberofelements])
-        if 'HydrologyDCInefficientAnalysis' in analyses:
-            if type(md.hydrology).__name__ == 'hydrologydc':
-                md = checkfield(md, 'fieldname', 'initialization.sediment_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'HydrologyDCEfficientAnalysis' in analyses:
-            if type(md.hydrology).__name__ == 'hydrologydc':
-                if md.hydrology.isefficientlayer:
-                    md = checkfield(md, 'fieldname', 'initialization.epl_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-                    md = checkfield(md, 'fieldname', 'initialization.epl_thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'SamplingAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.issampling:
-            if np.any(np.isnan(md.initialization.sample)):
-                md = checkfield(md, 'fieldname', 'initialization.sample', 'NaN', 1,'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'DebrisAnalysis' in analyses:
-            if not np.isnan(md.initialization.debris):
-                if (solution == 'TransientSolution' and md.transient.ishydrology) or solution == 'HydrologySolution':
-                    md = checkfield(md, 'fieldname', 'initialization.debris', 'NaN', 1,'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'AgeAnalysis' in analyses:
-            if not np.isnan(md.initialization.age):
-                if (solution == 'TransientSolution' and md.transient.ishydrology) or solution == 'HydrologySolution':
-                    md = checkfield(md, 'fieldname', 'initialization.age', 'NaN', 1,'Inf', 1, 'size', [md.mesh.numberofvertices])
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'pressure', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'bottompressure', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'str', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'dsl', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'temperature', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'waterfraction', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_head', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_head', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_thickness', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'watercolumn', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'channelarea', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hydraulic_potential', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sample', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'debris', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'age', 'format', 'DoubleMat', 'mattype', 1, 'scale', yts)
-
-        if md.thermal.isenthalpy:
-            if (np.size(self.enthalpy) <= 1):
-                # Reconstruct enthalpy
-                tpmp = md.materials.meltingpoint - md.materials.beta * md.initialization.pressure
-                pos = np.where(md.initialization.waterfraction > 0)[0]
-                self.enthalpy = md.materials.heatcapacity * (md.initialization.temperature - md.constants.referencetemperature)
-                self.enthalpy[pos] = md.materials.heatcapacity * (tpmp[pos].reshape(-1,) - md.constants.referencetemperature) + md.materials.latentheat * md.initialization.waterfraction[pos].reshape(-1,)
-
-            WriteData(fid, prefix, 'data', self.enthalpy, 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.initialization.enthalpy')
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.vx = project3d(md, 'vector', self.vx, 'type', 'node')
-        self.vy = project3d(md, 'vector', self.vy, 'type', 'node')
-        self.vz = project3d(md, 'vector', self.vz, 'type', 'node')
-        self.vel = project3d(md, 'vector', self.vel, 'type', 'node')
-        self.temperature = project3d(md, 'vector', self.temperature, 'type', 'node')
-        self.enthalpy = project3d(md, 'vector', self.enthalpy, 'type', 'node')
-        self.waterfraction = project3d(md, 'vector', self.waterfraction, 'type', 'node')
-        self.watercolumn = project3d(md, 'vector', self.watercolumn, 'type', 'node')
-        self.sediment_head = project3d(md, 'vector', self.sediment_head, 'type', 'node', 'layer', 1)
-        self.epl_head = project3d(md, 'vector', self.epl_head, 'type', 'node', 'layer', 1)
-        self.epl_thickness = project3d(md, 'vector', self.epl_thickness, 'type', 'node', 'layer', 1)
-        self.sealevel = project3d(md, 'vector', self.sealevel, 'type', 'node', 'layer', 1)
-        self.bottompressure = project3d(md, 'vector', self.bottompressure, 'type', 'node', 'layer', 1)
-        self.dsl = project3d(md, 'vector', self.dsl, 'type', 'node', 'layer', 1)
-        self.str = project3d(md, 'vector', self.str, 'type', 'node', 'layer', 1)
-        self.debris = project3d(md, 'vector', self.debris, 'type', 'node', 'layer', 1)
-        self.age = project3d(md, 'vector', self.age, 'type', 'node', 'layer', 1)
-
-        # Lithostatic pressure by default
-        if np.ndim(md.geometry.surface) == 2:
-            print('Reshaping md.geometry.surface for your convenience but you should fix it in your model set up')
-            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface.reshape(-1, 1) - md.mesh.z)
-        else:
-            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.z)
-
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/inversion.js
===================================================================
--- /issm/trunk/src/m/classes/inversion.js	(revision 28275)
+++ 	(revision )
@@ -1,212 +1,0 @@
-//INVERSION class definition
-//
-//   Usage:
-//      inversion=new inversion();
-
-function inversion (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//default is incomplete adjoint for now
-		this.incomplete_adjoint=1;
-
-		//parameter to be inferred by control methods (only
-		//drag and B are supported yet)
-		this.control_parameters=['FrictionCoefficient'];
-
-		//number of steps in the control methods
-		this.nsteps=20;
-
-		//maximum number of iteration in the optimization algorithm for
-		//each step
-		this.maxiter_per_step=20*NewArrayFill(this.nsteps,1);
-
-		//the inversed parameter is updated as follows:
-		//new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1];
-		//usually the gradient_scaling must be of the order of magnitude of the 
-		//inversed parameter (10^8 for B, 50 for drag) and can be decreased
-		//after the first iterations
-		this.gradient_scaling=NewArrayFill(this.nsteps,50);
-
-		//several responses can be used:
-		this.cost_functions=101;
-
-		//step_threshold is used to speed up control method. When
-		//misfit(1)/misfit(0) < this.step_threshold, we go directly to
-		//the next step
-		this.step_threshold=NewArrayFill(this.nsteps,.7); //30 per cent decrement.
-
-		//cost_function_threshold is a criteria to stop the control methods.
-		//if J[n]-J[n-1]/J[n] < criteria, the control run stops
-		//NaN if not applied
-		this.cost_function_threshold=NaN; //not activated
-
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   inversion parameters:'));
-		fielddisplay(this,'iscontrol','is inversion activated?');
-		fielddisplay(this,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity');
-		fielddisplay(this,'control_parameters',"ex: {'FrictionCoefficient'}, or {'MaterialsRheologyBbar'}");
-		fielddisplay(this,'nsteps','number of optimization searches');
-		fielddisplay(this,'cost_functions','indicate the type of response for each optimization step');
-		fielddisplay(this,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
-		fielddisplay(this,'cost_function_threshold','misfit convergence criterion. Default is 1%, NaN if not applied');
-		fielddisplay(this,'maxiter_per_step','maximum iterations during each optimization step');
-		fielddisplay(this,'gradient_scaling','scaling factor on gradient direction during optimization, for each optimization step');
-		fielddisplay(this,'step_threshold','decrease threshold for misfit, default is 30%');
-		fielddisplay(this,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
-		fielddisplay(this,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
-		fielddisplay(this,'vx_obs','observed velocity x component [m/yr]');
-		fielddisplay(this,'vy_obs','observed velocity y component [m/yr]');
-		fielddisplay(this,'vel_obs','observed velocity magnitude [m/yr]');
-		fielddisplay(this,'thickness_obs','observed thickness [m]');
-		fielddisplay(this,'surface_obs','observed surface elevation [m]');
-		console.log('Available cost functions:');
-		console.log('   101: SurfaceAbsVelMisfit');
-		console.log('   102: SurfaceRelVelMisfit');
-		console.log('   103: SurfaceLogVelMisfit');
-		console.log('   104: SurfaceLogVxVyMisfit');
-		console.log('   105: SurfaceAverageVelMisfit');
-		console.log('   201: ThicknessAbsMisfit');
-		console.log('   501: DragCoefficientAbsGradient');
-		console.log('   502: RheologyBbarAbsGradient');
-		console.log('   503: ThicknessAbsGradient');
-
-	}// }}}
-    this.extrude = function(md) {//{{{
-        this.vx_obs=project3d(md, 'vector', this.vx_obs, 'type', 'node');
-        this.vy_obs=project3d(md,'vector',this.vy_obs,'type','node');
-        this.vel_obs=project3d(md,'vector',this.vel_obs,'type','node');
-        this.thickness_obs=project3d(md,'vector',this.thickness_obs,'type','node');
-
-        if (this.cost_functions_coefficients.length>1) {
-            this.cost_functions_coefficients=project3d(md,'vector',this.cost_functions_coefficients,'type','node');
-        }			
-        if (this.min_parameters.length>1) {
-            this.min_parameters=project3d(md,'vector',this.min_parameters,'type','node');
-        }
-        if (this.max_parameters.length>1) {
-            this.max_parameters=project3d(md,'vector',this.max_parameters,'type','node');
-        }
-        return this;
-    }//}}}
-	this.classname= function(){// {{{
-		return "inversion";
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-
-			//Early return
-			if (!this.iscontrol) return;
-
-			num_controls=md.inversion.control_parameters.length;
-			num_costfunc=md.inversion.control_parameters[0].length;
-
-			checkfield(md,'fieldname','inversion.iscontrol','values',[0, 1]);
-			checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0 ,1]);
-			checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',supportedcontrols());
-			checkfield(md,'fieldname','inversion.nsteps','numel',1,'>=',0);
-			checkfield(md,'fieldname','inversion.maxiter_per_step','size',[md.inversion.nsteps, 1],'>=',0);
-			checkfield(md,'fieldname','inversion.step_threshold','size',[md.inversion.nsteps, 1]);
-			checkfield(md,'fieldname','inversion.cost_functions','size',[1, num_costfunc],'values',supportedcostfunctions());
-			checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices, num_costfunc],'>=',0);
-			checkfield(md,'fieldname','inversion.gradient_scaling','size',[md.inversion.nsteps, num_controls]);
-			checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices , num_controls]);
-			checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices ,num_controls]);
-
-			//Only SSA, HO and FS are supported right now
-			if (solution=='StressbalanceSolution'){
-				if (!(md.flowequation.isSSA | md.flowequation.isHO | md.flowequation.isFS | md.flowequation.isL1L2)){
-					md.checkmessage('inversion can only be performed for SSA, HO or FS ice flow models');
-				}
-			}
-
-			if (solution=='BalancethicknessSolution'){
-				checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices ,1],'NaN',1,'Inf',1);
-			}
-			else if (solution=='BalancethicknessSoftSolution'){
-				checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices, 1],'NaN',1,'Inf',1);
-			}
-			else{
-				checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices ,1],'NaN',1,'Inf',1);
-				checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices ,1],'NaN',1,'Inf',1);
-			}
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			var yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.inversion.type','data',0,'format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','iscontrol','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','incomplete_adjoint','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1/yts);
-			if (!this.iscontrol) return;
-			WriteData(fid,prefix,'object',this,'fieldname','nsteps','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','maxiter_per_step','format','IntMat','mattype',3);
-			WriteData(fid,prefix,'object',this,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','gradient_scaling','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',this,'fieldname','cost_function_threshold','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','min_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',this,'fieldname','max_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',this,'fieldname','step_threshold','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',this,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',this,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',this,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			if(this.thickness_obs.length==md.mesh.numberofelements) mattype=2;
-			else mattype=1;
-			WriteData(fid,prefix,'object',this,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
-			WriteData(fid,prefix,'object',this,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
-
-			//process control parameters
-			num_control_parameters=this.control_parameters.length;
-			WriteData(fid,prefix,'object',this,'fieldname','control_parameters','format','StringArray');
-			WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer');
-
-			//process cost functions
-			num_cost_functions=this.cost_functions[0].length;
-			data=marshallcostfunctions(this.cost_functions);
-			WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer');
-		}//}}}
-		this.fix=function() { //{{{
-			this.control_parameters=NullFix(this.control_parameters,NaN);
-			this.maxiter_per_step=NullFix(this.maxiter_per_step,NaN);
-			this.cost_functions=NullFix(this.cost_functions,NaN);
-			this.cost_functions_coefficients=NullFix(this.cost_functions_coefficients,NaN);
-			this.cost_function_threshold=NullFix(this.cost_function_threshold,NaN);
-			this.gradient_scaling=NullFix(this.gradient_scaling,NaN);
-			this.min_parameters=NullFix(this.min_parameters,NaN);
-			this.max_parameters=NullFix(this.max_parameters,NaN);
-			this.step_threshold=NullFix(this.step_threshold,NaN);
-			this.vx_obs=NullFix(this.vx_obs,NaN);
-			this.vy_obs=NullFix(this.vy_obs,NaN);
-			this.vz_obs=NullFix(this.vz_obs,NaN);
-			this.vel_obs=NullFix(this.vel_obs,NaN);
-			this.thickness_obs=NullFix(this.thickness_obs,NaN);
-			this.surface_obs=NullFix(this.surface_obs,NaN);
-		}//}}}
-	//properties 
-	// {{{
-
-	this.iscontrol                   = 0;
-	this.incomplete_adjoint          = 0;
-	this.control_parameters          = NaN;
-	this.nsteps                      = 0;
-	this.maxiter_per_step            = NaN;
-	this.cost_functions              = NaN;
-	this.cost_functions_coefficients = NaN;
-	this.gradient_scaling            = NaN;
-	this.cost_function_threshold     = 0;
-	this.min_parameters              = NaN;
-	this.max_parameters              = NaN;
-	this.step_threshold              = NaN;
-	this.vx_obs                      = NaN;
-	this.vy_obs                      = NaN;
-	this.vz_obs                      = NaN;
-	this.vel_obs                     = NaN;
-	this.thickness_obs               = NaN;
-	this.surface_obs                 = NaN;
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/inversion.m
===================================================================
--- /issm/trunk/src/m/classes/inversion.m	(revision 28275)
+++ 	(revision )
@@ -1,206 +1,0 @@
-%INVERSION class definition
-%
-%   Usage:
-%      inversion=inversion();
-
-classdef inversion
-	properties (SetAccess=public) 
-		iscontrol                   = 0
-		incomplete_adjoint          = 0
-		control_parameters          = NaN
-		nsteps                      = 0
-		maxiter_per_step            = NaN
-		cost_functions              = NaN
-		cost_functions_coefficients = NaN
-		gradient_scaling            = NaN
-		cost_function_threshold     = 0
-		min_parameters              = NaN
-		max_parameters              = NaN
-		step_threshold              = NaN
-		vx_obs                      = NaN
-		vy_obs                      = NaN
-		vz_obs                      = NaN
-		vel_obs                     = NaN
-		thickness_obs               = NaN
-		surface_obs                 = NaN
-	end
-	methods
-		function self = inversion(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self =structtoobj(inversion(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.vx_obs=project3d(md,'vector',self.vx_obs,'type','node');
-			self.vy_obs=project3d(md,'vector',self.vy_obs,'type','node');
-			self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node');
-			self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node');
-			if numel(self.cost_functions_coefficients)>1,self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node');end;
-			if numel(self.min_parameters)>1,self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node');end;
-			if numel(self.max_parameters)>1,self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node');end;
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default is incomplete adjoint for now
-			self.incomplete_adjoint=1;
-
-			%parameter to be inferred by control methods (only
-			%drag and B are supported yet)
-			self.control_parameters={'FrictionCoefficient'};
-
-			%number of steps in the control methods
-			self.nsteps=20;
-
-			%maximum number of iteration in the optimization algorithm for
-			%each step
-			self.maxiter_per_step=20*ones(self.nsteps,1);
-
-			%the inversed parameter is updated as follows:
-			%new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1];
-			%usually the gradient_scaling must be of the order of magnitude of the 
-			%inversed parameter (10^8 for B, 50 for drag) and can be decreased
-			%after the first iterations
-			self.gradient_scaling=50*ones(self.nsteps,1);
-
-			%several responses can be used:
-			self.cost_functions=101;
-
-			%step_threshold is used to speed up control method. When
-			%misfit(1)/misfit(0) < self.step_threshold, we go directly to
-			%the next step
-			self.step_threshold=.7*ones(self.nsteps,1); %30 per cent decrement.
-
-			%cost_function_threshold is a criteria to stop the control methods.
-			%if J[n]-J[n-1]/J[n] < criteria, the control run stops
-			%NaN if not applied
-			self.cost_function_threshold=NaN; %not activated
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~self.iscontrol, return; end
-
-			num_controls=numel(md.inversion.control_parameters);
-			num_costfunc=size(md.inversion.cost_functions,2);
-
-			md = checkfield(md,'fieldname','inversion.iscontrol','values',[0 1]);
-			md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0 1]);
-			md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',supportedcontrols());
-			md = checkfield(md,'fieldname','inversion.nsteps','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
-			md = checkfield(md,'fieldname','inversion.step_threshold','size',[md.inversion.nsteps 1]);
-			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',supportedcostfunctions());
-			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
-			md = checkfield(md,'fieldname','inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
-			md = checkfield(md,'fieldname','inversion.min_parameters','size',[NaN num_controls]);
-			md = checkfield(md,'fieldname','inversion.max_parameters','size',[NaN num_controls]);
-
-			%Only SSA, HO and FS are supported right now
-			if strcmp(solution,'StressbalanceSolution')
-				if ~(md.flowequation.isSSA || md.flowequation.isMOLHO || md.flowequation.isHO || md.flowequation.isFS || md.flowequation.isL1L2),
-					md = checkmessage(md,['inversion can only be performed for SSA, MOLHO, HO or FS ice flow models']);
-				end
-			end
-			if strcmp(solution,'BalancethicknessSolution')
-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			elseif strcmp(solution,'BalancethicknessSoftSolution')
-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			else
-				md = checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   inversion parameters:'));
-			fielddisplay(self,'iscontrol','is inversion activated?');
-			fielddisplay(self,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity');
-			fielddisplay(self,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
-			fielddisplay(self,'nsteps','number of optimization searches');
-			fielddisplay(self,'cost_functions','indicate the type of response for each optimization step');
-			fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
-			fielddisplay(self,'cost_function_threshold','misfit convergence criterion. Default is 1%, NaN if not applied');
-			fielddisplay(self,'maxiter_per_step','maximum iterations during each optimization step');
-			fielddisplay(self,'gradient_scaling','scaling factor on gradient direction during optimization, for each optimization step');
-			fielddisplay(self,'step_threshold','decrease threshold for misfit, default is 30%');
-			fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'vx_obs','observed velocity x component [m/yr]');
-			fielddisplay(self,'vy_obs','observed velocity y component [m/yr]');
-			fielddisplay(self,'vel_obs','observed velocity magnitude [m/yr]');
-			fielddisplay(self,'thickness_obs','observed thickness [m]');
-			fielddisplay(self,'surface_obs','observed surface elevation [m]');
-			disp('Available cost functions:');
-			disp('   101: SurfaceAbsVelMisfit');
-			disp('   102: SurfaceRelVelMisfit');
-			disp('   103: SurfaceLogVelMisfit');
-			disp('   104: SurfaceLogVxVyMisfit');
-			disp('   105: SurfaceAverageVelMisfit');
-			disp('   201: ThicknessAbsMisfit');
-			disp('   501: DragCoefficientAbsGradient');
-			disp('   502: RheologyBbarAbsGradient');
-			disp('   503: ThicknessAbsGradient');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.inversion.type','data',0,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','iscontrol','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','incomplete_adjoint','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			if ~self.iscontrol, return; end
-			WriteData(fid,prefix,'object',self,'fieldname','nsteps','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','maxiter_per_step','format','IntMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','gradient_scaling','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','cost_function_threshold','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','min_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','max_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','step_threshold','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			if(numel(self.thickness_obs)==md.mesh.numberofelements),
-				mattype=2;
-			else
-				mattype=1;
-			end
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
-
-			%process control parameters
-			WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray');
-			WriteData(fid,prefix,'data',numel(self.control_parameters),'name','md.inversion.num_control_parameters','format','Integer');
-
-			%process cost functions
-			num_cost_functions=size(self.cost_functions,2);
-			data=marshallcostfunctions(self.cost_functions);
-			WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','StringArray');
-			WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.inversion.iscontrol'],self.iscontrol);
-			writejsdouble(fid,[modelname '.inversion.incomplete_adjoint'],self.incomplete_adjoint);
-			writejscellstring(fid,[modelname '.inversion.control_parameters'],self.control_parameters);
-			writejsdouble(fid,[modelname '.inversion.nsteps'],self.nsteps);
-			writejs1Darray(fid,[modelname '.inversion.maxiter_per_step'],self.maxiter_per_step);
-			writejs2Darray(fid,[modelname '.inversion.cost_functions'],self.cost_functions);
-			writejs2Darray(fid,[modelname '.inversion.cost_functions_coefficients'],self.cost_functions_coefficients);
-			writejs1Darray(fid,[modelname '.inversion.min_parameters'],self.min_parameters);
-			writejs1Darray(fid,[modelname '.inversion.max_parameters'],self.max_parameters);
-			writejs1Darray(fid,[modelname '.inversion.vx_obs'],self.vx_obs);
-			writejs1Darray(fid,[modelname '.inversion.vy_obs'],self.vy_obs);
-			writejs1Darray(fid,[modelname '.inversion.vz_obs'],self.vz_obs);
-			writejs1Darray(fid,[modelname '.inversion.vel_obs'],self.vel_obs);
-			writejs1Darray(fid,[modelname '.inversion.thickness_obs'],self.thickness_obs);
-			writejs1Darray(fid,[modelname '.inversion.surface_obs'],self.surface_obs);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/inversion.py
===================================================================
--- /issm/trunk/src/m/classes/inversion.py	(revision 28275)
+++ 	(revision )
@@ -1,198 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from marshallcostfunctions import marshallcostfunctions
-from project3d import project3d
-from supportedcontrols import supportedcontrols
-from supportedcostfunctions import supportedcostfunctions
-from WriteData import WriteData
-
-
-class inversion(object):
-    """INVERSION class definition
-
-    Usage:
-        inversion = inversion()
-    """
-
-    def __init__(self):  # {{{
-        self.iscontrol = 0
-        self.incomplete_adjoint = 0
-        self.control_parameters = np.nan
-        self.nsteps = 0
-        self.maxiter_per_step = np.nan
-        self.cost_functions = ''
-        self.cost_functions_coefficients = np.nan
-        self.gradient_scaling = np.nan
-        self.cost_function_threshold = 0
-        self.min_parameters = np.nan
-        self.max_parameters = np.nan
-        self.step_threshold = np.nan
-        self.vx_obs = np.nan
-        self.vy_obs = np.nan
-        self.vz_obs = np.nan
-        self.vel_obs = np.nan
-        self.thickness_obs = np.nan
-        self.surface_obs = np.nan
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   inversion parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'iscontrol', 'is inversion activated?'))
-        s += '{}\n'.format(fielddisplay(self, 'incomplete_adjoint', '1: linear viscosity, 0: non - linear viscosity'))
-        s += '{}\n'.format(fielddisplay(self, 'control_parameters', 'ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'))
-        s += '{}\n'.format(fielddisplay(self, 'nsteps', 'number of optimization searches'))
-        s += '{}\n'.format(fielddisplay(self, 'cost_functions', 'indicate the type of response for each optimization step'))
-        s += '{}\n'.format(fielddisplay(self, 'cost_functions_coefficients', 'cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
-        s += '{}\n'.format(fielddisplay(self, 'cost_function_threshold', 'misfit convergence criterion. Default is 1%, NaN if not applied'))
-        s += '{}\n'.format(fielddisplay(self, 'maxiter_per_step', 'maximum iterations during each optimization step'))
-        s += '{}\n'.format(fielddisplay(self, 'gradient_scaling', 'scaling factor on gradient direction during optimization, for each optimization step'))
-        s += '{}\n'.format(fielddisplay(self, 'step_threshold', 'decrease threshold for misfit, default is 30%'))
-        s += '{}\n'.format(fielddisplay(self, 'min_parameters', 'absolute minimum acceptable value of the inversed parameter on each vertex'))
-        s += '{}\n'.format(fielddisplay(self, 'max_parameters', 'absolute maximum acceptable value of the inversed parameter on each vertex'))
-        s += '{}\n'.format(fielddisplay(self, 'vx_obs', 'observed velocity x component [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vy_obs', 'observed velocity y component [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vel_obs', 'observed velocity magnitude [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'thickness_obs', 'observed thickness [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'surface_obs', 'observed surface elevation [m]'))
-        s += '{}\n'.format('Available cost functions:')
-        s += '{}\n'.format('   101: SurfaceAbsVelMisfit')
-        s += '{}\n'.format('   102: SurfaceRelVelMisfit')
-        s += '{}\n'.format('   103: SurfaceLogVelMisfit')
-        s += '{}\n'.format('   104: SurfaceLogVxVyMisfit')
-        s += '{}\n'.format('   105: SurfaceAverageVelMisfit')
-        s += '{}\n'.format('   201: ThicknessAbsMisfit')
-        s += '{}\n'.format('   501: DragCoefficientAbsGradient')
-        s += '{}\n'.format('   502: RheologyBbarAbsGradient')
-        s += '{}\n'.format('   503: ThicknessAbsGradient')
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #default is incomplete adjoint for now
-        self.incomplete_adjoint = 1
-        #parameter to be inferred by control methods (only
-        #drag and B are supported yet)
-        self.control_parameters = 'FrictionCoefficient'
-        #number of steps in the control methods
-        self.nsteps = 20
-        #maximum number of iteration in the optimization algorithm for
-        #each step
-        self.maxiter_per_step = 20 * np.ones(self.nsteps)
-        #the inversed parameter is updated as follows:
-        #new_par = old_par + gradient_scaling(n) * C * gradient with C in [0 1]
-        #usually the gradient_scaling must be of the order of magnitude of the
-        #inversed parameter (1.0e8 for B, 50 for drag) and can be decreased
-        #after the first iterations
-        self.gradient_scaling = 50 * np.ones((self.nsteps, 1))
-        #several responses can be used:
-        self.cost_functions = [101, ]
-        #step_threshold is used to speed up control method. When
-        #misfit(1) / misfit(0) < self.step_threshold, we go directly to
-        #the next step
-        self.step_threshold = 0.7 * np.ones(self.nsteps)  #30 per cent decrement
-        #cost_function_threshold is a criteria to stop the control methods.
-        #if J[n] - J[n - 1] / J[n] < criteria, the control run stops
-        #NaN if not applied
-        self.cost_function_threshold = np.nan  #not activated
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.vx_obs = project3d(md, 'vector', self.vx_obs, 'type', 'node')
-        self.vy_obs = project3d(md, 'vector', self.vy_obs, 'type', 'node')
-        self.vel_obs = project3d(md, 'vector', self.vel_obs, 'type', 'node')
-        self.thickness_obs = project3d(md, 'vector', self.thickness_obs, 'type', 'node')
-        if not np.any(np.isnan(self.cost_functions_coefficients)):
-            self.cost_functions_coefficients = project3d(md, 'vector', self.cost_functions_coefficients, 'type', 'node')
-        if not np.any(np.isnan(self.min_parameters)):
-            self.min_parameters = project3d(md, 'vector', self.min_parameters, 'type', 'node')
-        if not np.any(np.isnan(self.max_parameters)):
-            self.max_parameters = project3d(md, 'vector', self.max_parameters, 'type', 'node')
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if not self.iscontrol:
-            return md
-
-        num_controls = np.size(md.inversion.control_parameters)
-        num_costfunc = np.size(md.inversion.cost_functions)
-
-        md = checkfield(md, 'fieldname', 'inversion.iscontrol', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'inversion.incomplete_adjoint', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'inversion.control_parameters', 'cell', 1, 'values', supportedcontrols())
-        md = checkfield(md, 'fieldname', 'inversion.nsteps', 'numel', [1], '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.maxiter_per_step', 'size', [md.inversion.nsteps], '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.step_threshold', 'size', [md.inversion.nsteps])
-        md = checkfield(md, 'fieldname', 'inversion.cost_functions', 'size', [num_costfunc], 'values', supportedcostfunctions())
-        if num_costfunc == 1:
-            md.inversion.cost_functions_coefficients = np.squeeze(md.inversion.cost_functions_coefficients)
-            md = checkfield(md, 'fieldname', 'inversion.cost_functions_coefficients', 'size', [md.mesh.numberofvertices], '>=', 0)
-        else:
-            md = checkfield(md, 'fieldname', 'inversion.cost_functions_coefficients', 'size', [md.mesh.numberofvertices, num_costfunc], '>=', 0)
-
-        if num_controls == 1:
-            md.inversion.gradient_scaling = np.squeeze(md.inversion.gradient_scaling)
-            md.inversion.min_parameters = np.squeeze(md.inversion.min_parameters)
-            md.inversion.max_parameters = np.squeeze(md.inversion.max_parameters)
-            md = checkfield(md, 'fieldname', 'inversion.gradient_scaling', 'size', [md.inversion.nsteps])
-            md = checkfield(md, 'fieldname', 'inversion.min_parameters', 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'inversion.max_parameters', 'size', [md.mesh.numberofvertices])
-        else:
-            md = checkfield(md, 'fieldname', 'inversion.gradient_scaling', 'size', [md.inversion.nsteps, num_controls])
-            md = checkfield(md, 'fieldname', 'inversion.min_parameters', 'size', [md.mesh.numberofvertices, num_controls])
-            md = checkfield(md, 'fieldname', 'inversion.max_parameters', 'size', [md.mesh.numberofvertices, num_controls])
-
-        # Only SSA, HO and FS are supported right now
-        if solution == 'StressbalanceSolution':
-            if not (md.flowequation.isSSA or md.flowequation.isMOLHO or md.flowequation.isHO or md.flowequation.isFS or md.flowequation.isL1L2):
-                md.checkmessage("'inversion can only be performed for SSA, MOLHO, HO or FS ice flow models")
-        if solution == 'BalancethicknessSolution':
-            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        elif solution == 'BalancethicknessSoftSolution':
-            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        else:
-            md = checkfield(md, 'fieldname', 'inversion.vx_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'inversion.vy_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.inversion.type', 'data', 0, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'iscontrol', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'incomplete_adjoint', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vel_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        if not self.iscontrol:
-            return
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'nsteps', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter_per_step', 'format', 'IntMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'cost_functions_coefficients', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'gradient_scaling', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'cost_function_threshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_parameters', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'max_parameters', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'step_threshold', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vx_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vy_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vz_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness_obs', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'surface_obs', 'format', 'DoubleMat', 'mattype', 1)
-
-        # Process control parameters
-        num_control_parameters = len(self.control_parameters)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'control_parameters', 'format', 'StringArray')
-        WriteData(fid, prefix, 'data', num_control_parameters, 'name', 'md.inversion.num_control_parameters', 'format', 'Integer')
-
-        # Process cost functions
-        num_cost_functions = np.size(self.cost_functions)
-        data = marshallcostfunctions(self.cost_functions)
-        WriteData(fid, prefix, 'data', data, 'name', 'md.inversion.cost_functions', 'format', 'StringArray')
-        WriteData(fid, prefix, 'data', num_cost_functions, 'name', 'md.inversion.num_cost_functions', 'format', 'Integer')
-    # }}}
Index: sm/trunk/src/m/classes/inversionvalidation.m
===================================================================
--- /issm/trunk/src/m/classes/inversionvalidation.m	(revision 28275)
+++ 	(revision )
@@ -1,148 +1,0 @@
-%INVERSIONVALIDATION class definition
-%
-%   Usage:
-%      inversionvalidation=inversionvalidation();
-
-classdef inversionvalidation
-	properties (SetAccess=public) 
-		iscontrol                   = 0
-		incomplete_adjoint          = 0
-		control_parameters          = NaN
-		control_scaling_factors     = NaN
-		cost_functions              = NaN
-		cost_functions_coefficients = NaN
-		min_parameters              = NaN
-		max_parameters              = NaN
-		vx_obs                      = NaN
-		vy_obs                      = NaN
-		vz_obs                      = NaN
-		vel_obs                     = NaN
-		thickness_obs               = NaN
-		surface_obs                 = NaN
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.vx_obs=project3d(md,'vector',self.vx_obs,'type','node');
-			self.vy_obs=project3d(md,'vector',self.vy_obs,'type','node');
-			self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node');
-			self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node');
-			if numel(self.cost_functions_coefficients)>1,self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node');end;
-			if numel(self.min_parameters)>1,self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node');end;
-			if numel(self.max_parameters)>1,self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node');end;
-		end % }}}
-		function self = inversionvalidation(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(inversionvalidation(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default is incomplete adjoint for now
-			self.incomplete_adjoint=1;
-
-			%parameter to be inferred by control methods (only
-			%drag and B are supported yet)
-			self.control_parameters={'FrictionCoefficient'};
-
-			%Scaling factor for each control
-			self.control_scaling_factors=1;
-
-			%several responses can be used:
-			self.cost_functions=101;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~self.iscontrol, return; end
-
-			num_controls=numel(md.inversion.control_parameters);
-			num_costfunc=size(md.inversion.cost_functions,2);
-
-			md = checkfield(md,'fieldname','inversion.iscontrol','values',[0 1]);
-			md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0 1]);
-			md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',supportedcontrols());
-			md = checkfield(md,'fieldname','inversion.control_scaling_factors','size',[1 num_controls],'>',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',supportedcostfunctions());
-			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
-			md = checkfield(md,'fieldname','inversion.min_parameters','size',[NaN num_controls]);
-			md = checkfield(md,'fieldname','inversion.max_parameters','size',[NaN num_controls]);
-
-			if strcmp(solution,'BalancethicknessSolution')
-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			elseif strcmp(solution,'BalancethicknessSoftSolution')
-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			else
-				md = checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				if ~strcmp(domaintype(md.mesh),'2Dvertical'),
-					md = checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				end
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   inversionvalidation parameters:'));
-			fielddisplay(self,'iscontrol','is inversion activated?');
-			fielddisplay(self,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity');
-			fielddisplay(self,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
-			fielddisplay(self,'control_scaling_factors','order of magnitude of each control (useful for multi-parameter optimization)');
-			fielddisplay(self,'cost_functions','indicate the type of response for each optimization step');
-			fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
-			fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'vx_obs','observed velocity x component [m/yr]');
-			fielddisplay(self,'vy_obs','observed velocity y component [m/yr]');
-			fielddisplay(self,'vel_obs','observed velocity magnitude [m/yr]');
-			fielddisplay(self,'thickness_obs','observed thickness [m]');
-			fielddisplay(self,'surface_obs','observed surface elevation [m]');
-			disp('Available cost functions:');
-			disp('   101: SurfaceAbsVelMisfit');
-			disp('   102: SurfaceRelVelMisfit');
-			disp('   103: SurfaceLogVelMisfit');
-			disp('   104: SurfaceLogVxVyMisfit');
-			disp('   105: SurfaceAverageVelMisfit');
-			disp('   201: ThicknessAbsMisfit');
-			disp('   501: DragCoefficientAbsGradient');
-			disp('   502: RheologyBbarAbsGradient');
-			disp('   503: ThicknessAbsGradient');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');
-			WriteData(fid,prefix,'name','md.inversion.type','data',3,'format','Integer');
-			if ~self.iscontrol, return; end
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			if(numel(self.thickness_obs)==md.mesh.numberofelements),
-				mattype=2; 
-			else
-				mattype=1;
-			end
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
-
-			%process control parameters
-			num_control_parameters=numel(self.control_parameters);
-			WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray');
-			WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer');
-
-			%process cost functions
-			num_cost_functions=size(self.cost_functions,2);
-			data=marshallcostfunctions(self.cost_functions);
-			WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','StringArray');
-			WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/issmsettings.js
===================================================================
--- /issm/trunk/src/m/classes/issmsettings.js	(revision 28275)
+++ 	(revision )
@@ -1,99 +1,0 @@
-//ISSMSETTINGS class definition
-//
-//   Usage:
-//      issmsettings=new issmsettings();
-
-function issmsettings (){
-    //methods
-	this.setdefaultparameters = function(){// {{{
-		//are we short in memory ? (0 faster but requires more memory)
-		this.lowmem=0;
-
-		//i/o:
-		this.io_gather=1;
-
-		//results frequency by default every step
-		this.output_frequency=1;
-
-		//coupling frequency of the stress balance solver by default every step
-		this.sb_coupling_frequency=1;
-
-		//checkpoints frequency, by default never:
-		this.checkpoint_frequency=0;
-
-		//this option can be activated to load automatically the results
-		//onto the model after a parallel run by waiting for the lock file
-		//N minutes that is generated once the solution has converged
-		//0 to deactivate
-		this.waitonlock=Infinity;
-
-		//upload options:
-		this.upload_port         = 0;
-
-		//throw an error if solver residue exceeds this value
-		this.solver_residue_threshold=1e-6;
-
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   issmsettings class echo:'));
-
-		fielddisplay(this,'results_on_nodes','results are output for all the nodes of each element');
-		fielddisplay(this,'io_gather','I/O gathering strategy for result outputs (default 1)');
-		fielddisplay(this,'lowmem','is the memory limited ? (0 or 1)');
-		fielddisplay(this,'output_frequency','number of time steps between two saves (e.g., 5 means that results are only saved every 5 time steps)');
-		fielddisplay(this,'checkpoint_frequency','frequency at which the runs are being recorded, allowing for a restart');
-		fielddisplay(this,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
-		fielddisplay(this,'upload_server','server hostname where model should be uploaded');
-		fielddisplay(this,'upload_path','path on server where model should be uploaded');
-		fielddisplay(this,'upload_login','server login');
-		fielddisplay(this,'upload_port','port login (default is 0)');
-		fielddisplay(this,'upload_filename','unique id generated when uploading the file to server');
-		fielddisplay(this,'solver_residue_threshold','throw an error if solver residue exceeds this value');
-
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "issmsettings";
-
-	}// }}}
-	this.checkconsistency = function(md,solution,analyses) { // {{{
-
-		checkfield(md,'fieldname','settings.results_on_nodes','stringrow',1);
-		checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0, 1]);
-		checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0, 1]);
-		checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1);
-		checkfield(md,'fieldname','settings.sb_coupling_frequency','numel',[1],'>=',1);
-		checkfield(md,'fieldname','settings.checkpoint_frequency','numel',[1],'>=',0);
-		checkfield(md,'fieldname','settings.waitonlock','numel',[1]);
-		checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0);
-	} // }}}
-	this.marshall=function(md,prefix,fid) { //{{{
-		WriteData(fid,prefix,'object',this,'class','settings','fieldname','results_on_nodes','format','StringArray');
-		WriteData(fid,prefix,'object',this,'class','settings','fieldname','io_gather','format','Boolean');
-		WriteData(fid,prefix,'object',this,'class','settings','fieldname','lowmem','format','Boolean');
-		WriteData(fid,prefix,'object',this,'class','settings','fieldname','output_frequency','format','Integer');
-		WriteData(fid,prefix,'object',this,'class','settings','fieldname','sb_coupling_frequency','format','Integer');
-		WriteData(fid,prefix,'object',this,'class','settings','fieldname','checkpoint_frequency','format','Integer');
-		WriteData(fid,prefix,'object',this,'class','settings','fieldname','waitonlock','data',this.waitonlock>0,'format','Boolean');
-		WriteData(fid,prefix,'object',this,'class','settings','fieldname','solver_residue_threshold','format','Double');
-	}//}}}
-	this.fix=function() { //{{{
-	}//}}}
-	//properties
-	// {{{
-	this.results_on_nodes        = '';
-	this.io_gather               = 0;
-	this.lowmem                  = 0;
-	this.output_frequency        = 0;
-	this.sb_coupling_frequency   = 0;
-	this.checkpoint_frequency    = 0;
-	this.waitonlock              = 0;
-	this.upload_server           = '';
-	this.upload_path             = '';
-	this.upload_login            = '';
-	this.upload_port             = 0;
-	this.upload_filename         = '';
-	this.solver_residue_threshold = 0;
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/issmsettings.m
===================================================================
--- /issm/trunk/src/m/classes/issmsettings.m	(revision 28275)
+++ 	(revision )
@@ -1,133 +1,0 @@
-%ISSMSETTINGS class definition
-%
-%   Usage:
-%      issmsettings=issmsettings();
-
-classdef issmsettings
-	properties (SetAccess=public) 
-		results_on_nodes         = {};
-		io_gather                = 0;
-		lowmem                   = 0;
-		output_frequency         = 0;
-		sb_coupling_frequency    = 0;
-		checkpoint_frequency     = 0;
-		waitonlock               = 0;
-		upload_server            = '';
-		upload_path              = '';
-		upload_login             = '';
-		upload_port              = 0;
-		upload_filename          = '';
-		solver_residue_threshold = 0;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. Update old properties here
-
-			%2020 Oct 6
-			if isstruct(self)
-				objstruct = self;
-				self = structtoobj(issmsettings(),objstruct);
-				if isfield(objstruct,'recording_frequency')
-					self.checkpoint_frequency = objstruct.recording_frequency;
-				end
-			end
-		end % }}}
-	end
-	methods
-		function self = issmsettings(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%are we short in memory ? (0 faster but requires more memory)
-			self.lowmem=0;
-
-			%i/o:
-			self.io_gather=1;
-
-			%results frequency by default every step
-			self.output_frequency=1;
-
-			%coupling frequency of the stress balance solver by default every step
-			self.sb_coupling_frequency=1;
-			
-			%checkpoints frequency, by default never: 
-			self.checkpoint_frequency=0;
-
-			%this option can be activated to load automatically the results
-			%onto the model after a parallel run by waiting for the lock file
-			%N minutes that is generated once the solution has converged
-			%0 to deactivate
-			self.waitonlock=Inf;
-
-			%upload options: 
-			self.upload_port         = 0;
-
-			%throw an error if solver residue exceeds this value
-			self.solver_residue_threshold = 1e-6;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','settings.results_on_nodes','stringrow',1);
-			md = checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1);
-			md = checkfield(md,'fieldname','settings.sb_coupling_frequency','numel',[1],'>=',1);
-			md = checkfield(md,'fieldname','settings.checkpoint_frequency','numel',[1],'>=',0);
-			md = checkfield(md,'fieldname','settings.waitonlock','numel',[1]);
-			md = checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0);
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   general issmsettings parameters:'));
-
-			fielddisplay(self,'results_on_nodes','list of output for which results will be output for all the nodes of each element, Use ''all'' for all output on nodes.');
-			fielddisplay(self,'io_gather','I/O gathering strategy for result outputs (default 1)');
-			fielddisplay(self,'lowmem','is the memory limited ? (0 or 1)');
-			fielddisplay(self,'output_frequency','number of time steps between two saves (e.g., 5 means that results are only saved every 5 time steps)');
-			fielddisplay(self,'sb_coupling_frequency','frequency at which StressBalance solver is coupled (default 1)');
-			fielddisplay(self,'checkpoint_frequency','frequency at which the runs are being recorded, allowing for a restart');
-			fielddisplay(self,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
-			fielddisplay(self,'upload_server','server hostname where model should be uploaded');
-			fielddisplay(self,'upload_path','path on server where model should be uploaded');
-			fielddisplay(self,'upload_login','server login');
-			fielddisplay(self,'upload_port','port login (default is 0)');
-			fielddisplay(self,'upload_filename','unique id generated when uploading the file to server');
-			fielddisplay(self,'solver_residue_threshold','throw an error if solver residue exceeds this value (NaN to deactivate)');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'data',self.results_on_nodes,'name','md.settings.results_on_nodes','format','StringArray');
-			WriteData(fid,prefix,'object',self,'class','settings','fieldname','io_gather','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','settings','fieldname','lowmem','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','settings','fieldname','output_frequency','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','settings','fieldname','sb_coupling_frequency','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','settings','fieldname','checkpoint_frequency','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','settings','fieldname','waitonlock','data',self.waitonlock>0,'format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','settings','fieldname','solver_residue_threshold','format','Double');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejscellstring(fid,[modelname '.settings.results_on_nodes'],self.results_on_nodes);
-			writejsdouble(fid,[modelname '.settings.io_gather'],self.io_gather);
-			writejsdouble(fid,[modelname '.settings.lowmem'],self.lowmem);
-			writejsdouble(fid,[modelname '.settings.output_frequency'],self.output_frequency);
-			writejsdouble(fid,[modelname '.settings.sb_coupling_frequency'],self.sb_coupling_frequency);
-			writejsdouble(fid,[modelname '.settings.checkpoint_frequency'],self.checkpoint_frequency);
-			writejsdouble(fid,[modelname '.settings.waitonlock'],self.waitonlock);
-			writejsstring(fid,[modelname '.settings.upload_server'],self.upload_server);
-			writejsstring(fid,[modelname '.settings.upload_path'],self.upload_path);
-			writejsstring(fid,[modelname '.settings.upload_login'],self.upload_login);
-			writejsdouble(fid,[modelname '.settings.upload_port'],self.upload_port);
-			writejsstring(fid,[modelname '.settings.upload_filename'],self.upload_filename);
-			writejsstring(fid,[modelname '.settings.solver_residue_threshold'],self.solver_residue_threshold);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/issmsettings.py
===================================================================
--- /issm/trunk/src/m/classes/issmsettings.py	(revision 28275)
+++ 	(revision )
@@ -1,89 +1,0 @@
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class issmsettings(object):
-    """ISSMSETTINGS class definition
-
-    Usage:
-        issmsettings = issmsettings()
-    """
-
-    def __init__(self):  # {{{
-        self.results_on_nodes = []
-        self.io_gather = 0
-        self.lowmem = 0
-        self.output_frequency = 0
-        self.coupling_frequency = 0
-        self.checkpoint_frequency = 0
-        self.waitonlock = 0
-        self.solver_residue_threshold = 0
-
-        # Set defaults
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = "   general issmsettings parameters:\n"
-        s += '{}\n'.format(fielddisplay(self, "results_on_nodes", "list of output for which results will be output for all the nodes of each element, Use 'all' for all output on nodes."))
-        s += '{}\n'.format(fielddisplay(self, "io_gather", "I / O gathering strategy for result outputs (default 1)"))
-        s += '{}\n'.format(fielddisplay(self, "lowmem", "is the memory limited ? (0 or 1)"))
-        s += '{}\n'.format(fielddisplay(self, "output_frequency", "number of time steps between two saves (e.g., 5 means that results are only saved every 5 time steps)"))
-        s += '{}\n'.format(fielddisplay(self, "sb_coupling_frequency", "frequency at which StressBalance solver is coupled (default 1)"))
-        s += '{}\n'.format(fielddisplay(self, "checkpoint_frequency", "frequency at which the runs are being recorded, allowing for a restart"))
-        s += '{}\n'.format(fielddisplay(self, "waitonlock", "maximum number of minutes to wait for batch results, or return 0"))
-        s += '{}\n'.format(fielddisplay(self, "solver_residue_threshold", "throw an error if solver residue exceeds this value (NaN to deactivate)"))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Are we short in memory? (0 faster but requires more memory)
-        self.lowmem = 0
-        # I/O:
-        self.io_gather = 1
-        # Results frequency by default every step
-        self.output_frequency = 1
-        # Coupling frequency of the stress balance solver by default every step
-        self.sb_coupling_frequency = 1
-        # Checkpoints frequency, by default never:
-        self.checkpoint_frequency = 0
-        # This option can be activated to load automatically the results onto 
-        # the model after a parallel run by waiting for the lock file N minutes 
-        # that is generated once the solution has converged
-        # Set to 0 to deactivate
-        self.waitonlock = pow(2, 31) - 1
-        # Throw an error if solver residue exceeds this value
-        self.solver_residue_threshold = 1e-6
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'settings.results_on_nodes', 'stringrow', 1)
-        md = checkfield(md, 'fieldname', 'settings.io_gather', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'settings.lowmem', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'settings.output_frequency', 'numel', [1], '>=', 1)
-        md = checkfield(md, 'fieldname', 'settings.sb_coupling_frequency', 'numel', [1], '>=', 1)
-        md = checkfield(md, 'fieldname', 'settings.checkpoint_frequency', 'numel', [1], '>=', 0)
-        md = checkfield(md, 'fieldname', 'settings.waitonlock', 'numel', [1])
-        md = checkfield(md, 'fieldname', 'settings.solver_residue_threshold', 'numel', [1], '>', 0)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'data', self.results_on_nodes, 'name', 'md.settings.results_on_nodes', 'format', 'StringArray')
-        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'io_gather', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'lowmem', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'output_frequency', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'sb_coupling_frequency', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'checkpoint_frequency', 'format', 'Integer')
-
-        if self.waitonlock > 0:
-            WriteData(fid, prefix, 'name', 'md.settings.waitonlock', 'data', True, 'format', 'Boolean')
-        else:
-            WriteData(fid, prefix, 'name', 'md.settings.waitonlock', 'data', False, 'format', 'Boolean')
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'solver_residue_threshold', 'format', 'Double')
-    # }}}
Index: sm/trunk/src/m/classes/levelset.js
===================================================================
--- /issm/trunk/src/m/classes/levelset.js	(revision 28275)
+++ 	(revision )
@@ -1,74 +1,0 @@
-//LEVELSET class definition
-//
-//   Usage:
-//      levelset=new levelset();
-
-function levelset (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//stabilization = 1 by default
-		this.stabilization		= 1;
-		this.reinit_frequency	= 5;
-		this.kill_icebergs      = 1;
-		this.migration_max      = 1e12; //No need for general cases, unless specified
-
-		//Linear elements by default
-		this.fe='P1';
-	
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   Level-set parameters:'));
-		fielddisplay(this,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding');
-		fielddisplay(this,'spclevelset','Levelset constraints (NaN means no constraint)');
-		fielddisplay(this,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized (NaN: no re-initialization).');
-		fielddisplay(this,'kill_icebergs','remove floating icebergs to prevent rigid body motions (1: true, 0: false)');
-		fielddisplay(this,'migration_max','maximum allowed migration rate (m/a)');
-		fielddisplay(this,'fe','Finite Element type: "P1" (default), or "P2"');
-
-	}// }}}
-    this.extrude = function(md) {//{{{
-        this.spclevelset=project3d(md,'vector',this.spclevelset,'type','node');
-        return this;
-    }//}}}
-	this.classname= function(){// {{{
-		return "levelset";
-	}// }}}
-	this.checkconsistency = function(md,solution,analyses) { // {{{
-		//Early return
-		if (solution!='TransientSolution' | md.trans.ismovingfront==0) return;
-
-		checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1);
-		checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2,5]);
-		checkfield(md,'fieldname','levelset.kill_icebergs','numel',1,'values',[0, 1]);
-		checkfield(md,'fieldname','levelset.migration_max','numel',1,'NaN',1,'Inf',1,'>',0);
-		checkfield(md,'fieldname','levelset.fe','values',['P1','P2']);
-	} //}}}
-	this.marshall=function(md,prefix,fid) { //{{{
-
-		let yts=md.constants.yts;
-
-		WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'object',this,'fieldname','reinit_frequency','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','kill_icebergs','format','Boolean');
-		WriteData(fid,prefix,'object',this,'fieldname','migration_max','format','Double','scale',1/yts);
-		WriteData(fid,prefix,'object',this,'fieldname','fe','format','String');
-	}//}}}
-		this.fix=function() { //{{{
-			this.spclevelset=NullFix(this.spclevelset,NaN);
-		}//}}}
-	//properties 
-	// {{{
-
-	this.stabilization		= 0;
-	this.spclevelset		= NaN;
-	this.reinit_frequency	= NaN;
-	this.kill_icebergs     	= 0;
-	this.migration_max      = 0.;
-	this.fe              	= 'P1';
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/levelset.m
===================================================================
--- /issm/trunk/src/m/classes/levelset.m	(revision 28275)
+++ 	(revision )
@@ -1,89 +1,0 @@
-%LEVELSET class definition
-%
-%   Usage:
-%      levelset=levelset();
-
-classdef levelset
-	properties (SetAccess=public) 
-		stabilization		= 0;
-		spclevelset			= NaN;
-		reinit_frequency	= 5;
-		kill_icebergs		= 0;
-		migration_max		= 0.;
-		fe					= 'P1';
-	end
-	methods
-		function self = levelset(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('levelset');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Level-set parameters:'));
-			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding');
-			fielddisplay(self,'spclevelset','Levelset constraints (NaN means no constraint)');
-			fielddisplay(self,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized');
-			fielddisplay(self,'kill_icebergs','remove floating icebergs to prevent rigid body motions (1: true, 0: false)');
-			fielddisplay(self,'migration_max','maximum allowed migration rate (m/a)');
-			fielddisplay(self,'fe','Finite Element type: ''P1'' (default), or ''P2''');
-		end % }}}
-		function self = extrude(self,md) % {{{
-
-			self.spclevelset=project3d(md,'vector',self.spclevelset,'type','node');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%stabilization = 1 by default
-			self.stabilization    = 1;
-			self.reinit_frequency = 5;
-			self.kill_icebergs    = 1;
-			self.migration_max    = 1e12; % No need for general cases, unless specified
-
-			%Linear elements by default
-			self.fe='P1';
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%Early return
-			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
-
-			md = checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','levelset.stabilization','values',[0 1 2 5 6]);
-			md = checkfield(md,'fieldname','levelset.kill_icebergs','numel',1,'values',[0 1]);
-			md = checkfield(md,'fieldname','levelset.migration_max','numel',1,'NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','levelset.fe','values',{'P1','P2'});
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','reinit_frequency','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','kill_icebergs','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','migration_max','format','Double','scale',1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			writejsdouble(fid,[modelname '.levelset.stabilization'],self.stabilization);
-			writejs1Darray(fid,[modelname '.levelset.spclevelset'],self.spclevelset);
-			writejs1Darray(fid,[modelname '.levelset.reinit_frequency'],self.reinit_frequency);
-			writejsdouble(fid,[modelname '.levelset.kill_icebergs'],self.kill_icebergs);
-			writejsdouble(fid,[modelname '.levelset.migration_max'],self.migration_max);
-		end % }}}
-	end
-end
-
Index: sm/trunk/src/m/classes/levelset.py
===================================================================
--- /issm/trunk/src/m/classes/levelset.py	(revision 28275)
+++ 	(revision )
@@ -1,80 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class levelset(object):
-    """LEVELSET class definition
-
-    Usage:
-        levelset = levelset()
-    """
-
-    def __init__(self):  # {{{
-        self.stabilization = 0
-        self.spclevelset = np.nan
-        self.reinit_frequency = 5
-        self.kill_icebergs = 0
-        self.migration_max = 0
-        self.fe = 'P1'
-
-        # Set defaults
-        self.setdefaultparameters()
-    # }}}
-    def __repr__(self):  # {{{
-        s = '   Level-set parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: streamline upwinding'))
-        s += '{}\n'.format(fielddisplay(self, 'spclevelset', 'Levelset constraints (NaN means no constraint)'))
-        s += '{}\n'.format(fielddisplay(self, 'reinit_frequency', 'Amount of time steps after which the levelset function in re-initialized'))
-        s += '{}\n'.format(fielddisplay(self, 'kill_icebergs', 'remove floating icebergs to prevent rigid body motions (1: true, 0: false)'))
-        s += '{}\n'.format(fielddisplay(self, 'migration_max', 'maximum allowed migration rate (m/a)'))
-        s += '{}\n'.format(fielddisplay(self, 'fe', 'Finite Element type: \'P1\' (default), or \'P2\''))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Stabilization = 1 by default
-        self.stabilization = 1
-        self.reinit_frequency = 5
-        self.kill_icebergs = 1
-        self.migration_max = 1e12 # No need for general cases, unless specified
-
-        # Linear elements by default
-        self.fe = 'P1'
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
-            return md
-
-        md = checkfield(md, 'fieldname', 'levelset.spclevelset', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'levelset.stabilization', 'numel', [1], 'values', [0, 1, 2, 5, 6])
-        md = checkfield(md, 'fieldname', 'levelset.kill_icebergs', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'levelset.migration_max', 'numel', [1], 'NaN', 1, 'Inf', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'levelset.fe', 'values', ['P1', 'P2'])
-
-        return md
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.spclevelset = project3d(md, 'vector', self.spclevelset, 'type', 'node')
-        return self
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'spclevelset', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'reinit_frequency', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'kill_icebergs', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'migration_max', 'format', 'Double', 'scale', 1 / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe', 'format', 'String')
-    # }}}
Index: sm/trunk/src/m/classes/linearbasalforcings.m
===================================================================
--- /issm/trunk/src/m/classes/linearbasalforcings.m	(revision 28275)
+++ 	(revision )
@@ -1,105 +1,0 @@
-%LINEAR BASAL FORCINGS class definition
-%
-%   Usage:
-%      linearbasalforcings=linearbasalforcings();
-
-classdef linearbasalforcings
-	properties (SetAccess=public)
-		deepwater_melting_rate    = 0.;
-		upperwater_melting_rate   = 0.;
-		deepwater_elevation       = 0.;
-		upperwater_elevation      = 0.;
-		groundedice_melting_rate  = NaN;
-		perturbation_melting_rate = NaN;
-		geothermalflux            = NaN;
-	end
-	methods
-		function self = linearbasalforcings(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(linearbasalforcings(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.perturbation_melting_rate=project3d(md,'vector',self.perturbation_melting_rate,'type','node','layer',1);
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1);
-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.groundedice_melting_rate),
-				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			end
-			% TODO: Should we be setting self.geothermalflux here (we do so in linearbasalforcings.py)?
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default values for melting parameterization
-			self.deepwater_melting_rate = 50.;
-			self.upperwater_melting_rate = 0.;
-			self.deepwater_elevation    = -800.;
-			self.upperwater_elevation   = -400.;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if numel(md.basalforcings.perturbation_melting_rate)>1
-				md = checkfield(md,'fieldname','basalforcings.perturbation_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-			end
-
-			if ismember('MasstransportAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.ismasstransport==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','>=',0,'singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','>=',0,'singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1);
-			end
-			if ismember('ThermalAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isthermal==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','>=',0,'singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   basal forcings parameters:'));
-
-			fielddisplay(self,'deepwater_melting_rate','basal melting rate (positive if melting applied for floating ice whith base < deepwater_elevation) [m/yr]');
-			fielddisplay(self,'deepwater_elevation','elevation of ocean deepwater [m]');
-			fielddisplay(self,'upperwater_melting_rate','basal melting rate (positive if melting applied for floating ice whith base >= upperwater_elevation) [m/yr]');
-			fielddisplay(self,'upperwater_elevation','elevation of ocean upperwater [m]');
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'perturbation_melting_rate','basal melting rate perturbation added to computed melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','perturbation_melting_rate','format','DoubleMat','name','md.basalforcings.perturbation_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','deepwater_melting_rate','format','DoubleMat','mattype',3,'timeserieslength',2,'name','md.basalforcings.deepwater_melting_rate','scale',1./yts,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','deepwater_elevation','format','DoubleMat','mattype',3,'name','md.basalforcings.deepwater_elevation','yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','upperwater_melting_rate','format','DoubleMat','mattype',3,'timeserieslength',2,'name','md.basalforcings.upperwater_melting_rate','scale',1./yts,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','upperwater_elevation','format','DoubleMat','mattype',3,'name','md.basalforcings.upperwater_elevation','yts',md.constants.yts)
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/linearbasalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/linearbasalforcings.py	(revision 28275)
+++ 	(revision )
@@ -1,118 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class linearbasalforcings(object):
-    """LINEAR BASAL FORCINGS class definition
-
-    Usage:
-        basalforcings = linearbasalforcings()
-    """
-
-    def __init__(self, *args):  # {{{
-        nargs = len(args)
-        if nargs == 0:
-            print('empty init')
-            self.deepwater_melting_rate = 0.
-            self.deepwater_elevation = 0.
-            self.upperwater_melting_rate = 0.
-            self.upperwater_elevation = 0.
-            self.groundedice_melting_rate = float('NaN')
-            self.perturbation_melting_rate = float('NaN')
-            self.geothermalflux = float('NaN')
-
-            # set defaults
-            self.setdefaultparameters()
-        elif nargs == 1 and args[0].__module__ == 'basalforcings':
-            print('converting basalforings to linearbasalforcings')
-            inv = args[0]
-            self.groundedice_melting_rate = inv.groundedice_melting_rate
-            self.perturbation_melting_rate = float('NaN')
-            self.geothermalflux = inv.geothermalflux
-            self.deepwater_melting_rate = 0.
-            self.deepwater_elevation = 0.
-            self.upperwater_melting_rate = 0.
-            self.upperwater_elevation = 0.
-
-            # Set defaults
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   linear basal forcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, "deepwater_melting_rate", "basal melting rate (positive if melting applied for floating ice whith base < deepwater_elevation) [m/yr]"))
-        s += '{}\n'.format(fielddisplay(self, "deepwater_elevation", "elevation of ocean deepwater [m]"))
-        s += '{}\n'.format(fielddisplay(self, "upperwater_melting_rate", "upper melting rate (positive if melting applied for floating ice whith base >= upperwater_elevation) [m/yr]"))
-        s += '{}\n'.format(fielddisplay(self, "upperwater_elevation", "elevation of ocean upper water [m]"))
-        s += '{}\n'.format(fielddisplay(self, "groundedice_melting_rate", "basal melting rate (positive if melting) [m/yr]"))
-        s += '{}\n'.format(fielddisplay(self, "perturbation_melting_rate", "perturbation applied to computed melting rate (positive if melting) [m/yr]"))
-        s += '{}\n'.format(fielddisplay(self, "geothermalflux", "geothermal heat flux [W/m^2]"))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.perturbation_melting_rate = project3d(md, 'vector', self.perturbation_melting_rate, 'type', 'node', 'layer', 1)
-        self.groundedice_melting_rate = project3d(md, 'vector', self.groundedice_melting_rate, 'type', 'node', 'layer', 1)
-        self.geothermalflux = project3d(md, 'vector', self.geothermalflux, 'type', 'node', 'layer', 1) # Bedrock only gets geothermal flux
-        return self
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.groundedice_melting_rate)):
-            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
-            print("      no basalforcings.groundedice_melting_rate specified: values set as zero")
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.deepwater_melting_rate = 50.0
-        self.deepwater_elevation = -800.0
-        self.upperwater_melting_rate = 0.0
-        self.upperwater_elevation = -400.0
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if not np.all(np.isnan(self.perturbation_melting_rate)):
-            md = checkfield(md, 'fieldname', 'basalforcings.perturbation_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_melting_rate', '>=', 0, 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', '<', 'basalforcings.upperwater_elevation', 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', '<=', 0, 'singletimeseries', 1)
-        if 'BalancethicknessAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_melting_rate', '>=', 0, 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', '<', 'basalforcings.upperwater_elevation', 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', '<=', 0, 'singletimeseries', 1)
-        if 'ThermalAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isthermal:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_melting_rate', '>=', 0, 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', '<', 'basalforcings.upperwater_elevation', 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', '<=', 0, 'singletimeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.geothermalflux', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'perturbation_melting_rate', 'name', 'md.basalforcings.perturbation_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'name', 'md.basalforcings.groundedice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'name', 'md.basalforcings.geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deepwater_melting_rate', 'format', 'DoubleMat', 'mattype', 3, 'timeserieslength', 2, 'name', 'md.basalforcings.deepwater_melting_rate', 'scale', 1. / yts, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deepwater_elevation', 'format', 'DoubleMat', 'mattype', 3, 'name', 'md.basalforcings.deepwater_elevation', 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperwater_melting_rate', 'format', 'DoubleMat', 'mattype', 3, 'timeserieslength', 2, 'name', 'md.basalforcings.upperwater_melting_rate', 'scale', 1. / yts, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperwater_elevation', 'format', 'DoubleMat', 'mattype', 3, 'name', 'md.basalforcings.upperwater_elevation', 'yts', yts)
-    # }}}
Index: sm/trunk/src/m/classes/linearbasalforcingsarma.m
===================================================================
--- /issm/trunk/src/m/classes/linearbasalforcingsarma.m	(revision 28275)
+++ 	(revision )
@@ -1,213 +1,0 @@
-%LINEAR BASAL FORCINGS ARMA class definition
-%
-%   Usage:
-%      linearbasalforcingsarma=linearbasalforcingsarma();
-
-classdef linearbasalforcingsarma
-	
-	properties (SetAccess=public) 
-		num_basins                = 0;
-		num_params                = 0;
-		num_breaks                = 0;
-		polynomialparams          = NaN;
-      datebreaks                = NaN;
-      ar_order                  = 0;
-      ma_order                  = 0;
-      arma_timestep             = 0;
-      arlag_coefs               = NaN;
-      malag_coefs               = NaN;
-      basin_id                  = NaN;
-		groundedice_melting_rate  = NaN;
-		deepwater_elevation       = NaN;
-		upperwater_melting_rate   = NaN;
-		upperwater_elevation      = NaN;
-		geothermalflux            = NaN;
-	end
-	methods
-		function self = linearbasalforcingsarma(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
-			self.deepwater_elevation=project3d(md,'vector',self.deepwater_elevation,'type','node','layer',1); 
-			self.upperwater_melting_rate=project3d(md,'vector',self.upperwater_melting_rate,'type','node','layer',1); 
-			self.upperwater_elevation=project3d(md,'vector',self.upperwater_elevation,'type','node','layer',1); 
-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.groundedice_melting_rate),
-				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			end
-			if isnan(self.trend)
-            self.trend = zeros(1,self.num_basins); %no trend in SMB
-            disp('      basalforcings.trend (trend) not specified: value set to 0');
-         end
-         if (self.ar_order==0)
-            self.ar_order = 1; %dummy 1 value for autoregression
-            self.arlag_coefs      = zeros(self.num_basins,self.ar_order); %autoregression coefficients all set to 0
-            disp('      basalforcings.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0');
-         end
-         if (self.ma_order==0)
-            self.ma_order = 1; %dummy 1 value for moving-average
-            self.arlag_coefs      = zeros(self.num_basins,self.ma_order); %moving-average coefficients all set to 0
-            disp('      basalforcings.ma_order (order of moving-average model) not specified: order of moving-average model set to 0');
-         end
-         if (self.arma_timestep==0)
-            self.arma_timestep = md.timestepping.time_step; %ARMA model has no prescribed time step
-            disp('      basalforcings.arma_timestep (timestep of ARMA model) not specified: set to md.timestepping.time_step');
-         end
-         if isnan(self.arlag_coefs)
-            self.arlag_coefs = zeros(self.num_basins,self.ar_order); %autoregression model of order 0
-            disp('      basalforcings.arlag_coefs (AR lag coefficients) not specified: order of autoregressive model set to 0');
-         end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.ar_order    = 0.0; %autoregression model of order 0
-         self.ma_order    = 0.0; %moving-average model of order 0
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.ismasstransport==0),
-				nbas = md.basalforcings.num_basins;
-				nprm = md.basalforcings.num_params;
-				nbrk = md.basalforcings.num_breaks;
-				md = checkfield(md,'fieldname','basalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
-				md = checkfield(md,'fieldname','basalforcings.num_params','numel',1,'NaN',1,'Inf',1,'>',0);
-				md = checkfield(md,'fieldname','basalforcings.num_breaks','numel',1,'NaN',1,'Inf',1,'>=',0);
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','NaN',1,'Inf',1,'size',[1,md.basalforcings.num_basins],'numel',md.basalforcings.num_basins);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','NaN',1,'Inf',1,'>=',0,'size',[1,md.basalforcings.num_basins],'numel',md.basalforcings.num_basins);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','NaN',1,'Inf',1,'<=',0,'size',[1,md.basalforcings.num_basins],'numel',md.basalforcings.num_basins);
-            md = checkfield(md,'fieldname','basalforcings.basin_id','Inf',1,'>=',0,'<=',md.basalforcings.num_basins,'size',[md.mesh.numberofelements,1]);
-            if(nbas>1 && nbrk>=1 && nprm>1)
-					md = checkfield(md,'fieldname','basalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1,nprm],'numel',nbas*(nbrk+1)*nprm);
-				elseif(nbas==1)
-					md = checkfield(md,'fieldname','basalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nprm,nbrk+1],'numel',nbas*(nbrk+1)*nprm);
-				elseif(nbrk==0)
-					md = checkfield(md,'fieldname','basalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nprm],'numel',nbas*(nbrk+1)*nprm);
-				elseif(nprm==1)
-					md = checkfield(md,'fieldname','basalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1],'numel',nbas*(nbrk+1)*nprm);
-				end
-				md = checkfield(md,'fieldname','basalforcings.ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-				md = checkfield(md,'fieldname','basalforcings.ma_order','numel',1,'NaN',1,'Inf',1,'>=',0);
-            md = checkfield(md,'fieldname','basalforcings.arma_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %moving-average time step cannot be finer than ISSM timestep
-            md = checkfield(md,'fieldname','basalforcings.arlag_coefs','NaN',1,'Inf',1,'size',[md.basalforcings.num_basins,md.basalforcings.ar_order]);
-            md = checkfield(md,'fieldname','basalforcings.malag_coefs','NaN',1,'Inf',1,'size',[md.basalforcings.num_basins,md.basalforcings.ma_order]);
-				if(nbrk>0)
-					md = checkfield(md,'fieldname','basalforcings.datebreaks','NaN',1,'Inf',1,'size',[nbas,nbrk]);
-				elseif(numel(md.basalforcings.datebreaks)==0 || all(isnan(md.basalforcings.datebreaks)))
-					;
-				else
-					error('md.basalforcings.num_breaks is 0 but md.basalforcings.datebreaks is not empty');
-         end
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				error('not implemented yet!');
-			end
-			if ismember('ThermalAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isthermal==0),
-				error('not implemented yet!');
-			end
-			if numel(md.basalforcings.geothermalflux)>1
-            md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-         end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   autoregression linear basal forcings parameters:'));
-			disp(sprintf('   autoregressive model is applied for deepwater_melting_rate'));
-
-			fielddisplay(self,'num_basins','number of different basins [unitless]');
-         fielddisplay(self,'basin_id','basin number assigned to each element [unitless]');
-         fielddisplay(self,'num_breaks','number of different breakpoints in the piecewise-polynomial (separating num_breaks+1 periods)');
-         fielddisplay(self,'num_params','number of different parameters in the piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)');
-         fielddisplay(self,'polynomialparams','coefficients for the polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders');
-         disp(sprintf('%51s  ex: polyparams=cat(3,intercepts,trendlinearcoefs,trendquadraticcoefs)',' '));
-         fielddisplay(self,'datebreaks','dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]');
-			fielddisplay(self,'ar_order','order of the autoregressive model [unitless]');
-         fielddisplay(self,'ar_order','order of the moving-average model [unitless]');
-         fielddisplay(self,'arma_timestep','time resolution of the ARMA model [yr]');
-         fielddisplay(self,'arlag_coefs','basin-specific vectors of AR lag coefficients [unitless]');
-         fielddisplay(self,'malag_coefs','basin-specific vectors of MA lag coefficients [unitless]');
-			fielddisplay(self,'deepwater_elevation','basin-specific elevation of ocean deepwater [m]');
-			fielddisplay(self,'upperwater_melting_rate','basin-specific basal melting rate (positive if melting applied for floating ice whith base >= upperwater_elevation) [m/yr]');
-			fielddisplay(self,'upperwater_elevation','basin-specific elevation of ocean upperwater [m]');
-			fielddisplay(self,'groundedice_melting_rate','node-specific basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'geothermalflux','node-specific geothermal heat flux [W/m^2]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-			nbas = md.basalforcings.num_basins;
-         nprm = md.basalforcings.num_params;
-         nper = md.basalforcings.num_breaks+1;
-         % Scale the parameters %
-         polyparamsScaled   = md.basalforcings.polynomialparams;
-         polyparams2dScaled = zeros(nbas,nper*nprm);
-         if(nprm>1)
-            % Case 3D %
-            if(nbas>1 && nper>1)
-               for(ii=[1:nprm])
-                  polyparamsScaled(:,:,ii) = polyparamsScaled(:,:,ii)*((1/yts)^(ii));
-               end
-               % Fit in 2D array %
-               for(ii=[1:nprm])
-                  jj = 1+(ii-1)*nper;
-                  polyparams2dScaled(:,jj:jj+nper-1) = polyparamsScaled(:,:,ii);
-               end
-            % Case 2D and higher-order params at increasing row index %
-            elseif(nbas==1)
-               for(ii=[1:nprm])
-                  polyparamsScaled(ii,:) = polyparamsScaled(ii,:)*((1/yts)^(ii));
-               end
-               % Fit in row array %
-               for(ii=[1:nprm])
-                  jj = 1+(ii-1)*nper;
-                  polyparams2dScaled(1,jj:jj+nper-1) = polyparamsScaled(ii,:);
-               end
-            % Case 2D and higher-order params at incrasing column index %
-            elseif(nper==1)
-               for(ii=[1:nprm])
-                  polyparamsScaled(:,ii) = polyparamsScaled(:,ii)*((1/yts)^(ii));
-               end
-               % 2D array is already in correct format %
-               polyparams2dScaled = polyparamsScaled;
-            end
-         else
-				polyparamsScaled   = polyparamsScaled*(1/yts);
-            % 2D array is already in correct format %
-            polyparams2dScaled = polyparamsScaled;
-         end
-         if(nper==1) %a single period (no break date)
-            dbreaks = zeros(nbas,1); %dummy
-         else
-            dbreaks = md.basalforcings.datebreaks;
-         end
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',9,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','num_params','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','num_breaks','format','Integer');
-         WriteData(fid,prefix,'object',self,'fieldname','ar_order','format','Integer');
-         WriteData(fid,prefix,'object',self,'fieldname','ma_order','format','Integer');
-         WriteData(fid,prefix,'object',self,'fieldname','arma_timestep','format','Double','scale',yts);
-         WriteData(fid,prefix,'object',self,'fieldname','basin_id','data',self.basin_id-1,'name','md.basalforcings.basin_id','format','IntMat','mattype',2); %0-indexed
-         WriteData(fid,prefix,'object',self,'fieldname','arlag_coefs','format','DoubleMat','name','md.basalforcings.arlag_coefs','yts',yts);	
-         WriteData(fid,prefix,'object',self,'fieldname','malag_coefs','format','DoubleMat','name','md.basalforcings.malag_coefs','yts',yts);	
-			WriteData(fid,prefix,'data',polyparams2dScaled,'name','md.basalforcings.polynomialparams','format','DoubleMat');
-			WriteData(fid,prefix,'data',dbreaks,'name','md.basalforcings.datebreaks','format','DoubleMat','scale',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','deepwater_elevation','format','DoubleMat','name','md.basalforcings.deepwater_elevation');
-			WriteData(fid,prefix,'object',self,'fieldname','upperwater_melting_rate','format','DoubleMat','name','md.basalforcings.upperwater_melting_rate','scale',1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','upperwater_elevation','format','DoubleMat','name','md.basalforcings.upperwater_elevation');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/linearbasalforcingsarma.py
===================================================================
--- /issm/trunk/src/m/classes/linearbasalforcingsarma.py	(revision 28275)
+++ 	(revision )
@@ -1,200 +1,0 @@
-import numpy as np
-
-from checkfield import *
-from fielddisplay import fielddisplay
-from project3d import *
-from WriteData import *
-
-class linearbasalforcingsarma(object):
-    """linearbasalforcingsarma class definition
-
-    Usage:
-        linearbasalforcingsarma = linearbasalforcingsarma()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.num_basins = 0
-        self.num_params = 0
-        self.num_breaks = 0
-        self.polynomialparams = np.nan
-        self.datebreaks       = np.nan
-        self.ar_order = 0
-        self.ma_order = 0
-        self.arma_timestep = 0
-        self.arlag_coefs = np.nan
-        self.malag_coefs = np.nan
-        self.basin_id = np.nan
-        self.groundedice_melting_rate = np.nan
-        self.deepwater_elevation = np.nan
-        self.upperwater_melting_rate = np.nan
-        self.upperwater_elevation = np.nan
-        self.geothermalflux = np.nan
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   surface forcings parameters:\n'
-        s += '   autoregressive model is applied for deepwater_melting_rate\n'
-        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of different basins [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin number assigned to each element [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'num_breaks', 'number of different breakpoints in the piecewise-polynomial (separating num_breaks+1 periods)'))
-        s += '{}\n'.format(fielddisplay(self, 'num_params', 'number of different parameters in the piecewise-polynomial (1:intercept only, 2:with linear trend, 3:with quadratic trend, etc.)'))
-        s += '{}\n'.format(fielddisplay(self, 'polynomialparams', 'coefficients for the polynomial (const,trend,quadratic,etc.),dim1 for basins,dim2 for periods,dim3 for orders, ex: polyparams=cat(num_params,intercepts,trendlinearcoefs,trendquadraticcoefs)'))
-        s += '{}\n'.format(fielddisplay(self, 'datebreaks', 'dates at which the breakpoints in the piecewise polynomial occur (1 row per basin) [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'ar_order', 'order of the autoregressive model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'ma_order', 'order of the moving-average model [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'arma_timestep', 'time resolution of the ARMA model [yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'arlag_coefs', 'basin-specific vectors of AR lag coefficients [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'malag_coefs', 'basin-specific vectors of MA lag coefficients [unitless]'))
-        s += '{}\n'.format(fielddisplay(self, 'deepwater_elevation', 'basin-specific elevation of ocean deepwater [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'upperwater_melting_rate', 'basin-specic basal melting rate (positive if melting applied for floating ice whith base >= upperwater_elevation) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'upperwater_elevation', 'basin-specific elevation of ocean upperwater [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate','node-specific basal melting rate (positive if melting) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'geothermalflux','node-specific geothermal heat flux [W/m^2]'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.ar_order = 0.0 # Autoregression model of order 0
-        self.ma_order = 0.0 # Moving-average model of order 0
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self # Nothing for now
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.groundedice_melting_rate)):
-            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
-            print("      no basalforcings.groundedice_melting_rate specified: values set as zero")
-        if np.all(np.isnan(self.trend)):
-            self.trend = np.zeros((1, self.num_basins)) # No trend in SMB
-            print('      basalforcings.trend (trend) not specified: value set to 0')
-        if self.ar_order == 0:
-            self.ar_order = 1 # Dummy 1 value for autoregression
-            self.arlag_coefs = np.zeros((self.num_basins, self.ar_order)) # Autoregression coefficients all set to 0
-            print('      basalforcings.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0')
-        if self.arma_timestep == 0:
-            self.arma_timestep = md.timestepping.time_step # ARMA model has no prescribed time step
-            print('      basalforcings.arma_timestep (timestep of ARMA model) not specified: set to md.timestepping.time_step')
-        if np.all(np.isnan(self.arlag_coefs)):
-            self.arlag_coefs = np.zeros((self.num_basins, self.ar_order)) # Autoregression model of order 0
-            print('      basalforcings.arlag_coefs (AR lag coefficients) not specified: order of autoregressive model set to 0')
-        if np.all(np.isnan(self.malag_coefs)):
-            self.arlag_coefs = np.zeros((self.num_basins, self.ma_order)) # Moving-average model of order 0
-            print('      basalforcings.malag_coefs (MA lag coefficients) not specified: order of moving-average model set to 0')
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'MasstransportAnalysis' in analyses:
-            nbas = md.basalforcings.num_basins;
-            nprm = md.basalforcings.num_params;
-            nbrk = md.basalforcings.num_breaks;
-            md = checkfield(md, 'fieldname', 'basalforcings.num_basins', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.num_params', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
-            md = checkfield(md, 'fieldname', 'basalforcings.num_breaks', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-
-            if len(np.shape(self.deepwater_elevation)) == 1:
-                self.deepwater_elevation = np.array([self.deepwater_elevation])
-                self.upperwater_elevation = np.array([self.upperwater_elevation])
-                self.upperwater_melting_rate = np.array([self.upperwater_melting_rate])
-            if len(np.shape(self.polynomialparams)) == 1:
-                self.polynomialparams = np.array([[self.polynomialparams]])
-            if(nbas>1 and nbrk>=1 and nprm>1):
-                md = checkfield(md,'fieldname','basalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk+1,nprm],'numel',nbas*(nbrk+1)*nprm)
-            elif(nbas==1):
-                md = checkfield(md,'fieldname','basalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nprm,nbrk+1],'numel',nbas*(nbrk+1)*nprm)
-            elif(nbrk==0):
-                md = checkfield(md,'fieldname','basalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nprm],'numel',nbas*(nbrk+1)*nprm)
-            elif(nprm==1):
-                md = checkfield(md,'fieldname','basalforcings.polynomialparams','NaN',1,'Inf',1,'size',[nbas,nbrk],'numel',nbas*(nbrk+1)*nprm)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', 'NaN', 1, 'Inf', 1, 'size', [1, md.basalforcings.num_basins], 'numel', md.basalforcings.num_basins)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', 'NaN', 1, 'Inf', 1, '<=', 0, 'size', [1, md.basalforcings.num_basins], 'numel', md.basalforcings.num_basins)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_melting_rate', 'NaN', 1, 'Inf', 1,'>=', 0, 'size', [1, md.basalforcings.num_basins], 'numel', md.basalforcings.num_basins)
-            md = checkfield(md, 'fieldname', 'basalforcings.basin_id', 'Inf', 1, '>=', 0, '<=', md.basalforcings.num_basins, 'size', [md.mesh.numberofelements])
-
-
-            md = checkfield(md, 'fieldname', 'basalforcings.ar_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-            md = checkfield(md, 'fieldname', 'basalforcings.ma_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
-            md = checkfield(md, 'fieldname', 'basalforcings.arma_timestep', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', md.timestepping.time_step) # Autoregression time step cannot be finer than ISSM timestep
-            md = checkfield(md, 'fieldname', 'basalforcings.arlag_coefs', 'NaN', 1, 'Inf', 1, 'size', [md.basalforcings.num_basins, md.basalforcings.ar_order])
-            md = checkfield(md, 'fieldname', 'basalforcings.malag_coefs', 'NaN', 1, 'Inf', 1, 'size', [md.basalforcings.num_basins, md.basalforcings.ma_order])
-            if(nbrk>0):
-                md = checkfield(md, 'fieldname', 'basalforcings.datebreaks', 'NaN', 1, 'Inf', 1, 'size', [nbas,nbrk])
-            elif(np.size(md.basalforcings.datebreaks)==0 or np.all(np.isnan(md.basalforcings.datebreaks))):
-                pass
-            else:
-                raise RuntimeError('md.basalforcings.num_breaks is 0 but md.basalforcings.datebreaks is not empty')
-
-        if 'BalancethicknessAnalysis' in analyses:
-            raise Exception('not implemented yet!')
-        if 'ThermalAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isthermal:
-            raise Exception('not implemented yet!')
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        nbas = md.basalforcings.num_basins;
-        nprm = md.basalforcings.num_params;
-        nper = md.basalforcings.num_breaks+1;
-        # Scale the parameters #
-        polyparamsScaled   = np.copy(md.basalforcings.polynomialparams)
-        polyparams2dScaled = np.zeros((nbas,nper*nprm))
-        if(nprm>1):
-            # Case 3D #
-            if(nbas>1 and nper>1):
-                for ii in range(nprm):
-                    polyparamsScaled[:,:,ii] = polyparamsScaled[:,:,ii]*(1/yts)**(ii+1)
-                # Fit in 2D array #
-                for ii in range(nprm):
-                    polyparams2dScaled[:,ii*nper:(ii+1)*nper] = 1*polyparamsScaled[:,:,ii]
-            # Case 2D and higher-order params at increasing row index #
-            elif(nbas==1):
-                for ii in range(nprm):
-                    polyparamsScaled[ii,:] = polyparamsScaled[ii,:]*(1/yts)**(ii+1)
-                # Fit in row array #
-                for ii in range(nprm):
-                    polyparams2dScaled[0,ii*nper:(ii+1)*nper] = 1*polyparamsScaled[ii,:]
-            # Case 2D and higher-order params at incrasing column index #
-            elif(nper==1):
-                for ii in range(nprm):
-                    polyparamsScaled[:,ii] = polyparamsScaled[:,ii]*(1/yts)**(ii+1)
-                # 2D array is already in correct format #
-                polyparams2dScaled = np.copy(polyparamsScaled)
-        else:
-            polyparamsScaled   = polyparamsScaled*(1/yts)
-            # 2D array is already in correct format #
-            polyparams2dScaled = np.copy(polyparamsScaled)
-        if(nper==1):
-            dbreaks = np.zeros((nbas,1))
-        else:
-            dbreaks = np.copy(md.basalforcings.datebreaks)
-
-        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 9, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'name', 'md.basalforcings.groundedice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'name', 'md.basalforcings.geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'num_basins', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'num_params', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'num_breaks', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ar_order', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ma_order', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'arma_timestep', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'basin_id', 'data', self.basin_id - 1, 'name', 'md.basalforcings.basin_id', 'format', 'IntMat', 'mattype', 2)  # 0-indexed
-        WriteData(fid, prefix, 'data', polyparams2dScaled, 'name', 'md.basalforcings.polynomialparams', 'format', 'DoubleMat')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'arlag_coefs', 'format', 'DoubleMat', 'name', 'md.basalforcings.arlag_coefs', 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'malag_coefs', 'format', 'DoubleMat', 'name', 'md.basalforcings.malag_coefs', 'yts', yts)
-        WriteData(fid, prefix, 'data', dbreaks, 'name', 'md.basalforcings.datebreaks', 'format', 'DoubleMat','scale',yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deepwater_elevation', 'format', 'DoubleMat', 'name', 'md.basalforcings.deepwater_elevation')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperwater_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.upperwater_melting_rate', 'scale', 1 / yts, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperwater_elevation', 'format', 'DoubleMat', 'name', 'md.basalforcings.upperwater_elevation')
-
-    # }}}
Index: sm/trunk/src/m/classes/love.m
===================================================================
--- /issm/trunk/src/m/classes/love.m	(revision 28275)
+++ 	(revision )
@@ -1,245 +1,0 @@
-%love class definition
-%
-%   Usage:
-%      md.love=love();
-
-classdef love
-	properties (SetAccess=public) 
-		nfreq						= 0;
-		frequencies					= 0;
-		sh_nmax						= 0;
-		sh_nmin						= 0;
-		g0							= 0;
-		r0							= 0;
-		mu0							= 0;
-		Gravitational_Constant		= 0;
-		chandler_wobble				= 0;
-		allow_layer_deletion		= 0;
-		underflow_tol				= 0;
-		pw_threshold				= 0;
-		min_integration_steps	= 0;
-		max_integration_dr	= 0;
-		integration_scheme	= 0;
-		istemporal					= 0;
-		n_temporal_iterations		= 0;
-		time						= 0;
-		love_kernels				= 0;
-		forcing_type				= 0;
-		inner_core_boundary			= 0;
-		core_mantle_boundary		= 0;
-		complex_computation			= 0;
-		quad_precision			= 0;
-		debug=0;
-		hypergeom_table1=0;
-		hypergeom_table2=0;
-		hypergeom_nalpha=0;
-		hypergeom_nz=0;
-		hypergeom_z=0;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. Update old properties here
-
-			if isstruct(self),
-				oldself=self;
-				%Assign property values from struct
-				self=structtoobj(love(),oldself);
-				if isfield(oldself,'int_steps_per_layers')
-					self.min_integration_steps	= self.int_steps_per_layers;
-				end
-			end
-		end% }}}
-	end
-	methods
-		function self = love(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			%we setup an elastic love number computation by default.
-			self.nfreq=1; 
-			self.frequencies=[0]; %Hz
-			self.sh_nmax=256; % .35 degree, 40 km at the equator.
-			self.sh_nmin=1;
-			% work on matlab script for computing g0 for given Earth's structure. 
-			self.g0=9.81; % m/s^2; 
-			self.r0=6371*1e3; %m;
-			self.mu0=1e11; % Pa
-			self.Gravitational_Constant=6.67259e-11; % m^3 kg^-1 s^-2
-			self.chandler_wobble=0;
-			self.allow_layer_deletion=1;
-			self.underflow_tol=1e-16; %threshold of deep to surface love number ratio to trigger the deletion of layer 
-			self.pw_threshold=1e-3; %if relative variation across frequencies is smaller than this ratio, the post-widder transform for time-dependent love numbers is bypassed 
-			self.min_integration_steps=50;
-			self.max_integration_dr=1e4;
-			self.integration_scheme=1;
-			self.istemporal=0;
-			self.n_temporal_iterations=8;
-			self.time=[0]; %s
-			self.love_kernels=0; 
-			self.forcing_type = 11; % surface loading
-			self.inner_core_boundary=1;
-			self.core_mantle_boundary=2;
-			self.complex_computation=0;
-			self.quad_precision=0;
-			self.debug=0;
-			self.hypergeom_table1=1;
-			self.hypergeom_table2=1;
-			self.hypergeom_nalpha=1;
-			self.hypergeom_nz=1;
-			self.hypergeom_z=0;
-		end % }}}
-		function disp(self) % {{{
-			fielddisplay(self,'nfreq','number of frequencies sampled (default: 1, elastic) [Hz]');
-			fielddisplay(self,'frequencies','frequencies sampled (convention defaults to 0 for the elastic case) [Hz]');
-			fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)');
-			fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default: 1)');
-			fielddisplay(self,'g0','adimensioning constant for gravity (default: 10) [m/s^2]');
-			fielddisplay(self,'r0','adimensioning constant for radius (default: 6371*10^3) [m]');
-			fielddisplay(self,'mu0','adimensioning constant for stress (default: 10^11) [Pa]');
-			fielddisplay(self,'Gravitational_Constant','Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])');
-			fielddisplay(self,'chandler_wobble','includes the inertial terms for the chandler wobble in the rotational feedback love numbers, only for forcing_type=11 (default: 0) (/!\ 1 has not been validated yet)');
-			fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)');			
-			fielddisplay(self,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default: 1e-16)');
-			fielddisplay(self,'pw_threshold','if relative variation across frequencies is smaller than this ratio, the post-widder transform for time-dependent love numbers is bypassed (default (1e-3)');
-			fielddisplay(self,'min_integration_steps','minimum number of radial steps to propagate the yi system from the bottom to the top of each layer (default: 50)');
-			fielddisplay(self,'max_integration_dr','maximum length of radial steps to propagate the yi system from the bottom to the top of each layer (default: 10e3) [m]');
-			fielddisplay(self,'integration_scheme','0: Euler, 1: Midpoint aka Runge-Kutta 2, 2: Runge-Kutta 4 (default: 1)');
-			fielddisplay(self,'istemporal',{'1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use love class function build_frequencies_from_time to meet consistency'});
-			fielddisplay(self,'n_temporal_iterations','max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default: 8)');
-			fielddisplay(self,'time','time vector for deformation if istemporal (default: 0) [s]');
-			fielddisplay(self,'love_kernels','compute love numbers at depth? (default: 0)');
-			fielddisplay(self,'forcing_type',{'integer indicating the nature and depth of the forcing for the Love number calculation (default: 11):','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction '});
-			fielddisplay(self,'inner_core_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default: 1)');
-			fielddisplay(self,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)'); 
-			fielddisplay(self,'complex_computation','return love numbers as 0: real (useful for elastic or temporal forms), 1: complex numbers (useful for Fourier spectral form) (default: 0)'); 
-			fielddisplay(self,'quad_precision','toggle computation love numbers and post-widder transform with 32 digit precision, useful for temporal form (default: 1)'); 
-			fielddisplay(self,'debug','outputs yi system matrix prior to solving (default: 0)'); 
-			fielddisplay(self,'hypergeom_table1','table 1 for hypergeometric function, only for EBM rheology (default: [1])'); 
-			fielddisplay(self,'hypergeom_table2','table 2 for hypergeometric function, only for EBM rheology (default: [1])'); 
-			fielddisplay(self,'hypergeom_nalpha','length of hypergeometric table, only for EBM rheology (default: 1)'); 
-			fielddisplay(self,'hypergeom_nz','width of hypergeometric table, only for EBM rheology (default: 1)'); 
-			fielddisplay(self,'hypergeom_z','abscissa for hypergeometric table, only for EBM rheology (default: [0])'); 
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('LoveAnalysis',analyses), return; end
-
-			md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',md.love.nfreq);
-			md = checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.Gravitational_Constant','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.chandler_wobble','values',[0 1]);
-			md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0 1]);
-			md = checkfield(md,'fieldname','love.underflow_tol','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.pw_threshold','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.min_integration_steps','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.max_integration_dr','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.integration_scheme','NaN',1,'Inf',1,'numel',1,'>=',0,'<=',2);
-			md = checkfield(md,'fieldname','love.love_kernels','values',[0 1]);
-			md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
-			md = checkfield(md,'fieldname','love.complex_computation','NaN',1,'Inf',1,'numel',1,'values',[0 1]);
-			md = checkfield(md,'fieldname','love.quad_precision','NaN',1,'Inf',1,'numel',1,'values',[0 1]);
-			md = checkfield(md,'fieldname','love.debug','NaN',1,'Inf',1,'numel',1,'values',[0 1]);
-
-			md = checkfield(md,'fieldname','love.istemporal','values',[0 1]);
-
-			md = checkfield(md,'fieldname','love.hypergeom_nalpha','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.hypergeom_nz','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','love.hypergeom_z','NaN',1,'Inf',1,'numel',md.love.hypergeom_nz);
-			md = checkfield(md,'fieldname','love.hypergeom_table1','NaN',1,'Inf',1,'numel',md.love.hypergeom_nz*md.love.hypergeom_nalpha);
-			md = checkfield(md,'fieldname','love.hypergeom_table2','NaN',1,'Inf',1,'numel',md.love.hypergeom_nz*md.love.hypergeom_nalpha);
-
-			if md.love.istemporal==1
-				md = checkfield(md,'fieldname','love.n_temporal_iterations','NaN',1,'Inf',1,'numel',1,'>',0);
-				md = checkfield(md,'fieldname','love.time','NaN',1,'Inf',1,'numel',md.love.nfreq/2/md.love.n_temporal_iterations);
-			end
-			if md.love.sh_nmin<=1 & (md.love.forcing_type==1 || md.love.forcing_type==5 || md.love.forcing_type==9)
-				error(['Degree 1 not supported for forcing type ' num2str(md.love.forcing_type) '. Use sh_min>=2 for this kind of calculation.'])
-			end
-
-			if md.love.chandler_wobble==1
-				disp('Warning, Chandler Wobble in Love number calculator has not been validated yet');
-			end
-
-			%need 'litho' material: 
-			if ~isa(md.materials,'materials') | ~sum(strcmpi(md.materials.nature,'litho'))
-				error('Need a ''litho'' material to run a Fourier Love number analysis');
-			end
-
-			mat=find(strcmpi(md.materials.nature,'litho'));
-			if md.love.forcing_type<=4
-				md = checkfield(md,'fieldname','love.inner_core_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
-			elseif md.love.forcing_type<=8
-				md = checkfield(md,'fieldname','love.core_mantle_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
-			end
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'object',self,'fieldname','nfreq','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','frequencies','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','sh_nmax','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','sh_nmin','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','g0','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','r0','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','mu0','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','Gravitational_Constant','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','chandler_wobble','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','allow_layer_deletion','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','underflow_tol','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','pw_threshold','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','min_integration_steps','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','max_integration_dr','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','integration_scheme','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','istemporal','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','n_temporal_iterations','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','complex_computation','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','quad_precision','format','Boolean');
-			%note: no need to marshall the time vector, we have frequencies
-			WriteData(fid,prefix,'object',self,'fieldname','love_kernels','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','inner_core_boundary','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','core_mantle_boundary','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','debug','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','hypergeom_table1','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','hypergeom_table2','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','hypergeom_nalpha','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','hypergeom_nz','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','hypergeom_z','format','DoubleMat','mattype',3);
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			error('not implemented yet!');
-		end % }}}
-		function self=build_frequencies_from_time(self) % {{{
-			if ~self.istemporal
-				error('cannot build frequencies for temporal love numbers if love.istemporal==0')
-			end
-			disp('Temporal love numbers: Overriding md.love.nfreq and md.love.frequencies');
-			self.nfreq=length(self.time)*2*self.n_temporal_iterations;
-			self.frequencies=zeros(self.nfreq,1);
-			for i=1:length(self.time)
-				for j=1:2*self.n_temporal_iterations
-					if self.time(i)==0
-						self.frequencies((i-1)*2*self.n_temporal_iterations +j) =0; % convention to avoid marshalling infinite numbers
-					else
-						self.frequencies((i-1)*2*self.n_temporal_iterations +j) = j*log(2)/self.time(i)/2/pi;
-					end
-				end
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/love.py
===================================================================
--- /issm/trunk/src/m/classes/love.py	(revision 28275)
+++ 	(revision )
@@ -1,232 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-class love(object):
-    """LOVE - class definition
-
-    Usage:
-        md.love = love()
-    """
-
-    def __init__(self):  # {{{
-        self.nfreq = 0
-        self.frequencies = 0
-        self.sh_nmax = 0
-        self.sh_nmin = 0
-        self.g0 = 0
-        self.r0 = 0
-        self.mu0 = 0
-        self.Gravitational_Constant = 0
-        self.chandler_wobble = 0
-        self.allow_layer_deletion = 0
-        self.underflow_tol = 0
-        self.pw_threshold = 0
-        self.min_integration_steps = 0
-        self.max_integration_dr = 0
-        self.integration_scheme = 0
-        self.istemporal = 0
-        self.n_temporal_iterations = 0
-        self.time = 0
-        self.love_kernels = 0
-        self.forcing_type = 0
-        self.inner_core_boundary = 0
-        self.core_mantle_boundary = 0
-        self.complex_computation = 0
-        self.quad_precision = 0
-        self.hypergeom_table1 = 0
-        self.hypergeom_table2 = 0
-        self.hypergeom_table1 = 0
-        self.hypergeom_nz = 0
-        self.hypergeom_z = 0
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '{}\n'.format(fielddisplay(self, 'nfreq', 'number of frequencies sampled (default: 1, elastic) [Hz]'))
-        s += '{}\n'.format(fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
-        s += '{}\n'.format(fielddisplay(self, 'sh_nmax', 'maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)'))
-        s += '{}\n'.format(fielddisplay(self, 'sh_nmin', 'minimum spherical harmonic degree (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'g0', 'adimensioning constant for gravity (default: 10) [m/s^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'r0', 'adimensioning constant for radius (default: 6371*10^3) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'mu0', 'adimensioning constant for stress (default: 10^11) [Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'Gravitational_Constant', 'Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])'))
-        s += '{}\n'.format(fielddisplay(self, 'chandler_wobble', 'includes the inertial terms for the chandler wobble in the rotational feedback love numbers, only for forcing_type=11 (default: 0) (/!\\ 1 has not been validated yet)'))
-        s += '{}\n'.format(fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'underflow_tol', 'threshold of deep to surface love number ratio to trigger the deletion of layers (default: 1e-16)'))
-        s += '{}\n'.format(fielddisplay(self, 'pw_threshold', 'if relative variation across frequencies is smaller than this ratio, the post-widder transform for time-dependent love numbers is bypassed (default (1e-3)'))
-        s += '{}\n'.format(fielddisplay(self, 'min_integration_steps', 'minimum number of radial steps to propagate the yi system from the bottom to the top of each layer (default: 50)'))
-        s += '{}\n'.format(fielddisplay(self, 'max_integration_dr', 'maximum length of radial steps to propagate the yi system from the bottom to the top of each layer (default: 10e3) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'istemporal', ['1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency']))
-        s += '{}\n'.format(fielddisplay(self, 'n_temporal_iterations', 'max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default: 8)'))
-        s += '{}\n'.format(fielddisplay(self, 'time', 'time vector for deformation if istemporal (default: 0) [s]'))
-        s += '{}\n'.format(fielddisplay(self, 'love_kernels', 'compute love numbers at depth? (default: 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'forcing_type', 'integer indicating the nature and depth of the forcing for the Love number calculation (default: 11):'))
-        s += '{}\n'.format('                                                     1:  Inner core boundary -- Volumic Potential')
-        s += '{}\n'.format('                                                     2:  Inner core boundary -- Pressure')
-        s += '{}\n'.format('                                                     3:  Inner core boundary -- Loading')
-        s += '{}\n'.format('                                                     4:  Inner core boundary -- Tangential traction')
-        s += '{}\n'.format('                                                     5:  Core mantle boundary -- Volumic Potential')
-        s += '{}\n'.format('                                                     6:  Core mantle boundary -- Pressure')
-        s += '{}\n'.format('                                                     7:  Core mantle boundary -- Loading')
-        s += '{}\n'.format('                                                     8:  Core mantle boundary -- Tangential traction')
-        s += '{}\n'.format('                                                     9:  Surface -- Volumic Potential')
-        s += '{}\n'.format('                                                     10: Surface -- Pressure')
-        s += '{}\n'.format('                                                     11: Surface -- Loading')
-        s += '{}\n'.format('                                                     12: Surface -- Tangential traction ')
-        s += '{}\n'.format(fielddisplay(self, 'inner_core_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'core_mantle_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)'))
-        s += '{}\n'.format(fielddisplay(self, 'complex_computation', 'return love numbers as 0: real (useful for elastic or temporal forms), 1: complex numbers (useful for Fourier spectral form) (default: 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'quad_precision', 'toggle computation love numbers and post-widder transform with 32 digit precision, useful for temporal form (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'debug', 'outputs yi system matrix prior to solving (default: 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'hypergeom_table1', 'table 1 for hypergeometric function, only for EBM rheology (default: [1])'))
-        s += '{}\n'.format(fielddisplay(self, 'hypergeom_table2', 'table 2 for hypergeometric function, only for EBM rheology (default: [1])'))
-        s += '{}\n'.format(fielddisplay(self, 'hypergeom_nalpha', 'length of hypergeometric table, only for EBM rheology (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'hypergeom_nz', 'width of hypergeometric table, only for EBM rheology (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'hypergeom_z', 'abscissa for hypergeometric table, only for EBM rheology (default: [0])'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # We setup an elastic love number computation by default
-        self.nfreq = 1
-        self.frequencies = [0] # Hz
-        self.sh_nmax = 256 # .35 degree, 40 km at the equator
-        self.sh_nmin = 1
-        # Work on Python script for computing g0 for given Earth's structure
-        self.g0 = 9.81 # m/s^2
-        self.r0 = 6371 * 1e3 # m
-        self.mu0 = 1e11 # Pa
-        self.Gravitational_Constant = 6.67259e-11 # m^3 kg^-1 s^-2
-        self.chandler_wobble = 0
-        self.allow_layer_deletion = 1
-        self.underflow_tol = 1e-16 # Threshold of deep to surface love number ratio to trigger the deletion of layer
-        self.pw_threshold = 1e-3 # If relative variation across frequencies is smaller than this ratio, the post-widder transform for time-dependent love numbers is bypassed 
-        self.min_integration_steps=50
-        self.max_integration_dr=1e4
-        self.integration_scheme=1
-        self.istemporal = 0
-        self.n_temporal_iterations = 8
-        self.time = [0] # s
-        self.love_kernels = 0
-        self.forcing_type = 11 # Surface loading
-        self.inner_core_boundary = 1
-        self.core_mantle_boundary = 2
-        self.complex_computation = 0
-        self.quad_precision = 0
-        self.debug = 0
-        self.hypergeom_table1 = 1
-        self.hypergeom_table2 = 1
-        self.hypergeom_nalpha = 1
-        self.hypergeom_nz = 1
-        self.hypergeom_z = 0
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'LoveAnalysis' not in analyses:
-            return md
-
-        md = checkfield(md, 'fieldname', 'love.nfreq', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.frequencies', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq)
-        md = checkfield(md, 'fieldname', 'love.sh_nmax', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.sh_nmin', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.g0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.r0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.mu0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.Gravitational_Constant', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.chandler_wobble', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'love.allow_layer_deletion', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'love.underflow_tol', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.pw_threshold', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.min_integration_steps', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.max_integration_dr', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.integration_scheme', 'NaN', 1, 'Inf', 1, 'numel', 1, '>=', 0, '<=', 2)
-        md = checkfield(md, 'fieldname', 'love.love_kernels', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'love.forcing_type', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', 12)
-        md = checkfield(md, 'fieldname', 'love.complex_computation', 'NaN', 1, 'Inf', 1, 'numel', 1, 'values', [0, 1])
-
-        md = checkfield(md, 'fieldname', 'love.istemporal', 'values', [0, 1])
-
-        md = checkfield(md, 'fieldname', 'love.hypergeom_nalpha', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.hypergeom_nz', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'love.hypergeom_z', 'NaN', 1, 'Inf', 1, 'numel', md.love.hypergeom_nz)
-        md = checkfield(md, 'fieldname', 'love.hypergeom_table1', 'NaN', 1, 'Inf', 1, 'numel', md.love.hypergeom_nz * md.love.hypergeom_nalpha)
-        md = checkfield(md, 'fieldname', 'love.hypergeom_table2', 'NaN', 1, 'Inf', 1, 'numel', md.love.hypergeom_nz * md.love.hypergeom_nalpha)
-
-        if md.love.istemporal:
-            md = checkfield(md, 'fieldname', 'love.n_temporal_iterations', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-            md = checkfield(md, 'fieldname', 'love.time', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq / 2 / md.love.n_temporal_iterations)
-        if md.love.sh_nmin <= 1 and (md.love.forcing_type == 1 or md.love.forcing_type == 5 or md.love.forcing_type == 9):
-            raise RuntimeError('Degree 1 not supported for forcing type {}. Use sh_min >= 2 for this kind of calculation.'.format(md.love.forcing_type))
-
-        if md.love.chandler_wobble  == 1:
-            print('Warning: Chandler wobble in Love number calculator has not been validated yet')
-
-        # Need 'litho' material
-        if md.materials.__class__.__name__ != 'materials' or 'litho' not in md.materials.nature:
-            raise RuntimeError('Need a \'litho\' material to run a Fourier Love number analysis')
-
-        mat = np.where(np.array(md.materials.nature) == 'litho')[0]
-        if md.love.forcing_type <= 4:
-            md = checkfield(md, 'fieldname', 'love.inner_core_boundary', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', md.materials[mat].numlayers)
-        elif md.love.forcing_type <= 8:
-            md = checkfield(md, 'fieldname', 'love.core_mantle_boundary', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', md.materials[mat].numlayers)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'nfreq', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'frequencies', 'format', 'DoubleMat', 'mattype',3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmax', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmin', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'g0', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'r0', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'mu0', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'Gravitational_Constant', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'chandler_wobble', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'allow_layer_deletion', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'underflow_tol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'pw_threshold', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_integration_steps', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'max_integration_dr', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'integration_scheme', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'istemporal', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'n_temporal_iterations', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'complex_computation', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'quad_precision', 'format', 'Boolean')
-        # Note: no need to marshall the time vector, we have frequencies
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_kernels', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'forcing_type', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'inner_core_boundary', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'core_mantle_boundary', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'debug', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hypergeom_table1', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hypergeom_table2', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hypergeom_nalpha', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hypergeom_nz', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hypergeom_z', 'format', 'DoubleMat', 'mattype', 3)
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def build_frequencies_from_time(self):  # {{{
-        if not self.istemporal:
-            raise RuntimeError('cannot build frequencies for temporal love numbers if love.istemporal==0')
-        print('Temporal love numbers: Overriding md.love.nfreq and md.love.frequencies')
-        self.nfreq = len(self.time) * 2 * self.n_temporal_iterations
-        self.frequencies = np.zeros((self.nfreq,))
-        for i in range(len(self.time)):
-            for j in range(2 * self.n_temporal_iterations):
-                if self.time[i] == 0:
-                    self.frequencies[(i - 1) * 2 * self.n_temporal_iterations + j] = 0 # Convention to avoid marshalling infinite numbers
-                else:
-                    self.frequencies[(i - 1) * 2 * self.n_temporal_iterations + j] = j * np.log(2) / self.time[i] / 2 / np.pi
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/lovenumbers.m
===================================================================
--- /issm/trunk/src/m/classes/lovenumbers.m	(revision 28275)
+++ 	(revision )
@@ -1,150 +1,0 @@
-%LOVENUMBERS numbers class definition
-%
-%   Usage:
-%      lovenumbers=lovenumbers() 
-%      lovenumbers=lovenumbers('maxdeg',10000,'referenceframe','CF'); 
-% 
-%   choose numbers of degrees required (1000 by default) and reference frame (between CF and CM; CM by default) 
-
-classdef lovenumbers
-	properties (SetAccess=public) 
-
-		%loading love numbers:
-		h             = []; %provided by PREM model
-		k             = []; %idem
-		l             = []; %idem
-		
-		%tidal love numbers for computing rotational feedback:
-		th            = [];
-		tk            = [];
-		tl            = [];
-		tk2secular    = 0; %deg 2 secular number.
-		pmtf_colinear = [];
-		pmtf_ortho    = [];
-
-		%time/frequency for visco-elastic love numbers
-		timefreq      = [];
-		istime        = 1;
-
-	end
-	methods
-		function self = lovenumbers(varargin) % {{{
-			options=pairoptions(varargin{:});
-			maxdeg=getfieldvalue(options,'maxdeg',1000);
-			referenceframe=getfieldvalue(options,'referenceframe','CM');
-			self=setdefaultparameters(self,maxdeg,referenceframe);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   lovenumbers parameters:'));
-
-			fielddisplay(self,'h','load Love number for radial displacement');
-			fielddisplay(self,'k','load Love number for gravitational potential perturbation');
-			fielddisplay(self,'l','load Love number for horizontal displacements');
-
-			fielddisplay(self,'th','tidal load Love number (deg 2)');
-			fielddisplay(self,'tk','tidal load Love number (deg 2)');
-			fielddisplay(self,'tl','tidal load Love number (deg 2)');
-			fielddisplay(self,'tk2secular','secular fluid Love number');
-			fielddisplay(self,'pmtf_colinear','Colinear component of the Polar Motion Transfer Function (e.g. x-motion due to x-component perturbation of the inertia tensor)');
-			fielddisplay(self,'pmtf_ortho','Orthogonal component of the Polar Motion Transfer Function (couples x and y components, only used for Chandler Wobble)');
-
-
-			fielddisplay(self,'istime','time (default: 1) or frequency love numbers (0)');
-			fielddisplay(self,'timefreq','time/frequency vector (yr or 1/yr)');
-
-		end % }}}
-		function self = setdefaultparameters(self,maxdeg,referenceframe) % {{{
-
-			%initialize love numbers:
-			self.h=getlovenumbers('type','loadingverticaldisplacement','referenceframe',referenceframe,'maxdeg',maxdeg);
-			self.k=getlovenumbers('type','loadinggravitationalpotential','referenceframe',referenceframe,'maxdeg',maxdeg);
-			self.l=getlovenumbers('type','loadinghorizontaldisplacement','referenceframe',referenceframe,'maxdeg',maxdeg);
-			self.th=getlovenumbers('type','tidalverticaldisplacement','referenceframe',referenceframe,'maxdeg',maxdeg);
-			self.tk=getlovenumbers('type','tidalgravitationalpotential','referenceframe',referenceframe,'maxdeg',maxdeg);
-			self.tl=getlovenumbers('type','tidalhorizontaldisplacement','referenceframe',referenceframe,'maxdeg',maxdeg);
-
-			%secular fluid love number: 
-			self.tk2secular=0.942;
-
-			self.pmtf_colinear=0.0;
-			self.pmtf_ortho=0.0;
-			if maxdeg>=2
-				self.pmtf_colinear=(1.0+self.k(3,:))/(1.0-self.tk(3,:)/self.tk2secular); %valid only for elastic regime, not viscous. Also neglects chandler wobble
-				self.pmtf_ortho=0.0;
-			end
-			%time: 
-			self.istime=1; %temporal love numbers by default
-			self.timefreq=0; %elastic case by default.
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
-				return; 
-			end
-
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.h','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.k','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.l','NaN',1,'Inf',1);
-			
-			
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.th','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.tk','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.tl','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.tk2secular','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.pmtf_colinear','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.pmtf_ortho','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.timefreq','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.lovenumbers.istime','NaN',1,'Inf',1,'values',[0 1]);
-
-			%check that love numbers are provided at the same level of accuracy: 
-			if (size(self.h,1)~=size(self.k,1) | size(self.h,1)~=size(self.l,1)),
-				error('lovenumbers error message: love numbers should be provided at the same level of accuracy');
-			end
-
-			ntf=length(self.timefreq);
-			if( size(self.h,2) ~= ntf | size(self.k,2) ~= ntf | size(self.l,2) ~= ntf | size(self.th,2) ~= ntf | size(self.tk,2) ~= ntf | size(self.tl,2) ~= ntf | size(self.pmtf_colinear,2) ~= ntf | size(self.pmtf_ortho,2) ~= ntf),
-				error('lovenumbers error message: love numbers should have as many time/frequency steps as the time/frequency vector');
-			end
-
-			if self.istime && self.timefreq(1)~=0
-				error('temporal love numbers must start with elastic response, i.e timefreq(1)=0');
-			end
-
-		end % }}}
-		function list=defaultoutputs(self,md) % {{{
-			list = {};
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'object',self,'fieldname','h','name','md.solidearth.lovenumbers.h','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','k','name','md.solidearth.lovenumbers.k','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','l','name','md.solidearth.lovenumbers.l','format','DoubleMat','mattype',1);
-
-			WriteData(fid,prefix,'object',self,'fieldname','th','name','md.solidearth.lovenumbers.th','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','tk','name','md.solidearth.lovenumbers.tk','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','tl','name','md.solidearth.lovenumbers.tl','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','pmtf_colinear','name','md.solidearth.lovenumbers.pmtf_colinear','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','pmtf_ortho','name','md.solidearth.lovenumbers.pmtf_ortho','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'data',self.tk2secular,'fieldname','lovenumbers.tk2secular','format','Double');
-
-			if self.istime,
-				scale=md.constants.yts; 
-			else
-				scale=1.0/md.constants.yts;
-			end
-			WriteData(fid,prefix,'object',self,'fieldname','istime','name','md.solidearth.lovenumbers.istime','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','timefreq','name','md.solidearth.lovenumbers.timefreq','format','DoubleMat','mattype',1,'scale',scale);
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			writejs1Darray(fid,[modelname '.lovenumbers.h'],self.h);
-			writejs1Darray(fid,[modelname '.lovenumbers.k'],self.k);
-			writejs1Darray(fid,[modelname '.lovenumbers.l'],self.l);
-			writejs1Darray(fid,[modelname '.lovenumbers.istime'],self.istime);
-			writejs1Darray(fid,[modelname '.lovenumbers.time'],self.time);
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/lovenumbers.py
===================================================================
--- /issm/trunk/src/m/classes/lovenumbers.py	(revision 28275)
+++ 	(revision )
@@ -1,140 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from getlovenumbers import getlovenumbers
-from pairoptions import pairoptions
-from WriteData import WriteData
-
-
-class lovenumbers(object):  #{{{
-    """lovenumbers class definition
-
-    Usage:
-        lovenumbers = lovenumbers()
-        lovenumbers = lovenumbers('maxdeg', 10000, 'referenceframe', 'CF');
-
-    Choose numbers of degrees required (1000 by default) and reference frame 
-    (between CF and CM; CM by default)
-    """
-
-    def __init__(self, *args):  #{{{
-        # Loading love numbers
-        self.h = [] # Provided by PREM model
-        self.k = [] # idem
-        self.l = [] # idem
-
-        # Tidal love numbers for computing rotational feedback
-        self.th = []
-        self.tk = []
-        self.tl = []
-        self.tk2secular = 0 # deg 2 secular number
-        self.pmtf_colinear = []
-        self.pmtf_ortho = []
-
-        # Time/frequency for visco-elastic love numbers
-        self.timefreq = []
-        self.istime = 1
-
-        options = pairoptions(*args)
-        maxdeg = options.getfieldvalue('maxdeg', 1000)
-        referenceframe = options.getfieldvalue('referenceframe', 'CM')
-        self.setdefaultparameters(maxdeg, referenceframe)
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = '   lovenumbers parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'h', 'load Love number for radial displacement'))
-        s += '{}\n'.format(fielddisplay(self, 'k', 'load Love number for gravitational potential perturbation'))
-        s += '{}\n'.format(fielddisplay(self, 'l', 'load Love number for horizontal displacements'))
-        s += '{}\n'.format(fielddisplay(self, 'th', 'tidal load Love number (deg 2)'))
-        s += '{}\n'.format(fielddisplay(self, 'tk', 'tidal load Love number (deg 2)'))
-        s += '{}\n'.format(fielddisplay(self, 'tl', 'tidal load Love number (deg 2)'))
-        s += '{}\n'.format(fielddisplay(self, 'tk2secular', 'secular fluid Love number'))
-        s += '{}\n'.format(fielddisplay(self, 'pmtf_colinear', 'Colinear component of the Polar Motion Transfer Function (e.g. x-motion due to x-component perturbation of the inertia tensor)'))
-        s += '{}\n'.format(fielddisplay(self, 'pmtf_ortho', 'Orthogonal component of the Polar Motion Transfer Function (couples x and y components, only used for Chandler Wobble)'))
-        s += '{}\n'.format(fielddisplay(self, 'istime', 'time (default: 1) or frequency love numbers (0)'))
-        s += '{}\n'.format(fielddisplay(self, 'timefreq', 'time/frequency vector (yr or 1/yr)'))
-        s += '{}\n'.format(fielddisplay(self, 'pmtf_colinear', 'Colinear component of the Polar Motion Transfer Function (e.g. x-motion due to x-component perturbation of the inertia tensor)'))
-        s += '{}\n'.format(fielddisplay(self, 'pmtf_ortho', 'Orthogonal component of the Polar Motion Transfer Function (couples x and y components, only used for Chandler Wobble)'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self, maxdeg, referenceframe):  #{{{
-        # Initialize love numbers
-        self.h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
-        self.k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
-        self.l = getlovenumbers('type', 'loadinghorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
-        self.th = getlovenumbers('type', 'tidalverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
-        self.tk = getlovenumbers('type', 'tidalgravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
-        self.tl = getlovenumbers('type', 'tidalhorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
-
-        # Secular fluid love number
-        self.tk2secular = 0.942
-
-        self.pmtf_colinear = np.array([0.0]).reshape(-1, 1)
-        self.pmtf_ortho = np.array([0.0]).reshape(-1, 1)
-        if maxdeg >= 2:
-            self.pmtf_colinear = ((1.0 + self.k[2, :]) / (1.0 - self.tk[2, :] / self.tk2secular)).reshape(-1, 1) # Valid only for elastic regime, not viscous. Also neglects chandler wobble.
-            self.pmtf_ortho = np.array([0.0]).reshape(-1, 1)
-        # Time
-        self.istime = 1 # Temporal love numbers by default
-        self.timefreq = np.zeros(1) # Elastic case by default
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
-            return
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.h', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.k', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.l', 'NaN', 1, 'Inf', 1)
-
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.th', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tk', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tl', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tk2secular', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.pmtf_colinear', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.pmtf_ortho', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.timefreq', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.istime', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
-
-        # Check that love numbers are provided at the same level of accuracy
-        if (self.h.shape[0] != self.k.shape[0]) or (self.h.shape[0] != self.l.shape[0]):
-            raise ValueError('lovenumbers error message: love numbers should be provided at the same level of accuracy')
-
-        ntf = len(self.timefreq)
-        if (np.shape(self.h)[1] != ntf or np.shape(self.k)[1] != ntf or np.shape(self.l)[1] != ntf or np.shape(self.th)[1] != ntf or np.shape(self.tk)[1] != ntf or np.shape(self.tl)[1] != ntf or np.shape(self.pmtf_colinear)[1] != ntf or np.shape(self.pmtf_ortho)[1] != ntf):
-            raise ValueError('lovenumbers error message: love numbers should have as many time/frequency steps as the time/frequency vector')
-
-        if self.istime and self.timefreq[0] != 0:
-            raise ValueError('temporal love numbers must start with elastic response, i.e. timefreq[0] = 0')
-        return md
-    # }}}
-
-    def defaultoutputs(self, md):  #{{{
-        return[]
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'h', 'name', 'md.solidearth.lovenumbers.h', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'k', 'name', 'md.solidearth.lovenumbers.k', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'l', 'name', 'md.solidearth.lovenumbers.l', 'format', 'DoubleMat', 'mattype', 1)
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'th', 'name', 'md.solidearth.lovenumbers.th', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'tk', 'name', 'md.solidearth.lovenumbers.tk', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'tl', 'name', 'md.solidearth.lovenumbers.tl', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'pmtf_colinear','name','md.solidearth.lovenumbers.pmtf_colinear','format','DoubleMat','mattype',1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'pmtf_ortho','name','md.solidearth.lovenumbers.pmtf_ortho','format','DoubleMat','mattype',1)
-        WriteData(fid, prefix, 'object', self, 'data', self.tk2secular, 'fieldname', 'lovenumbers.tk2secular', 'format', 'Double')
-
-        if (self.istime):
-            scale = md.constants.yts
-        else:
-            scale = 1.0 / md.constants.yts
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'istime', 'name', 'md.solidearth.lovenumbers.istime', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'timefreq', 'name', 'md.solidearth.lovenumbers.timefreq', 'format', 'DoubleMat', 'mattype', 1, 'scale', scale);
-    # }}}
-
-    def extrude(self, md):  #{{{
-        return
-    # }}}
Index: sm/trunk/src/m/classes/m1qn3inversion.m
===================================================================
--- /issm/trunk/src/m/classes/m1qn3inversion.m	(revision 28275)
+++ 	(revision )
@@ -1,206 +1,0 @@
-%M1QN3INVERSION class definition
-%
-%   Usage:
-%      m1qn3inversion=m1qn3inversion();
-
-classdef m1qn3inversion
-	properties (SetAccess=public) 
-		iscontrol                   = 0
-		incomplete_adjoint          = 0
-		control_parameters          = NaN
-		control_scaling_factors     = NaN
-		maxsteps                    = 0
-		maxiter                     = 0
-		dxmin                       = 0
-		dfmin_frac                  = 0
-		gttol                       = 0
-		cost_functions              = NaN
-		cost_functions_coefficients = NaN
-		min_parameters              = NaN
-		max_parameters              = NaN
-		vx_obs                      = NaN
-		vy_obs                      = NaN
-		vz_obs                      = NaN
-		vel_obs                     = NaN
-		thickness_obs               = NaN
-		surface_obs                 = NaN
-
-	end
-	methods
-		function self = m1qn3inversion(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(m1qn3inversion(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.vx_obs=project3d(md,'vector',self.vx_obs,'type','node');
-			self.vy_obs=project3d(md,'vector',self.vy_obs,'type','node');
-			self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node');
-			self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node');
-			if numel(self.cost_functions_coefficients)>1,self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node');end;
-			if numel(self.min_parameters)>1,self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node');end;
-			if numel(self.max_parameters)>1,self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node');end;
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default is incomplete adjoint for now
-			self.incomplete_adjoint=1;
-
-			%parameter to be inferred by control methods (only
-			%drag and B are supported yet)
-			self.control_parameters={'FrictionCoefficient'};
-
-			%Scaling factor for each control
-			self.control_scaling_factors=1;
-
-			%number of iterations
-			self.maxsteps=20;
-			self.maxiter=40;
-
-			%several responses can be used:
-			self.cost_functions=101;
-
-			%m1qn3 parameters
-			self.dxmin      = 0.1;
-			self.dfmin_frac = 1;
-			self.gttol      = 1e-4;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~self.iscontrol, return; end
-
-			if ~IssmConfig('_HAVE_M1QN3_'),
-				md = checkmessage(md,['M1QN3 has not been installed, ISSM needs to be reconfigured and recompiled with M1QN3']);
-			end
-			num_controls=numel(md.inversion.control_parameters);
-			num_costfunc=size(md.inversion.cost_functions,2);
-
-			md = checkfield(md,'fieldname','inversion.iscontrol','values',[0 1]);
-			md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0 1]);
-			md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',supportedcontrols());
-			md = checkfield(md,'fieldname','inversion.control_scaling_factors','size',[1 num_controls],'>',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','inversion.maxsteps','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.maxiter','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.dxmin','numel',1,'>',0);
-         md = checkfield(md,'fieldname','inversion.dfmin_frac','numel',1,'>=',0,'<=',1);
-			md = checkfield(md,'fieldname','inversion.gttol','numel',1,'>',0);
-			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',supportedcostfunctions());
-			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
-			md = checkfield(md,'fieldname','inversion.min_parameters','size',[NaN num_controls]);
-			md = checkfield(md,'fieldname','inversion.max_parameters','size',[NaN num_controls]);
-
-			if strcmp(solution,'BalancethicknessSolution')
-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','inversion.surface_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			elseif strcmp(solution,'BalancethicknessSoftSolution')
-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			else
-				md = checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				if ~strcmp(domaintype(md.mesh),'2Dvertical'),
-					md = checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				end
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   m1qn3inversion parameters:'));
-			fielddisplay(self,'iscontrol','is inversion activated?');
-			fielddisplay(self,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity');
-			fielddisplay(self,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
-			fielddisplay(self,'control_scaling_factors','order of magnitude of each control (useful for multi-parameter optimization)');
-			fielddisplay(self,'maxsteps','maximum number of iterations (gradient computation)');
-			fielddisplay(self,'maxiter','maximum number of Function evaluation (forward run)');
-			fielddisplay(self,'dxmin','convergence criterion: two points less than dxmin from eachother (sup-norm) are considered identical');
-         fielddisplay(self,'dfmin_frac','expected reduction of J during the first step (e.g., 0.3=30% reduction in cost function)');
-			fielddisplay(self,'gttol','convergence criterion: ||g(X)||/||g(X0)|| (g(X0): gradient at initial guess X0)');
-			fielddisplay(self,'cost_functions','indicate the type of response for each optimization step');
-			fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
-			fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'vx_obs','observed velocity x component [m/yr]');
-			fielddisplay(self,'vy_obs','observed velocity y component [m/yr]');
-			fielddisplay(self,'vel_obs','observed velocity magnitude [m/yr]');
-			fielddisplay(self,'thickness_obs','observed thickness [m]');
-			fielddisplay(self,'surface_obs','observed surface elevation [m]');
-			disp('Available cost functions:');
-			disp('   101: SurfaceAbsVelMisfit');
-			disp('   102: SurfaceRelVelMisfit');
-			disp('   103: SurfaceLogVelMisfit');
-			disp('   104: SurfaceLogVxVyMisfit');
-			disp('   105: SurfaceAverageVelMisfit');
-			disp('   201: ThicknessAbsMisfit');
-			disp('   501: DragCoefficientAbsGradient');
-			disp('   502: RheologyBbarAbsGradient');
-			disp('   503: ThicknessAbsGradient');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');
-			WriteData(fid,prefix,'name','md.inversion.type','data',2,'format','Integer');
-			if ~self.iscontrol, return; end
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','dxmin','format','Double');
-         WriteData(fid,prefix,'object',self,'class','inversion','fieldname','dfmin_frac','format','Double');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			if(numel(self.thickness_obs)==md.mesh.numberofelements),
-				mattype=2;
-			else
-				mattype=1;
-			end
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
-
-			%process control parameters
-			num_control_parameters=numel(self.control_parameters);
-			WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray');
-			WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer');
-
-			%process cost functions
-			num_cost_functions=size(self.cost_functions,2);
-			data=marshallcostfunctions(self.cost_functions);
-			WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','StringArray');
-			WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.inversion.iscontrol'],self.iscontrol);
-			writejsdouble(fid,[modelname '.inversion.incomplete_adjoint'],self.incomplete_adjoint);
-			writejscellstring(fid,[modelname '.inversion.control_parameters'],self.control_parameters);
-			writejsdouble(fid,[modelname '.inversion.control_scaling_factors'],self.control_scaling_factors);
-			writejsdouble(fid,[modelname '.inversion.maxsteps'],self.maxsteps);
-			writejsdouble(fid,[modelname '.inversion.maxiter'],self.maxiter);
-			writejsdouble(fid,[modelname '.inversion.dxmin'],self.dxmin);
-         writejsdouble(fid,[modelname '.inversion.dfmin_frac'],self.dfmin_frac);
-			writejsdouble(fid,[modelname '.inversion.gttol'],self.gttol);
-			writejs2Darray(fid,[modelname '.inversion.cost_functions'],self.cost_functions);
-			writejs2Darray(fid,[modelname '.inversion.cost_functions_coefficients'],self.cost_functions_coefficients);
-			writejs1Darray(fid,[modelname '.inversion.min_parameters'],self.min_parameters);
-			writejs1Darray(fid,[modelname '.inversion.max_parameters'],self.max_parameters);
-			writejs1Darray(fid,[modelname '.inversion.vx_obs'],self.vx_obs);
-			writejs1Darray(fid,[modelname '.inversion.vy_obs'],self.vy_obs);
-			writejs1Darray(fid,[modelname '.inversion.vz_obs'],self.vz_obs);
-			writejs1Darray(fid,[modelname '.inversion.vel_obs'],self.vel_obs);
-			writejs1Darray(fid,[modelname '.inversion.thickness_obs'],self.thickness_obs);
-			writejs1Darray(fid,[modelname '.inversion.surface_obs'],self.surface_obs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/m1qn3inversion.py
===================================================================
--- /issm/trunk/src/m/classes/m1qn3inversion.py	(revision 28275)
+++ 	(revision )
@@ -1,195 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from marshallcostfunctions import marshallcostfunctions
-from project3d import project3d
-from supportedcontrols import supportedcontrols
-from supportedcostfunctions import supportedcostfunctions
-from WriteData import WriteData
-
-
-class m1qn3inversion(object):
-    """M1QN3 class definition
-
-    Usage:
-        m1qn3inversion = m1qn3inversion()
-    """
-
-    def __init__(self, *args):  # {{{
-        if not len(args):
-            print('empty init')
-            self.iscontrol                   = 0
-            self.incomplete_adjoint          = 0
-            self.control_parameters          = np.nan
-            self.control_scaling_factors     = np.nan
-            self.maxsteps                    = 0
-            self.maxiter                     = 0
-            self.dxmin                       = 0.
-            self.dfmin_frac                  = 0.
-            self.gttol                       = 0.
-            self.cost_functions              = np.nan
-            self.cost_functions_coefficients = np.nan
-            self.min_parameters              = np.nan
-            self.max_parameters              = np.nan
-            self.vx_obs                      = np.nan
-            self.vy_obs                      = np.nan
-            self.vz_obs                      = np.nan
-            self.vel_obs                     = np.nan
-            self.thickness_obs               = np.nan
-
-            self.setdefaultparameters()
-        elif len(args) == 1 and args[0].__module__ == 'inversion':
-            print('converting inversion to m1qn3inversion')
-            inv = args[0]
-            #first call setdefaultparameters:
-            self.setdefaultparameters()
-
-            #then go fish whatever is available in the inversion object provided to the constructor
-            self.iscontrol = inv.iscontrol
-            self.incomplete_adjoint = inv.incomplete_adjoint
-            self.control_parameters = inv.control_parameters
-            self.maxsteps = inv.nsteps
-            self.cost_functions = inv.cost_functions
-            self.cost_functions_coefficients = inv.cost_functions_coefficients
-            self.min_parameters = inv.min_parameters
-            self.max_parameters = inv.max_parameters
-            self.vx_obs = inv.vx_obs
-            self.vy_obs = inv.vy_obs
-            self.vz_obs = inv.vz_obs
-            self.vel_obs = inv.vel_obs
-            self.thickness_obs = inv.thickness_obs
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   m1qn3inversion parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'iscontrol', 'is inversion activated?'))
-        s += '{}\n'.format(fielddisplay(self, 'incomplete_adjoint', '1: linear viscosity, 0: non - linear viscosity'))
-        s += '{}\n'.format(fielddisplay(self, 'control_parameters', 'ex: [''FrictionCoefficient''], or [''MaterialsRheologyBbar'']'))
-        s += '{}\n'.format(fielddisplay(self, 'control_scaling_factors', 'order of magnitude of each control (useful for multi - parameter optimization)'))
-        s += '{}\n'.format(fielddisplay(self, 'maxsteps', 'maximum number of iterations (gradient computation)'))
-        s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of Function evaluation (forward run)'))
-        s += '{}\n'.format(fielddisplay(self, 'dxmin', 'convergence criterion: two points less than dxmin from eachother (sup - norm) are considered identical'))
-        s += '{}\n'.format(fielddisplay(self, 'dfmin_frac', 'expected reduction of J during the first step (e.g., 0.3=30% reduction in cost function)'))
-        s += '{}\n'.format(fielddisplay(self, 'gttol', '||g(X)||/||g(X0)|| (g(X0): gradient at initial guess X0)'))
-        s += '{}\n'.format(fielddisplay(self, 'cost_functions', 'indicate the type of response for each optimization step'))
-        s += '{}\n'.format(fielddisplay(self, 'cost_functions_coefficients', 'cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
-        s += '{}\n'.format(fielddisplay(self, 'min_parameters', 'absolute minimum acceptable value of the inversed parameter on each vertex'))
-        s += '{}\n'.format(fielddisplay(self, 'max_parameters', 'absolute maximum acceptable value of the inversed parameter on each vertex'))
-        s += '{}\n'.format(fielddisplay(self, 'vx_obs', 'observed velocity x component [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vy_obs', 'observed velocity y component [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vel_obs', 'observed velocity magnitude [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'thickness_obs', 'observed thickness [m]'))
-        s += '{}\n'.format('Available cost functions:')
-        s += '{}\n'.format('   101: SurfaceAbsVelMisfit')
-        s += '{}\n'.format('   102: SurfaceRelVelMisfit')
-        s += '{}\n'.format('   103: SurfaceLogVelMisfit')
-        s += '{}\n'.format('   104: SurfaceLogVxVyMisfit')
-        s += '{}\n'.format('   105: SurfaceAverageVelMisfit')
-        s += '{}\n'.format('   201: ThicknessAbsMisfit')
-        s += '{}\n'.format('   501: DragCoefficientAbsGradient')
-        s += '{}\n'.format('   502: RheologyBbarAbsGradient')
-        s += '{}\n'.format('   503: ThicknessAbsGradient')
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #default is incomplete adjoint for now
-        self.incomplete_adjoint = 1
-        #parameter to be inferred by control methods (only
-        #drag and B are supported yet)
-        self.control_parameters = 'FrictionCoefficient'
-        #Scaling factor for each control
-        self.control_scaling_factors = 1
-        #number of iterations
-        self.maxsteps = 20
-        self.maxiter = 40
-        #several responses can be used:
-        self.cost_functions = 101
-        #m1qn3 parameters
-        self.dxmin = 0.1
-        self.dfmin_frac = 1.
-        self.gttol = 1e-4
-
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.vx_obs = project3d(md, 'vector', self.vx_obs, 'type', 'node')
-        self.vy_obs = project3d(md, 'vector', self.vy_obs, 'type', 'node')
-        self.vel_obs = project3d(md, 'vector', self.vel_obs, 'type', 'node')
-        self.thickness_obs = project3d(md, 'vector', self.thickness_obs, 'type', 'node')
-        if not np.any(np.isnan(self.cost_functions_coefficients)):
-            self.cost_functions_coefficients = project3d(md, 'vector', self.cost_functions_coefficients, 'type', 'node')
-        if not np.any(np.isnan(self.min_parameters)):
-            self.min_parameters = project3d(md, 'vector', self.min_parameters, 'type', 'node')
-        if not np.any(np.isnan(self.max_parameters)):
-            self.max_parameters = project3d(md, 'vector', self.max_parameters, 'type', 'node')
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if not self.iscontrol:
-            return md
-
-        num_controls = np.size(md.inversion.control_parameters)
-        num_costfunc = np.size(md.inversion.cost_functions)
-
-        md = checkfield(md, 'fieldname', 'inversion.iscontrol', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'inversion.incomplete_adjoint', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'inversion.control_parameters', 'cell', 1, 'values', supportedcontrols())
-        md = checkfield(md, 'fieldname', 'inversion.control_scaling_factors', 'size', [num_controls], '>', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'inversion.maxsteps', 'numel', [1], '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.maxiter', 'numel', [1], '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.dxmin', 'numel', [1], '>', 0.)
-        md = checkfield(md, 'fieldname', 'inversion.dfmin_frac', 'numel', [1], '>=', 0., '<=', 1.)
-        md = checkfield(md, 'fieldname', 'inversion.gttol', 'numel', [1], '>', 0.)
-        md = checkfield(md, 'fieldname', 'inversion.cost_functions', 'size', [num_costfunc], 'values', supportedcostfunctions())
-        md = checkfield(md, 'fieldname', 'inversion.cost_functions_coefficients', 'size', [md.mesh.numberofvertices, num_costfunc], '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.min_parameters', 'size', [md.mesh.numberofvertices, num_controls])
-        md = checkfield(md, 'fieldname', 'inversion.max_parameters', 'size', [md.mesh.numberofvertices, num_controls])
-
-        if solution == 'BalancethicknessSolution':
-            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        elif solution == 'BalancethicknessSoftSolution':
-            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        else:
-            md = checkfield(md, 'fieldname', 'inversion.vx_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'inversion.vy_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'iscontrol', 'format', 'Boolean')
-        WriteData(fid, prefix, 'name', 'md.inversion.type', 'data', 2, 'format', 'Integer')
-        if not self.iscontrol:
-            return
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'incomplete_adjoint', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'control_scaling_factors', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'maxsteps', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'maxiter', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'dxmin', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'dfmin_frac', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'gttol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'cost_functions_coefficients', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'min_parameters', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'max_parameters', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vx_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vy_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vz_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'thickness_obs', 'format', 'DoubleMat', 'mattype', 1)
-
-        # Process control parameters
-        num_control_parameters = len(self.control_parameters)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'control_parameters', 'format', 'StringArray')
-        WriteData(fid, prefix, 'data', num_control_parameters, 'name', 'md.inversion.num_control_parameters', 'format', 'Integer')
-
-        # Process cost functions
-        num_cost_functions = np.size(self.cost_functions)
-        data = marshallcostfunctions(self.cost_functions)
-        WriteData(fid, prefix, 'data', data, 'name', 'md.inversion.cost_functions', 'format', 'StringArray')
-        WriteData(fid, prefix, 'data', num_cost_functions, 'name', 'md.inversion.num_cost_functions', 'format', 'Integer')
-    # }}}
Index: sm/trunk/src/m/classes/mask.js
===================================================================
--- /issm/trunk/src/m/classes/mask.js	(revision 28275)
+++ 	(revision )
@@ -1,49 +1,0 @@
-//MASK class definition
-//
-//   Usage:
-//      mask= new mask();
-
-function mask () {
-	//properties 
-	// {{{
-		this.ocean_levelset	= NaN;
-		this.ice_levelset	= NaN;
-		//}}}
-	//methods 
-		this.setdefaultparameters = function (){ //{{{
-		} // }}}
-		this.disp = function () { //{{{
-			console.log(sprintf("   masks:")); 
-
-			fielddisplay(this,'ocean_levelset','presence of ocean if < 0, coastline/grounding line if = 0, no ocean if > 0');
-			fielddisplay(this,'ice_levelset','presence of ice if < 0, icefront position if = 0, no ice if > 0');
-		} //}}}
-		this.extrude = function(md) {//{{{
-			this.ocean_levelset=project3d(md,'vector',this.ocean_levelset,'type','node');
-			this.ice_levelset=project3d(md,'vector',this.ice_levelset,'type','node');
-			return this;
-		}//}}}
-		this.classname = function () { //{{{
-			return "mask";
-		} //}}}
-		this.checkconsistency = function(md,solution,analyses){ //{{{
-			if (solution=='LoveSolution') return;
-
-			checkfield(md,'fieldname','mask.ocean_levelset','size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mask.ice_levelset'        ,'size',[md.mesh.numberofvertices, 1]);
-			var isice=NewArrayFill(md.mesh.numberofvertices,0); 
-			for(var i=0;i<md.mesh.numberofvertices;i++)if(md.mask.ice_levelset[i]<=0)isice[i]=1;
-			if (ArraySum(isice)==0){
-				console.log('no ice present in the domain');
-			}
-			if (ArrayMax(md.mask.ice_levelset)<0){
-				console.log('no ice front provided');
-			}
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-            WriteData(fid,prefix,'object',this,'fieldname','ocean_levelset','format','DoubleMat','mattype',1);
-            WriteData(fid,prefix,'object',this,'fieldname','ice_levelset','format','DoubleMat','mattype',1);
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-}
Index: sm/trunk/src/m/classes/mask.m
===================================================================
--- /issm/trunk/src/m/classes/mask.m	(revision 28275)
+++ 	(revision )
@@ -1,126 +1,0 @@
-%MASK class definition
-%
-%   Usage:
-%      mask=mask();
-
-classdef mask
-	properties (SetAccess=public) 
-		ocean_levelset = NaN;
-		ice_levelset   = NaN;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. Update old properties here
-
-			%2014 February 5th. NOT NEED ANYMORE, AND CAN LEAD TO CONFUSION for sea-level models. 
-			%if numel(self.ice_levelset)>1 & all(self.ice_levelset>=0),
-			%	disp('WARNING: md.mask.ice_levelset>=0, you probably need to change the sign of this levelset');
-			%end
-
-			%2020 May 15th
-			if isstruct(self)
-				selfnew = mask();
-				if isfield(self,'ice_levelset')
-					selfnew.ice_levelset = self.ice_levelset;
-				end
-				if isfield(self,'ocean_levelset')
-					selfnew.ocean_levelset = self.ocean_levelset;
-				end
-				if isfield(self,'groundedice_levelset')
-					disp('WARNING: automatically updated md.mask as groundedice_levelset is now ocean_levelset');
-					selfnew.ocean_levelset = self.groundedice_levelset;
-				end
-				self = selfnew;
-			end
-		end % }}}
-	end
-	methods
-		function disp(self) % {{{
-			disp(sprintf('   masks:'));
-
-			fielddisplay(self,'ocean_levelset','presence of ocean if < 0, coastline/grounding line if = 0, no ocean if > 0');
-			fielddisplay(self,'ice_levelset','presence of ice if < 0, icefront position if = 0, no ice if > 0');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.ocean_levelset=project3d(md,'vector',self.ocean_levelset,'type','node');
-			self.ice_levelset=project3d(md,'vector',self.ice_levelset,'type','node');
-		end % }}}
-		function self = mask(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self=setocean(self,varargin) % {{{
-			if nargin==3,
-				ocean=varargin{1}; 
-				index=varargin{2};
-				self.ocean_levelset(index)=-ocean;
-			elseif nargin==2,
-				ocean=varargin{1}; 
-				self.ocean_levelset=-ocean;
-			else error('oceanset error message: not supported yet');
-			end
-		end % }}}
-		function self=setice(self,varargin) % {{{
-			if nargin==3,
-				ice=varargin{1}; 
-				index=varargin{2};
-				self.ice_levelset(index)=-ice;
-			elseif nargin==2,
-				ice=varargin{1}; 
-				self.ice_levelset=-ice;
-			else error('iceset error message: not supported yet');
-			end
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			if strcmpi(solution,'LoveSolution'), return; end;
-
-			if isa(self.ocean_levelset,'cell'),
-				for i=1:length(self.ocean_levelset),
-					md = checkfield(md,'field',self.ocean_levelset{i},'NaN',0,'Inf',1,'timeserieslength',1,'Inf',1);
-				end
-			else
-				md = checkfield(md,'fieldname','mask.ocean_levelset','timeseries',1,'NaN',1);
-			end
-			
-			if isa(self.ice_levelset,'cell'),
-				for i=1:length(self.ice_levelset),
-					md = checkfield(md,'field',self.ice_levelset{i},'NaN',0,'Inf',1,'timeserieslength',1,'Inf',1);
-				end
-			else
-				md = checkfield(md,'fieldname','mask.ice_levelset','timeseries',1,'NaN',1);
-				isice=(md.mask.ice_levelset<=0);
-				if sum(isice)==0,
-					warning('no ice present in the domain');
-				end
-			end
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			if isa(self.ocean_levelset,'cell'),
-				WriteData(fid,prefix,'object',self,'fieldname','ocean_levelset','name','md.mask.ocean_levelset','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			else
-				WriteData(fid,prefix,'object',self,'fieldname','ocean_levelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			end
-
-			if isa(self.ice_levelset,'cell'),
-				WriteData(fid,prefix,'object',self,'fieldname','ice_levelset','name','md.mask.ice_levelset','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			else
-				WriteData(fid,prefix,'object',self,'fieldname','ice_levelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			end
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.mask.ocean_levelset'],self.ocean_levelset);
-			writejs1Darray(fid,[modelname '.mask.ice_levelset'],self.ice_levelset);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/mask.py
===================================================================
--- /issm/trunk/src/m/classes/mask.py	(revision 28275)
+++ 	(revision )
@@ -1,95 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class mask(object):
-    """MASK class definition
-
-    Usage:
-        mask = mask()
-    """
-    
-    def __init__(self):  # {{{
-        self.ice_levelset = float('NaN')
-        self.ocean_levelset = float('NaN')
-
-        #set defaults
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "   masks:"
-
-        string = "%s\n%s" % (string, fielddisplay(self, "ocean_levelset", "presence of ocean if < 0, coastline/grounding line if = 0, no ocean if > 0"))
-        string = "%s\n%s" % (string, fielddisplay(self, "ice_levelset", "presence of ice if < 0, icefront position if = 0, no ice if > 0"))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.ice_levelset = project3d(md, 'vector', self.ice_levelset, 'type', 'node')
-        self.ocean_levelset = project3d(md, 'vector', self.ocean_levelset, 'type', 'node')
-
-        return self
-    # }}}
-
-    def mask(self, *args):  # {{{
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise RuntimeError("constructor not supported")
-
-        return self
-    # }}}
-
-    def oceanset(self, *args):  # {{{
-        if len(args) == 2:
-            ocean = args[0]
-            index = args[1]
-            self.ocean_levelset[index] = -ocean
-        elif len(args) == 1:
-            ocean = args[0]
-            self.ocean_levelset = -ocean
-        else:
-            raise RuntimeError("oceanset error message: not supported yet")
-
-        return self
-    # }}}
-
-    def iceset(self, *args):  # {{{
-        if len(args) == 2:
-            ice = args[0]
-            index = args[1]
-            self.ice_levelset[index] = -ice
-        elif len(args) == 1:
-            ice = args[0]
-            self.ocean_levelset = -ice
-        else:
-            raise RuntimeError("iceset error message: not supported yet")
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if solution == 'LoveSolution':
-            return
-
-        md = checkfield(md, 'fieldname', 'mask.ice_levelset', 'size', [md.mesh.numberofvertices])
-        isice = np.array(md.mask.ice_levelset <= 0, int)
-        if np.sum(isice) == 0:
-            raise TypeError("no ice present in the domain")
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_levelset', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ice_levelset', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-    # }}}
Index: sm/trunk/src/m/classes/masscon.m
===================================================================
--- /issm/trunk/src/m/classes/masscon.m	(revision 28275)
+++ 	(revision )
@@ -1,74 +1,0 @@
-%MASSCON class definition
-%
-%   Usage:
-%      masscon=masscon();
-%      masscon=masscon('name','MassCon58','definitionstring','Outputdefinition1',... %name of a North-East Greenland JPL MassCon
-%                    'levelset',level);
-% 
-%   where level is a levelset vectorial field.
-%
-%   See also: MISFIT, MASSCONAXPBY, REGIONALOUTPUT
-
-classdef masscon
-	properties (SetAccess=public)
-		%masscon
-		name              = '';
-		definitionstring  = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-10]'
-		levelset          = NaN; %levelset vectorial field which identifies the boundaries of the masscon
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.levelset)
-				self.levelset=project3d(md,'vector',self.levelset,'type','node');
-			end
-		end % }}}
-		function self = masscon(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.levelset=getfieldvalue(options,'levelset');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('masscon error message: ''name'' field should be a string!');
-			end
-
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-			md = checkfield(md,'fieldname','self.levelset','field',self.levelset,'timeseries',1,'NaN',1,'Inf',1);
-
-		end % }}}
-		function md = disp(self) % {{{
-
-			disp(sprintf('   Masscon:\n'));
-
-			fielddisplay(self,'name','identifier for this masscon response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'levelset','levelset vectorial field which identifies the boundaries of the masscon');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'data',self.name,'name','md.masscon.name','format','String');
-			WriteData(fid,prefix,'data',self.definitionstring,'name','md.masscon.definitionstring','format','String');
-			WriteData(fid,prefix,'data',self.levelset,'name','md.masscon.levelset','format','DoubleMat','mattype',1);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/massconaxpby.m
===================================================================
--- /issm/trunk/src/m/classes/massconaxpby.m	(revision 28275)
+++ 	(revision )
@@ -1,90 +1,0 @@
-%MASSCONAXPBY class definition
-%
-%   Usage:
-%      massconaxpby=massconaxpby();
-%      massconaxpby=massconaxpby('name','MassCon58+35','namex','MassCon58','alpha',.5,'namey','MassCon35','beta',.5,'definitionstring','Outputdefinition1'); 
-% 
-%   where name is the name of the massconaxpby object, namex is the name of the first masscon, namey the name of the second masscon and alpha,beta the 
-%         multiplicators. The meaning of axpby here is: resulting masscon is the linear combination (alpha *x + beta * y) 
-%         of two masscons.
-%
-%   See also: MASSCON, REGIONALOUTPUT
-
-classdef massconaxpby
-	properties (SetAccess=public)
-		%masscon axpby
-		name               = '';
-		definitionstring   = ''; %String that identifies this output definition uniquely, from 'Outputdefinition[1-10]'
-		namex              = '';
-		namey              = '';
-		alpha              = NaN;
-		beta               = NaN;
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = massconaxpby(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get names
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.namex=getfieldvalue(options,'namex');
-				self.namey=getfieldvalue(options,'namey');
-
-				%get multiplicators: 
-				self.alpha=getfieldvalue(options,'alpha');
-				self.beta=getfieldvalue(options,'beta');
-
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name), error('masscon error message: ''name'' field should be a string!'); end
-			if ~ischar(self.namex), error('masscon error message: ''namex'' field should be a string!'); end
-			if ~ischar(self.namey), error('masscon error message: ''namey'' field should be a string!'); end
-		
-			% Create output definition cell array for check
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-
-			md = checkfield(md,'fieldname','self.alpha','field',self.alpha,'NaN',1,'Inf',1,'size',[1 1]);
-			md = checkfield(md,'fieldname','self.betaa','field',self.beta,'NaN',1,'Inf',1,'size',[1 1]);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   Massconaxpby:\n'));
-
-			fielddisplay(self,'name','name');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from Outputdefinition[1-10]');
-			fielddisplay(self,'namex','identifier for the first masscon');
-			fielddisplay(self,'alpha','first masscon multiplicator');
-			fielddisplay(self,'namey','identifier for the second masscon');
-			fielddisplay(self,'beta','second masscon multiplicator');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'data',self.name,'name','md.massconaxpby.name','format','String');
-			WriteData(fid,prefix,'data',self.definitionstring,'name','md.massconaxpby.definitionstring','format','String');
-			WriteData(fid,prefix,'data',self.namex,'name','md.massconaxpby.namex','format','String');
-			WriteData(fid,prefix,'data',self.namey,'name','md.massconaxpby.namey','format','String');
-			WriteData(fid,prefix,'data',self.alpha,'name','md.massconaxpby.alpha','format','Double');
-			WriteData(fid,prefix,'data',self.beta,'name','md.massconaxpby.beta','format','Double');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/massfluxatgate.m
===================================================================
--- /issm/trunk/src/m/classes/massfluxatgate.m	(revision 28275)
+++ 	(revision )
@@ -1,75 +1,0 @@
-%MASSFLUXATGATE class definition
-%
-%   Usage:
-%      massfluxatgate=massfluxatgate();
-%      massfluxatgate=massfluxatgate('name','GateName','definitionname','Outputdefinition1','profilename','PathToExpFile');
-
-classdef massfluxatgate
-	properties (SetAccess=public)  
-		%massfluxatgate 
-		name            = '';
-		definitionstring  = '';
-		profilename     = ''; 
-	end
-	properties (SetAccess=private)  
-		segments        = NaN;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = massfluxatgate(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.profilename=getfieldvalue(options,'profilename');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			
-			if ~ischar(self.name),
-				error('massfluxatgate error message: ''name'' field should be a string!');
-			end
-			if ~ischar(self.profilename),
-				error('massfluxatgate error message: ''profilename'' field should be a string!');
-			end
-		
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'field',self.definitionstring,'values',OutputdefinitionStringArray);
-
-			%check the profilename points to a file!: 
-			if exist(self.profilename,'file')~=2,
-				error('massfluxatgate error message: file name for profile corresponding to gate does not point to a legitimate file on disk!');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Massfluxatgate:\n'));
-
-			fielddisplay(self,'name','identifier for this massfluxatgate response');
-			fielddisplay(self,'profilename','name of file (shapefile or argus file) defining a profile (or gate)');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-100]''');
-			
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-		%before marshalling, we need to create the segments out of the profilename: 
-		self.segments=MeshProfileIntersection(md.mesh.elements,md.mesh.x,md.mesh.y,self.profilename);
-
-		%ok, marshall name and segments: 
-		WriteData(fid,prefix,'data',self.name,'name','md.massfluxatgate.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.massfluxatgate.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.segments,'name','md.massfluxatgate.segments','format','DoubleMat','mattype',1);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/massfluxatgate.py
===================================================================
--- /issm/trunk/src/m/classes/massfluxatgate.py	(revision 28275)
+++ 	(revision )
@@ -1,83 +1,0 @@
-import numpy as np
-from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from checkfield import checkfield
-from WriteData import WriteData
-from MeshProfileIntersection import MeshProfileIntersection
-import os
-
-
-class massfluxatgate(object):
-    """
-    MASSFLUXATEGATE class definition
-
-       Usage:
-          massfluxatgate = massfluxatgate('GateName', 'PathToExpFile')
-    """
-
-    def __init__(self, *args):  # {{{
-
-        self.name = ''
-        self.definitionstring = ''
-        self.profilename = ''
-        self.segments = np.nan
-
-    #set defaults
-        self.setdefaultparameters()
-
-    #use provided options to change fields
-        options = pairoptions(*args)
-
-    #OK get other fields
-        self = options.AssignObjectFields(self)
-
-    # }}}
-
-    def __repr__(self):  # {{{
-
-        string = "   Massfluxatgate:"
-        string = "%s\n%s" % (string, fielddisplay(self, 'name', 'identifier for this massfluxatgate response'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'definitionstring', 'string that identifies this output definition uniquely, from Outputdefinition[1 - 100]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'profilename', 'name of file (shapefile or argus file) defining a profile (or gate)'))
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if not isinstance(self.name, str):
-            raise RuntimeError("massfluxatgate error message: 'name' field should be a string!")
-
-        if not isinstance(self.profilename, str):
-            raise RuntimeError("massfluxatgate error message: 'profilename' field should be a string!")
-
-        OutputdefinitionStringArray = []
-        for i in range(1, 100):
-            x = 'Outputdefinition' + str(i)
-            OutputdefinitionStringArray.append(x)
-
-        md = checkfield(md, 'field', self.definitionstring, 'values', OutputdefinitionStringArray)
-
-        #check the profilename points to a file!:
-        if not os.path.isfile(self.profilename):
-            raise RuntimeError("massfluxatgate error message: file name for profile corresponding to gate does not point to a legitimate file on disk!")
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        #before marshalling, we need to create the segments out of the profilename:
-        self.segments = MeshProfileIntersection(md.mesh.elements, md.mesh.x, md.mesh.y, self.profilename)[0]
-
-    #ok, marshall name and segments:
-        WriteData(fid, prefix, 'data', self.name, 'name', 'md.massfluxatgate.name', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.definitionstring, 'name', 'md.massfluxatgate.definitionstring', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.segments, 'name', 'md.massfluxatgate.segments', 'format', 'DoubleMat', 'mattype', 1)
-
-    # }}}
Index: sm/trunk/src/m/classes/masstransport.js
===================================================================
--- /issm/trunk/src/m/classes/masstransport.js	(revision 28275)
+++ 	(revision )
@@ -1,102 +1,0 @@
-class masstransport {//{{{
-	/**
-	 * MASSTRANSPORT class definition
-	 *
-	 * Usage:
-	 *     masstransport = masstransport();
-	 */
-	constructor() {//{{{
-		this.spcthickness = NaN;
-		this.isfreesurface = 0;
-		this.min_thickness = 0;
-		this.hydrostatic_adjustment = 0;
-		this.stabilization = 0;
-		this.vertex_pairing = 0;
-		this.penalty_factor = 0;
-		this.requested_outputs = 0;
-
-		if (arguments.length == 0) {
-			this.setdefaultparameters();
-		} else {
-			error('constructor not supported');
-		}
-	} //}}}
-
-	disp() {//{{{
-		console.log('WARNING: masstransport::disp is not yet implemented');
-	} //}}}
-
-	setdefaultparameters() {//{{{
-		// Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
-		this.stabilization = 1;
-
-		// Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
-		this.penalty_factor = 3;
-
-		// Minimum ice thickness that can be used
-		this.min_thickness = 1;
-
-		// Hydrostatic adjustment
-		this.hydrostatic_adjustment = 'Absolute';
-
-		// Default output
-		this.requested_outputs = ['default'];
-	} //}}}
-
-	checkconsistency(md, solution, analyses) {//{{{
-		// Early return
-		if (analyses.includes('HydrologyShreveAnalysis') || (solution == 'TransientSolution' && !md.trans.ismasstransport)) {
-			return md;
-		}
-
-		md = checkfield(md, 'fieldname', 'masstransport.spcthickness', 'Inf', 1, 'timeseries', 1);
-		md = checkfield(md, 'fieldname', 'masstransport.isfreesurface', 'values', [0, 1]);
-		md = checkfield(md, 'fieldname', 'masstransport.hydrostatic_adjustment', 'values', ['Absolute', 'Incremental']);
-		md = checkfield(md, 'fieldname', 'masstransport.stabilization', 'values', [0, 1, 2, 3, 4, 5]);
-		md = checkfield(md, 'fieldname', 'masstransport.min_thickness', '>', 0);
-		md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1);
-		if (!any(isnan(md.stressbalance.vertex.vertex_pairing))) {
-			md = checkfield(md, 'fieldname', 'stressbalance.vertex_pairing', '>', 0);
-		}
-
-		return md;
-	} //}}}
-
-	defaultoutputs(md) {//{{{
-		return ['Thickness', 'Surface', 'Base'];
-	} //}}}
-
-	marshall(md, prefix, fid) {//{{{
-		let yts = md.constants.yts;
-
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'isfreesurface', 'format', 'Boolean');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'min_thickness', 'format', 'Double');
-		WriteData(fid, prefix, 'data', this.hydrostatic_adjustment, 'format', 'String', 'name', 'md.masstransport.hydrostatic_adjustment');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'stabilization', 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'vertex_pairing', 'format', 'DoubleMat', 'mattype', 3);
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'penalty_factor', 'format', 'Double');
-
-		// Process requested outputs
-		let outputs = this.requested_outputs;
-		let pos = find(ismember(outputs, 'default'));
-		if (pos.length) {
-			/*
-			NOTE: In order to handle case where user has added 'default' more 
-			than once to this.requested_outputs, need to remove elements by 
-			index in reverse order.
-			*/
-			for (let i = (pos.length - 1); i >= 0; --i) {
-				outputs.splice(pos[i], 1);
-			}
-			let default_outputs = this.defaultoutputs(md);
-			for (let i = 0; i < default_outputs.length; ++i) {
-				outputs.push(default_outputs[i]);
-			}
-		}
-		WriteData(fid, prefix, 'data', outputs, 'name', 'md.masstransport.requested_outputs', 'format', 'StringArray');
-	} //}}}
-
-	extrude(md) {//{{{
-	} //}}}
-}
Index: sm/trunk/src/m/classes/masstransport.m
===================================================================
--- /issm/trunk/src/m/classes/masstransport.m	(revision 28275)
+++ 	(revision )
@@ -1,149 +1,0 @@
-%MASSTRANSPORT class definition
-%
-%   Usage:
-%      masstransport=masstransport();
-
-classdef masstransport
-	properties (SetAccess=public)
-		 spcthickness           = NaN;
-		 isfreesurface          = 0;
-		 min_thickness          = 0;
-		 hydrostatic_adjustment = 0;
-		 stabilization          = 0;
-		 vertex_pairing         = NaN;
-		 penalty_factor         = 0;
-		 requested_outputs      = {};
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. If the input is a struct it is an old version of this class and
-			% old fields must be recovered (make sure they are in the deprecated
-			% model properties)
-
-			if verLessThan('matlab','7.9'),
-				disp('Warning: your matlab version is old and there is a risk that load does not work correctly');
-				disp('         if the model is not loaded correctly, rename temporarily loadobj so that matlab does not use it');
-
-				% This is a Matlab bug: all the fields of md have their default value
-				% Example of error message:
-				% Warning: Error loading an object of class 'model':
-				% Undefined function or method 'exist' for input arguments of type 'cell'
-				%
-				% This has been fixed in MATLAB 7.9 (R2009b) and later versions
-			end
-
-			if isstruct(self)
-				disp('Recovering masstransport from older version');
-				self = structtoobj(masstransport(),self);
-			end
-		end% }}}
-	end
-	methods
-		function self = masstransport(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('masstransport');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.spcthickness=project3d(md,'vector',self.spcthickness,'type','node');
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-
-			list = {'Thickness','Surface','Base'};
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
-			self.stabilization=1;
-
-			%Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
-			self.penalty_factor=3;
-
-			%Minimum ice thickness that can be used
-			self.min_thickness=1;
-
-			%Hydrostatic adjustment
-			self.hydrostatic_adjustment='Absolute';
-
-			%default output
-			self.requested_outputs={'default'};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('MasstransportAnalysis',analyses) |  (strcmp(solution,'TransientSolution') & md.transient.ismasstransport==0), return; end
-
-			md = checkfield(md,'fieldname','masstransport.spcthickness','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','masstransport.isfreesurface','values',[0 1]);
-			md = checkfield(md,'fieldname','masstransport.hydrostatic_adjustment','values',{'Absolute' 'Incremental'});
-			md = checkfield(md,'fieldname','masstransport.stabilization','values',[0 1 2 3 4 5]);
-			md = checkfield(md,'fieldname','masstransport.min_thickness','>',0);
-			md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1);
-			if ~any(isnan(md.stressbalance.vertex_pairing)),
-				md = checkfield(md,'fieldname','stressbalance.vertex_pairing','>',0);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Masstransport solution parameters:'));
-			fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint) [m]');
-			fielddisplay(self,'isfreesurface','do we use free surfaces (FS only) or mass conservation');
-			fielddisplay(self,'min_thickness','minimum ice thickness allowed [m]');
-			fielddisplay(self,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' ');
-			fielddisplay(self,'stabilization','0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: discontinuous Galerkin, 4: flux corrected transport, 5: streamline upwind Petrov-Galerkin (SUPG)');
-
-			disp(sprintf('\n      %s','Penalty options:'));
-			fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
-			fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','isfreesurface','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');
-			WriteData(fid,prefix,'data',self.hydrostatic_adjustment,'format','String','name','md.masstransport.hydrostatic_adjustment');
-			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.masstransport.requested_outputs','format','StringArray');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.masstransport.spcthickness'],self.spcthickness);
-			writejsdouble(fid,[modelname '.masstransport.isfreesurface'],self.isfreesurface);
-			writejsdouble(fid,[modelname '.masstransport.min_thickness'],self.min_thickness);
-			writejsstring(fid,[modelname '.masstransport.hydrostatic_adjustment'],self.hydrostatic_adjustment);
-			writejsdouble(fid,[modelname '.masstransport.stabilization'],self.stabilization);
-			writejs2Darray(fid,[modelname '.masstransport.vertex_pairing'],self.vertex_pairing);
-			writejsdouble(fid,[modelname '.masstransport.penalty_factor'],self.penalty_factor);
-			writejscellstring(fid,[modelname '.masstransport.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/masstransport.py
===================================================================
--- /issm/trunk/src/m/classes/masstransport.py	(revision 28275)
+++ 	(revision )
@@ -1,99 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class masstransport(object):
-    """MASSTRANSPORT class definition
-
-    Usage:
-        masstransport = masstransport()
-    """
-
-    def __init__(self):  # {{{
-        self.spcthickness = float('NaN')
-        self.isfreesurface = 0
-        self.min_thickness = 0.
-        self.hydrostatic_adjustment = 0
-        self.stabilization = 0
-        self.vertex_pairing = float('NaN')
-        self.penalty_factor = 0
-        self.requested_outputs = []
-
-        # Set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Masstransport solution parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'spcthickness', 'thickness constraints (NaN means no constraint) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'isfreesurface', 'do we use free surfaces (FS only) or mass conservation'))
-        s += '{}\n'.format(fielddisplay(self, 'min_thickness', 'minimum ice thickness allowed [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'hydrostatic_adjustment', 'adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' '))
-        s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: discontinuous Galerkin, 4: flux corrected transport, 5: streamline upwind Petrov-Galerkin (SUPG)'))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.spcthickness = project3d(md, 'vector', self.spcthickness, 'type', 'node')
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['Thickness', 'Surface', 'Base']
-
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
-        self.stabilization = 1
-        # Factor applied to compute the penalties kappa = max(stiffness matrix) * 1.0**penalty_factor
-        self.penalty_factor = 3
-        # Minimum ice thickness that can be used
-        self.min_thickness = 1
-        # Hydrostatic adjustment
-        self.hydrostatic_adjustment = 'Absolute'
-        # Default output
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if ('MasstransportAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.ismasstransport):
-            return md
-
-        md = checkfield(md, 'fieldname', 'masstransport.spcthickness', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'masstransport.isfreesurface', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'masstransport.hydrostatic_adjustment', 'values', ['Absolute', 'Incremental'])
-        md = checkfield(md, 'fieldname', 'masstransport.stabilization', 'values', [0, 1, 2, 3, 4, 5])
-        md = checkfield(md, 'fieldname', 'masstransport.min_thickness', '>', 0)
-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
-        if not np.any(np.isnan(self.vertex_pairing)) and len(self.vertex_pairing) > 0:
-            md = checkfield(md, 'fieldname', 'stressbalance.vertex_pairing', '>', 0)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isfreesurface', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_thickness', 'format', 'Double')
-        WriteData(fid, prefix, 'data', self.hydrostatic_adjustment, 'format', 'String', 'name', 'md.masstransport.hydrostatic_adjustment')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vertex_pairing', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_factor', 'format', 'Double')
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.masstransport.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/matdamageice.m
===================================================================
--- /issm/trunk/src/m/classes/matdamageice.m	(revision 28275)
+++ 	(revision )
@@ -1,161 +1,0 @@
-%MATDAMAGEICE class definition
-%
-%   Usage:
-%      matdamageice=matdamageice();
-
-classdef matdamageice
-	properties (SetAccess=public) 
-		rho_ice                         = 0.;
-		rho_water                       = 0.;
-		rho_freshwater                  = 0.;
-		mu_water                        = 0.;
-		heatcapacity                    = 0.;
-		latentheat                      = 0.;
-		thermalconductivity             = 0.;
-		temperateiceconductivity        = 0.;
-		effectiveconductivity_averaging = 0.;
-		meltingpoint                    = 0.;
-		beta                            = 0.;
-		mixed_layer_capacity            = 0.;
-		thermal_exchange_velocity       = 0.;
-		rheology_B                      = NaN;
-		rheology_n                      = NaN;
-		rheology_law                    = '';
-
-		%slc
-		earth_density                   = 0;
-
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node');
-			self.rheology_n=project3d(md,'vector',self.rheology_n,'type','element');
-		end % }}}
-		function self = matdamageice(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('matdamageice');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%ice density (kg/m^3)
-			self.rho_ice=917.;
-
-			%ocean water density (kg/m^3)
-			self.rho_water=1023.;
-
-			%fresh water density (kg/m^3)
-			self.rho_freshwater=1000.;
-
-			%water viscosity (N.s/m^2)
-			self.mu_water=0.001787;  
-
-			%ice heat capacity cp (J/kg/K)
-			self.heatcapacity=2093.;
-
-			%ice latent heat of fusion L (J/kg)
-			self.latentheat=3.34*10^5;
-
-			%ice thermal conductivity (W/m/K)
-			self.thermalconductivity=2.4;
-
-			%wet ice thermal conductivity (W/m/K)
-			self.temperateiceconductivity=.24;
-
-			%computation of effective conductivity
-			self.effectiveconductivity_averaging=1;
-
-			%the melting point of ice at 1 atmosphere of pressure in K
-			self.meltingpoint=273.15;
-
-			%rate of change of melting point with pressure (K/Pa)
-			self.beta=9.8*10^-8;
-
-			%mixed layer (ice-water interface) heat capacity (J/kg/K)
-			self.mixed_layer_capacity=3974.;
-
-			%thermal exchange velocity (ice-water interface) (m/s)
-			self.thermal_exchange_velocity=1.00*10^-4;
-
-			%Rheology law: what is the temperature dependence of B with T
-			%available: none, paterson and arrhenius
-			self.rheology_law='Paterson';
-
-			%SLC
-			self.earth_density= 5512; % average density of the Earth (kg/m^3)
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			md = checkfield(md,'fieldname','materials.rho_ice','>',0);
-			md = checkfield(md,'fieldname','materials.rho_water','>',0);
-			md = checkfield(md,'fieldname','materials.rho_freshwater','>',0);
-			md = checkfield(md,'fieldname','materials.mu_water','>',0);
-			md = checkfield(md,'fieldname','materials.rheology_B','>',0,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
-			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
-			
-			if ismember('SealevelchangeAnalysis',analyses),
-				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
-			end
-
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Materials:'));
-
-			fielddisplay(self,'rho_ice','ice density [kg/m^3]');
-			fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
-			fielddisplay(self,'rho_freshwater','fresh water density [kg/m^3]');
-			fielddisplay(self,'mu_water','water viscosity [N s/m^2]');
-			fielddisplay(self,'heatcapacity','heat capacity [J/kg/K]');
-			fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']);
-			fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
-			fielddisplay(self,'effectiveconductivity_averaging','computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
-			fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K');
-			fielddisplay(self,'latentheat','latent heat of fusion [J/kg]');
-			fielddisplay(self,'beta','rate of change of melting point with pressure [K/Pa]');
-			fielddisplay(self,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
-			fielddisplay(self,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
-			fielddisplay(self,'rheology_B','flow law parameter [Pa s^(1/n)]');
-			fielddisplay(self,'rheology_n','Glen''s flow law exponent');
-			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']);
-			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.materials.type','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
-
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/matdamageice.py
===================================================================
--- /issm/trunk/src/m/classes/matdamageice.py	(revision 28275)
+++ 	(revision )
@@ -1,140 +1,0 @@
-import numpy as np
-
-from fielddisplay import fielddisplay
-from project3d import project3d
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class matdamageice(object):
-    """MATICE class definition
-
-       Usage:
-          matdamagice = matdamageice()
-    """
-
-    def __init__(self):  # {{{
-        self.rho_ice = 0
-        self.rho_water = 0
-        self.rho_freshwater = 0
-        self.mu_water = 0
-        self.heatcapacity = 0
-        self.latentheat = 0
-        self.thermalconductivity = 0
-        self.temperateiceconductivity = 0
-        self.effectiveconductivity_averaging = 0
-        self.meltingpoint = 0
-        self.beta = 0
-        self.mixed_layer_capacity = 0
-        self.thermal_exchange_velocity = 0
-        self.rheology_B = np.nan
-        self.rheology_n = np.nan
-        self.rheology_law = ''
-
-        #SLC
-        self.earth_density = 0
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Materials:\n'
-        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'water density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'effectiveconductivity_averaging', 'computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)'))
-        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
-        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/ kg/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\''))
-        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg m^-3]'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
-        self.rheology_n = project3d(md, 'vector', self.rheology_n, 'type', 'element')
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Ice density (kg/m^3)
-        self.rho_ice = 917.0
-        # Ocean water density (kg/m^3)
-        self.rho_water = 1023.0
-        # Fresh water density (kg/m^3)
-        self.rho_freshwater = 1000.0
-        # Water viscosity (N.s/m^2)
-        self.mu_water = 0.001787
-        # Ice heat capacity cp (J/kg/K)
-        self.heatcapacity = 2093.0
-        # Ice latent heat of fusion L (J/kg)
-        self.latentheat = 3.34 * pow(10, 5)
-        # Ice thermal conductivity (W/m/K)
-        self.thermalconductivity = 2.4
-        # Temperate ice thermal conductivity (W/m/K)
-        self.temperateiceconductivity = 0.24
-        # Computation of effective conductivity
-        self.effectiveconductivity_averaging = 1
-        # The melting point of ice at 1 atmosphere of pressure in K
-        self.meltingpoint = 273.15
-        # Rate of change of melting point with pressure (K/Pa)
-        self.beta = 9.8 * pow(10, -8)
-        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
-        self.mixed_layer_capacity = 3974.0
-        # Thermal exchange velocity (ice-water interface) (m/s)
-        self.thermal_exchange_velocity = 1.00e-4
-        # Rheology law: what is the temperature dependence of B with T
-        # available: none, paterson and arrhenius
-        self.rheology_law = 'Paterson'
-
-        # SLC
-        self.earth_density = 5512  # average density of the Earth (kg/m^3)
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval'])
-        md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
-
-        if 'SealevelchangeAnalysis' in analyses:
-                md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermal_exchange_velocity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
-
-    # }}}
Index: sm/trunk/src/m/classes/matenhancedice.m
===================================================================
--- /issm/trunk/src/m/classes/matenhancedice.m	(revision 28275)
+++ 	(revision )
@@ -1,187 +1,0 @@
-%MATICE class definition
-%
-%   Usage:
-%      matenhancedice=matenhancedice();
-
-classdef matenhancedice
-	properties (SetAccess=public) 
-		rho_ice                         = 0.;
-		rho_water                       = 0.;
-		rho_freshwater                  = 0.;
-		mu_water                        = 0.;
-		heatcapacity                    = 0.;
-		latentheat                      = 0.;
-		thermalconductivity             = 0.;
-		temperateiceconductivity        = 0.;
-		effectiveconductivity_averaging = 0.;
-		meltingpoint                    = 0.;
-		beta                            = 0.;
-		mixed_layer_capacity            = 0.;
-		thermal_exchange_velocity       = 0.;
-		rheology_E                      = NaN;
-		rheology_B                      = NaN;
-		rheology_n                      = NaN;
-		rheology_law                    = '';
-
-		%SLC
-		earth_density                   = 0;
-
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.rheology_E=project3d(md,'vector',self.rheology_E,'type','node');
-			self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node');
-			self.rheology_n=project3d(md,'vector',self.rheology_n,'type','element');
-		end % }}}
-		function self = matenhancedice(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('matenhancedice');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%ice density (kg/m^3)
-			self.rho_ice=917.;
-
-			%ocean water density (kg/m^3)
-			self.rho_water=1023.;
-
-			%fresh water density (kg/m^3)
-			self.rho_freshwater=1000.;
-
-			%water viscosity (N.s/m^2)
-			self.mu_water=0.001787;
-
-			%ice heat capacity cp (J/kg/K)
-			self.heatcapacity=2093.;
-
-			%ice latent heat of fusion L (J/kg)
-			self.latentheat=3.34*10^5;
-
-			%ice thermal conductivity (W/m/K)
-			self.thermalconductivity=2.4;
-			
-			%wet ice thermal conductivity (W/m/K)
-			self.temperateiceconductivity=.24;
-
-			%computation of effective conductivity
-			self.effectiveconductivity_averaging=1;
-
-			%the melting point of ice at 1 atmosphere of pressure in K
-			self.meltingpoint=273.15;
-
-			%rate of change of melting point with pressure (K/Pa)
-			self.beta=9.8*10^-8;
-
-			%mixed layer (ice-water interface) heat capacity (J/kg/K)
-			self.mixed_layer_capacity=3974.;
-
-			%thermal exchange velocity (ice-water interface) (m/s)
-			self.thermal_exchange_velocity=1.00*10^-4;
-
-			%Rheology law: what is the temperature dependence of B with T
-			%available: none, paterson and arrhenius
-			self.rheology_law='Paterson';
-
-			%SLC
-			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			md = checkfield(md,'fieldname','materials.rho_ice','>',0);
-			md = checkfield(md,'fieldname','materials.rho_water','>',0);
-			md = checkfield(md,'fieldname','materials.rho_freshwater','>',0);
-			md = checkfield(md,'fieldname','materials.mu_water','>',0);
-			md = checkfield(md,'fieldname','materials.rheology_E','>',0,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
-			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
-            
-			if ismember('SealevelchangeAnalysis',analyses),
-				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Materials:'));
-
-			fielddisplay(self,'rho_ice','ice density [kg/m^3]');
-			fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
-			fielddisplay(self,'rho_freshwater','fresh water density [kg/m^3]');
-			fielddisplay(self,'mu_water','water viscosity [N s/m^2]');
-			fielddisplay(self,'heatcapacity','heat capacity [J/kg/K]');
-			fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']);
-			fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
-			fielddisplay(self,'effectiveconductivity_averaging','computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
-			fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K');
-			fielddisplay(self,'latentheat','latent heat of fusion [J/kg]');
-			fielddisplay(self,'beta','rate of change of melting point with pressure [K/Pa]');
-			fielddisplay(self,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
-			fielddisplay(self,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
-			fielddisplay(self,'rheology_E','enhancement factor');
-			fielddisplay(self,'rheology_B','flow law parameter [Pa s^(1/n)]');
-			fielddisplay(self,'rheology_n','Glen''s flow law exponent');
-			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']);
-			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.materials.type','data',4,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_E','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
-
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.materials.rho_ice'],self.rho_ice);
-			writejsdouble(fid,[modelname '.materials.rho_water'],self.rho_water);
-			writejsdouble(fid,[modelname '.materials.rho_freshwater'],self.rho_freshwater);
-			writejsdouble(fid,[modelname '.materials.mu_water'],self.mu_water);
-			writejsdouble(fid,[modelname '.materials.heatcapacity'],self.heatcapacity);
-			writejsdouble(fid,[modelname '.materials.latentheat'],self.latentheat);
-			writejsdouble(fid,[modelname '.materials.thermalconductivity'],self.thermalconductivity);
-			writejsdouble(fid,[modelname '.materials.temperateiceconductivity'],self.temperateiceconductivity);
-			writejsdouble(fid,[modelname '.materials.effectiveconductivity_averaging'],self.effectiveconductivity_averaging);
-			writejsdouble(fid,[modelname '.materials.meltingpoint'],self.meltingpoint);
-			writejsdouble(fid,[modelname '.materials.beta'],self.beta);
-			writejsdouble(fid,[modelname '.materials.mixed_layer_capacity'],self.mixed_layer_capacity);
-			writejsdouble(fid,[modelname '.materials.thermal_exchange_velocity'],self.thermal_exchange_velocity);
-			writejsdouble(fid,[modelname '.materials.mixed_layer_capacity'],self.mixed_layer_capacity);
-			writejs1Darray(fid,[modelname '.materials.rheology_E'],self.rheology_E);
-			writejs1Darray(fid,[modelname '.materials.rheology_B'],self.rheology_B);
-			writejs1Darray(fid,[modelname '.materials.rheology_n'],self.rheology_n);
-			writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
-			writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/matenhancedice.py
===================================================================
--- /issm/trunk/src/m/classes/matenhancedice.py	(revision 28275)
+++ 	(revision )
@@ -1,145 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class matenhancedice(object):
-    """MATICE class definition
-
-    Usage:
-        matenhancedice = matenhancedice()
-    """
-
-    def __init__(self):  # {{{
-        self.rho_ice = 0
-        self.rho_water = 0
-        self.rho_freshwater = 0
-        self.mu_water = 0
-        self.heatcapacity = 0
-        self.latentheat = 0
-        self.thermalconductivity = 0
-        self.temperateiceconductivity = 0
-        self.effectiveconductivity_averaging = 0
-        self.meltingpoint = 0
-        self.beta = 0
-        self.mixed_layer_capacity = 0
-        self.thermal_exchange_velocity = 0
-        self.rheology_E = np.nan
-        self.rheology_B = np.nan
-        self.rheology_n = np.nan
-        self.rheology_law = ''
-
-        #SLC
-        self.earth_density = 0
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Materials:\n'
-        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'water density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'effectiveconductivity_averaging', 'computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)'))
-        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
-        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_E', 'enhancement factor'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\''))
-        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
-
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.rheology_E = project3d(md, 'vector', self.rheology_E, 'type', 'node')
-        self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
-        self.rheology_n = project3d(md, 'vector', self.rheology_n, 'type', 'element')
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Ice density (kg/m^3)
-        self.rho_ice = 917.0
-        # Ocean water density (kg/m^3)
-        self.rho_water = 1023.0
-        # Fresh water density (kg/m^3)
-        self.rho_freshwater = 1000.0
-        # Water viscosity (N.s/m^2)
-        self.mu_water = 0.001787
-        # Ice heat capacity cp (J/kg/K)
-        self.heatcapacity = 2093.0
-        # Ice latent heat of fusion L (J/kg)
-        self.latentheat = 3.34 * pow(10, 5)
-        # Ice thermal conductivity (W/m/K)
-        self.thermalconductivity = 2.4
-        # Temperate ice thermal conductivity (W/m/K)
-        self.temperateiceconductivity = 0.24
-        # Computation of effective conductivity
-        self.effectiveconductivity_averaging = 1
-        # The melting point of ice at 1 atmosphere of pressure in K
-        self.meltingpoint = 273.15
-        # Rate of change of melting point with pressure (K/Pa)
-        self.beta = 9.8 * pow(10, -8)
-        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
-        self.mixed_layer_capacity = 3974.0
-        # Thermal exchange velocity (ice-water interface) (m/s)
-        self.thermal_exchange_velocity = 1.00 * pow(10, -4)
-        # Rheology law: what is the temperature dependence of B with T
-        # available: none, paterson and arrhenius
-        self.rheology_law = 'Paterson'
-
-        # SLC
-        self.earth_density = 5512 # average density of the Earth, (kg/m^3)
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.rheology_E', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval'])
-        md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
-
-        if 'SealevelchangeAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 4, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermal_exchange_velocity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_E', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
-    # }}}
Index: sm/trunk/src/m/classes/materials.js
===================================================================
--- /issm/trunk/src/m/classes/materials.js	(revision 28275)
+++ 	(revision )
@@ -1,380 +1,0 @@
-class materials {
-	/**
-	 * MATERIALS class definition
-	 *
-	 * Usage:
-	 *     materials = materials();
-	 */
-	constructor() {//{{{
-		this.nature = [];
-
-		let nargs = arguments.length;
-		if (nargs == 0) {
-			this.nature=['ice'];
-		} else {
-			this.nature=arguments;
-		}
-
-		// Check this is acceptable
-		for (let i = 0; i < this.nature.length; ++i) {
-			if (!(strcmpi(this.nature[i], 'litho') || strcmpi(this.nature[i], 'ice') || strcmpi(this.nature[i], 'hydro'))) {
-				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
-			}
-		}
-
-		// Start filling in the dynamic fields (not truly dynamic under JavaScript)
-		for (let i = 0; i < length(this.nature); ++i) {
-			let nat = this.nature[i];
-			switch (nat) {
-				case 'ice':
-					this.rho_ice = 0;
-					this.rho_water = 0;
-					this.rho_freshwater = 0;
-					this.mu_water = 0;
-					this.heatcapacity = 0;
-					this.latentheat = 0;
-					this.thermalconductivity = 0;
-					this.temperateiceconductivity = 0;
-					this.effectiveconductivity_averaging = 0;
-					this.meltingpoint = 0;
-					this.beta = 0;
-					this.mixed_layer_capacity = 0;
-					this.thermal_exchange_velocity = 0;
-					this.rheology_B = 0;
-					this.rheology_n = 0;
-					this.rheology_law = 0;
-					break;
-				case 'litho':
-					this.numlayers = 0;
-					this.radius = 0;
-					this.viscosity = 0;
-					this.lame_lambda = 0;
-					this.lame_mu = 0;
-					this.burgers_viscosity = 0;
-					this.burgers_mu = 0;
-					this.ebm_alpha = 0;
-					this.ebm_delta = 0;
-					this.ebm_taul = 0;
-					this.ebm_tauh = 0;
-					this.rheologymodel = 0;
-					this.density = 0;
-					this.issolid = 0;
-					break;
-				case 'hydro':
-					this.rho_ice = 0;
-					this.rho_water = 0;
-					this.rho_freshwater = 0;
-					break;
-				default:
-					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
-			}
-			this.earth_density = 0;
-
-			// Set default parameters
-			this.setdefaultparameters();
-		}
-	} //}}}
-	disp() {//{{{
-		console.log(sprintf('   Materials:'));
-
-		for (let i = 0; i < length(this.nature); ++i) {
-			let nat = this.nature[i];
-			switch (nat) {
-				case 'ice':
-					console.log(sprintf('   \nIce:'));
-					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
-					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
-					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
-					fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
-					fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
-					fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
-					fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
-					fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
-					fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
-					fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
-					fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
-					fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
-					fielddisplay(this,'rheology_B','flow law parameter [Pa s^(1/n)]');
-					fielddisplay(this,'rheology_n','Glen\'s flow law exponent');
-					fielddisplay(this,'rheology_law','law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\'');
-					break;
-				case 'litho':
-					console.log(sprintf('   \nLitho:'));
-					fielddisplay(this,'numlayers','number of layers (default: 2)');
-					fielddisplay(this,'radius','array describing the radius for each interface (numlayers+1) [m]');
-					fielddisplay(this,'viscosity','array describing each layer\'s viscosity (numlayers) [Pa.s]');
-					fielddisplay(this,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]');
-					fielddisplay(this,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]');
-					fielddisplay(this,'burgers_viscosity','array describing each layer\'s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
-					fielddisplay(this,'burgers_mu','array describing each layer\'s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
-
-					fielddisplay(this,'ebm_alpha','array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
-					fielddisplay(this,'ebm_delta','array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
-					fielddisplay(this,'ebm_taul','array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
-					fielddisplay(this,'ebm_tauh','array describing each layer\'s array describing each layer\'s end period for transient relaxation, only for Burgers rheology (numlayers) [s]');
-
-					fielddisplay(this,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
-					fielddisplay(this,'density','array describing each layer\'s density (numlayers) [kg/m^3]');
-					fielddisplay(this,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
-					break;
-				case 'hydro':
-					console.log(sprintf('   \nHydro:'));
-					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
-					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
-					fielddisplay(this,'earth_density','mantle density [kg/m^3]');
-					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
-					break;
-				default:
-					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
-			}
-		}
-	} //}}}
-	setdefaultparameters() {//{{{
-		for (let i = 0; i < this.nature.length; ++i) {
-			let nat = this.nature[i];
-			switch (nat) {
-				case 'ice':
-					// Ice density (kg/m^3)
-					this.rho_ice = 917;
-
-					// Ocean water density (kg/m^3)
-					this.rho_water = 1023
-
-					// Fresh water density (kg/m^3)
-					this.rho_freshwater = 1000;
-
-					// Water viscosity (N.s/m^2)
-					this.mu_water = 0.001787;
-
-					// Ice heat capacity cp (J/kg/K)
-					this.heatcapacity = 2093;
-
-					// Ice latent heat of fusion L (J/kg)
-					this.latentheat = 3.34 * 1e5;
-
-					// Ice thermal conductivity (W/m/K)
-					this.thermalconductivity = 2.4;
-
-					// Wet ice thermal conductivity (W/m/K)
-					this.temperateiceconductivity = 0.24;
-
-					// Computation of effective conductivity
-					this.effectiveconductivity_averaging = 1;
-
-					// The melting point of ice at 1 atmosphere of pressure in K
-					this.meltingpoint = 273.15;
-
-					// Rate of change of melting point with pressure (K/Pa)
-					this.beta = 9.8 * 1e-8;
-
-					// Mixed layer (ice-water interface) heat capacity (J/kg/K)
-					this.mixed_layer_capacity = 3974;
-
-					// Thermal exchange velocity (ice-water interface) (m/s)
-					this.thermal_exchange_velocity = 1.00 * 1e-4;
-
-					// Rheology law: what is the temperature dependence of B with T
-					// available: none, paterson and arrhenius
-					this.rheology_law = 'Paterson';
-
-					// Rheology fields default
-					this.rheology_B = 1 * 1e8;
-					this.rheology_n = 3;
-					break;
-				case 'litho':
-					// We default to a configuration that enables running GIA 
-					// solutions using giacaron and/or giaivins
-					this.numlayers = 2;
-
-					// Center of the earth (approximation, must not be 0), then the 
-					// lab (lithosphere/asthenosphere boundary) then the surface
-					// (with 1d3 to avoid numerical singularities)
-					this.radius = [1e3, 6278 * 1e3, 6378 * 1e3];
-
-					this.viscosity = [1e21, 1e40]; // Mantle and lithosphere viscosity (respectively) [Pa.s]
-					this.lame_mu = [1.45 * 1e11, 6.7 * 1e10]; // (Pa) // Lithosphere and mantle shear modulus (respectively) [Pa]
-					this.lame_lambda = this.lame_mu; // (Pa) // Mantle and lithosphere lamba parameter (respectively) [Pa]
-					this.burgers_viscosity = [NaN, NaN];
-					this.burgers_mu = [NaN, NaN];
-
-					this.ebm_alpha = [NaN, NaN];
-					this.ebm_delta = [NaN, NaN];
-					this.ebm_taul = [NaN, NaN];
-					this.ebm_tauh = [NaN, NaN];
-					this.rheologymodel = [0, 0];
-					this.density = [5.51 * 1e3, 5.50 * 1e3]; // (Pa) // Mantle and lithosphere density [kg/m^3]
-					this.issolid = [1, 1]; // Is layer solid or liquid?
-					break;
-				case 'hydro':
-					// Ice density (kg/m^3)
-					this.rho_ice = 917;
-
-					// Ocean water density (kg/m^3)
-					this.rho_water = 1023;
-
-					// Fresh water density (kg/m^3)
-					this.rho_freshwater = 1000;
-					break;
-				default:
-					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
-			}
-
-			// Average density of the Earth (kg/m^3)
-			this.earth_density = 5512;
-		}
-	} //}}}
-	checkconsistency(md, solution, analyses) {//{{{
-		for (let i = 0; i < this.nature.length; ++i) {
-			let nat = this.nature[i];
-			if (nat == 'ice') {
-				md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0);
-				md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0);
-				md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0);
-				md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0);
-				md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1);
-				md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements, 1]);
-				md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O']);
-			} else if (nat == 'litho') {
-				if (!analyses.includes('LoveAnalysis')) {
-					return md;
-				}
-
-				md = checkfield(md, 'fieldname', 'materials.numlayers', 'NaN', 1, 'Inf', 1, '>', 0, 'numel', 1);
-				md = checkfield(md, 'fieldname', 'materials.radius', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers + 1, 1], '>', 0);
-				md = checkfield(md, 'fieldname', 'materials.lame_mu', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
-				md = checkfield(md, 'fieldname', 'materials.lame_lambda', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
-				md = checkfield(md, 'fieldname', 'materials.issolid', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<', 2);
-				md = checkfield(md, 'fieldname', 'materials.density', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>', 0);
-				md = checkfield(md, 'fieldname', 'materials.viscosity', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
-				md = checkfield(md, 'fieldname', 'materials.rheologymodel', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<=', 2);
-				md = checkfield(md, 'fieldname', 'materials.burgers_viscosity', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
-				md = checkfield(md, 'fieldname', 'materials.burgers_mu', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
-				md = checkfield(md, 'fieldname', 'materials.ebm_alpha', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
-				md = checkfield(md, 'fieldname', 'materials.ebm_delta', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
-				md = checkfield(md, 'fieldname', 'materials.ebm_taul', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
-				md = checkfield(md, 'fieldname', 'materials.ebm_tauh', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
-
-				for (let i = 0; i < md.materials.numlayers; ++i) {
-					if (md.materials.rheologymodel[i] == 1 && (isnan(md.materials.burgers_viscosity[i]) || isnan(md.materials.burgers_mu[i]))) {
-						error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');
-					}
-					if (md.materials.rheologymodel[i] == 2 && (isnan(md.materials.ebm_alpha[i]) || isnan(md.materials.ebm_delta[i])) || isnan(md.materials.ebm_taul[i] || isnan(md.materials.ebm_tauh[i]))) {
-						error('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice');
-					}
-				}
-				if (md.materials.issolid[0] == 0 || md.materials.lame_mu[0] == 0) {
-					error('First layer must be solid (issolid[0] > 0 AND lame_mu[0] > 0). Add a weak inner core if necessary.');
-				}
-				let ind = find(md.materials.issolid == 0);
-				if (sum(ismember(diff(ind), 1) >= 1)) { // If there are at least two consecutive indices that contain issolid = 0
-					error('Fluid layers detected at layers #' + ind + ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.');
-				}
-			} else if (nat == 'hydro') {
-				md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0);
-				md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0);
-				md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1);
-				md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0);
-			} else {
-				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
-			}
-		}
-
-		return md;
-	} //}}}
-	marshall(md, prefix, fid) {//{{{
-		// 1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
-		WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(this.nature), 'format', 'IntMat', 'mattype', 3);
-		WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer'); // DANGER: this can evolve if you have classes
-		for (let i = 0; i < this.nature.length; ++i) {
-			let nat = this.nature[i];
-			if (nat == 'ice') {
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'thermal_exchange_velocity', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2);
-				WriteData(fid, prefix, 'data', this.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String');
-			} else if (nat == 'litho') {
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'numlayers', 'format', 'Integer');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'radius', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'lame_mu', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'lame_lambda', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'issolid', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'density', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'viscosity', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rheologymodel', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'burgers_viscosity', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'burgers_mu', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_alpha', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_delta', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_taul', 'format', 'DoubleMat', 'mattype', 3);
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_tauh', 'format', 'DoubleMat', 'mattype', 3);
-				// Compute earth density compatible with our layer density distribution
-				let earth_density = 0;
-				for (let i = 0; i < this.numlayers; ++i) {
-					earth_density = earth_density + (Math.pow(this.radius[i + 1], 3) - Math.pow(this.radius[i], 3)) * this.density[i];
-				}
-				earth_density = earth_density / Math.pow(this.radius[this.numlayers]);
-				this.earth_density = earth_density;
-			} else if (nat == 'hydro') {
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double');
-				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double');
-			} else {
-				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
-			}
-			WriteData(fid, prefix, 'data', this.earth_density, 'name', 'md.materials.earth_density', 'format', 'Double');
-		}
-	} //}}}
-	extrude(md) {//{{{
-		for (let i = 0; i < this.nature.length; ++i) {
-			let nat = this.nature[i];
-			if (nat == 'ice') {
-				this.rheology_B = project3d(md, 'vector', this.rheology_B, 'type', 'node');
-				this.rheology_n = project3d(md, 'vector', this.rheology_n, 'type', 'element');
-			}
-		}
-	} //}}}
-} //}}}
-
-function naturetointeger(strnat) {//{{{
-	let intnat = zeros(strnat.length, 1);
-	for (let i = 0; i < strnat.length; ++i) {
-		switch (strnat[i]) {
-			case 'damageice':
-				intnat[i] = 1;
-				break;
-			case 'estar':
-				intnat[i] = 2;
-				break;
-			case 'ice':
-				intnat[i] = 3;
-				break;
-			case 'enhancedice':
-				intnat[i] = 4;
-				break;
-			//case 'materials': // This case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
-			//	intnat[i] = 5;
-			//	break;
-			case 'litho':
-				intnat[i] = 6;
-				break;
-			case 'hydro':
-				intnat[i] = 7;
-				break;
-			default:
-				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
-		}
-	}
-	return intnat;
-}// }}}
Index: sm/trunk/src/m/classes/materials.m
===================================================================
--- /issm/trunk/src/m/classes/materials.m	(revision 28275)
+++ 	(revision )
@@ -1,584 +1,0 @@
-%MATERIALS class definition
-%
-%   Usage:
-%      materials=materials();
-
-classdef materials < dynamicprops
-	properties (SetAccess=public)
-		nature={};
-		%all properties are dynamic.
-	end
-	methods
-		function self = materials(varargin) % {{{
-			if nargin==0
-				self.nature={'ice'};
-			else
-				self.nature=varargin;
-			end
-
-			%check this is acceptable:
-			for i=1:length(self.nature),
-				if ~(strcmpi(self.nature{i},'litho') | strcmpi(self.nature{i},'ice') | strcmpi(self.nature{i},'hydro')),
-					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
-				end
-			end
-
-			%start filling in the dynamic fields:
-			for i=1:length(self.nature),
-				nat=self.nature{i};
-				switch nat
-				case 'ice'
-					self.addprop('rho_ice');
-					self.addprop('rho_water');
-					self.addprop('rho_freshwater');
-					self.addprop('mu_water');
-					self.addprop('heatcapacity');
-					self.addprop('latentheat');
-					self.addprop('thermalconductivity');
-					self.addprop('temperateiceconductivity');
-					self.addprop('effectiveconductivity_averaging');
-					self.addprop('meltingpoint');
-					self.addprop('beta');
-					self.addprop('mixed_layer_capacity');
-					self.addprop('thermal_exchange_velocity');
-					self.addprop('rheology_B');
-					self.addprop('rheology_n');
-					self.addprop('rheology_law');
-				case 'litho'
-					self.addprop('numlayers');
-					self.addprop('radius');
-					self.addprop('viscosity');
-					self.addprop('lame_lambda');
-					self.addprop('lame_mu');
-					self.addprop('burgers_viscosity');
-					self.addprop('burgers_mu');
-					self.addprop('ebm_alpha');
-					self.addprop('ebm_delta');
-					self.addprop('ebm_taul');
-					self.addprop('ebm_tauh');
-					self.addprop('rheologymodel');
-					self.addprop('density');
-					self.addprop('issolid');
-				case 'hydro'
-					self.addprop('rho_ice');
-					self.addprop('rho_water');
-					self.addprop('rho_freshwater');
-				otherwise
-					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
-				end
-			end
-			self.addprop('earth_density');
-
-			%set default parameters:
-			self.setdefaultparameters();
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			for i=1:length(self.nature),
-				nat=self.nature{i};
-				switch nat
-				case 'ice'
-					%ice density (kg/m^3)
-					self.rho_ice=917.;
-
-					%ocean water density (kg/m^3)
-					self.rho_water=1023.;
-
-					%fresh water density (kg/m^3)
-					self.rho_freshwater=1000.;
-
-					%water viscosity (N.s/m^2)
-					self.mu_water=0.001787;
-
-					%ice heat capacity cp (J/kg/K)
-					self.heatcapacity=2093.;
-
-					%ice latent heat of fusion L (J/kg)
-					self.latentheat=3.34*1e5;
-
-					%ice thermal conductivity (W/m/K)
-					self.thermalconductivity=2.4;
-
-					%wet ice thermal conductivity (W/m/K)
-					self.temperateiceconductivity=.24;
-
-					%computation of effective conductivity
-					self.effectiveconductivity_averaging=1;
-
-					%the melting point of ice at 1 atmosphere of pressure in K
-					self.meltingpoint=273.15;
-
-					%rate of change of melting point with pressure (K/Pa)
-					self.beta=9.8*1e-8;
-
-					%mixed layer (ice-water interface) heat capacity (J/kg/K)
-					self.mixed_layer_capacity=3974.;
-
-					%thermal exchange velocity (ice-water interface) (m/s)
-					self.thermal_exchange_velocity=1.00*1e-4;
-
-					%Rheology law: what is the temperature dependence of B with T
-					%available: none, paterson and arrhenius
-					self.rheology_law='Paterson';
-
-					%Rheology fields default: 
-					self.rheology_B   = 1 * 1e8;
-					self.rheology_n   = 3;
-
-				case 'litho'
-					%we default to a configuration that enables running GIA solutions using giacaron and/or giaivins.
-					self.numlayers=2;
-
-					%center of the earth (approximation, must not be 0), then the lab (lithosphere/asthenosphere boundary) then the surface
-					%(with 1d3 to avoid numerical singularities)
-					self.radius=[1e3;6278*1e3;6378*1e3];
-
-					self.viscosity=[1e21;1e40]; %mantle and lithosphere viscosity (respectively) [Pa.s]
-					self.lame_mu=[1.45*1e11;6.7*1e10];  % (Pa) %lithosphere and mantle shear modulus (respectively) [Pa]
-					self.lame_lambda=self.lame_mu;  % (Pa) %mantle and lithosphere lamba parameter (respectively) [Pa]
-					self.burgers_viscosity=[NaN;NaN];
-					self.burgers_mu=[NaN;NaN];
-
-					self.ebm_alpha=[NaN;NaN];
-					self.ebm_delta=[NaN;NaN];
-					self.ebm_taul=[NaN;NaN];
-					self.ebm_tauh=[NaN;NaN];
-					self.rheologymodel=[0;0];
-					self.density=[5.51*1e3;5.50*1e3];  % (Pa) %mantle and lithosphere density [kg/m^3]
-					self.issolid=[1;1]; % is layer solid or liquid.
-
-				case 'hydro'
-					%ice density (kg/m^3)
-					self.rho_ice=917.;
-
-					%ocean water density (kg/m^3)
-					self.rho_water=1023.;
-					
-					%fresh water density (kg/m^3)
-					self.rho_freshwater=1000.;
-
-				otherwise
-					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
-				end
-
-				% average density of the Earth (kg/m^3)
-				self.earth_density=5512;
-
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Materials:'));
-
-			for i=1:length(self.nature),
-				nat=self.nature{i};
-				switch nat
-				case 'ice'
-					disp(sprintf('\n      Ice:'));
-					fielddisplay(self,'rho_ice','ice density [kg/m^3]');
-					fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
-					fielddisplay(self,'rho_freshwater','fresh water density [kg/m^3]');
-					fielddisplay(self,'mu_water','water viscosity [N s/m^2]');
-					fielddisplay(self,'heatcapacity','heat capacity [J/kg/K]');
-					fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']);
-					fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
-					fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K');
-					fielddisplay(self,'latentheat','latent heat of fusion [J/kg]');
-					fielddisplay(self,'beta','rate of change of melting point with pressure [K/Pa]');
-					fielddisplay(self,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
-					fielddisplay(self,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
-					fielddisplay(self,'rheology_B','flow law parameter [Pa s^(1/n)]');
-					fielddisplay(self,'rheology_n','Glen''s flow law exponent');
-					fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'', ''LliboutryDuval'', ''NyeCO2'', or ''NyeH2O''']);
-				case 'litho'
-					disp(sprintf('\n      Litho:'));
-					fielddisplay(self,'numlayers','number of layers (default: 2)');
-					fielddisplay(self,'radius','array describing the radius for each interface (numlayers+1) [m]');
-					fielddisplay(self,'viscosity','array describing each layer''s viscosity (numlayers) [Pa.s]');
-					fielddisplay(self,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]');
-					fielddisplay(self,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]');
-					fielddisplay(self,'burgers_viscosity','array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
-					fielddisplay(self,'burgers_mu','array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
-
-					fielddisplay(self,'ebm_alpha','array describing each layer''s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
-					fielddisplay(self,'ebm_delta','array describing each layer''s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
-					fielddisplay(self,'ebm_taul','array describing each layer''s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
-					fielddisplay(self,'ebm_tauh','array describing each layer''s array describing each layer''s end period for transient relaxation, only for Burgers rheology (numlayers) [s]');
-
-
-					fielddisplay(self,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
-					fielddisplay(self,'density','array describing each layer''s density (numlayers) [kg/m^3]');
-					fielddisplay(self,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
-				case 'hydro'
-					disp(sprintf('\n      Hydro:'));
-					fielddisplay(self,'rho_ice','ice density [kg/m^3]');
-					fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
-					fielddisplay(self,'earth_density','mantle density [kg/m^3]');
-					fielddisplay(self,'rho_freshwater','fresh water density [kg/m^3]');
-
-				otherwise
-					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
-				end
-			end
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			for i=1:length(self.nature),
-				nat=self.nature{i};
-				switch nat
-				case 'ice'
-					md = checkfield(md,'fieldname','materials.rho_ice','>',0);
-					md = checkfield(md,'fieldname','materials.rho_water','>',0);
-					md = checkfield(md,'fieldname','materials.rho_freshwater','>',0);
-					md = checkfield(md,'fieldname','materials.mu_water','>',0);
-					md = checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
-					md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
-					md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
-				case 'litho'
-					if ~ismember('LoveAnalysis',analyses), return; end
-					md = checkfield(md,'fieldname','materials.numlayers','NaN',1,'Inf',1,'>',0,'numel',1);
-					md = checkfield(md,'fieldname','materials.radius','NaN',1,'Inf',1,'size',[md.materials.numlayers+1 1],'>',0);
-					md = checkfield(md,'fieldname','materials.lame_mu','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-					md = checkfield(md,'fieldname','materials.lame_lambda','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-					md = checkfield(md,'fieldname','materials.issolid','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>=',0,'<',2);
-					md = checkfield(md,'fieldname','materials.density','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>',0);
-					md = checkfield(md,'fieldname','materials.viscosity','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-					md = checkfield(md,'fieldname','materials.rheologymodel','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>=',0,'<=',2);
-					md = checkfield(md,'fieldname','materials.burgers_viscosity','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-					md = checkfield(md,'fieldname','materials.burgers_mu','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-					md = checkfield(md,'fieldname','materials.ebm_alpha','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-					md = checkfield(md,'fieldname','materials.ebm_delta','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-					md = checkfield(md,'fieldname','materials.ebm_taul','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-					md = checkfield(md,'fieldname','materials.ebm_tauh','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-
-					for i=1:md.materials.numlayers,
-						if md.materials.rheologymodel(i)==1 & (isnan(md.materials.burgers_viscosity(i) | isnan(md.materials.burgers_mu(i)))),
-							error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');
-						end
-						if md.materials.rheologymodel(i)==2 & (isnan(md.materials.ebm_alpha(i)) | isnan(md.materials.ebm_delta(i)) | isnan(md.materials.ebm_taul(i)) | isnan(md.materials.ebm_tauh(i))),
-							error('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice');
-						end
-					end
-					if md.materials.issolid(1)==0 | md.materials.lame_mu(1)==0
-						error('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.');
-					end
-					ind=find(md.materials.issolid==0);
-					%if sum(ismember(diff(ind),1)>=1) %if there are at least two consecutive indices that contain issolid = 0
-					%		error(['Fluid layers detected at layers #', num2str(ind'), ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.'])
-					%end
-
-				case 'hydro'
-					md = checkfield(md,'fieldname','materials.rho_ice','>',0);
-					md = checkfield(md,'fieldname','materials.rho_water','>',0);
-					md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
-					md = checkfield(md,'fieldname','materials.rho_freshwater','>',0);
-
-				otherwise
-					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
-				end
-			end
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			%1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
-			WriteData(fid,prefix,'name','md.materials.nature','data',naturetointeger(self.nature),'format','IntMat','mattype',3);
-			WriteData(fid,prefix,'name','md.materials.type','data',5,'format','Integer'); %DANGER: this can evolve if you have classes.
-			for i=1:length(self.nature),
-				nat=self.nature{i};
-				switch nat
-				case 'ice'
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
-					WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
-				case 'litho'
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','numlayers','format','Integer');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','radius','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','lame_mu','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','lame_lambda','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','issolid','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','density','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','viscosity','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheologymodel','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_viscosity','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_mu','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_alpha','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_delta','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_taul','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_tauh','format','DoubleMat','mattype',3);
-					%compute earth density compatible with our layer density distribution: 
-					earth_density=0;
-					for i=1:self.numlayers,
-						earth_density=earth_density + (self.radius(i+1)^3-self.radius(i)^3)*self.density(i);
-					end
-					earth_density=earth_density/self.radius(self.numlayers+1)^3;
-					self.earth_density=earth_density;
-				case 'hydro'
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double');
-				otherwise
-					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
-				end
-			end
-			WriteData(fid,prefix,'data',self.earth_density,'name','md.materials.earth_density','format','Double');
-		end % }}}
-		function self = extrude(self,md) % {{{
-			for i=1:length(self.nature),
-				nat=self.nature{i};
-				switch nat
-				case 'ice'
-					self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node');
-					self.rheology_n=project3d(md,'vector',self.rheology_n,'type','element');
-				end
-			end
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			for i=1:length(self.nature),
-				nat=self.nature{i};
-				switch nat
-				case 'ice'
-					writejsdouble(fid,[modelname '.materials.rho_ice'],self.rho_ice);
-					writejsdouble(fid,[modelname '.materials.rho_water'],self.rho_water);
-					writejsdouble(fid,[modelname '.materials.rho_freshwater'],self.rho_freshwater);
-					writejsdouble(fid,[modelname '.materials.mu_water'],self.mu_water);
-					writejsdouble(fid,[modelname '.materials.heatcapacity'],self.heatcapacity);
-					writejsdouble(fid,[modelname '.materials.latentheat'],self.latentheat);
-					writejsdouble(fid,[modelname '.materials.thermalconductivity'],self.thermalconductivity);
-					writejsdouble(fid,[modelname '.materials.temperateiceconductivity'],self.temperateiceconductivity);
-					writejsdouble(fid,[modelname '.materials.effectiveconductivity_averaging'],self.effectiveconductivity_averaging);
-					writejsdouble(fid,[modelname '.materials.meltingpoint'],self.meltingpoint);
-					writejsdouble(fid,[modelname '.materials.beta'],self.beta);
-					writejsdouble(fid,[modelname '.materials.mixed_layer_capacity'],self.mixed_layer_capacity);
-					writejsdouble(fid,[modelname '.materials.thermal_exchange_velocity'],self.thermal_exchange_velocity);
-					writejsdouble(fid,[modelname '.materials.mixed_layer_capacity'],self.mixed_layer_capacity);
-					writejs1Darray(fid,[modelname '.materials.rheology_B'],self.rheology_B);
-					writejs1Darray(fid,[modelname '.materials.rheology_n'],self.rheology_n);
-					writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
-				case 'litho'
-					writejsdouble(fid,[modelname '.materials.numlayers'],self.numlayers);
-					writejsdouble(fid,[modelname '.materials.radius'],self.radius);
-					writejsdouble(fid,[modelname '.materials.lame_mu'],self.lame_mu);
-					writejsdouble(fid,[modelname '.materials.lame_lambda'],self.lame_lambda);
-					writejsdouble(fid,[modelname '.materials.issolid'],self.issolid);
-					writejsdouble(fid,[modelname '.materials.density'],self.density);
-					writejsdouble(fid,[modelname '.materials.viscosity'],self.viscosity);
-					writejsdouble(fid,[modelname '.materials.rheologymodel'],self.rheologymodel);
-					writejsdouble(fid,[modelname '.materials.burgers_viscosity'],self.burgers_viscosity);
-					writejsdouble(fid,[modelname '.materials.burgers_mu'],self.burgers_mu);
-					writejsdouble(fid,[modelname '.materials.ebm_alpha'],self.ebm_alpha);
-					writejsdouble(fid,[modelname '.materials.ebm_delta'],self.ebm_delta);
-					writejsdouble(fid,[modelname '.materials.ebm_taul'],self.ebm_taul);
-					writejsdouble(fid,[modelname '.materials.ebm_tauh'],self.ebm_tauh);
-
-				case 'hydro'
-					writejsdouble(fid,[modelname '.materials.rho_ice'],self.rho_ice);
-					writejsdouble(fid,[modelname '.materials.rho_water'],self.rho_water);
-					writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
-					writejsdouble(fid,[modelname '.materials.rho_freshwater'],self.rho_freshwater);
-
-				otherwise
-					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
-				end
-			end
-
-
-
-		end % }}}
-		function setlitho2prem(self) % {{{
-			%based on materials.radius and materials.issolid, replaces materials.density, materials.lame_mu, materials.lame_lambda
-			% with volumetric averages of a polynomial version of the PREM model
-			if ~strcmpi(self.nature, 'litho')
-			error('materials setlitho2prem error message: materials.nature must be ''litho''')
-			end
-		   
-		   
-		   ra=self.radius(end);
-		   r(1) = 0.0;     r(2) = 1221.5; r(3) = 3480.0; r(4) = 3630.;
-		   r(5) = 5600.0;  r(6) = 5701.0;  r(7) = 5771.0; r(8) = 5971.;
-		   r(9) = 6151.0; r(10) = 6291.0; r(11) = 6346.6;
-		   r(12) = 6356.0; r(13) = 6368.0; r(14) = 6371.;
-		  
-		   if (r(14)*1e3 ~= ra) 
-			error(['materials setlitho2prem error message: Earth surface radius in PREM r=' num2str(r(end)*1e3) ' does not match materials.radius(end)=' num2str(self.radius(end))]); 
-		   end
-
-		  d = zeros(12,4); %polynomial coef for density
-		  d(1,1) = 13.0885; 		         	  d(1,3) = -8.8381 ;
-		  d(2,1) = 12.5815; d(2,2) = -1.2638; d(2,3) = -3.6426; d(2,4) = -5.5281;
-		  d(3,1) = 7.9565 ; d(3,2) = -6.4761;   d(3,3) = 5.5283;  d(3,4) = -3.0807;
-		  d(4,1) = 7.9565 ; d(4,2) = -6.4761;   d(4,3) = 5.5283;  d(4,4) = -3.0807;
-		  d(5,1) = 7.9565 ; d(5,2) = -6.4761;   d(5,3) = 5.5283;  d(5,4) = -3.0807;
-		  d(6,1) = 5.3197 ; d(6,2) = -1.4836;
-		  d(7,1) = 11.2494; d(7,2) = -8.0298;
-		  d(8,1) = 7.1089 ; d(8,2) = -3.8045;
-		  d(9,1) = 2.6910 ; d(9,2) = 0.6924;
-		  d(10,1) = 2.6910; d(10,2) = 0.6924;
-		  d(11,1) = 2.9  ;
-		  d(12,1) = 2.6  ;
-
-		% ocean
-		  if (~self.issolid(end)) 
-		  	d(13,1) = 1.02 ;
-
-		% continental
-		  else
-		  d(13,1) = d(12,1);
-		  end
-
-		  p = zeros(13,4); %polynomial coef for Vp, pressure wave velocity
-		  p(1,1) = 11.2622 ; p(1,3) = -6.3640;
-		  p(2,1) = 11.0487 ; p(2,2) = -4.0362; p(2,3)  = 4.8023; p(2,4) = -13.5732;
-		  p(3,1) = 15.3891 ; p(3,2) = -5.3181; p(3,3)  = 5.5242; p(3,4) = -2.5514;
-		  p(4,1) = 24.952 ; p(4,2)  = -40.4673; p(4,3) = 51.4832; p(4,4) = -26.6419;
-		  p(5,1) = 29.2766 ; p(5,2) = -23.6027; p(5,3) = 5.5242; p(5,4) = -2.5514;
-		  p(6,1) = 19.0957 ; p(6,2)  = -9.8672;
-		  p(7,1) = 39.7027 ; p(7,2)  = -32.6166;
-		  p(8,1) = 20.3926 ; p(8,2)  = -12.2569;
-		  p(9,1) = 4.1875 ; p(9,2)  = 3.9382;
-		  p(10,1) = 4.1875 ; p(10,2) = 3.9382;
-		  p(11,1) = 6.8 ;
-		  p(12,1) = 5.8;
-		%
-		% ocean
-		  if (~self.issolid(end)) 
-		  p(13,1) = 1.45 ;
-		%
-		% continental
-		  else
-		  p(13,1) = p(12,1);
-		  end
-		%----
-		%
-		  s = zeros(13,4); %polynomial coef for Vs, shear wave velocity
-		%
-		  s(1,1) = 3.6678; s(1,3) = -4.4475;
-
-		  s(3,1) = 6.9254; s(3,2) = 1.4672; s(3,3) = -2.0834; s(3,4) = 0.9783;
-		  s(4,1) = 11.1671; s(4,2) = -13.7818; s(4,3) = 17.4575; s(4,4) = -9.2777;
-		  s(5,1) = 22.3459; s(5,2) = -17.2473; s(5,3) = -2.0834; s(5,4) = 0.9783;
-		  s(6,1) = 9.9839; s(6,2) = -4.9324;
-		  s(7,1) = 22.3512; s(7,2) = -18.5856 ;
-		  s(8,1) = 8.9496; s(8,2) = -4.4597;
-		  s(9,1) = 2.1519; s(9,2) = 2.3481;
-		  s(10,1) = 2.1519; s(10,2) = 2.3481;
-		  s(11,1) = 3.9 ;
-		  s(12,1) = 3.2 ;
-		%
-		% ocean (please don't modify)
-		  if (~self.issolid(end))
-		%
-		% continental
-		  else
-		  s(13,1) = s(12,1);
-		  end
-		%
-		%
-		  r = r*1e3;
-		  
-		  %- handling the first layer : central sphere
-		  rad = self.radius;
-		  rad(1) = 0.;
-		  
-		  for j = 1:self.numlayers
-		  
-			ro = 0.;
-			vp = 0.;
-			vs = 0.;
-
-			for i = 1:13
-
-				r1 = 0.;
-				r2 = 0.;
-				if ((rad(j) > r(i)) & (rad(j) <= r(i+1))) 
-					if (rad(j+1) <= r(i+1)) 
-						r2 = rad(j+1);
-						r1 = rad(j);
-					else
-						r2 = r(i+1);
-						r1 = rad(j);
-					end
-				elseif (rad(j) <= r(i))
-					if ((rad(j+1) > r(i)) & (rad(j+1) <= r(i+1)))
-						r2 = rad(j+1);
-						r1 = r(i);
-					elseif (rad(j+1) > r(i+1))
-						r2 = r(i+1);
-						r1 = r(i);
-					end
-				end
-
-				t1 = d(i,1)/3.;
-				t2 = d(i,2)/(ra*4.);
-				t3 = d(i,3)/((ra^2)*5.);
-				t4 = d(i,4)/((ra^3)*6.);
-				ro =  ro + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
-					  
-				t1 = p(i,1)/3.;
-				t2 = p(i,2)/(ra*4.);
-				t3 = p(i,3)/((ra^2)*5.);
-				t4 = p(i,4)/((ra^3)*6.);
-				vp =  vp + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
-					  
-				t1 = s(i,1)/3.;
-				t2 = s(i,2)/(ra*4.);
-				t3 = s(i,3)/((ra^2)*5.);
-				t4 = s(i,4)/((ra^3)*6.);
-				vs =  vs + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
-
-			end
-			ro = ro*3 / (rad(j+1)^3-rad(j)^3);
-			vp = vp*3 /(rad(j+1)^3-rad(j)^3);
-			vs = vs*3 / (rad(j+1)^3-rad(j)^3);
-			mu = ro*vs.^2;
-			la = ro*vp.^2 - 2.*mu;
-			ro = ro*1e3;
-			la = la*1e9;
-			mu = mu*1e9;
-
-			self.density(j) = ro;
-			self.lame_lambda(j) = la;
-			self.lame_mu(j) = mu;
-		  end
-
-		end % }}}
-	end
-end
-
-function intnat = naturetointeger(strnat) % {{{
-	intnat=zeros(length(strnat),1);
-	for i=1:length(strnat),
-		switch strnat{i},
-		case 'damageice'
-			intnat(i)=1;
-		case 'estar'
-			intnat(i)=2;
-		case 'ice'
-			intnat(i)=3;
-		case 'enhancedice'
-			intnat(i)=4;
-		%case 'materials' %this case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
-		%	intnat(i)=5;
-		case 'litho'
-			intnat(i)=6;
-		case 'hydro'
-			intnat(i)=7;
-		otherwise
-			error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
-		end
-	end
-end % }}}
Index: sm/trunk/src/m/classes/materials.py
===================================================================
--- /issm/trunk/src/m/classes/materials.py	(revision 28275)
+++ 	(revision )
@@ -1,351 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class materials(object):
-    """MATERIALS class definition
-
-    Usage:
-        materials = materials()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.nature = []
-        if len(args) == 0:
-            self.nature = ['ice']
-        else:
-            self.nature = args
-
-        for i in range(len(self.nature)):
-            if not(self.nature[i] == 'litho' or self.nature[i] == 'ice' or self.nature[i] == 'hydro'):
-                raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
-
-        # Start filling in the dynamic fields (not truly dynamic under Python)
-        for i in range(len(self.nature)):
-            nat = self.nature[i]
-            if nat == 'ice':
-                self.rho_ice = 0
-                self.rho_water = 0
-                self.rho_freshwater = 0
-                self.mu_water = 0
-                self.heatcapacity = 0
-                self.latentheat = 0
-                self.thermalconductivity = 0
-                self.temperateiceconductivity = 0
-                self.effectiveconductivity_averaging = 0
-                self.meltingpoint = 0
-                self.beta = 0
-                self.mixed_layer_capacity = 0
-                self.thermal_exchange_velocity = 0
-                self.rheology_B = 0
-                self.rheology_n = 0
-                self.rheology_law = 0
-            elif nat == 'litho':
-                self.numlayers = 0
-                self.radius = 0
-                self.viscosity = 0
-                self.lame_lambda = 0
-                self.lame_mu = 0
-                self.burgers_viscosity = 0
-                self.burgers_mu = 0
-                self.ebm_alpha = 0
-                self.ebm_delta = 0
-                self.ebm_taul = 0
-                self.ebm_tauh = 0
-                self.rheologymodel = 0
-                self.density = 0
-                self.issolid = 0
-            elif nat == 'hydro':
-                self.rho_ice = 0
-                self.rho_water = 0
-                self.rho_freshwater = 0
-            else:
-                raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
-        self.earth_density = 0
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Materials:\n'
-        for i in range(len(self.nature)):
-            nat = self.nature[i]
-            if nat == 'ice':
-                s += '\n      Ice:\n'
-                s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
-                s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
-                s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
-                s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
-                s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
-                s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
-                s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
-                s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
-                s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
-                s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
-                s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
-                s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
-                s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
-                s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
-                s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\''))
-            elif nat == 'litho':
-                s += '\n      Litho:\n'
-                s += '{}\n'.format(fielddisplay(self, 'numlayers', 'number of layers (default: 2)'))
-                s += '{}\n'.format(fielddisplay(self, 'radius', 'array describing the radius for each interface (numlayers + 1) [m]'))
-                s += '{}\n'.format(fielddisplay(self, 'viscosity', 'array describing each layer\'s viscosity (numlayers) [Pa.s]'))
-                s += '{}\n'.format(fielddisplay(self, 'lame_lambda', 'array describing the lame lambda parameter (numlayers) [Pa]'))
-                s += '{}\n'.format(fielddisplay(self, 'lame_mu', 'array describing the shear modulus for each layers (numlayers) [Pa]'))
-                s += '{}\n'.format(fielddisplay(self, 'burgers_viscosity', 'array describing each layer\'s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]'))
-                s += '{}\n'.format(fielddisplay(self, 'burgers_mu', 'array describing each layer\'s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]'))
-
-                s += '{}\n'.format(fielddisplay(self, 'ebm_alpha', 'array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)'))
-                s += '{}\n'.format(fielddisplay(self, 'ebm_delta', 'array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)'))
-                s += '{}\n'.format(fielddisplay(self, 'ebm_taul', 'array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]'))
-                s += '{}\n'.format(fielddisplay(self, 'ebm_tauh', 'array describing each layer''s array describing each layer\'s end period for transient relaxation, only for Burgers rheology (numlayers) [s]'))
-
-                s += '{}\n'.format(fielddisplay(self, 'rheologymodel', 'array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)'))
-                s += '{}\n'.format(fielddisplay(self, 'density', 'array describing each layer\'s density (numlayers) [kg/m^3]'))
-                s += '{}\n'.format(fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default: 1) (numlayers)'))
-            elif nat == 'hydro':
-                s += '\n      Hydro:\n'
-                s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
-                s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
-                s += '{}\n'.format(fielddisplay(self, 'earth_density', 'mantle density [kg/m^3]'))
-                s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
-
-            else:
-                raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        for i in range(len(self.nature)):
-            nat = self.nature[i]
-            if nat == 'ice':
-                # Ice density (kg/m^3)
-                self.rho_ice = 917.0
-
-                # Ocean water density (kg/m^3)
-                self.rho_water = 1023.0
-
-                # Fresh water density (kg/m^3)
-                self.rho_freshwater = 1000.0
-
-                # Water viscosity (N.s/m^2)
-                self.mu_water = 0.001787
-
-                # Ice heat capacity cp (J/kg/K)
-                self.heatcapacity = 2093.0
-
-                # Ice latent heat of fusion L (J/kg)
-                self.latentheat = 3.34 * 1e5
-
-                # Ice thermal conductivity (W/m/K)
-                self.thermalconductivity = 2.4
-
-                # Wet ice thermal conductivity (W/m/K)
-                self.temperateiceconductivity = 0.24
-
-                # Computation of effective conductivity
-                self.effectiveconductivity_averaging = 1
-
-                # The melting point of ice at 1 atmosphere of pressure in K
-                self.meltingpoint = 273.15
-
-                # Rate of change of melting point with pressure (K/Pa)
-                self.beta = 9.8 * 1e-8
-
-                # Mixed layer (ice-water interface) heat capacity (J/kg/K)
-                self.mixed_layer_capacity = 3974.0
-
-                # Thermal exchange velocity (ice-water interface) (m/s)
-                self.thermal_exchange_velocity = 1.00 * 1e-4
-
-                # Rheology law: what is the temperature dependence of B with T
-                # available: none, paterson and arrhenius
-                self.rheology_law = 'Paterson'
-
-                # Rheology fields default
-                self.rheology_B = 1 * 1e8
-                self.rheology_n = 3
-            elif nat == 'litho':
-                # We default to a configuration that enables running GIA
-                # solutions using giacaron and/or giaivins
-                self.numlayers = 2
-
-                # Center of the earth (approximation, must not be 0), then the
-                # lab (lithosphere/asthenosphere boundary) then the surface
-                # (with 1d3 to avoid numerical singularities)
-                self.radius = [1e3, 6278 * 1e3, 6378 * 1e3]
-
-                self.viscosity = [1e21, 1e40] # Mantle and lithosphere viscosity (respectively) [Pa.s]
-                self.lame_mu = [1.45 * 1e11, 6.7 * 1e10] # (Pa) # Lithosphere and mantle shear modulus (respectively) [Pa]
-                self.lame_lambda = self.lame_mu # (Pa) # Mantle and lithosphere lamba parameter (respectively) [Pa]
-                self.burgers_viscosity = [np.nan, np.nan]
-                self.burgers_mu = [np.nan, np.nan]
-
-                self.ebm_alpha = [np.nan, np.nan]
-                self.ebm_delta = [np.nan, np.nan]
-                self.ebm_taul = [np.nan, np.nan]
-                self.ebm_tauh = [np.nan, np.nan]
-                self.rheologymodel = [0, 0]
-                self.density = [5.51 * 1e3, 5.50 * 1e3] # (Pa) # Mantle and lithosphere density [kg/m^3]
-                self.issolid = [1, 1] # Is layer solid or liquid?
-            elif nat == 'hydro':
-                # Ice density (kg/m^3)
-                self.rho_ice = 917.0
-
-                # Ocean water density (kg/m^3)
-                self.rho_water = 1023.0
-
-                # Fresh water density (kg/m^3)
-                self.rho_freshwater = 1000.0
-            else:
-                raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
-
-            # Average density of the Earth (kg/m^3)
-            self.earth_density = 5512
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        for i in range(len(self.nature)):
-            nat = self.nature[i]
-            if nat == 'ice':
-                md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
-                md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
-                md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
-                md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
-                md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-                md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements])
-                md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O'])
-            elif nat == 'litho':
-                if 'LoveAnalysis' not in analyses:
-                    return md
-
-                md = checkfield(md, 'fieldname', 'materials.numlayers', 'NaN', 1, 'Inf', 1, '>', 0, 'numel', [1])
-                md = checkfield(md, 'fieldname', 'materials.radius', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers + 1, 1], '>', 0)
-                md = checkfield(md, 'fieldname', 'materials.lame_mu', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-                md = checkfield(md, 'fieldname', 'materials.lame_lambda', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-                md = checkfield(md, 'fieldname', 'materials.issolid', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<', 2)
-                md = checkfield(md, 'fieldname', 'materials.density', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>', 0)
-                md = checkfield(md, 'fieldname', 'materials.viscosity', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-                md = checkfield(md, 'fieldname', 'materials.rheologymodel', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<=', 2)
-                md = checkfield(md, 'fieldname', 'materials.burgers_viscosity', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-                md = checkfield(md, 'fieldname', 'materials.burgers_mu', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-                md = checkfield(md, 'fieldname', 'materials.ebm_alpha', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-                md = checkfield(md, 'fieldname', 'materials.ebm_delta', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-                md = checkfield(md, 'fieldname', 'materials.ebm_taul', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-                md = checkfield(md, 'fieldname', 'materials.ebm_tauh', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-
-                for i in range(md.materials.numlayers):
-                    if md.materials.rheologymodel[i] == 1 and (np.isnan(md.materials.burgers_viscosity[i] or np.isnan(md.materials.burgers_mu[i]))):
-                        raise RuntimeError('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice')
-
-                    if md.materials.rheologymodel[i] == 2 and (np.isnan(md.materials.ebm_alpha[i]) or np.isnan(md.materials.ebm_delta[i]) or np.isnan(md.materials.ebm_taul[i]) or np.isnan(md.materials.ebm_tauh[i])):
-                        raise RuntimeError('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice')
-                if md.materials.issolid[0] == 0 or md.materials.lame_mu[0] == 0:
-                    raise RuntimeError('First layer must be solid (issolid[0] > 0 AND lame_mu[0] > 0). Add a weak inner core if necessary.')
-                ind = np.where(md.materials.issolid == 0)[0]
-                #if np.sum(np.in1d(np.diff(ind),1) >= 1): # If there are at least two consecutive indices that contain issolid = 0
-                #    raise RuntimeError('Fluid layers detected at layers #' + indices + ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.')
-
-            elif nat == 'hydro':
-                md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
-                md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
-                md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
-                md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
-            else:
-                raise RuntimeError('materials checkconsistency error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        #1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
-        WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(self.nature), 'format', 'IntMat', 'mattype', 3)
-        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer') #DANGER: this can evolve if you have classes
-        for i in range(len(self.nature)):
-            nat = self.nature[i]
-            if nat == 'ice':
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermal_exchange_velocity', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
-                WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
-            elif nat == 'litho':
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'numlayers', 'format', 'Integer')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'radius', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lame_mu', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lame_lambda', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'issolid', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'density', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'viscosity', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheologymodel', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_viscosity', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_mu', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_alpha', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_delta', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_taul', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_tauh', 'format', 'DoubleMat', 'mattype', 3)
-                # Compute earth density compatible with our layer density distribution
-                earth_density = 0
-                for i in range(self.numlayers):
-                    earth_density = earth_density + (pow(self.radius[i + 1], 3) - pow(self.radius[i], 3)) * self.density[i]
-                earth_density = earth_density / pow(self.radius[self.numlayers], 3)
-                self.earth_density = earth_density
-            elif nat == 'hydro':
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
-            else:
-                raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
-        WriteData(fid, prefix, 'data', self.earth_density, 'name', 'md.materials.earth_density', 'format', 'Double')
-    # }}}
-
-    def extrude(self, md):  # {{{
-        for i in range(len(self.nature)):
-            nat = self.nature[i]
-            if nat == 'ice':
-                self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
-                self.rheology_n = project3d(md, 'vector', self.rheology_n, 'type', 'element')
-            return self
-    # }}}
-# }}}
-
-def naturetointeger(strnat):  # {{{
-    intnat = np.zeros(len(strnat))
-
-    for i in range(len(intnat)):
-        str_nat = strnat[i]
-        if str_nat == 'damageice':
-            intnat[i] = 1
-        elif str_nat == 'estar':
-            intnat[i] = 2
-        elif str_nat == 'ice':
-            intnat[i] = 3
-        elif str_nat == 'enhancedice':
-            intnat[i] = 4
-        # elif str_nat == 'materials':
-        #     intnat[i] = 5 #this case will never happen, kept to ensure equivalent of codes between IoCodeToMeterialsEnum and IoCodeToNatureEnum
-        elif str_nat == 'litho':
-            intnat[i] = 6
-        elif str_nat == 'hydro':
-            intnat[i] = 7
-        else:
-            raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
-
-    return intnat
-# }}}
Index: sm/trunk/src/m/classes/matestar.m
===================================================================
--- /issm/trunk/src/m/classes/matestar.m	(revision 28275)
+++ 	(revision )
@@ -1,194 +1,0 @@
-%MATICE class definition
-%
-%   Usage:
-%      matestar=matestar();
-
-classdef matestar
-	properties (SetAccess=public) 
-		rho_ice                         = 0.;
-		rho_water                       = 0.;
-		rho_freshwater                  = 0.;
-		mu_water                        = 0.;
-		heatcapacity                    = 0.;
-		latentheat                      = 0.;
-		thermalconductivity             = 0.;
-		temperateiceconductivity        = 0.;
-		effectiveconductivity_averaging = 0;
-		meltingpoint                    = 0.;
-		beta                            = 0.;
-		mixed_layer_capacity            = 0.;
-		thermal_exchange_velocity       = 0.;
-		rheology_B                      = NaN;
-		rheology_Ec                     = NaN;
-		rheology_Es                     = NaN;
-		rheology_law                    = '';
-
-		%SLC
-		earth_density                   = 0;
-
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node');
-			self.rheology_Ec=project3d(md,'vector',self.rheology_Ec,'type','node');
-			self.rheology_Es=project3d(md,'vector',self.rheology_Es,'type','node');
-		end % }}}
-		function self = matestar(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('matestar');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-					if strcmp(class(inputstruct),'matice'),
-						disp('Converting materials to ESTAR, keeping a Glen type relation');
-						%Set parameters so that we still use a Glen's like flow relation
-						self.rheology_Es = ones(size(inputstruct.rheology_B));
-						self.rheology_Ec = ones(size(inputstruct.rheology_B));
-						self.rheology_B = inputstruct.rheology_B;
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%ice density (kg/m^3)
-			self.rho_ice=917.;
-
-			%ocean water density (kg/m^3)
-			self.rho_water=1023.;
-
-			%fresh water density (kg/m^3)
-			self.rho_freshwater=1000.;
-
-			%water viscosity (N.s/m^2)
-			self.mu_water=0.001787;  
-
-			%ice heat capacity cp (J/kg/K)
-			self.heatcapacity=2093.;
-
-			%ice latent heat of fusion L (J/kg)
-			self.latentheat=3.34*10^5;
-
-			%ice thermal conductivity (W/m/K)
-			self.thermalconductivity=2.4;
-			
-			%wet ice thermal conductivity (W/m/K)
-			self.temperateiceconductivity=.24;
-
-			%computation of effective conductivity
-			self.effectiveconductivity_averaging=1;
-
-			%the melting point of ice at 1 atmosphere of pressure in K
-			self.meltingpoint=273.15;
-
-			%rate of change of melting point with pressure (K/Pa)
-			self.beta=9.8*10^-8;
-
-			%mixed layer (ice-water interface) heat capacity (J/kg/K)
-			self.mixed_layer_capacity=3974.;
-
-			%thermal exchange velocity (ice-water interface) (m/s)
-			self.thermal_exchange_velocity=1.00*10^-4;
-
-			%Rheology law: what is the temperature dependence of B with T
-			%available: none, paterson and arrhenius
-			self.rheology_law='Paterson';
-
-			%SLC
-			self.earth_density= 5512; % average density of the Earth, (kg/m^3)
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			md = checkfield(md,'fieldname','materials.rho_ice','>',0);
-			md = checkfield(md,'fieldname','materials.rho_water','>',0);
-			md = checkfield(md,'fieldname','materials.rho_freshwater','>',0);
-			md = checkfield(md,'fieldname','materials.mu_water','>',0);
-			md = checkfield(md,'fieldname','materials.rheology_B','>',0,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','materials.rheology_Ec','>',0,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','materials.rheology_Es','>',0,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
-			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
-
-			if ismember('SealevelchangeAnalysis',analyses),
-				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Materials:'));
-
-			fielddisplay(self,'rho_ice','ice density [kg/m^3]');
-			fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
-			fielddisplay(self,'rho_freshwater','fresh water density [kg/m^3]');
-			fielddisplay(self,'mu_water','water viscosity [N s/m^2]');
-			fielddisplay(self,'heatcapacity','heat capacity [J/kg/K]');
-			fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']);
-			fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
-			fielddisplay(self,'effectiveconductivity_averaging','computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
-			fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K');
-			fielddisplay(self,'latentheat','latent heat of fusion [J/kg]');
-			fielddisplay(self,'beta','rate of change of melting point with pressure [K/Pa]');
-			fielddisplay(self,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
-			fielddisplay(self,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
-			fielddisplay(self,'rheology_B','flow law parameter [Pa s^(1/3)]');
-			fielddisplay(self,'rheology_Ec','compressive enhancement factor');
-			fielddisplay(self,'rheology_Es','shear enhancement factor');
-			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']);
-			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.materials.type','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_Ec','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_Es','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
-
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.materials.rho_ice'],self.rho_ice);
-			writejsdouble(fid,[modelname '.materials.rho_water'],self.rho_water);
-			writejsdouble(fid,[modelname '.materials.rho_freshwater'],self.rho_freshwater);
-			writejsdouble(fid,[modelname '.materials.mu_water'],self.mu_water);
-			writejsdouble(fid,[modelname '.materials.heatcapacity'],self.heatcapacity);
-			writejsdouble(fid,[modelname '.materials.latentheat'],self.latentheat);
-			writejsdouble(fid,[modelname '.materials.thermalconductivity'],self.thermalconductivity);
-			writejsdouble(fid,[modelname '.materials.temperateiceconductivity'],self.temperateiceconductivity);
-			writejsdouble(fid,[modelname '.materials.effectiveconductivity_averaging'],self.effectiveconductivity_averaging);
-			writejsdouble(fid,[modelname '.materials.meltingpoint'],self.meltingpoint);
-			writejsdouble(fid,[modelname '.materials.beta'],self.beta);
-			writejsdouble(fid,[modelname '.materials.mixed_layer_capacity'],self.mixed_layer_capacity);
-			writejsdouble(fid,[modelname '.materials.thermal_exchange_velocity'],self.thermal_exchange_velocity);
-			writejsdouble(fid,[modelname '.materials.mixed_layer_capacity'],self.mixed_layer_capacity);
-			writejs1Darray(fid,[modelname '.materials.rheology_B'],self.rheology_B);
-			writejs1Darray(fid,[modelname '.materials.rheology_Ec'],self.rheology_Ec);
-			writejs1Darray(fid,[modelname '.materials.rheology_Es'],self.rheology_Es);
-			writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
-			writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/matestar.py
===================================================================
--- /issm/trunk/src/m/classes/matestar.py	(revision 28275)
+++ 	(revision )
@@ -1,147 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class matestar(object):
-    """MATESTAR class definition
-
-    Usage:
-        matestar = matestar()
-    """
-
-    def __init__(self):  # {{{
-        self.rho_ice = 0.
-        self.rho_water = 0.
-        self.rho_freshwater = 0.
-        self.mu_water = 0.
-        self.heatcapacity = 0.
-        self.latentheat = 0.
-        self.thermalconductivity = 0.
-        self.temperateiceconductivity = 0.
-        self.effectiveconductivity_averaging = 0
-        self.meltingpoint = 0.
-        self.beta = 0.
-        self.mixed_layer_capacity = 0.
-        self.thermal_exchange_velocity = 0.
-        self.rheology_B = np.nan
-        self.rheology_Ec = np.nan
-        self.rheology_Es = np.nan
-        self.rheology_law = ''
-
-        # SLC
-        self.earth_density = 0
-
-        # Set default parameters
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Materials:\n'
-        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', ['ice thermal conductivity [W/m/K]']))
-        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
-        s += '{}\n'.format(fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
-        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
-        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/kg]'))
-        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/3)]'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_Ec', 'compressive enhancement factor'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_Es', 'shear enhancement factor'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_law', ['law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\'']))
-        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
-
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
-        self.rheology_Ec = project3d(md, 'vector', self.rheology_Ec, 'type', 'node')
-        self.rheology_Es = project3d(md, 'vector', self.rheology_Es, 'type', 'node')
-
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Ice density (kg/m^3)
-        self.rho_ice = 917.0
-        # Ocean water density (kg/m^3)
-        self.rho_water = 1023.0
-        # Fresh water density (kg/m^3)
-        self.rho_freshwater = 1000.0
-        # Water viscosity (N.s/m^2)
-        self.mu_water = 0.001787
-        # Ice heat capacity cp (J/kg/K)
-        self.heatcapacity = 2093.0
-        # Ice latent heat of fusion L (J/kg)
-        self.latentheat = 3.34 * pow(10, 5)
-        # Ice thermal conductivity (W/m/K)
-        self.thermalconductivity = 2.4
-        # Wet ice thermal conductivity (W/m/K)
-        self.temperateiceconductivity = 0.24
-        # Computation of effective conductivity
-        self.effectiveconductivity_averaging = 1
-        # The melting point of ice at 1 atmosphere of pressure in K
-        self.meltingpoint = 273.15
-        # Rate of change of melting point with pressure (K/Pa)
-        self.beta = 9.8 * pow(10, -8)
-        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
-        self.mixed_layer_capacity = 3974.0
-        # Thermal exchange velocity (ice-water interface) (m/s)
-        self.thermal_exchange_velocity = 1.00 * pow(10, -4)
-        # Rheology law: what is the temperature dependence of B with T
-        # available: none, paterson and arrhenius
-        self.rheology_law = 'Paterson'
-        # SLC
-        self.earth_density = 5512 # average density of the Earth (kg/m^3)
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
-        md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'materials.rheology_Ec', '>', 0, 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'materials.rheology_Es', '>', 0, 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval'])
-        md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
-
-        if 'SealevelchangeAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermal_exchange_velocity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_Ec', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_Es', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
-    # }}}
Index: sm/trunk/src/m/classes/matice.js
===================================================================
--- /issm/trunk/src/m/classes/matice.js	(revision 28275)
+++ 	(revision )
@@ -1,161 +1,0 @@
-//MATICE class definition
-//
-//   Usage:
-//      matice = new matice();
-
-function matice(){
-	//properties
-	// {{{
-	this.rho_ice							= 0;
-	this.rho_water							= 0;
-	this.rho_freshwater						= 0;
-	this.mu_water							= 0;
-	this.heatcapacity						= 0;
-	this.latentheat							= 0;
-	this.thermalconductivity				= 0;
-	this.temperateiceconductivity			= 0;
-	this.effectiveconductivity_averaging	= 0;
-	this.meltingpoint						= 0;
-	this.beta								= 0;
-	this.mixed_layer_capacity				= 0;
-	this.thermal_exchange_velocity			= 0;
-	this.rheology_B							= NaN;
-	this.rheology_n							= NaN;
-	this.rheology_law						= '';
-
-	//SLC
-	this.earth_density= 5512; // average density of the Earth, (kg/m^3)
-
-	this.setdefaultparameters();
-	//}}}
-
-	//methods
-	this.setdefaultparameters = function(){ // {{{
-
-		//ice density (kg/m^3)
-		this.rho_ice=917;
-
-		//ocean water density (kg/m^3)
-		this.rho_water=1023;
-
-		//fresh water density (kg/m^3)
-		this.rho_freshwater=1000;
-
-		//water viscosity (N.s/m^2)
-		this.mu_water=0.001787;
-
-		//ice heat capacity cp (J/kg/K)
-		this.heatcapacity=2093;
-
-		//ice latent heat of fusion L (J/kg)
-		this.latentheat=3.34*Math.pow(10, 5);
-
-		//ice thermal conductivity (W/m/K)
-		this.thermalconductivity=2.4;
-
-		//wet ice thermal conductivity (W/m/K)
-		this.temperateiceconductivity=.24;
-
-		//computation of effective conductivity
-		this.effectiveconductivity_averaging=1;
-
-		//the melting point of ice at 1 atmosphere of pressure in K
-		this.meltingpoint=273.15;
-
-		//rate of change of melting point with pressure (K/Pa)
-		this.beta=9.8e-8;
-
-		//mixed layer (ice-water interface) heat capacity (J/kg/K)
-		this.mixed_layer_capacity=3974;
-
-		//thermal exchange velocity (ice-water interface) (m/s)
-		this.thermal_exchange_velocity=1.00*1e-4;
-
-		//Rheology law: what is the temperature dependence of B with T
-		//available: none, paterson and arrhenius
-		this.rheology_law='Paterson';
-
-		// Rheology for ice
-		this.rheology_B = 2.1 * 1e8
-		this.rheology_n = 3
-
-		//SLC
-		this.earth_density= 5512; // average density of the Earth, (kg/m^3)
-
-
-	} //}}}
-	this.disp = function() {// {{{
-		console.log(sprintf('   Materials:'));
-
-		fielddisplay(this,'rho_ice','ice density [kg/m^3]');
-		fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
-		fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
-		fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
-		fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
-		fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
-		fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
-		fielddisplay(this,'effectiveconductivity_averaging','computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
-		fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
-		fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
-		fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
-		fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
-		fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
-		fielddisplay(this,'rheology_B','flow law parameter [Pa s^(1/n)]');
-		fielddisplay(this,'rheology_n','Glen\'s flow law exponent');
-		fielddisplay(this,'rheology_law','law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeH2O\', or \'NyeCO2\'');
-		fielddisplay(this,'earth_density','Mantle density [kg/m^-3]');
-
-	} // }}}
-	this.extrude = function(md) {//{{{
-		this.rheology_B=project3d(md,'vector',this.rheology_B,'type','node');
-		this.rheology_n=project3d(md,'vector',this.rheology_n,'type','element');
-		return this;
-	}//}}}
-	this.classname = function() {// {{{
-		return 'matice';
-	} // }}}
-	this.checkconsistency = function(md,solution,analyses) { // {{{
-		if (solution == 'TransientSolution' && md.transient.isslc) {
-			checkfield(md,'fieldname','materials.earth_density','>',0,'numel',[1])
-		} else {
-			checkfield(md,'fieldname','materials.rho_ice','>',0);
-			checkfield(md,'fieldname','materials.rho_water','>',0);
-			checkfield(md,'fieldname','materials.rho_freshwater','>',0);
-			checkfield(md,'fieldname','materials.mu_water','>',0);
-			checkfield(md,'fieldname','materials.rheology_B','>',0,'universal',1,'NaN',1,'Inf',1);
-			checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1);
-			checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval','NyeH2O','NyeCO2']);
-			checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0,1,2])
-		}
-	} // }}}
-	this.marshall=function(md,prefix,fid) { //{{{
-		WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mu_water','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','heatcapacity','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','latentheat','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-		if ((shape(self.rheology_B)[0] == md.mesh.numberofvertices) || (shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1) or (shape(self.rheology_B)[0] == md.mesh.numberofelements && shape(self.rheology_B)[1] > 1)) {
-			mattype = 1
-			tsl = md.mesh.numberofvertices
-		} else {
-			mattype = 2
-			tsl = md.mesh.numberofelements
-		}
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
-		WriteData(fid,prefix,'data',this.rheology_law,'name','md.materials.rheology_law','format','String');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','earth_density','format','Double');
-
-	}//}}}
-	this.fix=function() { //{{{
-	}//}}}
-}
Index: sm/trunk/src/m/classes/matice.m
===================================================================
--- /issm/trunk/src/m/classes/matice.m	(revision 28275)
+++ 	(revision )
@@ -1,190 +1,0 @@
-%MATICE class definition
-%
-%   Usage:
-%      matice=matice();
-
-classdef matice
-	properties (SetAccess=public) 
-		rho_ice                         = 0.;
-		rho_water                       = 0.;
-		rho_freshwater                  = 0.;
-		mu_water                        = 0.;
-		heatcapacity                    = 0.;
-		latentheat                      = 0.;
-		thermalconductivity             = 0.;
-		temperateiceconductivity        = 0.;
-		effectiveconductivity_averaging = 0.;
-		meltingpoint                    = 0.;
-		beta                            = 0.;
-		mixed_layer_capacity            = 0.;
-		thermal_exchange_velocity       = 0.;
-		rheology_B                      = NaN;
-		rheology_n                      = NaN;
-		rheology_law                    = '';
-
-		%slc
-		earth_density                   = 0;
-
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node');
-			self.rheology_n=project3d(md,'vector',self.rheology_n,'type','element');
-		end % }}}
-		function self = matice(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('matice');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%ice density (kg/m^3)
-			self.rho_ice=917.;
-
-			%ocean water density (kg/m^3)
-			self.rho_water=1023.;
-
-			%fresh water density (kg/m^3)
-			self.rho_freshwater=1000.;
-
-			%water viscosity (N.s/m^2)
-			self.mu_water=0.001787;
-
-			%ice heat capacity cp (J/kg/K)
-			self.heatcapacity=2093.;
-
-			%ice latent heat of fusion L (J/kg)
-			self.latentheat=3.34*10^5;
-
-			%ice thermal conductivity (W/m/K)
-			self.thermalconductivity=2.4;
-			
-			%wet ice thermal conductivity (W/m/K)
-			self.temperateiceconductivity=.24;
-
-			%computation of effective conductivity
-			self.effectiveconductivity_averaging=1;
-
-			%the melting point of ice at 1 atmosphere of pressure in K
-			self.meltingpoint=273.15;
-
-			%rate of change of melting point with pressure (K/Pa)
-			self.beta=9.8*10^-8;
-
-			%mixed layer (ice-water interface) heat capacity (J/kg/K)
-			self.mixed_layer_capacity=3974.;
-
-			%thermal exchange velocity (ice-water interface) (m/s)
-			self.thermal_exchange_velocity=1.00*10^-4;
-
-			%Rheology law: what is the temperature dependence of B with T
-			%available: none, paterson and arrhenius
-			self.rheology_law='Paterson';
-
-			%Rheology for ice: 
-			self.rheology_B=2.1*1e8;
-			self.rheology_n=3;
-
-			%SLR
-			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if strcmpi(solution,'TransientSolution') & md.transient.isslc,
-				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
-			else
-				md = checkfield(md,'fieldname','materials.rho_ice','>',0);
-				md = checkfield(md,'fieldname','materials.rho_water','>',0);
-				md = checkfield(md,'fieldname','materials.rho_freshwater','>',0);
-				md = checkfield(md,'fieldname','materials.mu_water','>',0);
-				md = checkfield(md,'fieldname','materials.rheology_B','>',0,'universal',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
-				md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Materials:'));
-
-			fielddisplay(self,'rho_ice','ice density [kg/m^3]');
-			fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
-			fielddisplay(self,'rho_freshwater','fresh water density [kg/m^3]');
-			fielddisplay(self,'mu_water','water viscosity [N s/m^2]');
-			fielddisplay(self,'heatcapacity','heat capacity [J/kg/K]');
-			fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']);
-			fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
-			fielddisplay(self,'effectiveconductivity_averaging','computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
-			fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K');
-			fielddisplay(self,'latentheat','latent heat of fusion [J/kg]');
-			fielddisplay(self,'beta','rate of change of melting point with pressure [K/Pa]');
-			fielddisplay(self,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
-			fielddisplay(self,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
-			fielddisplay(self,'rheology_B','flow law parameter [Pa s^(1/n)]');
-			fielddisplay(self,'rheology_n','Glen''s flow law exponent');
-			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'', ''LliboutryDuval'', ''NyeH2O'', or ''NyeCO2''']);
-			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-			if(size(self.rheology_B,1)==md.mesh.numberofvertices | size(self.rheology_B,1)==md.mesh.numberofvertices+1 | (size(self.rheology_B,1)==md.mesh.numberofelements && size(self.rheology_B,2)>1))
-				mattype=1; tsl = md.mesh.numberofvertices;
-			else
-				mattype=2; tsl = md.mesh.numberofelements;
-			end
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.materials.rho_ice'],self.rho_ice);
-			writejsdouble(fid,[modelname '.materials.rho_water'],self.rho_water);
-			writejsdouble(fid,[modelname '.materials.rho_freshwater'],self.rho_freshwater);
-			writejsdouble(fid,[modelname '.materials.mu_water'],self.mu_water);
-			writejsdouble(fid,[modelname '.materials.heatcapacity'],self.heatcapacity);
-			writejsdouble(fid,[modelname '.materials.latentheat'],self.latentheat);
-			writejsdouble(fid,[modelname '.materials.thermalconductivity'],self.thermalconductivity);
-			writejsdouble(fid,[modelname '.materials.temperateiceconductivity'],self.temperateiceconductivity);
-			writejsdouble(fid,[modelname '.materials.effectiveconductivity_averaging'],self.effectiveconductivity_averaging);
-			writejsdouble(fid,[modelname '.materials.meltingpoint'],self.meltingpoint);
-			writejsdouble(fid,[modelname '.materials.beta'],self.beta);
-			writejsdouble(fid,[modelname '.materials.mixed_layer_capacity'],self.mixed_layer_capacity);
-			writejsdouble(fid,[modelname '.materials.thermal_exchange_velocity'],self.thermal_exchange_velocity);
-			writejsdouble(fid,[modelname '.materials.mixed_layer_capacity'],self.mixed_layer_capacity);
-			writejs1Darray(fid,[modelname '.materials.rheology_B'],self.rheology_B);
-			writejs1Darray(fid,[modelname '.materials.rheology_n'],self.rheology_n);
-			writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
-			writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/matice.py
===================================================================
--- /issm/trunk/src/m/classes/matice.py	(revision 28275)
+++ 	(revision )
@@ -1,149 +1,0 @@
-import numpy as np
-
-from fielddisplay import fielddisplay
-from project3d import project3d
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class matice(object):
-    """MATICE class definition
-
-    Usage:
-            matice = matice()
-    """
-
-    def __init__(self):  # {{{
-        self.rho_ice = 0
-        self.rho_water = 0
-        self.rho_freshwater = 0
-        self.mu_water = 0
-        self.heatcapacity = 0
-        self.latentheat = 0
-        self.thermalconductivity = 0
-        self.temperateiceconductivity = 0
-        self.effectiveconductivity_averaging = 0
-        self.meltingpoint = 0
-        self.beta = 0
-        self.mixed_layer_capacity = 0
-        self.thermal_exchange_velocity = 0
-        self.rheology_B = np.nan
-        self.rheology_n = np.nan
-        self.rheology_law = ''
-
-        # SLC
-        self.earth_density = 0
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Materials:\n'
-        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'water density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [Ns/m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'effectiveconductivity_averaging', 'computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)'))
-        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
-        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
-        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
-        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
-        s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\''))
-        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
-        self.rheology_n = project3d(md, 'vector', self.rheology_n, 'type', 'element')
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Ice density (kg/m^3)
-        self.rho_ice = 917.0
-        # Ocean water density (kg/m^3)
-        self.rho_water = 1023.0
-        # Fresh water density (kg/m^3)
-        self.rho_freshwater = 1000.0
-        # Water viscosity (N.s/m^2)
-        self.mu_water = 0.001787
-        # Ice heat capacity cp (J/kg/K)
-        self.heatcapacity = 2093.0
-        # Ice latent heat of fusion L (J/kg)
-        self.latentheat = 3.34 * pow(10, 5)
-        # Ice thermal conductivity (W/m/K)
-        self.thermalconductivity = 2.4
-        # Temperate ice thermal conductivity (W/m/K)
-        self.temperateiceconductivity = 0.24
-        # Computation of effective conductivity
-        self.effectiveconductivity_averaging = 1
-        # The melting point of ice at 1 atmosphere of pressure in K
-        self.meltingpoint = 273.15
-        # Rate of change of melting point with pressure (K/Pa)
-        self.beta = 9.8 * pow(10, -8)
-        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
-        self.mixed_layer_capacity = 3974.0
-        # Thermal exchange velocity (ice-water interface) (m/s)
-        self.thermal_exchange_velocity = 1.00 * pow(10, -4)
-        # Rheology law: what is the temperature dependence of B with T
-        # available: none, paterson and arrhenius
-        self.rheology_law = 'Paterson'
-
-        # Rheology for ice
-        self.rheology_B = 2.1 * 1e8
-        self.rheology_n = 3
-
-        # SLR
-        self.earth_density = 5512  # average density of the Earth, (kg/m^3)
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if solution == 'TransientSolution' and md.transient.isslc:
-            md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
-        else:
-            md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
-            md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
-            md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
-            md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
-            md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'universal', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'universal',1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O'])
-            md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 3, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermal_exchange_velocity', 'format', 'Double')
-        # NOTE: We first have to check if we have a NumPy array here
-        if np.size(self.rheology_B)==1 or (((np.shape(self.rheology_B)[0] == md.mesh.numberofvertices) or (np.shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1)) or ((len(np.shape(self.rheology_B)) == 2) and (np.shape(self.rheology_B)[0] == md.mesh.numberofelements) and (np.shape(self.rheology_B)[1] > 1))):
-            mattype = 1
-            tsl = md.mesh.numberofvertices
-        else:
-            mattype = 2
-            tsl = md.mesh.numberofelements
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', mattype, 'timeserieslength', tsl + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
-    # }}}
Index: sm/trunk/src/m/classes/mesh2d.js
===================================================================
--- /issm/trunk/src/m/classes/mesh2d.js	(revision 28275)
+++ 	(revision )
@@ -1,140 +1,0 @@
-//MESH2D class definition
-//
-//   Usage:
-//      mesh2d= new mesh2d();
-
-function mesh2d () {
-	//methods 
-		this.setdefaultparameters = function (){ //{{{
-
-			//the connectivity is the averaged number of nodes linked to a
-			//given node through an edge. This connectivity is used to initially
-			//allocate memory to the stiffness matrix. A value of 16 seems to
-			//give a good memory/time ration. This value can be checked in
-			//trunk/test/Miscellaneous/runme.m
-			this.average_vertex_connectivity=25;
-		}
-		// }}}
-		this.disp = function () { //{{{
-			console.log(sprintf("   2D tria Mesh (horizontal):")); 
-
-			console.log(sprintf("\n      Elements and vertices:"));
-			fielddisplay(this,"numberofelements","number of elements");
-			fielddisplay(this,"numberofvertices","number of vertices");
-			fielddisplay(this,"elements","vertex indices of the mesh elements");
-			fielddisplay(this,"x","vertices x coordinate [m]");
-			fielddisplay(this,"y","vertices y coordinate [m]");
-			fielddisplay(this,"edges","edges of the 2d mesh (vertex1 vertex2 element1 element2)");
-			fielddisplay(this,"numberofedges","number of edges of the 2d mesh");
-
-			console.log(sprintf("\n      Properties:"));
-			fielddisplay(this,"vertexonboundary","vertices on the boundary of the domain flag list");
-			fielddisplay(this,"segments","edges on domain boundary (vertex1 vertex2 element)");
-			fielddisplay(this,"segmentmarkers","number associated to each segment");
-			fielddisplay(this,"vertexconnectivity","list of elements connected to vertex_i");
-			fielddisplay(this,"elementconnectivity","list of elements adjacent to element_i");
-			fielddisplay(this,"average_vertex_connectivity","average number of vertices connected to one vertex");
-
-			console.log(sprintf("\n      Extracted model:"));
-			fielddisplay(this,"extractedvertices","vertices extracted from the model");
-			fielddisplay(this,"extractedelements","elements extracted from the model");
-
-			console.log(sprintf("\n      Projection:"));
-			fielddisplay(this,"lat","vertices latitude [degrees]");
-			fielddisplay(this,"long","vertices longitude [degrees]");
-			fielddisplay(this,"epsg","EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)");
-			fielddisplay(self,"scale_factor","Projection correction for volume, area, etc. computation)");
-		} //}}}
-		this.classname = function () { //{{{
-			return "mesh2d";
-		} //}}}
-		this.domaintype=function (){ // {{{
-			return '2Dhorizontal';
-		} // }}}
-		this.dimension = function () { //{{{
-			return 2;
-		} //}}}
-		this.elementtype = function() {//{{{
-			return 'Tria';
-		} // }}}
-		this.checkconsistency = function(md,solution,analyses){ //{{{
-
-			checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',NewArrayFillIncrement(md.mesh.numberofvertices,1,1));
-			checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements, 3]);
-			if(ArrayAnyEqual(ArrayIsMember(NewArrayFillIncrement(md.mesh.numberofvertices,1,1),ArraySort(ArrayUnique(MatrixToList(md.mesh.elements)))),0)){
-				md.checkmessage('orphan nodes have been found. Check the mesh outline');
-			}
-			checkfield(md,'fieldname','mesh.numberofelements','>',0);
-			checkfield(md,'fieldname','mesh.numberofvertices','>',0);
-			checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',9,'message',"'mesh.average_vertex_connectivity' should be at least 9 in 2d");
-			checkfield(md,'fieldname','mesh.segments','NaN',1,'Inf',1,'>',0,'size',[NaN, 3]);
-			if(this.scale_factor.length>1) checkfield(md,'fieldname','mesh.scale_factor','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-
-			switch(solution){
-			case 'ThermalSolution':
-				checkmessage(md,'thermal not supported for 2d mesh');
-				break;
-			default:
-				break
-			}
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'name','md.mesh.domain_type','data','Domain' + this.domaintype(),'format','String');
-			WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',this.dimension(),'format','Integer');
-			WriteData(fid,prefix,'name','md.mesh.elementtype','data',this.elementtype(),'format','String');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'name','md.mesh.z','data',NewArrayFill(this.numberofvertices,0),'format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','numberofelements','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','numberofvertices','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','segments','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','scale_factor','format','DoubleMat','mattype',1);
-		}//}}}
-		this.fix=function() { //{{{
-			//Transform objects into Float64Arrays:
-			this.x=FloatFix(this.x,this.numberofvertices); 
-			this.y=FloatFix(this.y,this.numberofvertices); 
-			this.edges=NullFix(this.edges,NaN);
-			this.vertexonboundary=FloatFix(this.vertexonboundary,this.numberofvertices); 
-			this.segmentmarkers=FloatFix(this.segmentmarkers,this.segments.length);
-			this.extractedvertices=NullFix(this.extractedvertices,NaN);
-			this.extractedelements=NullFix(this.extractedelements,NaN);
-			this.lat=NullFix(this.lat,NaN);
-			this.long=NullFix(this.long,NaN);
-			this.scale_factor=NullFix(this.scale_factor,NaN);
-		}//}}}
-
-	//properties 
-	// {{{
-		this.x                           = NaN;
-		this.y                           = NaN;
-		this.elements                    = NaN;
-		this.numberofelements            = 0;
-		this.numberofvertices            = 0;
-		this.numberofedges               = 0;
-
-		this.lat                         = NaN;
-		this.long                        = NaN;
-		this.epsg                        = 0;
-		this.scale_factor                = NaN;
-
-		this.vertexonboundary            = NaN;
-
-		this.edges                       = NaN;
-		this.segments                    = NaN;
-		this.segmentmarkers              = NaN;
-		this.vertexconnectivity          = NaN;
-		this.elementconnectivity         = NaN;
-		this.average_vertex_connectivity = 0;
-
-		this.extractedvertices           = NaN;
-		this.extractedelements           = NaN;
-
-		this.setdefaultparameters();
-		//}}}
-}
Index: sm/trunk/src/m/classes/mesh2d.m
===================================================================
--- /issm/trunk/src/m/classes/mesh2d.m	(revision 28275)
+++ 	(revision )
@@ -1,274 +1,0 @@
-%MESH2D class definition
-%
-%   Usage:
-%      mesh2d=mesh2d();
-
-classdef mesh2d
-	properties (SetAccess=public) 
-		x                           = NaN;
-		y                           = NaN;
-		elements                    = NaN;
-		numberofelements            = 0;
-		numberofvertices            = 0;
-		numberofedges               = 0;
-
-		lat                         = NaN;
-		long                        = NaN;
-		epsg                        = 0;
-		proj                        = 0;
-		scale_factor                = NaN;
-
-		vertexonboundary            = NaN;
-
-		edges                       = NaN;
-		segments                    = NaN;
-		segmentmarkers              = NaN;
-		vertexconnectivity          = NaN;
-		elementconnectivity         = NaN;
-		average_vertex_connectivity = 0;
-
-		extractedvertices           = NaN;
-		extractedelements           = NaN;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model selfect is
-			% loaded. Update old properties here
-
-			%2014 Oct. 1st
-			if isstruct(self),
-				oldself=self;
-				%Assign property values from struct
-				self=structtoobj(mesh2d(),oldself);
-				if isfield(oldself,'hemisphere'),
-					disp('md.mesh.hemisphere has been automatically converted to EPSG code');
-					if strcmpi(oldself.hemisphere,'n'),
-						self.epsg=3413;
-						self.proj=epsg2proj(3413);
-					else
-						self.epsg=3031;
-						self.proj=epsg2proj(3031);
-					end
-				end
-			end
-
-		end% }}}
-	end
-	methods
-		function self = mesh2d(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=mesh2d();
-					object=varargin{1};
-					fields=fieldnames(object);
-					for i=1:length(fields)
-						field=fields{i};
-						if ismember(field,properties('mesh2d')),
-							self.(field)=object.(field);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%The connectivity is the average number of nodes linked to a given 
-			%node through an edge. This connectivity is used to initially allocate 
-			%memory to the stiffness matrix. A value of 16 seems to give a good 
-			%memory/time ratio. This value can be checked in
-			%test/Miscellaneous/runme.m
-			self.average_vertex_connectivity=25;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			
-			if strcmpi(solution,'LoveSolution'), return; end
-
-			md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',1:md.mesh.numberofvertices);
-			md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements 3]);
-			if any(~ismember(1:md.mesh.numberofvertices,sort(unique(md.mesh.elements(:)))));
-				md = checkmessage(md,'orphan nodes have been found. Check the mesh outline');
-			end
-			md = checkfield(md,'fieldname','mesh.numberofelements','>',0);
-			md = checkfield(md,'fieldname','mesh.numberofvertices','>',0);
-			md = checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',9,'message','''mesh.average_vertex_connectivity'' should be at least 9 in 2d');
-			md = checkfield(md,'fieldname','mesh.segments','NaN',1,'Inf',1,'>',0,'size',[NaN 3]);
-			if numel(md.mesh.scale_factor)>1,
-				md = checkfield(md,'fieldname','mesh.scale_factor','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			end
-
-			if strcmp(solution,'ThermalSolution')
-					md = checkmessage(md,'thermal not supported for 2d mesh');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   2D tria Mesh (horizontal):')); 
-
-			disp(sprintf('\n      Elements and vertices:'));
-			fielddisplay(self,'numberofelements','number of elements');
-			fielddisplay(self,'numberofvertices','number of vertices');
-			fielddisplay(self,'elements','vertex indices of the mesh elements');
-			fielddisplay(self,'x','vertices x coordinate [m]');
-			fielddisplay(self,'y','vertices y coordinate [m]');
-			fielddisplay(self,'edges','edges of the 2d mesh (vertex1 vertex2 element1 element2)');
-			fielddisplay(self,'numberofedges','number of edges of the 2d mesh');
-
-			disp(sprintf('\n      Properties:'));
-			fielddisplay(self,'vertexonboundary','vertices on the boundary of the domain flag list');
-			fielddisplay(self,'segments','edges on domain boundary (vertex1 vertex2 element)');
-			fielddisplay(self,'segmentmarkers','number associated to each segment');
-			fielddisplay(self,'vertexconnectivity','list of elements connected to vertex_i');
-			fielddisplay(self,'elementconnectivity','list of elements adjacent to element_i');
-			fielddisplay(self,'average_vertex_connectivity','average number of vertices connected to one vertex');
-
-			disp(sprintf('\n      Extracted model:'));
-			fielddisplay(self,'extractedvertices','vertices extracted from the model');
-			fielddisplay(self,'extractedelements','elements extracted from the model');
-
-			disp(sprintf('\n      Projection:'));
-			fielddisplay(self,'lat','vertices latitude [degrees]');
-			fielddisplay(self,'long','vertices longitude [degrees]');
-			fielddisplay(self,'epsg','EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)');
-			fielddisplay(self,'proj','PROJ.4 compatible projection string');
-			fielddisplay(self,'scale_factor','Projection correction for volume, area, etc. computation)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.mesh.domain_type','data',['Domain' domaintype(self)],'format','String');
-			WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(self),'format','Integer');
-			WriteData(fid,prefix,'name','md.mesh.elementtype','data',elementtype(self),'format','String');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'name','md.mesh.z','data',zeros(self.numberofvertices,1),'format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','segments','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','scale_factor','format','DoubleMat','mattype',1);
-			if md.transient.isoceancoupling, %Need to add lat/long coordinates to couple with ocean as they rely on lat/long coordinate system
-				WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lat','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'class','mesh','fieldname','long','format','DoubleMat','mattype',1);
-			end
-		end % }}}
-		function t = domaintype(self) % {{{
-			t = '2Dhorizontal';
-		end % }}}
-		function d = dimension(self) % {{{
-			d = 2;
-		end % }}}
-		function s = elementtype(self) % {{{
-			s = 'Tria';
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.mesh.x'],self.x);
-			writejs1Darray(fid,[modelname '.mesh.y'],self.y);
-			writejs2Darray(fid,[modelname '.mesh.elements'],self.elements);
-			writejsdouble(fid,[modelname '.mesh.numberofelements'],self.numberofelements);
-			writejsdouble(fid,[modelname '.mesh.numberofvertices'],self.numberofvertices);
-			writejsdouble(fid,[modelname '.mesh.numberofedges'],self.numberofedges);
-			writejs1Darray(fid,[modelname '.mesh.lat'],self.lat);
-			writejs1Darray(fid,[modelname '.mesh.long'],self.long);
-			writejsdouble(fid,[modelname '.mesh.epsg'],self.epsg);
-			writejsdouble(fid,[modelname '.mesh.proj'],self.proj);
-			writejsdouble(fid,[modelname '.mesh.scale_factor'],self.scale_factor);
-			writejs1Darray(fid,[modelname '.mesh.vertexonboundary'],self.vertexonboundary);
-			writejs2Darray(fid,[modelname '.mesh.edges'],self.edges);
-			writejs2Darray(fid,[modelname '.mesh.segments'],self.segments);
-			writejs2Darray(fid,[modelname '.mesh.segmentmarkers'],self.segmentmarkers);
-			writejs2Darray(fid,[modelname '.mesh.vertexconnectivity'],self.vertexconnectivity);
-			writejs2Darray(fid,[modelname '.mesh.elementconnectivity'],self.elementconnectivity);
-			writejsdouble(fid,[modelname '.mesh.average_vertex_connectivity'],self.average_vertex_connectivity);
-			writejs1Darray(fid,[modelname '.mesh.extractedvertices'],self.extractedvertices);
-			writejs1Darray(fid,[modelname '.mesh.extractedelements'],self.extractedelements);
-
-		end % }}}
-		function export(self,varargin) % {{{
-
-			options=pairoptions(varargin{:});
-			filename=getfieldvalue(options,'filename');
-			format=getfieldvalue(options,'format','shp');
-			geometry=getfieldvalue(options,'geometry','line');
-			index=getfieldvalue(options,'index',[]);
-			proj=getfieldvalue(options,'projection','');
-
-			%prepare contours: 
-			contours= struct([]);
-			if strcmpi(geometry,'point'),
-				for i=1:self.numberofvertices,
-					contours(i).x = self.x(i);
-					contours(i).y = self.y(i);
-					contours(i).id = i;
-					contours(i).Geometry = 'Point';
-				end
-			elseif strcmpi(geometry,'line'),
-				counter=1;
-				for i=1:self.numberofelements,
-					el=self.elements(i,:);
-					%first line:
-					contours(counter).x = [self.x(el(1)) self.x(el(2))];
-					contours(counter).y = [self.y(el(1)) self.y(el(2))];
-					contours(counter).Geometry = 'Line';
-
-					%second line:
-					contours(counter+1).x = [self.x(el(2)) self.x(el(3))];
-					contours(counter+1).y = [self.y(el(2)) self.y(el(3))];
-					contours(counter+1).Geometry = 'Line';
-
-					%third line:
-					contours(counter+2).x = [self.x(el(3)) self.x(el(1))];
-					contours(counter+2).y = [self.y(el(3)) self.y(el(1))];
-					contours(counter+2).Geometry = 'Line';
-					
-					%increase counter: 
-					counter=counter+3;
-				end
-			elseif strcmpi(geometry,'polygon'),
-				if isempty(index),
-					counter=1;
-					for i=1:self.numberofelements,
-						el=self.elements(i,:);
-						contours(i).x=[self.x(el(1)) self.x(el(2)) self.x(el(3)) self.x(el(1))];
-						contours(i).y=[self.y(el(1)) self.y(el(2)) self.y(el(3)) self.y(el(1))];
-						contours(i).Geometry = 'Polygon';
-						contours(i).Id = i;
-					end
-				else
-					counter=1;
-					for i=1:length(index),
-						el=self.elements(index(i),:);
-						contours(i).x=[self.x(el(1)) self.x(el(2)) self.x(el(3)) self.x(el(1))];
-						contours(i).y=[self.y(el(1)) self.y(el(2)) self.y(el(3)) self.y(el(1))];
-						contours(i).id = index(i);
-						contours(i).Geometry = 'Polygon';
-					end
-				end
-			else
-				error(sprintf('mesh3dsurface ''export'' error message: geometry %s not supported yet (should be ''point'' or ''line''',geometry));
-			end
-
-			%write file: 
-			if strcmpi(format,'shp'),
-				shpwrite(contours,filename);
-			elseif strcmpi(format,'exp'),
-				expwrite(contours,filename);
-			else
-				error(sprintf('mesh3dsurface ''export'' error message: file format %s not supported yet',format));
-			end
-
-			%write projection file: 
-			if ~isempty(proj),
-				proj2shpprj(filename,proj);
-			end
-			%write style file: 
-			applyqgisstyle(filename,'mesh');
-
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/mesh2d.py
===================================================================
--- /issm/trunk/src/m/classes/mesh2d.py	(revision 28275)
+++ 	(revision )
@@ -1,140 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-import MatlabFuncs as m
-from WriteData import WriteData
-
-
-class mesh2d(object):
-    """mesh2d class definition
-
-    Usage:
-        mesh2d = mesh2d()
-    """
-
-    def __init__(self):  # {{{
-        self.x = np.nan
-        self.y = np.nan
-        self.elements = np.nan
-        self.numberofelements = 0
-        self.numberofvertices = 0
-        self.numberofedges = 0
-
-        self.lat = np.nan
-        self.long = np.nan
-        self.epsg = 0
-        self.scale_factor = np.nan
-
-        self.vertexonboundary = np.nan
-        self.edges = np.nan
-        self.segments = np.nan
-        self.segmentmarkers = np.nan
-        self.vertexconnectivity = np.nan
-        self.elementconnectivity = np.nan
-        self.average_vertex_connectivity = 0
-
-        self.extractedvertices = np.nan
-        self.extractedelements = np.nan
-
-        # Set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   2D tria Mesh (horizontal):\n'
-
-        s += '{}\n'.format('      Elements and vertices:')
-        s += '{}\n'.format(fielddisplay(self, 'numberofelements', 'number of elements'))
-        s += '{}\n'.format(fielddisplay(self, 'numberofvertices', 'number of vertices'))
-        s += '{}\n'.format(fielddisplay(self, 'elements', 'vertex indices of the mesh elements'))
-        s += '{}\n'.format(fielddisplay(self, 'x', 'vertices x coordinate [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'y', 'vertices y coordinate [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'edges', 'edges of the 2d mesh (vertex1 vertex2 element1 element2)'))
-        s += '{}\n'.format(fielddisplay(self, 'numberofedges', 'number of edges of the 2d mesh'))
-        s += '\n'
-        s += '{}\n'.format('      Properties:')
-        s += '{}\n'.format(fielddisplay(self, 'vertexonboundary', 'vertices on the boundary of the domain flag list'))
-        s += '{}\n'.format(fielddisplay(self, 'segments', 'edges on domain boundary (vertex1 vertex2 element)'))
-        s += '{}\n'.format(fielddisplay(self, 'segmentmarkers', 'number associated to each segment'))
-        s += '{}\n'.format(fielddisplay(self, 'vertexconnectivity', 'list of elements connected to vertex_i'))
-        s += '{}\n'.format(fielddisplay(self, 'elementconnectivity', 'list of elements adjacent to element_i'))
-        s += '{}\n'.format(fielddisplay(self, 'average_vertex_connectivity', 'average number of vertices connected to one vertex'))
-        s += '\n'
-        s += '{}\n'.format('      Extracted model:')
-        s += '{}\n'.format(fielddisplay(self, 'extractedvertices', 'vertices extracted from the model'))
-        s += '{}\n'.format(fielddisplay(self, 'extractedelements', 'elements extracted from the model'))
-        s += '\n'
-        s += '{}\n'.format('      Projection:')
-        s += '{}\n'.format(fielddisplay(self, 'lat', 'vertices latitude [degrees]'))
-        s += '{}\n'.format(fielddisplay(self, 'long', 'vertices longitude [degrees]'))
-        s += '{}\n'.format(fielddisplay(self, 'epsg', 'EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)'))
-        s += '{}\n'.format(fielddisplay(self, 'scale_factor', 'Projection correction for volume, area, etc. computation'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # The connectivity is the average number of nodes linked to a given 
-        # node through an edge. This connectivity is used to initially allocate 
-        # memory to the stiffness matrix. A value of 16 seems to give a good 
-        # memory/time ratio. This value can be checked in 
-        # test/Miscellaneous/runme.m
-        self.average_vertex_connectivity = 25
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if(solution == 'LoveSolution'):
-            return
-
-        md = checkfield(md, 'fieldname', 'mesh.x', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.y', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.elements', 'NaN', 1, 'Inf', 1, '>', 0, 'values', np.arange(1, md.mesh.numberofvertices + 1))
-        md = checkfield(md, 'fieldname', 'mesh.elements', 'size', [md.mesh.numberofelements, 3])
-        if np.any(np.logical_not(m.ismember(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements))):
-            md.checkmessage('orphan nodes have been found. Check the mesh outline')
-        md = checkfield(md, 'fieldname', 'mesh.numberofelements', '>', 0)
-        md = checkfield(md, 'fieldname', 'mesh.numberofvertices', '>', 0)
-        md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 9, 'message', '\'mesh.average_vertex_connectivity\' should be at least 9 in 2d')
-        md = checkfield(md, 'fieldname', 'mesh.segments', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [np.nan, 3])
-        if(np.size(self.scale_factor) > 1):
-            md = checkfield(md, 'fieldname', 'mesh.scale_factor', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-
-        if solution == 'ThermalSolution':
-            md.checkmessage('thermal not supported for 2d mesh')
-
-        return md
-    # }}}
-
-    def domaintype(self):  # {{{
-        return '2Dhorizontal'
-    # }}}
-
-    def dimension(self):  # {{{
-        return 2
-    # }}}
-
-    def elementtype(self):  # {{{
-        return 'Tria'
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', 'Domain' + self.domaintype(), 'format', 'String')
-        WriteData(fid, prefix, 'name', 'md.mesh.domain_dimension', 'data', self.dimension(), 'format', 'Integer')
-        WriteData(fid, prefix, 'name', 'md.mesh.elementtype', 'data', self.elementtype(), 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'x', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'y', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'name', 'md.mesh.z', 'data', np.zeros(self.numberofvertices), 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'elements', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofelements', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofvertices', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'average_vertex_connectivity', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonboundary', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'segments', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'scale_factor', 'format', 'DoubleMat', 'mattype', 1)
-        if md.transient.isoceancoupling:
-            WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'lat', 'format', 'DoubleMat', 'mattype', 1)
-            WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'long', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
Index: sm/trunk/src/m/classes/mesh2dvertical.m
===================================================================
--- /issm/trunk/src/m/classes/mesh2dvertical.m	(revision 28275)
+++ 	(revision )
@@ -1,273 +1,0 @@
-%MESH2DVERTICAL class definition
-%
-%   Usage:
-%      mesh2dvertical=mesh2dvertical();
-
-classdef mesh2dvertical
-	properties (SetAccess=public) 
-		x                           = NaN;
-		y                           = NaN;
-		elements                    = NaN;
-		numberofelements            = 0;
-		numberofvertices            = 0;
-		numberofedges               = 0;
-
-		lat                         = NaN;
-		long                        = NaN;
-		epsg                        = NaN;
-		proj                        = '';
-		scale_factor                = NaN;
-
-		vertexonboundary            = NaN;
-		vertexonbase                = NaN;
-		vertexonsurface             = NaN;
-
-		edges                       = NaN;
-		segments                    = NaN;
-		segmentmarkers              = NaN;
-		vertexconnectivity          = NaN;
-		elementconnectivity         = NaN;
-		average_vertex_connectivity = 0;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model selfect is
-			% loaded. Update old properties here
-
-			%2014 Oct. 1st
-			if isstruct(self),
-				oldself=self;
-				%Assign property values from struct
-				self=structtoobj(mesh2dvertical(),oldself);
-				if isfield(oldself,'hemisphere'),
-					disp('md.mesh.hemisphere has been automatically converted to EPSG code');
-					if strcmpi(oldself.hemisphere,'n'),
-						self.epsg=3413;
-						self.proj=epsg2proj(3413);
-					else
-						self.epsg=3031;
-						self.proj=epsg2proj(3031);
-					end
-				end
-			end
-
-		end% }}}
-	end
-	methods
-		function self = mesh2dvertical(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('mesh2dvertical');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%the connectivity is the averaged number of nodes linked to a
-			%given node through an edge. This connectivity is used to initially
-			%allocate memory to the stiffness matrix. A value of 16 seems to
-			%give a good memory/time ration. This value can be checked in
-			%trunk/test/Miscellaneous/runme.m
-			self.average_vertex_connectivity=25;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			
-			if strcmpi(solution,'LoveSolution'), return; end
-
-			md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',1:md.mesh.numberofvertices);
-			md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements 3]);
-			if any(~ismember(1:md.mesh.numberofvertices,sort(unique(md.mesh.elements(:)))));
-				md = checkmessage(md,'orphan nodes have been found. Check the mesh outline');
-			end
-			md = checkfield(md,'fieldname','mesh.numberofelements','>',0);
-			md = checkfield(md,'fieldname','mesh.numberofvertices','>',0);
-			md = checkfield(md,'fieldname','mesh.vertexonbase','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			md = checkfield(md,'fieldname','mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			md = checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',9,'message','''mesh.average_vertex_connectivity'' should be at least 9 in 2d');
-			if numel(md.mesh.scale_factor)>1,
-				md = checkfield(md,'fieldname','mesh.scale_factor','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			end
-
-			if strcmp(solution,'ThermalSolution')
-				md = checkmessage(md,'thermal not supported for 2d mesh');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   2D tria Mesh (vertical):')); 
-
-			disp(sprintf('\n      Elements and vertices:'));
-			fielddisplay(self,'numberofelements','number of elements');
-			fielddisplay(self,'numberofvertices','number of vertices');
-			fielddisplay(self,'elements','vertex indices of the mesh elements');
-			fielddisplay(self,'x','vertices x coordinate [m]');
-			fielddisplay(self,'y','vertices y coordinate [m]');
-			fielddisplay(self,'edges','edges of the 2d mesh (vertex1 vertex2 element1 element2)');
-			fielddisplay(self,'numberofedges','number of edges of the 2d mesh');
-
-			disp(sprintf('\n      Properties:'));
-			fielddisplay(self,'vertexonboundary','vertices on the boundary of the domain flag list');
-			fielddisplay(self,'vertexonbase','vertices on the bed of the domain flag list');
-			fielddisplay(self,'vertexonsurface','vertices on the surface of the domain flag list');
-			fielddisplay(self,'segments','edges on domain boundary (vertex1 vertex2 element)');
-			fielddisplay(self,'segmentmarkers','number associated to each segment');
-			fielddisplay(self,'vertexconnectivity','list of elements connected to vertex_i');
-			fielddisplay(self,'elementconnectivity','list of elements adjacent to element_i');
-			fielddisplay(self,'average_vertex_connectivity','average number of vertices connected to one vertex');
-
-			disp(sprintf('\n      Projection:'));
-			fielddisplay(self,'lat','vertices latitude [degrees]');
-			fielddisplay(self,'long','vertices longitude [degrees]');
-			fielddisplay(self,'epsg','EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)');
-			fielddisplay(self,'proj','PROJ.4 compatible projection string');
-			fielddisplay(self,'scale_factor','Projection correction for volume, area, etc. computation)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.mesh.domain_type','data',['Domain' domaintype(self)],'format','String');
-			WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(self),'format','Integer');
-			WriteData(fid,prefix,'name','md.mesh.elementtype','data',elementtype(self),'format','String');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'name','md.mesh.z','data',zeros(self.numberofvertices,1),'format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','scale_factor','format','DoubleMat','mattype',1);
-		end % }}}
-		function t = domaintype(self) % {{{
-			t = '2Dvertical';
-		end % }}}
-		function d = dimension(self) % {{{
-			d = 2;
-		end % }}}
-		function s = elementtype(self) % {{{
-			s = 'Tria';
-		end % }}}
-		function flags = vertexflags(self,value) % {{{
-			flags = zeros(self.numberofvertices,1);
-			pos   = self.segments(find(self.segmentmarkers==value),1:2);
-			flags(pos) = 1;
-		end % }}}
-		function [data datatype] = processdata(self,md,data,options) % {{{
-
-			%transpose data if necessary
-			if (size(data,2) > size(data,1)),
-				data=data';
-			end
-			datasize=size(data);
-
-			%convert to double if necessary
-			if ~isnumeric(data);
-				disp('processdata info message: data is not numeric (logical?). Converted to double');
-				data=double(data);
-			end
-
-			%check length
-			if datasize(1)~=md.mesh.numberofvertices & datasize(1)~=md.mesh.numberofelements
-				error('plotmodel error message: data not supported yet');
-			end
-
-			%quiver?
-			if datasize(2)>1,
-				datatype=3;
-			end
-
-			%smoothing?
-			if exist(options,'smooth')
-				data=averaging(md,data,getfieldvalue(options,'smooth'));
-				datasize(1)=md.mesh.numberofvertices;
-				%---> go to node data
-			end
-
-			%element data
-			if (datasize(1)==md.mesh.numberofelements & datasize(2)==1),
-				datatype=1;
-
-				%Mask?
-				if exist(options,'mask'),
-					flags=getfieldvalue(options,'mask');
-					pos=find(~flags);
-					if length(flags)==md.mesh.numberofvertices,
-						[pos2 dummy]=find(ismember(md.mesh.elements,pos));
-						data(pos2,:)=NaN;
-					elseif length(flags)==md.mesh.numberofelements
-						data(pos,:)=NaN;
-					else
-						disp('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements');
-					end
-				end
-
-				%log?
-				if exist(options,'log'),
-					bounds=getfieldvalue(options,'caxis',[min(data(:)) max(data(:))]);
-					data(find(data<bounds(1)))=bounds(1);
-					if any(data<=0),
-						error('Log option cannot be applied on negative values. Use caxis option (Rignot''s settings: [1.5 max(data)])');
-					end
-					pos=find(~isnan(data));
-					data(pos)=log(data(pos))/log(getfieldvalue(options,'log'));
-				end
-			end
-
-			%node data
-			if (datasize(1)==md.mesh.numberofvertices & datasize(2)==1),
-				datatype=2;
-
-				%Mask?
-				if exist(options,'mask'),
-					flags=getfieldvalue(options,'mask');
-					pos=find(~flags);
-					if length(flags)==md.mesh.numberofvertices,
-						data(pos,:)=NaN;
-					elseif length(flags)==md.mesh.numberofelements
-						data(md.mesh.elements(pos,:),:)=NaN;
-					else
-						disp('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements');
-					end
-				end
-
-				%log?
-				if exist(options,'log'),
-					%if any(data<=0),
-					%	error('Log option cannot be applied on negative values. Use caxis option (Rignot''s settings: [1.5 max(data)])');
-					%end
-					data=log(data)/log(getfieldvalue(options,'log'));
-				end
-			end
-		end % }}}
-		function [x y z elements is2d isplanet] = processmesh(self,options) % {{{
-
-			isplanet = 0;
-			is2d     = 1;
-
-			elements = self.elements;
-			x        = self.x;
-			y        = self.y;
-			z        = zeros(self.numberofvertices,1);
-
-			if exist(options,'xunit'),
-				unit=getfieldvalue(options,'xunit');
-				x=x*unit; % Apply to x only
-			end
-			if exist(options,'yunit'),
-				unit=getfieldvalue(options,'yunit');
-				x=x*unit; % Apply to x only
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/mesh2dvertical.py
===================================================================
--- /issm/trunk/src/m/classes/mesh2dvertical.py	(revision 28275)
+++ 	(revision )
@@ -1,142 +1,0 @@
-import numpy as np
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-import MatlabFuncs as m
-from WriteData import WriteData
-
-
-class mesh2dvertical(object):
-    """
-    MESH2DVERTICAL class definition
-
-       Usage:
-          mesh2dvertical = mesh2dvertical()
-    """
-
-    def __init__(self):  # {{{
-        self.x = float('NaN')
-        self.y = float('NaN')
-        self.elements = float('NaN')
-        self.numberofelements = 0
-        self.numberofvertices = 0
-        self.numberofedges = 0
-
-        self.lat = float('NaN')
-        self.long = float('NaN')
-        self.epsg = float('NaN')
-        self.scale_factor = float('NaN')
-
-        self.vertexonboundary = float('NaN')
-        self.vertexonbase = float('NaN')
-        self.vertexonsurface = float('NaN')
-
-        self.edges = float('NaN')
-        self.segments = float('NaN')
-        self.segmentmarkers = float('NaN')
-        self.vertexconnectivity = float('NaN')
-        self.elementconnectivity = float('NaN')
-        self.average_vertex_connectivity = 0
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-    def __repr__(self):  # {{{
-        string = "   2D tria Mesh (vertical):"
-
-        string = "%s\n%s" % (string, "\n      Elements and vertices:")
-        string = "%s\n%s" % (string, fielddisplay(self, "numberofelements", "number of elements"))
-        string = "%s\n%s" % (string, fielddisplay(self, "numberofvertices", "number of vertices"))
-        string = "%s\n%s" % (string, fielddisplay(self, "elements", "vertex indices of the mesh elements"))
-        string = "%s\n%s" % (string, fielddisplay(self, "x", "vertices x coordinate [m]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "y", "vertices y coordinate [m]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "edges", "edges of the 2d mesh (vertex1 vertex2 element1 element2)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "numberofedges", "number of edges of the 2d mesh"))
-
-        string = "%s%s" % (string, "\n\n      Properties:")
-        string = "%s\n%s" % (string, fielddisplay(self, "vertexonboundary", "vertices on the boundary of the domain flag list"))
-        string = "%s\n%s" % (string, fielddisplay(self, 'vertexonbase', 'vertices on the bed of the domain flag list'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'vertexonsurface', 'vertices on the surface of the domain flag list'))
-        string = "%s\n%s" % (string, fielddisplay(self, "segments", "edges on domain boundary (vertex1 vertex2 element)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "segmentmarkers", "number associated to each segment"))
-        string = "%s\n%s" % (string, fielddisplay(self, "vertexconnectivity", "list of elements connected to vertex_i"))
-        string = "%s\n%s" % (string, fielddisplay(self, "elementconnectivity", "list of elements adjacent to element_i"))
-        string = "%s\n%s" % (string, fielddisplay(self, "average_vertex_connectivity", "average number of vertices connected to one vertex"))
-
-        string = "%s%s" % (string, "\n\n      Projection:")
-        string = "%s\n%s" % (string, fielddisplay(self, "lat", "vertices latitude [degrees]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "long", "vertices longitude [degrees]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "epsg", "EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "scale_factor", "Projection correction for volume, area, etc. computation"))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #the connectivity is the averaged number of nodes linked to a
-        #given node through an edge. This connectivity is used to initially
-        #allocate memory to the stiffness matrix. A value of 16 seems to
-        #give a good memory / time ration. This value can be checked in
-        #trunk / test / Miscellaneous / runme.m
-        self.average_vertex_connectivity = 25.
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if(solution == 'LoveSolution'):
-            return
-
-        md = checkfield(md, 'fieldname', 'mesh.x', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.y', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.elements', 'NaN', 1, 'Inf', 1, '>', 0, 'values', np.arange(1, md.mesh.numberofvertices + 1))
-        md = checkfield(md, 'fieldname', 'mesh.elements', 'size', [md.mesh.numberofelements, 3])
-        if np.any(np.logical_not(m.ismember(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements))):
-            md.checkmessage("orphan nodes have been found. Check the mesh outline")
-        md = checkfield(md, 'fieldname', 'mesh.numberofelements', '>', 0)
-        md = checkfield(md, 'fieldname', 'mesh.numberofvertices', '>', 0)
-        md = checkfield(md, 'fieldname', 'mesh.vertexonbase', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'mesh.vertexonsurface', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 9, 'message', "'mesh.average_vertex_connectivity' should be at least 9 in 2d")
-        if(np.size(self.scale_factor) > 1):
-            md = checkfield(md, 'fieldname', 'mesh.scale_factor', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-
-        if solution == 'ThermalSolution':
-            md.checkmessage("thermal not supported for 2d mesh")
-
-        return md
-    # }}}
-
-    def domaintype(self):  # {{{
-        return "2Dvertical"
-    # }}}
-
-    def dimension(self):  # {{{
-        return 2
-    # }}}
-
-    def elementtype(self):  # {{{
-        return "Tria"
-    # }}}
-
-    def vertexflags(self, value):  # {{{
-        flags = np.zeros((self.numberofvertices, ))
-        pos = self.segments[np.where(self.segmentmarkers == value), 0:2] - 1
-        flags[pos] = 1
-        return flags
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', "Domain" + self.domaintype(), 'format', 'String')
-        WriteData(fid, prefix, 'name', 'md.mesh.domain_dimension', 'data', self.dimension(), 'format', 'Integer')
-        WriteData(fid, prefix, 'name', 'md.mesh.elementtype', 'data', self.elementtype(), 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'x', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'y', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'name', 'md.mesh.z', 'data', np.zeros(self.numberofvertices), 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'elements', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofelements', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofvertices', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonbase', 'format', 'BooleanMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonsurface', 'format', 'BooleanMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'average_vertex_connectivity', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'scale_factor', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
Index: sm/trunk/src/m/classes/mesh3dprisms.js
===================================================================
--- /issm/trunk/src/m/classes/mesh3dprisms.js	(revision 28275)
+++ 	(revision )
@@ -1,165 +1,0 @@
-//MESH3DPRISMS class definition
-//
-//   Usage:
-//      mesh=mesh3dprisms();
-
-function mesh3dprisms() {
-		this.setdefaultparameters = function() { // {{{)
-
-			//the connectivity is the averaged number of nodes linked to a
-			//given node through an edge. This connectivity is used to initially
-			//allocate memory to the stiffness matrix. A value of 16 seems to
-			//give a good memory/time ration. This value can be checked in
-			//trunk/test/Miscellaneous/runme.m
-			this.average_vertex_connectivity=25;
-		} // }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{[)
-
-			checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.z','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',NewArrayFillIncrement(md.mesh.numberofvertices,1,1));
-			checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements, 6]);
-
-            if(ArrayAnyEqual(ArrayIsMember(NewArrayFillIncrement(md.mesh.numberofvertices,1,1),ArraySort(ArrayUnique(MatrixToList(md.mesh.elements)))),0)){
-				//checkmessage(md,'orphan nodes have been found. Check the mesh outline'); @TODO
-                md.checkmessage('orphan nodes have been found. Check the mesh outline');
-			}
-			checkfield(md,'fieldname','mesh.numberoflayers','>=',0);
-			checkfield(md,'fieldname','mesh.numberofelements','>',0);
-			checkfield(md,'fieldname','mesh.numberofvertices','>',0);
-			checkfield(md,'fieldname','mesh.vertexonbase','size',[md.mesh.numberofvertices, 1],'values',[0, 1]);
-			checkfield(md,'fieldname','mesh.vertexonsurface','size',[md.mesh.numberofvertices, 1],'values',[0, 1]);
-			checkfield(md,'fieldname','mesh.z','>=',md.geometry.base-Math.pow(10, -10),'message','\'mesh.z\' lower than bedrock');
-			checkfield(md,'fieldname','mesh.z','<=',md.geometry.surface+Math.pow(10, -10),'message','\'mesh.z\' higher than surface elevation');
-			checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',24,'message','\'mesh.average_vertex_connectivity\' should be at least 24 in 3d');
-			if(this.scale_factor.length>1) checkfield(md,'fieldname','mesh.scale_factor','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-		} // }}}
-		this.disp = function()  { // {{{
-			console.log(sprintf('   3D prism Mesh:')); 
-
-			console.log(sprintf('\n      Elements and vertices of the original 2d mesh:'));
-			fielddisplay(this,'numberofelements2d','number of elements');
-			fielddisplay(this,'numberofvertices2d','number of vertices');
-			fielddisplay(this,'elements2d','vertex indices of the mesh elements');
-			fielddisplay(this,'x2d','vertices x coordinate [m]');
-			fielddisplay(this,'y2d','vertices y coordinate [m]');
-
-            console.log(sprintf('\n      Elements and vertices of the extruded 3d mesh:'));
-			fielddisplay(this,'numberofelements','number of elements');
-			fielddisplay(this,'numberofvertices','number of vertices');
-			fielddisplay(this,'elements','vertex indices of the mesh elements');
-			fielddisplay(this,'x','vertices x coordinate [m]');
-			fielddisplay(this,'y','vertices y coordinate [m]');
-			fielddisplay(this,'z','vertices z coordinate [m]');
-
-			console.log(sprintf('\n      Properties:'));
-			fielddisplay(this,'numberoflayers','number of extrusion layers');
-			fielddisplay(this,'vertexonbase','lower vertices flags list');
-			fielddisplay(this,'vertexonsurface','upper vertices flags list');
-			fielddisplay(this,'uppervertex','upper vertex list (NaN for vertex on the upper surface)');
-			fielddisplay(this,'upperelements','upper element list (NaN for element on the upper layer)');
-			fielddisplay(this,'lowervertex','lower vertex list (NaN for vertex on the lower surface)');
-			fielddisplay(this,'lowerelements','lower element list (NaN for element on the lower layer');
-			fielddisplay(this,'vertexonboundary','vertices on the boundary of the domain flag list');
-
-			fielddisplay(this,'vertexconnectivity','list of elements connected to vertex_i');
-			fielddisplay(this,'elementconnectivity','list of elements adjacent to element_i');
-			fielddisplay(this,'average_vertex_connectivity','average number of vertices connected to one vertex');
-
-			console.log(sprintf('\n      Extracted model:'));
-			fielddisplay(this,'extractedvertices','vertices extracted from the model');
-			fielddisplay(this,'extractedelements','elements extracted from the model');
-
-			console.log(sprintf('\n      Projection:'));
-			fielddisplay(this,'lat','vertices latitude [degrees]');
-			fielddisplay(this,'long','vertices longitude [degrees]');
-			fielddisplay(this,'epsg','EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)');
-			fielddisplay(self,"scale_factor","Projection correction for volume, area, etc. computation)");
-		} // }}}
-		this.marshall = function(md,prefix,fid) { // {{{
-			WriteData(fid,prefix,'name','md.mesh.domain_type','data','Domain' + this.domaintype(),'format','String');
-			WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',this.dimension(),'format','Integer');
-			WriteData(fid,prefix,'name','md.mesh.elementtype','data',this.elementtype(),'format','String');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','z','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','numberoflayers','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','numberofelements','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','numberofvertices','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','numberofvertices2d','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','numberofelements2d','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','mesh','fieldname','scale_factor','format','DoubleMat','mattype',1);
-		} // }}}
-        this.fix=function() { //{{{
-            //Transform objects into Float64Arrays:
-            this.x=FloatFix(this.x,this.numberofvertices); 
-            this.y=FloatFix(this.y,this.numberofvertices); 
-            this.z=FloatFix(this.y,this.numberofvertices); 
-            this.r=FloatFix(this.y,this.numberofvertices); 
-            this.edges=NaNFix(this.edges,NaN);
-            this.vertexonboundary=FloatFix(this.vertexonboundary,this.numberofvertices); 
-            this.segmentmarkers=FloatFix(this.segmentmarkers,this.segments.length);
-            this.extractedvertices=NaNFix(this.extractedvertices,NaN);
-            this.extractedelements=NaNFix(this.extractedelements,NaN);
-            this.lat=NaNFix(this.lat,NaN);
-            this.long=NaNFix(this.long,NaN);
-				this.scale_factor=NullFix(this.scale_factor,NaN);
-        }//}}}
-		this.domaintype = function() { // {{{)
-			return '3D';
-		} // }}}
-		this.dimension = function() { // {{{)
-			return 3;
-		} // }}}
-		this.elementtype = function() { // {{{)
-			return 'Penta';
-		} // }}}
-        this.classname = function () { //{{{
-            return "mesh3dprisms";
-        } //}}}
-
-	//properties 
-	// {{{
-        this.x                           = NaN;
-        this.y                           = NaN;
-        this.z                           = NaN;
-        this.elements                    = NaN;
-        this.numberoflayers              = 0;
-        this.numberofelements            = 0;
-        this.numberofvertices            = 0;
-
-        this.lat                         = NaN;
-        this.long                        = NaN;
-        this.epsg                        = 0;
-		this.scale_factor                = NaN;
-
-        this.vertexonbase                = NaN;
-        this.vertexonsurface             = NaN;
-        this.lowerelements               = NaN;
-        this.lowervertex                 = NaN;
-        this.upperelements               = NaN;
-        this.uppervertex                 = NaN;
-        this.vertexonboundary            = NaN;
-
-        this.vertexconnectivity          = NaN;
-        this.elementconnectivity         = NaN;
-        this.average_vertex_connectivity = 0;
-
-        this.x2d                         = NaN;
-        this.y2d                         = NaN;
-        this.elements2d                  = NaN;
-        this.numberofvertices2d          = 0;
-        this.numberofelements2d          = 0;
-
-        this.extractedvertices           = NaN;
-        this.extractedelements           = NaN;
-	//}}}
-}
Index: sm/trunk/src/m/classes/mesh3dprisms.m
===================================================================
--- /issm/trunk/src/m/classes/mesh3dprisms.m	(revision 28275)
+++ 	(revision )
@@ -1,249 +1,0 @@
-%MESH3DPRISMS class definition
-%
-%   Usage:
-%      mesh=mesh3dprisms();
-
-classdef mesh3dprisms
-	properties (SetAccess=public) 
-		x                           = NaN;
-		y                           = NaN;
-		z                           = NaN;
-		elements                    = NaN;
-		numberoflayers              = 0;
-		numberofelements            = 0;
-		numberofvertices            = 0;
-
-		lat                         = NaN;
-		long                        = NaN;
-		epsg                        = 0;
-		proj                        = '';
-		scale_factor                = NaN;
-
-		vertexonbase                = NaN;
-		vertexonsurface             = NaN;
-		lowerelements               = NaN;
-		lowervertex                 = NaN;
-		upperelements               = NaN;
-		uppervertex                 = NaN;
-		vertexonboundary            = NaN;
-
-		vertexconnectivity          = NaN;
-		elementconnectivity         = NaN;
-		average_vertex_connectivity = 0;
-
-		x2d                         = NaN;
-		y2d                         = NaN;
-		elements2d                  = NaN;
-		segments2d                  = NaN;
-		numberofvertices2d          = 0;
-		numberofelements2d          = 0;
-
-		extractedvertices           = NaN;
-		extractedelements           = NaN;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model selfect is
-			% loaded. Update old properties here
-
-			%2014 Oct. 1st
-			if isstruct(self),
-				oldself=self;
-				%Assign property values from struct
-				self=structtoobj(mesh3dprisms(),oldself);
-				if isfield(oldself,'hemisphere'),
-					disp('md.mesh.hemisphere has been automatically converted to EPSG code');
-					if strcmpi(oldself.hemisphere,'n'),
-						self.epsg=3413;
-						self.proj=epsg2proj(3413);
-					else
-						self.epsg=3031;
-						self.proj=epsg2proj(3031);
-					end
-				end
-			end
-
-		end% }}}
-	end
-	methods
-		function self = mesh3dprisms(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=mesh3dprisms();
-					object=varargin{1};
-					fields=fieldnames(object);
-					for i=1:length(fields)
-						field=fields{i};
-						if ismember(field,properties('mesh3dprisms')),
-							self.(field)=object.(field);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%the connectivity is the averaged number of nodes linked to a
-			%given node through an edge. This connectivity is used to initially
-			%allocate memory to the stiffness matrix. A value of 16 seems to
-			%give a good memory/time ration. This value can be checked in
-			%trunk/test/Miscellaneous/runme.m
-			self.average_vertex_connectivity=25;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			
-			if strcmpi(solution,'LoveSolution'), return; end
-
-			md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.z','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',1:md.mesh.numberofvertices);
-			md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements 6]);
-			if any(~ismember(1:md.mesh.numberofvertices,sort(unique(md.mesh.elements(:)))));
-				md = checkmessage(md,'orphan nodes have been found. Check the mesh outline');
-			end
-			md = checkfield(md,'fieldname','mesh.numberoflayers','>=',0);
-			md = checkfield(md,'fieldname','mesh.numberofelements','>',0);
-			md = checkfield(md,'fieldname','mesh.numberofvertices','>',0);
-			md = checkfield(md,'fieldname','mesh.vertexonboundary','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			md = checkfield(md,'fieldname','mesh.vertexonbase','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			md = checkfield(md,'fieldname','mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			md = checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',24,'message','''mesh.average_vertex_connectivity'' should be at least 24 in 3d');
-
-			%Check that mesh follows the geometry
-			md = checkfield(md,'fieldname','mesh.z','>=',md.geometry.base-10^-10,'message','''mesh.z'' lower than bedrock');
-			md = checkfield(md,'fieldname','mesh.z','<=',md.geometry.surface+10^-10,'message','''mesh.z'' higher than surface elevation');
-			if any(max(abs(project2d(md,md.mesh.z,1)-project2d(md,md.geometry.base,1)))>1e-10),
-				md = checkmessage(md,'md.mesh.z is not consistent with md.geometry.base, you changed the geometry after extrusion');
-			end
-			if any(max(abs(project2d(md,md.mesh.z,md.mesh.numberoflayers)-project2d(md,md.geometry.surface,1)))>1e-10),
-				md = checkmessage(md,'md.mesh.z is not consistent with md.geometry.surface, you changed the geometry after extrusion !!');
-			end
-			if any(max(abs(project2d(md,md.mesh.z,md.mesh.numberoflayers)-project2d(md,md.mesh.z,1) - project2d(md,md.geometry.thickness,1)))>1e-10),
-				md = checkmessage(md,'md.mesh.z is not consistent with md.geometry.thickness, you changed the geometry after extrusion !!');
-			end
-			if numel(md.mesh.scale_factor)>1,
-				md = checkfield(md,'fieldname','mesh.scale_factor','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   3D prism Mesh:')); 
-
-			disp(sprintf('\n      Elements and vertices of the original 2d mesh:'));
-			fielddisplay(self,'numberofelements2d','number of elements');
-			fielddisplay(self,'numberofvertices2d','number of vertices');
-			fielddisplay(self,'elements2d','vertex indices of the mesh elements');
-			fielddisplay(self,'segments2d','edges on 2d domain boundary (vertex1 vertex2 element)');
-			fielddisplay(self,'x2d','vertices x coordinate [m]');
-			fielddisplay(self,'y2d','vertices y coordinate [m]');
-
-			disp(sprintf('\n      Elements and vertices of the extruded 3d mesh:'));
-			fielddisplay(self,'numberofelements','number of elements');
-			fielddisplay(self,'numberofvertices','number of vertices');
-			fielddisplay(self,'elements','vertex indices of the mesh elements');
-			fielddisplay(self,'x','vertices x coordinate [m]');
-			fielddisplay(self,'y','vertices y coordinate [m]');
-			fielddisplay(self,'z','vertices z coordinate [m]');
-
-			disp(sprintf('\n      Properties:'));
-			fielddisplay(self,'numberoflayers','number of extrusion layers');
-			fielddisplay(self,'vertexonbase','lower vertices flags list');
-			fielddisplay(self,'vertexonsurface','upper vertices flags list');
-			fielddisplay(self,'uppervertex','upper vertex list (NaN for vertex on the upper surface)');
-			fielddisplay(self,'upperelements','upper element list (NaN for element on the upper layer)');
-			fielddisplay(self,'lowervertex','lower vertex list (NaN for vertex on the lower surface)');
-			fielddisplay(self,'lowerelements','lower element list (NaN for element on the lower layer');
-			fielddisplay(self,'vertexonboundary','vertices on the boundary of the domain flag list');
-
-			fielddisplay(self,'vertexconnectivity','list of elements connected to vertex_i');
-			fielddisplay(self,'elementconnectivity','list of elements adjacent to element_i');
-			fielddisplay(self,'average_vertex_connectivity','average number of vertices connected to one vertex');
-
-			disp(sprintf('\n      Extracted model:'));
-			fielddisplay(self,'extractedvertices','vertices extracted from the model');
-			fielddisplay(self,'extractedelements','elements extracted from the model');
-
-			disp(sprintf('\n      Projection:'));
-			fielddisplay(self,'lat','vertices latitude [degrees]');
-			fielddisplay(self,'long','vertices longitude [degrees]');
-			fielddisplay(self,'epsg','EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)');
-			fielddisplay(self,'proj','PROJ.4 compatible projection string');
-			fielddisplay(self,'scale_factor','Projection correction for volume, area, etc. computation)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.mesh.domain_type','data',['Domain' domaintype(self)],'format','String');
-			WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(self),'format','Integer');
-			WriteData(fid,prefix,'name','md.mesh.elementtype','data',elementtype(self),'format','String');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberoflayers','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonboundary','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','segments2d','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices2d','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements2d','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','scale_factor','format','DoubleMat','mattype',1);
-			if md.transient.isoceancoupling,
-				WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lat','format','DoubleMat','mattype',1);
-				WriteData(fid,prefix,'object',self,'class','mesh','fieldname','long','format','DoubleMat','mattype',1);
-			end
-		end % }}}
-		function type = domaintype(self) % {{{
-			type = '3D';
-		end % }}}
-		function d = dimension(self) % {{{
-			d = 3;
-		end % }}}
-		function s = elementtype(self) % {{{
-			s = 'Penta';
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			fprintf(fid,'%s.mesh=new mesh3dprisms();\n',modelname);
-			writejs1Darray(fid,[modelname '.mesh.x'],self.x);
-			writejs1Darray(fid,[modelname '.mesh.y'],self.y);
-			writejs1Darray(fid,[modelname '.mesh.z'],self.z);
-			writejs2Darray(fid,[modelname '.mesh.elements'],self.elements);
-			writejsdouble(fid,[modelname '.mesh.numberoflayers'],self.numberoflayers);
-			writejsdouble(fid,[modelname '.mesh.numberofelements'],self.numberofelements);
-			writejsdouble(fid,[modelname '.mesh.numberofvertices'],self.numberofvertices);
-			writejs1Darray(fid,[modelname '.mesh.lat'],self.lat);
-			writejs1Darray(fid,[modelname '.mesh.long'],self.long);
-			writejs1Darray(fid,[modelname '.mesh.epsg'],self.epsg);
-			writejs1Darray(fid,[modelname '.mesh.proj'],self.proj);
-			writejs1Darray(fid,[modelname '.mesh.vertexonbase'],self.vertexonbase);
-			writejs1Darray(fid,[modelname '.mesh.vertexonsurface'],self.vertexonsurface);
-			writejs1Darray(fid,[modelname '.mesh.lowerelements'],self.lowerelements);
-			writejs1Darray(fid,[modelname '.mesh.upperelements'],self.upperelements);
-			writejs1Darray(fid,[modelname '.mesh.uppervertex'],self.uppervertex);
-			writejs1Darray(fid,[modelname '.mesh.vertexonboundary'],self.vertexonboundary);
-
-			writejs2Darray(fid,[modelname '.mesh.vertexconnectivity'],self.vertexconnectivity);
-			writejs2Darray(fid,[modelname '.mesh.elementconnectivity'],self.elementconnectivity);
-			writejsdouble(fid,[modelname '.mesh.average_vertex_connectivity'],self.average_vertex_connectivity);
-			
-			writejs1Darray(fid,[modelname '.mesh.x2d'],self.x2d);
-			writejs1Darray(fid,[modelname '.mesh.y2d'],self.y2d);
-			writejs2Darray(fid,[modelname '.mesh.elements2d'],self.elements2d);
-			writejs2Darray(fid,[modelname '.mesh.segments2d'],self.segments2d);
-			writejsdouble(fid,[modelname '.mesh.numberofvertices2d'],self.numberofvertices2d);
-			writejsdouble(fid,[modelname '.mesh.numberofelements2d'],self.numberofelements2d);
-
-			writejs1Darray(fid,[modelname '.mesh.extractedvertices'],self.extractedvertices);
-			writejs1Darray(fid,[modelname '.mesh.extractedelements'],self.extractedelements);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/mesh3dprisms.py
===================================================================
--- /issm/trunk/src/m/classes/mesh3dprisms.py	(revision 28275)
+++ 	(revision )
@@ -1,165 +1,0 @@
-import numpy as np
-from fielddisplay import fielddisplay
-from checkfield import *
-import MatlabFuncs as m
-from WriteData import WriteData
-
-
-class mesh3dprisms(object):
-    """
-    MESH3DPRISMS class definition
-
-       Usage:
-          mesh3d = mesh3dprisms()
-    """
-
-    def __init__(self):  # {{{
-        self.x = float('NaN')
-        self.y = float('NaN')
-        self.z = float('NaN')
-        self.elements = float('NaN')
-        self.numberoflayers = 0
-        self.numberofelements = 0
-        self.numberofvertices = 0
-
-        self.lat = float('NaN')
-        self.long = float('NaN')
-        self.epsg = 0
-        self.scale_factor = float('NaN')
-
-        self.vertexonbase = float('NaN')
-        self.vertexonsurface = float('NaN')
-        self.lowerelements = float('NaN')
-        self.lowervertex = float('NaN')
-        self.upperelements = float('NaN')
-        self.uppervertex = float('NaN')
-        self.vertexonboundary = float('NaN')
-
-        self.vertexconnectivity = float('NaN')
-        self.elementconnectivity = float('NaN')
-        self.average_vertex_connectivity = 0
-
-        self.x2d = float('NaN')
-        self.y2d = float('NaN')
-        self.elements2d = float('NaN')
-        self.numberofvertices2d = 0
-        self.numberofelements2d = 0
-
-        self.extractedvertices = float('NaN')
-        self.extractedelements = float('NaN')
-
-    #set defaults
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "   3D prism Mesh:"
-
-        string = "%s\n%s" % (string, "\n      Elements and vertices of the original 2d mesh3dprisms:")
-
-        string = "%s\n%s" % (string, fielddisplay(self, "numberofelements2d", "number of elements"))
-        string = "%s\n%s" % (string, fielddisplay(self, "numberofvertices2d", "number of vertices"))
-        string = "%s\n%s" % (string, fielddisplay(self, "elements2d", "vertex indices of the mesh3dprisms elements"))
-        string = "%s\n%s" % (string, fielddisplay(self, "x2d", "vertices x coordinate [m]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "y2d", "vertices y coordinate [m]"))
-
-        string = "%s\n%s" % (string, "\n\n      Elements and vertices of the extruded 3d mesh3dprisms:")
-        string = "%s\n%s" % (string, fielddisplay(self, "numberofelements", "number of elements"))
-        string = "%s\n%s" % (string, fielddisplay(self, "numberofvertices", "number of vertices"))
-        string = "%s\n%s" % (string, fielddisplay(self, "elements", "vertex indices of the mesh3dprisms elements"))
-        string = "%s\n%s" % (string, fielddisplay(self, "x", "vertices x coordinate [m]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "y", "vertices y coordinate [m]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "z", "vertices z coordinate [m]"))
-
-        string = "%s%s" % (string, "\n\n      Properties:")
-        string = "%s\n%s" % (string, fielddisplay(self, "numberoflayers", "number of extrusion layers"))
-        string = "%s\n%s" % (string, fielddisplay(self, "vertexonbase", "lower vertices flags list"))
-        string = "%s\n%s" % (string, fielddisplay(self, "vertexonsurface", "upper vertices flags list"))
-        string = "%s\n%s" % (string, fielddisplay(self, "uppervertex", "upper vertex list (NaN for vertex on the upper surface)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "upperelements", "upper element list (NaN for element on the upper layer)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "lowervertex", "lower vertex list (NaN for vertex on the lower surface)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "lowerelements", "lower element list (NaN for element on the lower layer)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "vertexonboundary", "vertices on the boundary of the domain flag list"))
-        string = "%s\n%s" % (string, fielddisplay(self, "vertexconnectivity", "list of elements connected to vertex_i"))
-        string = "%s\n%s" % (string, fielddisplay(self, "elementconnectivity", "list of elements adjacent to element_i"))
-        string = "%s\n%s" % (string, fielddisplay(self, "average_vertex_connectivity", "average number of vertices connected to one vertex"))
-
-        string = "%s%s" % (string, "\n\n      Extracted model:")
-        string = "%s\n%s" % (string, fielddisplay(self, "extractedvertices", "vertices extracted from the model"))
-        string = "%s\n%s" % (string, fielddisplay(self, "extractedelements", "elements extracted from the model"))
-
-        string = "%s%s" % (string, "\n\n      Projection:")
-        string = "%s\n%s" % (string, fielddisplay(self, "lat", "vertices latitude [degrees]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "long", "vertices longitude [degrees]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "epsg", "EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "scale_factor", "Projection correction for volume, area, etc. computation"))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #the connectivity is the averaged number of nodes linked to a
-        #given node through an edge. This connectivity is used to initially
-        #allocate memory to the stiffness matrix. A value of 16 seems to
-        #give a good memory / time ration. This value can be checked in
-        #trunk / test / Miscellaneous / runme.m
-        self.average_vertex_connectivity = 25
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'mesh.x', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.y', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.z', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.elements', 'NaN', 1, 'Inf', 1, '>', 0, 'values', np.arange(1, md.mesh.numberofvertices + 1))
-        md = checkfield(md, 'fieldname', 'mesh.elements', 'size', [md.mesh.numberofelements, 6])
-        if np.any(np.logical_not(m.ismember(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements))):
-            md.checkmessage("orphan nodes have been found. Check the mesh3dprisms outline")
-        md = checkfield(md, 'fieldname', 'mesh.numberoflayers', '>=', 0)
-        md = checkfield(md, 'fieldname', 'mesh.numberofelements', '>', 0)
-        md = checkfield(md, 'fieldname', 'mesh.numberofvertices', '>', 0)
-        md = checkfield(md, 'fieldname', 'mesh.vertexonbase', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'mesh.vertexonsurface', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 24, 'message', "'mesh.average_vertex_connectivity' should be at least 24 in 3d")
-        if(np.size(self.scale_factor) > 1):
-            md = checkfield(md, 'fieldname', 'mesh.scale_factor', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-
-        return md
-    # }}}
-
-    def domaintype(self):  # {{{
-        return "3D"
-    # }}}
-
-    def dimension(self):  # {{{
-        return 3
-    # }}}
-
-    def elementtype(self):  # {{{
-        return "Penta"
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', "Domain" + self.domaintype(), 'format', 'String')
-        WriteData(fid, prefix, 'name', 'md.mesh.domain_dimension', 'data', self.dimension(), 'format', 'Integer')
-        WriteData(fid, prefix, 'name', 'md.mesh.elementtype', 'data', self.elementtype(), 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'x', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'y', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'z', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'elements', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberoflayers', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofelements', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofvertices', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonbase', 'format', 'BooleanMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonsurface', 'format', 'BooleanMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'lowerelements', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'upperelements', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'average_vertex_connectivity', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'elements2d', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofvertices2d', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofelements2d', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'scale_factor', 'format', 'DoubleMat', 'mattype', 1)
-        if md.transient.isoceancoupling:
-            WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'lat', 'format', 'DoubleMat', 'mattype', 1)
-            WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'long', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
Index: sm/trunk/src/m/classes/mesh3dsurface.js
===================================================================
--- /issm/trunk/src/m/classes/mesh3dsurface.js	(revision 28275)
+++ 	(revision )
@@ -1,139 +1,0 @@
-//MESH3DSURFACE class definition
-//
-//   Usage:
-//      mesh3dsurface= new mesh3dsurface();
-
-function mesh3dsurface () {
-	//methods 
-		this.setdefaultparameters = function (){ //{{{
-
-			//the connectivity is the averaged number of nodes linked to a
-			//given node through an edge. This connectivity is used to initially
-			//allocate memory to the stiffness matrix. A value of 16 seems to
-			//give a good memory/time ration. This value can be checked in
-			//trunk/test/Miscellaneous/runme.m
-			this.average_vertex_connectivity=25;
-		}
-		// }}}
-		this.disp = function () { //{{{
-			console.log(sprintf("   2D tria Mesh (3D surface):")); 
-
-			console.log(sprintf("\n      Elements and vertices:"));
-			fielddisplay(this,"numberofelements","number of elements");
-			fielddisplay(this,"numberofvertices","number of vertices");
-			fielddisplay(this,"elements","vertex indices of the mesh elements");
-			fielddisplay(this,"x","vertices x coordinate [m]");
-			fielddisplay(this,"y","vertices y coordinate [m]");
-			fielddisplay(this,"z","vertices z coordinate [m]");
-			fielddisplay(this,"edges","edges of the 2d mesh (vertex1 vertex2 element1 element2)");
-			fielddisplay(this,"numberofedges","number of edges of the 2d mesh");
-
-			console.log(sprintf("\n      Properties:"));
-			fielddisplay(this,"vertexonboundary","vertices on the boundary of the domain flag list");
-			fielddisplay(this,"segments","edges on domain boundary (vertex1 vertex2 element)");
-			fielddisplay(this,"segmentmarkers","number associated to each segment");
-			fielddisplay(this,"vertexconnectivity","list of elements connected to vertex_i");
-			fielddisplay(this,"elementconnectivity","list of elements adjacent to element_i");
-			fielddisplay(this,"average_vertex_connectivity","average number of vertices connected to one vertex");
-
-			console.log(sprintf("\n      Extracted model:"));
-			fielddisplay(this,"extractedvertices","vertices extracted from the model");
-			fielddisplay(this,"extractedelements","elements extracted from the model");
-
-			console.log(sprintf("\n      Projection:"));
-			fielddisplay(this,"lat","vertices latitude [degrees]");
-			fielddisplay(this,"long","vertices longitude [degrees]");
-			fielddisplay(this,"r","vertices radius [m]");
-		} //}}}
-		this.classname = function () { //{{{
-			return "mesh3dsurface";
-		} //}}}
-		this.domaintype=function (){ // {{{
-			return '3Dsurface';
-		} // }}}
-		this.dimension = function () { //{{{
-			return 2;
-		} //}}}
-		this.elementtype = function() {//{{{
-			return 'Tria';
-		} // }}}
-		this.checkconsistency = function(md,solution,analyses){ //{{{
-
-			checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.z','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.lat','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.long','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.r','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',NewArrayFillIncrement(md.mesh.numberofvertices,1,1));
-			checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements, 3]);
-			if(ArrayAnyEqual(ArrayIsMember(NewArrayFillIncrement(md.mesh.numberofvertices,1,1),ArraySort(ArrayUnique(MatrixToList(md.mesh.elements)))),0)){
-				md.checkmessage('orphan nodes have been found. Check the mesh outline');
-			}
-			checkfield(md,'fieldname','mesh.numberofelements','>',0);
-			checkfield(md,'fieldname','mesh.numberofvertices','>',0);
-			checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',9,'message',"'mesh.average_vertex_connectivity' should be at least 9 in 2d");
-			checkfield(md,'fieldname','mesh.segments','NaN',1,'Inf',1,'>',0,'size',[NaN, 3]);
-
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'name','md.mesh.domain_type','data','Domain' + this.domaintype(),'format','String');
-			WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',this.dimension(),'format','Integer');
-			WriteData(fid,prefix,'name','md.mesh.elementtype','data',this.elementtype(),'format','String');
-			WriteData(fid,prefix,'object',this,'fieldname','x','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','y','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','z','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','lat','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','long','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','r','format','DoubleMat','mattype',1);
-			//WriteData(fid,prefix,'object',this,'fieldname','z','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',this,'fieldname','numberofelements','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','numberofvertices','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','average_vertex_connectivity','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','vertexonboundary','format','DoubleMat','mattype',1);
-			//WriteData(fid,prefix,'object',this,'fieldname','segments','format','DoubleMat','mattype',3);
-		}//}}}
-		this.fix=function() { //{{{
-			//Transform objects into Float64Arrays:
-			this.x=FloatFix(this.x,this.numberofvertices); 
-			this.y=FloatFix(this.y,this.numberofvertices); 
-			this.z=FloatFix(this.y,this.numberofvertices); 
-			this.r=FloatFix(this.y,this.numberofvertices); 
-			this.edges=NullFix(this.edges,NaN);
-			this.vertexonboundary=FloatFix(this.vertexonboundary,this.numberofvertices); 
-			this.segmentmarkers=FloatFix(this.segmentmarkers,this.segments.length);
-			this.extractedvertices=NullFix(this.extractedvertices,NaN);
-			this.extractedelements=NullFix(this.extractedelements,NaN);
-			this.lat=NullFix(this.lat,NaN);
-			this.long=NullFix(this.long,NaN);
-		}//}}}
-
-	//properties 
-	// {{{
-		this.x                           = NaN;
-		this.y                           = NaN;
-		this.z                           = NaN;
-		this.elements                    = NaN;
-		this.numberofelements            = 0;
-		this.numberofvertices            = 0;
-		this.numberofedges               = 0;
-
-		this.lat                         = NaN;
-		this.long                        = NaN;
-		this.r                           = NaN;
-
-		this.vertexonboundary            = NaN;
-		this.edges                       = NaN;
-		this.segments                    = NaN;
-		this.segmentmarkers              = NaN;
-		this.vertexconnectivity          = NaN;
-		this.elementconnectivity         = NaN;
-		this.average_vertex_connectivity = 0;
-
-		this.extractedvertices           = NaN;
-		this.extractedelements           = NaN;
-
-		this.setdefaultparameters();
-		//}}}
-}
Index: sm/trunk/src/m/classes/mesh3dsurface.m
===================================================================
--- /issm/trunk/src/m/classes/mesh3dsurface.m	(revision 28275)
+++ 	(revision )
@@ -1,282 +1,0 @@
-%MESH3DSURFACE class definition
-%
-%   Usage:
-%      mesh3dsurface=mesh3dsurface();
-
-classdef mesh3dsurface
-	properties (SetAccess=public) 
-		x                           = NaN;
-		y                           = NaN;
-		z                           = NaN;
-		elements                    = NaN;
-		numberofelements            = 0;
-		numberofvertices            = 0;
-		numberofedges               = 0;
-
-		lat                         = NaN;
-		long                        = NaN;
-		r                           = NaN;
-		area                        = NaN;
-
-		vertexonboundary            = NaN;
-		edges                       = NaN;
-		segments                    = NaN;
-		segmentmarkers              = NaN;
-		vertexconnectivity          = NaN;
-		elementconnectivity         = NaN;
-		average_vertex_connectivity = 0;
-
-		extractedvertices           = NaN;
-		extractedelements           = NaN;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model selfect is
-			% loaded. Update old properties here
-
-			%2014 Oct. 1st
-			if isstruct(self),
-				oldself=self;
-				%Assign property values from struct
-				self=structtoobj(mesh3dsurface(),oldself);
-				%if isfield(oldself,'hemisphere'), %NOTE: not ever needed, epsg is not a field anymore.
-				%	disp('md.mesh.hemisphere has been automatically converted to EPSG code');
-				%	if strcmpi(oldself.hemisphere,'n'),
-				%		self.epsg=3413;
-				%	else
-				%		self.epsg=3031;
-				%	end
-				%end
-			end
-
-		end% }}}
-	end
-	methods
-		function self = mesh3dsurface(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=mesh3dsurface();
-					object=varargin{1};
-					fields=fieldnames(object);
-					for i=1:length(fields)
-						field=fields{i};
-						if ismember(field,properties('mesh3dsurface')),
-							self.(field)=object.(field);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function obj = setdefaultparameters(obj) % {{{
-
-			%The connectivity is the average number of nodes linked to a given 
-			%node through an edge. This connectivity is used to initially 
-			%allocate memory to the stiffness matrix. A value of 16 seems to 
-			%give a good memory/time ratio. This value can be checked in 
-			%test/NightlyRun/runme.py.
-			obj.average_vertex_connectivity=25;
-		end % }}}
-		function md = checkconsistency(obj,md,solution,analyses) % {{{
-
-			if strcmpi(solution,'LoveSolution'), return; end
-
-			md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.z','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.lat','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.long','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.r','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',1:md.mesh.numberofvertices);
-			md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements 3]);
-			if any(~ismember(1:md.mesh.numberofvertices,sort(unique(md.mesh.elements(:)))));
-				md = checkmessage(md,'orphan nodes have been found; check the mesh outline');
-			end
-			md = checkfield(md,'fieldname','mesh.numberofelements','>',0);
-			md = checkfield(md,'fieldname','mesh.numberofvertices','>',0);
-			md = checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',9,'message','''mesh.average_vertex_connectivity'' should be at least 9 in 2d');
-
-			if strcmp(solution,'ThermalSolution')
-				md = checkmessage(md,'thermal not supported for 2d mesh');
-			end
-		end % }}}
-		function disp(obj) % {{{
-			disp(sprintf('   3D tria Mesh (surface):')); 
-
-			disp(sprintf('\n      Elements and vertices:'));
-			fielddisplay(obj,'numberofelements','number of elements');
-			fielddisplay(obj,'numberofvertices','number of vertices');
-			fielddisplay(obj,'elements','vertex indices of the mesh elements');
-			fielddisplay(obj,'x','vertices x coordinate [m]');
-			fielddisplay(obj,'y','vertices y coordinate [m]');
-			fielddisplay(obj,'z','vertices z coordinate [m]');
-			fielddisplay(obj,'lat','vertices latitude [degrees]');
-			fielddisplay(obj,'long','vertices longitude [degrees]');
-			fielddisplay(obj,'r','vertices radius [m]');
-			fielddisplay(obj,'area','elemental areas [m^2]');
-			
-			fielddisplay(obj,'edges','edges of the 2d mesh (vertex1 vertex2 element1 element2)');
-			fielddisplay(obj,'numberofedges','number of edges of the 2d mesh');
-
-			disp(sprintf('\n      Properties:'));
-			fielddisplay(obj,'vertexonboundary','vertices on the boundary of the domain flag list');
-			fielddisplay(obj,'segments','edges on domain boundary (vertex1 vertex2 element)');
-			fielddisplay(obj,'segmentmarkers','number associated to each segment');
-			fielddisplay(obj,'vertexconnectivity','list of elements connected to vertex_i');
-			fielddisplay(obj,'elementconnectivity','list of elements adjacent to element_i');
-			fielddisplay(obj,'average_vertex_connectivity','average number of vertices connected to one vertex');
-
-			disp(sprintf('\n      Extracted model:'));
-			fielddisplay(obj,'extractedvertices','vertices extracted from the model');
-			fielddisplay(obj,'extractedelements','elements extracted from the model'); 
-		end % }}}
-		function marshall(obj,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.mesh.domain_type','data',['Domain' domaintype(obj)],'format','String');
-			WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(obj),'format','Integer');
-			WriteData(fid,prefix,'name','md.mesh.elementtype','data',elementtype(obj),'format','String');
-			WriteData(fid,prefix,'object',obj,'fieldname','x','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',obj,'fieldname','y','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',obj,'fieldname','z','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',obj,'fieldname','lat','data',obj.lat,'format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',obj,'fieldname','long','data',obj.long,'format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',obj,'fieldname','r','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'name','md.mesh.z','data',zeros(obj.numberofvertices,1),'format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',obj,'fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',obj,'fieldname','numberofelements','format','Integer');
-			WriteData(fid,prefix,'object',obj,'fieldname','numberofvertices','format','Integer');
-			WriteData(fid,prefix,'object',obj,'fieldname','average_vertex_connectivity','format','Integer');
-			WriteData(fid,prefix,'object',obj,'fieldname','vertexonboundary','format','DoubleMat','mattype',1);
-		end % }}}
-		function t = domaintype(obj) % {{{
-			t = '3Dsurface';
-		end % }}}
-		function d = dimension(obj) % {{{
-			d = 2;
-		end % }}}
-		function s = elementtype(obj) % {{{
-			s = 'Tria';
-		end % }}}
-		function [x y z elements is2d isplanet] = processmesh(self,options) % {{{
-
-			isplanet = 1;
-			is2d     = 0;
-
-			elements = self.elements;
-			x        = self.x;
-			y        = self.y;
-			z        = self.z;
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			fprintf(fid,'%s.mesh=new mesh3dsurface();\n',modelname);
-			writejs1Darray(fid,[modelname '.mesh.x'],self.x);
-			writejs1Darray(fid,[modelname '.mesh.y'],self.y);
-			writejs1Darray(fid,[modelname '.mesh.z'],self.z);
-			writejs2Darray(fid,[modelname '.mesh.elements'],self.elements);
-			writejsdouble(fid,[modelname '.mesh.numberofelements'],self.numberofelements);
-			writejsdouble(fid,[modelname '.mesh.numberofvertices'],self.numberofvertices);
-			writejsdouble(fid,[modelname '.mesh.numberofedges'],self.numberofedges);
-			writejs1Darray(fid,[modelname '.mesh.lat'],self.lat);
-			writejs1Darray(fid,[modelname '.mesh.long'],self.long);
-			writejs1Darray(fid,[modelname '.mesh.r'],self.r);
-			writejs1Darray(fid,[modelname '.mesh.area'],self.area);
-			writejs1Darray(fid,[modelname '.mesh.vertexonboundary'],self.vertexonboundary);
-			writejs2Darray(fid,[modelname '.mesh.edges'],self.edges);
-			writejs2Darray(fid,[modelname '.mesh.segments'],self.segments);
-			writejs2Darray(fid,[modelname '.mesh.segmentmarkers'],self.segmentmarkers);
-			writejs2Darray(fid,[modelname '.mesh.vertexconnectivity'],self.vertexconnectivity);
-			writejs2Darray(fid,[modelname '.mesh.elementconnectivity'],self.elementconnectivity);
-			writejsdouble(fid,[modelname '.mesh.average_vertex_connectivity'],self.average_vertex_connectivity);
-			writejs1Darray(fid,[modelname '.mesh.extractedvertices'],self.extractedvertices);
-			writejs1Darray(fid,[modelname '.mesh.extractedelements'],self.extractedelements);
-
-		end % }}}
-		function export(self,varargin) % {{{
-
-			options=pairoptions(varargin{:});
-			filename=getfieldvalue(options,'filename');
-			format=getfieldvalue(options,'format','shp');
-			geometry=getfieldvalue(options,'geometry','line');
-			index=getfieldvalue(options,'index',[]);
-			proj=getfieldvalue(options,'projection','');
-
-			%prepare contours: 
-			contours= struct([]);
-			if strcmpi(geometry,'point'),
-				for i=1:self.numberofvertices,
-					contours(i).x = self.long(i);
-					contours(i).y = self.lat(i);
-					contours(i).id = i;
-					contours(i).Geometry = 'Point';
-				end
-			elseif strcmpi(geometry,'line'),
-				count=1;
-				for i=1:self.numberofelements,
-					el=self.elements(i,:);
-					%first line:
-					contours(count).x = [self.long(el(1)) self.long(el(2))];
-					contours(count).y = [self.lat(el(1)) self.lat(el(2))];
-					contours(count).Geometry = 'Line';
-
-					%second line:
-					contours(count+1).x = [self.long(el(2)) self.long(el(3))];
-					contours(count+1).y = [self.lat(el(2)) self.lat(el(3))];
-					contours(count+1).Geometry = 'Line';
-
-					%third line:
-					contours(count+2).x = [self.long(el(3)) self.long(el(1))];
-					contours(count+2).y = [self.lat(el(3)) self.lat(el(1))];
-					contours(count+2).Geometry = 'Line';
-					
-					%increase count: 
-					count = count+3;
-				end
-			elseif strcmpi(geometry,'polygon'),
-				% TODO: Refactor the following to reduce repeated code, or 
-				%		leave as is because it is more readable?
-				if isempty(index),
-					for i=1:self.numberofelements,
-						el=self.elements(i,:);
-						contours(i).x=[self.long(el(1)) self.long(el(2)) self.long(el(3)) self.long(el(1))];
-						contours(i).y=[self.lat(el(1)) self.lat(el(2)) self.lat(el(3)) self.lat(el(1))];
-						contours(i).Id = i;
-						contours(i).Geometry = 'Polygon';
-					end
-				else
-					for i=1:length(index),
-						el=self.elements(index(i),:);
-						contours(i).x=[self.long(el(1)) self.long(el(2)) self.long(el(3)) self.long(el(1))];
-						contours(i).y=[self.lat(el(1)) self.lat(el(2)) self.lat(el(3)) self.lat(el(1))];
-						contours(i).id = index(i);
-						contours(i).Geometry = 'Polygon';
-					end
-				end
-			else
-				error(sprintf('mesh3dsurface ''export'' error message: geometry %s not supported yet (should be ''point'' or ''line'' or ''polygon'')',geometry));
-			end
-
-			%write file: 
-			if strcmpi(format,'shp'),
-				shpwrite(contours,filename);
-			elseif strcmpi(format,'exp'),
-				expwrite(contours,filename);
-			else
-				error(sprintf('mesh3dsurface ''export'' error message: file format %s not supported yet',format));
-			end
-
-			%write projection file: 
-			if ~isempty(proj),
-				proj2shpprj(filename,proj);
-			end
-
-			%write style file: 
-			applyqgisstyle(filename,'mesh');
-
-
-
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/mesh3dsurface.py
===================================================================
--- /issm/trunk/src/m/classes/mesh3dsurface.py	(revision 28275)
+++ 	(revision )
@@ -1,271 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from MatlabFuncs import *
-from model import *
-from WriteData import WriteData
-
-
-class mesh3dsurface(object):
-    """MESH3DSURFACE class definition
-
-    Usage:
-        mesh3dsurface = mesh3dsurface()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.x = np.nan
-        self.y = np.nan
-        self.z = np.nan
-        self.elements = np.nan
-        self.numberofelements = 0
-        self.numberofvertices = 0
-        self.numberofedges = 0
-
-        self.lat = np.nan
-        self.long = np.nan
-        self.r = np.nan
-
-        self.vertexonboundary = np.nan
-        self.edges = np.nan
-        self.segments = np.nan
-        self.segmentmarkers = np.nan
-        self.vertexconnectivity = np.nan
-        self.elementconnectivity = np.nan
-        self.average_vertex_connectivity = 0
-
-        self.extractedvertices = np.nan
-        self.extractedelements = np.nan
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            self = mesh3dsurface()
-            arg = args[1]
-            fields = fieldnames(arg)
-            for i in range(len(fields)):
-                field = fields[i]
-                if ismember(field, properties('mesh3dsurface')):
-                    self.field = arg.field
-        else:
-            raise RuntimeError('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   2D tria Mesh (surface):'
-
-        s += '\n      Elements and vertices:'
-        s = "%s\n%s" % (s, fielddisplay(self, 'numberofelements', 'number of elements'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'numberofvertices', 'number of vertices'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'elements', 'vertex indices of the mesh elements'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'x', 'vertices x coordinate [m]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'y', 'vertices y coordinate [m]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'z', 'vertices z coordinate [m]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'lat', 'vertices latitude [degrees]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'long', 'vertices longitude [degrees]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'r', 'vertices radius [m]'))
-
-        s = "%s\n%s" % (s, fielddisplay(self, 'edges', 'edges of the 2d mesh (vertex1 vertex2 element1 element2)'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'numberofedges', 'number of edges of the 2d mesh'))
-
-        s += '\n      Properties:'
-        s = "%s\n%s" % (s, fielddisplay(self, 'vertexonboundary', 'vertices on the boundary of the domain flag list'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'segments', 'edges on domain boundary (vertex1 vertex2 element)'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'segmentmarkers', 'number associated to each segment'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'vertexconnectivity', 'list of elements connected to vertex_i'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'elementconnectivity', 'list of elements adjacent to element_i'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'average_vertex_connectivity', 'average number of vertices connected to one vertex'))
-
-        s += '\n      Extracted model():'
-        s = "%s\n%s" % (s, fielddisplay(self, 'extractedvertices', 'vertices extracted from the model()'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'extractedelements', 'elements extracted from the model()'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #The connectivity is the average number of nodes linked to a given node 
-        #through an edge. This connectivity is used to initially allocate 
-        #memory to the stiffness matrix. A value of 16 seems to give a good 
-        #memory/time ratio. This value can be checked in 
-        #test/NightlyRun/runme.py.
-        self.average_vertex_connectivity = 25
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'mesh.x', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.y', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.z', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.lat', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.long', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.r', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'mesh.elements', 'NaN', 1, 'Inf', 1, '>', 0, 'values', np.arange(1, md.mesh.numberofvertices + 1))
-        md = checkfield(md, 'fieldname', 'mesh.elements', 'size', [md.mesh.numberofelements, 3])
-        if np.any(np.logical_not(np.in1d(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements.flat))):
-            md = md.checkmessage('orphan nodes have been found; check the mesh outline')
-
-        md = checkfield(md, 'fieldname', 'mesh.numberofelements', '>', 0)
-        md = checkfield(md, 'fieldname', 'mesh.numberofvertices', '>', 0)
-        md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 9, 'message', '"mesh.average_vertex_connectivity" should be at least 9 in 2d')
-
-        if solution == 'ThermalSolution':
-            md = md.checkmessage('thermal not supported for 2d mesh')
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', 'Domain' + self.domaintype(), 'format', 'String')
-        WriteData(fid, prefix, 'name', 'md.mesh.domain_dimension', 'data', self.dimension(), 'format', 'Integer')
-        WriteData(fid, prefix, 'name', 'md.mesh.elementtype', 'data', self.elementtype(), 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'x', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'y', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'z', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'lat', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'long', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'r', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'name', 'md.mesh.z', 'data', np.zeros(md.mesh.numberofvertices), 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'elements', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofelements', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofvertices', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'average_vertex_connectivity', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vertexonboundary', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
-
-    def domaintype(self):  # {{{
-        return '3Dsurface'
-    # }}}
-
-    def dimension(self):  # {{{
-        return 2
-    # }}}
-
-    def elementtype(self):  # {{{
-        return 'Tria'
-    # }}}
-
-    def processmesh(self, options):  # {{{
-        isplanet = 1
-        is2d = 0
-
-        elements = self.elements
-        x = self.x
-        y = self.y
-        z = self.z
-
-        return x, y, z, elements, is2d, isplanet
-    # }}}
-
-    def savemodeljs(self, fid, modelname):  # {{{
-        fid.write('  #s.mesh = new mesh3dsurface()\n' % modelname)
-        writejs1Darray(fid, [modelname, '.mesh.x'], self.x)
-        writejs1Darray(fid, [modelname, '.mesh.y'], self.y)
-        writejs1Darray(fid, [modelname, '.mesh.z'], self.z)
-        writejs2Darray(fid, [modelname, '.mesh.elements'], self.elements)
-        writejsdouble(fid, [modelname, '.mesh.numberofelements'], self.numberofelements)
-        writejsdouble(fid, [modelname, '.mesh.numberofvertices'], self.numberofvertices)
-        writejsdouble(fid, [modelname, '.mesh.numberofedges'], self.numberofedges)
-        writejs1Darray(fid, [modelname, '.mesh.lat'], self.lat)
-        writejs1Darray(fid, [modelname, '.mesh.long'], self.long)
-        writejs1Darray(fid, [modelname, '.mesh.r'], self.r)
-        writejs1Darray(fid, [modelname, '.mesh.vertexonboundary'], self.vertexonboundary)
-        writejs2Darray(fid, [modelname, '.mesh.edges'], self.edges)
-        writejs2Darray(fid, [modelname, '.mesh.segments'], self.segments)
-        writejs2Darray(fid, [modelname, '.mesh.segmentmarkers'], self.segmentmarkers)
-        writejs2Darray(fid, [modelname, '.mesh.vertexconnectivity'], self.vertexconnectivity)
-        writejs2Darray(fid, [modelname, '.mesh.elementconnectivity'], self.elementconnectivity)
-        writejsdouble(fid, [modelname, '.mesh.average_vertex_connectivity'], self.average_vertex_connectivity)
-        writejs1Darray(fid, [modelname, '.mesh.extractedvertices'], self.extractedvertices)
-        writejs1Darray(fid, [modelname, '.mesh.extractedelements'], self.extractedelements)
-    # }}}
-
-    def export(self, *args):  # {{{
-        options = pairoptions(*args)
-
-        filename    = options.getfieldvalue('filename')
-        format      = options.getfieldvalue('format', 'shp')
-        geometry    = options.getfieldvalue('geometry', 'line')
-        index       = options.getfieldvalue('index', [])
-        proj        = options.getfieldvalue('projection', '')
-
-        #prepare contours:
-        contours = []
-        if geometry == 'point':
-            for i in range(len(self.numberofvertices)):
-                contour             = OrderedStruct()
-                contour.x           = self.long[i]
-                contour.y           = self.lat[i]
-                contour.id          = i
-                contour.Geometry    = 'Point'
-                contours[i]         = contour
-        elif geometry == 'line':
-            count = 0
-            for i in range(len(self.numberofelements)): 
-                el = self.elements[i]
-
-                #first line:
-                contour             = OrderedStruct()
-                contour.x           = [self.long[el[0]], self.long[el[1]]]
-                contour.y           = [self.lat[el[0]], self.lat[el[1]]]
-                contour.Geometry    = 'Line' 
-                contours[count]     = contour
-
-                #second line:
-                contour             = OrderedStruct()
-                contour.x           = [self.long[el[1]], self.long[el[2]]]
-                contour.y           = [self.lat[el[1]], self.lat[el[2]]]
-                contour.Geometry    = 'Line'
-                contours[count + 1] = contour
-
-                #second line:
-                contour             = OrderedStruct()
-                contour.x           = [self.long[el[2]], self.long[el[0]]]
-                contour.y           = [self.lat[el[2]], self.lat[el[0]]]
-                contour.Geometry    = 'Line'
-                contours[count + 2] = contour
-
-                #increase count:
-                count += 3
-        elif geometry == 'polygon':
-            # TODO: Refactor the following to reduce repeated code, or 
-            #       leave as is because it is more readable?
-            if index == []:
-                for i in range(len(self.numberofelements)):
-                    el = self.elements[i]
-
-                    contour             = OrderedStruct()
-                    contour.x           = [self.long[el[0]], self.long[el[1]], self.long[el[2]]]
-                    contour.y           = [self.lat[el[0]], self.lat[el[1]], self.lat[el[2]]]
-                    contour.Id          = i
-                    contour.Geometry    = 'Polygon'
-                    contours[i]         = contour
-            else:
-                for i in range(len(index)):
-                    el = self.elements[index[i]]
-
-                    contour             = OrderedStruct()
-                    contour.x           = [self.long[el[0]], self.long[el[1]], self.long[el[2]]]
-                    contour.y           = [self.lat[el[0]], self.lat[el[1]], self.lat[el[2]]]
-                    contour.Id          = index[i]
-                    contour.Geometry    = 'Polygon'
-                    contours[i]         = contour
-        else:
-            raise RuntimeError("mesh3dsurface 'export' error message: geometry %s not supported yet (should be 'point' or 'line' or 'polygon')" % geometry)
-
-        #write file:
-        if format == 'shp':
-            shpwrite(contours, filename)
-        elif format == 'exp':
-            expwrite(contours, filename)
-        else:
-            raise RuntimeError("mesh3dsurface 'export' error message: file format %s not supported yet" % format)
-
-        #write projection file:
-        if proj != '':
-            proj2shpprj(filename, proj)
-
-        #write style file:
-        applyqgisstyle(filename, 'mesh')
-    # }}}
Index: sm/trunk/src/m/classes/mesh3dtetras.m
===================================================================
--- /issm/trunk/src/m/classes/mesh3dtetras.m	(revision 28275)
+++ 	(revision )
@@ -1,194 +1,0 @@
-%MESH3DTETRAS class definition
-%
-%   Usage:
-%      mesh=mesh3dtetras();
-
-classdef mesh3dtetras
-	properties (SetAccess=public) 
-		x                           = NaN;
-		y                           = NaN;
-		z                           = NaN;
-		elements                    = NaN;
-		numberoflayers              = 0;
-		numberofelements            = 0;
-		numberofvertices            = 0;
-
-		lat                         = NaN;
-		long                        = NaN;
-		epsg                        = 0;
-		proj                        = '';
-		scale_factor                = NaN;
-
-		vertexonbase                = NaN;
-		vertexonsurface             = NaN;
-		lowerelements               = NaN;
-		lowervertex                 = NaN;
-		upperelements               = NaN;
-		uppervertex                 = NaN;
-		vertexonboundary            = NaN;
-
-		vertexconnectivity          = NaN;
-		elementconnectivity         = NaN;
-		average_vertex_connectivity = 0;
-
-		x2d                         = NaN;
-		y2d                         = NaN;
-		elements2d                  = NaN;
-		numberofvertices2d          = 0;
-		numberofelements2d          = 0;
-
-		extractedvertices           = NaN;
-		extractedelements           = NaN;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model selfect is
-			% loaded. Update old properties here
-
-			%2014 Oct. 1st
-			if isstruct(self),
-				oldself=self;
-				%Assign property values from struct
-				self=structtoobj(mesh3dtetras(),oldself);
-				if isfield(oldself,'hemisphere'),
-					disp('md.mesh.hemisphere has been automatically converted to EPSG code');
-					if strcmpi(oldself.hemisphere,'n'),
-						self.epsg=3413;
-						self.proj=epsg2proj(3413);
-					else
-						self.epsg=3031;
-						self.proj=epsg2proj(3031);
-					end
-				end
-			end
-
-		end% }}}
-	end
-	methods
-		function self = mesh3dtetras(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('mesh3dtetras');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%the connectivity is the averaged number of nodes linked to a
-			%given node through an edge. This connectivity is used to initially
-			%allocate memory to the stiffness matrix. A value of 16 seems to
-			%give a good memory/time ration. This value can be checked in
-			%trunk/test/Miscellaneous/runme.m
-			self.average_vertex_connectivity=25;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			
-			if strcmpi(solution,'LoveSolution'), return; end
-
-			md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.z','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',1:md.mesh.numberofvertices);
-			md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements 4]);
-			if any(~ismember(1:md.mesh.numberofvertices,sort(unique(md.mesh.elements(:)))));
-				md = checkmessage(md,'orphan nodes have been found. Check the mesh outline');
-			end
-			md = checkfield(md,'fieldname','mesh.numberoflayers','>=',0);
-			md = checkfield(md,'fieldname','mesh.numberofelements','>',0);
-			md = checkfield(md,'fieldname','mesh.numberofvertices','>',0);
-			md = checkfield(md,'fieldname','mesh.vertexonbase','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			md = checkfield(md,'fieldname','mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]);
-			md = checkfield(md,'fieldname','mesh.z','>=',md.geometry.base-10^-10,'message','''mesh.z'' lower than bedrock');
-			md = checkfield(md,'fieldname','mesh.z','<=',md.geometry.surface+10^-10,'message','''mesh.z'' higher than surface elevation');
-			md = checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',24,'message','''mesh.average_vertex_connectivity'' should be at least 24 in 3d');
-			if numel(md.mesh.scale_factor)>1,
-				md = checkfield(md,'fieldname','mesh.scale_factor','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   3D tetra Mesh:')); 
-
-			disp(sprintf('\n      Elements and vertices of the original 2d mesh:'));
-			fielddisplay(self,'numberofelements2d','number of elements');
-			fielddisplay(self,'numberofvertices2d','number of vertices');
-			fielddisplay(self,'elements2d','vertex indices of the mesh elements');
-			fielddisplay(self,'x2d','vertices x coordinate [m]');
-			fielddisplay(self,'y2d','vertices y coordinate [m]');
-
-			disp(sprintf('\n      Elements and vertices of the extruded 3d mesh:'));
-			fielddisplay(self,'numberofelements','number of elements');
-			fielddisplay(self,'numberofvertices','number of vertices');
-			fielddisplay(self,'elements','vertex indices of the mesh elements');
-			fielddisplay(self,'x','vertices x coordinate [m]');
-			fielddisplay(self,'y','vertices y coordinate [m]');
-			fielddisplay(self,'z','vertices z coordinate [m]');
-
-			disp(sprintf('\n      Properties:'));
-			fielddisplay(self,'numberoflayers','number of extrusion layers');
-			fielddisplay(self,'vertexonbase','lower vertices flags list');
-			fielddisplay(self,'vertexonsurface','upper vertices flags list');
-			fielddisplay(self,'uppervertex','upper vertex list (NaN for vertex on the upper surface)');
-			fielddisplay(self,'upperelements','upper element list (NaN for element on the upper layer)');
-			fielddisplay(self,'lowervertex','lower vertex list (NaN for vertex on the lower surface)');
-			fielddisplay(self,'lowerelements','lower element list (NaN for element on the lower layer');
-			fielddisplay(self,'vertexonboundary','vertices on the boundary of the domain flag list');
-
-			fielddisplay(self,'vertexconnectivity','list of elements connected to vertex_i');
-			fielddisplay(self,'elementconnectivity','list of elements adjacent to element_i');
-			fielddisplay(self,'average_vertex_connectivity','average number of vertices connected to one vertex');
-
-			disp(sprintf('\n      Extracted model:'));
-			fielddisplay(self,'extractedvertices','vertices extracted from the model');
-			fielddisplay(self,'extractedelements','elements extracted from the model');
-
-			disp(sprintf('\n      Projection:'));
-			fielddisplay(self,'lat','vertices latitude [degrees]');
-			fielddisplay(self,'long','vertices longitude [degrees]');
-			fielddisplay(self,'epsg','EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)');
-			fielddisplay(self,'proj','PROJ.4 compatible projection string');
-			fielddisplay(self,'scale_factor','Projection correction for volume, area, etc. computation)');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.mesh.domain_type','data',['Domain' domaintype(self)],'format','String');
-			WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(self),'format','Integer');
-			WriteData(fid,prefix,'name','md.mesh.elementtype','data',elementtype(self),'format','String');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberoflayers','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','scale_factor','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices2d','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements2d','format','Integer');
-		end % }}}
-		function t = domaintype(self) % {{{
-			t = '3D';
-		end % }}}
-		function d = dimension(self) % {{{
-			d = 3;
-		end % }}}
-		function s = elementtype(self) % {{{
-			s = 'Tetra';
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/miscellaneous.js
===================================================================
--- /issm/trunk/src/m/classes/miscellaneous.js	(revision 28275)
+++ 	(revision )
@@ -1,39 +1,0 @@
-//MISCELLANEOUS class definition
-//
-//   Usage:
-//      miscellaneous=new miscellaneous();
-
-function miscellaneous (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   miscellaneous parameters:'));
-
-		fielddisplay(this,'notes','notes in a cell of strings');
-		fielddisplay(this,'name','model name');
-		fielddisplay(this,'dummy','empty field to store some data');
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "miscellaneous";
-	}// }}}
-		this.checkconsistency= function(md,solution,analyses) {// {{{
-
-			checkfield(md,'fieldname','miscellaneous.name','empty',1);
-		}// }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'fieldname','name','format','String');
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-	this.notes = '';
-	this.name  = '';
-	this.dummy = [];
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/miscellaneous.m
===================================================================
--- /issm/trunk/src/m/classes/miscellaneous.m	(revision 28275)
+++ 	(revision )
@@ -1,63 +1,0 @@
-%MISCELLANEOUS class definition
-%
-%   Usage:
-%      miscellaneous=miscellaneous();
-
-classdef miscellaneous
-	properties (SetAccess=public) 
-		notes = '';
-		name  = '';
-		dummy = struct();
-	end
-	methods
-		function self = miscellaneous(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','miscellaneous.name','empty',1);
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Add some information about the model for future reference
-			username = getenv('USER');
-			issmver = num2str(issmversion());
-			today   = date();
-			host    =  oshostname();
-			self.notes = [' Model created on ' today ' by ' username ' on ' host sprintf('\n') ...
-				' ISSM version: ' issmver sprintf('\n') ...
-				' (path: ' pwd() ')'];
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   miscellaneous parameters:'));
-
-			fielddisplay(self,'notes','notes in a cell of strings');
-			fielddisplay(self,'name','model name');
-			fielddisplay(self,'dummy','empty field to store some data');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','name','format','String');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejsstring(fid,[modelname '.miscellaneous.notes'],self.notes);
-			writejsstring(fid,[modelname '.miscellaneous.name'],self.name);
-			if strcmpi(class(self.dummy),'double'),
-				if size(self.dummy,2)==1,
-					writejs1Darray(fid,[modelname '.miscellaneous.dummy'],self.dummy);
-				else
-					writejs2Darray(fid,[modelname '.miscellaneous.dummy'],self.dummy);
-				end
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/miscellaneous.py
===================================================================
--- /issm/trunk/src/m/classes/miscellaneous.py	(revision 28275)
+++ 	(revision )
@@ -1,44 +1,0 @@
-from collections import OrderedDict
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class miscellaneous(object):
-    """
-    MISCELLANEOUS class definition
-
-       Usage:
-          miscellaneous = miscellaneous()
-    """
-
-    def __init__(self):  # {{{
-        self.notes = ''
-        self.name = ''
-        self.dummy = OrderedDict()
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-    def __repr__(self):  # {{{
-        string = '   miscellaneous parameters:'
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'notes', 'notes in a cell of strings'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'name', 'model name'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'dummy', 'empty field to store some data'))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'miscellaneous.name', 'empty', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #  {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'name', 'format', 'String')
-    # }}}
Index: sm/trunk/src/m/classes/misfit.m
===================================================================
--- /issm/trunk/src/m/classes/misfit.m	(revision 28275)
+++ 	(revision )
@@ -1,112 +1,0 @@
-%MISFIT class definition
-%
-%   Usage:
-%      misfit=misfit();
-%      misfit=misfit('name','SurfaceAltimetry',...
-%                    'definitionstring','Outputdefinition1',... 
-%							'model_string','Surface',...
-%                    'observation_string','SurfaceObservations',...
-%                    'observation',md.geometry.surface,...
-%                    'timeinterpolation','nearestneighbor',...
-%                    'local',1,...
-%                    'weights',ones(md.mesh.numberofvertices,1),...
-%                    'weights_string','WeightsSurfaceObservations');
-%
-%
-
-classdef misfit
-	properties (SetAccess=public)
-		%misfit
-		name               = '';
-		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		model_string       = ''; %string for field that is modeled
-		observation        = NaN; %observed field that we compare the model against
-		observation_string = ''; %string for observed field.
-		timeinterpolation  = '';
-		local              = 1;
-		weights            = NaN; %weight coefficients for every vertex
-		weights_string     = ''; %string to identify this particular set of weights
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.weights)
-				self.weights=project3d(md,'vector',self.weights,'type','node');
-			end
-			if ~isnan(self.observation)
-				self.observation=project3d(md,'vector',self.observation,'type','node');
-			end
-		end % }}}
-		function self = misfit(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.model_string=getfieldvalue(options,'model_string');
-				self.observation=getfieldvalue(options,'observation',NaN);
-				self.observation_string=getfieldvalue(options,'observation_string');
-				self.local=getfieldvalue(options,'local',1);
-				self.timeinterpolation=getfieldvalue(options,'timeinterpolation','nearestneighbor');
-				self.weights=getfieldvalue(options,'weights',NaN);
-				self.weights_string=getfieldvalue(options,'weights_string','');
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.local=1;
-			self.timeinterpolation='nearestneighbor';
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('misfit error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-
-			if ~ischar(self.timeinterpolation),
-				error('misfit error message: ''timeinterpolation'' field should be a string!');
-			end
-			md = checkfield(md,'fieldname','self.observation','field',self.observation,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','self.timeinterpolation','field',self.timeinterpolation,'values',{'nearestneighbor'});
-			md = checkfield(md,'fieldname','self.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   Misfit:\n'));
-
-			fielddisplay(self,'name','identifier for this misfit response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'model_string','string for field that is modeled');
-			fielddisplay(self,'observation','observed field that we compare the model against');
-			fielddisplay(self,'observation_string','observation string');
-			fielddisplay(self,'local','is the response local to the elements, or global? (default is 1)''');
-			fielddisplay(self,'timeinterpolation','interpolation routine used to interpolate misfit between two time steps (default is ''nearestneighbor''');
-			fielddisplay(self,'weights','weights (at vertices) to apply to the misfit');
-			fielddisplay(self,'weights_string','string for weights for identification purposes');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-		WriteData(fid,prefix,'data',self.name,'name','md.misfit.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.misfit.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.model_string,'name','md.misfit.model_string','format','String');
-		WriteData(fid,prefix,'data',self.observation,'name','md.misfit.observation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.observation_string,'name','md.misfit.observation_string','format','String');
-		WriteData(fid,prefix,'data',self.local,'name','md.misfit.local','format','Integer');
-		WriteData(fid,prefix,'data',self.timeinterpolation,'name','md.misfit.timeinterpolation','format','String');
-		WriteData(fid,prefix,'data',self.weights,'name','md.misfit.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'data',self.weights_string,'name','md.misfit.weights_string','format','String');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/misfit.py
===================================================================
--- /issm/trunk/src/m/classes/misfit.py	(revision 28275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-import numpy as np
-from project3d import project3d
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class misfit(object):
-    """
-    MISFIT class definition
-
-    Usage:
-        misfit = misfit()
-        misfit = misfit(name = 'SurfaceAltimetry',
-                    definitionstring = 'Outputdefinition1',
-            model_string = 'Surface',
-                    observation_string = 'SurfaceObservations',
-                     observation = md.geometry.surface,
-                        timeinterpolation = 'nearestneighbor',
-                        local = 1,
-                        weights = np.ones((md.mesh.numberofvertices, 1)),
-                        weights_string = 'WeightsSurfaceObservations')
-    """
-
-    def __init__(self, name=None, definitionstring=None, model_string=None, observation=None, observation_string=None, timeinterpolation=None, local=None, weights=None, weights_string=None, cumulated=None):  # {{{
-        self.name = name if name is not None else ''
-        #string that identifies this output definition uniquely, from 'Outputdefinition[1 - 100]'
-        self.definitionstring = definitionstring if definitionstring is not None else ''
-        #string for field that is modeled
-        self.model_string = model_string if model_string is not None else ''
-        #observed field that we compare the model against
-        self.observation = observation if observation is not None else float('NaN')
-        #string for observed field.
-        self.observation_string = observation_string if observation_string is not None else ''
-        self.timeinterpolation = timeinterpolation if timeinterpolation is not None else 'nearestneighbor'
-        self.local = local if local is not None else 1
-        #weight coefficients for every vertex
-        self.weights = weights if weights is not None else float('NaN')
-        #string to identify this particular set of weights
-        self.weights_string = weights_string if weights_string is not None else ''
-        #do we cumulate misfit through time?
-        self.cumulated = cumulated if cumulated is not None else float('NaN')
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = '   Misfit:'
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'name', 'identifier for this misfit response'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'definitionstring', 'string that identifies this output definition uniquely, from "Outputdefinition[1 - 10]"'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'model_string', 'string for field that is modeled'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'observation', 'observed field that we compare the model against'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'observation_string', 'observation string'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'local', 'is the response local to the elements, or global? (default is 1)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'timeinterpolation', 'interpolation routine used to interpolate misfit between two time steps (default is "nearestneighbor"'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'weights', 'weights (at vertices) to apply to the misfit'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'weights_string', 'string for weights for identification purposes'))
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        if not np.any(np.isnan(self.weights)):
-            self.weights = project3d(md, 'vector', self.weights, 'type', 'node')
-        if not np.any(np.isnan(self.observation)):
-            self.observation = project3d(md, 'vector', self.observation, 'type', 'node')
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if type(self.name) != str:
-            raise TypeError('misfit error message: "name" field should be a string!')
-
-        OutputdefinitionStringArray = []
-        for i in range(100):
-            OutputdefinitionStringArray.append('Outputdefinition' + str(i))
-
-        md = checkfield(md, 'fieldname', 'self.definitionstring', 'field', self.definitionstring, 'values', OutputdefinitionStringArray)
-        if type(self.timeinterpolation) != str:
-            raise TypeError('misfit error message: "timeinterpolation" field should be a string!')
-
-        md = checkfield(md, 'fieldname', 'self.observation', 'field', self.observation, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'self.timeinterpolation', 'field', self.timeinterpolation, 'values', ['nearestneighbor'])
-        md = checkfield(md, 'fieldname', 'self.weights', 'field', self.weights, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #  {{{
-        WriteData(fid, prefix, 'data', self.name, 'name', 'md.misfit.name', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.definitionstring, 'name', 'md.misfit.definitionstring', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.model_string, 'name', 'md.misfit.model_string', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.observation, 'name', 'md.misfit.observation', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'data', self.observation_string, 'name', 'md.misfit.observation_string', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.local, 'name', 'md.misfit.local', 'format', 'Integer')
-        WriteData(fid, prefix, 'data', self.timeinterpolation, 'name', 'md.misfit.timeinterpolation', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.weights, 'name', 'md.misfit.weights', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'data', self.weights_string, 'name', 'md.misfit.weights_string', 'format', 'String')
-    # }}}
Index: sm/trunk/src/m/classes/mismipbasalforcings.m
===================================================================
--- /issm/trunk/src/m/classes/mismipbasalforcings.m	(revision 28275)
+++ 	(revision )
@@ -1,95 +1,0 @@
-%MISMIP BASAL FORCINGS class definition
-%
-%   Usage:
-%      mismipbasalforcings=mismipbasalforcings();
-
-classdef mismipbasalforcings
-	properties (SetAccess=public) 
-		groundedice_melting_rate  = NaN;
-		meltrate_factor           = NaN;
-		threshold_thickness       = 0.;
-		upperdepth_melt           = 0.;
-		geothermalflux            = NaN;
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
-		end % }}}
-		function self = mismipbasalforcings(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(mismipbasalforcings(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.groundedice_melting_rate),
-				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default values for melting parameterization
-			self.meltrate_factor        = 0.2;
-			self.threshold_thickness    = 75;
-			self.upperdepth_melt        = -100;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.ismasstransport==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'universal',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'universal',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',1);
-			end
-			if ismember('ThermalAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isthermal==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'universal',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-			end
-			if isnan(md.geometry.bed),
-				md = checkmessage(md,['requesting mismip basal melting parameterization, but bathymetry is absent!']);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   MISMIP+ basal melt parameterization:'));
-
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'meltrate_factor','Melt-rate rate factor [1/yr] (sign is opposite to MISMIP+ benchmark to remain consistent with ISSM convention of positive values for melting)');
-			fielddisplay(self,'threshold_thickness','threshold thickness for saturation of basal melting [m]');
-			fielddisplay(self,'upperdepth_melt','depth above which the melt rate is zero [m]');
-			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-			if yts~=365.2422*24.*3600.
-				disp('WARNING: value of yts for MISMIP+ runs different from ISSM default!');
-			end
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',3,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','meltrate_factor','format','DoubleMat','mattype',1,'scale',1./yts)
-			WriteData(fid,prefix,'object',self,'fieldname','threshold_thickness','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','upperdepth_melt','format','Double')
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/mismipbasalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/mismipbasalforcings.py	(revision 28275)
+++ 	(revision )
@@ -1,84 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class mismipbasalforcings(object):
-    """MISMIP Basal Forcings class definition
-
-    Usage:
-        mismipbasalforcings = mismipbasalforcings()
-    """
-
-    def __init__(self):  # {{{
-        self.groundedice_melting_rate = np.nan
-        self.meltrate_factor          = np.nan
-        self.threshold_thickness      = 0.
-        self.upperdepth_melt          = 0.
-        self.geothermalflux           = np.nan
-        self.setdefaultparameters()
-    # }}}
-    def __repr__(self):  # {{{
-        s = '   MISMIP + basal melt parameterization\n'
-        s += '{}\n'.format(fielddisplay(self, "groundedice_melting_rate", "basal melting rate (positive if melting) [m / yr]"))
-        s += '{}\n'.format(fielddisplay(self, "meltrate_factor", "Melt - rate rate factor [1 / yr] (sign is opposite to MISMIP + benchmark to remain consistent with ISSM convention of positive values for melting)"))
-        s += '{}\n'.format(fielddisplay(self, "threshold_thickness", "Threshold thickness for saturation of basal melting [m]"))
-        s += '{}\n'.format(fielddisplay(self, "upperdepth_melt", "Depth above which melt rate is zero [m]"))
-        s += '{}\n'.format(fielddisplay(self, "geothermalflux", "Geothermal heat flux [W / m^2]"))
-        return s
-    # }}}
-    def extrude(self, md):  # {{{
-        self.groundedice_melting_rate = project3d(md, 'vector', self.groundedice_melting_rate, 'type', 'node', 'layer', 1)
-        self.geothermalflux = project3d(md, 'vector', self.geothermalflux, 'type', 'node', 'layer', 1)  #bedrock only gets geothermal flux
-        return self
-    # }}}
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.groundedice_melting_rate)):
-            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
-            print('no basalforcings.groundedice_melting_rate specified: values set as zero')
-        if np.all(np.isnan(self.geothermalflux)):
-            self.geothermalflux = np.zeros((md.mesh.numberofvertices))
-            print("      no basalforcings.geothermalflux specified: values set as zero")
-        return self
-    # }}}
-    def setdefaultparameters(self):  # {{{
-        # default values for melting parameterization
-        self.meltrate_factor = 0.2
-        self.threshold_thickness = 75.
-        self.upperdepth_melt = -100.
-        return self
-    # }}}
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.meltrate_factor', '>=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'basalforcings.threshold_thickness', '>=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'basalforcings.upperdepth_melt', '<=', 0, 'numel', [1])
-        if 'BalancethicknessAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'basalforcings.meltrate_factor', '>=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'basalforcings.threshold_thickness', '>=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'basalforcings.upperdepth_melt', '<=', 0, 'numel', [1])
-        if 'ThermalAnalysis' in analyses and not (solution == 'TransientSolution' and not md.transient.isthermal):
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.meltrate_factor', '>=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'basalforcings.threshold_thickness', '>=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'basalforcings.upperdepth_melt', '<=', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'basalforcings.geothermalflux', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        if yts != 365.2422 * 24. * 3600.:
-            print('WARNING: value of yts for MISMIP + runs different from ISSM default!')
-        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 3, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.groundedice_melting_rate', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'name', 'md.basalforcings.geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'meltrate_factor', 'format', 'Double', 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'threshold_thickness', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperdepth_melt', 'format', 'Double')
-    # }}}
Index: sm/trunk/src/m/classes/mmeadditionalsolidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 28275)
+++ 	(revision )
@@ -1,104 +1,0 @@
-%MMEADDITIONALSOLIDEARTHSOLUTION class definition
-%
-%   Usage:
-%      addsol=mmeadditionalsolidearthsolution(); where the additional solid earth solutions %                               are based on a multi-model ensemble (ex: Caron et al 2017 statistics) 
-
-classdef mmeadditionalsolidearthsolution < additionalsolidearthsolution 
-	properties (SetAccess=public) 
-		modelid; %index into the multi-model ensemble, each ensemble variable being defined 
-	         %in the father class.
-	end
-	methods
-		function self = mmeadditionalsolidearthsolution(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.setdefaultparameters@additionalsolidearthsolution();
-			self.modelid=0;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
-				error('mmeadditionalsolidearthsolution checkconsistency error message: need to run GRD solution if you are supplying a GRD additional pattern solution');
-			end
-
-			seast=length(self.displacementeast);
-			snorth=length(self.displacementnorth);
-			sup=length(self.displacementup);
-			sgeoid=length(self.geoid);
-
-			if (seast-snorth)~=0,
-				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and displacementnorth should be the same size');
-			end
-
-			if (seast-sup)~=0,
-				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and displacementup should be the same size');
-			end
-
-			if (seast-sgeoid)~=0,
-				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and geoid should be the same size');
-			end
-			
-			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.displacementeast));
-
-			for i=1:seast,
-				md = checkfield(md,'field',self.displacementeast{i},'NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'field',self.displacementup{i},'NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'field',self.displacementnorth{i},'NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'field',self.geoid{i},'NaN',1,'Inf',1,'timeseries',1);
-			end
-
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   external: mmeadditionalsolidearth solution:'));
-			self.disp@solidearthsolution();
-			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'data',3,'name','md.solidearth.external.nature','format','Integer'); %code 3 for mmeadditionalsolidearthsolution class
-
-			nummodels=length(self.displacementeast);
-			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',nummodels,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
-
-			%transform our cell array of time series into cell array of time series of rates 
-			for i=1:nummodels,
-				displacementeast=self.displacementeast{i}; 
-				displacementnorth=self.displacementnorth{i}; 
-				displacementup=self.displacementup{i}; 
-				geoid=self.geoid{i}; 
-
-				time=displacementeast(end,:);
-				dt=diff(time,1,2);
-				
-				displacementeast_rate=diff(displacementeast(1:end-1,:),1,2)./dt;
-				displacementnorth_rate=diff(displacementnorth(1:end-1,:),1,2)./dt;
-				displacementup_rate=diff(displacementup(1:end-1,:),1,2)./dt;
-				geoid_rate=diff(geoid(1:end-1,:),1,2)./dt;
-
-				self.displacementeast{i}=displacementeast_rate; 
-				self.displacementnorth{i}=displacementnorth_rate; 
-				self.displacementup{i}=displacementup_rate; 
-				self.geoid{i}=geoid_rate; 
-			end
-			
-			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
-			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
-			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
-			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
-
-		end % }}}
-
-		function savemodeljs(self,fid,modelname) % {{{
-			error('mmeadditionalsolidearthsolution error message: not implemented yet');
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/mmeofflinesolidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/mmeofflinesolidearthsolution.m	(revision 28275)
+++ 	(revision )
@@ -1,103 +1,0 @@
-%MMEOFFLINESOLIDEARTHSOLUTION class definition
-%
-%   Usage:
-%      addsol=mmeofflinesolidearthsolution(); where the offline solid earth solutions %                               are based on a multi-model ensemble (ex: Caron et al 2017 statistics) 
-
-classdef mmeofflinesolidearthsolution < offlinesolidearthsolution 
-	properties (SetAccess=public) 
-		modelid; %index into the multi-model ensemble, each ensemble variable being defined 
-	         %in the father class.
-	end
-	methods
-		function self = mmeofflinesolidearthsolution(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.setdefaultparameters@offlinesolidearthsolution();
-			self.modelid=0;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
-				error('mmeofflinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
-			end
-			
-			seast=length(self.displacementeast);
-			snorth=length(self.displacementnorth);
-			sup=length(self.displacementup);
-			sgeoid=length(self.geoid);
-
-			if (seast-snorth)~=0,
-				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and displacementnorth should be the same size');
-			end
-
-			if (seast-sup)~=0,
-				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and displacementup should be the same size');
-			end
-
-			if (seast-sgeoid)~=0,
-				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and geoid should be the same size');
-			end
-			
-			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.displacementeast));
-
-			for i=1:seast,
-				md = checkfield(md,'field',self.displacementeast{i},'NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'field',self.displacementup{i},'NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'field',self.displacementnorth{i},'NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'field',self.geoid{i},'NaN',1,'Inf',1,'timeseries',1);
-			end
-
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   external: mmeofflinesolidearth solution:'));
-			self.disp@solidearthsolution();
-			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'data',4,'name','md.solidearth.external.nature','format','Integer'); %code 4 for mmeofflinesolidearthsolution class
-			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
-			nummodels=length(self.displacementeast);
-			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',nummodels,'format','Integer');
-
-			%transform our cell array of time series into cell array of time series of rates 
-			for i=1:nummodels,
-				displacementeast=self.displacementeast{i}; 
-				displacementnorth=self.displacementnorth{i}; 
-				displacementup=self.displacementup{i}; 
-				geoid=self.geoid{i}; 
-
-				time=displacementeast(end,:);
-				dt=diff(time,1,2);
-				
-				displacementeast_rate=diff(displacementeast(1:end-1,:),1,2)./dt;
-				displacementnorth_rate=diff(displacementnorth(1:end-1,:),1,2)./dt;
-				displacementup_rate=diff(displacementup(1:end-1,:),1,2)./dt;
-				geoid_rate=diff(geoid(1:end-1,:),1,2)./dt;
-				barystaticsealevel_rate=diff(barystaticsealevel(1:end-1,:),1,2)./dt;
-
-				self.displacementeast{i}=displacementeast_rate; 
-				self.displacementnorth{i}=displacementnorth_rate; 
-				self.displacementup{i}=displacementup_rate; 
-				self.geoid{i}=geoid_rate; 
-			end
-			
-			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
-			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
-			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
-			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			error('mmeofflinesolidearthsolution error message: not implemented yet');
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/model.js
===================================================================
--- /issm/trunk/src/m/classes/model.js	(revision 28275)
+++ 	(revision )
@@ -1,785 +1,0 @@
-/**
- * MODEL class definition
- *
- * Usage:
- *     md = new model();
- *
- * TODO:
- * - Convert to ES6 class
- */
-function model(planet) {
-	//methods
-	this.disp = function() { //{{{
-		console.log(sprintf("class model echo: "));
-		console.log(sprintf("//19s: //-22s -- //s","mesh"            ,"[1x1 " + typeof(this.mesh) + "]","mesh properties"));
-		console.log(sprintf("//19s: //-22s -- //s","mask"            ,"[1x1 " + typeof(this.mask) + "]","defines grounded and floating elements"));
-		console.log(sprintf("//19s: //-22s -- //s","geometry"        ,"[1x1 " + typeof(this.geometry) + "]","surface elevation, bedrock topography, ice thickness,..."));
-		console.log(sprintf("//19s: //-22s -- //s","constants"       ,"[1x1 " + typeof(this.constants) + "]","physical constants"));
-		console.log(sprintf("//19s: //-22s -- //s","smb"             ,"[1x1 " + typeof(this.smb) + "]","surface mass balance"));
-		console.log(sprintf("//19s: //-22s -- //s","basalforcings"   ,"[1x1 " + typeof(this.basalforcings) + "]","bed forcings"));
-		console.log(sprintf("//19s: //-22s -- //s","materials"       ,"[1x1 " + typeof(this.materials) + "]","material properties"));
-		console.log(sprintf("//19s: //-22s -- //s","damage"          ,"[1x1 " + typeof(this.damage) + "]","parameters for damage evolution solution"));
-		console.log(sprintf("//19s: //-22s -- //s","friction"        ,"[1x1 " + typeof(this.friction) + "]","basal friction/drag properties"));
-		console.log(sprintf("//19s: //-22s -- //s","flowequation"    ,"[1x1 " + typeof(this.flowequation) + "]","flow equations"));
-		console.log(sprintf("//19s: //-22s -- //s","timestepping"    ,"[1x1 " + typeof(this.timestepping) + "]","time stepping for trans models"));
-		console.log(sprintf("//19s: //-22s -- //s","initialization"  ,"[1x1 " + typeof(this.initialization) + "]","initial guess/state"));
-		console.log(sprintf("//19s: //-22s -- //s","rifts"           ,"[1x1 " + typeof(this.rifts) + "]","rifts properties"));
-		console.log(sprintf("//19s: //-22s -- //s","solidearth"      ,"[1x1 " + typeof(this.solidearth) + "]","solidearth inputs and settings"));
-		console.log(sprintf("//19s: //-22s -- //s","slr"             ,"[1x1 " + typeof(this.slr) + "]","slr forcings"));
-		console.log(sprintf("//19s: //-22s -- //s","dsl"             ,"[1x1 " + typeof(this.dsl) + "]","dynamic sea level"));
-		console.log(sprintf("//19s: //-22s -- //s","debug"           ,"[1x1 " + typeof(this.debug) + "]","debugging tools (valgrind, gprof)"));
-		console.log(sprintf("//19s: //-22s -- //s","verbose"         ,"[1x1 " + typeof(this.verbose) + "]","verbosity level in solve"));
-		console.log(sprintf("//19s: //-22s -- //s","settings"        ,"[1x1 " + typeof(this.settings) + "]","settings properties"));
-		console.log(sprintf("//19s: //-22s -- //s","toolkits"        ,"[1x1 " + typeof(this.toolkits) + "]","PETSc options for each solution"));
-		console.log(sprintf("//19s: //-22s -- //s","cluster"         ,"[1x1 " + typeof(this.cluster) + "]","cluster parameters (number of CPUs...)"));
-		console.log(sprintf("//19s: //-22s -- //s","balancethickness","[1x1 " + typeof(this.balancethickness) + "]","parameters for balancethickness solution"));
-		console.log(sprintf("//19s: //-22s -- //s","stressbalance"   ,"[1x1 " + typeof(this.stressbalance) + "]","parameters for stressbalance solution"));
-		console.log(sprintf("//19s: //-22s -- //s","groundingline"   ,"[1x1 " + typeof(this.groundingline) + "]","parameters for groundingline solution"));
-		console.log(sprintf("//19s: //-22s -- //s","hydrology"       ,"[1x1 " + typeof(this.hydrology) + "]","parameters for hydrology solution"));
-		console.log(sprintf("//19s: //-22s -- //s","masstransport"   ,"[1x1 " + typeof(this.masstransport) + "]","parameters for masstransport solution"));
-		console.log(sprintf("//19s: //-22s -- //s","thermal"         ,"[1x1 " + typeof(this.thermal) + "]","parameters for thermal solution"));
-		console.log(sprintf("//19s: //-22s -- //s","steadystate"     ,"[1x1 " + typeof(this.steadystate) + "]","parameters for steadystate solution"));
-		console.log(sprintf("//19s: //-22s -- //s","transient"       ,"[1x1 " + typeof(this.transient) + "]","parameters for transient solution"));
-		console.log(sprintf("//19s: //-22s -- //s","levelset"        ,"[1x1 " + typeof(this.levelset) + "]","parameters for moving boundaries (level-set method)"));
-		console.log(sprintf("//19s: //-22s -- //s","calving"         ,"[1x1 " + typeof(this.calving) + "]","parameters for calving"));
-		console.log(sprintf("//19s: //-22s -- //s","gia"             ,"[1x1 " + typeof(this.gia) + "]","parameters for gia solution"));
-		console.log(sprintf("//19s: //-22s -- //s","love"            ,"[1x1 " + typeof(this.love) + "]","parameters for love solution"));
-		console.log(sprintf("//19s: //-22s -- //s","esa"             ,"[1x1 " + typeof(this.esa) + "]","parameters for elastic adjustment solution"));
-		console.log(sprintf("//19s: //-22s -- //s","sampling"        ,"[1x1 " + typeof(this.sampling) + "]","parameters for stochastic sampler"));
-		console.log(sprintf("//19s: //-22s -- //s","autodiff"        ,"[1x1 " + typeof(this.autodiff) + "]","automatic differentiation parameters"));
-		console.log(sprintf("//19s: //-22s -- //s","inversion"       ,"[1x1 " + typeof(this.inversion) + "]","parameters for inverse methods"));
-		console.log(sprintf("//19s: //-22s -- //s","qmu"             ,"[1x1 " + typeof(this.qmu) + "]","Dakota properties"));
-		console.log(sprintf("//19s: //-22s -- //s","amr"             ,"[1x1 " + typeof(this.amr) + "]","adaptive mesh refinement properties"));
-		console.log(sprintf("//19s: //-22s -- //s","outputdefinition","[1x1 " + typeof(this.outputdefinition) + "]","output definition"));
-		console.log(sprintf("//19s: //-22s -- //s","results"         ,"[1x1 " + typeof(this.results) + "]","model results"));
-		console.log(sprintf("//19s: //-22s -- //s","radaroverlay"    ,"[1x1 " + typeof(this.radaroverlay) + "]","radar image for plot overlay"));
-		console.log(sprintf("//19s: //-22s -- //s","miscellaneous"   ,"[1x1 " + typeof(this.miscellaneous) + "]","miscellaneous fields"));
-	} //}}}
-	this.setdefaultparameters = function(planet) { // {{{
-		this.mesh             = new mesh2d();
-		this.mask             = new mask();
-
-		this.geometry         = new geometry();
-		this.constants        = new constants();
-		this.smb              = new SMBforcing();
-		this.basalforcings    = new basalforcings();
-		this.materials        = new matice();
-		this.damage           = new damage();
-		this.friction         = new friction();
-		this.flowequation     = new flowequation();
-		this.timestepping     = new timestepping();
-		this.initialization   = new initialization();
-		this.rifts            = new rifts();
-		this.dsl              = new dsl();
-		this.solidearth       = new solidearth(planet);
-
-		this.debug            = new debug();
-		this.verbose          = new verbose();
-		this.settings         = new issmsettings();
-		this.toolkits         = new toolkits();
-		this.cluster          = new local();
-
-		this.balancethickness = new balancethickness();
-		this.stressbalance    = new stressbalance();
-		this.groundingline    = new groundingline();
-		this.hydrology        = new hydrologyshreve();
-		this.masstransport    = new masstransport();
-		this.thermal          = new thermal();
-		this.steadystate      = new steadystate();
-		this.transient        = new transient();
-		this.levelset         = new levelset();
-		this.calving          = new calving();
-		this.frontalforcings  = new frontalforcings();
-		this.love             = new fourierlove();
-		this.esa              = new esa();
-		this.sampling         = new sampling();
-
-		this.autodiff         = new autodiff();
-		this.inversion        = new inversion();
-		this.qmu              = new qmu();
-		this.amr              = new amr();
-		this.results          = {};
-		this.outputdefinition = new outputdefinition();
-		this.radaroverlay     = new radaroverlay();
-		this.miscellaneous    = new miscellaneous();
-		this.priv             = new priv();
-	} //}}}
-	this.checkmessage = function(string){ //{{{
-		console.log('model not consistent: ' + string);
-		this.priv.isconsistent=false;
-	} //}}}
-	this.fix = function(){ //{{{
-
-		for (var field in this){
-
-			//Some properties do not need to be fixed
-			if (field == 'results' | field =='radaroverlay' | field == 'toolkits' | field =='cluster' | field == 'priv') continue;
-
-			//Check that current field is a class
-			if(typeof this[field] == 'function'){
-				continue;
-			}
-
-			//Fix current object
-			this[field].fix(this);
-		}
-
-	} //}}}
-	this.extrude = function(md) { //{{{
-		//EXTRUDE - vertically extrude a 2d mesh
-		//
-		//   vertically extrude a 2d mesh and create corresponding 3d mesh.
-		//   The vertical distribution can:
-		//    - follow a polynomial law
-		//    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
-		//    - be described by a list of coefficients (between 0 and 1)
-		//   
-		//
-		//   Usage:
-		//      md=extrude(md,numlayers,extrusionexponent);
-		//      md=extrude(md,numlayers,lowerexponent,upperexponent);
-		//      md=extrude(md,listofcoefficients);
-		//
-		//   Example:
-		//      md=extrude(md,15,1.3);
-		//      md=extrude(md,15,1.3,1.2);
-		//      md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]);
-		//
-		//   See also: MODELEXTRACT, COLLAPSE
-
-		//some checks on list of arguments
-		var argc = arguments.length;
-		var extrusionlist;
-		var numlayers;
-		
-		if ((argc > 4) | (argc < 2)) {
-			error("extrude error message");
-		}
-
-		//Extrude the mesh
-		if (argc==2) { //list of coefficients
-			clist=arguments[0];
-			if (ArrayAnyBelowStrict(clist,0) || ArrayAnyAboveStrict(clist,1)) {
-				error('extrusioncoefficients must be between 0 and 1');
-			}
-			extrusionlist=ArraySort(ArrayUnique(clist.push(0,1)));
-			numlayers=extrusionlist.length;
-		} else if (argc==3) { //one polynomial law
-			if (arguments[1]<=0) {
-				error('extrusionexponent must be >=0');
-			}
-			numlayers=arguments[1];
-			extrusionlist = [];
-			for (var i = 0; i < numlayers; i++) {
-				extrusionlist.push(Math.pow(i/(numlayers-1), arguments[2]));
-			}
-		} else if (argc==4) { //two polynomial laws
-			numlayers=arguments[1];
-			var lowerexp=arguments[2];
-			var upperexp=arguments[3];
-
-			if (arguments[2]<=0 || arguments[3]<=0) {
-				error('lower and upper extrusionexponents must be >=0');
-			}
-
-			var lowerextrusionlist = [];
-			for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
-				lowerextrusionlist.push(Math.pow(i, lowerexp)/2)
-			}
-			var upperextrusionlist = [];
-			for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
-				upperextrusionlist.push(1-Math.pow(i, upperexp)/2)
-			}
-			extrusionlist=ArrayConcat(lowerextrusionlist,upperextrusionlist);
-			extrusionlist=ArraySort(ArrayUnique(extrusionlist.push(1)));
-		}
-
-		if (numlayers<2) {
-			console.error('number of layers should be at least 2');
-		}
-		if (md.mesh.domaintype() === '3D') {
-			console.error('Cannot extrude a 3d mesh (extrude cannot be called more than once)');
-		}
-
-		//Initialize with the 2d mesh
-		var mesh2d = md.mesh;
-		md.mesh=new mesh3dprisms();
-		md.mesh.x                           = mesh2d.x;
-		md.mesh.y                           = mesh2d.y;
-		md.mesh.elements                    = mesh2d.elements;
-		md.mesh.numberofelements            = mesh2d.numberofelements;
-		md.mesh.numberofvertices            = mesh2d.numberofvertices;
-
-		md.mesh.lat                         = mesh2d.lat;
-		md.mesh.long                        = mesh2d.long;
-		md.mesh.epsg                        = mesh2d.epsg;
-		md.mesh.scale_factor                = mesh2d.scale_factor;
-
-		md.mesh.vertexonboundary            = mesh2d.vertexonboundary;
-		md.mesh.vertexconnectivity          = mesh2d.vertexconnectivity;
-		md.mesh.elementconnectivity         = mesh2d.elementconnectivity;
-		md.mesh.average_vertex_connectivity = mesh2d.average_vertex_connectivity;
-
-		md.mesh.extractedvertices           = mesh2d.extractedvertices;
-		md.mesh.extractedelements           = mesh2d.extractedelements;
-
-		var x3d=new Float64Array(); 
-		var y3d=new Float64Array();
-		var z3d=new Float64Array();  //the lower node is on the bed
-		var thickness3d=md.geometry.thickness; //thickness and bed for these nodes
-		var bed3d=md.geometry.base;
-
-		//Create the new layers
-		//Dimensions of x/y/z3d: md.mesh.numberofvertices * numlayers, 1
-		for (var i = 1; i <= numlayers; i++) {
-			x3d=ArrayConcat(x3d, md.mesh.x); 
-			y3d=ArrayConcat(y3d, md.mesh.y); 
-			//nodes are distributed between bed and surface accordingly to the given exponent
-			z3d=ArrayConcat(z3d, FloatFix(thickness3d.map(function(value,index) { return bed3d[index] + value * extrusionlist[i-1]; }), thickness3d.length)); 
-		}
-		var number_nodes3d=x3d.length; //number of 3d nodes for the non extruded part of the mesh
-
-		//Extrude elements 
-		//Create the elements of the 3d mesh for the non extruded part
-		//Dimensions of elements3d: md.mesh.numberofelements * (numlayers - 1), 6
-		var elements3d=[];
-		var elements_prisms=[];
-		for (var i = 1; i < numlayers; i++) {
-			for (var j = 0; j < md.mesh.numberofelements; j++) {
-				elements_prisms = [];
-				for (var k = 0, offset = (i - 1) * md.mesh.numberofvertices; k < 3; k++) {
-					elements_prisms.push(md.mesh.elements[j][k]+offset);
-				}
-				for (var k = 0, offset = i * md.mesh.numberofvertices; k < 3; k++) {
-					elements_prisms.push(md.mesh.elements[j][k]+offset);
-				}
-				elements3d.push(elements_prisms);
-			}				
-		}
-		number_el3d=elements3d.length; //number of 3d nodes for the non extruded part of the mesh
-
-		//Keep a trace of lower and upper nodes
-		var lowervertex = NewArrayFill(number_nodes3d, NaN);
-		var uppervertex = NewArrayFill(number_nodes3d, NaN);
-		//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofvertices+1)
-		for (var i = md.mesh.numberofvertices, k = 1; i < lowervertex.length; i++, k++) {
-			lowervertex[i] = k;
-		};
-		//Set last layer to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
-		for (var i = 0, k = md.mesh.numberofvertices+1; i < (numlayers-1)*md.mesh.numberofvertices; i++, k++) {
-			uppervertex[i] = k;
-		};
-		md.mesh.lowervertex=lowervertex;
-		md.mesh.uppervertex=uppervertex;
-
-		//same for lower and upper elements
-		var lowerelements = NewArrayFill(number_el3d, NaN);
-		var upperelements = NewArrayFill(number_el3d, NaN);
-		//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofelements+1)
-		for (var i = md.mesh.numberofelements, k = 1; i < lowerelements.length; i++, k++) {
-			lowerelements[i] = k;
-		};
-		//Set last 2 layers to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
-		for (var i = 0, k = md.mesh.numberofelements + 1; i < (numlayers-2)*md.mesh.numberofelements; i++, k++) {
-			upperelements[i] = k;
-		};
-		md.mesh.lowerelements=lowerelements;
-		md.mesh.upperelements=upperelements;
-
-		//Save old mesh 
-		md.mesh.x2d=md.mesh.x;
-		md.mesh.y2d=md.mesh.y;
-		md.mesh.elements2d=md.mesh.elements;
-		md.mesh.numberofelements2d=md.mesh.numberofelements;
-		md.mesh.numberofvertices2d=md.mesh.numberofvertices;
-
-		//Build global 3d mesh 
-		md.mesh.elements=elements3d;
-		md.mesh.x=x3d;
-		md.mesh.y=y3d;
-		md.mesh.z=z3d;
-		md.mesh.numberofelements=number_el3d;
-		md.mesh.numberofvertices=number_nodes3d;
-		md.mesh.numberoflayers=numlayers;
-
-		//Ok, now deal with the other fields from the 2d mesh:
-
-		//bedinfo and surface info
-		md.mesh.vertexonbase=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',1);
-		md.mesh.vertexonsurface=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',md.mesh.numberoflayers);
-		md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node');
-
-		//lat long
-		md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node');
-		md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node');
-		md.mesh.scale_factor=project3d(md,'vector',md.mesh.scale_factor,'type','node');
-
-		md.geometry=md.geometry.extrude(md);
-		md.friction=md.friction.extrude(md);
-		md.inversion=md.inversion.extrude(md);
-		md.smb=md.smb.extrude(md);
-		md.initialization=md.initialization.extrude(md);
-
-		md.flowequation=md.flowequation.extrude(md);
-		md.stressbalance=md.stressbalance.extrude(md);
-		md.thermal=md.thermal.extrude(md);
-		md.masstransport=md.masstransport.extrude(md);
-		md.levelset=md.levelset.extrude(md);
-		md.calving=md.calving.extrude(md);
-		md.hydrology = md.hydrology.extrude(md);
-		md.solidearth = md.solidearth.extrude(md);
-
-		//connectivity
-		if (!ArrayAnyNaN(md.mesh.elementconnectivity)) {
-			//md.mesh.elementconnectivity=repmat(md.mesh.elementconnectivity,numlayers-1,1); //Replicate the matrix across numlayers-1 
-			var temparr = [];
-			for (var i = 0; i < numlayers - 1; i++) {
-				temparr = ArrayConcat(temparr, md.mesh.elementconnectivity);
-			}
-			md.mesh.elementconnectivity = temparr;
-	
-			//md.mesh.elementconnectivity(find(md.mesh.elementconnectivity==0))=NaN;
-			var indices = ArrayFind(md.mesh.elementconnectivity, 0);
-			for (var i = 0; i < indices.length; i++) {
-				md.mesh.elementconnectivity[i] = NaN;
-			};
-	
-			for (var i = 2; i < numlayers; i++) {
-				//md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)...
-				//=md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)+md.mesh.numberofelements2d;
-				for (var j = (i-1)*md.mesh.numberofelements2d; j <= (i)*md.mesh.numberofelements2d-1; j++) {
-					for (var k = 0; k < 3; k++) {
-						md.mesh.elementconnectivity[j][k] += md.mesh.numberofelements2d;
-					}
-				}
-			}
-			md.mesh.elementconnectivity = md.mesh.elementconnectivity.map(function(value) { return (Number.isNaN(value)) ? 0 : value; });
-		}
-
-		md.materials=md.materials.extrude(md);
-		md.damage=md.damage.extrude(md);
-		md.mask=md.mask.extrude(md);
-		md.qmu=md.qmu.extrude(md);
-		md.basalforcings=md.basalforcings.extrude(md);
-
-		//increase connectivity if less than 25:
-		if (md.mesh.average_vertex_connectivity<=25) {
-			md.mesh.average_vertex_connectivity=100;
-		}
-	} //}}}
-	this.extract = function(md,area) { //{{{
-		//extract - extract a model according to an Argus contour or flag list
-		//
-		//   This routine extracts a submodel from a bigger model with respect to a given contour
-		//   md must be followed by the corresponding exp file or flags list
-		//   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
-		//   If user wants every element outside the domain to be 
-		//   extract2d, add '~' to the name of the domain file (ex: '~HO.exp');
-		//   an empty string '' will be considered as an empty domain
-		//   a string 'all' will be considered as the entire domain
-		//
-		//   Usage:
-		//      md2=extract(md,area);
-		//
-		//   Examples:
-		//      md2=extract(md,'Domain.exp');
-		//
-		//   See also: EXTRUDE, COLLAPSE
-
-		//some checks on list of arguments
-		var argc = arguments.length;
-
-		if (!((argc == 2) | (argc == 1))) {
-			error('extract error message: bad usage');
-		}
-		
-		//get elements that are inside area
-		flag_elem=FlagElements(this,area);
-
-		if (!ArrayAnyEqual(flag_elem,1)) {
-			error('extracted model is empty!');
-		}
-
-		/*kick out all elements with 3 dirichlets: actually, not so fast, not good for javscript usually.
-		spc_elem=find(~flag_elem);
-		spc_node=sort(unique(md1.mesh.elements(spc_elem,:)));
-		flag=ones(md1.mesh.numberofvertices,1);
-		flag(spc_node)=0;
-		pos=find(sum(flag(md1.mesh.elements),2)==0);
-		flag_elem(pos)=0;*/
-
-		//extracted elements and nodes lists
-		var pos_elem = ArrayFind(flag_elem,1);
-		var dup_nodes= new Array(pos_elem.length*3);
-		for(var i=0;i<pos_elem.length;i++){
-			dup_nodes[3*i]=md.mesh.elements[pos_elem[i]][0]-1;
-			dup_nodes[3*i+1]=md.mesh.elements[pos_elem[i]][1]-1;
-			dup_nodes[3*i+2]=md.mesh.elements[pos_elem[i]][2]-1;
-		}
-		pos_node=ArrayUnique(dup_nodes); pos_node=ArraySort(pos_node);
-
-		//keep track of some fields
-		var numberofvertices1=md.mesh.numberofvertices;
-		var numberofelements1=md.mesh.numberofelements;
-		var numberofvertices2=pos_node.length;
-		var numberofelements2=pos_elem.length;
-		var flag_node=NewArrayFill(numberofvertices1,0);
-		for (var i=0;i<pos_node.length;i++)flag_node[pos_node[i]]=1;
-
-		//Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
-		Pelem=NewArrayFill(numberofelements1,0);
-		for (var i=0;i<numberofelements2;i++) Pelem[pos_elem[i]]=i;
-		Pnode=NewArrayFill(numberofvertices1,0);
-		for (var i=0;i<numberofvertices2;i++) Pnode[pos_node[i]]=i;
-		//renumber the elements (some nodes won't exist anymore)
-		var elements_2=NewArrayFill2D(numberofelements2,3,0);
-		for (var i=0;i<numberofelements2;i++){
-			for (var j=0;j<3;j++){
-				elements_2[i][j]=Pnode[md.mesh.elements[i][j]-1]+1;
-			}
-		}
-		
-		/*if isa(md.mesh,'mesh3dprisms'),
-			elements_2(:,4)=Pnode(elements_2(:,4));
-			elements_2(:,5)=Pnode(elements_2(:,5));
-			elements_2(:,6)=Pnode(elements_2(:,6));
-		end
-		*/
-		
-		//OK, now create the new model!
-
-		//take every field from model
-		var md2=md.deepcopy(md);
-		//var md2=new model(); md2.mesh=new mesh3dsurface();
-		
-		//deal with mesh: {{{
-		md2.mesh.numberofvertices=numberofvertices2;
-		md2.mesh.numberofelements=numberofelements2;
-		md2.mesh.elements=elements_2;
-
-		md2.mesh.x=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.x[i]=md.mesh.x[pos_node[i]];
-		md2.mesh.y=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.y[i]=md.mesh.y[pos_node[i]];
-		md2.mesh.z=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.z[i]=md.mesh.z[pos_node[i]];
-		md2.mesh.lat=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.lat[i]=md.mesh.lat[pos_node[i]];
-		md2.mesh.long=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.long[i]=md.mesh.long[pos_node[i]];
-		md2.mesh.r=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.r[i]=md.mesh.r[pos_node[i]];
-		//}}}
-		//deal with geometry: {{{
-		md2.geometry.base=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.base[i]=md.geometry.base[pos_node[i]];
-		md2.geometry.thickness=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.thickness[i]=md.geometry.thickness[pos_node[i]];
-		md2.geometry.surface=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.surface[i]=md.geometry.surface[pos_node[i]];
-		md2.geometry.bed=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.bed[i]=md.geometry.bed[pos_node[i]];
-		//}}}
-
-		//Keep track of pos_node and pos_elem
-		for (var i=0;i<md2.mesh.numberofvertices;i++)pos_node[i]=pos_node[i]+1;
-		for (var i=0;i<md2.mesh.numberofelements;i++)pos_elem[i]=pos_elem[i]+1;
-		md2.mesh.extractedvertices=pos_node;
-		md2.mesh.extractedelements=pos_elem;
-
-		return md2;
-
-		//automatically modify fields
-
-		//loop over model fields
-		//model_fields=fields(md);
-	} //}}}
-	this.collapse = function(md) { //{{{
-		/*
-		 *COLLAPSE - collapses a 3d mesh into a 2d mesh
-		 *
-		 *   This routine collapses a 3d model into a 2d model
-		 *   and collapses all the fileds of the 3d model by
-		 *   taking their depth-averaged values
-		 *
-		 *   Usage:
-		 *	 md=collapse(md)
-		 *
-		 *   See also: EXTRUDE, MODELEXTRACT
-		 */
-
-		// Check that the model is really a 3d model
-		if (md.mesh.elementtype() !== 'Penta') {
-			console.error('collapse error message: only 3d mesh can be collapsed')
-		}
-
-		// Start with changing all the fields from the 3d mesh 
-
-		// dealing with the friction law
-		// drag is limited to nodes that are on the bedrock.
-		if (md.friction.classname() === 'friction') {
-			md.friction.coefficient=project2d(md,md.friction.coefficient,1);
-			md.friction.p=project2d(md,md.friction.p,1);
-			md.friction.q=project2d(md,md.friction.q,1);
-		} else if (md.friction.classname() === 'frictionhydro') {
-			md.friction.q=project2d(md,md.friction.q,1);
-			md.friction.C=project2d(md,md.friction.C,1);
-			md.friction.As=project2d(md,md.friction.As,1);
-			md.friction.effective_pressure=project2d(md,md.friction.effective_pressure,1);
-		} else if (md.friction.classname() === 'frictionwaterlayer') {
-			md.friction.coefficient=project2d(md,md.friction.coefficient,1);
-			md.friction.p=project2d(md,md.friction.p,1);
-			md.friction.q=project2d(md,md.friction.q,1);
-			md.friction.water_layer=project2d(md,md.friction.water_layer,1);
-		} else if (md.friction.classname() === 'frictionweertman') {
-			md.friction.C=project2d(md,md.friction.C,1);
-			md.friction.m=project2d(md,md.friction.m,1);
-		} else if (md.friction.classname() === 'frictionweertmantemp') {
-			md.friction.C=project2d(md,md.friction.C,1);
-			md.friction.m=project2d(md,md.friction.m,1);
-		} else {
-			disp('friction type not supported');
-		}
-
-		// observations
-		if (!Number.isNaN(md.inversion.vx_obs))
-			md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
-
-		if (!Number.isNaN(md.inversion.vy_obs))
-			md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
-
-		if (!Number.isNaN(md.inversion.vel_obs))
-			md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers);
-
-		if (!Number.isNaN(md.inversion.cost_functions_coefficients))
-			md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers);
-
-		if (numel(md.inversion.min_parameters)>1)
-			md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers);
-
-		if (numel(md.inversion.max_parameters)>1) 
-			md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers);
-
-		if (md.smb.classname() === 'SMBforcing' && !Number.isNaN(md.smb.mass_balance)) {
-			md.smb.mass_balance=project2d(md,md.smb.mass_balance,md.mesh.numberoflayers);
-		} else if (md.smb.classname() === 'SMBhenning' && !Number.isNaN(md.smb.smbref)) {
-			md.smb.smbref=project2d(md,md.smb.smbref,md.mesh.numberoflayers);
-		}
-
-		// results
-		if (!Number.isNaN(md.initialization.vx))
-			md.initialization.vx=DepthAverage(md,md.initialization.vx);
-		if (!Number.isNaN(md.initialization.vy))
-			md.initialization.vy=DepthAverage(md,md.initialization.vy);
-		if (!Number.isNaN(md.initialization.vz))
-			md.initialization.vz=DepthAverage(md,md.initialization.vz);
-		if (!Number.isNaN(md.initialization.vel))
-			md.initialization.vel=DepthAverage(md,md.initialization.vel);
-		if (!Number.isNaN(md.initialization.temperature))
-			md.initialization.temperature=DepthAverage(md,md.initialization.temperature);
-		if (!Number.isNaN(md.initialization.pressure))
-			md.initialization.pressure=project2d(md,md.initialization.pressure,1);
-		if (!Number.isNaN(md.initialization.sediment_head))
-			md.initialization.sediment_head=project2d(md,md.initialization.sediment_head,1);
-		if (!Number.isNaN(md.initialization.epl_head))
-			md.initialization.epl_head=project2d(md,md.initialization.epl_head,1);
-		if (!Number.isNaN(md.initialization.epl_thickness))
-			md.initialization.epl_thickness=project2d(md,md.initialization.epl_thickness,1);
-
-		// giaivins
-		if (!Number.isNaN(md.gia.mantle_viscosity))
-			md.gia.mantle_viscosity=project2d(md,md.gia.mantle_viscosity,1);
-		if (!Number.isNaN(md.gia.lithosphere_thickness))
-			md.gia.lithosphere_thickness=project2d(md,md.gia.lithosphere_thickness,1);
-
-		// elementstype
-		if (!Number.isNaN(md.flowequation.element_equation)) {
-			md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1);
-			md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1);
-			md.flowequation.borderSSA=project2d(md,md.flowequation.borderSSA,1);
-			md.flowequation.borderHO=project2d(md,md.flowequation.borderHO,1);
-			md.flowequation.borderFS=project2d(md,md.flowequation.borderFS,1);
-		}
-
-		// boundary conditions
-		md.stressbalance.spcvx=project2d(md,md.stressbalance.spcvx,md.mesh.numberoflayers);
-		md.stressbalance.spcvy=project2d(md,md.stressbalance.spcvy,md.mesh.numberoflayers);
-		md.stressbalance.spcvz=project2d(md,md.stressbalance.spcvz,md.mesh.numberoflayers);
-		md.stressbalance.referential=project2d(md,md.stressbalance.referential,md.mesh.numberoflayers);
-		md.stressbalance.loadingforce=project2d(md,md.stressbalance.loadingforce,md.mesh.numberoflayers);
-		md.masstransport.spcthickness=project2d(md,md.masstransport.spcthickness,md.mesh.numberoflayers);
-		if (!Number.isNaN(md.damage.spcdamage))
-			md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers);
-		md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
-
-		// Hydrologydc variables
-		if (md.hydrology.classname() === 'hydrologydc') {
-			md.hydrology.spcsediment_head=project2d(md,md.hydrology.spcsediment_head,1);
-			md.hydrology.mask_eplactive_node=project2d(md,md.hydrology.mask_eplactive_node,1);
-			md.hydrology.sediment_transmitivity=project2d(md,md.hydrology.sediment_transmitivity,1);
-			md.hydrology.basal_moulin_input=project2d(md,md.hydrology.basal_moulin_input,1);
-
-			if(md.hydrology.isefficientlayer==1)
-				md.hydrology.spcepl_head=project2d(md,md.hydrology.spcepl_head,1);
-		}
-		
-		// materials
-		md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
-		md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
-		
-		// damage: 
-		if (md.damage.isdamage)
-			md.damage.D=DepthAverage(md,md.damage.D);
-
-		// special for thermal modeling:
-		if (!Number.isNaN(md.basalforcings.groundedice_melting_rate))
-			md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1); 
-
-		if (!Number.isNaN(md.basalforcings.floatingice_melting_rate))
-			md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1); 
-
-		md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); // bedrock only gets geothermal flux
-
-		// update of connectivity matrix
-		md.mesh.average_vertex_connectivity=25;
-
-		// Collapse the mesh
-		var nodes2d=md.mesh.numberofvertices2d;
-		var elements2d=md.mesh.numberofelements2d;
-
-		// parameters
-		md.geometry.surface=project2d(md,md.geometry.surface,1);
-		md.geometry.thickness=project2d(md,md.geometry.thickness,1);
-		md.geometry.base=project2d(md,md.geometry.base,1);
-		if (!Number.isNaN(md.geometry.bed))
-			md.geometry.bed=project2d(md,md.geometry.bed,1);
-
-		if (!Number.isNaN(md.mask.ocean_levelset))
-			md.mask.ocean_levelset=project2d(md,md.mask.ocean_levelset,1);
-
-		if (!Number.isNaN(md.mask.ice_levelset))
-			md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1);
-
-		// lat long
-		if (numel(md.mesh.lat) === md.mesh.numberofvertices)
-			md.mesh.lat=project2d(md,md.mesh.lat,1);
-		if (numel(md.mesh.long) === md.mesh.numberofvertices)
-			md.mesh.long=project2d(md,md.mesh.long,1);
-		if (numel(md.mesh.scale_factor) === md.mesh.numberofvertices)
-			md.mesh.scale_factor=project2d(md,md.mesh.scale_factor,1);
-
-		// Initialize with the 2d mesh
-		var mesh = new mesh2d();
-		mesh.x=md.mesh.x2d;
-		mesh.y=md.mesh.y2d;
-		mesh.numberofvertices=md.mesh.numberofvertices2d;
-		mesh.numberofelements=md.mesh.numberofelements2d;
-		mesh.elements=md.mesh.elements2d;
-
-		if (!Number.isNaN(md.mesh.vertexonboundary))
-			mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
-		if (!Number.isNaN(md.mesh.elementconnectivity))
-			mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
-
-		md.mesh=mesh;
-		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
-		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
-		md.mesh.segments=contourenvelope(md.mesh);
-
-		return md;
-	} /*}}}*/
-	this.deepCopy = function(md) { //{{{
-		/*
-		 *DEEPCOPY - returns a deep copy of the model.
-		 *
-		 *   This routine creates a new model with new objects 
-		 *   for each corresponding object in the original model,
-		 *   so that changes in one do not affect the other.
-		 *
-		 *   Usage:
-		 *	 md1=deepCopy(md)
-		 *
-		 */
-		function recursiveDeepCopy(obj) {
-			var returnValue;
-
-			switch (typeof obj) {
-				case "object":
-					if (obj === null) {
-						// null => null
-						returnValue = null;
-					} else {
-						switch (toString.call(obj)) {
-							case "[object Array]":
-								// It's an array, create a new array with deep copies of the entries
-								returnValue = obj.map(recursiveDeepCopy);
-								break;
-							default:
-								// Some other kind of object, deep-copy its properties into a new object
-								returnValue = Object.keys(obj).reduce(function(prev, key) {
-									prev[key] = recursiveDeepCopy(obj[key]);
-									return prev;
-								}, {});
-								break;
-						}
-					}
-					break;
-				default:
-					// It's a primitive, copy via assignment
-					returnValue = obj;
-					break;
-			}
-			return returnValue;
-		}
-		
-		return recursiveDeepCopy(md);
-	} /*}}}*/
-//properties
-// {{{
-	//Careful here: no other class should be used as default value this is a bug of matlab
-	this.mesh             = 0;
-	this.mask             = 0;
-
-	this.geometry         = 0;
-	this.constants        = 0;
-	this.smb              = 0;
-	this.basalforcings    = 0;
-	this.materials        = 0;
-	this.damage           = 0;
-	this.friction         = 0;
-	this.flowequation     = 0;
-	this.timestepping     = 0;
-	this.initialization   = 0;
-	this.rifts            = 0;
-	this.dsl              = 0;
-	this.solidearth       = 0;
-
-	this.debug            = 0;
-	this.verbose          = 0;
-	this.settings         = 0;
-	this.toolkits         = 0;
-	this.cluster          = 0;
-
-	this.balancethickness = 0;
-	this.stressbalance    = 0;
-	this.groundingline    = 0;
-	this.hydrology        = 0;
-	this.masstransport    = 0;
-	this.thermal          = 0;
-	this.steadystate      = 0;
-	this.transient        = 0;
-	this.levelset         = 0;
-	this.calving          = 0;
-	this.frontalforcings  = 0;
-	this.love             = 0;
-	this.esa              = 0;
-	this.sampling         = 0;
-
-	this.autodiff         = 0;
-	this.inversion        = 0;
-	this.qmu              = 0;
-	this.amr              = 0;
-	this.results          = 0;
-	this.outputdefinition = 0;
-	this.radaroverlay     = 0;
-	this.miscellaneous    = 0;
-	this.priv             = 0;
-
-	// Set default values for fields
-	if (arguments.length == 0) {
-		this.setdefaultparameters('earth');
-	} else {
-		this.setdefaultparameters(planet);
-	}
-	//}}}
-}
Index: sm/trunk/src/m/classes/model.m
===================================================================
--- /issm/trunk/src/m/classes/model.m	(revision 28275)
+++ 	(revision )
@@ -1,1846 +1,0 @@
-%MODEL class definition
-%
-%   Usage:
-%      md = model(varargin)
-
-classdef model
-	properties (SetAccess=public) %Model fields
-		% {{{
-		%Careful here: no other class should be used as default value this is a bug of matlab
-		mesh             = 0;
-		mask             = 0;
-
-		geometry         = 0;
-		constants        = 0;
-		smb              = 0;
-		basalforcings    = 0;
-		materials        = 0;
-		damage           = 0;
-		friction         = 0;
-		flowequation     = 0;
-		timestepping     = 0;
-		initialization   = 0;
-		rifts            = 0;
-		dsl              = 0;
-		solidearth       = 0;
-
-		debug            = 0;
-		verbose          = 0;
-		settings         = 0;
-		toolkits         = 0;
-		cluster          = 0;
-
-		balancethickness = 0;
-		stressbalance    = 0;
-		groundingline    = 0;
-		hydrology        = 0;
-		debris           = 0;
-		masstransport    = 0;
-		thermal          = 0;
-		steadystate      = 0;
-		transient        = 0;
-		levelset         = 0;
-		calving          = 0;
-		frontalforcings  = 0;
-		love             = 0;
-		esa              = 0;
-		sampling         = 0;
-
-		autodiff         = 0;
-		inversion        = 0;
-		qmu              = 0;
-		amr              = 0;
-		results          = 0;
-		outputdefinition = 0;
-		radaroverlay     = 0;
-		miscellaneous    = 0;
-		private          = 0;
-		stochasticforcing= 0;
-
-		%}}}
-	end
-	methods (Static)
-		function md = loadobj(md) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. If the input is a struct it is an old version of model and
-			% old fields must be recovered (make sure they are in the deprecated
-			% model properties)
-
-			if verLessThan('matlab','7.9'),
-				disp('Warning: your matlab version is old and there is a risk that load does not work correctly');
-				disp('         if the model is not loaded correctly, rename temporarily loadobj so that matlab does not use it');
-
-				% This is a Matlab bug: all the fields of md have their default value
-				% Example of error message:
-				% Warning: Error loading an object of class 'model':
-				% Undefined function or method 'exist' for input arguments of type 'cell'
-				%
-				% This has been fixed in MATLAB 7.9 (R2009b) and later versions
-			end
-
-			if isstruct(md)
-				disp('Recovering model object from a previous version');
-				md = structtomodel(model,md);
-			end
-
-			%2012 August 4th
-			if isa(md.materials,'materials'),
-				disp('Recovering old materials');
-				if numel(md.materials.rheology_Z)==1 & isnan(md.materials.rheology_Z),
-					md.materials=matice(md.materials);
-				else
-					md.materials=matdamageice(md.materials);
-				end
-			end
-			%2013 April 12
-			if numel(md.stressbalance.loadingforce==1)
-				md.stressbalance.loadingforce=0*ones(md.mesh.numberofvertices,3);
-			end
-			%2013 April 17
-			if isa(md.hydrology,'hydrology'),
-				disp('Recovering old hydrology class');
-				md.hydrology=hydrologyshreve(md.materials);
-			end
-			%2013 October 9
-			if ~isa(md.damage,'damage'),
-				md.damage=damage();
-				md.damage.D=zeros(md.mesh.numberofvertices,1);
-				md.damage.spcdamage=NaN*ones(md.mesh.numberofvertices,1);
-			end
-			%2013 November 18
-			if ~isa(md.outputdefinition,'outputdefinition'),
-				md.outputdefinition=outputdefinition();
-			end
-			%2014 March 26th
-			if isa(md.mesh,'mesh'),
-				disp('Recovering old mesh class');
-				if isprop(md.mesh,'dimension'),
-					if md.mesh.dimension==2,
-						md.mesh=mesh2d(md.mesh);
-					else
-						md.mesh=mesh3dprisms(md.mesh);
-					end
-				else
-					md.mesh=mesh2dvertical(md.mesh);
-				end
-			end
-			%2014 November 12
-			if isa(md.calving,'double'); md.calving=calving(); end
-			%2016 October 11
-			if isa(md.esa,'double'); md.esa=esa(); end
-			%2017 February 10th
-			if isa(md.settings,'settings'), %this 'isa' verification: 2018 October 24th
-				if md.settings.solver_residue_threshold==0,
-					md.settings.solver_residue_threshold = 1e-6;
-				end
-			end
-			%2017 May 4th
-			if isa(md.amr,'double'); md.amr=amr(); end
-			%2017 Aug 29th
-			if isa(md.love,'double'); md.love=love(); end
-			%2017 Oct 26th
-			if isa(md.calving,'calvingdev')
-				disp('Warning: calvingdev is now calvingvonmises');
-				md.calving=calvingvonmises(md.calving); 
-			end
-			%2017 Dec 21st (needs to be here)
-			if isempty(md.settings)
-				disp('Warning: md.settings had to be reset, make sure to adjust md.settings.output_frequency and other fields');
-				md.settings = issmsettings();
-			end
-			%2018 Dec 1st
-			if md.settings.sb_coupling_frequency==0
-				md.settings.sb_coupling_frequency=1;
-			end
-			%2019 Jan..
-			if isa(md.frontalforcings,'double');
-				if(isprop('meltingrate',md.calving) & ~isnan(md.calving.meltingrate))
-		gia			disp('Warning: md.calving.meltingrate is now in md.frontalforcings');
-				end
-				md.frontalforcings=frontalforcings(md.calving); 
-			end
-			%2019 Feb 26
-			if isa(md.settings.results_on_nodes,'double')
-				if md.settings.results_on_nodes == 0
-					md.settings.results_on_nodes = {};
-				else
-					md.settings.results_on_nodes = {'all'};
-				end
-			end
-			%2019 Mar 28, updated 2021 April 23
-			if isa(md.smb,'SMBcomponents') | isa(md.smb,'SMBmeltcomponents') | isa(md.smb,'SMBforcing') | isa(md.smb,'SMBgemb') 
-				if any(strcmp(fieldnames(md.smb),'isclimatology'))
-					if isa(md.smb.isclimatology,'double')
-						if prod(size(md.smb.isclimatology)) ~= 1
-							md.smb.isclimatology = 0;
-						end
-						md.timestepping.cycle_forcing=md.smb.isclimatology;
-					end
-				end
-			end
-			%2019 Dec 16
-			if isa(md.dsl,'double') 
-				md.dsl=dsl();
-			end
-			%2020 April 24
-			if isa(md.smb,'SMBgemb')
-				if isa(md.smb.isconstrainsurfaceT,'double')
-					if prod(size(md.smb.isconstrainsurfaceT)) ~= 1
-						md.smb.isconstrainsurfaceT = 0;
-					end
-				end
-			end
-			%2021 February 17
-			if isa(md.sampling,'double'); md.sampling=sampling(); end
-			%VV
-			if ~isa(md.stochasticforcing,'stochasticforcing'); md.stochasticforcing=stochasticforcing(); end
-			%2022 Oct 28
-			if ~isa(md.debris,'debris'); md.debris=debris(); end
-		end% }}}
-	end
-	methods
-		function md = model(varargin) % {{{
-
-			switch nargin
-				case 0
-					md=setdefaultparameters(md,'earth');
-				otherwise
-					options=pairoptions(varargin{:});
-					planet=getfieldvalue(options,'planet','earth');
-					md=setdefaultparameters(md,planet);
-				end
-
-		end
-		%}}}
-		function disp(self) % {{{
-			disp(sprintf('%19s: %-23s -- %s','mesh'            ,['[1x1 ' class(self.mesh) ']'],'mesh properties'));
-			disp(sprintf('%19s: %-23s -- %s','mask'            ,['[1x1 ' class(self.mask) ']'],'defines grounded and floating elements'));
-			disp(sprintf('%19s: %-23s -- %s','geometry'        ,['[1x1 ' class(self.geometry) ']'],'surface elevation, bedrock topography, ice thickness,...'));
-			disp(sprintf('%19s: %-23s -- %s','constants'       ,['[1x1 ' class(self.constants) ']'],'physical constants'));
-			disp(sprintf('%19s: %-23s -- %s','smb'             ,['[1x1 ' class(self.smb) ']'],'surface mass balance'));
-			disp(sprintf('%19s: %-23s -- %s','basalforcings'   ,['[1x1 ' class(self.basalforcings) ']'],'bed forcings'));
-			disp(sprintf('%19s: %-23s -- %s','materials'       ,['[1x1 ' class(self.materials) ']'],'material properties'));
-			disp(sprintf('%19s: %-23s -- %s','damage'          ,['[1x1 ' class(self.damage) ']'],'parameters for damage evolution solution'));
-			disp(sprintf('%19s: %-23s -- %s','friction'        ,['[1x1 ' class(self.friction) ']'],'basal friction/drag properties'));
-			disp(sprintf('%19s: %-23s -- %s','flowequation'    ,['[1x1 ' class(self.flowequation) ']'],'flow equations'));
-			disp(sprintf('%19s: %-23s -- %s','timestepping'    ,['[1x1 ' class(self.timestepping) ']'],'time stepping for transient models'));
-			disp(sprintf('%19s: %-23s -- %s','initialization'  ,['[1x1 ' class(self.initialization) ']'],'initial guess/state'));
-			disp(sprintf('%19s: %-23s -- %s','rifts'           ,['[1x1 ' class(self.rifts) ']'],'rifts properties'));
-			disp(sprintf('%19s: %-23s -- %s','solidearth'      ,['[1x1 ' class(self.solidearth) ']'],'solidearth inputs and settings'));
-			disp(sprintf('%19s: %-23s -- %s','dsl'             ,['[1x1 ' class(self.dsl) ']'],'dynamic sea-level '));
-			disp(sprintf('%19s: %-23s -- %s','debug'           ,['[1x1 ' class(self.debug) ']'],'debugging tools (valgrind, gprof)'));
-			disp(sprintf('%19s: %-23s -- %s','verbose'         ,['[1x1 ' class(self.verbose) ']'],'verbosity level in solve'));
-			disp(sprintf('%19s: %-23s -- %s','settings'        ,['[1x1 ' class(self.settings) ']'],'settings properties'));
-			disp(sprintf('%19s: %-23s -- %s','toolkits'        ,['[1x1 ' class(self.toolkits) ']'],'PETSc options for each solution'));
-			disp(sprintf('%19s: %-23s -- %s','cluster'         ,['[1x1 ' class(self.cluster) ']'],'cluster parameters (number of CPUs...)'));
-			disp(sprintf('%19s: %-23s -- %s','balancethickness',['[1x1 ' class(self.balancethickness) ']'],'parameters for balancethickness solution'));
-			disp(sprintf('%19s: %-23s -- %s','stressbalance'   ,['[1x1 ' class(self.stressbalance) ']'],'parameters for stressbalance solution'));
-			disp(sprintf('%19s: %-23s -- %s','groundingline'   ,['[1x1 ' class(self.groundingline) ']'],'parameters for groundingline solution'));
-			disp(sprintf('%19s: %-23s -- %s','hydrology'       ,['[1x1 ' class(self.hydrology) ']'],'parameters for hydrology solution'));
-			disp(sprintf('%19s: %-23s -- %s','debris' 	   ,['[1x1 ' class(self.debris) ']'],'parameters for debris solution'));
-			disp(sprintf('%19s: %-23s -- %s','masstransport'   ,['[1x1 ' class(self.masstransport) ']'],'parameters for masstransport solution'));
-			disp(sprintf('%19s: %-23s -- %s','thermal'         ,['[1x1 ' class(self.thermal) ']'],'parameters for thermal solution'));
-			disp(sprintf('%19s: %-23s -- %s','steadystate'     ,['[1x1 ' class(self.steadystate) ']'],'parameters for steadystate solution'));
-			disp(sprintf('%19s: %-23s -- %s','transient'       ,['[1x1 ' class(self.transient) ']'],'parameters for transient solution'));
-			disp(sprintf('%19s: %-23s -- %s','levelset'        ,['[1x1 ' class(self.levelset) ']'],'parameters for moving boundaries (level-set method)'));
-			disp(sprintf('%19s: %-23s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
-			disp(sprintf('%19s: %-23s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
-			disp(sprintf('%19s: %-23s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
-			disp(sprintf('%19s: %-23s -- %s','love'            ,['[1x1 ' class(self.love) ']'],'parameters for love solution'));
-			disp(sprintf('%19s: %-23s -- %s','sampling'        ,['[1x1 ' class(self.sampling) ']'],'parameters for stochastic sampler'));
-			disp(sprintf('%19s: %-23s -- %s','autodiff'        ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
-			disp(sprintf('%19s: %-23s -- %s','inversion'       ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods'));
-			disp(sprintf('%19s: %-23s -- %s','qmu'             ,['[1x1 ' class(self.qmu) ']'],'Dakota properties'));
-			disp(sprintf('%19s: %-23s -- %s','amr'             ,['[1x1 ' class(self.amr) ']'],'adaptive mesh refinement properties'));
-			disp(sprintf('%19s: %-23s -- %s','outputdefinition',['[1x1 ' class(self.outputdefinition) ']'],'output definition'));
-			disp(sprintf('%19s: %-23s -- %s','results'         ,['[1x1 ' class(self.results) ']'],'model results'));
-			disp(sprintf('%19s: %-23s -- %s','radaroverlay'    ,['[1x1 ' class(self.radaroverlay) ']'],'radar image for plot overlay'));
-			disp(sprintf('%19s: %-23s -- %s','miscellaneous'   ,['[1x1 ' class(self.miscellaneous) ']'],'miscellaneous fields'));
-			disp(sprintf('%19s: %-23s -- %s','stochasticforcing',['[1x1 ' class(self.stochasticforcing) ']'],'stochasticity applied to model forcings'));
-		end % }}}
-		function md = setdefaultparameters(md,planet) % {{{
-
-			%initialize subclasses
-			md.mesh             = mesh2d();
-			md.mask             = mask();
-			md.constants        = constants();
-			md.geometry         = geometry();
-			md.initialization   = initialization();
-			md.smb              = SMBforcing();
-			md.basalforcings    = basalforcings();
-			md.friction         = friction();
-			md.rifts            = rifts();
-			md.solidearth       = solidearth(planet);
-			md.dsl              = dsl();
-			md.timestepping     = timestepping();
-			md.groundingline    = groundingline();
-			md.materials        = matice();
-			md.damage           = damage();
-			md.flowequation     = flowequation();
-			md.debug            = debug();
-			md.verbose          = verbose();
-			md.settings         = issmsettings();
-			md.toolkits         = toolkits();
-			md.cluster          = generic();
-			md.balancethickness = balancethickness();
-			md.stressbalance    = stressbalance();
-			md.hydrology        = hydrologyshreve();
-			md.debris           = debris();
-			md.masstransport    = masstransport();
-			md.thermal          = thermal();
-			md.steadystate      = steadystate();
-			md.transient        = transient();
-			md.levelset         = levelset();
-			md.calving          = calving();
-			md.frontalforcings  = frontalforcings();
-			md.love             = love();
-			md.esa              = esa();
-			md.sampling         = sampling();
-			md.autodiff         = autodiff();
-			md.inversion        = inversion();
-			md.qmu              = qmu();
-			md.amr              = amr();
-			md.radaroverlay     = radaroverlay();
-			md.results          = struct();
-			md.outputdefinition = outputdefinition();
-			md.miscellaneous    = miscellaneous();
-			md.private          = private();
-			md.stochasticforcing= stochasticforcing();
-		end
-		%}}}
-		function md = checkmessage(md,string) % {{{
-			if(nargout~=1) error('wrong usage, model must be an output'); end
-			disp(['model not consistent: ' string]);
-			md.private.isconsistent=false;
-		end
-		%}}}
-		function md = collapse(md)% {{{
-			%COLLAPSE - collapses a 3d mesh into a 2d mesh
-			%
-			%   This routine collapses a 3d model into a 2d model
-			%   and collapses all the fields of the 3d model by
-			%   taking their depth-averaged values
-			%
-			%   Usage:
-			%      md=collapse(md)
-			%
-			%   See also: EXTRUDE, MODELEXTRACT
-
-			%Check that the model is really a 3d model
-			if ~strcmp(md.mesh.elementtype(),'Penta'),
-				error('collapse error message: only 3d mesh can be collapsed')
-			end
-
-			%Start with changing all the fields from the 3d mesh 
-
-			%dealing with the friction law
-			%drag is limited to nodes that are on the bedrock.
-			if isa(md.friction,'friction'),
-				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
-				md.friction.p=project2d(md,md.friction.p,1);
-				md.friction.q=project2d(md,md.friction.q,1);
-			elseif isa(md.friction,'frictioncoulomb'),
-				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
-				md.friction.coefficientcoulomb=project2d(md,md.friction.coefficientcoulomb,1);
-				md.friction.p=project2d(md,md.friction.p,1);
-				md.friction.q=project2d(md,md.friction.q,1);
-			elseif isa(md.friction,'frictionhydro'),
-				md.friction.q=project2d(md,md.friction.q,1);
-				md.friction.C=project2d(md,md.friction.C,1);
-				md.friction.As=project2d(md,md.friction.As,1);
-				md.friction.effective_pressure=project2d(md,md.friction.effective_pressure,1);
-			elseif isa(md.friction,'frictionwaterlayer'),
-				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
-				md.friction.p=project2d(md,md.friction.p,1);
-				md.friction.q=project2d(md,md.friction.q,1);
-				md.friction.water_layer=project2d(md,md.friction.water_layer,1);
-			elseif isa(md.friction,'frictionweertman'),
-				md.friction.C=project2d(md,md.friction.C,1);
-				md.friction.m=project2d(md,md.friction.m,1);
-			elseif isa(md.friction,'frictionweertmantemp'),
-				md.friction.C=project2d(md,md.friction.C,1);
-				md.friction.m=project2d(md,md.friction.m,1);
-			elseif isa(md.friction,'frictionjosh'),
-				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
-				md.friction.pressure_adjusted_temperature=project2d(md,md.friction.pressure_adjusted_temperature,1);
-			else
-				disp('friction type not supported');
-			end
-
-			%observations
-			if ~isnan(md.inversion.vx_obs),
-				md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
-			end
-			if ~isnan(md.inversion.vy_obs),
-				md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
-			end
-			if ~isnan(md.inversion.vel_obs),
-				md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers);
-			end
-			if ~isnan(md.inversion.thickness_obs),
-				md.inversion.thickness_obs=project2d(md,md.inversion.thickness_obs,md.mesh.numberoflayers);
-			end
-			if ~isnan(md.inversion.cost_functions_coefficients),
-				md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers);
-			end
-			if numel(md.inversion.min_parameters)>1,
-				md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers);
-			end
-			if numel(md.inversion.max_parameters)>1,
-				md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers);
-			end
-			if isa(md.smb,'SMBforcing') & ~isnan(md.smb.mass_balance),
-				md.smb.mass_balance=project2d(md,md.smb.mass_balance,md.mesh.numberoflayers); 
-			elseif isa(md.smb,'SMBhenning') & ~isnan(md.smb.smbref),
-				md.smb.smbref=project2d(md,md.smb.smbref,md.mesh.numberoflayers);
-			end
-
-			%results
-			if ~isnan(md.initialization.vx),
-				md.initialization.vx=DepthAverage(md,md.initialization.vx);
-			end
-			if ~isnan(md.initialization.vy),
-				md.initialization.vy=DepthAverage(md,md.initialization.vy);
-			end
-			if ~isnan(md.initialization.vz),
-				md.initialization.vz=DepthAverage(md,md.initialization.vz);
-			end
-			if ~isnan(md.initialization.vel),
-				md.initialization.vel=DepthAverage(md,md.initialization.vel);
-			end
-			if ~isnan(md.initialization.temperature),
-				md.initialization.temperature=DepthAverage(md,md.initialization.temperature);
-			end
-			if ~isnan(md.initialization.pressure),
-				md.initialization.pressure=project2d(md,md.initialization.pressure,1);
-			end
-			if ~isnan(md.initialization.sediment_head),
-				md.initialization.sediment_head=project2d(md,md.initialization.sediment_head,1);
-			end
-			if ~isnan(md.initialization.epl_head),
-				md.initialization.epl_head=project2d(md,md.initialization.epl_head,1);
-			end
-			if ~isnan(md.initialization.epl_thickness),
-				md.initialization.epl_thickness=project2d(md,md.initialization.epl_thickness,1);
-			end
-			if ~isnan(md.initialization.waterfraction),
-				md.initialization.waterfraction=project2d(md,md.initialization.waterfraction,1);
-			end
-			if ~isnan(md.initialization.watercolumn),
-				md.initialization.watercolumn=project2d(md,md.initialization.watercolumn,1);
-			end
-			if ~isnan(md.initialization.debris),
-				md.initialization.debris=project2d(md,md.initialization.debris,1);
-			end
-
-
-			%elementstype
-			if ~isnan(md.flowequation.element_equation)
-				md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1);
-				md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1);
-				md.flowequation.borderSSA=project2d(md,md.flowequation.borderSSA,1);
-				md.flowequation.borderHO=project2d(md,md.flowequation.borderHO,1);
-				md.flowequation.borderFS=project2d(md,md.flowequation.borderFS,1);
-			end
-
-			%boundary conditions
-			md.stressbalance.spcvx=project2d(md,md.stressbalance.spcvx,md.mesh.numberoflayers);
-			md.stressbalance.spcvy=project2d(md,md.stressbalance.spcvy,md.mesh.numberoflayers);
-			md.stressbalance.spcvz=project2d(md,md.stressbalance.spcvz,md.mesh.numberoflayers);
-			md.stressbalance.referential=project2d(md,md.stressbalance.referential,md.mesh.numberoflayers);
-			md.stressbalance.loadingforce=project2d(md,md.stressbalance.loadingforce,md.mesh.numberoflayers);
-			if numel(md.masstransport.spcthickness)>1,
-				md.masstransport.spcthickness=project2d(md,md.masstransport.spcthickness,md.mesh.numberoflayers);
-			end
-			if numel(md.damage.spcdamage)>1,
-				md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers);
-			end
-			if numel(md.levelset.spclevelset)>1,
-				md.levelset.spclevelset=project2d(md,md.levelset.spclevelset,md.mesh.numberoflayers);
-			end
-			md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
-
-			% Hydrologydc variables
-			if isa(md.hydrology,'hydrologydc');
-				md.hydrology.spcsediment_head=project2d(md,md.hydrology.spcsediment_head,1);
-				md.hydrology.mask_eplactive_node=project2d(md,md.hydrology.mask_eplactive_node,1);
-				md.hydrology.sediment_transmitivity=project2d(md,md.hydrology.sediment_transmitivity,1);
-				md.hydrology.basal_moulin_input=project2d(md,md.hydrology.basal_moulin_input,1);
-				if(md.hydrology.isefficientlayer==1)
-					md.hydrology.spcepl_head=project2d(md,md.hydrology.spcepl_head,1);
-				end
-			end
-			
-			%materials
-			md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
-			md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
-			if isprop(md.materials,'rheology_E')
-				md.materials.rheology_E=project2d(md,md.materials.rheology_E,1);
-			end
-			
-			%damage: 
-			if md.damage.isdamage,
-				md.damage.D=DepthAverage(md,md.damage.D);
-			end
-
-			%special for thermal modeling:
-			if ~isnan(md.basalforcings.groundedice_melting_rate),
-				md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1); 
-			end
-			if isprop(md.basalforcings,'floatingice_melting_rate') & ~isnan(md.basalforcings.floatingice_melting_rate),
-				md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1); 
-			end
-			md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); %bedrock only gets geothermal flux
-
-			if isprop(md.calving,'coeff') & ~isnan(md.calving.coeff),
-				md.calving.coeff=project2d(md,md.calving.coeff,1); 
-			end
-			if isprop(md.frontalforcings,'meltingrate') & ~isnan(md.frontalforcings.meltingrate),
-				md.frontalforcings.meltingrate=project2d(md,md.frontalforcings.meltingrate,1); 
-			end
-
-			%update of connectivity matrix
-			md.mesh.average_vertex_connectivity=25;
-
-			%Collapse the mesh
-			nodes2d=md.mesh.numberofvertices2d;
-			elements2d=md.mesh.numberofelements2d;
-
-			%parameters
-			md.geometry.surface=project2d(md,md.geometry.surface,1);
-			md.geometry.thickness=project2d(md,md.geometry.thickness,1);
-			md.geometry.base=project2d(md,md.geometry.base,1);
-			if ~isnan(md.geometry.bed),
-				md.geometry.bed=project2d(md,md.geometry.bed,1);
-			end
-			if ~isnan(md.mask.ocean_levelset),
-				md.mask.ocean_levelset=project2d(md,md.mask.ocean_levelset,1);
-			end
-			if ~isnan(md.mask.ice_levelset),
-				md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1);
-			end
-
-			%lat long
-			if numel(md.mesh.lat)==md.mesh.numberofvertices,
-				md.mesh.lat=project2d(md,md.mesh.lat,1);
-			end
-			if numel(md.mesh.long)==md.mesh.numberofvertices,
-				md.mesh.long=project2d(md,md.mesh.long,1);
-			end
-
-			%outputdefinitions
-			for i=1:length(md.outputdefinition.definitions)
-				if isobject(md.outputdefinition.definitions{i})
-					%get subfields
-					solutionsubfields=fields(md.outputdefinition.definitions{i});
-					for j=1:length(solutionsubfields),
-						field=md.outputdefinition.definitions{i}.(solutionsubfields{j});
-						if length(field)==md.mesh.numberofvertices | length(field)==md.mesh.numberofelements,
-							md.outputdefinition.definitions{i}.(solutionsubfields{j})=project2d(md,md.outputdefinition.definitions{i}.(solutionsubfields{j}),1);
-						end
-					end
-				end
-			end
-
-			%Initialize 2d mesh
-			mesh=mesh2d();
-			mesh.x=md.mesh.x2d;
-			mesh.y=md.mesh.y2d;
-			mesh.numberofvertices=md.mesh.numberofvertices2d;
-			mesh.numberofelements=md.mesh.numberofelements2d;
-			mesh.elements=md.mesh.elements2d;
-			if numel(md.mesh.lat)==md.mesh.numberofvertices,
-				mesh.lat=project2d(md,md.mesh.lat,1);
-			end
-			if numel(md.mesh.long)==md.mesh.numberofvertices,
-				mesh.long=project2d(md,md.mesh.long,1);
-			end
-			mesh.epsg=md.mesh.epsg;
-			if numel(md.mesh.scale_factor)==md.mesh.numberofvertices,
-				mesh.scale_factor=project2d(md,md.mesh.scale_factor,1);
-			end
-			if ~isnan(md.mesh.vertexonboundary),
-				mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
-			end
-			if ~isnan(md.mesh.elementconnectivity),
-				mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
-			end
-			md.mesh=mesh;
-			md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
-			md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
-			md.mesh.segments=contourenvelope(md.mesh);
-
-		end % }}}
-		function md2 = extract(md,area,varargin) % {{{
-			%extract - extract a model according to an Argus contour or flag list
-			%
-			%   This routine extracts a submodel from a bigger model with respect to a given contour
-			%   md must be followed by the corresponding exp file or flags list
-			%   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
-			%   If user wants every element outside the domain to be 
-			%   extract2d, add '~' to the name of the domain file (ex: '~HO.exp');
-			%   an empty string '' will be considered as an empty domain
-			%   a string 'all' will be considered as the entire domain
-			%
-			%   Usage:
-			%      md2=extract(md,area);
-			%
-			%   Examples:
-			%      md2=extract(md,'Domain.exp');
-			%
-			%   See also: EXTRUDE, COLLAPSE
-
-			%copy model
-			md1=md;
-
-			%recover optoins: 
-			options=pairoptions(varargin{:});
-
-			%some checks
-			if ((nargin<2) | (nargout~=1)),
-				help extract
-				error('extract error message: bad usage');
-			end
-
-			%get elements that are inside area
-			flag_elem=FlagElements(md1,area);
-			if ~any(flag_elem),
-				error('extracted model is empty');
-			end
-
-			%kick out all elements with 3 dirichlets
-			if getfieldvalue(options,'spccheck',1)
-				spc_elem=find(~flag_elem);
-				spc_node=sort(unique(md1.mesh.elements(spc_elem,:)));
-				flag=ones(md1.mesh.numberofvertices,1);
-				flag(spc_node)=0;
-				pos=find(sum(flag(md1.mesh.elements),2)==0);
-				flag_elem(pos)=0;
-			end
-
-			%extracted elements and nodes lists
-			pos_elem=find(flag_elem);
-			pos_node=sort(unique(md1.mesh.elements(pos_elem,:)));
-
-			%keep track of some fields
-			numberofvertices1=md1.mesh.numberofvertices;
-			numberofelements1=md1.mesh.numberofelements;
-			numberofvertices2=length(pos_node);
-			numberofelements2=length(pos_elem);
-			flag_node=zeros(numberofvertices1,1);
-			flag_node(pos_node)=1;
-
-			%Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
-			Pelem=zeros(numberofelements1,1);
-			Pelem(pos_elem)=[1:numberofelements2]';
-			Pnode=zeros(numberofvertices1,1);
-			Pnode(pos_node)=[1:numberofvertices2]';
-
-			%renumber the elements (some nodes won't exist anymore)
-			elements_1=md1.mesh.elements;
-			elements_2=elements_1(pos_elem,:);
-			elements_2(:,1)=Pnode(elements_2(:,1));
-			elements_2(:,2)=Pnode(elements_2(:,2));
-			elements_2(:,3)=Pnode(elements_2(:,3));
-			if isa(md1.mesh,'mesh3dprisms'),
-				elements_2(:,4)=Pnode(elements_2(:,4));
-				elements_2(:,5)=Pnode(elements_2(:,5));
-				elements_2(:,6)=Pnode(elements_2(:,6));
-			end
-
-			%OK, now create the new model!
-
-			%take every field from model
-			md2=md1;
-
-			%automatically modify fields
-
-			%loop over model fields
-			model_fields=fields(md1);
-			for i=1:length(model_fields),
-				%get field
-				field=md1.(model_fields{i});
-				fieldsize=size(field);
-				if isobject(field), %recursive call
-					object_fields=fields(md1.(model_fields{i}));
-					for j=1:length(object_fields),
-						%get field
-						field=md1.(model_fields{i}).(object_fields{j});
-						fieldsize=size(field);
-						%size = number of nodes * n
-						if fieldsize(1)==numberofvertices1
-							md2.(model_fields{i}).(object_fields{j})=field(pos_node,:);
-						elseif (fieldsize(1)==numberofvertices1+1)
-							md2.(model_fields{i}).(object_fields{j})=[field(pos_node,:); field(end,:)];
-						%size = number of elements * n
-						elseif fieldsize(1)==numberofelements1
-							md2.(model_fields{i}).(object_fields{j})=field(pos_elem,:);
-						elseif (fieldsize(1)==numberofelements1+1)
-							md2.(model_fields{i}).(object_fields{j})=[field(pos_elem,:); field(end,:)];
-						end
-					end
-				else
-					%size = number of nodes * n
-					if fieldsize(1)==numberofvertices1
-						md2.(model_fields{i})=field(pos_node,:);
-					elseif (fieldsize(1)==numberofvertices1+1)
-						md2.(model_fields{i})=[field(pos_node,:); field(end,:)];
-					%size = number of elements * n
-					elseif fieldsize(1)==numberofelements1
-						md2.(model_fields{i})=field(pos_elem,:);
-					elseif (fieldsize(1)==numberofelements1+1)
-						md2.(model_fields{i})=[field(pos_elem,:); field(end,:)];
-					end
-				end
-			end
-
-			%modify some specific fields
-
-			%Mesh
-			md2.mesh.numberofelements=numberofelements2;
-			md2.mesh.numberofvertices=numberofvertices2;
-			md2.mesh.elements=elements_2;
-
-			%mesh.uppervertex mesh.lowervertex
-			if isa(md1.mesh,'mesh3dprisms'),
-				md2.mesh.uppervertex=md1.mesh.uppervertex(pos_node);
-				pos=find(~isnan(md2.mesh.uppervertex));
-				md2.mesh.uppervertex(pos)=Pnode(md2.mesh.uppervertex(pos));
-
-				md2.mesh.lowervertex=md1.mesh.lowervertex(pos_node);
-				pos=find(~isnan(md2.mesh.lowervertex));
-				md2.mesh.lowervertex(pos)=Pnode(md2.mesh.lowervertex(pos));
-
-				md2.mesh.upperelements=md1.mesh.upperelements(pos_elem);
-				pos=find(~isnan(md2.mesh.upperelements));
-				md2.mesh.upperelements(pos)=Pelem(md2.mesh.upperelements(pos));
-
-				md2.mesh.lowerelements=md1.mesh.lowerelements(pos_elem);
-				pos=find(~isnan(md2.mesh.lowerelements));
-				md2.mesh.lowerelements(pos)=Pelem(md2.mesh.lowerelements(pos));
-			end
-
-			%Initial 2d mesh
-			if isa(md1.mesh,'mesh3dprisms'),
-				flag_elem_2d=flag_elem(1:md1.mesh.numberofelements2d);
-				pos_elem_2d=find(flag_elem_2d);
-				flag_node_2d=flag_node(1:md1.mesh.numberofvertices2d);
-				pos_node_2d=find(flag_node_2d);
-
-				md2.mesh.numberofelements2d=length(pos_elem_2d);
-				md2.mesh.numberofvertices2d=length(pos_node_2d);
-				md2.mesh.elements2d=md1.mesh.elements2d(pos_elem_2d,:);
-				md2.mesh.elements2d(:,1)=Pnode(md2.mesh.elements2d(:,1));
-				md2.mesh.elements2d(:,2)=Pnode(md2.mesh.elements2d(:,2));
-				md2.mesh.elements2d(:,3)=Pnode(md2.mesh.elements2d(:,3));
-
-				md2.mesh.x2d=md1.mesh.x(pos_node_2d);
-				md2.mesh.y2d=md1.mesh.y(pos_node_2d);
-			end
-
-			%Edges
-			if(dimension(md.mesh)==2),
-				if size(md2.mesh.edges,2)>1, %do not use ~isnan because there are some NaNs...
-					%renumber first two columns
-					pos=find(md2.mesh.edges(:,4)~=-1);
-					md2.mesh.edges(:  ,1)=Pnode(md2.mesh.edges(:,1));
-					md2.mesh.edges(:  ,2)=Pnode(md2.mesh.edges(:,2));
-					md2.mesh.edges(:  ,3)=Pelem(md2.mesh.edges(:,3));
-					md2.mesh.edges(pos,4)=Pelem(md2.mesh.edges(pos,4));
-					%remove edges when the 2 vertices are not in the domain.
-					md2.mesh.edges=md2.mesh.edges(find(md2.mesh.edges(:,1) & md2.mesh.edges(:,2)),:);
-					%Replace all zeros by -1 in the last two columns
-					pos=find(md2.mesh.edges(:,3)==0);
-					md2.mesh.edges(pos,3)=-1;
-					pos=find(md2.mesh.edges(:,4)==0);
-					md2.mesh.edges(pos,4)=-1;
-					%Invert -1 on the third column with last column (Also invert first two columns!!)
-					pos=find(md2.mesh.edges(:,3)==-1);
-					md2.mesh.edges(pos,3)=md2.mesh.edges(pos,4);
-					md2.mesh.edges(pos,4)=-1;
-					values=md2.mesh.edges(pos,2);
-					md2.mesh.edges(pos,2)=md2.mesh.edges(pos,1);
-					md2.mesh.edges(pos,1)=values;
-					%Finally remove edges that do not belong to any element
-					pos=find(md2.mesh.edges(:,3)==-1 & md2.mesh.edges(:,4)==-1);
-					md2.mesh.edges(pos,:)=[];
-				end
-			end
-
-			%Penalties
-			if ~isnan(md2.stressbalance.vertex_pairing),
-				for i=1:size(md1.stressbalance.vertex_pairing,1);
-					md2.stressbalance.vertex_pairing(i,:)=Pnode(md1.stressbalance.vertex_pairing(i,:));
-				end
-				md2.stressbalance.vertex_pairing=md2.stressbalance.vertex_pairing(find(md2.stressbalance.vertex_pairing(:,1)),:);
-			end
-			if ~isnan(md2.masstransport.vertex_pairing),
-				for i=1:size(md1.masstransport.vertex_pairing,1);
-					md2.masstransport.vertex_pairing(i,:)=Pnode(md1.masstransport.vertex_pairing(i,:));
-				end
-				md2.masstransport.vertex_pairing=md2.masstransport.vertex_pairing(find(md2.masstransport.vertex_pairing(:,1)),:);
-			end
-
-			%recreate segments
-			if isa(md1.mesh,'mesh2d') | isa(md1.mesh','mesh3dsurface'),
-				md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices);
-				md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity);
-				md2.mesh.segments=contourenvelope(md2.mesh);
-				md2.mesh.vertexonboundary=zeros(numberofvertices2,1);
-				md2.mesh.vertexonboundary(md2.mesh.segments(:,1:2))=1;
-			else
-				%First do the connectivity for the contourenvelope in 2d
-				md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements2d,md2.mesh.numberofvertices2d);
-				md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements2d,md2.mesh.vertexconnectivity);
-				segments=contourenvelope(md2.mesh);
-				md2.mesh.vertexonboundary=zeros(numberofvertices2/md2.mesh.numberoflayers,1);
-				md2.mesh.vertexonboundary(segments(:,1:2))=1;
-				md2.mesh.vertexonboundary=repmat(md2.mesh.vertexonboundary,md2.mesh.numberoflayers,1);
-				%Then do it for 3d as usual
-				md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices);
-				md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity);
-			end
-
-			%Boundary conditions: Dirichlets on new boundary
-			%Catch the elements that have not been extracted
-			orphans_elem=find(~flag_elem);
-			orphans_node=unique(md1.mesh.elements(orphans_elem,:))';
-			%Figure out which node are on the boundary between md2 and md1
-			nodestoflag1=intersect(orphans_node,pos_node);
-			nodestoflag2=Pnode(nodestoflag1);
-			if numel(md1.stressbalance.spcvx)>1 & numel(md1.stressbalance.spcvy)>1 & numel(md1.stressbalance.spcvz)>1,
-				if isprop(md1.inversion,'vx_obs') & numel(md1.inversion.vx_obs)>1 & numel(md1.inversion.vy_obs)>1
-					md2.stressbalance.spcvx(nodestoflag2)=md2.inversion.vx_obs(nodestoflag2); 
-					md2.stressbalance.spcvy(nodestoflag2)=md2.inversion.vy_obs(nodestoflag2);
-				else
-					md2.stressbalance.spcvx(nodestoflag2)=NaN;
-					md2.stressbalance.spcvy(nodestoflag2)=NaN;
-					disp(' ')
-					disp('!! extract warning: spc values should be checked !!')
-					disp(' ')
-				end
-				%put 0 for vz
-				md2.stressbalance.spcvz(nodestoflag2)=0;
-			end
-			if ~isnan(md1.thermal.spctemperature),
-				md2.thermal.spctemperature(nodestoflag2,1)=1;
-			end
-
-			%Results fields
-			if isstruct(md1.results),
-				md2.results=struct();
-				solutionfields=fields(md1.results);
-				for i=1:length(solutionfields),
-					if isstruct(md1.results.(solutionfields{i}))
-						%get subfields
-						% loop over time steps
-						for p=1:length(md1.results.(solutionfields{i}))
-							current = md1.results.(solutionfields{i})(p);
-							solutionsubfields=fields(current);
-							for j=1:length(solutionsubfields),
-							field=md1.results.(solutionfields{i})(p).(solutionsubfields{j});
-							if length(field)==numberofvertices1,
-								md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_node);
-							elseif length(field)==numberofelements1,
-								md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_elem);
-							else
-								md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field;
-							end
-							end
-						end
-					else
-						field=md1.results.(solutionfields{i});
-						if length(field)==numberofvertices1,
-							md2.results.(solutionfields{i})=field(pos_node);
-						elseif length(field)==numberofelements1,
-							md2.results.(solutionfields{i})=field(pos_elem);
-						else
-							md2.results.(solutionfields{i})=field;
-						end
-					end
-				end
-			end
-
-			%OutputDefinitions fields
-			for i=1:length(md1.outputdefinition.definitions),
-				if isobject(md1.outputdefinition.definitions{i})
-					%get subfields
-					solutionsubfields=fields(md1.outputdefinition.definitions{i});
-					for j=1:length(solutionsubfields),
-						field=md1.outputdefinition.definitions{i}.(solutionsubfields{j});
-						if length(field)==numberofvertices1,
-							md2.outputdefinition.definitions{i}.(solutionsubfields{j})=field(pos_node);
-						elseif length(field)==numberofelements1,
-							md2.outputdefinition.definitions{i}.(solutionsubfields{j})=field(pos_elem);
-						elseif size(field,1)==numberofvertices1+1
-							md2.outputdefinition.definitions{i}.(solutionsubfields{j})=[field(pos_node,:); field(end,:)];
-						end
-					end
-				end
-			end
-			
-			%independents
-			for i=1:length(md1.autodiff.independents)
-				independentfield=fields(md1.autodiff.independents{i});
-				for j=1:length(independentfield)
-					field=md1.autodiff.independents{i}.(independentfield{j});
-					if length(field)==numberofvertices1
-						md2.autodiff.independents{i}.(independentfield{j})=field(pos_node);
-					elseif length(field)==numberofelements1
-						md2.autodiff.independents{i}.(independentfield{j})=field(pos_elem);
-					end
-				end
-			end
-
-			%Keep track of pos_node and pos_elem
-			md2.mesh.extractedvertices=pos_node;
-			md2.mesh.extractedelements=pos_elem;
-		end % }}}
-		function md2 = refine(md) % {{{
-			%refine - split all triangles into 3 to refine the mesh everywhere
-			%
-			%   This function only works for 2d triangle meshes
-			%
-			%   Usage:
-			%      md2=refine(md);
-			%
-			%   See also: EXTRUDE, COLLAPSE, EXTRACT
-
-			%Check incoming 
-			if ~strcmp(elementtype(md.mesh),'Tria')
-				error('not supported for 3d meshes');
-			end
-
-			%copy model
-			md2=md;
-
-			disp('Getting edges');
-			%initialization of some variables
-			nbe   = md.mesh.numberofelements;
-			nbv   = md.mesh.numberofvertices;
-			index = md.mesh.elements;
-			elementslist=1:nbe;
-			%1: list of edges
-			edges=[index(:,[1,2]); index(:,[2,3]); index(:,[3,1])];
-			%2: find unique edges
-			[edges,I,J]=unique(sort(edges,2),'rows');
-			%3: unique edge numbers
-			vec=J;
-			%4: unique edges numbers in each triangle (2 triangles sharing the same edge will have the same edge number)
-			edges_tria=[vec(elementslist+nbe) vec(elementslist+2*nbe) vec(elementslist)];
-
-			% We divide each element as follows
-			%
-			%                   e2
-			%    n1 ------------+------------ n3
-			%       \          / \          /
-			%        \    1   /   \   3    /
-			%         \      /     \      /
-			%          \    /   2   \    /
-			%           \  /         \  /
-			%         e3 +____________\/ e1
-			%             \           /
-			%              \         /
-			%               \   4   /
-			%                \     /
-			%                 \   /
-			%                   n2
-
-			%Create new coordinates
-			disp('Remeshing...');
-			x_edges = 0.5*(md.mesh.x(edges(:,1)) + md.mesh.x(edges(:,2)));
-			y_edges = 0.5*(md.mesh.y(edges(:,1)) + md.mesh.y(edges(:,2)));
-			xnew = [md2.mesh.x;x_edges];
-			ynew = [md2.mesh.y;y_edges];
-			indexnew = [...
-				index(:,1)          nbv+edges_tria(:,3) nbv+edges_tria(:,2);...
-				nbv+edges_tria(:,2) nbv+edges_tria(:,3) nbv+edges_tria(:,1);...
-				nbv+edges_tria(:,2) nbv+edges_tria(:,1) index(:,3);...
-				nbv+edges_tria(:,3) index(:,2)          nbv+edges_tria(:,1)];
-			%md2.mesh.numberofelements = 4*nbe;
-			%md2.mesh.numberofvertices = nbv + size(edges,1);
-
-			%Call Bamg to update other mesh properties
-			[bamgmesh_out bamggeom_out]=BamgConvertMesh(indexnew,xnew,ynew);
-			md2.mesh.x              = bamgmesh_out.Vertices(:,1);
-			md2.mesh.y              = bamgmesh_out.Vertices(:,2);
-			md2.mesh.elements       = bamgmesh_out.Triangles(:,1:3);
-			md2.mesh.edges          = bamgmesh_out.IssmEdges;
-			md2.mesh.segments       = bamgmesh_out.IssmSegments(:,1:3);
-			md2.mesh.segmentmarkers = bamgmesh_out.IssmSegments(:,4);
-			md2.mesh.numberofelements = size(md2.mesh.elements,1);
-			md2.mesh.numberofvertices = length(md2.mesh.x);
-			md2.mesh.numberofedges    = size(md2.mesh.edges,1);
-			md2.mesh.vertexonboundary = zeros(md2.mesh.numberofvertices,1); md2.mesh.vertexonboundary(md2.mesh.segments(:,1:2)) = 1;
-
-			%Deal with boundary
-			md2.mesh.vertexonboundary = [md.mesh.vertexonboundary;sum(md.mesh.vertexonboundary(edges),2)==2];
-			md2.mesh.elementconnectivity=bamgmesh_out.ElementConnectivity;
-			md2.mesh.elementconnectivity(find(isnan(md2.mesh.elementconnectivity)))=0;
-			disp(['   Old number of elements: ' num2str(nbe)]);
-			disp(['   New number of elements: ' num2str(4*nbe)]);
-
-			disp('Interpolate all fields');
-			numberofvertices1 = md.mesh.numberofvertices;
-			numberofelements1 = md.mesh.numberofelements;
-			nbv2 = md2.mesh.numberofvertices;
-
-			%Create transformation vectors
-			nbedges = size(edges,1);
-			Pelem = sparse(1:4*nbe,repmat([1:nbe],1,4),ones(4*nbe,1),4*nbe,nbe);
-			Pnode = sparse([1:nbv,repmat([nbv+1:nbv+nbedges],1,2)],[1:nbv edges(:)'],[ones(nbv,1);1/2*ones(2*nbedges,1)],md2.mesh.numberofvertices,nbv);
-
-			%Deal with mesh
-			if numel(md.mesh.scale_factor)==md.mesh.numberofvertices
-				md2.mesh.scale_factor=Pnode*md.mesh.scale_factor;
-			end
-
-			%loop over model fields
-			model_fields=setxor(fields(md),{'mesh'});
-			%remove mesh from this field
-			for i=1:length(model_fields),
-				%get field
-				field=md.(model_fields{i});
-				fieldsize=size(field);
-				if isobject(field), %recursive call
-					object_fields=fields(md.(model_fields{i}));
-					for j=1:length(object_fields),
-						%get field
-						field=md.(model_fields{i}).(object_fields{j});
-						fieldsize=size(field);
-						%size = number of nodes * n
-						if fieldsize(1)==numberofvertices1
-							md2.(model_fields{i}).(object_fields{j})=Pnode*field;
-						elseif (fieldsize(1)==numberofvertices1+1)
-							md2.(model_fields{i}).(object_fields{j})=[Pnode*field(1:end-1,:); field(end,:)];
-							%size = number of elements * n
-						elseif fieldsize(1)==numberofelements1
-							md2.(model_fields{i}).(object_fields{j})=Pelem*field;
-						elseif (fieldsize(1)==numberofelements1+1)
-							md2.(model_fields{i}).(object_fields{j})=[Pelem*field(1:end-1,:); field(end,:)];
-						end
-					end
-				else
-					%size = number of nodes * n
-					if fieldsize(1)==numberofvertices1
-						md2.(model_fields{i})=Pnode*field;
-					elseif (fieldsize(1)==numberofvertices1+1)
-						md2.(model_fields{i})=[Pnode*field(1:end-1,:); field(end,:)];
-						%size = number of elements * n
-					elseif fieldsize(1)==numberofelements1
-						md2.(model_fields{i})=Pelem*field;
-					elseif (fieldsize(1)==numberofelements1+1)
-						md2.(model_fields{i})=[Pelem*field(1:end-1,:); field(end,:)];
-					end
-				end
-			end
-
-		end % }}}
-		function md = extrude(md,varargin) % {{{
-			%EXTRUDE - vertically extrude a 2d mesh
-			%
-			%   vertically extrude a 2d mesh and create corresponding 3d mesh.
-			%   The vertical distribution can:
-			%    - follow a polynomial law
-			%    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
-			%    - be discribed by a list of coefficients (between 0 and 1)
-			%   
-			%
-			%   Usage:
-			%      md=extrude(md,numlayers,extrusionexponent);
-			%      md=extrude(md,numlayers,lowerexponent,upperexponent);
-			%      md=extrude(md,listofcoefficients);
-			%
-			%   Example:
-			%      md=extrude(md,15,1.3);
-			%      md=extrude(md,15,1.3,1.2);
-			%      md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]);
-			%
-			%   See also: MODELEXTRACT, COLLAPSE
-
-			%some checks on list of arguments
-			if ((nargin>4) | (nargin<2) | (nargout~=1)),
-				help extrude;
-				error('extrude error message');
-			end
-			if numel(md.geometry.base)~=md.mesh.numberofvertices || numel(md.geometry.surface)~=md.mesh.numberofvertices
-				error('model has not been parameterized yet: base and/or surface not set');
-			end
-
-			%Extrude the mesh
-			if nargin==2, %list of coefficients
-				clist=varargin{1};
-				if any(clist<0) | any(clist>1),
-					error('extrusioncoefficients must be between 0 and 1');
-				end
-				extrusionlist=sort(unique([clist(:);0;1]));
-				numlayers=length(extrusionlist);
-			elseif nargin==3, %one polynomial law
-				if varargin{2}<=0,
-					help extrude;
-					error('extrusionexponent must be >=0');
-				end
-				numlayers=varargin{1};
-				extrusionlist=((0:1:numlayers-1)/(numlayers-1)).^varargin{2};
-			elseif nargin==4, %two polynomial laws
-				numlayers=varargin{1};
-				lowerexp=varargin{2};
-				upperexp=varargin{3};
-
-				if varargin{2}<=0 | varargin{3}<=0,
-					help extrude;
-					error('lower and upper extrusionexponents must be >=0');
-				end
-
-				lowerextrusionlist=[(0:2/(numlayers-1):1).^lowerexp]/2;
-				upperextrusionlist=[(0:2/(numlayers-1):1).^upperexp]/2;
-				extrusionlist=sort(unique([lowerextrusionlist 1-upperextrusionlist]));
-
-			end
-
-			if numlayers<2,
-				error('number of layers should be at least 2');
-			end
-			if strcmp(md.mesh.domaintype(),'3D')
-				error('Cannot extrude a 3d mesh (extrude cannot be called more than once)');
-			end
-
-			%Initialize with 2d mesh
-			mesh2d = md.mesh;
-			md.mesh=mesh3dprisms();
-			md.mesh.x                           = mesh2d.x;
-			md.mesh.y                           = mesh2d.y;
-			md.mesh.elements                    = mesh2d.elements;
-			md.mesh.numberofelements            = mesh2d.numberofelements;
-			md.mesh.numberofvertices            = mesh2d.numberofvertices;
-
-			md.mesh.lat                         = mesh2d.lat;
-			md.mesh.long                        = mesh2d.long;
-			md.mesh.epsg                        = mesh2d.epsg;
-			md.mesh.scale_factor                = mesh2d.scale_factor;
-
-			md.mesh.vertexonboundary            = mesh2d.vertexonboundary;
-			md.mesh.vertexconnectivity          = mesh2d.vertexconnectivity;
-			md.mesh.elementconnectivity         = mesh2d.elementconnectivity;
-			md.mesh.average_vertex_connectivity = mesh2d.average_vertex_connectivity;
-
-			md.mesh.extractedvertices           = mesh2d.extractedvertices;
-			md.mesh.extractedelements           = mesh2d.extractedelements;
-
-			md.mesh.segments2d                  = mesh2d.segments;
-
-			x3d=[]; 
-			y3d=[];
-			z3d=[];  %the lower node is on the bed
-			thickness3d=md.geometry.thickness; %thickness and bed for these nodes
-			bed3d=md.geometry.base;
-
-			%Create the new layers
-			for i=1:numlayers,
-				x3d=[x3d; md.mesh.x]; 
-				y3d=[y3d; md.mesh.y];
-				%nodes are distributed between bed and surface accordingly to the given exponent
-				z3d=[z3d; bed3d+thickness3d*extrusionlist(i)]; 
-			end
-			number_nodes3d=size(x3d,1); %number of 3d nodes for the non extruded part of the mesh
-
-			%Extrude elements 
-			elements3d=[];
-			for i=1:numlayers-1,
-				elements3d=[elements3d;[md.mesh.elements+(i-1)*md.mesh.numberofvertices md.mesh.elements+i*md.mesh.numberofvertices]]; %Create the elements of the 3d mesh for the non extruded part
-			end
-			number_el3d=size(elements3d,1); %number of 3d nodes for the non extruded part of the mesh
-
-			%Keep a trace of lower and upper nodes
-			lowervertex=NaN*ones(number_nodes3d,1);
-			uppervertex=NaN*ones(number_nodes3d,1);
-			lowervertex(md.mesh.numberofvertices+1:end)=1:(numlayers-1)*md.mesh.numberofvertices;
-			uppervertex(1:(numlayers-1)*md.mesh.numberofvertices)=md.mesh.numberofvertices+1:number_nodes3d;
-			md.mesh.lowervertex=lowervertex;
-			md.mesh.uppervertex=uppervertex;
-
-			%same for lower and upper elements
-			lowerelements=NaN*ones(number_el3d,1);
-			upperelements=NaN*ones(number_el3d,1);
-			lowerelements(md.mesh.numberofelements+1:end)=1:(numlayers-2)*md.mesh.numberofelements;
-			upperelements(1:(numlayers-2)*md.mesh.numberofelements)=md.mesh.numberofelements+1:(numlayers-1)*md.mesh.numberofelements;
-			md.mesh.lowerelements=lowerelements;
-			md.mesh.upperelements=upperelements;
-
-			%Save old mesh 
-			md.mesh.x2d=md.mesh.x;
-			md.mesh.y2d=md.mesh.y;
-			md.mesh.elements2d=md.mesh.elements;
-			md.mesh.numberofelements2d=md.mesh.numberofelements;
-			md.mesh.numberofvertices2d=md.mesh.numberofvertices;
-
-			%Build global 3d mesh 
-			md.mesh.elements=elements3d;
-			md.mesh.x=x3d;
-			md.mesh.y=y3d;
-			md.mesh.z=z3d;
-			md.mesh.numberofelements=number_el3d;
-			md.mesh.numberofvertices=number_nodes3d;
-			md.mesh.numberoflayers=numlayers;
-
-			%Ok, now deal with the other fields from the 2d mesh:
-
-			%bedinfo and surface info
-			md.mesh.vertexonbase=project3d(md,'vector',ones(md.mesh.numberofvertices2d,1),'type','node','layer',1);
-			md.mesh.vertexonsurface=project3d(md,'vector',ones(md.mesh.numberofvertices2d,1),'type','node','layer',md.mesh.numberoflayers);
-			md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node');
-
-			%lat long
-			md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node');
-			md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node');
-			md.mesh.scale_factor=project3d(md,'vector',md.mesh.scale_factor,'type','node');
-
-			md.geometry=extrude(md.geometry,md);
-			md.friction  = extrude(md.friction,md);
-			md.inversion = extrude(md.inversion,md);
-			md.smb = extrude(md.smb,md);
-			md.initialization = extrude(md.initialization,md);
-
-			md.flowequation=md.flowequation.extrude(md);
-			md.stressbalance=extrude(md.stressbalance,md);
-			md.thermal=md.thermal.extrude(md);
-			md.masstransport=md.masstransport.extrude(md);
-			md.levelset=extrude(md.levelset,md);
-			md.calving=extrude(md.calving,md);
-			md.frontalforcings=extrude(md.frontalforcings,md);
-			md.hydrology = extrude(md.hydrology,md);
-			md.debris = extrude(md.debris,md);
-			md.solidearth = extrude(md.solidearth,md);
-			md.dsl = extrude(md.dsl,md);
-			md.stochasticforcing = extrude(md.stochasticforcing,md);
-
-			%connectivity
-			if ~isnan(md.mesh.elementconnectivity)
-				md.mesh.elementconnectivity=repmat(md.mesh.elementconnectivity,numlayers-1,1);
-				md.mesh.elementconnectivity(find(md.mesh.elementconnectivity==0))=NaN;
-				for i=2:numlayers-1,
-					md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)...
-						=md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)+md.mesh.numberofelements2d;
-				end
-				md.mesh.elementconnectivity(find(isnan(md.mesh.elementconnectivity)))=0;
-			end
-
-			md.materials=extrude(md.materials,md);
-			md.damage=extrude(md.damage,md);
-			md.mask=extrude(md.mask,md);
-			md.qmu=extrude(md.qmu,md);
-			md.basalforcings=extrude(md.basalforcings,md);
-			md.outputdefinition=extrude(md.outputdefinition,md);
-
-			%increase connectivity if less than 25:
-			if md.mesh.average_vertex_connectivity<=25,
-				md.mesh.average_vertex_connectivity=100;
-			end
-		end % }}}
-		function md = structtomodel(md,structmd) % {{{
-
-			if ~isstruct(structmd) error('input model is not a structure'); end
-
-			%loaded model is a struct, initialize output and recover all fields
-			md = structtoobj(model,structmd);
-
-			%Old field now classes
-			if (isfield(structmd,'timestepping') & isnumeric(md.timestepping)), md.timestepping=timestepping(); end
-			if (isfield(structmd,'mask') & isnumeric(md.mask)),md.mask=mask(); end
-
-			%Field name change
-			if isfield(structmd,'drag'), md.friction.coefficient=structmd.drag; end
-			if isfield(structmd,'p'), md.friction.p=structmd.p; end
-			if isfield(structmd,'q'), md.friction.q=structmd.p; end
-			if isfield(structmd,'melting'), md.basalforcings.floatingice_melting_rate=structmd.melting; end
-			if isfield(structmd,'melting_rate'), md.basalforcings.floatingice_melting_rate=structmd.melting_rate; end
-			if isfield(structmd,'melting_rate'), md.basalforcings.groundedice_melting_rate=structmd.melting_rate; end
-			if isfield(structmd,'accumulation'), md.smb.mass_balance=structmd.accumulation; end
-			if isfield(structmd,'numberofgrids'), md.mesh.numberofvertices=structmd.numberofgrids; end
-			if isfield(structmd,'numberofgrids2d'), md.mesh.numberofvertices2d=structmd.numberofgrids2d; end
-			if isfield(structmd,'uppergrids'), md.mesh.uppervertex=structmd.uppergrids; end
-			if isfield(structmd,'lowergrids'), md.mesh.lowervertex=structmd.lowergrids; end
-			if isfield(structmd,'gridonbase'), md.mesh.vertexonbase=structmd.gridonbase; end
-			if isfield(structmd,'gridonsurface'), md.mesh.vertexonsurface=structmd.gridonsurface; end
-			if isfield(structmd,'extractedgrids'), md.mesh.extractedvertices=structmd.extractedgrids; end
-			if isfield(structmd,'gridonboundary'), md.mesh.vertexonboundary=structmd.gridonboundary; end
-			if isfield(structmd,'petscoptions') & ~isempty(structmd.petscoptions), md.toolkits=structmd.petscoptions; end
-			if isfield(structmd,'g'), md.constants.g=structmd.g; end
-			if isfield(structmd,'yts'), md.constants.yts=structmd.yts; end
-			if isfield(structmd,'surface_mass_balance'), md.smb.mass_balance=structmd.surface_mass_balance; end
-			if isfield(structmd,'basal_melting_rate'), md.basalforcings.floatingice_melting_rate=structmd.basal_melting_rate; end
-			if isfield(structmd,'geothermalflux'), md.basalforcings.geothermalflux=structmd.geothermalflux; end
-			if isfield(structmd,'drag'), md.friction.coefficient=structmd.drag; end
-			if isfield(structmd,'drag_coefficient'), md.friction.coefficient=structmd.drag_coefficient; end
-			if isfield(structmd,'drag_p'), md.friction.p=structmd.drag_p; end
-			if isfield(structmd,'drag_q'), md.friction.q=structmd.drag_q; end
-			if isfield(structmd,'riftproperties'), %old implementation
-				md.rifts=rifts();
-				md.rifts.riftproperties=structmd.riftproperties; 
-				md.rifts.riftstruct=structmd.rifts;
-				md.rifts.riftproperties=structmd.riftinfo;
-			end
-			if isfield(structmd,'bamg'), md.private.bamg=structmd.bamg; end
-			if isfield(structmd,'lowmem'), md.settings.lowmem=structmd.lowmem; end
-			if isfield(structmd,'io_gather'), md.settings.io_gather=structmd.io_gather; end
-			if isfield(structmd,'spcwatercolumn'), md.hydrology.spcwatercolumn=structmd.spcwatercolumn; end
-			if isfield(structmd,'hydro_n'), md.hydrology.n=structmd.hydro_n; end
-			if isfield(structmd,'hydro_p'), md.hydrology.p=structmd.hydro_p; end
-			if isfield(structmd,'hydro_q'), md.hydrology.q=structmd.hydro_q; end
-			if isfield(structmd,'hydro_CR'), md.hydrology.CR=structmd.hydro_CR; end
-			if isfield(structmd,'hydro_kn'), md.hydrology.kn=structmd.hydro_kn; end
-			if isfield(structmd,'spctemperature'), md.thermal.spctemperature=structmd.spctemperature; end
-			if isfield(structmd,'min_thermal_constraints'), md.thermal.penalty_threshold=structmd.min_thermal_constraints; end
-			if isfield(structmd,'artificial_diffusivity'), md.thermal.stabilization=structmd.artificial_diffusivity; end
-			if isfield(structmd,'max_nonlinear_iterations'), md.thermal.maxiter=structmd.max_nonlinear_iterations; end
-			if isfield(structmd,'stabilize_constraints'), md.thermal.penalty_lock=structmd.stabilize_constraints; end
-			if isfield(structmd,'penalty_offset'), md.thermal.penalty_factor=structmd.penalty_offset; end
-			if isfield(structmd,'name'), md.miscellaneous.name=structmd.name; end
-			if isfield(structmd,'notes'), md.miscellaneous.notes=structmd.notes; end
-			if isfield(structmd,'dummy'), md.miscellaneous.dummy=structmd.dummy; end
-			if isfield(structmd,'dt'), md.timestepping.time_step=structmd.dt; end
-			if isfield(structmd,'ndt'), md.timestepping.final_time=structmd.ndt; end
-			if isfield(structmd,'time_adapt'), md.timestepping.time_adapt=structmd.time_adapt; end
-			if isfield(structmd,'cfl_coefficient'), md.timestepping.cfl_coefficient=structmd.cfl_coefficient; end
-			if isfield(structmd,'spcthickness'), md.masstransport.spcthickness=structmd.spcthickness; end
-			if isfield(structmd,'spcthickness'), md.debris.spcthickness=structmd.spcthickness; end
-			if isfield(structmd,'artificial_diffusivity'), md.masstransport.stabilization=structmd.artificial_diffusivity; end
-			if isfield(structmd,'hydrostatic_adjustment'), md.masstransport.hydrostatic_adjustment=structmd.hydrostatic_adjustment; end
-			if isfield(structmd,'penalties'), md.masstransport.vertex_pairing=structmd.penalties; end
-			if isfield(structmd,'penalty_offset'), md.masstransport.penalty_factor=structmd.penalty_offset; end
-			if isfield(structmd,'B'), md.materials.rheology_B=structmd.B; end
-			if isfield(structmd,'n'), md.materials.rheology_n=structmd.n; end
-			if isfield(structmd,'rheology_B'), md.materials.rheology_B=structmd.rheology_B; end
-			if isfield(structmd,'rheology_n'), md.materials.rheology_n=structmd.rheology_n; end
-			if isfield(structmd,'rheology_Z'), md.damage.D=(1-structmd.rheology_Z); end
-			if isfield(structmd,'spcthickness'), md.balancethickness.spcthickness=structmd.spcthickness; end
-			if isfield(structmd,'artificial_diffusivity'), md.balancethickness.stabilization=structmd.artificial_diffusivity; end
-			if isfield(structmd,'dhdt'), md.balancethickness.thickening_rate=structmd.dhdt; end
-			if isfield(structmd,'isSIA'), md.flowequation.isSIA=structmd.isSIA; end
-			if isfield(structmd,'isFS'), md.flowequation.isFS=structmd.isFS; end
-			if isfield(structmd,'elements_type'), md.flowequation.element_equation=structmd.elements_type; end
-			if isfield(structmd,'vertices_type'), md.flowequation.vertex_equation=structmd.vertices_type; end
-			if isfield(structmd,'eps_rel'), md.steadystate.reltol=structmd.eps_rel; end
-			if isfield(structmd,'max_steadystate_iterations'), md.steadystate.maxiter=structmd.max_steadystate_iterations; end
-			if isfield(structmd,'isdiagnostic'), md.transient.isstressbalance=structmd.isdiagnostic; end
-			if isfield(structmd,'isprognostic'), md.transient.ismasstransport=structmd.isprognostic; end
-			if isfield(structmd,'isthermal'), md.transient.isthermal=structmd.isthermal; end
-			if isfield(structmd,'control_analysis'), md.inversion.iscontrol=structmd.control_analysis; end
-			if isfield(structmd,'weights'), md.inversion.cost_functions_coefficients=structmd.weights; end
-			if isfield(structmd,'nsteps'), md.inversion.nsteps=structmd.nsteps; end
-			if isfield(structmd,'maxiter_per_step'), md.inversion.maxiter_per_step=structmd.maxiter_per_step; end
-			if isfield(structmd,'cm_min'), md.inversion.min_parameters=structmd.cm_min; end
-			if isfield(structmd,'cm_max'), md.inversion.max_parameters=structmd.cm_max; end
-			if isfield(structmd,'vx_obs'), md.inversion.vx_obs=structmd.vx_obs; end
-			if isfield(structmd,'vy_obs'), md.inversion.vy_obs=structmd.vy_obs; end
-			if isfield(structmd,'vel_obs'), md.inversion.vel_obs=structmd.vel_obs; end
-			if isfield(structmd,'thickness_obs'), md.inversion.thickness_obs=structmd.thickness_obs; end
-			if isfield(structmd,'vx'), md.initialization.vx=structmd.vx; end
-			if isfield(structmd,'vy'), md.initialization.vy=structmd.vy; end
-			if isfield(structmd,'vz'), md.initialization.vz=structmd.vz; end
-			if isfield(structmd,'vel'), md.initialization.vel=structmd.vel; end
-			if isfield(structmd,'pressure'), md.initialization.pressure=structmd.pressure; end
-			if isfield(structmd,'temperature'), md.initialization.temperature=structmd.temperature; end
-			if isfield(structmd,'waterfraction'), md.initialization.waterfraction=structmd.waterfraction; end
-			if isfield(structmd,'watercolumn'), md.initialization.watercolumn=structmd.watercolumn; end
-			if isfield(structmd,'surface'), md.geometry.surface=structmd.surface; end
-			if isfield(structmd,'bed'), md.geometry.base=structmd.bed; end
-			if isfield(structmd,'thickness'), md.geometry.thickness=structmd.thickness; end
-			if isfield(structmd,'bathymetry'), md.geometry.bed=structmd.bathymetry; end
-			if isfield(structmd,'thickness_coeff'), md.geometry.hydrostatic_ratio=structmd.thickness_coeff; end
-			if isfield(structmd,'connectivity'), md.mesh.average_vertex_connectivity=structmd.connectivity; end
-			if isfield(structmd,'extractednodes'), md.mesh.extractedvertices=structmd.extractednodes; end
-			if isfield(structmd,'extractedelements'), md.mesh.extractedelements=structmd.extractedelements; end
-			if isfield(structmd,'nodeonboundary'), md.mesh.vertexonboundary=structmd.nodeonboundary; end
-			if isfield(structmd,'lat'), md.mesh.lat=structmd.lat; end
-			if isfield(structmd,'long'), md.mesh.long=structmd.long; end
-			if isfield(structmd,'scale_factor'), md.mesh.scale_factor=structmd.scale_factor; end
-			if isfield(structmd,'segments'), md.mesh.segments=structmd.segments; end
-			if isfield(structmd,'segmentmarkers'), md.mesh.segmentmarkers=structmd.segmentmarkers; end
-			if isfield(structmd,'numlayers'), md.mesh.numberoflayers=structmd.numlayers; end
-			if isfield(structmd,'numberofelements'), md.mesh.numberofelements=structmd.numberofelements; end
-			if isfield(structmd,'numberofvertices'), md.mesh.numberofvertices=structmd.numberofvertices; end
-			if isfield(structmd,'numberofnodes'), md.mesh.numberofvertices=structmd.numberofnodes; end
-			if isfield(structmd,'numberofedges'), md.mesh.numberofedges=structmd.numberofedges; end
-			if isfield(structmd,'numberofelements2d'), md.mesh.numberofelements2d=structmd.numberofelements2d; end
-			if isfield(structmd,'numberofnodes2d'), md.mesh.numberofvertices2d=structmd.numberofnodes2d; end
-			if isfield(structmd,'nodeconnectivity'), md.mesh.vertexconnectivity=structmd.nodeconnectivity; end
-			if isfield(structmd,'elementconnectivity'), md.mesh.elementconnectivity=structmd.elementconnectivity; end
-			if isfield(structmd,'uppernodes'), md.mesh.uppervertex=structmd.uppernodes; end
-			if isfield(structmd,'lowernodes'), md.mesh.lowervertex=structmd.lowernodes; end
-			if isfield(structmd,'upperelements'), md.mesh.upperelements=structmd.upperelements; end
-			if isfield(structmd,'lowerelements'), md.mesh.lowerelements=structmd.lowerelements; end
-			if isfield(structmd,'nodeonsurface'), md.mesh.vertexonsurface=structmd.nodeonsurface; end
-			if isfield(structmd,'nodeonbase'), md.mesh.vertexonbase=structmd.nodeonbase; end
-			if isfield(structmd,'elements2d'), md.mesh.elements2d=structmd.elements2d; end
-			if isfield(structmd,'y2d'), md.mesh.y2d=structmd.y2d; end
-			if isfield(structmd,'x2d'), md.mesh.x2d=structmd.x2d; end
-			if isfield(structmd,'elements'), md.mesh.elements=structmd.elements; end
-			if isfield(structmd,'edges'), 
-				md.mesh.edges=structmd.edges; 
-				md.mesh.edges(isnan(md.mesh.edges))=-1;
-			end
-			if isfield(structmd,'y'), md.mesh.y=structmd.y; end
-			if isfield(structmd,'x'), md.mesh.x=structmd.x; end
-			if isfield(structmd,'z'), md.mesh.z=structmd.z; end
-			if isfield(structmd,'diagnostic_ref'), md.stressbalance.referential=structmd.diagnostic_ref; end
-			if isfield(structmd,'npart'); md.qmu.numberofpartitions=structmd.npart; end
-			if isfield(structmd,'part'); md.qmu.partition=structmd.part; end
-
-			if isnumeric(md.verbose),
-				md.verbose=verbose;
-			end
-
-			if isfield(structmd,'spcvelocity'), 
-				md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
-				md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);
-				md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);
-				pos=find(structmd.spcvelocity(:,1)); md.stressbalance.spcvx(pos)=structmd.spcvelocity(pos,4); 
-				pos=find(structmd.spcvelocity(:,2)); md.stressbalance.spcvy(pos)=structmd.spcvelocity(pos,5); 
-				pos=find(structmd.spcvelocity(:,3)); md.stressbalance.spcvz(pos)=structmd.spcvelocity(pos,6); 
-			end
-			if isfield(structmd,'spcvx'), 
-				md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
-				pos=find(~isnan(structmd.spcvx)); md.stressbalance.spcvx(pos)=structmd.spcvx(pos); 
-			end
-			if isfield(structmd,'spcvy'),
-				md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);
-				pos=find(~isnan(structmd.spcvy)); md.stressbalance.spcvy(pos)=structmd.spcvy(pos);     
-			end
-			if isfield(structmd,'spcvz'),
-				md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);
-				pos=find(~isnan(structmd.spcvz)); md.stressbalance.spcvz(pos)=structmd.spcvz(pos);     
-			end
-			if isfield(structmd,'pressureload'),
-				if ~isempty(structmd.pressureload) & ismember(structmd.pressureload(end,end),[118 119 120]),
-					pos=find(structmd.pressureload(:,end)==120); md.stressbalance.icefront(pos,end)=0;
-					pos=find(structmd.pressureload(:,end)==118); md.stressbalance.icefront(pos,end)=1;
-					pos=find(structmd.pressureload(:,end)==119); md.stressbalance.icefront(pos,end)=2;
-				end
-			end
-			if isfield(structmd,'elements_type') & structmd.elements_type(end,end)>50,
-				pos=find(structmd.elements_type==59); md.flowequation.element_equation(pos,end)=0;
-				pos=find(structmd.elements_type==55); md.flowequation.element_equation(pos,end)=1;
-				pos=find(structmd.elements_type==56); md.flowequation.element_equation(pos,end)=2;
-				pos=find(structmd.elements_type==60); md.flowequation.element_equation(pos,end)=3;
-				pos=find(structmd.elements_type==62); md.flowequation.element_equation(pos,end)=4;
-				pos=find(structmd.elements_type==57); md.flowequation.element_equation(pos,end)=5;
-				pos=find(structmd.elements_type==58); md.flowequation.element_equation(pos,end)=6;
-				pos=find(structmd.elements_type==61); md.flowequation.element_equation(pos,end)=7;
-			end
-			if isfield(structmd,'vertices_type') & structmd.vertices_type(end,end)>50,
-				pos=find(structmd.vertices_type==59); md.flowequation.vertex_equation(pos,end)=0;
-				pos=find(structmd.vertices_type==55); md.flowequation.vertex_equation(pos,end)=1;
-				pos=find(structmd.vertices_type==56); md.flowequation.vertex_equation(pos,end)=2;
-				pos=find(structmd.vertices_type==60); md.flowequation.vertex_equation(pos,end)=3;
-				pos=find(structmd.vertices_type==62); md.flowequation.vertex_equation(pos,end)=4;
-				pos=find(structmd.vertices_type==57); md.flowequation.vertex_equation(pos,end)=5;
-				pos=find(structmd.vertices_type==58); md.flowequation.vertex_equation(pos,end)=6;
-				pos=find(structmd.vertices_type==61); md.flowequation.vertex_equation(pos,end)=7;
-			end
-			if isfield(structmd,'rheology_law') & isnumeric(structmd.rheology_law),
-				if (structmd.rheology_law==272), md.materials.rheology_law='None';      end
-				if (structmd.rheology_law==368), md.materials.rheology_law='Paterson';  end
-				if (structmd.rheology_law==369), md.materials.rheology_law='Arrhenius'; end
-			end
-			if isfield(structmd,'groundingline_migration') & isnumeric(structmd.groundingline_migration),
-				if (structmd.groundingline_migration==272), md.groundingline.migration='None';      end
-				if (structmd.groundingline_migration==273), md.groundingline.migration='AggressiveMigration';  end
-				if (structmd.groundingline_migration==274), md.groundingline.migration='SoftMigration'; end
-			end
-			if isfield(structmd,'control_type') & isnumeric(structmd.control_type),
-				if (structmd.control_type==143), md.inversion.control_parameters={'FrictionCoefficient'}; end
-				if (structmd.control_type==190), md.inversion.control_parameters={'RheologyBbar'}; end
-				if (structmd.control_type==147), md.inversion.control_parameters={'Thickeningrate'}; end
-			end
-			if isfield(structmd,'cm_responses') & ismember(structmd.cm_responses(end,end),[165:170 383 388 389]),
-				pos=find(structmd.cm_responses==166); md.inversion.cost_functions(pos)=101;
-				pos=find(structmd.cm_responses==167); md.inversion.cost_functions(pos)=102;
-				pos=find(structmd.cm_responses==168); md.inversion.cost_functions(pos)=103;
-				pos=find(structmd.cm_responses==169); md.inversion.cost_functions(pos)=104;
-				pos=find(structmd.cm_responses==170); md.inversion.cost_functions(pos)=105;
-				pos=find(structmd.cm_responses==165); md.inversion.cost_functions(pos)=201;
-				pos=find(structmd.cm_responses==389); md.inversion.cost_functions(pos)=501;
-				pos=find(structmd.cm_responses==388); md.inversion.cost_functions(pos)=502;
-				pos=find(structmd.cm_responses==382); md.inversion.cost_functions(pos)=503;
-			end
-
-			if isfield(structmd,'artificial_diffusivity') & structmd.artificial_diffusivity==2,
-					md.thermal.stabilization=2;
-					md.masstransport.stabilization=1;
-					md.balancethickness.stabilization=1;
-			end
-			if isnumeric(md.masstransport.hydrostatic_adjustment)
-				if md.masstransport.hydrostatic_adjustment==269,
-					md.masstransport.hydrostatic_adjustment='Incremental';
-				else
-					md.masstransport.hydrostatic_adjustment='Absolute';
-				end
-			end
-
-			%New fields
-			if ~isfield(structmd,'upperelements') & isa(md.mesh,'mesh3dprisms')
-				md.mesh.upperelements=transpose(1:md.mesh.numberofelements)+md.mesh.numberofelements2d;
-				md.mesh.upperelements(end-md.mesh.numberofelements2d+1:end)=NaN;
-			end
-			if ~isfield(structmd,'lowerelements') & isa(md.mesh,'mesh3dprisms')
-				md.mesh.lowerelements=transpose(1:md.mesh.numberofelements)-md.mesh.numberofelements2d;
-				md.mesh.lowerelements(1:md.mesh.numberofelements2d)=NaN;
-			end
-			if ~isfield(structmd,'diagnostic_ref');
-				md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6);
-			end
-			if ~isfield(structmd,'loadingforce');
-				md.stressbalance.loadingforce=0*ones(md.mesh.numberofvertices,3);
-			end
-
-			%2013 August 9
-			if isfield(structmd,'prognostic') & isa(structmd.prognostic,'prognostic'),
-				disp('Recovering old prognostic class');
-				md.masstransport=masstransport(structmd.prognostic);
-			end
-			%2013 August 9
-			if isfield(structmd,'diagnostic') & (isa(structmd.diagnostic,'diagnostic') || isa(structmd.diagnostic,'stressbalance')),
-				disp('Recovering old diagnostic class');
-				md.stressbalance=stressbalance(structmd.diagnostic);
-			end
-			%2014 January 9th
-			if isfield(structmd,'surfaceforcings') & isa(md.smb,'surfaceforcings'),
-				disp('Recovering old surfaceforcings class');
-				mass_balance=structmd.surfaceforcings.mass_balance;
-				md.smb=SMB();
-				md.smb.mass_balance=mass_balance;
-			end
-			%2015 September 10
-			if isfield(structmd,'surfaceforcings') & isa(structmd.surfaceforcings,'SMB'),
-				disp('Recovering old SMB class');
-				md.smb=SMBforcing(structmd.surfaceforcings);
-			end
-			if isfield(structmd,'surfaceforcings') & isa(structmd.surfaceforcings,'SMBhenning'),
-				disp('Recovering old SMBhenning class');
-				md.smb=SMBhenning(structmd.surfaceforcings);
-			end
-			if isfield(structmd,'slr') && ~isempty(structmd.slr)
-				md.solidearth       = solidearth('Earth');
-				disp('Recovering old slr class');
-				if isfield(structmd.slr,'sealevel'),
-					md.solidearth.sealevel=structmd.slr.sealevel;
-				end
-				md.solidearth.planetradius=structmd.slr.planetradius;
-				md.solidearth.requested_outputs=structmd.slr.requested_outputs;
-				md.solidearth.transitions=structmd.slr.transitions;
-
-				md.solidearth.transitions=structmd.slr.transitions;
-				md.solidearth.settings.reltol=structmd.slr.reltol;
-				md.solidearth.settings.abstol=structmd.slr.abstol;
-				md.solidearth.settings.maxiter=structmd.slr.maxiter;
-				md.solidearth.settings.rigid=structmd.slr.rigid;
-				md.solidearth.settings.elastic=structmd.slr.elastic;
-				md.solidearth.settings.rotation=structmd.slr.rotation;
-				md.solidearth.settings.runfrequency=structmd.slr.geodetic_run_frequency;
-				md.solidearth.settings.computesealevelchange=structmd.slr.geodetic;
-				md.solidearth.settings.degacc=structmd.slr.degacc;
-				md.solidearth.settings.horiz=structmd.slr.horiz;
-				md.solidearth.settings.ocean_area_scaling=structmd.slr.ocean_area_scaling;
-
-				md.solidearth.surfaceload.icethicknesschange=structmd.slr.deltathickness;
-				md.solidearth.surfaceload.waterheightchange=structmd.slr.hydro_rate;
-
-				md.solidearth.lovenumbers.h=structmd.slr.love_h;
-				md.solidearth.lovenumbers.k=structmd.slr.love_k;
-				md.solidearth.lovenumbers.l=structmd.slr.love_l;
-				md.solidearth.lovenumbers.th=structmd.slr.tide_love_h;
-				md.solidearth.lovenumbers.tk=structmd.slr.tide_love_k;
-				md.solidearth.lovenumbers.tk2secular=structmd.slr.fluid_love;
-
-				md.solidearth.rotational.equatorialmoi=structmd.slr.equatorial_moi;
-				md.solidearth.rotational.polarmoi=structmd.slr.polar_moi;
-				md.solidearth.rotational.angularvelocity=structmd.slr.angular_velocity;
-			end
-		end% }}}
-		function md = tetras(md,varargin) % {{{
-			%TETRAS - split 3d prismatic mesh into 3 tetrahedrons
-			%
-			%   Usage:
-			%      md=tetra(md)
-
-			if ~isa(md.mesh,'mesh3dprisms')
-				error('mesh is not a 3d prismatic mesh');
-			end
-
-			%Initialize tetra mesh
-			md.mesh=mesh3dtetras(md.mesh);
-
-			%Subdivision from Philipp Furnstahl (http://studierstube.icg.tugraz.at/thesis/fuernstahl_thesis.pdf)
-			steiner  = 0;
-			nbv      = md.mesh.numberofvertices;
-			nbt      = 3*md.mesh.numberofelements;
-			elements = zeros(nbt,4);
-			for i=1:md.mesh.numberofelements
-				v1=md.mesh.elements(i,1); v2=md.mesh.elements(i,2); v3=md.mesh.elements(i,3);
-				v4=md.mesh.elements(i,4); v5=md.mesh.elements(i,5); v6=md.mesh.elements(i,6);
-				if(min(v2,v4)<min(v1,v5) & min(v1,v6)<min(v3,v4) & min(v3,v5)<min(v2,v6)),
-					steiner = steiner+1; nbv = nbv+1; nbt = nbt+5; v7 = nbv;
-					md.mesh.x=[md.mesh.x; mean(md.mesh.x(md.mesh.elements(i,:)))];
-					md.mesh.y=[md.mesh.y; mean(md.mesh.y(md.mesh.elements(i,:)))];
-					md.mesh.z=[md.mesh.z; mean(md.mesh.z(md.mesh.elements(i,:)))];
-					elements(3*(i-1)+1,:) = [v1 v2 v3 v7];
-					elements(3*(i-1)+2,:) = [v1 v2 v4 v7];
-					elements(3*(i-1)+3,:) = [v2 v4 v5 v7];
-					elements(end+1,:) = [v2 v3 v5 v7];
-					elements(end+1,:) = [v3 v5 v6 v7];
-					elements(end+1,:) = [v1 v3 v6 v7];
-					elements(end+1,:) = [v1 v4 v6 v7];
-					elements(end+1,:) = [v4 v5 v6 v7];
-				elseif(min(v2,v4)<min(v1,v5) & min(v1,v6)<min(v3,v4) & min(v3,v5)>min(v2,v6)),
-					elements(3*(i-1)+1,:) = [v1 v2 v4 v6];
-					elements(3*(i-1)+2,:) = [v2 v4 v5 v6];
-					elements(3*(i-1)+3,:) = [v1 v2 v3 v6];
-				elseif(min(v2,v4)<min(v1,v5) & min(v1,v6)>min(v3,v4) & min(v3,v5)<min(v2,v6)),
-					elements(3*(i-1)+1,:) = [v1 v2 v3 v4];
-					elements(3*(i-1)+2,:) = [v2 v3 v4 v5];
-					elements(3*(i-1)+3,:) = [v3 v4 v5 v6];
-				elseif(min(v2,v4)<min(v1,v5) & min(v1,v6)>min(v3,v4) & min(v3,v5)>min(v2,v6)),
-					elements(3*(i-1)+1,:) = [v1 v2 v3 v4];
-					elements(3*(i-1)+2,:) = [v2 v4 v5 v6];
-					elements(3*(i-1)+3,:) = [v2 v3 v4 v6];
-				elseif(min(v2,v4)>min(v1,v5) & min(v1,v6)<min(v3,v4) & min(v3,v5)<min(v2,v6)),
-					elements(3*(i-1)+1,:) = [v1 v4 v5 v6];
-					elements(3*(i-1)+2,:) = [v1 v2 v3 v5];
-					elements(3*(i-1)+3,:) = [v1 v3 v5 v6];
-				elseif(min(v2,v4)>min(v1,v5) & min(v1,v6)<min(v3,v4) & min(v3,v5)>min(v2,v6)),
-					elements(3*(i-1)+1,:) = [v1 v4 v5 v6];
-					elements(3*(i-1)+2,:) = [v1 v2 v5 v6];
-					elements(3*(i-1)+3,:) = [v1 v2 v3 v6];
-				elseif(min(v2,v4)>min(v1,v5) & min(v1,v6)>min(v3,v4) & min(v3,v5)<min(v2,v6)),
-					elements(3*(i-1)+1,:) = [v1 v3 v4 v5];
-					elements(3*(i-1)+2,:) = [v1 v2 v3 v5];
-					elements(3*(i-1)+3,:) = [v3 v4 v5 v6];
-				elseif(min(v2,v4)>min(v1,v5) & min(v1,v6)<min(v3,v4) & min(v3,v5)<min(v2,v6)),
-					elements(3*(i-1)+1,:) = [v1 v5 v6 v4];
-					elements(3*(i-1)+2,:) = [v1 v2 v3 v5];
-					elements(3*(i-1)+3,:) = [v5 v6 v3 v1];
-				elseif(min(v2,v4)>min(v1,v5) & min(v1,v6)>min(v3,v4) & min(v3,v5)>min(v2,v6)),
-					steiner = steiner+1; nbv = nbv+1; nbt = nbt+5; v7 = nbv;
-					md.mesh.x=[md.mesh.x; mean(md.mesh.x(md.mesh.elements(i,:)))];
-					md.mesh.y=[md.mesh.y; mean(md.mesh.y(md.mesh.elements(i,:)))];
-					md.mesh.z=[md.mesh.z; mean(md.mesh.z(md.mesh.elements(i,:)))];
-					elements(3*(i-1)+1,:) = [v1 v2 v3 v7];
-					elements(3*(i-1)+2,:) = [v1 v4 v5 v7];
-					elements(3*(i-1)+3,:) = [v1 v2 v5 v7];
-					elements(end+1,:) = [v2 v5 v6 v7];
-					elements(end+1,:) = [v2 v3 v6 v7];
-					elements(end+1,:) = [v3 v4 v6 v7];
-					elements(end+1,:) = [v1 v3 v4 v7];
-					elements(end+1,:) = [v4 v5 v6 v7];
-				else
-					error('Case not supported'); %not supposed to happen!
-				end
-				%Reorder elements to make sure they are direct
-				for j=1:3
-					element = elements(3*(i-1)+j,:);
-					matrix = [md.mesh.x(element), md.mesh.y(element), md.mesh.z(element), ones(4,1)];
-					if det(matrix)>0,
-						elements(3*(i-1)+j,1)=element(2);
-						elements(3*(i-1)+j,2)=element(1);
-					end
-				end
-			end
-			%%Split in 3 tetras
-			%subelement1 = [1 2 3 5];
-			%subelement2 = [4 6 5 1];
-			%subelement3 = [5 6 3 1];
-			%elements=[md.mesh.elements(:,subelement1);md.mesh.elements(:,subelement2);md.mesh.elements(:,subelement3)];
-			if steiner==0,
-				disp('No Steiner point required to split prismatic mesh into tets');
-			else
-				disp([num2str(steiner) ' Steiner points had to be included'])
-				error('Steiner point not supported yet');
-			end
-
-			pos_elements = repmat([1:md.mesh.numberofelements]',3,1);
-
-			md.mesh.elements=elements;
-			md.mesh.numberofelements=size(elements,1);
-
-			%p and q (same deal, except for element that are on the bedrock: )
-			if ~isnan(md.friction.p),
-				md.friction.p=md.friction.p(pos_elements);
-				md.friction.q=md.friction.q(pos_elements);
-			end
-
-			%elementstype
-			if ~isnan(md.flowequation.element_equation)
-				oldelements_type=md.flowequation.element_equation;
-				md.flowequation.element_equation=md.flowequation.element_equation(pos_elements);
-			end
-
-			%connectivity
-			md.mesh.elementconnectivity=NaN;
-
-			%materials
-			if ~isnan(md.materials.rheology_n),
-				md.materials.rheology_n=md.materials.rheology_n(pos_elements);
-			end
-
-			%increase connectivity if less than 25:
-			if md.mesh.average_vertex_connectivity<=25,
-				md.mesh.average_vertex_connectivity=100;
-			end
-		end % }}}
-		function memory(self) % {{{
-
-			disp(sprintf('\nMemory imprint:\n'));
-
-			fields=properties('model');
-			mem=0;
-
-			for i=1:length(fields),
-				field=self.(fields{i});
-				s=whos('field'); 
-				mem=mem+s.bytes/1e6;
-				disp(sprintf('%19s: %6.2f Mb',fields{i},s.bytes/1e6));
-			end
-			disp(sprintf('%19s--%10s','--------------','--------------'));
-			disp(sprintf('%19s: %g Mb','Total',mem));
-		end
-		% }}}
-		function netcdf(self,filename) % {{{
-			%NETCDF - save model as netcdf
-			%
-			%   Usage:
-			%      netcdf(md,filename)
-			%
-			%   Example:
-			%      netcdf(md,'model.nc');
-
-			disp('Saving model as NetCDF');
-			%1. Create NetCDF file
-			ncid=netcdf.create(filename,'CLOBBER');
-			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Conventions','CF-1.4');
-			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Title',['ISSM model (' self.miscellaneous.name ')']);
-			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Author',getenv('USER'));
-			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Date',datestr(now));
-
-			%Preallocate variable id, needed to write variables in netcdf file
-			var_id=zeros(1000,1);%preallocate
-
-			for step=1:2,
-				counter=0;
-				[var_id,counter]=structtonc(ncid,'md',self,0,var_id,counter,step);
-				if step==1, netcdf.endDef(ncid); end
-			end
-
-			if counter>1000,
-				warning(['preallocation of var_id need to be updated from ' num2str(1000) ' to ' num2str(counter)]);
-			end
-
-			netcdf.close(ncid)
-		end % }}}
-		function xylim(self) % {{{
-
-			xlim([min(self.mesh.x) max(self.mesh.x)]);
-			ylim([min(self.mesh.y) max(self.mesh.y)])
-		end % }}}
-		function md=upload(md) % {{{
-			%the goal of this routine is to upload the model onto a server, and to empty it.
-			%So first, save the model with a unique name and upload the file to the server: 
-			random_part=fix(rand(1)*10000);
-			id=[md.miscellaneous.name '-' regexprep(datestr(now),'[^\w'']','') '-' num2str(random_part)  '-' getenv('USER') '-' oshostname() '.upload']; 
-			eval(['save ' id ' md']);
-
-			%Now, upload the file: 
-			issmscpout(md.settings.upload_server,md.settings.upload_path,md.settings.upload_login,md.settings.upload_port,{id},1);
-
-			%Now, empty this model of everything except settings, and record name of file we just uploaded!
-			settings_back=md.settings;
-			md=model();
-			md.settings=settings_back;
-			md.settings.upload_filename=id;
-
-			%get locally rid of file that was uploaded
-			eval(['delete ' id]);
-
-		end % }}}
-		function md=download(md) % {{{
-
-			%the goal of this routine is to download the internals of the current model from a server, because 
-			%this model is empty, except for the settings which tell us where to go and find this model!
-
-			%Download the file: 
-			issmscpin(md.settings.upload_server, md.settings.upload_login, md.settings.upload_port, md.settings.upload_path, {md.settings.upload_filename});
-
-			name=md.settings.upload_filename;
-
-			%Now, load this model: 
-			md=loadmodel(md.settings.upload_filename);
-
-			%get locally rid of file that was downloaded
-			eval(['delete ' name]);
-
-		end % }}}
-		function saveasstruct(md,filename) % {{{
-
-			fields=sort(properties('model')); %sort fields so that comparison of binary files is easier
-			disp('Converting all model fields to struct...');
-			warning off MATLAB:structOnObject
-			for i=1:length(fields),
-				field=fields{i};
-				md.(field) = struct(md.(field));
-			end
-			disp('Converting model to struct...');
-			md=struct(md);
-			warning on MATLAB:structOnObject
-			disp(['Saving as ' filename '...']);
-			save(filename,'md','-v7.3')
-		end % }}}
-function savemodeljs(md,modelname,websiteroot,varargin) % {{{
-
-	%the goal of this routine is to save the model as a javascript array that can be included in any html 
-	%file: 
-
-	options=pairoptions(varargin{:});
-	optimization=getfieldvalue(options,'optimize',0);
-
-
-	%disp: 
-	disp(['saving model ''' modelname ''' in file ' websiteroot '/js/' modelname '.js']);
-
-	%open file for writing and declare the model:
-	fid=fopen([websiteroot '/js/' modelname '.js'],'w');
-	fprintf(fid,'var %s=new model();\n',modelname);
-
-	%now go through all the classes and fwrite all the corresponding fields: 
-
-	fields=properties('model');
-	for i=1:length(fields),
-		field=fields{i};
-
-		%Some properties do not need to be saved
-		if ismember(field,{'results','cluster' }),
-			continue;
-		end
-
-		%some optimization: 
-		if optimization==1,
-			%optimize for plotting only:
-			if ~ismember(field,{'geometry','mesh','mask'}),
-				continue;
-			end
-		end
-
-		%Check that current field is an object
-		if ~isobject(md.(field))
-			error(['field ''' char(field) ''' is not an object']);
-		end
-
-		%savemodeljs for current object
-		%disp(['javascript saving ' field '...']);
-		savemodeljs(md.(field),fid,modelname);
-	end
-
-	%done, close file:
-	fclose(fid);
-end
-	end
-end
Index: sm/trunk/src/m/classes/model.py
===================================================================
--- /issm/trunk/src/m/classes/model.py	(revision 28275)
+++ 	(revision )
@@ -1,999 +1,0 @@
-#module imports {{{
-import numpy as np
-import copy
-import sys
-from pairoptions import pairoptions
-from mesh2d import mesh2d
-from mesh3dprisms import mesh3dprisms
-from mask import mask
-from geometry import geometry
-from constants import constants
-from SMBforcing import SMBforcing
-from SMBpdd import SMBpdd
-from SMBd18opdd import SMBd18opdd
-from SMBgradients import SMBgradients
-from SMBcomponents import SMBcomponents
-from SMBmeltcomponents import SMBmeltcomponents
-from basalforcings import basalforcings
-from linearbasalforcings import linearbasalforcings
-from matice import matice
-from levelset import levelset
-from calving import calving
-from love import love
-from calvinglevermann import calvinglevermann
-#from calvingpi import calvingpi
-from frontalforcings import frontalforcings
-from damage import damage
-from friction import friction
-from flowequation import flowequation
-from timestepping import timestepping
-from timesteppingadaptive import timesteppingadaptive
-from initialization import initialization
-from rifts import rifts
-from solidearth import solidearth
-from dsl import dsl
-from debug import debug
-from verbose import verbose
-from issmsettings import issmsettings
-from toolkits import toolkits
-from generic import generic
-from balancethickness import balancethickness
-from stressbalance import stressbalance
-from groundingline import groundingline
-from hydrologyshreve import hydrologyshreve
-from hydrologydc import hydrologydc
-from hydrologyglads import hydrologyglads
-from hydrologypism import hydrologypism
-from hydrologyshakti import hydrologyshakti
-from debris import debris
-from masstransport import masstransport
-from thermal import thermal
-from steadystate import steadystate
-from transient import transient
-from esa import esa
-from autodiff import autodiff
-from inversion import inversion
-from outputdefinition import outputdefinition
-from qmu import qmu
-from amr import amr
-from results import results
-from radaroverlay import radaroverlay
-from miscellaneous import miscellaneous
-from private import private
-from mumpsoptions import mumpsoptions
-from iluasmoptions import iluasmoptions
-from project3d import project3d
-from project2d import project2d
-from FlagElements import FlagElements
-from NodeConnectivity import NodeConnectivity
-from ElementConnectivity import ElementConnectivity
-from contourenvelope import contourenvelope
-from DepthAverage import DepthAverage
-from sampling import sampling
-from stochasticforcing import stochasticforcing
-# }}}
-
-
-class model(object):
-    """model class definition
-
-    Usage:
-        md = model()
-    """
-
-    def __init__(self, *args):  #{{{
-        self.mesh = None
-        self.mask = None
-
-        self.geometry = None
-        self.constants = None
-        self.smb = None
-        self.basalforcings = None
-        self.materials = None
-        self.damage = None
-        self.friction = None
-        self.flowequation = None
-        self.timestepping = None
-        self.initialization = None
-        self.rifts = None
-        self.dsl = None
-        self.solidearth = None
-        self.debug = None
-        self.verbose = None
-        self.settings = None
-        self.toolkits = None
-        self.cluster = None
-        self.balancethickness = None
-        self.stressbalance = None
-        self.groundingline = None
-        self.hydrology = None
-        self.debris = None
-        self.masstransport = None
-        self.thermal = None
-        self.steadystate = None
-        self.transient = None
-        self.levelset = None
-        self.calving = None
-        self.frontalforcings = None
-        self.love = None
-        self.esa = None
-        self.sampling = None
-        self.autodiff = None
-        self.inversion = None
-        self.qmu = None
-        self.amr = None
-        self.results = None
-        self.outputdefinition = None
-        self.radaroverlay = None
-        self.miscellaneous = None
-        self.private = None
-        self.stochasticforcing = None
-
-        if len(args) == 0:
-            self.setdefaultparameters('earth')
-        else:
-            options = pairoptions(*args)
-            planet = options.getfieldvalue('planet', 'earth')
-            self.setdefaultparameters(planet)
-    # }}}
-
-    def __repr__(obj):  #{{{
-        # TODO:
-        # - Convert all formatting to calls to <string>.format (see any
-        #   already converted <class>.__repr__ method for examples)
-        #
-        s = '%19s: %-23s -- %s' % ('mesh', '[%s %s]' % ('1x1', obj.mesh.__class__.__name__), 'mesh properties')
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('mask', '[%s %s]' % ('1x1', obj.mask.__class__.__name__), 'defines grounded and floating elements'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('geometry', '[%s %s]' % ('1x1', obj.geometry.__class__.__name__), 'surface elevation, bedrock topography, ice thickness, ...'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('constants', '[%s %s]' % ('1x1', obj.constants.__class__.__name__), 'physical constants'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('smb', '[%s %s]' % ('1x1', obj.smb.__class__.__name__), 'surface mass balance'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('basalforcings', '[%s %s]' % ('1x1', obj.basalforcings.__class__.__name__), 'bed forcings'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('materials', '[%s %s]' % ('1x1', obj.materials.__class__.__name__), 'material properties'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('damage', '[%s %s]' % ('1x1', obj.damage.__class__.__name__), 'damage propagation laws'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('friction', '[%s %s]' % ('1x1', obj.friction.__class__.__name__), 'basal friction / drag properties'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('flowequation', '[%s %s]' % ('1x1', obj.flowequation.__class__.__name__), 'flow equations'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('timestepping', '[%s %s]' % ('1x1', obj.timestepping.__class__.__name__), 'time stepping for transient models'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('initialization', '[%s %s]' % ('1x1', obj.initialization.__class__.__name__), 'initial guess / state'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('rifts', '[%s %s]' % ('1x1', obj.rifts.__class__.__name__), 'rifts properties'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('solidearth', '[%s %s]' % ('1x1', obj.solidearth.__class__.__name__), 'solidearth inputs and settings'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('dsl', '[%s %s]' % ('1x1', obj.dsl.__class__.__name__), 'dynamic sea level'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('debug', '[%s %s]' % ('1x1', obj.debug.__class__.__name__), 'debugging tools (valgrind, gprof)'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('verbose', '[%s %s]' % ('1x1', obj.verbose.__class__.__name__), 'verbosity level in solve'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('settings', '[%s %s]' % ('1x1', obj.settings.__class__.__name__), 'settings properties'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('toolkits', '[%s %s]' % ('1x1', obj.toolkits.__class__.__name__), 'PETSc options for each solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('cluster', '[%s %s]' % ('1x1', obj.cluster.__class__.__name__), 'cluster parameters (number of CPUs...)'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('balancethickness', '[%s %s]' % ('1x1', obj.balancethickness.__class__.__name__), 'parameters for balancethickness solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('stressbalance', '[%s %s]' % ('1x1', obj.stressbalance.__class__.__name__), 'parameters for stressbalance solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('groundingline', '[%s %s]' % ('1x1', obj.groundingline.__class__.__name__), 'parameters for groundingline solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('hydrology', '[%s %s]' % ('1x1', obj.hydrology.__class__.__name__), 'parameters for hydrology solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('masstransport', '[%s %s]' % ('1x1', obj.masstransport.__class__.__name__), 'parameters for masstransport solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('thermal', '[%s %s]' % ('1x1', obj.thermal.__class__.__name__), 'parameters for thermal solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('steadystate', '[%s %s]' % ('1x1', obj.steadystate.__class__.__name__), 'parameters for steadystate solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('transient', '[%s %s]' % ('1x1', obj.transient.__class__.__name__), 'parameters for transient solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('levelset', '[%s %s]' % ('1x1', obj.levelset.__class__.__name__), 'parameters for moving boundaries (level-set method)'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('calving', '[%s %s]' % ('1x1', obj.calving.__class__.__name__), 'parameters for calving'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('frontalforcings', '[%s %s]' % ('1x1', obj.frontalforcings.__class__.__name__), 'parameters for frontalforcings'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('esa', '[%s %s]' % ('1x1', obj.esa.__class__.__name__), 'parameters for elastic adjustment solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('sampling', '[%s %s]' % ('1x1', obj.sampling.__class__.__name__), 'parameters for stochastic sampler'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('love', '[%s %s]' % ('1x1', obj.love.__class__.__name__), 'parameters for love solution'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('autodiff', '[%s %s]' % ('1x1', obj.autodiff.__class__.__name__), 'automatic differentiation parameters'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('inversion', '[%s %s]' % ('1x1', obj.inversion.__class__.__name__), 'parameters for inverse methods'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('qmu', '[%s %s]' % ('1x1', obj.qmu.__class__.__name__), 'Dakota properties'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('amr', '[%s %s]' % ('1x1', obj.amr.__class__.__name__), 'adaptive mesh refinement properties'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('outputdefinition', '[%s %s]' % ('1x1', obj.outputdefinition.__class__.__name__), 'output definition'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('results', '[%s %s]' % ('1x1', obj.results.__class__.__name__), 'model results'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('radaroverlay', '[%s %s]' % ('1x1', obj.radaroverlay.__class__.__name__), 'radar image for plot overlay'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('miscellaneous', '[%s %s]' % ('1x1', obj.miscellaneous.__class__.__name__), 'miscellaneous fields'))
-        s = '%s\n%s' % (s, '%19s: %-23s -- %s' % ('stochasticforcing', '[%s %s]' % ('1x1', obj.stochasticforcing.__class__.__name__), 'stochasticity applied to model forcings'))
-        return s
-    # }}}
-
-    def properties(self):  #{{{
-        # ordered list of properties since vars(self) is random
-        return [
-            'mesh',
-            'mask',
-            'geometry',
-            'constants',
-            'smb',
-            'basalforcings',
-            'materials',
-            'damage',
-            'friction',
-            'flowequation',
-            'timestepping',
-            'initialization',
-            'rifts',
-            'dsl',
-            'solidearth',
-            'debug',
-            'verbose',
-            'settings',
-            'toolkits',
-            'cluster',
-            'balancethickness',
-            'stressbalance',
-            'groundingline',
-            'hydrology',
-            'debris',
-            'masstransport',
-            'thermal',
-            'steadystate',
-            'transient',
-            'levelset',
-            'calving',
-            'frontalforcings',
-            'love',
-            'esa',
-            'sampling',
-            'autodiff',
-            'inversion',
-            'qmu',
-            'amr',
-            'results',
-            'outputdefinition',
-            'radaroverlay',
-            'miscellaneous',
-            'private',
-            'stochasticforcing'
-        ]
-    # }}}
-
-    def setdefaultparameters(self, planet):  #{{{
-        self.mesh = mesh2d()
-        self.mask = mask()
-        self.constants = constants()
-        self.geometry = geometry()
-        self.initialization = initialization()
-        self.smb = SMBforcing()
-        self.basalforcings = basalforcings()
-        self.friction = friction()
-        self.rifts = rifts()
-        self.solidearth = solidearth(planet)
-        self.dsl = dsl()
-        self.timestepping = timestepping()
-        self.groundingline = groundingline()
-        self.materials = matice()
-        self.damage = damage()
-        self.flowequation = flowequation()
-        self.debug = debug()
-        self.verbose = verbose()
-        self.settings = issmsettings()
-        self.toolkits = toolkits()
-        self.cluster = generic()
-        self.balancethickness = balancethickness()
-        self.stressbalance = stressbalance()
-        self.hydrology = hydrologyshreve()
-        self.debris = debris()
-        self.masstransport = masstransport()
-        self.thermal = thermal()
-        self.steadystate = steadystate()
-        self.transient = transient()
-        self.levelset = levelset()
-        self.calving = calving()
-        self.frontalforcings = frontalforcings()
-        self.love = love()
-        self.esa = esa()
-        self.sampling = sampling()
-        self.autodiff = autodiff()
-        self.inversion = inversion()
-        self.qmu = qmu()
-        self.amr = amr()
-        self.radaroverlay = radaroverlay()
-        self.results = results()
-        self.outputdefinition = outputdefinition()
-        self.miscellaneous = miscellaneous()
-        self.private = private()
-        self.stochasticforcing = stochasticforcing()
-    # }}}
-
-    def checkmessage(self, string):  #{{{
-        print("model not consistent: {}".format(string))
-        self.private.isconsistent = False
-        return self
-    # }}}
-    #@staticmethod
-
-    def extract(self, area):  #{{{
-        """EXTRACT - extract a model according to an Argus contour or flag list
-
-        This routine extracts a submodel from a bigger model with respect to a given contour
-        md must be followed by the corresponding exp file or flags list
-        It can either be a domain file (argus type, .exp extension), or an array of element flags.
-        If user wants every element outside the domain to be
-        extract2d, add '~' to the name of the domain file (ex: '~HO.exp')
-        an empty string '' will be considered as an empty domain
-        a string 'all' will be considered as the entire domain
-
-        Usage:
-            md2 = extract(md, area)
-
-        Examples:
-            md2 = extract(md, 'Domain.exp')
-
-        See also: EXTRUDE, COLLAPSE
-        """
-
-        #copy model
-        md1 = copy.deepcopy(self)
-
-        #get elements that are inside area
-        flag_elem = FlagElements(md1, area)
-        if not np.any(flag_elem):
-            raise RuntimeError("extracted model is empty")
-
-        #kick out all elements with 3 dirichlets
-        spc_elem = np.nonzero(np.logical_not(flag_elem))[0]
-        spc_node = np.unique(md1.mesh.elements[spc_elem, :]) - 1
-        flag = np.ones(md1.mesh.numberofvertices)
-        flag[spc_node] = 0
-        pos = np.nonzero(np.logical_not(np.sum(flag[md1.mesh.elements - 1], axis=1)))[0]
-        flag_elem[pos] = 0
-
-        #extracted elements and nodes lists
-        pos_elem = np.nonzero(flag_elem)[0]
-        pos_node = np.unique(md1.mesh.elements[pos_elem, :]) - 1
-
-        #keep track of some fields
-        numberofvertices1 = md1.mesh.numberofvertices
-        numberofelements1 = md1.mesh.numberofelements
-        numberofvertices2 = np.size(pos_node)
-        numberofelements2 = np.size(pos_elem)
-        flag_node = np.zeros(numberofvertices1)
-        flag_node[pos_node] = 1
-
-        #Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
-        Pelem = np.zeros(numberofelements1, int)
-        Pelem[pos_elem] = np.arange(1, numberofelements2 + 1)
-        Pnode = np.zeros(numberofvertices1, int)
-        Pnode[pos_node] = np.arange(1, numberofvertices2 + 1)
-
-        #renumber the elements (some node won't exist anymore)
-        elements_1 = copy.deepcopy(md1.mesh.elements)
-        elements_2 = elements_1[pos_elem, :]
-        elements_2[:, 0] = Pnode[elements_2[:, 0] - 1]
-        elements_2[:, 1] = Pnode[elements_2[:, 1] - 1]
-        elements_2[:, 2] = Pnode[elements_2[:, 2] - 1]
-        if md1.mesh.__class__.__name__ == 'mesh3dprisms':
-            elements_2[:, 3] = Pnode[elements_2[:, 3] - 1]
-            elements_2[:, 4] = Pnode[elements_2[:, 4] - 1]
-            elements_2[:, 5] = Pnode[elements_2[:, 5] - 1]
-
-        #OK, now create the new model!
-
-        #take every field from model
-        md2 = copy.deepcopy(md1)
-
-        #automatically modify fields
-
-        #loop over model fields
-        model_fields = vars(md1)
-        for fieldi in model_fields:
-            #get field
-            field = getattr(md1, fieldi)
-            fieldsize = np.shape(field)
-            if hasattr(field, '__dict__') and fieldi not in ['results']:  #recursive call
-                object_fields = vars(field)
-                for fieldj in object_fields:
-                    #get field
-                    field = getattr(getattr(md1, fieldi), fieldj)
-                    fieldsize = np.shape(field)
-                    if len(fieldsize):
-                        #size = number of nodes * n
-                        if fieldsize[0] == numberofvertices1:
-                            setattr(getattr(md2, fieldi), fieldj, field[pos_node])
-                        elif fieldsize[0] == numberofvertices1 + 1:
-                            setattr(getattr(md2, fieldi), fieldj, np.vstack((field[pos_node], field[-1, :])))
-                        #size = number of elements * n
-                        elif fieldsize[0] == numberofelements1:
-                            setattr(getattr(md2, fieldi), fieldj, field[pos_elem])
-            else:
-                if len(fieldsize):
-                    #size = number of nodes * n
-                    if fieldsize[0] == numberofvertices1:
-                        setattr(md2, fieldi, field[pos_node])
-                    elif fieldsize[0] == numberofvertices1 + 1:
-                        setattr(md2, fieldi, np.hstack((field[pos_node], field[-1, :])))
-                    #size = number of elements * n
-                    elif fieldsize[0] == numberofelements1:
-                        setattr(md2, fieldi, field[pos_elem])
-
-        #modify some specific fields
-        #Mesh
-        md2.mesh.numberofelements = numberofelements2
-        md2.mesh.numberofvertices = numberofvertices2
-        md2.mesh.elements = elements_2
-
-        #mesh.uppervertex mesh.lowervertex
-        if md1.mesh.__class__.__name__ == 'mesh3dprisms':
-            md2.mesh.uppervertex = md1.mesh.uppervertex[pos_node]
-            pos = np.where(~np.isnan(md2.mesh.uppervertex))[0]
-            md2.mesh.uppervertex[pos] = Pnode[md2.mesh.uppervertex[pos].astype(int) - 1]
-
-            md2.mesh.lowervertex = md1.mesh.lowervertex[pos_node]
-            pos = np.where(~np.isnan(md2.mesh.lowervertex))[0]
-            md2.mesh.lowervertex[pos] = Pnode[md2.mesh.lowervertex[pos].astype(int) - 1]
-
-            md2.mesh.upperelements = md1.mesh.upperelements[pos_elem]
-            pos = np.where(~np.isnan(md2.mesh.upperelements))[0]
-            md2.mesh.upperelements[pos] = Pelem[md2.mesh.upperelements[pos].astype(int) - 1]
-
-            md2.mesh.lowerelements = md1.mesh.lowerelements[pos_elem]
-            pos = np.where(~np.isnan(md2.mesh.lowerelements))[0]
-            md2.mesh.lowerelements[pos] = Pelem[md2.mesh.lowerelements[pos].astype(int) - 1]
-
-        #Initial 2d mesh
-        if md1.mesh.__class__.__name__ == 'mesh3dprisms':
-            flag_elem_2d = flag_elem[np.arange(0, md1.mesh.numberofelements2d)]
-            pos_elem_2d = np.nonzero(flag_elem_2d)[0]
-            flag_node_2d = flag_node[np.arange(0, md1.mesh.numberofvertices2d)]
-            pos_node_2d = np.nonzero(flag_node_2d)[0]
-
-            md2.mesh.numberofelements2d = np.size(pos_elem_2d)
-            md2.mesh.numberofvertices2d = np.size(pos_node_2d)
-            md2.mesh.elements2d = md1.mesh.elements2d[pos_elem_2d, :]
-            md2.mesh.elements2d[:, 0] = Pnode[md2.mesh.elements2d[:, 0] - 1]
-            md2.mesh.elements2d[:, 1] = Pnode[md2.mesh.elements2d[:, 1] - 1]
-            md2.mesh.elements2d[:, 2] = Pnode[md2.mesh.elements2d[:, 2] - 1]
-
-            md2.mesh.x2d = md1.mesh.x[pos_node_2d]
-            md2.mesh.y2d = md1.mesh.y[pos_node_2d]
-
-        #Edges
-        if md1.mesh.domaintype() == '2Dhorizontal':
-            if np.ndim(md2.mesh.edges) > 1 and np.size(md2.mesh.edges, axis=1) > 1:  #do not use ~isnan because there are some np.nans...
-                #renumber first two columns
-                pos = np.nonzero(md2.mesh.edges[:, 3] != -1)[0]
-                md2.mesh.edges[:, 0] = Pnode[md2.mesh.edges[:, 0] - 1]
-                md2.mesh.edges[:, 1] = Pnode[md2.mesh.edges[:, 1] - 1]
-                md2.mesh.edges[:, 2] = Pelem[md2.mesh.edges[:, 2] - 1]
-                md2.mesh.edges[pos, 3] = Pelem[md2.mesh.edges[pos, 3] - 1]
-                #remove edges when the 2 vertices are not in the domain.
-                md2.mesh.edges = md2.mesh.edges[np.nonzero(np.logical_and(md2.mesh.edges[:, 0], md2.mesh.edges[:, 1]))[0], :]
-                #Replace all zeros by - 1 in the last two columns
-                pos = np.nonzero(md2.mesh.edges[:, 2] == 0)[0]
-                md2.mesh.edges[pos, 2] = -1
-                pos = np.nonzero(md2.mesh.edges[:, 3] == 0)[0]
-                md2.mesh.edges[pos, 3] = -1
-                #Invert - 1 on the third column with last column (Also invert first two columns!!)
-                pos = np.nonzero(md2.mesh.edges[:, 2] == -1)[0]
-                md2.mesh.edges[pos, 2] = md2.mesh.edges[pos, 3]
-                md2.mesh.edges[pos, 3] = -1
-                values = md2.mesh.edges[pos, 1]
-                md2.mesh.edges[pos, 1] = md2.mesh.edges[pos, 0]
-                md2.mesh.edges[pos, 0] = values
-                #Finally remove edges that do not belong to any element
-                pos = np.nonzero(np.logical_and(md2.mesh.edges[:, 1] == -1, md2.mesh.edges[:, 2] == -1))[0]
-                md2.mesh.edges = np.delete(md2.mesh.edges, pos, axis=0)
-
-        #Penalties
-        if np.any(np.logical_not(np.isnan(md2.stressbalance.vertex_pairing))):
-            for i in range(np.size(md1.stressbalance.vertex_pairing, axis=0)):
-                md2.stressbalance.vertex_pairing[i, :] = Pnode[md1.stressbalance.vertex_pairing[i, :]]
-            md2.stressbalance.vertex_pairing = md2.stressbalance.vertex_pairing[np.nonzero(md2.stressbalance.vertex_pairing[:, 0])[0], :]
-        if np.any(np.logical_not(np.isnan(md2.masstransport.vertex_pairing))):
-            for i in range(np.size(md1.masstransport.vertex_pairing, axis=0)):
-                md2.masstransport.vertex_pairing[i, :] = Pnode[md1.masstransport.vertex_pairing[i, :]]
-            md2.masstransport.vertex_pairing = md2.masstransport.vertex_pairing[np.nonzero(md2.masstransport.vertex_pairing[:, 0])[0], :]
-
-        #recreate segments
-        if md1.mesh.__class__.__name__ == 'mesh2d':
-            md2.mesh.vertexconnectivity = NodeConnectivity(md2.mesh.elements, md2.mesh.numberofvertices)
-            md2.mesh.elementconnectivity = ElementConnectivity(md2.mesh.elements, md2.mesh.vertexconnectivity)
-            md2.mesh.segments = contourenvelope(md2.mesh)
-            md2.mesh.vertexonboundary = np.zeros(numberofvertices2, bool)
-            md2.mesh.vertexonboundary[md2.mesh.segments[:, 0:2] - 1] = True
-        else:
-            #First do the connectivity for the contourenvelope in 2d
-            md2.mesh.vertexconnectivity = NodeConnectivity(md2.mesh.elements2d, md2.mesh.numberofvertices2d)
-            md2.mesh.elementconnectivity = ElementConnectivity(md2.mesh.elements2d, md2.mesh.vertexconnectivity)
-            segments = contourenvelope(md2.mesh)
-            md2.mesh.vertexonboundary = np.zeros(int(numberofvertices2 / md2.mesh.numberoflayers), bool)
-            md2.mesh.vertexonboundary[segments[:, 0:2] - 1] = True
-            md2.mesh.vertexonboundary = np.tile(md2.mesh.vertexonboundary, md2.mesh.numberoflayers)
-            #Then do it for 3d as usual
-            md2.mesh.vertexconnectivity = NodeConnectivity(md2.mesh.elements, md2.mesh.numberofvertices)
-            md2.mesh.elementconnectivity = ElementConnectivity(md2.mesh.elements, md2.mesh.vertexconnectivity)
-
-        #Boundary conditions: Dirichlets on new boundary
-        #Catch the elements that have not been extracted
-        orphans_elem = np.nonzero(np.logical_not(flag_elem))[0]
-        orphans_node = np.unique(md1.mesh.elements[orphans_elem, :]) - 1
-        #Figure out which node are on the boundary between md2 and md1
-        nodestoflag1 = np.intersect1d(orphans_node, pos_node)
-        nodestoflag2 = Pnode[nodestoflag1].astype(int) - 1
-        if np.size(md1.stressbalance.spcvx) > 1 and np.size(md1.stressbalance.spcvy) > 2 and np.size(md1.stressbalance.spcvz) > 2:
-            if np.size(md1.inversion.vx_obs) > 1 and np.size(md1.inversion.vy_obs) > 1:
-                md2.stressbalance.spcvx[nodestoflag2] = md2.inversion.vx_obs[nodestoflag2]
-                md2.stressbalance.spcvy[nodestoflag2] = md2.inversion.vy_obs[nodestoflag2]
-            else:
-                md2.stressbalance.spcvx[nodestoflag2] = np.nan
-                md2.stressbalance.spcvy[nodestoflag2] = np.nan
-                print("\n!! extract warning: spc values should be checked !!\n\n")
-            #put 0 for vz
-            md2.stressbalance.spcvz[nodestoflag2] = 0
-        if np.any(np.logical_not(np.isnan(md1.thermal.spctemperature))):
-            md2.thermal.spctemperature[nodestoflag2] = 1
-
-        #Results fields
-        if md1.results:
-            md2.results = results()
-            for solutionfield, field in list(md1.results.__dict__.items()):
-                if isinstance(field, list):
-                    setattr(md2.results, solutionfield, [])
-                    #get time step
-                    for i, fieldi in enumerate(field):
-                        if isinstance(fieldi, results) and fieldi:
-                            getattr(md2.results, solutionfield).append(results())
-                            fieldr = getattr(md2.results, solutionfield)[i]
-                            #get subfields
-                            for solutionsubfield, subfield in list(fieldi.__dict__.items()):
-                                if np.size(subfield) == numberofvertices1:
-                                    setattr(fieldr, solutionsubfield, subfield[pos_node])
-                                elif np.size(subfield) == numberofelements1:
-                                    setattr(fieldr, solutionsubfield, subfield[pos_elem])
-                                else:
-                                    setattr(fieldr, solutionsubfield, subfield)
-                        else:
-                            getattr(md2.results, solutionfield).append(None)
-                elif isinstance(field, results):
-                    setattr(md2.results, solutionfield, results())
-                    if isinstance(field, results) and field:
-                        fieldr = getattr(md2.results, solutionfield)
-                        #get subfields
-                        for solutionsubfield, subfield in list(field.__dict__.items()):
-                            if np.size(subfield) == numberofvertices1:
-                                setattr(fieldr, solutionsubfield, subfield[pos_node])
-                            elif np.size(subfield) == numberofelements1:
-                                setattr(fieldr, solutionsubfield, subfield[pos_elem])
-                            else:
-                                setattr(fieldr, solutionsubfield, subfield)
-
-        #OutputDefinitions fields
-        if md1.outputdefinition.definitions:
-            for solutionfield, field in list(md1.outputdefinition.__dict__.items()):
-                if isinstance(field, list):
-                    #get each definition
-                    for i, fieldi in enumerate(field):
-                        if fieldi:
-                            fieldr = getattr(md2.outputdefinition, solutionfield)[i]
-                            #get subfields
-                            for solutionsubfield, subfield in list(fieldi.__dict__.items()):
-                                if np.size(subfield) == numberofvertices1:
-                                    setattr(fieldr, solutionsubfield, subfield[pos_node])
-                                elif np.size(subfield) == numberofelements1:
-                                    setattr(fieldr, solutionsubfield, subfield[pos_elem])
-                                else:
-                                    setattr(fieldr, solutionsubfield, subfield)
-
-        #Keep track of pos_node and pos_elem
-        md2.mesh.extractedvertices = pos_node + 1
-        md2.mesh.extractedelements = pos_elem + 1
-
-        return md2
-    # }}}
-
-    def extrude(md, *args):  #{{{
-        """EXTRUDE - vertically extrude a 2d mesh
-
-        vertically extrude a 2d mesh and create corresponding 3d mesh.
-        The vertical distribution can:
-        - follow a polynomial law
-        - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
-        - be discribed by a list of coefficients (between 0 and 1)
-
-
-        Usage:
-            md = extrude(md, numlayers, extrusionexponent)
-            md = extrude(md, numlayers, lowerexponent, upperexponent)
-            md = extrude(md, listofcoefficients)
-
-        Example:
-            md = extrude(md, 15, 1.3)
-            md = extrude(md, 15, 1.3, 1.2)
-            md = extrude(md, [0 0.2 0.5 0.7 0.9 0.95 1])
-
-        See also: MODELEXTRACT, COLLAPSE
-        """
-
-        #some checks on list of arguments
-        if len(args) > 3 or len(args) < 1:
-            raise RuntimeError('extrude error message')
-
-        #Extrude the mesh
-        if len(args) == 1:  #list of coefficients
-            clist = args[0]
-            if any(clist < 0) or any(clist > 1):
-                raise TypeError('extrusioncoefficients must be between 0 and 1')
-            clist.extend([0., 1.])
-            clist.sort()
-            extrusionlist = list(set(clist))
-            numlayers = len(extrusionlist)
-
-        elif len(args) == 2:  #one polynomial law
-            if args[1] <= 0:
-                raise TypeError('extrusionexponent must be >= 0')
-            numlayers = args[0]
-            extrusionlist = (np.arange(0., float(numlayers - 1) + 1., 1.) / float(numlayers - 1))**args[1]
-
-        elif len(args) == 3:  #two polynomial laws
-            numlayers = args[0]
-            lowerexp = args[1]
-            upperexp = args[2]
-
-            if args[1] <= 0 or args[2] <= 0:
-                raise TypeError('lower and upper extrusionexponents must be >= 0')
-
-            lowerextrusionlist = (np.arange(0., 1. + 2. / float(numlayers - 1), 2. / float(numlayers - 1)))**lowerexp / 2.
-            upperextrusionlist = (np.arange(0., 1. + 2. / float(numlayers - 1), 2. / float(numlayers - 1)))**upperexp / 2.
-            extrusionlist = np.unique(np.concatenate((lowerextrusionlist, 1. - upperextrusionlist)))
-
-        if numlayers < 2:
-            raise TypeError('number of layers should be at least 2')
-        if md.mesh.__class__.__name__ == 'mesh3dprisms':
-            raise TypeError('Cannot extrude a 3d mesh (extrude cannot be called more than once)')
-
-        #Initialize with 2d mesh
-        mesh2d = md.mesh
-        md.mesh = mesh3dprisms()
-        md.mesh.x = mesh2d.x
-        md.mesh.y = mesh2d.y
-        md.mesh.elements = mesh2d.elements
-        md.mesh.numberofelements = mesh2d.numberofelements
-        md.mesh.numberofvertices = mesh2d.numberofvertices
-
-        md.mesh.lat = mesh2d.lat
-        md.mesh.long = mesh2d.long
-        md.mesh.epsg = mesh2d.epsg
-        md.mesh.scale_factor = mesh2d.scale_factor
-
-        md.mesh.vertexonboundary = mesh2d.vertexonboundary
-        md.mesh.vertexconnectivity = mesh2d.vertexconnectivity
-        md.mesh.elementconnectivity = mesh2d.elementconnectivity
-        md.mesh.average_vertex_connectivity = mesh2d.average_vertex_connectivity
-
-        md.mesh.extractedvertices = mesh2d.extractedvertices
-        md.mesh.extractedelements = mesh2d.extractedelements
-
-        x3d = np.empty((0))
-        y3d = np.empty((0))
-        z3d = np.empty((0))  #the lower node is on the bed
-        thickness3d = md.geometry.thickness  #thickness and bed for these nodes
-        bed3d = md.geometry.base
-
-        #Create the new layers
-        for i in range(numlayers):
-            x3d = np.concatenate((x3d, md.mesh.x))
-            y3d = np.concatenate((y3d, md.mesh.y))
-            #nodes are distributed between bed and surface accordingly to the given exponent
-            z3d = np.concatenate((z3d, (bed3d + thickness3d * extrusionlist[i]).reshape(-1)))
-        number_nodes3d = np.size(x3d)  #number of 3d nodes for the non extruded part of the mesh
-
-        #Extrude elements
-        elements3d = np.empty((0, 6), int)
-        for i in range(numlayers - 1):
-            elements3d = np.vstack((elements3d, np.hstack((md.mesh.elements + i * md.mesh.numberofvertices,
-                                                           md.mesh.elements + (i + 1) * md.mesh.numberofvertices))))  #Create the elements of the 3d mesh for the non extruded part
-        number_el3d = np.size(elements3d, axis=0)  #number of 3d nodes for the non extruded part of the mesh
-
-        #Keep a trace of lower and upper nodes
-        lowervertex = np.nan * np.ones(number_nodes3d, int)
-        uppervertex = np.nan * np.ones(number_nodes3d, int)
-        lowervertex[md.mesh.numberofvertices:] = np.arange(1, (numlayers - 1) * md.mesh.numberofvertices + 1)
-        uppervertex[:(numlayers - 1) * md.mesh.numberofvertices] = np.arange(md.mesh.numberofvertices + 1, number_nodes3d + 1)
-        md.mesh.lowervertex = lowervertex
-        md.mesh.uppervertex = uppervertex
-
-        #same for lower and upper elements
-        lowerelements = np.nan * np.ones(number_el3d, int)
-        upperelements = np.nan * np.ones(number_el3d, int)
-        lowerelements[md.mesh.numberofelements:] = np.arange(1, (numlayers - 2) * md.mesh.numberofelements + 1)
-        upperelements[:(numlayers - 2) * md.mesh.numberofelements] = np.arange(md.mesh.numberofelements + 1, (numlayers - 1) * md.mesh.numberofelements + 1)
-        md.mesh.lowerelements = lowerelements
-        md.mesh.upperelements = upperelements
-
-        #Save old mesh
-        md.mesh.x2d = md.mesh.x
-        md.mesh.y2d = md.mesh.y
-        md.mesh.elements2d = md.mesh.elements
-        md.mesh.numberofelements2d = md.mesh.numberofelements
-        md.mesh.numberofvertices2d = md.mesh.numberofvertices
-
-        #Build global 3d mesh
-        md.mesh.elements = elements3d
-        md.mesh.x = x3d
-        md.mesh.y = y3d
-        md.mesh.z = z3d
-        md.mesh.numberofelements = number_el3d
-        md.mesh.numberofvertices = number_nodes3d
-        md.mesh.numberoflayers = numlayers
-
-        #Ok, now deal with the other fields from the 2d mesh:
-        #bedinfo and surface info
-        md.mesh.vertexonbase = project3d(md, 'vector', np.ones(md.mesh.numberofvertices2d, bool), 'type', 'node', 'layer', 1)
-        md.mesh.vertexonsurface = project3d(md, 'vector', np.ones(md.mesh.numberofvertices2d, bool), 'type', 'node', 'layer', md.mesh.numberoflayers)
-        md.mesh.vertexonboundary = project3d(md, 'vector', md.mesh.vertexonboundary, 'type', 'node')
-
-        #lat long
-        md.mesh.lat = project3d(md, 'vector', md.mesh.lat, 'type', 'node')
-        md.mesh.long = project3d(md, 'vector', md.mesh.long, 'type', 'node')
-        md.mesh.scale_factor = project3d(md, 'vector', md.mesh.scale_factor, 'type', 'node')
-
-        md.geometry.extrude(md)
-        md.friction.extrude(md)
-        md.inversion.extrude(md)
-        md.smb.extrude(md)
-        md.initialization.extrude(md)
-
-        md.flowequation.extrude(md)
-        md.stressbalance.extrude(md)
-        md.thermal.extrude(md)
-        md.masstransport.extrude(md)
-        md.levelset.extrude(md)
-        md.calving.extrude(md)
-        md.frontalforcings.extrude(md)
-        md.hydrology.extrude(md)
-        md.debris.extrude(md)
-        md.solidearth.extrude(md)
-        md.dsl.extrude(md)
-        md.stochasticforcing.extrude(md)
-
-        #connectivity
-        md.mesh.elementconnectivity = np.tile(md.mesh.elementconnectivity, (numlayers - 1, 1))
-        md.mesh.elementconnectivity[np.nonzero(md.mesh.elementconnectivity == 0)] = -sys.maxsize - 1
-        if not np.isnan(md.mesh.elementconnectivity).all():
-            for i in range(1, numlayers - 1):
-                connect1 = i * md.mesh.numberofelements2d
-                connect2 = (i + 1) * md.mesh.numberofelements2d
-                md.mesh.elementconnectivity[connect1:connect2, :] = md.mesh.elementconnectivity[connect1:connect2, :] + md.mesh.numberofelements2d
-                md.mesh.elementconnectivity[np.nonzero(md.mesh.elementconnectivity < 0)] = 0
-
-        md.materials.extrude(md)
-        md.damage.extrude(md)
-        md.mask.extrude(md)
-        md.qmu.extrude(md)
-        md.basalforcings.extrude(md)
-        md.outputdefinition.extrude(md)
-
-        #increase connectivity if less than 25:
-        if md.mesh.average_vertex_connectivity <= 25:
-            md.mesh.average_vertex_connectivity = 100
-
-        return md
-    # }}}
-
-    def collapse(md):  #{{{
-        """COLLAPSE - collapses a 3d mesh into a 2d mesh
-
-        This routine collapses a 3d model into a 2d model and collapses all
-        the fields of the 3d model by taking their depth-averaged values
-
-        Usage:
-            md = collapse(md)
-
-        See also: EXTRUDE, MODELEXTRACT
-        """
-
-        # Check that the model is really a 3d model
-        if md.mesh.elementtype() != 'Penta':
-            raise Exception('collapse error message: only a 3d mesh can be collapsed')
-
-        # Start with changing all the fields from the 3d mesh
-
-        # Dealing with the friction law
-        # Drag is limited to nodes that are on the bedrock.
-        if md.friction.__class__.__name__ == 'friction':
-            md.friction.coefficient = project2d(md, md.friction.coefficient, 1)
-            md.friction.p = project2d(md, md.friction.p, 1)
-            md.friction.q = project2d(md, md.friction.q, 1)
-        elif md.friction.__class__.__name__ == 'frictioncoulomb':
-            md.friction.coefficient = project2d(md, md.friction.coefficient, 1)
-            md.friction.coefficientcoulomb = project2d(md, md.friction.coefficientcoulomb, 1)
-            md.friction.p = project2d(md, md.friction.p, 1)
-            md.friction.q = project2d(md, md.friction.q, 1)
-        elif md.friction.__class__.__name__ == 'frictionhydro':
-            md.friction.q = project2d(md, md.friction.q, 1)
-            md.friction.C = project2d(md, md.friction.C, 1)
-            md.friction.As = project2d(md, md.friction.As, 1)
-            md.friction.effective_pressure = project2d(md, md.friction.effective_pressure, 1)
-        elif md.friction.__class__.__name__ == 'frictionwaterlayer':
-            md.friction.coefficient = project2d(md, md.friction.coefficient, 1)
-            md.friction.p = project2d(md, md.friction.p, 1)
-            md.friction.q = project2d(md, md.friction.q, 1)
-            md.friction.water_layer = project2d(md, md.friction.water_layer, 1)
-        elif md.friction.__class__.__name__ == 'frictionweertman':
-            md.friction.C = project2d(md, md.friction.C, 1)
-            md.friction.m = project2d(md, md.friction.m, 1)
-        elif md.friction.__class__.__name__ == 'frictionweertmantemp':
-            md.friction.C = project2d(md, md.friction.C, 1)
-            md.friction.m = project2d(md, md.friction.m, 1)
-        else:
-            print('friction type not supported')
-
-        # Observations
-        if not np.isnan(md.inversion.vx_obs).all():
-            md.inversion.vx_obs = project2d(md, md.inversion.vx_obs, md.mesh.numberoflayers)
-        if not np.isnan(md.inversion.vy_obs).all():
-            md.inversion.vy_obs = project2d(md, md.inversion.vy_obs, md.mesh.numberoflayers)
-        if not np.isnan(md.inversion.vel_obs).all():
-            md.inversion.vel_obs = project2d(md, md.inversion.vel_obs, md.mesh.numberoflayers)
-        if not np.isnan(md.inversion.thickness_obs).all():
-            md.inversion.thickness_obs = project2d(md, md.inversion.thickness_obs, md.mesh.numberoflayers)
-        if not np.isnan(md.inversion.cost_functions_coefficients).all():
-            md.inversion.cost_functions_coefficients = project2d(md, md.inversion.cost_functions_coefficients, md.mesh.numberoflayers)
-        if isinstance(md.inversion.min_parameters, np.ndarray) and md.inversion.min_parameters.size > 1:
-            md.inversion.min_parameters = project2d(md, md.inversion.min_parameters, md.mesh.numberoflayers)
-        if isinstance(md.inversion.max_parameters, np.ndarray) and md.inversion.max_parameters.size > 1:
-            md.inversion.max_parameters = project2d(md, md.inversion.max_parameters, md.mesh.numberoflayers)
-        if md.smb.__class__.__name__ == 'SMBforcing' and not np.isnan(md.smb.mass_balance).all():
-            md.smb.mass_balance = project2d(md, md.smb.mass_balance, md.mesh.numberoflayers)
-        elif md.smb.__class__.__name__ == 'SMBhenning' and not np.isnan(md.smb.smbref).all():
-            md.smb.smbref = project2d(md, md.smb.smbref, md.mesh.numberoflayers)
-
-        # Results
-        if not np.isnan(md.initialization.vx).all():
-            md.initialization.vx = DepthAverage(md, md.initialization.vx)
-        if not np.isnan(md.initialization.vy).all():
-            md.initialization.vy = DepthAverage(md, md.initialization.vy)
-        if not np.isnan(md.initialization.vz).all():
-            md.initialization.vz = DepthAverage(md, md.initialization.vz)
-        if not np.isnan(md.initialization.vel).all():
-            md.initialization.vel = DepthAverage(md, md.initialization.vel)
-        if not np.isnan(md.initialization.temperature).all():
-            md.initialization.temperature = DepthAverage(md, md.initialization.temperature)
-        if not np.isnan(md.initialization.pressure).all():
-            md.initialization.pressure = project2d(md, md.initialization.pressure, 1)
-        if not np.isnan(md.initialization.sediment_head).all():
-            md.initialization.sediment_head = project2d(md, md.initialization.sediment_head, 1)
-        if not np.isnan(md.initialization.epl_head).all():
-            md.initialization.epl_head = project2d(md, md.initialization.epl_head, 1)
-        if not np.isnan(md.initialization.epl_thickness).all():
-            md.initialization.epl_thickness = project2d(md, md.initialization.epl_thickness, 1)
-        if not np.isnan(md.initialization.waterfraction).all():
-            md.initialization.waterfraction = project2d(md, md.initialization.waterfraction, 1)
-        if not np.isnan(md.initialization.watercolumn).all():
-            md.initialization.watercolumn = project2d(md, md.initialization.watercolumn, 1)
-        if not np.isnan(md.initialization.debris).all():
-            md.initialization.debris = project2d(md, md.initialization.debris, 1)
-
-        # elementstype
-        if not np.isnan(md.flowequation.element_equation).all():
-            md.flowequation.element_equation = project2d(md, md.flowequation.element_equation, 1)
-            md.flowequation.vertex_equation = project2d(md, md.flowequation.vertex_equation, 1)
-            md.flowequation.borderSSA = project2d(md, md.flowequation.borderSSA, 1)
-            md.flowequation.borderHO = project2d(md, md.flowequation.borderHO, 1)
-            md.flowequation.borderFS = project2d(md, md.flowequation.borderFS, 1)
-
-        # Boundary conditions
-        md.stressbalance.spcvx = project2d(md, md.stressbalance.spcvx, md.mesh.numberoflayers)
-        md.stressbalance.spcvy = project2d(md, md.stressbalance.spcvy, md.mesh.numberoflayers)
-        md.stressbalance.spcvz = project2d(md, md.stressbalance.spcvz, md.mesh.numberoflayers)
-        md.stressbalance.referential = project2d(md, md.stressbalance.referential, md.mesh.numberoflayers)
-        md.stressbalance.loadingforce = project2d(md, md.stressbalance.loadingforce, md.mesh.numberoflayers)
-        # TODO:
-        # - Check if md.mesh.numberoflayershould really be offset by 1.
-        # - Find out why md.masstransport.spcthickness is not offset, but the
-        #   other fields are.
-        # - If offset is required, figure out if it can be abstarcted away to
-        #   another part of the API.
-        if np.size(md.masstransport.spcthickness) > 1:
-            md.masstransport.spcthickness = project2d(md, md.masstransport.spcthickness, md.mesh.numberoflayers)
-        if np.size(md.damage.spcdamage) > 1:  # and not np.isnan(md.damage.spcdamage).all():
-            md.damage.spcdamage = project2d(md, md.damage.spcdamage, md.mesh.numberoflayers - 1)
-        if np.size(md.levelset.spclevelset) > 1:
-            md.levelset.spclevelset = project2d(md, md.levelset.spclevelset, md.mesh.numberoflayers - 1)
-        md.thermal.spctemperature = project2d(md, md.thermal.spctemperature, md.mesh.numberoflayers - 1)
-
-        # Hydrologydc variables
-        if md.hydrology.__class__.__name__ == 'hydrologydc':
-            # md.hydrology.spcsediment_head = project2d(md, md.hydrology.spcsediment_head, 1)
-            # md.hydrology.mask_eplactive_node = project2d(md, md.hydrology.mask_eplactive_node, 1)
-            # md.hydrology.sediment_transmitivity = project2d(md, md.hydrology.sediment_transmitivity, 1)
-            # md.hydrology.basal_moulin_input = project2d(md, md.hydrology.basal_moulin_input, 1)
-            # if md.hydrology.isefficientlayer == 1:
-            #     md.hydrology.spcepl_head = project2d(md, md.hydrology.spcepl_head, 1)
-            hydrofields = md.hydrology.__dict__.keys()
-            for field in hydrofields:
-                try:
-                    isvector = np.logical_or(np.shape(md.hydrology.__dict__[field])[0] == md.mesh.numberofelements,
-                                             np.shape(md.hydrology.__dict__[field])[0] == md.mesh.numberofvertices)
-                except IndexError:
-                    isvector = False
-                #we collapse only fields that are vertices or element based
-                if isvector:
-                    md.hydrology.__dict__[field] = project2d(md, md.hydrology.__dict__[field], 1)
-
-        # Materials
-        md.materials.rheology_B = DepthAverage(md, md.materials.rheology_B)
-        md.materials.rheology_n = project2d(md, md.materials.rheology_n, 1)
-
-        # dsl
-        if np.size(md.dsl.sea_surface_height_above_geoid) > 1:
-            md.dsl.sea_surface_height_above_geoid = project2d(md, md.dsl.sea_surface_height_above_geoid, 1)
-        if np.size(md.dsl.sea_water_pressure_at_sea_floor) > 1:
-            md.dsl.sea_water_pressure_at_sea_floor = project2d(md, md.dsl.sea_water_pressure_at_sea_floor, 1)
-
-        # Damage
-        if md.damage.isdamage:
-            md.damage.D = DepthAverage(md, md.damage.D)
-
-        # Special for thermal modeling
-        if not np.isnan(md.basalforcings.groundedice_melting_rate).all():
-            md.basalforcings.groundedice_melting_rate = project2d(md, md.basalforcings.groundedice_melting_rate, 1)
-        if hasattr(md.basalforcings, 'floatingice_melting_rate') and not np.isnan(md.basalforcings.floatingice_melting_rate).all():
-            md.basalforcings.floatingice_melting_rate = project2d(md, md.basalforcings.floatingice_melting_rate, 1)
-        md.basalforcings.geothermalflux = project2d(md, md.basalforcings.geothermalflux, 1)  #bedrock only gets geothermal flux
-
-        if hasattr(md.calving, 'coeff') and not np.isnan(md.calving.coeff).all():
-            md.calving.coeff = project2d(md, md.calving.coeff, 1)
-        if hasattr(md.frontalforcings, 'meltingrate') and not np.isnan(md.frontalforcings.meltingrate).all():
-            md.frontalforcings.meltingrate = project2d(md, md.frontalforcings.meltingrate, 1)
-
-        # Update of connectivity matrix
-        md.mesh.average_vertex_connectivity = 25
-
-        # Collapse the mesh
-        nodes2d = md.mesh.numberofvertices2d
-        elements2d = md.mesh.numberofelements2d
-
-        # Parameters
-        md.geometry.surface = project2d(md, md.geometry.surface, 1)
-        md.geometry.thickness = project2d(md, md.geometry.thickness, 1)
-        md.geometry.base = project2d(md, md.geometry.base, 1)
-        if not np.isnan(md.geometry.bed).all():
-            md.geometry.bed = project2d(md, md.geometry.bed, 1)
-        if not np.isnan(md.mask.ocean_levelset).all():
-            md.mask.ocean_levelset = project2d(md, md.mask.ocean_levelset, 1)
-        if not np.isnan(md.mask.ice_levelset).all():
-            md.mask.ice_levelset = project2d(md, md.mask.ice_levelset, 1)
-
-        # Lat/long
-        if np.size(md.mesh.lat) == md.mesh.numberofvertices:
-            md.mesh.lat = project2d(md, md.mesh.lat, 1)
-        if np.size(md.mesh.long) == md.mesh.numberofvertices:
-            md.mesh.long = project2d(md, md.mesh.long, 1)
-
-        # OutputDefinitions
-        if md.outputdefinition.definitions:
-            for solutionfield, field in list(md.outputdefinition.__dict__.items()):
-                if isinstance(field, list):
-                    # Get each definition
-                    for i, fieldi in enumerate(field):
-                        if fieldi:
-                            fieldr = getattr(md.outputdefinition, solutionfield)[i]
-                            # Get subfields
-                            for solutionsubfield, subfield in list(fieldi.__dict__.items()):
-                                if np.size(subfield) == md.mesh.numberofvertices:
-                                    setattr(fieldr, solutionsubfield, project2d(md, subfield, 1))
-                                elif np.size(subfield) == md.mesh.numberofelements:
-                                    setattr(fieldr, solutionsubfield, project2d(md, subfield, 1))
-
-        # Initialize 2d mesh
-        mesh = mesh2d()
-        mesh.x = md.mesh.x2d
-        mesh.y = md.mesh.y2d
-        mesh.numberofvertices = md.mesh.numberofvertices2d
-        mesh.numberofelements = md.mesh.numberofelements2d
-        mesh.elements = md.mesh.elements2d
-        # if not np.isnan(md.mesh.vertexonboundary).all():
-        #     mesh.vertexonboundary = project2d(md, md.mesh.vertexonboundary, 1)
-        # if not np.isnan(md.mesh.elementconnectivity).all():
-        #     mesh.elementconnectivity = project2d(md, md.mesh.elementconnectivity, 1)
-        if np.size(md.mesh.lat) == md.mesh.numberofvertices:
-            mesh.lat = project2d(md, md.mesh.lat, 1)
-        if np.size(md.mesh.long) == md.mesh.numberofvertices:
-            mesh.long = project2d(md, md.mesh.long, 1)
-        mesh.epsg = md.mesh.epsg
-        if np.size(md.mesh.scale_factor) == md.mesh.numberofvertices:
-            mesh.scale_factor = project2d(md, md.mesh.scale_factor, 1)
-        if hasattr(md.mesh, 'vertexonboundary') and not np.isnan(md.mesh.vertexonboundary).all():
-            mesh.vertexonboundary = project2d(md, md.mesh.vertexonboundary, 1)
-        if hasattr(md.mesh, 'elementonboundary') and not np.isnan(md.mesh.elementonboundary).all():
-            mesh.elementonboundary = project2d(md, md.mesh.elementonboundary, 1)
-        md.mesh = mesh
-        md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)
-        md.mesh.elementconnectivity = ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)
-        md.mesh.segments = contourenvelope(md.mesh)
-
-        return md
-    # }}}
Index: sm/trunk/src/m/classes/modellist.m
===================================================================
--- /issm/trunk/src/m/classes/modellist.m	(revision 28275)
+++ 	(revision )
@@ -1,385 +1,0 @@
-%MODELLIST class definition
-%
-%   Usage:
-%      modellist=modellist({md1 md2 md3});
-
-classdef modellist
-	properties (SetAccess=public) 
-		models  = cell(0,1);
-		cluster = generic();
-	end
-	methods
-		function md_list=modelsextract(md,flags,minel,varargin) % {{{
-			%modelsextract - extract several self contained models according to a list of element flags.
-			%
-			%   The difference between this routine and the modelextract.m routine (without an 's') is that 
-			%   as many models are extracted as there are closed contours defined in area. 
-			%   This routine is needed for example when doing data assimilation of ice shelves in Antarctica. 
-			%   Many independent ice shelves are present, and we don't want data assimilation on one ice shelf 
-			%   to be hindered by another totally independent ice shelf.
-			%
-			%   Usage:
-			%      md_list=modelsextract(md,elementfalgs,minel);
-			%
-			%   Examples:
-			%      md_list=modelsextract(md...,,1000);
-			%
-			%   See also: EXTRUDE, COLLAPSE, MODELEXTRACT
-
-			disp('selecting pools of elements');
-			%go through flags and build as many independent element flags as there are groups of connected 1s
-			%in flags.
-
-			%2D or 3D?
-			if dimension(md.mesh)==3,
-				numberofelements=md.mesh.numberofelements2d; %this will be forgotten when we get out.
-				flags=project2d(md,flags,1);
-			else
-				numberofelements=md.mesh.numberofelements;
-			end
-
-			%recover extra arguments: 
-			distance=0;
-			if nargin==4,
-				distance=varargin{1};
-			end
-
-			flag_list=cell(0,1);
-
-			for i=1:size(flags,1),
-
-				if (flags(i)),
-
-					%ok, we are sure element i is part of a new pool.
-					pool=zeros(numberofelements,1);
-					pool=PropagateFlagsFromConnectivity(md.mesh.elementconnectivity,pool,i,flags);
-					flag_list{end+1,1}=pool;
-
-					%speed up rest of computation by taking pool out of flags: 
-					pos=find(pool);flags(pos)=0;
-
-				end
-			end
-
-			%go through flag_list and discard any pool of less than minel elements: 
-			ex_pos=[];
-			for i=1:length(flag_list),
-				if length(find(flag_list{i}))<minel,
-					ex_pos=[ex_pos; i];
-				end
-			end
-			flag_list(ex_pos)=[];
-
-			%now, if distance was specified, expand the flag_list by distance km: 
-			if distance,
-				for i=1:length(flag_list),
-					flag_list{i}=PropagateFlagsUntilDistance(md,flag_list{i},distance);
-				end
-			end
-
-			%now, go use the pools of flags to extract models: 
-			disp(['extracting ' num2str(size(flag_list,1)) ' models']);
-			models=cell(0,1);
-
-			for i=1:size(flag_list,1),
-				disp(['   ' num2str(i) '/' num2str(size(flag_list,1))]);
-				if dimension(md.mesh)==3,
-					flags2d=flag_list{i};
-					realflags=project3d(md,flags2d,'element');
-				else
-					realflags=flag_list{i};
-				end
-				models{end+1,1}=modelextract(md,realflags);
-			end
-
-			%return model list
-			md_list=modellist(models);
-
-		end %end of this function }}}
-		function md_list=modelsextractfromdomains(md,directory) % {{{
-			%modelsextractfromdomains- extract several self contained models according to a list of domains
-			%
-			%   Usage:
-			%      md_list=modelsextractfromdomains(md,'Basins/');
-			%
-			%   Examples:
-			%      md_list=modelsextract(md,'Basins/');
-			%
-			%   See also: MODELSEXTRACTS, MODELEXTRACT
-
-			%go into directory and get list of files.
-			cd(directory);
-			basins=listfiles;
-			cd ..
-
-			models=cell(0,1);
-			for i=1:length(basins),
-				models{end+1,1}=modelextract(md,[directory '/' basins{i}]);
-			end
-
-			%return model list: 
-			md_list=modellist(models);
-
-		end % }}}
-		function self = modellist(varargin) % {{{
-
-			%initialize list
-			if nargin==0,
-				%Do nothing,
-			elseif nargin==1,
-				if ~isa(varargin{1},'cell'),
-					error('not supported yet');
-				end
-
-				celllist=varargin{1};
-
-				%check on size of cell list: 
-				if (size(celllist,2)~=1),
-					error('modellist constructor error message: list of models should be a cell list of column size 1');
-				end
-
-				%check that only models are in the celllist: 
-				for i=1:size(celllist,1),
-					if ~isa(celllist{i},'model')
-						error(['modellist constructor error message: element ' num2str(i) ' of cell list is not a model!']);
-					end
-				end
-
-				self.models  = celllist;
-				self.cluster = self.models{1}.cluster;
-			end
-		end % }}}
-		function val = get(self, propName)% {{{
-		%GET - gets model propertie from a specified object ans returns the value
-		% 
-		%   Usage:
-		%      val = get(a, propName)
-
-			switch propName
-				case 'numberofelements'
-					val = self.numberofelements;
-				case 'numberofnodes'
-					val = self.numberofnodes;
-				case 'elements' 
-					val = self.elements;
-				case 'x' 
-					val = self.x;
-				case 'y' 
-					val = self.y;
-				case 'z' 
-					val = self.z;
-				otherwise
-					error(['get error message: ' propName,' is not a valid model property'])
-			end
-		end % }}}
-		function self = loadmultipleresultsfromcluster(self) % {{{
-			%LOADMULTIPLERESULTSFROMCLUSTER - load multiple results of solution sequences from cluster
-			%
-			%   Usage:
-			%      self=loadresultsfromcluster(self);
-
-			nummodels=length(self.models);
-
-			%Get cluster settings
-			cluster=self.cluster;
-			name=self.name;
-			cluster_rc_location=which('cluster.rc');
-			[codepath,executionpath]=ClusterParameters(cluster,cluster_rc_location);
-
-			%Remote tar: 
-			disp('tarring results');
-			issmssh(cluster,['"cd ' executionpath '/' name ' && rm -rf file_list.txt ModelResults.tar.gz && find -iname ''*-*vs*.outbin'' > file_list.txt && tar zcvf ModelResults.tar.gz --files-from file_list.txt  && rm -rf file_list.txt "']);
-
-			%copy results from cluster to present directory
-			scpin(cluster, [executionpath '/' name], {'ModelResults.tar.gz'});
-
-			%untar:
-			!tar -zxvf ModelResults.tar.gz
-
-			%ok, go through list and load results from disk: 
-			for i=1:nummodels,
-				%load  results for this model
-				self.models{i}=loadresultsfromdisk(self.models{i},[name '-' num2str(i) 'vs' num2str(nummodels) '.outbin']);
-
-				delete([name '-' num2str(i) 'vs' num2str(nummodels) '.outbin']);
-			end
-
-			%erase files 
-			delete('ModelResults.tar.gz');
-		end % }}}
-		function self = solve(self,varargin)% {{{
-			%SOLVE - apply solution sequence for  a list of models. Used in batch mode.
-			%
-			%   Usage:
-			%      self=solve(self,varargin)
-			%      where varargin is a lit of paired arguments. 
-			%      arguments can be: 'analysis_type': 'stressbalance','thermal','masstransport','transient'
-			%
-			%   Examples:
-			%      self=solve(self,'analysis_type','stressbalance');
-
-			%recover options
-			options=pairoptions(varargin{:});
-
-			%add default options
-			options=process_solve_options(options);
-
-			%length of list
-			nummodels=length(self.models);
-
-			%name of queue: to make it unique, add a time stamp
-			name=[self.name '-' datestr(now,1) '-' datestr(now,'HH-MM-SS') ];
-
-			%name of cluster will be first name of list
-			cluster=self.cluster;
-
-			%Figure out parameters for this particular cluster
-			cluster_rc_location=which('cluster.rc');
-			[codepath,executionpath]=ClusterParameters(cluster,cluster_rc_location);
-
-			%solve in batch mode: 
-			for i=1:nummodels,
-
-				%model
-				mdex=self.models{i};
-
-				%recover some fields
-				mdex.analysis_type=options.analysis_type;
-
-				mdex.name=[name '-' num2str(i) 'vs' num2str(nummodels)];
-				mdex.time=self.time;
-				mdex.queue=self.queue;
-				mdex.cluster=self.cluster;
-				if ~isnan(self.np),
-					mdex.np=self.np;
-				end
-
-				%call solve in batch mode:
-				if strcmpi(cluster,oshostname),
-					mdex=solve(mdex,varargin{:});
-				else
-					mdex=solve(mdex,varargin{:},'batch','yes','directory',name);
-				end
-
-				%feed back
-				self.models{i}=mdex;
-			end
-
-			%locally, we are done.
-			if strcmpi(cluster,oshostname),
-				return
-			end
-
-			%now, tar all the files and then erase them.
-			eval(['!find -iname ''' name '-*'' > file_list.txt']);
-			!tar zcvf ModelList.tar.gz --files-from file_list.txt
-			!rm -rf *.bin *.queue file_list.txt
-
-			%still have to build a launching script.
-			BuildMultipleQueueingScript(cluster,name,executionpath,codepath);
-
-			%launch jobs on remote cluster
-			LaunchMultipleQueueJob(cluster,name,executionpath);
-
-			%erase files: 
-			delete([name '.queue']);
-			delete('ModelList.tar.gz');
-
-			%save name: 
-			self.name=name;
-		end % }}}
-	end
-end
-
-function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)% {{{
-%BUILDMULTIPLEQUEUEINGSCRIPT - 
-%
-%   Usage:
-%      BuildMultipleQueueingScript(executionpath,codepath)
-
-disp('building queuing script');
-
-%First try and figure out if there is a special script for this particular cluster
-function_name=['BuildMultipleQueueingScript' cluster]
-
-%some specific treatment of identical cluster, gemini, castor and pollux
-if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
-	function_name='BuildMultipleQueueingScriptgemini';
-end
-
-if exist(function_name,'file'),
-	%Call this function:
-	eval([function_name '(name,executionpath,codepath);']);
-else
-	%Call the generic BuildQueueingScript:
-	BuildMultipleQueueingScriptGeneric(name,executionpath,codepath);
-end
-end % }}}
-function BuildQueueingScriptgemini(name,executionpath,codepath)% {{{
-%BUILDQUEUEINGSCRIPTGEMINI - ...
-%
-%   Usage:
-%      BuildQueueingScriptgemini(md,executionpath,codepath)
-
-scriptname=[name '.queue'];
-
-fid=fopen(scriptname,'w');
-if fid==-1,
-	error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
-end
-
-fprintf(fid,'#!/bin/sh\n');
-fprintf(fid,'cd %s\n',executionpath);
-fprintf(fid,'mkdir %s\n',name);
-fprintf(fid,'cd %s\n',name);
-fprintf(fid,'mv ../ModelList.tar.gz ./\n');
-fprintf(fid,'tar -zxvf ModelList.tar.gz\n');
-fprintf(fid,'foreach i (%s-*vs*.queue)\n',name);
-fprintf(fid,'qsub $i\n');
-fprintf(fid,'end\n');
-fclose(fid);
-end% }}}
-function LaunchMultipleQueueJob(cluster,name,executionpath)% {{{
-%LAUNCHMULTIPLEQUEUEJOB - ...
-%
-%   Usage:
-%      LaunchMultipleQueueJob(executionpath)
-
-%First try and figure out if there is a special script for thie particular cluster
-function_name=['LaunchMultipleQueueJob' cluster]
-
-%some specific treatment of identical cluster, gemini, castor and pollux
-if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
-	function_name='LaunchMultipleQueueJobgemini';
-end
-
-if exist(function_name,'file'),
-	%Call this function:
-	eval([function_name '(cluster,name,executionpath);']);
-else
-	%Call the generic LaunchMultipleQueueJob:
-	LaunchMultipleQueueJobGeneric(cluster,name,executionpath);
-end
-end% }}}
-function md=LaunchMultipleQueueJobgemini(cluster,name,executionpath)% {{{
-%LAUNCHMULTIPLEQUEUEJOBGEMINI - Launch multiple queuing script on Gemini cluster
-%
-%   Usage:
-%      LaunchMultipleQueueJobgemini(cluster,name,executionpath)
-
-%first, check we have the binary file and the queuing script
-if ~exist([ name '.queue'],'file'),
-	error('LaunchMultipleQueueJobgemini error message: queuing script issing, cannot go forward');
-end
-
-if ~exist('ModelList.tar.gz','file'),
-	error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward');
-end
-
-%upload both files to cluster
-disp('uploading input file,  queuing script and variables script');
-eval(['!scp ModelList.tar.gz ' name '.queue '  cluster ':' executionpath]);
-
-disp('launching solution sequence on remote cluster');
-issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']);
-end% }}}
Index: sm/trunk/src/m/classes/nodalvalue.m
===================================================================
--- /issm/trunk/src/m/classes/nodalvalue.m	(revision 28275)
+++ 	(revision )
@@ -1,69 +1,0 @@
-%NODALVALUE class definition
-%
-%   Usage:
-%      nodalvalue=nodalvalue();
-%      nodalvalue=nodalvalue('name','SealevelchangeSNodalValue',...
-%                    'definitionstring','Outputdefinition1', 
-%                    'model_string','SealevelchangeS',
-%                    'node',1);
-
-classdef nodalvalue
-	properties (SetAccess=public)
-		%nodalvalue
-		name              = '';
-		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-10]'
-		model_string      = ''; %string for field that is being retrieved
-		node             = NaN; %for which node are we retrieving the value?
-	end
-	
-	methods
-		function self = nodalvalue(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.model_string=getfieldvalue(options,'model_string');
-				self.node=getfieldvalue(options,'node',NaN);
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('nodalvalue error message: ''name'' field should be a string!');
-			end
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-			md = checkfield(md,'fieldname','self.node','field',self.node,'values',[1:md.mesh.numberofvertices]);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   Nodalvalue:\n'));
-
-			fielddisplay(self,'name','identifier for this nodalvalue response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
-			fielddisplay(self,'model_string','string for field that is being retrieved');
-			fielddisplay(self,'node','vertex index at which we retrieve the value');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'data',self.name,'name','md.nodalvalue.name','format','String');
-			WriteData(fid,prefix,'data',self.definitionstring,'name','md.nodalvalue.definitionenum','format','String');
-			WriteData(fid,prefix,'data',self.model_string,'name','md.nodalvalue.model_enum','format','String');
-			WriteData(fid,prefix,'data',self.node,'name','md.nodalvalue.node','format','Integer');
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/nodalvalue.py
===================================================================
--- /issm/trunk/src/m/classes/nodalvalue.py	(revision 28275)
+++ 	(revision )
@@ -1,66 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from WriteData import WriteData
-
-
-class nodalvalue(object):
-    """NODALVALUE class definition
-
-    Usage:
-        nodalvalue=nodalvalue()
-        nodalvalue=nodalvalue(
-            'name', 'SealevelchangeSNodalValue',
-            'definitionstring', 'Outputdefinition1',
-            'model_string', 'SealevelchangeS',
-            'node', 1
-        )
-    """
-
-    def __init__(self, *args):  #{{{
-        self.name = ''
-        self.definitionstring = ''  # string that identifies this output definition uniquely, from 'Outputdefinition[1-10]'
-        self.model_string = ''  # string for field that is being retrieved
-        self.node = np.nan  #for which node are we retrieving the value?
-
-        #use provided options to change fields
-        options = pairoptions(*args)
-
-        # Get name
-        self.name = options.getfieldvalue('name', '')
-        self.definitionstring = options.getfieldvalue('definitionstring', '')
-        self.model_string = options.getfieldvalue('model_string', '')
-        self.node = options.getfieldvalue('node', '')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Nodalvalue:\n'
-        s += '{}\n'.format(fielddisplay(self, 'name', 'identifier for this nodalvalue response'))
-        s += '{}\n'.format(fielddisplay(self, 'definitionstring', 'string that identifies this output definition uniquely, from \'Outputdefinition[1-10]\''))
-        s += '{}\n'.format(fielddisplay(self, 'model_string', 'string for field that is being retrieved'))
-        s += '{}\n'.format(fielddisplay(self, 'node', 'vertex index at which we retrieve the value'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if not isinstance(self.name, str):
-            raise Exception('nodalvalue error message: \'name\' field should be a string!')
-        OutputdefinitionStringArray = []
-        for i in range(100):
-            OutputdefinitionStringArray.append('Outputdefinition{}'.format(i))
-        md = checkfield(md, 'fieldname', 'self.definitionstring', 'field', self.definitionstring, 'values', OutputdefinitionStringArray)
-        md = checkfield(md, 'fieldname', 'self.node', 'field', self.node, 'values', range(md.mesh.numberofvertices))
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        WriteData(fid, prefix, 'data', self.name, 'name', 'md.nodalvalue.name', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.definitionstring, 'name', 'md.nodalvalue.definitionenum', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.model_string, 'name', 'md.nodalvalue.model_enum', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.node, 'name', 'md.nodalvalue.node', 'format', 'Integer')
-    # }}}
Index: sm/trunk/src/m/classes/numberedcostfunction.m
===================================================================
--- /issm/trunk/src/m/classes/numberedcostfunction.m	(revision 28275)
+++ 	(revision )
@@ -1,122 +1,0 @@
-%NUMBEREDCOSTFUNCTION class definition
-%
-%   Usage:
-%      numberedcostfunction=numberedcostfunction();
-
-classdef numberedcostfunction
-	properties (SetAccess=public) 
-		name								 = '';
-		definitionstring				 = '';
-		cost_functions              = NaN
-		cost_functions_coefficients = NaN
-		vx_obs                      = NaN
-		vy_obs                      = NaN
-		vz_obs                      = NaN
-		vel_obs                     = NaN
-		thickness_obs               = NaN
-		surface_obs                 = NaN
-	end
-	methods
-		function self = numberedcostfunction(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(numberedcostfunction(),varargin{1});
-				otherwise
-					error('construtor not supported yet');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.vx_obs=project3d(md,'vector',self.vx_obs,'type','node');
-			self.vy_obs=project3d(md,'vector',self.vy_obs,'type','node');
-			self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node');
-			self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node');
-			if numel(self.cost_functions_coefficients)>1,self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node');end;
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%several responses can be used:
-			self.cost_functions=101;
-			
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			num_costfunc=size(self.cost_functions,2);
-
-			md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.dependent{X}.cost_functions','field',self.cost_functions,'size',[1 num_costfunc],'values',supportedcostfunctions());
-			md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.cost_functions_coefficients','field',self.cost_functions_coefficients,'size',[md.mesh.numberofvertices numel(self.cost_functions)],'>=',0);
-			
-			if strcmp(solution,'BalancethicknessSolution')
-				md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.thickness_obs','field',self.thickness_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.surface_obs','field',self.surface_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			elseif strcmp(solution,'BalancethicknessSoftSolution')
-				md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.thickness_obs','field',self.thickness_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			else
-				md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.vx_obs','field',self.vx_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				if ~strcmp(domaintype(md.mesh),'2Dvertical'),
-					md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.vy_obs','field',self.vy_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				end
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   numberedcostfunction parameters:'));
-			fielddisplay(self,'cost_functions','indicate the type of response for each optimization step');
-			fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
-			fielddisplay(self,'vx_obs','observed velocity x component [m/yr]');
-			fielddisplay(self,'vy_obs','observed velocity y component [m/yr]');
-			fielddisplay(self,'vel_obs','observed velocity magnitude [m/yr]');
-			fielddisplay(self,'thickness_obs','observed thickness [m]');
-			fielddisplay(self,'surface_obs','observed surface elevation [m]');
-			disp('Available cost functions:');
-			disp('   101: SurfaceAbsVelMisfit');
-			disp('   102: SurfaceRelVelMisfit');
-			disp('   103: SurfaceLogVelMisfit');
-			disp('   104: SurfaceLogVxVyMisfit');
-			disp('   105: SurfaceAverageVelMisfit');
-			disp('   201: ThicknessAbsMisfit');
-			disp('   501: DragCoefficientAbsGradient');
-			disp('   502: RheologyBbarAbsGradient');
-			disp('   503: ThicknessAbsGradient');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'data',self.name,'name','md.numberedcostfunction.name','format','String');
-			WriteData(fid,prefix,'data',self.definitionstring,'name','md.numberedcostfunction.definitionstring','format','String');
-
-			WriteData(fid,prefix,'data',self.cost_functions_coefficients,'name','md.numberedcostfunction.cost_functions_coefficients','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'data',self.vx_obs,'name','md.numberedcostfunction.vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'data',self.vy_obs,'name','md.numberedcostfunction.vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'data',self.vz_obs,'name','md.numberedcostfunction.vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'data',self.vel_obs,'name','md.numberedcostfunction.vel_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			if(numel(self.thickness_obs)==md.mesh.numberofelements),
-				mattype=2;
-			else
-				mattype=1;
-			end
-			WriteData(fid,prefix,'data',self.thickness_obs,'name','md.numberedcostfunction.thickness_obs','format','DoubleMat','mattype',mattype);
-			WriteData(fid,prefix,'data',self.surface_obs,'name','md.numberedcostfunction.surface_obs','format','DoubleMat','mattype',mattype);
-
-			%process cost functions
-			num_cost_functions=size(self.cost_functions,2);
-			data=marshallcostfunctions(self.cost_functions);
-			WriteData(fid,prefix,'data',data,'name','md.numberedcostfunction.cost_functions','format','StringArray');
-			WriteData(fid,prefix,'data',num_cost_functions,'name','md.numberedcostfunction.num_cost_functions','format','Integer');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs2Darray(fid,[modelname '.inversion.cost_functions'],self.cost_functions);
-			writejs2Darray(fid,[modelname '.inversion.cost_functions_coefficients'],self.cost_functions_coefficients);
-			writejs1Darray(fid,[modelname '.inversion.vx_obs'],self.vx_obs);
-			writejs1Darray(fid,[modelname '.inversion.vy_obs'],self.vy_obs);
-			writejs1Darray(fid,[modelname '.inversion.vz_obs'],self.vz_obs);
-			writejs1Darray(fid,[modelname '.inversion.vel_obs'],self.vel_obs);
-			writejs1Darray(fid,[modelname '.inversion.thickness_obs'],self.thickness_obs);
-			writejs1Darray(fid,[modelname '.inversion.surface_obs'],self.surface_obs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/offlinesolidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/offlinesolidearthsolution.m	(revision 28275)
+++ 	(revision )
@@ -1,44 +1,0 @@
-%OFFLINESOLIDEARTHSOLUTION class definition
-%
-%   Usage:
-%      addsol=offlinesolidearthsolution();
-
-classdef offlinesolidearthsolution < solidearthsolution
-	properties (SetAccess=public) 
-	end
-	methods
-		function self = offlinesolidearthsolution(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.setdefaultparameters@solidearthsolution();
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
-				error('offlinesolidearthsolution.m::checkconsistency: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
-			end
-			self.checkconsistency@solidearthsolution(md,solution,analyses);
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   external: offlinesolidearth solution:'));
-			self.disp@solidearthsolution();
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			disp(sprintf('   external (offlinesolidearthsolution) solution:'));
-			WriteData(fid,prefix,'data',2,'name','md.solidearth.external.nature','format','Integer'); %code 2 for offlinesolidearthsolution  class
-			self.marshall@solidearthsolution(prefix,md,fid);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			self.savemodeljs@solidearthsolution(fid,modelname);
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/offlinesolidearthsolution.py
===================================================================
--- /issm/trunk/src/m/classes/offlinesolidearthsolution.py	(revision 28275)
+++ 	(revision )
@@ -1,85 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class offlinesolidearthsolution(object):
-    """OFFLINESOLIDEARTHSOLUTION class definition
-
-    Usage:
-        offlinesolidearthsolution = offlinesolidearthsolution()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.displacementeast = None
-        self.displacementnorth = None
-        self.displacementup = None
-        self.geoid = None
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise RuntimeError('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '         units for time series is (yr)\n       external: offlinesolidearth solution\n'
-        s += '{}\n'.format(fielddisplay(self, 'displacementeast', 'solid-Earth Eastwards bedrock displacement series (m)'))
-        s += '{}\n'.format(fielddisplay(self, 'displacementnorth', 'solid-Earth Northwards bedrock displacement time series (m)'))
-        s += '{}\n'.format(fielddisplay(self, 'displacementup', 'solid-Earth bedrock uplift time series (m)'))
-        s += '{}\n'.format(fielddisplay(self, 'geoid', 'solid-Earth geoid time series (m)'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.displacementeast = []
-        self.displacementnorth = []
-        self.displacementup = []
-        self.geoid = []
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if ('SealevelchangeAnalysis' not in analyses) or ((solution=='TransientSolution') and (md.solidearth.settings.isgrd==1)): 
-            print('offlinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!')
-            return md
-        md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1)
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        # Transform our time series into time series rates
-        if len(np.shape(self.displacementeast)) == 1:
-            print('Warning: offlinesolidearthsolution.py::marshall: only one time step provided, assuming the values are rates per year')
-            displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
-            displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
-            displacementup_rate = np.append(np.array(self.displacementup).reshape(-1, 1), 0)
-            geoid_rate = np.append(np.array(self.geoid).reshape(-1, 1), 0)
-        else:
-            time = self.displacementeast[-1, :]
-            dt = np.diff(time, axis=0)
-            displacementeast_rate = np.diff(self.displacementeast[0:-2, :], 1, 1) / dt
-            displacementeast_rate = np.append(displacementeast_rate,time[:-1].reshape(1,-1),axis=0)
-            displacementnorth_rate = np.diff(self.displacementnorth[0:-2, :], 1, 1) / dt
-            displacementnorth_rate = np.append(displacementnorth_rate,time[:-1].reshape(1,-1),axis=0)
-            displacementup_rate = np.diff(self.displacementup[0:-2, :], 1, 1) / dt
-            displacementup_rate = np.append(displacementup_rate,time[:-1].reshape(1,-1),axis=0)
-            geoid_rate = np.diff(self.geoid[0:-2, :], 1, 1) / dt
-            geoid_rate = np.append(geoid_rate,time[:-1].reshape(1,-1),axis=0)
-
-        WriteData(fid, prefix, 'name', 'md.solidearth.external.nature', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementup', 'data', displacementup_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geoid', 'data', geoid_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/organizer.m
===================================================================
--- /issm/trunk/src/m/classes/organizer.m	(revision 28275)
+++ 	(revision )
@@ -1,305 +1,0 @@
-%ORGANIZER class definition
-%
-%   Supported options:
-%      repository: directory where all models will be saved
-%      prefix:     prefix for saved model names
-%      steps:      requested steps
-%      color:      color of step title (default is '41;37')
-%
-%   Usage:
-%      org = organizer(varargin)
-%
-%   Examples:
-%      org = organizer('repository','Models/','prefix','AGU2015','steps',0);  %build an empty organizer object with a given repository
-
-classdef organizer < handle
-	properties (SetAccess=private) 
-		% {{{
-		currentstep   =0;
-	end
-    properties (SetAccess=public) 
-		repository    ='';
-		prefix        ='';
-		color         ='';
-		steps         =[];
-		skipio        = false;
-		requestedsteps=[0];
-		%}}}
-	end
-	methods
-		function org=organizer(varargin) % {{{
-
-			%process options
-			options=pairoptions(varargin{:});
-
-			%Get prefix
-			prefix=getfieldvalue(options,'prefix','model_');
-			if ~ischar(prefix),                            error('prefix is not a string'); end
-			if ~strcmp(regexprep(prefix,'\s+',''),prefix), error('prefix should not have any white space'); end
-			org.prefix=prefix;
-
-			%Get repository
-			repository=getfieldvalue(options,'repository','./');
-			if ~ischar(repository),        error('repository is not a string'); end
-			if exist(repository,'dir')~=7, error(['Directory ' repository ' not found']), end
-			org.repository=repository;
-
-			%Color
-			org.color=getfieldvalue(options,'color','41;37');
-
-			%Get steps
-			org.requestedsteps=getfieldvalue(options,'steps',0);
-
-			%Skip io?
-			org.skipio=getfieldvalue(options,'skipio',0);
-		end
-		%}}}
-		function reset(org,varargin) % {{{
-			
-			%process options
-			options=pairoptions(varargin{:});
-		
-			%Zero out some fields: 
-			org.currentstep   =0;
-			org.steps=[];
-	
-			%get requested step: 
-			org.requestedsteps=getfieldvalue(options,'steps',0);
-			
-		end
-		%}}}
-		function disp(org) % {{{
-			disp(sprintf('   Repository: ''%s''',org.repository));
-			disp(sprintf('   Prefix:     ''%s''\n',org.prefix));
-			disp(sprintf('   Color:      ''%s''\n',org.color));
-			disp(sprintf('   skipio:     %i\n',org.skipio));
-			if isempty(org.steps)
-				disp('   no step');
-			else
-				for i=1:length(org.steps),
-					disp(sprintf('   step #%2i: ''%s''',org.steps(i).id,org.steps(i).string));
-				end
-			end
-		end
-		%}}}
-		function md=load(org,string),% {{{
-
-			%Get model path
-			if ~ischar(string), error('argument provided is not a string'); end
-			path=[org.repository '/' org.prefix string];
-
-			%Skip if requested
-			if org.skipio,
-				disp(['WARNING: Skipping loading ' path]);
-				md = evalin('base', 'md');
-				return;
-			end
-
-			%figure out if the model is there
-			if exist(path,'file'),
-				path=path;
-			elseif exist([path '.mat'],'file'),
-				path=[path '.mat'];
-			else
-				error(['Could not find ' path ]);
-			end
-
-			struc=load(path,'-mat');
-			name=char(fieldnames(struc));
-			md=struc.(name);
-			if nargout,
-				varargout{1}=md;
-			end
-		end%}}}
-		function md=loadmodel(org,string),% {{{
-
-			%Get model path
-			if ~ischar(string), error('argument provided is not a string'); end
-			path=[org.repository '/' org.prefix string];
-
-			%Skip if requested
-			if org.skipio,
-				disp(['WARNING: Skipping loading ' path]);
-				md = evalin('base', 'md');
-				return;
-			end
-
-			%figure out if the model is there, otherwise, we have to use the default path supplied by user.
-			if exist(path,'file') | exist([path '.mat'],'file'),
-				md=loadmodel(path);
-				return;
-			end
-
-			%If we are here, the data has not been found. 
-			error(['Could not find ' path ]);
-		end%}}}
-		function loaddata(org,string),% {{{
-
-			%Get model path
-			if ~ischar(string), error('argument provided is not a string'); end
-			path=[org.repository '/' org.prefix string];
-
-			%figure out if the data is there, otherwise, we have to use the default path supplied by user.
-			if exist(path,'file'),
-				path=path;
-			elseif exist([path '.mat'],'file'),
-				path=[path '.mat'];
-			else
-				error(['Could not find ' path ]);
-			end
-			if exist(path,'file')
-				evalin('caller',['load -mat ' path]);
-				return;
-			end
-
-			%If we are here, the data has not been found. 
-			error(['Could not find ' path ]);
-		end%}}}
-		function loaddatanoprefix(org,string),% {{{
-
-			%Get model path
-			if ~ischar(string), error('argument provided is not a string'); end
-			path=[org.repository '/' string];
-
-			%figure out if the data is there, otherwise, we have to use the default path supplied by user.
-			if exist(path,'file'),
-				path=path;
-			elseif exist([path '.mat'],'file'),
-				path=[path '.mat'];
-			else
-				error(['Could not find ' path ]);
-			end
-			if exist(path,'file')
-				evalin('caller',['load -mat ' path]);
-				return;
-			end
-
-			%If we are here, the data has not been found. 
-			error(['Could not find ' path ]);
-		end%}}}
-		function bool=perform(org,varargin) % {{{
-
-			bool=false;
-			
-			%group,string are the variable arguments length: 
-			if nargin==2,
-				string=varargin{1};
-			elseif nargin==3,
-				string=sprintf('%s.%s',varargin{1},varargin{2});
-			end
-
-			%Some checks
-			if ~ischar(string),                            error('Step provided should be a string'); end
-			if ~strcmp(regexprep(string,'\s+',''),string), error('Step provided should not have any white space'); end
-			if (org.currentstep>0 & ismember({string},{org.steps.string})) 
-				error(['Step ' string ' already present. Change name']); 
-			end
-
-			%Add step
-			org.steps(end+1).id=length(org.steps)+1;
-			org.steps(end).string=string;
-			org.currentstep=org.currentstep+1;
-
-			%if requestedsteps = 0, print all steps in org 
-			if any(org.requestedsteps==0),
-				if org.currentstep==1,
-					disp(sprintf('   prefix: %s',org.prefix));
-				end
-				disp(sprintf('   step #%2i : %s',org.steps(org.currentstep).id,org.steps(org.currentstep).string));
-			end
-
-			%Ok, now if currentstep is a member of steps, return true
-			if ismember(org.currentstep,org.requestedsteps),
-				if usejava('desktop'),
-					disp(sprintf('\n   step #%i : %s\n',org.steps(org.currentstep).id,org.steps(org.currentstep).string));
-				else
-					%Print on a red background
-					fprintf(['\n\033[' org.color 'm   step #' num2str(org.steps(org.currentstep).id) ': ' org.steps(org.currentstep).string '   \033[0m\n\n']);
-				end
-				bool=true;
-
-				%last check: is this step locked? 
-				string=org.steps(org.currentstep).string; 
-				if length(string)>7,
-					if strcmpi(string(end-5:end),'Locked'),
-						error('organizer: you are  trying to run a locked step! Unlock it first!');
-					end
-				end
-			end
-		end%}}}
-		function savemodel(org,md) % {{{
-
-			%check
-			if (org.currentstep==0), error('Cannot save model because organizer (org) is empty! Make sure you did not skip any perform call'); end
-			if (org.currentstep>length(org.steps)), error('Cannot save model because organizer (org) is not up to date!'); end
-
-			name=[org.repository '/' org.prefix org.steps(org.currentstep).string ];
-			disp(['saving model as: ' name]);
-
-			%Skip if requested
-			if org.skipio,
-				disp(['WARNING: Skipping saving ' name]);
-				return;
-			end
-
-			%check that md is a model
-			if ~isa(md,'model') & ~isa(md,'sealevelmodel'), warning('second argument is not a model'); end
-			if (org.currentstep>length(org.steps)), error(['organizer error message: element with id ' num2str(org.currentstep) ' not found']); end
-
-			%save model
-			save(name,'md','-v7.3');
-		end%}}}
-		function savedata(org,varargin) % {{{
-
-			%check
-			if (org.currentstep==0), error('Cannot save data because organizer (org) is empty! Make sure you did not skip any perform call'); end
-			if (org.currentstep>length(org.steps)), error('Cannot save data because organizer (org) is not up to date!'); end
-
-			name=[org.repository '/' org.prefix org.steps(org.currentstep).string ];
-			disp(['saving data in: ' name]);
-
-			%Skip if requested
-			if org.skipio,
-				disp(['WARNING: Skipping saving ' name]);
-				return;
-			end
-
-			%check that md is a model
-			if (org.currentstep>length(org.steps)), error(['organizer error message: element with id ' num2str(org.currentstep) ' not found']); end
-
-			%list of variable names: 
-			variables='';
-			for i=2:nargin, 
-				variables=[variables ',' '''' inputname(i) ''''];
-				eval([inputname(i) '= varargin{' num2str(i-1) '};']);
-			end
-			eval(['save(''' name '''' variables ',''-v7.3'');']);
-		end%}}}
-		function savedatanoprefix(org,varargin) % {{{
-
-			%check
-			if (org.currentstep==0), error('Cannot save data because organizer (org) is empty! Make sure you did not skip any perform call'); end
-			if (org.currentstep>length(org.steps)), error('Cannot save data because organizer (org) is not up to date!'); end
-
-			name=[org.repository '/' org.steps(org.currentstep).string ];
-			disp(['saving data in: ' name]);
-
-			%Skip if requested
-			if org.skipio,
-				disp(['WARNING: Skipping saving ' name]);
-				return;
-			end
-
-			%check that md is a model
-			if (org.currentstep>length(org.steps)), error(['organizer error message: element with id ' num2str(org.currentstep) ' not found']); end
-
-			%list of variable names: 
-			variables='';
-			for i=2:nargin, 
-				variables=[variables ',' '''' inputname(i) ''''];
-				eval([inputname(i) '= varargin{' num2str(i-1) '};']);
-			end
-			eval(['save(''' name '''' variables ',''-v7.3'');']);
-		end%}}}
-	end
-end
Index: sm/trunk/src/m/classes/organizer.py
===================================================================
--- /issm/trunk/src/m/classes/organizer.py	(revision 28275)
+++ 	(revision )
@@ -1,190 +1,0 @@
-import os.path
-from collections import OrderedDict
-import pairoptions
-from loadvars import loadvars
-from loadmodel import loadmodel
-from savevars import savevars
-from model import model
-#hack to keep python 2 compatipility
-try:
-    #py3 import
-    import dbm
-except ImportError:
-    #py2 import
-    from whichdb import whichdb
-
-import MatlabFuncs as m
-
-
-class organizer(object):
-    """
-    ORGANIZER class definition
-
-       Supported options:
-          repository: directory where all models will be saved
-          prefix:     prefix for saved model names
-          steps:      requested steps
-          trunkprefix:prefix of previous run with a different prefix. Used to branch.
-
-       Usage:
-          org = organizer(varargin)
-
-       Examples:
-          org = organizer('repository', 'Models/', 'prefix', 'AGU2015', 'steps', 0);  %build an empty organizer object with a given repository
-    """
-
-    def __init__(self, *args):  # {{{
-        self._currentstep = 0
-        self.repository = './'
-        self.prefix = 'model.'
-        self.trunkprefix = ''
-        self.steps = []
-        self.requestedsteps = [0]
-
-        #process options
-        options = pairoptions.pairoptions(*args)
-
-        #Get prefix
-        prefix = options.getfieldvalue('prefix', 'model.')
-        if not isinstance(prefix, str):
-            raise TypeError("prefix is not a string")
-        if not m.strcmp(prefix, prefix.strip()) or len(prefix.split()) > 1:
-            raise TypeError("prefix should not have any white space")
-        self.prefix = prefix
-
-        #Get repository
-        repository = options.getfieldvalue('repository', './')
-        if not isinstance(repository, str):
-            raise TypeError("repository is not a string")
-        if not os.path.isdir(repository):
-            raise IOError("Directory '%s' not found" % repository)
-        self.repository = repository
-
-        #Get steps
-        self.requestedsteps = options.getfieldvalue('steps', [0])
-
-        #Get trunk prefix (only if provided by user)
-        if options.exist('trunkprefix'):
-            trunkprefix = options.getfieldvalue('trunkprefix', '')
-            if not isinstance(trunkprefix, str):
-                raise TypeError("trunkprefix is not a string")
-            if not m.strcmp(trunkprefix, trunkprefix.strip()) or len(trunkprefix.split()) > 1:
-                raise TypeError("trunkprefix should not have any white space")
-            self.trunkprefix = trunkprefix
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = ""
-        s += "%s\n" % "   Repository: '%s'" % self.repository
-        s += "%s\n" % "   Prefix:     '%s'" % self.prefix
-        if not self.steps:
-            s += "%s\n" % "   no step"
-        else:
-            for step in self.steps:
-                s += "%s\n" % "   step  #%2i: '%s'", step['id'], step['string']
-    # }}}
-
-    def load(self, string):  # {{{
-        #Get model path
-        if not isinstance(string, str):
-            raise TypeError("argument provided is not a string")
-        path = os.path.join(self.repository, self.prefix + string)
-
-        #figure out if the model is there
-        if os.path.exists(path):
-            struc = loadvars(path)
-            name = name = [key for key in list(struc.keys())]
-            md = struc.name[0]
-        else:
-            raise IOError("Could not find '%s'" % path)
-
-        return md
-    # }}}
-
-    def loadmodel(self, string):  # {{{
-        #Get model path
-        if not isinstance(string, str):
-            raise TypeError("argument provided is not a string")
-        path1 = os.path.join(self.repository, self.prefix + string + '.python')
-        path2 = os.path.join(self.repository, string)
-
-        #figure out if the model is there, otherwise, we have to use the default path supplied by user.
-        if dbm.whichdb(path1):
-            md = loadmodel(path1)
-            return md
-        elif dbm.whichdb(path2):
-            md = loadmodel(path2)
-            return md
-
-        #If we are here, the model has not been found. Try trunk prefix if provided
-        if self.trunkprefix:
-            path2 = os.path.join(self.repository, self.trunkprefix + string)
-            if not os.path.exists(path2):
-                raise IOError("Could find neither '%s' nor '%s'" % (path1, path2))
-            else:
-                print(("--> Branching '%s' from trunk '%s'" % (self.prefix, self.trunkprefix)))
-                md = loadmodel(path2)
-                return md
-        else:
-            raise IOError("Could not find '%s'" % path1)
-    # }}}
-
-    def perform(self, string):  # {{{
-        bool = False
-
-        #Some checks
-        if not isinstance(string, str):
-            raise TypeError("Step provided should be a string")
-        if not m.strcmp(string, string.strip()) or len(string.split()) > 1:
-            raise TypeError("Step provided should not have any white space")
-        if self._currentstep > 0 and string in [step['string'] for step in self.steps]:
-            raise RuntimeError("Step '%s' already present. Change name" % string)
-
-        #Add step
-        self.steps.append(OrderedDict())
-        self.steps[-1]['id'] = len(self.steps)
-        self.steps[-1]['string'] = string
-        self._currentstep += 1
-
-        #if requestedsteps = 0, print all steps in self
-        if 0 in self.requestedsteps:
-            if self._currentstep == 1:
-                print(("   prefix: %s" % self.prefix))
-            print(("   step  #%i : %s" % (self.steps[self._currentstep - 1]['id'], self.steps[self._currentstep - 1]['string'])))
-
-        #Ok, now if _currentstep is a member of steps, return true
-        if self._currentstep in self.requestedsteps:
-            print(("\n   step  #%i : %s\n" % (self.steps[self._currentstep - 1]['id'], self.steps[self._currentstep - 1]['string'])))
-            bool = True
-
-            #last check: is this step locked?
-            s = self.steps[self._currentstep - 1]['string']
-            if len(s) > 7:
-                if s[-6:] == 'Locked':
-                    raise Exception('organizer: you are trying to run a locked step! Unlock it first!')
-
-        return bool
-    # }}}
-
-    def savemodel(self, md, name='default'):  # {{{
-        #check
-        if self._currentstep == 0:
-            raise RuntimeError("Cannot save model because organizer (org) is empty! Make sure you did not skip any perform call")
-        if self._currentstep > len(self.steps):
-            raise RuntimeError("Cannot save model because organizer (org) is not up to date!")
-
-        if (name == 'default'):
-            name = os.path.join(self.repository, self.prefix + self.steps[self._currentstep - 1]['string'] + '.python')
-        else:
-            name = os.path.join(self.repository, name)
-        print(("saving model as: '%s'" % name))
-
-    #check that md is a model
-        if not isinstance(md, model):
-            print("second argument is not a model")
-        if self._currentstep > len(self.steps):
-            raise RuntimeError("organizer error message: element with id %d not found" % self._currentstep)
-
-    #save model
-        savevars(name, 'md', md)
-    # }}}
Index: sm/trunk/src/m/classes/outputdefinition.js
===================================================================
--- /issm/trunk/src/m/classes/outputdefinition.js	(revision 28275)
+++ 	(revision )
@@ -1,50 +1,0 @@
-//OUTPUTDEFINITION class definition
-//
-//   Usage:
-//      outputdefinition=new outputdefinition();
-
-function outputdefinition (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		this.definitions=[];
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   outputdefinition:'));
-		fielddisplay(this,'definitions','list of potential outputs that can be requested, but which need additional data to be defined');
-
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "outputdefinition";
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-
-			checkfield(md,'fieldname','outputdefinition.definitions','cell',1);
-
-			for (var i=0;i<this.definitions.length;i++){
-				this.definitions[i].checkconsistency(md,solution,analyses);
-			}
-
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			var data=NewArrayFill(this.definitions.length,'');	
-			for(var i=0;i<this.definitions.length;i++){
-				this.definitions[i].marshall(md,fid,prefix);
-				classdefinition=this.definitions[i].classname();
-				classdefinition=classdefinition.charAt(0).toUpperCase() + classdefinition.slice(1); // we match our string definitions
-				data[i]=classdefinition;
-			}
-			data=ArrayUnique(data);
-			if(data.length==0){ data=''; }
-
-			WriteData(fid,prefix,'data',data,'name','md.outputdefinition.list','format','StringArray');
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-	this.definitions                 = [];
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/outputdefinition.m
===================================================================
--- /issm/trunk/src/m/classes/outputdefinition.m	(revision 28275)
+++ 	(revision )
@@ -1,63 +1,0 @@
-%CONSTANTS class definition
-%
-%   Usage:
-%      outputdefinition=outputdefinition();
-
-classdef outputdefinition
-	properties (SetAccess=public) 
-		definitions                 = {};
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			for i=1:length(self.definitions)
-				self.definitions{i}=extrude(self.definitions{i},md);
-			end
-		end % }}}
-		function self = outputdefinition(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.definitions={};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','outputdefinition.definitions','cell',1);
-
-			for i=1:length(self.definitions),
-				md=checkconsistency(self.definitions{i},md,solution,analyses);
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   outputdefinition:'));
-			fielddisplay(self,'definitions','list of potential outputs that can be requested, but which need additional data to be defined');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-		data={};
-		for i=1:length(self.definitions)
-			self.definitions{i}.marshall(prefix,md,fid);
-			classdefinition=class(self.definitions{i});
-			classdefinition(1)=upper(classdefinition(1));
-			data{i}=classdefinition;
-		end
-		data_unique=unique(data);
-		WriteData(fid,prefix,'data',data_unique,'name','md.outputdefinition.list','format','StringArray');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			fprintf(fid,'%s.outputdefinition.definitions=[];\n',modelname);
-			if ~isempty(self.definitions),
-				error('outputdefinition savemodeljs error message: not supported yet!');
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/outputdefinition.py
===================================================================
--- /issm/trunk/src/m/classes/outputdefinition.py	(revision 28275)
+++ 	(revision )
@@ -1,56 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-import numpy as np
-
-
-class outputdefinition(object):
-    """
-    OUTPUTDEFINITION class definition
-
-       Usage:
-          outputdefinition = outputdefinition()
-    """
-
-    def __init__(self):  # {{{
-        self.definitions = []
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "   Outputdefinitions:"
-
-        string = "%s\n%s" % (string, fielddisplay(self, "definitions", "list of potential outputs that can be requested, but which need additional data to be defined"))
-
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        for definition in self.definitions:
-            definition.extrude(md)
-
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-
-        md = checkfield(md, 'fieldname', 'outputdefinition.definitions', 'cell', 1)
-        for definition in self.definitions:
-            definition.checkconsistency(md, solution, analyses)
-
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        data = []
-        for i in range(len(self.definitions)):
-            self.definitions[i].marshall(prefix, md, fid)
-            classdefinition = self.definitions[i].__class__.__name__
-            classdefinition = classdefinition[0].upper() + classdefinition[1:]
-            data.append(classdefinition)
-
-        data = np.unique(data)
-        WriteData(fid, prefix, 'data', data, 'name', 'md.outputdefinition.list', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/pairoptions.js
===================================================================
--- /issm/trunk/src/m/classes/pairoptions.js	(revision 28275)
+++ 	(revision )
@@ -1,269 +1,0 @@
-//PAIROPTIONS class definition
-//
-//   Usage:
-//      pairoptions=pairoptions();
-//      pairoptions=pairoptions('module',true,'solver',false);
-
-function pairoptions(args) { 
-
-
-	//methods
-	this.constructor = function (args) {// {{{
-
-		//initialize list
-		if (args.length==0){
-			this.list=[];
-		}
-		else{
-
-			//check length of input
-			if (args.length % 2){
-				throw Error('pairoptions error message: invalid parameter/value pair arguments') 
-			}
-			numoptions = args.length/2;
-
-			//Allocate memory
-			this.list= Create2DArray(numoptions,3);
-
-			//go through args and build list of obj
-			for (var i=0;i<numoptions;i++){
-				if (typeof args[2*i] === 'string'){
-					this.list[i][0]=args[2*i];
-					this.list[i][1]=args[2*i+1];
-					this.list[i][2]=false;  //used?
-				}
-				else{
-					//option is not a string, ignore it
-					console.log(sprintf('%s%i%s\n','WARNING: option number ',i,' is not a string, it will be ignored'));
-					this.list[i][0]=[];
-					this.list[i][1]=[];
-					this.list[i][2]=[];
-					continue
-				}
-			}
-		}
-	}// }}}
-	this.addfield = function (field, value){ // {{{
-		if (typeof field === 'string'){
-			this.list.push([field,value,false]);
-		}
-	}// }}}
-	this.numoptions = function (){ // {{{
-		return this.list.length;
-	}// }}}
-	this.addfielddefault = function (field,value){ // {{{
-		//ADDFIELDDEFAULT - add a field to an options list if it does not exist
-		if (typeof field === 'string'){
-			if (!this.exist(field)){
-				this.list.push([field,value,true]); //true is a default so user will not be notified if not used
-			}
-		}
-	} // }}}
-	this.AssignObjectFields = function(object){ // {{{
-		//ASSIGNOBJECTFIELDS - assign object fields from options
-		for (var i=0;i<list.length;i++){
-			fieldname=list[i][0];
-			fieldvalue=list[i][1];
-			if (fieldname in object){
-				obj2[fieldname]=fieldvalue;
-			}
-			else{
-				console.log(sprintf("%s'%s'%s%s\n",'WARNING: ',fieldname, 'is not a property of ',typeof object));
-			}
-		}
-	} // }}}
-	this.changefieldvalue = function(field,newvalue){ // {{{
-		//CHANGEOPTIONVALUE - change the value of an option in an option list
-
-		var found=0;
-		for (var i=0;i<this.list.length;i++){
-			if (this.list[i][0] === field){
-				found=1;
-			}
-		}
-
-		if (found==0){
-			this.list.push([field,newvalue,true]); // do not notify user if unused
-		}
-		else{
-			for (var i=0;i<this.list.length;i++){
-				if (this.list[i][0] === field){
-					this.list[i][1] = newvalue;
-				}
-			}
-		}
-	} // }}}
-	this.deleteduplicates = function(warn){ // {{{
-		//DELETEDUPLICATES - delete duplicates in an option list
-
-		//track the first occurrence of each option
-		var indices=NewArrayFill(this.list.length,0);
-		for (var i=0;i<this.list.length;i++){
-			if(indices[i]==0){
-				for(var j=i+1;j<this.list.length;j++){
-					if (this.list[i][0] === this.list[j][0])indices[j]=1;
-				}
-			}
-		}
-		sumindices=ArraySum(indices);
-
-		//remove duplicates from the options list
-		newlist=Create2DArray(sumindices,3);
-		var count=0;
-		for (var i=0;i<this.list.length;i++){
-			if (indices[i]==1) if (warn) console.log(sprintf("%s%s%s\n",'WARNING: option ', this.list[i,0],' appeared more than once. Only its first occurrence will be kept'));
-			else{
-				newlist[count]=this.list[i];
-				count++;
-			}
-		}
-	} // }}}
-	this.displayunused = function (){ // {{{
-		//DISPLAYUNUSED - display unused options
-
-		for (var i=0;i<this.list.length;i++){
-			if (!(this.list[i][2])){
-				console.log(sprintf("%s%s%s\n",'WARNING: option ',this.list[i][0],' was not used'));
-			}
-		}
-	}// }}}
-	this.disp = function (){ //{{{
-		if (this.list.length){
-			console.log(sprintf('   pairoptions: (%i)\n',this.list.length));
-			for (var i=0;i<this.list.length;i++){
-				if (typeof this.list[i][1] === 'string'){
-					console.log(sprintf("     field: '%s' value(string): ''%s''",this.list[i][0],this.list[i][1]));
-				}
-				else if( typeof this.list[i][1] === 'number'){
-					console.log(sprintf("     field: '%s' value(number): %g",this.list[i][0],this.list[i][1]));
-				}
-				else if( IsArray(this.list[i][1])){
-					console.log(sprintf("     field: '%s' value(array): [%i]",this.list[i][0],this.list[i][1].length));
-				}
-			}
-		}
-		else{
-			console.log(sprintf('   list: empty'));
-		}
-	}// }}}
-	this.exist = function (field) { //{{{
-
-		//EXIST - check if the option exists
-		//some argument checking: 
-		if (!(typeof field === 'string')){
-			throw Error('exist error message: field should be a string');
-		}
-
-		//Recover option
-		var bool=0;
-		for (var i=0;i<this.list.length;i++){
-			if (this.list[i][0] === field){
-				bool=1;
-				this.list[i][2]=1; //It is a default so user will not be notified if not used
-				break;
-			}
-		}
-		return bool;
-	} // }}}
-	this.fieldoccurrences = function(field){ // {{{
-
-		//FIELDOCCURRENCES - get number of occurrence of a field
-		var num=0;
-
-		//check input 
-		if (!(typeof field === 'string')){
-			throw Error('exist error message: field should be a string');
-		}
-
-		//count number of occurrences:
-		for (var i=0;i<this.list.length;i++) if (this.list[i][0] === field)num++;
-
-		return num;
-
-	} // }}}
-	this.getfieldvalue = function(field){ // {{{
-		//GETOPTION - get the value of an option
-		//
-		//   Usage:
-		//      value=pairoptions.getfieldvalue(field,varargin)
-		//
-		//   Find an option value from a field. A default option
-		//   can be given in input if the field does not exist
-		//
-		//   Examples:
-		//      value=pairoptions.getfieldvalue('caxis');
-		//      value=pairoptions.getfieldvalue('caxis',[0 2]);
-
-		//some argument checking: 
-		if(!(arguments.length==1 | arguments.length==2)){
-			error('pairoptions usage error: getfieldvalue bad usage');
-		}
-
-		if (!(typeof field === 'string')){
-			throw Error('pairoptions error message: field should be a string');
-		}
-
-		//Recover option
-		for(var i=0;i<this.list.length;i++){
-			if (this.list[i][0] === field){
-				this.list[i][2]=1; //option used
-				return value=this.list[i][1];
-			}
-		}
-
-		//The option has not been found, output default if provided
-		if (arguments.length==2){
-			return arguments[1];
-		}
-		else{
-			throw Error(sprintf("%s%s%s\n",'error message: field ',field,' has not been provided by user (and no default value has been specified)'));
-		}
-	} // }}}
-	this.removefield = function(field,warn){// {{{
-
-		//REMOVEFIELD - delete a field in an option list
-		//
-		//   Usage:
-		//      options.removefield(field,warn)
-		//
-		//   if warn==1 display an info message to warn user that
-		//   some of his options have been removed.
-
-		//check if field exists
-		if (this.exist(field)){
-
-			var indices;
-			var count;
-
-			//find where the field is located
-			indices=NewArrayFill(this.list.length,1);
-			for (var i=0;i<this.list.length;i++)if(this.list[i][1] === field)indices[i]=0;
-			sumindices=ArraySum(indices);
-
-			//remove duplicates from the options list
-			newlist=Create2DArray(sumindices,3);
-
-			count=0;
-			for (var i=0;i<this.list.length;i++){
-				if(!(this.list[i][1] === field)){
-					newlist[count]=this.list[i];
-					count++;
-				}
-			}
-			this.list=newlist;
-
-			//warn user if requested
-			if (warn){
-				console.log(sprintf("%s%s%s\n",'removefield info: option ',field,' has been removed from the list of options.'));
-			}
-		}
-	} // }}}
-	this.marshall = function(fid,firstindex){// {{{
-
-		throw Error('pairoptions marshall error: not implemented yet!');
-	} // }}}
-
-	//properties 
-	this.list         = [];
-	this.constructor(args);
-}
Index: sm/trunk/src/m/classes/pairoptions.m
===================================================================
--- /issm/trunk/src/m/classes/pairoptions.m	(revision 28275)
+++ 	(revision )
@@ -1,303 +1,0 @@
-%PAIROPTIONS class definition
-%
-%   Usage:
-%      pairoptions=pairoptions();
-%      pairoptions=pairoptions('module',true,'solver',false);
-
-classdef pairoptions < matlab.mixin.Copyable
-	properties (SetAccess = private,GetAccess = private) 
-		functionname = '';
-		list         = cell(0,3);
-	end
-	methods
-		function self = pairoptions(varargin) % {{{
-
-			%get calling function name
-			a=dbstack;
-			if length(a)>1,
-				self.functionname=a(2).file(1:end-2);
-			else
-				self.functionname='';
-			end
-
-			%initialize list
-			if nargin==0,
-				%Do nothing,
-			else
-				self=buildlist(self,varargin{:});
-			end
-		end % }}}
-		function self = buildlist(self,varargin) % {{{
-		%BUILDLIST - build list of obj from input
-
-			%check length of input
-			if mod((nargin-1),2),
-				error('Invalid parameter/value pair arguments') 
-			end
-			numoptions = (nargin-1)/2;
-
-			%Allocate memory
-			self.list=cell(numoptions,3);
-
-			%go through varargin and build list of obj
-			for i=1:numoptions,
-				if ischar(varargin{2*i-1}),
-					self.list{i,1}=varargin{2*i-1};
-					self.list{i,2}=varargin{2*i};
-					self.list{i,3}=false; %used?
-				else
-					%option is not a string, ignore it
-					disp(['WARNING: option number ' num2str(i) ' is not a string, it will be ignored']);
-					self.list(i,:)=[];
-					continue
-				end
-			end
-		end % }}}
-		function self = addfield(self,field,value) % {{{
-			if ischar(field),
-				self.list{end+1,1} = field;
-				self.list{end,2}   = value;
-				self.list{end,3}   = false;
-			end
-		end % }}}
-		function self = addfielddefault(self,field,value) % {{{
-		%ADDFIELDDEFAULT - add a field to an options list if it does not exist
-			if ischar(field),
-				if ~exist(self,field),
-					self.list{end+1,1} = field;
-					self.list{end,2}   = value;
-					self.list{end,3}   = true;  %It is a default so user will not be notified if not used
-				end
-			end
-		end % }}}
-		function obj2 = AssignObjectFields(options,obj2) % {{{
-		%ASSIGNOBJECTFIELDS - assign object fields from options
-			listproperties=properties(obj2);
-			for i=1:size(options.list,1),
-				fieldname=options.list{i,1};
-				fieldvalue=options.list{i,2};
-				if ismember(fieldname,listproperties),
-					obj2.(fieldname)=fieldvalue;
-				else
-					disp(['WARNING: ''' fieldname ''' is not a property of ''' class(obj2) '''']);
-				end
-			end
-		end % }}}
-		function self = changefieldvalue(self,field,newvalue) % {{{
-		%CHANGEOPTIONVALUE - change the value of an option in an option list
-
-			%track occurrence of field
-			lines=find(strcmpi(self.list(:,1),field));
-
-			%replace value
-			if isempty(lines),
-				%add new field if not found
-				self=addfield(self,field,newvalue);
-				self.list{end,3}=true; % do not notify user if unused
-			else
-				for i=1:length(lines),
-					self.list{lines(i),2}=newvalue;
-				end
-			end
-		end % }}}
-		function self = deleteduplicates(self,warn) % {{{
-		%DELETEDUPLICATES - delete duplicates in an option list
-
-			%track the first occurrence of each option
-			[dummy lines]=unique(self.list(:,1),'first');
-			clear dummy
-
-			%warn user if requested
-			if warn,
-				numoptions=size(self.list,1);
-				for i=1:numoptions,
-					if ~ismember(i,lines),
-						disp(['WARNING: option ' self.list{i,1} ' appeared more than once. Only its first occurrence will be kept'])
-					end
-				end
-			end
-
-			%remove duplicates from the options list
-			self.list=self.list(lines,:);
-		end % }}}
-		function displayunused(self) % {{{
-			%DISPLAYUNUSED - display unused options
-
-			numoptions=size(self.list,1);
-			for i=1:numoptions,
-				if ~self.list{i,3},
-					disp(['WARNING: option ' self.list{i,1} ' was not used'])
-				end
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   functionname: %s',self.functionname));
-			if ~isempty(self.list),
-				disp(sprintf('   list: (%ix%i)\n',size(self.list,1),size(self.list,2)));
-				for i=1:size(self.list,1),
-					if ischar(self.list{i,2}),
-						disp(sprintf('     field: %-10s value: ''%s''',self.list{i,1},self.list{i,2}));
-					elseif isnumeric(self.list{i,2}) & length(self.list{i,2})==1,
-						disp(sprintf('     field: %-10s value: %g',self.list{i,1},self.list{i,2}));
-					elseif isnumeric(self.list{i,2}) & length(self.list{i,2})==2,
-						disp(sprintf('     field: %-10s value: [%g %g]',self.list{i,1},self.list{i,2}));
-					else
-						disp(sprintf('     field: %-10s value: (%ix%i)',self.list{i,1},size(self.list{i,2},1),size(self.list{i,2},2)));
-					end
-				end
-			else
-				disp(sprintf('   list: empty'));
-			end
-		end % }}}
-		function bool = exist(self,field) % {{{
-		%EXIST - check if the option exists
-
-			%some argument checking: 
-			if ((nargin~=2) | (nargout~=1)),
-				error('exist error message: bad usage');
-			end
-			if ~ischar(field),
-				error('exist error message: field should be a string');
-			end
-
-			%Recover option
-			pos=find(strcmpi(field,self.list(:,1)));
-			if ~isempty(pos),
-				bool=true;
-				self.list{pos,3}   = true;  %It is a default so user will not be notified if not used
-			else
-				bool=false;
-			end
-		end % }}}
-		function num = fieldoccurrences(self,field), % {{{
-		%FIELDOCCURRENCES - get number of occurrence of a field
-
-			%check input 
-			if ~ischar(field),
-				error('fieldoccurrences error message: field should be a string');
-			end
-
-			%get number of occurrence
-			num=sum(strcmpi(field,self.list(:,1)));
-		end % }}}
-		function value = getfieldvalue(self,field,varargin), % {{{
-		%GETFIELDVALUE - get the value of an option
-		%
-		%   Usage:
-		%      value=getfieldvalue(self,field,varargin)
-		%
-		%   Find an option value from a field. A default option
-		%   can be given in input if the field does not exist
-		%
-		%   Examples:
-		%      value=getfieldvalue(options,'caxis');
-		%      value=getfieldvalue(options,'caxis',[0 2]);
-
-			%some argument checking: 
-			if nargin~=2 && nargin~=3,
-				help getfieldvalue
-				error('getfieldvalue error message: bad usage');
-			end
-
-			if ~ischar(field),
-				error('getfieldvalue error message: field should be a string');
-			end
-
-			%Recover option
-			pos=find(strcmpi(self.list(:,1),field));
-			if ~isempty(pos),
-				value=self.list{pos(1),2}; % ignore extra entry
-				self.list{pos(1),3}=true;  % option used
-				return;
-			end
-
-			%The option has not been found, output default if provided
-			if nargin==3,
-				value=varargin{1};
-			else
-				error(['error message: field ' field ' has not been provided by user (and no default value has been specified)'])
-			end
-		end % }}}
-		function values = getfieldvalues(self,field,varargin), % {{{
-		%GETFIELDVALUES - get the value of an option (if the option is repeated, return multiple values)
-		%
-		%   Usage:
-		%      values=getfieldvalues(self,field,varargin)
-		%
-		%   Find all option values from a field. Default options
-		%   can be given in input if the field does not exist
-		%
-		%   Examples:
-		%      values=getfieldvalues(options,'caxis');
-		%      values=getfieldvalues(options,'caxis',{[0 2],[3 4]});
-
-			%some argument checking: 
-			if nargin~=2 && nargin~=3,
-				help getfieldvalues
-				error('getfieldvalues error message: bad usage');
-			end
-
-			if ~ischar(field),
-				error('getfieldvalues error message: field should be a string');
-			end
-
-			%Recover options
-			pos=find(strcmpi(self.list(:,1),field));
-			if ~isempty(pos),
-				values={};
-				for i=1:length(pos),
-					values{i}=self.list{pos(i),2};
-					self.list{pos(i),3}=true; % option used
-				end
-				return;
-			end
-
-			%The option has not been found, output default if provided
-			if nargin==3,
-				values=varargin{1};
-			else
-				error(['error message: field ' field ' has not been provided by user (and no default value has been specified)'])
-			end
-		end % }}}
-		function self = removefield(self,field,warn)% {{{
-		%REMOVEFIELD - delete a field in an option list
-		%
-		%   Usage:
-		%      self=removefield(self,field,warn)
-		%
-		%   if warn==1 display an info message to warn user that
-		%   some of their options have been removed.
-
-			%check is field exist
-			if exist(self,field),
-
-				%find where the field is located
-				lines=find(~strcmpi(self.list(:,1),field));
-
-				%remove duplicates from the options list
-				self.list=self.list(lines,:);
-
-				%warn user if requested
-				if warn
-					disp(['removefield info: option ' field ' has been removed from the list of options.'])
-				end
-			end
-		end % }}}
-		function marshall(self,fid)% {{{
-
-			for i=1:size(self.list,1),
-				name  = self.list{i,1};
-				value = self.list{i,2};
-
-				%Write option value
-				if (isnumeric(value) & numel(value)==1),
-					WriteData(fid,'','name',['md.' name],'data',value,'format','Double');
-				elseif ischar(value),
-					WriteData(fid,'','name',['md.' name],'data',value,'format','String');
-				else
-					error(['Cannot marshall option ' name ': format not supported yet']);
-				end
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/pairoptions.py
===================================================================
--- /issm/trunk/src/m/classes/pairoptions.py	(revision 28275)
+++ 	(revision )
@@ -1,196 +1,0 @@
-from collections import OrderedDict
-
-
-class pairoptions(object):
-    """PAIROPTIONS class definition
-
-    Usage:
-        pairoptions = pairoptions()
-        pairoptions = pairoptions('module', true, 'solver', false)
-    """
-
-    def __init__(self, *arg):  # {{{
-        #self.functionname = ''
-        self.list = OrderedDict()
-
-        #get calling function name
-        #import inspect
-        #if len(inspect.stack()) > 1:
-        #self.functionname = inspect.stack()[1][3]
-        import traceback
-        try:
-            self.functionname = traceback.extract_stack(limit=2)[0][2]
-        except IndexError:
-            pass  #this is probably similar to the previous if treatment (but faster)
-
-        #initialize list
-        if not len(arg):
-            pass  #Do nothing,
-        else:
-            self.buildlist(*arg)
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = "   functionname: '{}'\n".format(self.functionname)
-        if self.list:
-            s += "   list: ({}x{}) \n\n".format(len(self.list), 2)
-            for item in self.list.items():
-                s += "     field: {} value: '{}'\n".format(item[0], item[1])
-            print(s)
-        else:
-            s += "   list: empty\n"
-        return s
-    # }}}
-
-    def buildlist(self, *arg):  # {{{
-        """BUILDLIST - build list of objects from input
-        """
-
-        #check length of input
-        if len(arg) % 2:
-            raise TypeError('Invalid parameter/value pair arguments')
-        numoptions = int(len(arg) / 2)
-
-        #go through arg and build list of objects
-        for i in range(numoptions):
-            if isinstance(arg[2 * i], str):
-                self.list[arg[2 * i]] = arg[2 * i + 1]
-            else:
-                #option is not a string, ignore it
-                print(("WARNING: option number {} is not a string and will be ignored.".format(i + 1)))
-    # }}}
-
-    def addfield(self, field, value):  # {{{
-        """ADDFIELD - add a field to an options list
-        """
-
-        if isinstance(field, str):
-            if field in self.list:
-                print(("WARNING: field '{}' with value={} exists and will be overwritten with value={}.".format(field, str(self.list[field]), str(value))))
-            self.list[field] = value
-    # }}}
-
-    def addfielddefault(self, field, value):  # {{{
-        """ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-        """
-
-        if isinstance(field, str):
-            if field not in self.list:
-                self.list[field] = value
-    # }}}
-
-    def AssignObjectFields(self, obj2):  # {{{
-        """ASSIGNOBJECTFIELDS - assign object fields from options
-        """
-
-        for item in list(self.list.items()):
-            if item[0] in dir(obj2):
-                setattr(obj2, item[0], item[1])
-            else:
-                print(("WARNING: field '%s' is not a property of '%s'." % (item[0], type(obj2))))
-        return obj2
-    # }}}
-
-    def changefieldvalue(self, field, newvalue):  # {{{
-        """CHANGEOPTIONVALUE - change the value of an option in an option list
-        """
-
-        self.list[field] = newvalue
-    # }}}
-
-    def displayunused(self):  # {{{
-        """DISPLAYUNUSED - display unused options
-        """
-
-        print('WARNING: pairoptions::displayunused is not yet implemented')
-    # }}}
-
-    def exist(self, field):  # {{{
-        """EXIST - check if the option exists
-        """
-
-        #some argument checking:
-        if field is None or field == '':
-            raise ValueError('exist error message: bad usage')
-        if not isinstance(field, str):
-            raise TypeError("exist error message: field '%s' should be a string." % str(field))
-
-        #Recover option
-        if field in self.list:
-            return True
-        else:
-            return False
-    # }}}
-
-    def getfieldvalue(self, field, default=None):  # {{{
-        """GETFIELDVALUE - get the value of an option
-
-        Usage:
-           value = options.getfieldvalue(field, default)
-
-        Find an option value from a field. A default option
-        can be given in input if the field does not exist
-
-        Examples:
-           value = options.getfieldvalue(options, 'caxis')
-           value = options.getfieldvalue(options, 'caxis', [0 2])
-        """
-
-        #some argument checking:
-        if field is None or field == '':
-            raise ValueError('getfieldvalue error message: bad usage')
-        if not isinstance(field, str):
-            raise TypeError("getfieldvalue error message: field '%s' should be a string." % str(field))
-
-        #Recover option
-        if field in self.list:
-            value = self.list[field]
-        else:
-            if default is not None:
-                value = default
-            else:
-                raise KeyError("error message: field '%s' has not been provided by user (and no default value has been specified)." % field)
-
-        return value
-    # }}}
-
-    def removefield(self, field, warn):  # {{{
-        """REMOVEFIELD - delete a field in an option list
-
-        Usage:
-           obj = removefield(self, field, warn)
-
-        if warn == 1 display an info message to warn user that
-        some of their options have been removed.
-        """
-
-        #check if field exist
-        if field in self.list:
-
-            #remove duplicates from the options list
-            del self.list[field]
-
-            #warn user if requested
-            if warn:
-                print(("removefield info: option '%s' has been removed from the list of options." % field))
-    # }}}
-
-    def marshall(self, md, fid, firstindex):  # {{{
-
-        for i, item in enumerate(self.list.items()):
-            name = item[0]
-            value = item[1]
-
-            raise NameError('need to sync with MATLAB')
-
-        #Write option name
-        #WriteData(fid, prefix, 'enum', (firstindex - 1) + 2 * i + 1, 'data', name, 'format', 'String')
-
-        #Write option value
-        #if   isinstance(value, (str, unicode)):
-        #    WriteData(fid, prefix, 'enum', (firstindex - 1) + 2 * i + 2, 'data', value, 'format', 'String')
-        #elif isinstance(value, (bool, int, long, float)):
-        #    WriteData(fid, prefix, 'enum', (firstindex - 1) + 2 * i + 2, 'data', value, 'format', 'Double')
-        #else:
-        #raise TypeError("Cannot marshall option '%s': format not supported yet." % name)
-    # }}}
Index: sm/trunk/src/m/classes/plotoptions.js
===================================================================
--- /issm/trunk/src/m/classes/plotoptions.js	(revision 28275)
+++ 	(revision )
@@ -1,173 +1,0 @@
-//PLOTOPTIONS class definition
-//
-//   Usage:
-//      plotoptions = plotoptions(varargin)
-
-function plotoptions(args) {
-	//methods
-	this.disp = function (){ // {{{
-		console.log(sprintf('\nplotoptions = \n'));
-		console.log(sprintf('   figurenumber: %i',this.figurenumber));
-		console.log(sprintf('   numberofplots: %i',this.numberofplots));
-		if (this.list.length){
-			for (var i=0;i<this.list.length;i++){
-				console.log(sprintf('\n   options of plot number %i',i+1));
-				this.list[i].disp();
-			}
-		}
-		else{
-			console.log(sprintf('   list: empty'));
-		}
-	}
-	//}}}
-	this.constructor = function (args){ // {{{
-
-		//check length of input
-		if (args.length % 2){
-			for (i=0;i<args.length;i+=2){
-				if (!(typeof args[i] === 'string')){
-					console.log('Last valid option: ' + args[i-2]);
-					break;
-				}
-			}
-			throw Error('plotoptions error message: invalid parameter/value pair arguments');
-		}
-
-		//go through varargin and build list (like pairoptions)
-		var rawoptions=new pairoptions(args);
-		numoptions=rawoptions.numoptions();
-
-		var counter=0;
-		for (i=0;i<numoptions;i++){
-			if(typeof args[2*i] === 'string')counter++;
-		}
-		rawlist=Create2DArray(counter,2);
-		var counter=0;
-		for (i=0;i<numoptions;i++){
-			optionname=args[2*i];
-			optionval=args[2*i+1];
-			if(typeof optionname === 'string'){
-				rawlist[counter][0]=optionname;
-				rawlist[counter][1]=optionval;
-				counter++;
-			}
-			else{
-				//option is not a string, ignore it
-				console.log(sprintf("%s%i%s\n",'WARNING: option number ',i,' is not a string, it will be ignored'));
-				rawlist[counter]=[];
-				continue
-			}
-		}
-		
-			
-		//get number of data to be plotted
-		numberofplots=rawoptions.fieldoccurrences('data');
-		this.numberofplots=numberofplots;
-
-		//figure out wether alloptions flog is on
-		if (rawoptions.getfieldvalue('alloptions','off') === 'on') allflag=1;
-		else allflag=0;
-
-		//initialize list
-		var list=new Array(numberofplots);
-		for (i=0;i<numberofplots;i++){
-			list[i]=new pairoptions([]);
-		}
-				
-		//process plot options
-		for(var i=0;i<rawlist.length;i++){
-
-			//If alloptions flag has is on, apply to all plots
-			if (allflag & !(rawlist[i][0] === 'data') & (rawlist[i][0].indexOf('#') == -1)){
-				for(var j=0;j<numberofplots;j++){
-					list[j].addfield(rawlist[i][0],rawlist[i][1]);
-				}
-			}
-			else if (rawlist[i][0].indexOf('#') != -1){ //option contains '#'
-
-				//get suplot(s) associated
-				string=rawlist[i][0].split('#');
-				plotnums=string[1];
-				field=string[0];
-
-				//divide plotnums if there is a comma ','
-				plotnums=plotnums.split(',');
-
-				//loop over plotnums
-				for (k=0;k<plotnums.length;k++){
-					plotnum=plotnums[k];
-
-					//Empty
-					if (plotnum === '') continue;
-
-					else if (plotnum === 'all'){ //pound all
-						for(var j=0;j<numberofplots;j++){
-							list[j].addfield(field,rawlist[i][1]);
-						}
-					}
-					else if (plotnum.indexOf('-')!=-1){  //pound i-j
-						nums=plotnum.split('-');
-						if (nums.length!=2) continue;
-						if ((nums[0] == '') | (nums[1] === '')){
-							throw Error(sprintf("%s%s\n",'the option #i-j is not set properly for ',field));
-						}
-						for (j=(Number(nums[0])-1);j<(Number(nums[1])); j++){
-							list[j].addfield(field,rawlist[i][1]);
-						}
-					}
-					else{ //pound i
-						//assign to subplot
-						if (Number(plotnum)>numberofplots){
-							throw Error(sprintf("%s%s%s%i%s\n",'plotoptions error message: ',field,' cannot be assigned (',plotnum,' exceeds maximum number of plot)'));
-						}
-						list[Number(plotnum)-1].addfield(field,rawlist[i][1]);
-					}
-				}
-			}
-			else{ //assign option field to corresponding subplot
-
-				
-				//go through all subplot and assign to the first one free
-				var inc=0;
-				
-				while (inc<numberofplots){
-					
-					if (!list[inc].exist(rawlist[i][0])){
-						list[inc].addfield(rawlist[i][0],rawlist[i][1]);
-						break
-					}
-					else inc++;
-				}
-
-				if (inc>numberofplots-1){
-					console.log(sprintf("%s%s%s\n",'plot info message: too many ',rawlist[i][0],' options'));
-				}
-			}
-		}
-
-		//check that there is no duplicates
-		for (var i=0;i<numberofplots;i++) list[i].deleteduplicates();
-
-		//allocate canvasid automatically
-		for (var i=0;i<numberofplots;i++) {
-			if (!list[i].exist('canvasid')) {
-				list[i].addfield('canvasid',i);
-			}
-		}
-
-		//Get figure number (should be in options for subplot 1)
-		this.figurenumber=list[0].getfieldvalue('figure',1);
-		list[0].removefield('figure',0);
-
-		//asign output
-		this.list=list;
-
-	} //}}}
-	//properties
-	// {{{
-	this.numberofplots = 0;
-	this.figurenumber  = 1;
-	this.list          = [];
-	this.constructor(args);
-	//}}}
-}
Index: sm/trunk/src/m/classes/plotoptions.m
===================================================================
--- /issm/trunk/src/m/classes/plotoptions.m	(revision 28275)
+++ 	(revision )
@@ -1,179 +1,0 @@
-%PLOTOPTIONS class definition
-%
-%   Usage:
-%      plotoptions = plotoptions(varargin)
-
-classdef plotoptions
-    properties (SetAccess=public) 
-		 % {{{
-		 numberofplots = 0;
-		 figurenumber  = 1;
-		 list          = cell(0,0);
-		 %}}}
-	 end
-	 methods
-		 function opt=plotoptions(varargin) % {{{
-			 opt=buildlist(opt,varargin{:});
-		 end
-		 %}}}
-		 function disp(opt) % {{{
-			 disp(sprintf('\n%s = \n',inputname(1)));
-			 disp(sprintf('   numberofplots: %i',opt.numberofplots));
-			 disp(sprintf('   figurenumber: %i',opt.figurenumber));
-			 if ~isempty(opt.list),
-				 disp(sprintf('   list: (%ix%i)',size(opt.list,1),size(opt.list,2)));
-				 for i=1:size(opt.list,1),
-					 unit=opt.list{i};
-					 disp(sprintf('\n   options of plot number %i',i));
-					 for j=1:size(unit.list,1)
-						 if ischar(unit.list{j,2}),
-							 disp(sprintf('     field: %-10s value: ''%s''',unit.list{j,1},unit.list{j,2}));
-						 elseif isnumeric(unit.list{j,2}) & length(unit.list{j,2})==1,
-							 disp(sprintf('     field: %-10s value: %g',unit.list{j,1},unit.list{j,2}));
-						 else
-							 disp(sprintf('     field: %-10s value: (%ix%i)',unit.list{j,1},size(unit.list{j,2},1),size(unit.list{j,2},2)));
-						 end
-					 end
-				 end
-			 else
-				 disp(sprintf('   list: empty'));
-			 end
-		 end
-		 %}}}
-		 function opt=buildlist(opt,varargin) % {{{
-
-			 %check length of input
-			 if mod((nargin-1),2),
-				 for i=1:2:(nargin-1)
-					 if ~ischar(varargin{i}),
-						 disp(['Last valid option: ' varargin{i-2} ]);
-						 break;
-					 end
-				 end
-				 error('Invalid parameter/value pair arguments')
-			 end
-
-			 %go through varargin and build list (like pairoptions)
-			 rawoptions=pairoptions(varargin{:});
-			 numoptions = (nargin-1)/2;
-			 rawlist=cell(numoptions,2);
-			 counter=1;
-			 for i=1:numoptions,
-				 optionname = varargin{2*i-1};
-				 optionval  = varargin{2*i};
-				 if ischar(optionname),
-					 rawlist{counter,1}=optionname;
-					 rawlist{counter,2}=optionval;
-					 counter=counter+1;
-				 else
-					 %option is not a string, ignore it
-					 disp(['WARNING: option number ' num2str(i) ' is not a string, it will be ignored']);
-					 rawlist(counter,:)=[];
-					 continue
-				 end
-			 end
-
-			 %get number of data to be plotted
-			 numberofplots=fieldoccurrences(rawoptions,'data');
-			 opt.numberofplots=numberofplots;
-
-			 %figure out wether alloptions flog is on
-			 if strcmpi(getfieldvalue(rawoptions,'alloptions','off'),'on'),
-				 allflag=1;
-			 else
-				 allflag=0;
-			 end
-
-			 %initialize opt.list
-			 opt.list=cell(numberofplots,1);
-			 for i=1:numberofplots,
-				 opt.list{i}=pairoptions;
-			 end
-
-			 %process plot options
-			 for i=1:size(rawlist,1),
-
-				 %If alloptions flag has is on, apply to all plots
-				 if (allflag & ~strcmpi(rawlist{i,1},'data') & ~ismember('#',rawlist{i,1})),
-					 for j=1:numberofplots,
-						 opt.list{j}=addfield(opt.list{j},rawlist{i,1},rawlist{i,2});
-					 end
-
-					 %option contains '#'
-				 elseif ismember('#',rawlist{i,1}),
-
-					 %get suplot(s) associated
-					 string=strsplit_strict(rawlist{i,1},'#');
-					 plotnums=string{end};
-					 field=string{1};
-
-					 %divide plotnums if there is a comma ','
-					 plotnums=strsplit_strict(plotnums,',');
-
-					 %loop over plotnums
-					 for k=1:length(plotnums);
-						 plotnum=plotnums{k};
-
-						 %Empty
-						 if isempty(plotnum),
-							 continue;
-
-							 %pound all
-						 elseif strcmpi(plotnum,'all');
-							 for j=1:numberofplots,
-								 opt.list{j}=addfield(opt.list{j},field,rawlist{i,2});
-							 end
-
-							 %pound i-j
-						 elseif ismember('-',plotnum)
-							 nums=strsplit_strict(plotnum,'-');
-							 if length(nums)~=2, continue; end
-							 if isempty(str2num(nums{1}))|isempty(str2num(nums{2}))
-								 error(['the option #i-j is not set properly for ' field]);
-							 end
-							 for j=str2num(nums{1}):str2num(nums{2}),
-								 opt.list{j}=addfield(opt.list{j},field,rawlist{i,2});
-							 end
-
-							 %pound i
-						 else
-							 %assign to subplot
-							 if str2num(plotnum)>numberofplots,
-								 error(['opt error message: ' field ' cannot be assigned (' plotnum ' exceed maximum number of plot)']);
-							 end
-							 opt.list{str2num(plotnum)}=addfield(opt.list{str2num(plotnum)},field,rawlist{i,2});
-						 end
-					 end
-
-					 %assign option field to corresponding subplot
-				 else
-
-					 %go through all subplot and assign to the first one free
-					 j=1;
-					 while (j<=numberofplots),
-						 if ~exist(opt.list{j},rawlist{i,1});
-							 opt.list{j}=addfield(opt.list{j},rawlist{i,1},rawlist{i,2});
-							 break
-						 else
-							 j=j+1;
-						 end
-					 end
-					 if j>numberofplots,
-						 disp(['plot info message: too many ''' rawlist{i,1} ''' options']);
-					 end
-				 end
-			 end
-
-			 %check that there is no duplicates
-			 for i=1:numberofplots,
-				 opt.list{i}=deleteduplicates(opt.list{i},1);
-			 end
-
-			 %Get figure number (should be in options for subplot 1)
-			 opt.figurenumber=getfieldvalue(opt.list{1},'figure',1);
-			 removefield(opt.list{1},'figure',0);
-
-		 end
-		 %}}}
-	end
-end
Index: sm/trunk/src/m/classes/plotoptions.py
===================================================================
--- /issm/trunk/src/m/classes/plotoptions.py	(revision 28275)
+++ 	(revision )
@@ -1,127 +1,0 @@
-from collections import OrderedDict
-
-import pairoptions
-
-
-class plotoptions(object):
-    '''
-    PLOTOPTIONS class definition
-
-    Usage:
-        plotoptions = plotoptions(*arg)
-    '''
-
-    def __init__(self, *arg):  # {{{
-        self.numberofplots = 0
-        self.figurenumber = 1
-        self.list = OrderedDict()
-
-        self.buildlist(*arg)
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = "\n"
-        s += "    numberofplots: %i\n" % self.numberofplots
-        s += "    figurenumber: %i\n" % self.figurenumber
-        if self.list:
-            s += "    list: (%ix%i)\n" % (len(self.list), 2)
-            for item in list(self.list.items()):
-                s += "    field: {:10} value: '{}'\n".format(item[0], item[1])
-            print(s)
-        else:
-            s += "    list: empty\n"
-        return s
-    # }}}
-
-    def buildlist(self, *arg):  #{{{
-        #check length of input
-        if len(arg) % 2:
-            raise TypeError('Invalid parameter/value pair arguments')
-
-        #go through args and build list (like pairoptions)
-        rawoptions = pairoptions.pairoptions(*arg)
-        numoptions = int(len(arg) / 2)
-        rawlist = []  # cannot be a dict since they do not support duplicate keys
-
-        for i in range(numoptions):
-            if isinstance(arg[2 * i], str):
-                rawlist.append([arg[2 * i], arg[2 * i + 1]])
-            else:
-                #option is not a string, ignore it
-                print(("WARNING: option number %d is not a string and will be ignored." % (i + 1)))
-
-        #get figure number
-        self.figurenumber = rawoptions.getfieldvalue('figure', 1)
-        rawoptions.removefield('figure', 0)
-
-        #get number of subplots
-        numberofplots = len([1 for sublist in rawlist for x in sublist if str(x) == 'data'])
-        self.numberofplots = numberofplots
-
-        #figure out whether alloptions flag is on
-        if rawoptions.getfieldvalue('alloptions', 'off') == 'on':
-            allflag = 1
-        else:
-            allflag = 0
-
-        #initialize self.list (will need a list of dict's (or nested dict) for numberofplots > 1)
-        #self.list = defaultdict(dict)
-        for i in range(numberofplots):
-            self.list[i] = pairoptions.pairoptions()
-
-        #process plot options
-        for i in range(len(rawlist)):
-
-            #if alloptions flag is on, apply to all plots
-            if (allflag and 'data' not in rawlist[i][0] and '#' not in rawlist[i][0]):
-
-                for j in range(numberofplots):
-                    self.list[j].addfield(rawlist[i][0], rawlist[i][1])
-
-            elif '#' in rawlist[i][0]:
-                #get subplots associated
-                string = rawlist[i][0].split('#')
-                plotnums = string[-1].split(', ')
-                field = string[0]
-
-                #loop over plotnums
-                for k in range(len(plotnums)):
-                    plotnum = plotnums[k]
-
-                    #Empty
-                    if not plotnum:
-                        continue
-
-                    # '#all'
-                    elif 'all' in plotnum:
-                        for j in range(numberofplots):
-                            self.list[j].addfield(field, rawlist[i][1])
-
-                    # '#i-j'
-                    elif '-' in plotnum:
-                        nums = plotnum.split('-')
-                        if len(nums) != 2:
-                            continue
-                        if False in [x.isdigit() for x in nums]:
-                            raise ValueError('error: in option i-j both i and j must be integers')
-                        for j in range(int(nums[0]) - 1, int(nums[1])):
-                            self.list[j].addfield(field, rawlist[i][1])
-
-                    # Deal with  #i
-                    else:
-                        #assign to subplot
-                        if int(plotnum) > numberofplots:
-                            raise ValueError('error: %s cannot be assigned %d which exceeds the number of subplots' % (field, plotnum))
-                        self.list[int(plotnum) - 1].addfield(field, rawlist[i][1])
-            else:
-                #go through all subplots and assign key - value pairs
-                j = 0
-                while j <= numberofplots - 1:
-                    if not self.list[j].exist(rawlist[i][0]):
-                        self.list[j].addfield(rawlist[i][0], rawlist[i][1])
-                        break
-                    else:
-                        j = j + 1
-                if j + 1 > numberofplots:
-                    print(("WARNING: too many instances of '%s' in options" % rawlist[i][0]))
-    # }}}
Index: sm/trunk/src/m/classes/plumebasalforcings.m
===================================================================
--- /issm/trunk/src/m/classes/plumebasalforcings.m	(revision 28275)
+++ 	(revision )
@@ -1,132 +1,0 @@
-%PLUME BASAL FORCINGS class definition
-%
-%   Usage:
-%      plumebasalforcings=plumebasalforcings();
-
-classdef plumebasalforcings
-	properties (SetAccess=public) 
-		floatingice_melting_rate  = NaN;
-		groundedice_melting_rate  = NaN;
-		mantleconductivity        = NaN;
-		nusselt                   = NaN;
-		dtbg                      = NaN;
-		plumeradius               = NaN;
-		topplumedepth             = NaN;
-		bottomplumedepth          = NaN;
-		plumex                    = NaN;
-		plumey                    = NaN;
-		crustthickness            = NaN;
-		uppercrustthickness       = NaN;
-		uppercrustheat            = NaN;
-		lowercrustheat            = NaN;
-
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
-			self.floatingice_melting_rate=project3d(md,'vector',self.floatingice_melting_rate,'type','node','layer',1); 
-		end % }}}
-		function self = plumebasalforcings(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(plumebasalforcings(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.groundedice_melting_rate),
-				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			end
-			if isnan(self.floatingice_melting_rate),
-				self.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.floatingice_melting_rate specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default values for melting parameterization
-			self.mantleconductivity     = 2.2;
-			self.nusselt                = 300;
-			self.dtbg                   = 11/1000.;
-			self.plumeradius            = 100000;
-			self.topplumedepth          = 10000;
-			self.bottomplumedepth       = 1050000;
-			self.crustthickness         = 30000;
-			self.uppercrustthickness    = 14000;
-			self.uppercrustheat         = 1.7*10^-6;
-			self.lowercrustheat         = 0.4*10^-6;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ismember('MasstransportAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.ismasstransport==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'timeseries',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
-			end
-			if ismember('ThermalAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isthermal==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.mantleconductivity','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.nusselt','>',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.dtbg','>',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.topplumedepth','>',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.bottomplumedepth','>',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.plumex','numel',1);
-				md = checkfield(md,'fieldname','basalforcings.plumey','numel',1);
-				md = checkfield(md,'fieldname','basalforcings.crustthickness','>',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.uppercrustthickness','>',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.uppercrustheat','>',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.lowercrustheat','>',0,'numel',1);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   mantle plume basal melt parameterization:'));
-
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'floatingice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'mantleconductivity','mantle heat conductivity [W/m^3]');
-			fielddisplay(self,'nusselt','nusselt number, ratio of mantle to plume [1]');
-			fielddisplay(self,'dtbg','background temperature gradient [degree/m]');
-			fielddisplay(self,'plumeradius','radius of the mantle plume [m]');
-			fielddisplay(self,'topplumedepth','depth of the mantle plume top below the crust [m]');
-			fielddisplay(self,'bottomplumedepth','depth of the mantle plume base below the crust [m]');
-			fielddisplay(self,'plumex','x coordinate of the center of the plume [m]');
-			fielddisplay(self,'plumey','y coordinate of the center of the plume [m]');
-			fielddisplay(self,'crustthickness','thickness of the crust [m]');
-			fielddisplay(self,'uppercrustthickness','thickness of the upper crust [m]');
-			fielddisplay(self,'uppercrustheat','volumic heat of the upper crust [w/m^3]');
-			fielddisplay(self,'lowercrustheat','volumic heat of the lowercrust [w/m^3]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',4,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','name','md.basalforcings.floatingice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','mantleconductivity','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','nusselt','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','dtbg','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','plumeradius','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','topplumedepth','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','bottomplumedepth','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','plumex','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','plumey','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','crustthickness','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','uppercrustthickness','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','uppercrustheat','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','lowercrustheat','format','Double')
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/plumebasalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/plumebasalforcings.py	(revision 28275)
+++ 	(revision )
@@ -1,135 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from structtoobj import structtoobj
-from WriteData import WriteData
-
-
-class plumebasalforcings(object):
-    """PLUME BASAL FORCINGS class definition
-
-    Usage:
-        plumebasalforcings = plumebasalforcings()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.floatingice_melting_rate   = np.nan
-        self.groundedice_melting_rate   = np.nan
-        self.mantleconductivity         = np.nan
-        self.nusselt                    = np.nan
-        self.dtbg                       = np.nan
-        self.plumeradius                = np.nan
-        self.topplumedepth              = np.nan
-        self.bottomplumedepth           = np.nan
-        self.plumex                     = np.nan
-        self.plumey                     = np.nan
-        self.crustthickness             = np.nan
-        self.uppercrustthickness        = np.nan
-        self.uppercrustheat             = np.nan
-        self.lowercrustheat             = np.nan
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            # TODO: This has not been tested
-            self = structtoobj(self, args[0])
-        else:
-            error('constuctor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   mantle plume basal melt parameterization:\n'
-        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'floatingice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'mantleconductivity', 'mantle heat conductivity [W/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'nusselt', 'nusselt number, ratio of mantle to plume [1]'))
-        s += '{}\n'.format(fielddisplay(self, 'dtbg', 'background temperature gradient [degree/m]'))
-        s += '{}\n'.format(fielddisplay(self, 'plumeradius', 'radius of the mantle plume [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'topplumedepth', 'depth of the mantle plume top below the crust [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'bottomplumedepth', 'depth of the mantle plume base below the crust [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'plumex', 'x coordinate of the center of the plume [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'plumey', 'y coordinate of the center of the plume [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'crustthickness', 'thickness of the crust [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'uppercrustthickness', 'thickness of the upper crust [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'uppercrustheat', 'volumic heat of the upper crust [w/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'lowercrustheat', 'volumic heat of the lowercrust [w/m^3]'))
-        return s
-    # }}}
-
-    def initialize(self, md):  #{{{
-        if np.all(np.isnan(self.groundedice_melting_rate)):
-            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
-            print('      no basalforcings.groundedice_melting_rate specified: values set as zero')
-        if np.all(np.isnan(self.floatingice_melting_rate)):
-            self.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
-            print('      no basalforcings.floatingice_melting_rate specified: values set as zero')
-        return self
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.groundedice_melting_rate = project3d(md, 'vector', self.groundedice_melting_rate, 'type', 'node', 'layer', 1)
-        self.floatingice_melting_rate = project3d(md, 'vector', self.floatingice_melting_rate, 'type', 'node', 'layer', 1)
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Default values for melting parameterization
-        self.mantleconductivity = 2.2
-        self.nusselt = 300
-        self.dtbg = 11 / 1000.0
-        self.plumeradius = 100000
-        self.topplumedepth = 10000
-        self.bottomplumedepth = 1050000
-        self.crustthickness = 30000
-        self.uppercrustthickness = 14000
-        self.uppercrustheat = 1.7 * pow(10, -6)
-        self.lowercrustheat = 0.4 * pow(10, -6)
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if 'MasstransportAnalysis' in analyses and not (solution == 'TransientSolution' and md.transient.ismasstransport == 0):
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'timeseries', 1)
-        if 'BalancethicknessAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'size', [md.mesh.numberofvertices])
-        if 'ThermalAnalysis' in analyses and not (solution == 'TransientSolution' and md.transient.isthermal == 0):
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.mantleconductivity', '>=', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.nusselt', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.dtbg', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.topplumedepth', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.bottomplumedepth', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.plumex', 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.plumey', 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.crustthickness', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.uppercrustthickness', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.uppercrustheat', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.lowercrustheat', '>', 0, 'numel', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 4, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'floatingice_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.floatingice_melting_rate', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.groundedice_melting_rate', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'mantleconductivity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'nusselt', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'dtbg', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'plumeradius', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'topplumedepth', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'bottomplumedepth', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'plumex', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'plumey', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'crustthickness', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'uppercrustthickness', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'uppercrustheat', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'lowercrustheat', 'format', 'Double')
-    # }}}
Index: sm/trunk/src/m/classes/priv.js
===================================================================
--- /issm/trunk/src/m/classes/priv.js	(revision 28275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-//PRIV class definition
-//
-//   Usage:
-//      priv =new priv();
-
-function priv (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   private parameters: do not change'));
-
-		fielddisplay(this,'isconsistent','is model this consistent');
-		fielddisplay(this,'runtimename','name of the run launched');
-		fielddisplay(this,'bamg','structure with mesh properties constructed if bamg is used to mesh the domain');
-		fielddisplay(this,'solution','type of solution launched');
-	}// }}}
-	this.checkconsistency = function(md,solution,analyses){ // {{{
-
-	}// % }}}
-	//properties 
-	// {{{
-	this.isconsistent = true;
-	this.runtimename  = '';
-	this.bamg         = {};
-	this.solution     = '';
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/private.m
===================================================================
--- /issm/trunk/src/m/classes/private.m	(revision 28275)
+++ 	(revision )
@@ -1,46 +1,0 @@
-%PRIVATE class definition
-%
-%   Usage:
-%      private=private();
-
-classdef private
-	properties (SetAccess=public) 
-		isconsistent = true;
-		runtimename  = '';
-		bamg         = struct();
-		solution     = '';
-	end
-	methods
-		function self = private(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   private parameters: do not change'));
-
-			fielddisplay(self,'isconsistent','is model self consistent');
-			fielddisplay(self,'runtimename','name of the run launched');
-			fielddisplay(self,'bamg','structure with mesh properties constructed if bamg is used to mesh the domain');
-			fielddisplay(self,'solution','type of solution launched');
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.priv.isconsistent'],self.isconsistent);
-			writejsstring(fid,[modelname '.priv.runtimename'],self.runtimename);
-			writejsstring(fid,[modelname '.priv.solution'],self.solution);
-			%no bamg 
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/private.py
===================================================================
--- /issm/trunk/src/m/classes/private.py	(revision 28275)
+++ 	(revision )
@@ -1,40 +1,0 @@
-from collections import OrderedDict
-from fielddisplay import fielddisplay
-
-
-class private(object):
-    """
-    PRIVATE class definition
-
-       Usage:
-          private = private()
-    """
-
-    def __init__(self):  # {{{
-        self.isconsistent = True
-        self.runtimename = ''
-        self.bamg = OrderedDict()
-        self.solution = ''
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = '   private parameters: do not change'
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'isconsistent', 'is model self consistent'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'runtimename', 'name of the run launched'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'bamg', 'structure with mesh properties constructed if bamg is used to mesh the domain'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'solution', 'type of solution launched'))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        return md
-    # }}}
Index: /issm/trunk/src/m/classes/public/BuildQueueingScript.m
===================================================================
--- /issm/trunk/src/m/classes/public/BuildQueueingScript.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/BuildQueueingScript.m	(revision 1)
@@ -0,0 +1,17 @@
+function BuildQueueingScript(md,solutiontype,executionpath,codepath)
+%BUILDQUEUEINGSCRIPT - 
+%
+%   Usage:
+%      BuildQueueingScript(md,solutiontype,executionpath,codepath)
+
+disp('building queueing script');
+
+%First try and figure out if there is a special script for thie particular cluster
+function_name=['BuildQueueingScript' md.cluster];
+if exist(function_name,'file'),
+	%Call this function:
+	eval([function_name '(md,solutiontype,executionpath,codepath);']);
+else
+	%Call the generic BuildQueueingScript:
+	BuildQueueingScriptGeneric(md,solutiontype,executionpath,codepath);
+end
Index: /issm/trunk/src/m/classes/public/BuildQueueingScriptGeneric.m
===================================================================
--- /issm/trunk/src/m/classes/public/BuildQueueingScriptGeneric.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/BuildQueueingScriptGeneric.m	(revision 1)
@@ -0,0 +1,31 @@
+function BuildQueueingScriptGeneric(md,solutiontype,executionpath,codepath)
+%BUILDQUEUEINGSCRIPTGENERIC - ...
+%
+%   Usage:
+%      BuildQueueingScriptGeneric(md,executionpath,codepath)
+
+%Open queuing script file 
+scriptname=[md.name '.queue'];
+
+fid=fopen(scriptname,'w');
+if fid==-1,
+	error(['BuildQueueingScriptGenericerror message: could not open ' scriptname ' file for ascii writing']);
+end
+
+fprintf(fid,'#!/bin/sh\n');
+fprintf(fid,'rm -rf %s/%s.lock\n',executionpath,md.name);
+fprintf(fid,'mpirun -np %i ',md.np);
+
+if strcmpi(solutiontype,'diagnostic_horiz') |  strcmpi(solutiontype,'diagnostic'),
+	fprintf(fid,'%s/diagnostic.exe',codepath);
+elseif strcmpi(solutiontype,'control'),
+	fprintf(fid,'%s/control.exe',codepath);
+elseif strcmpi(solutiontype,'thermalsteady'),
+	fprintf(fid,'%s/thermalsteady.exe',codepath);
+else
+	error('BuildQueueingScriptGeneric error message: unsupported solution type!');
+end
+
+
+fprintf(fid,' %s %s.bin %s.outbin %s.lock 2> %s.errlog >%s.outlog & ',executionpath,md.name,md.name,md.name,md.name,md.name);
+fclose(fid);
Index: /issm/trunk/src/m/classes/public/BuildQueueingScriptcosmos.m
===================================================================
--- /issm/trunk/src/m/classes/public/BuildQueueingScriptcosmos.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/BuildQueueingScriptcosmos.m	(revision 1)
@@ -0,0 +1,49 @@
+function BuildQueueingScriptcosmos(md,executionpath,codepath)
+%BUILDQUEUEINGSCRIPTCOSMOS - build queueing script for batch system when running parallel
+%
+%   solutiontype is 'diagnostic','prognostic','transient','thermalsteady','thermaltransient','parameters' or 'control'
+%   and varargin is an optional package name ('cielo', 'ice' or 'macayeal')
+%
+%   Usage:
+%       md=solve(md,solutiontype,varargin)
+%
+%   Examples:
+%      md=solve(md,'diagnostic','macayeal');
+%
+
+function BuildQueueingScriptcosmos(md,solutiontype,executionpath,codepath)
+%BUILDQUEUEINGSCRIPTCOSMOS - ...
+%
+%   Usage:
+%      BuildQueueingScriptcosmos(md,executionpath,codepath)
+
+scriptname=[md.name '.queue'];
+
+fid=fopen(scriptname,'w');
+if fid==-1,
+	error(['BuildQueueingScriptcosmoserror message: could not open ' scriptname ' file for ascii writing']);
+end
+
+fprintf(fid,'#!/bin/sh\n');
+fprintf(fid,'#BSUB -n %i -W %i\n',md.np,md.time);
+if md.exclusive,
+	fprintf(fid,'#BSUB -x\n');
+end
+fprintf(fid,'#BSUB -a mpich_gm\n');
+fprintf(fid,'#BSUB -J %s\n',md.name);
+fprintf(fid,'#BSUB -o %s.outlog -e %s.errlog\n',md.name,md.name);
+fprintf(fid,'cd %s\n',executionpath);
+fprintf(fid,'rm -rf %s.outlog %s.errlog %s.lock\n',md.name,md.name,md.name);
+if md.alloc_cleanup,
+	fprintf(fid,'mpirun.lsf /home/larour/bin/alloc_cleanup.exe\n');
+end
+if strcmpi(solutiontype,'diagnostic_horiz') |  strcmpi(solutiontype,'diagnostic'),
+	fprintf(fid,'mpirun.lsf %s/diagnostic.exe %s %s.bin %s.outbin %s.lock',codepath,executionpath,md.name,md.name,md.name);
+elseif strcmpi(solutiontype,'control') ,
+	fprintf(fid,'mpirun.lsf %s/control.exe %s %s.bin %s.outbin %s.lock',codepath,executionpath,md.name,md.name,md.name);
+elseif strcmpi(solutiontype,'thermalsteady') ,
+	fprintf(fid,'mpirun.lsf %s/thermalsteady.exe %s %s.bin %s.outbin %s.lock',codepath,executionpath,md.name,md.name,md.name);
+else
+	error('BuildQueueingScriptcosmso error message: unsupported solution type!');
+end
+fclose(fid);
Index: /issm/trunk/src/m/classes/public/BuildQueueingScriptgemini.m
===================================================================
--- /issm/trunk/src/m/classes/public/BuildQueueingScriptgemini.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/BuildQueueingScriptgemini.m	(revision 1)
@@ -0,0 +1,33 @@
+function BuildQueueingScriptgemini(md,solutiontype,executionpath,codepath)
+%BUILDQUEUEINGSCRIPTGEMINI - ...
+%
+%   Usage:
+%      BuildQueueingScriptgemini(md,executionpath,codepath)
+
+scriptname=[md.name '.queue'];
+
+fid=fopen(scriptname,'w');
+if fid==-1,
+	error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
+end
+
+fprintf(fid,'#!/bin/sh\n');
+fprintf(fid,'#BSUB -n %i -W %i\n',md.np,md.time);
+fprintf(fid,'#BSUB -J %s\n',md.name);
+if ~isempty(md.queue),
+	fprintf(fid,'#BSUB -q %s\n',md.queue);
+end
+fprintf(fid,'#BSUB -o %s.outlog -e %s.errlog\n',md.name,md.name);
+fprintf(fid,'cd %s\n',executionpath);
+fprintf(fid,'rm -rf %s.outlog %s.errlog %s.lock\n',md.name,md.name,md.name);
+
+if strcmpi(solutiontype,'diagnostic_horiz') |  strcmpi(solutiontype,'diagnostic'),
+	fprintf(fid,'mpirun -np %i %s/diagnostic.exe %s %s.bin %s.outbin %s.lock',md.np,codepath,executionpath,md.name,md.name,md.name);
+elseif strcmpi(solutiontype,'control') ,
+	fprintf(fid,'mpirun -np %i %s/control.exe %s %s.bin %s.outbin %s.lock',md.np,codepath,executionpath,md.name,md.name,md.name);
+elseif strcmpi(solutiontype,'thermalsteady') ,
+	fprintf(fid,'mpirun -np %i %s/thermalsteady.exe %s %s.bin %s.outbin %s.lock',md.np,codepath,executionpath,md.name,md.name,md.name);
+else
+	error('BuildQueueingScriptgemini error message: unsupported solution type!');
+end
+fclose(fid);
Index: /issm/trunk/src/m/classes/public/DepthAverage.m
===================================================================
--- /issm/trunk/src/m/classes/public/DepthAverage.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/DepthAverage.m	(revision 1)
@@ -0,0 +1,19 @@
+function  vector_average=DepthAverage(md,vector);
+%DEPTHAVERAGE - computes depth average of 3d vector, and return value on 2d mesh. 
+%
+%   Usage:
+%      vector_average=DepthAverage(md,vector);
+%
+%   Example:
+%      vel_bar=DepthAverage(md,md.vel);
+
+%check that the model given in input is 3d
+if ~strcmpi(md.type,'3d');
+	error('DepthAverage error message: the model given in input must be 3d')
+end
+
+vector_average=zeros(md.numberofgrids2d,1);
+for i=1:md.numlayers-1,
+	vector_average=vector_average+(project2d(md,vector,i)+project2d(md,vector,i+1))/2.*(project2d(md,md.z,i+1)-project2d(md,md.z,i));
+end
+vector_average=vector_average./project2d(md,md.thickness,1);
Index: /issm/trunk/src/m/classes/public/LaunchQueueJob.m
===================================================================
--- /issm/trunk/src/m/classes/public/LaunchQueueJob.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/LaunchQueueJob.m	(revision 1)
@@ -0,0 +1,15 @@
+function LaunchQueueJob(md,executionpath)
+%LAUNCHQUEUEJOB - ...
+%
+%   Usage:
+%      LaunchQueueJob(md,executionpath)
+
+%First try and figure out if there is a special script for thie particular cluster
+function_name=['LaunchQueueJob' md.cluster];
+if exist(function_name,'file'),
+	%Call this function:
+	eval([function_name '(md,executionpath);']);
+else
+	%Call the generic LaunchQueueJob:
+	LaunchQueueJobGeneric(md,executionpath);
+end
Index: /issm/trunk/src/m/classes/public/LaunchQueueJobGeneric.m
===================================================================
--- /issm/trunk/src/m/classes/public/LaunchQueueJobGeneric.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/LaunchQueueJobGeneric.m	(revision 1)
@@ -0,0 +1,33 @@
+function LaunchQueueJobGeneric(md,executionpath)
+%LAUNCHQUEUEJOBGENERIC - ...
+%
+%   Usage:
+%      LaunchQueueJobGeneric(md,executionpath)
+
+%first, check we have the binary file and the queueing script
+if ~exist([ md.name '.bin'],'file'),
+	error('LaunchQueueJobGeneric error message: Binary input file missing, cannot go forward');
+end
+
+if ~exist([ md.name '.queue'],'file'),
+	error('LaunchQueueJobGeneric error message: queueing script issing, cannot go forward');
+end
+
+%if we are running locally, no need to call ssh to launch the job. We figure out by comparing the 
+%hostname to the cluster name
+[result,hostname]=system('hostname -s');hostname=hostname(1:end-1);
+	
+disp('uploading input file and queueing script');
+if strcmpi(hostname,md.cluster),
+	system(['cp ' md.name '.bin' ' ' md.name '.queue' ' ' executionpath]);
+else
+	system(['scp ' md.name '.bin' ' ' md.name '.queue' ' ' md.cluster ':' executionpath]);
+end
+
+disp('launching solution sequence on remote cluster');
+%now call the queuing script to launch the job.
+if strcmpi(hostname,md.cluster),
+	system(['cd ' executionpath ' && source ' md.name '.queue ']);
+else
+	system(['ssh  ' md.cluster ' ''cd ' executionpath ' && source ' md.name '.queue ''']);
+end
Index: /issm/trunk/src/m/classes/public/LaunchQueueJobcosmos.m
===================================================================
--- /issm/trunk/src/m/classes/public/LaunchQueueJobcosmos.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/LaunchQueueJobcosmos.m	(revision 1)
@@ -0,0 +1,33 @@
+function LaunchQueueJobcosmos(md,executionpath)
+%LAUNCHQUEUEJOBCOSMOS - ...
+%
+%   Usage:
+%      LaunchQueueJobcosmos(md,executionpath)
+
+%first, check we have the binary file and the queueing script
+if ~exist([ md.name '.bin'],'file'),
+	error('LaunchQueueJobcosmos error message: Binary input file missing, cannot go forward');
+end
+
+if ~exist([ md.name '.queue'],'file'),
+	error('LaunchQueueJobcosmos error message: queueing script issing, cannot go forward');
+end
+
+%Some special handling here! We could not get lsf to work through ssh, there is always something going badly 
+%in terms of environment variables not being correctly setup. This is due to the fact the ssh does not use a loging 
+%shell! What we therefore did, is figure out every variable setup in a login shell ( you can find it out by typing 
+%export in a login bash shell). Instead of trying to figure out which path variable is not being correctly setup, 
+%we just dump the export command result into a file, which we source before launching our job. This ensures we replicate 
+%exactly the state of a login shell, through ssh.
+cosmosvariableslocation=which('cosmosvariables.sh');
+if isempty(cosmosvariableslocation),
+	error('LaunchQueueJobcosmos error message: could not find environment variables for cosmos cluster!');
+end
+
+%now upload both files to cluster
+disp('uploading input file,  queueing script and variables script');
+eval(['!scp ' md.name '.bin' ' ' md.name '.queue ' cosmosvariableslocation ' ' md.cluster ':' executionpath]);
+
+disp('launching solution sequence on remote cluster');
+%now call the queuing script to launch the job.
+system(['ssh  ' md.cluster ' ''cd ' executionpath ' && source ./cosmosvariables.sh && bsub <  ' md.name '.queue  && rm cosmosvariables.sh ''']);
Index: /issm/trunk/src/m/classes/public/LaunchQueueJobgemini.m
===================================================================
--- /issm/trunk/src/m/classes/public/LaunchQueueJobgemini.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/LaunchQueueJobgemini.m	(revision 1)
@@ -0,0 +1,22 @@
+function LaunchQueueJobgemini(md,executionpath)
+%LAUNCHQUEUEJOBGEMINI - ...
+%
+%   Usage:
+%      LaunchQueueJobgemini(md,executionpath)
+
+%first, check we have the binary file and the queueing script
+if ~exist([ md.name '.bin'],'file'),
+	error('LaunchQueueJobgemini error message: Binary input file missing, cannot go forward');
+end
+
+if ~exist([ md.name '.queue'],'file'),
+	error('LaunchQueueJobgemini error message: queueing script issing, cannot go forward');
+end
+
+%jpload both files to cluster
+disp('uploading input file,  queueing script and variables script');
+eval(['!scp ' md.name '.bin' ' ' md.name '.queue '  md.cluster ':' executionpath]);
+
+disp('launching solution sequence on remote cluster');
+%now call the queuing script to launch the job.
+system(['ssh  ' md.cluster ' ''cd ' executionpath ' && bsub <  ' md.name '.queue ''']);
Index: /issm/trunk/src/m/classes/public/QueueJobPeek.m
===================================================================
--- /issm/trunk/src/m/classes/public/QueueJobPeek.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/QueueJobPeek.m	(revision 1)
@@ -0,0 +1,15 @@
+function md=QueueJobPeek(md,executionpath)
+%QUEUEJOBPEEK - ...
+%
+%   Usage:
+%      QueueJobPeek(md,executionpath)
+
+%First try and figure out if there is a special script for thie particular cluster
+function_name=['QueueJobPeek' md.cluster];
+if exist(function_name,'file'),
+	%Call this function:
+	eval(['md=' function_name '(md,executionpath);']);
+else
+	%Call the generic QueueJobPeek:
+	md=QueueJobPeekGeneric(md,executionpath);
+end
Index: /issm/trunk/src/m/classes/public/QueueJobPeekGeneric.m
===================================================================
--- /issm/trunk/src/m/classes/public/QueueJobPeekGeneric.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/QueueJobPeekGeneric.m	(revision 1)
@@ -0,0 +1,27 @@
+function md=QueueJobPeekGeneric(md,executionpath)
+%QUEUEJOBPEEKGENERIC - ...
+%
+%   Usage:
+%      md=QueueJobPeekGeneric(md,executionpath)
+
+disp('downloading error and output log files');
+
+%download errlog and outlog from cluster
+system(['scp ' md.cluster ':' executionpath '/' md.name '.*log ./']);
+
+%read log files onto  fields
+md.errlog=readfile([md.name '.errlog']);
+md.outlog=readfile([md.name '.outlog']);
+
+%cat those two files
+disp(sprintf('\n\nerror log:\n\n'));
+system(['cat ' md.name '.errlog']);
+
+disp(sprintf('\n\noutput log:\n\n'));
+system(['cat ' md.name '.outlog']);
+
+%erase the log files
+system(['rm -rf ' md.name '.outlog ' md.name '.errlog']);
+
+%warn user
+disp(sprintf('\n\nerror and output logs are saved in model fields for further checking'));
Index: /issm/trunk/src/m/classes/public/README
===================================================================
--- /issm/trunk/src/m/classes/public/README	(revision 1)
+++ /issm/trunk/src/m/classes/public/README	(revision 1)
@@ -0,0 +1,11 @@
+This directory is similar to @model, in that it only deals
+with methods proper to the @model class. But we need a different 
+directory from @model, to make those methods public, not private. 
+The advantage of public methods is that they will use subsref and 
+susasgn to access data in a @model object.
+
+For ex: 
+calling md.x in a "@model" routine just accesses the x field in the md 
+structure. But calling md.x in a "model" routine will access the x field 
+through the susref routine in @model. This ensures that we protect the 
+data in @model classes from improper use.
Index: /issm/trunk/src/m/classes/public/ReadData.m
===================================================================
--- /issm/trunk/src/m/classes/public/ReadData.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/ReadData.m	(revision 1)
@@ -0,0 +1,29 @@
+function field=ReadData(fid)
+%READDATA - ...
+%
+%   Usage:
+%      field=ReadData(fid)
+
+
+%read field
+[type,count]=fread(fid,1,'double');
+
+if count==0,
+	field=NaN;
+else
+	if type==0,
+		%string
+		stringsize=fread(fid,1,'double');
+		field=char(fread(fid,stringsize,'char'));
+		field=field(1:end-1)';
+	elseif type==1,
+		%matrix
+		M=fread(fid,1,'double');
+		N=fread(fid,1,'double');
+		field=fread(fid,[M,N],'double');
+	elseif ((type==2) || (type==3)),
+		field=fread(fid,1,'double');
+	else 
+		error('ReadData error message: data type not supported yet!');
+	end
+end
Index: /issm/trunk/src/m/classes/public/SectionValues.m
===================================================================
--- /issm/trunk/src/m/classes/public/SectionValues.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/SectionValues.m	(revision 1)
@@ -0,0 +1,115 @@
+function [index,X,Y,Z,S,data_interp]=SectionValues(md,data,infile,resolution)
+%SECTIONVALUES - compute the value of a field on a section
+%
+%   This routine gets the value of a given field of the model on points
+%   given by filname (Argus type file)
+%
+%   Usage:
+%      [elements,x,y,z,s,data]=SectionValues(md,data,filename,resolution)
+
+%read infile:
+contempt=expread(infile,1);
+nods=contempt.nods;
+x=contempt.x;
+y=contempt.y;
+
+%get the specified resolution
+if isnumeric(resolution(1))
+	res_h=resolution(1);
+else
+	error('SectionValues error message: wrong resolution type. Resolution must be an array [horizontal_resolution vertical_resolution]')
+end
+if strcmpi(md.type,'3d')
+	if (length(resolution)==2 & isnumeric(resolution(2)))
+		res_v=resolution(2);
+	else
+		error('SectionValues error message: wrong resolution type. Resolution must be an array [horizontal_resolution vertical_resolution]')
+	end
+end
+
+%initialization
+X=[]; %X-coordinate
+Y=[]; %Y-coordinate
+S=0;  %curvilinear coordinate
+
+for i=1:nods-1
+
+	x_start=x(i);
+	x_end=x(i+1);
+	y_start=y(i);
+	y_end=y(i+1);
+	s_start=S(end);
+
+	length_segment=sqrt((x_end-x_start)^2+(y_end-y_start)^2);
+	portion=ceil(length_segment/res_h);
+
+	x_segment=zeros(portion,1);
+	y_segment=zeros(portion,1);
+	s_segment=zeros(portion,1);
+
+	for j=1:portion
+		x_segment(j)=x_start+(j-1)*(x_end-x_start)/portion;
+		y_segment(j)=y_start+(j-1)*(y_end-y_start)/portion;
+		s_segment(j)=s_start+j*length_segment/portion;
+	end
+
+	%plug into X and Y
+	X=[X;x_segment];
+	Y=[Y;y_segment];
+	S=[S;s_segment];
+end
+X(end+1)=x(nods);
+Y(end+1)=y(nods);
+
+%Number of grids:
+numberofgrids=size(X,1);
+
+%Compute Z
+Z=zeros(numberofgrids,1);
+
+%New mesh and Data interpolation
+if strcmpi(md.type,'2d')
+
+	%Interpolation of data on specified points
+	data_interp=griddata_mesh_to_mesh(md.elements,md.x,md.y,data,X,Y);
+
+	%Compute index
+	index=[1:1:(numberofgrids-1);2:1:numberofgrids]';
+
+else
+
+	%vertically extrude mesh
+
+	%Get bed and surface for each 2d point, offset to make sure that it is inside the glacier system
+	offset=10^-10;
+	bed=griddata_mesh_to_mesh_3d(md.elements,md.x,md.y,md.z,md.bed,X,Y,Z,'node')+offset;
+	surface=griddata_mesh_to_mesh_3d(md.elements,md.x,md.y,md.z,md.surface,X,Y,Z,'node')-offset;
+
+	%Some useful parameters
+	layers=ceil(res_v/md.numlayers);
+	gridsperlayer=numberofgrids;
+	gridstot=gridsperlayer*layers;
+	elementsperlayer=gridsperlayer-1;
+	elementstot=(gridsperlayer-1)*(layers-1);
+
+	%initialization
+	X3=zeros(gridsperlayer*layers,1); Y3=zeros(gridsperlayer*layers,1); Z3=zeros(gridsperlayer*layers,1); S3=zeros(gridsperlayer*layers,1); index3=zeros(elementstot,4);
+
+	%Get new coordinates in 3d
+	for i=1:layers
+		X3(i:layers:end)=X;
+		Y3(i:layers:end)=Y;
+		Z3(i:layers:end)=bed+(i-1)*(surface-bed)/(layers-1);
+		S3(i:layers:end)=S;
+
+		if i<layers %Build index3 with quads
+			index3((i-1)*elementsperlayer+1:i*elementsperlayer,:)=[i:layers:gridstot-layers; i+1:layers:gridstot-layers; i+layers+1:layers:gridstot; i+layers:layers:gridstot]';
+		end
+	end
+
+	%Interpolation of data on specified points
+	data_interp=griddata_mesh_to_mesh_3d(md.elements,md.x,md.y,md.z,data,X3,Y3,Z3);
+
+	%build outputs
+	X=X3; Y=Y3; Z=Z3;  S=S3; index=index3;
+end
Index: /issm/trunk/src/m/classes/public/ThicknessCorrection.m
===================================================================
--- /issm/trunk/src/m/classes/public/ThicknessCorrection.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/ThicknessCorrection.m	(revision 1)
@@ -0,0 +1,39 @@
+function md=ThicknessCorrection(md,filename,distance)
+%THICKNESSCORRECTION - correct the thickness of the ice shelf near the grounding line
+%
+%   This routine corrects the thickness and the bed at the transition ice sheet - shelf
+%   due to the assumption of hydrostatic equilibrium.
+%   it treats the area given by the Argus file given in input as follows:
+%   1: linearize the transition iceshelf ice sheet
+%    thickness = coeff * thickness_GL + (1-coeff) * thickness_shelf
+%    coeff = min(0,ditance to GL / distance)
+%   2: take the minimum between this linearized thickness and the previous thickness
+%    thickness = min(linearized thickness, previous thickness)
+%
+%   Usage:
+%      md=ThicknessCorrection(md,filename,distance)
+
+%some checks
+if ~exist(filename),
+	error(['ThicknessCorrection error message: the file ' filename  ' does not exist']);
+end
+
+in=ArgusContourToMesh(md.elements,md.x,md.y,expread(filename,1),'node',1);
+pos_shelf=find(in & md.gridoniceshelf);
+pos_sheet=find(in & ~md.gridoniceshelf);
+for i=1:length(pos_shelf)
+	%search the grid on ice sheet the closest to i
+	[d posd]=min(sqrt((md.x(pos_shelf(i))-md.x(pos_sheet)).^2+(md.y(pos_shelf(i))-md.y(pos_sheet)).^2));
+	%thickness is minimum between hydrostatic equilibrium and thickness of the closest grid on ice sheet
+	coeff=min(1,d/distance);
+	md.thickness(pos_shelf(i))=min(coeff*md.thickness(pos_shelf(i))+(1-coeff)*md.thickness(pos_sheet(posd)),md.thickness(pos_shelf(i)));
+end
+
+%check the computed thickness
+di=md.rho_ice/md.rho_water;
+minth=1/(1-di);
+pos=find(isnan(md.thickness) | (md.thickness<=0));
+md.thickness(pos)=minth;
+
+%change bed to take into account the changes in thickness
+md.bed=md.surface-md.thickness;
Index: /issm/trunk/src/m/classes/public/WriteData.m
===================================================================
--- /issm/trunk/src/m/classes/public/WriteData.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/WriteData.m	(revision 1)
@@ -0,0 +1,45 @@
+function WriteData(fid,data,data_type,name)
+%WRITEDATA - ...
+%
+%   Usage:
+%      WriteData(fid,data,data_type)
+
+if issparse(data),
+	data=full(data);
+end
+
+%Ok! put the length of the name, and the "name" string first!
+fwrite(fid,length(name),'int'); 
+fwrite(fid,name,'char'); 
+
+if strcmpi(data_type,'String'),
+	%first write length of record
+	fwrite(fid,length(data)+4,'int');  %4 for int32
+	%now write string
+	fwrite(fid,length(data),'int'); 
+	fwrite(fid,data,'char'); 
+elseif strcmpi(data_type,'Mat'),
+	s=size(data);
+	
+	%first write length of record
+	fwrite(fid,4+4+8*s(1)*s(2),'int');  %2 integers (32 bits) + the double matrix
+
+	%now write matrix
+	fwrite(fid,s(1),'int'); 
+	fwrite(fid,s(2),'int'); 
+	if s(1)*s(2),
+		fwrite(fid,data','double'); %get to the "c" convenction, hence the transpose
+	end
+elseif strcmpi(data_type,'Integer'),
+	%first write length of record
+	fwrite(fid,4,'int');  %1 integer
+	%now write integer
+	fwrite(fid,data,'int'); 
+elseif strcmpi(data_type,'Scalar'),
+	%first write length of record
+	fwrite(fid,8,'int');  %1 double
+	%now write double
+	fwrite(fid,data,'double'); 
+else 
+	error('WriteData error message: data type not supported yet!');
+end
Index: /issm/trunk/src/m/classes/public/addnote.m
===================================================================
--- /issm/trunk/src/m/classes/public/addnote.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/addnote.m	(revision 1)
@@ -0,0 +1,36 @@
+function md=addnote(md,string)
+%ADDNOTE - add a note to the existing model notes field
+%
+%   Usage:
+%      md=addnote(md,string);
+%
+%   Example:
+%      md=addnote(md,'Pine Island, Geometry of 2007');
+
+if (nargin~=2) | (nargout~=1),
+	addnoteusage;
+	error(' ');
+end
+
+if ~ischar(string),
+	error('addnote error message: second input argument should be a string');
+end
+notes=md.notes;
+
+if ischar(notes),
+	newnotes=cell(2,1);
+	newnotes(1)={notes};
+	newnotes(2)={string};
+else
+	newnotes=cell(length(notes)+1,1);
+	for i=1:length(notes),
+		newnotes(i)=notes(i);
+	end
+	newnotes(length(notes)+1)={string};
+end
+
+md.notes=newnotes;
+
+function addnoteusage()
+disp('addnote usage:');
+disp('   model=addnote(model,string)');
Index: /issm/trunk/src/m/classes/public/area.m
===================================================================
--- /issm/trunk/src/m/classes/public/area.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/area.m	(revision 1)
@@ -0,0 +1,22 @@
+function areas=area(md)
+%AREA - compute areas for every element
+%
+%   Usage:
+%      areas=area(md)
+
+areas=zeros(md.numberofelements,1);
+
+%load some variables (it is much faster if the variab;es are loaded from md once for all)
+index=md.elements;
+x=md.x; y=md.y; z=md.z;
+x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3)); y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
+
+%compute the volume of each element
+if strcmpi(md.type,'3d')
+	%V=area(triangle)*1/3(z1+z2+z3)
+	thickness=mean(z(index(:,4:6)))-mean(z(index(:,1:3)));
+	areas=abs(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
+else
+	%compute the surface of the triangle
+	areas=abs(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
+end
Index: /issm/trunk/src/m/classes/public/averageconnectivity.m
===================================================================
--- /issm/trunk/src/m/classes/public/averageconnectivity.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/averageconnectivity.m	(revision 1)
@@ -0,0 +1,11 @@
+function conn=averageconnectivity(md)
+%AVERAGECONNECTIVITY - computes the average connectivity of a model
+%
+%   Usage:
+%      connectivity=averageconnectivity(md);
+
+nnz=0;
+for i=1:md.numberofgrids,
+	nnz=nnz+length(find(md.elements==i));
+end
+conn=nnz/md.numberofgrids;
Index: /issm/trunk/src/m/classes/public/averaging.m
===================================================================
--- /issm/trunk/src/m/classes/public/averaging.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/averaging.m	(revision 1)
@@ -0,0 +1,64 @@
+function average=averaging(md,data,iterations)
+%AVERAGING - smooths the input over the mesh
+%
+%   This routine takes a list over the elements or the grids in input
+%   and return a list over the grids.
+%   For each iterations it computes the average over each element (average 
+%   of the vertices values) and then computes the average over each grid
+%   by taking the average of the element around a grid weighted by the
+%   elements volume
+%
+%   Usage:
+%      md=averaging(md,data,iterations)
+%
+%   Examples:
+%      velsmoothed=averaging(md,md.vel,4);
+%      pressure=averaging(md,md.pressure,0);
+
+if length(data)~=md.numberofelements & length(data)~=md.numberofgrids
+	error('averaging error message: data not supported yet');
+end
+
+%initialization
+weights=zeros(md.numberofgrids,1);
+areas=zeros(md.numberofelements,1);
+data=data(:);
+
+%load some variables (it is much faster if the variab;es are loaded from md once for all)
+index=md.elements;
+numberofgrids=md.numberofgrids;
+numberofelements=md.numberofelements;
+
+%build some variables
+line=index(:);
+if strcmpi(md.type,'3d')
+	rep=6;
+else
+	rep=3;
+end
+summation=1/rep*ones(rep,1);
+linesize=rep*numberofelements;
+
+%compute the volume of each element
+areas=area(md);
+
+%update weights that holds the volume of all the element holding the grid i
+weights=sparse(line,ones(linesize,1),repmat(areas,rep,1),numberofgrids,1);
+
+%initialization
+if length(data)==numberofelements
+	average_grid=sparse(line,ones(linesize,1),repmat(areas.*data,rep,1),numberofgrids,1);
+	average_grid=average_grid./weights;
+else
+	average_grid=data;
+end
+
+%loop over iteration
+for i=1:iterations
+	average_el=average_grid(index)*summation;
+	average_grid=sparse(line,ones(linesize,1),repmat(areas.*average_el,rep,1),numberofgrids,1);
+	average_grid=average_grid./weights;
+end
+
+%return output as a full matrix (C code do not like sparse matrices)
+average=full(average_grid);
Index: /issm/trunk/src/m/classes/public/balvel.m
===================================================================
--- /issm/trunk/src/m/classes/public/balvel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/balvel.m	(revision 1)
@@ -0,0 +1,26 @@
+function [velx,vely,vel]=balvel(md)
+%BALVEL - computation of balanced velocities
+%
+%   This routine uses the model of Hutter to compute the velocities
+%   of a 2d model using the surface slope
+%
+%   Usage:
+%      [velx,vely,vel]=balvel(md)
+
+if ~strcmpi(md.type,'2d'),
+	error('Only 2d meshes are allowed to compute velocity balances');
+end
+
+%Get slope
+[sx,sy,s]=slope(md);
+
+%Average thickness and B over all elements.
+summer=[1;1;1];
+hel=md.thickness(md.elements)*summer/3;
+Bel=md.B(md.elements)*summer/3;
+
+Ael=Bel.^(-3);
+
+velx=-2*(md.rho_ice*md.g)^3*s.^2.*sx.*Ael/4.*hel.^4;
+vely=-2*(md.rho_ice*md.g)^3*s.^2.*sy.*Ael/4.*hel.^4;
+vel=sqrt(velx.^2+vely.^2);
Index: /issm/trunk/src/m/classes/public/basalstress.m
===================================================================
--- /issm/trunk/src/m/classes/public/basalstress.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/basalstress.m	(revision 1)
@@ -0,0 +1,28 @@
+function [sx,sy,smag]=basalstress(md)
+%BASALSTRESS -  evaluates the basal stress
+%
+%   The basal stress is computed according to the following formula: 
+%   sigma=drag^2*Neff^r*vel^s
+%   where:
+%    Neff is the effective pressure (Neff=rho_ice*g*thickness+rho_water*g*bed),
+%    r=q/p
+%    s=1/p
+%    p and q being friction coefficients found in the literature (Paterson).
+%
+%   Usage:
+%      [Fx,Fy,Fmag]=basalstress(md)
+
+%Compute effective pressure
+Neff=md.rho_ice*md.g*md.thickness+md.rho_water*md.g*md.bed;
+Neff(find(Neff<0))=0.1;
+r=md.q./md.p;
+s=1./md.p;
+dragel=(md.drag(md.elements(:,1))+md.drag(md.elements(:,2))+md.drag(md.elements(:,3)))/3;
+Neffel=(Neff(md.elements(:,1))+Neff(md.elements(:,2))+Neff(md.elements(:,3)))/3;
+velel=(md.vel(md.elements(:,1))+md.vel(md.elements(:,2))+md.vel(md.elements(:,3)))/3/md.yts;
+vxel=(md.vx(md.elements(:,1))+md.vx(md.elements(:,2))+md.vx(md.elements(:,3)))/3/md.yts;
+vyel=(md.vy(md.elements(:,1))+md.vy(md.elements(:,2))+md.vy(md.elements(:,3)))/3/md.yts;
+
+sx=dragel.^2.*Neffel.^r.*velel.^(s-1).*vxel;
+sy=dragel.^2.*Neffel.^r.*velel.^(s-1).*vyel;
+smag=sqrt(sx.^2+sy.^2);
Index: /issm/trunk/src/m/classes/public/basevert.m
===================================================================
--- /issm/trunk/src/m/classes/public/basevert.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/basevert.m	(revision 1)
@@ -0,0 +1,35 @@
+function wb=basevert(md)
+%BASEVERT - computes the basal vertical velcities
+%
+%   This routine computes the basal vertical velocities of ice shelves
+%   for 2d models only using the following formula:
+%   wb=rho_ice/rho_water*div(thickness*vel_horiz)+vel_horiz.grad(base)
+%
+%   Usage:
+%      wb=basevert(md);
+
+alpha=zeros(md.numberofelements,3);
+beta=zeros(md.numberofelements,3);
+gamma=zeros(md.numberofelements,3);
+
+for n=1:md.numberofelements
+	X=inv([md.x(md.elements(n,:)) md.y(md.elements(n,:)) ones(3,1)]);
+	alpha(n,:)=X(1,:);
+	beta(n,:)=X(2,:);
+	gamma(n,:)=X(3,:);
+end
+
+hu=md.thickness.*md.vx;
+hv=md.thickness.*md.vy;
+
+summation=[1;1;1];
+hux=(hu(md.elements).*alpha)*summation;
+hvy=(hv(md.elements).*beta)*summation;
+
+uelem=md.vx(md.elements)*summation/3;
+velem=md.vy(md.elements)*summation/3;
+
+dbdx=(md.bed(md.elements).*alpha)*summation;
+dbdy=(md.bed(md.elements).*beta)*summation;
+
+wb=-md.rho_ice/md.rho_water*(hux+hvy)+uelem.*dbdx+velem.*dbdy;
Index: /issm/trunk/src/m/classes/public/buildoverlay.m
===================================================================
--- /issm/trunk/src/m/classes/public/buildoverlay.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/buildoverlay.m	(revision 1)
@@ -0,0 +1,98 @@
+function [image_rgb varargout]=buildoverlay(md,field,transparency,highres,smoothing,windowsize,border);
+%BUILDOVERLAY - creates an RGB image of a field
+%
+%   This routine is used by plotmodel to superimpose a radar
+%   image and a field of the model
+%
+%   Usage:
+%      image_rgb=buildoverlay(md,field,transparency,highres,smoothing,windowsize);
+%
+%   Example:
+%      image_rgb=buildoverlay(md,md.vel,0.5,1,1,10^3);
+%
+%   See also: RADARPOWER, PLOTMODEL, BUILDOVERLAYCOLORBAR
+
+%2d plots only
+if ~strcmpi(md.type,'2d'),
+	error('plot_overlay error message: only 2d plots allowed');
+end
+
+%Ok, first we need to recover the radar map.
+md=radarpower(md,highres);
+
+if isfield(struct(md),field)
+	data=eval(['md.' field ';']);
+else
+	data=field;
+end
+
+%load x,y, etc ... to speed up plot
+x=md.x;
+y=md.y;
+z=md.z;
+elements=md.elements;
+
+if md.numberofgrids==size(elements,1),
+	error('buildoverlay error message: the number of elements is the same as the number of grids! cannot plot anything with model/plot, use matlab/plot instead')
+end
+
+if smoothing,
+	data=averaging(md,data,1);
+end
+
+%use mesh2grid solution to get an gridded data to display using imagesc
+md.dummy=data;
+md.mesh2grid_parameters={'dummy'};
+if length(data)==length(elements),
+	md.mesh2grid_interpolation={'element'};
+elseif length(data)==md.numberofgrids,
+	md.mesh2grid_interpolation={'node'};
+else 
+	error('plot_overlay error message: data should be numberofgrids of numberofelements long');
+end
+md.mesh2grid_filter={'average'};
+md.mesh2grid_cornereast=min(md.x);
+md.mesh2grid_cornernorth=max(md.y);
+md.mesh2grid_ncolumns=length(md.sarxm);
+md.mesh2grid_xposting=(max(md.x)-min(md.x))/md.mesh2grid_ncolumns;
+md.mesh2grid_nlines=length(md.sarym);
+md.mesh2grid_yposting=(max(md.y)-min(md.y))/md.mesh2grid_nlines;
+md.mesh2grid_windowsize=windowsize;
+
+md.cluster='none';
+md=solve(md,'mesh2grid','cielo');
+
+%Ok, we have two images, double format: 
+radar=md.sarpwr;
+results=md.mesh2grid_results{1};
+
+%nullify NaN in results
+results(find(isnan(results)))=0;
+
+%Build hsv color image from radar and results
+%intensity
+v=radar/max(max(radar));
+
+%hue
+%cut results under 1.5, and log
+results(find(results<1.5))=1.5;
+h=bytscl(log(results))/(255+1); %1 offset on colormap
+
+%saturation
+s=(0.5+results/125)/transparency;s(find(s>1))=1;s(find(s<0))=0;
+s(find(results==1.5))=0;
+
+%Include border
+v((1:border),:)=0;  v((end-border+1:end),:)=0; v(:,1:border)=0;v(:,(end-border+1:end))=0;
+
+%Transform hsv to rgb
+image_hsv=zeros(size(results,1),size(results,2),3);
+image_hsv(:,:,1)=h;
+image_hsv(:,:,2)=s;
+image_hsv(:,:,3)=v;
+image_rgb=hsv2rgb(image_hsv);
+
+if nargout==3,
+	varargout{1}=md.sarxm;
+	varargout{2}=md.sarym;
+end
Index: /issm/trunk/src/m/classes/public/buildoverlaycolorbar.m
===================================================================
--- /issm/trunk/src/m/classes/public/buildoverlaycolorbar.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/buildoverlaycolorbar.m	(revision 1)
@@ -0,0 +1,44 @@
+function colorbar_rgb=buildoverlaycolorbar(md,field,transparency);
+%BUILDOVERLAYCOLORBAR - creates the colorbar associated with an averlay plot option
+%
+%   creates a color bar assotiated with the RGB image created be BUILDOVERLAY
+%   that uses RGB colors
+%
+%   Usage:
+%      colorbar_rgb=buildoverlaycolorbar(md,field,transparency);
+%
+%   Example:
+%      colorbar_rgb=buildoverlaycolorbar(md,md.vel,0.5);
+%
+%   See also: RADARPOWER, PLOTMODEL, BUILDOVERLAY
+
+%recover results
+if isfield(struct(md),field)
+	data=eval(['md.' field ';']);
+else
+	data=field;
+end
+
+results=min(data):(max(data)-min(data))/256:max(data);
+
+%Build hsv color image from radar and results
+%intensity
+v=ones(size(results,1),1);
+
+%hue
+%cut results under 1.5, and log
+results(find(results<1.5))=1.5;
+h=bytscl((results))/(255+1); %1 offset on colormap
+
+%saturation
+s=(0.5+results/125)/transparency;s(find(s>1))=1;s(find(s<0))=0;
+s(find(results==1.5))=0;
+
+%Transform hsv to rgb
+colorbar_hsv=zeros(size(results,2),size(results,1),3);
+colorbar_hsv(:,:,1)=h;
+colorbar_hsv(:,:,2)=s;
+colorbar_hsv(:,:,3)=v;
+
+%Transform rgb to hsv
+colorbar_rgb=hsv2rgb(colorbar_hsv);
Index: /issm/trunk/src/m/classes/public/collapse.m
===================================================================
--- /issm/trunk/src/m/classes/public/collapse.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/collapse.m	(revision 1)
@@ -0,0 +1,138 @@
+function md=collapse(md)
+%COLLAPSE - collapses a 3d mesh into a 2d mesh
+%
+%   This routine collapses a 3d model into a 2d model
+%   and collapses all the fileds of the 3d model by
+%   taking their depth-averaged values
+%
+%   Usage:
+%      md=collapse(md)
+%
+%   See also: EXTRUDE, MODELEXTRACT
+
+%Check that the model is really a 3d model
+if ~strcmpi(md.type,'3d'),
+	error('collapse error message: only 3d mesh can be collapsed')
+end
+
+%Start with changing alle the fields from the 3d mesh 
+
+%drag is limited to grids that are on the bedrock.
+md.drag=project2d(md,md.drag,1);
+
+%p and q (same deal, except for element that are on the bedrock: )
+md.p=project2d(md,md.p,1);
+md.q=project2d(md,md.q,1);
+
+%observations
+md.vx_obs=project2d(md,md.vx_obs,md.numlayers);
+md.vy_obs=project2d(md,md.vy_obs,md.numlayers);
+md.vel_obs=project2d(md,md.vel_obs,md.numlayers);
+md.accumulation=project2d(md,md.accumulation,md.numlayers);
+md.firn_layer=project2d(md,md.firn_layer,md.numlayers);
+
+%results
+if ~isnan(md.vx),md.vx=DepthAverage(md,md.vx);end;
+if ~isnan(md.vy),md.vy=DepthAverage(md,md.vy);end;
+if ~isnan(md.vz),md.vz=DepthAverage(md,md.vz);end;
+if ~isnan(md.vel),md.vel=DepthAverage(md,md.vel);end;
+if ~isnan(md.surface_slopex),md.surface_slopex=project2d(md,md.surface_slopex,md.numlayers);end;
+if ~isnan(md.surface_slopey),md.surface_slopey=project2d(md,md.surface_slopey,md.numlayers);end;
+if ~isnan(md.bed_slopex),md.bed_slopex=project2d(md,md.bed_slopex,1);end;
+if ~isnan(md.bed_slopey),md.bed_slopey=project2d(md,md.bed_slopey,1);end;
+
+%bedinfo and surface info
+md.elementonbed=ones(md.numberofelements2d,1);
+md.elementonsurface=ones(md.numberofelements2d,1);
+md.gridonbed=ones(md.numberofgrids2d,1);
+md.gridonsurface=ones(md.numberofgrids2d,1);
+
+%elementstype
+if ~isnan(md.elements_type2d)
+	md.elements_type=md.elements_type2d; 
+else
+	md.elements_type2d(:,1)=project2d(md,md.elements_type(:,1),1);
+	md.elements_type2d(:,2)=project2d(md,md.elements_type(:,2),1);
+end	
+md.gridonhutter=project2d(md,md.gridonhutter,1);
+md.gridonmacayeal=project2d(md,md.gridonmacayeal,1);
+md.gridonpattyn=project2d(md,md.gridonpattyn,1);
+md.gridonstokes=project2d(md,md.gridonstokes,1);
+
+%boundary conditions
+md.gridondirichlet_diag=project2d(md,md.gridondirichlet_diag,md.numlayers);
+dirichletvalues_diag2d(:,1)=project2d(md,md.dirichletvalues_diag(:,1),md.numlayers); 
+dirichletvalues_diag2d(:,2)=project2d(md,md.dirichletvalues_diag(:,2),md.numlayers); 
+md.dirichletvalues_diag=dirichletvalues_diag2d;
+
+%Extrusion of Neumann BC
+%in 2d, segmentonnumann is: [grid1 grid2 element]
+numberofneumann2d=size(md.segmentonneumann_diag,1)/md.numlayers;
+md.segmentonneumann_diag=[md.segmentonneumann_diag(1:numberofneumann2d,1:2) md.segmentonneumann_diag(1:numberofneumann2d,5)]; %Add two columns on the first layer 
+
+%Prognostic
+md.gridondirichlet_prog=project2d(md,md.gridondirichlet_prog,md.numlayers);
+md.dirichletvalues_prog=project2d(md,md.dirichletvalues_prog,md.numlayers);
+%md.segmentonneumann_prog=[tproj(md.segmentonneumann_prog(:,1)) tproj(md.segmentonneumann_prog(:,2)) tproj2d_el(md.segmentonneumann_prog(:,5))];
+%md.segmentonneumann_prog2=[tproj(md.segmentonneumann_prog2(:,1)) tproj(md.segmentonneumann_prog2(:,2)) tproj2d_el(md.segmentonneumann_prog2(:,5))];
+
+%materials
+md.B=DepthAverage(md,md.B);
+md.n=project2d(md,md.n,1);
+
+%special for thermal modeling:
+md.melting=project2d(md,md.melting,1); 
+md.observed_temperature=DepthAverage(md,md.observed_temperature); 
+md.geothermalflux=project2d(md,md.geothermalflux,1); %bedrock only gets geothermal flux
+md.gridondirichlet_thermal=project2d(md,md.gridondirichlet_thermal,md.numlayers); %surface temperature
+md.dirichletvalues_thermal=project2d(md,md.dirichletvalues_thermal,md.numlayers); %surface temperature
+
+%NaN the values that are not on an spc'd temperature.
+pos=find(~md.gridondirichlet_thermal);
+md.dirichletvalues_thermal(pos)=NaN;
+
+%update of connectivity matrix
+md.connectivity=25;
+
+%Collapse the mesh
+grids2d=md.numberofgrids2d;
+elements2d=md.numberofelements2d;
+
+%parameters
+md.surface=project2d(md,md.surface,1);
+md.thickness=project2d(md,md.thickness,1);
+md.bed=project2d(md,md.bed,1);
+md.gridonboundary=project2d(md,md.gridonboundary,1);
+md.elementoniceshelf=project2d(md,md.elementoniceshelf,1);
+md.gridoniceshelf=project2d(md,md.gridoniceshelf,1);
+md.elementonicesheet=project2d(md,md.elementonicesheet,1);
+md.gridonicesheet=project2d(md,md.gridonicesheet,1);
+
+%Initialize with the 2d mesh
+md.x=md.x2d;
+md.y=md.y2d;
+md.z=md.z2d;
+md.numberofgrids=md.numberofgrids2d;
+md.numberofelements=md.numberofelements2d;
+md.elements=md.elements2d;
+
+%Keep a trace of lower and upper grids
+md.lowergrids=NaN;
+md.uppergrids=NaN;
+
+%Remove old mesh 
+md.x2d=NaN;
+md.y2d=NaN;
+md.z2d=NaN;
+md.elements2d=NaN;
+md.elements_type2d=md.elements_type;
+md.numberofelements2d=md.numberofelements;
+md.numberofgrids2d=md.numberofgrids;
+md.numlayers=0;
+
+%Update mesh type
+md.type='2d';
+
+%Tie in with Cielo if requested
+cieloend;
+end
Index: /issm/trunk/src/m/classes/public/deepcopy.m
===================================================================
--- /issm/trunk/src/m/classes/public/deepcopy.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/deepcopy.m	(revision 1)
@@ -0,0 +1,30 @@
+function md2=deepcopy(md)
+%DEEPCOPY - copies a model
+%
+%   This routine will copy md into md2. If md is being held in an out of core 
+%   repository, user will be prompted for a different repository name, and a 
+%   copy of the repository, with the new name, will be done.
+%
+%   Usage:
+%      md2=deepcopy(md)
+
+if isempty(md.repository),
+	md2=md;
+else
+	%New repository name?
+	new_repository=input(['   input model is held in repository: ' md.repository '. you need a new name for the model copy: ']);
+	md2=model(new_repository);
+
+	structfields=fields(md);
+	for i=1:length(structfields),
+		field=structfields(i);field=field{1};
+		if strcmpi(field,'repository'),
+			%we don't want to clobber md2.repository!
+			continue;
+		end
+		fieldval=getfield(md,field);
+		if isfield(struct(md2),field),
+			eval(['md2.' field '=fieldval;']);
+		end
+	end
+end
Index: /issm/trunk/src/m/classes/public/displaybc.m
===================================================================
--- /issm/trunk/src/m/classes/public/displaybc.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displaybc.m	(revision 1)
@@ -0,0 +1,29 @@
+function displaybc(md)
+%DISPLAYBC - display of the boundary conditions fileds
+%
+%   to avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays boundary conditions  from model md, 
+%   only if requested.
+%
+%   Usage:
+%      displaybc(md)
+
+disp(sprintf('   Boundary conditions:'));
+disp(sprintf('      diagnostic:'));
+disp(sprintf('         gridondirichlet_diag: (%i)',length(md.gridondirichlet_diag)));
+disp(sprintf('         dirichletvalues_diag [m/a]: (%i,%i)',length(md.dirichletvalues_diag),2));
+disp(sprintf('         segmentonneumann_diag: (%i)',length(md.segmentonneumann_diag)));
+disp(sprintf('         neumannvalues_diag [N]: (%i)',length(md.neumannvalues_diag)));
+
+disp(sprintf('      prognostic:'));
+disp(sprintf('         gridondirichlet_prog: (%i)',length(md.gridondirichlet_prog)));
+disp(sprintf('         dirichletvalues_prog [m/a]: (%i)',length(md.dirichletvalues_prog)));
+disp(sprintf('         segmentonneumann_prog (flux): (%i)',length(md.segmentonneumann_prog)));
+disp(sprintf('         neumannvalues_prog [N]: (%i)',length(md.neumannvalues_prog)));
+disp(sprintf('         segmentonneumann_prog2 (thickness gradient): (%i)',length(md.segmentonneumann_prog2)));
+disp(sprintf('         neumannvalues_prog2 [N]: (%i)',length(md.neumannvalues_prog2)));
+
+disp(sprintf('      thermal:'));
+disp(sprintf('         gridondirichlet_thermal: (%i)',length(md.gridondirichlet_thermal)));
+disp(sprintf('         dirichletvalues_thermal [K]: (%i)',length(md.dirichletvalues_thermal)));
+disp(sprintf('         melting [m/a]: (%i)',length(md.melting)));
Index: /issm/trunk/src/m/classes/public/displaycontrol.m
===================================================================
--- /issm/trunk/src/m/classes/public/displaycontrol.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displaycontrol.m	(revision 1)
@@ -0,0 +1,22 @@
+function displaycontrol(md)
+%DISPLAYCONTROL - display control parameters
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays control parameters from model md, 
+%   only if requested.
+%
+%   Usage:
+%      displaycontrol(md)
+
+disp(sprintf('      ''%s''','control'));
+disp(sprintf('         control_type: %s (control type, ex: ''drag'', or ''B'')',md.control_type));
+disp(sprintf('         fit: (%i)      (''absolute: 0'', ''relative: 1'', or ''logarithmic: 2''. default is ''absolute: 0'', for each optimization steps)',length(md.fit)));
+disp(sprintf('         meanvel: %g      (velocity scaling factor when evaluating relative or logarithmic misfit)',md.meanvel));
+disp(sprintf('         epsvel: %g      ( for relative fit, avoids misfit becoming infinity, for logarithmic fit, threshold for velocity)',md.epsvel));
+disp(sprintf('         nsteps: %i      (number of optimization searches)',md.nsteps));
+disp(sprintf('         optscal: (%i %i)      (scaling factor on gradient direction during optimization, for each optimization step)',size(md.optscal,1),size(md.optscal,2)));
+disp(sprintf('         mincontrolconstraint: %g      (minimum contraint for the controlled parameters)',md.mincontrolconstraint));
+disp(sprintf('         maxcontrolconstraint: %g      (maximum contraint for the controlled parameters)',md.maxcontrolconstraint));
+disp(sprintf('         maxiter: (%i)      (maximum iterations during each optimization step)',length(md.maxiter)));
+disp(sprintf('         tolx: %f      (minimum tolerance which will stop one optimization search)',md.tolx));
+disp(sprintf('         plot: %i      (visualization of the results of each iteration yes -> 1 no -> 0. Default is 1)',md.plot));
Index: /issm/trunk/src/m/classes/public/displayexppar.m
===================================================================
--- /issm/trunk/src/m/classes/public/displayexppar.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displayexppar.m	(revision 1)
@@ -0,0 +1,17 @@
+function displayoutlines(md);
+%DISPLAYOUTLINES - display outline information
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays outline information from model md, 
+%   only if requested.
+%
+%   Usage:
+%      displayoutline(md)
+
+disp(sprintf('   Outlines:'));
+if isnan(md.domainoutline), disp(sprintf('      domainoutline: N/A')); else disp(sprintf('      domainoutline: not displayed (can be accessed by typing md.domainoutline)'));end
+if isnan(md.riftoutline), disp(sprintf('      riftoutline: N/A')); else disp(sprintf('      riftoutline: not displayed (can be accessed by typing md.riftoutline)'));end
+if isnan(md.iceshelfoutline), disp(sprintf('      iceshelfoutline: N/A')); else disp(sprintf('      iceshelfoutline: not displayed (can be accessed by typing md.iceshelfoutline)'));end
+if isnan(md.icesheetoutline), disp(sprintf('      icesheetoutline: N/A')); else disp(sprintf('      icesheetoutline: not displayed (can be accessed by typing md.icesheetoutline)'));end
+disp(sprintf('   Model files:'));
+if isnan(md.parameterfile), disp(sprintf('      parameterfile: N/A')); else disp(sprintf('      parameterfile: not displayed (can be accessed by typing md.parameterfile)'));end
Index: /issm/trunk/src/m/classes/public/displaymaterials.m
===================================================================
--- /issm/trunk/src/m/classes/public/displaymaterials.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displaymaterials.m	(revision 1)
@@ -0,0 +1,22 @@
+function displaymaterials(md)
+%DISPLAYCONTROL - display material parameters
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays material parameters from model md, 
+%   only if requested.
+%
+%   Usage:
+%      displaymaterials(md)
+
+disp(sprintf('   Materials:'));
+disp(sprintf('      rho_ice: %g [kg/m^3]',md.rho_ice));
+disp(sprintf('      rho_water: %g [kg/m^3]',md.rho_water));
+if isempty(md.B), disp(sprintf('      B: N/A (flow law parameter)')); else disp(sprintf('      B: (%i) (flow law parameter [Pa/s^(1/n)])',length(md.B))); end
+if isempty(md.n), disp(sprintf('      n: N/A (flow law coefficient)')); else disp(sprintf('      n: (%i) (flow law coefficient)',length(md.n))); end
+disp(sprintf('      heatcapacity: %g [J/kg/K]',md.heatcapacity));
+disp(sprintf('      thermalconductivity: %g [W/m/K]',md.thermalconductivity));
+disp(sprintf('      meltingpoint: %g [K] (melting point of ice at 1atm in K)',md.meltingpoint));
+disp(sprintf('      latentheat: %g [J/kg] (latent heat of fusion)',md.latentheat));
+disp(sprintf('      beta: %g [K/Pa]',md.beta));
+disp(sprintf('      mixed_layer_capacity: %g [W/kg/K]',md.mixed_layer_capacity));
+disp(sprintf('      thermal_exchange_velocity: %g [m/s]',md.thermal_exchange_velocity));
Index: /issm/trunk/src/m/classes/public/displaymesh.m
===================================================================
--- /issm/trunk/src/m/classes/public/displaymesh.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displaymesh.m	(revision 1)
@@ -0,0 +1,56 @@
+function displaymesh(md)
+%DISPLAYMESH - display mesh information
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays mesh information from model md, 
+%   only if requested.
+%
+%   Usage:
+%      displaymesh(md)
+
+disp(sprintf('   Mesh:')); 
+disp(sprintf('      type: %s',md.type));
+
+if strcmpi(md.type,'2d'),
+	disp(sprintf('      numberofelements: %i',md.numberofelements));
+	disp(sprintf('      numberofgrids: %i',md.numberofgrids)); 
+	if ~isnan(md.dof),
+		disp(sprintf('      number of dofs: %i',md.dof)); 
+	end
+	disp(sprintf('      elements: (%i-%i) (index into (x,y,z), coordinates of the grids)',md.numberofelements,size(md.elements,2))); 
+	disp(sprintf('      elements_type: (%i) (type of elements, according to number of grids per element)',md.numberofelements));
+	disp(sprintf('      x: (%i) (grid x coordinates)',md.numberofgrids));
+	disp(sprintf('      y: (%i) (grid y coordinates)',md.numberofgrids));
+	disp(sprintf('      z: (%i) (grid z coordinates)',md.numberofgrids));
+elseif strcmpi(md.type,'3d'),
+
+	disp(sprintf('      Original 2d mesh:'));
+	disp(sprintf('         numberofelements2d: %i',md.numberofelements2d));
+	disp(sprintf('         numberofgrids2d: %i',md.numberofgrids2d)); 
+	disp(sprintf('         elements2d: (%i-%i) (index into (x,y,z), coordinates of the grids)',md.numberofelements2d,size(md.elements2d,2))); 
+	disp(sprintf('         elements_type2d: (%i) (element types, according to number of grids)',md.numberofelements2d));
+	disp(sprintf('         x2d: (%i) (grid x coordinates)',md.numberofgrids2d));
+	disp(sprintf('         y2d: (%i) (grid y coordinates)',md.numberofgrids2d));
+	disp(sprintf('         z2d: (%i) (grid z coordinates)',md.numberofgrids2d));
+
+	disp(sprintf('      Extruded 3d mesh: '));
+	disp(sprintf('         numberofelements: %i',md.numberofelements));
+	disp(sprintf('         numberofgrids: %i',md.numberofgrids)); 
+	if ~isnan(md.dof),
+		disp(sprintf('      number of dofs: %i',md.dof)); 
+	end
+	disp(sprintf('         elements: (%i-%i) (index into (x,y,z), coordinates of the grids)',md.numberofelements,size(md.elements,2))); 
+	disp(sprintf('         elements_type: (%i) (element types, according to number of grids)',md.numberofelements));
+	disp(sprintf('         x: (%i) (grid x coordinates)',md.numberofgrids));
+	disp(sprintf('         y: (%i) (grid y coordinates)',md.numberofgrids));
+	disp(sprintf('         z: (%i) (grid z coordinates)',md.numberofgrids));
+	disp(sprintf('         numlayers: (%i) (number of extrusion layers)',md.numlayers));
+	disp(sprintf('         gridoncollapsed: (%i)',md.numberofgrids));
+	disp(sprintf('         gridonnoncollapsed: (%i)',md.numberofgrids));
+	
+	disp(sprintf('      Penalties: (%i-%i) (penalties applied to connect 2d and 3d parts of 2d-3d mesh)',size(md.penalties,1),size(md.penalties,2)));
+else
+	error('only ''2d'' and ''3d'' are allowed for model type');
+end
+
+
Index: /issm/trunk/src/m/classes/public/displayobservations.m
===================================================================
--- /issm/trunk/src/m/classes/public/displayobservations.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displayobservations.m	(revision 1)
@@ -0,0 +1,17 @@
+function displayobservations(md)
+%DISPLAYOBSERVATIONS - display observations information
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays observations information from model md, 
+%   only if requested.
+%
+%   Usage:
+%      displayobservations(md)
+
+disp(sprintf('   Observations:'));
+disp(sprintf('      vx_obs [m/a]: (%i)',length(md.vx_obs)));
+disp(sprintf('      vy_obs [m/a]: (%i)',length(md.vy_obs)));
+disp(sprintf('      vel_obs [m/a]: (%i)',length(md.vel_obs)));
+disp(sprintf('      accumulation [m/a]: (%i)',length(md.accumulation)));
+disp(sprintf('      observed_temperature [K]: (%i)',length(md.observed_temperature)));
+disp(sprintf('      geothermalflux [W/m^2]: (%i)',length(md.geothermalflux)));
Index: /issm/trunk/src/m/classes/public/displayparallel.m
===================================================================
--- /issm/trunk/src/m/classes/public/displayparallel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displayparallel.m	(revision 1)
@@ -0,0 +1,23 @@
+function displayparallel(md)
+%DISPLAYPARALLEL - display parallel computation parameters
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays all fields related to
+%   parallel computation from model md, only if requested.
+%
+%   Usage:
+%      displayparallel(md)
+
+disp(sprintf('      ''%s''','parallelisation'));
+disp(sprintf('         cluster: %s      (set to ''cluster_name'' to run in cluster, ''none'' to run serially)',md.cluster));
+disp(sprintf('         np: %i      (number of CPUS requested on cluster)',md.np));
+disp(sprintf('         exclusive: %i      (set to 1 if CPUS used are not to be shared with other users, 0 otherwise)',md.exclusive));
+disp(sprintf('         time: %i      (amount of time requested on cluster)',md.time)); 
+disp(sprintf('         alloc_cleanup: %i      (allocation cleanup before starting a job, default 1)',md.alloc_cleanup)); 
+disp(sprintf('         waitonlock: %i      (wait for batch results 1, or return 0. default is to return )',md.waitonlock)); 
+disp(sprintf('         queue: %s      (special queue name on cluster? default is '''')',md.queue));
+disp(sprintf('      ''%s''','solver options'));
+disp(sprintf('         %s','''ice'''));
+disp(sprintf('            solver_type: %s      (solver type for Ice: ''lu'' or ''cholesky'')',md.solver_type));
+disp(sprintf('         %s','''cielo'''));
+disp(sprintf('            solverstring: %s (solver string for Petsc. See solversetto... routines. Default is asm)',md.solverstring)); 
Index: /issm/trunk/src/m/classes/public/displayparameters.m
===================================================================
--- /issm/trunk/src/m/classes/public/displayparameters.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displayparameters.m	(revision 1)
@@ -0,0 +1,31 @@
+function displayparameters(md)
+%DISPLAYPARAMETERS - display parameters
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays parameters from model md, 
+%   only if requested.
+%
+%   Usage:
+%      displayparameters(md)
+
+disp(sprintf('   Parameters:'));
+if isempty(md.surface), disp(sprintf('      surface: N/A')); else disp(sprintf('      surface [m]: (%i)',length(md.surface))); end
+if isempty(md.thickness), disp(sprintf('      thickness: N/A')); else disp(sprintf('      thickness [m]: (%i)',length(md.thickness))); end
+if isempty(md.new_thickness), disp(sprintf('      new_thickness: N/A')); else disp(sprintf('      new_thickness [m]: (%i)',length(md.new_thickness))); end
+if isempty(md.bed), disp(sprintf('      bed: N/A')); else disp(sprintf('      bed [m]: (%i)',length(md.bed))); end
+if isempty(md.firn_layer), disp(sprintf('      firn_layer: N/A')); else disp(sprintf('      firn_layer [m]: (%i)',length(md.firn_layer))); end
+disp(sprintf('      gridonboundary: (%i)',length(md.gridonboundary)));
+disp(sprintf('      elementoniceshelf: (%i)',length(md.elementoniceshelf)));
+disp(sprintf('      gridoniceshelf: (%i)',length(md.gridoniceshelf)));
+disp(sprintf('      elementonicesheet: (%i)',length(md.elementonicesheet)));
+disp(sprintf('      gridonicesheet: (%i)',length(md.gridonicesheet)));
+if strcmpi(md.type,'3d'), disp(sprintf('      elementonbed: (%i)',length(md.elementonbed))); end
+if strcmpi(md.type,'3d'), disp(sprintf('      elementonsurface: (%i)',length(md.elementonsurface))); end
+if strcmpi(md.type,'3d'), disp(sprintf('      gridonbed: (%i)',length(md.gridonbed))); end
+if strcmpi(md.type,'3d'), disp(sprintf('      gridonsurface: (%i)',length(md.gridonsurface))); end
+disp(sprintf('      g: %g [m/s^2]',md.g));
+disp(sprintf('      ''Friction parameters (Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p)'''));
+if isempty(md.drag), disp(sprintf('         drag: N/A')); else disp(sprintf('         drag: (%i)',length(md.drag))); end
+disp(sprintf('         drag_type: %i (0: none, 1:plastic, 2:viscous):',md.drag_type));
+if isempty(md.p), disp(sprintf('         p: N/A')); else disp(sprintf('         p: (%i)',length(md.p))); end
+if isempty(md.q), disp(sprintf('         q: N/A')); else disp(sprintf('         q: (%i)',length(md.q))); end
Index: /issm/trunk/src/m/classes/public/displayqmu.m
===================================================================
--- /issm/trunk/src/m/classes/public/displayqmu.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displayqmu.m	(revision 1)
@@ -0,0 +1,37 @@
+function displayqmu(md)
+%DISPLAYQMU - display qmu computation parameters
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays all fields related to
+%   qmu computation from model md, only if requested.
+%
+%   Usage:
+%      displayqmu(md)
+
+disp(sprintf('      ''%s''','qmu using Dakota'));
+disp(sprintf('         variables:  (arrays of each variable class)'));
+fnames=fieldnames(md.variables);
+for i=1:length(fnames);
+    disp(sprintf('            %s    [%ix%i]    ''%s''',...
+        fnames{i},size(md.variables.(fnames{i})),class(md.variables.(fnames{i}))));
+end
+disp(sprintf('         responses:  (arrays of each response class)'));
+fnames=fieldnames(md.responses);
+for i=1:length(fnames);
+    disp(sprintf('            %s    [%ix%i]    ''%s''',...
+        fnames{i},size(md.responses.(fnames{i})),class(md.responses.(fnames{i}))));
+end
+disp(sprintf('         dakotaresults: 1x%i   {dvar,rfunc,scm,pcm,srcm,prcm}',length(md.dakotaresults)));
+if isempty(md.dakotain), disp(sprintf('         dakotain: N/A')); else disp(sprintf('         dakotain: not displayed (can be accessed by typing md.dakotain)'));end
+if isempty(md.dakotaout), disp(sprintf('         dakotaout: N/A')); else disp(sprintf('         dakotaout: not displayed (can be accessed by typing md.dakotaout)'));end
+if isempty(md.dakotadat), disp(sprintf('         dakotadat: N/A')); else disp(sprintf('         dakotadat: not displayed (can be accessed by typing md.dakotadat)'));end
+disp(sprintf('         method: ''%s'' (''local reliability'' or ''sampling'')',md.method));
+disp(sprintf('         seed: %g (random seed number)',md.seed));
+disp(sprintf('         samples: %i (number of samples)',md.samples));
+disp(sprintf('         sample_type: ''%s'' (type of sampling, ''random'' or ''lhs'')',md.sample_type));
+disp(sprintf('         interval_type: ''%s'' (FD ''forward'' or ''central'')',md.interval_type));
+disp(sprintf('         fd_gradient_step_size: %g (FD gradient step size, default= .001) ',md.fd_gradient_step_size));
+disp(sprintf('         evaluation_concurrency: %i (evaluation concurrency level)',md.evaluation_concurrency));
+disp(sprintf('         npart: %i (number of partitions for semi-descrete qmu)',md.npart));
+disp(sprintf('         analysis_driver    : ''%s'' (''matlab'' or name of driver for Dakota analysis)',md.analysis_driver));
+disp(sprintf('         analysis_components: ''%s'' (Matlab script file for Matlab driver)',md.analysis_components));
Index: /issm/trunk/src/m/classes/public/displayresults.m
===================================================================
--- /issm/trunk/src/m/classes/public/displayresults.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displayresults.m	(revision 1)
@@ -0,0 +1,68 @@
+function displayresults(md)
+%DISPLAYRESULTS - display results
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays results from model md, 
+%   only if requested.
+%
+%   Usage:
+%      displayresults(md)
+
+disp(sprintf('   Results:'));
+disp(sprintf('      ''%s''','diagnostic'));
+if isempty(md.vx), disp(sprintf('         vx: N/A')); else disp(sprintf('         vx [m/a]: (%i)',length(md.vx))); end
+if isempty(md.vy), disp(sprintf('         vy: N/A')); else disp(sprintf('         vy [m/a]: (%i)',length(md.vy))); end
+if isempty(md.vz), disp(sprintf('         vz: N/A')); else disp(sprintf('         vz [m/a]: (%i)',length(md.vz))); end
+if isempty(md.vel), disp(sprintf('         vel: N/A')); else disp(sprintf('         vel [m/a]: (%i)',length(md.vel))); end
+if isempty(md.pressure), disp(sprintf('         pressure: N/A')); else disp(sprintf('         pressure [Pa]: (%i)',length(md.pressure))); end
+if isempty(md.viscousheating), disp(sprintf('         viscousheating: N/A')); else disp(sprintf('         viscousheating [Pa]: (%i)',length(md.viscousheating))); end
+if ~isstruct(md.stress), disp(sprintf('         stress: N/A')); 
+else 
+	disp(sprintf('         stress [Pa]:'))
+	struct_display(md.stress,'         ');
+end
+if ~isstruct(md.deviatoricstress), disp(sprintf('         deviatoricstress: N/A')); 
+else 
+	disp(sprintf('         deviatoricstress [Pa]:'))
+	struct_display(md.deviatoricstress,'         ');
+end
+if ~isstruct(md.strainrate), disp(sprintf('         strainrate: N/A')); 
+else 
+        disp(sprintf('         strainrate [1/a]:'))
+        struct_display(md.strainrate,'         ');
+end
+
+disp(sprintf('      ''%s''','transient'));
+if ~isstruct(md.transient_results), disp(sprintf('         transient_results: N/A')); 
+else 
+	struct_display(md.transient_results,'         ');
+end
+
+disp(sprintf('      ''%s''','control method'));
+if isempty(md.cont_vx), disp(sprintf('         cont_vx: N/A')); else disp(sprintf('         cont_vx [m/a]: (%i)',length(md.cont_vx))); end
+if isempty(md.cont_vy), disp(sprintf('         cont_vy: N/A')); else disp(sprintf('         cont_vy [m/a]: (%i)',length(md.cont_vy))); end
+if isempty(md.cont_vz), disp(sprintf('         cont_vz: N/A')); else disp(sprintf('         cont_vz [m/a]: (%i)',length(md.cont_vz))); end
+if isempty(md.cont_vel), disp(sprintf('         cont_vel: N/A')); else disp(sprintf('         cont_vel [m/a]: (%i)',length(md.cont_vel))); end
+if isempty(md.cont_parameters), disp(sprintf('         cont_parameters: N/A')); else disp(sprintf('         cont_parameters: (%i)',length(md.cont_parameters))); end
+if isempty(md.cont_J), disp(sprintf('         cont_J: N/A')); else disp(sprintf('         cont_J: (%i)',length(md.cont_J))); end
+
+	
+disp(sprintf('      ''%s''','thermal'));
+if isempty(md.temperature), disp(sprintf('         temperature: N/A')); else disp(sprintf('         temperature [K]: (%i)',length(md.temperature))); end
+if ~isstruct(md.thermaltransient_results), disp(sprintf('         thermaltransient_results: N/A')); 
+else 
+	struct_display(md.thermaltransient_results,'         ');
+end
+
+disp(sprintf('      ''%s''','mesh2grid'));
+if isempty(md.mesh2grid_results) | isnan(md.mesh2grid_results), disp(sprintf('         mesh2grid_results: N/A')); else disp(sprintf('         mesh2grid_results: (%i)',length(md.mesh2grid_results))); end
+
+end
+
+function struct_display(structure,offset)
+structure_fields=fields(structure);
+for i=1:length(structure_fields),
+	disp(sprintf('%s',[offset '   ' structure_fields{i} ': (' num2str(size( eval([' structure.' structure_fields{i}]),1))  ')' ]));
+end
+
+end
Index: /issm/trunk/src/m/classes/public/displaysolutionparameters.m
===================================================================
--- /issm/trunk/src/m/classes/public/displaysolutionparameters.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/displaysolutionparameters.m	(revision 1)
@@ -0,0 +1,124 @@
+function displaysolutionparameters(md)
+%DISPLAYSOLUTIONPARAMETERS - display solution parameters
+%
+%   To avoid clobbering display.m with every field from model md, 
+%   we create this routine that displays the solution parameters
+%   from model md, only if requested.
+%
+%   Usage:
+%      displaysolutionparameters(md)
+
+disp(sprintf('   Solution parameters:'));
+disp(sprintf('      ''%s''','statics'));
+disp(sprintf('         %s','Newton convergence criteria'));
+disp(sprintf('            eps_rel: %g      (velocity relative convergence criterion)',md.eps_rel));
+disp(sprintf('            eps_abs: %g      (velocity absolute convergence criterion [m/yr], NaN -> no absolute criterion)',md.eps_abs));
+disp(sprintf('            viscosity_overshoot: %g      (over-shooting constant new=new+C*(new-old))',md.viscosity_overshoot));
+disp(sprintf('         penalty_offset: %g      (offset used by penalties: penalty = Kmax*10^offset)',md.penalty_offset));
+disp(sprintf('         penalty_melting: %g      (penalty used to keep T<Tpmp)',md.penalty_melting));
+disp(sprintf('         penalty_lock: %g      (counter used to lock penalties that zig zag)',md.penalty_lock));
+disp(sprintf('         lowmem: %i      (Set to 1 if you are running low on cluster memory)',md.lowmem));
+disp(sprintf('         sparsity: %g      (matrix sparsity. Set to .001 for < 1M dof, .0001 for 5M dof, and .00001 for > 10M dof',md.sparsity));
+disp(sprintf('         connectivity: %i      (element connectivity)',md.connectivity)); 
+disp(sprintf('         acceleration: %i      (accelerate MacAyeal''s formulation? yes -> 1, no -> 0 )',md.acceleration));
+disp(sprintf('         debug: %i      (output debug statements when possible yes-> 1, no -> 0. Default is 1',md.debug));
+disp(sprintf('         element_debug: %i      (output debug statements for elementswhen possible yes-> 1, no -> 0. Default is 0',md.element_debug));
+disp(sprintf('         element_debugid: %i      (if element_debug on, id of element for which to output messages',md.element_debugid));
+disp(sprintf('         debug: %i      (output debug statements when possible yes-> 1, no -> 0. Default is 1'));
+disp(sprintf('      ''%s''','transient'));
+disp(sprintf('         dt: %g ( time step in years)',md.dt/md.yts));
+disp(sprintf('         ndt: %g ( time span in years)',md.ndt/md.yts));
+disp(sprintf('         artificial_diffusivity: %i (yes->1, no->0)',md.artificial_diffusivity));
+disp(sprintf('         minh: %g (minimum thickness to avoid stiffness singularity)',md.minh));
+disp(sprintf('         timestepping: %i ( adptative time stepping implemented - default to 0)',md.timestepping));
+disp(sprintf('         deltaH: %g ( minimum thickness difference between two time steps)',md.deltaH));
+disp(sprintf('         DeltaH: %g ( maximum thickness difference between two time steps)',md.DeltaH));
+disp(sprintf('         deltaT: %g ( minimum temperature difference between two time steps)',md.deltaT));
+disp(sprintf('         DeltaT: %g ( maximum temperature difference between two time steps)',md.DeltaT));
+disp(sprintf('         timeacc: %g ( multiplier to time step when time stepping increases time step)',md.timeacc));
+disp(sprintf('         timedec: %g ( multiplier to time step when time stepping decresaes time step)',md.timedec));
+disp(sprintf('      ''%s''','control'));
+
+%control type
+disp(sprintf('         control_type: %s (control type, ex: ''drag'', or ''B'')',md.control_type));
+disp(sprintf('         fit: (%g)      ( 0 -> absolute, 1 -> relative, 2 -> logarithmic. default is absolute)',length(md.fit)));
+disp(sprintf('         meanvel: %g      (velocity scaling factor when evaluating relative or logarithmic misfit)',md.meanvel));
+disp(sprintf('         epsvel: %g      ( for relative fit, avoids misfit becoming infinity, for logarithmic fit, threshold for velocity)',md.epsvel));
+disp(sprintf('         nsteps: %i      (number of optimization searches)',md.nsteps));
+disp(sprintf('         optscal: (%i %i)      (scaling factor on gradient direction during optimization, for each optimization step)',size(md.optscal,1),size(md.optscal,2)));
+disp(sprintf('         mincontrolconstraint: %f      (minimum contraint for the controlled parameters, NaN -> no constraint)',md.mincontrolconstraint));
+disp(sprintf('         maxcontrolconstraint: %f      (maximum contraint for the controlled parameters, NaN -> no constraint)',md.maxcontrolconstraint));
+disp(sprintf('         maxiter: (%i)      (maximum iterations during each optimization step)',length(md.maxiter)));
+disp(sprintf('         tolx: %f      (minimum tolerance which will stop one optimization search)',md.tolx));
+disp(sprintf('         plot: %i      (visualization of the results of each iteration yes -> 1 no -> 0. Default is 1)\n',md.plot));
+
+
+%mesh
+disp(sprintf('      ''%s''','mesh'));
+disp(sprintf('         mesh_domainoutline: %s      (domain outlines)',md.mesh_domainoutline));
+disp(sprintf('         mesh_riftoutline: %s      (rift outlines)',md.mesh_riftoutline));
+disp(sprintf('         mesh_resolution: (%g)      (mesh resolutoin)\n',md.mesh_resolution));
+
+%mesh2grid type
+disp(sprintf('      ''%s''','mesh2grid'));
+mesh2grid_string='';
+for i=1:length(md.mesh2grid_parameters),
+	parameter=md.mesh2grid_parameters{i};
+	%check this parameter is a field from model! 
+	if ~isfield(struct(md),parameter),
+		error('displaysolutionparameters error message: one of the mesh2grid type parameters does not exist!');
+	end
+	mesh2grid_string=[mesh2grid_string parameter ' and '];
+end
+mesh2grid_string=mesh2grid_string(1:length(mesh2grid_string)-5);
+disp(sprintf('         mesh2grid_parameters: %s %s',mesh2grid_string,'(list of parameters for which mesh 2 grid interpolation is carried out; ex: {''drag''}, or {''drag'',''B''})'));
+
+%mesh2grid interpolation
+mesh2grid_interpstring='';
+for i=1:length(md.mesh2grid_interpolation),
+	interpolation=md.mesh2grid_interpolation{i};
+	mesh2grid_interpstring=[mesh2grid_interpstring interpolation ' and '];
+end
+mesh2grid_interpstring=mesh2grid_interpstring(1:length(mesh2grid_interpstring)-5);
+disp(sprintf('         mesh2grid_interpolation: %s %s',mesh2grid_interpstring,'(list of interpolation (''node'' or ''element'') for each parameter ex: {''node''}, or {''node'',''element''})'));
+
+%mesh2grid filter
+mesh2grid_filterstring='';
+for i=1:length(md.mesh2grid_filter),
+	filter=md.mesh2grid_filter{i};
+	mesh2grid_filterstring=[mesh2grid_filterstring filter ' and '];
+end
+mesh2grid_filterstring=mesh2grid_filterstring(1:length(mesh2grid_filterstring)-5);
+disp(sprintf('         mesh2grid_filter: %s %s',mesh2grid_filterstring,'(list of filter (''average'' or ''nearest'') for each parameter ex: {''average''}, or {''average'',''nearest''})'));
+
+
+disp(sprintf('         mesh2grid_cornereast: %g ( corner east of square grid)',md.mesh2grid_cornereast));
+disp(sprintf('         mesh2grid_cornernorth: %g ( corner north of square grid)',md.mesh2grid_cornernorth));
+disp(sprintf('         mesh2grid_xposting: %g (x  posting of grid (in m))',md.mesh2grid_xposting));
+disp(sprintf('         mesh2grid_yposting: %g (y  posting of grid (in m))',md.mesh2grid_yposting));
+disp(sprintf('         mesh2grid_nlines: %g ( number of grid lines)',md.mesh2grid_nlines));
+disp(sprintf('         mesh2grid_ncolumns: %g ( number of grid columns)',md.mesh2grid_ncolumns));
+disp(sprintf('         mesh2grid_windowsize: %g ( size of filter )\n',md.mesh2grid_windowsize));
+
+%parallelisation
+md.parallel
+
+%parameteroutput type
+parameteroutput_string='';
+for i=1:length(md.parameteroutput),
+	parameter=md.parameteroutput{i};
+	%check this parameter is a field from model! 
+	if ~isfield(struct(md),parameter),
+		error('displaysolutionparameters error message: one of the parameteroutput type parameters does not exist!');
+	end
+	parameteroutput_string=[parameteroutput_string parameter ' and '];
+end
+parameteroutput_string=parameteroutput_string(1:length(parameteroutput_string)-5);
+
+disp(sprintf('      ''%s''','output'));
+disp(sprintf('         parameteroutput: %s %s',parameteroutput_string,...
+                       '(list of output parameters recovered in the solution sequences: ex: {''viscousheating''}, or {''viscousheating'',''deviatoricstress''})'));
+
+%qmu
+disp(sprintf('\n'));
+displayqmu(md);
Index: /issm/trunk/src/m/classes/public/domaintomesh.m
===================================================================
--- /issm/trunk/src/m/classes/public/domaintomesh.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/domaintomesh.m	(revision 1)
@@ -0,0 +1,36 @@
+function interp=domaintomesh(md,domainname,interptype)
+%DOMAINTOMESH - flag elements or nodes located inside an Argus contour
+%
+%   from an Argus domain outline, and a @model object, figure out
+%   which elements (interptype='element') or which grid (interptype='node')
+%   is inside the domain.
+%
+%   Usage:
+%      interp=domaintomesh(md,domainname,interptype)
+%
+%   Example:
+%      flag=domaintomesh(md,'Domain.exp','node');
+%
+%   See also: ARGUSCONTOURTOMESH
+
+%some checks on list of arguments
+if ((nargin~=3) | (nargout~=1)),
+	domaintomeshusage();
+	error('domaintomesh error message');
+end
+if ((~ischar(domainname)) | (~ischar(interptype))  )
+	domaintomeshusage();
+	error('domaintomesh error message');
+end
+
+if ( (~strcmp(interptype,'node')) & (~strcmp(interptype,'element')) )
+	domaintomeshusage();
+	error('domaintomesh error message');
+end
+
+[rinterp]=ArgusContourToMesh(md.elements,md.x,md.y,expread(domainname,1),interptype,1);
+interp=IMdb('select matrix from rinterp');
+IMdb('drop rinterp');
+
+function domaintomeshusage(),
+disp('usage: md=domaintomesh(md,domainname,interptype')
Index: /issm/trunk/src/m/classes/public/drivingstress.m
===================================================================
--- /issm/trunk/src/m/classes/public/drivingstress.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/drivingstress.m	(revision 1)
@@ -0,0 +1,18 @@
+function [px,py,pmag]=drivingstress(md)
+%DRIVINGSTRESS -  evaluates the driving stress
+%
+%   The driving stress is computed according to the following formula: 
+%   driving stress= rho_ice*g*H*slope
+%
+%   Usage:
+%      [Fx,Fy,Fmag]=drivingstress(md)
+
+%Get slope
+[sx,sy,s]=slope(md);
+
+%Average thickness over elements
+thickness_bar=(md.thickness(md.elements(:,1))+md.thickness(md.elements(:,2))+md.thickness(md.elements(:,3)))/3;
+
+px=md.rho_ice*md.g*thickness_bar.*sx;
+py=md.rho_ice*md.g*thickness_bar.*sy;
+pmag=sqrt(px.^2+py.^2);
Index: /issm/trunk/src/m/classes/public/export.m
===================================================================
--- /issm/trunk/src/m/classes/public/export.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/export.m	(revision 1)
@@ -0,0 +1,16 @@
+function export_results=export(md,results, xlower,ylower,xposting,yposting,xsize,ysize)
+%EXPORT - exports results from a mesh to a regular grid
+%
+%   this routine exports results from a mesh to a regular grid 
+%   of postings (xposting,yposint) with coordinates for lower left 
+%   corner (xlower,ylower), and of size (xsize,ysize) 
+%
+%   Usage:
+%      export_results=export(md,results, xlower,ylower,xposting,yposting,xsize,ysize)
+
+%Build x_m and y_m
+x_m=(xlower):xposting:(xlower+xposting*(xsize-1));
+y_m=(ylower):yposting:(ylower+yposting*(ysize-1));
+
+[X,Y]=meshgrid(x_m,y_m);
+export_results=griddata(md.x,md.y,results,X,Y);
Index: /issm/trunk/src/m/classes/public/extrude.m
===================================================================
--- /issm/trunk/src/m/classes/public/extrude.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/extrude.m	(revision 1)
@@ -0,0 +1,198 @@
+function md=extrude(md,numlayers,extrusionexponent)
+%EXTRUDE - vertically extrude a 2d mesh
+%
+%   vertically extrude a 2d mesh and create corresponding 3d mesh following the extrusionexponent, 
+%   the vertical distribution follows a polynomial law:');
+%     extrusionexponent>1    refinement at the base');
+%   0<extrusionexponent<1    refinement at the surface');
+%     extrusionexponent=1    linear extrusion');
+%
+%   Usage:
+%      md=extrude(md,numlayers,extrusionexponent);
+%
+%   Example:
+%      md=extrude(md,8,3);
+%
+%   See also: MODELEXTRACT, COLLAPSE
+
+%some checks on list of arguments
+if ((nargin~=3) | (nargout~=1)),
+	extrudeusage();
+	error('extrude error message');
+end
+
+if md.counter<3,
+	extrudeusage();
+	error('only fully parameterized 2d models can be extruded');
+end
+
+if md.counter>=4,
+	error('This model has already been extruded!','s');
+end
+
+if numlayers<2,
+	extrudeusage();
+	error('number of layers should be at least 2');
+end
+
+if extrusionexponent<0,
+	extrudeusage();
+	error('extrusionexponent must be >0');
+end
+
+%Extrude the mesh
+%Initialize with the 2d mesh
+x3d=md.x; 
+y3d=md.y;
+z3d=md.bed;  %the lower grid is on the bed
+thickness3d=md.thickness; %thickness and bed for these grids
+bed3d=md.bed;
+%Create the new layers
+for i=2:numlayers,
+	x3d=[x3d; md.x]; %build the grids of the other layers
+	y3d=[y3d; md.y];
+	z3d=[z3d; bed3d+thickness3d*(i/numlayers)^extrusionexponent]; %grids are distributed between bed and surface accordingly to the given exponent
+end
+number_grids3d=size(x3d,1); %number of 3d grids for the non extruded part of the mesh
+
+%Extrude elements 
+elements3d=[];
+for i=1:numlayers-1,
+	elements3d=[elements3d;[md.elements+(i-1)*md.numberofgrids md.elements+i*md.numberofgrids]]; %Create the elements of the 3d mesh for the non extruded part
+end
+number_el3d=size(elements3d,1); %number of 3d grids for the non extruded part of the mesh
+
+%Keep a trace of lower and upper grids
+lowergrids=NaN*ones(number_grids3d,1);
+uppergrids=NaN*ones(number_grids3d,1);
+lowergrids(md.numberofgrids+1:end)=1:(numlayers-1)*md.numberofgrids;
+uppergrids(1:(numlayers-1)*md.numberofgrids)=md.numberofgrids+1:number_grids3d;
+md.lowergrids=lowergrids;
+md.uppergrids=uppergrids;
+
+%Save old mesh 
+md.x2d=md.x;
+md.y2d=md.y;
+md.z2d=md.z;
+md.elements2d=md.elements;
+md.elements_type2d=md.elements_type;
+md.numberofelements2d=md.numberofelements;
+md.numberofgrids2d=md.numberofgrids;
+
+%Update mesh type
+md.type='3d';
+
+%Build global 3d mesh 
+md.elements=elements3d;
+md.x=x3d;
+md.y=y3d;
+md.z=z3d;
+md.numberofelements=number_el3d;
+md.numberofgrids=number_grids3d;
+md.numlayers=numlayers;
+
+%Ok, now deal with the other fields from the 2d mesh:
+
+%drag is limited to grids that are on the bedrock.
+md.drag=project3d(md,md.drag,'node',1);
+
+%p and q (same deal, except for element that are on the bedrock: )
+md.p=project3d(md,md.p,'element');
+md.q=project3d(md,md.q,'element');
+
+%observations
+md.vx_obs=project3d(md,md.vx_obs,'node',md.numlayers);
+md.vy_obs=project3d(md,md.vy_obs,'node',md.numlayers);
+md.vel_obs=project3d(md,md.vel_obs,'node',md.numlayers);
+md.accumulation=project3d(md,md.accumulation,'node',md.numlayers);
+md.firn_layer=project3d(md,md.firn_layer,'node',md.numlayers);
+
+%results
+if ~isnan(md.vx),md.vx=project3d(md,md.vx,'node');end;
+if ~isnan(md.vy),md.vy=project3d(md,md.vy,'node');end;
+if ~isnan(md.vz),md.vz=project3d(md,md.vz,'node');end;
+if ~isnan(md.vel),md.vel=project3d(md,md.vel,'node');end;
+if ~isnan(md.surface_slopex),md.surface_slopex=project3d(md,md.surface_slopex,'node');end;
+if ~isnan(md.surface_slopey),md.surface_slopey=project3d(md,md.surface_slopey,'node');end;
+if ~isnan(md.bed_slopex),md.bed_slopex=project3d(md,md.bed_slopex,'node');end;
+if ~isnan(md.bed_slopey),md.bed_slopey=project3d(md,md.bed_slopey,'node');end;
+
+%bedinfo and surface info
+md.elementonbed=project3d(md,ones(md.numberofelements2d,1),'element',1);
+md.elementonsurface=project3d(md,ones(md.numberofelements2d,1),'element',md.numlayers-1);
+md.gridonbed=project3d(md,ones(md.numberofgrids2d,1),'node',1);
+md.gridonsurface=project3d(md,ones(md.numberofgrids2d,1),'node',md.numlayers);
+
+%elementstype
+if ~isnan(md.elements_type)
+	oldelements_type=md.elements_type2d;
+	md.elements_type=zeros(number_el3d,2);
+	md.elements_type(:,1)=project3d(md,oldelements_type(:,1),'element');
+	md.elements_type(:,2)=project3d(md,oldelements_type(:,2),'element');
+	md.gridonhutter=project3d(md,md.gridonhutter,'node');
+	md.gridonmacayeal=project3d(md,md.gridonmacayeal,'node');
+	md.gridonpattyn=project3d(md,md.gridonpattyn,'node');
+	md.gridonstokes=project3d(md,md.gridonstokes,'node');
+end
+
+%boundary conditions
+md.gridondirichlet_diag=project3d(md,md.gridondirichlet_diag,'node');
+md.dirichletvalues_diag=project3d(md,md.dirichletvalues_diag,'node'); 
+
+%Extrusion of Neumann BC
+%in 3d, segmentonnumann is: [grid1 grid2 grid3 grid4 element]
+oldsegmentonneumann_diag=md.segmentonneumann_diag;
+segmentonneumann_diag_layer1=[oldsegmentonneumann_diag(:,1:2)  oldsegmentonneumann_diag(:,2)+md.numberofgrids2d  oldsegmentonneumann_diag(:,1)+md.numberofgrids2d  oldsegmentonneumann_diag(:,3)]; %Add two columns on the first layer 
+segmentonneumann_diag=[];
+for i=1:numlayers-1,
+	segmentonneumann_diag=[segmentonneumann_diag ;segmentonneumann_diag_layer1(:,1:4)+(i-1)*md.numberofgrids2d segmentonneumann_diag_layer1(:,5)+(i-1)*md.numberofelements2d ];
+end
+
+%plug into md
+md.segmentonneumann_diag=segmentonneumann_diag;
+md.gridondirichlet_prog=project3d(md,md.gridondirichlet_prog,'node');
+md.dirichletvalues_prog=project3d(md,md.dirichletvalues_prog,'node',1);
+%md.segmentonneumann_prog=[tproj(md.segmentonneumann_prog(:,1)) tproj(md.segmentonneumann_prog(:,2)) tproj2d_el(md.segmentonneumann_prog(:,3))];
+%md.segmentonneumann_prog2=[tproj(md.segmentonneumann_prog2(:,1)) tproj(md.segmentonneumann_prog2(:,2)) tproj2d_el(md.segmentonneumann_prog2(:,3))];
+
+%materials
+md.B=project3d(md,md.B,'node');
+md.n=project3d(md,md.n,'element');
+
+%parameters
+md.surface=project3d(md,md.surface,'node');
+md.thickness=project3d(md,md.thickness,'node');
+md.bed=project3d(md,md.bed,'node');
+md.gridonboundary=project3d(md,md.gridonboundary,'node');
+md.elementoniceshelf=project3d(md,md.elementoniceshelf,'element');
+md.gridoniceshelf=project3d(md,md.gridoniceshelf,'node');
+md.elementonicesheet=project3d(md,md.elementonicesheet,'element');
+md.gridonicesheet=project3d(md,md.gridonicesheet,'node');
+
+%special for thermal modeling:
+md.melting=project3d(md,md.melting,'node',1); 
+md.observed_temperature=project3d(md,md.observed_temperature,'node'); 
+md.geothermalflux=project3d(md,md.geothermalflux,'node',1); %bedrock only gets geothermal flux
+md.gridondirichlet_thermal=project3d(md,md.gridondirichlet_thermal,'node',md.numlayers); %surface temperature
+md.dirichletvalues_thermal=project3d(md,md.dirichletvalues_thermal,'node',md.numlayers); %surface temperature
+
+%NaN the values that are not on an spc'd temperature.
+pos=find(~md.gridondirichlet_thermal);
+md.dirichletvalues_thermal(pos)=NaN;
+
+%update of connectivity matrix
+md.connectivity=25;
+
+%augment counter  keeping track of what has been done to this model
+md.counter=4;
+
+end
+
+function extrudeusage(),
+disp('INPUT function md=extrude(md,numlayers,extrusionexponent) ');
+disp('     vertically extrude a 2d mesh and create corresponding 3d mesh,  ');
+disp('     the vertical distribution follows a polynomial law:');
+disp('          extrusionexponent>1  refinement at the base');
+disp('        0<extrusionexponent<1  refinement at the surface');
+disp('          extrusionexponent=1  linear extrusion');
+end
Index: /issm/trunk/src/m/classes/public/fieldcount.m
===================================================================
--- /issm/trunk/src/m/classes/public/fieldcount.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/fieldcount.m	(revision 1)
@@ -0,0 +1,8 @@
+function numFields = fieldcount(modelObj)
+%FIELDCOUNT - determines the number of fields in an model object
+%
+%   determines the number of fields in an model object
+%   Used by model child class methods
+%   Do not use
+
+numFields = length(fieldnames(modelObj));
Index: /issm/trunk/src/m/classes/public/geography.m
===================================================================
--- /issm/trunk/src/m/classes/public/geography.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/geography.m	(revision 1)
@@ -0,0 +1,86 @@
+function md=geography(md,iceshelfname,icesheetname)
+%GEOGRAPHY - establish boundaries between grounded and floating ice.
+%
+%   By default, ice is considered grounded. The contour iceshelfname defines grids 
+%   for which ice is floting. The contour icesheetname defines grids inside an iceshelf, 
+%   that are grounded (ie: ice rises, islands, etc ...)
+%   All input files are in the Argus format (extension .exp).
+%
+%   Usage:
+%      md=geography(md,iceshelfname,icesheetname)
+%
+%   Examples:
+%      md=geography(md,'all','');
+%      md=geography(md,'Iceshelves.exp','Islands.exp');
+
+%some checks on list of arguments
+if ((nargin~=3) | (nargout~=1)),
+	geographyusage();
+	error('geography error message');
+end
+if ((~ischar(iceshelfname)) | (~ischar(icesheetname))  )
+	geographyusage();
+	error('geography error message');
+end
+
+if md.counter>=2,
+	choice=input('This model already has a geometry. Are you sure you want to go ahead? (y/n)','s');
+	if ~strcmp(choice,'y')
+		error('no geometry done ... exiting');
+	end
+else
+	if (md.counter~=1)
+		error('geography error message: you need to run mesh.m first on this model');
+	else
+		md.counter=2;
+	end
+end
+
+%Get assigned fields
+x=md.x;
+y=md.y;
+elements=md.elements;
+
+%Fist recover arrays of ice shelf grids and elements, and ice sheet grids and elements.
+if strcmp(iceshelfname,''), %no iceshelf contour file, we are dealing with a pure ice sheet.
+	gridoniceshelf=zeros(md.numberofgrids,1);
+	elementoniceshelf=zeros(md.numberofelements,1);
+elseif strcmp(iceshelfname,'all'), %we are dealing with a pure ice shelf.
+	gridoniceshelf=ones(md.numberofgrids,1);
+	elementoniceshelf=ones(md.numberofelements,1);
+else
+	[gridoniceshelf,elementoniceshelf]=ArgusContourToMesh(elements,x,y,expread(iceshelfname,1),'element and node',2);
+end
+
+if strcmp(icesheetname,''), %no icesheet contour file, we are dealing with a pure ice shelf.
+	gridonicesheet=zeros(md.numberofgrids,1);
+	elementonicesheet=zeros(md.numberofelements,1);
+else
+	[gridonicesheet,elementonicesheet]=ArgusContourToMesh(elements,x,y,expread(icesheetname,1),'element and node',2);
+end
+
+%Because icesheet grids and elements can be included into an iceshelf, we need to update. Remember, all the previous 
+%arrays come from domain outlines that can intersect one another: 
+gridoniceshelf=double((gridoniceshelf & ~gridonicesheet));
+elementoniceshelf=double((elementoniceshelf & ~elementonicesheet));
+gridonicesheet=double(~gridoniceshelf);
+elementonicesheet=double(~elementoniceshelf);
+
+%Return: 
+md.elementoniceshelf=elementoniceshelf;
+md.gridoniceshelf=gridoniceshelf;
+
+md.elementonicesheet=elementonicesheet;
+md.gridonicesheet=gridonicesheet;
+
+%Keep track of input files
+if strcmp(iceshelfname,''), md.iceshelfoutline=''; elseif strcmp(iceshelfname,'all'), md.iceshelfoutline='all'; else md.iceshelfoutline=readfile(iceshelfname); end
+if strcmp(icesheetname,''), md.icesheetoutline=''; elseif strcmp(icesheetname,'all'), md.icesheetoutline='all'; else md.icesheetoutline=readfile(icesheetname); end
+
+function geographyusage(),
+disp('INPUT md=geography(md,iceshelfname,icesheetname)');
+disp('geography:  establish boundaries between grounded and floating ice.');
+disp('     By default, ice is considered grounded. The contour iceshelfname defines grids ');
+disp('     for which ice is floting. The contour icesheetname defines grids inside an iceshelf, ');
+disp('     that are grounded (ie: ice rises, islands, etc ...)');
+disp('     All input files are in the Argus format (extension .exp');
Index: /issm/trunk/src/m/classes/public/ismodelselfconsistent.m
===================================================================
--- /issm/trunk/src/m/classes/public/ismodelselfconsistent.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/ismodelselfconsistent.m	(revision 1)
@@ -0,0 +1,368 @@
+function bool=ismodelselfconsistent(md,solutiontype,package),
+%ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+%
+%   Usage:
+%      bool=ismodelselfconsistent(md,solutiontype,package),
+
+if strcmpi(solutiontype,'mesh'),
+	%this solution is a little special. It should come right after the md=model;  operation. So a lot less checks!
+
+	bool=1;
+	return;
+end
+
+%tolerance we use in litmus tests for the consistency of the model
+tolerance=10^-12;
+if (nargin~=3  )
+	IsModelSelfConsistentUsage();
+	error(' ');
+end
+
+if strcmpi(solutiontype,'qmu'),
+	if ~strcmpi(md.cluster,'none'),
+		if md.waitonlock==0,
+			disp(['model is not correctly configured: waitonlock should be activated when running qmu in parallel mode!']);
+			bool=0;return;
+		end
+	end
+end
+
+if isempty(md.name),
+	disp(['model is not correctly configured: missing name!']);
+	bool=0;return;
+end
+
+if md.counter<3,
+	disp(['model ' md.name ' is not correctly configured. You forgot one step in the following sequence (mesh, geography, parameterize)!']);
+	bool=0;return;
+end
+
+if md.numberofelements<=0,
+	disp(['model ' md.name ' does not have any elements!']);
+	bool=0; return;
+end
+
+if md.numberofgrids<=0,
+	disp(['model ' md.name ' does not have any grids!']);
+	bool=0; return;
+end
+
+%check elementstype
+if size(md.elements_type,1)~=md.numberofelements | size(md.elements_type,2)~=2,
+	disp(['Types of elements have not been set properly, run setelementstype first'])
+	bool=0;return;
+end
+if any(ones(md.numberofelements,1)-((md.elements_type(:,1)==hutterenum) + (md.elements_type(:,1)==macayealenum)  + (md.elements_type(:,1)==pattynenum)))
+	disp(['Types of elements have not been set properly, run setelementstype first'])
+	bool=0;return;
+end
+if any(ones(md.numberofelements,1)-((md.elements_type(:,2)==stokesenum) + (md.elements_type(:,2)==noneenum)))
+	disp(['Types of elements have not been set properly, run setelementstype first'])
+	bool=0;return;
+end
+if strcmpi(md.type,'2d'),
+	if (ismember(pattynenum,md.elements_type(:,1)) |  ismember(stokesenum,md.elements_type(:,2))),
+		disp(['For a 2d model, only MacAyeal''s and Hutter''s elements are allowed']);
+		bool=0;return;
+	end
+end
+%check that if there are rifts, model is 2d
+if md.numrifts,
+	if ~strcmpi(md.type,'2d'),
+		disp(['Models with rifts are only supported in 2d for now!']);
+		bool=0;return;
+	end
+end
+
+%If there are rifts, check that the solver is set to mumps in parallel
+if md.numrifts, 
+	if ~strcmpi(md.cluster,'none')
+		if isempty(findstr('aijmumps',md.solverstring)),
+			disp(['For a 2d model with rifts, running on a cluster, you should use a direct solver like MUMPS!']);
+			bool=0;return;
+		end
+	end
+end
+
+%check elementstype in diagnostic
+if strcmpi(solutiontype,'diagnostic')
+	if any(md.elements_type(:,1)==hutterenum & md.elementoniceshelf),
+		disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n'));
+	end
+end
+
+%Check that mesh is 3d
+if strcmpi(solutiontype,'thermalsteady') |  strcmp(solutiontype,'thermaltransient'),
+	if strcmp(md.type,'2d'),
+		disp(['For a ' solutiontype ' computation, the model must be 3d, extrude it first!'])
+		bool=0;return;
+	end
+end
+
+%check artificial_diffusivity is an integer
+if ~isscalar(md.artificial_diffusivity),
+	disp('artificial_diffusivity should be a scalar (1 or 0)');
+	bool=0;return;
+end
+
+%check on connectivity
+if strcmpi(md.type,'2d'),
+	if md.connectivity<9, 
+		disp('connectivity should be at least 9 for 2d models');
+		bool=0;return;
+	end
+end
+
+if strcmpi(md.type,'3d'),
+	if md.connectivity<24, 
+		disp('connectivity should be at least 24 for 3d models');
+		bool=0;return;
+	end
+end
+
+
+
+
+
+%Check previous computation
+if strcmp(solutiontype,'thermaltransient') | strcmp(solutiontype,'thermalsteady')
+	if (isempty(md.vx) | isempty(md.vy) | isempty(md.vz)),
+		disp(['a 3d velocity is required. Run ''diagnostic'' solution first!'])
+		bool=0;return;
+	end
+end
+
+if strcmp(solutiontype,'thermaltransient') | strcmp(solutiontype,'thermalsteady')
+	if (isempty(md.pressure) | isnan(md.pressure)),
+		disp(['pressure is required. Run ''diagnostic'' solution first!'])
+		bool=0;return;
+	end
+	
+	if (isempty(md.vx) | isnan(md.vx) | isempty(md.vy)  | isnan(md.vy) | isempty(md.vz) | isnan(md.vz)),
+		disp(['velocities are required!']);
+		bool=0;return;
+	end
+end
+
+if strcmp(solutiontype,'thermaltransient')
+	if isempty(md.temperature),
+		disp(['An  initial temperature is needed for a transient thermal computation'])
+		bool=0;return;
+	end
+	if isstruct(md.temperature) |  isstruct(md.melting),
+		disp(['The initial temperature or melting should be a list and not a structure'])
+		bool=0;return;
+	end
+
+end
+
+if strcmp(solutiontype,'transient')
+	if isstruct(md.temperature),
+		disp(['The initial temperature should be empty or a list but not a structure'])
+		bool=0;return;
+	end
+
+end
+
+if strcmp(solutiontype,'parameters')
+	if ~(size(md.vx,1)==md.numberofgrids & size(md.vy,1)==md.numberofgrids & (size(md.vz,1)==md.numberofgrids | strcmpi(md.type,'2d')))
+		disp(['velocities are required!']);
+		bool=0;return;
+	end
+	if strcmpi(md.type,'2d') & md.acceleration
+		disp(['solution requires acceleration=0']);
+		bool=0;return;
+	end
+	if any(md.elements_type(:,1)==hutterenum); 
+		disp(['The model has Hutter''s elements. Impossible to compute parameters']);
+		bool=0;return;
+	end
+end
+
+
+%Check that problem is not singular
+if strcmp(solutiontype,'diagnostic'),
+	if isempty(find(md.gridondirichlet_diag)),
+		disp(['model ' md.name ' is not well posed (singular). You need at least one grid with fixed velocity!'])
+		bool=0;return;
+	end
+end
+
+%Check we have values for dirichletvalues_diag
+if strcmp(solutiontype,'diagnostic'),
+	if isempty(md.gridondirichlet_diag) | isempty(md.dirichletvalues_diag),
+		disp(['model ' md.name ' is not well posed. Missing dirichlet values for diagnostic run']);
+		bool=0;return;
+	end
+end
+
+
+
+if strcmp(solutiontype,'prognostic'),
+	%old testing
+%	if isempty(find(md.gridondirichlet_diag)),
+%		disp(['model ' md.name ' diagnostic is not well posed (singular). You need at least one grid with fixed velocity!'])
+%		bool=0;return;
+%	end
+%	if isempty(find(md.gridondirichlet_prog)),
+%		disp(['model ' md.name ' prognostic is not well posed (singular). You need at least one grid with fixed thickness!'])
+%		bool=0;return;
+%	end
+	if (size(md.vx,1)~=md.numberofgrids | size(md.vy,1)~=md.numberofgrids),
+		disp(['a 3d velocity is required. Run ''diagnostic'' solution first!'])
+		bool=0; return;
+	end
+end
+%some checks for control methods
+if strcmp(solutiontype,'control')
+	%check fields used by control
+	if (length(md.maxiter)~=md.nsteps | length(md.optscal)~=md.nsteps | length(md.fit)~=md.nsteps)
+		disp('maxiter, optscal and fit must have the length specified by nsteps')
+		bool=0;return;
+	end
+	if sum((double(md.fit==1) + double(md.fit==0) + double(md.fit==2))==1)~=md.nsteps
+		disp('wrong fits: fit should be a vector of size nsteps holding 0, 1 and 2 only')
+		bool=0;return;
+	end
+end
+
+
+%Check that no NaN values popped up: 
+fields={'numberofelements','numberofgrids','x','y','z','segmentonneumann_diag','drag','drag_type','p','q','gridondirichlet_diag',...
+        'rho_ice','rho_water','B','elementoniceshelf','surface','thickness','bed','g','lowmem','sparsity','nsteps','maxiter',...
+		'tolx','np','time','eps_rel','exclusive','n','gridonbed','gridonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec'};
+for i=1:length(fields),
+	if ~isempty(eval(['md.' char(fields(i))])),
+		if find(isnan(eval(['md.' char(fields(i))]))),
+			disp(['model ' md.name ' has an NaN value in field ' char(fields(i)) '!']);
+			bool=0; return;
+		end
+	end
+end
+
+%Check that these fields are > 0 
+fields={'numberofelements','numberofgrids','elements','segmentonneumann_diag','drag','drag_type','p','q','gridondirichlet_diag',...
+         'rho_ice','rho_water','B','elementoniceshelf','thickness','g','eps_rel','eps_abs','nsteps','maxiter','tolx','np','time','exclusive',...
+		 'sparsity','lowmem','n','gridonbed','gridonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec'};
+for i=1:length(fields),
+	if ~isempty(eval(['md.' char(fields(i))])),
+		if find((eval(['md.' char(fields(i))]))<0),
+			disp(['model ' md.name ' has a <0 value in field ' char(fields(i)) '!']);
+			bool=0; return;
+		end
+	end
+end
+
+%Check that these fields are ~=0 
+fields={'numberofelements','numberofgrids','elements','segmentonneumann_diag','drag_type',...
+         'rho_ice','rho_water','B','thickness','g','eps_rel','eps_abs','maxiter','tolx','np','time',...
+		 'sparsity','deltaH','DeltaH','timeacc','timedec'};
+for i=1:length(fields),
+	if ~isempty(eval(['md.' char(fields(i))])),
+		if find((eval(['md.' char(fields(i))]))==0),
+			disp(['model ' md.name ' has a =0 value in field ' char(fields(i)) '!']);
+			bool=0; return;
+		end
+	end
+end
+
+%Check that these fields are of size md.numberofelements
+fields={'elements','p','q','elementoniceshelf','n','elementonbed'};
+for i=1:size(fields,2),
+	if (size(eval(['md.' char(fields(i))]),1)~=md.numberofelements),
+		disp(['model ' md.name ' field ' char(fields(i)) ' should be of size ' num2str(md.numberofelements) '!']);
+		bool=0; return;
+	end
+end
+
+%Check that these fields are of size md.numberofgrids
+fields={'melting','x','y','z','B','drag','gridondirichlet_diag','vx_obs','vy_obs','surface','thickness','bed','gridonbed','gridonsurface'};
+for i=1:length(fields),
+	if find(length(eval(['md.' char(fields(i))]))~=md.numberofgrids),
+		disp(['model ' md.name ' field ' char(fields(i)) ' should be of size ' num2str(md.numberofgrids) '!']);
+		bool=0; return;
+	end
+end
+
+%Make sure lowmem is either 0 or 1
+if ((md.lowmem ~= 1) & (md.lowmem~=0)),
+	disp(['model ' md.name ' lowmem field should be 0 or 1']);
+	bool=0; return;
+end
+
+%Make sure sparsity is between 0 and 1: 
+if ( (md.sparsity<=0) | (md.sparsity>1)),
+	disp(['model ' md.name ' sparsity should be inside the ]0 1] range']);
+	bool=0; return;
+end
+
+%Make sure thickness=surface-bed;
+if find((md.thickness-md.surface+md.bed)>tolerance),
+	disp(['model ' md.name ' violates the equality thickness=surface-bed!']);
+	bool=0; return;
+end
+
+%Check that rifts were processed correctly: 
+if ~isstruct(md.rifts),
+	if ~isempty(find(md.segmentmarkers>=2)),
+		%We have segments with rift markers, but no rift structure!
+		disp(['model ' md.name ' should be processed for rifts (run meshprocessrifts)!']);
+		bool=0; return;
+	end
+end
+
+
+%Check that thickness is not null. If is it, then the corresponding grids should be spc'd.
+if ~isempty(find(md.thickness<=0)),
+	pos=find(md.thickness<=0);
+	if ~isempty(find(md.gridondirichlet_diag(pos)==0)),
+		disp(['model ' md.name ' has some grids with 0 thickness']);
+		bool=0; return;
+	end
+end
+
+%Check that p>0 in the sliding law u = k * sigma ^ p * Neff ^ q :
+if ~isempty(find(md.p<=0)),
+	disp(['model ' md.name ' has some p<0 friction coefficientsin sliding law']);
+	bool=0; return;
+end
+
+
+%Check parameteroutput
+if ~iscell(md.parameteroutput)
+	disp(['parameteroutput field must be a cell, example {''strainrate'',''stress'',''deviatoricstress'',''viscousheating''}']);
+	bool=0; return;
+end
+
+
+for i=1:length(md.parameteroutput)
+	if ~strcmpi(md.parameteroutput(i),'strainrate') & ~strcmpi(md.parameteroutput(i),'stress')  & ~strcmpi(md.parameteroutput(i),'deviatoricstress') & ~strcmpi(md.parameteroutput(i),'viscousheating') ...
+		 & ~strcmpi(md.parameteroutput(i),'pressure_elem') & ~strcmpi(md.parameteroutput(i),'stress_bed')  & ~strcmpi(md.parameteroutput(i),'stress_surface')
+		disp(['one of the parameteroutput is not supported yet']);
+		bool=0; return;
+	end
+end
+
+%check parallel settings
+if ~strcmpi(md.cluster,'none'),
+	if ~strcmpi(package,'cielo'),
+		disp(['parallel runs only allowed for ''cielo'' package']);
+		bool=0; return;
+	end
+end
+
+%Put as many checks as you want here: 
+
+
+%No problems, just return 1;
+bool=1;
+return;
+
+function IsModelSelfConsistentUsage()
+disp(' ');
+disp('   IsModelSelfConsistent usage: flag=IsModelSelfConsistent(model)');
+disp('         where model is an instance of the @model class, and flag a boolean');
+
+
+
+
Index: /issm/trunk/src/m/classes/public/isresultconsistent.m
===================================================================
--- /issm/trunk/src/m/classes/public/isresultconsistent.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/isresultconsistent.m	(revision 1)
@@ -0,0 +1,102 @@
+function bool=isresultconsistent(md,solutiontype),
+%ISRESULTCONSISTENT: check that results are consistent
+%
+%   This routine is called after a computation and check
+%   that the values t the penalties are consitent
+%
+%   Usage:
+%      bool=IsModelSelfConsistent(model,solutiontype)
+
+%tolerance we use in litmus tests for the consistency of the model
+tolerance=10^-2;
+
+if (nargin~=2  )
+	IsResultConsistentUsage();
+	error(' ');
+end
+%Check velocities i(no penalties for 2d meshes)
+if (strcmp(solutiontype,'diagnostic') || strcmp(solutiontype,'diagnostic_horiz') ),
+
+	if strcmpi(md.type,'3d'),
+		if ~isnan(md.penalties),
+			for i=1:size(md.penalties,1)
+				for n=2:md.numlayers
+					relativex=(md.vx(md.penalties(i,1))-md.vx(md.penalties(i,n)))./(md.vx(md.penalties(i,1)));
+					if md.vx(md.penalties(i,1))==md.vx(md.penalties(i,n)), relativex=0; end
+					relativey=(md.vy(md.penalties(i,1))-md.vy(md.penalties(i,n)))./(md.vy(md.penalties(i,1)));
+					if md.vy(md.penalties(i,1))==md.vy(md.penalties(i,n)), relativey=0; end
+					if abs(relativex)>tolerance | abs(relativey)>tolerance
+						disp(['''diagnostic'' result not consistent: increase penalty_offset (discontinuous horizontal velocity)']);
+						bool=0; return;
+					end
+
+				end
+			end
+		end
+	end
+end
+
+if strcmp(solutiontype,'thermalsteady')
+
+	%check melting 
+	if any(abs(md.melting(md.numberofgrids2d+1:end))>tolerance)
+		disp(['''thermalsteady'' result not consistent: increase penalty_melting (negative melting)']);
+		bool=0; return; 
+	end
+
+end
+
+if strcmp(solutiontype,'thermaltransient')
+
+	for iter=1:length(md.thermaltransient_results)
+
+	%check melting 
+	if any(abs(md.thermaltransient_results(iter).melting(md.numberofgrids2d+1:end))>tolerance)
+		disp(['''thermaltransient'' result not consistent: increase penalty_melting (negative melting)']);
+		bool=0; return;
+	end
+
+	end
+end
+
+
+if (strcmp(solutiontype,'transient') & strcmpi(md.type,'3d')),
+	for iter=1:length(md.transient_results)
+
+		%check melting 
+		if any(abs(md.transient_results(iter).melting(md.numberofgrids2d+1:end))>tolerance)
+			disp(['''thermaltransient'' result not consistent: increase penalty_melting (negative melting)']);
+			bool=0; return;
+		end
+
+
+		%check velocities
+		if ~isnan(md.penalties),
+			for i=1:size(md.penalties,1)
+				for n=2:md.numlayers
+					relativex=(md.transient_results(iter).vx(md.penalties(i,1))-md.transient_results(iter).vx(md.penalties(i,n)))./(md.transient_results(iter).vx(md.penalties(i,1)));
+					if md.transient_results(iter).vx(md.penalties(i,1))==md.transient_results(iter).vx(md.penalties(i,n)), relativex=0; end
+					relativey=(md.transient_results(iter).vy(md.penalties(i,1))-md.transient_results(iter).vy(md.penalties(i,n)))./(md.transient_results(iter).vy(md.penalties(i,1)));
+					if md.transient_results(iter).vy(md.penalties(i,1))==md.transient_results(iter).vy(md.penalties(i,n)), relativey=0; end
+					if abs(relativex)>tolerance | abs(relativey)>tolerance
+						disp(['''transient'' result not consistent: increase penalty_offset (discontinuous horizontal velocity)']);
+						bool=0; return;
+					end
+
+				end
+			end
+		end
+
+	end
+
+end
+
+
+%No problems, just return 1;
+bool=1;
+return;
+	
+function IsResultConsistentUsage()
+disp(' ');
+disp('   IsResultConsistent usage: flag=IsResultConsistent(model,solutiontype)');
+disp('         where model is an instance of the @model class, and flag a boolean');
Index: /issm/trunk/src/m/classes/public/loadresultsfromcluster.m
===================================================================
--- /issm/trunk/src/m/classes/public/loadresultsfromcluster.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/loadresultsfromcluster.m	(revision 1)
@@ -0,0 +1,36 @@
+function md=loadresultsfromcluster(md,solutiontype)
+%LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
+%
+%   Usage:
+%      md=loadresultsfromcluster(md,solutiontype);
+
+%Get cielo.rc location
+cielo_rc_location=which('cielo.rc');
+
+%Figure out parameters for this particular cluster
+[codepath,executionpath]=ProcessParallelParametersFromCieloRc(md.cluster,cielo_rc_location);
+
+%if we are running locally, no need to call ssh to recover the logs and results. We figure out by comparing the 
+%hostname to the cluster name
+[result,hostname]=system('hostname -s');hostname=hostname(1:end-1);
+
+%Go pickup output file and logs on cluster
+if strcmpi(hostname,md.cluster),
+	system(['cp ' executionpath '/' md.name '.*o* ./']); %get outlog, errlog and outbin files
+else
+	system(['scp ' md.cluster ':' executionpath '/' md.name '.*o* ./']); %get outlog, errlog and outbin files
+end
+
+%read log files onto  fields
+md.errlog=readfile([md.name '.errlog']);
+md.outlog=readfile([md.name '.outlog']);
+
+if ~isempty(md.errlog),
+	disp(['loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields']);
+end
+
+%If we are here, no errors in the solution sequence, call loadresultsfromdisk.
+md=loadresultsfromdisk(md,[md.name '.outbin'],solutiontype);
+
+%erase the log and output files
+system(['rm -rf ' md.name '.outlog ' md.name '.errlog' md.name '.outbin']);
Index: /issm/trunk/src/m/classes/public/loadresultsfromdisk.m
===================================================================
--- /issm/trunk/src/m/classes/public/loadresultsfromdisk.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/loadresultsfromdisk.m	(revision 1)
@@ -0,0 +1,88 @@
+function md=loadresultsfromdisk(md,filename,solutiontype)
+%LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
+%
+%   Usage:
+%      md=loadresultsfromdisk(md,filename);
+
+%We convert all results to m/a units, from m/s
+
+if ((nargin~=3) | (nargout~=1)),
+	help loadresultsfromdisk;
+	error('loadresultsfromdisk: error message.');
+end
+
+
+results=parseresultsfromdisk(filename);
+
+%First get solution type
+analysis_type=results{1};
+
+%Get gsize
+gsize=results{2};
+
+%Get part
+part=results{3};
+
+%now to specialized reading
+if strcmpi(analysis_type,'diagnostic_horiz'),
+
+	%Get u_g
+	u_g=results{4};
+
+	%Used to recover velocities
+	indx=part(1:2:end);
+	indy=part(2:2:end);
+
+	%Recover velocity
+	md.vx=u_g(indx)*md.yts;
+	md.vy=u_g(indy)*md.yts;
+	md.vel=sqrt(md.vx.^2+md.vy.^2);
+
+elseif strcmpi(analysis_type,'control'),
+
+	%read num_control_parameters
+	num_control_parameters=results{4};
+	nsteps=results{5};
+	
+	%read J
+	md.cont_J=results{6};
+
+	%Used to recover parameters and velocit
+	indx=part(1:2:end);
+	indy=part(2:2:end);
+
+	%read parameters
+	for i=1:num_control_parameters,
+		control_parameter=results{6+i};
+		cont_parameters{i}=control_parameter(indx);
+	end
+	md.cont_parameters=cont_parameters;
+
+	%Recover velocity
+	u_g=results{7+num_control_parameters};
+
+	md.cont_vx=u_g(indx)*md.yts;
+	md.cont_vy=u_g(indy)*md.yts;
+	md.cont_vel=sqrt(md.cont_vx.^2+md.cont_vy.^2);
+elseif strcmpi(analysis_type,'thermalsteady'),
+
+	%read t_g
+	t_g=results{4};
+
+	%Used to recover velocities
+	indx=1:6:gsize;
+	indx=indx(part);
+
+	%Recover velocity
+	md.temperature=t_g(indx);
+else
+	error(['loadresultsfromdisk error message: unknow solution type ',analysis_type]);
+end
+
+
+%Check result is consistent
+disp(sprintf('%s\n','checking result consistency'));
+
+if ~isresultconsistent(md,solutiontype),
+	disp('!! results not consistent correct the model !!') %it would be very cruel to put an error, it would kill the computed results (even if not consistent...)
+end
Index: /issm/trunk/src/m/classes/public/marshall.m
===================================================================
--- /issm/trunk/src/m/classes/public/marshall.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/marshall.m	(revision 1)
@@ -0,0 +1,163 @@
+function marshall(md,solutiontype,package)
+%MARSHALL - output Cielo compatible binary file from @model md, for certain solution type.
+%
+%   The routine creates a Cielo compatible binary file from @model md
+%   solutiontype can be 'diagnostic','prognostic' or 'control'. 
+%   This binary file will be used for parallel runs in cielo.
+%
+%   Usage:
+%      marshall(md,solutiontype,package)
+
+%some checks on list of arguments
+if ((nargin~=3) & (nargout~=0))
+	marshallusage;
+	error('marshall error message');
+end
+
+disp(['marshalling file ' md.name '.bin']);
+
+%open file for binary writing
+fid=fopen([ md.name '.bin'],'wb');
+if fid==-1,
+	error(['marshall error message: could not open ' [md.name '.bin'],' file for binary writing']);
+end
+
+WriteData(fid,solutiontype,'String','analysis_type');
+WriteData(fid,md.type,'String','type');
+WriteData(fid,md.numberofgrids,'Integer','numberofgrids');
+WriteData(fid,md.numberofelements,'Integer','numberofelements');
+WriteData(fid,md.x,'Mat','x');
+WriteData(fid,md.y,'Mat','y');
+WriteData(fid,md.z,'Mat','z');
+WriteData(fid,md.elements,'Mat','elements');
+WriteData(fid,md.elements_type,'Mat','elements_type');
+
+if strcmpi(md.type,'3d'),
+	WriteData(fid,md.numberofelements2d,'Integer','numberofelements2d');
+	WriteData(fid,md.numberofgrids2d,'Integer','numberofgrids2d');
+	WriteData(fid,md.elements2d,'Mat','elements2d');
+	WriteData(fid,md.deadgrids,'Mat','deadgrids');
+	WriteData(fid,md.numlayers,'Integer','numlayers');
+end
+WriteData(fid,md.elementonbed,'Mat','elementonbed');
+WriteData(fid,md.elementonsurface,'Mat','elementonsurface');
+WriteData(fid,md.gridonbed,'Mat','gridonbed');
+WriteData(fid,md.gridonsurface,'Mat','gridonsurface');
+
+
+WriteData(fid,md.thickness,'Mat','thickness');
+WriteData(fid,md.surface,'Mat','surface');
+WriteData(fid,md.bed,'Mat','bed');
+
+WriteData(fid,md.vx_obs,'Mat','vx_obs');
+WriteData(fid,md.vy_obs,'Mat','vy_obs');
+
+WriteData(fid,md.vx,'Mat','vx');
+WriteData(fid,md.vy,'Mat','vy');
+WriteData(fid,md.vz,'Mat','vz');
+WriteData(fid,md.pressure,'Mat','pressure');
+
+
+WriteData(fid,md.drag_type,'Integer','drag_type');
+WriteData(fid,md.drag,'Mat','drag');
+WriteData(fid,md.p,'Mat','p');
+WriteData(fid,md.q,'Mat','q');
+
+WriteData(fid,md.elementoniceshelf,'Mat','elementoniceshelf');
+
+WriteData(fid,md.segmentonneumann_diag,'Mat','segmentonneumann_diag');
+WriteData(fid,md.neumannvalues_diag,'Mat','neumannvalues_diag');
+WriteData(fid,md.gridondirichlet_diag,'Mat','gridondirichlet_diag');
+WriteData(fid,md.dirichletvalues_diag,'Mat','dirichletvalues_diag');
+
+WriteData(fid,md.segmentonneumann_prog,'Mat','segmentonneumann_prog');
+WriteData(fid,md.neumannvalues_prog,'Mat','neumannvalues_prog');
+WriteData(fid,md.gridondirichlet_prog,'Mat','gridondirichlet_prog');
+WriteData(fid,md.dirichletvalues_prog,'Mat','dirichletvalues_prog');
+WriteData(fid,md.segmentonneumann_prog2,'Mat','segmentonneumann_prog2');
+WriteData(fid,md.neumannvalues_prog2,'Mat','neumannvalues_prog2');
+
+WriteData(fid,md.gridondirichlet_thermal,'Mat','gridondirichlet_thermal');
+WriteData(fid,md.dirichletvalues_thermal,'Mat','dirichletvalues_thermal');
+WriteData(fid,md.geothermalflux,'Mat','geothermalflux');
+WriteData(fid,md.melting,'Mat','melting');
+WriteData(fid,md.accumulation,'Mat','accumulation');
+
+%Get materials
+WriteData(fid,md.rho_water,'Scalar','rho_water');
+WriteData(fid,md.rho_ice,'Scalar','rho_ice');
+WriteData(fid,md.g,'Scalar','g');
+WriteData(fid,md.B,'Mat','B');
+WriteData(fid,md.n,'Mat','n');
+
+%Control methods
+WriteData(fid,md.control_type,'String','control_type');
+
+%Write solution parameters
+WriteData(fid,md.fit,'Mat','fit');
+WriteData(fid,md.yts,'Scalar','yts');
+WriteData(fid,md.meanvel,'Scalar','meanvel');
+WriteData(fid,md.epsvel,'Scalar','epsvel');
+WriteData(fid,md.debug,'Integer','debug');
+WriteData(fid,md.plot,'Integer','plot');
+WriteData(fid,md.artificial_diffusivity,'Integer','artificial_diffusivity');
+WriteData(fid,md.nsteps,'Integer','nsteps');
+WriteData(fid,md.tolx,'Scalar','tolx');
+WriteData(fid,md.maxiter,'Mat','maxiter');
+WriteData(fid,md.mincontrolconstraint,'Scalar','mincontrolconstraint');
+WriteData(fid,md.maxcontrolconstraint,'Scalar','maxcontrolconstraint');
+WriteData(fid,md.eps_rel,'Scalar','eps_rel');
+WriteData(fid,md.eps_abs,'Scalar','eps_abs');
+WriteData(fid,md.dt,'Scalar','dt');
+WriteData(fid,md.ndt,'Scalar','ndt');
+WriteData(fid,md.penalty_offset,'Scalar','penalty_offset');
+WriteData(fid,md.penalty_melting,'Scalar','penalty_melting');
+WriteData(fid,md.penalty_lock,'Integer','penalty_lock');
+WriteData(fid,md.sparsity,'Scalar','sparsity');
+WriteData(fid,md.connectivity,'Integer','connectivity');
+WriteData(fid,md.lowmem,'Integer','lowmem');
+WriteData(fid,md.optscal,'Mat','optscal');
+WriteData(fid,md.solverstring,'String','solverstring');
+WriteData(fid,md.viscosity_overshoot,'Scalar','viscosity_overshoot');
+WriteData(fid,md.waitonlock,'Integer','waitonlock');
+
+%Thermal parameters
+WriteData(fid,md.beta,'Scalar','beta');
+WriteData(fid,md.meltingpoint,'Scalar','meltingpoint');
+WriteData(fid,md.latentheat,'Scalar','latentheat');
+WriteData(fid,md.heatcapacity,'Scalar','heatcapacity');
+WriteData(fid,md.thermalconductivity,'Scalar','thermalconductivity');
+WriteData(fid,md.min_thermal_constraints,'Integer','min_thermal_constraints');
+WriteData(fid,md.mixed_layer_capacity,'Scalar','mixed_layer_capacity');
+WriteData(fid,md.thermal_exchange_velocity,'Scalar','thermal_exchange_velocity');
+
+%Rifts
+WriteData(fid,md.numrifts,'Integer','numrifts');
+for i=1:md.numrifts,
+	WriteData(fid,md.rifts(i).penaltypairs,'Mat',['penaltypairs' num2str(i)]);
+	WriteData(fid,md.rifts(i).fill,'Scalar',['fill' num2str(i)]);
+	WriteData(fid,md.rifts(i).friction,'Scalar',['friction' num2str(i)]);
+end
+	
+%Get penalties to connect collapsed and non-collapsed 3d meshes: 
+if strcmpi(md.type,'3d'),
+	WriteData(fid,md.penalties,'Mat','penalties');
+end
+
+%close file
+st=fclose(fid);
+if st==-1,
+	error(['marshall error message: could not close file ' [md.name '.bin']]);
+end
+
+end
+
+
+function marshallusage();
+disp(' ');
+disp('function marshall(md,solutiontype)');
+disp(' marshall: output Cielo compatible binary file from @model md, for certain solution type.');
+disp('             solutiontype can be ''diagnostic'',''prognostic'' or ''control''. ');
+disp('             This binary file will be used for parallel runs in cielo.');
+disp('INPUT function marshall(md,solutiontype)');
+end
Index: /issm/trunk/src/m/classes/public/mesh.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/mesh.m	(revision 1)
@@ -0,0 +1,91 @@
+function md=mesh(md,domainname,varargin)
+%MESH - create model mesh
+%
+%   This routine creates a model mesh using TriMesh and a domain outline, to within a certain resolution
+%   where md is a @model object, domainname is the name of an Argus domain outline file, 
+%   and resolution is a characteristic length for the mesh (same unit as the domain outline
+%   unit). Riftname is an optional argument (Argus domain outline) describing rifts.
+%
+%   Usage:
+%      md=mesh(md,domainname,resolution)
+%   or md=mesh(md,domainname,riftname, resolution)
+%
+%   Examples:
+%      md=mesh(md,'DOmainOutline.exp',1000);
+%      md=mesh(md,'DOmainOutline.exp','Rifts.exp',1500);
+
+%Figure out a characteristic area. Resolution is a grid oriented concept (ex a 1000m  resolution grid would 
+%be made of 1000*1000 area squares). 
+if (nargin==3),
+	resolution=varargin{1};
+	riftname='';
+end
+if (nargin==4),
+	riftname=varargin{1};
+	resolution=varargin{2};
+end
+
+%Check that mesh was not already run, and warn user: 
+if subsref(md,struct('type','.','subs','counter'))>=1,
+	choice=input('This model already has a mesh. Are you sure you want to go ahead? (y/n)','s');
+	if ~strcmp(choice,'y')
+		error('no meshing done ... exiting');
+	end
+end
+
+area=resolution^2;
+
+%Mesh using TriMesh
+if strcmp(riftname,''),
+	[md.elements,md.x,md.y,md.segments,md.segmentmarkers]=TriMesh(domainname,area,'yes');
+else
+	[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area,'yes');
+
+	%check that all the created grids belong to at least one element
+	orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
+	for i=1:length(orphan),
+		%get rid of the orphan grid i
+		%update x and y
+		x=[x(1:orphan(i)-(i-1)-1); x(orphan(i)-(i-1)+1:end)];
+		y=[y(1:orphan(i)-(i-1)-1); y(orphan(i)-(i-1)+1:end)];
+		%update elements
+		pos=find(elements>orphan(i)-(i-1));
+		elements(pos)=elements(pos)-1;
+		%update segments
+		pos1=find(segments(:,1)>orphan(i)-(i-1));
+		pos2=find(segments(:,2)>orphan(i)-(i-1));
+		segments(pos1,1)=segments(pos1,1)-1;
+		segments(pos2,2)=segments(pos2,2)-1;
+	end
+
+	%plug into md
+	md.x=x;
+	md.y=y;
+	md.elements=elements;
+	md.segments=segments;
+	md.segmentmarkers=segmentmarkers;
+end
+
+%Fill in rest of fields:
+md.numberofelements=length(md.elements);
+md.numberofgrids=length(md.x);
+md.z=zeros(md.numberofgrids,1);
+md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
+md.gridonbed=ones(md.numberofgrids,1);
+md.gridonsurface=ones(md.numberofgrids,1);
+md.elementonbed=ones(md.numberofelements,1);
+md.elementonsurface=ones(md.numberofelements,1);
+
+%outline names
+md.domainoutline=readfile(domainname);
+if strcmp(riftname,''),
+	md.riftoutline='';
+else
+	md.riftoutline=readfile(riftname);
+end
+
+%type of model
+md.type='2d';
+	
+%augment counter  keeping track of what has been done to this model
+md.counter=1;
Index: /issm/trunk/src/m/classes/public/mesh2.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh2.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/mesh2.m	(revision 1)
@@ -0,0 +1,73 @@
+function md2=mesh2(md,domainname,varargin)
+%MESH - create model mesh
+%
+%   This routine creates a model mesh using TriMesh and a domain outline, to within a certain resolution
+%   where md is a @model object, domainname is the name of an Argus domain outline file, 
+%   and resolution is a characteristic length for the mesh (same unit as the domain outline
+%   unit). Riftname is an optional argument (Argus domain outline) describing rifts.
+%
+%   Usage:
+%      md2=mesh2(md,domainname,resolution)
+%   or md2=mesh2(md,domainname,riftname, resolution)
+%
+%   Examples:
+%      md2=mesh2(md,'DOmainOutline.exp',1000);
+%      md2=mesh2(md,'DOmainOutline.exp','Rifts.exp',1500);
+
+%Figure out a characteristic area. Resolution is a grid oriented concept (ex a 1000m  resolution grid would 
+%be made of 1000*1000 area squares). 
+if (nargin==3),
+	resolution=varargin{1};
+	riftname='';
+end
+if (nargin==4),
+	riftname=varargin{1};
+	resolution=varargin{2};
+end
+
+%Check that mesh was not already run, and warn user: 
+if subsref(md,struct('type','.','subs','counter'))>=1,
+	choice=input('This model already has a mesh. Are you sure you want to go ahead? (y/n)','s');
+	if ~strcmp(choice,'y')
+		error('no meshing done ... exiting');
+	end
+end
+
+area=resolution^2;
+%Initialize return model;
+md2=model;
+
+%Mesh using TriMesh
+if strcmp(riftname,''),
+	[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,area,'yes');
+else
+	[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area,'yes');
+end
+
+md2=subsasgn(md2,struct('type','.','subs','elements'),elements); 
+md2=subsasgn(md2,struct('type','.','subs','segmentmarkers'),segmentmarkers); 
+md2=subsasgn(md2,struct('type','.','subs','segments'),segments); 
+md2=subsasgn(md2,struct('type','.','subs','y'),y);
+md2=subsasgn(md2,struct('type','.','subs','x'),x); 
+
+%Fill in rest of fields:
+md2=subsasgn(md2,struct('type','.','subs','numberofelements'),length(elements));
+md2=subsasgn(md2,struct('type','.','subs','numberofgrids'),length(x));
+md2=subsasgn(md2,struct('type','.','subs','z'),zeros(length(x),1));
+gridonboundary=zeros(length(x),1); gridonboundary(segments(:,1:2))=1;
+md2=subsasgn(md2,struct('type','.','subs','gridonboundary'),gridonboundary);
+md2=subsasgn(md2,struct('type','.','subs','elements_type'),3*ones(md2.numberofelements,1)); % type determined by number of grids per element
+
+%outline names
+md2=subsasgn(md2,struct('type','.','subs','domainoutline'),readfile(domainname));
+if strcmp(riftname,''),
+	md2=subsasgn(md2,struct('type','.','subs','riftoutline'),'');
+else
+	md2=subsasgn(md2,struct('type','.','subs','riftoutline'),readfile(riftname));
+end
+
+%type of model
+md2=subsasgn(md2,struct('type','.','subs','type'),'2d');
+	
+%augment counter  keeping track of what has been done to this model
+md2=subsasgn(md2,struct('type','.','subs','counter'),1);
Index: /issm/trunk/src/m/classes/public/meshadaptation.m
===================================================================
--- /issm/trunk/src/m/classes/public/meshadaptation.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/meshadaptation.m	(revision 1)
@@ -0,0 +1,100 @@
+function md2=meshadaptation(md,field,scale,epsilon)
+%MESHADAPTATION - remesh a model for a given field
+%
+%   remesh a model for a given field, use the hessian computation to spread the error on the element
+%   scale: 1.2 large scale leads to higher refining.
+%   epsilon: .5  large epsilon will refine fewer elements
+%
+%   Usage:
+%      md2=meshadaptation(md,field,scale,epsilon)
+%
+%   Example:
+%      md2=meshadaptation(md,md.vel,1.2,0.5);
+
+%some checks
+if ~strcmpi(md.type,'2d')
+	error('meshadaptation error message: adaptation for 3d meshes not implemented yet')
+end
+if length(field)~=md.numberofgrids
+	error('meshadaptation error message: input field length shoud be numberofgrids')
+end
+
+disp(sprintf('      metric computation') )
+
+%load some variables (it is much faster if the variab;es are loaded from md once for all) 
+numberofelements=md.numberofelements;
+numberofgrids=md.numberofgrids;
+index=md.elements;
+x=md.x; y=md.y; z=md.z;
+
+%initialization
+alpha=zeros(md.numberofelements,3);
+beta=zeros(md.numberofelements,3);
+gradx=zeros(md.numberofgrids,1);
+grady=zeros(md.numberofgrids,1);
+metric=zeros(md.numberofelements,1);
+
+%build some usefull variables
+field=field(:);
+line=index(:);
+summation=1/3*ones(3,1);
+linesize=3*numberofelements;
+x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3)); y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
+
+%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
+invdet=1./(x1.*(y2-y3)-x2.*(y1-y3)+x3.*(y1-y2));
+alpha=[invdet.*(y2-y3) invdet.*(y3-y1) invdet.*(y1-y2)];
+beta=[invdet.*(x3-x2) invdet.*(x1-x3) invdet.*(x2-x1)];
+
+%Compute gradient for each element
+grad_elx=sum(field(index).*alpha,2); 
+grad_ely=sum(field(index).*beta,2);
+
+%compute the volume of each element
+areas=area(md);
+
+%update weights that holds the volume of all the element holding the grid i
+weights=sparse(line,ones(linesize,1),repmat(areas,3,1),numberofgrids,1);
+
+%Compute gradient for each grid (average of the elements around)
+gradx=sparse(line,ones(linesize,1),repmat(areas.*grad_elx,3,1),numberofgrids,1);
+grady=sparse(line,ones(linesize,1),repmat(areas.*grad_ely,3,1),numberofgrids,1);
+gradx=gradx./weights;
+grady=grady./weights;
+
+%Compute hessian for each element
+hessian=[sum(gradx(index).*alpha,2) sum(grady(index).*beta,2) sum(grady(index).*alpha,2)];
+
+%Compute the new metric
+hmin=min(sqrt(areas))/scale;
+hmax=max(sqrt(areas));
+
+%first, find the eigen values of eah line of H=[hessian(i,1) hessian(i,3); hessian(i,3)  hessian(i,2)]
+a=hessian(:,1); b=hessian(:,3); d=hessian(:,2);
+lambda1=0.5*((a+d)+sqrt(4*b.^2+(a-d).^2));
+lambda2=0.5*((a+d)-sqrt(4*b.^2+(a-d).^2));
+
+%Modify the eigen values to control the shape of the elements
+lambda1=min(max(abs(lambda1)/epsilon,1/hmax^2),1/hmin^2);
+lambda2=min(max(abs(lambda2)/epsilon,1/hmax^2),1/hmin^2);
+
+%find the corresponding eigen vectors of the initial eigen values
+%NOT USED FOR NOW
+%div1=sqrt(1+(b./(lambda1-d)).^2);
+%div2=sqrt(1+(b./(lambda2-d)).^2);
+%vector1=[1./div1 (b./(lambda1-d))./div1];
+%vector2=[1./div2 (b./(lambda2-d))./div2];
+
+%compute the metric
+%R=[vector1(:,1) vector2(:,1) vector1(:,2) vector2(:,2)];
+%det=vector1(:,1).*vector2(:,2)-vector1(:,2).*vector1(:,2);
+%Rinv=[vector2(:,2)./det   -vector2(:,1)./det   -vector1(:,2)./det   vector1(:,1)./det];
+metric=20*1./sqrt(lambda1.^2+lambda2.^2);
+
+%ok, metric can't go under 1km resolution.
+metric(find(metric<10^6))=10^6;
+
+%Remesh with this new metric
+disp(sprintf('      initial number of element: %i', md.numberofelements))
+md2=meshrefine(md,full(metric));
+disp(sprintf('      new number of elements:    %i', md2.numberofelements))
Index: /issm/trunk/src/m/classes/public/meshexprefine.m
===================================================================
--- /issm/trunk/src/m/classes/public/meshexprefine.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/meshexprefine.m	(revision 1)
@@ -0,0 +1,59 @@
+function md=meshexprefine(md,domainname,newresolution)
+%MESHEXPREFINE - refine mesh from a model
+%
+%   This routine refines a mesh for a given area using an Argus domain outline 
+%   and a new resolution for this domain.
+%   Appending ~ at the beginning of domainname will make this routine refine
+%   the elements which are not in the domain outline. 
+%   newresolution is the resolution to which the flagged elements must be refined.
+%
+%   Usage:
+%      md=meshexprefine(md,domainname,newresolution)
+%
+%   Example:
+%      md=meshexprefine(md,'RefineAreas.exp',1000)
+
+%some checks on list of arguments
+if ((nargin~=3) | (nargout~=1)),
+	meshexprefineusage();
+	error('meshexprefine error message');
+end
+
+if ~ischar(domainname) 
+	meshexprefineusage();
+	error('meshexprefine error message');
+end
+
+if (md.counter<1)
+	error('meshexprefine error message: you need to run mesh.m first on this model');
+end
+
+%Check the first letter of domainname, if it is ~, then we need to strip it away from 
+%domainname. The subsequent refinement will be done on the mask of the domain outline.
+if strcmpi(domainname(1),'~'),
+	mask=1;
+	domainname=domainname(2:length(domainname));
+else
+	mask=0;
+end
+
+%Read domainname file into a matlab array (x,y):
+refinearea=ArgusContourToMesh(md.elements,md.x,md.y,expread(domainname,1),'element',1);
+aires=area(md);
+
+%flags areas within the domain
+if mask==1,
+	pos=find(~refinearea);
+else
+	pos=find(refinearea);
+end
+aires(pos)=newresolution*newresolution/2; %triangle area
+
+pos=find(refinearea);
+aires(pos)=2*aires(pos); %be sure this does not get refined.
+
+%refine using the new area vector
+md=meshrefine(md,aires);
+
+%return model
+end
Index: /issm/trunk/src/m/classes/public/meshprocessrifts.m
===================================================================
--- /issm/trunk/src/m/classes/public/meshprocessrifts.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/meshprocessrifts.m	(revision 1)
@@ -0,0 +1,31 @@
+function md=meshprocessrifts(md)
+%MESHPROCESSRIFTS - process mesh when rifts are present
+%
+%   split rifts inside mesh (rifts are defined by presence of
+%   segments inside the domain outline)
+%
+%   Usage:
+%      md=meshprocessrifts(md)
+
+%some checks on list of arguments
+if ((nargin~=1) | (nargout~=1)),
+	meshprocessriftsusage();
+	error('meshprocessrifts error message');
+end
+
+[md.elements,md.x,md.y,md.segments,md.segmentmarkers,md.rifts]=TriMeshProcessRifts(md.elements,md.x,md.y,md.segments,md.segmentmarkers);
+
+%Fill in rest of fields:
+md.numberofelements=length(md.elements);
+md.numberofgrids=length(md.x);
+md.z=zeros(md.numberofgrids,1);
+md.gridonboundary=zeros(length(md.x),1); md.gridonboundary(md.segments(:,1:2))=1;
+md.numrifts=length(md.rifts);
+md.elements_type=3*ones(md.numberofelements,1);
+md.gridonbed=ones(md.numberofgrids,1);
+md.gridonsurface=ones(md.numberofgrids,1);
+md.elementonbed=ones(md.numberofelements,1);
+md.elementonsurface=ones(md.numberofelements,1);
+
+function meshprocessriftsusage(),
+disp('usage: md=meshprocessrifts(md)');
Index: /issm/trunk/src/m/classes/public/meshrefine.m
===================================================================
--- /issm/trunk/src/m/classes/public/meshrefine.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/meshrefine.m	(revision 1)
@@ -0,0 +1,40 @@
+function md=meshrefine(md,areas)
+%MESHREFINE:  refined the mesh from a model, according to an area metric.
+%
+%   Usage:
+%      md=meshrefine(md,metric)
+
+%some checks on list of arguments
+if ((nargin~=2) | (nargout~=1)),
+	meshrefineusage();
+	error('meshrefine error message');
+end
+if ( (isempty(areas)) |  (length(areas)~=md.numberofelements) | (length(find(isnan(areas))))),
+	meshrefineusage();
+	error('meshrefine error message');
+end
+
+%Refine using TriMeshRefine
+%[md.elements,md.x,md.y,md.segments,md.rifts]=TriMeshRefine(md.elements,md.x,md.y,md.segments,md.rifts,areas,'yes');
+[md.elements,md.x,md.y,md.segments,md.segmentmarkers]=TriMeshRefine(md.elements,md.x,md.y,md.segments,md.segmentmarkers,areas,'yes');
+
+%Fill in rest of fields:
+md.numberofelements=length(md.elements);
+md.numberofgrids=length(md.x);
+md.z=zeros(md.numberofgrids,1);
+md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
+md.gridonbed=ones(md.numberofgrids,1);
+md.gridonsurface=ones(md.numberofgrids,1);
+md.elementonbed=ones(md.numberofelements,1);
+md.elementonsurface=ones(md.numberofelements,1);
+
+%type of model
+md.type='2d';
+	
+%augment counter  keeping track of what has been done to this model
+md.counter=1;
+end
+
+function meshrefineusage(),
+disp('usage: md=meshrefine(md,areas)');
+end
Index: /issm/trunk/src/m/classes/public/model2ocmodel.m
===================================================================
--- /issm/trunk/src/m/classes/public/model2ocmodel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/model2ocmodel.m	(revision 1)
@@ -0,0 +1,26 @@
+function md2=model2ocmodel(md,repository)
+%MODEL2OCMODEL - create an out of core model
+%
+%   This routine will take an input model, running in core (ie: md.repository=''),
+%   and copy all its fields to an output model which will run out of core on 'repository'.
+%
+%   Usage:
+%      md2=model2ocmodel(md,repository);
+%
+%   Example:
+%      md2=model2ocmodel(md,'PineIsland');
+
+md2=model(repository);
+
+structfields=fields(md);
+for i=1:length(structfields),
+	field=structfields(i);field=field{1};
+	if strcmpi(field,'repository'),
+		%we don't want to clobber md2.repository!
+		continue;
+	end
+	fieldval=getfield(md,field);
+	if isfield(struct(md2),field),
+	eval(['md2.' field '=fieldval;']);
+	end
+end
Index: /issm/trunk/src/m/classes/public/modelextract.m
===================================================================
--- /issm/trunk/src/m/classes/public/modelextract.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/modelextract.m	(revision 1)
@@ -0,0 +1,354 @@
+function md2=modelextract(md1,area)
+%MODELEXTRACT - extract a model according to an Argus contour or flag list
+%
+%   This routine extracts a submodel from a bigger model with respect to a given contour
+%   md must be followed by the corresponding exp file or flags list
+%   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+%   If user wants every element outside the domain to be 
+%   modelextractd, add '~' to the name of the domain file (ex: '~Pattyn.exp');
+%   an empty string '' will be considered as an empty domain
+%   a string 'all' will be considered as the entire domain
+%
+%   Usage:
+%      md2=modelextract(md1,area);
+%
+%   Examples:
+%      md2=modelextract(md,'Domain.exp');
+%      md2=modelextract(md,md.elementoniceshelf);
+%
+%   See also: EXTRUDE, COLLAPSE
+
+%some checks on list of arguments
+if ((nargin~=2) | (nargout~=1)),
+	error('modelextract error message');
+end
+package='Ice';
+
+%first
+if ischar(area),
+	if isempty(area),
+		flag_elem=zeros(md1.numberofelements,1);
+		invert=0;
+	elseif strcmpi(area,'all')
+		flag_elem=ones(md1.numberofelements,1);
+		invert=0;
+	else
+		%make sure that we actually don't want the elements outside the domain outline!
+		if strcmpi(area(1),'~'),
+			area=area(2:length(area));
+			invert=1;
+		else
+			invert=0;
+		end
+		%ok, flag_elem elements
+		A=expread(area,1);
+		flag_elem=ArgusContourToMesh(md1.elements(:,1:3),md1.x,md1.y,A,'element',1);
+		%check that the elements do not cross the contour -> flag as 0
+		pos=find(flag_elem);
+		for contour=1:length(A)
+			for i=1: length(pos)
+				test=cross_extract(md1.x(md1.elements(pos(i),:)),md1.y(md1.elements(pos(i),:)),A(contour).x,A(contour).y);
+				if test
+					flag_elem(pos(i))=0;
+				end
+			end
+		end
+	end
+	if invert,
+		flag_elem=~flag_elem;
+	end
+elseif isfloat(area),
+	if size(area,1)~=md1.numberofelements,
+		setelementstypeusage();
+		error('Flags must be of same size as number of elements in model');
+	end
+	flag_elem=area;
+else
+	error('Invalide option');
+end
+pos_elem=find(flag_elem);
+
+%get the flags of grids
+flag_grid=ismember([1:md1.numberofgrids]',sort(unique(md1.elements(pos_elem,:)))');
+pos_grid=find(flag_grid);
+
+%keep track of some fields
+numberofgrids1=md1.numberofgrids;
+numberofelements1=md1.numberofelements;
+numberofgrids2=length(pos_grid);
+numberofelements2=length(pos_elem);
+
+%Create Pelem and Pgrid (transform old grids in new grids and same thing for the elements)
+Pelem=zeros(numberofelements1,1);
+Pelem(pos_elem)=[1:numberofelements2]';
+Pgrid=zeros(numberofgrids1,1);
+Pgrid(pos_grid)=[1:numberofgrids2]';
+
+%renumber the elements (some grid won't exist anymore)
+elements_1=md1.elements;
+elements_2=elements_1(pos_elem,:);
+
+elements_2(:,1)=Pgrid(elements_2(:,1));
+elements_2(:,2)=Pgrid(elements_2(:,2));
+elements_2(:,3)=Pgrid(elements_2(:,3));
+if strcmpi(md1.type,'3d'),
+	elements_2(:,4)=Pgrid(elements_2(:,4));
+	elements_2(:,5)=Pgrid(elements_2(:,5));
+	elements_2(:,6)=Pgrid(elements_2(:,6));
+end
+
+%OK, now create the new model !
+
+	%take every fields from model
+	md2=md1;
+
+	%Mesh
+	md2.numberofelements=numberofelements2;
+	md2.numberofgrids=numberofgrids2;
+	md2.elements=elements_2;
+	if ~isnan(md2.elements_type), md2.elements_type=md1.elements_type(pos_elem,:);end
+	md2.x=md1.x(pos_grid);
+	md2.y=md1.y(pos_grid);
+	md2.z=md1.z(pos_grid);
+	if ~isnan(md2.bed_slopex), md2.bed_slopex=md1.bed_slopex(pos_grid); end;
+	if ~isnan(md2.bed_slopey), md2.bed_slopex=md1.bed_slopey(pos_grid); end;
+	if ~isnan(md2.surface_slopex), md2.surface_slopex=md1.surface_slopex(pos_grid); end;
+	if ~isnan(md2.surface_slopey), md2.surface_slopex=md1.surface_slopey(pos_grid); end;
+
+	%Initial 2d mesh 
+	if strcmpi(md1.type,'3d')
+		flag_elem_2d=flag_elem(1:md1.numberofelements2d);
+		pos_elem_2d=find(flag_elem_2d);
+		flag_grid_2d=flag_grid(1:md1.numberofgrids2d);
+		pos_grid_2d=find(flag_grid_2d);
+
+		md2.numberofelements2d=length(pos_elem_2d);
+		md2.numberofgrids2d=length(pos_grid_2d);
+		md2.elements2d=md1.elements2d(pos_elem_2d,:);
+		md2.elements2d(:,1)=Pgrid(md2.elements2d(:,1));
+		md2.elements2d(:,2)=Pgrid(md2.elements2d(:,2));
+		md2.elements2d(:,3)=Pgrid(md2.elements2d(:,3));
+
+		if ~isnan(md2.elements_type2d), md2.elements_type2d=md1.elements_type2d(pos_elem_2d,:); end;
+		md2.x2d=md1.x(pos_grid_2d);
+		md2.y2d=md1.y(pos_grid_2d);
+		md2.z2d=md1.z(pos_grid_2d);
+	end
+		
+	%Elements
+	if ~isnan(md2.elementonhutter), md2.elementonhutter=md1.elementonhutter(pos_elem); end;
+	if ~isnan(md2.elementonmacayeal), md2.elementonmacayeal=md1.elementonmacayeal(pos_elem); end;
+	if ~isnan(md2.elementonpattyn), md2.elementonpattyn=md1.elementonpattyn(pos_elem); end;
+	if ~isnan(md2.elementonstokes), md2.elementonstokes=md1.elementonstokes(pos_elem); end;
+
+	%Nodes
+	if ~isnan(md2.gridonhutter), md2.gridonhutter=md1.gridonhutter(pos_grid); end;
+	if ~isnan(md2.gridonmacayeal), md2.gridonmacayeal=md1.gridonmacayeal(pos_grid); end;
+	if ~isnan(md2.gridonpattyn), md2.gridonpattyn=md1.gridonpattyn(pos_grid); end;
+	if ~isnan(md2.gridonstokes), md2.gridonstokes=md1.gridonstokes(pos_grid); end;
+	
+	%Penalties
+	if ~isnan(md2.penalties),
+		for i=1:size(md1.penalties,1);
+			md2.penalties(i,:)=Pgrid(md1.penalties(i,:));
+		end
+		md2.penalties=md2.penalties(find(md2.penalties(:,1)),:);
+	end
+	md2.rifts=NaN; %????????????????????????????
+	md2.numrifts=0;%????????????????????????????
+
+	%Projections
+	if ~isnan(md2.uppergrids), md2.uppergrids=Pgrid(md1.uppergrids(pos_grid)); end;
+	if ~isnan(md2.lowergrids), md2.lowergrids=Pgrid(md1.lowergrids(pos_grid)); end;
+	if ~isnan(md2.deadgrids), md2.deadgrids=md1.deadgrids(pos_grid);end;
+	
+	%Extrusion
+	md2.elementonbed=md1.elementonbed(pos_elem);
+	md2.elementonsurface=md1.elementonsurface(pos_elem);
+	md2.gridonbed=md1.gridonbed(pos_grid);
+	md2.gridonsurface=md1.gridonsurface(pos_grid);
+	if ~isnan(md2.firn_layer), md2.firn_layer=md1.firn_layer(pos_grid); end;
+	
+	%Physical parameters
+	if ~isnan(md2.drag), md2.drag=md1.drag(pos_grid);end;
+	if ~isnan(md2.p), md2.p=md1.p(pos_elem);end;
+	if ~isnan(md2.q), md2.q=md1.q(pos_elem);end;
+	if ~isnan(md2.n), md2.n=md1.n(pos_elem);end;
+	if ~isnan(md2.B), md2.B=md1.B(pos_grid);end;
+
+	%Geometrical parameters
+	if ~isnan(md2.elementoniceshelf), md2.elementoniceshelf=md1.elementoniceshelf(pos_elem);end;
+	if ~isnan(md2.elementonicesheet), md2.elementonicesheet=md1.elementonicesheet(pos_elem);end;
+	if ~isnan(md2.gridoniceshelf), md2.gridoniceshelf=md1.gridoniceshelf(pos_grid);end;
+	if ~isnan(md2.gridonicesheet), md2.gridonicesheet=md1.gridonicesheet(pos_grid);end;
+	if ~isnan(md2.surface), md2.surface=md1.surface(pos_grid); end;
+	if ~isnan(md2.thickness), md2.thickness=md1.thickness(pos_grid); end;
+	if ~isnan(md2.new_thickness), md2.new_thickness=md1.new_thickness(pos_grid); end;
+	if ~isnan(md2.bed), md2.bed=md1.bed(pos_grid); end;
+
+	%Boundary conditions
+	md2.gridonboundary=md1.gridonboundary(pos_grid);
+
+	%Diagnostic
+	if ~isnan(md2.segmentonneumann_diag)
+		md2.segmentonneumann_diag(:,1)=Pgrid(md1.segmentonneumann_diag(:,1)); 
+		md2.segmentonneumann_diag(:,2)=Pgrid(md1.segmentonneumann_diag(:,2)); 
+		md2.segmentonneumann_diag(:,end)=Pelem(md1.segmentonneumann_diag(:,end)); 
+		if strcmpi(md1.type,'3d')
+			md2.segmentonneumann_diag(:,3)=Pgrid(md1.segmentonneumann_diag(:,3)); 
+			md2.segmentonneumann_diag(:,4)=Pgrid(md1.segmentonneumann_diag(:,4)); 
+		end
+		md2.segmentonneumann_diag=md2.segmentonneumann_diag(find(md2.segmentonneumann_diag(:,1) & md2.segmentonneumann_diag(:,2)),:);
+	end
+	md2.neumannvalues_diag=NaN; %???????????????????????????
+	if ~isnan(md2.gridondirichlet_diag), md2.gridondirichlet_diag=md1.gridondirichlet_diag(pos_grid); end;
+	if ~isnan(md2.dirichletvalues_diag),
+		md2.dirichletvalues_diag=[];
+		for i=1:size(md1.dirichletvalues_diag,2)
+			md2.dirichletvalues_diag(:,i)=md1.dirichletvalues_diag(pos_grid,i);
+		end
+	end
+
+	%Thermal
+	if ~isnan(md2.gridondirichlet_thermal), md2.gridondirichlet_thermal=md1.gridondirichlet_thermal(pos_grid); end;
+	if ~isnan(md2.dirichletvalues_thermal), md2.dirichletvalues_thermal=md1.dirichletvalues_thermal(pos_grid); end;
+
+	%Transient
+	if ~isnan(md2.segmentonneumann_prog)
+		md2.segmentonneumann_prog(:,1)=Pgrid(md1.segmentonneumann_prog(:,1)); 
+		md2.segmentonneumann_prog(:,2)=Pgrid(md1.segmentonneumann_prog(:,2)); 
+		md2.segmentonneumann_prog(:,end)=Pelem(md1.segmentonneumann_prog(:,end)); 
+		md2.segmentonneumann_prog=md2.segmentonneumann_prog(find(md2.segmentonneumann_prog(:,1) & md2.segmentonneumann_prog(:,2)),:);
+	end
+	md2.neumannvalues_prog=NaN; %???????????????????????????
+	if ~isnan(md2.segmentonneumann_prog2)
+		md2.segmentonneumann_prog2(:,1)=Pgrid(md1.segmentonneumann_prog2(:,1)); 
+		md2.segmentonneumann_prog2(:,2)=Pgrid(md1.segmentonneumann_prog2(:,2)); 
+		md2.segmentonneumann_prog2(:,end)=Pelem(md1.segmentonneumann_prog2(:,end)); 
+		md2.segmentonneumann_prog2=md2.segmentonneumann_prog2(find(md2.segmentonneumann_prog2(:,1) & md2.segmentonneumann_prog2(:,2)),:);
+	end
+	md2.neumannvalues_prog=NaN; %???????????????????????????
+	if ~isnan(md2.gridondirichlet_prog), md2.gridondirichlet_prog=md1.gridondirichlet_prog(pos_grid); end;
+	if ~isnan(md2.dirichletvalues_prog), md2.dirichletvalues_prog=md1.dirichletvalues_prog(pos_grid); end;
+
+	%Observations
+	if ~isnan(md2.vx_obs), md2.vx_obs=md1.vx_obs(pos_grid); end;
+	if ~isnan(md2.vy_obs), md2.vy_obs=md1.vy_obs(pos_grid); end;
+	if ~isnan(md2.vel_obs), md2.vel_obs=md1.vel_obs(pos_grid); end;
+	if ~isnan(md2.accumulation), md2.accumulation=md1.accumulation(pos_grid); end;
+	if ~isnan(md2.geothermalflux), md2.geothermalflux=md1.geothermalflux(pos_grid); end;
+	if ~isnan(md2.observed_temperature), md2.observed_temperature=md1.observed_temperature(pos_grid); end;
+	
+	%Output parameters
+	md2.viscousheating=NaN;
+	md2.pressure_elem=NaN;
+	md2.stress=NaN;
+	md2.stress_surface=NaN;
+	md2.stress_bed=NaN;
+	md2.deviatoricstress=NaN;
+	md2.strainrate=NaN;
+
+	%Results fields
+	if ~isnan(md2.vx), md2.vx=md1.vx(pos_grid); end;
+	if ~isnan(md2.vy), md2.vy=md1.vy(pos_grid); end;
+	if ~isnan(md2.vz), md2.vz=md1.vz(pos_grid); end;
+	if ~isnan(md2.vel), md2.vel=md1.vel(pos_grid); end;
+	if ~isnan(md2.temperature), md2.temperature=md1.temperature(pos_grid); end;
+	if ~isnan(md2.melting), md2.melting=md1.melting(pos_grid); end;
+	if ~isnan(md2.pressure), md2.pressure=md1.pressure(pos_grid); end;
+
+%Now take care of the boudaries (Dirichlet).
+
+%Catch the elements that have not been extracted
+orphans_elem=find(~flag_elem);
+orphans_grid=unique(md1.elements(orphans_elem,:))';
+
+%Figure out which grid are on the boundary between md2 and md1
+gridstoflag1=intersect(orphans_grid,pos_grid);
+gridstoflag2=Pgrid(gridstoflag1);
+
+%Same thing for the elements
+flaglist=ismember(md1.elements,gridstoflag1);
+elementstoflag1=find((flaglist(:,1) | flaglist(:,2) | flaglist(:,3)) & ~flag_elem);
+flaglist=ismember(md2.elements,gridstoflag2);
+elementstoflag2=find(flaglist(:,1) | flaglist(:,2) | flaglist(:,3));
+
+%These grids are "on boundary" and hence "on dirichlet"
+test=0;
+if ~isnan(md2.gridonboundary), md2.gridonboundary(gridstoflag2)=1; end;
+if ~isnan(md2.gridondirichlet_diag), md2.gridondirichlet_diag(gridstoflag2)=1; end;
+if ~isnan(md2.gridondirichlet_prog), md2.gridondirichlet_prog(gridstoflag2)=1; end;
+if ~isnan(md2.gridondirichlet_thermal), md2.gridondirichlet_thermal(gridstoflag2)=1; end;
+if ~isnan(md2.dirichletvalues_diag), 
+	test=1; 
+	if strcmpi(md1.type,'3d')
+		if ~isnan(md2.vx) & ~isnan(md2.vy)
+			md2.dirichletvalues_diag(gridstoflag2,1)=md2.vx(gridstoflag2); 
+			md2.dirichletvalues_diag(gridstoflag2,2)=md2.vy(gridstoflag2);
+		end
+	else
+		if ~isnan(md2.vx_obs) & ~isnan(md2.vy_obs)
+			md2.dirichletvalues_diag(gridstoflag2,1)=md2.vx_obs(gridstoflag2); 
+			md2.dirichletvalues_diag(gridstoflag2,2)=md2.vy_obs(gridstoflag2);
+		end
+	end
+end
+if ~isnan(md2.dirichletvalues_prog), test=1; end;
+if ~isnan(md2.dirichletvalues_thermal), test=1; end;
+
+if test
+	disp(' ')
+	disp('!! modelextract warning: dirichlet values should be checked !!')
+	disp(' ')
+end
+
+%Keep track of pos_grid and pos_elem
+md2.extractedgrids=pos_grid;
+md2.extractedelements=pos_elem;
+
+%get segments
+elementsonboundary=find(sum(md2.gridonboundary(md2.elements),2)>=2);
+md2.segments=[];
+for i=1:length(elementsonboundary),
+	el=elementsonboundary(i);
+	for j=1:3,
+		grid1=md2.elements(el,j);
+		if (j==3),
+			grid2=md2.elements(el,1);
+		else
+			grid2=md2.elements(el,j+1);
+		end
+		%ok, [grid1,grid2] are a segment only if they belong to one element
+		pos=find(    ((md2.elements(:,1)==grid1) | (md2.elements(:,2)==grid1) | (md2.elements(:,3)==grid1)) & ...
+		            ((md2.elements(:,1)==grid2) | (md2.elements(:,2)==grid2) | (md2.elements(:,3)==grid2))...
+				);
+	    if length(pos)==1,
+			md2.segments=[md2.segments; [grid1 grid2 pos]];
+		end
+	end
+end
+md2.segmentmarkers=ones(size(md2.segments,1));
+
+
+end %function
+
+function bool=cross_extract(x1,y1,x2,y2);
+%return 1 if the polygon defined by (x1,y1) crosses the polygon defined by (x2,y2)
+	x1 = x1(:); y1 = y1(:);
+	x2 = x2(:); y2 = y2(:);
+	l1 = length(x1);
+	l2 = length(x2);
+
+	% Indexing
+	[i11,i12] = meshgrid(1:l1,1:l2);
+	[i21,i22] = meshgrid([2:l1 1],[2:l2 1]);
+	i11 = i11(:); i12 = i12(:);
+	i21 = i21(:); i22 = i22(:);
+
+	% Calculate matrix of intersections
+	S = iscross([x1(i11) x1(i21)]',[y1(i11) y1(i21)]',...
+		[x2(i12) x2(i22)]',[y2(i12) y2(i22)]')';
+	S(find(S==0.5))=0;
+
+	bool=any(any(S));
+end
Index: /issm/trunk/src/m/classes/public/modelzoom.m
===================================================================
--- /issm/trunk/src/m/classes/public/modelzoom.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/modelzoom.m	(revision 1)
@@ -0,0 +1,113 @@
+function md2=modelzoom(md,areaname)
+%MODELZOOM - exctract a smaller model out of a large one. 
+%
+%   It is used to be able to plot large models, one area at a time. 
+%   Be careful: usage is: md2=modelzoom(md,areaname) where md2 is the returned 
+%   model, md the large input model, and areaname the name of the area wherefrom 
+%   the smaller model should be extracted. 
+%   Because this is intended for mainly plotting purposes, the private member segments will 
+%   not be extracted. Ie: this model cannot be used for solving.
+%
+%   Usage:
+%      md2=modelzoom(md,areaname)
+%
+%   Example:
+%      md2=modelzoom(md,'pineislandglacier');
+%
+%   See also: MODELEXTRACT
+
+%some checks on list of arguments
+if ((nargin~=2) | (nargout~=1)),
+	modelzoomusage();
+	error('modelzoom error message');
+end
+
+[xlim0 ylim0]=antmodelzoom(areaname);
+
+%Create a list of elements locations from the input model
+xel=(md.x(md.elements(:,1))+md.x(md.elements(:,2))+md.x(md.elements(:,3)))/3;
+yel=(md.y(md.elements(:,1))+md.y(md.elements(:,2))+md.y(md.elements(:,3)))/3;
+
+%Figure out which elements are within the area: 
+elementlist=find( (xel>xlim0(1)) & (xel<xlim0(2)) & (yel>ylim0(1)) & (yel<ylim0(2)) );
+
+%Create a list of elements locations from the input model, which are on the segmentonneumann_diag: 
+if(~isempty(md.segmentonneumann_diag)),
+	xelneumann=(md.x(md.elements(md.segmentonneumann_diag(:,3),1))+md.x(md.elements(md.segmentonneumann_diag(:,3),2))+md.x(md.elements(md.segmentonneumann_diag(:,3),3)))/3;
+	yelneumann=(md.y(md.elements(md.segmentonneumann_diag(:,3),1))+md.y(md.elements(md.segmentonneumann_diag(:,3),2))+md.y(md.elements(md.segmentonneumann_diag(:,3),3)))/3;
+	%Figure out which elements are within the area, and on segmentonneumann_diag: 
+	elementlistneumann=find( (xelneumann>xlim0(1)) & (xelneumann<xlim0(2)) & (yelneumann>ylim0(1)) & (yelneumann<ylim0(2)) );
+end
+
+
+%Figure out the corresponding grids in the area: 
+flags=zeros(md.numberofgrids,1);
+flags(md.elements(elementlist,1))=1;
+flags(md.elements(elementlist,2))=1;
+flags(md.elements(elementlist,3))=1;
+gridlist=find(flags);
+
+%Reverse indexing
+gridpos=zeros(md.numberofgrids,1);
+gridpos(gridlist)=1:1:length(gridlist);
+elempos=zeros(md.numberofelements,1);
+elempos(elementlist)=1:1:length(elementlist);
+
+%Create output model: 
+md2=model;
+md2.numberofgrids=length(gridlist);
+md2.numberofelements=length(elementlist);
+
+structfields=fields(md);
+for i=1:length(structfields),
+	field=structfields(i);field=field{1};
+	fieldval=getfield(md,field);
+
+	if isnumeric(fieldval),
+		if isempty(fieldval),
+			md2=setfield(md2,field,fieldval);
+		end
+		if length(fieldval)==md.numberofgrids,
+			fieldval=fieldval(gridlist);
+			md2=setfield(md2,field,fieldval);
+		end
+		if length(fieldval)==md.numberofelements,
+			if strcmp(field,'elements'),
+				fieldval=fieldval(elementlist,:);
+				md2=setfield(md2,field,fieldval);
+				%Now, we need to reset the element grid ids to the 
+				%new mesh grid ids.
+				md2.elements(:)=gridpos(md2.elements(:));
+			else
+				fieldval=fieldval(elementlist,:);
+				md2=setfield(md2,field,fieldval);
+			end
+		end
+		if isscalar(fieldval),
+			if (~(strcmp(field,'numberofelements') | strcmp(field,'numberofgrids')))
+				md2=setfield(md2,field,fieldval);
+			end
+		end
+	end
+	if ischar(fieldval),
+		md2=setfield(md2,field,fieldval);
+	end
+end
+
+%Deal with segmentonneumann_diag: 
+if(~isempty(md.segmentonneumann_diag)),
+	md2.segmentonneumann_diag=md.segmentonneumann_diag(elementlistneumann,:);
+	md2.segmentonneumann_diag(:,1)=gridpos(md2.segmentonneumann_diag(:,1));
+	md2.segmentonneumann_diag(:,2)=gridpos(md2.segmentonneumann_diag(:,2));
+	md2.segmentonneumann_diag(:,3)=elempos(md2.segmentonneumann_diag(:,3));
+end
+
+%Add a note: 
+md2=addnote(md2,['This model is a modelzoom on area: ' areaname]);
+end %end of function
+
+
+function modelzoomusage(),
+disp('md2=modelzoom(md,areaname');
+end %end of function
+
Index: /issm/trunk/src/m/classes/public/parameterize.m
===================================================================
--- /issm/trunk/src/m/classes/public/parameterize.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/parameterize.m	(revision 1)
@@ -0,0 +1,53 @@
+function md=parameterize(md,parametername)
+%PARAMETERIZE - parameterize a model
+%
+%   from a parameter matlab file, start filling in all the @model fields that were not 
+%   filled in by the mesh.m and geography.m @model methods.
+%   Warning: the paramter file must be able to be run in Matlab
+%
+%   Usage:
+%      md=parameterize(md,parametername)
+%
+%   Example:
+%      md=parameterize(md,'Square.par');
+
+if md.counter>=4,
+	choice=input('This model already has parameters and has been extruded. Are you sure you want to go ahead? (y/n)','s');
+	if ~strcmp(choice,'y')
+		error('no parameters done ... exiting');
+	end
+elseif md.counter==3
+	disp('This model already has parameters, overwriting...')
+else
+	if (md.counter~=2)
+		error('parameterize error message: you need to run geography.m first on this model');
+	else
+		md.counter=3;
+	end
+end
+
+%Try and run parameter file. We try to capture the error message, but this is not allowed for 
+%lower versions of matlab.
+
+stringfile=readfile(parametername);
+stringlines=strsplit(stringfile,char(10)); %split into lines
+
+for i=1:length(stringlines),
+	a=stringlines{i};
+	try,
+		eval(stringlines{i});
+	catch me,
+		disp(' ');
+		disp(['Error in ==> ' parametername ' at ' num2str(i)]);
+		disp(me.message);
+		disp(stringlines{i});
+		error(' ');
+	end
+end
+
+%Keep track of parameter file
+md.parameterfile=readfile(parametername);
+
+%Name and notes
+md.notes=['Model created by using parameter file: ' parametername ' on: ' datestr(now)];
+[a,root,c,d]=fileparts(parametername); md.name=root;
Index: /issm/trunk/src/m/classes/public/parseresultsfromdisk.m
===================================================================
--- /issm/trunk/src/m/classes/public/parseresultsfromdisk.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/parseresultsfromdisk.m	(revision 1)
@@ -0,0 +1,24 @@
+function results=parseresultsfromdisk(filename)
+%PARSERESULTSFROMDISK - ...
+%
+%   Usage:
+%      results=parseresultsfromdisk(filename)
+
+%Open file
+fid=fopen(filename,'rb');
+if(fid==-1),
+	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
+end
+
+results={};
+
+%Read fields until the end of the file.
+while 0<1,
+
+	result=ReadData(fid);
+	if isnan(result),
+		break;
+	else
+		results{end+1}=result;
+	end
+end
Index: /issm/trunk/src/m/classes/public/peek.m
===================================================================
--- /issm/trunk/src/m/classes/public/peek.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/peek.m	(revision 1)
@@ -0,0 +1,16 @@
+function md=peek(md)
+%PEEK - check on an existing job running on the cluster
+%
+%   Usage:
+%      md=peek(md);
+%
+%   See also: QueueJobPeek
+
+%Get cielo.rc location
+cielo_rc_location=which('cielo.rc');
+
+%Figure out parameters for this particular cluster
+[codepath,executionpath]=ProcessParallelParametersFromCieloRc(md.cluster,cielo_rc_location);
+
+%peek at the queued job
+md=QueueJobPeek(md,executionpath);
Index: /issm/trunk/src/m/classes/public/plot/applyoptions.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/applyoptions.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/applyoptions.m	(revision 1)
@@ -0,0 +1,167 @@
+function applyoptions(md,data,options_structure)
+%APPLYOPTIONS - apply the options to current plot
+%
+%   Usage:
+%      applyoptions(md,data,options_structure)
+%
+%   See also: PLOTMODEL, PARSE_OPTIONS
+
+%fontsize
+if ~isnan(options_structure.fontsize),
+	fontsize=options_structure.fontsize;
+else
+	fontsize=14;
+end
+
+%fontweight
+if ~isnan(options_structure.fontweight),
+	fontweight=options_structure.fontweight;
+else
+	fontweight='normal';
+end
+
+%title
+if ~isnan(options_structure.title),
+	title(options_structure.title,'FontSize',fontsize,'FontWeight',fontweight);
+end
+
+%xlabel
+if ~isnan(options_structure.xlabel),
+	xlabel(options_structure.xlabel,'FontSize',fontsize,'FontWeight',fontweight);
+end
+
+%ylabel
+if ~isnan(options_structure.ylabel),
+	ylabel(options_structure.ylabel,'FontSize',fontsize,'FontWeight',fontweight);
+end
+
+%zlabel
+if ~isnan(options_structure.zlabel),
+	zlabel(options_structure.zlabel,'FontSize',fontsize,'FontWeight',fontweight);
+end
+
+%view 
+if ~isnan(options_structure.view),
+	view(options_structure.view);
+end
+
+%xlim
+if ~isnan(options_structure.xlim),
+	xlim(options_structure.xlim);
+end
+
+%ylim
+if ~isnan(options_structure.ylim),
+	ylim(options_structure.ylim);
+end
+
+%zlim
+if ~isnan(options_structure.zlim),
+	zlim(options_structure.zlim);
+end
+
+%Caxis
+if ~isnan(options_structure.caxis),
+	caxis(options_structure.caxis);
+end
+
+%shading
+if ~isnan(options_structure.shading),
+	shading(options_structure.shading);
+end
+
+%grid
+if ~isnan(options_structure.grid) & strcmpi(options_structure.grid,'on'),
+	grid on;
+end
+
+%colormap
+if ~isnan(options_structure.colormap),
+	h=colormap(options_structure.colormap);
+end
+
+%wrapping
+if ~isnan(options_structure.wrapping),
+	if  isnan(options_structure.colormap)
+		h=jet;
+	end
+	colormap(repmat(h,options_structure.wrapping,1));
+end
+
+%colorbar
+if ~isnan(options_structure.colorbar),
+	if options_structure.colorbar,
+		c=colorbar;
+		if ~isnan(options_structure.wrapping)
+			lim=get(c,'Ylim');
+			lim=[lim(1) lim(1)+(lim(2)-lim(1))/options_structure.wrapping];
+			set(c,'Ylim',lim);
+		end
+		if ~isnan(options_structure.colorbarpos),
+			set(c,'Position',options_structure.colorbarpos);
+		end
+	elseif ~options_structure.colorbar,
+		colorbar('off');
+	end
+else
+	c=colorbar;
+	if ~isnan(options_structure.wrapping)
+		lim=get(c,'Ylim');
+		lim=[lim(1) lim(1)+(lim(2)-lim(1))/options_structure.wrapping];
+		set(c,'Ylim',lim);
+	end
+	if ~isnan(options_structure.colorbarpos),
+		set(c,'Position',options_structure.colorbarpos);
+	end
+end
+
+%axis
+if ~isnan(options_structure.axis)
+	eval(['axis ' options_structure.axis]);
+end
+
+%area
+if ~isnan(options_structure.area),
+	antzoom(options_structure.area);
+end
+
+%expdisp
+if iscell(options_structure.expdisp) | ~isnan(options_structure.expdisp),
+	for i=1:length(options_structure.expdisp),
+		filename=options_structure.expdisp{i};
+		style=options_structure.expstyle{i};
+		expdisp(filename,gcf,style);
+	end
+end
+
+%text (default value is empty, not NaN...)
+if ~isempty(options_structure.text)
+	for i=1:length(options_structure.text);
+		textstring=options_structure.text{i};
+		textweight=options_structure.textweight{i};
+		textsize=options_structure.textsize{i};
+		textcolor=options_structure.textcolor{i};
+		textposition=options_structure.textposition{i};
+		text(textposition(1),textposition(2),textstring,'FontSize',textsize,'FontWeight',textweight,'Color',textcolor);
+	end
+end
+
+%latlon
+if iscell(options_structure.latlon),
+	latlonoverlay(options_structure.latlon,options_structure.latlonnumbering);
+end
+
+%north arrow
+if ~isnan(options_structure.northarrow),
+	northarrow(options_structure.northarrow);
+end
+
+%Scale ruler
+if ~isnan(options_structure.scaleruler),
+	scaleruler(options_structure.scaleruler);
+end
+
+%contours
+if iscell(options_structure.contourlevels) | ~isnan(options_structure.contourlevels),
+	plot_contour(md,data,options_structure);
+end
Index: /issm/trunk/src/m/classes/public/plot/imagescnan.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/imagescnan.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/imagescnan.m	(revision 1)
@@ -0,0 +1,303 @@
+function [h,hcb] = imagescnan(x,y,U,varargin)
+%IMAGESCNAN Scale data and display as image with uncolored NaNs.
+%
+%   Syntax
+%               imagescnan(x,y,U)
+%               imagescnan(x,y,U,...,colormask)
+%               imagescnan(x,y,U,...,color)
+%               imagescnan(x,y,U,...,cbfit_opt)
+%           h = imagescnan(...);
+%     [h,hcb] = imagescnan(...,cbfit_opt);
+%
+%   Input:
+%     x          - X-axis vector data. Optional, i.e., can be empty.
+%                  Default: 1:n (rows index).
+%     y          - Y-axis vector data. Optional, i.e., can be empty.
+%                  Default: 1:m (column index).
+%     U          - Matrix [m x n] data or an RGB image [m x n x 3] (with/
+%                  without NaNs). 
+%     colormask  - Logical matrix indicating the U elements to be
+%                  uncolored, if is empty then ISNAN(U) is used. Or it can
+%                  be a single value which will be uncolored.
+%                  Default: ~isfinite(U) (NaNs and Infs elements uncolored)
+%     color      - A vector with 3 elements specifying the [R G B] color
+%                  for the NaNs color. It can be specified by the known
+%                  char colors: 'k', etcerera. Optional.  
+%                  Default: get(gca,'color') (axes background color)
+%     cbfit_opt  - Cell array with the options to call COLORBARFIT.
+%                  Default: COLORBARFIT function is not used by default.
+%
+%   Output:
+%     h   - Image handle. Optional
+%     hcb - Colorbar handle. Optional
+%
+%   Description:
+%      This function draws a matrix data as an image with uncolored NaN's
+%      elements using IMAGESC. The difference between IMAGESC and the
+%      PCOLOR, MESH or SURF function is that EVERY element is colored and
+%      no one is interpolated, besides, the pixels are centered with the
+%      axis value, although it is a flat image.
+%
+%      The color mask is added because IMAGESC do not work with NaN's, in
+%      fact it colors them with the lower value of the current colormap.
+%      
+%      The cbfit_opt is include in order to be able to define a diferent
+%      color map with the COLORBARFIT function which can be found at:
+%           http://www.mathworks.com/matlabcentral/fileexchange/.
+%      If this function is not found, a normal COLORBAR is generated.
+%
+%      The data and the colorbar are scaled with the current colormap, so,
+%      the use of COLORMAP after this function doesn't affects the
+%      generated image and colorbar! Therefore, COLORMAP and CAXIS should
+%      be used before this function.
+%
+%      Notes: * The inputs arguments for the COLORBARFIT function are 3
+%               plus the normal COLORBAR function options, for this reason,
+%               if the former is not found, the latter is used ignoring
+%               these first 3 options. Anyway, to generate a colorbar, at
+%               least an empty cell is needed for cbfit_opt = {[]}.
+%   
+%   Examples:
+%
+%      % Compares with normal IMAGESC:
+%       N = 100;
+%       PNaNs = 0.10;
+%       X = peaks(N);
+%       X(round(1 + (N^2-1).*rand(N^2*PNaNs,1))) = NaN;
+%       subplot(221), imagesc(X)
+%        title('With IMAGESC: ugly NaNs')
+%       subplot(222), imagescnan([],[],X) 
+%        title('With IMAGESCNAN: uncolored NaNs')
+%
+%      % Compares with SPY:
+%       subplot(223), spy(isnan(X))
+%        title('SPY NaNs')
+%       subplot(224), imagescnan([],[],isnan(X),0), axis equal tight
+%        title('No-NaNs with IMAGESCNAN')
+%
+%   See also IMAGE, IMAGESC, COLORBAR, IMREAD, IMWRITE and COLORBARFIT by
+%   Carlos Vargas. 
+
+%   Copyright 2008 Carlos Adrian Vargas Aguilera
+%   $Revision: 1.1 $  $Date: 2009/03/24 21:05:20 $
+
+%   Written by
+%   M.S. Carlos Adrian Vargas Aguilera
+%   Physical Oceanography PhD candidate
+%   CICESE 
+%   Mexico, 2008
+%   nubeobscura@hotmail.com
+%
+%   Download from:
+%   http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objec
+%   tType=author&objectId=1093874
+
+%   1.0     Released (30/06/2008)
+%   1.1     Fixed bug when CAXIS used.
+%   1.2     Colorbar freezed colormap.
+%   1.3     Fixed bug in color vector input (Found by Greg King) and now
+%           accets RGB image as input.
+
+%% INPUTS:
+
+% Error checking:
+% Note: At least 3 inputs and no more than 6:
+if nargin<3 || nargin>6
+ error('Imagescnan:IncorrectInputNumber',...
+       'Input arguments must be at least 3 and less than 7.')
+end
+
+% Check the x,y,U:
+% Note: x,y should be the axes data.
+m = size(U);
+if numel(m)>3
+ error('Imagescnan:IncorrectInputSize',...
+       'Input image must be a matrix or an RGB image.')
+else
+ if isempty(x) || numel(x)~=m(2)
+  %warning('Imagescnan:IncorrectInputSize',...
+  %        'Index column axis has been used.')
+  x = 1:m(2); 
+ end
+ if isempty(y) || numel(y)~=m(1)
+  %warning('Imagescnan:IncorrectInputSize',...
+  %        'Index row axis has been used.')
+  y = 1:m(1); 
+ end
+end
+
+% Get color limits:
+% Note: If you would like to use specific color limits, use CAXIS before
+%       this function.
+switch get(gca,'CLimMode')
+ case 'manual'
+  clim = caxis;
+ otherwise
+  clim = [min(U(:)) max(U(:))];
+end
+
+% Parse inputs and defaults:
+% Note: * Mask color will be the not-finite elements plus the elements
+%         indicated by the user.
+%       * Default colormask is the current axes background.
+%       * Default currentmap is current figure colormap (probably JET).
+colormask = ~isfinite(U);
+color_nan = get(gca,'color');
+color_map = get(gcf,'colormap'); 
+cbfit_opt = [];
+ycolorbarfit = (exist('colorbarfit','file')==2);
+if nargin>3
+ while ~isempty(varargin)
+  if     iscell(varargin{1})
+   if length(varargin{1})<3
+    error('Imagescnan:IncorrectInputType',...
+     'Options for COLORBARFIT must be at least 3, although empty.')
+   end
+   caxis(clim)
+   cbfit_opt = varargin{1};
+   if ycolorbarfit
+    colorbarfit(cbfit_opt{:})
+    color_map = get(gcf,'colormap');
+   else
+    % warning('Imagescnan:ColorBarFitNotFound',...
+    %  'COLORBARFIT function not found, used default COLORBAR.') 
+   end
+   varargin(1) = [];
+  elseif ischar(varargin{1})
+   switch varargin{1}
+    case 'y', color_nan = [1 1 0];
+    case 'm', color_nan = [1 0 0];
+    case 'c', color_nan = [0 1 1];
+    case 'r', color_nan = [1 0 0];
+    case 'g', color_nan = [0 1 0];
+    case 'b', color_nan = [0 0 1];
+    case 'w', color_nan = [1 1 1];
+    case 'k', color_nan = [0 0 0];
+   otherwise
+   error('Imagescnan:InvalidColor',...
+    'Color char must be one of: ''ymcrgbwk''.')
+   end
+   varargin(1) = [];
+  elseif islogical(varargin{1})
+   if numel(varargin{1})~=numel(U)
+    error('Imagescnan:InvalidMask',...
+     'The logical mask must have the same elements as the matrix.')
+   end
+   colormask = varargin{1} | colormask;
+   varargin(1) = [];
+  elseif length(varargin{1})==3
+   if (max(varargin{1})>1) || (min(varargin{1})<0) % Fixed BUG 2008/07/11
+    error('Imagescnan:InvalidColor',...
+     'The color must be on the range of [0 1].')
+   end
+   color_nan = varargin{1};
+   varargin(1) = [];
+  elseif length(varargin{1})==1
+   colormask = (U==varargin{1}) | colormask;
+   varargin(1) = [];
+  else
+   error('Imagescnan:IncorrectInputType',...
+    'Incorrect optional(s) argument(s).')
+  end
+ end
+end
+
+
+%% MAIN:
+
+% Matrix data to RGB:
+if numel(m)==2
+
+ % Sets to double data:
+ if ~isfloat(U)
+  U = double(U);
+ end
+
+ % Normalizes and rounds data to range [0 N]:
+ N = size(color_map,1);
+ U = (U - clim(1))/diff(clim);          % Fixed bug when CAXIS used
+ U = U*N;
+ if N<=256
+  U = uint8(U);
+ else
+  U = uint16(U);
+ end
+
+ % Scales data with colormap:
+ U = ind2rgb(U,color_map);              % 2D to 3D RGB values [0 1]
+else
+ % Already is an RGB image, so do nothing.
+end
+
+ % Set mask color to color_nan:
+ mn = prod(m(1:2));
+ ind = find(colormask);
+ U(ind)      = color_nan(1); % Red color
+ U(ind+mn)   = color_nan(2); % Green color
+ U(ind+mn*2) = color_nan(3); % Blue color
+
+ % Draws the RGB image:
+ h = imagesc(x,y,U,clim);
+
+%% OUTPUTS:
+
+% Calls to colorbarfit and freezes his colormap:
+if ~isempty(cbfit_opt)
+ % Creates a temporary colorbar:
+ if ycolorbarfit
+  hcb   = colorbarfit(cbfit_opt{:});
+ else
+  Nopt = min([3 length(cbfit_opt)]);
+  cbfit_opt(1:Nopt) = [];
+  hcb   = colorbar(cbfit_opt{:});
+ end
+ % Save image position:
+ ha    = gca; position = get(ha,'Position'); 
+ % Gets colorbar axes properties:
+ ghcb  = get(hcb);
+ CData = ind2rgb(get(ghcb.Children,'CData'),color_map);
+ XData = get(ghcb.Children,'XData');
+ YData = get(ghcb.Children,'YData');
+ % Move ticks because IMAGESC draws them like centered pixels:
+ XTick = ghcb.XTick;
+ YTick = ghcb.YTick;
+ if ~isempty(XTick)
+  XTick = XTick(1:end-1) + diff(XTick(1:2))/2;
+ end
+ if ~isempty(YTick)
+  YTick = YTick(1:end-1) + diff(YTick(1:2))/2;
+ end
+ % Deletes the colorbar:
+ delete(hcb)            
+ % Generates other colorbar:
+ hcb = axes('Position',ghcb.Position);
+ hcbim = imagesc(XTick,YTick,CData,'Parent',hcb); axis tight
+ set(hcbim,...
+  'HitTest','off',...
+  'Interruptible','off',...
+  'SelectionHighlight','off',...
+  'Tag','TMW_COLORBAR',...
+  'XData',XData,...
+  'YData',YData)
+ set(hcb,...
+  'XAxisLocation',ghcb.XAxisLocation,...
+  'YAxisLocation',ghcb.YAxisLocation,...
+  'XLim',ghcb.XLim,...
+  'YLim',ghcb.YLim,...
+  'XDir',ghcb.XDir,...
+  'YDir',ghcb.YDir,...
+  'XTick',ghcb.XTick,...
+  'YTick',ghcb.YTick,...
+  'XTickLabel',ghcb.XTickLabel,...
+  'YTickLabel',ghcb.YTickLabel,...
+  'ButtonDownFcn',@resetCurrentAxes,...
+  'Interruptible','off',...
+  'Tag','Colorbar')
+ % Returns the image position:
+ axes(ha), set(ha,'Position',position)
+end
+
+% Sets output:
+if ~nargout
+ clear h
+end
Index: /issm/trunk/src/m/classes/public/plot/latlonoverlay.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/latlonoverlay.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/latlonoverlay.m	(revision 1)
@@ -0,0 +1,112 @@
+function latlonoverlay(latlon,numbering)
+%LATLONOVERLAY - overlay latitude and longitude lines on current figure
+%
+%   latstep,lonstep, in latitude and longitude degreees, between two latitudinal, longitudinal profiles.
+%   color: [1 1 1] for example
+%   resolution: profile resolution ( in lat,lon degrees) 
+%   gap: gap (in meters) to plug lat,lon degree numbers;
+%
+%   Usage:
+%      latlonoverlay(latlon,numbering)
+
+%recover latstep and longstep
+latstep=latlon{1};
+lonstep=latlon{2};
+resolution=latlon{3};
+color=latlon{4};
+
+if ~iscell(numbering),
+	numbering=0;
+else
+	latgap=numbering{1};
+	longap=numbering{2};
+	colornumber=numbering{3};
+	latangle=numbering{4};
+	lonangle=numbering{5};
+	numbering=1;
+end
+
+%Find lat and lon that fit within the bounds of our image.
+lat=-90:resolution:0;
+lon=0:resolution:360;
+
+xlimits=xlim;
+ylimits=ylim;
+
+for i=1:length(lon),
+	if(rem(lon(i),lonstep)==0)
+		latitudes=lat';
+		longitudes=lon(i)*ones(length(latitudes),1);
+		[x,y]=ll2xy(latitudes,longitudes);
+		pos=find(x<=xlimits(2) & x>=xlimits(1) & y<=ylimits(2) & y>=ylimits(1));
+		if length(pos)<=1,
+			continue;
+		end
+		x=x(pos);y=y(pos);
+
+		l=line(x,y,'Color',color);
+		if numbering,
+			disp(['Specifiy where to put number for longitude ' num2str(lon(i))]);
+			[xcorner,ycorner]=ginput(1);
+
+			%Find nearest point on this profile corresponding to (xcorner,ycorner):
+			ind=find_point(x,y,xcorner,ycorner); xcorner=x(ind); ycorner=y(ind);
+			if length(x(1:ind))>10,
+				xcorner2=x(ind-10); ycorner2=y(ind-10);
+			else
+				xcorner2=x(ind-1); ycorner2=y(ind-1);
+			end
+			angle=(180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+lonangle;
+			
+			if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
+				th=text(xcorner,ycorner,[num2str(lon(i)) '^{\circ}']);set(th,'Color',colornumber,'Rotation',angle,'FontSize',16,'HorizontalAlignment','center','VerticalAlignment','middle');
+				
+				%erase line and redraw it in two parts, to leave space for latitude number
+				delete(l);
+				line(x(1:ind-longap),y(1:ind-longap),'Color',color);hold on;
+				line(x(ind+longap:end),y(ind+longap:end),'Color',color);
+			end
+
+		end
+	end
+end
+
+for i=1:length(lat),
+	if(rem(lat(i),latstep)==0)
+		longitudes=lon';
+		latitudes=lat(i)*ones(length(longitudes),1);
+		[x,y]=ll2xy(latitudes,longitudes);
+		pos=find(x<=xlimits(2) & x>=xlimits(1) & y<=ylimits(2) & y>=ylimits(1));
+		if length(pos)<=1,
+			continue;
+		end
+		x=x(pos);y=y(pos);
+
+		l=line(x,y,'Color',color);
+		
+		if numbering,
+			disp(['Specifiy where to put number for latitude ' num2str(lat(i))]);
+			[xcorner,ycorner]=ginput(1);
+
+			%Find nearest point on this profile corresponding to (xcorner,ycorner):
+			ind=find_point(x,y,xcorner,ycorner); xcorner=x(ind); ycorner=y(ind);
+			if length(x(1:ind))>10,
+				xcorner2=x(ind-10); ycorner2=y(ind-10);
+			else
+				xcorner2=x(ind-1); ycorner2=y(ind-1);
+			end
+			angle=(180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+latangle;
+			
+			if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
+				th=text(xcorner,ycorner,[num2str(lat(i)) '^{\circ}']);set(th,'Color',colornumber,'Rotation',angle,'FontSize',16,'HorizontalAlignment','center','VerticalAlignment','middle');
+				
+				%erase line and redraw it in two parts, to leave space for latitude number
+				delete(l);
+				line(x(1:ind-latgap),y(1:ind-latgap),'Color',color);hold on;
+				line(x(ind+latgap:end),y(ind+latgap:end),'Color',color);
+			end
+
+		end
+
+	end
+end
Index: /issm/trunk/src/m/classes/public/plot/northarrow.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/northarrow.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/northarrow.m	(revision 1)
@@ -0,0 +1,73 @@
+function northarrow(structure)
+%NORTHARROW - overlay an arrow pointing north on the current plot
+%
+%   Usage:
+%      northarrow(structure)
+
+%Go through structure and fill missing arguments
+if length(structure)<3
+	error('plotmodel error message: the position or the length of the North arrow is missing');
+elseif length(structure)==3
+	structure(4)=0.5; %default ratio headarrow/length
+	structure(5)=structure(3)/10; %default width =length/10
+elseif length(structure)==4
+	structure(5)=structure(3)/10; %default width =length/10
+elseif length(structure)>5
+	error('plotmodel error message: to many input arguments for northarrow: [x0 y0 length [ratio [width]]]');
+end
+
+%retrieve north arrow parameters
+x0=structure(1);
+y0=structure(2);
+lengtharrow=structure(3);
+ratio=structure(4);
+width=structure(5);
+
+%Figure out angle to point towards north
+ang=atan2(y0,x0);
+
+%Build the two points Ap and Bp
+x=zeros(2,1);
+y=zeros(2,1);
+x(1)=x0;
+y(1)=y0;
+
+x(2)=x(1)+lengtharrow*cos(ang);
+y(2)=y(1)+lengtharrow*sin(ang);
+
+Ap=[x(1)
+   y(1)];
+Bp=[x(2)
+   y(2)];
+
+%Build arrowhead first
+ang2=150*2*pi/360;
+rotation=[cos(ang2), sin(ang2); -sin(ang2), cos(ang2)];
+
+E=ratio*rotation*(Bp-Ap)+Bp;
+F=Bp;
+G=ratio*rotation'*(Bp-Ap)+Bp;
+H=Bp/4+E*3/8+G*3/8;
+
+%Build rectangle
+u=Bp-Ap;
+alpha=atan2(u(2),u(1));
+
+A=Ap-[-width/2*sin(alpha)
+   width/2*cos(alpha)];
+ B=H-[-width/2*sin(alpha)
+   width/2*cos(alpha)];
+C=H+[-width/2*sin(alpha)
+   width/2*cos(alpha)];
+D=Ap+[-width/2*sin(alpha)
+   width/2*cos(alpha)];
+
+%Plot arrow
+hold on
+p1=patch([A(1) B(1) C(1) D(1)],[A(2) B(2) C(2) D(2)],'Black');
+p2=patch([E(1) F(1) G(1) H(1)],[E(2) F(2) G(2) H(2)],'Black');
+
+%Text North
+xN=max([A(1) D(1) E(1) F(1) G(1)])+ratio/3*lengtharrow;
+yN=mean([A(2) F(2) H(2)]);
+text(xN,yN,'North','FontSize',16,'FontWeight','b');
Index: /issm/trunk/src/m/classes/public/plot/parse_options.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/parse_options.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/parse_options.m	(revision 1)
@@ -0,0 +1,619 @@
+function  options_struct=parse_options(md,optionstring);
+%PARSE_OPTIONS - build a structure that holds all plot options
+%
+%   Usage:
+%      options_struct=parse_options(md,optionstring);
+%
+%   See also: PLOTMODEL
+
+%units
+unitvalues=findarg(optionstring,'unit');
+if ~isempty(unitvalues),
+	if strcmpi(unitvalues.value,'km'),
+		options_struct.unitmultiplier=10^-3;
+	end
+else
+	options_struct.unitmultiplier=NaN;
+end
+
+%Section profile
+sectionvalues=findarg(optionstring,'sectionvalue');
+if ~isempty(sectionvalues),
+	if ischar(sectionvalues(1).value),
+		options_struct.sectionvalue=sectionvalues(1).value;
+	else
+		options_struct.sectionvalue=0;
+	end
+else
+	options_struct.sectionvalue=NaN;
+end
+
+%Resolution to be used by section profile
+resolution=findarg(optionstring,'resolution');
+if ~isempty(resolution),
+	options_struct.resolution=resolution(1).value;
+else
+	options_struct.resolution=NaN;
+end
+
+%Show section
+showsections=findarg(optionstring,'showsection');
+if ~isempty(showsections),
+	if ischar(showsections(1).value),
+		options_struct.showsection=showsections(1).value;
+	else
+		options_struct.showsection=0;
+	end
+else
+	options_struct.showsection=NaN;
+end
+
+%iceshelf values
+iceshelfvalues=findarg(optionstring,'iceshelf');
+if ~isempty(iceshelfvalues),
+	if strcmpi(iceshelfvalues(1).value,'none'),
+		options_struct.noiceshelf=1;
+	else
+		options_struct.noiceshelf=0;
+	end
+else
+	options_struct.noiceshelf=0;
+end
+
+%icesheet values
+icesheetvalues=findarg(optionstring,'icesheet');
+if ~isempty(icesheetvalues),
+	if strcmpi(icesheetvalues(1).value,'none'),
+		options_struct.noicesheet=1;
+	else
+		options_struct.noicesheet=0;
+	end
+else
+	options_struct.noicesheet=0;
+end
+
+%transient_movie
+transient_movie_values=findarg(optionstring,'transient_movie');
+if ~isempty(transient_movie_values),
+	if(ischar(transient_movie_values.value)),
+		options_struct.transient_movie=str2num(transient_movie_values.value);
+	else
+		options_struct.transient_movie=transient_movie_values.value;
+	end
+else
+	options_struct.transient_movie=NaN;
+end
+
+%fontsize
+fontsize_values=findarg(optionstring,'fontsize');
+if ~isempty(fontsize_values),
+	if(ischar(fontsize_values.value)),
+		options_struct.fontsize=str2num(fontsize_values.value);
+	else
+		options_struct.fontsize=fontsize_values.value;
+	end
+else
+	options_struct.fontsize=NaN;
+end
+
+%fontweight
+fontweight_values=findarg(optionstring,'fontweight');
+if ~isempty(fontweight_values),
+	options_struct.fontweight=fontweight_values.value;
+else
+	options_struct.fontweight=NaN;
+end
+
+%smoothing
+smooth_values=findarg(optionstring,'smooth');
+if ~isempty(smooth_values),
+	if strcmpi(smooth_values.value,'yes'),
+		options_struct.smooth=0;
+	else
+		options_struct.smooth=smooth_values.value;
+	end
+else
+	options_struct.smooth=NaN;
+end
+
+%contouronly
+contouronly_values=findarg(optionstring,'contouronly');
+if ~isempty(contouronly_values) & strcmpi(contouronly_values.value,'on'),
+	options_struct.contouronly=1;
+else
+	options_struct.contouronly=NaN;
+end
+
+%contourlevels
+contourlevels_values=findarg(optionstring,'contourlevels');
+if ~isempty(contourlevels_values),
+	options_struct.contourlevels=contourlevels_values.value;
+else
+	options_struct.contourlevels=NaN;
+end
+
+%contour color
+contourcolor_values=findarg(optionstring,'contourcolor');
+if ~isempty(contourcolor_values),
+	options_struct.contourcolor=contourcolor_values.value;
+else
+	options_struct.contourcolor=NaN;
+end
+
+%contour ticks
+contourticks_values=findarg(optionstring,'contourticks');
+if ~isempty(contourticks_values),
+	options_struct.contourticks=contourticks_values.value;
+else
+	options_struct.contourticks=NaN;
+end
+
+%highlight
+highlight_values=findarg(optionstring,'highlight');
+if ~isempty(highlight_values),
+	options_struct.highlight=highlight_values.value;
+else
+	options_struct.highlight=NaN;
+end
+
+%layer projection? 
+layer_values=findarg(optionstring,'layer');
+if ~isempty(layer_values),
+	options_struct.layer=layer_values(1).value;
+	if (options_struct.layer<=0 | options_struct.layer>md.numlayers),
+		error(['plot error message: layer option should be between 1 and ' num2str(md.numlayers)]);
+	else
+		%we are projecting onto  2d mesh. 
+		if ~strcmpi(md.type,'3d'),
+			error('plot error message: layer option only supported for 3d type mesh');
+		end
+	end
+else
+	options_struct.layer=NaN;
+end
+
+%title
+titlevalues=findarg(optionstring,'title');
+if ~isempty(titlevalues),
+	if ischar(titlevalues.value),
+		options_struct.title=titlevalues.value;
+	else
+		error('plot error message: title option must be a string');
+	end
+else
+	options_struct.title=NaN;
+end
+
+%xlabel
+xlabelvalues=findarg(optionstring,'xlabel');
+if ~isempty(xlabelvalues),
+	if ischar(xlabelvalues.value),
+		options_struct.xlabel=xlabelvalues.value;
+	else
+		error('plot error message: xlabel option must be a string');
+	end
+else
+	options_struct.xlabel=NaN;
+end
+
+%ylabel
+ylabelvalues=findarg(optionstring,'ylabel');
+if ~isempty(ylabelvalues),
+	if ischar(ylabelvalues.value),
+		options_struct.ylabel=ylabelvalues.value;
+	else
+		error('plot error message: ylabel option must be a string');
+	end
+else
+	options_struct.ylabel=NaN;
+end
+
+%zlabel
+zlabelvalues=findarg(optionstring,'zlabel');
+if ~isempty(zlabelvalues),
+	if ischar(zlabelvalues.value),
+		options_struct.zlabel=zlabelvalues.value;
+	else
+		error('plot error message: zlabel option must be a string');
+	end
+else
+	options_struct.zlabel=NaN;
+end
+
+%view
+viewvalues=findarg(optionstring,'view');
+if ~isempty(viewvalues),
+	options_struct.view=viewvalues.value;
+else
+	if strcmpi(md.type,'3d') & isnan(options_struct.layer),
+		options_struct.view=3;
+	else
+		options_struct.view=2;
+	end
+end
+
+%Caxis
+caxisvalues=findarg(optionstring,'caxis');
+if ~isempty(caxisvalues),
+	options_struct.caxis=caxisvalues.value;
+else
+	options_struct.caxis=NaN;
+end
+
+%xlim
+xlimvalues=findarg(optionstring,'xlim');
+if ~isempty(xlimvalues),
+	options_struct.xlim=xlimvalues.value;
+else
+	options_struct.xlim=NaN;
+end
+
+%ylim
+ylimvalues=findarg(optionstring,'ylim');
+if ~isempty(ylimvalues),
+	options_struct.ylim=ylimvalues.value;
+else
+	options_struct.ylim=NaN;
+end
+
+%zlim
+zlimvalues=findarg(optionstring,'zlim');
+if ~isempty(zlimvalues),
+	options_struct.zlim=zlimvalues.value;
+else
+	options_struct.zlim=NaN;
+end
+
+
+%shading
+shadingvalues=findarg(optionstring,'shading');
+if ~isempty(shadingvalues),
+	if ischar(shadingvalues.value),
+		options_struct.shading=shadingvalues.value;
+	else
+		error('plot error message: shading option must be a string');
+	end
+else
+	options_struct.shading=NaN;
+end
+
+%grid
+gridvalues=findarg(optionstring,'grid');
+if ~isempty(gridvalues),
+	if ischar(gridvalues.value),
+		options_struct.grid=gridvalues.value;
+	else
+		error('plot error message: grid option must be a string');
+	end
+else
+	options_struct.grid=NaN;
+end
+
+%Colorbar;
+colorbarvalues=findarg(optionstring,'colorbar');
+if ~isempty(colorbarvalues),
+	if ischar(colorbarvalues.value),
+		if strcmpi(colorbarvalues.value,'on'),
+			options_struct.colorbar=1;
+		elseif strcmpi(colorbarvalues.value,'off'),
+			options_struct.colorbar=0;
+		end
+	else
+		error('plot error message: colorbarvalues option must be ''on'' or ''off''');
+	end
+else
+	options_struct.colorbar=NaN;
+end
+
+%Colorbar position;
+colorbarposvalues=findarg(optionstring,'colorbarpos');
+if ~isempty(colorbarposvalues),
+	options_struct.colorbarpos=colorbarposvalues.value;
+else
+	options_struct.colorbarpos=NaN;
+end
+
+%Colormap;
+colormapvalues=findarg(optionstring,'colormap');
+if ~isempty(colormapvalues),
+	if ischar(colormapvalues.value),
+		options_struct.colormap=colormapvalues.value;
+	else
+		error('plot error message: colormapvalues option must be a string');
+	end
+else
+	options_struct.colormap=NaN;
+end
+
+%Wrapping colormap;
+wrappingvalues=findarg(optionstring,'wrapping');
+if ~isempty(wrappingvalues),
+	options_struct.wrapping=wrappingvalues.value;
+else
+	options_struct.wrapping=NaN;
+end
+
+%axis
+axisvalues=findarg(optionstring,'axis');
+if ~isempty(axisvalues),
+	options_struct.axis=axisvalues.value;
+else
+	options_struct.axis=NaN;
+end
+
+%area
+areavalues=findarg(optionstring,'area');
+if ~isempty(areavalues),
+	if ischar(areavalues.value),
+		options_struct.area=areavalues.value;
+	else
+		error('plot error message: area option must be a string');
+	end
+else
+	options_struct.area=NaN;
+end
+
+%edgecolor
+edgecolorvalues=findarg(optionstring,'edgecolor');
+if ~isempty(edgecolorvalues),
+	if ischar(edgecolorvalues.value),
+		options_struct.edgecolor=edgecolorvalues.value;
+	else
+		error('plot error message: edgecolor option must be a string');
+	end
+else
+	options_struct.edgecolor=NaN;
+end
+
+%overlay
+overlayvalues=findarg(optionstring,'overlay');
+if ~isempty(overlayvalues),
+	if ischar(overlayvalues.value),
+		options_struct.overlay=overlayvalues.value;
+	else
+		error('plot error message: overlay option must be a string');
+	end
+else
+	options_struct.overlay=NaN;
+end
+
+%highres
+highresvalues=findarg(optionstring,'highres');
+if ~isempty(highresvalues),
+	options_struct.highres=highresvalues.value;
+else
+	options_struct.highres=NaN;
+end
+
+%windowsize
+windowsizevalues=findarg(optionstring,'windowsize');
+if ~isempty(windowsizevalues),
+	if isscalar(windowsizevalues.value),
+		options_struct.windowsize=windowsizevalues.value;
+	else
+		error('plot error message: windowsize option must be a string');
+	end
+else
+	options_struct.windowsize=NaN;
+end
+
+%alpha
+alphavalues=findarg(optionstring,'alpha');
+if ~isempty(alphavalues),
+	if isscalar(alphavalues.value),
+		options_struct.alpha=alphavalues.value;
+	else
+		error('plot error message: alpha option must be a string');
+	end
+else
+	options_struct.alpha=NaN;
+end
+	
+%text
+%1: textsize
+textsizevalues=findarg(optionstring,'textsize');
+textsizevaluesarray=cell(0,0);
+if ~isempty(textsizevalues)
+	textsizevalues=textsizevalues.value;
+	%ischar if only one textsize -> create a cell
+	if ischar(textsizevalues),
+		textsizevalues={textsizevalues};
+	end
+else
+	textsizevalues={14};
+end
+%2: textweight
+textweightvalues=findarg(optionstring,'textweight');
+textweightvaluesarray=cell(0,0);
+if ~isempty(textweightvalues)
+	textweightvalues=textweightvalues.value;
+	%ischar if only one textweight -> create a cell
+	if ischar(textweightvalues),
+		textweightvalues={textweightvalues};
+	end
+else
+	textweightvalues={'n'};
+end
+%3: textcolor
+textcolorvalues=findarg(optionstring,'textcolor');
+textcolorvaluesarray=cell(0,0);
+if ~isempty(textcolorvalues)
+	textcolorvalues=textcolorvalues.value;
+	%ischar if only one textcolor -> create a cell
+	if ischar(textcolorvalues),
+		textcolorvalues={textcolorvalues};
+	end
+else
+	textcolorvalues={'k'};
+end
+%4: textposition
+textpositionvalues=findarg(optionstring,'textposition');
+textpositionvaluesarray=cell(0,0);
+if ~isempty(textpositionvalues)
+	textpositionvalues=textpositionvalues.value;
+	%isnumeric if only one textposition -> create a cell
+	if isnumeric(textpositionvalues),
+		textpositionvalues={textpositionvalues};
+	end
+end
+%5: textvalue
+textvalues=findarg(optionstring,'text');
+textvaluesarray=cell(0,0);
+if ~isempty(textvalues),
+	textvalues=textvalues.value;
+	%ischar if only one expstyle -> create a cell
+	if ischar(textvalues),
+		textvalues={textvalues};
+	end
+	%get options
+	for i=1:length(textvalues)
+		textvaluesarray{end+1}=textvalues{i};
+		%size
+		if (length(textsizevalues)>=i),
+			textsizevaluesarray{end+1}=textsizevalues{i};
+		else
+			textsizevaluesarray{end+1}=textsizevalues{1};
+		end
+		%weight
+		if (length(textweightvalues)>=i),
+			textweightvaluesarray{end+1}=textweightvalues{i};
+		else
+			textweightvaluesarray{end+1}=textweightvalues{1};
+		end
+		%color
+		if (length(textcolorvalues)>=i),
+			textcolorvaluesarray{end+1}=textcolorvalues{i};
+		else
+			textcolorvaluesarray{end+1}=textcolorvalues{1};
+		end
+		%position
+		if (length(textpositionvalues)>=i),
+			textpositionvaluesarray{end+1}=textpositionvalues{i};
+		else
+			error('plotmodel error message: one or more textposition is missing');
+		end
+	end
+end
+options_struct.text=textvaluesarray;
+options_struct.textsize=textsizevaluesarray;
+options_struct.textweight=textweightvaluesarray;
+options_struct.textcolor=textcolorvaluesarray;
+options_struct.textposition=textpositionvaluesarray;
+
+%expdisp
+expdispvalues=findarg(optionstring,'expdisp');
+expdispvaluesarray=cell(0,0);
+expstylevalues=findarg(optionstring,'expstyle');
+expstylevaluesarray=cell(0,0);
+if ~isempty(expstylevalues)
+	expstylevalues=expstylevalues.value;
+	%ischar if only one expstyle -> create a cell
+	if ischar(expstylevalues),
+		expstylevalues={expstylevalues};
+	end
+end
+if ~isempty(expdispvalues),
+	expdispvalues=expdispvalues.value;
+	%ischar if only one expstyle -> create a cell
+	if ischar(expdispvalues),
+		expdispvalues={expdispvalues};
+	end
+	for i=1:length(expdispvalues)
+		expdispvaluesarray{end+1}=expdispvalues{i};
+		if (length(expstylevalues)>=i),
+			expstylevaluesarray{end+1}=expstylevalues{i};
+		else
+			expstylevaluesarray{end+1}='g-';
+		end
+	end
+end
+options_struct.expdisp=expdispvaluesarray;
+options_struct.expstyle=expstylevaluesarray;
+
+%latlon
+latlonvalues=findarg(optionstring,'latlon');
+if ~isempty(latlonvalues),
+	options_struct.latlon=latlonvalues.value;
+else
+	options_struct.latlon=NaN;
+end
+
+%latlonnumbering
+latlonnumberingvalues=findarg(optionstring,'latlonnumbering');
+if ~isempty(latlonnumberingvalues),
+	options_struct.latlonnumbering=latlonnumberingvalues.value;
+else
+	options_struct.latlonnumbering=NaN;
+end
+
+%north arrow
+northarrowvalues=findarg(optionstring,'northarrow');
+if ~isempty(northarrowvalues),
+	if  strcmpi(northarrowvalues.value,'on')
+		%default values
+		Lx=max(md.y)-min(md.y);
+		Ly=max(md.y)-min(md.y);
+		%default values
+		northarrowvalues.value=[min(md.x)+1/6*Lx   min(md.y)+5/6*Ly   1/15*Ly   0.25   1/250*Ly];
+	end
+	options_struct.northarrow=northarrowvalues.value;
+else
+	options_struct.northarrow=NaN;
+end
+
+%scale ruler
+scalerulervalues=findarg(optionstring,'scaleruler');
+if ~isempty(scalerulervalues),
+	if  strcmpi(scalerulervalues.value,'on')
+		%default values
+		Lx=max(md.y)-min(md.y);
+		Ly=max(md.y)-min(md.y);
+		%default values
+		scalerulervalues.value=[min(md.x)+1/8*Lx   min(md.y)+1/8*Ly   10^(ceil(log10(Lx)))/5 floor(Lx/100) 5];
+	end
+	options_struct.scaleruler=scalerulervalues.value;
+else
+	options_struct.scaleruler=NaN;
+end
+
+
+%designvariable
+designvariable=findarg(optionstring,'designvariable');
+if ~isempty(designvariable),
+	if ischar(designvariable(1).value),
+		options_struct.designvariable=designvariable(1).value;
+	else
+		options_struct.designvariable=0;
+	end
+else
+	options_struct.designvariable=NaN;
+end
+
+%responsefunction
+responsefunction=findarg(optionstring,'responsefunction');
+if ~isempty(responsefunction),
+	if ischar(responsefunction(1).value),
+		options_struct.responsefunction=responsefunction(1).value;
+	else
+		options_struct.responsefunction=0;
+	end
+else
+	options_struct.responsefunction=NaN;
+end
+
+
+%log
+logvalues=findarg(optionstring,'log');
+if ~isempty(logvalues),
+	options_struct.log=logvalues(1).value;
+else
+	options_struct.log=NaN;
+end
+
+%border
+bordervalues=findarg(optionstring,'border');
+if ~isempty(bordervalues),
+	options_struct.border=bordervalues(1).value;
+else
+	options_struct.border=NaN;
+end
Index: /issm/trunk/src/m/classes/public/plot/plot_basaldrag.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_basaldrag.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_basaldrag.m	(revision 1)
@@ -0,0 +1,51 @@
+function plot_basaldrag(md,options_structure,width,i);
+%PLOT_BASALDRAG - plot basal drag
+%
+%   Usage:
+%      plot_basaldrag(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%check layer
+if strcmpi(md.type,'3d')
+	if options_structure.layer~=1,
+		disp('plot_basaldrag warning: basal drag is displayed in the lower layer')
+		options_structure.layer=1;
+	end
+end
+
+%compute exponents
+s=averaging(md,1./md.p,0);
+r=averaging(md,md.p./md.q,0);
+
+%compute horizontal velocity
+ub=sqrt(md.vx.^2+md.vy.^2)/md.yts;
+
+%compute basal drag
+drag=(md.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)).^r.*(md.drag).^2.*ub.^s/1000;
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[basal_drag isongrid]=processdata(md,drag,options_structure);
+
+%plot mesh quivervel
+subplot(width,width,i); 
+
+%edgecolor?
+if ~isnan(options_structure.edgecolor),
+	edgecolor=options_structure.edgecolor;
+else
+	edgecolor='none';
+end
+
+%plot basal basal drag
+A=elements(:,1); B=elements(:,2); C=elements(:,3);
+
+patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData',basal_drag,'FaceColor','interp','EdgeColor',edgecolor);
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Basal drag [kPa]';
+end 
+options_structure.view=2;
+applyoptions(md,basal_drag,options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_boundaries.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_boundaries.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_boundaries.m	(revision 1)
@@ -0,0 +1,43 @@
+function plot_boundaries(md,options_structure,width,i);
+%PLOT_BOUNDARIES - plot mesh boundaries
+%
+%   Usage:
+%      plot_boundaries(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+subplot(width,width,i); 
+
+%process data and model
+if ~isnan(options_structure.layer)
+	disp('plotmodel warning: layer projection not supported yet by plot_boundaries');
+	options_structure.layer=NaN;
+end
+[x y z elements is2d]=processmesh(md,options_structure);
+
+for i=1:size(md.segments,1),
+	plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');hold on;
+end
+
+%plot rifts if present: 
+if isstruct(md.rifts),
+	for i=1:size(md.rifts,1),
+		segments=md.rifts(i).segments;
+		for j=1:size(segments,1),
+			plot(x(segments(j,1:2)),y(segments(j,1:2)),'r.-');
+		end
+		text(x(segments(floor(size(segments,1)/4),1)),y(segments(floor(size(segments,1)/4),1)),['Rift #' num2str(i)]);
+		%point out the tips
+		plot(x(md.rifts(i).tips(1)),y(md.rifts(i).tips(1)),'b*');
+		plot(x(md.rifts(i).tips(2)),y(md.rifts(i).tips(2)),'b*');
+	end
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Mesh boundaries';
+end
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_contour.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_contour.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_contour.m	(revision 1)
@@ -0,0 +1,239 @@
+function plot_contour(md,data,options_structure);
+%PLOT_CONTOUR - plot contours of a given field
+%
+%   Usage:
+%      plot_contour(md,data,options_structure);
+%
+%   See also: PLOTMODEL
+
+%process data and model
+[x y z index is2d]=processmesh(md,options_structure);
+[data isongrid]=processdata(md,data,options_structure);
+
+%check is2d
+if ~is2d,
+	error('plot_contour error message: contour not supported for 3d meshes, project on a layer');
+end
+
+%first, process data: must be on grids
+if ~isongrid
+	data=averaging(md,data,0);
+end
+
+%prepare colors
+if isnan(options_structure.contouronly)
+	%contour color
+	if isnan(options_structure.contourcolor)
+		options_structure.contourcolor='y';
+	end
+else
+	%remove the previous plots
+	cla
+end
+color=options_structure.contourcolor;
+
+%get contours levels
+if isnumeric(options_structure.contourlevels),
+	levels=round_ice(linspace(max(data),min(data),options_structure.contourlevels),2);
+else
+	levels=[];
+	for i=1:length(options_structure.contourlevels)
+		levels(end+1)=options_structure.contourlevels{i};
+	end
+	levels=sort(unique(levels),'descend');
+end
+numlevels=length(levels);
+
+%initialization of some variables
+numberofelements=md.numberofelements;
+elementslist=1:numberofelements;
+c=[];
+h=[];
+
+%get unique edges in mesh
+%1: list of edges
+edges=[index(:,[1,2]); index(:,[2,3]); index(:,[3,1])];
+%2: find unique edges
+[edges,I,J]=unique(sort(edges,2),'rows');
+%3: unique edge numbers
+vec=J;
+%4: unique edges numbers in each triangle (2 triangles sharing the same edge will have
+%   the same edge number)
+edges_tria=[vec(elementslist), vec(elementslist+numberofelements), vec(elementslist+2*numberofelements)];
+
+%segments [grids1 gruids2]
+Seg1=index(:,[1 2]);
+Seg2=index(:,[2 3]);
+Seg3=index(:,[3 1]);
+
+%segment numbers [1;4;6;...]
+Seg1_num=edges_tria(:,1);
+Seg2_num=edges_tria(:,2);
+Seg3_num=edges_tria(:,3);
+
+%value of data on each tips of the segments
+Data1=data(Seg1);
+Data2=data(Seg2);
+Data3=data(Seg3);
+
+%get the ranges for each segment
+Range1=sort(Data1,2);
+Range2=sort(Data2,2);
+Range3=sort(Data3,2);
+
+for i=1:numlevels
+
+	level=levels(i);
+
+	%find the segments that contain this value
+	pos1=(Range1(:,1)<level & Range1(:,2)>level);
+	pos2=(Range2(:,1)<level & Range2(:,2)>level);
+	pos3=(Range3(:,1)<level & Range3(:,2)>level);
+
+	%get elements
+	poselem12=(pos1 & pos2);
+	poselem13=(pos1 & pos3);
+	poselem23=(pos2 & pos3);
+	poselem=find(poselem12 | poselem13 | poselem23);
+	numelems=length(poselem);
+
+	%if no element has been flagged, skip to the next level
+	if numelems==0,
+		continue,
+	end
+
+	%go through the elements and build the coordinates for each segment (1 by element)
+	x1=zeros(numelems,1);
+	x2=zeros(numelems,1);
+	y1=zeros(numelems,1);
+	y2=zeros(numelems,1);
+	edge_l=zeros(numelems,2);
+
+	for j=1:numelems,
+
+		weight1=(level-Data1(poselem(j),1))/(Data1(poselem(j),2)-Data1(poselem(j),1));
+		weight2=(level-Data2(poselem(j),1))/(Data2(poselem(j),2)-Data2(poselem(j),1));
+		weight3=(level-Data3(poselem(j),1))/(Data3(poselem(j),2)-Data3(poselem(j),1));
+
+		if poselem12(poselem(j));
+
+			x1(j)=x(Seg1(poselem(j),1))+weight1*(x(Seg1(poselem(j),2))-x(Seg1(poselem(j),1)));
+			x2(j)=x(Seg2(poselem(j),1))+weight2*(x(Seg2(poselem(j),2))-x(Seg2(poselem(j),1)));
+			y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1)));
+			y2(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1)));
+			edge_l(j,1)=Seg1_num(poselem(j));
+			edge_l(j,2)=Seg2_num(poselem(j));
+
+		elseif poselem13(poselem(j)),
+
+			x1(j)=x(Seg1(poselem(j),1))+weight1*(x(Seg1(poselem(j),2))-x(Seg1(poselem(j),1)));
+			x2(j)=x(Seg3(poselem(j),1))+weight3*(x(Seg3(poselem(j),2))-x(Seg3(poselem(j),1)));
+			y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1)));
+			y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1)));
+			edge_l(j,1)=Seg1_num(poselem(j));
+			edge_l(j,2)=Seg3_num(poselem(j));
+
+		elseif poselem23(poselem(j)),
+
+			x1(j)=x(Seg2(poselem(j),1))+weight2*(x(Seg2(poselem(j),2))-x(Seg2(poselem(j),1)));
+			x2(j)=x(Seg3(poselem(j),1))+weight3*(x(Seg3(poselem(j),2))-x(Seg3(poselem(j),1)));
+			y1(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1)));
+			y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1)));
+			edge_l(j,1)=Seg2_num(poselem(j));
+			edge_l(j,2)=Seg3_num(poselem(j));
+		else
+			%it shoud not go here
+		end
+	end
+
+	%now that we have the segments, we must try to connect them...
+
+	%loop over the subcontours
+	while ~isempty(edge_l),
+
+		%take the right edge of the second segment and connect it to the next segments if any
+		e1=edge_l(1,1);   e2=edge_l(1,2);
+		xc=[x1(1);x2(1)]; yc=[y1(1);y2(1)];
+
+		%erase the lines corresponding to this edge
+		edge_l(1,:)=[];
+		x1(1)=[]; x2(1)=[];
+		y1(1)=[]; y2(1)=[];
+
+		[ro1,co1]=find(edge_l==e1);
+
+		while ~isempty(ro1)
+
+			if co1==1,
+				xc=[x2(ro1);xc]; yc=[y2(ro1);yc];
+
+				%next edge:
+				e1=edge_l(ro1,2);
+
+			else
+				xc=[x1(ro1);xc]; yc=[y1(ro1);yc];
+
+				%next edge:
+				e1=edge_l(ro1,1);
+			end
+
+			%erase the lines of this
+			edge_l(ro1,:)=[];
+			x1(ro1)=[]; x2(ro1)=[];
+			y1(ro1)=[]; y2(ro1)=[];
+
+			%next connection
+			[ro1,co1]=find(edge_l==e1);
+		end
+
+		%same thing the other way (to the right)
+		[ro2,co2]=find(edge_l==e2);
+
+		while ~isempty(ro2)
+
+			if co2==1,
+				xc=[xc;x2(ro2)]; yc=[yc;y2(ro2)];
+
+				%next edge:
+				e2=edge_l(ro2,2);
+			else
+				xc=[xc;x1(ro2)]; yc=[yc;y1(ro2)];
+
+				%next edge:
+				e2=edge_l(ro2,1);
+			end
+
+			%erase the lines of this
+			edge_l(ro2,:)=[];
+			x1(ro2)=[]; x2(ro2)=[];
+			y1(ro2)=[]; y2(ro2)=[];
+
+			%next connection
+			[ro2,co2]=find(edge_l==e2);
+		end
+
+		%we now have one subcontour ready to be plotted
+		zc=level*ones(length(xc)+1,1);
+		if isnan(color),
+			h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'Zdata',zc,'Cdata',zc,'facecolor','none','edgecolor','flat')];
+			hold on      
+		else
+			h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'facecolor','none','edgecolor',color)];
+			hold on
+		end
+
+		% Update the CS data structure as per "contours.m"
+		% so that clabel works
+		c = horzcat(c,[level, xc'; length(xc), yc']);
+
+	end
+end
+
+%labels?
+if ~strcmpi(options_structure.contourticks,'off')
+	if ~isnan(options_structure.contourcolor)
+		clabel(c,h,'color',color);
+	else
+		clabel(c,h);
+	end
+end
Index: /issm/trunk/src/m/classes/public/plot/plot_drivingstress.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_drivingstress.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_drivingstress.m	(revision 1)
@@ -0,0 +1,64 @@
+function plot_drivingstress(md,options_structure,width,i);
+%PLOT_DRIVINGSTRESS - plot driving stress
+%
+%   Usage:
+%      plot_drivingstress(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%get driving stress
+[sx sy s]=drivingstress(md);
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[dstress isongrid]=processdata(md,s,options_structure);
+dstress=dstress/1000;
+
+%plot mesh quivervel
+subplot(width,width,i); 
+
+%edgecolor?
+if ~isnan(options_structure.edgecolor),
+	edgecolor=options_structure.edgecolor;
+else
+	edgecolor='none';
+end
+
+%element data
+if ~isongrid
+	if is2d
+		A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+		patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', dstress,'FaceColor','flat','EdgeColor',edgecolor);
+	else
+		A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+		patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', dstress,'FaceColor','flat','EdgeColor',edgecolor);
+		patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', dstress,'FaceColor','flat','EdgeColor',edgecolor);
+		patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', dstress,'FaceColor','flat','EdgeColor',edgecolor);
+		patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', dstress,'FaceColor','flat','EdgeColor',edgecolor);
+		patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', dstress,'FaceColor','flat','EdgeColor',edgecolor);
+	end
+%grid data
+elseif isongrid
+	if is2d
+		A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+		patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', dstress,'FaceColor','interp','EdgeColor',edgecolor);
+	else
+		if options_structure.layer>=1,
+			A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', dstress,'FaceColor','interp','EdgeColor',edgecolor);
+		else
+			A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', dstress,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', dstress,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', dstress,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', dstress,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', dstress,'FaceColor','interp','EdgeColor',edgecolor);
+		end
+	end
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Driving stress [kPa]';
+end 
+applyoptions(md,dstress,options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_elementnumbering.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_elementnumbering.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_elementnumbering.m	(revision 1)
@@ -0,0 +1,55 @@
+function plot_elementnumbering(md,options_structure,width,i);
+%PLOT_ELEMENTNUMBERING - plot element numbering
+%
+%   Usage:
+%      plot_elementnumbering(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+subplot(width,width,i); 
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[elementnumbers isgrid]=processdata(md,[1:md.numberofelements]',options_structure);
+
+%plot
+if is2d
+	%plot mesh 
+	A=elements(:,1); B=elements(:,2); C=elements(:,3);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	for i=1:size(elements,1),
+		text(sum(x(elements(i,:)))/3,sum(y(elements(i,:)))/3,sum(z(elements(i,:)))/3,num2str(elementnumbers(i)));
+		if ~isnan(options_structure.highlight) & ismember(elementnumbers(i),options_structure.highlight)
+			A=elements(i,1); B=elements(i,2);  C=elements(i,3);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+		end
+	end
+else
+	%plot mesh 
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	for i=1:size(elements,1),
+		text(sum(x(elements(i,:)))/6,sum(y(elements(i,:)))/6,sum(z(elements(i,:)))/6,num2str(elementnumbers(i)));
+		if ~isnan(options_structure.highlight) & ismember(elementnumbers(i),options_structure.highlight)
+			A=elements(i,1); B=elements(i,2);  C=elements(i,3);  D=elements(i,4); E=elements(i,5);  F=elements(i,6);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+		end
+	end
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Element numbering';
+end
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_elementstype.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_elementstype.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_elementstype.m	(revision 1)
@@ -0,0 +1,96 @@
+function plot_elementstype(md,options_structure,width,i);
+%PLOT_ELEMENTSTYPE - plot elements type
+%
+%   Usage:
+%      plot_elementstype(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[data1 isongrid]=processdata(md,md.elements_type(:,1),options_structure);
+[data2 isongrid]=processdata(md,md.elements_type(:,2),options_structure);
+data=[data1 data2];
+
+%edgecolor?
+if ~isnan(options_structure.edgecolor),
+	edgecolor=options_structure.edgecolor;
+else
+	edgecolor='none';
+end
+
+%plot
+subplot(width,width,i);
+
+if is2d
+	%Hutter elements
+	posH=find(data(:,1)==hutterenum);
+	A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 
+	p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',hutterenum,'FaceColor','flat','EdgeColor',edgecolor);
+	%MacAyeal element
+	posH=find(data(:,1)==macayealenum);
+	A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 
+	p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',macayealenum,'FaceColor','flat','EdgeColor',edgecolor);
+	%Pattyn element
+	posH=find(data(:,1)==pattynenum);
+	A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 
+	p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',pattynenum,'FaceColor','flat','EdgeColor',edgecolor);
+	%Stokes elements
+	alpha=0.35;
+	posS=find(data(:,2)==stokesenum);
+	if ~isempty(posS)
+		A=elements(posS,1); B=elements(posS,2); C=elements(posS,3);
+	%	p4=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',stokesenum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha);
+	%	legend([p1 p2 p3 p4],'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements','Stokes''s elements');
+	else
+		legend([p1 p2 p3],'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements');
+	end
+else
+	%Hutter elements
+	posH=find(data(:,1)==hutterenum);
+	A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); D=elements(posH,4); E=elements(posH,5); F=elements(posH,6);
+	p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', hutterenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', hutterenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', hutterenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', hutterenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', hutterenum,'FaceColor','flat','EdgeColor',edgecolor);
+	%MacAyeal elements
+	posM=find(data(:,1)==macayealenum);
+	A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); D=elements(posM,4); E=elements(posM,5); F=elements(posM,6);
+	p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', macayealenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', macayealenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', macayealenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', macayealenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', macayealenum,'FaceColor','flat','EdgeColor',edgecolor);
+	%Pattyn elements
+	posP=find(data(:,1)==pattynenum);
+	A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6);
+	p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', pattynenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', pattynenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', pattynenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', pattynenum,'FaceColor','flat','EdgeColor',edgecolor);
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', pattynenum,'FaceColor','flat','EdgeColor',edgecolor);
+	%Stokes elements
+	alpha=0.35;
+	posS=find(data(:,2)==stokesenum);
+	if ~isempty(posS)
+		A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); D=elements(posS,4); E=elements(posS,5); F=elements(posS,6);
+	%	p4=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', stokesenum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha);
+	%	patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', stokesenum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha);
+	%	patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', stokesenum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha);
+	%	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', stokesenum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha);
+	%	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', stokesenum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha);
+	%	legend([p1 p2 p3 p4],'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements','Stokes''s elements');
+	else
+		legend([p1 p2 p3],'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements');
+	end
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Elements type';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_gridnumbering.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_gridnumbering.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_gridnumbering.m	(revision 1)
@@ -0,0 +1,53 @@
+function plot_gridnumbering(md,options_structure,width,i);
+%PLOT_GRIDNUMBERING - plot grid numbering
+%
+%   Usage:
+%      plot_gridnumbering(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[gridnumbers isongrid]=processdata(md,[1:md.numberofgrids]',options_structure);
+
+%plot
+subplot(width,width,i); 
+
+if is2d
+	%plot mesh 
+	A=elements(:,1); B=elements(:,2); C=elements(:,3);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	for i=1:length(gridnumbers)
+		text(x(i),y(i), z(i),num2str(gridnumbers(i)),'backgroundcolor',[0.8 0.9 0.8]);
+	end
+	if ~isnan(options_structure.highlight),
+		for i=1:length(options_structure.highlight)
+			text(x(options_structure.highlight(i)),y(options_structure.highlight(i)), z(options_structure.highlight(i)),num2str(options_structure.highlight(i)),'backgroundcolor',[1 0 0]);
+		end
+	end
+else
+	%plot mesh 
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	for i=1:length(gridnumbers)
+		text(x(i),y(i), z(i),num2str(i),'backgroundcolor',[0.8 0.9 0.8]);
+	end
+	if ~isnan(options_structure.highlight),
+		for i=1:length(options_structure.highlight)
+			text(x(options_structure.highlight(i)),y(options_structure.highlight(i)), z(options_structure.highlight(i)),num2str(options_structure.highlight(i)),'backgroundcolor',[1 0 0]);
+		end
+	end
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Grid numbering';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_highlightelements.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_highlightelements.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_highlightelements.m	(revision 1)
@@ -0,0 +1,57 @@
+function plot_highlightelements(md,options_structure,width,i);
+%PLOT_HIGHLIGHTELEMENTS - plot selected elements
+%
+%   Usage:
+%      plot_highlightelements(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh boundaries
+subplot(width,width,i); 
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[elementnumbers isgrid]=processdata(md,[1:md.numberofelements]',options_structure);
+
+%plot
+if is2d
+	%plot mesh 
+	A=elements(:,1); B=elements(:,2); C=elements(:,3);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	for i=1:size(elements,1),
+		if ~isnan(options_structure.highlight) & ismember(elementnumbers(i),options_structure.highlight)
+			A=elements(i,1); B=elements(i,2);  C=elements(i,3);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+		end
+	end
+else
+	%plot mesh 
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	for i=1:size(elements,1),
+		if ~isnan(options_structure.highlight) & ismember(elementnumbers(i),options_structure.highlight)
+			A=elements(i,1); B=elements(i,2);  C=elements(i,3);  D=elements(i,4); E=elements(i,5);  F=elements(i,6);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+		end
+	end
+end
+
+%apply options
+if isnan(options_structure.highlight)
+	disp('highlightelements warning : highlight option empty, not element highlighted');
+end
+if isnan(options_structure.title)
+	options_structure.title='Highlighted Elements';
+end
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_highlightgrids.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_highlightgrids.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_highlightgrids.m	(revision 1)
@@ -0,0 +1,50 @@
+function plot_highlightgrids(md,options_structure,width,i);
+%PLOT_HIGHLIGHTGRIDS - plot selected grids
+%
+%   Usage:
+%      plot_highlightgrids(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[gridnumbers isongrid]=processdata(md,[1:md.numberofgrids]',options_structure);
+
+%plot
+subplot(width,width,i); 
+
+if is2d
+	%plot mesh 
+	A=elements(:,1); B=elements(:,2); C=elements(:,3);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	if ~isnan(options_structure.highlight),
+		for i=1:length(options_structure.highlight)
+			text(x(options_structure.highlight(i)),y(options_structure.highlight(i)), z(options_structure.highlight(i)),num2str(options_structure.highlight(i)),'backgroundcolor',[1 0 0]);
+		end
+	end
+else
+	%plot mesh 
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	if ~isnan(options_structure.highlight),
+		for i=1:length(options_structure.highlight)
+			text(x(options_structure.highlight(i)),y(options_structure.highlight(i)), z(options_structure.highlight(i)),num2str(options_structure.highlight(i)),'backgroundcolor',[1 0 0]);
+		end
+	end
+end
+
+%apply options
+if isnan(options_structure.highlight)
+	disp('highlightgrids warning : highlight option empty, not grid highlighted');
+end
+if isnan(options_structure.title)
+	options_structure.title='Highlighted Grids';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_importancefactors.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_importancefactors.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_importancefactors.m	(revision 1)
@@ -0,0 +1,87 @@
+function plot_importancefactors(md,options_structure,width,ii);
+%PLOT_IMPORTANCEFACTORS - plot importance factors
+%
+%   Usage:
+%      plot_importancefactors(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%first recover design variable descriptor
+if ~isnan(options_structure.designvariable),
+	descriptor=options_structure.designvariable;
+else
+	error('plot_importancefactors error message: Need to supply design variable descriptor');
+end
+descriptorlength=length(descriptor);
+
+%then recover responsfunction name
+if ~isnan(options_structure.responsefunction),
+	responsefunctiondescriptor=options_structure.responsefunction;
+else
+	error('plot_importancefactors error message: Need to supply response function descriptor');
+end
+
+%go through all response functions and find the one corresponding to the correct responsefunctiondescriptor
+responsefunctions=md.dakotaresults{2};
+found=0;
+for i=1:length(responsefunctions),
+	if strcmpi(responsefunctions(i).descriptor,responsefunctiondescriptor),
+		found=i;
+		break;
+	end
+end
+if ~found,
+	error('plot_importancefactors error message: could not find correct response function');
+end
+responsefunctions=responsefunctions(found);
+nfun=size(responsefunctions.desvar,1);
+
+%Now recover response to the correct desgin variable
+importancefactors=zeros(md.npart,1);
+count=0;
+for i=1:nfun,
+	desvar=responsefunctions.desvar{i};
+	if strncmpi(desvar,descriptor,descriptorlength),
+		count=count+1;
+		importancefactors(count)=responsefunctions.impfac(i);
+	end
+end
+if count==0,
+	error('plot_importancefactors error message: could not find to response functions with corresponding design variable');
+end
+
+%log?
+if ~isnan(options_structure.log),
+	logvalue=options_structure.log;
+	importancefactors=log(importancefactors)/log(logvalue);
+end
+
+%Ok, get partitioning.
+[epart npart]=MeshPartition(md,md.npart);
+
+%distribute importance factor
+gridimportance=importancefactors(npart);
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+
+%edgecolor?
+if ~isnan(options_structure.edgecolor),
+	edgecolor=options_structure.edgecolor;
+else
+	edgecolor='none';
+end
+
+%standard plot:
+subplot(width,width,ii);
+
+%ok, plot gridimportance now.
+if is2d,
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', gridimportance,'FaceColor','interp','EdgeColor',edgecolor);
+else
+	error('plot_importancefactors error message: 3d meshes not supported yet');
+end
+
+%apply options
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_mesh.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_mesh.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_mesh.m	(revision 1)
@@ -0,0 +1,35 @@
+function plot_mesh(md,options_structure,width,i);
+%PLOT_MESH - plot model mesh
+%
+%   Usage:
+%      plot_mesh(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+
+%plot mesh
+subplot(width,width,i); 
+
+%plot mesh
+if is2d
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+else
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Mesh';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_overlay.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_overlay.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_overlay.m	(revision 1)
@@ -0,0 +1,101 @@
+function plot_overlay(md,data,options_structure,width,i)
+%PLOT_OVERLAY - superimpose radar image to a given field
+%
+%   Usage:
+%      plot_overlay(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%2d plots only
+if ~strcmpi(md.type,'2d'),
+	error('plot_overlay error message: only 2d plots allowed');
+end
+
+%highres?
+if ~isnan(options_structure.highres),
+	highres=options_structure.highres;
+else
+	highres=0;
+end
+
+%alpha?
+if ~isnan(options_structure.alpha),
+	transparency=options_structure.alpha;
+else
+	transparency=1.5; %rignot setting.
+end
+
+%smoothing?
+if strcmpi(options_structure.smooth,'yes') & length(data)==md.numberofelements
+	smoothing=1;
+else
+	smoothing=0;
+end
+
+if ~isnan(options_structure.windowsize),
+	windowsize=options_structure.windowsize;
+else
+	windowsize=1;
+end
+
+%border?
+if ~isnan(options_structure.border),
+	border=options_structure.border;
+else
+	border=0;
+end
+
+[image_rgb xm ym]=buildoverlay(md,data,transparency,highres,smoothing,windowsize,border);
+
+%Select plot area 
+subplot(width,width,i);
+
+if ~isnan(options_structure.unitmultiplier),
+	xm=xm*options_structure.unitmultiplier;
+	ym=ym*options_structure.unitmultiplier;
+end
+
+%Plot: 
+imagesc(xm,ym,image_rgb);set(gca,'YDir','normal');
+
+%Apply options, without colorbar and without grid
+options_structure.colorbar=0;
+
+applyoptions(md,data,options_structure);
+
+%colorbar
+if ~isnan(options_structure.colorbar),
+
+	%create colorbar with correct colors and position
+	colorbar_rgb=buildoverlaycolorbar(md,data,transparency);
+	colorbar_handle=colorbar; 
+	colorbar_image_handle=get(colorbar_handle,'Children'); 
+	set(colorbar_image_handle,'CData',colorbar_rgb);
+	set(colorbar_handle,'Position',options_structure.colorbarpos);
+
+	%modify ticks.
+	if isfield(struct(md),data) data=eval(['md.' data ';']); end
+	data(find(data<1.5))=1.5;
+	
+	scalestring=get(colorbar_handle,'YTickLabel');
+	scalevalues=get(colorbar_handle,'YTick');
+	scaleminmax=caxis;
+	numvalues=length(scalevalues);
+
+	scalestring=[];
+	for i=1:numvalues,
+		fraction=(scalevalues(i)-scaleminmax(1))/(scaleminmax(2)-scaleminmax(1));
+		scalevalues(i)=exp(min(log(data))+(max(log(data))-min(log(data)))*fraction);
+
+		scalestring=[scalestring; sprintf('%8.4g',scalevalues(i))];
+	end
+	set(colorbar_handle,'YTickLabel',scalestring);
+	set(colorbar_handle,'YColor','y');
+	set(colorbar_handle,'FontSize',16);
+end
+
+%take axis off
+axis off;
+
+%put axis equal
+axis equal;
Index: /issm/trunk/src/m/classes/public/plot/plot_penalties.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_penalties.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_penalties.m	(revision 1)
@@ -0,0 +1,51 @@
+function plot_penalties(md,options_structure,width,i);
+%PLOT_PENALTIES - plot penalties
+%
+%   Usage:
+%      plot_penalties(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+
+%plot mesh penalties
+subplot(width,width,i); 
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	x=x*options_structure.unitmultiplier;
+	y=y*options_structure.unitmultiplier;
+	z=z*options_structure.unitmultiplier;
+end
+
+if ~strcmpi(md.type,'3d'),
+	error('no penalties to plot for ''2d'' model');
+elseif isnan(md.penalties) | isempty(md.penalties)
+	disp('no penalty applied in this model');
+	return;
+else
+	%plot mesh
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+
+	hold on;
+	for (i=1:size(md.penalties,1)),
+		P1=plot3(x(md.penalties(i,1)),y(md.penalties(i,1)),z(md.penalties(i,1)),'ro','MarkerSize',15,'MarkerFaceColor','r');
+		P2=plot3(x(md.penalties(i,:)),y(md.penalties(i,:)),z(md.penalties(i,:)),'bo-','LineWidth',2,'MarkerSize',8,'MarkerFaceColor','b');
+	end
+	legend([P1 P2],'MacAyeal''s penalized grids','Pattyn''s penalized grids');
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Penalties';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_quiver.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_quiver.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_quiver.m	(revision 1)
@@ -0,0 +1,27 @@
+function plot_quivervel(md,options_structure,width,i);
+%PLOT_QUIVERVEL - plot arrow field of 2d velocities
+%
+%   Usage:
+%      plot_quivervel(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[vx isongrid]=processdata(md,md.vx,options_structure);
+[vy isongrid]=processdata(md,md.vy,options_structure);
+
+%plot mesh quivervel
+subplot(width,width,i); 
+					
+%quiver 2d 
+quiver(x,y,vx,vy);
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Velocity vectors';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_quiver3.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_quiver3.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_quiver3.m	(revision 1)
@@ -0,0 +1,28 @@
+function plot_quivervel3(md,options_structure,width,i);
+%PLOT_QUIVERVEL3 - plot arrow field of 3d velocities
+%
+%   Usage:
+%      plot_quivervel3(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[vx isongrid]=processdata(md,md.vx,options_structure);
+[vy isongrid]=processdata(md,md.vy,options_structure);
+[vz isongrid]=processdata(md,md.vz,options_structure);
+
+%plot mesh quivervel3
+subplot(width,width,i); 
+
+%quiver 3d 
+quiver3(x,y,z,vx,vy,vz);
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Velocity vectors (3D)';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=1;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_quivervel.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_quivervel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_quivervel.m	(revision 1)
@@ -0,0 +1,56 @@
+function plot_quivervel(md,options_structure,width,i);
+%PLOT_QUIVERVEL - superimpose arrows and magnitude of the velocity
+%
+%   Usage:
+%      plot_quivervel(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[vx isongrid]=processdata(md,md.vx,options_structure);
+[vy isongrid]=processdata(md,md.vy,options_structure);
+if ~isnan(md.vz)
+	[vz isongrid]=processdata(md,md.vz,options_structure);
+end
+
+%edgecolor?
+if ~isnan(options_structure.edgecolor),
+	edgecolor=options_structure.edgecolor;
+else
+	edgecolor='none';
+end
+
+%plot
+subplot(width,width,i); 
+
+if is2d
+	hold on
+	colormap('default')
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+	colorbar;
+	quiver(x,y,vx,vy,'k')
+	alpha(0.7)
+else
+	hold on
+	colormap('default')
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+	colorbar;
+	quiver3(x,y,z,vx,vy,vz);
+	alpha(0.7)
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Velocity';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=1;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_riftpenetration.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_riftpenetration.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_riftpenetration.m	(revision 1)
@@ -0,0 +1,82 @@
+function plot_rifpenetration(md,options_structure,width,i);
+%PLOT_RIFTPENETRATION - plot rift penetration
+%
+%   Usage:
+%      plot_rifpenetration(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh boundaries
+subplot(width,width,i); 
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	md.x=md.x*options_structure.unitmultiplier;
+	md.y=md.y*options_structure.unitmultiplier;
+	md.z=md.z*options_structure.unitmultiplier;
+end
+
+for i=1:size(md.segments,1),
+	plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'k.-');hold on;
+end
+
+hold on;
+
+isp1=0;
+isp2=0;
+
+if isstruct(md.rifts),
+	%plot mesh boundaries
+	for i=1:size(md.segments,1),
+		h1=plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'b-');
+	end
+	for i=1:size(md.rifts,1),
+		penaltypairs=md.rifts(i).penaltypairs;
+
+		segments=md.rifts(i).segments;
+		for j=1:size(segments,1),
+			plot(md.x(segments(j,1:2)),md.y(segments(j,1:2)),'b-');
+		end
+
+		normal=zeros(2,1);
+		for j=1:size(penaltypairs,1),
+			normal(1)=penaltypairs(j,5);
+			normal(2)=penaltypairs(j,6);
+
+			vx1=md.vx(penaltypairs(j,1)); vx2=md.vx(penaltypairs(j,2)); vy1=md.vy(penaltypairs(j,1)); vy2=md.vy(penaltypairs(j,2));
+			penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
+			%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
+			if(penetration>0),
+				p2=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'r*');
+				isp2=1;
+			else
+				p1=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'k*');
+				isp1=1;
+			end
+		end
+
+		%point out the tips
+		h2=plot(md.x(md.rifts(i).tips(1)),md.y(md.rifts(i).tips(1)),'g*');
+		plot(md.x(md.rifts(i).tips(2)),md.y(md.rifts(i).tips(2)),'g*');
+	end
+	if isp1 & isp2
+		legend([h1,h2,p1,p2],'mesh boundaries','rift tips',' rifts closing','rifts opening')
+	elseif isp1
+		legend([h1,h2,p1],'mesh boundaries','rift tips',' rifts closing')
+	elseif isp2
+		legend([h1,h2,p2],'mesh boundaries','rift tips','rifts opening')
+	else
+		legend([h1,h2],'mesh boundaries','rift tips')
+	end
+else
+	error('plot error message: no rifts available!');
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Rift Penetration';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_riftrelvel.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_riftrelvel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_riftrelvel.m	(revision 1)
@@ -0,0 +1,87 @@
+function plot_riftrelvel(md,options_structure,width,i);
+%PLOT_RIFTRELVEL - plot rift relative velocities
+%
+%   Usage:
+%      plot_riftrelvel(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh boundaries
+subplot(width,width,i); 
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	md.x=md.x*options_structure.unitmultiplier;
+	md.y=md.y*options_structure.unitmultiplier;
+	md.z=md.z*options_structure.unitmultiplier;
+end
+
+for i=1:size(md.segments,1),
+	plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'k.-');hold on;
+end
+
+%plot rift velocities
+hold on;
+
+isp1=0;
+isp2=0;
+
+if isstruct(md.rifts),
+	%plot mesh boundaries
+	for i=1:size(md.segments,1),
+		h1=plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'b-');
+	end
+	for i=1:size(md.rifts,1),
+		penaltypairs=md.rifts(i).penaltypairs;
+
+		segments=md.rifts(i).segments;
+		for j=1:size(segments,1),
+			plot(md.x(segments(j,1:2)),md.y(segments(j,1:2)),'b-');
+		end
+
+		normal=zeros(2,1);
+		for j=1:size(penaltypairs,1),
+			normal(1)=penaltypairs(j,5);
+			normal(2)=penaltypairs(j,6);
+
+			vx1=md.vx(penaltypairs(j,1)); vx2=md.vx(penaltypairs(j,2)); vy1=md.vy(penaltypairs(j,1)); vy2=md.vy(penaltypairs(j,2));
+			penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
+			%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
+			if(penetration>0),
+				p2=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'r*');
+				isp2=1;
+			else
+				p1=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'k*');
+				isp1=1;
+			end
+		end
+
+		%point out the tips
+		h2=plot(md.x(md.rifts(i).tips(1)),md.y(md.rifts(i).tips(1)),'g*');
+		plot(md.x(md.rifts(i).tips(2)),md.y(md.rifts(i).tips(2)),'g*');
+
+		%plot relative velocities
+		h=quiver(md.x(penaltypairs(:,1)),md.y(penaltypairs(:,1)),md.vx(penaltypairs(:,2))-md.vx(penaltypairs(:,1)),md.vy(penaltypairs(:,2))-md.vy(penaltypairs(:,1)));
+		set(h,'Color',[1 0 0]);
+	end
+	if isp1 & isp2
+		legend([h1,h2,p1,p2,h],'mesh boundaries','rift tips',' rifts closing','rifts opening','relative velocities')
+	elseif isp1
+		legend([h1,h2,p1,h],'mesh boundaries','rift tips',' rifts closing','relative velocities')
+	elseif isp2
+		legend([h1,h2,p2,h],'mesh boundaries','rift tips','rifts opening','relative velocities')
+	else
+		legend([h1,h2,h],'mesh boundaries','rift tips','relative velocities')
+	end
+else
+	error('plot error message: no rifts available!');
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Rift relative velocities';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_riftvel.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_riftvel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_riftvel.m	(revision 1)
@@ -0,0 +1,86 @@
+function plot_riftvel(md,options_structure,width,i);
+%PLOT_RIFTVEL - plot rift velocity
+%
+%   Usage:
+%      plot_riftvel(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh boundaries
+subplot(width,width,i); 
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	md.x=md.x*options_structure.unitmultiplier;
+	md.y=md.y*options_structure.unitmultiplier;
+	md.z=md.z*options_structure.unitmultiplier;
+end
+
+for i=1:size(md.segments,1),
+	plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'k.-');hold on;
+end
+
+%plot rift velocities
+hold on;
+
+isp1=0;
+isp2=0;
+
+if isstruct(md.rifts),
+	%plot mesh boundaries
+	for i=1:size(md.segments,1),
+		h1=plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'b-');
+	end
+	for i=1:size(md.rifts,1),
+		penaltypairs=md.rifts(i).penaltypairs;
+
+		segments=md.rifts(i).segments;
+		for j=1:size(segments,1),
+			plot(md.x(segments(j,1:2)),md.y(segments(j,1:2)),'b-');
+		end
+
+		normal=zeros(2,1);
+		for j=1:size(penaltypairs,1),
+			normal(1)=penaltypairs(j,5);
+			normal(2)=penaltypairs(j,6);
+
+			vx1=md.vx(penaltypairs(j,1)); vx2=md.vx(penaltypairs(j,2)); vy1=md.vy(penaltypairs(j,1)); vy2=md.vy(penaltypairs(j,2));
+			penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
+			%if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
+			if(penetration>0),
+				p2=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'r*');
+				isp2=1;
+			else
+				p1=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'k*');
+				isp1=1;
+			end
+		end
+
+		%point out the tips
+		h2=plot(md.x(md.rifts(i).tips(1)),md.y(md.rifts(i).tips(1)),'g*');
+		plot(md.x(md.rifts(i).tips(2)),md.y(md.rifts(i).tips(2)),'g*');
+		segments=md.rifts(i).segments(:,1:2);
+		h3=quiver(md.x(segments),md.y(segments),md.vx(segments),md.vy(segments));
+		set(h3,'Color',[1 0 0]);
+	end
+	if isp1 & isp2
+		legend([h1,h2,p1,p2,h3],'mesh boundaries','rift tips',' rifts closing','rifts opening','velocities')
+	elseif isp1
+		legend([h1,h2,p1,h3],'mesh boundaries','rift tips',' rifts closing','velocities')
+	elseif isp2
+		legend([h1,h2,p2,h3],'mesh boundaries','rift tips','rifts opening','velocities')
+	else
+		legend([h1,h2,h3],'mesh boundaries','rift tips','velocities')
+	end
+else
+	error('plot error message: no rifts available!');
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Rift Velocities';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_sarpwr.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_sarpwr.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_sarpwr.m	(revision 1)
@@ -0,0 +1,27 @@
+function plot_sarpwr(md,options_structure,width,i);
+%PLOT_SARPWR - plot radar image
+%
+%   Usage:
+%      plot_sarpwr(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh sarpwr
+subplot(width,width,i); 
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	md.x=md.x*options_structure.unitmultiplier;
+	md.y=md.y*options_structure.unitmultiplier;
+	md.z=md.z*options_structure.unitmultiplier;
+end
+					
+imagesc(md.sarxm,md.sarym,double(md.sarpwr)),set(gca,'YDir','normal');colormap(gray);
+
+%apply options
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+options_structure.colormap='gray';
+
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_section.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_section.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_section.m	(revision 1)
@@ -0,0 +1,108 @@
+function plot_section(md,data,options_structure,width,i)
+%PLOT_SECTION - plot a given field on a section
+%
+%   Usage:
+%      plot_section(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%How many subplots?
+if strcmpi(options_structure.showsection,'yes')
+
+	%Compute the indexes of the 2 plots (one for the sectionvalue and one for showsection
+	upperplots=fix((i-1)/width);
+	if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
+	index1=4*width*upperplots+2*leftplots+1;
+	index2=index1+1;
+	width=2*width;
+else
+	index1=i;
+end
+
+%check on arguments
+if (iscell(data) | isempty(data)),
+	error('plot error message: data provided is empty');
+end
+if md.numberofgrids==size(md.elements,1),
+	error('plot error message: the number of elements is the same as the number of grids! cannot plot anything with model/plot, use matlab/plot instead')
+end
+
+%smoothing?
+if strcmpi(options_structure.smooth,'yes') & length(data)==md.numberofelements
+	data=elementstogrids(md,data);
+end
+
+%layer projection? 
+if ~isnan(options_structure.layer) & options_structure.layer>=1,
+	data=project2d(md,data,options_structure.layer); %project onto 2d mesh
+	%we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded. 
+	md.x=md.x2d;
+	md.y=md.y2d;
+	md.z=md.z2d;
+	md.elements=md.elements2d;
+	md.elements_type=md.elements_type2d;
+	md.type='2d';
+end
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	md.x=md.x*options_structure.unitmultiplier;
+	md.y=md.y*options_structure.unitmultiplier;
+	md.z=md.z*options_structure.unitmultiplier;
+end
+
+%resolution
+if ~isnan(options_structure.resolution),
+	resolution=options_structure.resolution;
+else %Default resolution
+	resolution=[1000 10*md.numlayers];
+	disp(['plot_section warning: no resolution specified, use default resolution: [horizontal_resolution vertical_resolution]=[' num2str(resolution)  ']']);
+end
+
+%Compute section value
+[elements,x,y,z,s,data]=SectionValues(md,data,options_structure.sectionvalue,resolution);
+
+if strcmpi(md.type,'2d')
+	%plot section value
+	subplot(width,width,index1)
+	plot(s,data)
+else
+	%plot section value
+	%if user requested view2: 2d plot with curvilinear coordinate
+	if (~isnan(options_structure.view) & options_structure.view==2 )
+		subplot(width,width,index1)
+		A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4); 
+		patch( 'Faces', [A B C D], 'Vertices', [s z zeros(length(s),1)],'FaceVertexCData',data,'FaceColor','interp','EdgeColor','none');
+	else
+		subplot(width,width,index1)
+		A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4); 
+		patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData',data,'FaceColor','interp','EdgeColor','none');
+		view(3)
+	end
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Section value';
+end 
+if isnan(options_structure.colorbar) & strcmpi(md.type,'2d')
+	options_structure.colorbar=0;
+end
+if isnan(options_structure.xlabel) & (strcmpi(md.type,'2d') | options_structure.view==2 )
+	options_structure.xlabel='Curvilinear coordinate';
+end
+if isnan(options_structure.ylabel) & (strcmpi(md.type,'3d') & options_structure.view==2 )
+	options_structure.ylabel='z';
+end
+applyoptions(md,[],options_structure);
+
+%plot section if requested by user
+if strcmpi(options_structure.showsection,'yes')
+	subplot(width,width,index2)
+	hold on
+	text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
+	text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8])
+	plot(x,y)
+	axis([min(md.x) max(md.x) min(md.y) max(md.y)])
+	view(2)
+end
Index: /issm/trunk/src/m/classes/public/plot/plot_segmentnumbering.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_segmentnumbering.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_segmentnumbering.m	(revision 1)
@@ -0,0 +1,56 @@
+function plot_segmentnumbering(md,options_structure,width,i);
+%PLOT_SEGMENTNUMBERING - plot segment numbering
+%
+%   Usage:
+%      plot_segmentnumbering(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh boundaries
+subplot(width,width,i); 
+
+%process data and model
+[x y z segments is2d]=processmesh(md,options_structure);
+
+error('not implemented yet');
+%plot
+if is2d
+	%plot mesh 
+	A=segments(:,1); B=segments(:,2); C=segments(:,3);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	for i=1:size(segments,1),
+		text(sum(x(segments(i,:)))/3,sum(y(segments(i,:)))/3,sum(z(segments(i,:)))/3,num2str(segmentnumbers(i)));
+		if ~isnan(options_structure.highlight) & ismember(segmentnumbers(i),options_structure.highlight)
+			A=segments(i,1); B=segments(i,2);  C=segments(i,3);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+		end
+	end
+else
+	%plot mesh 
+	A=segments(:,1); B=segments(:,2); C=segments(:,3); D=segments(:,4); E=segments(:,5); F=segments(:,6);
+	patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	for i=1:size(segments,1),
+		text(sum(x(segments(i,:)))/6,sum(y(segments(i,:)))/6,sum(z(segments(i,:)))/6,num2str(segmentnumbers(i)));
+		if ~isnan(options_structure.highlight) & ismember(segmentnumbers(i),options_structure.highlight)
+			A=segments(i,1); B=segments(i,2);  C=segments(i,3);  D=segments(i,4); E=segments(i,5);  F=segments(i,6);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+			patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [0.9 0.5 0.5],'FaceColor','flat','EdgeColor','black');
+		end
+	end
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Element numbering';
+end
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_segmentonneumann.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_segmentonneumann.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_segmentonneumann.m	(revision 1)
@@ -0,0 +1,99 @@
+function plot_segmentonneumann(md,options_structure,width,i,datai);
+%PLOT_SEGMENTONNEUMANN - plot segment on neumann BC
+%
+%   Usage:
+%      plot_segmentonneumann(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh boundaries
+subplot(width,width,i); 
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	md.x=md.x*options_structure.unitmultiplier;
+	md.y=md.y*options_structure.unitmultiplier;
+	md.z=md.z*options_structure.unitmultiplier;
+end
+
+if strcmp(datai,'segmentonneumann_diag') segmentonneumann=md.segmentonneumann_diag;end
+if strcmp(datai,'segmentonneumann_prog') segmentonneumann=md.segmentonneumann_prog;end
+
+%we are dealing with the loads. 
+length_icefront=sqrt( (md.x(segmentonneumann(:,1))-md.x(segmentonneumann(:,2))).^2 + (md.y(segmentonneumann(:,1))-md.y(segmentonneumann(:,2))).^2 );
+normal_icefront(:,1)=cos(atan2( (md.x(segmentonneumann(:,1))-md.x(segmentonneumann(:,2))) , (md.y(segmentonneumann(:,2))-md.y(segmentonneumann(:,1))) ) );
+normal_icefront(:,2)=sin(atan2( (md.x(segmentonneumann(:,1))-md.x(segmentonneumann(:,2))) , (md.y(segmentonneumann(:,2))-md.y(segmentonneumann(:,1))) ) );
+
+if strcmpi(md.type,'2d'),
+	for n=1:size(segmentonneumann,1),
+
+		plot(md.x(segmentonneumann(n,1:2)),md.y(segmentonneumann(n,1:2)),'b-','linewidth',2);
+		hold on
+		plot(md.x(segmentonneumann(n,1:2)),md.y(segmentonneumann(n,1:2)),'r.','markersize',12);
+
+		xstart=mean(md.x(segmentonneumann(n,1:2)));
+		ystart=mean(md.y(segmentonneumann(n,1:2)));
+
+		xend=xstart+length_icefront(n)*normal_icefront(n,1);
+		yend=ystart+length_icefront(n)*normal_icefront(n,2);
+
+		plot([xstart xend],[ystart yend],'r-')
+		legend('element edges on ice front','grids on ice front','normal vectors')
+	end
+else
+	for n=1:size(segmentonneumann,1),
+		hold on
+
+		%Plot the two triangles of each quad (element edges on ice front)
+		A=segmentonneumann(n,1);  B=segmentonneumann(n,2); C=segmentonneumann(n,3); D=segmentonneumann(n,4); E=md.numberofgrids+1;
+		coordinates= [md.x md.y md.z; mean(md.x(segmentonneumann(n,1:4))) mean(md.y(segmentonneumann(n,1:4))) mean(md.z(segmentonneumann(n,1:4)))];
+		p1=patch( 'Faces', [A B E A], 'Vertices',coordinates,'FaceVertexCData', [1 1 1],'FaceColor','flat','EdgeColor','blue','linewidth',2);
+		patch( 'Faces', [A D E A], 'Vertices',coordinates,'FaceVertexCData', [1 1 1],'FaceColor','flat','EdgeColor','blue','linewidth',2);
+		patch( 'Faces', [D C E D], 'Vertices',coordinates,'FaceVertexCData', [1 1 1],'FaceColor','flat','EdgeColor','blue','linewidth',2);
+		patch( 'Faces', [C B E C], 'Vertices',coordinates,'FaceVertexCData', [1 1 1],'FaceColor','flat','EdgeColor','blue','linewidth',2);
+
+		%Plot the nodes of each quad (grids on ice front)
+		p2=plot3(md.x(segmentonneumann(n,1:4)),md.y(segmentonneumann(n,1:4)),md.z(segmentonneumann(n,1:4)),'r.','markersize',12);
+		plot3(coordinates(end,1),coordinates(end,2),coordinates(end,3),'g.','markersize',12);
+
+		%Retrieve coordinates of the four nodes of the Quad
+		xyz1=[md.x(segmentonneumann(n,1));md.y(segmentonneumann(n,1));md.z(segmentonneumann(n,1));];
+		xyz2=[md.x(segmentonneumann(n,2));md.y(segmentonneumann(n,2));md.z(segmentonneumann(n,2));];
+		xyz3=[md.x(segmentonneumann(n,3));md.y(segmentonneumann(n,3));md.z(segmentonneumann(n,3));];
+		xyz4=[md.x(segmentonneumann(n,4));md.y(segmentonneumann(n,4));md.z(segmentonneumann(n,4));];
+		xyz5=coordinates(end,:)';
+		
+		%Build the norms of each triangle
+		V1=cross(xyz5-xyz1,xyz5-xyz2); normal1=1/norm(V1)*V1';
+		V2=cross(xyz5-xyz2,xyz5-xyz3); normal2=1/norm(V2)*V2';
+		V3=cross(xyz5-xyz3,xyz5-xyz4); normal3=1/norm(V3)*V3';
+		V4=cross(xyz5-xyz4,xyz5-xyz1); normal4=1/norm(V4)*V4';
+
+		xstart1=mean([xyz1(1) xyz2(1) xyz5(1)]); ystart1=mean([xyz1(2) xyz2(2) xyz5(2)]); zstart1=mean([xyz1(3) xyz2(3) xyz5(3)]);
+		xstart2=mean([xyz2(1) xyz3(1) xyz5(1)]); ystart2=mean([xyz2(2) xyz3(2) xyz5(2)]); zstart2=mean([xyz2(3) xyz3(3) xyz5(3)]);
+		xstart3=mean([xyz3(1) xyz4(1) xyz5(1)]); ystart3=mean([xyz3(2) xyz4(2) xyz5(2)]); zstart3=mean([xyz3(3) xyz4(3) xyz5(3)]);
+		xstart4=mean([xyz4(1) xyz1(1) xyz5(1)]); ystart4=mean([xyz4(2) xyz1(2) xyz5(2)]); zstart4=mean([xyz4(3) xyz1(3) xyz5(3)]);
+
+		xend1=xstart1+length_icefront(n)*normal1(1);	yend1=ystart1+length_icefront(n)*normal1(2);	zend1=zstart1+length_icefront(n)*normal1(3);
+		xend2=xstart2+length_icefront(n)*normal2(1);	yend2=ystart2+length_icefront(n)*normal2(2);	zend2=zstart2+length_icefront(n)*normal2(3);
+		xend3=xstart3+length_icefront(n)*normal3(1);	yend3=ystart3+length_icefront(n)*normal3(2);	zend3=zstart3+length_icefront(n)*normal3(3);
+		xend4=xstart4+length_icefront(n)*normal4(1);	yend4=ystart4+length_icefront(n)*normal4(2);	zend4=zstart4+length_icefront(n)*normal4(3);
+		
+		%plot the normals of each triangle (normal vectors)
+		p3=plot3([xstart1 xend1],[ystart1 yend1],[zstart1 zend1],'r-');
+		plot3([xstart2 xend2],[ystart2 yend2],[zstart2 zend2],'r-');
+		plot3([xstart3 xend3],[ystart3 yend3],[zstart3 zend3],'r-');
+		plot3([xstart4 xend4],[ystart4 yend4],[zstart4 zend4],'r-');
+
+	end
+	legend([p1,p2,p3],'element edges on ice front','grids on ice front','normal vectors');
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Neumann boundary conditions';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_tensor.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_tensor.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_tensor.m	(revision 1)
@@ -0,0 +1,39 @@
+function plot_tensor(md,options_structure,width,i,type);
+%PLOT_TENSOR - plot tensor components
+%
+%   Usage:
+%      plot_tensor(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+h=subplot(width,width,i); axis off; pos=get(h,'Position');
+
+plot_options.offsetx=pos(1);
+plot_options.offsety=pos(2);
+plot_options.width=pos(3);
+plot_options.height=pos(4);
+
+%Figure out tensor type:
+if strcmpi(type(1:6),'strain'),
+	tensor=md.strainrate;
+elseif strcmpi(type(1:6),'stress'),
+	tensor=md.stress;
+elseif strcmpi(type(1:16),'deviatoricstress'),
+	tensor=md.deviatoricstress;
+else
+	error('plot_tensor error message: unsupported type of tensor');
+end
+
+%Figure out type of plot being requested
+if strcmpi(type(end-5:end),'tensor') | strcmpi(type,'strainrate') | strcmpi(type,'deviatoricstress') | strcmpi(type,'stress'),
+	plot_tensor_components(md,options_structure,width,i,tensor,type,plot_options);
+	return;
+elseif strcmpi(type(end-8:end),'principal'),
+	plot_tensor_principal(md,options_structure,width,i,tensor,type,plot_options);
+	return;
+elseif strcmpi(type(end-13:end-1),'principalaxis'),
+	plot_tensor_principalaxis(md,options_structure,width,i,tensor,type,plot_options);
+	return;
+else
+	error('plot_tensor error message: unsurported type of plot');
+end
Index: /issm/trunk/src/m/classes/public/plot/plot_tensor_components.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_tensor_components.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_tensor_components.m	(revision 1)
@@ -0,0 +1,311 @@
+function plot_tensor_components(md,options_structure,width,i,tensor,type,plot_options);
+%PLOT_TENSOR_COMPONENT - plot component of a tensor
+%
+%   Usage:
+%      plot_tensor_components(md,options_structure,width,i,tensor,type,plot_option);
+%
+%   See also: PLOTMODEL
+
+	%Compute the indexes of the components plots
+	upperplots=fix((i-1)/width);
+	if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
+	if strcmpi(md.type,'2d')%3 components -> 3 indexes
+		index1=4*width*upperplots+2*leftplots+1;
+		index2=index1+1;
+		index3=index1+width*2;
+	elseif strcmpi(md.type,'3d')%6 components -> 6 indexes
+		index1=3*3*width*upperplots+3*leftplots+1;
+		index2=index1+1;
+		index3=index1+2;
+		index4=index1+width*3;
+		index5=index4+1;
+		index6=index4+2;
+	end
+
+	%smoothing?
+	if strcmpi(options_structure.smooth,'yes') & length(tensor.xx)==md.numberofelements
+		tensor.xx=elementstogrids(md,tensor.xx);
+		tensor.yy=elementstogrids(md,tensor.yy);
+		tensor.xy=elementstogrids(md,tensor.xy);
+		if  strcmpi(md.type,'3d')
+		tensor.zz=elementstogrids(md,tensor.zz);
+		tensor.yz=elementstogrids(md,tensor.yz);
+		tensor.xz=elementstogrids(md,tensor.xz);
+		end
+	end
+
+			
+	%layer projection? 
+	if ~isnan(options_structure.layer) & options_structure.layer>=1,
+		tensor.xx=project2d(md,tensor.xx,options_structure.layer); %project onto 2d mesh
+		tensor.yy=project2d(md,tensor.yy,options_structure.layer); %project onto 2d mesh
+		tensor.zz=project2d(md,tensor.zz,options_structure.layer); %project onto 2d mesh
+		tensor.xy=project2d(md,tensor.xy,options_structure.layer); %project onto 2d mesh
+		tensor.xz=project2d(md,tensor.xz,options_structure.layer); %project onto 2d mesh
+		tensor.yz=project2d(md,tensor.yz,options_structure.layer); %project onto 2d mesh
+		%we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded. 
+		md.x=md.x2d;
+		md.y=md.y2d;
+		md.z=md.z2d;
+		md.elements=md.elements2d;
+		md.elements_type=md.elements_type2d;
+	end
+
+	%units
+	if ~isnan(options_structure.unitmultiplier),
+		md.x=md.x*options_structure.unitmultiplier;
+		md.y=md.y*options_structure.unitmultiplier;
+		md.z=md.z*options_structure.unitmultiplier;
+	end
+
+	if length(tensor.xx)==length(md.elements),
+		
+		if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+			tensor.xx(find(md.elementoniceshelf))=NaN;
+			tensor.yy(find(md.elementoniceshelf))=NaN;
+			tensor.xy(find(md.elementoniceshelf))=NaN;
+			if  strcmpi(md.type,'3d')
+				tensor.zz(find(md.elementoniceshelf))=NaN;
+				tensor.yz(find(md.elementoniceshelf))=NaN;
+				tensor.xz(find(md.elementoniceshelf))=NaN;
+			end
+		end
+		if ~isnan(options_structure.noicesheet) & options_structure.noicesheet,
+			tensor.xx(find(~md.elementoniceshelf))=NaN;
+			tensor.yy(find(~md.elementoniceshelf))=NaN;
+			tensor.xy(find(~md.elementoniceshelf))=NaN;
+			if  strcmpi(md.type,'3d')
+				tensor.zz(find(~md.elementoniceshelf))=NaN;
+				tensor.yz(find(~md.elementoniceshelf))=NaN;
+				tensor.xz(find(~md.elementoniceshelf))=NaN;
+			end
+		end
+
+		if (strcmpi(md.type,'2d')),
+			A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); 
+
+			subplot(2*width,2*width,index1)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.xx,'FaceColor','flat','EdgeColor','black');
+			Apply_options_tensor(options_structure,type,'xx')
+
+			subplot(2*width,2*width,index2)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.yy,'FaceColor','flat','EdgeColor','black');
+			Apply_options_tensor(options_structure,type,'yy')
+
+			subplot(2*width,2*width,index3)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.xy,'FaceColor','flat','EdgeColor','black');
+			Apply_options_tensor(options_structure,type,'xy')
+		else
+			if options_structure.layer>=1,
+				A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); 
+
+				subplot(3*width,3*width,index1)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData',tensor.xx ,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'xx')
+
+				subplot(3*width,3*width,index2)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData',tensor.yy ,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'yy')
+
+				subplot(3*width,3*width,index3)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData',tensor.zz ,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'zz')
+
+				subplot(3*width,3*width,index4)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData',tensor.xy ,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'xy')
+
+				subplot(3*width,3*width,index5)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData',tensor.xz ,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'xz')
+
+				subplot(3*width,3*width,index6)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData',tensor.yz ,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'yz')
+
+			else
+				A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); D=md.elements(:,4); E=md.elements(:,5); F=md.elements(:,6);
+
+				subplot(3*width,3*width,index1)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.xx,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'CData', tensor.xx,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'CData', tensor.xx,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'CData', tensor.xx,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'CData', tensor.xx,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'xx')
+
+				subplot(3*width,3*width,index2)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.yy,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'CData', tensor.yy,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'CData', tensor.yy,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'CData', tensor.yy,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'CData', tensor.yy,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'yy')
+
+				subplot(3*width,3*width,index3)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.zz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'CData', tensor.zz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'CData', tensor.zz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'CData', tensor.zz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'CData', tensor.zz,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'zz')
+
+				subplot(3*width,3*width,index4)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.xy,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'CData', tensor.xy,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'CData', tensor.xy,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'CData', tensor.xy,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'CData', tensor.xy,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'xy')
+
+				subplot(3*width,3*width,index5)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.xz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'CData', tensor.xz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'CData', tensor.xz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'CData', tensor.xz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'CData', tensor.xz,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'xz')
+
+				subplot(3*width,3*width,index6)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.yz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'CData', tensor.yz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'CData', tensor.yz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'CData', tensor.yz,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'CData', tensor.yz,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'yz')
+			end
+		end
+	elseif length(tensor.xx)==md.numberofgrids |  length(tensor.xx)==md.numberofgrids2d,
+		if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+			pos=find(md.gridoniceshelf);
+			tensor.xx(pos)=NaN;
+			tensor.yy(pos)=NaN;
+			tensor.xy(pos)=NaN;
+			if strcmpi(md.type,'3d')
+				tensor.zz(pos)=NaN;
+				tensor.xz(pos)=NaN;
+				tensor.yz(pos)=NaN;
+			end
+		end
+		if ~isnan(options_structure.noiceshelf) & options_structure.noicesheet,
+			pos=find(md.gridonicesheet);
+			tensor.xx(pos)=NaN;
+			tensor.yy(pos)=NaN;
+			tensor.xy(pos)=NaN;
+			if strcmpi(md.type,'3d')
+				tensor.zz(pos)=NaN;
+				tensor.xz(pos)=NaN;
+				tensor.yz(pos)=NaN;
+			end
+		end
+
+		if strcmpi(md.type,'2d'),
+			A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); 
+
+			subplot(2*width,2*width,index1)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.xx ,'FaceColor','flat','EdgeColor','none');
+			Apply_options_tensor(options_structure,type,'xx')
+
+			subplot(2*width,2*width,index2)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.yy ,'FaceColor','flat','EdgeColor','none');
+			Apply_options_tensor(options_structure,type,'yy')
+
+			subplot(2*width,2*width,index3)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.xy ,'FaceColor','flat','EdgeColor','none');
+			Apply_options_tensor(options_structure,type,'xy')
+
+		else
+			if options_structure.layer>=1,
+				A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); 
+				subplot(3*width,3*width,index1)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.xx ,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'xx')
+
+				subplot(3*width,3*width,index2)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.yy ,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'yy')
+
+				subplot(3*width,3*width,index3)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.zz ,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'zz')
+
+				subplot(3*width,3*width,index4)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.xy ,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'xy')
+
+				subplot(3*width,3*width,index5)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.xz ,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'xz')
+
+				subplot(3*width,3*width,index6)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.yz ,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'yz')
+
+			else
+				A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); D=md.elements(:,4); E=md.elements(:,5); F=md.elements(:,6);
+
+				subplot(3*width,3*width,index1)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xx,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xx,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xx,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xx,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xx,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'xx')
+
+				subplot(3*width,3*width,index2)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yy,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yy,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yy,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yy,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yy,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'yy')
+
+				subplot(3*width,3*width,index3)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.zz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.zz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.zz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.zz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.zz,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'zz')
+
+				subplot(3*width,3*width,index4)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xy,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xy,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xy,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xy,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xy,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'xy')
+
+				subplot(3*width,3*width,index5)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.xz,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'xz')
+
+				subplot(3*width,3*width,index6)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yz,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.yz,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'yz')
+			end
+		end
+	end
+end
+
+function Apply_options_tensor(options_structure,type,component)
+%apply options
+	if isnan(options_structure.title)
+		if ismember('_',type) %user plotet stress_tensor
+			strings=strsplit(type,'_');
+			string=strings{1};
+		else %default plot: user requested stress
+			string=type;
+		end
+		options_structure.title=[upper(string(1)) string(2:end) ' ' component];
+	end 
+	applyoptions(md,[],options_structure);
+end
Index: /issm/trunk/src/m/classes/public/plot/plot_tensor_principal.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_tensor_principal.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_tensor_principal.m	(revision 1)
@@ -0,0 +1,225 @@
+function plot_tensor_principal(md,options_structure,width,i,tensor,type,plot_options);
+%PLOT_TENSOR_PRINCIPAL - plot principal values
+%
+%   Usage:
+%      plot_tensor_principal(md,options_structure,width,i,tensor,type,plot_options);
+%
+%   See also: PLOTMODEL
+
+	%Compute the indexes of the components plots
+	upperplots=fix((i-1)/width);
+	if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
+	if strcmpi(md.type,'2d')%3 components -> 3 indexes
+		index1=4*width*upperplots+2*leftplots+1;
+		index2=index1+1;
+		index3=index1+width*2;
+		index4=index3+1;
+		newwidth=2*width;
+	elseif strcmpi(md.type,'3d')%6 components -> 6 indexes
+		index1=3*3*width*upperplots+3*leftplots+1;
+		index2=index1+1;
+		index3=index1+2;
+		index4=index1+width*3;
+		index5=index4+1;
+		index6=index4+2;
+		newwidth=3*width;
+	end
+
+	%plot principal axis
+	type1=[type 'axis1'];
+	plot_tensor_principalaxis(md,options_structure,newwidth,index1,tensor,type1,plot_options);
+	type2=[type 'axis2'];
+	plot_tensor_principalaxis(md,options_structure,newwidth,index2,tensor,type2,plot_options);
+	if  strcmpi(md.type,'3d')
+		type3=[type 'axis3'];
+		plot_tensor_principalaxis(md,options_structure,newwidth,index3,tensor,type3,plot_options);
+	end
+
+	%smoothing?
+	if strcmpi(options_structure.smooth,'yes') & length(tensor.principalvalue1)==md.numberofelements
+		tensor.principalvalue1=elementstogrids(md,tensor.principalvalue1);
+		tensor.principalvalue2=elementstogrids(md,tensor.principalvalue2);
+		if  strcmpi(md.type,'3d'), tensor.principalvalue3=elementstogrids(md,tensor.principalvalue3); end
+	end
+
+			
+	%layer projection? 
+	if ~isnan(options_structure.layer) & options_structure.layer>=1,
+		tensor.principalvalue1=project2d(md,tensor.principalvalue1,options_structure.layer); %project onto 2d mesh
+		tensor.principalvalue2=project2d(md,tensor.principalvalue2,options_structure.layer);
+		tensor.principalvalue3=project2d(md,tensor.principalvalue3,options_structure.layer);
+
+		%we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded. 
+		md.x=md.x2d;
+		md.y=md.y2d;
+		md.z=md.z2d;
+		md.elements=md.elements2d;
+		md.elements_type=md.elements_type2d;
+	end
+
+	%units
+	if ~isnan(options_structure.unitmultiplier),
+		md.x=md.x*options_structure.unitmultiplier;
+		md.y=md.y*options_structure.unitmultiplier;
+		md.z=md.z*options_structure.unitmultiplier;
+	end
+
+	if length(tensor.principalvalue1)==length(md.elements),
+		if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+			tensor.principalvalue1(find(md.elementoniceshelf))=NaN;
+			tensor.principalvalue2(find(md.elementoniceshelf))=NaN;
+			if  strcmpi(md.type,'3d')
+				tensor.principalvalue3(find(md.elementoniceshelf))=NaN;
+			end
+		end
+		if ~isnan(options_structure.noicesheet) & options_structure.noicesheet,
+			tensor.principalvalue1(find(~md.elementoniceshelf))=NaN;
+			tensor.principalvalue2(find(~md.elementoniceshelf))=NaN;
+			if  strcmpi(md.type,'3d')
+				tensor.principalvalue3(find(~md.elementoniceshelf))=NaN;
+			end
+		end
+
+		if (strcmpi(md.type,'2d')),
+			A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); 
+
+			subplot(2*width,2*width,index3)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','black');
+			Apply_options_tensor(options_structure,type,'principal value 1')
+
+			subplot(2*width,2*width,index4)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','black');
+			Apply_options_tensor(options_structure,type,'principal value 2')
+		else
+			if options_structure.layer>=1,
+				A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); 
+
+				subplot(3*width,3*width,index4)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'principal value 1')
+
+				subplot(3*width,3*width,index5)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'principal value 2')
+
+				subplot(3*width,3*width,index6)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'principal value 3')
+
+			else
+	
+				A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); D=md.elements(:,4); E=md.elements(:,5); F=md.elements(:,6);
+
+				subplot(3*width,3*width,index4)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'principal value 1')
+
+				subplot(3*width,3*width,index5)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'principal value 2')
+
+				subplot(3*width,3*width,index6)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','black');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'CData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','black');
+				Apply_options_tensor(options_structure,type,'principal value 3')
+			end
+		end
+
+	elseif length(tensor.principalvalue1)==md.numberofgrids |  length(tensor.principalvalue1)==md.numberofgrids2d,
+		if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+			pos=find(md.gridoniceshelf);
+			tensor.principalvalue1(pos)=NaN;
+			tensor.principalvalue2(pos)=NaN;
+			if strcmpi(md.type,'3d')
+				tensor.principalvalue3(pos)=NaN;
+			end
+		end
+		if ~isnan(options_structure.noiceshelf) & options_structure.noicesheet,
+			pos=find(md.gridonicesheet);
+			tensor.principalvalue1(pos)=NaN;
+			tensor.principalvalue2(pos)=NaN;
+			if strcmpi(md.type,'3d')
+				tensor.principalvalue3(pos)=NaN;
+			end
+		end
+
+		if strcmpi(md.type,'2d'),
+			A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); 
+
+			subplot(2*width,2*width,index3)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.principalvalue1 ,'FaceColor','flat','EdgeColor','none');
+			Apply_options_tensor(options_structure,type,'principal value 1')
+
+			subplot(2*width,2*width,index4)
+			patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.principalvalue2 ,'FaceColor','flat','EdgeColor','none');
+			Apply_options_tensor(options_structure,type,'principal value 2')
+		else
+			if options_structure.layer>=1,
+				A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); 
+
+				subplot(3*width,3*width,index4)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.principalvalue1 ,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'principal value 1')
+
+				subplot(3*width,3*width,index5)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.principalvalue2 ,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'principal value 2')
+
+				subplot(3*width,3*width,index6)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData',tensor.principalvalue3 ,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'principal value 3')
+			else
+				A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); D=md.elements(:,4); E=md.elements(:,5); F=md.elements(:,6);
+
+				subplot(3*width,3*width,index4)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue1,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'principal value 1')
+
+				subplot(3*width,3*width,index5)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue2,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'principal value 2')
+
+				subplot(3*width,3*width,index6)
+				patch( 'Faces', [A B C], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [D E F], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [A B E D], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [B E F C ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','none');
+				patch( 'Faces', [C A D F ], 'Vertices', [md.x md.y md.z],'FaceVertexCData', tensor.principalvalue3,'FaceColor','flat','EdgeColor','none');
+				Apply_options_tensor(options_structure,type,'principal value 3')
+			end
+		end
+	end
+end
+
+function Apply_options_tensor(options_structure,type,component)
+%apply options
+	if isnan(options_structure.title)
+		if ismember('_',type) %user plotet stress_tensor
+			strings=strsplit(type,'_');
+			string=strings{1};
+		else %default plot: user requested stress
+			string=type;
+		end
+		options_structure.title=[upper(string(1)) string(2:end) ' ' component];
+	end
+	applyoptions(md,[],options_structure);
+end
Index: /issm/trunk/src/m/classes/public/plot/plot_tensor_principalaxis.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_tensor_principalaxis.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_tensor_principalaxis.m	(revision 1)
@@ -0,0 +1,103 @@
+function plot_tensor_principalaxis(md,options_structure,width,i,tensor,type,plot_options);
+%PLOT_TENSOR_PRINCIPALAXIS - plot ytensor principal axis
+%
+%   Usage:
+%      plot_tensor_principalaxis(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh boundaries
+subplot(width,width,i); 
+
+
+if (strcmpi(md.type,'2d')),
+	eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2);'])
+else
+	eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2); Vz=tensor.principalaxis' type(end) '(:,3);'])
+end
+
+%smoothing?
+if strcmpi(options_structure.smooth,'yes') & length(Vx)==md.numberofelements
+	Vx=elementstogrids(md,Vx);
+	Vy=elementstogrids(md,Vy);
+	if (strcmpi(md.type,'3d')),
+		Vz=elementstogrids(md,Vz);
+	end
+end
+		
+%layer projection? 
+if ~isnan(options_structure.layer) & options_structure.layer>=1,
+	Vx=project2d(md,Vx,options_structure.layer); %project onto 2d mesh
+	Vy=project2d(md,Vy,options_structure.layer); %project onto 2d mesh
+	if (strcmpi(md.type,'3d')),
+		Vz=project2d(md,Vz,options_structure.layer); %project onto 2d mesh
+	end
+	%we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded. 
+	md.x=md.x2d;
+	md.y=md.y2d;
+	md.z=md.z2d;
+	md.elements=md.elements2d;
+	md.elements_type=md.elements_type2d;
+	md.type='2d';
+end
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	md.x=md.x*options_structure.unitmultiplier;
+	md.y=md.y*options_structure.unitmultiplier;
+	md.z=md.z*options_structure.unitmultiplier;
+end
+if length(Vx)==length(md.elements),
+	
+	if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+		Vx(find(md.elementoniceshelf))=NaN;
+		Vy(find(md.elementoniceshelf))=NaN;
+		Vz(find(md.elementoniceshelf))=NaN;
+	end
+	if ~isnan(options_structure.noicesheet) & options_structure.noicesheet,
+		Vx(find(~md.elementoniceshelf))=NaN;
+		Vy(find(~md.elementoniceshelf))=NaN;
+		Vz(find(~md.elementoniceshelf))=NaN;
+	end
+
+	if (strcmpi(md.type,'2d')),
+		x=mean(md.x(md.elements'))'; y=mean(md.y(md.elements'))';
+		A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3);
+		quiver(x,y,Vx,Vy)
+
+	else
+		x=mean(md.x(md.elements'))'; y=mean(md.y(md.elements'))'; z=mean(md.z(md.elements'))';
+		A=md.elements(:,1); B=md.elements(:,2); C=md.elements(:,3); D=md.elements(:,4); E=md.elements(:,5); F=md.elements(:,6);
+		quiver3(x,y,z,Vx,Vy,Vz)
+	end
+elseif length(Vx)==md.numberofgrids |  length(Vx)==md.numberofgrids2d,
+	if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+		pos=find(md.gridoniceshelf);
+		Vx(pos)=NaN;
+		Vy(pos)=NaN;
+		Vz(pos)=NaN;
+	end
+	if ~isnan(options_structure.noiceshelf) & options_structure.noicesheet,
+		pos=find(md.gridonicesheet);
+		Vx(pos)=NaN;
+		Vy(pos)=NaN;
+		Vz(pos)=NaN;
+	end
+
+	if strcmpi(md.type,'2d'),
+                quiver(md.x,md.y,Vx,Vy)
+	else
+		quiver3(md.x,md.y,md.z,Vx,Vy,Vz)
+	end
+end
+
+%apply options
+if isnan(options_structure.title)
+	strings=strsplit(type,'_');
+	string=strings{1};
+	options_structure.title=[upper(string(1)) string(2:end) ' principal axis ' type(end)];
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plot_thermaltransient_results.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_thermaltransient_results.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_thermaltransient_results.m	(revision 1)
@@ -0,0 +1,24 @@
+function plot_thermaltransient_results(md,options_structure,width,i)
+%PLOT_THERMALTRANSIENT_RESULTS - plot  results of a thermal transient solution
+%
+%   Usage:
+%      plot_thermaltransient_results(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+string='plot(md';
+for i=1:length(md.thermaltransient_results),
+	string=[string ',''data'',''thermaltransient_results(' num2str(i) ').temperature'',''view'',3,''title'',''Temperature at time ' num2str(md.thermaltransient_results(i).time) ' a'''];
+end
+string=[string ',''figure'',1,''colorbar#all'',''on'',''view'',3,''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' options_structure.fontweight ');'];
+eval(string);
+clear string;
+
+string='plot(md';
+for i=2:length(md.thermaltransient_results),
+	string=[string ',''data'',md.thermaltransient_results(' num2str(i) ').temperature-md.thermaltransient_results(' num2str(i-1) ').temperature,''view'',3,''title'',''Delta temperature at time ' num2str(md.thermaltransient_results(i).time) ' a'''];
+end
+string=[string ',''figure'',2,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' options_structure.fontweight ');'];
+eval(string);
+clear string;
+
Index: /issm/trunk/src/m/classes/public/plot/plot_transient_movie.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_transient_movie.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_transient_movie.m	(revision 1)
@@ -0,0 +1,100 @@
+function plot_transient_movie(md,options_structure,width,i);
+%PLOT_TRANSIENT_MOVIE - plot a transient result as a movie
+%   Usage:
+%      plot_transient_movie(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+	%plot mesh boundaries
+	subplot(width,width,i); 
+
+	%first load x,y, etc ... to speed up plot
+	x=md.x;
+	x2d=md.x2d;
+	y=md.y;
+	y2d=md.y2d;
+	z=md.z;
+	z2d=md.z2d;
+	elements2d=md.elements2d;
+	elements=md.elements;
+	elements_type2d=md.elements_type2d;
+
+	%units
+	if ~isnan(options_structure.unitmultiplier),
+		md.x=md.x*options_structure.unitmultiplier;
+		md.y=md.y*options_structure.unitmultiplier;
+		md.z=md.z*options_structure.unitmultiplier;
+	end
+
+	%edgecolor?
+	if ~isnan(options_structure.edgecolor),
+		edgecolor=options_structure.edgecolor;
+	else
+		edgecolor='none';
+	end
+
+	if strcmpi(md.type,'2d') 
+		choice=input('Which field do you want to plot? (vel/vx/vy/thickness/surface/bed)','s');
+
+		if ~strcmp(choice,'vel') & ~strcmp(choice,'vx') & ~strcmp(choice,'vy') & ~strcmp(choice,'thickness') & ~strcmp(choice,'bed') & ~strcmp(choice,'surface')
+			disp('plot_transient_movie error message: input not supported yet, exiting...')
+			return
+		end
+		if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+			pos=find(md.gridoniceshelf);
+			data(pos)=NaN;
+		end
+		if ~isnan(options_structure.noiceshelf) & options_structure.noicesheet,
+			pos=find(md.gridonicesheet);
+			data(pos)=NaN;
+		end
+		for i=1:length(md.transient_results)
+			eval(['data=md.transient_results(' num2str(i) ').' num2str(choice) ';']);
+			titlestring=[choice ' at time ' num2str(md.transient_results(i).time) ' year'];
+			A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			apply_options_movie(options_structure,titlestring);
+			pause(0.5)
+		end
+
+	else
+		choice=input('Which field do you want to plot? (vel/vx/vy/vz/thickness/surface/bed/temperature)','s');
+
+		if ~strcmp(choice,'vel') & ~strcmp(choice,'vx') & ~strcmp(choice,'vy') & ~strcmp(choice,'vz') & ~strcmp(choice,'temperature') & ~strcmp(choice,'thickness') & ~strcmp(choice,'bed') & ~strcmp(choice,'surface')
+			disp('plot_transient_movie error message: input not supported yet, exiting...')
+			return
+		end
+		if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+			pos=find(md.gridoniceshelf);
+			data(pos)=NaN;
+		end
+		if ~isnan(options_structure.noiceshelf) & options_structure.noicesheet,
+			pos=find(md.gridonicesheet);
+			data(pos)=NaN;
+		end
+		for i=1:length(md.transient_results)
+			eval(['data=md.transient_results(' num2str(i) ').' num2str(choice) ';']);
+			titlestring=[choice 'at time ' num2str(md.transient_results(i).time) ' a'];
+			A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			apply_options_movie(options_structure,titlestring);
+			pause(0.5)
+		end
+	end
+
+end %function
+
+function apply_options_movie(options_structure,titlestring)
+	%apply options
+	if isnan(options_structure.title)
+		options_structure.title=titlestring;
+	end 
+	if isnan(options_structure.colorbar)
+		options_structure.colorbar=1;
+	end
+	applyoptions(md,[],options_structure);
+end
Index: /issm/trunk/src/m/classes/public/plot/plot_transient_results.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_transient_results.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_transient_results.m	(revision 1)
@@ -0,0 +1,70 @@
+function plot_transient_results(md,options_structure,width,i)
+%PLOT_TRANSIENT_RESULTS - plot transient results
+%
+%   Usage:
+%      plot_transient_results(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%Prepare window distribution
+%Get screen geometry
+mp = get(0, 'MonitorPositions');
+%Build window sizes
+if size(mp,1)>=2        %several monitors, use the second one
+	bdwidth=mp(2,1)+5; topbdwidth=mp(2,2)+20; W=mp(2,3)/3; H=mp(2,4)/2;
+else                    %only one monitor
+	bdwidth=5;         topbdwidth=20;         W=mp(1,3)/3; H=mp(1,4)/2;
+end
+pos1=[bdwidth  H+bdwidth  W-2*bdwidth  H-bdwidth-topbdwidth];
+pos2=pos1+[W 0 0 0]; pos3=pos1+[2*W 0 0 0]; pos4=pos1+[0 -H 0 0]; pos5=pos1+[W -H 0 0]; pos6=pos1+[2*W -H 0 0];
+%Create windows
+figure(1);close;
+figure('Position',pos1); figure('Position',pos2);figure('Position',pos3);figure('Position',pos4);figure('Position',pos5);figure('Position',pos6);
+
+string='plotmodel(md';
+for i=1:length(md.transient_results),
+	string=[string ',''data'',''transient_results(' num2str(i) ').thickness'',''title'',''Thickness at time ' num2str(md.transient_results(i).time) ' a'''];
+end
+string=[string ',''figure'',1,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight) ');'];
+eval(string);
+clear string;
+
+string='plotmodel(md';
+for i=1:length(md.transient_results),
+	string=[string ',''data'',''transient_results(' num2str(i) ').vel'',''view'',3,''title'',''Velocity at time ' num2str(md.transient_results(i).time) ' a'''];
+end
+string=[string ',''figure'',2,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
+eval(string);
+clear string;
+
+string='plotmodel(md';
+for i=1:length(md.transient_results),
+	string=[string ',''data'',''transient_results(' num2str(i) ').temperature'',''view'',3,''title'',''Temperature at time ' num2str(md.transient_results(i).time) ' a'''];
+end
+string=[string ',''figure'',3,''colorbar#all'',''on'',''view'',3,''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
+eval(string);
+clear string;
+
+string='plotmodel(md';
+for i=2:length(md.transient_results),
+	string=[string ',''data'',md.transient_results(' num2str(i) ').thickness-md.transient_results(' num2str(i-1) ').thickness,''title'',''Delta thickness at time ' num2str(md.transient_results(i).time) ' a'''];
+end
+string=[string ',''figure'',4,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
+eval(string);
+clear string;
+
+string='plotmodel(md';
+for i=2:length(md.transient_results),
+	string=[string ',''data'',md.transient_results(' num2str(i) ').vel-md.transient_results(' num2str(i-1) ').vel,''view'',3,''title'',''Delta velocity at time ' num2str(md.transient_results(i).time) ' a'''];
+end
+string=[string ',''figure'',5,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
+eval(string);
+clear string;
+
+string='plotmodel(md';
+for i=2:length(md.transient_results),
+	string=[string ',''data'',md.transient_results(' num2str(i) ').temperature-md.transient_results(' num2str(i-1) ').temperature,''view'',3,''title'',''Delta temperature at time ' num2str(md.transient_results(i).time) ' a'''];
+end
+string=[string ',''figure'',6,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
+eval(string);
+clear string;
Index: /issm/trunk/src/m/classes/public/plot/plot_unit.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_unit.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plot_unit.m	(revision 1)
@@ -0,0 +1,168 @@
+function plot_unit(md,optionstring,width,i);
+%PLOT_UNIT - unit plot called by plotmodel
+%
+%   Usage:
+%      plot_unit(md,optionstring,width,i);
+%
+%   See also: PLOTMODEL
+
+%parse options and get a structure of options. 
+options_structure=parse_options(md,optionstring);
+
+%figure out if this is a special plot
+data=findarg(optionstring,'data');data=data.value;
+
+%Figure out if this is a semi-transparent plot.
+if ~isnan(options_structure.overlay),
+	plot_overlay(md,data,options_structure,width,i);
+	return;
+end
+
+if ischar(data),
+	switch data,
+	case 'boundaries',
+		plot_boundaries(md,options_structure,width,i);
+		return;
+	case 'elementnumbering',
+		plot_elementnumbering(md,options_structure,width,i);
+		return;
+	case 'highlightelements',
+		plot_highlightelements(md,options_structure,width,i);
+	case 'segmentnumbering',
+		plot_segmentnumbering(md,options_structure,width,i);
+		return;
+	case 'importancefactors',
+		plot_importancefactors(md,options_structure,width,i);
+		return;
+	case 'elements_type',
+		plot_elementstype(md,options_structure,width,i);
+		return;
+	case 'gridnumbering',
+		plot_gridnumbering(md,options_structure,width,i);
+		return;
+	case 'highlightgrids',
+		plot_highlightgrids(md,options_structure,width,i);
+		return;
+	case 'basal_drag',
+		plot_basaldrag(md,options_structure,width,i);
+		return;
+	case 'driving_stress',
+		plot_drivingstress(md,options_structure,width,i);
+		return;
+	case 'mesh',
+		plot_mesh(md,options_structure,width,i);
+		return;
+	case 'penalties',
+		plot_penalties(md,options_structure,width,i);
+		return;
+	case 'quiver',
+		plot_quiver(md,options_structure,width,i);
+		return;
+	case 'quiver3',
+		plot_quiver3(md,options_structure,width,i);
+		return;
+	case 'quivervel',
+		plot_quivervel(md,options_structure,width,i);
+		return;
+	case 'riftvel',
+		plot_riftvel(md,options_structure,width,i);
+		return;
+	case 'riftrelvel',
+		plot_riftrelvel(md,options_structure,width,i);
+		return;
+	case 'riftpenetration',
+		plot_riftpenetration(md,options_structure,width,i);
+		return;
+	case 'sarpwr',
+		plot_sarpwr(md,options_structure,width,i)
+		return
+	case {'segmentonneumann_diag','segmentonneumann_prog'}
+		plot_segmentonneumann(md,options_structure,width,i,data)
+		return
+	case {'strainrate_tensor','strainrate','strainrate_principal','strainrate_principalaxis1','strainrate_principalaxis2','strainrate_principalaxis3',...
+		'stress_tensor','stress','stress_principal','stress_principalaxis1','stress_principalaxis2','stress_principalaxis3',...
+		'deviatoricstress_tensor','deviatoricstress','deviatoricstress_principal','deviatoricstress_principalaxis1','deviatoricstress_principalaxis2','deviatoricstress_principalaxis3'},
+		plot_tensor(md,options_structure,width,i,data);
+		return;
+	case 'thermaltransient_results',
+		plot_thermaltransient_results(md,options_structure,width,i);
+		return;
+	case 'transient_movie',
+		plot_transient_movie(md,options_structure,width,i);
+		return;
+	case 'transient_results',
+		plot_transient_results(md,options_structure,width,i);
+		return;
+	otherwise,
+		if isfield(struct(md),data)
+			data=eval(['md.' data ';']);
+		else
+			error('plot error message: data provided not supported yet. Type plotdoc for help');
+		end
+	end
+end
+
+%Figure out if this is a Section plot
+if ~isnan(options_structure.sectionvalue)
+	plot_section(md,data,options_structure,width,i);
+	return;
+end
+
+%check on arguments
+if (iscell(data) | isempty(data)),
+	error('plot error message: data provided is empty');
+end
+
+%process data and model
+[x y z elements is2d]=processmesh(md,options_structure);
+[data isongrid]=processdata(md,data,options_structure);
+
+%edgecolor?
+if ~isnan(options_structure.edgecolor),
+	edgecolor=options_structure.edgecolor;
+else
+	edgecolor='none';
+end
+
+%standard plot:
+subplot(width,width,i);
+
+%element data
+if ~isongrid
+	if is2d
+		A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+		patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(:),'FaceColor','flat','EdgeColor',edgecolor);
+	else
+		A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+		patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(:),'FaceColor','flat','EdgeColor',edgecolor);
+		patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', data(:),'FaceColor','flat','EdgeColor',edgecolor);
+		patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', data(:),'FaceColor','flat','EdgeColor',edgecolor);
+		patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', data(:),'FaceColor','flat','EdgeColor',edgecolor);
+		patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', data(:),'FaceColor','flat','EdgeColor',edgecolor);
+	end
+%grid data
+elseif isongrid
+	if is2d
+		A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+		patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+	else
+		if options_structure.layer>=1,
+			A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+		else
+			A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+			patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', data,'FaceColor','interp','EdgeColor',edgecolor);
+		end
+	end
+end
+
+%apply all options
+if isnan(options_structure.shading) & isnan(options_structure.edgecolor) & size(data,1)==md.numberofgrids,
+	options_structure.shading='interp';
+end
+
+applyoptions(md,data,options_structure);
Index: /issm/trunk/src/m/classes/public/plot/plotanalyse.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plotanalyse.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plotanalyse.m	(revision 1)
@@ -0,0 +1,23 @@
+function plotanalyse(md)
+%PLOTANALYSE - analyse entire model by plotting everything!
+%
+%   Usage:
+%      plotanalyse(md)
+
+%Do a series of plots that will help the user analyse what is going on. 
+plot(md,'data','segmentonneumann_diag','title','dynamic boundary conditions',...
+		'data','gridondirichlet_diag','title','fixed velocity grids',...
+		'data','vx_obs','title','vx observation (m/s)',...
+		'data','vy_obs','title','vy observation (m/s)',... 
+		'colorbar#all','on','figure',1);
+
+plot(md,'data','surface','title','surface','data','thickness','title','thickness',...
+        'data','bed','title','bedrock','colorbar#all','on','figure',2);
+
+plot(md,'data','drag','title','drag coefficient','data','p','title','p coeff',...
+         'data','q','title','q coeff','colorbar#all','on','figure',3);
+
+plot(md,'data','elementoniceshelf','title','elements on iceshelf',...
+        'data','gridoniceshelf','title','nodes on iceshelf',...
+		'data','elementonicesheet','title','elements on icesheet',...
+		'data','gridonicesheet','title','nodes on icesheet','colorbar#all','on','figure',4);
Index: /issm/trunk/src/m/classes/public/plot/plotdoc.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plotdoc.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plotdoc.m	(revision 1)
@@ -0,0 +1,100 @@
+function plotdoc()
+%PLOTDOC - plot documentation
+%
+%   Usage:
+%      plotdoc()
+
+disp(' ');
+disp('   Plot usage: plotm(model,varargin)');
+disp('   Options: ');
+disp('       ''figure'': figure number');
+disp('       ''data'' : what we want to plot');
+disp('                Available values for ''data'' are: ');
+disp('                  - any field of the model structure. ex: plot(md,''data'',''vel''), or plot(md,''data'',md.vel)');
+disp('                  - ''boundaries'': this will draw all the segment boundaries to the model, including rifts.');
+disp('                  - ''deviatoricstress_tensor'': plot the components of the deviatoric stress tensor (tauxx,tauyy,tauzz,tauxy,tauxz,tauyz) if computed');
+disp('                  - ''deviatoricstress_principal'': plot the deviatoricstress tensor principal axis and principal values');
+disp('                  - ''deviatoricstress_principalaxis1'': arrow plot the first principal axis of the deviatoricstress tensor(replace 1 by 2 or 3 if needed)');
+disp('                  - ''elements_type'': model used for each element');
+disp('                  - ''elementnumbering'': numbering of elements');
+disp('                  - ''gridnumbering'': numbering of grids');
+disp('                  - ''segmentnumbering'': numbering of segments');
+disp('                  - ''highlightelements'': to highlight elements to highlight the element list');
+disp('                  - ''highlightgrids'': to highlight grids (use highlight option to enter the grid list');
+disp('                  - ''mesh'': draw mesh using trisurf');
+disp('                  - ''quiver'': arrow plot of the velocity in 2d');
+disp('                  - ''quiver3'': arrow plot of the velocity in 3d');
+disp('                  - ''quivervel'': arrow plot of the velocity superimposed with its magnitude');
+disp('                  - ''riftvel'': velocities along rifts');
+disp('                  - ''riftrelvel'': relative velocities along rifts');
+disp('                  - ''riftpenetration'': penetration levels for a fault');
+disp('                  - ''basal_drag'': plot the basal drag on the bed (in kPa)');
+disp('                  - ''driving_stress'': plot the driving stress (in kPa)');
+disp('                  - ''strainrate_tensor'': plot the components of the strainrate tensor (exx,eyy,ezz,exy,exz,eyz) if computed');
+disp('                  - ''strainrate_principal'': plot the strainrate tensor principal axis and principal values)');
+disp('                  - ''strainrate_principalaxis1'': arrow plot the first principal axis of the strainrate tensor(replace 1 by 2 or 3 if needed)');
+disp('                  - ''stress_tensor'': plot the components of stress tensor (sxx,syy,szz,sxy,sxz,syz) if computed');
+disp('                  - ''stress_principal'': plot the stress tensor principal axis and principal values');
+disp('                  - ''stress_principalaxis1'': arrow plot the first principal axis of the stress tensor(replace 1 by 2 or 3 if needed)');
+disp('                  - ''transient_results'': this will display all the time steps of a transient run');
+disp('                  - ''transient_movie'': this will display the time steps of a given field of a transient run');
+disp('                  - ''thermaltransient_results'': this will display all the time steps of a thermal transient run');
+disp('                  - ''importancefactors'': qmu results');
+
+answer = lower(input(['more?(y/n) \n'],'s'));
+if ~strcmp(answer,'y'), return, end
+
+disp('       ''axis'': same as standard matlab option (''equal'',''off'',''equal on'',...)');
+disp('       ''caxis'': modify  colorbar range. (array of type [a b] where b>=a)');
+disp('       ''colorbar'': add colorbar (string ''on'' or ''off'')');
+disp('       ''colorbarpos'': [x,y,dx,dy] where x,y,dx and dy are within [0 1]');
+disp('       ''colormap'': same as standard matlab option (''jet'',''HSV'',''cool'',''spring'',''gray'',...)');
+disp('       ''contourlevels'': N or {value1,valu2,value3,...} add the contours of the specified values or N contours');
+disp('       ''contourticks'': ''on'' or ''off'' to display the ticks of the contours');
+disp('       ''contouronly'': ''on'' or ''off'' to display the contours on a white background');
+disp('       ''contourcolors'': ticks and contour color');
+disp('       ''wrapping'': repeat ''n'' times the colormap (''n'' must be an integer)');
+disp('       ''edgecolor'': same as standard matlab option EdgeColor (color name: ''black'' or RGB array: [0.5 0.2 0.8])');
+disp('       ''fontsize'': same as standard matlab option (normal: ''n'',bold: ''b'',light: ''l'',demi: ''d'')');
+disp('       ''fontweight'': same as standard matlab option (10,14,...)');
+disp('       ''highlight'': highlights certain grids or elements when using ''gridnumbering'' or ''elementnumbering'' or ''highlightgrids '' or ''highlightelements'' option');
+disp('       ''resolution'': resolution used by section value (array of type [horizontal_resolution vertical_resolution])');
+disp('                       horizontal_resolution must be in meter, and vertical_resolution a number of layers');
+disp('       ''showsection'': show section used by ''sectionvalue'' (string ''yes'')');
+disp('       ''sectionvalue'': give the value of data on a profile given by an Argus file (string ''Argusfile_name.exp'')');
+disp('       ''smooth'': smooth element data (string ''yes'' or integer)');
+disp('       ''title'': same as standard matlab option');
+disp('       ''view'': same as standard matlab option (ex: 2, 3 or [90 180]');
+disp('       ''xlim'': same as standard matlab option (ex: [0 500])');
+disp('       ''ylim'': same as standard matlab option');
+disp('       ''zlim'': same as standard matlab option');
+disp('       ''xlabel'': same as standard matlab option (ex:''km'')');
+disp('       ''ylabel'': same as standard matlab option');
+disp('       ''overlay'': yes or no. This will overlay a radar amplitude image behind');
+disp('       ''windowsize'': default is 1. size of filter window when using overlay.');
+disp('       ''highres'': resolution of overlayed radar amplitude image (default is 0, high resolution is 1).');
+disp('       ''alpha'': transparency coefficient (the higher, the more transparent). Default is 1.5');
+disp('       ''expdisp'': plot exp file on top of a data plot. provide exp file as an argument (use a cell of strings if more than one)');
+disp('       ''expstyle'': marker style for expdisp plot (use a cell of strings if more than one)');
+disp('       ''border'': size of display border (in pixels). active only for overlay plots');
+disp('       ''text'': print string, use a cell of strings if more than one');
+disp('       ''textposition'': [x y] position of text, use a cell of strings if more than one');
+disp('       ''textsize'':  same as standard ''FontSize'' matlab option applied to text, use a cell of strings if more than one');
+disp('       ''textweight'':  same as standard ''FontWeight'' matlab option applied to text, use a cell of strings if more than one');
+disp('       ''textcolor'':  same as standard ''color'' matlab option applied to text, use a cell of strings if more than one');
+disp('       ''iceshelf'': ''none'' if ice shelves are to not be plotted');
+disp('       ''icesheet'': ''none'' if ice sheets are to not be plotted');
+disp('       ''log'': value of log');
+disp('       ''designvariable'': name of design variable for importance factors');
+disp('       ''responsefunction'': name of response function for importance factors');
+disp('       ''latlon'': {latstep lonstep resolution color} where latstep,longstep and resolution are in degrees, color is a [r g b] array');
+disp('       ''latlonnumbering'': {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers,'); 
+disp('                   colornumber is a [r g b] array and latangle and lonangle are angles to flip the numbers');
+disp('       ''northarrow'': add an arrow pointing north, ''on'' for default value or [x0 y0 length [ratio [width]]] where (x0,y0) are the coordinates of the base, and ratio=headlength/length');
+disp('       ''scaleruler'': add a scale ruler, ''on'' for default value or [x0 y0 length width numberofticks] where (x0,y0) are the coordinates of the lower left corner');
+disp(' ');
+disp('       any options (except ''data'') can be followed by ''#i'' where ''i'' is the subplot number, or ''#all'' if applied to all plots');
+disp('  ');
+disp('   Examples:');
+disp('       plotmodel(md,''data'',''vel'',''data'',''mesh'',''view#2'',3,''colorbar#all'',''on'',''axis#1'',''off equal'')');
+disp('       plotmodel(md,''data'',''highlightelements'',''highlight'',[1 4 10],''expdisp'',{''domain1.exp'' ''domain2.exp'' ''domain3.exp''})');
Index: /issm/trunk/src/m/classes/public/plot/plotmodel.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plotmodel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/plotmodel.m	(revision 1)
@@ -0,0 +1,43 @@
+function plotmodel(md,varargin)
+%At command prompt, type plotdoc for help on documentation.
+global ISSM_DIR
+if isempty(ISSM_DIR),
+	error('ISSM_DIR variable got erased! This variable is needed to run Ice code correctly. Please rerun your startup file.');
+end
+
+%First go through varargin and  figure out how many subplots we are going to make
+datavalues=findarg(varargin,'data');
+numberofplots=length(datavalues);
+subplotwidth=ceil(sqrt(numberofplots));
+
+%Get figure number 
+figurevalues=findarg(varargin,'figure');
+if ~isempty(figurevalues),
+	if length(figurevalues)>1,
+		error('plotmodel error message: only one figure allowed');
+	else
+		figurenumber=figurevalues.value;
+	end
+else
+	figurenumber=1;
+end
+
+%go through subplots
+if numberofplots,
+		
+	%recover options  for all subplots.
+	options=recover_plot_options(md,varargin,numberofplots);
+
+	%Create figure 
+	figure(figurenumber); clf;
+	
+	%Go through all data plottable
+	for i=1:numberofplots,
+		
+		%call unit plot
+		plot_unit(md,options{i},subplotwidth,i);
+	
+	end
+else
+	error('plotmodel error message: no output data found. ');
+end
Index: /issm/trunk/src/m/classes/public/plot/processdata.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/processdata.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/processdata.m	(revision 1)
@@ -0,0 +1,63 @@
+function [data isongrid]=processdata(md,data,options_structure);
+%PROCESSDATA - process data to be plotted
+%
+%   Usage:
+%      [data isongrid]=processdata(md,data,options_structure);
+%
+%   See also: PLOTMODEL, PROCESSMESH
+
+%some checks
+if length(data)~=md.numberofgrids & length(data)~=md.numberofelements & length(data)~=md.numberofgrids*6
+	error('plotmodel error message: data not supproted yet')
+end
+
+%6*grid data
+if length(data)==6*md.numberofgrids
+	%keep the only norm of data
+	data1=data(1:6:md.numberofgrids*6);
+	data2=data(2:6:md.numberofgrids*6);
+	data=sqrt(data1.^2+data2.^2);
+	%---> go to grid data
+end
+
+%smoothing?
+if ~isnan(options_structure.smooth)
+	data=averaging(md,data,options_structure.smooth);
+	%---> go to grid data
+end
+
+%element data
+if length(data)==md.numberofelements;
+	isongrid=0;
+
+	%ice sheet only?
+	if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+		data(find(md.elementoniceshelf))=NaN;
+	end
+	%ice shelf only?
+	if ~isnan(options_structure.noicesheet) & options_structure.noicesheet,
+		data(find(~md.elementoniceshelf))=NaN;
+	end
+end
+
+%grid data
+if length(data)==md.numberofgrids
+	isongrid=1;
+	%ice sheet only?
+	if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
+		pos=find(md.gridoniceshelf);
+		data(pos)=NaN;
+	end
+	%ice shelf only?
+	if ~isnan(options_structure.noiceshelf) & options_structure.noicesheet,
+		pos=find(md.gridonicesheet);
+		data(pos)=NaN;
+	end
+end
+
+%layer projection? 
+if ~isnan(options_structure.layer) & options_structure.layer>=1,
+	data=project2d(md,data,options_structure.layer); %project onto 2d mesh
+end
+
+
Index: /issm/trunk/src/m/classes/public/plot/processmesh.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/processmesh.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/processmesh.m	(revision 1)
@@ -0,0 +1,51 @@
+function [x y z elements is2d]=processmesh(md,options_structure);
+%PROCESSMESH - process mesh to be plotted
+%
+%   Usage:
+%      [x y z elements is2d]=processmesh(md,options_structure)
+%
+%   See also: PLOTMODEL, PROCESSDATA
+
+%some checks
+if md.numberofgrids==md.numberofelements
+	error('plot error message: the number of elements is the same as the number of grids! cannot plot anything with model/plot, use matlab/plot instead')
+end
+
+%first load x,y, etc ... to speed up plot
+x=md.x;
+x2d=md.x2d;
+y=md.y;
+y2d=md.y2d;
+z=md.z;
+z2d=md.z2d;
+elements2d=md.elements2d;
+elements=md.elements;
+elements_type2d=md.elements_type2d;
+
+%is it a 2d plot?
+if strcmpi(md.type,'2d');
+	is2d=1;
+else
+	if ~isnan(options_structure.layer) & options_structure.layer>=1,
+		is2d=1;
+	else
+		is2d=0;
+	end
+end
+
+%layer projection? 
+if ~isnan(options_structure.layer) & options_structure.layer>=1,
+	%we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded. 
+	x=x2d;
+	y=y2d;
+	z=z2d;
+	elements=elements2d;
+	elements_type=elements_type2d;
+end
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	x=x*options_structure.unitmultiplier;
+	y=y*options_structure.unitmultiplier;
+	z=z*options_structure.unitmultiplier;
+end
Index: /issm/trunk/src/m/classes/public/plot/recover_plot_options.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/recover_plot_options.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/recover_plot_options.m	(revision 1)
@@ -0,0 +1,102 @@
+function plotoptions=recover_plot_options(md,varargin,numberofplots);
+%RECOVER_PLOT_OPTIONS - recover plot options
+%
+%   Usage:
+%      plotoptions=recover_plot_options(md,varargin,numberofplots);
+%
+%   See also: PARSE_OPTIONS, PLOTMODEL
+
+%initialize options string.
+plotoptions=cell(numberofplots,1);
+
+%initialize options.
+options=cell(0,2);
+
+for i=1:size(plotoptions,1),
+	plotoptions{i}=options;
+end
+
+%make sure length(varargin) is even
+if mod(length(varargin),2),
+	error('recover_plot_options error message: an even number of options is necessary');
+end
+
+%go through varargin, extract options and plug them into subplot options, by order of appearance
+for i=1:length(varargin)/2,
+
+	optionstring=varargin{2*i-1};
+	optionvalue=varargin{2*i};
+
+	if length(optionstring)>4 & strcmpi(optionstring(end-3:end),'#all'),
+		optionstring=optionstring(1:end-4);
+		for j=1:size(plotoptions,1), 
+			ispresent=0;
+			options_j=plotoptions{j};
+			for k=1:size(options_j,1),
+				if strcmpi(options_j{k,1},optionstring),
+					options_j{k,2}=optionvalue;
+					ispresent=1;
+				end
+			end
+			plotoptions{j}=options_j;
+
+			if ~ispresent,
+				options_j{end+1,1}=optionstring;
+				options_j{end,2}=optionvalue;
+				plotoptions{j}=options_j;
+			end
+		end
+	else
+		
+		%look for an a pound sign that would enforce choice of plot number
+		if length(optionstring)>2 & strcmpi(optionstring(end-1),'#'),
+			optionstring(end-1);
+			plotnum=str2num(optionstring(end));
+			options_j=plotoptions{plotnum};
+			options_j{end+1,1}=optionstring(1:end-2);
+			options_j{end,2}=optionvalue;
+			plotoptions{plotnum}=options_j;
+		else
+			for j=1:numberofplots,
+				options_j=plotoptions{j};
+
+				alreadypresent=0;
+				for k=1:size(options_j,1),
+					if strcmpi(optionstring,options_j{k,1}),
+						alreadypresent=1;
+						break;
+					else
+						alreadypresent=0;
+					end
+				end
+				if alreadypresent,
+					continue;
+				else
+					options_j{end+1,1}=optionstring;
+					options_j{end,2}=optionvalue;
+					plotoptions{j}=options_j;
+					break;
+				end
+			end
+		end
+	end
+end
+
+for i=1:length(plotoptions),
+	options_i=plotoptions{i};
+	new_options_i=cell(1,size(options_i,1)*size(options_i,2));
+	counter=1;
+	for j=1:size(options_i,1),
+		new_options_i{counter}=options_i{j,1};
+		new_options_i{counter+1}=options_i{j,2};
+		counter=counter+2;
+	end
+	plotoptions{i}=new_options_i;
+end
+
+%%DEBUG
+%for i=1:length(plotoptions),
+%	disp(['Options ' num2str(i)]);
+%	plotoptions{i}
+%end
+%error('debug')
Index: /issm/trunk/src/m/classes/public/plot/scaleruler.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/scaleruler.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/scaleruler.m	(revision 1)
@@ -0,0 +1,59 @@
+function scaleruler(structure)
+%SCALERULER - overlay a scale ruler on current plot
+%
+%   Usage:
+%      scaleruler(structure)
+
+%Go through structure and fill missing arguments
+if length(structure)~=5
+	error('plotmodel error message: bad number of input arguments for scaleruler: [x0 y0 length thickness numberofticks]');
+end
+
+%retrieve north arrow parameters
+x0=structure(1);
+y0=structure(2);
+lengthscale=structure(3);
+widthscale=structure(4);
+numberofticks=structure(5);
+
+%initialize some coordinates
+unitlength=lengthscale/(numberofticks -1);
+flag=-1;
+
+Bd=[x0 y0];
+Bu=[x0 y0+widthscale];
+Tick=0;
+
+%Text
+xt=Bu(1);
+yt=Bu(2)+widthscale;
+text(xt,yt,num2str(Tick),'FontSize',13,'FontWeight','b');
+
+%loope over the patches
+for i=1:numberofticks-1,
+	Au=Bu;
+	Ad=Bd;
+	Bu=[Au(1)+unitlength Ad(2)+widthscale];
+	Bd=[Ad(1)+unitlength Ad(2)];
+	Tick=Tick+unitlength;
+
+	%pathes
+	if flag==-1
+		p=patch([Ad(1) Bd(1) Bu(1) Au(1)],[Ad(2) Bd(2) Bu(2) Au(2)],'Black');
+	else
+		p=patch([Ad(1) Bd(1) Bu(1) Au(1)],[Ad(2) Bd(2) Bu(2) Au(2)],'White');
+	end
+
+	%flip flag
+	flag=-flag;
+
+	%Text
+	xt=Bu(1);
+	yt=Bu(2)+widthscale;
+	text(xt,yt,num2str(Tick/1000),'FontSize',13,'FontWeight','b');
+end
+
+%Text
+xt=Bu(1)+unitlength;
+yt=Bu(2);
+text(xt,yt,'km','FontSize',16,'FontWeight','b');
Index: /issm/trunk/src/m/classes/public/plot/undoplot.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/undoplot.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plot/undoplot.m	(revision 1)
@@ -0,0 +1,36 @@
+function  undoplot(n)
+%UNDOPLOT - undo plot
+%
+%   o n>0 removes the last n figure items added
+%   o n<0 removes all the figures done after figure=-n
+%   undoplot to remove only the last figure
+%
+%   Usage:
+%      undoplot(n)
+
+%some checks on n
+if nargin==0
+	n=1;
+end
+if ischar(n)
+	n = sscanf(n,'%i');
+end
+
+%how many plots have been done?
+g=get(gca,'children');
+L=length(g);
+
+
+if n>0
+	%erase plot
+	for i=1:min(n,L)
+		delete(g(i));
+	end
+end
+
+if n<0
+	%erase plot
+	for i=1:min(L-n,L)
+		delete(g(i));
+	end
+end
Index: /issm/trunk/src/m/classes/public/plug.m
===================================================================
--- /issm/trunk/src/m/classes/public/plug.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/plug.m	(revision 1)
@@ -0,0 +1,38 @@
+function md=plug(md,field,value)
+%PLUG - plugs the holes of a model field
+%
+%   This routine takes a model field interpolated on a mesh, and plugs the holes (made of value)
+%   to the nearest interpolation
+%
+%   Usage:
+%      md=plug(md,field,value)
+
+%First retrieve field
+fieldvalues=eval(['md.' field]);
+
+if isnan(value),
+	holevalues=find(isnan(fieldvalues));
+elseif isinf(value),
+	holevalues=find(isinf(fieldvalues));
+else
+	holevalues=find(fieldvalues==value);
+end
+
+for i=1:length(holevalues),
+
+	index=holevalues(i);
+
+	if ~mod(i,100),
+		%disp(['Step ' num2str(i) '/' num2str(length(holevalues))]);
+	end
+
+	distance=sqrt( (md.x(index)-md.x).^2 + (md.y(index)-md.y).^2 );
+	distance(holevalues)=10^10; %be sure we are not picking up the nan grids!
+
+	index2=find(distance==min(distance));index2=index2(1);
+
+	fieldvalues(index)=fieldvalues(index2);
+end
+
+%Set fieldvalues in md.field
+eval(['md.' field '=fieldvalues;']);
Index: /issm/trunk/src/m/classes/public/preparerun.m
===================================================================
--- /issm/trunk/src/m/classes/public/preparerun.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/preparerun.m	(revision 1)
@@ -0,0 +1,32 @@
+function md=preparerun(md,solutiontype,varargin)
+%PREPARERUN - prepare solution run for a cluster
+%
+%   Usage:
+%      md=preparerun(md,solutiontype,varargin)
+
+%Recover type of package being used: 
+if nargin==2,
+	package='Ice';
+else
+	package=varargin{1};
+end
+
+if ~ischar(package), 
+	error('Package specified in varargin can only be ''ice'', or ''cielo''');
+end
+
+if ~(strcmpi(package,'ice') || strcmpi(package,'cielo') || strcmpi(package,'macayeal'))
+	error('Package specified in varargin can only be ''ice'', ''macayeal'', or ''cielo''');
+end
+
+%Get cielo.rc location
+cielo_rc_location=which('cielo.rc');
+
+%Figure out parameters for this particular cluster
+[codepath,executionpath]=ProcessParallelParametersFromCieloRc(md.cluster,cielo_rc_location);
+
+%Marshall model data into a binary file.
+marshall(md,solutiontype,package);
+
+%Now, we need to build the queuing script, used by the cluster to launch the job.
+BuildQueueingScript(md,solutiontype,executionpath,codepath);
Index: /issm/trunk/src/m/classes/public/printmodel.m
===================================================================
--- /issm/trunk/src/m/classes/public/printmodel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/printmodel.m	(revision 1)
@@ -0,0 +1,10 @@
+function printmodel(filename,format)
+%PRINTMODEL - save an image of current figure
+%
+%   the format is the same as the one accepted by the builtin imwrite routine.
+%
+%   Usage:
+%      printmodel(filename,format)
+
+frame=getframe();image=frame2im(frame);
+imwrite(image,filename,format);
Index: /issm/trunk/src/m/classes/public/project2d.m
===================================================================
--- /issm/trunk/src/m/classes/public/project2d.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/project2d.m	(revision 1)
@@ -0,0 +1,46 @@
+function projection_value=project2d(md,value,layer)
+%PROJECT2D - returns the value of a field for a given layer of the mesh
+%
+%   project 'value' vector taken at layer 'layer' from extruded 2d-3d mesh onto 2d mesh 
+%   used to do the extrusion. This routine is used to compare values between a 2d-3d mesh
+%   at a certain layer, and the equivalent value (if it exists), on the original 2d mesh. 
+%   This routine relies heavily on projections (contained in 3d model md) recored during 
+%   the extrude operation.
+%
+%   Usage:
+%      projection_value=project2d(md,value,layer)
+%
+%   Example:
+%      vel2=project2d(md,md.vel,2);
+
+%some checks on list of arguments
+if ((nargin~=3) ),
+	project2dusage();
+	error('project2d error message');
+end
+
+if md.counter<4,
+	error('this model has not been extruded! ... exiting');
+end
+
+if ~strcmpi(md.type,'3d'),
+	error('wrong model type ... should be ''3d''');
+end
+
+if ((layer<1) | (layer>md.numlayers)),
+	error(['layer must be between 1 and ' num2str(md.numlayers)]);
+end
+
+if length(value)==md.numberofgrids,
+	projection_value=value((layer-1)*md.numberofgrids2d+1:layer*md.numberofgrids2d);
+else
+	projection_value=value((layer-1)*md.numberofelements2d+1:layer*md.numberofelements2d);
+end
+
+function project2dusage();
+disp(' project2d:  project ''value'' vector taken at layer ''layer'' from extruded 2d-3d mesh onto 2d mesh ');
+disp('              used to do the extrusion. This routine is used to compare values between a 2d-3d mesh');
+disp('              at a certain layer, and the equivalent value (if it exists), on the original 2d mesh. ');
+disp('              This routine relies heavily on projections (contained in 3d model md) recored during ');
+disp('              the extrude operation.');
+disp(' INPUT function projection_value=project2d(md,value,layer)');
Index: /issm/trunk/src/m/classes/public/project3d.m
===================================================================
--- /issm/trunk/src/m/classes/public/project3d.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/project3d.m	(revision 1)
@@ -0,0 +1,46 @@
+function projected_vector=project3d(md,vector2d,type,varargin);
+%PROJECT3D - vertically project a vector from 2d mesh
+%
+%   vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh.
+%   This vector can be a grid vector of size (md.numberofgrids2d,N/A) or an 
+%   element vector of size (md.numberofelements2d,N/A). 
+%   type is 'element' or 'node'. layer an optional layer number where vector 
+%   should keep its values. If not specified, all layers adopt the value of the 
+%   2d vector.
+%
+%   Usage:
+%      extruded_vector=project3d(md,vector2d,type,layer);
+
+if nargin==4,
+	layer=varargin{1};
+	if ((layer<1) || (layer>md.numlayers)),
+		error(['project3d error message: layer shoud be between 1 and ' num2str(md.numlayers)]);
+	end
+else
+	layer=0;
+end
+
+if strcmpi(type,'node'),
+
+	projected_vector=zeros(md.numberofgrids,size(vector2d,2));
+	
+	if layer==0,
+		for i=1:md.numlayers,
+			projected_vector(((i-1)*md.numberofgrids2d+1):(i*md.numberofgrids2d),:)=vector2d;
+		end
+	else
+		projected_vector(((layer-1)*md.numberofgrids2d+1):(layer*md.numberofgrids2d),:)=vector2d;
+	end
+else
+
+	projected_vector=zeros(md.numberofelements,size(vector2d,2));
+
+	if layer==0,
+		for i=1:(md.numlayers-1),
+			projected_vector( ((i-1)*md.numberofelements2d+1):(i*md.numberofelements2d),:)=vector2d;
+		end
+
+	else
+		projected_vector( ((layer-1)*md.numberofelements2d+1):(layer*md.numberofelements2d),:)=vector2d;
+	end
+end
Index: /issm/trunk/src/m/classes/public/radarpower.m
===================================================================
--- /issm/trunk/src/m/classes/public/radarpower.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/radarpower.m	(revision 1)
@@ -0,0 +1,48 @@
+function md=radarpower(md,highres)
+%RADARPOWER - overlay a power radar image on an existing mesh
+%
+%   This routine will overlay a power radar image on an existing mesh.
+%   The power amplitude will be output to vel for now.
+%   In the future, think about a field to hold this value.
+%
+%   Usage:
+%      md=radarpower(md,highres)
+
+global ISSM_DIR
+global MODELDATA
+
+%find gdal coordinates
+x0=min(md.x);
+x1=max(md.x);
+
+y0=min(md.y);
+y1=max(md.y);
+
+%Get path  to gdal binaries
+path_gdal=[ISSM_DIR '/Libs/gdal/install'];
+
+%Was gdal compiled? 
+if exist([path_gdal 'gdal_translate'])==0,
+	error(['radarpower error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' ISSM_DIR '/Libs/gdal to use this routine.']);
+end
+
+%the geotiff image is either 200m or 1km accuracy. 
+if highres,
+	geotiff_name=[MODELDATA 'MosaicTiffRsat/amm125m_v2_200m.tif'];
+else
+	geotiff_name=[MODELDATA 'MosaicTiffRsat/amm125m_v2_1km.tif'];
+end
+
+%Name of image
+inputname='./temp.tif';
+
+command=['system(''' path_gdal 'gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ''');'];
+eval(command);
+
+%Read in temp.tif:
+md.sarpwr=double(flipud(imread('temp.tif','TIFF')));
+md.sarxm=(x0:(x1-x0)/(size(md.sarpwr,2)-1):x1);
+md.sarym=(y0:(y1-y0)/(size(md.sarpwr,1)-1):y1);
+
+%Erase image
+system('rm -rf ./temp.tif');
Index: /issm/trunk/src/m/classes/public/recover_areas.m
===================================================================
--- /issm/trunk/src/m/classes/public/recover_areas.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/recover_areas.m	(revision 1)
@@ -0,0 +1,76 @@
+function [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+%RECOVER_AREAS - flag the element depending on the physical model that is assigned to them
+%
+%   This routine is called by setelementstype, do not use
+%
+%   Usage:
+%      [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+
+	%initialize elementstype
+	hutterflag=zeros(md.numberofelements,1);
+	macayealflag=zeros(md.numberofelements,1);
+	pattynflag=zeros(md.numberofelements,1);
+	stokesflag=zeros(md.numberofelements,1);
+	filltype='none';
+
+	%make sure length(varargin) is even
+	varargin=varargin{1};
+	if mod(length(varargin),2),
+		error('recover_elementstype_options error message: an even number of options is necessary');
+	end
+
+	%go through varargin, extract options and plug them into subtype options, by order of appearance
+	for i=1:length(varargin)/2,
+
+		optionstring=varargin{2*i-1};
+		optionvalue=varargin{2*i};
+
+		if strcmpi(optionstring,'hutter'),
+			hutterflag=BuildFlag(md,optionvalue);
+		elseif strcmpi(optionstring,'macayeal'),
+			macayealflag=BuildFlag(md,optionvalue);
+		elseif strcmpi(optionstring,'pattyn'),
+			pattynflag=BuildFlag(md,optionvalue);
+		elseif strcmpi(optionstring,'stokes'),
+			stokesflag=BuildFlag(md,optionvalue);
+		elseif strcmpi(optionstring,'fill'),
+			filltype=optionvalue;
+		else
+			error('elementstype_options error message: bad elementstype options');
+		end
+	end
+end %end function
+
+
+function flag=BuildFlag(md,area),
+	if ischar(area),
+		if isempty(area),
+			flag=zeros(md.numberofelements,1);
+			invert=0;
+		elseif strcmpi(area,'all')
+			flag=ones(md.numberofelements,1);
+			invert=0;
+		else
+			%make sure that we actually don't want the elements outside the domain outline!
+			if strcmpi(area(1),'~'),
+				area=area(2:length(area));
+				invert=1;
+			else
+				invert=0;
+			end
+			%ok, flag elements
+			flag=ArgusContourToMesh(md.elements(:,1:3),md.x,md.y,expread(area,1),'element',1);
+		end
+		if invert,
+			flag=~flag;
+		end
+	elseif isfloat(area),
+		if size(area,1)~=md.numberofelements,
+			setelementstypeusage();
+			error('Flags for elements_type must be of same size as number of elements in model');
+		end
+		flag=area;
+	else
+		error('Invalide elements_type option');
+	end
+end
Index: /issm/trunk/src/m/classes/public/removeholes.m
===================================================================
--- /issm/trunk/src/m/classes/public/removeholes.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/removeholes.m	(revision 1)
@@ -0,0 +1,47 @@
+function md2=removeholes(md,field)
+%REMOVEHOLES - interpolate a field on the a mesh without any hole
+%
+%   as its name indicates, this routine takes a model, a field (value of some 
+%   physical quantity evaluated at the mesh grids) of the model, and interpolates this field 
+%   on the model mesh, without any hole.
+%
+%   Usage:
+%      md=removeholes(md,field)
+
+%Check that model is complete
+if md.counter<3,
+	error('removeholes error message: model is incomplete ... exiting');
+end
+
+if nargin~=2,
+	removeholesusage;
+	error('removeholes error message');
+end
+
+if ~ischar(field), 
+	removeholesusage;
+	error('removeholes error message');
+end
+
+
+%Ok, retrieve and write domain outline without holes, to disk.
+domainoutline_string=md.domainoutline;
+name_slots=findstr(domainoutline_string,'## Name');
+domainoutline_string=domainoutline_string(1:(name_slots(2)-1)); %only keep first outline
+writefile('DomainOutlineTemp.exp',domainoutline_string);
+
+%Now create new model with mesh based on DomainOutlineTemp: 
+%get average resolution
+resolution=mean(sqrt(2*area(md)));
+md2=model;
+md2=mesh(md2,'DomainOutlineTemp.exp',resolution);
+
+%Ok, now interpolate field onto this new mesh
+fieldvalue=getfield(md,field);
+md2=setfield(md2,field,griddata(md.x,md.y,fieldvalue,md2.x,md2.y));
+
+end %end of function
+
+function removeholesusage(),
+disp('usage: md2=removeholes(md,field)');
+end
Index: /issm/trunk/src/m/classes/public/rifttipsrefine.m
===================================================================
--- /issm/trunk/src/m/classes/public/rifttipsrefine.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/rifttipsrefine.m	(revision 1)
@@ -0,0 +1,33 @@
+function md=rifttipsrefine(md,resolution,circleradius);
+%RIFTTIPSREFINE - refine mesh near rift tips
+%
+%   Usage:
+%      md=rifttipsrefine(md,resolution,circleradius);
+
+numberofgrids=50;
+
+%First check rifts are present!
+if strcmpi(md.riftoutline,''),
+	error('No rifts found in the outlines!');
+end
+
+%Ok, dumps riftoutline into a temporary file
+writefile('Rifts.exp.temp',md.riftoutline);
+
+%take rifts, and create refinement circles around tips
+rifts=expread('Rifts.exp.temp',1);
+!echo -n "" > Circles.exp
+for i=1:length(rifts),
+	tip1=[rifts(i).x(1) rifts(i).y(1)];
+	tip2=[rifts(i).x(end) rifts(i).y(end)];
+	%create circle around tip
+	expcreatecircle('Circle1.exp',tip1(1),tip1(2),circleradius,numberofgrids);
+	expcreatecircle('Circle2.exp',tip2(1),tip2(2),circleradius,numberofgrids);
+	!cat Circles.exp Circle1.exp Circle2.exp > Circles2.exp
+	!mv Circles2.exp Circles.exp
+	!rm -rf Circle1.exp Circle2.exp
+end
+
+md=meshexprefine(md,'Circles.exp',resolution);
+
+system('rm -rf Circles.exp');
Index: /issm/trunk/src/m/classes/public/setelementstype.m
===================================================================
--- /issm/trunk/src/m/classes/public/setelementstype.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/setelementstype.m	(revision 1)
@@ -0,0 +1,121 @@
+function md=setelementstype(md,varargin)
+%SETELEMENTSTYPE - associate a solution type to each element
+%
+%   This routine works like plotmodel: it works with an even number of inputs
+%   'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options
+%   that must be followed by the corresponding exp file or flags list
+%   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+%   If user wants every element outside the domain to be 
+%   setelementstyped, add '~' to the name of the domain file (ex: '~Pattyn.exp');
+%   an empty string '' will be considered as an empty domain
+%   a string 'all' will be considered as the entire domain
+%
+%   Usage:
+%      md=setelementstype(md,varargin)
+%
+%   Example:
+%      md=setelementstype(md,'pattyn','Pattyn.exp','macayeal',md.elementoniceshelf,'fill','hutter');
+
+%some checks on list of arguments
+if ((nargin<2) | (nargout~=1)),
+	error('setelementstype error message');
+end
+
+if md.counter<2,
+	error('only fully parameterized 2d models can be setelementstyped');
+end
+
+[hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);
+
+%Flag the elements that has not been flagged as filltype
+if strcmpi(filltype,'hutter'),
+	hutterflag(find(~macayealflag & ~pattynflag))=1;
+elseif strcmpi(filltype,'macayeal'),
+	macayealflag(find(~hutterflag & ~pattynflag))=1;
+elseif strcmpi(filltype,'pattyn'),
+	pattynflag(find(~hutterflag & ~macayealflag))=1;
+end
+
+%check that each element has at least one flag
+if any(hutterflag+ macayealflag+pattynflag==0),
+	error('setelementstype error message: elements type not assigned, must be specified')
+end
+
+%check that each element has only one flag
+if any(hutterflag+ macayealflag+pattynflag>1),
+	disp('setelementstype warning message: some elements have several types, higher order type is used for them')
+	hutterflag(find(hutterflag & macayealflag))=0;
+	macayealflag(find(macayealflag & pattynflag))=0;
+	pattynflag(find(pattynflag & macayealflag))=0;
+end
+
+%Check that no pattyn or stokes for 2d mesh
+if strcmpi(md.type,'2d'),
+	if any(stokesflag | pattynflag)
+		error('setelementstype error message: stokes and pattyn elements no allowed in 2d mesh, extrude it first')
+	end
+end
+
+%Modify stokesflag to get rid of elements contrained everywhere
+nonstokesflag=find(~stokesflag);                   %non stokes elements
+gridonstokes=ones(md.numberofgrids,1);
+gridonstokes(md.elements(nonstokesflag,:))=0;      %non stokes grids
+pos=find(md.gridondirichlet_diag);                 %find all the grids on the boundary of the domain without icefront
+gridonstokes(pos)=0;                               %we have to constrain all the boundary of the domain without icefront
+
+%Rule out elements where all grids are on the border of the stokes grids (because those elements are completely 
+%constrained 
+pos=find(stokesflag);
+constrained_list=pos(find(sum(gridonstokes(md.elements(pos,:)),2)==0));
+stokesflag(constrained_list)=0;
+
+%add in model who is who
+md.elements_type=zeros(md.numberofelements,2);
+
+%1: Hutter elements
+gridonhutter=zeros(md.numberofgrids,1);
+gridonhutter(md.elements(find(hutterflag),:))=1;
+md.gridonhutter=gridonhutter;
+md.elements_type(find(hutterflag),1)=hutterenum();
+
+%2: MacAyeal elements
+gridonmacayeal=zeros(md.numberofgrids,1);
+gridonmacayeal(md.elements(find(macayealflag),:))=1;
+md.gridonmacayeal=gridonmacayeal;
+md.elements_type(find(macayealflag),1)=macayealenum();
+
+%3: Pattyn elements
+gridonpattyn=zeros(md.numberofgrids,1);
+gridonpattyn(md.elements(find(pattynflag),:))=1;
+md.gridonpattyn=gridonpattyn;
+md.elements_type(find(pattynflag),1)=pattynenum();
+
+%4: Stokes elements
+md.gridonstokes=gridonstokes;
+md.elements_type(find(stokesflag),2)=stokesenum();
+
+%5: None elements (non Stokes)
+md.elements_type(find(~stokesflag),2)=noneenum();
+
+%Create the border grids between Pattyn and MacAyeal and extrude them
+numgrids2d=md.numberofgrids2d;
+numlayers=md.numlayers;
+bordergrids2d=find(gridonpattyn(1:numgrids2d) & gridonmacayeal(1:numgrids2d)); %Grids connected to two different types of elements
+
+%initialize and fill in penalties structure
+md.penalties=[];
+if ~isnan(bordergrids2d),
+	penalties=[];
+	for	i=1:numlayers,
+		penalties=[penalties [bordergrids2d+md.numberofgrids2d*(i-1)]];
+	end
+	md.penalties=penalties;
+end
+
+%flag dead grids (strictly in MacAyeal and not on bed -> not used in diagnostic horiz)
+nonmacayeal_el=find(~macayealflag);                   %non macayeal elements
+deadgrids=ones(md.numberofgrids,1);
+deadgrids(md.elements(nonmacayeal_el,:))=0;          %non macayeal grids are not dead
+deadgrids(find(md.gridonbed))=0;                      %grid on bed are not dead
+md.deadgrids=deadgrids;
+end
Index: /issm/trunk/src/m/classes/public/shear2d.m
===================================================================
--- /issm/trunk/src/m/classes/public/shear2d.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/shear2d.m	(revision 1)
@@ -0,0 +1,26 @@
+function [sx,sy,sxy,s]=shear2d(md)
+%SHEAR2D - computes 2d strain rate
+%
+%   This routine computes the strain rate of 2d models
+%
+%   Usage:
+%      [sx,sy,sxy,s]=shear2d(md);
+
+alpha=zeros(md.numberofelements,3); beta=zeros(md.numberofelements,3); 
+gamma=zeros(md.numberofelements,3); area=zeros(md.numberofelements,1);
+
+for n=1:md.numberofelements
+	X=inv([md.x(md.elements(n,:)) md.y(md.elements(n,:)) ones(3,1)]);
+	alpha(n,:)=X(1,:);
+	beta(n,:)=X(2,:);
+end
+clear X;
+
+
+summation=[1;1;1];
+sx=(md.vx(md.elements).*alpha)*summation;
+uy=(md.vx(md.elements).*beta)*summation;
+vx=(md.vy(md.elements).*alpha)*summation;
+sy=(md.vy(md.elements).*beta)*summation;						
+sxy=(uy+vx)/2;
+s=sqrt(sx.^2+sy.^2+sxy.^2+sx.*sy);
Index: /issm/trunk/src/m/classes/public/shearnorm2d.m
===================================================================
--- /issm/trunk/src/m/classes/public/shearnorm2d.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/shearnorm2d.m	(revision 1)
@@ -0,0 +1,9 @@
+function s=shearnorm2d(md)
+%SHEARNORM2D - computes the norm of the strain rate
+%
+%   Usage:
+%      s=shearnorm2d(md)
+%
+%   See also: shear2d
+
+[sx,sy,sxy,s]=shear2d(md);
Index: /issm/trunk/src/m/classes/public/slope.m
===================================================================
--- /issm/trunk/src/m/classes/public/slope.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/slope.m	(revision 1)
@@ -0,0 +1,42 @@
+function [sx,sy,s]=slope(md)
+%SLOPE - compute the surface slope
+%
+%   Usage:
+%      [sx,sy,s]=slope(md)
+
+%load some variables (it is much faster if the variab;es are loaded from md once for all) 
+if strcmpi(md.type,'2d'),
+	numberofelements=md.numberofelements;
+	numberofgrids=md.numberofgrids;
+	index=md.elements;
+	x=md.x; y=md.y; z=md.z;
+else
+	numberofelements=md.numberofelements2d;
+	numberofgrids=md.numberofgrids2d;
+	index=md.elements2d;
+	x=md.x2d; y=md.y2d; z=md.z2d;
+end
+
+%initialization
+alpha=zeros(numberofelements,3);
+beta=zeros(numberofelements,3);
+
+%build some usefull variables
+summation=1/3*ones(3,1);
+x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3)); y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
+
+%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
+invdet=1./(x1.*(y2-y3)-x2.*(y1-y3)+x3.*(y1-y2));
+alpha=[invdet.*(y2-y3) invdet.*(y3-y1) invdet.*(y1-y2)];
+beta=[invdet.*(x3-x2) invdet.*(x1-x3) invdet.*(x2-x1)];
+
+summation=[1;1;1];
+sx=(md.surface(index).*alpha)*summation;
+sy=(md.surface(index).*beta)*summation;
+s=sqrt(sx.^2+sy.^2);
+
+if strcmpi(md.type,'3d'),
+	sx=project3d(md,sx,'element');
+	sy=project3d(md,sy,'element');
+	s=sqrt(sx.^2+sy.^2);
+end
Index: /issm/trunk/src/m/classes/public/solve.m
===================================================================
--- /issm/trunk/src/m/classes/public/solve.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/solve.m	(revision 1)
@@ -0,0 +1,110 @@
+function md=solve(md,solutiontype,varargin)
+%SOLVE - apply solution sequence for this model
+%
+%   solutiontype is 'diagnostic','prognostic','transient','thermalsteady','thermaltransient','parameters' or 'control'
+%   and varargin is an optional package name ('cielo', 'ice' or 'macayeal')
+%
+%   Usage:
+%       md=solve(md,solutiontype,varargin)
+%
+%   Examples:
+%      md=solve(md,'diagnostic','macayeal');
+%      md=solve(md,'control','cielo');
+
+%some checks on list of arguments
+
+solutions={'mesh2grid','mesh','thermaltransient','thermalsteady','qmu','diagnostic','diagnostic_horiz','prognostic','transient','paramters','control'};
+found=0;
+for i=1:length(solutions),
+	if strcmpi(solutiontype,solutions{i}),
+		found=1;
+		break;
+	end
+end
+
+if found==0,
+	error(['solve error messae: solution type ' solutiontype ' not supported yet!']);
+end
+
+%we are good with this solutiontype, put in the analysis_type field of md: 
+md.analysis_type=solutiontype;
+
+%Recover type of package being used: 
+if nargin==2,
+	package='Ice';
+else
+	package=varargin{1};
+end
+
+if ~ischar(package), 
+	error('Package specified in varargin can only be ''ice'', or ''cielo''');
+end
+
+if ~(strcmpi(package,'ice') || strcmpi(package,'cielo') || strcmpi(package,'macayeal'))
+	error('Package specified in varargin can only be ''ice'', ''macayeal'', or ''cielo''');
+end
+
+%Use package to set solution namespace
+usenamespace(package);
+
+
+%Check model is self-consistent
+if ~strcmpi(solutiontype,'mesh2grid'),
+	disp(sprintf('\n%s','checking model consistency'));
+	if ~ismodelselfconsistent(md,solutiontype,package),
+		error(' '); %previous error messages should explain what is going on.
+	end
+end
+disp('launching solution sequence');
+
+%If running in parallel, we have a different way of launching the solution
+%sequences.
+if ~strcmpi(solutiontype,'qmu'),
+	if ~strcmpi(md.cluster,'none'),
+		md=solveparallel(md,solutiontype,package);
+		return;
+	end
+end
+
+%Lauch correct solution sequence
+if strcmpi(solutiontype,'diagnostic'),
+	md=diagnostic(md);
+
+elseif strcmpi(solutiontype,'mesh'),
+	md=mesh(md);
+
+elseif strcmpi(solutiontype,'transient'),
+	md=transient(md);
+
+elseif strcmpi(solutiontype,'qmu'),
+	md=qmu(md,package);
+
+elseif strcmpi(solutiontype,'parameters'),
+	md=parameters(md);;
+
+elseif strcmpi(solutiontype,'mesh2grid'),
+	md=mesh2grid(md);;
+
+elseif strcmpi(solutiontype,'prognostic'),
+	md=prognostic(md);;
+
+elseif strcmpi(solutiontype,'control'),
+	md=control(md);
+
+elseif strcmpi(solutiontype,'thermalsteady') | strcmpi(solutiontype,'thermaltransient'),
+	md=thermal(md,solutiontype);
+else
+	error('solution type not supported for this model configuration.');
+end
+
+%Check result is consistent
+disp(sprintf('%s\n','checking result consistency'));
+if ~isresultconsistent(md,solutiontype),
+	disp('!! results not consistent correct the model !!') %it would be very cruel to put an error, it would kill the computed results (even if not consistent...)
+end
+
+function solveusage();
+disp(' ');
+disp('   Solve usage: md=solve(md,solutiontype,package)');
+disp('         solutiontype can be ''diagnostic'',''transient'', ''thermalsteady'',''thermaltransient'',''parameters'',''mesh2grid''  or ''control''');
+disp('         package is either ''cielo'' or ''ice''');
Index: /issm/trunk/src/m/classes/public/solveparallel.m
===================================================================
--- /issm/trunk/src/m/classes/public/solveparallel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/solveparallel.m	(revision 1)
@@ -0,0 +1,45 @@
+function md=solveparallel(md,solutiontype,varargin)
+%SOLVEPARALLEL - solution sequence using a cluster in parallel mode
+%
+%   Usage:
+%      md=solveparallel(md,solutiontype,varargin)
+
+%Recover type of package being used: 
+if nargin==2,
+	package='Ice';
+else
+	package=varargin{1};
+end
+
+if ~ischar(package), 
+	error('Package specified in varargin can only be ''ice'', or ''cielo''');
+end
+
+if ~(strcmpi(package,'ice') || strcmpi(package,'cielo') || strcmpi(package,'macayeal'))
+	error('Package specified in varargin can only be ''ice'', ''macayeal'', or ''cielo''');
+end
+
+%Get cielo.rc location
+cielo_rc_location=which('cielo.rc');
+
+%Figure out parameters for this particular cluster
+[codepath,executionpath]=ProcessParallelParametersFromCieloRc(md.cluster,cielo_rc_location);
+
+%Marshall model data into a binary file.
+marshall(md,solutiontype,package);
+
+%Now, we need to build the queuing script, used by the cluster to launch the job.
+BuildQueueingScript(md,solutiontype,executionpath,codepath);
+
+%Now, launch the queueing script
+LaunchQueueJob(md,executionpath);
+
+%Do we return, or just wait for results?
+if md.waitonlock,
+	%we wait for the done file
+	waitonlock([executionpath '/' md.name '.lock']);
+	%load results
+	md=loadresultsfromcluster(md,solutiontype);
+else
+	return;
+end
Index: /issm/trunk/src/m/classes/public/solversettoasm.m
===================================================================
--- /issm/trunk/src/m/classes/public/solversettoasm.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/solversettoasm.m	(revision 1)
@@ -0,0 +1,8 @@
+function md=solversettoasm(md)
+%SOLVERSETTOASM - associate solver asm to the model
+%
+%   Usage:
+%      md=solversettoasm(md)
+
+md.solverstring=' -mat_type aij -ksp_type cgs -pc_type asm -sub_mat_type mumps -sub_pc_type lu -pc_asm_overlap 2 ';
+%md.solverstring=' -mat_type aij -ksp_type cgs -pc_type asm -sub_pc_type lu -pc_asm_overlap 2 ';
Index: /issm/trunk/src/m/classes/public/solversettomumps.m
===================================================================
--- /issm/trunk/src/m/classes/public/solversettomumps.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/solversettomumps.m	(revision 1)
@@ -0,0 +1,10 @@
+function md=solversettomumps(md)
+%SOLVERSETTOMUMPS - associate solver mumps to the model
+%
+%   Usage:
+%      md=solversettomumps(md)
+
+md.solverstring=' -mat_type aijmumps -ksp_type preonly -pc_type lu -mat_mumps_icntl_14 40 ';
+
+%optional
+%md.solverstring=[md.solverstring ' -mat_mumps_icntl_14 40 -mat_mumps_icntl_4 0 -mat_mumps_sym 1 -mat_ignore_lower_triangular'];
Index: /issm/trunk/src/m/classes/public/solversettosor.m
===================================================================
--- /issm/trunk/src/m/classes/public/solversettosor.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/solversettosor.m	(revision 1)
@@ -0,0 +1,10 @@
+function md=solversettosor(md)
+%SOLVERSETTOSOR - associate solver sor to the model
+%
+%   Usage:
+%      md=solversettosor(md)
+
+md.mat_type='aij';
+md.ksp_type='cg';
+md.pc_type='sor';
+md.solver_extra_option=' -pc_sor_omega 1.1 -pc_sor_its 2 ';
Index: /issm/trunk/src/m/classes/public/structtomodel.m
===================================================================
--- /issm/trunk/src/m/classes/public/structtomodel.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/structtomodel.m	(revision 1)
@@ -0,0 +1,17 @@
+function md=structtomodel(md,structmd)
+%STRUCTTOMODEL - convert a structure into a model
+%
+%   This function will take all the fields in structmd and copy them to corresponding
+%   fields in the md @model class instance. If the field does not exist in md, it is dropped.
+%
+%   Usage:
+%      md=structtomodel(md,structmd)
+
+structfields=fields(structmd);
+for i=1:length(structfields),
+	field=structfields(i);field=field{1};
+	fieldval=getfield(structmd,field);
+	if isfield(struct(md),field),
+		md=setfield(md,field,fieldval);
+	end
+end
Index: /issm/trunk/src/m/classes/public/thicknessevolution.m
===================================================================
--- /issm/trunk/src/m/classes/public/thicknessevolution.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/thicknessevolution.m	(revision 1)
@@ -0,0 +1,31 @@
+function dhdt=thicknessevolution(md)
+%THICKNESSEVOLUTION - compute the new thickness of a model after ∆t
+%
+%   This routine compute the new thickness of a model after a time step
+%   according to the following formula:
+%   dh/dt=div(Hu)+Ms-Mb
+%
+%   Usage:
+%      dhdt=thicknessevolution(md)
+
+if (length(md.vx)~=md.numberofgrids)|(length(md.vy)~=md.numberofgrids)
+	error('thicknessevolution error message: velocity empty')
+end
+
+alpha=zeros(md.numberofelements,3);
+beta=zeros(md.numberofelements,3);
+
+for n=1:md.numberofelements
+	X=inv([md.x(md.elements(n,:)) md.y(md.elements(n,:)) ones(3,1)]);
+	alpha(n,:)=X(1,:);
+	beta(n,:)=X(2,:);
+end
+
+summation=[1;1;1];
+dHu=(md.vx(md.elements).*md.thickness(md.elements).*alpha)*summation;
+dHv=(md.vy(md.elements).*md.thickness(md.elements).*beta)*summation;
+
+dHu=averaging(md,dHu,0);
+dHv=averaging(md,dHv,0);
+
+dhdt=dHu+dHv+md.accumulation-md.melting;
Index: /issm/trunk/src/m/classes/public/todo
===================================================================
--- /issm/trunk/src/m/classes/public/todo	(revision 1)
+++ /issm/trunk/src/m/classes/public/todo	(revision 1)
@@ -0,0 +1,1 @@
+allow optional settings in constructor.
Index: /issm/trunk/src/m/classes/public/usenamespace.m
===================================================================
--- /issm/trunk/src/m/classes/public/usenamespace.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/usenamespace.m	(revision 1)
@@ -0,0 +1,41 @@
+function usenamespace(package)
+%USENAMESPACE- switch between packages for solution routines
+%
+%   To avoid having to rename the routines for solution sequences (depending 
+%   on if we are running the macyeal, ice or cielo routines), we can switch 
+%   packages routines on and off by just using their corresponding name space. 
+%   For example: usenamespace('ice') will take out from the matlab path any routines
+%   related to macyaeal or cielo. 
+%
+%   Usage:
+%      usenamespace(package)
+
+global ISSM_DIR
+
+%First, add all packages in the path, so that when we erase them, rmpath does not error 
+%out. 
+addpath(genpath_ice([ISSM_DIR '/src/m/solutions/macayeal']));
+addpath(genpath_ice([ISSM_DIR '/src/m/solutions/ice']));
+addpath(genpath_ice([ISSM_DIR '/src/m/solutions/cielo']));
+
+%binaries for running using cielo
+addpath(genpath_ice([ISSM_DIR '/bin']));
+
+
+%Now, erase according to package
+if strcmpi(package,'macayeal'),
+rmpath(genpath_ice([ISSM_DIR '/src/m/solutions/ice']));
+rmpath(genpath_ice([ISSM_DIR '/src/m/solutions/cielo']));
+rmpath(genpath_ice([ISSM_DIR '/bin']));
+end
+
+if strcmpi(package,'ice'),
+rmpath(genpath_ice([ISSM_DIR '/src/m/solutions/macayeal']));
+rmpath(genpath_ice([ISSM_DIR '/src/m/solutions/cielo']));
+rmpath(genpath_ice([ISSM_DIR '/bin']));
+end
+
+if strcmpi(package,'cielo'),
+rmpath(genpath_ice([ISSM_DIR '/src/m/solutions/macyeal']));
+rmpath(genpath_ice([ISSM_DIR '/src/m/solutions/ice']));
+end
Index: /issm/trunk/src/m/classes/public/waitonlock.m
===================================================================
--- /issm/trunk/src/m/classes/public/waitonlock.m	(revision 1)
+++ /issm/trunk/src/m/classes/public/waitonlock.m	(revision 1)
@@ -0,0 +1,14 @@
+function waitonlock(filename)
+%WAITONLOCK - wait for a file
+%
+%   This routine will return when a file named 'filename' is written to disk.
+%
+%   Usage:
+%      waitonlock(filename)
+
+test=0;
+disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)'])
+while test==0
+	test=exist(filename,'file');
+	pause(1)
+end
Index: sm/trunk/src/m/classes/qmu.js
===================================================================
--- /issm/trunk/src/m/classes/qmu.js	(revision 28275)
+++ 	(revision )
@@ -1,153 +1,0 @@
-//QMU class definition
-//
-//   Usage:
-//      qmu=new qmu();
-
-function qmu (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   qmu parameters:'));
-
-		fielddisplay(this,'isdakota','is qmu analysis activated?');
-		fielddisplay(this,'output','are we outputting ISSM results, default is 0');
-		/*
-		for (var i=0;i<this.variables.length;i++){
-			console.log(sprintf('         variables%s:  (arrays of each variable class)',...
-						string_dim(this.variables,i)));
-		}
-		fnames=fieldnames(this.variables(i));
-		maxlen=0;
-		for j=1:numel(fnames)
-			maxlen=max(maxlen,length(fnames{j}));
-		end
-
-			for j=1:numel(fnames)
-				console.log(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
-							fnames{j},size(this.variables.(fnames{j})),class(this.variables.(fnames{j}))));
-		end
-			end
-			for i=1:numel(this.responses)
-				console.log(sprintf('         responses%s:  (arrays of each response class)',...
-							string_dim(this.responses,i)));
-		fnames=fieldnames(this.responses(i));
-		maxlen=0;
-		for j=1:numel(fnames)
-			maxlen=max(maxlen,length(fnames{j}));
-		end
-
-			for j=1:numel(fnames)
-				console.log(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
-							fnames{j},size(this.responses.(fnames{j})),class(this.responses.(fnames{j}))));
-		end
-			end
-			fielddisplay(this,'numberofresponses','number of responses') 
-			for i=1:numel(this.method);
-		if strcmp(class(this.method(i)),'dakota_method')
-			console.log(sprintf('            method%s :    ''%s''',...
-						string_dim(this.method,i),this.method(i).method));
-		end
-			end
-			for i=1:numel(this.params)
-				console.log(sprintf('         params%s:  (array of method-independent parameters)',...
-							string_dim(this.params,i)));
-		fnames=fieldnames(this.params(i));
-		maxlen=0;
-		for j=1:numel(fnames)
-			maxlen=max(maxlen,length(fnames{j}));
-		end
-
-			for j=1:numel(fnames)
-				console.log(sprintf(['            %-' num2str(maxlen+1) 's: %s'],...
-							fnames{j},any2str(this.params(i).(fnames{j}))));
-		end
-			end
-			for i=1:numel(this.results)
-				console.log(sprintf('         results%s:  (information from dakota files)',...
-							string_dim(this.results,i)));
-		fnames=fieldnames(this.results(i));
-		maxlen=0;
-		for j=1:numel(fnames)
-			maxlen=max(maxlen,length(fnames{j}));
-		end
-
-			for j=1:numel(fnames)
-				console.log(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
-							fnames{j},size(this.results.(fnames{j})),class(this.results.(fnames{j}))));
-		end
-			end
-			fielddisplay(this,'partition','user provided mesh partitioning, defaults to metis if not specified') 
-			fielddisplay(this,'numberofpartitions','number of partitions for semi-discrete qmu') 
-			fielddisplay(this,'variabledescriptors','');
-		fielddisplay(this,'responsedescriptors','');
-		fielddisplay(this,'method','array of dakota_method class');
-		fielddisplay(this,'mass_flux_profile_directory','directory for mass flux profiles');
-		fielddisplay(this,'mass_flux_profiles','list of mass_flux profiles');
-		fielddisplay(this,'mass_flux_segments','');
-		fielddisplay(this,'adjacency','');
-		fielddisplay(this,'vertex_weight','weight applied to each mesh vertex');
-		*/
-
-	}// }}}
-    this.extrude = function(md) {//{{{
-	if (!isNaN(this.partition)) this.partition=project3d(md,'vector',ArrayTranspose(this.partition),'type','node');
-        return this;
-    }//}}}
-	this.classname= function(){// {{{
-		return "qmu";
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-
-			///Early return
-			if (!md.qmu.isdakota) return;
-			else md.checkmessage('qmu runs not supported yet!');
-
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'fieldname','isdakota','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','output','format','Boolean');
-			if (!this.isdakota){
-				WriteData(fid,prefix,'data',0,'name','md.qmu.mass_flux_segments_present','format','Boolean');
-			}
-			else{
-				WriteData(fid,prefix,'object',this,'fieldname','partition','format','DoubleMat','mattype',2);
-				WriteData(fid,prefix,'object',this,'fieldname','numberofpartitions','format','Integer');
-				WriteData(fid,prefix,'object',this,'fieldname','numberofresponses','format','Integer');
-				WriteData(fid,prefix,'object',this,'fieldname','variabledescriptors','format','StringArray');
-				WriteData(fid,prefix,'object',this,'fieldname','responsedescriptors','format','StringArray');
-				if (this.mass_flux_segments.length){
-					WriteData(fid,prefix,'data',this.mass_flux_segments,'name','md.qmu.mass_flux_segments','format','MatArray');
-					flag=true; 
-				}
-				else flag=false; 
-				WriteData(fid,prefix,'data',flag,'name','md.qmu.mass_flux_segments_present','format','Boolean');
-			}
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-
-	this.isdakota                    = 0;
-	this.output                      = 0;
-	this.variables                   = []
-	this.responses                   = [];
-	this.method                      = []
-	this.params                      = []
-	this.results                     = []
-	this.partition                   = NaN;
-	this.numberofpartitions          = 0;
-	this.numberofresponses           = 0;
-	this.variabledescriptors         = []
-	this.responsedescriptors         = []
-	this.mass_flux_profile_directory = NaN;
-	this.mass_flux_profiles          = NaN;
-	this.mass_flux_segments          = []
-	this.adjacency                   = NaN;
-	this.vertex_weight               = NaN;
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/qmu.m
===================================================================
--- /issm/trunk/src/m/classes/qmu.m	(revision 28275)
+++ 	(revision )
@@ -1,255 +1,0 @@
-%QMU class definition
-%
-%   Usage:
-%      qmu=qmu();
-
-classdef qmu
-	properties (SetAccess=public)
-		isdakota                    = 0;
-		output                      = 0;
-		variables                   = struct();
-		correlation_matrix          = [];
-		responses                   = struct();
-		method                      = struct();
-		params                      = struct();
-		statistics                  = qmustatistics();
-		results                     = struct();
-		numberofresponses           = 0;
-		variabledescriptors         = {};
-		variablepartitions          = {};
-		variablepartitions_npart    = [];
-		variablepartitions_nt    = [];
-		responsedescriptors         = {};
-		responsepartitions          = {};
-		responsepartitions_npart    = [];
-		mass_flux_profile_directory = NaN;
-		mass_flux_profiles          = NaN;
-		mass_flux_segments          = {};
-		adjacency                   = NaN;
-		vertex_weight               = NaN;
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. If the input is a struct it is an old version of this class and
-			% old fields must be recovered (make sure they are in the deprecated
-			% model properties)
-
-			if verLessThan('matlab','7.9'),
-				disp('Warning: your matlab version is old and there is a risk that load does not work correctly');
-				disp('         if the model is not loaded correctly, rename temporarily loadobj so that matlab does not use it');
-
-				% This is a Matlab bug: all the fields of md have their default value
-				% Example of error message:
-				% Warning: Error loading an object of class 'model':
-				% Undefined function or method 'exist' for input arguments of type 'cell'
-				%
-				% This has been fixed in MATLAB 7.9 (R2009b) and later versions
-			end
-
-			if isstruct(self)
-				%disp('Recovering qmu from older version');
-				objstruct = self;
-				self = structtoobj(qmu(),objstruct);
-
-				%2019 Dec 7th
-				%if isfield(objstruct,'partition'),      self.vpartition     = objstruct.partition;       end;
-			end
-
-		end% }}}
-	end
-	methods
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function self = qmu(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~md.qmu.isdakota, return; end
-
-			version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
-
-			if version < 6,
-				if md.qmu.params.evaluation_concurrency~=1,
-					md = checkmessage(md,['concurrency should be set to 1 when running dakota in library mode']);
-				end
-			else
-				if ~strcmpi(self.params.evaluation_scheduling,'master'),
-					md = checkmessage(md,['evaluation_scheduling in qmu.params should be set to ''master''']);
-				end
-				if md.cluster.nprocs()<=1,
-					md = checkmessage(md,['in parallel library mode, Dakota needs to run on at least 2 cpus, 1 cpu for the master, 1 cpu for the slave. Modify md.cluster.np accordingly.']);
-				end
-
-				if self.params.processors_per_evaluation<1,
-					md = checkmessage(md,['in parallel library mode, Dakota needs to run at least one slave on one cpu (md.qmu.params.processors_per_evaluation >=1)!']);
-				end
-				if mod(md.cluster.nprocs()-1,self.params.processors_per_evaluation),
-					%md = checkmessage(md,['in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly']);
-				end
-			end
-
-			%go through variables and check for consistency: 
-			fv=fieldnames(self.variables);
-			for i=1:length(fv),
-				self.variables.(fv{i}).checkconsistency(md,solution,analyses);
-			end
-
-			%go through variables, and check that we have normal uncertains first, then uniform uncertains 
-			%and finally histogram_bin_uncertain. Indeed, dakota will order them this way, and when we send 
-			%partitions for scaled variables, they better show up in the order dakota is feeding them to us 
-			%in InputUpdateFromDakotax!
-			fv=fieldnames(self.variables); classlist={};
-			for i=1:length(fv),
-				classlist{i}=class(self.variables.(fv{i}));
-			end
-			n=0; u=0; h=0;
-			for i=1:length(classlist),
-				if strcmpi(classlist{i},'normal_uncertain')
-					if (u~=0 | h~=0),
-						error('normal_uncertain variables should be declared before uniform and histogram_bin uncertain variables');
-					else
-						n=1;
-					end
-				end
-				if strcmpi(classlist{i},'uniform_uncertain')
-					if (h~=0),
-						error('uniform_uncertain variables should be declared before histogram_bin uncertain variables');
-					else
-						u=1;
-					end
-				end
-				if strcmpi(classlist{i},'histogram_bin_uncertain')
-					h=1;
-				end
-
-			end
-
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   qmu parameters:'));
-
-			fielddisplay(self,'isdakota','is qmu analysis activated?');
-			fielddisplay(self,'output','are we outputting ISSM results, default is 0');
-			for i=1:numel(self.variables)
-				disp(sprintf('         variables%s:  (arrays of each variable class)',...
-					string_dim(self.variables,i)));
-				fnames=fieldnames(self.variables(i));
-				maxlen=0;
-				for j=1:numel(fnames)
-					maxlen=max(maxlen,length(fnames{j}));
-				end
-
-				for j=1:numel(fnames)
-					disp(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
-						fnames{j},size(self.variables.(fnames{j})),class(self.variables.(fnames{j}))));
-				end
-			end
-			for i=1:numel(self.responses)
-				disp(sprintf('         responses%s:  (arrays of each response class)',...
-					string_dim(self.responses,i)));
-				fnames=fieldnames(self.responses(i));
-				maxlen=0;
-				for j=1:numel(fnames)
-					maxlen=max(maxlen,length(fnames{j}));
-				end
-
-				for j=1:numel(fnames)
-					disp(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
-						fnames{j},size(self.responses.(fnames{j})),class(self.responses.(fnames{j}))));
-				end
-			end
-			fielddisplay(self,'numberofresponses','number of responses')
-			for i=1:numel(self.method);
-				if strcmp(class(self.method(i)),'dakota_method')
-					disp(sprintf('            method%s :    ''%s''',...
-						string_dim(self.method,i),self.method(i).method));
-				end
-			end
-			for i=1:numel(self.params)
-				disp(sprintf('         params%s:  (array of method-independent parameters)',...
-					string_dim(self.params,i)));
-				fnames=fieldnames(self.params(i));
-				maxlen=0;
-				for j=1:numel(fnames)
-					maxlen=max(maxlen,length(fnames{j}));
-				end
-
-				for j=1:numel(fnames)
-					disp(sprintf(['            %-' num2str(maxlen+1) 's: %s'],...
-						fnames{j},any2str(self.params(i).(fnames{j}))));
-				end
-			end
-			for i=1:numel(self.results)
-				disp(sprintf('         results%s:  (information from dakota files)',...
-					string_dim(self.results,i)));
-				fnames=fieldnames(self.results(i));
-				maxlen=0;
-				for j=1:numel(fnames)
-					maxlen=max(maxlen,length(fnames{j}));
-				end
-
-				for j=1:numel(fnames)
-					disp(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
-						fnames{j},size(self.results.(fnames{j})),class(self.results.(fnames{j}))));
-				end
-			end
-			fielddisplay(self,'variablepartitions','');
-			fielddisplay(self,'variablepartitions_npart','');
-			fielddisplay(self,'variablepartitions_nt','');
-			fielddisplay(self,'variabledescriptors','');
-			fielddisplay(self,'responsedescriptors','');
-			fielddisplay(self,'method','array of dakota_method class');
-			fielddisplay(self,'mass_flux_profile_directory','directory for mass flux profiles');
-			fielddisplay(self,'mass_flux_profiles','list of mass_flux profiles');
-			fielddisplay(self,'mass_flux_segments','');
-			fielddisplay(self,'adjacency','');
-			fielddisplay(self,'vertex_weight','weight applied to each mesh vertex');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','isdakota','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','output','format','Boolean');
-			if ~self.isdakota,
-				WriteData(fid,prefix,'data',false,'name','md.qmu.mass_flux_segments_present','format','Boolean');
-				return;
-			end
-			WriteData(fid,prefix,'data',self.method.params.samples,'name','md.qmu.method.params.samples','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','numberofresponses','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','variabledescriptors','format','StringArray');
-			WriteData(fid,prefix,'object',self,'fieldname','variablepartitions','format','MatArray');
-			WriteData(fid,prefix,'object',self,'fieldname','variablepartitions_npart','format','IntMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','variablepartitions_nt','format','IntMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','responsedescriptors','format','StringArray');
-			WriteData(fid,prefix,'object',self,'fieldname','responsepartitions','format','MatArray');
-			WriteData(fid,prefix,'object',self,'fieldname','responsepartitions_npart','format','IntMat','mattype',3);
-			if ~isempty(self.mass_flux_segments),
-				WriteData(fid,prefix,'data',self.mass_flux_segments,'name','md.qmu.mass_flux_segments','format','MatArray');
-				flag=true;
-			else
-				flag=false;
-			end
-			WriteData(fid,prefix,'data',flag,'name','md.qmu.mass_flux_segments_present','format','Boolean');
-			self.statistics.marshall(prefix,md,fid);
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			if self.isdakota,
-				error('qmu savemodeljs error message: not supported yet!');
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/qmu.py
===================================================================
--- /issm/trunk/src/m/classes/qmu.py	(revision 28275)
+++ 	(revision )
@@ -1,219 +1,0 @@
-import numpy as np
-
-from collections import OrderedDict
-from dakota_method import *
-from fielddisplay import fielddisplay
-from helpers import *
-from IssmConfig import *
-from MatlabFuncs import *
-from qmustatistics import qmustatistics
-from WriteData import WriteData
-
-
-class qmu(object):
-    """QMU class definition
-
-    Usage:
-        qmu = qmu()
-    """
-
-    def __init__(self):  # {{{
-        self.isdakota = 0
-        self.output = 0
-        self.variables = OrderedStruct()
-        self.correlation_matrix = []
-        self.responses = OrderedStruct()
-        self.method = OrderedDict()
-        self.params = OrderedStruct()
-        self.statistics = qmustatistics()
-        self.results = OrderedDict()
-        self.numberofresponses = 0
-        self.variabledescriptors = []
-        self.variablepartitions = []
-        self.variablepartitions_npart = []
-        self.variablepartitions_nt = []
-        self.responsedescriptors = []
-        self.responsepartitions = []
-        self.responsepartitions_npart = []
-        self.responsepartitions_nt = []
-        self.mass_flux_profile_directory = float('NaN')
-        self.mass_flux_profiles = float('NaN')
-        self.mass_flux_segments = []
-        self.adjacency = float('NaN')
-        self.vertex_weight = float('NaN')
-
-        self.setdefaultparameters()
-    # }}}
-    def __repr__(self):  # {{{
-        s = '   qmu parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'isdakota', 'is QMU analysis activated?'))
-        s += '{}\n'.format(fielddisplay(self, 'output', 'are we outputting ISSM results, default is 0'))
-        maxlen = 0
-        s += '         variables:  (arrays of each variable class)\n'
-
-    # OrderedStruct's iterator returns individual name / array - of - functions pairs
-        for variable in self.variables:
-            fname = variable[0]
-            maxlen = max(maxlen, len(fname))
-            size = np.shape(variable[1])
-            a = size[0]
-            b = 1 if len(size) < 2 else size[1]
-            s += "            %-*s:    [%ix%i]    '%s'\n" % (maxlen + 1, fname, a, b, type(variable[1][0]))
-
-        s += "         responses:  (arrays of each response class)\n"
-        for response in self.responses:
-            fname = response[0]
-            maxlen = max(maxlen, len(fname))
-            size = np.shape(response[1])
-            a = size[0]
-            b = 1 if len(size) < 2 else size[1]
-            s += "            %-*s:    [%ix%i]    '%s'\n" % (maxlen + 1, fname, a, b, type(response[1][0]))
-
-        s += '{}\n'.format(fielddisplay(self, 'numberofresponses', 'number of responses'))
-
-        if type(self.method) != OrderedDict:
-            self.method = [self.method]
-    # self.method must be iterable
-        for method in self.method:
-            if isinstance(method, dakota_method):
-                s += "            method :    '%s'\n" % (method.method)
-
-    # params could have a number of forms (mainly 1 struct or many)
-        if type(self.params) == OrderedStruct:
-            params = [self.params]
-        else:
-            params = np.hstack(np.atleast_1d(np.array(self.params)))
-        for param in params:
-            print(type(param))
-            print(param)
-            s += "         params:  (array of method-independent parameters)\n"
-            fnames = vars(param)
-            maxlen = 0
-            for fname in fnames:
-                maxlen = max(maxlen, len(fname))
-
-            for fname in fnames:
-                s += "            %-*s: %s\n" % (maxlen + 1, fname, str(getattr(param, fname)))
-
-    # results could be have a number of forms (mainly 1 struct or many)
-        results = np.hstack(np.atleast_1d(np.array(self.results)))
-        for result in results:
-            s += "         results:  (information from dakota files)\n"
-            fnames = vars(result)
-            maxlen = 0
-            for fname in fnames:
-                maxlen = max(maxlen, len(fname))
-
-            for fname in fnames:
-                size = np.shape(response[1])
-                a = size[0]
-                b = 0 if len(size) < 2 else size[1]
-                size = np.shape(getattr(result, fname))
-                s += "            %-*s:    [%ix%i]    '%s'\n" % (maxlen + 1, fname, a, b, type(getattr(result, fname)))
-
-        s += '{}\n'.format(fielddisplay(self, 'variablepartitions', ''))
-        s += '{}\n'.format(fielddisplay(self, 'variablepartitions_npart', ''))
-        s += '{}\n'.format(fielddisplay(self, 'variablepartitions_nt', ''))
-        s += '{}\n'.format(fielddisplay(self, 'variabledescriptors', ''))
-        s += '{}\n'.format(fielddisplay(self, 'responsedescriptors', ''))
-        s += '{}\n'.format(fielddisplay(self, 'method', 'array of dakota_method class'))
-        s += '{}\n'.format(fielddisplay(self, 'mass_flux_profile_directory', 'directory for mass flux profiles'))
-        s += '{}\n'.format(fielddisplay(self, 'mass_flux_profiles', 'list of mass_flux profiles'))
-        s += '{}\n'.format(fielddisplay(self, 'mass_flux_segments', ''))
-        s += '{}\n'.format(fielddisplay(self, 'adjacency', ''))
-        s += '{}\n'.format(fielddisplay(self, 'vertex_weight', 'weight applied to each mesh vertex'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if not md.qmu.isdakota:
-            return
-
-        version = IssmConfig('_DAKOTA_VERSION_')
-        version = float(version[0])
-
-        if version < 6:
-            if not md.qmu.params.evaluation_concurrency == 1:
-                md.checkmessage("concurrency should be set to 1 when running dakota in library mode")
-        else:
-            if not strcmpi(self.params.evaluation_scheduling, 'master'):
-                md.checkmessage('evaluation_scheduling in qmu.params should be set to "master"')
-
-            if md.cluster.nprocs() <= 1:
-                md.checkmessage('in parallel library mode, Dakota needs to run on at least 2 cpus, 1 cpu for the master, 1 cpu for the slave. Modify md.cluster.np accordingly.')
-
-            if self.params.processors_per_evaluation < 1:
-                md.checkmessage('in parallel library mode, Dakota needs to run at least one slave on one cpu (md.qmu.params.processors_per_evaluation >= 1)!')
-
-            if np.mod(md.cluster.nprocs() - 1, self.params.processors_per_evaluation):
-                #md.checkmessage('in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly')
-                pass
-
-        # Go through variables and check for consistency
-        fv = fieldnames(self.variables)
-        for i in range(len(fv)):
-            variable = getattr(self.variables, fv[i])
-            if hasattr(variable, 'checkconsistency'):
-                variable.checkconsistency(md, solution, analyses)
-
-        # Go through variables and check that we have normal uncertains first,
-        # then uniform uncertains and finally histogram_bin_uncertain. Indeed,
-        # Dakota will order them this waym, and when we send partitions for
-        # scaled variables, they better show up in the order Dakota is feeding
-        # them to us in InputUpdateFromDakotax!
-        fv = fieldnames(self.variables)
-        classlist = []
-        for i in range(len(fv)):
-            classlist.append(self.variables[fv[i]].__class__.__name__)
-        n = 0
-        u = 0
-        h = 0
-        for i in range(len(classlist)):
-            if classlist[i] == 'normal_uncertain':
-                if u != 0 or h != 0:
-                    raise Exception('normal uncertain variables should be declared before uniform and hhistogram_bin uncertain variables')
-                else:
-                    n = 1
-            if classlist[i] == 'uniform_uncertain':
-                if h != 0:
-                    raise Exception('uniform_uncertain variables should be declared before histogram_bin uncertain variables')
-                else:
-                    u = 1
-            if classlist[i] == 'histogram_bin_uncertain':
-                h = 1
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdakota', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'output', 'format', 'Boolean')
-        if not self.isdakota:
-            WriteData(fid, prefix, 'data', False, 'name', 'md.qmu.mass_flux_segments_present', 'format', 'Boolean')
-            return
-        WriteData(fid, prefix, 'data', self.method.params.samples, 'name', 'md.qmu.method.params.samples', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofresponses', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'variabledescriptors', 'format', 'StringArray')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'variablepartitions', 'format', 'MatArray')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'variablepartitions_npart', 'format', 'IntMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'variablepartitions_nt', 'format', 'IntMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'responsedescriptors', 'format', 'StringArray')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'responsepartitions', 'format', 'MatArray')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'responsepartitions_npart', 'format', 'IntMat', 'mattype', 3)
-        if not isempty(self.mass_flux_segments):
-            WriteData(fid, prefix, 'data', self.mass_flux_segments, 'name', 'md.qmu.mass_flux_segments', 'format', 'MatArray')
-            flag = True
-        else:
-            flag = False
-        WriteData(fid, prefix, 'data', flag, 'name', 'md.qmu.mass_flux_segments_present', 'format', 'Boolean')
-        self.statistics.marshall(prefix, md, fid)
-    # }}}
Index: sm/trunk/src/m/classes/qmustatistics.m
===================================================================
--- /issm/trunk/src/m/classes/qmustatistics.m	(revision 28275)
+++ 	(revision )
@@ -1,162 +1,0 @@
-%QMUSTATISTICS class definition
-%
-%   Usage:
-%      stats=qmustatistics();
-
-classdef qmustatistics
-	properties (SetAccess=public)
-	
-		%generic information: 
-		nfiles_per_directory = 5;  %number of files per output directory.
-		ndirectories         = 50; %number of output directories; should be < numcpus
-	
-		method = struct('name',{'None'},'fields',{[]},'steps',{[]},'nbins',{NaN},'indices',{[]});
-
-		%name: name of method, one of 'None','Histogram','SampleSeries' or 'MeanVariance'
-		%fields: fields for the  statistics being requested, ex: 'Sealevel','BslcIce','BslcHydro'
-		%steps: time steps at which each field statistic is computed, ex: [1:2,5,20] or 1:100
-		%nbins: number of bins for 'Histogram' statistics
-		%indices: vertex indices at which to retrieve samples
-
-	end
-	methods
-		function self = qmustatistics(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('qmustatistics');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.method.name='None';
-			self.nfiles_per_directory = 5;  %number of files per output directory.
-			self.ndirectories         = 50; %number of output directories.  %ndirectories should be < numcpus
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return: 
-			if md.qmu.isdakota==0; return; end;
-			if strcmpi(self.method(1).name,'None'),return;end;
-
-			%Checks:
-			md = checkfield(md,'fieldname','qmu.statistics.nfiles_per_directory','>=',1);
-			if self.ndirectories>md.cluster.np, 
-				error('qmustatistics consistency check: number of cluster CPUs should be > number of output directories');
-			end
-			if (self.ndirectories*self.nfiles_per_directory)~=md.qmu.method.params.samples,
-				error('qmustatistics consistency check: number of directories x number of files per directory should be == to number of samples requested!');
-			end
-			for i=1:length(self.method),
-				m=self.method(i);
-				if strcmpi(m.name,'Histogram'),
-					md = checkfield(md,'fieldname',sprintf('qmu.statistics.method(%i).nbins',i),'>=',1,'<=',md.qmu.method.params.samples);
-				end
-				for f=1:length(m.fields),
-					if ~ischar(m.fields{f}),
-						error(sprintf('qmustatistics consistency check error: qmu.statistics.method(%i).fields{%i} is not a string!',i,f));
-					end
-				end
-				for s=1:length(m.steps),
-					if m.steps(s)<=0,
-						error(sprintf('qmustatistics consistency check error: qmu.statistics.method(%i).steps(%i) should be > 0!',i,s));
-					end
-					if m.steps(s)> md.mesh.numberofvertices
-						error(sprintf('qmustatistics consistency check error: qmu.statistics.method(%i).steps(%i) should be < md.mesh.numberofvertices!',i,s));
-					end
-				end
-
-			end
-
-		end % }}}
-		function list=defaultoutputs(self,md) % {{{
-		end % }}}
-		function disp(self) % {{{
-
-			disp(sprintf('qmustatistics: post-Dakota run processing of QMU statistics:'));
-				
-			if strcmpi(self.method(1).name,'None'),  return; end;
-
-			%generic information:
-			fielddisplay(self,'nfiles_per_directory','number of files per output directory');
-			fielddisplay(self,'ndirectories','number of output directories; should be < numcpus');
-
-			for i=1:length(self.method),
-				disp(['   method #' num2str(i)]);
-				disp(self.method(i));
-			end
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			if strcmpi(self.method(1).name,'None'), 
-				WriteData(fid,prefix,'name','md.qmu.statistics','data',0,'format','Boolean');
-				statistics=0; 
-				return;
-			else 
-				WriteData(fid,prefix,'name','md.qmu.statistics','data',1,'format','Boolean');
-				statistics=1;
-			end
-
-			if statistics,
-				WriteData(fid,prefix,'name','md.qmu.statistics.nfiles_per_directory','data',self.nfiles_per_directory,'format','Integer');
-				WriteData(fid,prefix,'name','md.qmu.statistics.ndirectories','data',self.ndirectories,'format','Integer');
-				WriteData(fid,prefix,'name','md.qmu.statistics.numstatistics','data',length(self.method),'format','Integer');
-				for i=1:length(self.method),
-					m=self.method(i); 
-					WriteData(fid,prefix,'name',sprintf('md.qmu.statistics.method(%i).name',i),'data',m.name,'format','String');
-					WriteData(fid,prefix,'data',m.fields,'name',sprintf('md.qmu.statistics.method(%i).fields',i),'format','StringArray');
-					WriteData(fid,prefix,'data',m.steps,'name',sprintf('md.qmu.statistics.method(%i).steps',i),'format','IntMat','mattype',3);
-
-					if strcmpi(m.name,'Histogram'),
-						WriteData(fid,prefix,'name',sprintf('md.qmu.statistics.method(%i).nbins',i),'data',m.nbins,'format','Integer');
-					elseif strcmpi(m.name,'MeanVariance'),
-						%do nothing
-					elseif strcmpi(m.name,'SampleSeries'),
-						WriteData(fid,prefix,'data',m.indices,'name',sprintf('md.qmu.statistics.method(%i).indices',i),'format','IntMat','mattype',3);
-					else 
-						error(sprintf('qmustatistics marshall error message: unknown type ''%s'' for qmu.statistics.method(%i)',m.name,i));
-					end
-
-				end
-			end
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.stressbalance.spcvx'],self.spcvx);
-			writejs1Darray(fid,[modelname '.stressbalance.spcvy'],self.spcvy);
-			writejs1Darray(fid,[modelname '.stressbalance.spcvz'],self.spcvz);
-			writejsdouble(fid,[modelname '.stressbalance.restol'],self.restol);
-			writejsdouble(fid,[modelname '.stressbalance.reltol'],self.reltol);
-			writejsdouble(fid,[modelname '.stressbalance.abstol'],self.abstol);
-			writejsdouble(fid,[modelname '.stressbalance.isnewton'],self.isnewton);
-			writejsdouble(fid,[modelname '.stressbalance.FSreconditioning'],self.FSreconditioning);
-			writejsdouble(fid,[modelname '.stressbalance.maxiter'],self.maxiter);
-			writejsdouble(fid,[modelname '.stressbalance.shelf_dampening'],self.shelf_dampening);
-			writejs1Darray(fid,[modelname '.stressbalance.vertex_pairing'],self.vertex_pairing);
-			writejsdouble(fid,[modelname '.stressbalance.penalty_factor'],self.penalty_factor);
-			writejsdouble(fid,[modelname '.stressbalance.rift_penalty_lock'],self.rift_penalty_lock);
-			writejsdouble(fid,[modelname '.stressbalance.rift_penalty_threshold'],self.rift_penalty_threshold);
-			writejs2Darray(fid,[modelname '.stressbalance.referential'],self.referential);
-			writejs2Darray(fid,[modelname '.stressbalance.loadingforce'],self.loadingforce);
-			writejscellstring(fid,[modelname '.stressbalance.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/qmustatistics.py
===================================================================
--- /issm/trunk/src/m/classes/qmustatistics.py	(revision 28275)
+++ 	(revision )
@@ -1,142 +1,0 @@
-import numpy as np
-
-from helpers import *
-from WriteData import WriteData
-
-
-class qmustatistics(object):
-    """QMUSTATISTICS class definition
-
-    Usage:
-        stats = qmustatistics()
-    """
-
-    def __init__(self, *args):  #{{{
-        self.nfiles_per_directory = 5  # Number of files per output directory
-        self.ndirectories  = 50  # Number of output directories; should be < numcpus
-
-        self.method = [{}]
-        self.method[0]['name'] = 'None'
-        self.method[0]['fields'] = []
-        self.method[0]['steps'] = []
-        self.method[0]['nbins'] = np.nan
-        self.method[0]['indices'] = []
-
-        # name : name of method, one of 'None', 'Histogram', 'SampleSeries', or 'MeanVariance'
-        # fields : fields for the statistics being requested, ex: 'Sealevel', 'BslrIce', 'BsrlHydro'
-        # steps : time steps at which each field statistic is computed, ex: [1, 2, 5, 20] or [range(1:100)]
-        # nbins : number of bins for 'Histogram' statistics
-        # indices : vertex indices at which to retrieve samples
-
-        nargs = len(args)
-        if nargs == 0:
-            # Create a default object
-            self.setdefaultparameters()
-        elif nargs == 1:
-            # NOTE: The following has not been tested. Remove this note when it has
-            inputstruct = args[0]
-            list1 = properties('qmustatistics')
-            list2 = fieldnames(inputstruct)
-            for i in range(len(list1)):
-                fieldname = list1[i]
-                if fieldname in list2:
-                    setattr(self, fieldname, getattr(inputstruct, fieldname))
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = 'qmustatistics: post-Dakota run processing of QMU statistics:\n'
-        if self.method[0]['name'] == 'None':
-            return s
-        s += '{}\n'.format(fielddisplay(self, 'nfiles_per_directory', 'number of files per output directory'))
-        s += '{}\n'.format(fielddisplay(self, 'ndirectories', 'number of output directories; should be < numcpus'))
-        for i in range(len(self.method)):
-            s += '{}\n'.format('   method # {}'.format(i))
-            s += '{}\n'.format(self.method[i])
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.method[0]['name'] = 'None'
-        self.nfiles_per_directory = 5  # Number of files per output directory
-        self.ndirectories = 50  # Number of output directories; should be < numcpus
-        return self
-    # }}}
-
-    @staticmethod
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if md.qmu.isdakota == 0:
-            return
-        if self.method[0]['name'] == 'None':
-            return
-
-        # Checks
-        md = checkfield(md, 'fieldname', 'qmu.statistics.nfiles_per_directory', '>=', 1)
-        if self.ndirectories > md.cluster.np:
-            raise Exception('qmustatistics consistency check: number of cluster CPUs should be > number of output directories')
-        if self.ndirectories * self.nfiles_per_directory != md.qmu.method.params.sample:
-            raise Exception('qmustatistics consistency check: number of directories x number of files per directory should be == to number of samples requested!')
-        for i in range(len(self.method)):
-            m = self.method[i]
-            if m.name == 'Histogram':
-                md = checkfield(md, 'fieldname', 'qmu.statistics.method[{}].nbins'.format(i), '>=', 1, '<=', md.qmu.method.params.samples)
-            for f in range(len(m['fields'])):
-                if not isinstance(m['fields'][f], str):
-                    raise Exception('qmustatistics consistency check error: qmu.statistics.method[{}][\'fields\'][{}] is not a string!'.format(i, f))
-            for s in range(len(m['steps'])):
-                if m['steps'][s] <= 0:
-                    raise Exception('qmustatistics consistency check error: qmu.statistics.method[{}][\'steps\'][{}] should be > 0!'.format(i, s))
-                if m['steps'][s] > md.mesh.numberofvertices:
-                    raise Exception('qmustatistics consistency check error: qmu.statistics.method[{}][\'steps\'][{}] should be < md.mesh.numberofvertices!'.format(i, s))
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        outputs = []
-        return outputs
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        if self.method[0]['name'] == 'None':
-            WriteData(fid, prefix, 'name', 'md.qmu.statistics', 'data', 0, 'format', 'Boolean')
-            statistics = 0
-            return
-        else:
-            WriteData(fid, prefix, 'name', 'md.qmu.statistics', 'data', 1, 'format', 'Boolean')
-            statistics = 1
-
-        if statistics:
-            WriteData(fid, prefix, 'name', 'md.qmu.statistics.nfiles_per_directory', 'data', self.nfiles_per_directory, 'format', 'Integer')
-            WriteData(fid, prefix, 'name', 'md.qmu.statistics.ndirectories', 'data', self.ndirectories, 'format', 'Integer')
-            WriteData(fid, prefix, 'name', 'md.qmu.statistics.numstatistics', 'data', len(self.method), 'format', 'Integer')
-            for i in range(1, len(self.method) + 1):
-                m = self.method[i - 1]
-                WriteData(fid, prefix, 'name', 'md.qmu.statistics.method({}).name'.format(i), 'data', m['name'], 'format', 'String')
-                WriteData(fid, prefix, 'data', m['fields'], 'name', 'md.qmu.statistics.method({}).fields'.format(i), 'format', 'StringArray')
-                WriteData(fid, prefix, 'data', m['steps'], 'name', 'md.qmu.statistics.method({}).steps'.format(i), 'format', 'IntMat', 'mattype', 3)
-                if m['name'] == 'Histogram':
-                    WriteData(fid, prefix, 'name', 'md.qmu.statistics.method({}).nbins'.format(i), 'data', m['nbins'], 'format', 'Integer')
-                elif m['name'] == 'MeanVariance':
-                    pass # do nothing
-                elif m['name'] == 'SampleSeries':
-                    WriteData(fid, prefix, 'data', m['indices'], 'name', 'md.qmu.statistics.method({}).indices'.format(i), 'format', 'IntMat', 'mattype', 3)
-                else:
-                    raise Exception('qmustatistics marshall error message: unknown type ''{}'' for qmu.statistics.method[{}]'.format(m['name'], i))
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
-
-    def addmethod(self, *args):  # {{{
-        """ADDMETHOD - Add new, empty method or passed dict to self.method
-        """
-        nargs = len(args)
-        if nargs == 0:
-            self.method.append({})
-        elif nargs == 1:
-            self.method.append(args[0])
-        else:
-            raise Exception('Number of args should be 0 (appends empty dict to methods member) or 1 (appends passed dict to methods member)')
-    # }}}
Index: sm/trunk/src/m/classes/radar.m
===================================================================
--- /issm/trunk/src/m/classes/radar.m	(revision 28275)
+++ 	(revision )
@@ -1,56 +1,0 @@
-%RADAR class definition
-%
-%   Usage:
-%      radar=radar();
-%      radar=radar('name','Radar1',...
-%						 'definitionname','Outputdefinition1',...
-%						 'ice_period', ones(md.mesh.numberofvertices,1));
-
-classdef radar
-	properties (SetAccess=private)  
-		%radarattenuation
-		name						 = '';
-		definitionstring		 = '';
-	end
-
-	methods
-		function self = extrude(self,md) % {{{
-			return;
-		end % }}}
-		function self = radar(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			
-			if ~ischar(self.name),
-				error('radar error message: ''name'' field should be a string!');
-			end	
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			md = checkfield(md,'field',self.definitionstring,'values',OutputdefinitionStringArray);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Radar:\n'));
-
-			fielddisplay(self,'name','identifier for this radar response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-100]''');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-		WriteData(fid,prefix,'data',self.name,'name','md.radar.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring, 'name','md.radar.definitionstring','format','String');
-	end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/radaroverlay.js
===================================================================
--- /issm/trunk/src/m/classes/radaroverlay.js	(revision 28275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-//RADAROVERLAY class definition
-//
-//   Usage:
-//      radaroverlay=new radaroverlay();
-
-function radaroverlay (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   radaroverlay parameters:'));
-
-		fielddisplay(this,'xlim','corresponding x boundaries[m]');
-		fielddisplay(this,'ylim','corresponding y boundaries [m]');
-		fielddisplay(this,'outerindex','outer triangulation between mesh and bounding box');
-		fielddisplay(this,'outerx','outer triangulation x coordinate between mesh and bounding box');
-		fielddisplay(this,'outery','outer triangulation y coordinate between mesh and bounding box');
-
-	}// }}}
-	//properties 
-	// {{{
-	this.xlim   = NaN;
-	this.ylim   = NaN;
-	this.outerindex   = NaN;
-	this.outerx   = NaN;
-	this.outery   = NaN;
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/radaroverlay.m
===================================================================
--- /issm/trunk/src/m/classes/radaroverlay.m	(revision 28275)
+++ 	(revision )
@@ -1,53 +1,0 @@
-%RADAROVERLAY class definition
-%
-%   Usage:
-%      radaroverlay=radaroverlay();
-
-classdef radaroverlay
-	properties (SetAccess=public) 
-		pwr = NaN;
-		x   = NaN;
-		y   = NaN;
-		outerindex = NaN;
-		outerx = NaN;
-		outery = NaN;
-		outerheight = NaN;
-	end
-	methods
-		function self = radaroverlay(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   radaroverlay parameters:'));
-
-			fielddisplay(self,'pwr','radar power image (matrix)');
-			fielddisplay(self,'x','corresponding x coordinates [m]');
-			fielddisplay(self,'y','corresponding y coordinates [m]');
-			fielddisplay(self,'outerindex','outer triangulation corresponding to space between mesh and the bounding box');
-			fielddisplay(self,'outerx','outer x corresponding to space between mesh and the bounding box');
-			fielddisplay(self,'outery','outer y corresponding to space between mesh and the bounding box');
-			fielddisplay(self,'outerheight','outer height corresponding to space between mesh and the bounding box');
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			if ~isnan(self.pwr),
-				writejs1Darray(fid,[modelname '.radaroverlay.xlim'],[min(self.x) max(self.x)]);
-				writejs1Darray(fid,[modelname '.radaroverlay.ylim'],[min(self.y) max(self.y)]);
-				writejs2Darray(fid,[modelname '.radaroverlay.outerindex'],self.outerindex);
-				writejs1Darray(fid,[modelname '.radaroverlay.outerx'],self.outerx);
-				writejs1Darray(fid,[modelname '.radaroverlay.outery'],self.outery);
-				writejs1Darray(fid,[modelname '.radaroverlay.outerheight'],self.outerheight)
-			end
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/radaroverlay.py
===================================================================
--- /issm/trunk/src/m/classes/radaroverlay.py	(revision 28275)
+++ 	(revision )
@@ -1,32 +1,0 @@
-from fielddisplay import fielddisplay
-
-
-class radaroverlay(object):
-    """
-    RADAROVERLAY class definition
-
-       Usage:
-          radaroverlay = radaroverlay()
-    """
-
-    def __init__(self):  # {{{
-        self.pwr = float('NaN')
-        self.x = float('NaN')
-        self.y = float('NaN')
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = '   radaroverlay parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'pwr', 'radar power image (matrix)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'x', 'corresponding x coordinates [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'y', 'corresponding y coordinates [m]'))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/regionaloutput.m
===================================================================
--- /issm/trunk/src/m/classes/regionaloutput.m	(revision 28275)
+++ 	(revision )
@@ -1,106 +1,0 @@
-%REGIONALOUTPUT class definition
-%
-%   Usage:
-%      regionaloutput=regionaloutput();
-%      regionaloutput=regionaloutput('name','Volume1','definitionstring','Outputdefinition1','outputnamestring','IceVolume',...
-%                    'mask',mask);
-%      regionaloutput=regionaloutput('name','Volume1','definitionstring','Outputdefinition1','outputnamestring','IceVolume',...
-%                    'maskexpstring','Exp/Mask.exp','model',md)
-% 
-%   where mask is a vectorial field of size md.mesh.numberofvertices,1 : where vertices with values > 0 are to be included in the calculated region.
-%   Alternatively, the user can pass in an Argus file and model object instead of a mask, and mask will be calculated for the user
-%
-%   See also: MISFIT, MASSCON, MASSCONAXPBY
-
-classdef regionaloutput
-	properties (SetAccess=public)
-		%regionaloutput
-		name              = '';
-		definitionstring  = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		outputnamestring  = ''; %string that identifies the type of output you want, eg. IceVolume, TotalSmb, GroudedArea
-		mask              = NaN; %mask vectorial field which identifies the region of interest (value > 0 will be included)
-		maskexpstring     = '';
-	end
-	
-	methods
-		function self = extrude(self,md) % {{{
-			if ~isnan(self.mask)
-				self.mask=project3d(md,'vector',self.mask,'type','node');
-			end
-		end % }}}
-		function self = regionaloutput(varargin) % {{{
-			if nargin==0,
-				self=setdefaultparameters(self);
-			else
-				%use provided options to change fields
-				options=pairoptions(varargin{:});
-
-				%get name
-				self.name=getfieldvalue(options,'name','');
-				if nargin==8
-					self.mask=getfieldvalue(options,'mask',NaN);
-					if isnan(self.mask)
-						error('regionaloutput error message: ''mask'' field or ''maskexpstring'' and ''model'' fields should be defined!');
-					end
-				elseif nargin==10
-					modelname=getfieldvalue(options,'model');
-					self.maskexpstring=getfieldvalue(options,'maskexpstring');
-					self=setmaskfromexp(self,modelname);
-				else
-					error('regionaloutput error message: ''mask'' field or ''maskexpstring'' and ''model'' fields should be defined!');
-				end
-		
-				self.definitionstring=getfieldvalue(options,'definitionstring');
-				self.outputnamestring=getfieldvalue(options,'outputnamestring');
-
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		end % }}}
-		function self = setmaskfromexp(self,md) % {{{
-
-			if length(self.maskexpstring)>0
-				self.mask=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,self.maskexpstring,'node',1);
-			end
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ischar(self.name),
-				error('regionaloutput error message: ''name'' field should be a string!');
-			end
-			if ~ischar(self.outputnamestring),
-				error('regionaloutput error message: ''outputnamestring'' field should be a string!');
-			end
-			
-			OutputdefinitionStringArray={};
-			for i=1:100
-				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
-			end
-			self=setmaskfromexp(self,md);
-
-			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
-			md = checkfield(md,'fieldname','self.mask','field',self.mask,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-
-		end % }}}
-		function md = disp(self) % {{{
-		
-			disp(sprintf('   Regionaloutput:\n'));
-
-			fielddisplay(self,'name','identifier for this regional response');
-			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-100]''');
-			fielddisplay(self,'outputnamestring','string that identifies the type of output you want, eg. IceVolume, TotalSmb, GroudedArea');
-			fielddisplay(self,'mask','mask vectorial field which identifies the region of interest (value > 0 will be included)');
-			fielddisplay(self,'maskexpstring','name of Argus file that can be passed in to define the regional mask');
-
-		end % }}}
-		function md = marshall(self,prefix,md,fid) % {{{
-
-			self=setmaskfromexp(self,md);
-			WriteData(fid,prefix,'data',self.name,'name','md.regionaloutput.name','format','String');
-			WriteData(fid,prefix,'data',self.definitionstring,'name','md.regionaloutput.definitionstring','format','String');
-			WriteData(fid,prefix,'data',self.outputnamestring,'name','md.regionaloutput.outputnamestring','format','String');
-			WriteData(fid,prefix,'data',self.mask,'name','md.regionaloutput.mask','format','DoubleMat','mattype',1);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/regionaloutput.py
===================================================================
--- /issm/trunk/src/m/classes/regionaloutput.py	(revision 28275)
+++ 	(revision )
@@ -1,114 +1,0 @@
-from project3d import project3d
-from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from checkfield import checkfield
-from WriteData import WriteData
-from ContourToMesh import ContourToMesh
-import numpy as np
-import os
-
-
-class regionaloutput(object):
-    """
-    REGIONALOUTPUT class definition
-
-       Usage:
-          regionaloutput = regionaloutput()
-          regionaloutput = regionaloutput('name', 'Volume1', 'definitionstring', 'Outputdefinition1', 'outputnamestring', 'IceVolume', 'mask', mask)
-          regionaloutput = regionaloutput('name', 'Volume1', 'definitionstring', 'Outputdefinition1', 'outputnamestring', 'IceVolume', 'maskexpstring', 'Exp/Mask.exp', 'model', md)
-
-       where mask is a vectorial field of size md.mesh.numberofvertices, 1 : where vertices with values > 1 are to be included in the calculated region.
-       Alternatively, the user can pass in an Argus file and model object instead of a mask, and mask will be calculated for the user
-    """
-
-    def __init__(self, *args):  # {{{
-
-        self.name = ''
-        self.model= ''
-        self.definitionstring = ''
-        self.outputnamestring = ''
-        self.mask = np.nan
-        self.maskexpstring = ''
-
-    #set defaults
-        self.setdefaultparameters()
-
-    #use provided options to change fields
-        options = pairoptions(*args)
-
-    #OK get other fields
-        self = options.AssignObjectFields(self)
-
-    #get name
-        if options.getfieldvalue('model', 0):
-            if options.getfieldvalue('maskexpstring', 0):
-                modelname = options.getfieldvalue('model')
-                self.maskexpstring = options.getfieldvalue('maskexpstring')
-                self.setmaskfromexp(modelname)
-
-        # if (len(self.mask) <= 1 & np.any(np.isnan(self.mask))):
-        #     raise IOError('regionaloutput error message: ''mask'' field or ''maskexpstring'' and ''model'' fields should be defined!')
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "   Regionaloutput:"
-        string = "%s\n%s" % (string, fielddisplay(self, 'name', 'identifier for this regional response'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'definitionstring', 'string that identifies this output definition uniquely, from Outputdefinition[1 - 100]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'outputnamestring', 'string that identifies the type of output you want, eg. IceVolume, TotalSmb, GroudedArea'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'mask', 'mask vectorial field which identifies the region of interest (value > 0 will be included)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'maskexpstring', 'name of Argus file that can be passed in to define the regional mask'))
-        return string
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.mask = project3d(md, 'vector', self.mask, 'type', 'node')
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def setmaskfromexp(self, md):  # {{{
-        if len(self.maskexpstring) > 0:
-            self.mask = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, self.maskexpstring, 'node', 1)
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-
-        if not isinstance(self.name, str):
-            raise RuntimeError("regionaloutput error message: 'name' field should be a string!")
-
-        if not isinstance(self.outputnamestring, str):
-            raise RuntimeError("regionaloutput error message: 'outputnamestring' field should be a string!")
-
-        if len(self.maskexpstring) > 0:
-            if not os.path.isfile(self.maskexpstring):
-                raise RuntimeError("regionaloutput error message: file name for mask exp does not point to a legitimate file on disk!")
-            else:
-                self.setmaskfromexp(md)
-
-        OutputdefinitionStringArray = []
-        for i in range(1, 100):
-            x = 'Outputdefinition' + str(i)
-            OutputdefinitionStringArray.append(x)
-
-        md = checkfield(md, 'field', self.definitionstring, 'values', OutputdefinitionStringArray)
-        md = checkfield(md, 'field', self.mask, 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        return md
-    # }}}
-    def marshall(self, prefix, md, fid):  # {{{
-
-        #before marshalling, make sure mask is set:
-        self.setmaskfromexp(md)
-
-    #ok, marshall strings and mask:
-        WriteData(fid, prefix, 'data', self.name, 'name', 'md.regionaloutput.name', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.definitionstring, 'name', 'md.regionaloutput.definitionstring', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.outputnamestring, 'name', 'md.regionaloutput.outputnamestring', 'format', 'String')
-        WriteData(fid, prefix, 'data', self.mask, 'name', 'md.regionaloutput.mask', 'format', 'DoubleMat', 'mattype', 1)
-
-    # }}}
Index: sm/trunk/src/m/classes/results.py
===================================================================
--- /issm/trunk/src/m/classes/results.py	(revision 28275)
+++ 	(revision )
@@ -1,224 +1,0 @@
-from copy import deepcopy
-
-
-class results(object):  #{{{
-    """RESULTS class definition
-
-    Usage:
-        md.results = results()
-
-    TODO:
-    - Rework so that a solution of arbitrary length (normal or transient) can
-    initialized from one call to the results class constructor.
-    """
-
-    def __init__(self):  #{{{
-        pass
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = ''
-        for key, value in self.__dict__.items():
-            if isinstance(value, resultsdakota):
-                lengthvalue = 1
-            else:
-                try:
-                    lengthvalue = len(value)
-                except TypeError:
-                    lengthvalue = 1
-            s += '    {}: [1x{} struct]\n'.format(key, lengthvalue)
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        #do nothing
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        pass
-    # }}}
-# }}}
-
-
-class resultsdakota(object):  #{{{
-    """RESULTSDAKOTA class definition - Used to store results from a run of
-    Dakota.
-
-    Usage:
-        md.results.dakota = resultsdakota()
-
-    NOTE: Values of attributes can themselves be instances of solution class.
-    """
-
-    def __init__(self):  #{{{
-        pass
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = ''
-        for key, value in self.__dict__.items():
-            s += '    {}: '.format(key)
-            if isinstance(value, list):
-                s += '[{} element list]'.format(len(value))
-            else:
-                s += '{}'.format(value)
-            s += '\n'
-        return s
-    # }}}
-
-    def __len__(self):  #{{{
-        return len(self.__dict__.keys())
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        #do nothing
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        pass
-    # }}}
-# }}}
-
-
-class solution(object):  #{{{
-    """SOLUTION class definition - Value of an attribute (which should be
-    a string representing a solution type) of an instance of results class
-
-    Elements of self.steps should be instances of solutionstep.
-
-    Usage:
-        setattr(md.results, 'SolutionType', solution())
-
-    NOTE:
-    - Under MATLAB, this is implemented as a structure array
-    - Only when this instance of solution represents a transient solution
-    should self.steps have more than one element
-    """
-
-    def __init__(self, *args):  #{{{
-        self.steps = None
-        if len(args) == 1:
-            arg = args[0]
-            if isinstance(arg, list):
-                self.steps = arg
-            else:
-                raise Exception('solution class error: if initializing with an argument, that argument should be an empty list or a list of instances of solutionstep')
-        else:
-            self.steps = [solutionstep()]
-    # }}}
-
-    def __deepcopy__(self, memo):  #{{{
-        return solution(deepcopy(self.steps, memo))
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = ''
-        numsteps = len(self.steps)
-        if numsteps == 1:
-            for key, value in self.steps[0].__dict__.items():
-                s += '    {}: {}\n'.format(key, value)
-        else:
-            s = '  1x{} struct array with fields:\n'.format(numsteps)
-            s += '\n'
-            for fieldname in self.steps[0].getfieldnames():
-                s += '    {}\n'.format(fieldname)
-
-        return s
-    # }}}
-
-    def __len__(self):  #{{{
-        return len(self.steps)
-    # }}}
-
-    def __getattr__(self, key):  #{{{
-        # NOTE: Currently only returning value from first frame of transient solution (see retrieval of md.results.TransientSolution.BedGRD in test2051.py for justification)
-        return getattr(self.steps[0], key)
-
-        # Original code
-        # if len(self.steps) == 1:
-        #     return getattr(self.steps[0], key)
-        # else:
-        #     raise Exception('<results>.<solution> error: Currently, can only get a field if we are not working with a transient solution.')
-    # }}}
-
-    def __getitem__(self, index):  #{{{
-        while True:
-            try:
-                return self.steps[index]
-            except:
-                self.steps.append(solutionstep())
-        else:
-            raise Exception('<results>.<solution>: either request a specific result by index or make sure that there is only a single result for this solution (cannot be a transient solution)')
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        pass
-    # }}}
-# }}}
-
-
-class solutionstep(object):  #{{{
-    """SOLUTIONSTEP class definition - Single element of <solution>.steps
-
-    Usage:
-        <solution>.steps.append(solutionstep())
-    """
-
-    def __init__(self, *args):  #{{{
-        pass
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = ''
-        width = self.getlongestfieldname()
-        for key, value in self.__dict__.items():
-            s += '    {:{width}s}: {}\n'.format(key, value, width=width)
-
-        return s
-    # }}}
-
-    def getfieldnames(self):  #{{{
-        return self.__dict__.keys()
-    # }}}
-
-    def getlongestfieldname(self):  #{{{
-        maxlength = 0
-        for key in self.__dict__.keys():
-            length = len(key)
-            if length > maxlength:
-                maxlength = length
-
-        return maxlength
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        pass
-    # }}}
-# }}}
Index: sm/trunk/src/m/classes/rifts.js
===================================================================
--- /issm/trunk/src/m/classes/rifts.js	(revision 28275)
+++ 	(revision )
@@ -1,91 +1,0 @@
-//RIFTS class definition
-//
-//   Usage:
-//      rifts=new rifts();
-
-function rifts (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-	}// }}}
-	this.classname= function(){// {{{
-		return "rifts";
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   rifts class echo:'));
-		fielddisplay(this,'riftstruct','structure containing all rift information (vertices coordinates, segments, type of melange, ...)');
-		fielddisplay(this,'riftproperties','');
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-			var numrifts;
-			if (isNaN(this.riftstruct) | this.riftstruct.length==0){
-				numrifts=0;
-			}
-			else{
-				numrifts=this.riftstruct.length;
-			}
-			if (numrifts){
-				if (!(md.mesh.domaintype() == '2Dhorizontal')){
-					md.checkmessage('models with rifts are only supported in 2d for now!');
-				}
-				if (!IsArray(this.riftstruct)){
-					md.checkmessage('rifts.riftstruct should be a structure!');
-				}
-				for(var i=0;i<md.mesh.segmentmarkers.length;i++){
-					if (md.mesh.segmentmarkers[i]>=2){
-						//We have segments with rift markers, but no rift structure!
-						md.checkmessage(['model should be processed for rifts (run meshprocessrifts)!']);
-						break;
-					}
-				}
-				for (var i=0;i<numrifts;i++){
-					md = checkfield(md,'fieldname',sprintf('rifts.riftstruct[%i].fill',i),'values',['Water', 'Air', 'Ice', 'Melange']);
-				}
-			}
-			else{
-				if (!isNaN(this.riftstruct)) md.checkmessage('riftstruct should be NaN since numrifts is 0!');
-			}
-		} //}}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			var numrifts;
-			//Process rift info
-			if ((this.riftstruct.length==0) | (this.riftstruct == null)){
-				numrifts=0;
-			}
-			else{
-				numrifts=this.riftstruct.length;
-			}
-			var numpairs=0;
-			for (var i=0;i<numrifts;i++){
-				numpairs=numpairs+this.riftstruct[i].penaltypairs.length;
-			}
-
-			// 2 for nodes + 2 for elements+ 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
-			data=Create2DArray(numpairs,12);
-			var count=0;
-			for (var i=0;i<numrifts;i++){
-				numpairsforthisrift=this.riftstruct[i].penaltypairs.length;
-				for(var j=0;j<numpairsforthisrift;j++){
-					for(var k=0;k<7;k++)data[count+j][k]=this.riftstruct[i].penaltypairs;
-					data[count+j][7]=this.riftstruct[i].fill;
-					data[count+j][8]=this.riftstruct[i].friction;
-					data[count+j][9]=this.riftstruct[i].fraction;
-					data[count+j][10]=this.riftstruct[i].fractionincrement;
-					data[count+j][11]=this.riftstruct[i].state;
-					count+=numpairsforthisrift;
-				}
-			}
-			WriteData(fid,prefix,'data',numrifts,'name','md.rifts.numrifts','format','Integer');
-			WriteData(fid,prefix,'data',data,'name','md.rifts.riftstruct','format','StringArray');
-		}//}}}
-		this.fix=function() { //{{{
-			this.riftstruct=NullFix(this.riftstruct,'');
-			this.riftproperties=NullFix(this.riftproperties,NaN);
-		}//}}}
-	//properties 
-	// {{{
-	this.riftstruct     = NaN;
-	this.riftproperties = NaN;
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/rifts.m
===================================================================
--- /issm/trunk/src/m/classes/rifts.m	(revision 28275)
+++ 	(revision )
@@ -1,115 +1,0 @@
-%RIFTS class definition
-%
-%   Usage:
-%      rifts=rifts();
-
-classdef rifts
-	properties (SetAccess=public) 
-		riftstruct     = NaN;
-		riftproperties = NaN;
-	end
-	methods
-		function self = rifts(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			if isempty(self.riftstruct) | isnans(self.riftstruct),
-				numrifts=0;
-			else
-				numrifts=numel(self.riftstruct);
-			end
-			if numrifts,
-				if ~(strcmp(domaintype(md.mesh),'2Dhorizontal')),
-					md = checkmessage(md,['models with rifts are only supported in 2d for now!']);
-				end
-				if ~isstruct(self.riftstruct),
-					md = checkmessage(md,['rifts.riftstruct should be a structure!']);
-				end
-				if ~isempty(find(md.mesh.segmentmarkers>=2)),
-					%We have segments with rift markers, but no rift structure!
-					md = checkmessage(md,['model should be processed for rifts (run meshprocessrifts)!']);
-				end
-				for i=1:numrifts,
-					md = checkfield(md,'fieldname',sprintf('rifts.riftstruct(%d).fill',i),'values',{'Air','Ice','Melange','Water'});
-				end
-			else
-				if ~isnans(self.riftstruct),
-					md = checkmessage(md,['riftstruct should be NaN since numrifts is 0!']);
-				end
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   rifts parameters:'));
-
-			fielddisplay(self,'riftstruct','structure containing all rift information (vertices coordinates, segments, type of melange, ...)');
-			fielddisplay(self,'riftproperties','');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			%Process rift info
-			if isempty(self.riftstruct) | isnans(self.riftstruct),
-				numrifts=0;
-			else
-				numrifts=numel(self.riftstruct);
-			end
-
-			numpairs=0;
-			for i=1:numrifts,
-				numpairs=numpairs+size(self.riftstruct(i).penaltypairs,1);
-			end
-			
-			for i=1:numrifts
-				if (strcmpi(self.riftstruct(i).fill,'Air'))
-					self.riftstruct(i).fill = 0;
-				elseif (strcmpi(self.riftstruct(i).fill,'Ice'))
-					self.riftstruct(i).fill = 1;
-				elseif (strcmpi(self.riftstruct(i).fill,'Melange'))
-					self.riftstruct(i).fill = 2;
-				elseif (strcmpi(self.riftstruct(i).fill,'Water'))
-					self.riftstruct(i).fill = 3;
-				else
-					error(['Could not convert string in riftstruct to integer for marshalling']);	
-				end
-			end
-
-			% 2 for nodes + 2 for elements+ 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
-			data=zeros(numpairs,12);
-			count=1;
-			for i=1:numrifts,
-				numpairsforthisrift=size(self.riftstruct(i).penaltypairs,1);
-				data(count:count+numpairsforthisrift-1,1:7)=self.riftstruct(i).penaltypairs;
-				data(count:count+numpairsforthisrift-1,8)=self.riftstruct(i).fill;
-				data(count:count+numpairsforthisrift-1,9)=self.riftstruct(i).friction;
-				data(count:count+numpairsforthisrift-1,10)=self.riftstruct(i).fraction;
-				data(count:count+numpairsforthisrift-1,11)=self.riftstruct(i).fractionincrement;
-				data(count:count+numpairsforthisrift-1,12)=self.riftstruct(i).state;
-				count=count+numpairsforthisrift;
-			end
-
-			WriteData(fid,prefix,'data',numrifts,'name','md.rifts.numrifts','format','Integer');
-			WriteData(fid,prefix,'data',data,    'name','md.rifts.riftstruct','format','DoubleMat','mattype',3);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-	
-			if isempty(self.riftstruct) | isnans(self.riftstruct),
-				numrifts=0;
-			else
-				numrifts=numel(self.riftstruct);
-			end
-			
-			if numrifts,
-				error('rifts savemodeljs error message: not supported yet!');
-			end
-	
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/rifts.py
===================================================================
--- /issm/trunk/src/m/classes/rifts.py	(revision 28275)
+++ 	(revision )
@@ -1,98 +1,0 @@
-import numpy as np
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-from isnans import isnans
-import MatlabFuncs as m
-
-
-class rifts(object):
-    """
-    RIFTS class definition
-
-       Usage:
-          rifts = rifts()
-    """
-
-    def __init__(self):  # {{{
-        self.riftstruct = []
-        self.riftproperties = []
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = '   rifts parameters:'
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'riftstruct', 'structure containing all rift information (vertices coordinates, segments, type of melange, ...)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'riftproperties', ''))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if (not self.riftstruct) or np.any(isnans(self.riftstruct)):
-            numrifts = 0
-        else:
-            numrifts = len(self.riftstruct)
-
-        if numrifts:
-            if not m.strcmp(md.mesh.domaintype(), '2Dhorizontal'):
-                md.checkmessage("models with rifts are only supported in 2d for now!")
-            if not isinstance(self.riftstruct, list):
-                md.checkmessage("rifts.riftstruct should be a structure!")
-            if np.any(md.mesh.segmentmarkers >= 2):
-                #We have segments with rift markers, but no rift structure!
-                md.checkmessage("model should be processed for rifts (run meshprocessrifts)!")
-            for i, rift in enumerate(self.riftstruct):
-                md = checkfield(md, 'fieldname', "rifts.riftstruct[{}]['fill']".format(i), 'values', ['Water', 'Air', 'Ice', 'Melange', 0, 1, 2, 3])
-        else:
-            if self.riftstruct and np.any(np.logical_not(isnans(self.riftstruct))):
-                md.checkmessage("riftstruct should be NaN since numrifts is 0!")
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        #Process rift info
-        if (not self.riftstruct) or np.any(isnans(self.riftstruct)):
-            numrifts = 0
-        else:
-            numrifts = len(self.riftstruct)
-
-        numpairs = 0
-        if numrifts > 0:
-            for rift in self.riftstruct:
-                numpairs += np.size(rift['penaltypairs'], axis=0)
-
-            # Convert strings in riftstruct to hard coded numbers
-            FillDict = {'Air': 0,
-                        'Ice': 1,
-                        'Melange': 2,
-                        'Water': 3}
-            for rift in self.riftstruct:
-                if rift['fill'] in ['Air', 'Ice', 'Melange', 'Water']:
-                    rift['fill'] = FillDict[rift['fill']]
-
-            # 2 for nodes + 2 for elements + 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
-            data = np.zeros((numpairs, 12))
-            count = 0
-            for rift in self.riftstruct:
-                numpairsforthisrift = np.size(rift['penaltypairs'], 0)
-                data[count:count + numpairsforthisrift, 0:7] = rift['penaltypairs']
-                data[count:count + numpairsforthisrift, 7] = rift['fill']
-                data[count:count + numpairsforthisrift, 8] = rift['friction']
-                data[count:count + numpairsforthisrift, 9] = rift['fraction']
-                data[count:count + numpairsforthisrift, 10] = rift['fractionincrement']
-                data[count:count + numpairsforthisrift, 11] = rift['state'].reshape(-1)
-                count += numpairsforthisrift
-        else:
-            data = np.zeros((numpairs, 12))
-        WriteData(fid, prefix, 'data', numrifts, 'name', 'md.rifts.numrifts', 'format', 'Integer')
-        WriteData(fid, prefix, 'data', data, 'name', 'md.rifts.riftstruct', 'format', 'DoubleMat', 'mattype', 3)
-    # }}}
Index: sm/trunk/src/m/classes/rotational.js
===================================================================
--- /issm/trunk/src/m/classes/rotational.js	(revision 28275)
+++ 	(revision )
@@ -1,58 +1,0 @@
-class rotational {//{{{
-	/**
-	 * ROTATIONAL class definition
-	 *
-	 * Usage:
-	 *     rotational = rotational();
-	 */
-	constructor() {//{{{
-		this.equatorialmoi		= 0;
-		this.polarmoi			= 0;
-		this.angularvelocity	= 0;
-
-		let nargs = arguments.length;
-		if (nargs == 0) {
-			this.setdefaultparameters();
-		} else {
-			error('constructor not supported');
-		}
-	} //}}}
-
-	disp() {//{{{
-		console.log('WARNING: rotational::disp is not yet implemented');
-	} //}}}
-
-	setdefaultparameters() {//{{{
-		// Moment of inertia
-		this.equatorialmoi	= 8.0077e37; // [kg m^2]
-		this.polarmoi		= 8.0345e37; // [kg m^2]
-
-		// Mean rotational velocity of earth
-		this.angularvelocity = 7.2921e-5; // [s^-1]
-	} //}}}
-
-	checkconsistency(md, solution, analyses) {//{{{
-		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
-			return md;
-		}
-
-		md = checkfield(md, 'fieldname', 'solidearth.rotational.equatorialmoi', 'NaN', 1, 'Inf', 1);
-		md = checkfield(md, 'fieldname', 'solidearth.rotational.polarmoi', 'NaN', 1, 'Inf', 1);
-		md = checkfield(md, 'fieldname', 'solidearth.rotational.angularvelocity', 'NaN', 1, 'Inf', 1);
-
-		return md;
-	} //}}}
-
-	defaultoutputs(md) {//{{{
-		return [];
-	} //}}}
-
-	marshall(md, prefix, fid) {//{{{
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'equatorialmoi', 'name', 'md.solidearth.rotational.equatorialmoi', 'format', 'Double');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'polarmoi', 'name', 'md.solidearth.rotational.polarmoi', 'format', 'Double');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'angularvelocity', 'name', 'md.solidearth.rotational.angularvelocity', 'format', 'Double');
-	} //}}}
-
-	extrude(md) {//{{{
-	} //}}}
-} //}}}
Index: sm/trunk/src/m/classes/rotational.m
===================================================================
--- /issm/trunk/src/m/classes/rotational.m	(revision 28275)
+++ 	(revision )
@@ -1,68 +1,0 @@
-%ROTATIONAL class definition
-%
-%   Usage:
-%      rotational=rotational();
-
-classdef rotational
-	properties (SetAccess=public) 
-		equatorialmoi         = 0;
-		polarmoi              = 0;
-		angularvelocity       = 0;
-	end
-	methods
-		function self = rotational(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%moment of inertia:
-			self.equatorialmoi	=8.0077*10^37; % [kg m^2]
-			self.polarmoi		=8.0345*10^37; % [kg m^2]
-
-			% mean rotational velocity of earth
-			self.angularvelocity=7.2921*10^-5; % [s^-1]
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
-				return; 
-			end
-
-			md = checkfield(md,'fieldname','solidearth.rotational.equatorialmoi','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.rotational.polarmoi','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','solidearth.rotational.angularvelocity','NaN',1,'Inf',1);
-
-		end % }}}
-		function list=defaultoutputs(self,md) % {{{
-			list = {};
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   rotational parameters:'));
-
-			fielddisplay(self,'equatorialmoi','mean equatorial moment of inertia [kg m^2]');
-			fielddisplay(self,'polarmoi','polar moment of inertia [kg m^2]');
-			fielddisplay(self,'angularvelocity','mean rotational velocity of earth [per second]'); 
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			
-			WriteData(fid,prefix,'object',self,'fieldname','equatorialmoi','name','md.solidearth.rotational.equatorialmoi','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','polarmoi','name','md.solidearth.rotational.polarmoi','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','angularvelocity','name','md.solidearth.rotational.angularvelocity','format','Double');
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.rotational.equatorialmoi'],self.equatorial_moi);
-			writejsdouble(fid,[modelname '.rotational.polarmoi'],self.polar_moi);
-			writejsdouble(fid,[modelname '.rotational.angularvelocity'],self.angular_velocity);
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/rotational.py
===================================================================
--- /issm/trunk/src/m/classes/rotational.py	(revision 28275)
+++ 	(revision )
@@ -1,64 +1,0 @@
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class rotational(object):
-    """ROTATIONAL class definition
-
-    Usage:
-        rotational = rotational()
-    """
-
-    def __init__(self, *args):  #{{{
-        self.equatorialmoi = 0
-        self.polarmoi = 0
-        self.langularvelocity = 0
-
-        nargin = len(args)
-        if nargin == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   rotational parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'equatorialmoi', 'mean equatorial moment of inertia [kg m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'polarmoi', 'polar moment of inertia [kg m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'angularvelocity', 'mean rotational velocity of earth [per second]'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Moment of inertia
-        self.equatorialmoi = 8.0077 * pow(10, 37) # [kg m^2]
-        self.polarmoi = 8.0345 * pow(10, 37) # [kg m^2]
-
-        # Mean rotational velocity of earth
-        self.angularvelocity = 7.2921 * pow(10, -5) # [s^-1]
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
-            return md
-        md = checkfield(md, 'fieldname', 'solidearth.rotational.equatorialmoi', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.rotational.polarmoi', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.rotational.angularvelocity', 'NaN', 1, 'Inf', 1)
-        return md
-    # }}}
-
-    def defaultoutputs(self, md):  #{{{
-        return []
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'equatorialmoi', 'name', 'md.solidearth.rotational.equatorialmoi', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'polarmoi', 'name', 'md.solidearth.rotational.polarmoi', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'angularvelocity', 'name', 'md.solidearth.rotational.angularvelocity', 'format', 'Double')
-    # }}}
-
-    def extrude(self, md):  #{{{
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/sampling.js
===================================================================
--- /issm/trunk/src/m/classes/sampling.js	(revision 28275)
+++ 	(revision )
@@ -1,99 +1,0 @@
-//SAMPLING class definition
-//
-//   Usage:
-//      sampling=new sampling();
-
-function sampling (){
-	//methods
-	this.defaultoutputs = function(){// {{{
-       	return [];
-	}// }}}
-	this.setdefaultparameters = function(){// {{{
-
-		//Scaling coefficient
-		this.tau=1;  
-
-		//Apply Robin boundary conditions
-		this.robin=0;   
-		
-		//Temporal correlation factor
-		this.phi=0;  
-		
-		//Exponent in fraction SPDE (default=2, biLaplacian covariance
-		//operator)
-		this.alpha=2; // Default 
-		
-		//Seed for pseudorandom number generator (default -1 for random seed)
-		this.seed=-1;
-		
-		//default output
-		this.requested_outputs=['default'];
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   Sampling parameters:'));
-
-		console.log(sprintf('\n      %s','Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):'));
-		fielddisplay(this,'kappa','coefficient of the identity operator');
-		fielddisplay(this,'tau','scaling coefficient of the solution (default 1.0)');
-		fielddisplay(this,'alpha','exponent in PDE operator, (default 2.0, BiLaplacian covariance operator)');
-	  
-		console.log(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():'));
-		fielddisplay(this,'robin','Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default 0)');
-		fielddisplay(this,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)');          
-		
-		console.log(sprintf('\n      %s','Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):'));
-		fielddisplay(this,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)');
-		
-		console.log(sprintf('\n      %s','Other parameters of stochastic sampler:'));
-		fielddisplay(this,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default -1)');
-		fielddisplay(this,'requested_outputs','additional outputs requested (not implemented yet)');
-	}// }}}
-	this.classname= function(){// {{{
-		return "sampling";
-	}// }}}
-	this.checkconsistency = function(md,solution,analyses) { //{{{
-		if (!ismember('SamplingAnalysis',analyses)) return;
-		
-		checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
-		checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0,1]);
-		if (md.sampling.robin) {
-			checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
-		}
-		checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
-		checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
-		checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
-		checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
-	} // }}}
-	this.marshall=function(md,prefix,fid) { //{{{
-		WriteData(fid,prefix,'object',this,'fieldname','kappa','format','DoubleMat','mattype',1);
-		WriteData(fid,prefix,'object',this,'fieldname','tau','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','beta','format','DoubleMat','mattype',1);
-		WriteData(fid,prefix,'object',this,'fieldname','phi','format','Double');
-		WriteData(fid,prefix,'object',this,'fieldname','alpha','format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','robin','format','Boolean');
-		WriteData(fid,prefix,'object',this,'fieldname','seed','format','Integer');
-		
-		//process requested outputs
-		outputs = this.requested_outputs;
-		pos = find(ismember(outputs,'default'));
-		if (!isempty(pos)) {
-			ArrayIndex(outputs,pos,[]);                         //remove 'default' from outputs
-			outputs = ArrayConcat(outputs, this.defaultoutputs()); //add defaults
-		}
-		WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray');
-	}//}}}
-	//properties 
-	// {{{
-    this.kappa          	= NaN;
-	this.tau            	= 0;
-	this.beta           	= NaN;
-    this.phi            	= 0;
-    this.alpha          	= 0;
-    this.robin          	= 0;
-    this.seed           	= 0;
-	this.requested_outputs  = [];
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/sampling.m
===================================================================
--- /issm/trunk/src/m/classes/sampling.m	(revision 28275)
+++ 	(revision )
@@ -1,124 +1,0 @@
-%SAMPLING class definition
-%
-%   Usage:
-%      sampling=sampling();
-
-classdef sampling
-	properties (SetAccess=public)
-		kappa             = NaN;
-		tau               = 0;
-		beta              = NaN;
-		phi               = NaN;
-		alpha             = 0;
-		robin             = 0;
-		seed              = 0;
-		requested_outputs = {};
-	end
-	methods
-		function self = sampling(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function disp(self) % {{{
-
-			disp(sprintf('   Sampling parameters:'));
-
-			disp(sprintf('\n      %s','Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):'));
-			fielddisplay(self,'kappa','coefficient of the identity operator');
-			fielddisplay(self,'tau','scaling coefficient of the solution');
-			fielddisplay(self,'alpha','exponent in PDE operator, (default: 2.0, BiLaplacian covariance operator)');
-
-			disp(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():'));
-			fielddisplay(self,'robin','Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default: 0)');
-			fielddisplay(self,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)');
-
-			disp(sprintf('\n      %s','Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):'));
-			fielddisplay(self,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)');
-
-			disp(sprintf('\n      %s','Other parameters of stochastic sampler:'));
-			fielddisplay(self,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default: -1)');
-			fielddisplay(self,'requested_outputs','additional outputs requested (not implemented yet)');
-
-		end % }}}','
-		function self = setdefaultparameters(self) % {{{
-
-			%Apply Robin boundary conditions
-			self.robin=0;
-
-			%Exponent in fraction SPDE (default: 2, biLaplacian covariance
-			%operator)
-			self.alpha=2; % Default 
-
-			%Seed for pseudorandom number generator (default: -1, for random seed)
-			self.seed=-1;
-
-			%default output
-			self.requested_outputs={'default'};
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-
-			list = {};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SamplingAnalysis',analyses), return; end
-
-			md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
-			md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
-			md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]);
-			if(md.sampling.robin)
-				md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
-			end
-			md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
-			md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
-			md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','tau','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','phi','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray');
-		end % }}}
-		function md = setparameters(self,md,lc,sigma) % {{{
-
-			nu = self.alpha-1;
-			KAPPA = sqrt(8*nu)./lc;
-			TAU = sqrt(gamma(nu)./(gamma(self.alpha)*(4*pi)*KAPPA.^(2*nu).*sigma.^2));
-			md.sampling.kappa = KAPPA.*ones(md.mesh.numberofvertices,1);
-			md.sampling.tau = TAU.*ones(md.mesh.numberofvertices,1);
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejsdouble(fid,[modelname '.sampling.kappa'],self.kappa);
-			writejsdouble(fid,[modelname '.sampling.tau'],self.tau);
-			writejsdouble(fid,[modelname '.sampling.beta'],self.beta);
-			writejsdouble(fid,[modelname '.sampling.phi'],self.phi);
-			writejsdouble(fid,[modelname '.sampling.alpha'],self.alpha);
-			writejsdouble(fid,[modelname '.sampling.robin'],self.robin);
-			writejsdouble(fid,[modelname '.sampling.seed'],self.seed);
-			writejscellstring(fid,[modelname '.sampling.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/sampling.py
===================================================================
--- /issm/trunk/src/m/classes/sampling.py	(revision 28275)
+++ 	(revision )
@@ -1,119 +1,0 @@
-import numpy as np
-
-from math import *
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class sampling(object):
-    """sampling class definition
-
-    Usage:
-        sampling = sampling()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.kappa = np.nan
-        self.tau = 0
-        self.beta = np.nan
-        self.phi = np.nan
-        self.alpha = 0
-        self.robin = 0
-        self.seed = 0
-        self.requested_outputs = []
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise RuntimeError('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Sampling parameters::\n'
-        s += '      Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):\n'
-        s += '{}\n'.format(fielddisplay(self, 'kappa', 'coefficient of the identity operator'))
-        s += '{}\n'.format(fielddisplay(self, 'tau', 'scaling coefficient of the solution (default: 1.0)'))
-        s += '{}\n'.format(fielddisplay(self, 'alpha', 'exponent in PDE operator, (default: 2.0, BiLaplacian covariance operator)'))
-
-        s += '      Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():\n'
-        s += '{}\n'.format(fielddisplay(self, 'robin', 'Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default: 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'beta', 'Coefficient in Robin boundary conditions (to be defined for robin = 1)'))
-
-        s += '      Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):\n'
-        s += '{}\n'.format(fielddisplay(self, 'phi', 'Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)'))
-
-        s += '      Other parameters of stochastic sampler:\n'
-        s += '{}\n'.format(fielddisplay(self, 'seed', 'Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default: -1)'))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested (not implemented yet)'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-
-        # Apply Robin boundary conditions
-        self.robin = 0
-
-        # Exponent in fraction SPDE (default: 2, biLaplacian covariance operator)
-        self.alpha = 2 # Default
-
-        # Seed for pseudorandom number generator (default: -1, for random seed)
-        self.seed = -1
-
-        # Default output
-        self.requested_outputs = ['default']
-
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return []
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if ('SamplingAnalysis' not in analyses):
-            return md
-
-        md = checkfield(md, 'fieldname', 'sampling.kappa', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
-        md = checkfield(md, 'fieldname', 'sampling.tau', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'sampling.robin', 'numel', 1, 'values', [0, 1])
-        if md.sampling.robin:
-            md = checkfield(md, 'fieldname', 'sampling.beta', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
-        end
-        md = checkfield(md, 'fieldname', 'sampling.alpha', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
-        md = checkfield(md, 'fieldname', 'sampling.seed', 'NaN', 1, 'Inf', 1, 'numel', 1)
-        md = checkfield(md, 'fieldname', 'sampling.requested_outputs', 'stringrow', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'kappa', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'tau', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'beta', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'phi', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'alpha', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'robin', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'seed', 'format', 'Integer')
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.sampling.requested_outputs', 'format', 'StringArray')
-    # }}}
-
-    def setparameters(self, md, lc, sigma):  # {{{
-        nu = self.alpha - 1
-        KAPPA = pow((8 * nu), 0.5) / lc
-        TAU = pow((math.gamma(nu) / math.gamma(self.alpha) * (4 *  np.pi) * pow(KAPPA, 2 * nu) * pow(sigma, 2)), 0.5)
-        md.sampling.kappa = KAPPA * np.ones((md.mesh.numberofvertices, 1))
-        md.sampling.tau = TAU
-
-        return md
-    # }}}
Index: sm/trunk/src/m/classes/sealevelmodel.js
===================================================================
--- /issm/trunk/src/m/classes/sealevelmodel.js	(revision 28275)
+++ 	(revision )
@@ -1,143 +1,0 @@
-class sealevelmodel {
-	/**
-	 * SEALEVELMODEL class definition
-	 * 
-	 * Usage:
-	 *     slm = sealevelmodel(varargin)
-	 *
-	 * Example:
-	 *     slm = sealevelmodel(
-	 *         'icecap', md_greenland,
-	 *         'icecap', md_antarctica,
-	 *         'earth', md_earth
-	 *     )
-	 *
-	 * TODO:
-	 * - Finish translation
-	 */
-	constructor(...varargin) {//{{{
-		this.icecaps = []; // list of land/ice models; name should be changed later
-		this.earth = null; // model for the whole earth
-		this.basins = []; // list of basins, matching icecaps, where shapefile info is held
-		this.cluster = null;
-		this.miscellaneous = null;
-		this.settings = null;
-		this.private = null;
-		this.mergedcaps = null;
-		this.transitions = [];
-		this.eltransitions = [];
-		this.planet = '';
-
-		this.setdefaultparamters();
-
-		if (varargin.length) {
-			let options = pairoptions(varargin);
-
-			// Recover all the icecap models
-			this.icecaps = options.getfieldvalues('ice_cap', []);
-
-			// Recover the earth model
-			this.earth = options.getfieldvalue('earth', 0);
-
-			// Set planet type
-			this.planet = options.getfieldvalue('planet', 'earth');
-		}
-	} //}}}
-
-	setdefaultparamters() {//{{{
-		// Initialize subclasses
-		this.icecaps = [];
-		this.earth = [];
-		this.cluster = generic();
-		this.miscellaneous = miscellaneous();
-		this.settings = issmsettings();
-		this.private = private();
-		this.transitions = [];
-		this.eltransitions = [];
-		this.planet = 'earth';
-	} //}}}
-
-	static checkconsistency(slm, solutiontype) {//{{{
-		// Is the coupler turned on?
-		for (let i = 0; slm.icecaps.length; ++i) {
-			if (!slm.icecaps[0].transient.iscoupler) {
-				console.log('sealevelmodel checkconsistency error: icecap model ' +  slm.icecaps[0].miscellaneous.name + ' should have the transient coupler option turned on!');
-			}
-		}
-
-		if (!slm.earth.transient.iscoupler) {
-			console.log('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!');
-		}
-
-		// Check that the transition vectors have the right size
-		for (let i = 0; i < slm.icecaps.length; ++i) {
-			if (slm.icecaps[0].mesh.numberorvertices != slm.earth.solidearth.transitions[0].length) {
-				error('sealevelmodel checkconsistency issue with size of transition vector for ice cap: ' + i + ' name: ' + slm.icecaps[0].miscellaneous.name);
-			}
-		}
-
-		// Check that runfrequency is the same everywhere
-		for (let i = 0; i < slm.icecaps; ++i) {
-			if (slm.icecaps[i].solidearth.settings.runfrequency != slm.earth.solidearth.settings.runfrequency) {
-				error('sealevelmodel checkconsistency error: icecap model ' + slm.icecaps[i].miscellaneous.name + ' should have the same run frequency as earth!');
-			}
-		}
-
-		// Make sure steric_rate is the same everywhere
-		for (let i = 0; i < slm.icecaps.length; ++i) {
-			let md = slm.icecaps[i];
-			if (!isempty(find(md.dsl.steric_rate - slm.earth.dsl.steric_rate[slm.earth.dsl.transitions[i]]))) {
-				error('steric rate on ice cap ' + md.miscellaneous.name + ' is not the same as for the earth');
-			}
-		}
-
-		// Make sure grd is the same everywhere
-		for (let i = 0; i < slm.icecaps.length; ++i) {
-			let md = slm.icecaps[i];
-			if (md.solidearthsettings.isgrd != slm.earth.solidearthsettings.isgrd) {
-				error('isgrd on ice cap ' + md.miscellaneous.name + ' is not the same as for the earth');
-			}
-		}
-
-		// Make sure that there is no solid earth external forcing on the basins
-		for (let i = 0; i < slm.icecaps.length; ++i) {
-			let md = slm.icecaps[i];
-			if (!isempty(md.solidearth.external)) {
-				error('cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');
-			}
-		}
-
-		// Make sure that we have the right grd model for computing out sealevel patterns
-		for (let i = 0; i < slm.icecaps.length; ++i) {
-			let md = slm.icecaps[i];
-			if (md.solidearth.settings.grdmodel) {
-				error('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap ' + i);
-			}
-		}
-	} //}}}
-
-	disp() {//{{{
-		console.log('WARNING: sealevelmodel::disp is not yet implemented');
-	} //}}}
-
-	mergeresults() {//{{{
-		let champs = fieldnames(this.icecaps[0].results.TransientSolution);
-		for (let i = 0; i < this.mergedcaps.length / 2; ++i) {
-			let md = this.mergedcaps[2 * i];
-			let trans = this.mergedcaps[2 * i + 1];
-			//let icecaps = this.icecaps[this.range[2 * i + 2]];
-			for (let j = 0; j < this.icecaps[0].results.TransientSolution) {
-				for (let k = 0; champs.length; ++k) {
-					if (strcmpi(typeof(icecaps[0].results.TransientSolution[j][champs[k]]) == 'double')) {
-						// Vertex or element?
-						if (icecaps[0].results.TransientSolution[j][champs[k]].length == icecaps[0].mesh.numberofvertices) {
-							md.results.TransientSolution[j][champs[k]] == icecaps[0].mesh.numberofvertices;
-
-						}
-					} else {
-
-					}
-				}
-			}
-	} //}}}
-}
Index: sm/trunk/src/m/classes/sealevelmodel.m
===================================================================
--- /issm/trunk/src/m/classes/sealevelmodel.m	(revision 28275)
+++ 	(revision )
@@ -1,556 +1,0 @@
-%SEALEVELMODEL class definition
-%
-%   Usage:
-%      slm = sealevelmodel(varargin)
-%
-%      where varargin is a variable list of options:
-%
-%   Example:
-%      slm = sealevel('icecap',md_greenland,'icecap',md_antarctica,'earth',md_earth);
-
-classdef sealevelmodel < handle
-	properties (SetAccess=public) %Model fields
-		% {{{
-		icecaps          = {}; % list of land/ice models, name should  be change longer term.
-		earth            = 0;  % model for the whole earth
-		basins           = {}; % list of basins, matching icecaps, where shapefile info is held
-		cluster          = 0;
-		miscellaneous    = 0;
-		settings         = 0;
-		private          = 0;
-		mergedcaps       = 0;
-		transitions      = {};
-		eltransitions    = {};
-		planet           = '';
-		%}}}
-	end
-	methods
-		function slm = sealevelmodel(varargin) % {{{
-			slm=setdefaultparameters(slm);
-
-			if nargin==1,
-
-				options=pairoptions(varargin{:});
-
-				%recover all the icecap models:
-				slm.icecaps=getfieldvalues(options,'ice_cap',{});
-				
-				%recover the earth model:
-				slm.earth = getfieldvalue(options,'earth',0);
-
-				%set planet type:
-				slm.planet=getfieldvalue(options,'planet','earth');
-
-			end
-		end
-		%}}}
-		function checkconsistency(slm,solutiontype) % {{{
-
-			%is the coupler turned on?
-			%for i=1:length(slm.icecaps),
-			%	if slm.icecaps{i}.transient.iscoupler==0,
-			%		warning(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
-			%	end
-			%end
-				
-			%if slm.earth.transient.iscoupler==0,
-			%	warning('sealevelmodel.m::checkconsistency: earth model should have the transient coupler option turned on!');
-			%end
-
-			%check that the transition vectors have the right size:
-
-			if slm.earth.mesh.numberofvertices ~= length(slm.earth.solidearth.transfercount)
-				error('sealevelmodel.m::checkconsistency: earth.solidearth.transfercount should be of size earth.mesh.numberofvertices') 
-			end
-
-			%check that the transition vectors have the right size:
-			for i=1:length(slm.icecaps),
-				if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.solidearth.transitions{i}),
-					error(['sealevelmodel.m::checkconsistency: issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
-				end
-			end
-			
-			%check that runfrequency is the same everywhere:
-			for i=1:length(slm.icecaps),
-				if slm.icecaps{i}.solidearth.settings.runfrequency~=slm.earth.solidearth.settings.runfrequency,
-					error(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
-				end
-			end
-
-			%make sure steric_rate is the same everywhere:
-			for i=1:length(slm.icecaps),
-				md= slm.icecaps{i};
-				if ~isempty(find(md.dsl.sea_surface_height_above_geoid - slm.earth.dsl.sea_surface_height_above_geoid(slm.transitions{i}))),
-					error(sprintf('sealevelmodel.m::checkconsistency: steric rate on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
-				end
-			end
-
-			%make sure grd is the same everywhere:
-			for i=1:length(slm.icecaps),
-				md= slm.icecaps{i};
-				if md.solidearth.settings.isgrd~=slm.earth.solidearth.settings.isgrd
-					error(sprintf('sealevelmodel.m::checkconsistency: isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
-				end
-			end
-
-			%make sure that there is no solid earth external forcing on the basins:
-			for i=1:length(slm.icecaps),
-				md= slm.icecaps{i};
-				if ~isempty(md.solidearth.external),
-					error('sealevelmodel.m::checkconsistency: cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');
-				end
-
-			end
-			%make sure that we have the right grd model for computing out sealevel patterns:
-			for i=1:length(slm.icecaps),
-				md= slm.icecaps{i};
-				if md.solidearth.settings.grdmodel~=0
-					error(sprintf('sealevelmodel.m::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));
-				end
-			end
-
-		end
-		%}}}
-		function slm = setdefaultparameters(slm) % {{{
-
-			%initialize subclasses
-			slm.icecaps           = {};
-			slm.earth             = {};
-			slm.miscellaneous     = miscellaneous();
-			slm.settings          = issmsettings();
-			slm.private           = private();
-			slm.cluster           = generic();
-			slm.transitions       = {};
-			slm.eltransitions     = {};
-			slm.planet            = 'earth';
-		end
-		%}}}
-		function disp(self) % {{{
-			disp(sprintf('%19s: %-22s -- %s','icecaps'         ,['[' num2str(length(self.icecaps)) 'x1 ' class(self.icecaps) ']'],'ice caps'));
-			disp(sprintf('%19s: %-22s -- %s','earth'           ,['[1x1 ' class(self.earth) ']'],'earth'));
-			disp(sprintf('%19s: %-22s -- %s','settings'        ,['[1x1 ' class(self.settings) ']'],'settings properties'));
-			disp(sprintf('%19s: %-22s -- %s','cluster'         ,['[1x1 ' class(self.cluster) ']'],'cluster parameters (number of cpus...)'));
-			disp(sprintf('%19s: %-22s -- %s','miscellaneous'   ,['[1x1 ' class(self.miscellaneous) ']'],'miscellaneous fields'));
-		end % }}}
-		function self=mergeresults(self) % {{{
-			champs=fieldnames(self.icecaps{1}.results.TransientSolution);
-			for i=1:length(self.mergedcaps)/2,
-				md=self.mergedcaps{2*(i-1)+1}; trans=self.mergedcaps{2*(i-1)+2};
-				%icecaps=self.icecaps(self.range{2*(i-1)+2});
-				for j=1:length(self.icecaps{1}.results.TransientSolution),
-					for k=1:length(champs),
-						if strcmpi(class(icecaps{1}.results.TransientSolution(j).(champs{k})),'double'),
-							%vertex or element?
-							if length(icecaps{1}.results.TransientSolution(j).(champs{k}))==icecaps{1}.mesh.numberofvertices,
-								md.results.TransientSolution(j).(champs{k})=zeros(md.mesh.numberofvertices,1);
-								for l=1:length(trans),
-									resultcap=icecaps{l}.results.TransientSolution(j).(champs{k});
-									md.results.TransientSolution(j).(champs{k})(trans{l})=resultcap;
-								end
-							else
-								if strcmpi(champs{k},'IceVolume') | strcmpi(champs{k},'IceVolumeAboveFloatation') ,
-									md.results.TransientSolution(j).(champs{k})=0;
-									for l=1:length(trans),
-										resultcap=icecaps{l}.results.TransientSolution(j).(champs{k});
-										md.results.TransientSolution(j).(champs{k})= md.results.TransientSolution(j).(champs{k})+resultcap;
-									end
-								elseif strcmpi(champs{k},'time'),
-									md.results.TransientSolution(j).(champs{k})= icecaps{1}.results.TransientSolution(j).(champs{k});
-								else
-									continue;
-								end
-							end
-						else
-							continue;
-						end
-					end
-				end
-				self.mergedcaps{2*(i-1)+1}=md;
-			end
-		end % }}}
-		function listcaps(self) % {{{
-			for  i=1:length(self.icecaps),
-				disp(sprintf('%i: %s',i,self.icecaps{i}.miscellaneous.name));
-			end
-		end % }}}
-		function n=ncaps(self) % {{{
-			n=length(self.icecaps);
-		end % }}}
-		function list=continents(self) % {{{
-			list={};
-			for  i=1:length(self.basins),
-				list{end+1}=self.basins{i}.continent;
-			end
-			list=unique(list);
-		end % }}}
-		function list=basinsfromcontinent(self,continent) % {{{
-			list={};
-			for  i=1:length(self.icecaps),
-				if strcmpi(self.basins{i}.continent,continent),
-					list{end+1}=self.basins{i}.name;
-				end
-			end
-			list=unique(list);
-		end % }}}
-		function addbasin(self,bas) % {{{
-			if ~strcmpi(class(bas),'basin')
-				error('addbasin method only takes a ''basin'' class object as input');
-			end;
-			self.basins{end+1}=bas;
-		end % }}}
-		function intersections2d(self,varargin) % {{{
-
-			options=pairoptions(varargin{:});
-			force=getfieldvalue(options,'force',0);
-			
-			%initialize, to avoid issues of having more transitions than meshes.
-			self.transitions={};
-			self.eltransitions={};
-
-			%for elements:
-			xe=self.earth.mesh.x(self.earth.mesh.elements)*[1;1;1]/3;
-			ye=self.earth.mesh.y(self.earth.mesh.elements)*[1;1;1]/3;
-			
-			for i=1:length(self.icecaps),
-				mdi=self.icecaps{i};
-		
-				%for elements:
-				xei=mdi.mesh.x(mdi.mesh.elements)*[1;1;1]/3;
-				yei=mdi.mesh.y(mdi.mesh.elements)*[1;1;1]/3;
-		
-				disp(sprintf('Computing vertex intersections for basin %s',self.basins{i}.name));
-			
-				self.transitions{end+1}=meshintersect2d(self.earth.mesh.x,self.earth.mesh.y,mdi.mesh.x,mdi.mesh.y,'force',force);
-
-				self.eltransitions{end+1}=meshintersect2d(xe,ye,xei,yei,'force',force);
-			end
-		end % }}}
-		function intersections(self,varargin) % {{{
-
-			options=pairoptions(varargin{:});
-			force=getfieldvalue(options,'force',0);
-			
-			%initialize, to avoid issues of having more transitions than meshes.
-			self.transitions={};
-			self.eltransitions={};
-			self.earth.solidearth.transfercount=zeros(self.earth.mesh.numberofvertices,1);
-
-			%for elements:
-			xe=self.earth.mesh.x(self.earth.mesh.elements)*[1;1;1]/3;
-			ye=self.earth.mesh.y(self.earth.mesh.elements)*[1;1;1]/3;
-			ze=self.earth.mesh.z(self.earth.mesh.elements)*[1;1;1]/3;
-			
-			for i=1:length(self.icecaps),
-				mdi=self.icecaps{i};
-				mdi=TwoDToThreeD(mdi,self.planet);
-		
-				%for elements:
-				xei=mdi.mesh.x(mdi.mesh.elements)*[1;1;1]/3;
-				yei=mdi.mesh.y(mdi.mesh.elements)*[1;1;1]/3;
-				zei=mdi.mesh.z(mdi.mesh.elements)*[1;1;1]/3;
-		
-				disp(sprintf('Computing vertex intersections for basin %s',self.basins{i}.name));
-			
-				self.transitions{end+1}=meshintersect3d(self.earth.mesh.x,self.earth.mesh.y,self.earth.mesh.z,mdi.mesh.x,mdi.mesh.y,mdi.mesh.z,'force',force);
-
-				self.eltransitions{end+1}=meshintersect3d(xe,ye,ze,xei,yei,zei,'force',force);
-
-				self.earth.solidearth.transfercount(self.transitions{i})=self.earth.solidearth.transfercount(self.transitions{i})+1;
-			end
-
-			for i=1:length(self.icecaps),
-				self.icecaps{i}.solidearth.transfercount=self.earth.solidearth.transfercount(self.transitions{i});
-			end
-		end % }}}
-		function checkintersections(self) % {{{
-			flags=zeros(self.earth.mesh.numberofvertices,1);
-			for i=1:length(self.basins),
-				flags(self.transitions{i})=i;
-			end
-			plotmodel(self.earth,'data',flags,'coastlines','on');
-
-		end % }}}
-		function checkbasinconsistency(self) % {{{
-			for i=1:length(self.basins),
-				self.basins{i}.checkconsistency();
-			end
-
-		end % }}}
-		function baslist=basinindx(self,varargin) % {{{
-			options=pairoptions(varargin{:});
-			continent=getfieldvalue(options,'continent','all');
-			bas=getfieldvalue(options,'basin','all');
-
-			%expand continent list: {{{
-			if iscell(continent),
-				if length(continent)==1,
-					if strcmpi(continent{1},'all'),
-						%need to transform this into a list of continents:
-						continent={};
-						for i=1:length(self.basins),
-							continent{end+1}=self.basins{i}.continent;
-						end
-						continent=unique(continent);
-					else
-						%nothing to do: assume we have a list of continents
-					end
-				else
-					%nothing to do: assume we have a list of continents
-				end
-			else
-				if strcmpi(continent,'all'),
-					%need to transform this into a list of continents:
-					continent={};
-					for i=1:length(self.basins),
-						continent{end+1}=self.basins{i}.continent;
-					end
-					continent=unique(continent);
-				else
-					continent={continent};
-				end
-			end
-			%}}}
-			%expand basins list using the continent list above and the extra bas discriminator: %{{{
-			if iscell(bas),
-				if length(bas)==1,
-					if strcmpi(bas{1},'all'),
-						%need to transform this into a list of basins:
-						baslist=[];
-						for i=1:length(self.basins),
-							if self.basins{i}.iscontinentany(continent{:}),
-								baslist(end+1)=i;
-							end
-						end
-						baslist=unique(baslist);
-					else
-					bas=bas{1};
-					baslist=[];
-					for i=1:length(self.basins),
-						if self.basins{i}.iscontinentany(continent{:}),
-							if self.basins{i}.isnameany(bas),
-								baslist(end+1)=i;
-							end
-						end
-					end
-
-					end
-				else
-					%we have a list of basin names:
-					baslist=[];
-					for i=1:length(bas),
-						basname=bas{i};
-						for j=1:length(self.basins),
-							if self.basins{j}.iscontinentany(continent{:}),
-								if self.basins{j}.isnameany(basname),
-									baslist(end+1)=j;
-								end
-							end
-						end
-						baslist=unique(baslist);
-					end
-				end
-			else
-				if strcmpi(bas,'all'),
-					baslist=[];
-					for i=1:length(self.basins),
-						if self.basins{i}.iscontinentany(continent{:}),
-							baslist(end+1)=i;
-						end
-					end
-					baslist=unique(baslist);
-				else
-					baslist=[];
-					for i=1:length(self.basins),
-						if self.basins{i}.iscontinentany(continent{:}),
-							if self.basins{i}.isnameany(bas),
-								baslist(end+1)=i;
-							end
-						end
-					end
-					baslist=unique(baslist);
-				end
-			end
-			%}}}
-
-		end % }}}
-		function addicecap(self,md) % {{{
-			if ~strcmpi(class(md),'model')
-				error('addicecap method only takes a ''model'' class object as input');
-			end
-			self.icecaps{end+1}=md;
-		end % }}}
-		function basinsplot3d(self,varargin) % {{{
-			for i=1:length(self.basins),
-				self.basins{i}.plot3d(varargin{:});
-			end
-		end % }}}
-		function caticecaps(self,varargin) % {{{
-			
-			%recover options:
-			options=pairoptions(varargin{:});
-			tolerance=getfieldvalue(options,'tolerance',.65);
-			loneedgesdetect=getfieldvalue(options,'loneedgesdetect',0);
-	
-			%make 3D model:
-			models=self.icecaps;
-			for i=1:length(models),
-				models{i}=TwoDToThreeD(models{i},self.planet);
-			end
-			
-			%Plug all models together:
-			md=models{1};
-			for i=2:length(models),
-				md=modelmerge3d(md,models{i},'tolerance',tolerance);
-				md.private.bamg.landmask=[md.private.bamg.landmask;models{i}.private.bamg.landmask];
-			end
-
-			%Look for lone edges if asked for it: {{{
-			if loneedgesdetect,
-				edges=loneedges(md);
-				plotmodel(md,'data',md.mask.land_levelset);
-				hold on;
-				for i=1:length(edges),
-					ind1=edges(i,1);
-					ind2=edges(i,2);
-					%plot([md.mesh.x(ind1),md.mesh.x(ind2)],[md.mesh.y(ind1),md.mesh.y(ind2)],'r*-');
-					plot3([md.mesh.x(ind1),md.mesh.x(ind2)],[md.mesh.y(ind1),md.mesh.y(ind2)],[md.mesh.z(ind1),md.mesh.z(ind2)],'g*-');
-				end
-			end %}}}
-	
-			%Plug into earth:
-			self.earth=md;
-
-			%Create mesh radius:
-			self.earth.mesh.r=planetradius('earth')*ones(md.mesh.numberofvertices,1);
-
-		end % }}}
-		function caticecaps2d(self,varargin) % {{{
-
-			%recover options:
-			options=pairoptions(varargin{:});
-			tolerance=getfieldvalue(options,'tolerance',1e-5);
-			loneedgesdetect=getfieldvalue(options,'loneedgesdetect',0);
-			models=self.icecaps;
-
-			%Plug all models together:
-			md=models{1};
-			for i=2:length(models),
-				md=modelmerge2d(md,models{i},'tolerance',tolerance);
-			end
-
-			%Look for lone edges if asked for it: {{{
-			if loneedgesdetect,
-				edges=loneedges(md);
-				hold on;
-				for i=1:length(edges),
-					ind1=edges(i,1);
-					ind2=edges(i,2);
-					plot([md.mesh.x(ind1),md.mesh.x(ind2)],[md.mesh.y(ind1),md.mesh.y(ind2)],'g*-');
-				end
-			end %}}}
-
-			%Plug into earth:
-			self.earth=md;
-
-		end % }}}
-		function viscousiterations(self) % {{{
-			for  i=1:length(self.icecaps),
-				ic=self.icecaps{i};
-				mvi=ic.results.TransientSolution(1).StressbalanceConvergenceNumSteps;
-				for j=2:length(ic.results.TransientSolution)-1,
-					mvi=max(mvi,ic.results.TransientSolution(j).StressbalanceConvergenceNumSteps);
-				end
-				disp(sprintf('%i, %s: %i',i,self.icecaps{i}.miscellaneous.name,mvi));
-			end
-		end % }}}
-		function maxtimestep(self) % {{{
-			for  i=1:length(self.icecaps),
-				ic=self.icecaps{i};
-				mvi=length(ic.results.TransientSolution);
-				timei=ic.results.TransientSolution(end).time;
-				disp(sprintf('%i, %s: %i/%g',i,self.icecaps{i}.miscellaneous.name,mvi,timei));
-			end
-			mvi=length(self.earth.results.TransientSolution);
-			timei=self.earth.results.TransientSolution(end).time;
-			disp(sprintf('Earth: %i/%g',mvi,timei));
-		end % }}}
-		function transfer(self,string) % {{{
-			%Recover field size in one icecap:
-			eval(['n=size(self.icecaps{1}.' string ',1);']);
-			if n==self.icecaps{1}.mesh.numberofvertices,
-				eval(['self.earth.' string '=zeros(self.earth.mesh.numberofvertices,1);']);
-				for i=1:length(self.icecaps),
-					eval(['self.earth.' string '(self.transitions{' num2str(i) '})=self.icecaps{' num2str(i) '}.' string ';']);
-				end
-			elseif n==(self.icecaps{1}.mesh.numberofvertices+1),
-				%dealing with a transient dataset.
-				%check that all timetags are similar between all icecaps:  %{{{
-				for i=1:length(self.icecaps),
-					eval(['capfieldi= self.icecaps{' num2str(i) '}.' string ';']);
-					for j=(i+1):length(self.icecaps),
-						eval(['capfieldj= self.icecaps{' num2str(j) '}.' string ';']);
-						if ~isequal(capfieldi(end,:),capfieldj(end,:)),
-							error(['Time stamps for ' string ' field are different between icecaps ' num2str(i) ' and ' num2str(j)]);
-						end
-					end
-				end
-				eval(['capfield1= self.icecaps{1}.' string ';']);
-				times=capfield1(end,:);
-				nsteps=length(times);
-				%}}}
-				%initialize:  %{{{
-				eval(['field=zeros(self.earth.mesh.numberofvertices+1,' num2str(nsteps) ');']);
-				eval(['field(end,:)=times;']); %transfer the times only, not the values
-				%}}}
-				%transfer all time fields: {{{
-				for i=1:length(self.icecaps),
-					eval(['capfieldi= self.icecaps{' num2str(i) '}.' string ';']);
-					for j=1:nsteps,
-						eval(['field(self.transitions{' num2str(i) '},' num2str(j) ')=capfieldi(1:end-1,' num2str(j) ');']); %transfer only the values, not the time.
-					end
-				end
-				eval(['self.earth.' string '=field;']); %do not forget to plug the field variable into its final location
-				%}}}
-			elseif n==self.icecaps{1}.mesh.numberofelements,
-				eval(['self.earth.' string '=zeros(self.earth.mesh.numberofelements,1);']);
-				for i=1:length(self.icecaps),
-					eval(['self.earth.' string '(self.eltransitions{' num2str(i) '})=self.icecaps{' num2str(i) '}.' string ';']);
-				end
-			else
-				error('not supported yet');
-			end
-		end % }}}
-		function self=homogeneize(self,noearth) % {{{
-			if nargin==1,
-				noearth=0;
-			end
-			mintimestep=Inf;
-			for  i=1:length(self.icecaps),
-				ic=self.icecaps{i};
-				mintimestep=min(mintimestep, length(ic.results.TransientSolution));
-			end
-			if ~noearth,
-				mintimestep=min(mintimestep, length(self.earth.results.TransientSolution));
-			end
-			
-			for  i=1:length(self.icecaps),
-				ic=self.icecaps{i};
-				ic.results.TransientSolution=ic.results.TransientSolution(1:mintimestep);
-				self.icecaps{i}=ic;
-			end
-			ic=self.earth;
-			if ~noearth,
-				ic.results.TransientSolution=ic.results.TransientSolution(1:mintimestep);
-			end
-			self.earth=ic;
-		end % }}}
-		function self=initializemodels(self) % {{{
-
-			for i=1:length(self.basins),
-				md=model();
-				md.miscellaneous.name=self.basins{i}.name;
-				self.addicecap(md);
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/sealevelmodel.py
===================================================================
--- /issm/trunk/src/m/classes/sealevelmodel.py	(revision 28275)
+++ 	(revision )
@@ -1,501 +1,0 @@
-from copy import deepcopy
-
-import numpy as np
-
-from fielddisplay import fielddisplay
-from generic import generic
-from getsubattr import getsubattr
-from issmsettings import issmsettings
-from meshintersect3d import meshintersect3d
-from miscellaneous import miscellaneous
-from model import model
-from modelmerge3d import modelmerge3d
-from pairoptions import pairoptions
-from planetradius import planetradius
-from plotmodel import plotmodel
-from private import private
-from setsubattr import setsubattr
-from TwoDToThreeD import TwoDToThreeD
-
-
-class sealevelmodel(object):
-    """SEALEVELMODEL class definition
-
-    Usage:
-        slm = sealevelmodel(*args)
-
-        where args is a variable list of options
-
-    Example:
-        slm = sealevelmodel(
-            'icecap', md_greenland,
-            'icecap', md_antarctica,
-            'earth', md_earth
-        )
-    """
-
-    def __init__(self, *args):  # {{{
-        self.icecaps = [] # list of land/ice models; name should be changed later
-        self.earth = 0 # model for the whole earth
-        self.basins = []  # list of basins, matching icecaps, where shapefile info is held
-        self.cluster = 0
-        self.miscellaneous = 0
-        self.settings = 0
-        self.private = 0
-        self.mergedcaps = 0
-        self.transitions = []
-        self.eltransitions = []
-        self.planet = ''
-
-        self.setdefaultparameters()
-
-        if len(args):
-            options = pairoptions(*args)
-
-            # Recover all the icecap models
-            self.icecaps = options.getfieldvalue('ice_cap', [])
-
-            # Recover the earth models
-            self.earth = options.getfieldvalue('earth', 0)
-
-            # Set planet type
-            self.planet = options.getfieldvalue('planet', 'earth')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '{}\n'.format(fielddisplay(self, 'icecaps', 'ice caps'))
-        s += '{}\n'.format(fielddisplay(self, 'earth', 'earth'))
-        s += '{}\n'.format(fielddisplay(self, 'settings', 'settings properties'))
-        s += '{}\n'.format(fielddisplay(self, 'cluster', 'cluster parameters (number of cpus...'))
-        s += '{}\n'.format(fielddisplay(self, 'miscellaneous', 'miscellaneous fields'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.icecaps = []
-        self.earth = []
-        self.cluster = generic()
-        self.miscellaneous = miscellaneous()
-        self.settings = issmsettings()
-        self.private = private()
-        self.transitions = []
-        self.eltransitions = []
-        self.planet = 'earth'
-    # }}}
-
-    @staticmethod
-    def checkconsistency(slm, solutiontype):  # {{{
-        # Is the coupler turned on?
-        #for i in range(len(slm.icecaps)):
-        #    if not slm.icecaps[i].transient.iscoupler:
-        #        print('Warning: sealevelmodel.py::checkconsistency: icecap model {} should have the transient coupler option turned on!'.format(slm.icecaps[i].miscellaneous.name))
-
-        #if not slm.earth.transient.iscoupler:
-        #    print('Warning: sealevelmodel.py::checkconsistency: earth model should have the transient coupler option turned on!')
-
-        # Check that the transition vectors have the right size
-        if slm.earth.mesh.numberofvertices != len(slm.earth.solidearth.transfercount):
-            raise Exception('sealevelmodel.py::checkconsistency: earth.solidearth.transfercount should be of size earth.mesh.numberofvertices')
-
-        # Check that run frequency is the same everywhere
-        for i in range(len(slm.icecaps)):
-            if slm.icecaps[i].solidearth.settings.runfrequency != slm.earth.solidearth.settings.runfrequency:
-                raise Exception('sealevelmodel.py::checkconsistency: icecap model {} should have the same run frequency as earth!'.format(slm.icecaps[i].miscellaneous.name))
-
-        # Make sure steric_rate is the same everywhere
-        for i in range(len(slm.icecaps)):
-            md = slm.icecaps[i]
-            if np.nonzero(md.dsl.sea_surface_height_above_geoid - slm.earth.dsl.sea_surface_height_above_geoid[slm.transitions[i]]) != []:
-                raise Exception('sealevelmodel.py::checkconsistency: steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name))
-
-        # Make sure grd is the same everywhere
-        for i in range(len(slm.icecaps)):
-            md = slm.icecaps[i]
-            if md.solidearth.settings.isgrd != slm.earth.solidearth.settings.isgrd:
-                raise RuntimeError('sealevelmodel.py::checkconsistency: isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name))
-
-        # Make sure that there is no solid earth external forcing on the basins
-        for i in range(len(slm.icecaps)):
-            md = slm.icecaps[i]
-            if md.solidearth.external:
-                raise RuntimeError('sealevelmodel.py::checkconsistency: cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model')
-        # Make sure that we have the right grd model for computing our sealevel patterns
-        for i in range(len(slm.icecaps)):
-            md = slm.icecaps[i]
-            if md.solidearth.settings.grdmodel != 0:
-                raise RuntimeError('sealevelmodel.py::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap {}'.format(i))
-    # }}}
-
-    def mergeresults(self):  # {{{
-        champs = fieldnames(self.icecaps[0].results.TransientSolution)
-        for i in range(len(self.mergedcaps / 2)):
-            md = self.mergedcaps[2 * i]
-            trans = self.mergedcaps[2 * i + 1]
-            #icecaps = self.icecaps[self.range[2 * i + 2]]
-            for j in range(len(self.icecaps[0].results.TransientSolution)):
-                for k in range(len(champs)):
-                    if isinstance(getattr(icecaps[0].results.TransientSolution[j], champs[k]), float):
-                        # Vertex or element?
-                        if len(getattr(icecaps[0].results.TransientSolution[j], champs[k]) == icecaps[0].mesh.numberofvertices):
-                            setattr(md.results.TransientSolution[j], champs[k], np.zeros(md.mesh.numberofvertices))
-                            for l in range(len(trans)):
-                                resultcap = getattr(icecaps[l].results.TransientSolution[j], champs[k])
-                                setattr(getattr(md.results.TransientSolution[j], champs[k]), trans[l], resultcap)
-                        else:
-                            if champs[k] == 'IceVolume' or champs[k] == 'IceVolumeAboveFlotation':
-                                setattr(md.results.TransientSolution, champs[k], 0)
-                                for l in range(len(trans)):
-                                    resultcap = getattr(icecaps[l].results.TransientSolution[j], champs[k])
-                                    setattr(md.results.TransientSolution[j], champs[k], getattr(md.results.TransientSolution[j], champs[k]) + resultcap)
-                            elif champs[k] == 'time':
-                                setattr(md.results.TransientSolution[j], champs[k], getattr(icecaps[0].results.TransientSolution[j], champs[k]))
-                            else:
-                                continue
-                    else:
-                        continue
-            self.mergedcaps[2 * i] = md
-    # }}}
-
-    def listcaps(self):  # {{{
-        for i in range(len(self.icecaps)):
-            print('{}: {}'.format(i, self.icecaps[i].miscellaneous.name))
-    # }}}
-
-    def ncaps(self):  # {{{
-        return len(self.icecaps)
-    # }}}
-
-    def continents(self):  # {{{
-        list = []
-        for i in range(len(self.basins)):
-            list.append = self.basins[i].continent
-        return np.unique(list)
-    # }}}
-
-    def basinsfromcontinent(self, continent):  # {{{
-        list = []
-        for i in range(len(self.icecaps)):
-            if self.basins[i].continent == continent:
-                list.append = self.basins[i].name
-        return np.unique(list)
-    # }}}
-
-    def addbasin(self, bas):  # {{{
-        if bas.__class__.__name__ != 'basin':
-            raise Exception('addbasin method only takes a \'basin\' class object as input')
-        self.basins.append(bas)
-    # }}}
-
-    def intersections2d(self, *args):  # {{{
-        options = pairoptions(*args)
-        force = options.getfieldvalue('force', 0)
-
-        # Initialize, to avoid issues of having more transitions than meshes
-        self.transitions = []
-        self.eltransitions = []
-
-        # For elements
-        xe = np.mean(self.earth.mesh.x[self.earth.mesh.elements - 1], axis=1)
-        ye = np.mean(self.earth.mesh.y[self.earth.mesh.elements - 1], axis=1)
-
-        for i in range(len(self.icecaps)):
-            mdi = self.icecaps[i]
-
-            # For elements
-            xei = np.mean(mdi.mesh.x[mdi.mesh.elements - 1], axis=1)
-            yei = np.mean(mdi.mesh.y[mdi.mesh.elements - 1], axis=1)
-
-            print('Computing vertex intersections for basin {}'.format(self.basins[i].name))
-
-            self.transitions.append(meshintersect2d(self.earth.mesh.x, self.earth.mesh.y, mdi.mesh.x, mdi.mesh.y, 'force', force))
-            self.eltransitions.append(meshintersect2d(xe, ye, xei, yei, 'force', force))
-    # }}}
-
-    def intersections(self, *args):  # {{{
-        options = pairoptions(*args)
-        force = options.getfieldvalue('force', 0)
-
-        # Initialize, to avoid issues of having more transitions than meshes
-        self.transitions = []
-        self.eltransitions = []
-        self.earth.solidearth.transfercount = np.zeros(self.earth.mesh.numberofvertices)
-
-        # For elements
-        xe = np.mean(self.earth.mesh.x[self.earth.mesh.elements - 1], axis=1)
-        ye = np.mean(self.earth.mesh.y[self.earth.mesh.elements - 1], axis=1)
-        ze = np.mean(self.earth.mesh.z[self.earth.mesh.elements - 1], axis=1)
-
-        for i in range(len(self.icecaps)):
-            mdi = self.icecaps[i]
-            mdi = TwoDToThreeD(mdi, self.planet)
-
-            # For elements
-            xei = np.mean(mdi.mesh.x[mdi.mesh.elements - 1], axis=1)
-            yei = np.mean(mdi.mesh.y[mdi.mesh.elements - 1], axis=1)
-            zei = np.mean(mdi.mesh.z[mdi.mesh.elements - 1], axis=1)
-
-            print('Computing vertex intersections for basin {}'.format(self.basins[i].name))
-
-            self.transitions.append(meshintersect3d(self.earth.mesh.x, self.earth.mesh.y, self.earth.mesh.z, mdi.mesh.x, mdi.mesh.y, mdi.mesh.z, 'force', force))
-            self.eltransitions.append(meshintersect3d(xe, ye, ze, xei, yei, zei, 'force', force))
-
-            self.earth.solidearth.transfercount[self.transitions[i]] = self.earth.solidearth.transfercount[self.transitions[i]] + 1
-
-        for i in range(len(self.icecaps)):
-            self.icecaps[i].solidearth.transfercount = self.earth.solidearth.transfercount[self.transitions[i]]
-    # }}}
-
-    def checkintersections(self):  # {{{
-        flags = np.zeros(self.earth.mesh.numberofvertices, 1)
-        for i in range(len(self.basins)):
-            flags[self.transitions[i]] = i
-        plotmodel(self.earth, 'data', flags, 'coastlines', 'on')
-    # }}}
-
-    def checkbasinconsistency(self):  # {{{
-        for i in range(len(self.basins)):
-            self.basins[i].checkconsistency()
-    # }}}
-
-    def basinindx(self, *args):  # {{{
-        options = pairoptions(*args)
-        continent = options.getfieldvalue('continent', 'all')
-        bas = options.getfieldvalue('basin', 'all')
-
-        # Expand continent list #{{{
-        if type(continent) == np.ndarray:
-            if continent.shape[1] == 1:
-                if continent[0] == 'all':
-                    # Need to transform this into a list of continents
-                    continent = []
-                    for i in range(len(self.basins)):
-                        continent.append(self.basins[i].continent)
-                    continent = np.unique(continent)
-                else:
-                    pass  # Nothing to do: assume we have a list of continents
-            else:
-                pass  # Nothing to do: assume we have a list of continents
-        else:
-            if continent == 'all':
-                # Need to transform this into a list of continents
-                continent = []
-                for i in range(len(self.basins)):
-                    continent.append(self.basins[i].continent)
-                continent = np.unique(continent)
-            else:
-                pass  # Nothing to do: assume we have a list of continents
-        # }}}
-
-        # Expand basins list using the continent list above and the extra bas discriminator #{{{
-        if type(bas) == np.ndarray:
-            if bas.shape[1] == 1:
-                if bas[0] == 'all':
-                    # Need to transform this into a list of basins
-                    baslist = []
-                    for i in range(len(self.basins)):
-                        if self.basins[i].iscontinentany(continent):
-                            baslist.append(i)
-                    baslist = np.unique(baslist)
-                else:
-                    bas = bas[0]
-                    baslist = []
-                    for i in range(len(self.basins)):
-                        if self.basins[i].iscontinentany(continent):
-                            if self.basins[i].isnameany(bas):
-                                baslist.append(i)
-            else:
-                # We have a list of basin names
-                baslist = []
-                for i in range(len(bas)):
-                    basname = bas[i]
-                    for j in range(len(self.basins)):
-                        if self.basins[j].iscontinentany(continent):
-                            if self.basins[j].isnameany(basname):
-                                baslist.append(j)
-                    baslist = np.unique(baslist)
-        else:
-            if bas == 'all':
-                baslist = []
-                for i in range(len(self.basins)):
-                    if self.basins[i].iscontinentany(continent):
-                        baslist.append(i)
-                baslist = np.unique(baslist)
-            else:
-                baslist = []
-                for i in range(len(self.basins)):
-                    if self.basins[i].iscontinentany(continent):
-                        if self.basins[i].isnameany(bas):
-                            baslist.append(i)
-                baslist = np.unique(baslist)
-
-        return baslist
-        # }}}
-    # }}}
-
-    def addicecap(self, md):  # {{{
-        if not type(md) == model:
-            raise Exception("addicecap method only takes a 'model' class object as input")
-
-        self.icecaps.append(md)
-    # }}}
-
-    def basinsplot3d(self, *args):  # {{{
-        for i in range(len(self.basins)):
-            self.basins[i].plot3d(*args)
-    # }}}
-
-    def caticecaps(self, *args):  # {{{
-        # Recover options
-        options = pairoptions(*args)
-        tolerance = options.getfieldvalue('tolerance', .65)
-        loneedgesdetect = options.getfieldvalue('loneedgesdetect', 0)
-
-        # Make 3D model
-        models = deepcopy(self.icecaps)
-        for i in range(len(models)):
-            models[i] = TwoDToThreeD(models[i], self.planet)
-
-        # Plug all models together
-        md = models[0]
-        for i in range(1, len(models)):
-            md = modelmerge3d(md, models[i], 'tolerance', tolerance)
-            md.private.bamg.landmask = np.hstack((md.private.bamg.landmask, models[i].private.bamg.landmask))
-
-        # Look for lone edges if asked for it
-        if loneedgesdetect:
-            edges = loneedges(md)
-            # TODO: Reconfigure the following in the process of bringing plotting online
-            plotmodel(md, 'data', md.mask.land_levelset)
-            for i in range(len(edges)):
-                ind1 = edges(i, 1)
-                ind2 = edges(i, 2)
-                plot3([md.mesh.x[ind1], md.mesh.x[ind2]], [md.mesh.y[ind1], md.mesh.y[ind2]], [md.mesh.z[ind1], md.mesh.z[ind2]], 'g*-')
-
-        # Plug into earth
-        self.earth = md
-
-        # Create mesh radius
-        self.earth.mesh.r = planetradius('earth') * np.ones((md.mesh.numberofvertices, ))
-    # }}}
-
-    def caticecaps2d(self, *args):  # {{{
-        # Recover options
-        options = pairoptions(*args)
-        tolerance = options.getfieldvalue('tolerance', 1e-5)
-        loneedgesdetect = options.getfieldvalue('loneedgesdetect', 0)
-        models = self.icecaps
-
-        # Plug all models together
-        md = models[0]
-        for i in range(1, len(models)):
-            md = modelmerge2d(md, models[i], 'tolerance', tolerance)
-
-        # Look for lone edges if asked for it
-        if loneedgesdetect:
-            edges = loneedges(md)
-            # TODO: Reconfigure the following in the process of bringing plotting online
-            plotmodel(md, 'data', md.mask.land_levelset)
-            for i in range(len(edges)):
-                ind1 = edges(i, 1)
-                ind2 = edges(i, 2)
-                plot([md.mesh.x[ind1], md.mesh.x[ind2]], [md.mesh.y[ind1], md.mesh.y[ind2]], 'g*-')
-
-        # Plug into earth
-        self.earth = md
-    # }}}
-
-    def viscousiterations(self):  # {{{
-        for i in range(len(self.icecaps)):
-            ic = self.icecaps[i]
-            mvi = ic.results.TransientSolution[0].StressbalanceConvergenceNumSteps
-            for j in range(1, len(ic.results.TransientSolution) - 1):
-                mvi = np.max(mvi, ic.results.TransientSolution[j].StressbalanceConvergenceNumSteps)
-            print("{}, {}: {}".format(i, self.icecaps[i].miscellaneous.name, mvi))
-    # }}}
-
-    def maxtimestep(self):  # {{{
-        for i in range(len(self.icecaps)):
-            ic = self.icecaps[i]
-            mvi = len(ic.results.TransientSolution)
-            timei = ic.results.TransientSolution[-1].time
-            print("{}, {}: {}/{}".format(i, self.icecaps[i].miscellaneous.name, mvi, timei))
-
-        mvi = len(self.earth.results.TransientSolution)
-        timei = self.earth.results.TransientSolution[-1].time
-        print("Earth: {}/{}", mvi, timei)
-    # }}}
-
-    def transfer(self, string):  # {{{
-        # Recover field size in one icecap
-        n = getsubattr(self.icecaps[0], string).shape[0]
-
-        if n == self.icecaps[0].mesh.numberofvertices:
-            setsubattr(self.earth, string, np.zeros((self.earth.mesh.numberofvertices, ))) # Assign array of zeros to target attribute
-            earth_attr = getsubattr(self.earth, string) # Retrieve reference to target attribute
-            for i in range(len(self.icecaps)):
-                earth_attr[self.transitions[i]] = getsubattr(self.icecaps[i], string)
-        elif n == (self.icecaps[0].mesh.numberofvertices + 1):
-            # Dealing with transient dataset
-            # Check that all timetags are similar between all icecaps #{{{
-            for i in range(len(self.icecaps)):
-                capfieldi = getsubattr(self.icecaps[i], string)
-                for j in range(i + 1, len(self.icecaps)):
-                    capfieldj = getsubattr(self.icecaps[j], string)
-                    if capfieldi[-1, :] != capfieldj[-1, :]:
-                        raise Exception("Time stamps for {} field are different between icecaps {} and {}".format(string, i, j))
-            capfield1 = getsubattr(self.icecaps[0], string)
-            times = capfield1[-1, :]
-            nsteps = len(times)
-            # }}}
-            # Initialize #{{{
-            field = np.zeros((self.earth.mesh.numberofvertices + 1, nsteps))
-            field[-1, :] = times  # Transfer the times only, not the values
-            # }}}
-            # Transfer all the time fields #{{{
-            for i in range(len(self.icecaps)):
-                capfieldi = getsubattr(self.icecaps[i], string)
-                for j in range(nsteps):
-                    field[self.transitions[i], j] = capfieldi[0:-1, j]  # Transfer only the values, not the time
-            setsubattr(self.earth, string, field)  # Do not forget to plug the field variable into its final location
-            # }}}
-        elif n == (self.icecaps[0].mesh.numberofelements):
-            setsubattr(self.earth, string, np.zeros((self.earth.mesh.numberofelements, ))) # Assign array of zeros to target attribute
-            earth_attr = getsubattr(self.earth, string) # Retrieve reference to target attribute
-            for i in range(len(self.icecaps)):
-                earth_attr[self.eltransitions[i]] = getsubattr(self.icecaps[i], string)
-        else:
-            raise Exception('not supported yet')
-    # }}}
-
-    def homogenize(self, noearth=0):  # {{{
-        mintimestep = np.inf
-
-        for i in range(len(self.icecaps)):
-            ic = self.icecaps[i]
-            mintimestep = np.min(mintimestep, len(ic.results.TransientSolution))
-
-        if not noearth:
-            mintimestep = np.min(mintimestep, len(self.earth.results.TransientSolution))
-
-        for i in range(len(self.icecaps)):
-            ic = self.icecaps[i]
-            ic.resuts.TransientSolution = ic.results.TransientSolution[:mintimestep]
-            self.icecaps[i] = ic
-
-        ic = self.earth
-
-        if not noearth:
-            ic.results.TransientSolution = ic.results.TransientSolution[:mintimestep]
-
-        self.earth = ic
-
-        return self
-    # }}}
-
-    def initializemodels(self):  # {{{
-        for i in range(len(self.basins)):
-            md = model()
-            md.miscellaneous.name = self.basins[i].name
-            self.addicecap(md)
-    # }}}
Index: sm/trunk/src/m/classes/slr.js
===================================================================
--- /issm/trunk/src/m/classes/slr.js	(revision 28275)
+++ 	(revision )
@@ -1,199 +1,0 @@
-//SLR class definition
-//
-//   Usage:
-//      slr=slr();
-
-function slr(){
-	//methods
-		this.setdefaultparameters = function (){ //{{{
-
-		//Convergence criterion: absolute, relative and residual
-		this.reltol=0.01; // 1 per cent
-		this.abstol=NaN;  //default
-
-		//maximum of non-linear iterations.
-		this.maxiter=5;
-
-		//computational flags:
-		this.rigid=1;
-		this.elastic=1;
-		this.rotation=0;
-		this.ocean_area_scaling=0;
-
-		//tidal love numbers:
-		this.tide_love_h=0.6149; //degree 2
-		this.tide_love_k=0.3055; //degree 2
-
-		//secular fluid love number:
-		this.fluid_love=0.942;
-
-		//moment of inertia:
-		this.equatorial_moi=8.0077*10^37; // [kg m^2]
-		this.polar_moi		 =8.0345*10^37; // [kg m^2]
-
-		// mean rotational velocity of earth:
-		this.angular_velocity=7.2921*10^-5; // [s^-1]
-
-		//numerical discretization accuracy
-		this.degacc=.01;
-
-		//steric:
-		this.steric_rate=0;
-
-
-		//output default:
-		this.requested_outputs=['default'];
-
-		//transitions should be a cell array of vectors:
-		this.transitions=[];
-
-		}// }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-
-			//Early return
-			if (ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),0) || ArrayAnyEqual(ArrayIsMember('TransientSolution',analyses),0) && !md.transient.isslr) {
-				return;
-			}
-
-			md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements, 1]);
-			md = checkfield(md,'fieldname','slr.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			md = checkfield(md,'fieldname','slr.love_h','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.love_k','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.love_l','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.tide_love_h','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.tide_love_k','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.fluid_love','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.equatorial_moi','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.polar_moi','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.angular_velocity','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.reltol','size',[1, 1]);
-			md = checkfield(md,'fieldname','slr.abstol','size',[1, 1]);
-			md = checkfield(md,'fieldname','slr.steric_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-			md = checkfield(md,'fieldname','slr.maxiter','size',[1, 1],'>=',1);
-			md = checkfield(md,'fieldname','slr.degacc','size',[1, 1],'>=',1e-10);
-			md = checkfield(md,'fieldname','slr.requested_outputs','stringrow',1);
-
-			//check that love numbers are provided at the same level of accuracy:
-			if (this.love_h.length != this.love_k.length || this.love_h.length != this.love_l.length){
-				throw Error('slr error message: love numbers should be provided at the same level of accuracy');
-			}
-
-		} // }}}
-		this.defaultoutputs = function(md){ // {{{
-			return ['Sealevel'];
-		}//}}}
-		this.classname= function(){// {{{
-			return "slr";
-		}// }}}
-		this.disp= function(){// {{{
-
-			console.log(sprintf('   Sealevelrise solution parameters:'));
-
-		fielddisplay(this,'deltathickness','thickness change (main loading of the slr solution core [m]');
-		fielddisplay(this,'sealevel','current sea level (prior to computation) [m]');
-		fielddisplay(this,'reltol','sea level rise relative convergence criterion, (default, NaN: not applied)');
-		fielddisplay(this,'abstol','sea level rise absolute convergence criterion, NaN: not applied');
-		fielddisplay(this,'maxiter','maximum number of nonlinear iterations');
-		fielddisplay(this,'love_h','load Love number for radial displacement');
-		fielddisplay(this,'love_k','load Love number for gravitational potential perturbation');
-		fielddisplay(this,'love_l','load Love number for horizontal displacements');
-		fielddisplay(this,'tide_love_h','tidal love number (degree 2)');
-		fielddisplay(this,'tide_love_k','tidal love number (degree 2)');
-		fielddisplay(this,'fluid_love','secular fluid Love number');
-		fielddisplay(this,'equatorial_moi','mean equatorial moment of inertia [kg m^2]');
-		fielddisplay(this,'polar_moi','polar moment of inertia [kg m^2]');
-		fielddisplay(this,'angular_velocity','mean rotational velocity of earth [per second]');
-		fielddisplay(this,'rigid','rigid earth graviational potential perturbation');
-		fielddisplay(this,'elastic','elastic earth graviational potential perturbation');
-		fielddisplay(this,'rotation','rotational earth potential perturbation');
-		fielddisplay(this,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]');
-		fielddisplay(this,'degacc',"accuracy (default .01 deg) for numerical discretization of the Green's functions");
-		fielddisplay(this,'transitions','indices into parts of the mesh that will be icecaps');
-		fielddisplay(this,'requested_outputs','additional outputs requested');
-		fielddisplay(this,'steric_rate','rate of steric ocean expansion [mm/yr]');
-		} //}}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			console.log('WARNING: NOT MARHSALLING SLR FOR NOW.');
-			return;
-			WriteData(fid,prefix,'object',this,'fieldname','deltathickness','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',this,'fieldname','sealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',this,'fieldname','reltol','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','abstol','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','maxiter','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','love_h','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','love_k','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','love_l','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','tide_love_h','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','tide_love_k','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','fluid_love','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','equatorial_moi','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','polar_moi','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','angular_velocity','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','rigid','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','elastic','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','rotation','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','ocean_area_scaling','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','steric_rate','format','DoubleMat','mattype',1,'scale',1e-3/md.constants.yts);
-			WriteData(fid,prefix,'object',this,'fieldname','degacc','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','transitions','format','MatArray');
-
-			//process requested outputs
-			var outputs = this.requested_outputs;
-			for (var i=0;i<outputs.length;i++){
-				if (outputs[i] == 'default') {
-					outputs.splice(i,1);
-					var newoutputs=this.defaultoutputs(md);
-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-				}
-			}
-			WriteData(fid,prefix,'data',outputs,'name','md.slr.requested_outputs','format','StringArray');
-		}//}}}
-		this.fix=function() { //{{{
-			this.deltathickness=NullFix(this.deltathickness,NaN);
-			this.sealevel=NullFix(this.sealevel,NaN);
-			this.maxiter=NullFix(this.maxiter,NaN);
-			this.reltol=NullFix(this.reltol,NaN);
-			this.abstol=NullFix(this.abstol,NaN);
-			this.love_h=NullFix(this.love_h,NaN);
-			this.love_k=NullFix(this.love_k,NaN);
-			this.love_l=NullFix(this.love_l,NaN);
-			this.tide_love_h=NullFix(this.tide_love_h,NaN);
-			this.tide_love_k=NullFix(this.tide_love_k,NaN);
-			this.fluid_love=NullFix(this.fluid_love,NaN);
-			this.equatorial_moi=NullFix(this.equatorial_moi,NaN);
-			this.polar_moi=NullFix(this.polar_moi,NaN);
-			this.angular_velocity=NullFix(this.angular_velocity,NaN);
-			this.rigid=NullFix(this.rigid,NaN);
-			this.elastic=NullFix(this.elastic,NaN);
-			this.rotation=NullFix(this.rotation,NaN);
-			this.ocean_area_scaling=NullFix(this.ocean_area_scaling,NaN);
-			this.steric_rate=NullFix(this.steric_rate,NaN);
-			this.degacc=NullFix(this.degacc,NaN);
-		}//}}}
-	//properties
-	//{{{
-	this.deltathickness = NaN;
-	this.sealevel       = NaN;
-	this.maxiter        = 0;
-	this.reltol         = 0;
-	this.abstol         = 0;
-	this.love_h         = 0; //provided by PREM model
-	this.love_k         = 0; //idam
-	this.love_l         = 0; //idam
-	this.tide_love_h    = 0;
-	this.tide_love_k    = 0;
-	this.fluid_love	  = 0;
-	this.equatorial_moi	= 0;
-	this.polar_moi			= 0;
-	this.angular_velocity = 0;
-	this.rigid          = 0;
-	this.elastic        = 0;
-	this.rotation       = 0;
-	this.ocean_area_scaling = 0;
-	this.steric_rate    = 0; //rate of ocean expansion from steric effects.
-	this.degacc         = 0;
-	this.requested_outputs = [];
-	this.transitions    = [];
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/slr.py
===================================================================
--- /issm/trunk/src/m/classes/slr.py	(revision 28275)
+++ 	(revision )
@@ -1,210 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from MatlabFuncs import *
-from model import *
-from planetradius import planetradius
-from WriteData import WriteData
-from project3d import project3d
-
-
-class slr(object):
-    """SLR class definition
-
-    Usage:
-        slr = slr()
-    """
-    def __init__(self):  # {{{
-        self.deltathickness = np.nan
-        self.sealevel = np.nan
-        self.spcthickness = np.nan
-        self.maxiter = 0
-        self.reltol = 0
-        self.abstol = 0
-        self.love_h = 0  #provided by PREM model()
-        self.love_k = 0  #ideam
-        self.love_l = 0  #ideam
-        self.tide_love_k = 0  #ideam
-        self.tide_love_h = 0  #ideam
-        self.fluid_love = 0
-        self.equatorial_moi = 0
-        self.polar_moi = 0
-        self.angular_velocity = 0
-        self.rigid = 0
-        self.elastic = 0
-        self.rotation = 0
-        self.ocean_area_scaling = 0
-        self.hydro_rate = 0  #rate of steric expansion from hydrological effects.
-        self.geodetic_run_frequency = 1  #how many time steps we skip before we run the geodetic part of the solver during transient
-        self.geodetic = 0  #compute geodetic SLR? (in addition to steric?)
-        self.degacc = 0
-        self.horiz = 0
-        self.planetradius = planetradius('earth')
-        self.requested_outputs = []
-        self.transitions = []
-
-        #set defaults
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   slr parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'deltathickness', 'thickness change: ice height equivalent [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'sealevel', 'current sea level (prior to computation) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'spcthickness', 'thickness constraints (NaN means no constraint) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'reltol', 'sea level rise relative convergence criterion, (NaN: not applied)'))
-        s += '{}\n'.format(fielddisplay(self, 'abstol', 'sea level rise absolute convergence criterion, (default, NaN: not applied)'))
-        s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of nonlinear iterations'))
-        s += '{}\n'.format(fielddisplay(self, 'love_h', 'load Love number for radial displacement'))
-        s += '{}\n'.format(fielddisplay(self, 'love_k', 'load Love number for gravitational potential perturbation'))
-        s += '{}\n'.format(fielddisplay(self, 'love_l', 'load Love number for horizontal displaements'))
-        s += '{}\n'.format(fielddisplay(self, 'tide_love_k', 'tidal load Love number (degree 2)'))
-        s += '{}\n'.format(fielddisplay(self, 'tide_love_h', 'tidal load Love number (degree 2)'))
-        s += '{}\n'.format(fielddisplay(self, 'fluid_love', 'secular fluid Love number'))
-        s += '{}\n'.format(fielddisplay(self, 'equatorial_moi', 'mean equatorial moment of inertia [kg m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'polar_moi', 'polar moment of inertia [kg m^2]'))
-        s += '{}\n'.format(fielddisplay(self, 'angular_velocity', 'mean rotational velocity of earth [per second]'))
-        s += '{}\n'.format(fielddisplay(self, 'ocean_area_scaling', 'correction for model representation of ocean area [default: No correction]'))
-        s += '{}\n'.format(fielddisplay(self, 'hydro_rate', 'rate of hydrological expansion [mm / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'geodetic', 'compute geodetic SLR? (in addition to steric?) default 0'))
-        s += '{}\n'.format(fielddisplay(self, 'geodetic_run_frequency', 'how many time steps we skip before we run SLR solver during transient (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'rigid', 'rigid earth graviational potential perturbation'))
-        s += '{}\n'.format(fielddisplay(self, 'elastic', 'elastic earth graviational potential perturbation'))
-        s += '{}\n'.format(fielddisplay(self, 'rotation', 'earth rotational potential perturbation'))
-        s += '{}\n'.format(fielddisplay(self, 'degacc', 'accuracy (default .01 deg) for numerical discretization of the Green''s functions'))
-        s += '{}\n'.format(fielddisplay(self, 'transitions', 'indices into parts of the mesh that will be icecaps'))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Convergence criterion: absolute, relative and residual
-        self.reltol = 0.01 # default
-        self.abstol = np.nan # 1 mm of sea level rise
-        # Maximum number of non-linear iterations
-        self.maxiter = 5
-        # Computational flags
-        self.geodetic = 0
-        self.rigid = 1
-        self.elastic = 1
-        self.ocean_area_scaling = 0
-        self.rotation = 1
-        # Tidal love numbers
-        self.tide_love_h = 0.6149 # degree 2
-        self.tide_love_k = 0.3055 # degree 2
-        # Secular fluid love number
-        self.fluid_love = 0.942
-        # Moment of inertia
-        self.equatorial_moi = 8.0077e37  # [kg m^2]
-        self.polar_moi = 8.0345e37  # [kg m^2]
-        # Mean rotational velocity of earth
-        self.angular_velocity = 7.2921e-5  # [s^-1]
-        # Numerical discretization accuracy
-        self.degacc = 0.01
-        # Hydro
-        self.hydro_rate = 0
-        # How many time steps we skip before we run SLR solver during transient
-        self.geodetic_run_frequency = 1
-        # Output default
-        self.requested_outputs = ['default']
-        # Transitions should be a list of vectors
-        self.transitions = []
-        # Horizontal displacement? (not on by default)
-        self.horiz = 0
-        # Earth area
-        self.planetradius = planetradius('earth')
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'SealevelchangeAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.isslr):
-            return md
-
-        md = checkfield(md, 'fieldname', 'slr.deltathickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
-        md = checkfield(md, 'fieldname', 'slr.sealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'slr.spcthickness', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'slr.love_h', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'slr.love_k', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'slr.love_l', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'slr.tide_love_h', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'slr.tide_love_k', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'slr.fluid_love', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'slr.equatorial_moi', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'slr.polar_moi', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'slr.angular_velocity', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'slr.reltol', 'size', [1, 1])
-        md = checkfield(md, 'fieldname', 'slr.abstol', 'size', [1, 1])
-        md = checkfield(md, 'fieldname', 'slr.maxiter', 'size', [1, 1], '>=', 1)
-        md = checkfield(md, 'fieldname', 'slr.geodetic_run_frequency', 'size', [1, 1], '>=', 1)
-        md = checkfield(md, 'fieldname', 'slr.hydro_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        md = checkfield(md, 'fieldname', 'slr.degacc', 'size', [1, 1], '>=', 1e-10)
-        md = checkfield(md, 'fieldname', 'slr.requested_outputs', 'stringrow', 1)
-        md = checkfield(md, 'fieldname', 'slr.horiz', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
-
-        # Check that love numbers are provided at the same level of accuracy:
-        if (size(self.love_h, 0) != size(self.love_k, 0)) or (size(self.love_h, 0) != size(self.love_l, 0)):
-            raise Exception('slr error message: love numbers should be provided at the same level of accuracy')
-
-        # Cross check that whereever we have an ice load, the mask is < 0 on each vertex:
-        pos = np.where(self.deltathickness)
-        maskpos = md.mask.ice_levelset[md.mesh.elements[pos, :]]
-        els = np.where(maskpos > 0)
-        if len(els[0]) > 0:
-            print('Warning: slr.py::checkconsistency: there are elements with ice loads where some vertices are not on the ice!')
-
-        # Check that if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not, a coupler to a planet model is provided
-        if self.geodetic:
-            if md.transient.iscoupler:
-                # We are good
-                pass
-            else:
-                if md.mesh.__class__.__name__ == 'mesh3dsurface':
-                    # We are good
-                    pass
-                else:
-                    raise Exception('model is requesting geodetic computations without being a mesh3dsurface, or being coupled to one!')
-        return md
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['Sealevel']
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deltathickness', 'format', 'DoubleMat', 'mattype', 2)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'mattype', 1, 'format', 'DoubleMat', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_h', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_k', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_l', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'tide_love_h', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'tide_love_k', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'fluid_love', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'equatorial_moi', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'polar_moi', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'angular_velocity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'rigid', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'elastic', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'rotation', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geodetic_run_frequency', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hydro_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1e-3 / md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geodetic', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'planetradius', 'format', 'Double')
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.slr.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/snowpack.m
===================================================================
--- /issm/trunk/src/m/classes/snowpack.m	(revision 28275)
+++ 	(revision )
@@ -1,475 +1,0 @@
-%SNOWPACK class definition
-%
-%   Usage:
-%      snowpack=snowpack();
-
-classdef snowpack
-	properties (SetAccess=public) 
-
-		%first, the configuration fields, by category: 
-		%snowpack:  %{{{
-		snowpack_meas_tss = 0;
-		snowpack_enforce_measured_snow_heights = 0;
-		snowpack_sw_mode = 0;
-		snowpack_incoming_longwave = 0;
-		snowpack_height_of_wind_value = 0;
-		snowpack_height_of_meteo_values = 0;
-		snowpack_neutral = 0;
-		snowpack_roughness_length = 0;
-		snowpack_number_slopes = 0;
-		snowpack_snow_redistribution = 0;
-		snowpack_calculation_step_length = 0;
-		snowpack_change_bc = 0;
-		snowpack_thresh_change_bc = 0;
-		snowpack_snp_soil = 0;
-		snowpack_soil_flux = 0;
-		snowpack_geo_heat = 0;
-		snowpack_canopy = 0;
-		%}}}
-		%snowpackadvanced:  %{{{
-		snowpackadvanced_variant = ''; % use 320 kg m-3 for fixed density
-		snowpackadvanced_hn_density = '';
-		%}}}
-		%general:  %{{{
-		general_pluginpath = '';
-		general_buff_chunk_size = 0;
-		general_buff_before = 0;
-		%}}}
-		%input {{{
-		input_coordsys = '';
-		input_coordparam = '';
-		input_time_zone = 0;
-		input_meteo = '';
-		input_meteopath = '';
-		input_station1 = '';
-		input_snowfile1 = '';
-		%}}}
-		%output {{{
-		output_coordsys = '';
-		output_coordparam = '';
-		output_time_zone = 0;
-		output_meteopath = '';
-		output_experiment = '';
-		output_ts_write = 0;
-		output_ts_start = 0;
-		output_ts_days_between = 0;
-		output_profile = '';
-		output_prof_write = 0;
-		output_prof_start = 0;
-		output_prof_days_between = 0;
-		%}}}
-		%interpolations1d %{{{
-		interpolations1d_window_size = 0; %that is 5 d and 2 h; 1 d = 86400
-		interpolations1d_hnw_resample = '';
-		interpolations1d_hs_resample = '';
-		interpolations1d_tsg_resample = '';
-		interpolations1d_rho_hn_resample = '';
-		interpolations1d_vw_resample = '';
-		interpolations1d_vw_args = '';
-		%}}}
-		%filters {{{
-		filters={'TA::filter1',{'soft',[-20 10]}};
-		filters=NaN;
-		filter_values=NaN;
-
-		filters_ta_filter1 = '';
-		filters_ta_arg1 = NaN;
-		filters_rh_filter1 = '';
-		filters_rh_arg1 = NaN;
-		filters_rh_filter2 = '';
-		filters_rh_arg2 = NaN;
-		filters_iswr_filter1 = '';
-		filters_iswr_arg1 = NaN;
-		filters_iswr_filter2 = '';
-		filters_iswr_arg2 = NaN;
-		filters_rswr_filter1 = '';
-		filters_rswr_arg1 = NaN;
-		filters_rswr_filter2 = '';
-		filters_rswr_arg2 = NaN;
-
-		%for ta between 190 and 280 k;
-		filters_ilwr_filter1 = '';
-		filters_ilwr_arg1 = NaN;
-		filters_ilwr_filter2 = '';
-		filters_ilwr_arg2 = NaN;
-		filters_tss_filter1 = '';
-		filters_tss_arg1 = NaN;
-		filters_tsg_filter1 = '';
-		filters_tsg_arg1 = NaN;
-		filters_vw_filter1 = '';
-		filters_vw_arg1 = NaN;
-		filters_vw_filter2 = '';
-		filters_vw_arg2 = NaN;
-		%}}}
-
-	end
-	methods
-		function self = snowpack(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('snowpack');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-		%snowpack:  %{{{
-		self.snowpack_meas_tss = 1;
-		self.snowpack_enforce_measured_snow_heights = 0;
-		self.snowpack_sw_mode = 0;
-		self.snowpack_incoming_longwave = 1;
-		self.snowpack_height_of_wind_value = 12.;
-		self.snowpack_height_of_meteo_values = 12.;
-		self.snowpack_neutral = 0;
-		self.snowpack_roughness_length = 0.002;
-		self.snowpack_number_slopes = 1;
-		self.snowpack_snow_redistribution = 1;
-		self.snowpack_calculation_step_length = 15.0;
-		self.snowpack_change_bc = 0;
-		self.snowpack_thresh_change_bc = -1.0;
-		self.snowpack_snp_soil = 0;
-		self.snowpack_soil_flux = 0;
-		self.snowpack_geo_heat = 0.06;
-		self.snowpack_canopy = 0;
-		%}}}
-		%snowpackadvanced:  %{{{
-		self.snowpackadvanced_variant = 'ANTARCTICA'; % use 320 kg m-3 for fixed density
-		self.snowpackadvanced_hn_density = 'EVENT';
-		%}}}
-		%general:  %{{{
-		self.general_pluginpath = '/usr/local/lib/meteoio/plugins/';
-		self.general_buff_chunk_size = 90;
-		self.general_buff_before = 1.5;
-		%}}}
-		%input {{{
-		self.input_coordsys = 'ch1903';
-		self.input_coordparam = 'null';
-		self.input_time_zone = 8;
-		self.input_meteo = 'smet';
-		self.input_meteopath = './input';
-		self.input_station1 = 'domec.smet';
-		self.input_snowfile1 = 'domec.sno';
-		%}}}
-		%output {{{
-		self.output_coordsys = 'ch1903';
-		self.output_coordparam = 'null';
-		self.output_time_zone = 8;
-		self.output_meteopath = './output';
-		self.output_experiment = 'smet';
-		self.output_ts_write = 1;
-		self.output_ts_start = 0.0;
-		self.output_ts_days_between = 0.04166667;
-		self.output_profile = 'ascii';
-		self.output_prof_write = 1;
-		self.output_prof_start = 0.0;
-		self.output_prof_days_between = 0.04166667;
-		%}}}
-		%interpolations1d %{{{
-		self.interpolations1d_window_size = 439200; %that is 5 d and 2 h; 1 d = 86400
-		self.interpolations1d_hnw_resample = 'none';
-		self.interpolations1d_hs_resample = 'linear';
-		self.interpolations1d_tsg_resample = 'linear';
-		self.interpolations1d_rho_hn_resample = 'none';
-		self.interpolations1d_vw_resample = 'nearest_neighbour';
-		self.interpolations1d_vw_args = 'extrapolate';
-		%}}}
-		%filters {{{
-		self.filters_ta_filter1 = 'min_max';
-		self.filters_ta_arg1 = [190 280];
-		self.filters_rh_filter1 = 'min_max';
-		self.filters_rh_arg1 = [0.01 1.2];
-		self.filters_rh_filter2 = 'min_max';
-		self.filters_rh_arg2 = {'soft' 0.01 1.0};
-		self.filters_iswr_filter1 = 'min_max';
-		self.filters_iswr_arg1 = [-10 1500];
-		self.filters_iswr_filter2 = 'min_max';
-		self.filters_iswr_arg2 = {'soft' 0 1500};
-		self.filters_rswr_filter1 = 'min_max';
-		self.filters_rswr_arg1 = [-10 1500];
-		self.filters_rswr_filter2 = 'min_max';
-		self.filters_rswr_arg2 = {'soft' 0 1500};
-
-		%for ta between 190 and 280 k;
-		self.filters_ilwr_filter1 = 'min_max';
-		self.filters_ilwr_arg1 = [30 355];
-		self.filters_ilwr_filter2 = 'min_max';
-		self.filters_ilwr_arg2 = {'soft' 35 350};
-		self.filters_tss_filter1 = 'min_max';
-		self.filters_tss_arg1 = [180 275];
-		self.filters_tsg_filter1 = 'min_max';
-		self.filters_tsg_arg1 = [200 275];
-		self.filters_vw_filter1 = 'min_max';
-		self.filters_vw_arg1 = [-2 70];
-		self.filters_vw_filter2 = 'min_max';
-		self.filters_vw_arg2 = {'soft' 0 50};
-		%}}}
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			%snowpack:  %{{{
-			md=checkfield(md,'fieldname','snowpack.snowpack_meas_tss','values',[0 1]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_enforce_measured_snow_heights','values',[0 1]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_sw_mode','values',[0 1 2]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_incoming_longwave','values',[0 1]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_height_of_wind_value','>=',0);
-			md=checkfield(md,'fieldname','snowpack.snowpack_height_of_meteo_values','>=',0);
-			md=checkfield(md,'fieldname','snowpack.snowpack_neutral','values',[-1 0 1]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_roughness_length','>=',0);
-			md=checkfield(md,'fieldname','snowpack.snowpack_number_slopes','values',[1 3 5 9]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_snow_redistribution','values',[0 1]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_calculation_step_length','>',0);
-			md=checkfield(md,'fieldname','snowpack.snowpack_change_bc','values',[0 1]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_thresh_change_bc','<=',0);
-			md=checkfield(md,'fieldname','snowpack.snowpack_snp_soil','values',[0 1]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_soil_flux','values',[0 1]);
-			md=checkfield(md,'fieldname','snowpack.snowpack_geo_heat','>=',0);
-			md=checkfield(md,'fieldname','snowpack.snowpack_canopy','values',[0 1]);
-			%}}}
-			%snowpackadvanced:  %{{{
-			md=checkfield(md,'fieldname','snowpack.snowpackadvanced_variant','values',{'JAPAN','DEFAULT','ANTARCTICA'});
-			md=checkfield(md,'fieldname','snowpack.snowpackadvanced_hn_density','values',{'PARAMETERIZED','EVENT','MEASURED'});
-			%}}}
-			%general:  %{{{
-			md=checkfield(md,'fieldname','snowpack.general_buff_chunk_size','>',0);
-			md=checkfield(md,'fieldname','snowpack.general_buff_before','>',0);
-			%}}}
-			%input {{{
-			md=checkfield(md,'fieldname','snowpack.input_coordsys','values',{'CH1903','UTM','UPS','PROJ4','LOCAL'});
-			md=checkfield(md,'fieldname','snowpack.input_coordparam','values','null');
-			md=checkfield(md,'fieldname','snowpack.input_time_zone','>',-12,'<',12);
-			md=checkfield(md,'fieldname','snowpack.input_meteo','values',{'BORMA','COSMO','GEOTOP','GRIB','GSN','IMIS','SMET','SNOWPACK'});
-			md=checkfield(md,'fieldname','snowpack.input_meteopath','empty',1);
-			md=checkfield(md,'fieldname','snowpack.input_station1 ','empty',1);
-			md=checkfield(md,'fieldname','snowpack.input_snowfile1','empty',1);
-			%}}}
-			%output {{{
-			md=checkfield(md,'fieldname','snowpack.output_coordsys','values',{'CH1903','UTM','UPS','PROJ4','LOCAL'});
-			md=checkfield(md,'fieldname','snowpack.output_coordparam','values','null');
-			md=checkfield(md,'fieldname','snowpack.output_time_zone','>',-12,'<',12);
-			md=checkfield(md,'fieldname','snowpack.output_meteopath','empty',1);
-			md=checkfield(md,'fieldname','snowpack.output_experiment','empty',1);
-			md=checkfield(md,'fieldname','snowpack.output_ts_write','values',[0 1]);
-			md=checkfield(md,'fieldname','snowpack.output_ts_start','>=',0);
-			md=checkfield(md,'fieldname','snowpack.output_ts_days_between','>=',0);
-			md=checkfield(md,'fieldname','snowpack.output_profile','values',{'ASCII','IMIS','ASCII IMIS'});
-			md=checkfield(md,'fieldname','snowpack.output_prof_write','values',[0 1]);
-			md=checkfield(md,'fieldname','snowpack.output_prof_start','>=',0);
-			md=checkfield(md,'fieldname','snowpack.output_prof_days_between','>=',0);
-			%}}}
-			%interpolations1d %{{{
-			md=checkfield(md,'fieldname','snowpack.interpolations1d_window_size','>',0);
-			md=checkfield(md,'fieldname','snowpack.interpolations1d_hnw_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
-			md=checkfield(md,'fieldname','snowpack.interpolations1d_hs_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
-			md=checkfield(md,'fieldname','snowpack.interpolations1d_tsg_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
-			md=checkfield(md,'fieldname','snowpack.interpolations1d_rho_hn_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
-			md=checkfield(md,'fieldname','snowpack.interpolations1d_vw_resample','values',{'NONE','NEAREST_NEIGHBOUR','ACCUMULATE','LINEAR'});
-			md=checkfield(md,'fieldname','snowpack.interpolations1d_vw_args','values',{'EXTRAPOLATE'});
-			%}}}
-			%filters {{{
-			filter_values={'MIN_MAX','RATE_FILTER1','RATE_FILTER2','UNHEATED_RAIN_GAUGE_FILTER','WMO_UNDERCATCH_FILTER','WMO_UNDERCATCH_FILTER-SIMPLIFIED','UNVENTILLATED_TEMPERATURE_SENSOR','ADD_AN_OFFSET'};
-
-			md=checkfield(md,'fieldname','snowpack.filters_ta_filter1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_ta_filter1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_ta_filter1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_ta_arg1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_ta_arg1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_ta_arg1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_rh_filter1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_rh_filter1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_rh_filter1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_rh_arg1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_rh_arg1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_rh_arg1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_rh_filter2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_rh_filter2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_rh_filter2','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_rh_arg2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_rh_arg2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_rh_arg2','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_iswr_filter1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_iswr_filter1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_iswr_filter1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_iswr_arg1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_iswr_arg1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_iswr_arg1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_iswr_filter2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_iswr_filter2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_iswr_filter2','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_iswr_arg2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_iswr_arg2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_iswr_arg2','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_rswr_filter1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_rswr_filter1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_rswr_filter1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_rswr_arg1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_rswr_arg1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_rswr_arg1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_rswr_filter2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_rswr_filter2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_rswr_filter2','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_rswr_arg2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_rswr_arg2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_rswr_arg2','size',[1 NaN]); end
-
-			%for ta between 190 and 280 k;
-			md=checkfield(md,'fieldname','snowpack.filters_ilwr_filter1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_ilwr_filter1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_ilwr_filter1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_ilwr_arg1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_ilwr_arg1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_ilwr_arg1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_ilwr_filter2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_ilwr_filter2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_ilwr_filter2','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_ilwr_arg2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_ilwr_arg2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_ilwr_arg2','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_tss_filter1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_tss_filter1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_tss_filter1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_tss_arg1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_tss_arg1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_tss_arg1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_tsg_filter1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_tsg_filter1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_tsg_filter1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_tsg_arg1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_tsg_arg1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_tsg_arg1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_vw_filter1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_vw_filter1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_vw_filter1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_vw_arg1','values',{filter_values});
-			if strcmpi(md.snowpack.filters_vw_arg1,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_vw_arg1','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_vw_filter2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_vw_filter2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_vw_filter2','size',[1 NaN]); end
-			md=checkfield(md,'fieldname','snowpack.filters_vw_arg2','values',{filter_values});
-			if strcmpi(md.snowpack.filters_vw_arg2,'MIN_MAX'), md=checkfield(md,'fieldname','snowpack.filters_vw_arg2','size',[1 NaN]); end
-
-			%}}}
-		end % }}}
-		function disp(self) % {{{
-
-			disp(sprintf('   Snowpack solution parameters:'));
-			disp(sprintf('\n	%s','Snowpack parameters:')); % {{{
-			fielddisplay(self,'snowpack_meas_tss',{'A measured surface temperature is available and can be reliably ','used for various consistency tests (it needs to be set to true if enabling CHANGE_BC) (0 or 1)'});
-			fielddisplay(self,'snowpack_enforce_measured_snow_heights','Input mode by which a measurement of snow depth is used to drive the snow cover mass balance (0 or 1)');
-			fielddisplay(self,'snowpack_sw_mode',{'Define the shortwave radiation input:',...
-				'0 Incoming shortwave radiation is measured and albedo estimated by the model',...
-				'1 Reflected shortwave radiation is available as input and albedo is estimated by the model (IMIS standard)',...
-				'2 Incoming and reflected shortwave radiation are both measured and the albedo is estimated from both measurements subject to plausibility checks.'});
-			fielddisplay(self,'snowpack_incoming_longwave','Use the provided incoming long wave on the virtual slopes? (0 or 1)');
-			fielddisplay(self,'snowpack_height_of_wind_value',{'The instrument height (or model layer height) for wind input data; note that height ',...
-				'is above ground for a standard SNOWPACK application but above surface (snow or ground) for Alpine3D applications '});
-			fielddisplay(self,'snowpack_height_of_meteo_values',{'The instrument height (or model layer height) for meteorological input data except for wind,',...
-				'which may be at a different height; note that height is above ground for a standard SNOWPACK ',...
-				'application but above surface (snow or ground) for Alpine3D applications. '});
-			fielddisplay(self,'snowpack_neutral',{'Select the atmospheric stability correction model:',...
-				'-1 use a simplified Richardson number stability correction',...
-				'0 assume standard Monin-Obukhov bulk formulation for surface exchange iteration with Paulson, Stearns and Weidner (can be used with BC_CHANGE=0)',...
-				'1 force Monin-Obukhov formulation to assume neutral conditions regardless of the actual stratification; it has been shown to work well in ',...
-				'complex terrain settings. It should be used with BC_CHANGE=1, i.e., Dirichlet /* but also is recommended with Neumann b.c., i.e., BC_CHANGE=0.'});
-			fielddisplay(self,'snowpack_roughness_length',{'Aerodynamic roughness length as a parameter for the Monin-Obukhov bulk formulation;',...
-				'A typical value for complex terrain is 0.01 m and for snow covered flat sites 0.001 m. '});
-			fielddisplay(self,'snowpack_number_slopes',{'Based on meteorological input from a (flat field) automatic station or numerical weather model,',...
-				'up to 8 expositions can be calculated in addition to the flat field if the corresponding *.sno files are provided. For example,',...
-				'if you provide a flat field *.snow file (mandatory), which is named KLO3.sno and you want 4 slopes to be calculated the corresponding',...
-				'slope files should be named KLO21.sno, ...,KLO24.sno '});
-			fielddisplay(self,'snowpack_snow_redistribution',{'Specifies if redistribution of snow is allowed from (upwind) expositions to lee slopes.',...
-				'In case just the flat field is calculated, snow erosion is enabled but only for "ENFORCE_MEASURED_SNOW_HEIGHTS".'});
-				fielddisplay(self,'snowpack_calculation_step_length',{'Internal time step (in minutes) used for model simulation. Please note that this MUST ',...
-				'be the same as HNW::accumulate (the latter being in seconds) if re-acumulating precipitation, otherwise it would lead to wrong results.'});
-			fielddisplay(self,'snowpack_change_bc',{'Use measured surface temperature as Dirichlet temperature BC for sub-freezing snowpacks and switch to ',...
-			'Neumann only for melting snowpacks. If set to false, assumes Neumann boundary conditions.'});
-			fielddisplay(self,'snowpack_thresh_change_bc','Threshold value (small number below freezing), which switches from Dirichlet to Neumann BCs if CHANGE_BC is selected');
-			fielddisplay(self,'snowpack_snp_soil','Soil layers as defined by the *.sno files are included in the simulation');
-			fielddisplay(self,'snowpack_soil_flux','Assume that the lower temperature boundary condition is given by GEO_HEAT (Neumann) and not by a measured temperature');
-			fielddisplay(self,'snowpack_geo_heat','Constant geothermal heat flux at great) depth W m-2): Lower flux boundary condition for temperature equation if BC is Neumann');
-			fielddisplay(self,'snowpack_canopy','Switch to tell the model that canopy is present (note that Canopy parameters should then be provided in the *.sno file)');
-			% }}}
-			disp(sprintf('\n	%s','Snowpackadvanced parameters:')); % {{{
-			fielddisplay(self,'snowpackadvanced_variant','variant selection (includes a choice of specific models, DEFAULT, ANTARCTICA and JAPAN )'); % use 320 kg m-3 for fixed density
-			fielddisplay(self,'snowpackadvanced_hn_density',{'Fixed value to be used as new snow density if a constant density model is chosen, otherwise the choices are "PARAMETERIZED" "EVENT" "MEASURED"'});
-			% }}}
-			disp(sprintf('\n	%s','General parameters:')); % {{{
-			fielddisplay(self,'general_pluginpath','');
-			fielddisplay(self,'general_buff_chunk_size','Size in days of a chunk of data to read at once.');
-			fielddisplay(self,'general_buff_before','Alternate way of buffer centering: When rebuffering, the new date will be located BUFF_BEFORE days from the beginning of the buffer (therefore, it takes a value in days). ');
-			% }}}
-			disp(sprintf('\n	%s','Input  parameter:')); % {{{
-			fielddisplay(self,'input_coordsys','coordinates in the Swiss Grid (http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf). One of CH1903,UTM,UPS,PROJ4 or LOCAL');
-			fielddisplay(self,'input_coordparam',' ');
-			fielddisplay(self,'input_time_zone',' ');
-			fielddisplay(self,'input_meteo','plugin for METEO data (one of BORMA,COSMO,GEOTOP,GRIB,GS,IMIS,SMET,SNOWPACK');
-			fielddisplay(self,'input_meteopath','string containing the path to the xml files.');
-			fielddisplay(self,'input_station1','Meteorology file for station number #');
-			fielddisplay(self,'input_snowfile1','File name for the initial snow profile for station number #');
-			% }}}
-			disp(sprintf('\n	%s','Output parameters:')); % {{{
-			fielddisplay(self,'output_coordsys','Coordinates in the Swiss Grid http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf. One of CH1903,UTM,UPS,PROJ4 or LOCAL ');
-			fielddisplay(self,'output_coordparam','');
-			fielddisplay(self,'output_time_zone','');
-			fielddisplay(self,'output_meteopath','Path to the outputs (this path MUST exist, it won''t be created)');
-			fielddisplay(self,'output_experiment','Option to give an additional simulation specific output name to the run in addition to "STATION_NAME"');
-			fielddisplay(self,'output_ts_write','Write meteo data out? (0 or 1)');
-			fielddisplay(self,'output_ts_start','When to start writing meteo data out (offset, in days)');
-			fielddisplay(self,'output_ts_days_between','How often to write meteo data out (in days: 3 hours=.125, 1 hour=4.1666e-2)');
-			fielddisplay(self,'output_profile','How to write the profiles (default: ASCII, choice is ASCII,IMIS or ASCII IMIS)');
-)');
-			fielddisplay(self,'output_prof_write','Write profile data out? (0 or 1) ');
-			fielddisplay(self,'output_prof_start','When to start writing profile data out (offset, in days)');
-			fielddisplay(self,'output_prof_days_between','How often to write profile data out (in days: 3 hours=.125, 1 hour=4.1666e-2)');
-			% }}}
-			disp(sprintf('\n	%s','Interpolations1d parameters:')); % {{{
-			fielddisplay(self,'interpolations1d_window_size','Affects resampling: expresses (in seconds) how far a valid point can be searched for when re-interpolating a missing value'); 
-			fielddisplay(self,'interpolations1d_hnw_resample','NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR');
- ');
-			fielddisplay(self,'interpolations1d_hs_resample','Mean average processing. The mean average filter returns the mean value of all values within a user given time window. (NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR)');
-			fielddisplay(self,'interpolations1d_tsg_resample','Mean average processing. The mean average filter returns the mean value of all values within a user given time window.(NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR)');
-			fielddisplay(self,'interpolations1d_rho_hn_resample','(NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR)');
-			fielddisplay(self,'interpolations1d_vw_resample','(NONE, NEAREST_NEIGHBOUR, ACCUMULATE or LINEAR)');
-			fielddisplay(self,'interpolations1d_vw_args','default nothing, otherwise, ''extrapolcate''');
-			% }}}
-			disp(sprintf('\n	%s','Filters parameters:')); % {{{
-			fielddisplay(self,'filters_ta_filter1',' ');
-			fielddisplay(self,'filters_ta_arg1','');
-			fielddisplay(self,'filters_rh_filter1',' ');
-			fielddisplay(self,'filters_rh_arg1','');
-			fielddisplay(self,'filters_rh_filter2',' ');
-			fielddisplay(self,'filters_rh_arg2','');
-			fielddisplay(self,'filters_iswr_filter1',' ');
-			fielddisplay(self,'filters_iswr_arg1','');
-			fielddisplay(self,'filters_iswr_filter2',' ');
-			fielddisplay(self,'filters_iswr_arg2','');
-			fielddisplay(self,'filters_rswr_filter1',' ');
-			fielddisplay(self,'filters_rswr_arg1','');
-			fielddisplay(self,'filters_rswr_filter2',' ');
-			fielddisplay(self,'filters_rswr_arg2','');
-
-			%for ta between 190 and 280 k;
-			fielddisplay(self,'filters_ilwr_filter1',' ');
-			fielddisplay(self,'filters_ilwr_arg1','');
-			fielddisplay(self,'filters_ilwr_filter2',' ');
-			fielddisplay(self,'filters_ilwr_arg2','');
-			fielddisplay(self,'filters_tss_filter1',' ');
-			fielddisplay(self,'filters_tss_arg1','');
-			fielddisplay(self,'filters_tsg_filter1',' ');
-			fielddisplay(self,'filters_tsg_arg1','');
-			fielddisplay(self,'filters_vw_filter1',' ');
-			fielddisplay(self,'filters_vw_arg1','');
-			fielddisplay(self,'filters_vw_filter2',' ');
-			fielddisplay(self,'filters_vw_arg2','');
-			% }}}
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','restol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','reltol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','abstol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','isnewton','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','FSreconditioning','format','Double');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','maxiter','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','shelf_dampening','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','vertex_pairing','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','penalty_factor','format','Double');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','rift_penalty_lock','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','rift_penalty_threshold','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','referential','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','requested_outputs','format','StringArray');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/solidearth.js
===================================================================
--- /issm/trunk/src/m/classes/solidearth.js	(revision 28275)
+++ 	(revision )
@@ -1,135 +1,0 @@
-class solidearth {//{{{
-	/**
-	 * SOLIDEARTH class definition
-	 *
-	 * Usage:
-	 *     solidearth = solidearth();
-	 *     solidearth = solidearth('earth');
-	 */
-	constructor() {//{{{
-		this.settings = new solidearthsettings();
-		this.external = null;
-		this.lovenumbers = new lovenumbers();
-		this.rotational = new rotational();
-		this.planetradius = planetradius('earth');
-		this.requested_outputs = [];
-		this.transitions = [];
-		this.partitionice = [];
-		this.partitionhydro = [];
-		this.partitionocean = [];
-
-		let nargs = arguments.length;
-		if (nargs == 0) {
-			this.setdefaultparameters('earth');
-		} else if (nargs == 1) {
-			this.setdefaultparameters(arguments[0]);
-		} else {
-			error('solidearth constructor error message: zero or one argument only!');
-		}
-	} //}}}
-
-	disp() {//{{{
-		console.log('WARNING: solidearth::disp is not yet implemented');
-	} //}}}
-
-	setdefaultparameters(planet) {//{{{
-		// Output default
-		this.requested_outputs = ['default'];
-
-		// Transitions should be an array
-		this.transitions = [];
-
-		// No partitions requested for barystatic contribution
-		this.partitionice = [];
-		this.partitionhydro = [];
-		this.partitionocean = [];
-
-		// No external solutions by default
-		this.external = null;
-
-		// Planet radius
-		this.planetradius = planetradius(planet);
-	} //}}}
-
-	checkconsistency(md, solution, analyses) {//{{{
-		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
-			return md;
-		}
-
-		md = checkfield(md, 'fieldname', 'solidearth.requested_outputs', 'stringrow', 1);
-
-		this.settings.checkconsistency(md, solution, analyses);
-		this.lovenumbers.checkconsistency(md, solution, analyses);
-		this.rotational.checkconsistency(md, solution, analyses);
-
-		if (this.external != null) {
-			if (typeof(this.external) != 'solidearthsolution') {
-				error('solidearth consistency check: external field should be a solidearthsolution');
-			}
-		}
-
-		return md;
-	} //}}}
-
-	defaultoutputs(md) {//{{{
-		return ['Sealevel'];
-	} //}}}
-
-	marshall(md, prefix, fid) {//{{{
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'planetradius', 'format', 'Double');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'transitions', 'format', 'MatArray');
-
-		let npartice = 0;
-		if (this.partitionice.length) {
-			npartice = max(this.partitionice) + 2;
-		}
-
-		let nparthydro = 0;
-		if (this.partitionhydro.length) {
-			nparthydro = max(this.partitionhydro) + 2;
-		}
-
-		let npartocean = 0;
-		if (this.partitionocean.length) {
-			npartocean = max(this.partitionocean) + 2;
-		}
-
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'partitionice', 'mattype', 1, 'format', 'DoubleMat');
-		WriteData(fid, prefix, 'data', npartice, 'format', 'Integer', 'name', 'md.solidearth.npartice');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'partitionhydro', 'mattype', 1, 'format', 'DoubleMat');
-		WriteData(fid, prefix, 'data', nparthydro, 'format', 'Integer', 'name', 'md.solidearth.nparthydro');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'partitionocean', 'mattype', 1, 'format', 'DoubleMat');
-		WriteData(fid, prefix, 'data', npartocean, 'format', 'Integer', 'name', 'md.solidearth.npartocean');
-
-		this.settings.marshall(md, prefix, fid);
-		this.lovenumbers.marshall(md, prefix, fid);
-		this.rotational.marshall(md, prefix, fid);
-
-		if (this.external != null) {
-			WriteData(fid, prefix, 'data', 1, 'format', 'Integer', 'name', 'md.solidearth.isexternal');
-			this.external.marshall(md, prefix, fid);
-		} else {
-			WriteData(fid, prefix, 'data', 0, 'format', 'Integer', 'name', 'md.solidearth.isexternal');
-		}
-
-		// Process requested outputs
-		let outputs = this.requested_outputs;
-		let pos = find(ismember(outputs, 'default'));
-		if (pos.length) {
-			/*
-			NOTE: In order to handle case where user has added 'default' more 
-			than once to this.requested_outputs, need to remove elements by 
-			index in reverse order.
-			*/
-			for (let i = (pos.length - 1); i >= 0; --i) {
-				outputs.splice(pos[i], 1);
-			}
-
-			outputs.push(this.defaultoutputs(md));
-		}
-		WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray');
-	} //}}}
-
-	extrude(md) {//{{{
-	} //}}}
-} //}}}
Index: sm/trunk/src/m/classes/solidearth.m
===================================================================
--- /issm/trunk/src/m/classes/solidearth.m	(revision 28275)
+++ 	(revision )
@@ -1,175 +1,0 @@
-%SOLIDEARTH class definition
-%
-%   Usage:
-%      solidearth=solidearth();
-%      solidearth=solidearth('earth');
-
-classdef solidearth
-	properties (SetAccess=public) 
-		settings          = solidearthsettings();
-		external          = [];
-		lovenumbers       = lovenumbers();
-		rotational        = rotational();
-		planetradius      = planetradius('earth');
-		requested_outputs = {};
-		transitions       = {};
-		transfercount     = [];
-		partitionice      = [];
-		partitionhydro    = [];
-		partitionocean    = [];
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. If the input is a struct it is an old version of this class and
-			% old fields must be recovered (make sure they are in the deprecated
-			% model properties)
-
-			if isstruct(self)
-				% 2021, Jan 10
-				if isfield(self,'sealevel')
-					self.initialsealevel = self.sealevel;
-				end
-				self = structtoobj(solidearth(),self);
-
-			end
-		end% }}}
-	end
-	methods
-		function self = solidearth(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self,'earth');
-				case 1
-					self=setdefaultparameters(self,varargin{:});
-				otherwise
-					error('solidearth constructor error message: zero or one argument only!'); 
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   solidearth inputs, forcings and settings:'));
-
-			fielddisplay(self,'planetradius','planet radius [m]');
-			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
-			fielddisplay(self,'transfercount','number of icecaps vertices are part of');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-			fielddisplay(self,'partitionice','ice partition vector for barystatic contribution');
-			fielddisplay(self,'partitionhydro','hydro partition vector for barystatic contribution');
-			fielddisplay(self,'partitionocean','ocean partition vector for barystatic contribution');
-			if isempty(self.external), fielddisplay(self,'external','external solution, of the type solidearthsolution'); end
-			self.settings.disp();
-			self.lovenumbers.disp();
-			self.rotational.disp();
-			if ~isempty(self.external),
-				self.external.disp();
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self,planet) % {{{
-
-			%output default:
-			self.requested_outputs={'default'};
-
-			%transitions should be a cell array of vectors:
-			self.transitions={};
-			self.transfercount=[0];
-
-			%no partitions requested for barystatic contribution:
-			self.partitionice=[];
-			self.partitionhydro=[];
-			self.partitionocean=[];
-
-			%no external solutions by default:
-			self.external=[];
-
-			%planet radius
-			self.planetradius= planetradius(planet);
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
-				return; 
-			end
-
-			md = checkfield(md,'fieldname','solidearth.requested_outputs','stringrow',1);
-
-			self.settings.checkconsistency(md,solution,analyses);
-			self.lovenumbers.checkconsistency(md,solution,analyses);
-			self.rotational.checkconsistency(md,solution,analyses);
-			if ~isempty(self.external),
-				if ~isa(self.external,'solidearthsolution'),
-					error('solidearth consistency check: external field should be a solidearthsolution');
-				end
-				self.external.checkconsistency(md,solution,analyses);
-			end
-
-		end % }}}
-		function list=defaultoutputs(self,md) % {{{
-			list = {'Sealevel'};
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'object',self,'fieldname','planetradius','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray');
-			WriteData(fid,prefix,'object',self,'fieldname','transfercount','format','DoubleMat','mattype',1);
-
-			if ~isempty(self.partitionice),
-				npartice=max(self.partitionice)+2;
-			else
-				npartice=0;
-			end
-
-			if ~isempty(self.partitionhydro),
-				nparthydro=max(self.partitionhydro)+2;
-			else
-				nparthydro=0;
-			end
-			if ~isempty(self.partitionocean),
-				npartocean=max(self.partitionocean)+2;
-			else
-				npartocean=0;
-			end
-
-			WriteData(fid,prefix,'object',self,'fieldname','partitionice','mattype',1,'format','DoubleMat');
-			WriteData(fid,prefix,'data',npartice,'format','Integer','name','md.solidearth.npartice');
-			WriteData(fid,prefix,'object',self,'fieldname','partitionhydro','mattype',1,'format','DoubleMat');
-			WriteData(fid,prefix,'data',nparthydro,'format','Integer','name','md.solidearth.nparthydro');
-			WriteData(fid,prefix,'object',self,'fieldname','partitionocean','mattype',1,'format','DoubleMat');
-			WriteData(fid,prefix,'data',npartocean,'format','Integer','name','md.solidearth.npartocean');
-
-			self.settings.marshall(prefix,md,fid);
-			self.lovenumbers.marshall(prefix,md,fid);
-			self.rotational.marshall(prefix,md,fid);
-			if ~isempty(self.external),
-				WriteData(fid,prefix,'data',1,'format','Integer','name','md.solidearth.isexternal');
-				self.external.marshall(prefix,md,fid);
-			else
-				WriteData(fid,prefix,'data',0,'format','Integer','name','md.solidearth.isexternal');
-			end
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.solidearth.requested_outputs','format','StringArray');
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			self.settings.savemodeljs(fid,modelname);
-			self.lovenumbers.savemodeljs(fid,modelname);
-			self.rotational.savemodeljs(fid,modelname);
-			if ~isempty(self.external),
-				self.external.savemodeljs(fid,modelname);
-			end
-			writejscellstring(fid,[modelname '.solidearth.requested_outputs'],self.requested_outputs);
-			writejscellarray(fid,[modelname '.solidearth.transitions'],self.transitions);
-			writejscellarray(fid,[modelname '.solidearth.partition'],self.partition);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/solidearth.py
===================================================================
--- /issm/trunk/src/m/classes/solidearth.py	(revision 28275)
+++ 	(revision )
@@ -1,154 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from lovenumbers import lovenumbers
-from MatlabFuncs import *
-from planetradius import planetradius
-from rotational import rotational
-from solidearthsettings import solidearthsettings
-from solidearthsolution import solidearthsolution
-from WriteData import WriteData
-
-
-class solidearth(object):
-    """SOLIDEARTH class definition
-
-    Usage:
-        solidearth = solidearth()
-        solidearth = solidearth('earth')
-
-    TODO:
-    - Update translation from solidearth.m
-    """
-
-    def __init__(self, *args):  # {{{
-        self.settings          = solidearthsettings()
-        self.external          = None
-        self.lovenumbers       = lovenumbers()
-        self.rotational        = rotational()
-        self.planetradius      = planetradius('earth')
-        self.requested_outputs = []
-        self.transfercount     = []
-        self.transitions       = []
-        self.partitionice      = []
-        self.partitionhydro    = []
-        self.partitionocean    = []
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters('earth')
-        elif nargs == 1:
-            self.setdefaultparameters(args[0])
-        else:
-            raise Exception('solidearth constructor error message: zero or one argument only!')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   solidearthinputs, forcings and settings:\n'
-        s += '{}\n'.format(fielddisplay(self, 'planetradius', 'planet radius [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'transitions', 'indices into parts of the mesh that will be icecaps'))
-        s += '{}\n'.format(fielddisplay(self, 'transfercount', 'number of icecaps vertices are part of'))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        s += '{}\n'.format(fielddisplay(self, 'partitionice', 'ice partition vector for barystatic contribution'))
-        s += '{}\n'.format(fielddisplay(self, 'partitionhydro', 'hydro partition vector for barystatic contribution'))
-        s += '{}\n'.format(fielddisplay(self, 'partitionocean', 'ocean partition vector for barystatic contribution'))
-        if not self.external:
-            s += '{}\n'.format(fielddisplay(self, 'external', 'external solution, of the type solidearthsolution'))
-        print(self.settings)
-        print(self.lovenumbers)
-        print(self.rotational)
-        try:
-            print(self.external)
-        except TypeError:
-            pass
-        return s
-    # }}}
-
-    def setdefaultparameters(self, planet):  # {{{
-        # Output default
-        self.requested_outputs = ['default']
-
-        # Transitions should be a list
-        self.transitions = []
-        self.transfercount = [0]
-
-        # No partitions requested for barystatic contribution
-        self.partitionice = []
-        self.partitionhydro = []
-        self.partitionocean = []
-
-        # No external solutions by default
-        self.external = None
-
-        # Planet radius
-        self.planetradius = planetradius(planet)
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
-            return md
-
-        md = checkfield(md, 'fieldname', 'solidearth.requested_outputs', 'stringrow', 1)
-
-        self.settings.checkconsistency(md, solution, analyses)
-        self.lovenumbers.checkconsistency(md, solution, analyses)
-        self.rotational.checkconsistency(md, solution, analyses)
-        if self.external:
-            if not isa(self.external, solidearthsolution):
-                raise Exception('solidearth consistency check: external field should be a solidearthsolution')
-            self.external.checkconsistency(md, solution, analyses)
-        return md
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return ['Sealevel']
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'planetradius', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'transfercount', 'format', 'DoubleMat', 'mattype', 1)
-
-        if len(self.partitionice):
-            npartice = np.max(self.partitionice) + 2
-        else:
-            npartice = 0
-
-        if len(self.partitionhydro):
-            nparthydro = np.max(self.partitionhydro) + 2
-        else:
-            nparthydro = 0
-
-        if len(self.partitionocean):
-            npartocean = np.max(self.partitionocean) + 2
-        else:
-            npartocean = 0
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'partitionice', 'mattype', 1, 'format', 'DoubleMat');
-        WriteData(fid, prefix, 'data', npartice, 'format', 'Integer', 'name', 'md.solidearth.npartice');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'partitionhydro', 'mattype', 1, 'format', 'DoubleMat');
-        WriteData(fid, prefix, 'data', nparthydro,'format', 'Integer', 'name','md.solidearth.nparthydro');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'partitionocean', 'mattype', 1, 'format', 'DoubleMat');
-        WriteData(fid, prefix, 'data', npartocean,'format', 'Integer', 'name','md.solidearth.npartocean');
-
-        self.settings.marshall(prefix, md, fid)
-        self.lovenumbers.marshall(prefix, md, fid)
-        self.rotational.marshall(prefix, md, fid)
-        if self.external:
-            WriteData(fid, prefix, 'data', 1, 'format', 'Integer', 'name', 'md.solidearth.isexternal')
-            self.external.marshall(prefix, md, fid)
-        else:
-            WriteData(fid, prefix, 'data', 0, 'format', 'Integer', 'name', 'md.solidearth.isexternal')
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        pos = np.where(np.asarray(outputs) == 'default')[0]
-        if len(pos):
-            outputs = np.delete(outputs, pos) # remove 'default' from outputs
-            outputs = np.append(outputs, self.defaultoutputs(md)) # add defaults
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray')
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/solidearthsettings.js
===================================================================
--- /issm/trunk/src/m/classes/solidearthsettings.js	(revision 28275)
+++ 	(revision )
@@ -1,145 +1,0 @@
-class solidearthsettings {//{{{
-	/**
-	 * SOLIDEARTHSETTINGS class definition
-	 *
-	 * Usage:
-	 *     solidearthsettings = solidearthsettings();
-	 */
-	constructor() {//{{{
-		this.reltol					= 0;
-		this.abstol					= 0;
-		this.maxiter				= 0;
-		this.selfattraction			= 1;
-		this.elastic				= 1;
-		this.viscous				= 1;
-		this.rotation				= 1;
-		this.grdocean				= 1;
-		this.ocean_area_scaling		= 0;
-		this.runfrequency			= 1; // How many time steps will we skip before we run grd_core
-		this.sealevelloading		= 1; // Will sea-level loads be computed?
-		this.isgrd					= 0; // Will GRD patterns be computed?
-		this.compute_bp_grd			= 0; // Will GRD patterns for bottom pressures be computed?
-		this.degacc					= 0; // Degree increment for resolution of Green tables
-		this.timeacc				= 0; // Time step accuracy required to compute Green tables
-		this.horiz					= 0; // Compute horizontal deformation
-		this.grdmodel				= 0; // GRD model (0 by defualt, 1 for (visco-)elastic, 2 for Ivins)
-		this.cross_section_shape	= 0; // Cross section only used when GRD model is Ivins
-
-		if (arguments.length == 0) {
-			this.setdefaultparameters();
-		} else {
-			error('constructor not supported');
-		}
-	} //}}}
-
-	disp() {//{{{
-		console.log('WARNING: solidearthsettings::disp is not yet implemented');
-	} //}}}
-
-	setdefaultparameters() {//{{{
-		// Convergence criterion: absolute, relative, and residual
-		this.restol = 0.01; // 1 percent
-		this.abstol = NaN;
-
-		// Maximum of non-linear iterations
-		this.maxiter = 5;
-
-		// Computational flags
-		this.selfattraction = 1;
-		this.elastic = 1;
-		this.viscous = 1;
-		this.rotation = 1;
-		this.grdocean = 1;
-		this.ocean_area_scaling = 0;
-		this.compute_bp_grd = 0;
-		this.isgrd = 0;
-		this.sealevelloading = 1;
-
-		// Numerical discretiztion accuracy
-		this.degacc = 0.01;
-		this.timeacc = 1;
-
-		// How many time steps we skip before we run solidearthsettings solver during transient
-		this.runfrequency = 1;
-
-		// Horizontal displacement? (not on by default)
-		this.horiz = 0;
-
-		// Cross section for Ivins model
-		this.cross_section_shape = 1; // Square as default (see idege in GiaDeflectionCorex)
-
-		// No GRD model by default
-		this.grdmodel = 0;
-	} //}}}
-
-	checkconsistency(md, solution, analyses) {//{{{
-		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
-			return md;
-		}
-
-		md = checkfield(md, 'fieldname', 'solidearth.settings.reltol', 'size', [1]);
-		md = checkfield(md, 'fieldname', 'solidearth.settings.abstol', 'size', [1]);
-		md = checkfield(md, 'fieldname', 'solidearth.settings.maxiter', 'size', [1], '>=', 1);
-		md = checkfield(md, 'fieldname', 'solidearth.settings.runfrequency', 'size', [1], '>=', 1);
-		md = checkfield(md, 'fieldname', 'solidearth.settings.degacc', 'size', [1], '>=', 1e-10);
-		md = checkfield(md, 'fieldname', 'solidearth.settings.timeacc', 'size', [1], '>', 0);
-		md = checkfield(md, 'fieldname', 'solidearth.settings.horiz', 'NaN', 1, 'Inf', 1, 'values', [0, 1]);
-		md = checkfield(md, 'fieldname', 'solidearth.settings.grdmodel', '>=', 0, '<=', 2);
-		md = checkfield(md, 'fieldname', 'solidearth.settings.cross_section_shape', 'numel', [1], 'values', [1, 2]);
-
-		// Checks on computational flags
-		if (this.elastic && !this.rigid) {
-			error('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set');
-		}
-		if (this.viscous && !this.elastic) {
-			error('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set');
-		}
-
-		// A GRD computation has been requested, make some checks on the nature of the meshes provided
-		if (this.isgrd) {
-			if (strcmpi(typeof(md.mesh), 'mesh3dsurface')) {
-				if (this.grdmodel == 2) {
-					error('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)');
-				}
-			} else {
-				if (this.grdmodel == 1) {
-					error('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)');
-				}
-			}
-			
-			if (this.sealevelloading && !this.grdocean) {
-				error('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set');
-			}
-		}
-
-		if (this.compute_bp_grd && !md.solidearth.settings.isgrd) {
-			error('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on');
-		}
-
-		return md;
-	} //}}}
-
-	marshall(md, prefix, fid) {//{{{
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'selfattraction', 'name', 'md.solidearth.settings.selfattraction', 'format', 'Boolean');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'elastic', 'name', 'md.solidearth.settings.elastic', 'format', 'Boolean');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'viscous', 'name', 'md.solidearth.settings.viscous', 'format', 'Boolean');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'rotation', 'name', 'md.solidearth.settings.rotation', 'format', 'Boolean');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'grdocean', 'name', 'md.solidearth.settings.grdocean', 'format', 'Boolean');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Boolean');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale', md.constants.yts);
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'sealevelloading', 'name', 'md.solidearth.settings.sealevelloading', 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer');
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer');
-	} //}}}
-
-	extrude(md) {//{{{
-	} //}}}
-} //}}}
Index: sm/trunk/src/m/classes/solidearthsettings.m
===================================================================
--- /issm/trunk/src/m/classes/solidearthsettings.m	(revision 28275)
+++ 	(revision )
@@ -1,204 +1,0 @@
-%SOLIDEARTHSETTINGS class definition
-%
-%   Usage:
-%      solidearthsettings=solidearthsettings();
-
-classdef solidearthsettings
-	properties (SetAccess=public)
-		reltol                 = 0;
-		abstol                 = 0;
-		maxiter                = 0;
-		selfattraction         = 1;
-		elastic                = 1;
-		viscous                = 1;
-		rotation               = 1;
-		grdocean               = 1;
-		ocean_area_scaling     = 0;
-		runfrequency           = 1; %how many time steps we skip before we run grd_core
-		sealevelloading        = 1; %will sea-level loads be computed? 
-		isgrd                  = 0; %will GRD patterns be computed? 
-		compute_bp_grd         = 0; %will GRD patterns for bottom pressures be computed? 
-		degacc                 = 0; %degree increment for resolution of Green tables.
-		timeacc                = 1; %time step accuracy required to compute Green tables
-		horiz                  = 0; %compute horizontal deformation
-		grdmodel               = 1; %grd model (0 by default, 1 for (visco-)elastic, 2 for Ivins)
-		cross_section_shape    = 0; %cross section only used when grd model is Ivins
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. If the input is a struct it is an old version of this class and
-			% old fields must be recovered (make sure they are in the deprecated
-			% model properties)
-
-			if isstruct(self)
-				% 2021, Jun 4
-				if isfield(self,'rigid')
-					self.selfattraction = self.rigid;
-				end
-				if isfield(self,'computesealevelchange')
-					self.sealevelloading = self.computesealevelchange;
-				end
-				self = structtoobj(solidearthsettings(),self);
-
-			end
-		end% }}}
-	end
-	methods
-
-		function self = solidearthsettings(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Convergence criterion: absolute, relative and residual
-			self.reltol=0.01; % 1 percent
-			self.abstol=NaN;  % default
-
-			%maximum of non-linear iterations.
-			self.maxiter=5;
-
-			%computational flags:
-			self.selfattraction=1;
-			self.elastic=1;
-			self.viscous=1;
-			self.rotation=1;
-			self.grdocean=1;
-			self.ocean_area_scaling=0;
-			self.compute_bp_grd=0;
-			self.isgrd=0;
-			self.sealevelloading=1;
-
-			%numerical discretization accuracy
-			self.degacc=.01;
-			self.timeacc=1; 
-
-			%how many time steps we skip before we run solidearthsettings solver during transient
-			self.runfrequency=1;
-
-			%horizontal displacement? (not on by default)
-			self.horiz=0;
-
-			%cross section for Ivins model
-			self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
-
-			%grd model by default
-			self.grdmodel=1;
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   solidearth settings:'));
-			disp(sprintf('      core:'));
-			fielddisplay(self,'isgrd','compute GRD patterns (default: 1)');
-			fielddisplay(self,'grdmodel','type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)');
-			fielddisplay(self,'runfrequency','How many time steps we let masstransport core accumulate changes before each run of the sealevelchange core (default: 1, i.e run slc every time step)');
-			disp(sprintf('      computational flags:'));
-			fielddisplay(self,'selfattraction','enables surface mass load to perturb the gravity field');
-			fielddisplay(self,'elastic','enables elastic deformation from surface loading');
-			fielddisplay(self,'viscous','enables viscous deformation from surface loading');
-			fielddisplay(self,'rotation','enables polar motion to feedback on the GRD fields');
-			fielddisplay(self,'compute_bp_grd','compute GRD patterns for bottom pressure loads (default: 1)');
-			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore. Used only for grdmodel=2 only');
-			disp(sprintf('      resolution:'));
-			fielddisplay(self,'degacc','spatial accuracy (default: .01 deg) for numerical discretization of the Green''s functions');
-			fielddisplay(self,'timeacc','time accuracy (default: 1 yr) for numerical discretization of the Green''s functions');
-			disp(sprintf('      sea-level equation:'));
-			fielddisplay(self,'grdocean','does this planet have an ocean, if set to 1: global water mass is conserved in GRD module (default: 1)'); 
-			fielddisplay(self,'sealevelloading','enables surface loading from sea-level change (default: 1)');
-			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
-			fielddisplay(self,'reltol','sea level change relative convergence criterion (default, NaN: not applied)');
-			fielddisplay(self,'abstol','sea level change absolute convergence criterion(default, NaN: not applied)');
-			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area (default: No correction)'); 
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
-				return; 
-			end
-			md = checkfield(md,'fieldname','solidearth.settings.reltol','size',[1 1]);
-			md = checkfield(md,'fieldname','solidearth.settings.abstol','size',[1 1]);
-			md = checkfield(md,'fieldname','solidearth.settings.maxiter','size',[1 1],'>=',1);
-			md = checkfield(md,'fieldname','solidearth.settings.runfrequency','size',[1 1],'>=',1);
-			md = checkfield(md,'fieldname','solidearth.settings.degacc','size',[1 1],'>=',1e-10);
-			md = checkfield(md,'fieldname','solidearth.settings.timeacc','size',[1 1],'>',0);
-			md = checkfield(md,'fieldname','solidearth.settings.horiz','NaN',1,'Inf',1,'values',[0 1]);
-			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','>=',0,'<=',2);
-			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
-
-			if self.elastic==1 & self.selfattraction==0,
-				error('solidearthsettings checkconsistency error message: need selfattraction on if elastic flag is set');
-			end
-			if self.viscous==1 & self.elastic==0,
-				error('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set');
-			end
-			if self.rotation==1 & self.elastic==0,
-				error('solidearthsettings checkconsistency error message: need elastic on if rotation flag is set');
-			end
-
-			%a GRD computation has been requested, make some checks on the nature of the meshes provided. 
-			if self.isgrd,
-				if strcmpi(class(md.mesh),'mesh3dsurface'),
-					if self.grdmodel==2,
-						error('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)');
-					end
-				else
-					if self.grdmodel==1,
-						error('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)');
-					end
-				end
-				if self.sealevelloading==1 & self.grdocean==0
-					error('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set');
-				end
-			end
-
-			if self.compute_bp_grd==1 & md.solidearth.settings.isgrd==0,
-					error('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on');
-			end
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','reltol','name','md.solidearth.settings.reltol','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','abstol','name','md.solidearth.settings.abstol','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','maxiter','name','md.solidearth.settings.maxiter','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','selfattraction','name','md.solidearth.settings.selfattraction','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','elastic','name','md.solidearth.settings.elastic','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','viscous','name','md.solidearth.settings.viscous','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','rotation','name','md.solidearth.settings.rotation','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','grdocean','name','md.solidearth.settings.grdocean','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','ocean_area_scaling','name','md.solidearth.settings.ocean_area_scaling','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','runfrequency','name','md.solidearth.settings.runfrequency','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','degacc','name','md.solidearth.settings.degacc','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','timeacc','name','md.solidearth.settings.timeacc','format','Double','scale',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','horiz','name','md.solidearth.settings.horiz','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','sealevelloading','name','md.solidearth.settings.sealevelloading','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','isgrd','name','md.solidearth.settings.isgrd','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','compute_bp_grd','name','md.solidearth.settings.compute_bp_grd','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','grdmodel','name','md.solidearth.settings.grdmodel','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','name','md.solidearth.settings.cross_section_shape','format','Integer');
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			% TODO: Update the following fields so that coverage is complete
-			writejsdouble(fid,[modelname '.solidearth.settings.maxiter'],self.maxiter);
-			writejsdouble(fid,[modelname '.solidearth.settings.reltol'],self.reltol);
-			writejsdouble(fid,[modelname '.solidearth.settings.abstol'],self.abstol);
-			writejsdouble(fid,[modelname '.solidearth.settings.selfattraction'],self.selfattraction);
-			writejsdouble(fid,[modelname '.solidearth.settings.elastic'],self.elastic);
-			writejsdouble(fid,[modelname '.solidearth.settings.viscous'],self.viscous);
-			writejsdouble(fid,[modelname '.solidearth.settings.rotation'],self.rotation);
-			writejsdouble(fid,[modelname '.solidearth.settings.grdocean'],self.grdocean);
-			writejsdouble(fid,[modelname '.solidearth.settings.ocean_area_scaling'],self.ocean_area_scaling);
-			writejsdouble(fid,[modelname '.solidearth.settings.run_frequency'],self.run_frequency);
-			writejsdouble(fid,[modelname '.solidearth.settings.degacc'],self.degacc);
-			writejsdouble(fid,[modelname '.solidearth.settings.timeacc'],self.timeacc);
-			writejsdouble(fid,[modelname '.solidearth.settings.cross_section_shape'],self.cross_section_shape);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/solidearthsettings.py
===================================================================
--- /issm/trunk/src/m/classes/solidearthsettings.py	(revision 28275)
+++ 	(revision )
@@ -1,158 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class solidearthsettings(object):
-    """solidearthsettings class definition
-
-    Usage:
-        solidearthsettings = solidearthsettings()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.reltol                 = 0
-        self.abstol                 = 0
-        self.maxiter                = 0
-        self.selfattraction         = 1
-        self.elastic                = 1
-        self.viscous                = 1
-        self.rotation               = 1
-        self.grdocean               = 1
-        self.ocean_area_scaling     = 0
-        self.runfrequency           = 1 # How many time steps we skip before we run grd_core
-        self.sealevelloading        = 1 # Will sea-level loads be computed?
-        self.isgrd                  = 0 # Will GRD patterns be computed?
-        self.compute_bp_grd         = 0 # Will GRD patterns for bottom pressures be computed?
-        self.degacc                 = 0 # Degree increment for resolution of Green tables
-        self.timeacc                = 0 # Time step accuracy required to compute Green tables
-        self.horiz                  = 0 # Compute horizontal deformation?
-        self.grdmodel               = 0 # GRD model (0 by default, 1 for (visco-)elastic, 2 for Ivins)
-        self.cross_section_shape    = 0 # Cross section only used when GRD model is Ivins
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   solidearth settings:\n'
-        s += '{}\n'.format(fielddisplay(self, 'reltol', 'sea level change relative convergence criterion (default, NaN: not applied)'))
-        s += '{}\n'.format(fielddisplay(self, 'abstol', 'sea level change absolute convergence criterion (default, NaN: not applied)'))
-        s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of nonlinear iterations'))
-        s += '{}\n'.format(fielddisplay(self, 'grdocean', 'does this planet have an ocean, if set to 1: global water mass is conserved in GRD module (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'ocean_area_scaling', 'correction for model representation of ocean area (default: No correction)'))
-        s += '{}\n'.format(fielddisplay(self, 'sealevelloading', 'enables surface loading from sea-level change (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'isgrd', 'compute GRD patterns (default: 1'))
-        s += '{}\n'.format(fielddisplay(self, 'compute_bp_grd', 'compute GRD patterns for bottom pressure loads (default 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'runfrequency', 'how many time steps we skip before we run solidearthsettings solver during transient (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'selfattraction', 'enables surface mass load to perturb the gravity field'))
-        s += '{}\n'.format(fielddisplay(self, 'elastic', 'enables elastic deformation from surface loading'))
-        s += '{}\n'.format(fielddisplay(self, 'viscous', 'enables viscous deformation from surface loading'))
-        s += '{}\n'.format(fielddisplay(self, 'rotation', 'enables polar motion to feedback on the GRD fields'))
-        s += '{}\n'.format(fielddisplay(self, 'degacc', 'accuracy (default: .01 deg) for numerical discretization of the Green\'s functions'))
-        s += '{}\n'.format(fielddisplay(self, 'timeacc', 'time accuracy (default: 1 year) for numerical discretization of the Green\'s functions'))
-        s += '{}\n'.format(fielddisplay(self, 'grdmodel', 'type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)'))
-        s += '{}\n'.format(fielddisplay(self, 'cross_section_shape', '1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Convergence criterion: absolute, relative, and residual
-        self.reltol = 0.01  # 1 percent
-        self.abstol = np.nan  # default
-
-        # Maximum of non-linear iterations
-        self.maxiter = 5
-
-        # Computational flags
-        self.selfattraction = 1
-        self.elastic = 1
-        self.viscous = 1
-        self.rotation = 1
-        self.grdocean = 1
-        self.ocean_area_scaling = 0
-        self.compute_bp_grd = 0
-        self.isgrd = 0
-        self.sealevelloading = 1
-
-        # Numerical discretization accuracy
-        self.degacc = 0.01
-        self.timeacc = 1
-
-        # How many time steps we skip before we run solidearthsettings solver during transient
-        self.runfrequency = 1
-
-        # Horizontal displacement? (not on by default)
-        self.horiz = 0
-
-        # Cross section for Ivins model
-        self.cross_section_shape = 1 # Square as default (see iedge in GiaDeflectionCorex)
-
-        # GRD model by default
-        self.grdmodel = 1
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
-            return md
-
-        md = checkfield(md, 'fieldname', 'solidearth.settings.reltol', 'size', [1])
-        md = checkfield(md, 'fieldname', 'solidearth.settings.abstol', 'size', [1])
-        md = checkfield(md, 'fieldname', 'solidearth.settings.maxiter', 'size', [1], '>=', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.settings.runfrequency', 'size', [1], '>=', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.settings.degacc', 'size', [1], '>=', 1e-10)
-        md = checkfield(md, 'fieldname', 'solidearth.settings.timeacc', 'size', [1], '>', 0)
-        md = checkfield(md, 'fieldname', 'solidearth.settings.horiz', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'solidearth.settings.grdmodel', '>=', 0, '<=', 2)
-        md = checkfield(md, 'fieldname', 'solidearth.settings.cross_section_shape', 'numel', [1], 'values', [1, 2])
-
-        if self.elastic and not self.selfattraction:
-            raise Exception('solidearthsettings checkconsistency error message: need selfattraction on if elastic flag is set')
-        if self.viscous and not self.elastic:
-            raise Exception('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set')
-
-        # A GRD computation has been requested, make some checks on the nature of the meshes provided
-        if self.isgrd:
-            if md.mesh.__class__.__name__ == 'mesh3dsurface':
-                if self.grdmodel == 2:
-                    raise Exception('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)')
-            else:
-                if self.grdmodel == 1:
-                    raise Exception('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)')
-            if self.sealevelloading and not self.grdocean:
-                raise Exception('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set')
-
-        if self.compute_bp_grd and not md.solidearth.settings.isgrd:
-            raise Exception('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on')
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'selfattraction', 'name', 'md.solidearth.settings.selfattraction', 'format', 'Boolean');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'elastic', 'name', 'md.solidearth.settings.elastic', 'format', 'Boolean');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'viscous', 'name', 'md.solidearth.settings.viscous', 'format', 'Boolean');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'rotation', 'name', 'md.solidearth.settings.rotation', 'format', 'Boolean');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdocean', 'name', 'md.solidearth.settings.grdocean', 'format', 'Boolean');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Boolean');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale', md.constants.yts);
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevelloading', 'name', 'md.solidearth.settings.sealevelloading', 'format', 'Integer');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer');
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer');
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/solidearthsolution.js
===================================================================
--- /issm/trunk/src/m/classes/solidearthsolution.js	(revision 28275)
+++ 	(revision )
@@ -1,77 +1,0 @@
-class solidearthsolution {//{{{
-	/**
-	 * SOLIDEARTHSOLUTION class definition
-	 *
-	 * Usage:
-	 *     solidearthsolution = solidearthsolution();
-	 */
-	constructor() {//{{{
-		this.displacementeast	= [];
-		this.displacementnorth	= [];
-		this.displacementup		= [];
-		this.geoid				= [];
-
-		let nargs = arguments.length;
-		if (nargs == 0) {
-			this.setdefaultparameters();
-		} else {
-			error('constructor not supported');
-		}
-	} //}}}
-
-	setdefaultparameters() {//{{{
-		this.displacementeast	= [];
-		this.displacementnorth	= [];
-		this.displacementup		= [];
-		this.geoid				= [];
-	} //}}}
-
-	checkconsistency(md, solution, analyses) {//{{{
-		md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1);
-		md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1);
-		md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1);
-		md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1);
-
-		return md;
-	} //}}}
-
-	disp() {//{{{
-		console.log('WARNING: solidearthsolution::disp is not yet implemented');
-	} //}}}
-
-	marshall(md, prefix, fid) {//{{{
-		let yts = md.constants.yts;
-
-		// Transform our time series into time series rates
-		let displacementeast_rate	= [];
-		let displacementnorth_rate	= [];
-		let displacementup_rate		= [];
-		let geoid_rate				= [];
-		if (size(this.displacementeast, 1) == 1) {
-			disp('External solidearthsolution warning: only one time step provided, assuming the values are rates per year');
-			displacementeast_rate	= [this.displacementeast; 0];
-			displacementnorth_rate	= [this.displacementnorth; 0];
-			displacementup_rate		= [this.displacementup; 0];
-			geoid_rate				= [this.geoid; 0];
-		} else {
-			let time = this.displacementeast[end, :];
-			let dt = diff(time, 1, 2);
-			displacementeast_rate = diff(this.displacementeast[0:-1,:], 1, 2) ./ dt;
-			displacementeast_rate[end + 1, :] = time[0:-1];
-			displacementnorth_rate = diff(this.displacementnorth_rate[0:-1,:], 1, 2) ./ dt;
-			displacementnorth_rate[end + 1, :] = time[0:-1];
-			displacementup_rate = diff(this.displacementup_rate[0:-1,:], 1, 2) ./ dt;
-			displacementup_rate[end + 1, :] = time[0:-1];
-			geoid_rate = diff(this.geoid_rate[0:-1,:], 1, 2) ./ dt;
-			geoid_rate[end + 1, :] = tgeoid_rateime[0:-1];
-		}
-
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'displacementup', 'data', displacementup_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-		WriteData(fid, prefix, 'object', this, 'fieldname', 'geoid', 'data', geoid_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-	} //}}}
-
-	extrude(md) {//{{{
-	} //}}}
-} //}}}
Index: sm/trunk/src/m/classes/solidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/solidearthsolution.m	(revision 28275)
+++ 	(revision )
@@ -1,85 +1,0 @@
-%SOLIDEARTHSOLUTION class definition
-%
-%   Usage:
-%      solidearthsolution=solidearthsolution();
-
-classdef solidearthsolution
-	properties (SetAccess=public) 
-		displacementeast = [];
-		displacementnorth =[];
-		displacementup=[];
-		geoid=[];
-	end
-	methods
-		function self = solidearthsolution(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('%s','         units for time series is (yr)'));
-			fielddisplay(self,'displacementeast','solid-Earth Eastwards bedrock displacement series (m)');
-			fielddisplay(self,'displacementnorth','solid-Earth Northwards bedrock displacement time series (m)');
-			fielddisplay(self,'displacementup','solid-Earth bedrock uplift time series (m)');
-			fielddisplay(self,'geoid','solid-Earth geoid time series (m)');
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-	
-			self.displacementeast = [];
-			self.displacementnorth =[];
-			self.displacementup=[];
-			self.geoid=[];
-	
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','solidearth.external.displacementeast','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','solidearth.external.displacementnorth','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','solidearth.external.displacementup','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','solidearth.external.geoid','Inf',1,'timeseries',1);
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			yts=md.constants.yts;
-
-			%transform our time series into time series rates 
-			if size(self.displacementeast,2)==1
-				disp('External solidearthsolution warning: only one time step provided, assuming the values are rates per year');
-				displacementeast_rate=[self.displacementeast;0];
-				displacementnorth_rate=[self.displacementnorth;0];
-				displacementup_rate=[self.displacementup;0];
-				geoid_rate=[self.geoid;0];
-			else
-				time=self.displacementeast(end,:);
-				dt=diff(time,1,2);
-				displacementeast_rate=diff(self.displacementeast(1:end-1,:),1,2)./dt;
-				displacementeast_rate(end+1,:)=time(1:end-1);
-				displacementnorth_rate=diff(self.displacementnorth(1:end-1,:),1,2)./dt;
-				displacementnorth_rate(end+1,:)=time(1:end-1);
-				displacementup_rate=diff(self.displacementup(1:end-1,:),1,2)./dt;
-				displacementup_rate(end+1,:)=time(1:end-1);
-				geoid_rate=diff(self.geoid(1:end-1,:),1,2)./dt;
-				geoid_rate(end+1,:)=time(1:end-1);
-			end
-
-			WriteData(fid, prefix, 'name', 'md.solidearth.external.nature', 'data', 0, 'format', 'Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','data',displacementeast_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementeast','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','displacementup','data',displacementup_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementup','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','data',displacementnorth_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementnorth','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			WriteData(fid,prefix,'object',self,'fieldname','geoid','data',geoid_rate,'format','DoubleMat','name', 'md.solidearth.external.geoid','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
-			
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			writejs1Darray(fid,[modelname '.solidearth.external.displacementeast'],self.displacementeast);
-			writejs1Darray(fid,[modelname '.solidearth.external.displacementnorth'],self.displacementnorth);
-			writejs1Darray(fid,[modelname '.solidearth.external.displacementup'],self.displacementup);
-			writejs1Darray(fid,[modelname '.solidearth.external.geoid'],self.geoid);
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/solidearthsolution.py
===================================================================
--- /issm/trunk/src/m/classes/solidearthsolution.py	(revision 28275)
+++ 	(revision )
@@ -1,85 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class solidearthsolution(object):
-    """SOLIDEARTHSOLUTION class definition
-
-    Usage:
-        solidearthsolution = solidearthsolution()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.displacementeast = []
-        self.displacementnorth = []
-        self.displacementup = []
-        self.geoid = []
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise RuntimeError('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '         units for time series is (yr)\n'
-        s += '{}\n'.format(fielddisplay(self, 'displacementeast', 'solid-Earth Eastwards bedrock displacement series (m)'))
-        s += '{}\n'.format(fielddisplay(self, 'displacementnorth', 'solid-Earth Northwards bedrock displacement time series (m)'))
-        s += '{}\n'.format(fielddisplay(self, 'displacementup', 'solid-Earth bedrock uplift time series (m)'))
-        s += '{}\n'.format(fielddisplay(self, 'geoid', 'solid-Earth geoid time series (m)'))
-
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        self.displacementeast = []
-        self.displacementnorth = []
-        self.displacementup = []
-        self.geoid = []
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1)
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        print('sadjsda')
-        exit()
-
-        # Transform our time series into time series rates
-        if np.shape(self.displacementeast)[1] == 1:
-            print('solidearthsolution.py::marshall: Warning: only one time step provided, assuming the values are rates per year')
-            displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
-            displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
-            displacementup_rate = np.append(np.array(self.displacementup).reshape(-1, 1), 0)
-            geoid_rate = np.append(np.array(self.geoid).reshape(-1, 1), 0)
-        else:
-            time = self.displacementeast[-1, :]
-            dt = np.diff(time, axis=0)
-            displacementeast_rate = np.diff(self.displacementeast[0:-2, :], 1, 1) / dt
-            displacementeast_rate = np.append(displacementeast_rate,time[:-1].reshape(1,-1),axis=0)
-            displacementnorth_rate = np.diff(self.displacementnorth[0:-2, :], 1, 1) / dt
-            displacementnorth_rate = np.append(displacementnorth_rate,time[:-1].reshape(1,-1),axis=0)
-            displacementup_rate = np.diff(self.displacementup[0:-2, :], 1, 1) / dt
-            displacementup_rate = np.append(displacementup_rate,time[:-1].reshape(1,-1),axis=0)
-            geoid_rate = np.diff(self.geoid[0:-2, :], 1, 1) / dt
-            geoid_rate = np.append(geoid_rate,time[:-1].reshape(1,-1),axis=0)
-
-        WriteData(fid, prefix, 'name', 'md.solidearth.external.nature', 'data', 0, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementup', 'data', displacementup_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geoid', 'data', geoid_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
-    # }}}
-
-    def extrude(self, md):  # {{{
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/spatiallinearbasalforcings.m
===================================================================
--- /issm/trunk/src/m/classes/spatiallinearbasalforcings.m	(revision 28275)
+++ 	(revision )
@@ -1,123 +1,0 @@
-%SPATIAL LINEAR BASAL FORCINGS class definition
-%
-%   Usage:
-%      spatiallinearbasalforcings=spatiallinearbasalforcings();
-
-classdef spatiallinearbasalforcings
-	properties (SetAccess=public) 
-		groundedice_melting_rate  = NaN;
-		deepwater_melting_rate    = NaN;
-		deepwater_elevation       = NaN;
-		upperwater_melting_rate   = NaN;
-		upperwater_elevation      = NaN;
-		perturbation_melting_rate = NaN;
-		geothermalflux            = NaN;
-	end
-	methods
-		function self = spatiallinearbasalforcings(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					lb=varargin{1};
-					if isa(lb,'linearbasalforcings');
-						nvertices=length(lb.groundedice_melting_rate);
-						self.groundedice_melting_rate=lb.groundedice_melting_rate;
-						self.geothermalflux=lb.geothermalflux;
-						self.deepwater_elevation       = lb.deepwater_elevation*ones(nvertices,1);
-						self.deepwater_melting_rate    = lb.deepwater_melting_rate*ones(nvertices,1);
-						self.upperwater_melting_rate   = lb.upperwater_melting_rate*ones(nvertices,1);
-						self.upperwater_elevation      = lb.upperwater_elevation*ones(nvertices,1);
-						if ~isnan(lb.perturbation_melting_rate)
-							self.perturbation_melting_rate = lb.perturbation_melting_rate*ones(nvertices,1);
-						end
-					else 
-						self=structtoobj(spatiallinearbasalforcings(),varargin{1});
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
-			self.deepwater_melting_rate=project3d(md,'vector',self.deepwater_melting_rate,'type','node','layer',1); 
-			self.deepwater_elevation=project3d(md,'vector',self.deepwater_elevation,'type','node','layer',1); 
-			self.upperwater_melting_rate=project3d(md,'vector',self.upperwater_melting_rate,'type','node','layer',1); 
-			self.upperwater_elevation=project3d(md,'vector',self.upperwater_elevation,'type','node','layer',1); 
-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
-			self.perturbation_melting_rate=project3d(md,'vector',self.perturbation_melting_rate,'type','node','layer',1); 
-		end % }}}
-		function self = initialize(self,md) % {{{
-
-			if isnan(self.groundedice_melting_rate),
-				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
-				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default values for melting parameterization: can't, we don't have the vertices information!
-			%self.deepwater_melting_rate = 50;
-			%self.deepwater_elevation    = -800;
-			%self.upperwater_elevation   = -400;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if numel(md.basalforcings.perturbation_melting_rate)>1
-            md = checkfield(md,'fieldname','basalforcings.perturbation_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-         end
-
-			if ismember('MasstransportAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.ismasstransport==0),
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','NaN',1,'Inf',1,'timeseries',1,'<=',0);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
-				error('not implemented yet!');
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'numel',1);
-			end
-			if ismember('ThermalAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isthermal==0),
-				error('not implemented yet!');
-				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','>=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'numel',1);
-				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   spatial linear basal forcings parameters:'));
-
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'deepwater_melting_rate','basal melting rate (positive if melting applied for floating ice whith base < deepwater_elevation) [m/yr]');
-			fielddisplay(self,'deepwater_elevation','elevation of ocean deepwater [m]');
-			fielddisplay(self,'upperwater_melting_rate','basal melting rate (positive if melting applied for floating ice whith base >= upperwater_elevation) [m/yr]');
-			fielddisplay(self,'upperwater_elevation','elevation of ocean upperwater [m]');
-			fielddisplay(self,'perturbation_melting_rate','basal melting rate perturbation added to computed melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'name','md.basalforcings.model','data',6,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','deepwater_melting_rate','format','DoubleMat','name','md.basalforcings.deepwater_melting_rate','scale',1./yts,'mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','deepwater_elevation','format','DoubleMat','name','md.basalforcings.deepwater_elevation','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','upperwater_melting_rate','format','DoubleMat','name','md.basalforcings.upperwater_melting_rate','scale',1./yts,'mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','upperwater_elevation','format','DoubleMat','name','md.basalforcings.upperwater_elevation','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','perturbation_melting_rate','format','DoubleMat','name','md.basalforcings.perturbation_melting_rate','scale',1./yts,'mattype',1);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/spatiallinearbasalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/spatiallinearbasalforcings.py	(revision 28275)
+++ 	(revision )
@@ -1,119 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from structtoobj import structtoobj
-from WriteData import WriteData
-
-
-class spatiallinearbasalforcings(object):
-    """SPATIAL LINEAR BASAL FORCINGS class definition
-
-    Usage:
-        spatiallinearbasalforcings = spatiallinearbasalforcings()
-    """
-
-    def __init__(self, *args):  # {{{
-        nargs = len(args)
-        if nargs == 0:
-            self.groundedice_melting_rate   = np.nan
-            self.deepwater_melting_rate     = np.nan
-            self.deepwater_elevation        = np.nan
-            self.upperwater_melting_rate    = np.nan
-            self.upperwater_elevation       = np.nan
-            self.geothermalflux             = np.nan
-            self.perturbation_melting_rate  = np.nan
-
-            self.setdefaultparameters()
-        elif nargs == 1:
-            lb = args[0]
-            if lb.__module__ == 'linearbasalforcings':
-                nvertices = len(lb.groundedice_melting_rate)
-                self.groundedice_melting_rate   = lb.groundedice_melting_rate
-                self.geothermalflux             = lb.geothermalflux
-                self.deepwater_elevation        = lb.deepwater_elevation * np.ones((nvertices, ))
-                self.deepwater_melting_rate     = lb.deepwater_melting_rate * np.ones((nvertices, ))
-                self.upperwater_melting_rate    = lb.upperwater_melting_rate * np.ones((nvertices, ))
-                self.upperwater_elevation       = lb.upperwater_elevation * np.ones((nvertices, ))
-                self.perturbation_melting_rate  = lb.perturbation_melting_rate * np.ones((nvertices, ))
-            else:
-                # TODO: This has not been tested
-                self = structtoobj(self, lb)
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   spatial linear basal forcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'deepwater_melting_rate', 'basal melting rate (positive if melting applied for floating ice whith base < deepwater_elevation) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'deepwater_elevation', 'elevation of ocean deepwater [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'upperwater_melting_rate', 'basal melting rate (positive if melting applied for floating ice whith base >= upperwater_elevation) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'upperwater_elevation', 'elevation of ocean upperwater [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'perturbation_melting_rate', 'basal melting rate perturbation added to computed melting rate (positive if melting) [m/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'geothermalflux', 'geothermal heat flux [W/m^2]'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.groundedice_melting_rate = project3d(md, 'vector', self.groundedice_melting_rate, 'type', 'node', 'layer', 1) 
-        self.deepwater_melting_rate = project3d(md, 'vector', self.deepwater_melting_rate, 'type', 'node', 'layer', 1) 
-        self.deepwater_elevation = project3d(md, 'vector', self.deepwater_elevation, 'type', 'node', 'layer', 1)
-        self.upperwater_melting_rate = project3d(md, 'vector', self.upperwater_melting_rate, 'type', 'node', 'layer', 1) 
-        self.upperwater_elevation = project3d(md, 'vector', self.upperwater_elevation, 'type', 'node', 'layer', 1) 
-        self.geothermalflux = project3d(md, 'vector', self.geothermalflux, 'type', 'node', 'layer', 1) # Bedrock only gets geothermal flux
-        self.perturbation_melting_rate = project3d(md, 'vector', self.upperwater_melting_rate, 'type', 'node', 'layer', 1) 
-        return self
-    # }}}
-
-    def initialize(self, md):  # {{{
-        if np.all(np.isnan(self.groundedice_melting_rate)):
-            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
-            print('      no basalforcings.groundedice_melting_rate specified: values set as zero')
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if not np.all(np.isnan(self.perturbation_melting_rate)):
-            md = checkfield(md, 'fieldname', 'basalforcings.perturbation_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport:
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '<', 0)
-        if 'BalancethicknessAnalysis' in analyses:
-            raise Exception('not implemented yet!')
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', '<', 'basalforcings.upperwater_elevation', 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_melting_rate', '>=', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', '<=', 0, 'numel', 1)
-        if 'ThermalAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isthermal:
-            raise Exception('not implemented yet!')
-            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', '<', 'basalforcings.upperwater_elevation', 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', '<', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'basalforcings.geothermalflux', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 6, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.groundedice_melting_rate', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1,'yts', md.constants.yts)
-        WriteData(fid, prefix,'object', self, 'fieldname', 'geothermalflux', 'name', 'md.basalforcings.geothermalflux', 'format', 'DoubleMat', 'mattype', 1,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deepwater_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.deepwater_melting_rate', 'scale', 1. / yts, 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'deepwater_elevation', 'format', 'DoubleMat', 'name', 'md.basalforcings.deepwater_elevation', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperwater_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.upperwater_melting_rate', 'scale', 1. / yts, 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperwater_elevation', 'format', 'DoubleMat', 'name', 'md.basalforcings.upperwater_elevation', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'perturbation_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.perturbation_melting_rate', 'scale', 1. / yts, 'mattype', 1)
-    # }}}
Index: sm/trunk/src/m/classes/spheremesh.m
===================================================================
--- /issm/trunk/src/m/classes/spheremesh.m	(revision 28275)
+++ 	(revision )
@@ -1,96 +1,0 @@
-%SPHEREMESH class definition
-%
-%   Usage:
-%      spheremesh=spheremesh();
-
-classdef spheremesh
-	properties (SetAccess=public) 
-		x                           = NaN;
-		y                           = NaN;
-		z                           = NaN;
-		r                           = NaN;
-		theta                       = NaN;
-		phi                         = NaN
-		elements                    = NaN
-		numberoflayers              = 0;
-		numberofelements            = 0;
-		numberofvertices            = 0;
-
-		vertexconnectivity          = NaN
-		elementconnectivity         = NaN
-		average_vertex_connectivity = 0;
-	end
-	methods
-		function self = spheremesh(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%the connectivity is the avergaded number of nodes linked to a
-			%given node through an edge. This connectivity is used to initially
-			%allocate memory to the stiffness matrix. A value of 16 seems to
-			%give a good memory/time ration. This value can be checked in
-			%trunk/test/Miscellaneous/runme.m
-			self.average_vertex_connectivity=25;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','spheremesh.x','NaN',1,'Inf',1,'size',[md.spheremesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','spheremesh.y','NaN',1,'Inf',1,'size',[md.spheremesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','spheremesh.z','NaN',1,'Inf',1,'size',[md.spheremesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','spheremesh.r','NaN',1,'Inf',1,'size',[md.spheremesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','spheremesh.theta','NaN',1,'Inf',1,'size',[md.spheremesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','spheremesh.phi','NaN',1,'Inf',1,'size',[md.spheremesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','spheremesh.elements','NaN',1,'Inf',1,'>',0,'values',1:md.spheremesh.numberofvertices);
-			md = checkfield(md,'fieldname','spheremesh.elements','size',[md.spheremesh.numberofelements 3]);
-			if any(~ismember(1:md.spheremesh.numberofvertices,sort(unique(md.spheremesh.elements(:)))));
-				md = checkmessage(md,'orphan nodes have been found. Check the spheremesh outline');
-			end
-			md = checkfield(md,'fieldname','spheremesh.numberoflayers','>=',0);
-			md = checkfield(md,'fieldname','spheremesh.numberofelements','>',0);
-			md = checkfield(md,'fieldname','spheremesh.numberofvertices','>',0);
-			md = checkfield(md,'fieldname','spheremesh.elementconnectivity','size',[md.spheremesh.numberofelements 3],'NaN',1,'Inf',1);
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Mesh:')); 
-
-			disp(sprintf('\n      Elements and vertices:'));
-			fielddisplay(self,'numberofelements','number of elements');
-			fielddisplay(self,'numberofvertices','number of vertices');
-			fielddisplay(self,'elements','vertex indices of the mesh elements');
-			fielddisplay(self,'x','vertices x coordinate [m]');
-			fielddisplay(self,'y','vertices y coordinate [m]');
-			fielddisplay(self,'z','vertices z coordinate [m]');
-			fielddisplay(self,'r','vertices r coordinate [m]');
-			fielddisplay(self,'theta','vertices theta coordinate [degrees]');
-			fielddisplay(self,'phi','vertices phi coordinate [degrees]');
-
-			disp(sprintf('\n      Properties:'));
-			fielddisplay(self,'numberoflayers','number of extrusion layers');
-
-			fielddisplay(self,'vertexconnectivity','list of elements connected to vertex_i');
-			fielddisplay(self,'elementconnectivity','list of elements adjacent to element_i');
-			fielddisplay(self,'average_vertex_connectivity','average number of vertices connected to one vertex');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','x','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','y','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','z','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','r','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','theta','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','phi','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'fieldname','numberoflayers','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','numberofelements','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','numberofvertices','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','elementconnectivity','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'fieldname','average_vertex_connectivity','format','Integer');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/steadystate.js
===================================================================
--- /issm/trunk/src/m/classes/steadystate.js	(revision 28275)
+++ 	(revision )
@@ -1,84 +1,0 @@
-//STEADYSTATE class definition
-//
-//   Usage:
-//      steadystate=new steadystate();
-
-function steadystate (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//maximum of steady state iterations
-		this.maxiter=100;
-
-		//Relative tolerance for the steadystate convertgence
-		this.reltol=0.01;
-
-		//default output
-		this.requested_outputs=['default'];
-
-
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   steadystate solution parameters:'));
-
-		fielddisplay(this,'reltol','relative tolerance criterion');
-		fielddisplay(this,'maxiter','maximum number of iterations');
-		fielddisplay(this,'requested_outputs','additional requested outputs');
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "steadystate";
-
-	}// }}}
-	this.checkconsistency = function(md,solution,analyses) {// {{{
-
-		//Early return
-		if (solution!='SteadystateSolution') return;
-
-		if (md.timestepping.time_step!=0){
-			md.checkmessage('for a steadystate computation, timestepping.time_step must be zero.');
-		}
-		checkfield(md,'fieldname','steadystate.requested_outputs','stringrow',1);
-
-		if (isNaN(md.stressbalance.reltol)){
-			md.checkmessage('for a steadystate computation, stressbalance.reltol (relative convergence criterion) must be defined!');
-		}
-	} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'fieldname','reltol','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','maxiter','format','Integer');
-
-			//process requested outputs
-			var outputs = this.requested_outputs;
-			for (var i=0;i<outputs.length;i++){
-				if (outputs[i] == 'default') {
-					outputs.splice(i,1);
-					var newoutputs=this.defaultoutputs(md);
-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-				}
-			}
-			WriteData(fid,prefix,'data',outputs,'name','md.steadystate.requested_outputs','format','StringArray');
-		}//}}}
-		this.defaultoutputs = function(md) { //{{{
-
-			var list=[];
-
-			for (var i=0;i<md.stressbalance.defaultoutputs(md).length;i++)list.push(md.stressbalance.defaultoutputs(md)[i]);
-			for (var i=0;i<md.thermal.defaultoutputs(md).length;i++)list.push(md.thermal.defaultoutputs(md)[i]);
-
-			return list;
-
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-
-	this.reltol            = 0;
-	this.maxiter           = 0;
-	this.requested_outputs = [];
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/steadystate.m
===================================================================
--- /issm/trunk/src/m/classes/steadystate.m	(revision 28275)
+++ 	(revision )
@@ -1,79 +1,0 @@
-%STEADYSTATE class definition
-%
-%   Usage:
-%      steadystate=steadystate();
-
-classdef steadystate
-	properties (SetAccess=public) 
-		reltol            = 0;
-		maxiter           = 0;
-		requested_outputs = {};
-	end
-	methods
-		function self = steadystate(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			%maximum of steady state iterations
-			self.maxiter=100;
-
-			%Relative tolerance for the steadystate convertgence
-			self.reltol=0.01;
-
-			%default output
-			self.requested_outputs={'default'};
-		end % }}}
-		function list=defaultoutputs(self,md) % {{{
-
-			list =  [md.stressbalance.defaultoutputs(md) md.thermal.defaultoutputs(md)];
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~strcmp(solution,'SteadystateSolution'), return; end;
-
-			if md.timestepping.time_step~=0,
-				md = checkmessage(md,['for a steadystate computation, timestepping.time_step must be zero.']);
-			end
-			md = checkfield(md,'fieldname','steadystate.requested_outputs','stringrow',1);
-
-			if isnan(md.stressbalance.reltol),
-				md = checkmessage(md,['for a steadystate computation, stressbalance.reltol (relative convergence criterion) must be defined!']);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   steadystate solution parameters:'));
-
-			fielddisplay(self,'reltol','relative tolerance criterion');
-			fielddisplay(self,'maxiter','maximum number of iterations');
-			fielddisplay(self,'requested_outputs','additional requested outputs');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.steadystate.requested_outputs','format','StringArray');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.steadystate.reltol'],self.reltol);
-			writejsdouble(fid,[modelname '.steadystate.maxiter'],self.maxiter);
-			writejscellstring(fid,[modelname '.steadystate.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/steadystate.py
===================================================================
--- /issm/trunk/src/m/classes/steadystate.py	(revision 28275)
+++ 	(revision )
@@ -1,73 +1,0 @@
-import numpy as np
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class steadystate(object):
-    """
-    STEADYSTATE class definition
-
-       Usage:
-          steadystate = steadystate()
-    """
-
-    def __init__(self):  # {{{
-        self.reltol = 0
-        self.maxiter = 0
-        self.requested_outputs = []
-
-    #set defaults
-        self.setdefaultparameters()
-
-    # }}}
-    def __repr__(self):  # {{{
-        string = '   steadystate solution parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'reltol', 'relative tolerance criterion'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'maxiter', 'maximum number of iterations'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional requested outputs'))
-        return string
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return md.stressbalance.defaultoutputs(md) + md.thermal.defaultoutputs(md)
-
-    # }}}
-    def setdefaultparameters(self):  # {{{
-        #maximum of steady state iterations
-        self.maxiter = 100
-        #Relative tolerance for the steadystate convertgence
-        self.reltol = 0.01
-        #default output
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if not solution == 'SteadystateSolution':
-            return md
-
-        if not md.timestepping.time_step == 0:
-            md.checkmessage("for a steadystate computation, timestepping.time_step must be zero.")
-
-        if np.isnan(md.stressbalance.reltol):
-            md.checkmessage("for a steadystate computation, stressbalance.reltol (relative convergence criterion) must be defined!")
-
-        md = checkfield(md, 'fieldname', 'steadystate.requested_outputs', 'stringrow', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'format', 'Integer')
-
-    #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.steadystate.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/stochasticforcing.m
===================================================================
--- /issm/trunk/src/m/classes/stochasticforcing.m	(revision 28275)
+++ 	(revision )
@@ -1,478 +1,0 @@
-%STOCHASTICFORCING class definition
-%
-%   Usage:
-%      stochasticforcing=stochasticforcing();
-
-classdef stochasticforcing
-	properties (SetAccess=public)
-		isstochasticforcing	= 0;
-		fields					= NaN;
-		defaultdimension		= 0;
-		default_id				= NaN;
-		covariance				= NaN;
-		timecovariance			= NaN;
-		stochastictimestep   = 0;
-		randomflag				= 1;
-	end
-	methods
-		function self = stochasticforcing(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.default_id = project3d(md,'vector',self.default_id,'type','element');
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-			self.isstochasticforcing	= 0; %stochasticforcing is turned off by default
-			self.randomflag				= 1; %true randomness is implemented by default
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~self.isstochasticforcing, return; end
-
-			num_fields = numel(self.fields);
-			if(self.stochastictimestep==0)
-				md.stochasticforcing.stochastictimestep = md.timestepping.time_step; %by default: stochastictimestep set to ISSM time step
-			end
-
-
-			if(numel(size(self.covariance)==3))
-				numtcovmat = numel(self.covariance(1,1,:)); %number of covariance matrices in time
-				lsCovmats = {};
-				for ii=[1:numtcovmat] %loop over 3rd dimension
-					lsCovmats{ii} = self.covariance(:,:,ii);
-      			%Check that covariance matrix is positive definite
-      			try
-      				chol(self.covariance(:,:,ii));
-      			catch
-      				error('an entry in md.stochasticforcing.covariance is not positive definite');
-					end
-				end
-			elseif(numel(size(self.covariance)==2))
-				numtcovmat = 1; %number of covariance matrices in time
-				lsCovmats = {self.covariance};
-   			%Check that covariance matrix is positive definite
-   			try
-   				chol(self.covariance);
-   			catch
-   				error('md.stochasticforcing.covariance is not positive definite');
-   			end
-			end
-
-			%Check that all fields agree with the corresponding md class and if any field needs the default params
-			checkdefaults	= false; %need to check defaults only if one of the fields does not have its own dimensionality
-			structstoch		= structstochforcing();
-			% Check if hydrolgyarmapw is used
-			if(strcmp(class(md.hydrology),'hydrologyarmapw') && md.transient.ishydrology==1)
-				ispwHydroarma = 1;
-			else
-				ispwHydroarma = 0;
-			end
-			for field=self.fields
-				%Checking agreement of classes
-				if(contains(field,'SMBarma'))
-					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
-					if~(isequal(class(md.smb),char(mdname)))
-						error('md.smb does not agree with stochasticforcing field %s', char(field));
-					end
-				end
-				if(contains(field,'SMBforcing'))
-					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
-					if~(isequal(class(md.smb),char(mdname)))
-						error('md.smb does not agree with stochasticforcing field %s', char(field));
-					end
-				end
-				if(contains(field,'FrontalForcings'))
-					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
-					if~(isequal(class(md.frontalforcings),char(mdname)))
-						error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
-					end
-				end
-				if(contains(field,'Calving'))
-					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
-					if~(isequal(class(md.calving),char(mdname)))
-						error('md.calving does not agree with stochasticforcing field %s', char(field));
-					end
-				end
-				if(contains(field,'BasalforcingsFloatingice'))
-					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
-					if~(isequal(class(md.basalforcings),char(mdname)))
-						error('md.basalforcings does not agree with stochasticforcing field %s', char(field));
-					end
-				end
-				if(contains(field,'BasalforcingsSpatialDeepwaterMeltingRate'))
-					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
-					if~(isequal(class(md.basalforcings),char(mdname)))
-						error('md.basalforcings does not agree with stochasticforcing field %s', char(field));
-					end
-				end
-				if(contains(field,'BasalforcingsDeepwaterMeltingRatearma'))
-					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
-					if~(isequal(class(md.basalforcings),char(mdname)))
-						error('md.basalforcings does not agree with stochasticforcing field %s', char(field));
-					end
-				end
-				if(contains(field,'WaterPressure'))
-
-					mdnames = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
-					found   = 0;
-					for(ii=[1:numel(mdnames)])
-						if(isequal(class(md.friction),char(mdnames{ii}))) found=1; end
-					end
-					if(found==0)
-						error('md.friction does not agree with stochasticforcing field %s', char(field));
-					end
-					if(strcmp(class(md.friction),'friction') || strcmp(class(md.friction),'frictionschoof') || strcmp(class(md.friction),'frictioncoulomb'))
-						if(md.friction.coupling~=0 && md.friction.coupling~=1 && md.friction.coupling~=2)
-							error('stochasticforcing field %s is only implemented for cases md.friction.coupling 0 or 1 or 2', char(field));
-						end
-					end
-					if(strcmp(class(md.friction),'friction'))
-						if(any(md.friction.q==0))
-							error('stochasticforcing field %s requires non-zero q exponent',char(field));
-						end
-					end
-				end
-				%Checking for specific dimensions
-				if ~(strcmp(field,'SMBarma') || strcmp(field,'FrontalForcingsRignotarma') || strcmp(field,'BasalforcingsDeepwaterMeltingRatearma') || strcmp(field,'FrontalForcingsSubglacialDischargearma') || ((strcmp(field,'FrictionWaterPressure') && ispwHydroarma)))
-					checkdefaults = true; %field with non-specific dimensionality
-				end
-			end
-			%Retrieve all the field dimensionalities
-			dimensions = self.defaultdimension*ones(1,num_fields);
-			indSMBarma = -1; %about to check for index of SMBarma
-			indTFarma  = -1; %about to check for index of FrontalForcingsRignotarma
-			indSdarma  = -1; %about to check for index of SubglacialDischargearma
-			indBDWarma = -1; %about to check for index of BasalforcingsDeepwaterMeltingRatearma
-			indPwarma  = -1; %about to check for index of hydrologyarmapw
-			
-
-			if any(contains(self.fields,'SMBarma'))
-				indSMBarma = find(contains(self.fields,'SMBarma')); %index of SMBarma, now check for consistency with other arma timesteps 
-				dimensions(indSMBarma) = md.smb.num_basins;
-				if(md.smb.arma_timestep<self.stochastictimestep)
-					error('SMBarma cannot have a timestep shorter than stochastictimestep');
-				end
-			end
-			if any(contains(self.fields,'FrontalForcingsRignotarma'))
-				indTFarma	= find(contains(self.fields,'FrontalForcingsRignotarma')); %index of TFarma, now check for consistency with other arma timesteps 
-				dimensions(indTFarma) = md.frontalforcings.num_basins;
-				if(md.frontalforcings.arma_timestep<self.stochastictimestep)
-					error('FrontalForcingsRignotarma cannot have a timestep shorter than stochastictimestep');
-				end
-			end
-			if any(contains(self.fields,'FrontalForcingsSubglacialDischargearma'))
-				indSdarma	= find(contains(self.fields,'FrontalForcingsSubglacialDischargearma')); %index of Sdarma, now check for consistency with other arma timesteps 
-				dimensions(indSdarma) = md.frontalforcings.num_basins;
-				if(md.frontalforcings.sd_arma_timestep<self.stochastictimestep)
-					error('FrontalForcingsSubglacialDischargearma cannot have a timestep shorter than stochastictimestep');
-				end
-			end
-			if any(contains(self.fields,'BasalforcingsDeepwaterMeltingRatearma'))
-				indBDWarma	= find(contains(self.fields,'BasalforcingsDeepwaterMeltingRatearma')); %index of BDWarma, now check for consistency with other arma timesteps 
-				dimensions(indBDWarma) = md.basalforcings.num_basins;
-				if(md.basalforcings.arma_timestep<self.stochastictimestep)
-					error('BasalforcingsDeepwaterMeltingRatearma cannot have a timestep shorter than stochastictimestep');
-				end
-			end
-			if (any(contains(self.fields,'FrictionWaterPressure')) && ispwHydroarma)
-				indPwarma	= find(contains(self.fields,'FrictionWaterPressure')); %index of Pwarma, now check for consistency with other arma timesteps 
-				dimensions(indPwarma) = md.hydrology.num_basins;
-				if(md.hydrology.arma_timestep<self.stochastictimestep)
-					error('hydrologyarmapw cannot have a timestep shorter than stochastictimestep');
-				end
-			end
-			size_tot = sum(dimensions);
-
-			%%% Check consistency between ARMA models %%%
-			if(indBDWarma~=-1)
-				if(indPwarma~=-1)
-					if(md.basalforcings.arma_timestep~=md.hydrology.arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indBDWarma-1)):sum(dimensions(1:indBDWarma)),1+sum(dimensions(1:indPwarma-1)):sum(dimensions(1:indPwarma))),1,[]);
-							if any(crossentries~=0)
-								error('BasalforcingsDeepwaterMeltingRatearma and hydrologyarmapw have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				elseif(indSdarma~=-1)
-					if(md.frontalforcings.sd_arma_timestep~=md.basalforcings.arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indSdarma-1)):sum(dimensions(1:indSdarma)),1+sum(dimensions(1:indBDWarma-1)):sum(dimensions(1:indBDWarma))),1,[]);
-							if any(crossentries~=0)
-								error('FrontalForcingsSubglacialDischargearma and BasalforcingsDeepwaterMeltingRatearma have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				elseif(indSMBarma~=-1)
-					if(md.smb.arma_timestep~=md.basalforcings.arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indSMBarma-1)):sum(dimensions(1:indSMBarma)),1+sum(dimensions(1:indBDWarma-1)):sum(dimensions(1:indBDWarma))),1,[]);
-							if any(crossentries~=0)
-								error('SMBarma and BasalforcingsDeepwaterMeltingRatearma have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				elseif(indTFarma~=-1)
-					if(md.frontalforcings.arma_timestep~=md.basalforcings.arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indTFarma-1)):sum(dimensions(1:indTFarma)),1+sum(dimensions(1:indBDWarma-1)):sum(dimensions(1:indBDWarma))),1,[]);
-							if any(crossentries~=0)
-								error('FrontalForcingsRignotarma and BasalforcingsDeepwaterMeltingRatearma have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				end
-			elseif(indPwarma~=-1)
-				if(indSdarma~=-1)
-					if(md.frontalforcings.sd_arma_timestep~=md.hydrology.arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indSdarma-1)):sum(dimensions(1:indSdarma)),1+sum(dimensions(1:indPwarma-1)):sum(dimensions(1:indPwarma))),1,[]);
-							if any(crossentries~=0)
-								error('FrontalForcingsSubglacialDischargearma and hydrologyarmapw have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				elseif(indSMBarma~=-1)
-					if(md.smb.arma_timestep~=md.hydrology.arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indSMBarma-1)):sum(dimensions(1:indSMBarma)),1+sum(dimensions(1:indPwarma-1)):sum(dimensions(1:indPwarma))),1,[]);
-							if any(crossentries~=0)
-								error('SMBarma and hydrologyarmapw have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				elseif(indTFarma~=-1)
-					if(md.frontalforcings.arma_timestep~=md.hydrology.arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indTFarma-1)):sum(dimensions(1:indTFarma)),1+sum(dimensions(1:indPwarma-1)):sum(dimensions(1:indPwarma))),1,[]);
-							if any(crossentries~=0)
-								error('FrontalForcingsRignotarma and hydrologyarmapw have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				end
-			elseif(indSdarma~=-1)
-				if(indSMBarma~=-1)
-					if(md.smb.arma_timestep~=md.frontalforcings.sd_arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indSMBarma-1)):sum(dimensions(1:indSMBarma)),1+sum(dimensions(1:indSdarma-1)):sum(dimensions(1:indSdarma))),1,[]);
-							if any(crossentries~=0)
-								error('SMBarma and FrontalForcingsSubglacialDischargearma have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				elseif(indTFarma~=-1)
-					if(md.frontalforcings.sd_arma_timestep~=md.frontalforcings.arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indSdarma-1)):sum(dimensions(1:indSdarma)),1+sum(dimensions(1:indTFarma-1)):sum(dimensions(1:indTFarma))),1,[]);
-							if any(crossentries~=0)
-								error('FrontalForcingsRignotarma and FrontalForcingsSubglacialDischargearma have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				end
-			elseif(indSMBarma~=-1)
-				if(indTFarma~=-1)
-					if(md.smb.arma_timestep~=md.frontalforcings.arma_timestep)
-						for(ii=[1:numel(lsCovmats)])
-							covm = lsCovmats{ii};
-							crossentries = reshape(covm(1+sum(dimensions(1:indSMBarma-1)):sum(dimensions(1:indSMBarma)),1+sum(dimensions(1:indTFarma-1)):sum(dimensions(1:indTFarma))),1,[]);
-							if any(crossentries~=0)
-								error('SMBarma and FrontalForcingsRignotarma have different arma_timestep and non-zero covariance');
-							end
-						end
-					end
-				end
-			end
-			%%% End of consistency checks between ARMA models %%%
-
-			md = checkfield(md,'fieldname','stochasticforcing.isstochasticforcing','values',[0 1]);
-			md = checkfield(md,'fieldname','stochasticforcing.fields','numel',num_fields,'cell',1,'values',supportedstochforcings());
-			md = checkfield(md,'fieldname','stochasticforcing.covariance','NaN',1,'Inf',1,'size',[size_tot,size_tot,numtcovmat]); %global covariance matrix
-			md = checkfield(md,'fieldname','stochasticforcing.stochastictimestep','NaN',1,'Inf',1,'>=',md.timestepping.time_step);
-			md = checkfield(md,'fieldname','stochasticforcing.randomflag','numel',[1],'values',[0 1]);
-			if(numtcovmat>1) %check the time steps at which each covariance matrix starts to be applied
-				md = checkfield(md,'fieldname','stochasticforcing.timecovariance','NaN',1,'Inf',1,'>=',md.timestepping.start_time,'<=',md.timestepping.final_time,'size',[1,numtcovmat]);
-			end
-			if(checkdefaults) %need to check the defaults
-				md = checkfield(md,'fieldname','stochasticforcing.defaultdimension','numel',1,'NaN',1,'Inf',1,'>',0);
-				md = checkfield(md,'fieldname','stochasticforcing.default_id','Inf',1,'>=',0,'<=',self.defaultdimension,'size',[md.mesh.numberofelements,1]);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   stochasticforcing parameters:'));
-			fielddisplay(self,'isstochasticforcing','is stochasticity activated?');
-			fielddisplay(self,'fields','fields with stochasticity applied, ex: [{''SMBarma''}], or [{''SMBforcing''},{''DefaultCalving''}]');
-			fielddisplay(self,'defaultdimension','dimensionality of the noise terms (does not apply to fields with their specific dimension)');
-			fielddisplay(self,'default_id','id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)');
-			fielddisplay(self,'covariance',{'covariance matrix for within- and between-fields covariance (units must be squared field units)','multiple matrices can be concatenated along 3rd dimension to apply different covariances in time'}); 
-			fielddisplay(self,'timecovariance','starting dates at which covariances apply (only applicabe if multiple covariance matrices are prescribed)'); 
-			fielddisplay(self,'stochastictimestep','timestep at which new stochastic noise terms are generated (default: md.timestepping.time_step)');
-			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
-			disp('Available fields:');
-			for field=supportedstochforcings()
-				fprintf('   %s\n',string(field));
-			end
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-			num_fields = numel(self.fields);
-
-			WriteData(fid,prefix,'object',self,'fieldname','isstochasticforcing','format','Boolean');
-			if ~self.isstochasticforcing 
-				return
-			else
-
-				if(self.stochastictimestep==0)
-					disp('      stochasticforcing.stocahstictimestep not specified: set to md.timestepping.time_step');
-					self.stochastictimestep = md.timestepping.time_step; %by default: stochastictimestep set to ISSM time step
-				end
-
-				% Check if hydrolgyarmapw is used
-				if(strcmp(class(md.hydrology),'hydrologyarmapw') && md.transient.ishydrology==1)
-         	   ispwHydroarma = 1;
-         	else
-         	   ispwHydroarma = 0;
-         	end
-				%Retrieve dimensionality of each field
-				dimensions = self.defaultdimension*ones(1,num_fields);
-				ind = 1;
-				for field=self.fields
-					%Checking for specific dimensions
-					if(strcmp(field,'SMBarma'))
-						dimensions(ind) = md.smb.num_basins;
-					end
-					if(strcmp(field,'FrontalForcingsRignotarma'))
-						dimensions(ind) = md.frontalforcings.num_basins;
-					end
-					if(strcmp(field,'FrontalForcingsSubglacialDischargearma'))
-						dimensions(ind) = md.frontalforcings.num_basins;
-					end
-					if(strcmp(field,'BasalforcingsDeepwaterMeltingRatearma'))
-						dimensions(ind) = md.basalforcings.num_basins;
-					end
-					if(strcmp(field,'BasalforcingsDeepwaterMeltingRatearma'))
-						dimensions(ind) = md.basalforcings.num_basins;
-					end
-					if(strcmp(field,'FrictionWaterPressure') && ispwHydroarma)
-						dimensions(ind) = md.hydrology.num_basins;
-				   end
-					ind = ind+1;
-				end
-
-   			if(numel(size(self.covariance))==3)
-   				[nrow,ncol,numtcovmat] = size(self.covariance);
-   				lsCovmats = {};
-   				for ii=[1:numtcovmat] %loop over 3rd dimension
-   					lsCovmats{ii} = self.covariance(:,:,ii);
-   				end
-					if(md.timestepping.interp_forcing==1)
-					   disp('WARNING: md.timestepping.interp_forcing is 1, but be aware that there is no interpolation between covariance matrices');
-					   disp('         the changes between covariance matrices occur at the time steps specified in md.stochasticforcing.timecovariance');
-					end
-				elseif(numel(size(self.covariance)==2))
-   				[nrow,ncol] = size(self.covariance);
-   				numtcovmat = 1; %number of covariance matrices in time
-   				lsCovmats = {self.covariance};
-   			end
-   
-				%Scaling covariance matrix (scale column-by-column and row-by-row)
-				scaledfields = {'BasalforcingsDeepwaterMeltingRatearma','BasalforcingsSpatialDeepwaterMeltingRate','DefaultCalving','FloatingMeltRate','SMBarma','SMBforcing'}; %list of fields that need scaling *1/yts
-				tempcovariance2d = zeros(numtcovmat,sum(nrow*ncol)); %covariance matrices in 2d array
-				% Loop over covariance matrices %
-				for kk=[1:numtcovmat]
-					kkcov = self.covariance(:,:,kk); %extract covariance at index kk
-					% Loop over the fields %
-					for i=1:num_fields
-						if any(strcmp(scaledfields,self.fields(i)))
-							inds = [1+sum(dimensions(1:i-1)):1:sum(dimensions(1:i))];
-							for row=inds %scale rows corresponding to scaled field
-								kkcov(row,:) = 1./yts*kkcov(row,:);
-							end
-							for col=inds %scale columns corresponding to scaled field
-								kkcov(:,col) = 1./yts*kkcov(:,col);
-							end
-						end
-					end
-					% Save scaled covariance %
-					for rr=[1:nrow]
-						ind0 = 1+(rr-1)*ncol;
-						tempcovariance2d(kk,ind0:ind0+ncol-1) = kkcov(rr,:);
-					end
-				end
-				%Set dummy default_id vector if defaults not used
-				if isnan(self.default_id)
-					self.default_id = zeros(md.mesh.numberofelements,1);
-				end
-				%Set dummy timecovariance vector if a single covariance matrix is used
-				if(numtcovmat==1)
-					self.timecovariance = [md.timestepping.start_time];
-				end
-
-				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
-				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
-				WriteData(fid,prefix,'data',dimensions,'name','md.stochasticforcing.dimensions','format','IntMat');
-				WriteData(fid,prefix,'object',self,'fieldname','default_id','data',self.default_id-1,'format','IntMat','mattype',2); %0-indexed
-				WriteData(fid,prefix,'object',self,'fieldname','defaultdimension','format','Integer');
-				WriteData(fid,prefix,'data',numtcovmat,'name','md.stochasticforcing.num_timescovariance','format','Integer');
-				WriteData(fid,prefix,'data',tempcovariance2d,'name','md.stochasticforcing.covariance','format','DoubleMat');
-				WriteData(fid,prefix,'object',self,'fieldname','timecovariance','format','DoubleMat','scale',yts);
-				WriteData(fid,prefix,'object',self,'fieldname','stochastictimestep','format','Double','scale',yts);
-				WriteData(fid,prefix,'object',self,'fieldname','randomflag','format','Boolean');
-			end
-		end % }}}
-	end
-end
-function list = supportedstochforcings() % {{{
-	% Defines list of fields supported
-	% by the class md.stochasticforcing
-
-	list = structstochforcing();
-	list = list.fields;
-end % }}}
-function structure = structstochforcing() % {{{
-	% Defines structure with list of fields
-	% supported and corresponding md names
-	structure.fields = {...
-		'BasalforcingsDeepwaterMeltingRatearma',...
-		'BasalforcingsSpatialDeepwaterMeltingRate',...
-		'DefaultCalving',...
-		'FloatingMeltRate',...
-		'FrictionWaterPressure',...
-		'FrictionWaterPressure',...
-		'FrictionWaterPressure',...
-		'FrontalForcingsRignotarma',...
-		'FrontalForcingsSubglacialDischargearma',...
-		'SMBarma',...
-		'SMBforcing'
-		};
-	structure.mdnames = {...
-		'linearbasalforcingsarma',...
-		'spatiallinearbasalforcings',...
-		'calving',...
-		'basalforcings',...
-		'friction',...
-		'frictioncoulomb',...
-		'frictionschoof',...
-		'frontalforcingsrignotarma',...
-		'frontalforcingsrignotarma',...
-		'SMBarma',...
-		'SMBforcing'
-	};
-end % }}}
Index: sm/trunk/src/m/classes/stochasticforcing.py
===================================================================
--- /issm/trunk/src/m/classes/stochasticforcing.py	(revision 28275)
+++ 	(revision )
@@ -1,376 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class stochasticforcing(object):
-    """stochasticforcing class definition
-
-    Usage:
-        stochasticforcing = stochasticforcing()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.isstochasticforcing = 0
-        self.fields = np.nan
-        self.defaultdimension = 0
-        self.default_id = np.nan
-        self.covariance = np.nan
-        self.timecovariance = np.nan
-        self.stochastictimestep = 0
-        self.randomflag = 1
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise RuntimeError('constructor not supported for stochasticforcing')
-
-    def __repr__(self):  # {{{
-        s = '   stochasticforcing parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'isstochasticforcing', 'is stochasticity activated?'))
-        s += '{}\n'.format(fielddisplay(self, 'fields', 'fields with stochasticity applied, ex: [\'SMBautoregression\'], or [\'SMBforcing\',\'DefaultCalving\']'))
-        s += '{}\n'.format(fielddisplay(self, 'defaultdimension', 'dimensionality of the noise terms (does not apply to fields with their specific dimension)'))
-        s += '{}\n'.format(fielddisplay(self, 'default_id', 'id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)'))
-        s += '{}\n'.format(fielddisplay(self, 'covariance', 'covariance matrix for within- and between-fields covariance (units must be squared field units),multiple matrices can be concatenated along 3rd dimension to apply different covariances in time'))
-        s += '{}\n'.format(fielddisplay(self, 'timecovariance', 'starting dates at which covariances apply (only applicabe if multiple covariance matrices are prescribed)'))
-        s += '{}\n'.format(fielddisplay(self, 'stochastictimestep', 'timestep at which new stochastic noise terms are generated (default: md.timestepping.time_step)'))
-        s += '{}\n'.format(fielddisplay(self, 'randomflag', 'whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)'))
-        s += 'Available fields:\n'
-        s += '   BasalforcingsDeepwaterMeltingRatearma\n'
-        s += '   BasalforcingsSpatialDeepwaterMeltingRate\n'
-        s += '   DefaultCalving\n'
-        s += '   FloatingMeltRate\n'
-        s += '   FrictionWaterPressure\n'
-        s += '   FrictionCoulombWaterPressure\n'
-        s += '   FrictionSchoofWaterPressure\n'
-        s += '   FrontalForcingsRignotarma (thermal forcing)\n'
-        s += '   FrontalForcingsSubglacialDischargearma\n'
-        s += '   SMBarma\n'
-        s += '   SMBforcing\n'
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Type of stabilization used
-        self.isstochasticforcing = 0  # stochasticforcing is turned off by default
-        self.fields = []  # Need to initialize to list to avoid "RuntimeError: object of type 'float' has no len()" on import of class
-        self.randomflag = 1  # true randomness is implemented by default
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if not self.isstochasticforcing:
-            return md
-
-        num_fields = len(self.fields)
-        if self.stochastictimestep == 0:
-            md.stochasticforcing.stochastictimestep = md.timestepping.time_step #by default: stochastictimestep set to ISSM time step
-            print('      stochasticforcing.stocahstictimestep not specified: set to md.timestepping.time_step')
-
-        if(len(np.shape(self.covariance))==3):
-           numtcovmat = np.shape(self.covariance)[2] #number of covariance matrices in time
-           lsCovmats = []
-           for ii in range(numtcovmat):
-               lsCovmats.append(self.covariance[:,:,ii])
-               try:
-                   np.linalg.cholesky(self.covariance[:,:,ii])
-               except:
-                   raise TypeError('an entry in md.stochasticforcing.covariance is not positive definite')
-        elif(len(np.shape(self.covariance))==2):
-            numtcovmat = 1
-            lsCovmats = [self.covariance]
-            # Check that covariance matrix is positive definite (this is done internally by linalg)
-            try:
-                np.linalg.cholesky(self.covariance)
-            except:
-                raise TypeError('md.stochasticforcing.covariance is not positive definite')
-
-        # Check that all fields agree with the corresponding md class and if any field needs the default params
-        checkdefaults = False  # Need to check defaults only if one of the fields does not have its own dimensionality
-        structstoch = self.structstochforcing()
-        # Check if hydrologyarmapw is used
-        if((type(md.hydrology).__name__ == 'hydrologyarmapw') and md.transient.ishydrology==1):
-            ispwHydroarma = 1
-        else:
-            ispwHydroarma = 0
-        for field in self.fields:
-            # Checking agreement of classes
-            if 'SMBarma' in field:
-                mdname = structstoch[field]
-                if type(md.smb).__name__ != mdname:
-                    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
-            if 'SMBforcing' in field:
-                mdname = structstoch[field]
-                if type(md.smb).__name__ != mdname:
-                    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
-            if 'FrontalForcings' in field:
-                mdname = structstoch[field]
-                if type(md.frontalforcings).__name__ != mdname:
-                    raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
-            if 'Calving' in field:
-                mdname = structstoch[field]
-                if type(md.calving).__name__ != mdname:
-                    raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(field))
-            if 'BasalforcingsFloatingice' in field:
-                mdname = structstoch[field]
-                if type(md.basalforcings).__name__ != mdname:
-                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))
-            if 'BasalforcingsSpatialDeepwaterMeltingRate' in field:
-                mdname = structstoch[field]
-                if type(md.basalforcings).__name__ != mdname:
-                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))
-            if 'BasalforcingsDeepwaterMeltingRatearma' in field:
-                mdname = structstoch[field]
-                if type(md.basalforcings).__name__ != mdname:
-                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))
-            if 'WaterPressure' in field:
-                #mdname = structstoch[field]
-                mdnames = ['friction','frictioncoulomb','frictionschoof']
-                found   = 0
-                for ii in range(len(mdnames)):
-                    if type(md.friction).__name__ == mdnames[ii]:
-                        found = 1
-                if not found:
-                    raise TypeError('md.friction does not agree with stochasticforcing field {}'.format(field))
-                #if (type(md.friction).__name__ != mdname):
-                #    raise TypeError('md.friction does not agree with stochasticforcing field {}'.format(field))
-                if type(md.friction).__name__ == 'friction' or type(md.friction).__name__ == 'frictionschoof' or type(md.friction).__name__=='frictioncoulomb':
-                    if md.friction.coupling not in[0, 1, 2]:
-                        raise TypeError('stochasticforcing field {} is only implemented for cases md.friction.coupling 0 or 1 or 2'.format(field))
-                if type(md.friction).__name__ == 'friction':
-                    if (np.any(md.friction.q == 0)):
-                        raise TypeError('stochasticforcing field {} requires non-zero q exponent'.format(field))
-
-            # Checking for specific dimensions
-            if field not in ['SMBarma', 'FrontalForcingsRignotarma','BasalforcingsDeepwaterMeltingRatearma']  and not (field == 'FrictionWaterPressure' and ispwHydroarma == True):
-                checkdefaults = True  # field with non-specific dimensionality
-
-        # Retrieve sum of all the field dimensionalities
-        dimensions = self.defaultdimension * np.ones((num_fields))
-        indSMBarma   = -1  # About to check for index of SMBarma
-        indTFarma    = -1  # About to check for index of FrontalForcingsRignotarma
-        indSdarma    = -1  # About to check for index of FrontalForcingsSubglacialDischargearma
-        indBDWarma   = -1  # About to check for index of BasalforcingsDeepwaterMeltingRatearma
-        indPwarma    = -1  # About to check for index of hydrologyarmapw
-        if 'SMBarma' in self.fields:
-            indSMBarma = self.fields.index('SMBarma')  # Index of SMBarma, now check for consistency with other timesteps
-            dimensions[indSMBarma] = md.smb.num_basins
-            if(md.smb.arma_timestep<self.stochastictimestep):
-                raise TypeError('SMBarma cannot have a timestep shorter than stochastictimestep')
-        if 'FrontalForcingsRignotarma' in self.fields:
-            indTFarma = self.fields.index('FrontalForcingsRignotarma')  # Index of TFarma, now check for consistency with other timesteps
-            dimensions[indTFarma] = md.frontalforcings.num_basins
-            if md.frontalforcings.arma_timestep < self.stochastictimestep:
-                raise TypeError('FrontalForcingsRignotarma cannot have a timestep shorter than stochastictimestep')
-        if 'FrontalForcingsSubglacialDischargearma' in self.fields:
-            indSdarma = self.fields.index('FrontalForcingsSubglacialDischargearma')  # Index of Sdarma, now check for consistency with other timesteps
-            dimensions[indSdarma] = md.frontalforcings.num_basins
-            if md.frontalforcings.sd_arma_timestep < self.stochastictimestep:
-                raise TypeError('FrontalForcingsSubglacialDischargearma cannot have a timestep shorter than stochastictimestep')
-        if 'BasalforcingsDeepwaterMeltingRatearma' in self.fields:
-            indBDWarma = self.fields.index('BasalforcingsDeepwaterMeltingRatearma')  # Index of BDWarma, now check for consistency with other timesteps
-            dimensions[indTFarma] = md.basalforcings.num_basins
-            if md.basalforcings.arma_timestep < self.stochastictimestep:
-                raise TypeError('BasalforcingsDeepwaterMeltingRatearma cannot have a timestep shorter than stochastictimestep')
-        if 'FrictionWaterPressure' in self.fields and ispwHydroarma:
-            indPwarma = self.fields.index('FrictionWaterPressure')  # Index of Pwarma, now check for consistency with other timesteps
-            dimensions[indPwarma] = md.hydrology.num_basins
-            if md.hydrology.arma_timestep < self.stochastictimestep:
-                raise TypeError('hydrologyarmapw cannot have a timestep shorter than stochastictimestep')
-        size_tot = np.sum(dimensions)
-
-        if indBDWarma != -1:
-            if indPwarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indBDWarma]).astype(int):np.sum(dimensions[0:indBDWarma + 1]).astype(int), np.sum(dimensions[0:indPwarma]).astype(int):np.sum(dimensions[0:indPwarma + 1]).astype(int)]
-                    if md.smb.arma_timestep != md.hydrology.arma_timestep and np.any(covsum != 0):
-                        raise IOError('BasalforcingsDeepwaterMeltingRatarma and hydrologyarmapw have different arma_timestep and non-zero covariance')
-            elif indSdarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indSdarma]).astype(int):np.sum(dimensions[0:indSdarma + 1]).astype(int), np.sum(dimensions[0:indBDWarma]).astype(int):np.sum(dimensions[0:indBDWarma + 1]).astype(int)]
-                    if md.frontalforcings.sd_arma_timestep != md.basalforcings.arma_timestep and np.any(covsum != 0):
-                        raise IOError('FrontalForcingsSubglacialDischargearma and BasalforcingsDeepwaterMeltingRatearma have different arma_timestep and non-zero covariance')
-            elif indSMBarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indSMBarma]).astype(int):np.sum(dimensions[0:indSMBarma + 1]).astype(int), np.sum(dimensions[0:indBDWarma]).astype(int):np.sum(dimensions[0:indBDWarma + 1]).astype(int)]
-                    if md.smb.arma_timestep != md.basalforcings.arma_timestep and np.any(covsum != 0):
-                        raise IOError('SMBarma and BasalforcingsDeepwaterMeltingRatearma have different arma_timestep and non-zero covariance')
-            elif indTFarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indTFarma]).astype(int):np.sum(dimensions[0:indTFarma + 1]).astype(int), np.sum(dimensions[0:indBDWarma]).astype(int):np.sum(dimensions[0:indBDWarma + 1]).astype(int)]
-                    if md.frontalforcings.arma_timestep != md.basalforcings.arma_timestep and np.any(covsum != 0):
-                        raise IOError('FrontalForcingsRignotarma and BasalforcingsDeepwaterMeltingRatearma have different arma_timestep and non-zero covariance')
-        elif indPwarma != -1:
-            if indSdarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indSdarma]).astype(int):np.sum(dimensions[0:indSdarma + 1]).astype(int), np.sum(dimensions[0:indPwarma]).astype(int):np.sum(dimensions[0:indPwarma + 1]).astype(int)]
-                    if md.frontalforcings.sd_arma_timestep != md.hydrology.arma_timestep and np.any(covsum != 0):
-                        raise IOError('FrontalForingsSubglacialDischargearma and hydrologyarmapw have different arma_timestep and non-zero covariance')
-            elif indSMBarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indSMBarma]).astype(int):np.sum(dimensions[0:indSMBarma + 1]).astype(int), np.sum(dimensions[0:indPwarma]).astype(int):np.sum(dimensions[0:indPwarma + 1]).astype(int)]
-                    if md.smb.arma_timestep != md.hydrology.arma_timestep and np.any(covsum != 0):
-                        raise IOError('SMBarma and hydrologyarmapw have different arma_timestep and non-zero covariance')
-            elif indTFarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indTFarma]).astype(int):np.sum(dimensions[0:indTFarma + 1]).astype(int), np.sum(dimensions[0:indPwarma]).astype(int):np.sum(dimensions[0:indPwarma + 1]).astype(int)]
-                    if md.frontalforcings.arma_timestep != md.hydrology.arma_timestep and np.any(covsum != 0):
-                        raise IOError('FrontalForcingsRignotarma and hydrologyarmapw have different arma_timestep and non-zero covariance')
-        elif indSdarma != -1:
-            if indSMBarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indSMBarma]).astype(int):np.sum(dimensions[0:indSMBarma + 1]).astype(int), np.sum(dimensions[0:indSdarma]).astype(int):np.sum(dimensions[0:indSdarma + 1]).astype(int)]
-                    if md.smb.arma_timestep != md.frontalforcings.sd_arma_timestep and np.any(covsum != 0):
-                        raise IOError('SMBarma and FrontalForcingsSubglacialDischargearma have different arma_timestep and non-zero covariance')
-            elif indTFarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indSdarma]).astype(int):np.sum(dimensions[0:indSdarma + 1]).astype(int), np.sum(dimensions[0:indTFarma]).astype(int):np.sum(dimensions[0:indTFarma + 1]).astype(int)]
-                    if md.frontalforcings.sd_arma_timestep != md.frontalforcings.arma_timestep and np.any(covsum != 0):
-                        raise IOError('FrontalForcingsSubglacialDischargearma and FrontalForcingsRignotarma have different arma_timestep and non-zero covariance')
-        elif indSMBarma != -1:
-            if indTFarma != -1:
-                for ii in range(len(lsCovmats)):
-                    covm = lsCovmats[ii]
-                    covsum = covm[np.sum(dimensions[0:indSMBarma]).astype(int):np.sum(dimensions[0:indSMBarma + 1]).astype(int), np.sum(dimensions[0:indTFarma]).astype(int):np.sum(dimensions[0:indTFarma + 1]).astype(int)]
-                    if md.smb.arma_timestep != md.frontalforcings.arma_timestep and np.any(covsum != 0):
-                        raise IOError('SMBarma and FrontalForcingsRignotarma have different arma_timestep and non-zero covariance')
-
-        md = checkfield(md, 'fieldname', 'stochasticforcing.isstochasticforcing', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', self.supportedstochforcings())
-        md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot, numtcovmat])  # global covariance matrix
-        md = checkfield(md, 'fieldname', 'stochasticforcing.stochastictimestep', 'NaN', 1,'Inf', 1, '>=', md.timestepping.time_step)
-        md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
-        if(numtcovmat>1): #check the time steps at which each covariance matrix starts to be applie
-            md = checkfield(md, 'fieldname', 'stochasticforcing.timecovariance', 'NaN', 1, 'Inf', 1, '>=',md.timestepping.start_time,'<=',md.timestepping.final_time,'size',[1,numtcovmat])  # global covariance matrix
-        if checkdefaults:
-            md = checkfield(md, 'fieldname', 'stochasticforcing.defaultdimension', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
-            md = checkfield(md, 'fieldname', 'stochasticforcing.default_id', 'Inf', 1, 'NaN', 1, '>=', 0, '<=', self.defaultdimension, 'size', [md.mesh.numberofelements])
-        return md
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.default_id = project3d(md,'vector',self.default_id,'type','element')
-        return self
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isstochasticforcing', 'format', 'Boolean')
-        if not self.isstochasticforcing:
-            return md
-        else:
-            num_fields = len(self.fields)
-            if self.stochastictimestep == 0:
-                md.stochasticforcing.stochastictimestep = md.timestepping.time_step #by default: stochastictimestep set to ISSM time step
-            # Check if hydroarmapw is used
-            if((type(md.hydrology).__name__ == 'hydrologyarmapw') and md.transient.ishydrology==1):
-                ispwHydroarma = 1
-            else:
-                ispwHydroarma = 0
-
-            # Retrieve dimensionality of each field
-            dimensions = self.defaultdimension * np.ones((num_fields))
-            for ind, field in enumerate(self.fields):
-                # Checking for specific dimensions
-                if field == 'SMBarma':
-                    dimensions[ind] = md.smb.num_basins
-                elif field == 'FrontalForcingsRignotarma':
-                    dimensions[ind] = md.frontalforcings.num_basins
-                elif field == 'FrontalForcingsSubglacialDischargearma':
-                    dimensions[ind] = md.frontalforcings.num_basins
-                elif field == 'BasalforcingsDeepwaterMeltingRatearma':
-                    dimensions[ind] = md.basalforcings.num_basins
-                elif field == 'FrictionWaterPressure' and ispwHydroarma:
-                    dimensions[ind] = md.hydrology.num_basins
-            
-            if(len(np.shape(self.covariance))==3):
-                nrow,ncol,numtcovmat = np.shape(self.covariance)
-                lsCovmats = []
-                for ii in range(numtcovmat):
-                    lsCovmats.append(self.covariance[:,:,ii])
-                if(md.timestepping.interp_forcing==1):
-                    print('WARNING: md.timestepping.interp_forcing is 1, but be aware that there is no interpolation between covariance matrices')
-                    print('         the changes between covariance matrices occur at the time steps specified in md.stochasticforcing.timecovariance')
-            elif(len(np.shape(self.covariance))==2):
-                nrow,ncol = np.shape(self.covariance)
-                numtcovmat = 1
-                lsCovmats = [self.covariance]
-
-            # Scaling covariance matrix (scale column-by-column and row-by-row)
-            scaledfields = ['BasalforcingsDeepwaterMeltingRatearma','BasalforcingsSpatialDeepwaterMeltingRate','DefaultCalving', 'FloatingMeltRate', 'SMBarma', 'SMBforcing']  # list of fields that need scaling * 1 / yts
-            tempcovariance2d = np.zeros((numtcovmat,nrow*ncol))
-            # Loop over covariance matrices #
-            for kk in range(numtcovmat):
-                kkcov = lsCovmats[kk]
-                # Loop over the fields #
-                for i in range(num_fields):
-                    if self.fields[i] in scaledfields:
-                        inds = range(int(np.sum(dimensions[0:i])), int(np.sum(dimensions[0:i + 1])))
-                        for row in inds:  # scale rows corresponding to scaled field
-                            kkcov[row, :] = 1 / yts * kkcov[row, :]
-                        for col in inds:  # scale columns corresponding to scaled field
-                            kkcov[:, col] = 1 / yts * kkcov[:, col]
-                # Save scaled covariance #
-                for rr in range(nrow):
-                    ind0 = rr*ncol
-                    tempcovariance2d[kk,ind0:ind0+ncol] = np.copy(kkcov[rr,:])
-                    
-            # Set dummy default_id vector if defaults not used
-            if np.any(np.isnan(self.default_id)):
-                self.default_id = np.zeros(md.mesh.numberofelements)
-            # Set dummy timecovariance vector if a single covariance matrix is used
-            if(numtcovmat==1):
-                self.timecovariance = np.array([md.timestepping.start_time])
-            # Reshape dimensions as column array for marshalling
-            dimensions = dimensions.reshape(1, len(dimensions))
-
-            WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
-            WriteData(fid, prefix, 'data', dimensions, 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat', 'mattype', 2)
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'default_id', 'data', self.default_id - 1, 'format', 'IntMat', 'mattype', 2)  #12Nov2021 make sure this is zero-indexed!
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'defaultdimension', 'format', 'Integer')
-            WriteData(fid, prefix, 'data', numtcovmat, 'name', 'md.stochasticforcing.num_timescovariance', 'format', 'Integer')
-            WriteData(fid, prefix, 'data', tempcovariance2d, 'name', 'md.stochasticforcing.covariance', 'format', 'DoubleMat')
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'timecovariance', 'format', 'DoubleMat', 'scale', yts)
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'stochastictimestep', 'format', 'Double', 'scale', yts)
-            WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
-    # }}}
-
-    def supportedstochforcings(self):  # {{{
-        """Defines list of fields supported by the class md.stochasticforcing
-        """
-        list1 = self.structstochforcing()
-        list1 = list1.keys()
-        return list(list1)
-    # }}}
-
-    def structstochforcing(self):  # {{{
-        """Defines dictionary with list of fields
-           supported and corresponding md names
-        """
-        structure = {'BasalforcingsDeepwaterMeltingRatearma': 'linearbasalforcingsarma',
-                     'BasalforcingsSpatialDeepwaterMeltingRate': 'spatiallinearbasalforcings',
-                     'DefaultCalving': 'calving',
-                     'FloatingMeltRate': 'basalforcings',
-                     'FrictionWaterPressure': 'friction',
-                     'FrictionWaterPressure': 'frictioncoulomb',
-                     'FrictionWaterPressure': 'frictionschoof',
-                     'FrontalForcingsRignotarma': 'frontalforcingsrignotarma',
-                     'FrontalForcingsSubglacialDischargearma': 'frontalforcingsrignotarma',
-                     'SMBarma': 'SMBarma',
-                     'SMBforcing': 'SMBforcing'}
-        return structure
-    # }}}
Index: sm/trunk/src/m/classes/stressbalance.js
===================================================================
--- /issm/trunk/src/m/classes/stressbalance.js	(revision 28275)
+++ 	(revision )
@@ -1,218 +1,0 @@
-//STRESSBALANCE class definition
-//
-//   Usage:
-//      stressbalance=new stressbalance();
-
-function stressbalance (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//maximum of non-linear iterations.
-		this.maxiter=100;
-
-		//Convergence criterion: absolute, relative and residual
-		this.restol=Math.pow(10,-4); 
-		this.reltol=0.01;
-		this.abstol=10;
-
-		this.FSreconditioning=Math.pow(10,13);
-		this.shelf_dampening=0;
-
-		//Penalty factor applied kappa=max(stiffness matrix)*10^penalty_factor
-		this.penalty_factor=3;
-
-		//Stop the iterations of rift if below a threshold
-		this.rift_penalty_threshold=0;
-
-		//in some solutions, it might be needed to stop a run when only
-		//a few constraints remain unstable. For thermal computation, this
-		//parameter is often used.
-		this.rift_penalty_lock=10;
-
-		//output default:
-		this.requested_outputs=['default'];
-
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   StressBalance solution parameters:'));
-
-		console.log(sprintf('\n      %s','Convergence criteria:'));
-		fielddisplay(this,'restol','mechanical equilibrium residual convergence criterion');
-		fielddisplay(this,'reltol','velocity relative convergence criterion, NaN: not applied');
-		fielddisplay(this,'abstol','velocity absolute convergence criterion, NaN: not applied');
-		fielddisplay(this,'isnewton',"0: Picard's fixed point, 1: Newton's method, 2: hybrid");
-		fielddisplay(this,'maxiter','maximum number of nonlinear iterations');
-
-		console.log(sprintf('\n      %s','boundary conditions:'));
-		fielddisplay(this,'spcvx','x-axis velocity constraint (NaN means no constraint) [m/yr]');
-		fielddisplay(this,'spcvy','y-axis velocity constraint (NaN means no constraint) [m/yr]');
-		fielddisplay(this,'spcvz','z-axis velocity constraint (NaN means no constraint) [m/yr]');
-
-		console.log(sprintf('\n      %s','Rift options:'));
-		fielddisplay(this,'rift_penalty_threshold','threshold for instability of mechanical constraints');
-		fielddisplay(this,'rift_penalty_lock','number of iterations before rift penalties are locked');
-
-		console.log(sprintf('\n      %s','Penalty options:'));
-		fielddisplay(this,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
-		fielddisplay(this,'vertex_pairing','pairs of vertices that are penalized');
-
-		console.log(sprintf('\n      %s','Other:'));
-		fielddisplay(this,'shelf_dampening','use dampening for floating ice ? Only for FS model');
-		fielddisplay(this,'FSreconditioning','multiplier for incompressibility equation. Only for FS model');
-		fielddisplay(this,'referential','local referential');
-		fielddisplay(this,'loadingforce','loading force applied on each point [N/m^3]');
-		fielddisplay(this,'requested_outputs','additional outputs requested');
-
-
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "stressbalance";
-	}// }}}
-	this.extrude = function(md) {//{{{
-		this.spcvx=project3d(md,'vector',this.spcvx,'type','node');
-		this.spcvy=project3d(md,'vector',this.spcvy,'type','node');
-		this.spcvz=project3d(md,'vector',this.spcvz,'type','node');
-		this.referential=project3d(md,'vector',this.referential,'type','node');
-		this.loadingforce=project3d(md,'vector',this.loadingforce,'type','node');
-		return this;
-	}//}}}
-	this.checkconsistency = function(md,solution,analyses) { //{{{
-
-		//Early return
-		if(ArrayAnyEqual(ArrayIsMember('StressbalanceAnalysis',analyses),0))return;
-
-		checkfield(md,'fieldname','stressbalance.spcvx','Inf',1,'timeseries',1);
-		checkfield(md,'fieldname','stressbalance.spcvy','Inf',1,'timeseries',1);
-		checkfield(md,'fieldname','stressbalance.spcvz','Inf',1,'timeseries',1);
-		checkfield(md,'fieldname','stressbalance.restol','size',[1, 1],'>',0,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','stressbalance.reltol','size',[1, 1]);
-		checkfield(md,'fieldname','stressbalance.abstol','size',[1, 1]);
-		checkfield(md,'fieldname','stressbalance.isnewton','numel',[1],'values',[0, 1, 2]);
-		checkfield(md,'fieldname','stressbalance.FSreconditioning','size',[1, 1],'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','stressbalance.maxiter','size',[1, 1],'>=',1);
-		checkfield(md,'fieldname','stressbalance.referential','size',[md.mesh.numberofvertices, 6]);
-		checkfield(md,'fieldname','stressbalance.loadingforce','size',[md.mesh.numberofvertices, 3]);
-		checkfield(md,'fieldname','stressbalance.requested_outputs','stringrow',1);
-
-		//singular solution
-		if(!ArrayAnyNaN(md.stressbalance.spcvx) | !ArrayAnyNaN(md.stressbalance.spcvy) |  !ArrayAnyAboveStrict(md.mask.ocean_levelset,0)){
-			md = checkmessage(md,'model is not well posed (singular). You need at least one node with fixed velocity!');
-			console.log(sprintf('\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n'));
-		}
-		//CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
-		for(var i=0;i<md.stressbalance.referential.length;i++){
-			var sum=0;
-			for(j=0;j<md.stressbalance.referential[0].length;j++)sum+=md.stressbalance.referential[i][j];
-			if (sum!=0 & sum!=6){
-				md = checkmessage(md,'Each line of stressbalance.referential should contain either only NaN values or no NaN values');
-				break;
-			}
-		}
-		//CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
-		for(var i=0;i<md.stressbalance.referential.length;i++){
-			var sum=0;
-			for(j=0;j<md.stressbalance.referential[0].length;j++)sum+=md.stressbalance.referential[i][j];
-			if(sum==0){
-				var dot=0;
-				for(j=0;j<3;j++)dot+=md.stressbalance.referential[i][j]*md.stressbalance.referential[i][j+3];
-				dot=Math.abs(dot);
-				if(dot>Math.pow(10,-18)){
-					md.checkmessage('Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal');
-					break;
-				}
-			}
-		}
-		//CHECK THAT NO rotation specified for FS Grounded ice at base
-		if (md.mesh.domaintype() == '3D' & md.flowequation.isFS){
-			for(var i=0;i<md.mask.ocean_levelset.length;i++){
-				if(md.mask.ocean_levelset[i]>0 & md.mesh.vertexonbase[i]){
-					if(!ArrayIsNan(md.stressbalance.referential[i])){
-						md.checkmessage('no referential should be specified for basal vertices of grounded ice');
-						break;
-					}
-				}
-			}
-			checkfield(md,'fieldname','stressbalance.FSreconditioning','>',0);
-		}
-	} // }}}
-	this.marshall=function(md,prefix,fid) { //{{{
-
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','vertex_pairing','format','DoubleMat','mattype',3);
-
-		var yts=md.constants.yts;
-
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','restol','format','Double');
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','reltol','format','Double');
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','abstol','format','Double','scale',1./yts);
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','isnewton','format','Integer');
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','FSreconditioning','format','Double');
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','maxiter','format','Integer');
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','shelf_dampening','format','Integer');
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','penalty_factor','format','Double');
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','rift_penalty_lock','format','Integer');
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer');
-		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1);
-
-		if (size(this.loadingforce,1)==3) {
-			WriteData(fid,prefix,'data',ArrayCol(this.loadingforce,0),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex');
-			WriteData(fid,prefix,'data',ArrayCol(this.loadingforce,1),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey');
-			WriteData(fid,prefix,'data',ArrayCol(this.loadingforce,2),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez');
-		}
-
-		//process requested outputs
-		var outputs = this.requested_outputs;
-		for (var i=0;i<outputs.length;i++){
-			if (outputs[i] == 'default') {
-				outputs.splice(i,1);
-				var newoutputs=this.defaultoutputs(md);
-				for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-			}
-		}
-		WriteData(fid,prefix,'data',outputs,'name','md.stressbalance.requested_outputs','format','StringArray');
-	}//}}}
-	this.defaultoutputs = function(md){ // {{{
-
-		var list;
-		if (md.mesh.dimension() == 3) list = ['Vx','Vy','Vz','Vel','Pressure'];
-		else if (md.mesh.dimension()==2) list = ['Vx','Vy','Vel','Pressure'];
-		else throw Error('mesh type not supported yet');
-		return list;
-
-	}//}}}
-	this.fix=function() { //{{{
-		this.abstol=NullFix(this.abstol,NaN);
-		this.rift_penalty_lock=NullFix(this.rift_penalty_lock,NaN);
-		this.referential=NullFix(this.referential,NaN);
-		this.loadingforce=NullFix(this.loadingforce,NaN);
-		this.spcvx=NullFix(this.spcvx,NaN);
-		this.spcvy=NullFix(this.spcvy,NaN);
-		this.spcvz=NullFix(this.spcvz,NaN);
-		if(this.vertex_pairing=[])this.vertex_pairing=NaN;
-	}//}}}
-	//properties 
-	// {{{
-	this.spcvx                  = NaN;
-	this.spcvy                  = NaN;
-	this.spcvz                  = NaN;
-	this.restol                 = 0;
-	this.reltol                 = 0;
-	this.abstol                 = 0;
-	this.isnewton               = 0;
-	this.FSreconditioning       = 0;
-	this.maxiter                = 0;
-	this.shelf_dampening        = 0;
-	this.vertex_pairing         = NaN;
-	this.penalty_factor         = NaN;
-	this.rift_penalty_lock      = NaN;
-	this.rift_penalty_threshold = 0;
-	this.referential            = NaN;
-	this.loadingforce           = NaN;
-	this.requested_outputs      = []
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/stressbalance.m
===================================================================
--- /issm/trunk/src/m/classes/stressbalance.m	(revision 28275)
+++ 	(revision )
@@ -1,262 +1,0 @@
-%STRESSBALANCE class definition
-%
-%   Usage:
-%      stressbalance=stressbalance();
-
-classdef stressbalance
-	properties (SetAccess=public)
-		spcvx                  = NaN;
-		spcvy                  = NaN;
-		spcvx_base             = NaN;
-		spcvy_base             = NaN;
-		spcvx_shear            = NaN;
-		spcvy_shear            = NaN;
-		spcvz                  = NaN;
-		restol                 = 0;
-		reltol                 = 0;
-		abstol                 = 0;
-		isnewton               = 0;
-		FSreconditioning       = 0;
-		maxiter                = 0;
-		shelf_dampening        = 0;
-		vertex_pairing         = NaN;
-		penalty_factor         = NaN;
-		rift_penalty_lock      = NaN;
-		rift_penalty_threshold = 0;
-		referential            = NaN;
-		loadingforce           = NaN;
-		requested_outputs      = {};
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.spcvx=project3d(md,'vector',self.spcvx,'type','node');
-			self.spcvy=project3d(md,'vector',self.spcvy,'type','node');
-			self.spcvz=project3d(md,'vector',self.spcvz,'type','node');
-			self.referential=project3d(md,'vector',self.referential,'type','node');
-			self.loadingforce=project3d(md,'vector',self.loadingforce,'type','node');
-
-			% for MOLHO
-			if md.flowequation.isMOLHO
-				self.spcvx_base=project3d(md,'vector',self.spcvx_base,'type','node');
-				self.spcvy_base=project3d(md,'vector',self.spcvy_base,'type','node');
-				self.spcvx_shear=project3d(md,'vector',self.spcvx_shear,'type','poly','degree',4);
-				self.spcvy_shear=project3d(md,'vector',self.spcvy_shear,'type','poly','degree',4);
-			end
-		end % }}}
-		function self = stressbalance(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					inputstruct=varargin{1};
-					list1 = properties('stressbalance');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
-						end
-					end
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%maximum of non-linear iterations.
-			self.maxiter=100;
-
-			%Convergence criterion: absolute, relative and residual
-			self.restol=10^-4;
-			self.reltol=0.01;
-			self.abstol=10;
-
-			self.FSreconditioning=10^13;
-			self.shelf_dampening=0;
-
-			%Penalty factor applied kappa=max(stiffness matrix)*10^penalty_factor
-			self.penalty_factor=3;
-
-			%Stop the iterations of rift if below a threshold
-			self.rift_penalty_threshold=0;
-
-			%in some solutions, it might be needed to stop a run when only
-			%a few constraints remain unstable. For thermal computation, this
-			%parameter is often used.
-			self.rift_penalty_lock=10;
-
-			%output default:
-			self.requested_outputs={'default'};
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('StressbalanceAnalysis',analyses), return; end
-			if (strcmp(solution,'TransientSolution') & md.transient.isstressbalance == 0), return; end
-
-			md = checkfield(md,'fieldname','stressbalance.spcvx','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','stressbalance.spcvy','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','stressbalance.spcvz','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','stressbalance.restol','size',[1 1],'>',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','stressbalance.reltol','size',[1 1]);
-			md = checkfield(md,'fieldname','stressbalance.abstol','size',[1 1]);
-			md = checkfield(md,'fieldname','stressbalance.isnewton','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','stressbalance.FSreconditioning','size',[1 1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','stressbalance.maxiter','size',[1 1],'>=',1);
-			md = checkfield(md,'fieldname','stressbalance.referential','size',[md.mesh.numberofvertices 6]);
-			md = checkfield(md,'fieldname','stressbalance.loadingforce','size',[md.mesh.numberofvertices 3]);
-			md = checkfield(md,'fieldname','stressbalance.requested_outputs','stringrow',1);
-			if ~any(isnan(md.stressbalance.vertex_pairing)),
-				md = checkfield(md,'fieldname','stressbalance.vertex_pairing','>',0);
-			end
-			%singular solution
-			if ((~(any(~isnan(md.stressbalance.spcvx)) | any(~isnan(md.stressbalance.spcvy)))) & ~any(md.mask.ocean_levelset>0)),
-				disp(sprintf('\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n'));
-			end
-			%CHECK THAT EACH LINE CONTAINS ONLY NAN VALUES OR NO NAN VALUES
-			if any(sum(isnan(md.stressbalance.referential),2)~=0 & sum(isnan(md.stressbalance.referential),2)~=6),
-				md = checkmessage(md,['Each line of stressbalance.referential should contain either only NaN values or no NaN values']);
-			end
-			%CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
-			if any(sum(isnan(md.stressbalance.referential),2)==0),
-				pos=find(sum(isnan(md.stressbalance.referential),2)==0);
-				if any(abs(dot(md.stressbalance.referential(pos,1:3),md.stressbalance.referential(pos,4:6),2))>eps),
-					md = checkmessage(md,['Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal']);
-				end
-			end
-			%CHECK THAT NO rotation specified for FS Grounded ice at base
-			if strcmp(domaintype(md.mesh),'3D') & md.flowequation.isFS,
-				pos=find(md.mask.ocean_levelset>0. & md.mesh.vertexonbase);
-				if any(~isnan(md.stressbalance.referential(pos,:))),
-					md = checkmessage(md,['no referential should be specified for basal vertices of grounded ice']);
-				end
-				md = checkfield(md,'fieldname','stressbalance.FSreconditioning','>',0);
-			end
-			% CHECK THIS ONLY WORKS FOR MOLHO
-			if md.flowequation.isMOLHO
-				md = checkfield(md,'fieldname','stressbalance.spcvx_base','Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','stressbalance.spcvy_base','Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','stressbalance.spcvx_shear','Inf',1,'timeseries',1);
-				md = checkfield(md,'fieldname','stressbalance.spcvy_shear','Inf',1,'timeseries',1);
-			end
-		end % }}}
-		function list=defaultoutputs(self,md) % {{{
-
-			if dimension(md.mesh)==3,
-				list = {'Vx','Vy','Vz','Vel','Pressure'};
-			elseif dimension(md.mesh)==2,
-				list = {'Vx','Vy','Vel','Pressure'};
-			else
-				error('mesh type not supported yet');
-			end
-
-		end % }}}
-		function disp(self) % {{{
-
-			disp(sprintf('   StressBalance solution parameters:'));
-
-			disp(sprintf('\n      %s','Convergence criteria:'));
-			fielddisplay(self,'restol','mechanical equilibrium residual convergence criterion');
-			fielddisplay(self,'reltol','velocity relative convergence criterion, NaN: not applied');
-			fielddisplay(self,'abstol','velocity absolute convergence criterion, NaN: not applied');
-			fielddisplay(self,'isnewton','0: Picard''s fixed point, 1: Newton''s method, 2: hybrid');
-			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
-
-			disp(sprintf('\n      %s','boundary conditions:'));
-			fielddisplay(self,'spcvx','x-axis velocity constraint (NaN means no constraint) [m/yr]');
-			fielddisplay(self,'spcvy','y-axis velocity constraint (NaN means no constraint) [m/yr]');
-			fielddisplay(self,'spcvz','z-axis velocity constraint (NaN means no constraint) [m/yr]');
-
-			disp(sprintf('\n      %s','MOLHO boundary conditions:'));
-			fielddisplay(self,'spcvx_base','x-axis basal velocity constraint (NaN means no constraint) [m/yr]');
-			fielddisplay(self,'spcvy_base','y-axis basal velocity constraint (NaN means no constraint) [m/yr]');
-			fielddisplay(self,'spcvx_shear','x-axis shear velocity constraint (NaN means no constraint) [m/yr]');
-			fielddisplay(self,'spcvy_shear','y-axis shear velocity constraint (NaN means no constraint) [m/yr]');
-
-			disp(sprintf('\n      %s','Rift options:'));
-			fielddisplay(self,'rift_penalty_threshold','threshold for instability of mechanical constraints');
-			fielddisplay(self,'rift_penalty_lock','number of iterations before rift penalties are locked');
-
-			disp(sprintf('\n      %s','Penalty options:'));
-			fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
-			fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized');
-
-			disp(sprintf('\n      %s','Other:'));
-			fielddisplay(self,'shelf_dampening','use dampening for floating ice ? Only for FS model');
-			fielddisplay(self,'FSreconditioning','multiplier for incompressibility equation. Only for FS model');
-			fielddisplay(self,'referential','local referential');
-			fielddisplay(self,'loadingforce','loading force applied on each point [N/m^3]');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','vertex_pairing','format','DoubleMat','mattype',3);
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','restol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','reltol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','abstol','format','Double','scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','isnewton','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','FSreconditioning','format','Double');
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','maxiter','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','shelf_dampening','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','penalty_factor','format','Double');
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_lock','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1);
-
-			if size(self.loadingforce,2)==3,
-				WriteData(fid,prefix,'data',self.loadingforce(:,1),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex');
-				WriteData(fid,prefix,'data',self.loadingforce(:,2),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey');
-				WriteData(fid,prefix,'data',self.loadingforce(:,3),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez');
-			end
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.stressbalance.requested_outputs','format','StringArray');
-			% for MOLHO
-			if (md.flowequation.isMOLHO)
-				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx_base','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy_base','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx_shear','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy_shear','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			end
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.stressbalance.spcvx'],self.spcvx);
-			writejs1Darray(fid,[modelname '.stressbalance.spcvy'],self.spcvy);
-			writejs1Darray(fid,[modelname '.stressbalance.spcvz'],self.spcvz);
-			writejsdouble(fid,[modelname '.stressbalance.restol'],self.restol);
-			writejsdouble(fid,[modelname '.stressbalance.reltol'],self.reltol);
-			writejsdouble(fid,[modelname '.stressbalance.abstol'],self.abstol);
-			writejsdouble(fid,[modelname '.stressbalance.isnewton'],self.isnewton);
-			writejsdouble(fid,[modelname '.stressbalance.FSreconditioning'],self.FSreconditioning);
-			writejsdouble(fid,[modelname '.stressbalance.maxiter'],self.maxiter);
-			writejsdouble(fid,[modelname '.stressbalance.shelf_dampening'],self.shelf_dampening);
-			writejs1Darray(fid,[modelname '.stressbalance.vertex_pairing'],self.vertex_pairing);
-			writejsdouble(fid,[modelname '.stressbalance.penalty_factor'],self.penalty_factor);
-			writejsdouble(fid,[modelname '.stressbalance.rift_penalty_lock'],self.rift_penalty_lock);
-			writejsdouble(fid,[modelname '.stressbalance.rift_penalty_threshold'],self.rift_penalty_threshold);
-			writejs2Darray(fid,[modelname '.stressbalance.referential'],self.referential);
-			writejs2Darray(fid,[modelname '.stressbalance.loadingforce'],self.loadingforce);
-			writejscellstring(fid,[modelname '.stressbalance.requested_outputs'],self.requested_outputs);
-
-			writejs1Darray(fid,[modelname '.stressbalance.spcvx_base'],self.spcvx_shear);
-			writejs1Darray(fid,[modelname '.stressbalance.spcvy_base'],self.spcvy_shear);
-			writejs1Darray(fid,[modelname '.stressbalance.spcvx_shear'],self.spcvx_shear);
-			writejs1Darray(fid,[modelname '.stressbalance.spcvy_shear'],self.spcvy_shear);
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/stressbalance.py
===================================================================
--- /issm/trunk/src/m/classes/stressbalance.py	(revision 28275)
+++ 	(revision )
@@ -1,217 +1,0 @@
-import sys
-
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-import MatlabFuncs as m
-from project3d import project3d
-from WriteData import WriteData
-
-
-class stressbalance(object):
-    """STRESSBALANCE class definition
-
-    Usage:
-        stressbalance = stressbalance()
-    """
-
-    def __init__(self):  # {{{
-        self.spcvx = np.nan
-        self.spcvy = np.nan
-        self.spcvx_base = np.nan
-        self.spcvy_base = np.nan
-        self.spcvx_shear = np.nan
-        self.spcvy_shear = np.nan
-        self.spcvz = np.nan
-        self.restol = 0
-        self.reltol = 0
-        self.abstol = 0
-        self.isnewton = 0
-        self.FSreconditioning = 0
-        #self.icefront = np.nan -- no longer in use
-        self.maxiter = 0
-        self.shelf_dampening = 0
-        self.vertex_pairing = np.nan
-        self.penalty_factor = np.nan
-        self.rift_penalty_lock = np.nan
-        self.rift_penalty_threshold = 0
-        self.referential = np.nan
-        self.loadingforce = np.nan
-        self.requested_outputs = []
-
-        # Set defaults
-        self.setdefaultparameters()
-
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   StressBalance solution parameters:\n'
-        s += '      Convergence criteria:\n'
-        s += '{}\n'.format(fielddisplay(self, 'restol', 'mechanical equilibrium residual convergence criterion'))
-        s += '{}\n'.format(fielddisplay(self, 'reltol', 'velocity relative convergence criterion, NaN: not applied'))
-        s += '{}\n'.format(fielddisplay(self, 'abstol', 'velocity absolute convergence criterion, NaN: not applied'))
-        s += '{}\n'.format(fielddisplay(self, 'isnewton', '0: Picard\'s fixed point, 1: Newton\'s method, 2: hybrid'))
-        s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of nonlinear iterations'))
-        s += '      boundary conditions:\n'
-        s += '{}\n'.format(fielddisplay(self, 'spcvx', 'x-axis velocity constraint (NaN means no constraint) [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'spcvy', 'y-axis velocity constraint (NaN means no constraint) [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'spcvz', 'z-axis velocity constraint (NaN means no constraint) [m / yr]'))
-        #s += '{}\n'.format(fielddisplay(self, 'icefront', 'segments on ice front list (last column 0: Air, 1: Water, 2: Ice'))
-        s += '      MOLHO boundary conditions:\n'
-        s += '{}\n'.format(fielddisplay(self, 'spcvx_base', 'x-axis basal velocity constraint (NaN means no constraint) [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'spcvy_base', 'y-axis basal velocity constraint (NaN means no constraint) [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'spcvx_shear', 'x-axis shear velocity constraint (NaN means no constraint) [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'spcvy_shear', 'y-axis shear velocity constraint (NaN means no constraint) [m / yr]'))
-        s += '      Rift options:\n'
-        s += '{}\n'.format(fielddisplay(self, 'rift_penalty_threshold', 'threshold for instability of mechanical constraints'))
-        s += '{}\n'.format(fielddisplay(self, 'rift_penalty_lock', 'number of iterations before rift penalties are locked'))
-        s += '      Penalty options:\n'
-        s += '{}\n'.format(fielddisplay(self, 'penalty_factor', 'offset used by penalties: penalty = Kmax * 10^offset'))
-        s += '{}\n'.format(fielddisplay(self, 'vertex_pairing', 'pairs of vertices that are penalized'))
-        s += '      Other:\n'
-        s += '{}\n'.format(fielddisplay(self, 'shelf_dampening', 'use dampening for floating ice ? Only for FS model'))
-        s += '{}\n'.format(fielddisplay(self, 'FSreconditioning', 'multiplier for incompressibility equation. Only for FS model'))
-        s += '{}\n'.format(fielddisplay(self, 'referential', 'local referential'))
-        s += '{}\n'.format(fielddisplay(self, 'loadingforce', 'loading force applied on each point [N/m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.spcvx = project3d(md, 'vector', self.spcvx, 'type', 'node')
-        self.spcvy = project3d(md, 'vector', self.spcvy, 'type', 'node')
-        self.spcvz = project3d(md, 'vector', self.spcvz, 'type', 'node')
-        self.referential = project3d(md, 'vector', self.referential, 'type', 'node')
-        self.loadingforce = project3d(md, 'vector', self.loadingforce, 'type', 'node')
-
-        if md.flowequation.isMOLHO:
-            self.spcvx_base = project3d(md, 'vector', self.spcvx_base, 'type', 'node')
-            self.spcvy_base = project3d(md, 'vector', self.spcvy_base, 'type', 'node')
-            self.spcvx_shear = project3d(md, 'vector', self.spcvx_shear, 'type', 'poly', 'degree', 4)
-            self.spcvy_shear = project3d(md, 'vector', self.spcvy_shear, 'type', 'poly', 'degree', 4)
-
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Maximum of non-linear iterations
-        self.maxiter = 100
-
-        # Convergence criterion: absolute, relative and residual
-        self.restol = pow(10, -4)
-        self.reltol = 0.01
-        self.abstol = 10
-
-        self.FSreconditioning = pow(10, 13)
-        self.shelf_dampening = 0
-
-        # Penalty factor applied kappa = max(stiffness matrix) * 1.0^penalty_factor
-        self.penalty_factor = 3
-
-        # Stop the iterations of rift if below a threshold
-        self.rift_penalty_threshold = 0
-
-        # In some solutions, it might be needed to stop a run when only a few 
-        # constraints remain unstable. For thermal computation, this parameter 
-        # is often used.
-        self.rift_penalty_lock = 10
-
-        # Output default
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        if md.mesh.dimension() == 3:
-            list = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
-        else:
-            list = ['Vx', 'Vy', 'Vel', 'Pressure']
-        return list
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if 'StressbalanceAnalysis' not in analyses:
-            return md
-        if solution == 'TransientSolution' and not md.transient.isstressbalance:
-            return md
-
-        md = checkfield(md, 'fieldname', 'stressbalance.spcvx', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'stressbalance.spcvy', 'Inf', 1, 'timeseries', 1)
-        if m.strcmp(md.mesh.domaintype(), '3D'):
-            md = checkfield(md, 'fieldname', 'stressbalance.spcvz', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'stressbalance.restol', 'size', [1], '>', 0)
-        md = checkfield(md, 'fieldname', 'stressbalance.reltol', 'size', [1])
-        md = checkfield(md, 'fieldname', 'stressbalance.abstol', 'size', [1])
-        md = checkfield(md, 'fieldname', 'stressbalance.isnewton', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'stressbalance.FSreconditioning', 'size', [1], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'stressbalance.maxiter', 'size', [1], '>=', 1)
-        md = checkfield(md, 'fieldname', 'stressbalance.referential', 'size', [md.mesh.numberofvertices, 6])
-        md = checkfield(md, 'fieldname', 'stressbalance.loadingforce', 'size', [md.mesh.numberofvertices, 3])
-        md = checkfield(md, 'fieldname', 'stressbalance.requested_outputs', 'stringrow', 1)
-        if not np.any(np.isnan(self.vertex_pairing)) and len(self.vertex_pairing) > 0:
-            md = checkfield(md, 'fieldname', 'stressbalance.vertex_pairing', '>', 0)
-        # Singular solution
-        if (not np.any(np.logical_or(np.logical_not(np.isnan(md.stressbalance.spcvx)), np.logical_not(np.isnan(md.stressbalance.spcvy))))) & (not np.any(md.mask.ocean_levelset>0)):
-            print('\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n')
-        # CHECK THAT EACH LINES CONTAIN ONLY NAN VALUES OR NO NAN VALUES
-        if np.any(np.logical_and(np.sum(np.isnan(md.stressbalance.referential), axis=1) != 0, np.sum(np.isnan(md.stressbalance.referential), axis=1) != 6)):
-            md.checkmessage('Each line of stressbalance.referential should contain either only NaN values or no NaN values')
-        # CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
-        if np.any(np.sum(np.isnan(md.stressbalance.referential), axis=1) == 0):
-            pos = [i for i, item in enumerate(np.sum(np.isnan(md.stressbalance.referential), axis=1)) if item == 0]
-            for item in md.stressbalance.referential[pos, :]:
-                if np.abs(np.inner(item[0:2], item[3:5])) > sys.float_info.epsilon:
-                    md.checkmessage('Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal')
-        # CHECK THAT NO rotation specified for FS Grounded ice at base
-        if m.strcmp(md.mesh.domaintype(), '3D') and md.flowequation.isFS:
-            pos = np.nonzero(np.logical_and(md.mask.ocean_levelset, md.mesh.vertexonbase))
-            if np.any(np.logical_not(np.isnan(md.stressbalance.referential[pos, :]))):
-                md.checkmessage('no referential should be specified for basal vertices of grounded ice')
-        if md.flowequation.isMOLHO:
-            md = checkfield(md, 'fieldname', 'stressbalance.spcvx_base', 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'stressbalance.spcvy_base', 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'stressbalance.spcvx_shear', 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'fieldname', 'stressbalance.spcvy_shear', 'Inf', 1, 'timeseries', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'vertex_pairing', 'format', 'DoubleMat', 'mattype', 3)
-
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'restol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'reltol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'abstol', 'format', 'Double', 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'isnewton', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'FSreconditioning', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'maxiter', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'shelf_dampening', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'penalty_factor', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'rift_penalty_lock', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'rift_penalty_threshold', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'referential', 'format', 'DoubleMat', 'mattype', 1)
-        if isinstance(self.loadingforce, (list, tuple, np.ndarray)) and np.size(self.loadingforce, 1) == 3:
-            WriteData(fid, prefix, 'data', self.loadingforce[:, 0], 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.stressbalance.loadingforcex')
-            WriteData(fid, prefix, 'data', self.loadingforce[:, 1], 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.stressbalance.loadingforcey')
-            WriteData(fid, prefix, 'data', self.loadingforce[:, 2], 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.stressbalance.loadingforcez')
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.stressbalance.requested_outputs', 'format', 'StringArray')
-        # MOLHO
-        if md.flowequation.isMOLHO:
-            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvx_base', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvy_base', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvx_shear', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvy_shear', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-    # }}}
Index: sm/trunk/src/m/classes/surfaceload.m
===================================================================
--- /issm/trunk/src/m/classes/surfaceload.m	(revision 28275)
+++ 	(revision )
@@ -1,165 +1,0 @@
-%SURFACELOAD class definition
-%
-%   Usage:
-%      surfaceload=surfaceload();
-
-classdef surfaceload
-	properties (SetAccess=public) 
-		icethicknesschange     = [];
-		waterheightchange      = [];
-		otherchange            = [];
-	end
-	methods
-		function self = surfaceload(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			icethicknesschange=[];
-			waterheightchange=[];
-			otherchange=[];
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
-				return; 
-			end
-			if ~isempty(self.icethicknesschange),
-				if isa(self.icethicknesschange,'cell'),
-					for i=1:length(self.icethicknesschange),
-						md = checkfield(md,'field',self.icethicknesschange{i},'NaN',0,'Inf',1,'timeserieslength',1,'Inf',1);
-					end
-				else
-					md = checkfield(md,'field',self.icethicknesschange,'NaN',1,'Inf',1,'timeserieslength',1,'Inf',1);
-				end
-			end
-			if ~isempty(self.waterheightchange),
-				md = checkfield(md,'fieldname','solidearth.surfaceload.waterheightchange','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ~isempty(self.otherchange),
-				md = checkfield(md,'fieldname','solidearth.surfaceload.other','timeseries',1,'NaN',1,'Inf',1);
-			end
-
-			%cross check that whereever we have an ice load, the mask is <0 on each vertex:  legacy
-			%pos=find(self.deltathickness);
-			%maskpos=md.mask.ice_levelset(md.mesh.elements(pos,:)); 
-			%[els,vertices]=find(maskpos>0);
-			%if length(els),
-			%	warning('solidearth checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!');
-			%end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surfaceload:'));
-
-			fielddisplay(self,'icethicknesschange','thickness change: ice height equivalent [mIce/yr]');
-			fielddisplay(self,'waterheightchange','water height change: water height equivalent [mWater/yr]');
-			fielddisplay(self,'otherchange','other loads (sediments) [kg/m^2/yr]');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			%deal with ice thickness change: {{{
-			if isempty(self.icethicknesschange),
-				self.icethicknesschange=zeros(md.mesh.numberofelements+1,1);
-			end
-
-			yts=md.constants.yts;
-
-			if isa(self.icethicknesschange,'cell'),
-				%transform our cell array of time series into cell array of time series of rates 
-				nummodels=length(self.icethicknesschange);
-				for i=1:nummodels,
-					icethicknesschange=self.icethicknesschange{i}; 
-					time=icethicknesschange(end,:);
-					dt=diff(time,1,2);
-					icethicknesschange_rate=diff(icethicknesschange(1:end-1,:),1,2)./dt;
-					self.icethicknesschange{i}=icethicknesschange_rate; 
-				end
-				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
-			else
-				icethicknesschange=self.icethicknesschange;
-				time=icethicknesschange(end,:);
-				dt=diff(time,1,2);
-				icethicknesschange_rate=diff(icethicknesschange(1:end-1,:),1,2)./dt;
-				self.icethicknesschange=icethicknesschange_rate; 
-
-				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
-			end
-			%}}}
-			%deal with water height change: {{{
-			if isempty(self.waterheightchange),
-				self.waterheightchange=zeros(md.mesh.numberofelements+1,1);
-			end
-
-			if isa(self.waterheightchange,'cell'),
-				%transform our cell array of time series into cell array of time series of rates 
-				nummodels=length(self.waterheightchange);
-				for i=1:nummodels,
-					waterheightchange=self.waterheightchange{i}; 
-					time=waterheightchange(end,:);
-					dt=diff(time,1,2);
-					waterheightchange_rate=diff(waterheightchange(1:end-1,:),1,2)./dt;
-					self.waterheightchange{i}=waterheightchange_rate; 
-				end
-				WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
-			else
-				waterheightchange=self.waterheightchange;
-				time=waterheightchange(end,:);
-				dt=diff(time,1,2);
-				waterheightchange_rate=diff(waterheightchange(1:end-1,:),1,2)./dt;
-				self.waterheightchange=waterheightchange_rate; 
-
-				WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
-			end
-			%}}}
-			%deal with other: {{{
-			if isempty(self.otherchange),
-				self.otherchange=zeros(md.mesh.numberofelements+1,1);
-			end
-
-			if isa(self.otherchange,'cell'),
-				%transform our cell array of time series into cell array of time series of rates 
-				nummodels=length(self.otherchange);
-				for i=1:nummodels,
-					otherchange=self.otherchange{i}; 
-					time=otherchange(end,:);
-					dt=diff(time,1,2);
-					otherchange_rate=diff(otherchange(1:end-1,:),1,2)./dt;
-					self.otherchange{i}=otherchange_rate; 
-				end
-				WriteData(fid,prefix,'object',self,'fieldname','otherchange','name','md.solidearth.surfaceload.otherchange',...
-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
-			else
-				otherchange=self.otherchange;
-				time=otherchange(end,:);
-				dt=diff(time,1,2);
-				otherchange_rate=diff(otherchange(1:end-1,:),1,2)./dt;
-				self.otherchange=otherchange_rate; 
-
-				WriteData(fid,prefix,'object',self,'fieldname','otherchange','name','md.solidearth.surfaceload.otherchange',...
-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
-			end
-			%}}}
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejs1Darray(fid,[modelname '.surfaceload.icethicknesschange'],self.icethicknesschange);
-			writejs1Darray(fid,[modelname '.surfaceload.waterheightchange'],self.waterheightchange);
-			writejs1Darray(fid,[modelname '.surfaceload.otherchange'],self.otherchange);
-		end % }}}
-		function self = extrude(self,md) % {{{
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/surfaceload.py
===================================================================
--- /issm/trunk/src/m/classes/surfaceload.py	(revision 28275)
+++ 	(revision )
@@ -1,81 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class surfaceload(object):
-    """SURFACELOAD class definition
-
-    Usage:
-        surfaceload = surfaceload()
-    """
-
-    def __init__(self, *args):  #{{{
-        self.icethicknesschange = np.nan
-        self.waterheightchange = np.nan
-        self.other = np.nan
-
-        nargin = len(args)
-
-        if nargin == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = '   surfaceload:\n'
-        s += '{}\n'.format(fielddisplay(self, 'icethicknesschange', 'thickness change: ice height equivalent [mIce/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'waterheightchange', 'water height change: water height equivalent [mWater/yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'other', 'other loads (sediments) [kg/m^2/yr]'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
-            return md
-        if type(self.icethicknesschange) == np.ndarray:
-            md = checkfield(md, 'fieldname', 'solidearth.surfaceload.icethicknesschange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        if type(self.waterheightchange) == np.ndarray:
-            md = checkfield(md, 'fieldname', 'solidearth.surfaceload.waterheightchange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        if type(self.other) == np.ndarray:
-            md = checkfield(md, 'fieldname', 'solidearth.surfaceload.other', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        # TODO
-        # - When surfaceload class is used eventually, check premarshall 
-        # modifications against those done in MATLAB
-        #
-
-        # Deal with ice thickness change
-        if np.isempty(self.icethicknesschange):
-            self.icethicknesschange = np.zeros((md.mesh.numberofelements + 1, ))
-
-        yts = md.constants.yts
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'icethicknesschange', 'name', 'md.solidearth.surfaceload.icethicknesschange', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts, 'scale', 1 / yts)
-
-        # Deal with ice thickness change
-        if np.isempty(self.waterheightchange):
-            self.waterheightchange = np.zeros((md.mesh.numberofelements + 1, ))
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'waterheightchange', 'name', 'md.solidearth.surfaceload.waterheightchange', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts, 'scale', 1 / yts)
-
-        # Deal with ice thickness change
-        if np.isempty(self.otherchange):
-            self.otherchange = np.zeros((md.mesh.numberofelements + 1, ))
-
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'otherchange', 'name', 'md.solidearth.surfaceload.otherchange', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts, 'scale', 1 / yts)
-    # }}}
-
-    def extrude(self, md):  #{{{
-        return self
-    # }}}
Index: sm/trunk/src/m/classes/taoinversion.m
===================================================================
--- /issm/trunk/src/m/classes/taoinversion.m	(revision 28275)
+++ 	(revision )
@@ -1,198 +1,0 @@
-%TAOINVERSION class definition
-%
-%   Usage:
-%      taoinversion=taoinversion();
-
-classdef taoinversion
-	properties (SetAccess=public) 
-		iscontrol                   = 0
-		incomplete_adjoint          = 0
-		control_parameters          = NaN
-		maxsteps                    = 0
-		maxiter                     = 0
-		fatol                       = 0
-		frtol                       = 0
-		gatol                       = 0
-		grtol                       = 0
-		gttol                       = 0
-		algorithm                   = ''
-		cost_functions              = NaN
-		cost_functions_coefficients = NaN
-		min_parameters              = NaN
-		max_parameters              = NaN
-		vx_obs                      = NaN
-		vy_obs                      = NaN
-		vz_obs                      = NaN
-		vel_obs                     = NaN
-		thickness_obs               = NaN
-		surface_obs               = NaN
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.vx_obs=project3d(md,'vector',self.vx_obs,'type','node');
-			self.vy_obs=project3d(md,'vector',self.vy_obs,'type','node');
-			self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node');
-			self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node');
-			if numel(self.cost_functions_coefficients)>1,self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node');end;
-			if numel(self.min_parameters)>1,self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node');end;
-			if numel(self.max_parameters)>1,self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node');end;
-		end % }}}
-		function self = taoinversion(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(taoinversion(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default is incomplete adjoint for now
-			self.incomplete_adjoint=1;
-
-			%parameter to be inferred by control methods (only
-			%drag and B are supported yet)
-			self.control_parameters={'FrictionCoefficient'};
-
-			%number of iterations and steps
-			self.maxsteps=20;
-			self.maxiter =30;
-
-			%default tolerances
-			self.fatol = 0;
-			self.frtol = 0;
-			self.gatol = 0;
-			self.grtol = 0;
-			self.gttol = 1e-4;
-
-			%minimization algorithm
-			PETSCMAJOR = IssmConfig('_PETSC_MAJOR_');
-			PETSCMINOR = IssmConfig('_PETSC_MINOR_');
-			if(PETSCMAJOR>3 | (PETSCMAJOR==3 & PETSCMINOR>=5))
-				self.algorithm = 'blmvm';
-			else
-				self.algorithm = 'tao_blmvm';
-			end
-
-			%several responses can be used:
-			self.cost_functions=101;
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~self.iscontrol, return; end
-
-			if ~IssmConfig('_HAVE_TAO_'),
-				md = checkmessage(md,['TAO has not been installed, ISSM needs to be reconfigured and recompiled with TAO']);
-			end
-
-			num_controls=numel(md.inversion.control_parameters);
-			num_costfunc=size(md.inversion.cost_functions,2);
-
-			md = checkfield(md,'fieldname','inversion.iscontrol','values',[0 1]);
-			md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0 1]);
-			md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',supportedcontrols());
-			md = checkfield(md,'fieldname','inversion.maxsteps','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.maxiter','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.fatol','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.frtol','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.gatol','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.grtol','numel',1,'>=',0);
-			md = checkfield(md,'fieldname','inversion.gttol','numel',1,'>=',0);
-
-			PETSCMAJOR = IssmConfig('_PETSC_MAJOR_');
-			PETSCMINOR = IssmConfig('_PETSC_MINOR_');
-			if(PETSCMAJOR>3 | (PETSCMAJOR==3 & PETSCMINOR>=5))
-				md = checkfield(md,'fieldname','inversion.algorithm','values',{'blmvm','cg','lmvm'});
-			else
-				md = checkfield(md,'fieldname','inversion.algorithm','values',{'tao_blmvm','tao_cg','tao_lmvm'});
-			end
-
-			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',supportedcostfunctions());
-			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
-			md = checkfield(md,'fieldname','inversion.min_parameters','size',[NaN num_controls]);
-			md = checkfield(md,'fieldname','inversion.max_parameters','size',[NaN num_controls]);
-
-			if strcmp(solution,'BalancethicknessSolution')
-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			elseif strcmp(solution,'BalancethicknessSoftSolution')
-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			else
-				md = checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   taoinversion parameters:'));
-			fielddisplay(self,'iscontrol','is inversion activated?');
-			fielddisplay(self,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity');
-			fielddisplay(self,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
-			fielddisplay(self,'maxsteps','maximum number of iterations (gradient computation)');
-			fielddisplay(self,'maxiter','maximum number of Function evaluation (forward run)');
-			fielddisplay(self,'fatol','convergence criterion: f(X)-f(X*) (X: current iteration, X*: "true" solution, f: cost function)');
-			fielddisplay(self,'frtol','convergence criterion: |f(X)-f(X*)|/|f(X*)|');
-			fielddisplay(self,'gatol','convergence criterion: ||g(X)|| (g: gradient of the cost function)');
-			fielddisplay(self,'grtol','convergence criterion: ||g(X)||/|f(X)|');
-			fielddisplay(self,'gttol','convergence criterion: ||g(X)||/||g(X0)|| (g(X0): gradient at initial guess X0)');
-			fielddisplay(self,'algorithm','minimization algorithm: ''tao_blmvm'', ''tao_cg'', ''tao_lmvm''');
-			fielddisplay(self,'cost_functions','indicate the type of response for each optimization step');
-			fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
-			fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(self,'vx_obs','observed velocity x component [m/yr]');
-			fielddisplay(self,'vy_obs','observed velocity y component [m/yr]');
-			fielddisplay(self,'vel_obs','observed velocity magnitude [m/yr]');
-			fielddisplay(self,'thickness_obs','observed thickness [m]');
-			fielddisplay(self,'surface_obs','observed surface elevation [m]');
-			disp('Available cost functions:');
-			disp('   101: SurfaceAbsVelMisfit');
-			disp('   102: SurfaceRelVelMisfit');
-			disp('   103: SurfaceLogVelMisfit');
-			disp('   104: SurfaceLogVxVyMisfit');
-			disp('   105: SurfaceAverageVelMisfit');
-			disp('   201: ThicknessAbsMisfit');
-			disp('   501: DragCoefficientAbsGradient');
-			disp('   502: RheologyBbarAbsGradient');
-			disp('   503: ThicknessAbsGradient');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			yts=md.constants.yts;
-
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');
-			WriteData(fid,prefix,'name','md.inversion.type','data',1,'format','Integer');
-			if ~self.iscontrol, return; end
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','fatol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','frtol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gatol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','grtol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','algorithm','format','String');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',1);
-
-			%process control parameters
-			num_control_parameters=numel(self.control_parameters);
-			WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray');
-			WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer');
-
-			%process cost functions
-			num_cost_functions=size(self.cost_functions,2);
-			data=marshallcostfunctions(self.cost_functions);
-			WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','StringArray');
-			WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/taoinversion.py
===================================================================
--- /issm/trunk/src/m/classes/taoinversion.py	(revision 28275)
+++ 	(revision )
@@ -1,199 +1,0 @@
-import numpy as np
-from checkfield import checkfield
-from IssmConfig import IssmConfig
-from marshallcostfunctions import marshallcostfunctions
-from fielddisplay import fielddisplay
-from project3d import project3d
-from supportedcontrols import *
-from supportedcostfunctions import *
-from WriteData import WriteData
-
-
-class taoinversion(object):  # {{{
-    """TAOINVERSION class definition
-
-    Usage:
-        inversion = taoinversion()
-    """
-
-    def __init__(self):
-        self.iscontrol = 0
-        self.incomplete_adjoint = 0
-        self.control_parameters = np.nan
-        self.maxsteps = 0
-        self.maxiter = 0
-        self.fatol = 0
-        self.frtol = 0
-        self.gatol = 0
-        self.grtol = 0
-        self.gttol = 0
-        self.algorithm = ''
-        self.cost_functions = np.nan
-        self.cost_functions_coefficients = np.nan
-        self.min_parameters = np.nan
-        self.max_parameters = np.nan
-        self.vx_obs = np.nan
-        self.vy_obs = np.nan
-        self.vz_obs = np.nan
-        self.vel_obs = np.nan
-        self.thickness_obs = np.nan
-        self.surface_obs = np.nan
-
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):
-        s = '   taoinversion parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'iscontrol', 'is inversion activated?'))
-        # s += '{}\n'.format(fielddisplay(self, 'mantle_viscosity', 'mantle viscosity constraints (NaN means no constraint) (Pa s)'))
-        # s += '{}\n'.format(fielddisplay(self, 'lithosphere_thickness', 'lithosphere thickness constraints (NaN means no constraint) (m)'))
-        # s += '{}\n'.format(fielddisplay(self, 'cross_section_shape', "1: square-edged, 2: elliptical - edged surface"))
-        s += '{}\n'.format(fielddisplay(self, 'incomplete_adjoint', '1: linear viscosity, 0: non - linear viscosity'))
-        s += '{}\n'.format(fielddisplay(self, 'control_parameters', 'ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'))
-        s += '{}\n'.format(fielddisplay(self, 'maxsteps', 'maximum number of iterations (gradient computation)'))
-        s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of Function evaluation (forward run)'))
-        s += '{}\n'.format(fielddisplay(self, 'fatol', 'convergence criterion: f(X) - f(X * ) (X: current iteration, X * : "true" solution, f: cost function)'))
-        s += '{}\n'.format(fielddisplay(self, 'frtol', 'convergence criterion: |f(X) - f(X * )| / |f(X * )|'))
-        s += '{}\n'.format(fielddisplay(self, 'gatol', 'convergence criterion: ||g(X)|| (g: gradient of the cost function)'))
-        s += '{}\n'.format(fielddisplay(self, 'grtol', 'convergence criterion: ||g(X)|| / |f(X)|'))
-        s += '{}\n'.format(fielddisplay(self, 'gttol', 'convergence criterion: ||g(X)|| / ||g(X0)|| (g(X0): gradient at initial guess X0)'))
-        s += '{}\n'.format(fielddisplay(self, 'algorithm', 'minimization algorithm: ''tao_blmvm'', ''tao_cg'', ''tao_lmvm'''))
-        s += '{}\n'.format(fielddisplay(self, 'cost_functions', 'indicate the type of response for each optimization step'))
-        s += '{}\n'.format(fielddisplay(self, 'cost_functions_coefficients', 'cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
-        s += '{}\n'.format(fielddisplay(self, 'min_parameters', 'absolute minimum acceptable value of the inversed parameter on each vertex'))
-        s += '{}\n'.format(fielddisplay(self, 'max_parameters', 'absolute maximum acceptable value of the inversed parameter on each vertex'))
-        s += '{}\n'.format(fielddisplay(self, 'vx_obs', 'observed velocity x component [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vy_obs', 'observed velocity y component [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vel_obs', 'observed velocity magnitude [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'thickness_obs', 'observed thickness [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'surface_obs', 'observed surface elevation [m]'))
-        s += '{}\n'.format('Available cost functions:')
-        s += '{}\n'.format('   101: SurfaceAbsVelMisfit')
-        s += '{}\n'.format('   102: SurfaceRelVelMisfit')
-        s += '{}\n'.format('   103: SurfaceLogVelMisfit')
-        s += '{}\n'.format('   104: SurfaceLogVxVyMisfit')
-        s += '{}\n'.format('   105: SurfaceAverageVelMisfit')
-        s += '{}\n'.format('   201: ThicknessAbsMisfit')
-        s += '{}\n'.format('   501: DragCoefficientAbsGradient')
-        s += '{}\n'.format('   502: RheologyBbarAbsGradient')
-        s += '{}\n'.format('   503: ThicknessAbsGradient')
-        return s
-
-    def setdefaultparameters(self):
-        #default is incomplete adjoint for now
-        self.incomplete_adjoint = 1
-        #parameter to be inferred by control methods (only
-        #drag and B are supported yet)
-        self.control_parameters = ['FrictionCoefficient']
-        #number of iterations and steps
-        self.maxsteps = 20
-        self.maxiter = 30
-        #default tolerances
-        self.fatol = 0
-        self.frtol = 0
-        self.gatol = 0
-        self.grtol = 0
-        self.gttol = 1e-4
-        #minimization algorithm
-        PETSCMAJOR = IssmConfig('_PETSC_MAJOR_')[0]
-        PETSCMINOR = IssmConfig('_PETSC_MINOR_')[0]
-        if(PETSCMAJOR > 3 or (PETSCMAJOR == 3 and PETSCMINOR >= 5)):
-            self.algorithm = 'blmvm'
-        else:
-            self.algorithm = 'tao_blmvm'
-        #several responses can be used:
-        self.cost_functions = 101
-        return self
-
-    def extrude(self, md):
-        self.vx_obs = project3d(md, 'vector', self.vx_obs, 'type', 'node')
-        self.vy_obs = project3d(md, 'vector', self.vy_obs, 'type', 'node')
-        self.vel_obs = project3d(md, 'vector', self.vel_obs, 'type', 'node')
-        self.thickness_obs = project3d(md, 'vector', self.thickness_obs, 'type', 'node')
-
-        if numel(self.cost_functions_coefficients) > 1:
-            self.cost_functions_coefficients = project3d(md, 'vector', self.cost_functions_coefficients, 'type', 'node')
-
-        if numel(self.min_parameters) > 1:
-            self.min_parameters = project3d(md, 'vector', self.min_parameters, 'type', 'node')
-
-        if numel(self.max_parameters) > 1:
-            self.max_parameters = project3d(md, 'vector', self.max_parameters, 'type', 'node')
-
-        return self
-
-    def checkconsistency(self, md, solution, analyses):
-        if not self.iscontrol:
-            return md
-        if not IssmConfig('_HAVE_TAO_')[0]:
-            md = md.checkmessage('TAO has not been installed, ISSM needs to be reconfigured and recompiled with TAO')
-
-        num_controls = np.size(md.inversion.control_parameters)
-        num_costfunc = np.size(md.inversion.cost_functions)
-
-        md = checkfield(md, 'fieldname', 'inversion.iscontrol', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'inversion.incomplete_adjoint', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'inversion.control_parameters', 'cell', 1, 'values', supportedcontrols())
-        md = checkfield(md, 'fieldname', 'inversion.maxsteps', 'numel', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.maxiter', 'numel', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.fatol', 'numel', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.frtol', 'numel', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.gatol', 'numel', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.grtol', 'numel', 1, '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.gttol', 'numel', 1, '>=', 0)
-
-        PETSCMAJOR = IssmConfig('_PETSC_MAJOR_')[0]
-        PETSCMINOR = IssmConfig('_PETSC_MINOR_')[0]
-        if(PETSCMAJOR > 3 or (PETSCMAJOR == 3 and PETSCMINOR >= 5)):
-            md = checkfield(md, 'fieldname', 'inversion.algorithm', 'values', ['blmvm', 'cg', 'lmvm'])
-        else:
-            md = checkfield(md, 'fieldname', 'inversion.algorithm', 'values', ['tao_blmvm', 'tao_cg', 'tao_lmvm'])
-
-        md = checkfield(md, 'fieldname', 'inversion.cost_functions', 'size', [num_costfunc], 'values', supportedcostfunctions())
-        md = checkfield(md, 'fieldname', 'inversion.cost_functions_coefficients', 'size', [md.mesh.numberofvertices, num_costfunc], '>=', 0)
-        md = checkfield(md, 'fieldname', 'inversion.min_parameters', 'size', [md.mesh.numberofvertices, num_controls])
-        md = checkfield(md, 'fieldname', 'inversion.max_parameters', 'size', [md.mesh.numberofvertices, num_controls])
-
-        if solution == 'BalancethicknessSolution':
-            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        elif solution == 'BalancethicknessSoftSolution':
-            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-        else:
-            md = checkfield(md, 'fieldname', 'inversion.vx_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'inversion.vy_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-
-    def marshall(self, prefix, md, fid):
-
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'iscontrol', 'format', 'Boolean')
-        WriteData(fid, prefix, 'name', 'md.inversion.type', 'data', 1, 'format', 'Integer')
-        if not self.iscontrol:
-            return
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'incomplete_adjoint', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'maxsteps', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'maxiter', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'fatol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'frtol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'gatol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'grtol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'gttol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'algorithm', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'cost_functions_coefficients', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'min_parameters', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'max_parameters', 'format', 'DoubleMat', 'mattype', 3)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vx_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vy_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vz_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'thickness_obs', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'surface_obs', 'format', 'DoubleMat', 'mattype', 1)
-
-    #process control parameters
-        num_control_parameters = np.size(self.control_parameters)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'control_parameters', 'format', 'StringArray')
-        WriteData(fid, prefix, 'data', num_control_parameters, 'name', 'md.inversion.num_control_parameters', 'format', 'Integer')
-
-    #process cost functions
-        num_cost_functions = np.size(self.cost_functions)
-        data = marshallcostfunctions(self.cost_functions)
-        WriteData(fid, prefix, 'data', data, 'name', 'md.inversion.cost_functions', 'format', 'StringArray')
-        WriteData(fid, prefix, 'data', num_cost_functions, 'name', 'md.inversion.num_cost_functions', 'format', 'Integer')
Index: sm/trunk/src/m/classes/template.js
===================================================================
--- /issm/trunk/src/m/classes/template.js	(revision 28275)
+++ 	(revision )
@@ -1,18 +1,0 @@
-//TEMPLATE class definition
-//
-//   Usage:
-//      template=new template();
-
-function template (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   template class echo:'));
-
-	}// }}}
-	//properties 
-	// {{{
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/thermal.js
===================================================================
--- /issm/trunk/src/m/classes/thermal.js	(revision 28275)
+++ 	(revision )
@@ -1,181 +1,0 @@
-//THERMAL class definition
-//
-//   Usage:
-//      thermal=new thermal();
-
-function thermal (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//Number of unstable constraints acceptable
-		this.penalty_threshold=0;
-
-		//Type of stabilization used
-		this.stabilization=1;
-
-		//Relative tolerance for the enthalpy convergence
-		this.reltol=0.01;
-
-		//Maximum number of iterations
-		this.maxiter=100;
-
-		//factor used to compute the values of the penalties: kappa=max(stiffness matrix)*10^penalty_factor
-		this.penalty_factor=3;
-
-		//Should we use cold ice (default) or enthalpy formulation
-		this.isenthalpy=0;
-
-		//will basal boundary conditions be set dynamically
-		this.isdynamicbasalspc=0;
-
-		//wether waterfraction drainage is enabled
-		this.isdrainicecolumn=1;
-
-		//set an upper limit for local stored watercolumn
-		this.watercolumn_upperlimit=1000;
-		
-		//Linear elements by default
-		this.fe='P1';
-
-		//default output
-		this.requested_outputs=['default'];
-
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   Thermal solution parameters:'));
-
-		fielddisplay(this,'spctemperature','temperature constraints (NaN means no constraint) [K]');
-		fielddisplay(this,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG');
-		fielddisplay(this,'reltol','relative tolerance convergence criterion for enthalpy');
-		fielddisplay(this,'maxiter','maximum number of non linear iterations');
-		fielddisplay(this,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)');
-		fielddisplay(this,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)');
-		fielddisplay(this,'penalty_factor','scaling exponent (default is 3)');
-		fielddisplay(this,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)');
-		fielddisplay(this,'isdynamicbasalspc','enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)');
-		fielddisplay(this,'isdrainicecolumn','wether waterfraction drainage is enabled for enthalpy formulation (default is 1)'); 
-		fielddisplay(this,'watercolumn_upperlimit','upper limit of basal watercolumn for enthalpy formulation (default is 1000m)');
-		fielddisplay(this,'fe','Finite Element type: "P1" (default), "P1xP2"');
-		fielddisplay(this,'requested_outputs','additional outputs requested');
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "thermal";
-	}// }}}
-    this.extrude = function(md) {//{{{
-        this.spctemperature=project3d(md,'vector',this.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN);
-        if (md.initialization.temperature.length===md.mesh.numberofvertices) {
-            this.spctemperature = NewArrayFill(md.mesh.numberofvertices, NaN);
-            var pos=ArrayFindNot(md.mesh.vertexonsurface, 0);
-			// impose observed temperature on surface
-			for (var i=0,posIndex=0,count=0;i<md.initialization.temperature.length;i++){
-				if(count===pos[posIndex]){
-					this.spctemperature[i] = md.initialization.temperature[i][0];
-					posIndex++;
-				}
-				count++;
-			}
-//            this.spctemperature = NewArrayFill2D(md.mesh.numberofvertices, 1, NaN);
-//            var pos=ArrayFindNot2D(md.mesh.vertexonsurface, 0);
-//			// impose observed temperature on surface
-//			for (var i=0,posIndex=0,count=0;i<md.initialization.temperature.length;i++){
-//				for (var j=0;j<md.initialization.temperature[i].length;j++){
-//					if(count===pos[posIndex]){
-//						this.spctemperature[i][j] = md.initialization.temperature[i][j];
-//						posIndex++;
-//					}
-//					count++;
-//				}
-//			}
-        }
-
-        return this;
-    }//}}}
-	this.checkconsistency = function(md,solution,analyses){ // {{{
-
-		//Early return
-		if(!ArrayAnyEqual(ArrayIsMember('ThermalAnalysis',analyses),1) & !ArrayAnyEqual(ArrayIsMember('EnthalpyAnalysis',analyses),1)  | (solution == 'TransientSolution' & md.trans.isthermal==0)) return;
-
-		checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0 ,1, 2]);
-		checkfield(md,'fieldname','thermal.spctemperature','Inf',1,'timeseries',1);
-		checkfield(md,'fieldname','thermal.fe','values',['P1','P1xP2','P1xP3']);
-		if(ArrayAnyEqual(ArrayIsMember('EnthalpyAnalysis',analyses),1) & md.thermal.isenthalpy & md.mesh.dimension() == 3){
-			checkfield(md,'fieldname','thermal.isdrainicecolumn','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','thermal.watercolumn_upperlimit','>=',0);
-			
-			for(var i=0;i<md.mesh.numberofvertices;i++){
-				for(var j=0;j<md.thermal.spctemperature[0].length;j++){
-					if (!isNaN(md.thermal.spctemperature[i][j])){
-						var rep=md.geometry.surface[i]-md.mesh.z[i];
-						if (md.thermal.spctemperature[i][j] <= md.materials.melting-md.materials.beta*md.materials.rho_ice*md.constants.g*rep+Math.pow(10,-5)){
-
-							md.checkmessage('spctemperature should be less or equal than the adjusted melting point');
-							break;
-						}
-					}
-				}
-			}
-			checkfield(md,'fieldname','thermal.isenthalpy','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','thermal.isdynamicbasalspc','numel', [1],'values',[0, 1]);
-			if(md.thermal.isenthalpy){
-				if (isNan(md.stressbalance.reltol)){
-					md.checkmessage('for a steadystate computation, thermal.reltol (relative convergence criterion) must be defined!');
-				}
-				checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero');
-			}
-		}
-		checkfield(md,'fieldname','thermal.requested_outputs','stringrow',1);
-	} // }}} 
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'fieldname','spctemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',this,'fieldname','penalty_threshold','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','reltol','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','maxiter','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','penalty_lock','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','penalty_factor','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','isenthalpy','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isdrainicecolumn','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','watercolumn_upperlimit','format','Double');
-			WriteData(fid,prefix,'object',this,'fieldname','fe','format','String');
-			WriteData(fid,prefix,'object',this,'fieldname','isdynamicbasalspc','format','Boolean');
-
-			//process requested outputs
-			var outputs = this.requested_outputs;
-			for (var i=0;i<outputs.length;i++){
-				if (outputs[i] == 'default') {
-					outputs.splice(i,1);
-					var newoutputs=this.defaultoutputs(md);
-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-				}
-			}
-			WriteData(fid,prefix,'data',outputs,'name','md.thermal.requested_outputs','format','StringArray');
-        	}//}}}
-		this.defaultoutputs = function(md) { //{{{
-
-			if (this.isenthalpy) return ['Enthalpy','Temperature','Waterfraction','Watercolumn','BasalforcingsGroundediceMeltingRate'];
-			else return ['Temperature','BasalforcingsGroundediceMeltingRate'];
-		}//}}}
-		this.fix=function() { //{{{
-			this.spctemperature=NullFix(this.spctemperature,NaN);
-		}//}}}
-	//properties 
-	// {{{
-	this.spctemperature    		= NaN;
-	this.penalty_threshold 		= 0;
-	this.stabilization     		= 0;
-	this.reltol			   		= 0;
-	this.maxiter           		= 0;
-	this.penalty_lock      		= 0;
-	this.penalty_factor    		= 0;
-	this.isenthalpy        		= 0;
-	this.isdynamicbasalspc 		= 0;
-	this.isdrainicecolumn  		= 0;
-	this.watercolumn_upperlimit = 0;
-	this.fe                		= 'P1';
-	this.requested_outputs 		= [];
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/thermal.m
===================================================================
--- /issm/trunk/src/m/classes/thermal.m	(revision 28275)
+++ 	(revision )
@@ -1,173 +1,0 @@
-%THERMAL class definition
-%
-%   Usage:
-%      thermal=thermal();
-
-classdef thermal
-	properties (SetAccess=public) 
-		spctemperature    = NaN;
-		penalty_threshold = 0;
-		stabilization     = 0;
-		reltol				= 0;
-		maxiter           = 0;
-		penalty_lock      = 0;
-		penalty_factor    = 0;
-		isenthalpy        = 0;
-		isdynamicbasalspc = 0;
-		isdrainicecolumn   = 0;
-		watercolumn_upperlimit= 0;
-		fe                = 'P1';
-		requested_outputs = {};
-	end
-	methods
-		function self = extrude(self,md) % {{{
-			self.spctemperature=project3d(md,'vector',self.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN);
-			if (length(md.initialization.temperature)==md.mesh.numberofvertices),
-				self.spctemperature=NaN(md.mesh.numberofvertices,1);
-				pos=find(md.mesh.vertexonsurface);
-				self.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
-			end
-		end % }}}
-		function self = thermal(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-
-			if self.isenthalpy,
-				list = {'Enthalpy','Temperature','Waterfraction','Watercolumn','BasalforcingsGroundediceMeltingRate'};
-			else
-				list = {'Temperature','BasalforcingsGroundediceMeltingRate'};
-			end
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%Number of unstable constraints acceptable
-			self.penalty_threshold=0;
-
-			%Type of stabilization used
-			self.stabilization=1;
-
-			%Relative tolerance for the enthalpy convergence
-			self.reltol=0.01;
-
-			%Maximum number of iterations
-			self.maxiter=100;
-
-			%factor used to compute the values of the penalties: kappa=max(stiffness matrix)*10^penalty_factor
-			self.penalty_factor=3;
-
-			%Should we use cold ice (default) or enthalpy formulation
-			self.isenthalpy=0;
-
-			%will basal boundary conditions be set dynamically
-			self.isdynamicbasalspc=0;
-		
-			%wether waterfraction drainage is enabled
-			self.isdrainicecolumn=1;
-
-			%set an upper limit for local stored watercolumn
-			self.watercolumn_upperlimit=1000;
-
-			%Linear elements by default
-			self.fe='P1';
-
-			%default output
-			self.requested_outputs={'default'};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if (~ismember('ThermalAnalysis',analyses) & ~ismember('EnthalpyAnalysis',analyses)) | (strcmp(solution,'TransientSolution') & md.transient.isthermal==0), return; end
-
-			md = checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0 1 2 3]);
-			md = checkfield(md,'fieldname','thermal.spctemperature','Inf',1,'timeseries',1,'>=',0);
-			md = checkfield(md,'fieldname','thermal.fe','values',{'P1','P1xP2','P1xP3'});
-			if (ismember('EnthalpyAnalysis',analyses) & md.thermal.isenthalpy & dimension(md.mesh)==3),
-				md = checkfield(md,'fieldname','thermal.isdrainicecolumn','numel',[1],'values',[0 1]);
-				md = checkfield(md,'fieldname','thermal.watercolumn_upperlimit','>=',0);
-
-				%Make sure the spc are less than melting point (Josh commented out the next 2 lines)
-				TEMP=md.thermal.spctemperature(1:md.mesh.numberofvertices,:);
-				replicate=repmat(md.geometry.surface-md.mesh.z,1,size(md.thermal.spctemperature,2));
-				pos=find(~isnan(TEMP));
-				md = checkfield(md,'fieldname','thermal.spctemperature','field',TEMP(pos)',...
-					'<=',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*replicate(pos)+10^-5,...
-					'message','spctemperature should be less or equal than the adjusted melting point');
-
-				md = checkfield(md,'fieldname','thermal.isenthalpy','numel',[1],'values',[0 1]);
-				md = checkfield(md,'fieldname','thermal.isdynamicbasalspc','numel', [1],'values',[0 1]);
-				if(md.thermal.isenthalpy)
-					if isnan(md.stressbalance.reltol),
-						md = checkmessage(md,['for a steadystate computation, thermal.reltol (relative convergence criterion) must be defined!']);
-					end 
-					md = checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero');
-				end
-			end
-
-		 md = checkfield(md,'fieldname','thermal.requested_outputs','stringrow',1);
-    end % }}} 
-		function disp(self) % {{{
-			disp(sprintf('   Thermal solution parameters:'));
-
-			fielddisplay(self,'spctemperature','temperature constraints (NaN means no constraint) [K]');
-			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG, 3: anisotropic SUPG');
-			fielddisplay(self,'reltol','relative tolerance convergence criterion for enthalpy');
-			fielddisplay(self,'maxiter','maximum number of non linear iterations');
-			fielddisplay(self,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)');
-			fielddisplay(self,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)');
-			fielddisplay(self,'penalty_factor','scaling exponent (default is 3)');
-			fielddisplay(self,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)');
-			fielddisplay(self,'isdynamicbasalspc','enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)');
-			fielddisplay(self,'isdrainicecolumn','wether waterfraction drainage is enabled for enthalpy formulation (default is 1)'); 
-			fielddisplay(self,'watercolumn_upperlimit','upper limit of basal watercolumn for enthalpy formulation (default is 1000m)');
-			fielddisplay(self,'fe','Finite Element type: ''P1'' (default), ''P1xP2''');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','penalty_threshold','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','isenthalpy','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isdrainicecolumn','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','watercolumn_upperlimit','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
-			WriteData(fid,prefix,'object',self,'fieldname','isdynamicbasalspc','format','Boolean');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.thermal.requested_outputs','format','StringArray');
-        	end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.thermal.spctemperature'],self.spctemperature);
-			writejsdouble(fid,[modelname '.thermal.penalty_threshold'],self.penalty_threshold);
-			writejsdouble(fid,[modelname '.thermal.stabilization'],self.stabilization);
-			writejsdouble(fid,[modelname '.thermal.reltol'],self.reltol);
-			writejsdouble(fid,[modelname '.thermal.maxiter'],self.maxiter);
-			writejsdouble(fid,[modelname '.thermal.penalty_lock'],self.penalty_lock);
-			writejsdouble(fid,[modelname '.thermal.penalty_factor'],self.penalty_factor);
-			writejsdouble(fid,[modelname '.thermal.isenthalpy'],self.isenthalpy);
-			writejsdouble(fid,[modelname '.thermal.isdrainicecolumn'],self.isdrainicecolumn);
-			writejsdouble(fid,[modelname '.thermal.watercolumn_upperlimit'],self.watercolumn_upperlimit);
-			writejsdouble(fid,[modelname '.thermal.isdynamicbasalspc'],self.isdynamicbasalspc);
-			writejscellstring(fid,[modelname '.thermal.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/thermal.py
===================================================================
--- /issm/trunk/src/m/classes/thermal.py	(revision 28275)
+++ 	(revision )
@@ -1,144 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class thermal(object):
-    """THERMAL class definition
-
-       Usage:
-          thermal = thermal()
-    """
-
-    def __init__(self):  # {{{
-        self.spctemperature = np.nan
-        self.penalty_threshold = 0
-        self.stabilization = 0
-        self.reltol = 0
-        self.maxiter = 0
-        self.penalty_lock = 0
-        self.penalty_factor = 0
-        self.isenthalpy = 0
-        self.isdynamicbasalspc = 0
-        self.isdrainicecolumn = 0
-        self.watercolumn_upperlimit = 0
-        self.fe = 'P1'
-        self.requested_outputs = []
-        self.setdefaultparameters()
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   Thermal solution parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'spctemperature', 'temperature constraints (NaN means no constraint) [K]'))
-        s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: SUPG'))
-        s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of non linear iterations'))
-        s += '{}\n'.format(fielddisplay(self, 'reltol', 'relative tolerance criterion'))
-        s += '{}\n'.format(fielddisplay(self, 'penalty_lock', 'stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))
-        s += '{}\n'.format(fielddisplay(self, 'penalty_threshold', 'threshold to declare convergence of thermal solution (default is 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'isenthalpy', 'use an enthalpy formulation to include temperate ice (default is 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'isdynamicbasalspc', 'enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'isdrainicecolumn', 'wether waterfraction drainage is enabled for enthalpy formulation (default is 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'watercolumn_upperlimit', 'upper limit of basal watercolumn for enthalpy formulation (default is 1000m)'))
-        s += '{}\n'.format(fielddisplay(self, 'fe', 'Finite Element type: ''P1'' (default), ''P1xP2'''))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return s
-    # }}}
-
-    def extrude(self, md):  # {{{
-        self.spctemperature = project3d(md, 'vector', self.spctemperature, 'type', 'node', 'layer', md.mesh.numberoflayers, 'padding', np.nan)
-        if isinstance(md.initialization.temperature, np.ndarray) and np.size(md.initialization.temperature, axis=0) == md.mesh.numberofvertices:
-            self.spctemperature = float('NaN') * np.ones((md.mesh.numberofvertices))
-            pos = np.where(md.mesh.vertexonsurface)[0]
-            self.spctemperature[pos] = md.initialization.temperature[pos]  #impose observed temperature on surface
-        return self
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        if self.isenthalpy:
-            return ['Enthalpy', 'Temperature', 'Waterfraction', 'Watercolumn', 'BasalforcingsGroundediceMeltingRate']
-        else:
-            return ['Temperature', 'BasalforcingsGroundediceMeltingRate']
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #Number of unstable constraints acceptable
-        self.penalty_threshold = 0
-        #Type of stabilization used
-        self.stabilization = 1
-        #Relative tolerance for the enthalpy convergence
-        self.reltol = 0.01
-        #Maximum number of iterations
-        self.maxiter = 100
-        #factor used to compute the values of the penalties: kappa = max(stiffness matrix) * 1.0**penalty_factor
-        self.penalty_factor = 3
-        #Should we use cold ice (default) or enthalpy formulation
-        self.isenthalpy = 0
-        #will basal boundary conditions be set dynamically
-        self.isdynamicbasalspc = 0
-        #wether waterfraction drainage is enabled
-        self.isdrainicecolumn = 1
-        #set an upper limit for local stored watercolumn
-        self.watercolumn_upperlimit = 1000
-        #Finite element interpolation
-        self.fe = 'P1'
-        #default output
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        # Early return
-        if ('ThermalAnalysis' not in analyses and 'EnthalpyAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isthermal):
-            return md
-        md = checkfield(md, 'fieldname', 'thermal.stabilization', 'numel', [1], 'values', [0, 1, 2, 3])
-        md = checkfield(md, 'fieldname', 'thermal.spctemperature', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md,'fieldname', 'thermal.fe', 'values', ['P1', 'P1xP2', 'P1xP3'])
-        md = checkfield(md, 'fieldname', 'thermal.requested_outputs', 'stringrow', 1)
-        if 'EnthalpyAnalysis' in analyses and md.thermal.isenthalpy and md.mesh.dimension() == 3:
-            md = checkfield(md, 'fieldname', 'thermal.isdrainicecolumn', 'numel', [1], 'values', [0, 1])
-            md = checkfield(md, 'fieldname', 'thermal.watercolumn_upperlimit', '>=', 0)
-
-            TEMP = md.thermal.spctemperature[:-1].flatten()
-            pos = np.where(~np.isnan(TEMP))
-            try:
-                spccol = np.size(md.thermal.spctemperature, 1)
-            except IndexError:
-                spccol = 1
-
-            replicate = np.tile(md.geometry.surface - md.mesh.z, (spccol)).flatten()
-            control = md.materials.meltingpoint - md.materials.beta * md.materials.rho_ice * md.constants.g * replicate + 1.0e-5
-            md = checkfield(md, 'fieldname', 'thermal.spctemperature', 'field', md.thermal.spctemperature.flatten()[pos], '<=', control[pos], 'message', "spctemperature should be below the adjusted melting point")
-            md = checkfield(md, 'fieldname', 'thermal.isenthalpy', 'numel', [1], 'values', [0, 1])
-            md = checkfield(md, 'fieldname', 'thermal.isdynamicbasalspc', 'numel', [1], 'values', [0, 1])
-            if(md.thermal.isenthalpy):
-                if np.isnan(md.stressbalance.reltol):
-                    md.checkmessage("for a steadystate computation, thermal.reltol (relative convergence criterion) must be defined!")
-                md = checkfield(md, 'fieldname', 'thermal.reltol', '>', 0., 'message', "reltol must be larger than zero")
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'spctemperature', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_threshold', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_lock', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_factor', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isenthalpy', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdrainicecolumn', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'watercolumn_upperlimit', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdynamicbasalspc', 'format', 'Boolean')
-
-    #process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.thermal.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/timestepping.js
===================================================================
--- /issm/trunk/src/m/classes/timestepping.js	(revision 28275)
+++ 	(revision )
@@ -1,78 +1,0 @@
-//TIMESTEPPING class definition
-//
-//   Usage:
-//      timestepping=new timestepping();
-
-function timestepping (){
-	//methods
-	this.setdefaultparameters = function(){ //{{{
-		//time between 2 time steps
-		this.time_step=1./2.;
-
-		//final time
-		this.final_time=10.*this.time_step;
-
-		//should we interpolate forcings between timesteps?
-		this.interp_forcing=1;
-		this.cycle_forcing=0;
-	} //}}}
-	this.disp= function(){ //{{{
-
-		var unit;
-		console.log(sprintf('   timestepping parameters:'));
-		unit = 'yr';
-		fielddisplay(this,'start_time','simulation starting time ['+ unit + ']');
-		fielddisplay(this,'final_time','final time to stop the simulation ['+ unit + ']');
-		fielddisplay(this,'time_step','length of time steps [' +unit+ ']');
-		fielddisplay(this,'interp_forcing','interpolate in time between requested forcing values ? (0 or 1)');
-		fielddisplay(this,'cycle_forcing','cycle through forcing ? (0 or 1)');
-		fielddisplay(this,'coupling_time','length of coupling time steps with ocean model [' +unit+ ']');
-
-	} //}}}
-	this.classname= function(){ //{{{
-		return "timestepping";
-
-	} //}}}
-	this.checkconsistency = function(md,solution,analyses) { //{{{
-
-		checkfield(md,'fieldname','timestepping.start_time','numel',[1],'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','timestepping.interp_forcing','numel',[1],'values',[0,1]);
-		checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0,1]);
-		checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1);
-		if (this.final_time-this.start_time<0){
-			md.checkmessage('timestepping.final_time should be larger than timestepping.start_time');
-		}
-		if (solution=='TransientSolution'){
-			checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>',0,'NaN',1,'Inf',1);
-		}
-	} // }}}
-	this.marshall=function(md,prefix,fid) { //{{{
-
-		var scale;
-		scale = md.constants.yts;
-
-		WriteData(fid,prefix,'name','md.timestepping.type','data',1,'format','Integer');
-		WriteData(fid,prefix,'object',this,'fieldname','start_time','format','Double','scale',scale);
-		WriteData(fid,prefix,'object',this,'fieldname','final_time','format','Double','scale',scale);
-		WriteData(fid,prefix,'object',this,'fieldname','time_step','format','Double','scale',scale);
-		WriteData(fid,prefix,'object',this,'fieldname','interp_forcing','format','Boolean');
-		WriteData(fid,prefix,'object',this,'fieldname','cycle_forcing','format','Boolean');
-		WriteData(fid,prefix,'object',this,'fieldname','coupling_time','format','Double','scale',scale);
-
-	}//}}}
-	this.fix=function() { //{{{
-	}//}}}
-	//properties 
-	// {{{
-	this.start_time      = 0.;
-	this.final_time      = 0.;
-	this.time_step       = 0.;
-	this.interp_forcing  = 1;
-	this.cycle_forcing   = 1;
-	this.coupling_time   = 0.;
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/timestepping.m
===================================================================
--- /issm/trunk/src/m/classes/timestepping.m	(revision 28275)
+++ 	(revision )
@@ -1,91 +1,0 @@
-%TIMESTEPPING Class definition
-%
-%   Usage:
-%      timestepping=timestepping();
-
-classdef timestepping
-	properties (SetAccess=public)
-		start_time      = 0.;
-		final_time      = 0.;
-		time_step       = 0.;
-		interp_forcing  = 1;
-		average_forcing  = 0;
-		cycle_forcing   = 0;
-		coupling_time   = 0.;
-	end
-	methods
-		function self = timestepping(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(timestepping(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   timestepping parameters:'));
-
-			unit = 'yr';
-			fielddisplay(self,'start_time',['simulation starting time [' unit ']']);
-			fielddisplay(self,'final_time',['final time to stop the simulation [' unit ']']);
-			fielddisplay(self,'time_step',['length of time steps [' unit ']']);
-			fielddisplay(self,'interp_forcing','interpolate in time between requested forcing values? (0 or 1)');
-			fielddisplay(self,'average_forcing','average in time if there are several forcing values between steps? (0 or 1, default is 0)');
-			fielddisplay(self,'cycle_forcing','cycle through forcing? (0 or 1)');
-			fielddisplay(self,'coupling_time',['length of coupling time step with ocean model [' unit ']']);
-
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%time between 2 time steps
-			self.time_step=1./2.;
-
-			%final time
-			self.final_time=10.*self.time_step;
-
-			%should we interpolate forcing between timesteps?
-			self.interp_forcing=1;
-			self.average_forcing=0;
-			self.cycle_forcing=0;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','timestepping.start_time','numel',[1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','timestepping.interp_forcing','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','timestepping.average_forcing','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0 1]);
-			if self.final_time-self.start_time<0,
-				md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
-			end
-			if strcmp(solution,'TransientSolution'),
-				md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>',0,'NaN',1,'Inf',1);
-			end
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			scale = md.constants.yts;
-			WriteData(fid,prefix,'name','md.timestepping.type','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','start_time','format','Double','scale',scale);
-			WriteData(fid,prefix,'object',self,'fieldname','final_time','format','Double','scale',scale);
-			WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',scale);
-			WriteData(fid,prefix,'object',self,'fieldname','interp_forcing','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','average_forcing','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','cycle_forcing','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','coupling_time','format','Double','scale',scale);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejsdouble(fid,[modelname '.timestepping.start_time'],self.start_time);
-			writejsdouble(fid,[modelname '.timestepping.final_time'],self.final_time);
-			writejsdouble(fid,[modelname '.timestepping.time_step'],self.time_step);
-			writejsdouble(fid,[modelname '.timestepping.interp_forcing'],self.interp_forcing);
-			writejsdouble(fid,[modelname '.timestepping.average_forcing'],self.interp_forcing);
-			writejsdouble(fid,[modelname '.timestepping.cycle_forcing'],self.cycle_forcing);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/timestepping.py
===================================================================
--- /issm/trunk/src/m/classes/timestepping.py	(revision 28275)
+++ 	(revision )
@@ -1,81 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class timestepping(object):
-    """TIMESTEPPING Class definition
-
-    Usage:
-        timestepping = timestepping()
-    """
-
-    def __init__(self, *args):  #{{{
-        self.start_time = 0
-        self.final_time = 0
-        self.time_step = 0
-        self.interp_forcing = 1
-        self.average_forcing = 0
-        self.cycle_forcing = 0
-        self.coupling_time = 0
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise RuntimeError('constructor not supported')
-    # }}}
-
-    def __repr__(self):  #{{{
-        s = '   timestepping parameters:\n'
-        unit = 'yr'
-        s += '{}\n'.format(fielddisplay(self, 'start_time', 'simulation starting time [' + unit + ']'))
-        s += '{}\n'.format(fielddisplay(self, 'final_time', 'final time to stop the simulation [' + unit + ']'))
-        s += '{}\n'.format(fielddisplay(self, 'time_step', 'length of time steps [' + unit + ']'))
-        s += '{}\n'.format(fielddisplay(self, 'interp_forcing', 'interpolate in time between requested forcing values? (0 or 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'average_forcing', 'average in time if there are several forcing values between steps? (0 or 1, default is 0)'))
-        s += '{}\n'.format(fielddisplay(self, 'cycle_forcing', 'cycle through forcing? (0 or 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'coupling_time', 'length of coupling time steps with ocean model [' + unit + ']'))
-        return s
-    # }}}
-
-    def setdefaultparameters(self):  #{{{
-        # Time between 2 time steps
-        self.time_step = 1 / 2
-
-        # Final time
-        self.final_time = 10 * self.time_step
-
-        # Should we interpolate forcing between timesteps?
-        self.interp_forcing = 1
-        self.average_forcing = 0
-        self.cycle_forcing = 0
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  #{{{
-        md = checkfield(md, 'fieldname', 'timestepping.start_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'timestepping.final_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'timestepping.interp_forcing', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'timestepping.average_forcing', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'timestepping.cycle_forcing', 'numel', [1], 'values', [0, 1])
-        if (self.final_time - self.start_time) < 0:
-            md.checkmessage('timestepping.final_time should be larger than timestepping.start_time')
-        if solution == 'TransientSolution':
-            md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>', 0, 'NaN', 1, 'Inf', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        scale = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.timestepping.type', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'start_time', 'format', 'Double', 'scale', scale)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'final_time', 'format', 'Double', 'scale', scale)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'time_step', 'format', 'Double', 'scale', scale)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'interp_forcing', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'average_forcing', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'cycle_forcing', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'coupling_time', 'format', 'Double', 'scale', scale)
-    # }}}
Index: sm/trunk/src/m/classes/timesteppingadaptive.js
===================================================================
--- /issm/trunk/src/m/classes/timesteppingadaptive.js	(revision 28275)
+++ 	(revision )
@@ -1,87 +1,0 @@
-//TIMESTEPPINGADAPTIVE class definition
-//
-//   Usage:
-//      timesteppingadaptive=new timesteppingadaptive();
-
-function timesteppingadaptive (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		//time between 2 time steps
-		this.time_step_min=0.01;
-		this.time_step_max=10.;
-
-		//final time
-		this.final_time=10.*this.time_step_max;
-
-		//time adaptation? 
-		this.cfl_coefficient=0.5;
-
-		//should we interpolate forcings between timesteps?
-		this.interp_forcings=1;
-		this.cycle_forcing=0;
-	}// }}}
-	this.disp= function(){// {{{
-
-		var unit;
-		console.log(sprintf('   timesteppingadaptive parameters:'));
-		unit = 'yr';
-		fielddisplay(this,'start_time','simulation starting time ['+ unit + ']');
-		fielddisplay(this,'final_time','final time to stop the simulation ['+ unit + ']');
-		fielddisplay(this,'time_step_min','minimum length of time steps [' +unit+ ']');
-		fielddisplay(this,'time_step_max','maximum length of time steps [' +unit+ ']');
-		fielddisplay(this,'cfl_coefficient','coefficient applied to cfl condition');
-		fielddisplay(this,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
-		fielddisplay(this,'cycle_forcing','cycle through forcing ? (0 or 1)');
-		fielddisplay(this,'coupling_time','coupling time steps with ocean model [' +unit+ ']');
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "timesteppingadaptive";
-
-	}// }}}
-	this.checkconsistency = function(md,solution,analyses) { //{{{
-
-		checkfield(md,'fieldname','timestepping.start_time','numel',[1],'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','timestepping.time_step_min','numel',[1],'>=',0,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','timestepping.time_step_max','numel',[1],'>=',md.timestepping.time_step_max,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1);
-		checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1]);
-		checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0,1]);
-		if (this.final_time-this.start_time<0){
-			md.checkmessage('timestepping.final_time should be larger than timestepping.start_time');
-		}
-		checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1);
-	} // }}}
-	this.marshall=function(md,prefix,fid) { //{{{
-
-		var scale;
-		scale = md.constants.yts;
-
-		WriteData(fid,prefix,'name','md.timestepping.type','data',2,'format','Integer');
-		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','start_time','format','Double','scale',scale);
-		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','final_time','format','Double','scale',scale);
-		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','time_step_min','format','Double','scale',scale);
-		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','time_step_max','format','Double','scale',scale);
-		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','cfl_coefficient','format','Double');
-		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','interp_forcings','format','Boolean');
-		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','cycle_forcing','format','Boolean');
-		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','coupling_time','format','Double','scale',scale);
-
-	}//}}}
-	this.fix=function() { //{{{
-	}//}}}
-	//properties 
-	// {{{
-	this.start_time      = 0.;
-	this.final_time      = 0.;
-	this.time_step_min   = 0.;
-	this.time_step_max   = 0.;
-	this.cfl_coefficient = 0.;
-	this.interp_forcings = 1;
-	this.cycle_forcing   = 0;
-	this.coupling_time   = 0.;
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/timesteppingadaptive.m
===================================================================
--- /issm/trunk/src/m/classes/timesteppingadaptive.m	(revision 28275)
+++ 	(revision )
@@ -1,104 +1,0 @@
-%TIMESTEPPINGADAPTIVE Class definition
-%
-%   Usage:
-%      timesteppingadaptive=timesteppingadaptive();
-
-classdef timesteppingadaptive
-	properties (SetAccess=public)
-		start_time      = 0.;
-		final_time      = 0.;
-		time_step_min   = 0.;
-		time_step_max   = 0.;
-		cfl_coefficient = 0.;
-		interp_forcing  = 1;
-		average_forcing = 0;
-		cycle_forcing   = 0;
-		coupling_time   = 0.;
-	end
-	methods
-		function self = timesteppingadaptive(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(timesteppingadaptive(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%time between 2 time steps
-			self.time_step_min = 0.01;
-			self.time_step_max = 10.;
-
-			%final time
-			self.final_time=10.*self.time_step_max;
-
-			%default CFL coefficient
-			self.cfl_coefficient=0.5;
-
-			%should we interpolate forcing between timesteps?
-			self.interp_forcing=1;
-			self.average_forcing=0;
-			self.cycle_forcing=0;
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','timestepping.start_time','numel',[1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','timestepping.time_step_min','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','timestepping.time_step_max','numel',[1],'>=',md.timestepping.time_step_min,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1);
-			md = checkfield(md,'fieldname','timestepping.interp_forcing','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','timestepping.average_forcing','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',md.timestepping.coupling_time,'NaN',1,'Inf',1);
-			if self.final_time-self.start_time<0,
-				md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   timesteppingadaptive parameters:'));
-
-			unit = 'yr';
-			fielddisplay(self,'start_time',['simulation starting time [' unit ']']);
-			fielddisplay(self,'final_time',['final time to stop the simulation [' unit ']']);
-			fielddisplay(self,'time_step_min',['minimum length of time step [' unit ']']);
-			fielddisplay(self,'time_step_max',['maximum length of time step [' unit ']']);
-			fielddisplay(self,'cfl_coefficient','coefficient applied to cfl condition');
-			fielddisplay(self,'interp_forcing','interpolate in time between requested forcing values ? (0 or 1)');
-			fielddisplay(self,'average_forcing','average in time if there are several forcing values between steps? (0 or 1, default is 0)');
-			fielddisplay(self,'cycle_forcing','cycle through forcing ? (0 or 1)');
-			fielddisplay(self,'coupling_time',['coupling time step with ocean model [' unit ']']);
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			scale = md.constants.yts;
-			WriteData(fid,prefix,'name','md.timestepping.type','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','start_time','format','Double','scale',scale);
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','final_time','format','Double','scale',scale);
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','time_step_min','format','Double','scale',scale);
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','time_step_max','format','Double','scale',scale);
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cfl_coefficient','format','Double');
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','interp_forcing','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','average_forcing','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cycle_forcing','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','coupling_time','format','Double','scale',scale);
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			writejsdouble(fid,[modelname '.timesteppingadaptive.start_time'],self.start_time);
-			writejsdouble(fid,[modelname '.timesteppingadaptive.final_time'],self.final_time);
-			writejsdouble(fid,[modelname '.timesteppingadaptive.time_step_min'],self.time_step_min);
-			writejsdouble(fid,[modelname '.timesteppingadaptive.time_step_max'],self.time_step_max);
-			writejsdouble(fid,[modelname '.timesteppingadaptive.cfl_coefficient'],self.cfl_coefficient);
-			writejsdouble(fid,[modelname '.timesteppingadaptive.interp_forcing'],self.interp_forcing);
-			writejsdouble(fid,[modelname '.timesteppingadaptive.average_forcing'],self.interp_forcing);
-			writejsdouble(fid,[modelname '.timesteppingadaptive.cycle_forcing'],self.cycle_forcing);
-			writejsdouble(fid,[modelname '.timesteppingadaptive.coupling_time'],self.time_step_max);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/timesteppingadaptive.py
===================================================================
--- /issm/trunk/src/m/classes/timesteppingadaptive.py	(revision 28275)
+++ 	(revision )
@@ -1,101 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-
-class timesteppingadaptive(object):
-    """
-    TIMESTEPPINGADAPTIVE Class definition
-
-       Usage:
-          timesteppingadaptive = timesteppingadaptive()
-    """
-
-    def __init__(self, *args):  # {{{
-        if not len(args):
-            self.start_time = 0.
-            self.final_time = 0.
-            self.time_step_min = 0.
-            self.time_step_max = 0.
-            self.cfl_coefficient = 0.
-            self.interp_forcing = 1
-            self.average_forcing = 0
-            self.cycle_forcing = 0
-            self.coupling_time = 0.
-
-            #set defaults
-            self.setdefaultparameters()
-
-        elif len(args) == 1 and args[0].__module__ == 'timestepping':
-            old = args[0]
-            #first call setdefaultparameters:
-            self.setdefaultparameters()
-            self.start_time = old.start_time
-            self.final_time = old.final_time
-            self.interp_forcing = old.interp_forcing
-            self.average_forcing = old.average_forcing
-            self.cycle_forcing = old.cycle_forcing
-            self.coupling_time = old.coupling_time
-
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        string = "   timesteppingadaptive parameters:"
-        string = '{}\n{}'.format (string, fielddisplay(self, "start_time", "simulation starting time [yr]"))
-        string = '{}\n{}'.format(string, fielddisplay(self, "final_time", "final time to stop the simulation [yr]"))
-        string = '{}\n{}'.format (string, fielddisplay(self, "time_step_min", "minimum length of time steps [yr]"))
-        string = '{}\n{}'.format (string, fielddisplay(self, "time_step_max", "maximum length of time steps [yr]"))
-        string = '{}\n{}'.format (string, fielddisplay(self, "cfl_coefficient", "coefficient applied to cfl condition"))
-        string = '{}\n{}'.format (string, fielddisplay(self, "interp_forcing", "interpolate in time between requested forcing values ? (0 or 1)"))
-        string = '{}\n{}'.format(string, fielddisplay(self, 'average_forcing', 'average in time if there are several forcing values between steps? (0 or 1, default is 0)'))
-        string = '{}\n{}'.format(string, fielddisplay(self, "cycle_forcing", "cycle through forcing ? (0 or 1)"))
-        string = '{}\n{}'.format(string, fielddisplay(self, "coupling_time", "coupling time steps with ocean model [yr]"))
-        return string
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        #time between 2 time steps
-        self.time_step_min = 0.01
-        self.time_step_max = 10.
-        #final time
-        self.final_time = 10. * self.time_step_max
-        #time adaptation?
-        self.cfl_coefficient = 0.5
-        #should we interpolate forcing between timesteps?
-        self.interp_forcing = 1
-        self.average_forcing = 0
-        self.cycle_forcing   = 0
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'timestepping.start_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'timestepping.final_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'timestepping.time_step_min', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'timestepping.time_step_max', 'numel', [1], '>=', md.timestepping.time_step_min, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'timestepping.cfl_coefficient', 'numel', [1], '>', 0, '<=', 1)
-        if self.final_time - self.start_time < 0:
-            md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
-        md = checkfield(md, 'fieldname', 'timestepping.interp_forcing', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'timestepping.average_forcing', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'timestepping.cycle_forcing', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'name', 'md.timestepping.type', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'start_time', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'final_time', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'time_step_min', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'time_step_max', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'cfl_coefficient', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'interp_forcing', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'average_forcing', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'cycle_forcing', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
-    # }}}
Index: sm/trunk/src/m/classes/toolkits.js
===================================================================
--- /issm/trunk/src/m/classes/toolkits.js	(revision 28275)
+++ 	(revision )
@@ -1,103 +1,0 @@
-//TOOLKITS class definition
-//
-//   Usage:
-//      toolkits=new toolkits();
-
-function toolkits (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//default toolkits: 
-		if (IssmConfig('_HAVE_PETSC_')){
-			//MUMPS is the default toolkits
-			if (IssmConfig('_HAVE_MUMPS_')){
-				this.DefaultAnalysis           = mumpsoptions();
-			}
-			else{
-				this.DefaultAnalysis           = iluasmoptions(); 
-			}
-		}
-		else{
-			if (IssmConfig('_HAVE_MUMPS_')){
-				this.DefaultAnalysis           = issmmumpssolver(); 
-			}
-			else if (IssmConfig('_HAVE_GSL_')){
-				this.DefaultAnalysis           = issmgslsolver(); 
-			}
-			else{
-				console.warn('toolkits setdefaultparameters message: need at least Mumps or Gsl to define an issm solver type, no default solver assigned');
-			}
-		}
-
-		this.RecoveryAnalysis = this.DefaultAnalysis;
-	}// }}}
-	this.disp = function(){// {{{
-		console.log(sprintf('List of toolkits options per analysis:\n'));
-		for(var prop in this){
-			if(typeof this[prop] == 'object'){
-				console.log(prop+ ':',this[prop]);
-			}
-		}
-	}// }}}
-	this.checkconsistency = function (md,solution,analyses) { // {{{
-		for(var prop in this){
-			if(typeof this[prop] == 'object'){
-				if (this[prop] == ''){
-					md.checkmessage(sprintf("md.toolkits.%s is empty",prop));
-				}
-			}
-		}
-	} // }}}
-		 this.ToolkitsFile = function(filename) { //{{{
-		 //TOOLKITSFILE - build toolkits file (in string format)
-		 //
-		 //   Build a Petsc compatible options string, from the toolkits model field  + return options string. 
-		 //   This file string will also be used when the toolkit used is 'issm' instead of 'petsc'
-		 //
-		 //   Usage:     var toolkitsstring = toolkits.ToolkitsFile();
-
-			 var string = '';
-
-			 //write header
-			 string += sprintf('%s%s%s\n','\%Toolkits options file: ',filename,' written from Javascript toolkits array');
-
-			 //start writing options
-			 for (var analysis in this){
-				 var options;
-				 
-				 if(typeof this[analysis] == 'object') options=this[analysis]; else continue;
-
-				 //first write analysis:
-				 string += sprintf('\n+%s\n',analysis); //append a + to recognize it's an analysis string
-
-				 //now, write options
-			
-				 for(var optionname in options){
-					 var optionvalue=options[optionname];
-
-					 if (optionvalue.length==0){
-						 //this option has only one argument
-						 string+=sprintf('-%s\n',optionname);
-					 }
-					 else{
-						 //option with value. value can be string or scalar
-						 if (typeof optionvalue == 'number'){
-							 string+=sprintf('-%s %g\n',optionname,optionvalue);
-						 }
-						 else if (typeof optionvalue == 'string'){
-							 string+=sprintf('-%s %s\n',optionname,optionvalue);
-						 }
-						 else throw Error(sprintf("ToolkitsFile error: option '%s' is not well formatted",optionname));
-					 }
-				 }
-			 }
-			 return string;
-		 } //}}}
-	//properties 
-	// {{{
-	this.DefaultAnalysis  = [];
-	this.RecoveryAnalysis = [];
-	//The other properties are dynamic
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/toolkits.m
===================================================================
--- /issm/trunk/src/m/classes/toolkits.m	(revision 28275)
+++ 	(revision )
@@ -1,186 +1,0 @@
-%TOOLKITS class definition
-%
-%   Usage:
-%      self=toolkits();
-
-classdef toolkits < dynamicprops
-	properties (SetAccess=public) 
-		DefaultAnalysis  = struct();
-		RecoveryAnalysis = struct();
-		%The other properties are dynamic
-	end
-	methods (Static)
-		function self = loadobj(self) % {{{
-			% This function is directly called by matlab when a model object is
-			% loaded. Update old properties here
-
-			if isempty(fieldnames(self.RecoveryAnalysis));
-				disp('WARNING: updating toolkits (RecoveryAnalysis not set)');
-				self.RecoveryAnalysis  = self.DefaultAnalysis;
-			end
-		end% }}}
-	end
-	methods
-		function self = toolkits(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(self,varargin{1});
-				otherwise
-					error('constructor not supported');
-				end
-			end % }}}
-		function self = addoptions(self,analysis,varargin) % {{{
-		%ADDOPTIONS - add analysis to md.toolkits.analysis
-		%
-		%   Optional third parameter adds toolkits options to analysis.
-		%
-		%   Usage:
-		%      md.toolkits=addoptions(md.toolkits,'StressbalanceAnalysis',FSoptions());
-		%      md.toolkits=addoptions(md.toolkits,'StressbalanceAnalysis');
-
-			%Create dynamic property if property does not exist yet
-			if ~ismember(analysis,properties(self)),
-				self.addprop(analysis);
-			end
-
-			%Add toolkits options to analysis
-			if nargin==3,
-				self.(analysis) = varargin{1};
-			end
-		end
-		%}}}
-		function self = setdefaultparameters(self) % {{{
-
-			%default toolkits: 
-			if IssmConfig('_HAVE_PETSC_'),
-				%MUMPS is the default toolkits
-				if IssmConfig('_HAVE_MUMPS_'),
-					self.DefaultAnalysis           = mumpsoptions();
-				else
-					self.DefaultAnalysis           = iluasmoptions(); 
-				end
-			else
-				if IssmConfig('_HAVE_MUMPS_'),
-					self.DefaultAnalysis           = issmmumpssolver(); 
-				elseif IssmConfig('_HAVE_GSL_'),
-					self.DefaultAnalysis           = issmgslsolver(); 
-				else 
-					disp('WARNING: Need at least MUMPS or GSL to define an ISSM solver type, no default solver assigned');
-				end
-			end
-
-			%Use same solver for Recovery mode
-			self.RecoveryAnalysis = self.DefaultAnalysis;
-
-
-		end % }}}
-		function disp(self) % {{{
-			analyses=properties(self);
-			disp(sprintf('List of toolkits options per analysis:\n'));
-			for i=1:numel(analyses),
-				analysis=analyses{i};
-				disp([analysis ':']);
-				disp(self.(analysis));
-			end
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-			analyses=properties(self);
-			for i=1:numel(analyses),
-				switch analyses{i}
-					case 'DefaultAnalysis'
-					case 'RecoveryAnalysis'
-					case 'StressbalanceAnalysis'
-					case 'GLheightadvectionAnalysis'
-					case 'MasstransportAnalysis'
-					case 'ThermalAnalysis'
-					case 'EnthalpyAnalysis'
-					case 'AdjointBalancethicknessAnalysis'
-					case 'BalancethicknessAnalysis'
-					case 'Balancethickness2Analysis'
-					case 'BalancethicknessSoftAnalysis'
-					case 'BalancevelocityAnalysis'
-					case 'DamageEvolutionAnalysis'
-					case 'LoveAnalysis'
-					case 'EsaAnalysis'
-					case 'SealevelchangeAnalysis'
-					case 'FreeSurfaceBaseAnalysis'
-					case 'FreeSurfaceTopAnalysis'
-					case 'LevelsetAnalysis'
-					case 'DebrisAnalysis'
-					case 'L2ProjectionBaseAnalysis'
-					case 'ExtrudeFromBaseAnalysis'
-					case 'ExtrudeFromTopAnalysis'
-					otherwise
-						md = checkmessage(md,['md.toolkits.' analyses{i} ' not supported yet']);
-				end
-				if isempty(fieldnames(self.(analyses{i})))
-					md = checkmessage(md,['md.toolkits.' analyses{i} ' is empty']);
-				end
-			end
-		end % }}}
-		function ToolkitsFile(toolkits,filename) % {{{
-			%TOOLKITSFILE - build toolkits file
-			%
-			%   Build a Petsc compatible options file, from the toolkits model field and return options string.
-			%   This file will also be used when the toolkit used is 'issm' instead of 'petsc'.
-			%
-			%   Usage:     ToolkitsFile(toolkits,filename);
-
-			%open file for writing
-			fid=fopen(filename,'w');
-			if fid==-1,
-				error(['ToolkitsFile error: could not open ' filename ' for writing']);
-			end
-
-			%write header
-			fprintf(fid,'%s%s%s\n','%Toolkits options file: ',filename,' written from Matlab toolkits array');
-
-			%start writing options
-			analyses=properties(toolkits);
-			for i=1:numel(analyses),
-				analysis=analyses{i};
-				options=toolkits.(analysis);
-
-				%first write analysis:
-				fprintf(fid,'\n+%s\n',analysis); %append a + to recognize it's an analysis enum
-
-				%now, write options
-				optionslist=fieldnames(options);
-				for j=1:numel(optionslist),
-					optionname=optionslist{j};
-					optionvalue=options.(optionname);
-
-					if isempty(optionvalue),
-						%this option has only one argument
-						fprintf(fid,'-%s\n',optionname);
-					else
-						%option with value. value can be string or scalar
-						if isnumeric(optionvalue),
-							fprintf(fid,'-%s %g\n',optionname,optionvalue);
-						elseif ischar(optionvalue),
-							fprintf(fid,'-%s %s\n',optionname,optionvalue);
-						else
-							error(['ToolkitsFile error: option ' optionname ' is not well formatted']);
-						end
-					end
-				end
-			end
-
-			fclose(fid);
-		end %}}}
-		function savemodeljs(self,fid,modelname) % {{{
-
-			analyses=properties(self);
-			for i=1:numel(analyses),
-				if isempty(fieldnames(self.(analyses{i})))
-					error(['md.toolkits.' analyses{i} ' is empty']);
-				else
-					writejsstruct(fid,[modelname '.toolkits.' analyses{i}],self.(analyses{i}));
-				end
-			end
-
-		end % }}}
-	end
- end
Index: sm/trunk/src/m/classes/toolkits.py
===================================================================
--- /issm/trunk/src/m/classes/toolkits.py	(revision 28275)
+++ 	(revision )
@@ -1,160 +1,0 @@
-from fielddisplay import fielddisplay
-from iluasmoptions import iluasmoptions
-from IssmConfig import IssmConfig
-from issmgslsolver import issmgslsolver
-from issmmumpssolver import issmmumpssolver
-from mumpsoptions import mumpsoptions
-
-
-class toolkits(object):
-    """toolkits class definition
-
-    Usage:
-        self = toolkits()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.DefaultAnalysis = None
-        self.RecoveryAnalysis = None
-
-        nargs = len(args)
-        if nargs == 0:
-            self.setdefaultparameters()
-        elif nargs == 1:
-            # TODO: Replace the following with constructor
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = "List of toolkits options per analysis:\n\n"
-        for analysis in list(vars(self).keys()):
-            s += "{}\n".format(fielddisplay(self, analysis, ''))
-
-        return s
-    # }}}
-
-    def addoptions(self, analysis, *args):  # {{{
-        """addoptions - add analysis to md.toolkits.analysis
-
-        Optional third parameter adds toolkits options to analysis.
-        
-        Usage:
-            md.toolkits = addoptions(md.toolkits, 'StressbalanceAnalysis', FSoptions())
-            md.toolkits = addoptions(md.toolkits, 'StressbalanceAnalysis')
-        """
-
-        # Create dynamic property if property does not exist yet
-        if not hasattr(self, analysis):
-            setattr(self, analysis, None)
-
-        # Add toolkits options to analysis
-        if len(args) == 1:
-            setattr(self, analysis, args[0])
-
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Default toolkits
-        if IssmConfig('_HAVE_PETSC_')[0]:
-            # MUMPS is the default toolkits
-            if IssmConfig('_HAVE_MUMPS_')[0]:
-                self.DefaultAnalysis = mumpsoptions()
-            else:
-                self.DefaultAnalysis = iluasmoptions()
-        else:
-            if IssmConfig('_HAVE_MUMPS_')[0]:
-                self.DefaultAnalysis = issmmumpssolver()
-            elif IssmConfig('_HAVE_GSL_')[0]:
-                self.DefaultAnalysis = issmgslsolver()
-            else:
-                raise IOError('ToolkitsFile error: need at least MUMPS or GSL to define ISSM solver type, no default solver assigned')
-
-        # Use same solver for Recovery mode
-        self.RecoveryAnalysis = self.DefaultAnalysis
-
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        supported_analyses = [
-            'DefaultAnalysis',
-            'RecoveryAnalysis',
-            'StressbalanceAnalysis',
-            'GLheightadvectionAnalysis',
-            'MasstransportAnalysis',
-            'ThermalAnalysis',
-            'EnthalpyAnalysis',
-            'AdjointBalancethicknessAnalysis',
-            'BalancethicknessAnalysis',
-            'Balancethickness2Analysis',
-            'BalancethicknessSoftAnalysis',
-            'BalancevelocityAnalysis',
-            'DamageEvolutionAnalysis',
-            'LoveAnalysis',
-            'EsaAnalysis',
-            'SealevelchangeAnalysis',
-            'FreeSurfaceBaseAnalysis',
-            'FreeSurfaceTopAnalysis',
-            'LevelsetAnalysis',
-            'DebrisAnalysis',
-            'L2ProjectionBaseAnalysis',
-            'ExtrudeFromBaseAnalysis',
-            'ExtrudeFromTopAnalysis'
-        ]
-        analyses = list(vars(self).keys())
-        for analysis in analyses:
-            if analysis not in supported_analyses:
-                md.checkmessage('md.toolkits.{} not supported yet'.format(analysis))
-
-            if not getattr(self, analysis):
-                md.checkmessage('md.toolkits.{} is empty'.format(analysis))
-
-        return md
-    # }}}
-
-    def ToolkitsFile(self, filename):  # {{{
-        """ToolkitsFile - build toolkits file
-
-        Build a PETSc compatible options file, from the toolkits model field and return options string.
-        This file will also be used when the toolkit used is 'issm' instead of 'petsc'.
-
-        Usage:
-            ToolkitsFile(toolkits, filename)
-        """
-
-        # Open file for writing
-        try:
-            fid = open(filename, 'w')
-        except IOError as e:
-            raise IOError('ToolkitsFile error: could not open {} for writing due to {}'.format(filename), e)
-
-        # Write header
-        fid.write('{}{}{}\n'.format('%Toolkits options file: ', filename, ' written from Python toolkits array'))
-
-        # Start writing options
-        for analysis in list(vars(self).keys()):
-            options = getattr(self, analysis)
-
-            # First write analysis
-            fid.write('\n+{}\n'.format(analysis))  # Append a + to recognize it's an analysis enum
-
-            # Now, write options
-            for optionname, optionvalue in list(options.items()):
-
-                if not optionvalue:
-                    # This option has only one argument
-                    fid.write('-{}\n'.format(optionname))
-                else:
-                    # Option with value. Value can be string or scalar.
-                    if isinstance(optionvalue, (bool, int, float)):
-                        fid.write('-{} {}\n'.format(optionname, optionvalue))
-                    elif isinstance(optionvalue, str):
-                        fid.write('-{} {}\n'.format(optionname, optionvalue))
-                    else:
-                        raise TypeError('ToolkitsFile error: option {} is not well formatted'.format(optionname))
-
-        fid.close()
-    # }}}
Index: sm/trunk/src/m/classes/transient.js
===================================================================
--- /issm/trunk/src/m/classes/transient.js	(revision 28275)
+++ 	(revision )
@@ -1,139 +1,0 @@
-//TRANSIENT class definition
-//
-//   Usage:
-//      transient =new transient();
-
-function transient (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
-		this.isage             = 0;
-		this.issmb             = 1;
-		this.ismasstransport   = 1;
-		this.isstressbalance   = 1;
-		this.isthermal         = 0;
-		this.isgroundingline   = 0;
-		this.isgia             = 0;
-		this.isesa             = 0;
-		this.isdamageevolution = 0;
-		this.ismovingfront     = 0;
-		this.ishydrology       = 0;
-		this.isdebris          = 0;
-		this.issampling        = 0;
-		this.isslr             = 0;
-		this.isoceancoupling   = 0;
-		this.iscoupler         = 0;
-		this.amr_frequency     = 0;
-
-		//default output
-		this.requested_outputs=['default'];
-
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   transient solution parameters:'));
-
-		fielddisplay(this,'isage','indicates whether age model is requested in the transient');
-		fielddisplay(this,'issmb','indicates whether a surface mass balance solution is used in the transient');
-		fielddisplay(this,'ismasstransport','indicates whether a masstransport solution is used in the transient');
-		fielddisplay(this,'isstressbalance','indicates whether a stressbalance solution is used in the transient');
-		fielddisplay(this,'isthermal','indicates whether a thermal solution is used in the transient');
-		fielddisplay(this,'isgroundingline','indicates whether a groundingline migration is used in the transient');
-		fielddisplay(this,'isgia','indicates whether a postglacial rebound model is used in the transient');
-		fielddisplay(this,'isesa','indicates whether an elastic adjustment model is used in the transient');
-		fielddisplay(this,'isdamageevolution','indicates whether damage evolution is used in the transient');
-		fielddisplay(this,'ismovingfront','indicates whether a moving front capability is used in the transient');
-		fielddisplay(this,'ishydrology','indicates whether an hydrology model is used');
-		fielddisplay(this,'isslr','indicates whether a sea-level rise model is used');
-		fielddisplay(this,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
-		fielddisplay(this,'iscoupler','indicates whether different models are being run with need for coupling');
-		fielddisplay(this,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
-		fielddisplay(this,'requested_outputs','list of additional outputs requested');
-
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "transient";
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { // {{{
-
-			//Early return
-			if (solution!='TransientSolution') return;
-
-			checkfield(md,'fieldname','transient.isage','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.issmb','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.ismasstransport','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.isstressbalance','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.isthermal','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.isgroundingline','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.isgia','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.isesa','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.isdamageevolution','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.ismovingfront','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.ishydrology','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.isslr','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			checkfield(md,'fieldname','transient.requested_outputs','stringrow',1);
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			prefix='md.transient';
-			WriteData(fid,prefix,'object',this,'fieldname','isage','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','issmb','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','ismasstransport','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isoceantransport','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isstressbalance','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isthermal','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isgroundingline','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isesa','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isdamageevolution','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','ishydrology','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','ismovingfront','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isdebris','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','issampling','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isslc','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isoceancoupling','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','amr_frequency','format','Integer');
-
-			//process requested outputs
-			var outputs = this.requested_outputs;
-			for (var i=0;i<outputs.length;i++){
-				if (outputs[i] == 'default') {
-					outputs.splice(i,1);
-					var newoutputs=this.defaultoutputs(md);
-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-				}
-			}			
-			WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray');
-		}//}}}
-		this.defaultoutputs = function(md) { //{{{
-			return [];
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-
-	this.isage             = 0;
-	this.issmb             = 0;
-	this.ismasstransport   = 0;
-	this.isstressbalance   = 0;
-	this.isthermal         = 0;
-	this.isgroundingline   = 0;
-	this.isgia             = 0;
-	this.isesa             = 0;
-	this.isdamageevolution = 0;
-	this.ismovingfront     = 0;
-	this.ishydrology       = 0;
-	this.isslr             = 0;
-	this.isoceancoupling   = 0;
-	this.iscoupler         = 0;
-	this.amr_frequency	   = 0;
-	this.requested_outputs = [];
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/transient.m
===================================================================
--- /issm/trunk/src/m/classes/transient.m	(revision 28275)
+++ 	(revision )
@@ -1,185 +1,0 @@
-%TRANSIENT class definition
-%
-%   Usage:
-%      transient=transient();
-
-classdef transient
-	properties (SetAccess=public) 
-		isage             = 0;
-		issmb             = 0;
-		ismasstransport   = 0;
-		isoceantransport  = 0;
-		isstressbalance   = 0;
-		isthermal         = 0;
-		isgroundingline   = 0;
-		isesa             = 0;
-		isdamageevolution = 0;
-		ismovingfront     = 0;
-		ishydrology       = 0;
-		isdebris          = 0;
-		issampling        = 0;
-		isslc             = 0;
-		amr_frequency     = 0;
-		isoceancoupling   = 0;
-		requested_outputs = {};
-	end
-	methods
-		function self = transient(varargin) % {{{
-			switch nargin
-				case 0
-					self = setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = deactivateall(self) % {{{
-
-			%full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
-			self.isage             = 0;
-			self.issmb             = 0;
-			self.ismasstransport   = 0;
-			self.isoceantransport  = 0;
-			self.isstressbalance   = 0;
-			self.isthermal         = 0;
-			self.isgroundingline   = 0;
-			self.isesa             = 0;
-			self.isdamageevolution = 0;
-			self.ismovingfront     = 0;
-			self.ishydrology       = 0;
-			self.isdebris          = 0;
-			self.issampling        = 0;
-			self.isslc             = 0;
-			self.isoceancoupling   = 0;
-			self.amr_frequency     = 0;
-
-			%default output
-			self.requested_outputs={};
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			%full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
-			self.isage             = 0;
-			self.issmb             = 1;
-			self.ismasstransport   = 1;
-			self.isoceantransport  = 0;
-			self.isstressbalance   = 1;
-			self.isthermal         = 1;
-			self.isgroundingline   = 0;
-			self.isesa             = 0;
-			self.isdamageevolution = 0;
-			self.ismovingfront     = 0;
-			self.ishydrology       = 0;
-			self.isdebris= 0;
-			self.issampling        = 0;
-			self.isslc             = 0;
-			self.isoceancoupling   = 0;
-			self.amr_frequency     = 0;
-
-			%default output
-			self.requested_outputs={'default'};
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {};
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~strcmp(solution,'TransientSolution'), return; end
-
-			md = checkfield(md,'fieldname','transient.isage','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.issmb','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.ismasstransport','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.isoceantransport','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.isstressbalance','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.isthermal','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.isgroundingline','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.isesa','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.isdamageevolution','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.ismovingfront','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.ishydrology','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.isdebris','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.requested_outputs','stringrow',1);
-			md = checkfield(md,'fieldname','transient.isslc','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
-			md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
-
-			if (~strcmp(solution,'TransientSolution') & md.transient.iscoupling==1), 
-				md = checkmessage(md,['Coupling with ocean model can only be performed for transient simulations!']);
-			end
-			if (md.transient.isdamageevolution & ~isa(md.materials,'matdamageice')), 
-				md = checkmessage(md,['requesting damage evolution but md.materials is not of class matdamageice']);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   transient solution parameters:'));
-
-			fielddisplay(self,'isage','indicates whether an age model is used in the transient');
-			fielddisplay(self,'issmb','indicates whether a surface mass balance solution is used in the transient');
-			fielddisplay(self,'ismasstransport','indicates whether a masstransport solution is used in the transient');
-			fielddisplay(self,'isoceantransport','indicates whether an ocean masstransport solution is used in the transient');
-			fielddisplay(self,'isstressbalance','indicates whether a stressbalance solution is used in the transient');
-			fielddisplay(self,'isthermal','indicates whether a thermal solution is used in the transient');
-			fielddisplay(self,'isgroundingline','indicates whether a groundingline migration is used in the transient');
-			fielddisplay(self,'isesa','indicates whether an elastic adjustment model is used in the transient');
-			fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient');
-			fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient');
-			fielddisplay(self,'ishydrology','indicates whether an hydrology model is used');
-			fielddisplay(self,'isdebris','indicates whether a debris model is used');
-			fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
-			fielddisplay(self,'isslc','indicates whether a sea-level change solution is used in the transient');
-			fielddisplay(self,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient (1 for cartesian coordinates, 2 for lat/long coordinates');
-			fielddisplay(self,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
-			fielddisplay(self,'requested_outputs','list of additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'fieldname','isage','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','issmb','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','ismasstransport','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isoceantransport','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isstressbalance','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isthermal','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isgroundingline','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isesa','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isdamageevolution','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','ismovingfront','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','ishydrology','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isdebris','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','issampling','format','Boolean'); 
-			WriteData(fid,prefix,'object',self,'fieldname','isslc','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','amr_frequency','format','Integer');
-
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.trans.isage'],self.isage);
-			writejsdouble(fid,[modelname '.trans.issmb'],self.issmb);
-			writejsdouble(fid,[modelname '.trans.ismasstransport'],self.ismasstransport);
-			writejsdouble(fid,[modelname '.trans.isoceantransport'],self.isoceantransport);
-			writejsdouble(fid,[modelname '.trans.isstressbalance'],self.isstressbalance);
-			writejsdouble(fid,[modelname '.trans.isthermal'],self.isthermal);
-			writejsdouble(fid,[modelname '.trans.isgroundingline'],self.isgroundingline);
-			writejsdouble(fid,[modelname '.trans.isesa'],self.isesa);
-			writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution);
-			writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront);
-			writejsdouble(fid,[modelname '.trans.ishydrology'],self.ishydrology);
-			writejsdouble(fid,[modelname '.trans.isdebris'],self.isdebris);
-			writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
-			writejsdouble(fid,[modelname '.trans.isslc'],self.isslc);
-			writejsdouble(fid,[modelname '.trans.isoceancoupling'],self.isoceancoupling);
-			writejsdouble(fid,[modelname '.trans.amr_frequency'],self.amr_frequency);
-			writejscellstring(fid,[modelname '.trans.requested_outputs'],self.requested_outputs);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/transient.py
===================================================================
--- /issm/trunk/src/m/classes/transient.py	(revision 28275)
+++ 	(revision )
@@ -1,166 +1,0 @@
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from WriteData import WriteData
-
-
-class transient(object):
-    """TRANSIENT class definition
-
-    Usage:
-        transient = transient()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.isage = 0
-        self.issmb = 0
-        self.ismasstransport = 0
-        self.isoceantransport = 0
-        self.isstressbalance = 0
-        self.isthermal = 0
-        self.isgroundingline = 0
-        self.isesa = 0
-        self.isdamageevolution = 0
-        self.ismovingfront = 0
-        self.ishydrology = 0
-        self.isdebris = 0
-        self.issampling = 0
-        self.isslc = 0
-        self.amr_frequency = 0
-        self.isoceancoupling = 0
-        self.requested_outputs = []
-
-        if len(args) == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    # }}}
-
-    def __repr__(self):  # {{{
-        s = '   transient solution parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'isage', 'indicates if age model is requested in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'issmb', 'indicates if a surface mass balance solution is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'ismasstransport', 'indicates if a masstransport solution is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'isoceantransport', 'indicates whether an ocean masstransport solution is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'isstressbalance', 'indicates if a stressbalance solution is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'isthermal', 'indicates if a thermal solution is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'isgroundingline', 'indicates if a groundingline migration is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'isesa', 'indicates whether an elastic adjustment model is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'isdamageevolution', 'indicates whether damage evolution is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'ismovingfront', 'indicates whether a moving front capability is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'ishydrology', 'indicates whether an hydrology model is used'))
-        s += '{}\n'.format(fielddisplay(self, 'isdebris', 'indicates whether a debris model is used'))
-        s += '{}\n'.format(fielddisplay(self, 'issampling', 'indicates whether sampling is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'isslc', 'indicates if a sea level change solution is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'isoceancoupling', 'indicates whether coupling with an ocean model is used in the transient (1 for cartesian coordinates, 2 for lat/long coordinates'))
-        s += '{}\n'.format(fielddisplay(self, 'amr_frequency', 'frequency at which mesh is refined in simulations with multiple time_steps'))
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'list of additional outputs requested'))
-        return s
-    # }}}
-
-    def defaultoutputs(self, md):  # {{{
-        return []
-    # }}}
-
-    def deactivateall(self):  #{{{
-        self.isage = 0
-        self.issmb = 0
-        self.ismasstransport = 0
-        self.isoceantransport = 0
-        self.isstressbalance = 0
-        self.isthermal = 0
-        self.isgroundingline = 0
-        self.isesa = 0
-        self.isdamageevolution = 0
-        self.ismovingfront = 0
-        self.ishydrology = 0
-        self.isdebris = 0
-        self.issampling = 0
-        self.isslc = 0
-        self.isoceancoupling = 0
-        self.amr_frequency = 0
-
-        # Default output
-        self.requested_outputs = []
-        return self
-    # }}}
-
-    def setdefaultparameters(self):  # {{{
-        # Full analysis: Stressbalance, Masstransport and Thermal but no 
-        # groundingline migration for now
-        self.isage = 0
-        self.issmb = 1
-        self.ismasstransport = 1
-        self.isoceantransport = 0
-        self.isstressbalance = 1
-        self.isthermal = 1
-        self.isgroundingline = 0
-        self.isesa = 0
-        self.isdamageevolution = 0
-        self.ismovingfront = 0
-        self.ishydrology = 0
-        self.isdebris = 0
-        self.issampling = 0
-        self.isslc = 0
-        self.isoceancoupling = 0
-        self.amr_frequency = 0
-
-        # Default output
-        self.requested_outputs = ['default']
-        return self
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if not solution == 'TransientSolution':
-            return md
-
-        md = checkfield(md, 'fieldname', 'transient.isage', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.issmb', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.ismasstransport', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isoceantransport', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isstressbalance', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isthermal', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isgroundingline', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isesa', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isdamageevolution', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.ishydrology', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isdebris', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.issampling', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.ismovingfront', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isslc', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isoceancoupling', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'transient.amr_frequency', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-
-        if solution != 'TransientSolution' and md.transient.iscoupling:
-            md.checkmessage("Coupling with ocean can only be done in transient simulations!")
-        if md.transient.isdamageevolution and not hasattr(md.materials, 'matdamageice'):
-            md.checkmessage("requesting damage evolution but md.materials is not of class matdamageice")
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isage', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'issmb', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ismasstransport', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceantransport', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isstressbalance', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isthermal', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isgroundingline', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isesa', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdamageevolution', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ismovingfront', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ishydrology', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdebris', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'issampling', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isslc', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceancoupling', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'amr_frequency', 'format', 'Integer')
-
-        # Process requested outputs
-        outputs = self.requested_outputs
-        indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
-            outputs = outputscopy
-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.transient.requested_outputs', 'format', 'StringArray')
-    # }}}
Index: sm/trunk/src/m/classes/verbose.js
===================================================================
--- /issm/trunk/src/m/classes/verbose.js	(revision 28275)
+++ 	(revision )
@@ -1,86 +1,0 @@
-//VERBOSE class definition
-//
-//   Available verbosity levels:
-//      mprocessor  : model processing 
-//      module      : modules
-//      solution    : solution sequence
-//      solver      : solver info (extensive)
-//      convergence : convergence criteria
-//      control     : control method
-//      qmu         : sensitivity analysis
-//      autodiff    : AD analysis
-//      smb         : smb analysis
-//
-//   Usage:
-//      verbose=verbose();
-//      verbose=verbose(3);
-//      verbose=verbose('all');
-//      verbose=verbose('001100');
-//      verbose=verbose('module',true,'solver',false);
-
-//WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
-//         Do not modify these sections. See src/c/shared/Numerics/README for more info
-
-function verbose (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		//switch(nargin),
-			//case 0,
-		this.verbose.solution=true;
-		this.verbose.qmu=true;
-		this.verbose.control=true;
-	}// }}}
-	this.disp= function(){// {{{
-		//BEGINDISP
-		console.log(sprintf('verbose class echo:'));
-		console.log(sprintf('   %s : %i','mprocessor',this.mprocessor));
-		console.log(sprintf('   %s : %i','module',this.module));
-		console.log(sprintf('   %s : %i','solution',this.solution));
-		console.log(sprintf('   %s : %i','solver',this.solver));
-		console.log(sprintf('   %s : %i','convergence',this.convergence));
-		console.log(sprintf('   %s : %i','control',this.control));
-		console.log(sprintf('   %s : %i','qmu',this.qmu));
-		console.log(sprintf('   %s : %i','autodiff',this.autodiff));
-		console.log(sprintf('   %s : %i','smb',this.smb));
-		//ENDDISP
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses){ // {{{
-
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'data',this.VerboseToBinary(),'name','md.verbose','format','Integer');
-		}//}}}
-		this.VerboseToBinary = function () { //{{{
-
-			//BEGINVERB2BIN
-			var binary=0;
-			if (this.mprocessor) binary=binary|1; 
-			if (this.module) binary=binary|2; 
-			if (this.solution) binary=binary|4; 
-			if (this.solver) binary=binary|8; 
-			if (this.convergence) binary=binary|16; 
-			if (this.control) binary=binary|32; 
-			if (this.qmu) binary=binary|64; 
-			if (this.autodiff) binary=binary|128; 
-			if (this.smb) binary=binary|256; 
-			//ENDVERB2BIN
-			return binary;
-
-		} //}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-	this.mprocessor=false;
-	this.module=false;
-	this.solution=false;
-	this.solver=false;
-	this.convergence=false;
-	this.control=false;
-	this.qmu=false;
-	this.autodiff=false;
-	this.smb=false;
-
-	this.setdefaultparameters();
-	// }}}
-}
Index: sm/trunk/src/m/classes/verbose.m
===================================================================
--- /issm/trunk/src/m/classes/verbose.m	(revision 28275)
+++ 	(revision )
@@ -1,158 +1,0 @@
-%VERBOSE class definition
-%
-%   Available verbosity levels:
-%      mprocessor  : model processing 
-%      module      : modules
-%      solution    : solution sequence
-%      solver      : solver info (extensive)
-%      convergence : convergence criteria
-%      control     : control method
-%      qmu         : sensitivity analysis
-%      autodiff    : AD analysis
-%      smb         : smb analysis
-%
-%   Usage:
-%      verbose=verbose();
-%      verbose=verbose(3);
-%      verbose=verbose('all');
-%      verbose=verbose('001100');
-%      verbose=verbose('module',true,'solver',false);
-
-%WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
-%         Do not modify these sections. See src/c/shared/Numerics/README for more info
-
-classdef verbose
-	properties (SetAccess=public) 
-		% {{{
-		%BEGINFIELDS
-		mprocessor=false;
-		module=false;
-		solution=false;
-		solver=false;
-		convergence=false;
-		control=false;
-		qmu=false;
-		autodiff=false;
-		smb=false;
-		%ENDFIELDS
-		% }}}
-	end
-	%}}}
-	methods
-		function verbose=verbose(varargin) % {{{
-
-			switch(nargin),
-				case 0,
-					verbose.solution=true;
-					verbose.qmu=true;
-					verbose.control=true;
-				case 1,
-					binary=varargin{1};
-					if     ischar(binary),
-						if strcmpi(binary,'all'),
-							binary=2^11-1; %all ones
-							verbose=BinaryToVerbose(verbose,binary);
-							verbose.solver=false; %Do not use by default
-						else
-							binary=bin2dec(binary);
-							verbose=BinaryToVerbose(verbose,binary);
-						end
-					elseif isnumeric(binary),
-						verbose=BinaryToVerbose(verbose,binary);
-					end 
-				otherwise,
-					%Use options to initialize object
-					verbose=AssignObjectFields(pairoptions(varargin{:}),verbose);
-
-					%Cast to logicals
-					listproperties=properties('verbose');
-					for i=1:numel(listproperties),
-						fieldname=listproperties{i};
-						fieldvalue=verbose.(fieldname);
-						if (islogical(fieldvalue) | isnumeric(fieldvalue)) & numel(fieldvalue)==1,
-							verbose.(fieldname)=logical(fieldvalue);
-						else
-							error('verbose supported field values are logicals only (true or false)');
-						end
-					end
-			end
-		end
-		%}}}
-		function binary=VerboseToBinary(verbose) % {{{
-
-		%BEGINVERB2BIN
-		binary=0;
-		if (verbose.mprocessor), binary=bitor(binary,1); end
-		if (verbose.module), binary=bitor(binary,2); end
-		if (verbose.solution), binary=bitor(binary,4); end
-		if (verbose.solver), binary=bitor(binary,8); end
-		if (verbose.convergence), binary=bitor(binary,16); end
-		if (verbose.control), binary=bitor(binary,32); end
-		if (verbose.qmu), binary=bitor(binary,64); end
-		if (verbose.autodiff), binary=bitor(binary,128); end
-		if (verbose.smb), binary=bitor(binary,256); end
-		%ENDVERB2BIN
-
-		end
-		%}}}
-		function verbose=BinaryToVerbose(verbose,binary) % {{{
-
-		%BEGINBIN2VERB
-		if bitand(binary,1), verbose.mprocessor=true; else verbose.mprocessor=false; end
-		if bitand(binary,2), verbose.module=true; else verbose.module=false; end
-		if bitand(binary,4), verbose.solution=true; else verbose.solution=false; end
-		if bitand(binary,8), verbose.solver=true; else verbose.solver=false; end
-		if bitand(binary,16), verbose.convergence=true; else verbose.convergence=false; end
-		if bitand(binary,32), verbose.control=true; else verbose.control=false; end
-		if bitand(binary,64), verbose.qmu=true; else verbose.qmu=false; end
-		if bitand(binary,128), verbose.autodiff=true; else verbose.autodiff=false; end
-		if bitand(binary,256), verbose.smb=true; else verbose.smb=false; end
-		%ENDBIN2VERB
-
-		end
-		%}}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if md.inversion.iscontrol
-				temp = verbose('control',1);
-				if(VerboseToBinary(self) ~= VerboseToBinary(temp))
-					disp('INFO: the outlog will look better if only md.verbose.control is turned on');
-				end
-			end
-
-		end % }}}
-		function disp(verbose) % {{{
-
-		%BEGINDISP
-		disp(sprintf('class ''%s''  = ',class(verbose)));
-		disp(sprintf('   %15s : %s','mprocessor',mat2str(verbose.mprocessor)));
-		disp(sprintf('   %15s : %s','module',mat2str(verbose.module)));
-		disp(sprintf('   %15s : %s','solution',mat2str(verbose.solution)));
-		disp(sprintf('   %15s : %s','solver',mat2str(verbose.solver)));
-		disp(sprintf('   %15s : %s','convergence',mat2str(verbose.convergence)));
-		disp(sprintf('   %15s : %s','control',mat2str(verbose.control)));
-		disp(sprintf('   %15s : %s','qmu',mat2str(verbose.qmu)));
-		disp(sprintf('   %15s : %s','autodiff',mat2str(verbose.autodiff)));
-		disp(sprintf('   %15s : %s','smb',mat2str(verbose.smb)));
-		%ENDDISP
-
-		end
-		%}}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'data',VerboseToBinary(self),'name','md.verbose','format','Integer');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.verbose.mprocessor'],self.mprocessor);
-			writejsdouble(fid,[modelname '.verbose.module'],self.module);
-			writejsdouble(fid,[modelname '.verbose.solution'],self.solution);
-			writejsdouble(fid,[modelname '.verbose.solver'],self.solver);
-			writejsdouble(fid,[modelname '.verbose.convergence'],self.convergence);
-			writejsdouble(fid,[modelname '.verbose.control'],self.control);
-			writejsdouble(fid,[modelname '.verbose.qmu'],self.qmu);
-			writejsdouble(fid,[modelname '.verbose.autodiff'],self.autodiff);
-			writejsdouble(fid,[modelname '.verbose.smb'],self.smb);
-
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/verbose.py
===================================================================
--- /issm/trunk/src/m/classes/verbose.py	(revision 28275)
+++ 	(revision )
@@ -1,141 +1,0 @@
-from pairoptions import pairoptions
-from WriteData import WriteData
-
-
-class verbose(object):
-    """VERBOSE class definition
-
-    Available verbosity levels:
-        mprocessor  : model processing
-        module      : modules
-        solution    : solution sequence
-        solver      : solver info (extensive)
-        convergence : convergence criteria
-        control     : control method
-        qmu         : sensitivity analysis
-        autodiff    : AD analysis
-        smb         : SMB analysis
-
-    Usage:
-        verbose = verbose()
-        verbose = verbose(3)
-        verbose = verbose('001100')
-        verbose = verbose('module', True, 'solver', False)
-
-    NOTE:
-    - Some parts of this file are Synchronized with 
-    src/c/shared/Numerics/Verbosity.h. Do not modify these sections. See 
-    src/c/shared/Numerics/README for more info.
-    """
-
-    def __init__(self, *args):  # {{{
-        #BEGINFIELDS
-        self.mprocessor = False
-        self.module = False
-        self.solution = False
-        self.solver = False
-        self.convergence = False
-        self.control = False
-        self.qmu = False
-        self.autodiff = False
-        self.smb = False
-        #ENDFIELDS
-
-        if not len(args):
-            # Don't do anything
-            self.solution = True
-            self.qmu = True
-            self.control = True
-            pass
-
-        elif len(args) == 1:
-            binary = args[0]
-            if isinstance(binary, str):
-                if binary.lower() == 'all':
-                    binary = pow(2, 11) - 1  # all ones
-                    self.BinaryToVerbose(binary)
-                    self.solver = False  # Do not use by default
-                else:
-                    binary = int(binary, 2)
-                    self.BinaryToVerbose(binary)
-            elif isinstance(binary, (int, float)):
-                self.BinaryToVerbose(int(binary))
-
-        else:
-            # Use options to initialize object
-            self = pairoptions(*args).AssignObjectFields(self)
-
-            # Cast to logicals
-            listproperties = vars(self)
-            for fieldname, fieldvalue in list(listproperties.items()):
-                if isinstance(fieldvalue, bool) or isinstance(fieldvalue, (int, float)):
-                    setattr(self, fieldname, bool(fieldvalue))
-                else:
-                    raise TypeError("verbose supported field values are logicals only (True or False)")
-    # }}}
-
-    def __repr__(self):  # {{{
-
-        #BEGINDISP
-        s = "class '%s' = \n" % type(self)
-        s += "   %15s : %s\n" % ('mprocessor', self.mprocessor)
-        s += "   %15s : %s\n" % ('module', self.module)
-        s += "   %15s : %s\n" % ('solution', self.solution)
-        s += "   %15s : %s\n" % ('solver', self.solver)
-        s += "   %15s : %s\n" % ('convergence', self.convergence)
-        s += "   %15s : %s\n" % ('control', self.control)
-        s += "   %15s : %s\n" % ('qmu', self.qmu)
-        s += "   %15s : %s\n" % ('autodiff', self.autodiff)
-        s += "   %15s : %s\n" % ('smb', self.smb)
-        #ENDDISP
-        return s
-    # }}}
-
-    def VerboseToBinary(self):  # {{{
-        #BEGINVERB2BIN
-        binary = 0
-        if self.mprocessor:
-            binary = binary | 1
-        if self.module:
-            binary = binary | 2
-        if self.solution:
-            binary = binary | 4
-        if self.solver:
-            binary = binary | 8
-        if self.convergence:
-            binary = binary | 16
-        if self.control:
-            binary = binary | 32
-        if self.qmu:
-            binary = binary | 64
-        if self.autodiff:
-            binary = binary | 128
-        if self.smb:
-            binary = binary | 256
-        #ENDVERB2BIN
-
-        return binary
-    # }}}
-
-    def BinaryToVerbose(self, binary):  # {{{
-
-        #BEGINBIN2VERB
-        self.mprocessor = bool(binary & 1)
-        self.module = bool(binary & 2)
-        self.solution = bool(binary & 4)
-        self.solver = bool(binary & 8)
-        self.convergence = bool(binary & 16)
-        self.control = bool(binary & 32)
-        self.qmu = bool(binary & 64)
-        self.autodiff = bool(binary & 128)
-        self.smb = bool(binary & 256)
-    #ENDBIN2VERB
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-        WriteData(fid, prefix, 'data', self.VerboseToBinary(), 'name', 'md.verbose', 'format', 'Integer')
-    # }}}
Index: /issm/trunk/src/m/shared/GaussPenta.m
===================================================================
--- /issm/trunk/src/m/shared/GaussPenta.m	(revision 1)
+++ /issm/trunk/src/m/shared/GaussPenta.m	(revision 1)
@@ -0,0 +1,13 @@
+function [num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss)
+%GAUSSPENTA - get Gauss point for penta elements
+%
+%   This routine calls the routines GAUSSTRIA and GAUSSSEGMENT
+%
+%   Usage:
+%      [num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights, vert_gauss_coord,vert_gauss_weights]=GaussPenta(area_order,num_vert_gauss)
+
+%Get Tria area gauss points
+[num_area_gauss,first_area_gauss_coord,second_area_gauss_coord,third_area_gauss_coord,area_gauss_weights]=GaussTria(area_order);
+
+%Get vertical segment gauss points
+[vert_gauss_coord vert_gauss_weights]=GaussSegment(num_vert_gauss);
Index: /issm/trunk/src/m/shared/GaussQuad.m
===================================================================
--- /issm/trunk/src/m/shared/GaussQuad.m	(revision 1)
+++ /issm/trunk/src/m/shared/GaussQuad.m	(revision 1)
@@ -0,0 +1,36 @@
+function [num_gauss,first_gauss_coord,second_gauss_coord,gauss_weights]=GaussQuad(order)
+%GAUSSQUAD - get Gauss point for quad elements
+%
+%   This routine computes gaussian points on a reference qud elements
+%   The number of gaussian points returned depends on the order of integration ('order'). The order of 
+%   integration can be computed from the polynomial degree p that needs to be integrated. The formula is: 
+%   order = (p+1) /2 
+%   order=1, num_gauss=1. Can integrate polynomials of degree 0 to 1
+%
+%   Usage:
+%      [num_gauss,first_gauss_coord,second_gauss_coord,gauss_weights]=GaussQuad(order)
+
+
+if order==1,
+	num_gauss=1;
+	gauss_weights=4;
+	first_gauss_coord= 0;
+	second_gauss_coord= 0;
+
+%order=2, num_gauss=2. Can integrate polynomials of degree 0 to 3
+elseif order==2,
+	num_gauss=4;
+	gauss_weights=[ 1, 1, 1, 1];
+	first_gauss_coord=[ -0.57735026918962, 0.57735026918962, -0.57735026918962, 0.57735026918962];
+	second_gauss_coord=[0.57735026918962, 0.57735026918962, -0.57735026918962, -0.57735026918962];
+
+%order=3, num_gauss=3. Can integrate polynomials of degree 0 to 5
+elseif order==3,
+	num_gauss=9;
+	gauss_weights=[ 0.30864197530864, 0.49382716049383, 0.30864197530864, 0.49382716049383, 0.79012345679012, 0.49382716049383, 0.30864197530864, 0.49382716049383, 0.30864197530864];
+	first_gauss_coord=[ -0.77459666924148, 0, 0.77459666924148, -0.77459666924148, 0, 0.77459666924148, -0.77459666924148, 0, 0.77459666924148];
+	second_gauss_coord=[ -0.77459666924148, -0.77459666924148, -0.77459666924148, 0, 0, 0, 0.77459666924148, 0.77459666924148, 0.77459666924148];
+
+else
+	error('GaussQuad error message: order not supported yet');
+end
Index: /issm/trunk/src/m/shared/GaussSegment.m
===================================================================
--- /issm/trunk/src/m/shared/GaussSegment.m	(revision 1)
+++ /issm/trunk/src/m/shared/GaussSegment.m	(revision 1)
@@ -0,0 +1,41 @@
+function [segment_coord,gauss_weights]=GaussSegment(numgauss)
+%GAUSSSEGMENT - get Gauss point for segment elements
+%
+%   This routine computes numgauss gaussian points on a reference segment from -1 to 1.
+%   The number of gaussian points returned depends on the order of integration ('order'). The order of 
+%   integration can be computed from the polynomial degree p that needs to be integrated. The formula is: 
+%   order = (p+1) /2 
+%   order=1, num_gauss=1. Can integrate polynomials of degree 0 to 1
+%
+%   Usage:
+%      [segment_coord,gauss_weights]=GaussSegment(numgauss)
+
+if numgauss==1,
+
+	segment_coord=0;
+	gauss_weights=2;
+
+%p=3, numgauss=2. Can integrate polynomials of degree 0 to 3
+elseif numgauss==2,
+	gauss_weights=[ 1.0, 1.0];
+	segment_coord=[-0.577350269189626, 0.577350269189626];
+
+%p=5, numgauss=3. Can integrate polynomials of degree 0 to 5
+elseif numgauss==3,
+	gauss_weights=[ 0.555555555555555556, 0.88888888888889, 0.555555555555555556];
+	segment_coord=[ -0.774596669241483, 0.000000000000000, 0.774596669241483];
+
+%p=7, numgauss=4. Can integrate polynomials of degree 0 to 7
+elseif numgauss==4,
+	gauss_weights=[ 0.347854845137454, 0.652145154862546, 0.652145154862546, 0.347854845137454];
+	segment_coord=[ -0.861136311594053, -0.339981043584856, 0.339981043584856, 0.861136311594053];
+
+%p=9, numgauss=5. Can integrate polynomials of degree 0 to 9
+elseif numgauss==5,
+	gauss_weights=[ 0.236926885056189, 0.478628670499366, 0.568888888888889, 0.478628670499366, 0.236926885056189];
+	segment_coord=[ -0.906179845938664, -0.538469310105683, 0, 0.538469310105683, 0.906179845938664];
+
+
+else
+	error('GaussSegment error message: order not supported yet');
+end
Index: /issm/trunk/src/m/shared/GaussTetra.m
===================================================================
--- /issm/trunk/src/m/shared/GaussTetra.m	(revision 1)
+++ /issm/trunk/src/m/shared/GaussTetra.m	(revision 1)
@@ -0,0 +1,128 @@
+function [num_gauss,first_gauss_vol_coord,second_gauss_vol_coord,third_gauss_vol_coord,fourth_gauss_vol_coord,gauss_weights]=GaussTetra(order)
+%GAUSSTETRA - get Gauss point for tetra elements
+%
+%   This routine computes gaussian points on a reference tetra, in terms of their volume coordinates. 
+%   The number of gaussian points returned depends on the order of integration ('order'). The order of 
+%   integration can be computed from the polynomial degree p that needs to be integrated. The formula is: 
+%   order = (p+1) /2 
+%   order=1, num_gauss=1. Can integrate polynomials of degree 0 to 1
+%
+%   Usage:
+%      [num_gauss,first_gauss_vol_coord,second_gauss_vol_coord,third_gauss_vol_coord,fourth_gauss_vol_coord,gauss_weights]=GaussTetra(order)
+
+if order==1,
+	num_gauss=1;
+	gauss_weights=2*sqrt(2)/3*1;
+	first_gauss_vol_coord=0.250000000000000;
+	second_gauss_vol_coord=0.250000000000000;
+	third_gauss_vol_coord=0.250000000000000;
+	fourth_gauss_vol_coord=0.250000000000000;
+
+elseif order==2,
+	
+	num_gauss=4;
+	gauss_weights=2*sqrt(2)/3*[0.250000000000000, 0.250000000000000, 0.250000000000000, 0.250000000000000];
+	first_gauss_vol_coord=[ 0.585410196624969, 0.138196601125011, 0.138196601125011, 0.138196601125011];
+	second_gauss_vol_coord=[ 0.138196601125011, 0.585410196624969, 0.138196601125011, 0.138196601125011];
+	third_gauss_vol_coord=[ 0.138196601125011, 0.138196601125011, 0.585410196624969, 0.138196601125011];
+	fourth_gauss_vol_coord=[0.138196601125011, 0.138196601125011, 0.138196601125011, 0.585410196624969];
+
+elseif order==3,
+	
+	num_gauss=5;
+	gauss_weights=2*sqrt(2)/3*[ -0.800000000000000, 0.450000000000000, 0.450000000000000, 0.450000000000000, 0.450000000000000];
+	first_gauss_vol_coord=[ 0.250000000000000, 0.500000000000000, 0.166666666666667,0.166666666666667, 0.166666666666667];
+	second_gauss_vol_coord=[ 0.250000000000000, 0.166666666666667, 0.500000000000000,0.166666666666667, 0.166666666666667];
+	third_gauss_vol_coord=[ 0.250000000000000, 0.166666666666667, 0.166666666666667,0.500000000000000, 0.166666666666667];
+	fourth_gauss_vol_coord=[0.250000000000000, 0.166666666666667, 0.166666666666667,0.166666666666667, 0.500000000000000];
+
+elseif order==4,
+	
+	num_gauss=11;
+	gauss_weights=2*sqrt(2)/3*[-0.013155555555556, 0.007622222222222, 0.007622222222222,0.007622222222222, 0.007622222222222, 0.024888888888889, 0.024888888888889, 0.024888888888889, 0.024888888888889, 0.024888888888889, 0.024888888888889];
+	first_gauss_vol_coord=[ 0.250000000000000, 0.785714285714286, 0.071428571428571,0.071428571428571, 0.071428571428571, 0.399403576166799,0.399403576166799, 0.399403576166799, 0.100596423833201, 0.100596423833201, 0.100596423833201];
+	second_gauss_vol_coord=[0.250000000000000, 0.071428571428571, 0.785714285714286,0.071428571428571, 0.071428571428571, 0.399403576166799,0.100596423833201, 0.100596423833201, 0.399403576166799, 0.399403576166799, 0.100596423833201];
+	third_gauss_vol_coord=[ 0.250000000000000, 0.071428571428571, 0.071428571428571,0.785714285714286, 0.071428571428571, 0.100596423833201,0.399403576166799, 0.100596423833201, 0.399403576166799, 0.100596423833201, 0.399403576166799];
+	fourth_gauss_vol_coord=[0.250000000000000, 0.071428571428571, 0.071428571428571,0.071428571428571, 0.785714285714286, 0.100596423833201,0.100596423833201, 0.399403576166799, 0.100596423833201, 0.399403576166799, 0.399403576166799];
+
+
+elseif order==5,
+	
+	num_gauss=15;
+	gauss_weights=2*sqrt(2)/3*[0.030283678097089, 0.006026785714286, 0.006026785714286,...
+                 0.006026785714286, 0.006026785714286, 0.011645249086029,...
+                 0.011645249086029, 0.011645249086029, 0.011645249086029,...
+                 0.010949141561386, 0.010949141561386, 0.010949141561386,...
+                 0.010949141561386, 0.010949141561386, 0.010949141561386];
+	first_gauss_vol_coord=[ 0.250000000000000, 0.000000000000000, 0.333333333333333,...
+                 0.333333333333333, 0.333333333333333, 0.727272727272727,...
+                 0.090909090909091, 0.090909090909091, 0.090909090909091,...
+                 0.066550153573664, 0.066550153573664, 0.066550153573664,...
+                 0.433449846426336, 0.433449846426336, 0.433449846426336];
+	second_gauss_vol_coord=[0.250000000000000, 0.333333333333333, 0.000000000000000,...
+                 0.333333333333333, 0.333333333333333, 0.090909090909091,...
+                 0.727272727272727, 0.090909090909091, 0.090909090909091,...
+                 0.066550153573664, 0.433449846426336, 0.433449846426336,...
+                 0.066550153573664, 0.066550153573664, 0.433449846426336];
+	third_gauss_vol_coord=[0.250000000000000, 0.333333333333333, 0.333333333333333,...
+                 0.000000000000000, 0.333333333333333, 0.090909090909091,...
+                 0.090909090909091, 0.727272727272727, 0.090909090909091,...
+                 0.433449846426336, 0.066550153573664, 0.433449846426336,...
+                 0.066550153573664, 0.433449846426336, 0.066550153573664];
+	fourth_gauss_vol_coord=[ 0.250000000000000, 0.333333333333333, 0.333333333333333,...
+                 0.333333333333333, 0.000000000000000, 0.090909090909091,...
+                 0.090909090909091, 0.090909090909091, 0.727272727272727,...
+                 0.433449846426336, 0.433449846426336, 0.066550153573664,...
+                 0.433449846426336, 0.066550153573664, 0.066550153573664];
+
+
+elseif order==6,
+	
+	num_gauss=24;
+	gauss_weights=2*sqrt(2)/3*[ 0.006653791709695, 0.006653791709695, 0.006653791709695,...
+                 0.006653791709695, 0.001679535175887, 0.001679535175887,...
+                 0.001679535175887, 0.001679535175887, 0.009226196923942,...
+                 0.009226196923942, 0.009226196923942, 0.009226196923942,...
+                 0.008035714285714, 0.008035714285714, 0.008035714285714,...
+                 0.008035714285714, 0.008035714285714, 0.008035714285714,...
+                 0.008035714285714, 0.008035714285714, 0.008035714285714,...
+                 0.008035714285714, 0.008035714285714, 0.008035714285714];
+	first_gauss_vol_coord=[ 0.356191386222545, 0.214602871259152, 0.214602871259152,...
+                 0.214602871259152, 0.877978124396166, 0.040673958534611,...
+                 0.040673958534611, 0.040673958534611, 0.032986329573173,...
+                 0.322337890142276, 0.322337890142276, 0.322337890142276,...
+
+                 0.063661001875018, 0.063661001875018, 0.063661001875018,...
+                 0.063661001875018, 0.063661001875018, 0.063661001875018,...
+                 0.269672331458316, 0.603005664791649, 0.269672331458316,...
+                 0.603005664791649, 0.269672331458316, 0.603005664791649];
+	second_gauss_vol_coord=[0.214602871259152, 0.356191386222545, 0.214602871259152, ...
+                 0.214602871259152, 0.040673958534611, 0.877978124396166, ...
+                 0.040673958534611, 0.040673958534611, 0.322337890142276, ...
+                 0.032986329573173, 0.322337890142276, 0.322337890142276,...
+
+                 0.063661001875018, 0.063661001875018, 0.269672331458316, ...
+                 0.603005664791649, 0.269672331458316, 0.603005664791649, ...
+                 0.063661001875018, 0.063661001875018, 0.063661001875018, ...
+                 0.063661001875018, 0.603005664791649, 0.269672331458316];
+	third_gauss_vol_coord=[ 0.214602871259152, 0.214602871259152, 0.356191386222545, ...
+                 0.214602871259152, 0.040673958534611, 0.040673958534611, ...
+                 0.877978124396166, 0.040673958534611, 0.322337890142276, ...
+                 0.322337890142276, 0.032986329573173, 0.322337890142276,...
+
+                 0.269672331458316, 0.603005664791649, 0.063661001875018, ...
+                 0.063661001875018, 0.603005664791649, 0.269672331458316,...
+                 0.063661001875018, 0.063661001875018, 0.603005664791649,...
+                 0.269672331458316, 0.063661001875018, 0.063661001875018];
+	fourth_gauss_vol_coord=[0.214602871259152, 0.214602871259152, 0.214602871259152,...
+                 0.356191386222545, 0.040673958534611, 0.040673958534611,...
+                 0.040673958534611, 0.877978124396166, 0.322337890142276,...
+                 0.322337890142276, 0.322337890142276, 0.032986329573173,...
+
+                 0.603005664791649, 0.269672331458316, 0.603005664791649,...
+                 0.269672331458316, 0.063661001875018, 0.063661001875018,...
+                 0.603005664791649, 0.269672331458316, 0.063661001875018,...
+                 0.063661001875018, 0.063661001875018, 0.063661001875018];
+else
+	error('GaussTria error message: order not supported yet');
+end
Index: /issm/trunk/src/m/shared/GaussTria.m
===================================================================
--- /issm/trunk/src/m/shared/GaussTria.m	(revision 1)
+++ /issm/trunk/src/m/shared/GaussTria.m	(revision 1)
@@ -0,0 +1,67 @@
+function [num_gauss,first_gauss_area_coord,second_gauss_area_coord,third_gauss_area_coord,gauss_weights]=GaussTria(order)
+%GAUSSTRIA - get Gauss point for triangle elements
+%
+%   This routine computes gaussian points on a reference triangle, in terms of their area coordinates. 
+%   The number of gaussian points returned depends on the order of integration ('order'). The order of 
+%   integration can be computed from the polynomial degree p that needs to be integrated. The formula is: 
+%   order = (p+1) /2 
+%   order=1, num_gauss=1. Can integrate polynomials of degree 0 to 1
+%
+%   Usage:
+%      [num_gauss,first_gauss_area_coord,second_gauss_area_coord,third_gauss_area_coord,gauss_weights]=GaussTria(order)
+
+if order==1,
+	num_gauss=1;
+	gauss_weights=1.732050807568877;
+	first_gauss_area_coord= 0.333333333333333;
+	second_gauss_area_coord= 0.333333333333333;
+	third_gauss_area_coord= 0.333333333333333;
+
+%order=2, num_gauss=3. Can integrate polynomials of degree 0 to 3
+elseif order==2,
+	
+	num_gauss=3;
+	gauss_weights=[ 0.577350269189625, 0.577350269189625, 0.577350269189625];
+	first_gauss_area_coord=[ 0.666666666666667, 0.166666666666667, 0.166666666666667];
+	second_gauss_area_coord=[ 0.166666666666667, 0.666666666666667, 0.166666666666667];
+	third_gauss_area_coord=[ 0.166666666666667, 0.166666666666667, 0.666666666666667];
+
+%order=3, num_gauss=4. Can integrate polynomials of degree 0 to 5
+elseif order==3,
+	num_gauss=4;
+	gauss_weights=[ -0.974278579257493, 0.902109795608790, 0.902109795608790, 0.902109795608790];
+	first_gauss_area_coord=[ 0.333333333333333, 0.600000000000000, 0.200000000000000, 0.200000000000000];
+	second_gauss_area_coord=[ 0.333333333333333, 0.200000000000000, 0.600000000000000, 0.200000000000000];
+	third_gauss_area_coord=[ 0.333333333333333, 0.200000000000000, 0.200000000000000, 0.600000000000000];
+
+%order=4, num_gauss=6. Can integrate polynomials of degree 0 to 7
+elseif order==4,
+	num_gauss=6;
+	gauss_weights=[ 0.386908262797819, 0.386908262797819, 0.386908262797819, 0.190442006391807, 0.190442006391807, 0.190442006391807];
+	first_gauss_area_coord=[ 0.108103018168070, 0.445948490915965, 0.445948490915965, 0.816847572980459, 0.091576213509771, 0.091576213509771];
+	second_gauss_area_coord=[ 0.445948490915965, 0.108103018168070, 0.445948490915965, 0.091576213509771, 0.816847572980459, 0.091576213509771];
+	third_gauss_area_coord=[ 0.445948490915965, 0.445948490915965, 0.108103018168070, 0.091576213509771, 0.091576213509771, 0.816847572980459];
+
+%order=5, num_gauss=7. Can integrate polynomials of degree 0 to 9
+elseif order==5,
+	num_gauss=7;
+	
+	gauss_weights=[ 0.389711431702997, 0.229313399254729, 0.229313399254729, 0.229313399254729, 0.218133059367230, 0.218133059367230, 0.218133059367230];
+	first_gauss_area_coord=[ 0.333333333333333, 0.059715871789770, 0.470142064105115, 0.470142064105115, 0.797426985353087, 0.101286507323456, 0.101286507323456];
+	second_gauss_area_coord=[ 0.333333333333333, 0.470142064105115, 0.059715871789770, 0.470142064105115, 0.101286507323456, 0.797426985353087, 0.101286507323456];
+	third_gauss_area_coord=[ 0.333333333333333, 0.470142064105115, 0.470142064105115, 0.059715871789770, 0.101286507323456, 0.101286507323456, 0.797426985353087];
+
+%order=6, num_gauss=12. Can integrate polynomials of degree 0 to 11
+elseif order==6,
+	num_gauss=12;
+	gauss_weights=[ 0.202279763184836, 0.202279763184836, 0.202279763184836, 0.088065961139281, 0.088065961139281, 0.088065961139281, ...
+		 0.143502272432755, 0.143502272432755, 0.143502272432755, 0.143502272432755, 0.143502272432755, 0.143502272432755];
+	first_gauss_area_coord=[ 0.501426509658179, 0.249286745170910, 0.249286745170910, 0.873821971016996, 0.063089014491502, 0.063089014491502,  ...
+		 0.053145049844817, 0.053145049844817, 0.310352451033784, 0.636502499121399, 0.310352451033784, 0.636502499121399];
+	second_gauss_area_coord=[ 0.249286745170910, 0.501426509658179, 0.249286745170910, 0.063089014491502, 0.873821971016996, 0.063089014491502,  ...
+		 0.310352451033784, 0.636502499121399, 0.053145049844817, 0.053145049844817, 0.636502499121399, 0.310352451033784];
+	third_gauss_area_coord=[ 0.249286745170910, 0.249286745170910, 0.501426509658179, 0.063089014491502, 0.063089014491502, 0.873821971016996,  ...
+		 0.636502499121399, 0.310352451033784, 0.636502499121399, 0.310352451033784, 0.053145049844817, 0.053145049844817];
+else
+	error('GaussTria error message: order not supported yet');
+end
Index: /issm/trunk/src/m/shared/Getalpha2.m
===================================================================
--- /issm/trunk/src/m/shared/Getalpha2.m	(revision 1)
+++ /issm/trunk/src/m/shared/Getalpha2.m	(revision 1)
@@ -0,0 +1,49 @@
+function alpha2=Getalpha2(parameters)
+%GETALPHA2 - compute the friction parameter alpha2
+%
+%   This routine calculates the basal friction coefficient
+%   o alpha2= drag^2 * Neff ^r * vel ^s
+%   with 
+%   o Neff=rho_ice*g*thickness+rho_ice*g*bed, 
+%   o r=q/p and s=1/p
+%
+%   Usage:
+%      alpha2=Getalpha2(parameters)
+
+%recover parameters 
+gravity=parameters.g;
+rho_ice=parameters.rho_ice;
+rho_water=parameters.rho_water;
+K=parameters.k;
+bed=parameters.b;
+thickness=parameters.h;
+velocity_x=parameters.velocities(:,1);
+velocity_y=parameters.velocities(:,2);
+if size(parameters.velocities,2)==3, %we have to consider vz if Stokes model
+	velocity_z=parameters.velocities(:,3);
+end
+
+%From bed and thickness, compute effective pressure when drag is viscous:
+Neff=gravity*(rho_ice*thickness+rho_water*bed);
+
+%If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
+%the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
+%for this should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
+%replace it by Neff=0 (ie, equival it to an ice shelf)*/
+pos=find(Neff<0);
+Neff(pos)=0;
+
+%recover p and q in the drag law u = k * sigma ^ p * Neff ^ q :
+pcoeff=parameters.p;
+qcoeff=parameters.q;
+rcoeff=qcoeff./pcoeff;
+scoeff=1./pcoeff;
+
+%We need the velocity magnitude to evaluate the basal stress:
+if size(parameters.velocities,2)==2,
+	velocity_mag=sqrt(velocity_x.^2+velocity_y.^2);
+elseif size(parameters.velocities,2)==3,
+	velocity_mag=sqrt(velocity_x.^2+velocity_y.^2+velocity_z.^2);
+end
+
+alpha2=(K.^2).*(Neff.^rcoeff).*velocity_mag.^(scoeff-1);
Index: /issm/trunk/src/m/shared/Solver.m
===================================================================
--- /issm/trunk/src/m/shared/Solver.m	(revision 1)
+++ /issm/trunk/src/m/shared/Solver.m	(revision 1)
@@ -0,0 +1,22 @@
+function X=Solver(A,B,solver_type);
+%ICESOLVER - solve the matrix equation AX=B
+%
+%   Solver AX=B, with Chol, Lu or general solvers from matlab.
+%   We can use either the LU or the Cholesky decomposition, but the
+%   Cholesky decomposition is twice as efficient as LU for symmetric
+%   definite positive matrix
+%
+%   Usage:
+%      X=IceSolver(A,B,solver_type);
+
+if strcmpi(solver_type,'lu'),
+	% Solve by LU decomposition. 
+	[L,U] = lu(A);
+	X = U\(L\B);
+elseif strcmpi(solver_type,'cholesky'),
+	% Solve by Choleski decomposition.
+	L = chol(A); X = L\(L'\B);
+else
+	% use matlab's generic solver
+	X = A\B;
+end
Index: /issm/trunk/src/m/shared/hutterenum.m
===================================================================
--- /issm/trunk/src/m/shared/hutterenum.m	(revision 1)
+++ /issm/trunk/src/m/shared/hutterenum.m	(revision 1)
@@ -0,0 +1,9 @@
+function macro=hutterenum()
+%HUTTERENUM - returns the integer associated with Hutter elements
+%
+%   Usage:
+%      macro=hutterenum()
+%
+%   See also: SETELEMENTSTYPE, STOKESENUM, PATTYNENUM, MACAYEALENEUM, NONEENUM
+
+macro=1;
Index: /issm/trunk/src/m/shared/macayealenum.m
===================================================================
--- /issm/trunk/src/m/shared/macayealenum.m	(revision 1)
+++ /issm/trunk/src/m/shared/macayealenum.m	(revision 1)
@@ -0,0 +1,9 @@
+function macro=macayealenum()
+%MACAYEALENUM - returns the integer associated with macayeal elements
+%
+%   Usage:
+%      macro=macayealenum()
+%
+%   See also: SETELEMENTSTYPE, STOKESENUM, PATTYNENUM, HUTTERENEUM, NONEENUM
+
+macro=2;
Index: /issm/trunk/src/m/shared/noneenum.m
===================================================================
--- /issm/trunk/src/m/shared/noneenum.m	(revision 1)
+++ /issm/trunk/src/m/shared/noneenum.m	(revision 1)
@@ -0,0 +1,9 @@
+function macro=noneenum()
+%NONEENUM - returns the integer associated with "none" elements
+%
+%   Usage:
+%      macro=noneenum()
+%
+%   See also: SETELEMENTSTYPE, STOKESENUM, PATTYNENUM, MACAYEALENEUM, HUTTERENUM
+
+macro=0;
Index: /issm/trunk/src/m/shared/pattynenum.m
===================================================================
--- /issm/trunk/src/m/shared/pattynenum.m	(revision 1)
+++ /issm/trunk/src/m/shared/pattynenum.m	(revision 1)
@@ -0,0 +1,9 @@
+function macro=pattynenum()
+%PATTYNENUM - returns the integer associated with pattyn elements
+%
+%   Usage:
+%      macro=pattynenum()
+%
+%   See also: SETELEMENTSTYPE, STOKESENUM, HUTTERENUM, MACAYEALENEUM, NONEENUM
+
+macro=3;
Index: /issm/trunk/src/m/shared/recover_input.m
===================================================================
--- /issm/trunk/src/m/shared/recover_input.m	(revision 1)
+++ /issm/trunk/src/m/shared/recover_input.m	(revision 1)
@@ -0,0 +1,22 @@
+function  [field,fieldispresent]=recover_input(inputs,fieldname)
+%RECOVER_INPUT - recover the field of a structure
+%
+%   From a certain structure, recover the field that corresponds to a certain 
+%   field name. For example: field=recover_input(input,'bof') where input=struct('bof',4,'baf',5)
+%   will return the value 4, and 1 for fieldispresent. If 'bof' field did not exist, field would be 
+%   NaN and fieldispresent would be 0.
+%
+%   Usage:
+%      [field,fieldispresent]=recover_input(inputs,fieldname)
+
+if  isfield(inputs,fieldname),
+	field=getfield(inputs,fieldname);
+	if ~isempty(field),
+		fieldispresent=1;
+	else
+		fieldispresent=0;
+	end
+else
+	field=NaN;
+	fieldispresent=0;
+end
Index: /issm/trunk/src/m/shared/stokesenum.m
===================================================================
--- /issm/trunk/src/m/shared/stokesenum.m	(revision 1)
+++ /issm/trunk/src/m/shared/stokesenum.m	(revision 1)
@@ -0,0 +1,9 @@
+function macro=stokesenum()
+%STOKESENUM - returns the integer associated with stokes elements
+%
+%   Usage:
+%      macro=stokesenum()
+%
+%   See also: SETELEMENTSTYPE, HUTTERENUM, PATTYNENUM, MACAYEALENEUM, NONEENUM
+
+macro=4;
Index: /issm/trunk/src/m/solutions/cielo/Builduset.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/Builduset.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/Builduset.m	(revision 1)
@@ -0,0 +1,82 @@
+function uset=builduset( bgpdt, bgpdtb,analysis);
+% BUILDUSET builduset(bgpdt, bgpdtb)
+%
+% Builds the uset table from the bgpdt table. 
+%
+% Input: 	bgpdt, bgpdtb  	pointer to bgpdt table on data base
+%           analysis: analysis type, string
+%
+% Output: 	uset 		structure of partitioning vectors and its sizes
+%						in global Matlab workspace
+%
+% Calls  Upartn (mex)
+% where ms= m-script, mf= m-function, mex= executable function (c-code)
+%
+% This function is called after the uset bits in the bgpdt table have been
+% determined, e.g. after Gp4 or after Gpsp.
+%
+% The uset table is a matlab structure containing     
+%
+% uset.pv_g		g-set partitioning vector
+% uset.gsize 	size of the g-set
+% uset.pv_n		n-set partitioning vector with respect to (wrt) the g-set
+% uset.nsize 	size of the n-set
+% uset.pv_m  	m-set partitioning vector wrt the g-set
+% uset.msize  	size of the m-set
+% uset.pv_s  	s-set partitioning vector wrt the n-set
+% uset.ssize    size of the s-set
+% uset.pv_f  	f-set partitioning vector wrt the n-set
+% etc.
+%
+% The sets have the following hierarchy
+%
+% p - e       p = e + g    p= physical dof, e= extra point dofs
+%   - g - m           g= n + m   g= grid dofs,  m= multi-point constraint dofs
+%       - n - s          n= f + s   n= dofs not constr.by m, s= single-point constr.dofs
+%           - f - o         f= a + o   f= free dofs, o= omitted dofs
+%               - a - q        a= t + q   a= assembled dofs, q= generalized modal dofs   
+%                   - t - r       t= l + r  t= total dofs, r= rigid body dofs
+%                       - l - c      l= c + b + lm   l= left-over dofs, c= free dofs,
+%                           - b                      b= fixed dofs for modal reduction,
+%                           - lm                     lm= Lagrange multipliers.
+%
+% any combination of sets can be constructed, e.g.
+% d= a + e    d= dynamic dofs
+
+%			
+% Go down the set hierarchy and fill the structure
+% note that the order m - s - o - q - r must be kept, the m- and n-set partitioning
+% vector are wrt the g-set, the s- and f-set partitioning vectors are wrt the n-set,
+% etc.
+%
+
+% split g into m and n
+
+[uset.pv_m, uset.pv_n]= Upartn( bgpdt, bgpdtb,analysis, 'g', 'm', 'n');
+uset.msize= length(uset.pv_m);
+uset.nsize= length(uset.pv_n);
+uset.gsize= uset.msize + uset.nsize;
+
+% split n into s and f
+
+[uset.pv_s, uset.pv_f]= Upartn( bgpdt, bgpdtb,analysis, 'n', 's', 'f');
+uset.ssize= length(uset.pv_s);
+uset.fsize= length(uset.pv_f);
+
+% split f into o and a
+
+[uset.pv_o, uset.pv_a]= Upartn( bgpdt, bgpdtb,analysis, 'f', 'o', 'a');
+uset.osize= length(uset.pv_o);
+uset.asize= length(uset.pv_a);
+
+% split a into q and t
+
+[uset.pv_q, uset.pv_t]= Upartn( bgpdt, bgpdtb,analysis, 'a', 'q', 't');
+uset.qsize= length(uset.pv_q);
+uset.tsize= length(uset.pv_t);
+
+% split t into r and l
+
+[uset.pv_r, uset.pv_l]= Upartn( bgpdt, bgpdtb,analysis, 't', 'r', 'l');
+uset.rsize= length(uset.pv_r);
+uset.lsize= length(uset.pv_l);
Index: /issm/trunk/src/m/solutions/cielo/CieloHorizontalVelocityDepthAverage.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/CieloHorizontalVelocityDepthAverage.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/CieloHorizontalVelocityDepthAverage.m	(revision 1)
@@ -0,0 +1,12 @@
+function velocity_average_g=CieloHorizontalVelocityDepthAverage(md,velocity_g);
+%compute depth averaged horizontal velocity
+
+vx_average2d=DepthAverage(md,velocity_g(1:6:uset.gsize));
+vy_average2d=DepthAverage(md,velocity_g(2:6:uset.gsize));
+
+%project onto layer 1 of 3d mesh
+vx_average=project3d(md,vx_average2d,'node',1);
+vy_average=project3d(md,vy_average2d,'node',1);
+
+%output on g-set
+velocity_average_g=zeros(uset.gsize,1);velocity_average_g(1:6:uset.gsize)=vx_average;velocity_average_g(2:6:uset.gsize)=vy_average;
Index: /issm/trunk/src/m/solutions/cielo/CieloVelocityExtrude.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/CieloVelocityExtrude.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/CieloVelocityExtrude.m	(revision 1)
@@ -0,0 +1,39 @@
+function u_g=CieloVelocityExtrude(md,u_g);
+%Extrude collapsed horizontal velocities present in MacAyeal elements
+
+if strcmpi(md.type,'2d'),
+	%do nothing, we don't have a 3d mesh anyway.
+else
+
+	%Find list of 2d grids that belong to the collapsed macayeal elements.
+	%Numbering for these 2d grids corresponds to the initial 2d mesh.
+	grids2d=md.proj2d_coll_grids(1:md.number_grids2d_coll);
+	vx2d=u_g(1:6:6*md.number_grids2d_coll);
+	vy2d=u_g(2:6:6*md.number_grids2d_coll);
+
+	%Plug values for these 2d grids into the 2d mesh: 
+	vx=zeros(md.numberofgrids2d,1);
+	vx(grids2d)=vx2d;
+
+	vy=zeros(md.numberofgrids2d,1);
+	vy(grids2d)=vy2d;
+
+	%Extrude across the 3d mesh
+	vx3d=project3d(md,vx,'node');
+	vx3d(1:md.number_grids2d_coll)=0;
+	vy3d=project3d(md,vy,'node');
+	vy3d(1:md.number_grids2d_coll)=0;
+
+	%For border grids between MacAyeal and Pattyn, values will double, fix that.
+	for i=1:length(md.penalties), 
+		vx3d(md.penalties(i).grids3d_noncollapsed)=0;
+		vy3d(md.penalties(i).grids3d_noncollapsed)=0;
+	end
+
+	%Plug back into u_g
+	u_g(1:6:end)=u_g(1:6:end)+vx3d;
+	u_g(2:6:end)=u_g(2:6:end)+vy3d;
+
+end
+
+end %end function
Index: /issm/trunk/src/m/solutions/cielo/ConstrainControlParameterB.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/ConstrainControlParameterB.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/ConstrainControlParameterB.m	(revision 1)
@@ -0,0 +1,7 @@
+function B=ConstrainControlParameterB(B,m,params);
+
+%Ok, simple one: keep B positive.
+
+pos=find(B<=0);
+B(pos)=10;
+
Index: /issm/trunk/src/m/solutions/cielo/ConstrainControlParameterdrag.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/ConstrainControlParameterdrag.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/ConstrainControlParameterdrag.m	(revision 1)
@@ -0,0 +1,5 @@
+function drag=ConstrainControlParameterdrag(drag,m,params);
+%Ok, simple one: keep drag positive.
+
+pos=find(drag<=0);
+drag(pos)=5;
Index: /issm/trunk/src/m/solutions/cielo/ControlOptions.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/ControlOptions.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/ControlOptions.m	(revision 1)
@@ -0,0 +1,15 @@
+function options=ControlOptions(parameters);
+%CONTROLOPTIONS - setup optimization options for fmincon, using workspace parameters.
+%   
+%   Usage:
+%      options=ControlOptions(parameters)
+%
+%   See also: fmincon, optimset, control
+
+options=optimset('fminbnd');      
+options=optimset(options,'Display','iter');
+options=optimset(options,'MaxIter',parameters.maxiter(1));
+options=optimset(options,'TolX',parameters.tolx);
+options=optimset(options,'FunValCheck','on');
+
+
Index: /issm/trunk/src/m/solutions/cielo/CreateFemModel.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/CreateFemModel.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/CreateFemModel.m	(revision 1)
@@ -0,0 +1,43 @@
+%-----------------------------------------------------------------------
+%	CreateFEMModel.m: from a matlab ISSM @model class object, create a finite element 
+%                  model structure, with "c" code datasets (elements, nodes, loads,  constraints, 
+%                  parameters, partitioning vectors.
+%
+%-----------------------------------------------------------------------
+
+function  m=CreateFEMModel(md)
+
+	disp(sprintf('\n   reading data from model %s...',md.name));
+	[m.elements,m.nodes,m.constraints,m.loads,m.materials,parameters]=ModelProcessor(md);
+	
+	disp('   generating degrees of freedom...');
+	[m.nodes,m.part,m.tpart]=Dof(m.elements,m.nodes,parameters);
+	
+	disp('   generating single point constraints...');
+	[m.nodes,m.yg]=SpcNodes(m.nodes,m.constraints);
+
+	disp('   generating rigid body constraints...');
+	[m.Rmg,m.nodes]=MpcNodes(m.nodes,m.constraints);
+
+	disp('   generating node sets...');
+	m.nodesets=BuildNodeSets(m.nodes);
+
+	disp('   reducing single point constraints vector...');
+	[m.ys m.ys0]=Reducevectorgtos(m.yg,m.nodesets);
+
+	disp('   normalizing rigid body constraints matrix...');
+	m.Gmn = NormalizeConstraints(m.Rmg,m.nodesets);
+	
+	disp('   configuring element and loads...');
+	[m.elements,m.loads] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials);
+	
+	disp('   processing parameters...');
+	parameters= ProcessParams(parameters,m.part);
+
+	disp('   creating parameters in matlab workspace...');
+	m.parameters= ParamsToWorkspace(parameters);
+
+	%Get rid of parameters dataset. 
+	clear parameters;
+
+end
Index: /issm/trunk/src/m/solutions/cielo/GradJCompute.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/GradJCompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/GradJCompute.m	(revision 1)
@@ -0,0 +1,19 @@
+function grad_g=GradJCompute(m,inputs, u_g_obs);
+
+%Recover solution for this stiffness and right hand side: 
+[u_g K_ff0 K_fs0 ]=diagnostic_core_nonlinear(m,inputs);
+
+%Buid Du, difference between observed velocity and model velocity.
+[Du_g]=Du(m.elements,m.nodes,m.loads,m.materials,m.parameters, u_g,u_g_obs,inputs);
+
+%Reduce adjoint load from g-set to f-set
+[Du_f] = Reduceloadfromgtof( Du_g, m.Gmn, K_fs0, m.ys0, m.nodesets);
+
+%Solve for adjoint vector: 
+lambda_f=Solver(K_ff0,Du_f,[],m.parameters);
+
+%Merge back to g set
+lambda_g= Mergesolutionfromftog( lambda_f, m.Gmn, m.ys0, m.nodesets ); 
+
+%Compute gradJ 
+grad_g=Gradj(m.elements,m.nodes,m.loads,m.materials,m.parameters, u_g, lambda_g,inputs);
Index: /issm/trunk/src/m/solutions/cielo/Mergesolvec.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/Mergesolvec.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/Mergesolvec.m	(revision 1)
@@ -0,0 +1,57 @@
+function [u_g]= mergesolvec( u_f, G_mn, y_s ,uset);
+% MERGESOLVEC [u_g]= mergesolvec ( u_f, G_mn, y_s )
+% Merges solution vectors (displacement/temperature) from f size to g size, 
+% u_f to u_g,
+% the solution vectors can be total in linear or incremental in nonlinear.
+%
+% g global dof g = m + n
+% m dependent dof 
+% n independent dof  n= s + f
+% f free dof
+% s single point constraint dof
+%
+% Input:  u_f     	solution vectors (f size) 
+%					in Matlab workspace
+%		  G_mn      Reduction matrix from constraints (m x n)
+%					in Matlab workspace
+%		  y_s		vectors of enforced displacements y_s 
+%					in Matlab workspace
+%
+% Output: u_g       solution vectors (g size)
+%
+% Input from global workspace:
+%
+%         uset      uset.pv_*  partitioning vectors and sizes
+%					uset.*size   *=n,m etc.
+%
+% Called by  sol101 (ms), Normalmodes (ms), sol159 (ms) (all solution sequences)
+% Calls  none 
+% where ms= m-script, mf= m-function, mex= executable function (c-code)
+%
+% m_set and n_set index vectors are with respect to (wrt) the g- set
+% s_set and f_set index vectors are with respect to (wrt) the n- set
+
+%Merge f_set and s_set to n_set
+
+ncol= size( u_f, 2);
+u_n= sparse(uset.nsize,ncol);
+u_n(uset.pv_f,:)= u_f;
+
+
+% Note: we assume u_f and y_s have the same no.of columns
+if ~isempty(y_s)
+	u_n(uset.pv_s,:)= y_s;
+end
+
+%   Merge n_set and m_set to g_set
+
+u_g = sparse(uset.gsize,ncol);
+u_g(uset.pv_n,:)= u_n;
+
+	
+if (uset.msize>0)
+	u_m = G_mn * u_n;
+	u_g(uset.pv_m,:)= u_m;
+end
+
+end
Index: /issm/trunk/src/m/solutions/cielo/NewCreateFEMModel.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/NewCreateFEMModel.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/NewCreateFEMModel.m	(revision 1)
@@ -0,0 +1,105 @@
+%-----------------------------------------------------------------------
+%	CreateFEMModel.m: from a matlab ISSM @model class object, create a finite element 
+%                  compatible with Cielo.
+%
+%-----------------------------------------------------------------------
+function  m=CreateFEMModel(md,analysis_type )
+
+	global ParameterDefaults
+
+%	read input data:
+
+	disp(sprintf('\n   reading data from model %s...',md.name));
+	[m.ncase, m.dynamic, m.ept, m.geom1, m.geom1b, m.geom2, m.part, m.tpart, m.geom3, ...
+		m.geom4, m.mpt, m.pvt, m.sets, m.dit] = newImp( md ,analysis_type);
+
+		error;
+		
+%	generate list of states from case control (ncase), if any:
+
+	disp('   generating states...');
+	[m.states] = GenerateStates( m.ncase, m.dynamic);
+	
+	%ncase not needed anymore
+	m=rmfield(m,'ncase');
+
+%	generate grid point definition table
+%	(internal grid records, contain sil and uset data)
+	
+	disp('   generating gpdt...');
+	[m.gpdt,m.gpdtb] = Gp1( m.geom1, m.geom1b);
+
+	
+%	generate coordinate system transformation matrices, transform
+%	grids to basic coordinate system
+
+	disp('   generating updated gpdt...');
+	[m.cstm, m.bgpdt, m.bgpdtb] = Gp1b( m.geom1, m.geom1b, m.gpdt, m.gpdtb);
+
+	m=rmfield(m,'gpdt');
+	if ~isempty(m.gpdtb), m=rmfield(md,'gpdtb');end;
+
+	%geom1 and geom1b not needed anymore
+	m=rmfield(m,'geom1');
+	if ~isempty(m.geom1b), m=rmfield(m,'geom1b'); end;
+
+	%disp('   generating element objects...');
+	[m.est,m.lst] = Gp2( m.bgpdt, m.bgpdtb, m.ept, m.geom2, m.mpt, m.geom3);
+
+	%geom2 not needed anymore
+	m=rmfield(m,'geom2');
+
+%	phase 1:
+%
+	
+%	set parameters using bulk data, nastran case control above subcase level:
+	current_state = {};
+	[next_state] = NextState( m.states, current_state);
+	m.current_state = next_state;
+	clear next_state current_state;
+
+	[m.params] = Pvt( m.current_state, m.pvt);
+	
+
+%	generate usets and constraint matrices:
+
+	disp('   generating uset data and constraints...');
+
+	[m.updated_bgpdt, m.updated_bgpdtb, m.y_g, m.R_mg] = Gp4( m.states, m.geom4, m.bgpdt, m.bgpdtb,analysis_type);
+	
+	
+	%geom4 not needed anymore
+	if ~isempty(m.geom4), m=rmfield(m,'geom4');end;
+
+%	replace old bgpdt with new (bgpdt unchanged if nonexistent updated_bgpdt):
+	m.bgpdt = m.updated_bgpdt;m=rmfield(m,'updated_bgpdt');
+	if ~isempty(m.updated_bgpdtb),
+		m.bgpdtb = m.updated_bgpdtb;
+		m=rmfield(m,'updated_bgpdtb');
+	end;
+
+%   create uset table 
+	m.uset=Builduset(m.bgpdt,m.bgpdtb,analysis_type); 
+
+	
+%
+%	phase 1:
+%
+%	autospc operations:
+%	autospc is done on the g_set, it should be done on the n_set later
+
+%	Partition R_mg into R_mm and R_mn, and
+%	calculate G_mn = - R_mm^-1 * R_mn  (MCE1 type operations)
+
+	[m.G_mn] = Normalizeconstraints( m.R_mg, m.uset);
+
+%	Reduce enforced displacements / temperatures 
+	[m.y_s] = Reducevectorg( m.y_g ,m.uset);
+	
+
+	if isempty(m.y_s),
+		flag_y_s= 0;
+	else
+		flag_y_s= 1;
+	end
+end
Index: /issm/trunk/src/m/solutions/cielo/Normalizeconstraints.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/Normalizeconstraints.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/Normalizeconstraints.m	(revision 1)
@@ -0,0 +1,52 @@
+function [G_mn]= normalizeconstraints( R_mg ,uset);
+% NORMALIZECONSTRAINTS [G_mn]= normalizeconstraints( pR_mg )
+%
+% Calculates the G_mn matrix from the Jacobian of the
+% multi point and rigid constraints R_mg
+%
+% G_mn = -inv(R_mm) * R_mn
+%
+% where R_mg = [ R_mm R_mn ]
+%
+% m dependent dof 
+% n independent dof
+% g global dof g = m + n
+%
+% Input:  pR_mg    	pointer to R_mg matrix on data base
+%		            R_mg is the m x g matrix of constraints
+%					Use m.R_mg in the calling script
+%
+% Output: G_mn      m x n normalized matrix of constraints in the workspace
+%
+% Input from global workspace:
+%
+%         uset      uset.pv_*  	partitioning vector
+%					uset.*size 	size 
+%								*=n,m etc.
+%
+% Called by  sol101 (ms), Normalmodes (ms), sol159 (ms) (all solution sequences)
+% Calls  IMdb (mex)
+% where ms= m-script, mf= m-function, mex= executable function (c-code)
+%
+% uset.pv_m and uset.pv_n partitioning indicees are with respect to the g- set
+%
+% R_mg is the matrix (Jacobian) of constraints from MPCs and rigid elements,
+% with m rows and g columns. The m constraint equations are used to eliminate m
+% dof out of g dof leaving n dof . The normalized constraint matrix G_mn
+% is needed for later elimination, partition and merge operations.
+%
+
+% Retrieve R_mg, partition, and calculate G_mn
+
+if(uset.msize>0)
+
+	R_mm = R_mg(:, uset.pv_m);
+	R_mn = R_mg(:, uset.pv_n);
+
+	G_mn= - inv(R_mm) * R_mn;
+
+else
+
+	G_mn= [];
+
+end
Index: /issm/trunk/src/m/solutions/cielo/Orth.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/Orth.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/Orth.m	(revision 1)
@@ -0,0 +1,30 @@
+function  new_gradients=Orth(gradients,oldgradients);
+
+global client_server_mode IMDataCounter
+
+%outpu 
+new_gradients=gradients;
+
+numparams=length(gradients);
+for i=1:numparams,
+
+	%recover gradient  #i
+	gradient=gradients{i};
+	oldgradient=oldgradients{i};
+	
+	if isempty(oldgradient),
+		oldgradient=zeros(length(gradient),1);
+	end
+
+	% normalize gradient #i to 1
+	gradient=gradient/norm(gradient);
+
+	% rough orthagonalization
+	gradient=gradient-(gradient'*oldgradient)*oldgradient; 
+	
+	% renormalize gradients 
+	gradient=gradient/norm(gradient);
+
+	%plug back into gradients
+	new_gradients{i}=gradient;
+end
Index: /issm/trunk/src/m/solutions/cielo/Reducematrix.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/Reducematrix.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/Reducematrix.m	(revision 1)
@@ -0,0 +1,61 @@
+function [K_nn]= reducematrix( K_gg, G_mn, pv_m_set, pv_n_set, msize, flag );
+% REDUCEMATRIX [K_nn]= reducematrix( K_gg, G_mn, pv_m_set, pv_n_set, msize, flag )
+% Reduces K_gg to K_nn
+%          
+%          K_nn^~   K_nm
+% K_gg = [               ]
+%          K_mn     K_mm
+%
+% if flag == 1
+%  	K_nn = K_nn^~ + K_nm * G_mn
+% else
+% K_nn = K_nn^~ + K_nm * G_mn + G_mn^T * K_mn + G_mn^T * K_mm * G_mn
+%
+% m dof to be condensed 
+% n dof to be retained
+% g total dof g = m + n
+%
+% Input:  K_gg    	matrix (g x g)  
+%		  G_mn      Reduction matrix from constraints (m x n)
+%         pv_m_set  partitioning vector for the m dof wrt g 
+%         pv_n_set  partitioning vector for the n dof wrt g
+%		  msize		number of m-set dof
+%         flag      flag for type of condensation, see above 
+%
+% Output: K_nn      reduced matrix (n x n) 
+%
+% Called by  Reducematrixfromgtof (mf), Normalmodes (ms)
+% Calls none 
+% where ms= m-script, mf= m-function, mex= executable function (c-code)
+%
+% pv_m_set and pv_n_set index vectors are with respect to the g- set.
+%
+% All input and output variables are assumed to be in the workspace.
+
+if msize > 0 
+		
+%   Partition K_gg
+
+	K_mm = K_gg( pv_m_set, pv_m_set);
+	K_mn = K_gg( pv_m_set, pv_n_set);
+	K_nm = K_gg( pv_n_set, pv_m_set);
+	K_nn = K_gg( pv_n_set, pv_n_set);
+		
+%   Reduce K_gg to K_nn
+
+	K_nn = K_nn + K_nm * G_mn;
+	
+	if  flag ~= 1
+	
+		K_mn = K_mn + K_mm * G_mn;
+		K_nn = K_nn + G_mn' * K_mn;
+	
+	end
+	
+else     
+	
+% 	msize=0 just return input
+
+	K_nn = K_gg;
+	
+end
Index: /issm/trunk/src/m/solutions/cielo/Reducematrixfromgtof.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/Reducematrixfromgtof.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/Reducematrixfromgtof.m	(revision 1)
@@ -0,0 +1,51 @@
+function [ K_ff, K_fs] = reducematrixfromgtof(K_gg, G_mn, flag_u_s,uset);
+% REDUCEMATRIXFROMGTOF [K_ff, K_fs] = Reducematrixfromgtof( K_gg, G_mn, flag_u_s )
+% Reduces a matrix from g-size to f-size
+% 
+% Input:
+% 	K_gg		Matrix in g-size
+%	G_mn		Reduction matrix 
+%	flag_u_s	flag indicating whether K_fs is calculated or not
+%				=0 K_fs is not calculated, an empty matrix is returned
+%				=1 K_fs is calculated and returned
+% Output:
+%	K_ff		Reduced system tangent matrix f-size x f-size
+%   K_fs		Reduced sytem tangent matrix f-size x s-size
+%
+% Input from global workspace:
+%
+%	uset      	uset.pv_*  partitioning vector
+%				uset.*size size 
+%                          *=n,m etc., see Builduset
+%
+% Called by  sol101 (ms), Normalmodes (ms), Tangentmatrixheat (mf)
+% Calls  Reducematrix (mf)
+% where ms= m-script, mf= m-function, mex= executable function (c-code)
+%
+% The g-set is partitioned as follows
+%   g = n + m
+%  		n = f + s
+%   g 	all system degrees of freedom (dof)
+%   m 	multi-point constraint dofs to be condensed out
+%   n   remaining dof after m-set is condensed from the g-set
+%   s   boundary condition dofs (single point constraints)
+%   f   remaining free dofs after s-set is eliminated from the n-set
+%
+
+% 	Reduce matrix from g-size to n-size
+
+K_nn= Reducematrix( K_gg, G_mn, uset.pv_m, uset.pv_n, uset.msize, 2 );
+
+%  	Reduce matrix from n-size to f-size
+
+if  uset.ssize>0  
+	K_ff= K_nn(uset.pv_f, uset.pv_f);
+	if  flag_u_s 
+		K_fs= K_nn(uset.pv_f,uset.pv_s);
+	else
+		K_fs=[];
+	end
+else
+	K_ff= K_nn;
+	K_fs=[];
+end
Index: /issm/trunk/src/m/solutions/cielo/Reducerightside.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/Reducerightside.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/Reducerightside.m	(revision 1)
@@ -0,0 +1,111 @@
+function [p_f]= reducerightside( p_g, G_mn, K_fs, y_s, flag_y_s, uset )
+% REDUCERIGHTSIDE [p_f]= Reducerightside( p_g, G_mn, K_fs, y_s, flag_y_s )
+% Reduces right hand side vectors from g-size to f-size (p_g to p_f).
+%
+% Partition p_g into p_n and p_m, then modify p_n
+%
+% p_n = p_n + G_mn^T * p_m
+%
+% where G_mn is the reduction matrix from multi-point constraints
+%
+% Partition p_n into p_f and p_s, then modify p_f if flag_y_s > 0
+%
+% p_f = p_f - K_fs * y_s
+%
+% where y_s are enforced displacements/temperatures, 
+%
+% The g-set is partitioned as follows
+%   g = n + m
+%  		n = f + s
+%   g 	all system degrees of freedom (dof)
+%   m 	multi-point constraint dofs to be condensed out
+%   n   remaining dof after m-set is condensed from the g-set
+%   s   boundary condition dofs (single point constraints)
+%   f   remaining free dofs after s-set is eliminated from the n-set
+%
+% Input:  p_g     	right hand side vectors (g size) 
+%		  G_mn      Reduction matrix from constraints (m x n)
+%		  K_fs		Partitioned stiffness matrix (f x s)
+%         y_s		enforced displacements / temperatures s size
+%		  flag_y_s  flag for enforced displacement / temperature
+%					> 0 	K_fs * y_s is subtracted
+%                   <= 0	no action
+%
+% Output: p_f       reduced right hand side vectors (f-size)
+%
+% Called by  sol101 (ms), Normalmodes (ms), Residualheat (mf)
+% Calls none 
+% where ms= m-script, mf= m-function, mex= executable function (c-code)
+%
+% All input and output variables are assumed to be in the Matlab workspace.
+% The load vectors p_g and y_s must have the same number of columns. 
+%
+% Input from global workspace:
+%
+%	uset      	uset.pv_*  partitioning vector
+%				uset.*size size 
+%                          *=n,m etc., see Builduset
+%
+% uset.pv_m and uset.pv_n index vectors are wrt the g- set
+% uset.pv_s and uset.pv_f index vectors are wrt the n- set
+% etc.
+
+% Reduce p_g to p_f if not empty
+
+if ~isempty(p_g)
+	
+	% Reduce p_g to p_n
+
+	if ( uset.msize > 0 )
+		p_n = p_g( uset.pv_n, :);
+		p_m = p_g( uset.pv_m, :);
+		p_n = p_n + G_mn' * p_m;
+	else
+		p_n  = p_g;
+	end
+
+	% Reduce p_n to p_f
+
+	if ( uset.ssize > 0 )
+		p_f = p_n( uset.pv_f, :);
+	else
+		p_f = p_n;
+	end
+
+% Create a p_f if p_g is empty
+
+else
+	
+	if isempty(y_s)
+		disp('No right hand side found...');
+		p_f=[];
+		return;
+	else
+		ncols= size( y_s, 2);
+		p_f= sparse([],[],[],uset.fsize, ncols);
+	end
+	
+end
+	
+% for nonzero boundary conditions, subtract coupling forces,
+% this operation is only executed if flag_y_s > 0,
+% the flag is set in the calling script for linear analysis
+% and the first iteration step in nonlinear analysis
+
+if ( flag_y_s > 0 ) & ( ~isempty(y_s) )
+	% check if p_f and y_s have the same number of columns
+
+	ncolp= size(p_f,2);
+	ncoly= size(y_s,2);
+
+	if ncolp ~= ncoly
+		disp('Right hand side can not be calculated...');
+		return;
+	end
+
+	p_f = p_f - K_fs * y_s;
+		
+end
+
+
+end
Index: /issm/trunk/src/m/solutions/cielo/Reducevectorg.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/Reducevectorg.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/Reducevectorg.m	(revision 1)
@@ -0,0 +1,19 @@
+function [y_s]= Reducevectorg( y_g,uset )
+% REDUCEVECTORG [y_s ]= reducevectorg( py_g, uset )
+%
+% 
+% Input in global workspace:
+%
+%         uset      uset.pv_*  partitioning vectors and sizes
+%					uset.*size   *=n,m etc.
+
+if ( uset.ssize>0 )
+	if ~isempty(y_g),
+		y_n= y_g(uset.pv_n,:);
+		y_s= y_n(uset.pv_s,:);
+	else
+		y_s=[];
+	end	
+else 
+	y_s=[];
+end
Index: /issm/trunk/src/m/solutions/cielo/Residualice.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/Residualice.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/Residualice.m	(revision 1)
@@ -0,0 +1,3 @@
+function [res_g] = Residualice( KH, pnl, u);
+	res_g = pnl - KH * u;
+end
Index: /issm/trunk/src/m/solutions/cielo/SetParameterDefaults.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/SetParameterDefaults.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/SetParameterDefaults.m	(revision 1)
@@ -0,0 +1,46 @@
+%SETPARAMETERDEFAULTS
+%	  SetParameterDefaults sets parameter defaults for solution sequences. 
+%	  In particular, Emg module defaults, as well a Client/Server parameters.
+%
+%	  See also Pvt
+
+
+global ParameterDefaults;
+
+ParameterDefaults.autospc  ='yes';
+ParameterDefaults.coupmass = -1;	% translated to lumped/consistent option
+ParameterDefaults.epzero   = 1.e-8;
+ParameterDefaults.sigma    = 0.;
+ParameterDefaults.tabs     = 0.;
+
+%   for testing, may be made permanent later:
+
+ParameterDefaults.linesrch = 1;		% 0=no, 1=yes
+
+%	Client/Server mode settings
+
+ParameterDefaults.tunnel='no'; %enable ssh tunnelling for encrypted communication to Server.
+ParameterDefaults.batsiz=1;  %size of batch jobs sent to nodes
+ParameterDefaults.fdbckout=0;  %feedback output level from server (0: no output, 1: basic output, 3: large output)
+ParameterDefaults.batch='no';  %run in batch mode.
+ParameterDefaults.errchk='yes';  %run with error chechking.
+
+% Integration rule for sol159 is set to 3 (mid point rule)
+
+	ParameterDefaults.int_rule   = 3;
+
+
+%  John's Emg.mex, and Plotresults.m are picking up the following parameters
+
+	ParameterDefaults.analysis='structural';
+	ParameterDefaults.zgrad   ='no';
+	ParameterDefaults.imoselem='no';
+	ParameterDefaults.wtmass  = 1.;
+	ParameterDefaults.lumpm   = 1;
+	ParameterDefaults.mred    = 0;
+	ParameterDefaults.niref   = 1;
+	ParameterDefaults.njref   = 1;
+	ParameterDefaults.nkref   = 1;
+	ParameterDefaults.cido    =-1;
+	ParameterDefaults.solverstring    = ' -mat_type aij -ksp_type cgs -pc_type asm -sub_pc_type lu ';
+
Index: /issm/trunk/src/m/solutions/cielo/SwitchPartitioning.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/SwitchPartitioning.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/SwitchPartitioning.m	(revision 1)
@@ -0,0 +1,30 @@
+function new_u_g=SwitchPartitioning(u_g,destination,part,tpart,doflist);
+%INPUT function new_u_g=SwitchPartitioning(u_g,destination,part,tpart,doflist);
+
+gsize=length(u_g);
+if strcmpi(destination,'workspace'),
+	%g-size vector u_g is ordered according to a parallel partition. REorder it 
+	%so that u_g correspondgs to the workspace partition (ie: the initial grid 
+	%partition)
+	new_u_g=zeros(gsize,1);
+	
+	%go through list of degrees of freedom that need repartitioning
+	for i=1:length(doflist),
+		dof=doflist(i);
+		ind=dof:6:gsize; ind=ind(tpart);
+		new_u_g(dof:6:gsize)=u_g(ind);
+	end
+elseif strcmpi(destination,'cluster'),
+	%g size  vector u_g is ordered according to the matlab workspace. We need to 
+	%reorder it so that u_g is now ordered in the parallel partition.
+
+	new_u_g=zeros(gsize,1);
+
+	for i=1:length(doflist), 
+		dof=doflist(i);
+		ind=dof:6:gsize; vector=u_g(ind);
+		new_u_g(dof:6:gsize)=vector(part);
+	end
+else
+	error('SwitchPartitioning error message: only types of destination allowed are ''workspace'' or ''cluster''!');
+end
Index: /issm/trunk/src/m/solutions/cielo/cielodiagnostic_core_linear.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cielodiagnostic_core_linear.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cielodiagnostic_core_linear.m	(revision 1)
@@ -0,0 +1,48 @@
+function [ru_g m]=cielodiagnostic_core_linear(m,params,inputs,analysis)
+%INPUT ru_g =cielodiagnostic_core_linear(m,params,inputs,analysis)
+
+	%check inputs
+	if isempty(inputs),
+		clear inputs;
+	end
+
+	%recover flag_y_s from m.y_s
+	if isempty(m.y_s),
+		flag_y_s= 0;
+	else
+		flag_y_s= 1;
+	end
+
+	%stiffness and load generation only:
+	params.kflag=1; params.pflag=1;
+	params.ktflag=0;
+
+	%system matrices
+	[rK_gg , rp_g , rdK_gg]=Emg(m.bgpdt,m.bgpdtb, m.est,m.lst,m.ept,m.mpt,m.geom3,params,inputs,analysis);
+	
+	%Reduce tangent matrix from g size to f size
+	[rK_ff, rK_fs] = Reducematrixfromgtof( rK_gg, m.G_mn, flag_y_s ); 
+
+	%Cleanup memory
+	rK_gg=IMdb('drop rK_gg');
+	if ~isempty(rdK_gg), rdK_gg=IMdb('drop rdK_gg');end;
+	
+	%Reduce load from g size to f size
+	[rp_f] = Reducerightside( rp_g, m.G_mn, rK_fs, m.y_s, flag_y_s );
+	
+	%Cleanup memory
+	[rp_g rK_fs]=IMdb('drop rp_g rK_fs');
+	
+	%Solve	
+	[ru_f]=Solver(rK_ff,rp_f,{},params.solverstring);
+
+	%Cleanup memory
+	[rK_ff rp_f]=IMdb('drop rK_ff rp_f');
+	
+	%Merge back to g set
+	ru_g= Mergesolvec( ru_f, m.G_mn, m.y_s ); 
+	
+	%Cleanup memory
+	ru_f=IMdb('drop ru_f ');
+
+end %end function
Index: /issm/trunk/src/m/solutions/cielo/cielomelting_core.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cielomelting_core.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cielomelting_core.m	(revision 1)
@@ -0,0 +1,50 @@
+function rmelting_g =cielomelting_core_linear(m,params,thermalparams,inputs,analysis)
+%INPUT function rmelting_g =cielomelting_core_linear(m,params,thermalparams,inputs,analysis)
+
+	%recover flag_y_s from m.y_s
+	if m.y_s.header.M==0,
+		flag_y_s= 0;
+	else
+		flag_y_s= 1;
+	end
+
+	%stiffness and load generation only:
+	params.kflag=1; params.pflag=1;
+	params.ktflag=0;
+
+	%optional inputs
+	inputs.beta=thermalparams.beta;
+	inputs.meltingpoint=thermalparams.meltingpoint;
+	inputs.latentheat=thermalparams.latentheat;
+	inputs.heatcapacity=thermalparams.heatcapacity;
+	inputs.penalty=thermalparams.penalty;
+
+	%system matrices
+	[rK_gg , rp_g , rdK_gg]=Emg(m.bgpdt,m.bgpdtb, m.est,m.lst,m.ept,m.mpt,m.geom3,params,inputs,analysis);
+
+	%Reduce tangent matrix from g size to f size
+	[rK_ff, rK_fs] = Reducematrixfromgtof( rK_gg, m.G_mn, flag_y_s ); 
+
+	if params.lowmem, 
+		[rK_gg,rdK_gg]=IMdb('drop rK_gg rdK_gg');
+	end
+	
+	%Reduce load from g size to f size
+	[rp_f] = Reducerightside( rp_g, m.G_mn, rK_fs, m.y_s, flag_y_s );
+	if params.lowmem,
+		[rp_g rK_fs]=IMdb('drop rp_g rK_fs');
+	end
+
+	%Solve	
+	[rt_f]=Solver(rK_ff,rp_f,{},params.solverstring);
+
+	if params.lowmem,
+		[rK_ff rp_f]=IMdb('drop rK_ff rp_f');
+	end
+	
+	%Merge back to g set
+	rmelting_g= Mergesolvec( rt_f, m.G_mn, m.y_s ); 
+	
+	if (params.lowmem && count>2),
+		rt_f=IMdb('drop rt_f ');
+	end
Index: /issm/trunk/src/m/solutions/cielo/cielomesh.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cielomesh.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cielomesh.m	(revision 1)
@@ -0,0 +1,20 @@
+function md=cielomesh(md)
+%INPUT function md=cielomesh(md)
+%mesh solution
+
+	%timing
+	t1=clock;
+
+	analysis='mesh';
+
+	%configure, and initialise data model and parameter defaults:
+	SetParameterDefaults;
+
+	%first build an initial triangulation, using the domain outline and qhull.
+	[md.elements,md.x,md.y,md.z]=MeshTriangulate(md);
+	md.numberofgrids=length(md.x);
+	md.numberofelements=length(md.elements);
+
+	%timing
+	t2=clock;
+	disp(sprintf('\n%s\n',['   solution lasted ' num2str(etime(t2,t1)) ' seconds']));
Index: /issm/trunk/src/m/solutions/cielo/cielomesh2grid.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cielomesh2grid.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cielomesh2grid.m	(revision 1)
@@ -0,0 +1,37 @@
+function md=cielomesh2grid(md)
+%INPUT function md=cielomesh2grid(md)
+%mesh2grid solution
+
+	%timing
+	t1=clock;
+
+	analysis='mesh2grid';
+
+	%configure, and initialise data model and parameter defaults:
+	SetParameterDefaults;
+
+	%Initialize results
+	md.mesh2grid_results=cell(length(md.mesh2grid_parameters),1);
+
+	%Recover domain outline as a contour structure. 
+	writefile('contours.exp',md.domainoutline);
+	contours=expread('contours.exp',0);
+	contours=contours(1); %just keep the outer domain outline.
+	delete('contours.exp');
+   
+	%loop on the number of mesh2grid parameters:
+	for i=1:length(md.mesh2grid_parameters),
+		parameter=eval(['md.' md.mesh2grid_parameters{i}]);
+
+		%call GriddataMeshToGrid module:
+		md.mesh2grid_results{i}=...
+			GriddataMeshToGrid( md.elements,md.x,md.y,contours,parameter,md.mesh2grid_cornereast,md.mesh2grid_cornernorth,...
+					md.mesh2grid_xposting,md.mesh2grid_yposting,md.mesh2grid_nlines,md.mesh2grid_ncolumns,md.mesh2grid_interpolation{i},...
+					md.mesh2grid_filter{i},md.mesh2grid_windowsize);
+		
+	end
+
+
+	%timing
+	t2=clock;
+	disp(sprintf('\n%s\n',['   solution lasted ' num2str(etime(t2,t1)) ' seconds']));
Index: /issm/trunk/src/m/solutions/cielo/cieloprognostic.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cieloprognostic.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cieloprognostic.m	(revision 1)
@@ -0,0 +1,51 @@
+function md=cieloprognostic(md)
+%diagnostic solution for horizontal velocity
+
+	%timing
+	t1=clock;
+
+	analysis_p='prognostic';
+	
+	%configure, and initialise data model and parameter defaults:
+	SetParameterDefaults;
+
+	%Build model requested for prognostic simulation
+	m=CreateFEMModel(md,analysis_p);
+		
+	% figure out number of dof: just for information purposes.
+	md.dof=m.uset.fsize; 
+
+	%Build partitioning vectors. We only need one partitioning for all our models, we made sure of it in Imp!
+	indx=1:6:m.uset.gsize; indx=indx(tpart);
+
+	%build some parameters needed in core solution.
+	m.rifts=md.rifts;
+
+	%compute depth averaged horizontal velocity in Matlab workspace partitioning
+	u_g=zeros(m.uset.gsize,1); u_g(1:6:end)=md.vx/md.yts; u_g(2:6:end)=md.vy/md.yts;
+	velocity_average=CieloHorizontalVelocityDepthAverage(md,u_g);
+
+	%move surface and bed velocities to first lower layer, in workspace partitioning
+	ws=ShiftLayers(md,md.vz/md.yts,md.numlayers,1);
+	wb=ShiftLayers(md,md.vz/md.yts,1,1);
+	melting=ShiftLayers(md,md.melting,1,1);
+	accumulation=ShiftLayers(md,md.accumulation,md.numlayers,1);
+
+	%plug into g set, with cluster partitioning
+	ws_g=zeros(m.uset.gsize,1);ws_g(1:6:m.uset.gsize)=ws(part);
+	wb_g=zeros(m.uset.gsize,1);wb_g(1:6:m.uset.gsize)=wb(part);
+	melting_g=zeros(m.uset.gsize,1);melting_g(1:6:m.uset.gsize)=melting(part);
+	accumulation_g=zeros(m.uset.gsize,1);accumulation_g(1:6:m.uset.gsize)=accumulation(part);
+	
+	%initialize thickness
+	thickness=zeros(m.uset.gsize,1);thickness(1:6:end)=md.thickness(part);
+
+	%prepare inputs strcuture
+	inputs=struct('thickness',thickness,'melting',melting_g,'accumulation',accumulation_g,...
+	'surface_vertical_velocity',ws_g,'basal_vertical_velocity',wb_g,'dt',md.dt,'velocity_average',velocity_average);
+
+	%Run core solution
+	h_g=cieloprognostic_core(m,m.params,inputs,analysis_p);
+
+	%recover thickness and project onto every grid of the mesh
+	md.new_thickness=project3d(md,project2d(md,h_g(indx),1),'node');
Index: /issm/trunk/src/m/solutions/cielo/cieloprognostic_core.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cieloprognostic_core.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cieloprognostic_core.m	(revision 1)
@@ -0,0 +1,35 @@
+function h_g =cieloprognostic_core_linear(m,params,inputs,analysis)
+%INPUT function rh_g =cieloprognostic_core_linear(m,params,inputs,analysis)
+
+	%recover flag_y_s from m.y_s
+	if size(m.y_s,1)==0,
+		flag_y_s= 0;
+	else
+		flag_y_s= 1;
+	end
+
+	%stiffness and load generation only:
+	params.kflag=1; params.pflag=1;
+	params.ktflag=0;
+
+	%system matrices
+	[K_gg , p_g , dK_gg]=Emg(m.bgpdt,m.bgpdtb, m.est,m.lst,m.ept,m.mpt,m.geom3,params,inputs,analysis);
+
+	%Reduce tangent matrix from g size to f size
+	[K_ff, K_fs] = Reducematrixfromgtof( K_gg, m.G_mn, flag_y_s ); 
+	clear K_gg dK_gg
+	
+	%Reduce load from g size to f size
+	[rp_f] = Reducerightside( rp_g, m.G_mn, rK_fs, m.y_s, flag_y_s );
+	[clear p_g K_fs
+
+	%Solve	
+	[h_f]=Solver(K_ff,p_f,params.solverstring);
+	clear K_ff p_f
+	
+	%Merge back to g set
+	h_g= Mergesolvec( h_f, m.G_mn, m.y_s, m.uset); 
+	
+	if count>2,
+		clear h_f
+	end
Index: /issm/trunk/src/m/solutions/cielo/cieloprognostic_func.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cieloprognostic_func.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cieloprognostic_func.m	(revision 1)
@@ -0,0 +1,62 @@
+function [rh_g]=cieloprognostic_func(m,params,inputs)
+%INPUT function [rh_g]=cieloprognostic_func(m,params,inputs)
+
+	analysis='prognostic';
+
+	%Check arguments
+	if nargin==0,
+		cieloprognostic_func_usage;
+		error(' ');
+	end
+	
+	options_string='';
+
+	%recover flag_y_s from m.y_s
+	if m.y_s.header.M==0,
+		flag_y_s= 0;
+	else
+		flag_y_s= 1;
+	end
+	
+	%	stiffness and load generation only:
+	kflag=1; pflag=1; ktflag=0;
+	
+	%	disp('stiffness, damping, and mass matrix generation...');
+		[rK_gg , rp_g , rdK_gg]=Emg(m.bgpdt,m.bgpdtb, m.est,m.ept,m.mpt,m.geom3,kflag,params.sparsity,params.penalty,pflag,ktflag, {},{},inputs,analysis);
+				
+	%	Reduce tangent matrix from g size to f size
+			
+		[rK_ff, rK_fs] = Reducematrixfromgtof( rK_gg, m.G_mn, flag_y_s ); 
+
+		[rK_gg,rdK_gg]=IMdb('drop rK_gg rdK_gg');
+		
+	%	Reduce load from g size to f size
+
+		[rp_f] = Reducerightside( rp_g, m.G_mn, rK_fs, m.y_s, flag_y_s );
+
+		[rp_g rK_fs]=IMdb('drop rp_g rK_fs');
+			
+
+	%   Solve	
+		if(uset.fsize>0)
+			if strcmp(client_server_mode,'yes'),
+				%options_string='-ksp_type gmres or cg -pc_type bjacobi or jacobi -ksp_view -pc_factor_zeropivot 1e-30 -ksp_singmonitor ';
+				%options_string='-ksp_type cg  -ksp_singmonitor -pc_type bjacobi  -ksp_rtol 1e-11 -ksp_singmonitor ';           
+				options_string='-mat_type aijmumps -mat_mumps_sym 1 -ksp_type preonly -pc_type lu -mat_mumps_icntl_14 40';
+			end
+			rh_f=Solver(rK_ff,rp_f,{},options_string);
+		else
+			disp('All dof are constrained, f_set is empty...');
+		end
+		[rK_ff rp_f]=IMdb('drop rK_ff rp_f');
+
+		
+	%   Merge back to g set
+		rh_g= Mergesolvec( rh_f, m.G_mn, m.y_s ); 
+		[rh_f]=IMdb('drop rh_f ');
+
+function cieloprognostic_func_usage(),
+
+disp('function [rh_g]=cieloprognostic_func(m,params,inputs)');
+disp('%INPUT function [rh_g]=cieloprognostic_func(m,params,inputs)');
+
Index: /issm/trunk/src/m/solutions/cielo/cielothermal.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cielothermal.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cielothermal.m	(revision 1)
@@ -0,0 +1,98 @@
+function md=cielothermal(md,solutiontype)
+%thermal  solution: steady state and transient
+
+	analysis_t=solutiontype;
+	analysis_m='melting';
+	
+	%configure, and initialise data model and parameter defaults:
+	SetParameterDefaults;
+
+	%Build thermal and melting models
+	m_t=CreateFEMModel(md,analysis_t);
+	m_m=CreateFEMModel(md,analysis_m);
+
+
+	%Build partitioning vectors. 
+	indx=1:6:mt.uset.gsize; indx=indx(tpart);
+
+	% figure out number of dof: just for information purposes.
+	md.dof=m_t.uset.fsize; %biggest dof number
+
+	%initialize velocity,pressure and material properties
+	velocity=zeros(m_t.uset.gsize,1);
+	velocity(1:6:m_t.uset.gsize)=md.vx(part)/md.yts;
+	velocity(2:6:m_t.uset.gsize)=md.vy(part)/md.yts;
+	velocity(3:6:m_t.uset.gsize)=md.vz(part)/md.yts;
+
+	pressure=zeros(m_t.uset.gsize,1);
+	pressure(1:6:m_t.uset.gsize)=md.pressure(part);
+
+	thermalparams.beta=md.beta;
+	thermalparams.meltingpoint=md.meltingpoint;
+	thermalparams.latentheat=md.latentheat;
+	thermalparams.heatcapacity=md.heatcapacity;
+	thermalparams.penalty=md.penalty_thermal;
+	thermalparams.min_thermal_constraints=md.min_thermal_constraints;
+	thermalparams.mintemp=min(md.dirichletvalues_thermal(find(md.gridondirichlet_thermal)));
+
+	if strcmpi(analysis_t,'thermalsteady'),
+
+		inputs=struct('pressure',pressure,'velocity',velocity,'dt',md.dt);
+
+		%Call core thermal computation
+		disp(sprintf('\n%s\n','computing temperature...'));
+		[t_g,m_t]=cielothermal_core(m_t,m_t.params,thermalparams,inputs,analysis_t);
+
+		%Call core melting computation: 
+		%disp(sprintf('\n%s\n','computing melting...'));
+		%SetUset(m_m);
+		%inputs=struct('pressure',pressure,'temperature',rt_g,'dt',md.dt);
+		%rmelting_g=cielomelting_core(m_m,m_m.params,thermalparams,inputs,analysis_m);
+
+		%load results onto model
+		md.temperature=t_g(indx);
+		%melting_g=IMdb('select matrix from rmelting_g');
+		%md.melting=melting_g(indx)*md.yts; %from m/s to m/a
+	else
+
+		nsteps=md.ndt/md.dt;
+
+		%initialize temperature and melting
+		temperature=zeros(m_t.uset.gsize,1);
+		temperature(1:6:m_t.uset.gsize)=md.temperature(part);
+		soln.t_g=temperature;
+		%melting=zeros(uset.gsize,1);
+		%melting(1:6:uset.gsize)=md.melting(part)/md.yts; %in m/s
+		%soln.melting_g=melting;
+
+		for n=1:nsteps, 
+
+			disp(sprintf('\n%s%i/%i\n','time step: ',n,md.ndt/md.dt));
+			%Call core thermal computation
+			disp('   computing temperature...');
+			inputs=struct('pressure',pressure,'temperature',soln(n).t_g,'velocity',velocity,'dt',md.dt);
+			[soln(n+1).t_g,m_t]=cielothermal_core(m_t,m_t.params,thermalparams,inputs,analysis_t);
+			
+			%Call core melting computation
+			%disp('   computing melting...');
+			%SetUset(m_m);
+			%inputs=struct('pressure',pressure,'temperature',soln(n).t_g,'dt',md.dt);
+			%rmelting_g=cielomelting_core(m_m,m_m.params,thermalparams,inputs,analysis_m);
+			%soln(n+1).melting_g=IMdb('select matrix from rmelting_g');
+			
+		end
+		
+		%Wrap up
+		solution_temperature=struct('temperature',{});
+		for n=1:nsteps+1,
+			solution_temperature(n).temperature=soln(n).t_g(indx);
+		end
+		md.temperature=solution_temperature;
+		
+		%solution_melting=struct('melting',{});
+		%for n=1:nsteps+1,
+		%	solution_melting(n).melting=soln(n).melting_g(indx)*md.yts; %in m/a
+		%end
+		%md.melting=solution_melting;
+	end
+	
Index: /issm/trunk/src/m/solutions/cielo/cielothermal_core.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cielothermal_core.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cielothermal_core.m	(revision 1)
@@ -0,0 +1,94 @@
+function [rt_g m]=cielothermal_core(m,params,thermalparams,inputs,analysis)
+%INPUT function rt_g =cielothermal_core(m,params,thermalparams,inputs,analysis)
+
+	%check inputs
+	if isempty(inputs),
+		clear inputs;
+	end
+	
+	%recover flag_y_s from m.y_s
+	if m.y_s.header.M==0,
+		flag_y_s= 0;
+	else
+		flag_y_s= 1;
+	end
+
+	converged=0;
+	%stiffness and load generation only:
+	params.kflag=1; params.pflag=1;
+	params.ktflag=0;
+
+	dt=inputs.dt;
+
+	disp(sprintf('%s','   starting direct shooting method'));
+
+	%Recover pressure from inputs
+	pressure=inputs.pressure;
+
+	%Optional inputs
+	inputs.beta=thermalparams.beta; 
+	inputs.meltingpoint=thermalparams.meltingpoint;
+	inputs.mintemp=thermalparams.mintemp;
+
+	%intialize lst
+	lst=m.lst;
+	
+	count=1;
+
+	while(~converged),
+
+		%system matrices
+		[rK_gg , rp_g , rdK_gg]=Emg(m.bgpdt,m.bgpdtb, m.est,lst,m.ept,m.mpt,m.geom3,params,inputs,analysis);
+
+		%Reduce tangent matrix from g size to f size
+		[rK_ff, rK_fs] = Reducematrixfromgtof( rK_gg, m.G_mn, flag_y_s ); 
+	
+		%Cleanup memory
+		rK_gg=IMdb('drop rK_gg');
+		if ~isempty(rdK_gg), rdK_gg=IMdb('drop rdK_gg');end;
+		
+		%Reduce load from g size to f size
+		[rp_f] = Reducerightside( rp_g, m.G_mn, rK_fs, m.y_s, flag_y_s );
+
+		%Cleanup memory
+		[rp_g rK_fs]=IMdb('drop rp_g rK_fs');
+
+		%Solve	
+		[rt_f]=Solver(rK_ff,rp_f,params.solverstring);
+
+			
+		%Cleanup memory
+		[rK_ff rp_f]=IMdb('drop rK_ff rp_f');
+		
+		%Merge back to g set
+		rt_g= Mergesolvec( rt_f, m.G_mn, m.y_s ); 
+		
+		%Cleanup memory
+		if (count>2),
+			rt_f=IMdb('drop rt_f ');
+		end
+
+		%Deal with penalty loads
+		[new_lst,converged,num_unstable_constraints]=CieloPenaltyConstraints(m.bgpdt,m.bgpdtb,m.est,lst, struct('pressure',pressure, 'dt',dt, 'temperature',rt_g,'beta',thermalparams.beta,'melting_point',thermalparams.meltingpoint),analysis);
+
+		if ~converged,
+			disp(sprintf('   %s %i','#unstable constraints ',num_unstable_constraints));
+			if num_unstable_constraints<thermalparams.min_thermal_constraints,
+				converged=1;
+			end
+			if count==2,
+				disp('Carefull! Screwed up solutoin on purpose!');
+				converged=1;
+			end
+		end
+
+		%Set lst to new_lst, but do not wipeout m.lst at the same time! (we can't modify the input m.lst)
+		lst=Equiv(lst,new_lst);
+
+		count=count+1;
+	end
+
+	%don't forget to output loads
+	m.lst=lst;
+	
+end
Index: /issm/trunk/src/m/solutions/cielo/cielotransient.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/cielotransient.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/cielotransient.m	(revision 1)
@@ -0,0 +1,233 @@
+function md=cielotransient(md)
+%transient solution
+
+	analysis_t='thermaltransient';
+	analysis_m='melting';
+	analysis_dh='diagnostic_horiz';
+	analysis_dbv='diagnostic_basevert';
+	analysis_dv='diagnostic_vert';
+	analysis_p='prognostic';
+
+	%configure, and initialise data model and parameter defaults:
+	SetParameterDefaults;
+
+	%Initialize model velocity at 0 before model processing
+	md.vx=zeros(md.numberofgrids,1); md.vy=zeros(md.numberofgrids,1); md.vz=zeros(md.numberofgrids,1);
+
+	%read input data for all analyses
+	disp(sprintf('\n   reading data from model %s...',md.name));
+
+	%Build a model for the diagnostic simulation
+	m_t=CreateFEMModel(md,analysis_t);
+	m_m=CreateFEMModel(md,analysis_m);
+	m_dh=CreateFEMModel(md,analysis_dh);
+	m_dbv=CreateFEMModel(md,analysis_dbv);
+	m_dv=CreateFEMModel(md,analysis_dv);
+	m_p=CreateFEMModel(md,analysis_p);
+
+	% buid partitioning vectors. Same partitioning for all analyses. 
+	tpart=m_t.tpart;
+	part=m_t.part;
+	indx=1:6:m_t.uset.gsize; indx=indx(tpart);
+	indy=2:6:m_t.uset.gsize; indy=indy(tpart);
+	indz=3:6:m_t.uset.gsize; indz=indz(tpart);
+	indp=4:6:m_t.uset.gsize; indp=indp(tpart);
+
+	% figure out number of dof: just for information purposes.
+	md.dof=m_dh.uset.fsize; %biggest dof number
+
+	nsteps=md.ndt/md.dt;
+
+	%initialize (velocity,pressure) and (melting,temperature)
+	solution.u_g=zeros(uset.gsize,1);
+	if ~isempty(md.vx), solution.u_g(1:6:uset.gsize)=md.vx(part)/md.yts; end
+	if ~isempty(md.vy), solution.u_g(2:6:uset.gsize)=md.vy(part)/md.yts; end
+	if ~isempty(md.vz), solution.u_g(3:6:uset.gsize)=md.vz(part)/md.yts; end
+	solution.pressure=zeros(uset.gsize,1); solution.pressure(1:6:uset.gsize)=md.rho_ice*md.g*(md.surface(part)-md.z(part)); %lithostatic pressure to spin up
+
+	solution.t_g=zeros(uset.gsize,1);
+	if ~isempty(md.temperature), 
+		solution.t_g(1:6:uset.gsize)=md.temperature(part);
+	else
+		solution.t_g(1:6:uset.gsize)=md.meltingpoint;
+	end
+	if ~isempty(md.melting), solution.melting_g(1:6:uset.gsize)=md.melting(part);end;
+
+	%initialize geometry and time
+	solution.thickness=zeros(uset.gsize,1);solution.thickness(1:6:uset.gsize)=md.thickness(part);
+	solution.surface=zeros(uset.gsize,1);solution.surface(1:6:uset.gsize)=md.surface(part);
+	solution.bed=zeros(uset.gsize,1);solution.bed(1:6:uset.gsize)=md.bed(part);
+	solution.time=0;
+
+	%some thermal parameters
+	thermalparams.beta=md.beta;
+	thermalparams.meltingpoint=md.meltingpoint;
+	thermalparams.latentheat=md.latentheat;
+	thermalparams.heatcapacity=md.heatcapacity;
+	thermalparams.penalty=md.penalty_thermal;
+
+	for n=1:nsteps,
+
+		disp(sprintf('\n%s%i/%i\n','time step: ',n,md.ndt/md.dt));
+		
+		solution(n+1).time=(n)*md.dt;
+
+		%Deal with temperature first 
+		disp(sprintf('%s','   computing temperature...'));
+
+		%Call core thermal computation
+		inputs=struct('velocity',solution(n).u_g,'pressure',solution(n).pressure,'temperature',solution(n).t_g,'dt',md.dt,...
+					'thickness',solution(n).thickness,'bed',solution(n).bed,'surface',solution(n).surface);
+
+		[solution(n+1).t_g,m_t]=cielothermal_core(m_t,m_t.params,thermalparams,inputs,analysis_t); 
+		
+		%Call core melting computation
+		disp(sprintf('%s','   computing melting...'));
+		inputs=struct('pressure',solution(n).pressure,'temperature',solution(n+1).t_g,'dt',md.dt,...
+		'thickness',solution(n).thickness,'bed',solution(n).bed,'surface',solution(n).surface);
+	
+		solution(n+1).melting_g=cielomelting_core(m_m,m_m.params,thermalparams,inputs,analysis_m); 
+		
+		%Compute depth averaged temperature for 2d type elements.
+		temperature_workspace=solution(n+1).t_g(indx);
+		temperature_average2d_workspace=DepthAverage(md,temperature_workspace);
+		temperature_average_workspace=project3d(md,temperature_average2d_workspace,'node');
+		temperature_average=zeros(uset.gsize,1);temperature_average(1:6:uset.gsize)=temperature_average_workspace(part);
+		
+		if md.debug,
+			t_g_workspace=SwitchPartitioning(solution(n+1).t_g,'workspace',part,tpart,[1]); 
+			melting_g_workspace=SwitchPartitioning(solution(n+1).melting_g,'workspace',part,tpart,[1]); 
+			plot(md,'data',t_g_workspace(1:6:uset.gsize),'title','Temperature (K)','view',3,'data',melting_g_workspace(1:6:uset.gsize)*md.yts,'title','Melting (m/a)','view',3);pause(2);
+		end
+
+		%Deal with velocities.
+		disp(sprintf('%s','   computing horizontal velocities...'));
+
+		m_dh.rifts=md.rifts;
+		inputs=struct('thickness',solution(n).thickness,'bed',solution(n).bed,'surface',solution(n).surface,...
+					'temperature',solution(n+1).t_g,'temperature_average',temperature_average);
+		solution(n+1).u_g=cielodiagnostic_core_nonlinear(m_dh,m_dh.params,inputs,analysis_dh); 
+
+		%Extrude velocities for collapsed penta elements
+		u_g_workspace=SwitchPartitioning(solution(n+1).u_g,'workspace',part,tpart,[1 2]); u_g_workspace=CieloVelocityExtrude(md,u_g_workspace);
+		
+		%Plug velocities back into solution, with cluster partitioning: 
+		solution(n+1).u_g=SwitchPartitioning(u_g_workspace,'cluster',part,tpart,[1 2]);
+		
+		if md.debug,
+			plot(md,'data',sqrt(u_g_workspace(1:6:uset.gsize).^2+u_g_workspace(2:6:uset.gsize))*md.yts,'view',3,'title','Horizontal velocity (m/a)');pause(2);
+		end
+
+		%compute base vertical velocities
+		disp(sprintf('%s','   computing vertical base velocity...'));
+		inputs=struct('velocity',solution(n+1).u_g,'thickness',solution(n).thickness,'bed',solution(n).bed,'surface',solution(n).surface);
+		u_g_basevert=cielodiagnostic_core_linear(m_dbv,m_dbv.params,inputs,analysis_dbv); 
+
+		if md.debug,
+			u_g_basevert_workspace=SwitchPartitioning(u_g_basevert,'workspace',part,tpart,[3]); 
+			plot(md,'data',u_g_basevert_workspace(3:6:uset.gsize)*md.yts,'layer',1,'title','Basal Vertical velocity (m/a)');pause(2);
+		end
+	
+		%use solution(n+1).u_g_basevert to constrain vertical velocity
+		disp(sprintf('%s','   computing vertical velocity...'));
+		m_dv.y_g=u_g_basevert;
+	
+		%reduce constraining vector to s-set (the one we solve on)
+		m_dv.y_s = Reducevectorg( m_dv.y_g,m_dv.uset);
+
+		%compute depth averaged horizontal velocity
+		velocity_average_workspace=CieloHorizontalVelocityDepthAverage(md,u_g_workspace); velocity_average=SwitchPartitioning(velocity_average_workspace,'cluster',part,tpart,[1 2]);
+
+		%compute vertical velocities
+		inputs=struct('velocity',solution(n+1).u_g,'velocity_average',velocity_average,'thickness',solution(n).thickness,'bed',solution(n).bed,'surface',solution(n).surface);
+		u_g_vert=cielodiagnostic_core_linear(m_dv,m_dv.params,inputs,analysis_dv); 
+		
+		
+		%add contribution to vertical velocity
+		solution(n+1).u_g(3:6:uset.gsize)=u_g_vert(3:6:uset.gsize);
+	
+		if md.debug,
+			u_g_workspace=SwitchPartitioning(solution(n+1).u_g,'workspace',part,tpart,[3]);
+			plot(md,'data',u_g_workspace(3:6:uset.gsize)*md.yts,'view',3,'title','Vertical velocity (m/a)');pause(2);
+		end
+
+		%compute pressure (for now, lithostatic)
+		disp(sprintf('%s','   computing pressure...'));
+		solution(n+1).pressure=zeros(uset.gsize,1); solution(n+1).pressure(1:6:uset.gsize)=md.rho_ice*md.g*(md.surface(part)-md.z(part));
+		
+
+		%move surface and bed velocities to first lower layer. This will be needed by the prognostic model
+		u_g_vert_workspace=SwitchPartitioning(u_g_vert,'workspace',part,tpart,[3]);
+		ws_workspace=ShiftLayers(md,u_g_vert_workspace(3:6:uset.gsize),md.numlayers,1);
+		wb_workspace=ShiftLayers(md,u_g_vert_workspace(3:6:uset.gsize),1,1);
+		
+		melting_g_workspace=SwitchPartitioning(solution(n+1).melting_g,'workspace',part,tpart,[1]);
+		melting_workspace=ShiftLayers(md,melting_g_workspace(1:6:uset.gsize),1,1);
+		
+		accumulation_workspace=ShiftLayers(md,md.accumulation,md.numlayers,1);
+		
+
+		%plug into g set
+		ws_g=zeros(uset.gsize,1);ws_g(1:6:uset.gsize)=ws_workspace(part);
+		wb_g=zeros(uset.gsize,1);wb_g(1:6:uset.gsize)=wb_workspace(part);
+		melting_g=zeros(uset.gsize,1);melting_g(1:6:uset.gsize)=melting_workspace(part);
+		accumulation_g=zeros(uset.gsize,1);accumulation_g(1:6:uset.gsize)=accumulation_workspace(part)/md.yts;
+	
+		
+		if md.debug,
+			plot(md,'data',ws_workspace*md.yts,'title','Surface velocity projected on layer 1','view',3,'data',wb_workspace*md.yts,'title','Basal velocity projected on layer 1','view',3,...
+			'data',melting_workspace*md.yts,'title','Bed melting projected on layer 1 (m/yr)','view',3,'data',accumulation_workspace,'title','Surface accumulation projected on layer 1 (m/yr)','view',3);pause(2);
+		end
+		
+		%compute new thickness
+		disp(sprintf('%s','   computing new thickness...'));
+		inputs=struct('thickness',solution(n).thickness,'melting',melting_g,'accumulation',accumulation_g,...
+					   'surface_vertical_velocity',ws_g,'basal_vertical_velocity',wb_g,'dt',md.dt,'velocity_average',velocity_average);
+		new_thickness=cieloprognostic_core(m_p,m_p.params,inputs,analysis_p);
+	
+		%project collapsed thickness onto 3d mesh
+		new_thickness_workspace=SwitchPartitioning(new_thickness,'workspace',part,tpart,[1]); 
+		new_thickness_workspace=project3d(md,project2d(md,new_thickness_workspace(1:6:end),1),'node');
+
+		
+		%update surface and bed using the new thickness
+		[new_bed_workspace,new_surface_workspace,]=UpdateGeometry(md,new_thickness_workspace,solution(n).bed(indx),solution(n).surface(indx));
+
+		if md.debug,
+			plot(md,'data',new_thickness_workspace,'view',3,'title','New thickness (m)','data',new_surface_workspace,'view',3,'title','New surface (m)','data',new_bed_workspace,'view',3,'title','New bed (m)');pause(2);
+		end
+
+		%project onto g set
+		solution(n+1).thickness=zeros(uset.gsize,1);solution(n+1).thickness(1:6:uset.gsize)=new_thickness_workspace(part);
+		solution(n+1).bed=zeros(uset.gsize,1);solution(n+1).bed(1:6:uset.gsize)=new_bed_workspace(part);
+		solution(n+1).surface=zeros(uset.gsize,1);solution(n+1).surface(1:6:uset.gsize)=new_surface_workspace(part);
+
+		%update grid positions
+		[m_t.bgpdt,m_t.bgpdtb]=CieloUpdateGridPosition(m_t.bgpdt,m_t.bgpdtb,solution(n+1).bed,solution(n+1).thickness);
+
+		[m_dh.bgpdt,m_dh.bgpdtb]=CieloUpdateGridPosition(m_dh.bgpdt,m_dh.bgpdtb,solution(n+1).bed,solution(n+1).thickness);
+
+		[m_dbv.bgpdt,m_dbv.bgpdtb]=CieloUpdateGridPosition(m_dbv.bgpdt,m_dbv.bgpdtb,solution(n+1).bed,solution(n+1).thickness);
+
+		[m_dv.bgpdt,m_dv.bgpdtb]=CieloUpdateGridPosition(m_dv.bgpdt,m_dv.bgpdtb,solution(n+1).bed,solution(n+1).thickness);
+
+		[m_p.bgpdt,m_p.bgpdtb]=CieloUpdateGridPosition(m_p.bgpdt,m_p.bgpdtb,solution(n+1).bed,solution(n+1).thickness);
+	end
+
+
+
+%load results onto model
+for i=1:length(solution),
+	solution2(i).vx=solution(i).u_g(indx)*md.yts;
+	solution2(i).vy=solution(i).u_g(indy)*md.yts;
+	solution2(i).vz=solution(i).u_g(indz)*md.yts;
+	solution2(i).vel=sqrt(solution2(i).vx.^2+solution2(i).vy.^2+solution2(i).vz.^2);
+	solution2(i).pressure=solution(i).pressure(indx)/10^5;
+	solution2(i).temperature=solution(i).t_g(indx);
+	solution2(i).melting=solution(i).melting_g(indx);
+	solution2(i).thickness=solution(i).thickness(indx);
+	solution2(i).surface=solution(i).surface(indx);
+	solution2(i).bed=solution(i).bed(indx);
+	solution2(i).time=solution(i).time/md.yts;
+end
+md.transient_results=solution2;
Index: /issm/trunk/src/m/solutions/cielo/control.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/control.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/control.m	(revision 1)
@@ -0,0 +1,86 @@
+function md=control(md)
+
+	%timing
+	t1=clock;
+	
+	%Build all models requested for control simulation
+	md.analysis_type='control';
+	m=CreateFemModel(md); 
+
+	% figure out number of dof: just for information purposes.
+	md.dof=m.nodesets.fsize; %biggest dof number
+
+	%initialize control parameters, gradients and observations
+	u_g_obs=m.parameters.u_g_obs;
+	p_g=m.parameters.p_g;
+	grad_g=zeros(m.nodesets.gsize,1);
+		
+	%set optimization options.
+	options=ControlOptions(m.parameters);
+
+	for n=1:m.parameters.nsteps,
+		
+		%set options
+		options=optimset(options,'MaxFunEvals',m.parameters.maxiter(n));
+
+		disp(sprintf('\n%s%s%s%s\n',['   control method step ' num2str(n) '/' num2str(m.parameters.nsteps)]));
+
+		%initialize inputs, ie m.nparameters on which we invert.
+		eval(['inputs.' m.parameters.control_type '=p_g;']);
+		inputs.fit=m.parameters.fit(n);
+
+		disp('      computing gradJ...');
+		c(n).grad_g=GradJCompute(m,inputs,u_g_obs);
+		disp('      done.');
+
+		disp('      normalizing directions...');
+		if n>=2,
+			c(n).grad_g=Orth(c(n).grad_g,c(n-1).grad_g);
+		else
+			c(n).grad_g=Orth(c(n).grad_g,{});
+		end
+		disp('      done.');
+		
+		%visualize direction.
+		if m.parameters.plot
+			plot_direction;
+		end
+		
+		disp('      optimizing along gradient direction...'); 
+		[search_scalar c(n).J]=fminbnd('objectivefunctionC',-1,1,options,m,p_g,u_g_obs,c(n).grad_g,n);
+		disp('      done.');
+
+		disp('      updating parameter using optimized search scalar...');
+		p_g=p_g+search_scalar*m.parameters.optscal(n)*c(n).grad_g;
+		disp('      done.');
+
+		disp('      constraining the new distribution...');    
+		p_g=ControlConstrain(p_g,m.parameters);
+		disp('      done.');
+
+		%visualize direction.
+		if m.parameters.plot,
+			plot_newdistribution;
+		end
+
+		%some temporary saving 
+		if(mod(n,5)==0),
+			solution=controlfinalsol(c,m,p_g);
+			save temporary_control_results solution
+		end
+		disp(['      value of misfit J after optimization #' num2str(n) ':' num2str(c(n).J)]);
+
+	end
+
+	%Create final solution
+	disp('      preparing final velocity solution...');
+	solution=controlfinalsol(c,m,p_g);
+	disp('      done.');
+	
+	disp('      load results ontol model...');
+	md=loadcontrolfinalsol(md,solution);
+	disp('      done.');
+	
+	
+	t2=clock;
+	disp(['      overall time spent on control code ' num2str(etime(t2,t1)) ' seconds'])
Index: /issm/trunk/src/m/solutions/cielo/controlfinalsol.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/controlfinalsol.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/controlfinalsol.m	(revision 1)
@@ -0,0 +1,30 @@
+function solution=controlfinalsol(c,m,p_g);
+
+%From parameters, build inputs for icediagnostic_core, using the final parameters
+eval(['inputs.' m.parameters.control_type '=p_g;']);
+
+u_g=diagnostic_core_nonlinear(m,inputs);
+
+%Build partitioning vectors to recover solution
+indx=m.part(1:2:end);
+indy=m.part(2:2:end);
+
+%Recover velocity, and parameters, in the correct partitioning.
+vx=u_g(indx);
+vy=u_g(indy);
+vel=sqrt(vx.^2+vy.^2);
+
+parameter=p_g(indx);
+
+%Recover misfit at each iteration of the control method 
+J=zeros(length(c),1);
+for i=1:length(c),
+	J(i)=c(i).J;
+end
+
+%Store in solution
+solution.vx=vx;
+solution.vy=vy;
+solution.vel=vel;
+solution.J=J;
+solution.parameter=parameter;
Index: /issm/trunk/src/m/solutions/cielo/diagnostic.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/diagnostic.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/diagnostic.m	(revision 1)
@@ -0,0 +1,85 @@
+function md=diagnostic(md)
+
+	%timing
+	t1=clock;
+
+	analysis_dh='diagnostic_horiz';
+	analysis_dbv='diagnostic_basevert';
+	analysis_dv='diagnostic_vert';
+
+	%Build all models requested for diagnostic simulation
+	%remark, partitions are all identical.
+	md.analysis_type=analysis_dh; 
+	m_dh=CreateFemModel(md);
+
+	if strcmpi(md.type,'3d'),
+		m_dbv=CreateFemModel(md,analysis_dbv);
+		m_dv=CreateFemModel(md,analysis_dv);
+	end
+
+	% figure out number of dof: just for information purposes.
+	md.dof=m_dh.nodesets.fsize; %biggest dof number
+
+	%Get horizontal solution. 
+	disp(sprintf('\n%s',['computing horizontal velocities...']));
+
+	u_g=diagnostic_core_nonlinear(m_dh,{});
+
+	if strcmpi(md.type,'3d'),
+	
+		%swith u_g to workspace partitioning.
+		u_g=SwitchPartitioning(u_g,'workspace',part,tpart,[1 2]); 
+		
+		%extrude velocities for collapsed penta elements
+		u_g=CieloVelocityExtrude(md,u_g);
+
+		%Compute depth averaged velocity and add it to inputs
+		velocity_average=CieloHorizontalVelocityDepthAverage(md,u_g);
+
+		%swith u_g and velocity_average to cluster partitioning
+		u_g=SwitchPartitioning(u_g,'cluster',part,tpart,[1 2]); 
+		velocity_average=SwitchPartitioning(velocity_average,'cluster',part,tpart,[1 2]); 
+		
+
+		disp(sprintf('\n%s',['computing basal vertical velocities...']));
+		SetUset(m_dbv);
+		u_g_basevert=diagnostic_core_linear(m_dbv,m_dbv.parameters,struct('velocity',u_g,'velocity_average',velocity_average),analysis_dbv); 
+		
+		%use u_g_basevert to constrain vertical velocity
+		SetUset(m_dv);
+		m_dv.y_g=u_g_basevert;
+
+		%reduce constraining vector to s-set (the one we solve on)
+		m_dv.y_s = Reducevectorg( m_dv.y_g);
+
+		%run core linear to solve for vertical velocity
+		disp(sprintf('\n%s',['computing vertical velocities...']));
+		u_g_vert=diagnostic_core_linear(m_dv,m_dv.parameters,struct('velocity',u_g),analysis_dv); 
+		
+		%load results onto model: carefull, u_g and u_g_vert are in cluster partitioning
+		md.vx=u_g(indx)*md.yts;
+		md.vy=u_g(indy)*md.yts;
+		md.vz=u_g_vert(indz)*md.yts;
+		md.vel=sqrt(md.vx.^2+md.vy.^2+md.vz.^2);
+		
+		%Computation of pressure with Pattyn's assumptions (P=rho_ice*g*(s-z) in Pa)
+		md.pressure=md.rho_ice*md.g*(md.surface-md.z);
+	else
+		
+		%Build partitioning vectors to recover solution
+		indx=m_dh.part(1:2:end);
+		indy=m_dh.part(2:2:end);
+
+		%load results onto model
+		md.vx=u_g(indx)*md.yts;
+		md.vy=u_g(indy)*md.yts;
+		md.vz=zeros(md.numberofgrids,1);
+		md.vel=sqrt(md.vx.^2+md.vy.^2+md.vz.^2);
+	
+		%Computation of pressure with Pattyn's assumptions (P=rho_ice*g*(s-z) in Pa)
+		md.pressure=md.rho_ice*md.g*(md.thickness);
+	end		
+
+	%timing
+	t2=clock;
+	disp(sprintf('\n%s\n',['   solution converged in ' num2str(etime(t2,t1)) ' seconds']));
Index: /issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m	(revision 1)
@@ -0,0 +1,103 @@
+function [u_g varargout]=diagnostic_core_nonlinear(m,inputs)
+%INPUT function [ru_g varargout]=cielodiagnostic_core_nonlinear(m,inputs)
+	
+	%check inputs
+	if isempty(inputs),
+		clear inputs;
+	end
+
+%   first off! We are going to modify the loads dataset. We need to shield the loads from those changes once we return;
+	loads=m.loads;
+
+%	stiffness and load generation only:
+	m.parameters.kflag=1; m.parameters.pflag=1;
+
+%   initialize solution vector
+	count=1;
+	converged=0;
+	soln(count).u_g=[];
+	soln(count).u_f=[];
+
+
+	if m.parameters.debug,
+		disp(sprintf('\n%s',['   starting direct shooting method']));
+	end
+	
+	while(~converged),
+		
+		%add velocity to inputs
+		inputs.velocity=full(soln(count).u_g);
+
+		%Update inputs in datasets
+		[m.elements,m.nodes, loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);
+
+		%system matrices 
+		[K_gg_nopenalty , p_g_nopenalty]=SystemMatrices(m.elements,m.nodes,loads,m.materials,m.parameters,inputs);
+		
+		%penalties
+		[K_gg , p_g]=PenaltySystemMatrices(K_gg_nopenalty,p_g_nopenalty,m.elements,m.nodes,loads,m.materials,m.parameters,inputs);
+
+
+		%Reduce tangent matrix from g size to f size
+		[K_ff, K_fs] = Reducematrixfromgtof( K_gg, m.Gmn, m.nodesets); 
+
+		%Reduce load from g size to f size
+		[p_f] = Reduceloadfromgtof( p_g, m.Gmn, K_fs, m.ys, m.nodesets);
+
+		%Increment index
+		count=count+1;
+
+		%Solve	
+		[soln(count).u_f]=Solver(K_ff,p_f,[],m.parameters);
+	
+		%Merge back to g set
+		[soln(count).u_g]= Mergesolutionfromftog( soln(count).u_f, m.Gmn, m.ys, m.nodesets ); 
+
+		if (count>2),
+			soln(count-1).u_f=NaN;
+		end
+
+		%Deal with penalty loads
+		inputs.velocity=soln(count).u_g;
+	
+		%penalty constraints
+		[loads,constraints_converged,num_unstable_constraints] =PenaltyConstraints( m.elements,m.nodes, loads, m.materials,m.parameters,inputs);
+
+	%   Figure out if convergence is reached.
+		if(count>=3),
+			dug=soln(count).u_g-soln(count-1).u_g; ndu=norm(dug,2); nu=norm(soln(count-1).u_g,2); 
+			if (ndu/nu<=m.parameters.eps_rel),
+				if constraints_converged,
+					converged=1;
+				end
+			end
+			
+			if m.parameters.debug,
+				disp(sprintf('%s %g %s %g','      convergence criterion: norm(du)/norm(u)=',ndu/nu,' > ',m.parameters.eps_rel));
+				disp(sprintf('%s %i','      number of unstable constraints=',num_unstable_constraints));
+			end
+		end
+
+		if (count>2),
+			soln(count-1).u_g=NaN;
+		end
+	end
+			
+	%some cleanup
+	[soln(count).u_f]=NaN;
+
+	u_g=soln(count).u_g;
+
+	%more output might be needed, when running in cielocontrol.m
+	nout=max(nargout,1)-1;
+	if nout==2,
+		
+		inputs.velocity=full(soln(count).u_g);
+		m.parameters.kflag=1; m.parameters.pflag=0; 
+		[K_gg, p_g]=SystemMatrices(m.elements,m.nodes,loads,m.materials,m.parameters,inputs);
+		[K_ff, K_fs] = Reducematrixfromgtof( K_gg, m.Gmn, m.nodesets); 
+		varargout(1)={K_ff};
+		varargout(2)={K_fs};
+	end
+	
+end
Index: /issm/trunk/src/m/solutions/cielo/loadcontrolfinalsol.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/loadcontrolfinalsol.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/loadcontrolfinalsol.m	(revision 1)
@@ -0,0 +1,7 @@
+function md=loadfinalcontrolsol(md,solution);
+
+md.cont_vx=solution.vx*md.yts;
+md.cont_vy=solution.vy*md.yts;
+md.cont_vel=solution.vel*md.yts;
+md.cont_J=solution.J;
+md.cont_parameters=solution.parameter;
Index: /issm/trunk/src/m/solutions/cielo/objectivefunctionC.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/objectivefunctionC.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/objectivefunctionC.m	(revision 1)
@@ -0,0 +1,19 @@
+function J =objectivefunctionC(search_scalar,m,p_g,u_g_obs,grad_g,n);
+        
+%recover some parameters
+optscal=m.parameters.optscal(n);
+fit=m.parameters.fit(n);
+control_type=m.parameters.control_type;
+
+%Update along gradient using scalar supplied by fmincon optimization routine
+parameter=p_g+search_scalar*optscal*grad_g;
+
+%Plug parameter into inputs
+eval(['inputs.' control_type '=parameter;']);
+
+%Run diagnostic with updated parameters.
+u_g=diagnostic_core_nonlinear(m,inputs);
+
+%Compute misfit for this velocity field. 
+inputs.fit=fit;
+J=Misfit(m.elements,m.nodes,m.loads,m.materials,m.parameters, u_g, u_g_obs,inputs);
Index: /issm/trunk/src/m/solutions/cielo/path2cell.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/path2cell.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/path2cell.m	(revision 1)
@@ -0,0 +1,34 @@
+function pathlist = path2cell(pathstr)
+%PATH2CELL Convert search path to cell array.
+%
+%   PATH2CELL returns a cell array where each element is a directory
+%   in the search path.
+%
+%   PATH2CELL(MYPATH) converts MYPATH rather than the search path.
+%
+%   Empty directories are removed, so under UNIX, PATH2CELL('foo::bar')
+%   returns {'foo', 'bar'} rather than {'foo', '', 'bar'}.
+
+%   Author:      Peter J. Acklam
+%   Time-stamp:  2001-10-18 21:23:19 +0200
+%   E-mail:      pjacklam@online.no
+%   URL:         http://home.online.no/~pjacklam
+
+   % check number of input arguments
+   error(nargchk(0, 1, nargin));
+
+   % use MATLAB's search path if no input path is given
+   if ~nargin
+      pathstr = path;
+   end
+
+   k = find(pathstr == pathsep);            % find path separators
+   k = [0 k length(pathstr)+1];             % find directory boundaries
+   ndirs = length(k)-1;                     % number of directories
+   pathlist = cell(0);                      % initialize output argument
+   for i = 1 : ndirs
+      dir = pathstr(k(i)+1 : k(i+1)-1);     % get i'th directory
+      if ~isempty(dir)                      % if non-empty...
+         pathlist{end+1,1} = dir;           % ...append to list
+      end
+   end
Index: /issm/trunk/src/m/solutions/cielo/plot_direction.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/plot_direction.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/plot_direction.m	(revision 1)
@@ -0,0 +1,4 @@
+grad_g=c(n).grad_g;
+grad_gx=grad_g(1:2:end);grad_gy=grad_g(2:2:end); grad_g=sqrt(grad_gx.^2+grad_gy.^2);
+plotmodel(md,'data',grad_g,'title',['Normalized Direction for ' m.parameters.control_type],'figure',1,'colorbar#all','on'); pause(1);
+clear grad_g grad_gx grad_gy
Index: /issm/trunk/src/m/solutions/cielo/plot_newdistribution.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/plot_newdistribution.m	(revision 1)
+++ /issm/trunk/src/m/solutions/cielo/plot_newdistribution.m	(revision 1)
@@ -0,0 +1,3 @@
+p_gx=p_g(1:2:end);p_gy=p_g(2:2:end); p_g=sqrt(p_gx.^2+p_gy.^2);
+plotmodel(md,'data',p_g,'title',['Distribution of ' m.parameters.control_type 'at iteration' num2str(n)],'figure',1,'colorbar#all','on'); pause(1);
+clear p_gx p_gy
Index: /issm/trunk/src/m/solutions/dakota/cielo_ice_script.sh
===================================================================
--- /issm/trunk/src/m/solutions/dakota/cielo_ice_script.sh	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/cielo_ice_script.sh	(revision 1)
@@ -0,0 +1,63 @@
+#!/bin/bash -f
+# Sample simulator to Dakota system call script
+# See User Manual for instructions
+
+# $argv[1] is params.in.(fn_eval_num) FROM Dakota
+# $argv[2] is results.out.(fn_eval_num) returned to Dakota
+
+if [ -e $2 ]
+then
+    exit
+fi
+
+#check ISSM_DIR global variable is defined!
+if [[ "$ISSM_DIR" == "" ]]
+then
+	echo "Dakota could not find the ISSM_DIR global variable ! Aborting..."
+	exit 1
+fi
+
+# ------------------------
+# Set up working directory
+# ------------------------
+num=`echo $1 | sed 's/params.in.//g'`
+
+mkdir workdir.$num
+cp Qmu.model workdir.$num
+cp $ISSM_DIR/startup.m workdir.$num
+cd workdir.$num
+echo -n "$num" > number
+
+
+# --------------
+# PRE-PROCESSING
+# --------------
+# Use the following line if SNL's APREPRO utility is used instead of DPrePro.
+# ../aprepro -c '*' -q --nowarning modal.bdf.template modal.bdf
+
+#Preprocess 
+dprepro ../$1 ../qmu.m cielo_ice_run.m
+
+# --------
+# ANALYSIS
+# --------
+
+#nast707 jid=modal.bdf mem=2m scr=yes bat=no >&! nastran.out
+#cp -p ../cielo_ice_run.m .
+matlab -nodisplay -r "cielo_ice_run('Qmu.model','$2');exit;" >& matlab.out.$num
+
+# ---------------
+# POST-PROCESSING
+# ---------------
+
+#grep '                                  X           ' modal.f06 | cut -c 46-60 > $2
+#grep '        7        ' modal.f06 | cut -c 66-80 >> $2
+mv $2 ../.
+mv matlab.out.$num ../.
+
+# --------
+# Clean up
+# --------
+
+cd ..
+rm -rf workdir.$num
Index: /issm/trunk/src/m/solutions/dakota/dakota_in_data.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_in_data.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/dakota_in_data.m	(revision 1)
@@ -0,0 +1,80 @@
+%
+%  define the data to write the dakota .in file
+%
+%  []=dakota_in_data(md,filei,package)
+%
+function []=dakota_in_data(md,filei,package)
+
+if ~nargin
+    help dakota_in_data
+    return
+end
+
+%%  variables
+
+fnames=fieldnames(md.variables);
+for i=1:length(fnames)
+    fhandle=str2func([class(md.variables.(fnames{i})) '.empty']);
+    dvar.(fnames{i})=fhandle();
+    for j=1:length(md.variables.(fnames{i}))
+        %call setupdesign
+        dvar.(fnames{i})=QmuSetupDesign(md,dvar.(fnames{i}),md.variables.(fnames{i})(j)); 
+    end
+end
+
+%%  responses
+
+fnames=fieldnames(md.responses);
+for i=1:length(fnames)
+    fhandle=str2func([class(md.responses.(fnames{i})) '.empty']);
+    dresp.(fnames{i})=fhandle();
+    for j=1:length(md.responses.(fnames{i}))
+        dresp.(fnames{i})(j)=md.responses.(fnames{i})(j);
+    end
+end
+
+%%  run parameters
+
+params=dakota_in_params(struct());
+
+params.evaluation_concurrency=md.evaluation_concurrency;
+params.npart=md.npart;
+disp(md.method);
+
+if     strncmpi(md.method,'nond_l',6),
+	params.method               ='nond_local_reliability';
+	params.interval_type        =md.interval_type;
+	params.fd_gradient_step_size=md.fd_gradient_step_size;
+elseif strncmpi(md.method,'nond_s',6),
+	params.method               ='nond_sampling';
+	params.seed                 =md.seed;
+	params.samples              =md.samples;
+	params.sample_type          =md.sample_type;
+elseif strncmpi(md.method,'conmin_f',8),
+	params.method               ='conmin_frcg';
+elseif strncmpi(md.method,'conmin_m',8),
+	params.method               ='conmin_mfd';
+else
+	error('dakota_in_data: error message, method not supported yet!');
+end
+
+if     strcmpi(md.analysis_driver,'matlab')
+    params.analysis_driver='matlab';
+    if ~isempty(md.analysis_components)
+        params.analysis_components=md.analysis_components;
+    else
+        params.analysis_components=filei;
+    end
+elseif ~isempty(md.analysis_driver)
+    params.analysis_driver=md.analysis_driver;
+else
+    md.analysis_driver=params.analysis_driver;
+end
+
+%Write in file
+dakota_in_write(params.method,dvar,dresp,filei,params);
+
+%Write m file
+dakota_m_write(md,params.method,dvar,dresp,filei,params,package);
+
+end
Index: /issm/trunk/src/m/solutions/dakota/dakota_in_params.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_in_params.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/dakota_in_params.m	(revision 1)
@@ -0,0 +1,147 @@
+%
+%  populate a Dakota parameter structure.
+%
+%  [params]=dakota_in_params(params)
+%
+function [params]=dakota_in_params(params)
+
+global ISSM_DIR;
+
+if ~nargin
+    help dakota_in_params
+    return
+end
+
+%%  process the input parameters
+
+if ~exist('params','var')
+    params=struct();
+end
+
+%%  strategy section
+
+if ~isfield(params,'graphics')
+    params.graphics=false;
+end
+if ~isfield(params,'tabular_graphics_data')
+    params.tabular_graphics_data=true;
+end
+% could use unique file name rather than dakota default
+if ~isfield(params,'tabular_graphics_file')
+    params.tabular_graphics_file='dakota_tabular.dat';
+end
+
+%%  method section
+
+% if isfield(params,'method')
+%     method=params.method;
+% end
+
+%  method-independent
+
+if ~isfield(params,'output')
+    params.output=false;
+end
+if ~isfield(params,'max_iterations')
+    params.max_iterations=100;
+end
+if ~isfield(params,'max_function_evaluations')
+    params.max_function_evaluations=100;
+end
+if ~isfield(params,'convergence_tolerance')
+    params.convergence_tolerance=1.e-4;
+end
+
+%  nondeterministic methods
+
+if ~isfield(params,'distribution')
+    params.distribution='cumulative';
+end
+if ~isfield(params,'compute')
+    params.compute='probabilities';
+end
+
+%  nond_sampling
+
+if ~isfield(params,'seed')
+    params.seed=1234;
+end
+if ~isfield(params,'samples')
+    params.samples=100;
+end
+if ~isfield(params,'sample_type')
+    params.sample_type='lhs';
+end
+if ~isfield(params,'all_variables')
+    params.all_variables=false;
+end
+if ~isfield(params,'variance_based_decomp')
+    params.variance_based_decomp=false;
+end
+
+%  nond_local_reliability
+
+%%  interface section
+
+if ~isfield(params,'asynchronous')
+    params.asynchronous=true;
+end
+if ~isfield(params,'evaluation_concurrency')
+    params.evaluation_concurrency=false;
+end
+if ~isfield(params,'analysis_driver')
+    params.analysis_driver=[ISSM_DIR '/src/m/solutions/dakota/cielo_ice_script.sh'];
+end
+if ~isfield(params,'parameters_file')
+    params.parameters_file='params.in';
+end
+if ~isfield(params,'results_file')
+    params.results_file='results.out';
+end
+if ~isfield(params,'file_tag')
+    params.file_tag=true;
+end
+if ~isfield(params,'file_save')
+    params.file_save=true;
+end
+if ~isfield(params,'analysis_components')
+    params.analysis_components='';
+end
+
+%%  responses section
+
+%  gradient specifications dependent on method
+% if ~isfield(params,'no_gradients')
+%     params.no_gradients=false;
+% end
+if ~isfield(params,'numerical_gradients')
+    params.numerical_gradients=true;
+end
+if ~isfield(params,'method_source')
+    params.method_source='dakota';
+end
+if ~isfield(params,'interval_type')
+    params.interval_type='forward';
+end
+if ~isfield(params,'fd_gradient_step_size')
+    params.fd_gradient_step_size=0.001;
+end
+if ~isfield(params,'analytic_gradients')
+    params.analytic_gradients=false;
+end
+%  mixed_gradients not fully implemented
+if ~isfield(params,'mixed_gradients')
+    params.mixed_gradients=false;
+end
+if ~isfield(params,'id_analytic_gradients')
+    params.id_analytic_gradients=false;
+end
+if ~isfield(params,'id_numerical_gradients')
+    params.id_numerical_gradients=false;
+end
+% if ~isfield(params,'no_hessians')
+%     params.no_hessians=false;
+% end
+
+end
+
Index: /issm/trunk/src/m/solutions/dakota/dakota_in_parse.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_in_parse.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/dakota_in_parse.m	(revision 1)
@@ -0,0 +1,662 @@
+%
+%  read a Dakota .in file and parse it.
+%
+%  [method,dvar,dresp]=dakota_in_parse(filei)
+%
+function [method,dvar,dresp]=dakota_in_parse(filei)
+    
+if ~nargin
+    help dakota_in_parse
+    return
+end
+
+if ~exist('filei' ,'var') || isempty(filei)
+    filei=input('Input file?  ','s');
+end
+fidi=fopen(sprintf('%s',filei),'r');
+if (fidi < 0)
+    error('%s could not be opened.',filei);
+end
+
+%%  loop through the file to find the Dakota method
+
+method=[];
+fseek(fidi,0,'bof');
+[fline]=findline(fidi,'method');
+if ~ischar(fline)
+    return
+end
+
+[ntokens,tokens]=fltokens(fline);
+itoken=1;
+[tokens,itoken]=nextkey(fidi,tokens,itoken);
+method=tokens{1}{itoken};
+display(sprintf('Dakota method=%s.',method));
+
+%%  loop through the file to find the Dakota variables
+
+fseek(fidi,0,'bof');
+[fline]=findline(fidi,'variables');
+if ~ischar(fline)
+    error('No Dakota variables in file %s.',filei);
+end
+
+[ntokens,tokens]=fltokens(fline);
+itoken=1;
+[dvar]=variables_parse(fidi,tokens,itoken);
+
+%%  loop through the file to find the Dakota responses
+
+fseek(fidi,0,'bof');
+[fline]=findline(fidi,'responses');
+if ~ischar(fline)
+    error('No Dakota responses in file %s.',filei);
+end
+
+[ntokens,tokens]=fltokens(fline);
+itoken=1;
+[dresp]=responses_parse(fidi,tokens,itoken);
+
+%%  loop through the file to find the Dakota response and probability levels
+%   (even though they're in method section, process after responses)
+
+fseek(fidi,0,'bof');
+[fline]=findline(fidi,'method');
+
+[ntokens,tokens]=fltokens(fline);
+itoken=1;
+[dresp]=resplevels(fidi,tokens,itoken,dresp);
+
+%%  loop through the file to verify the end
+
+display('End of file successfully reached.');
+fclose(fidi);
+
+end
+
+%%  function to parse the dakota variables
+
+function [dvar]=variables_parse(fidi,tokens,itoken)
+
+display('Reading Dakota variables.');
+dvar=[];
+ncdv=0;
+nnuv=0;
+ncsv=0;
+
+%  read next keyword
+
+[tokens,itoken]=nextkey(fidi,tokens,itoken);
+if ~itoken
+    warning('variables_parse:empty',...
+        'Dakota variables section is empty.');
+end
+
+%  process current keyword
+%  (note that this is using dakota 4.1 keywords.  dakota 4.2
+%  keywords are order-dependent.)
+
+while itoken
+    keyword=tokens{1}{itoken};
+    display(sprintf('  Dakota keyword=%s.',keyword));
+
+%  switch according to the keyword
+
+    switch lower(keyword)
+        case 'continuous_design'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            ncdv=tlist;
+            dvar.cdv=[];
+            display(sprintf('  Number of Dakota %s variables=%d.',...
+                    'continuous_design',ncdv));
+        case 'cdv_initial_point'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.cdv(i).initpt    =tlist(i);
+            end
+        case 'cdv_lower_bounds'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.cdv(i).lower     =tlist(i);
+            end
+        case 'cdv_upper_bounds'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.cdv(i).upper     =tlist(i);
+            end
+        case 'cdv_descriptors'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.cdv(i).descriptor=char(tlist(i));
+            end
+
+        case 'normal_uncertain'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nnuv=tlist;
+            dvar.nuv=[];
+            display(sprintf('  Number of Dakota %s variables=%d.',...
+                    'normal_uncertain',nnuv));
+        case 'nuv_means'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.nuv(i).mean      =tlist(i);
+            end
+        case 'nuv_std_deviations'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.nuv(i).stddev    =tlist(i);
+            end
+        case 'nuv_lower_bounds'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.nuv(i).lower     =tlist(i);
+            end
+        case 'nuv_upper_bounds'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.nuv(i).upper     =tlist(i);
+            end
+        case 'nuv_descriptors'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.nuv(i).descriptor=char(tlist(i));
+            end
+
+        case 'continuous_state'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            ncsv=tlist;
+            dvar.csv=[];
+            display(sprintf('  Number of Dakota %s variables=%d.',...
+                    'continuous_state',ncsv));
+        case 'csv_initial_state'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.csv(i).initst    =tlist(i);
+            end
+        case 'csv_lower_bounds'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.csv(i).lower     =tlist(i);
+            end
+        case 'csv_upper_bounds'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.csv(i).upper     =tlist(i);
+            end
+        case 'csv_descriptors'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dvar.csv(i).descriptor=char(tlist(i));
+            end
+
+        otherwise
+            warning('variables_parse:unrec_key',...
+                'Unrecognized keyword ''%s''.',keyword);
+            [tokens,itoken]=nextkey(fidi,tokens,itoken);
+    end
+
+%  check for eof or start of new section
+
+    if (~itoken) || ...
+       strncmpi(tokens{1}{itoken},'strategy' ,8) || ...
+       strncmpi(tokens{1}{itoken},'method'   ,6) || ...
+       strncmpi(tokens{1}{itoken},'model'    ,5) || ...
+       strncmpi(tokens{1}{itoken},'variables',9) || ...
+       strncmpi(tokens{1}{itoken},'interface',9) || ...
+       strncmpi(tokens{1}{itoken},'responses',9)
+
+%  supply default descriptors if necessary
+
+        if isfield(dvar,'cdv') && ~isfield(dvar.cdv,'descriptor')
+            for i=1:ncdv
+                dvar.cdv(i).descriptor=sprintf('cdv_%d',i);
+            end
+        end
+        if isfield(dvar,'nuv') && ~isfield(dvar.nuv,'descriptor')
+            for i=1:nnuv
+                dvar.nuv(i).descriptor=sprintf('nuv_%d',i);
+            end
+        end
+        if isfield(dvar,'csv') && ~isfield(dvar.csv,'descriptor')
+            for i=1:ncsv
+                dvar.csv(i).descriptor=sprintf('csv_%d',i);
+            end
+        end
+        return;
+    end
+end
+
+end
+
+%%  function to parse the dakota responses
+
+function [dresp]=responses_parse(fidi,tokens,itoken)
+
+display('Reading Dakota response functions.');
+dresp=[];
+nof =0;
+nnic=0;
+nnec=0;
+nlst=0;
+nrf =0;
+
+%  read next keyword
+
+[tokens,itoken]=nextkey(fidi,tokens,itoken);
+if ~itoken
+    warning('responses_parse:empty',...
+        'Dakota responses section is empty.');
+end
+
+%  process current keyword
+
+while itoken
+    keyword=tokens{1}{itoken};
+    display(sprintf('  Dakota keyword=%s.',keyword));
+
+%  switch according to the keyword
+
+    switch lower(keyword)
+        case 'num_objective_functions'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nof =tlist;
+            dresp.of =[];
+            display(sprintf('  Number of Dakota %s=%d.',...
+                    'objective_functions',nof));
+        case 'num_nonlinear_inequality_constraints'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nnic=tlist;
+            dresp.nic=[];
+            display(sprintf('  Number of Dakota %s=%d.',...
+                    'nonlinear_inequality_constraints',nof));
+        case 'num_nonlinear_equality_constraints'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nnec=tlist;
+            display(sprintf('  Number of Dakota %s=%d.',...
+                    'nonlinear_equality_constraints',nof));
+        case 'num_least_squares_terms'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nlst=tlist;
+            dresp.lst=[];
+            display(sprintf('  Number of Dakota %s=%d.',...
+                    'least_squares_terms',nof));
+        case 'num_response_functions'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nrf =tlist;
+            dresp.rf =[];
+            display(sprintf('  Number of Dakota %s=%d.',...
+                    'response_functions',nrf));
+        case 'response_descriptors'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            for i=1:length(tlist)
+                dresp.rf(i).descriptor=char(tlist(i));
+            end
+        otherwise
+            warning('responses_parse:unrec_key',...
+                'Unrecognized keyword ''%s''.',keyword);
+            [tokens,itoken]=nextkey(fidi,tokens,itoken);
+    end
+
+%  check for eof or start of new section
+
+    if (~itoken) || ...
+       strncmpi(tokens{1}{itoken},'strategy' ,8) || ...
+       strncmpi(tokens{1}{itoken},'method'   ,6) || ...
+       strncmpi(tokens{1}{itoken},'model'    ,5) || ...
+       strncmpi(tokens{1}{itoken},'variables',9) || ...
+       strncmpi(tokens{1}{itoken},'interface',9) || ...
+       strncmpi(tokens{1}{itoken},'responses',9)
+
+%  supply default descriptors if necessary
+
+        if isfield(dresp,'of' ) && ~isfield(dresp.of,'descriptor')
+            for i=1:nof
+                dresp.of(i).descriptor=sprintf('obj_fn_%d',i);
+            end
+        end
+        if isfield(dresp,'nic') && ~isfield(dresp.nic,'descriptor')
+            for i=1:nnic
+                dresp.nic(i).descriptor=sprintf('nln_ineq_con_%d',i);
+            end
+        end
+        if isfield(dresp,'nec') && ~isfield(dresp.nec,'descriptor')
+            for i=1:nnec
+                dresp.nec(i).descriptor=sprintf('nln_eq_con_%d',i);
+            end
+        end
+        if isfield(dresp,'lst') && ~isfield(dresp.lst,'descriptor')
+            for i=1:nlst
+                dresp.lst(i).descriptor=sprintf('least_sq_term_%d',i);
+            end
+        end
+        if isfield(dresp,'rf' ) && ~isfield(dresp.rf,'descriptor')
+            for i=1:nrf
+                dresp.rf(i).descriptor=sprintf('response_fn_%d',i);
+            end
+        end
+        return;
+    end
+end
+
+end
+
+%%  function to read the number and levels of responses
+
+function [dresp]=resplevels(fidi,tokens,itoken,dresp)
+
+display('Reading Dakota response levels.');
+
+%  read next keyword
+
+[tokens,itoken]=nextkey(fidi,tokens,itoken);
+if ~itoken
+    warning('resplevels:empty',...
+        'Dakota method section is empty.');
+end
+
+%  process current keyword
+
+while itoken
+    keyword=tokens{1}{itoken};
+    display(sprintf('  Dakota keyword=%s.',keyword));
+
+%  switch according to the keyword
+
+    switch lower(keyword)
+        case 'nond_sampling'
+            [tokens,itoken]=nextkey(fidi,tokens,itoken);
+        case 'nond_local_reliability'
+            [tokens,itoken]=nextkey(fidi,tokens,itoken);
+        case 'num_response_levels'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nresp=tlist;
+        case 'response_levels'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nrespl=tlist;
+        case 'num_probability_levels'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nprob=tlist;
+        case 'probability_levels'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nprobl=tlist;
+        case 'num_reliability_levels'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nrel =tlist;
+        case 'reliability_levels'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            nrell =tlist;
+        case 'num_gen_reliability_levels'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            ngrel=tlist;
+        case 'gen_reliability_levels'
+            [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+            ngrell=tlist;
+        case 'compute'
+            [tokens,itoken]=nexttoken(fidi,tokens,itoken);
+            [tokens,itoken]=nextkey(fidi,tokens,itoken);
+        otherwise
+            warning('resplevels:unrec_key',...
+                'Unrecognized keyword ''%s''.',keyword);
+            [tokens,itoken]=nextkey(fidi,tokens,itoken);
+    end
+
+%  check for eof or start of new section
+
+    if (~itoken) || ...
+       strncmpi(tokens{1}{itoken},'strategy' ,8) || ...
+       strncmpi(tokens{1}{itoken},'method'   ,6) || ...
+       strncmpi(tokens{1}{itoken},'model'    ,5) || ...
+       strncmpi(tokens{1}{itoken},'variables',9) || ...
+       strncmpi(tokens{1}{itoken},'interface',9) || ...
+       strncmpi(tokens{1}{itoken},'responses',9)
+
+%  assemble the lists by response function
+
+        if exist('nrespl','var')
+            if ~exist('nresp','var')
+                nresp(1:length(dresp.rf))=floor(length(nrespl)/length(dresp.rf));
+            end
+            ilist=1;
+            for i=1:length(dresp.rf)
+                dresp.rf(i).respl=nrespl(ilist:ilist+nresp(i)-1);
+                ilist=ilist+nresp(i);
+            end
+        end
+
+        if exist('nprobl','var')
+            if ~exist('nprob','var')
+                nprob(1:length(dresp.rf))=floor(length(nprobl)/length(dresp.rf));
+            end
+            ilist=1;
+            for i=1:length(dresp.rf)
+                dresp.rf(i).probl=nprobl(ilist:ilist+nprob(i)-1);
+                ilist=ilist+nprob(i);
+            end
+        end
+
+        if exist('nrell' ,'var')
+            if ~exist('nrel' ,'var')
+                nrel (1:length(dresp.rf))=floor(length(nrell )/length(dresp.rf));
+            end
+            ilist=1;
+            for i=1:length(dresp.rf)
+                dresp.rf(i).rell =nrell (ilist:ilist+nrel (i)-1);
+                ilist=ilist+nrel (i);
+            end
+        end
+
+        if exist('ngrell','var')
+            if ~exist('ngrel','var')
+                ngrel(1:length(dresp.rf))=floor(length(ngrell)/length(dresp.rf));
+            end
+            ilist=1;
+            for i=1:length(dresp.rf)
+                dresp.rf(i).grell=ngrell(ilist:ilist+ngrel(i)-1);
+                ilist=ilist+ngrel(i);
+            end
+        end
+
+        return;
+    end
+end
+
+end
+
+%%  function to find the next keyword
+
+function [tokens,itoken]=nextkey(fidi,tokens,itoken)
+
+%  start with next token
+
+[tokens,itoken]=nexttoken(fidi,tokens,itoken);
+if ~itoken
+    return;
+end
+
+%  check for equal sign and skip subsequent list
+
+if (itoken <= length(tokens{1})) && ...
+   strncmp(tokens{1}{itoken},'=',1)
+    [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken);
+end
+
+end
+
+%%  function to find the next token
+
+function [tokens,itoken]=nexttoken(fidi,tokens,itoken)
+
+%  start with next token
+
+itoken=itoken+1;
+    
+%  read next line if necessary
+
+if (itoken > length(tokens{1}))
+    fline=readline(fidi);
+    if isempty(fline)
+        tokens={};
+        itoken=0;
+        return;
+    end
+    [ntokens,tokens]=fltokens(fline);
+    itoken=1;
+end
+    
+end
+
+%%  function to read a list of tokens
+
+function [tlist,tokens,itoken]=readtlist(fidi,tokens,itoken)
+
+%  start with next token (which should be equal sign, unless
+%  equal sign was already read to determine existence of list)
+
+itoken=itoken+1;
+
+%  read next line if necessary
+
+if (itoken > length(tokens{1}))
+    fline=readline(fidi);
+    if isempty(fline)
+        tokens={};
+        itoken=0;
+        return;
+    end
+    [ntokens,tokens]=fltokens(fline);
+    itoken=1;
+end
+    
+%  check for equal sign and skip
+
+if strncmp(tokens{1}{itoken},'=',1)
+    itoken=itoken+1;
+end
+
+ilist=0;
+
+%  accumulate list until non-numeric and non-quoted-string (or eof)
+%  is encountered
+
+while 1
+    for i=itoken:length(tokens{1})
+        if isnumeric(tokens{1}{i})
+            ilist=ilist+1;
+            tlist(ilist)=tokens{1}{i};
+        elseif ischar(tokens{1}{i}) && ...
+               (strncmp(tokens{1}{i}(1)  ,'''',1) && ...
+                strncmp(tokens{1}{i}(end),'''',1)) || ...
+               (strncmp(tokens{1}{i}(1)  ,'"',1) && ...
+                strncmp(tokens{1}{i}(end),'"',1))
+            ilist=ilist+1;
+            tlist(ilist)=cellstr(tokens{1}{i}(2:end-1));
+        else
+            itoken=i;
+            return
+        end
+    end
+    fline=readline(fidi);
+    if isempty(fline)
+        tokens={};
+        itoken=0;
+        return;
+    end
+    [ntokens,tokens]=fltokens(fline);
+    itoken=1;
+end
+
+end
+
+%%  function to find a file line starting with a specified string
+
+function [fline]=findline(fidi,string)
+
+ipos=ftell(fidi);
+
+while 1
+    fline=readline(fidi);
+    if isempty(fline)
+        break;
+    else
+        if (strncmpi(fline,string,length(string)))
+            return;
+        end
+    end
+end
+
+%  issue warning and reset file position
+
+warning('findline:str_not_found',...
+    'String ''%s'' not found in file.',string);
+fseek(fidi,ipos,'bof');
+
+end
+
+%%  function to read a file line ignoring comments and blanks
+
+function [fline]=readline(fidi)
+
+while 1
+    fline=fgetl(fidi);
+    if ~ischar(fline)
+        fline=[];
+        return;
+    end
+
+    for ichar=1:length(fline)
+        if ~strncmp(fline(ichar),' ',1) && ...
+           ~strncmp(fline(ichar),'	',1)
+            break;
+        end
+    end
+    if isempty(fline) || ...
+       (ichar > length(fline)) || ...
+       strncmp(fline(ichar),'#',1)
+        continue;
+    else
+        return;
+    end
+end
+
+end
+
+%%  function to parse a file line into tokens
+
+function [ntokens,tokens]=fltokens(fline)
+
+if ~ischar(fline)
+    ntokens=-1;
+    tokens={};
+    return;
+end
+if isempty(fline)
+    ntokens=0;
+    tokens={};
+    return;
+end
+
+strings=textscan(fline,'%s','delimiter',' :,');
+%for i=1:length(strings{1})
+%    display(sprintf('i=%d; strings{1}{%d}=%s',i,i,strings{1}{i}))
+%end
+ntokens=0;
+tokens{1}{length(strings)}='';
+
+for i=1:length(strings{1})
+    if isempty(strings{1}{i})
+        continue
+    end
+    ntokens=ntokens+1;
+    inum=sscanf(strings{1}{i},'%f');
+    if isempty(inum)
+        tokens{1}{ntokens}=strings{1}{i};
+%         display(sprintf('i=%d; tokens{1}{%d}=%s',...
+%             i,ntokens,tokens{1}{ntokens}))
+    else
+        tokens{1}{ntokens}=inum;
+%         display(sprintf('i=%d; tokens{1}{%d}=%f',...
+%             i,ntokens,tokens{1}{ntokens}))
+    end
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/dakota_in_write.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_in_write.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/dakota_in_write.m	(revision 1)
@@ -0,0 +1,591 @@
+%
+%  write a Dakota .in file.
+%
+%  []=dakota_in_write(method,dvar,dresp,filei,params)
+%
+function []=dakota_in_write(method,dvar,dresp,filei,params)
+
+if ~nargin
+    help dakota_in_write
+    return
+end
+
+%  process the input parameters
+
+if ~exist('method' ,'var') || isempty(method)
+    method=input('Method: sampling (s) or local reliability (l)?  ','s');
+    if     strncmpi(method,'s',1)
+        method='nond_sampling';
+    elseif strncmpi(method,'l',1)
+        method='nond_local_reliability';
+    end
+end
+
+switch method
+%     case {'dot_bfgs','dot_frcg','dot_mmfd','dot_slp','dot_sqp'}
+%     case {'npsol_sqp'}
+    case {'conmin_frcg','conmin_mfd'}
+%     case {'optpp_cg','optpp_q_newton','optpp_fd_newton',...
+%             'optpp_newton','optpp_pds'}
+%     case {'asynch_pattern_search'}
+%     case {'coliny_cobyla','coliny_direct','coliny_ea',...
+%             'coliny_pattern_search','coliny_solis_wets'}
+%     case {'ncsu_direct'}
+%     case {'moga','soga'}
+%     case {'nl2sol','nlssol_sqp','optpp_g_newton'}
+    case {'nond_sampling'}
+    case {'nond_local_reliability'}
+%     case {'dace','fsu_quasi_mc','fsu_cvt'}
+%     case {'vector_parameter_study','list_parameter_study',...
+%             'centered parameter_study','multidim_parameter_study'}
+    otherwise
+        error('Unrecognized method: ''%s''.',method);
+end
+
+if ~exist('filei' ,'var') || isempty(filei)
+    filei=input('Dakota input file to write?  ','s');
+end
+[pathstr,name,ext,versn] = fileparts(filei);
+if isempty(ext)
+    ext='.in';
+end
+filei2=fullfile(pathstr,[name ext versn]);
+
+display(sprintf('Opening Dakota input file ''%s''.',filei2));
+fidi=fopen(sprintf('%s',filei2),'w');
+if (fidi < 0)
+    error('''%s'' could not be opened.',filei2);
+end
+
+if ~exist('params','var')
+    params=struct();
+end
+params=dakota_in_params(params);
+
+%  write the strategy section
+
+strategy_write(fidi,params);
+
+%  write the method section
+
+method_write(fidi,method,dresp,params);
+
+%  write the model section
+
+model_write(fidi);
+
+%  write the variables section
+
+variables_write(fidi,method,dvar);
+
+%  write the interface section
+
+interface_write(fidi,params);
+
+%  write the responses section
+
+responses_write(fidi,method,dresp,params);
+
+fclose(fidi);
+display('End of file successfully written.');
+
+end
+
+%%  function to write the strategy section of the file
+
+function []=strategy_write(fidi,params)
+
+display('Writing strategy section of Dakota input file.');
+
+fprintf(fidi,'strategy,\n');
+fprintf(fidi,'\tsingle_method\n');
+param_write(fidi,'\t  ','graphics','','\n',params);
+param_write(fidi,'\t  ','tabular_graphics_data','','\n',params);
+param_write(fidi,'\t  ','tabular_graphics_file',' ''','''\n',params);
+fprintf(fidi,'\n');
+
+end
+
+%%  function to write the method section of the file
+
+function []=method_write(fidi,method,dresp,params)
+
+display('Writing method section of Dakota input file.');
+
+fprintf(fidi,'method,\n');
+fprintf(fidi,'\t%s\n',method);
+param_write(fidi,'\t  ','output',' ','\n',params);
+param_write(fidi,'\t  ','max_iterations','           = ','\n',params);
+param_write(fidi,'\t  ','max_function_evaluations',' = ','\n',params);
+param_write(fidi,'\t  ','convergence_tolerance','    = ','\n',params);
+
+switch method
+%     case {'dot_bfgs','dot_frcg','dot_mmfd','dot_slp','dot_sqp'}
+%     case {'npsol_sqp'}
+    case {'conmin_frcg','conmin_mfd'}
+%     case {'optpp_cg','optpp_q_newton','optpp_fd_newton',...
+%             'optpp_newton','optpp_pds'}
+%     case {'asynch_pattern_search'}
+%     case {'coliny_cobyla','coliny_direct','coliny_ea',...
+%             'coliny_pattern_search','coliny_solis_wets'}
+%     case {'ncsu_direct'}
+%     case {'moga','soga'}
+%     case {'nl2sol','nlssol_sqp','optpp_g_newton'}
+    case {'nond_sampling'}
+        param_write(fidi,'\t  ','seed','      = ','\n',params);
+        param_write(fidi,'\t  ','samples','   = ','\n',params);
+        param_write(fidi,'\t  ','sample_type',' ','\n',params);
+    case {'nond_local_reliability'}
+%     case {'dace','fsu_quasi_mc','fsu_cvt'}
+%     case {'vector_parameter_study','list_parameter_study',...
+%             'centered parameter_study','multidim_parameter_study'}
+end
+
+%  write response levels
+
+if isfield(dresp,'rf')
+    param_write(fidi,'\t  ','distribution',' ','\n',params);
+    [respl,probl,rell,grell]=dresp_levels(dresp.rf);
+    if ~isempty(respl)
+        rlev_write(fidi,'response_levels',respl);
+        param_write(fidi,'\t  ','compute',' ','\n',params);
+    end 
+    if ~isempty(probl)
+        rlev_write(fidi,'probability_levels',probl);
+    end
+    if ~isempty(rell)
+        rlev_write(fidi,'reliability_levels',rell);
+    end
+    if ~isempty(grell)
+        rlev_write(fidi,'gen_reliability_levels',grell);
+    end
+end
+fprintf(fidi,'\n');
+
+end
+
+%%  function to write response levels
+
+function []=rlev_write(fidi,ltype,levels)
+
+fprintf(fidi,'\t  num_%s =',ltype);
+for i=1:length(levels)
+    fprintf(fidi,' %d',length(levels{i}));
+end
+fprintf(fidi,'\n');
+
+fprintf(fidi,'\t  %s =\n',ltype);
+
+for i=1:length(levels)
+    if ~isempty(levels{i})
+        vector_write(fidi,sprintf('\t    '),levels{i},8,76);
+    end
+end
+
+end
+
+%%  function to write the model section of the file
+
+function []=model_write(fidi)
+
+display('Writing model section of Dakota input file.');
+
+fprintf(fidi,'model,\n');
+fprintf(fidi,'\t%s\n\n','single');
+
+end
+
+%%  function to write the variables section of the file
+
+function []=variables_write(fidi,method,dvar)
+
+display('Writing variables section of Dakota input file.');
+
+fprintf(fidi,'variables,\n');
+
+%  variables vary by method
+
+switch method
+%     case {'dot_bfgs','dot_frcg','dot_mmfd','dot_slp','dot_sqp'}
+%     case {'npsol_sqp'}
+    case {'conmin_frcg','conmin_mfd'}
+        vsets_write(fidi,dvar,'cdv','csv');
+%     case {'optpp_cg','optpp_q_newton','optpp_fd_newton',...
+%             'optpp_newton','optpp_pds'}
+%     case {'asynch_pattern_search'}
+%     case {'coliny_cobyla','coliny_direct','coliny_ea',...
+%             'coliny_pattern_search','coliny_solis_wets'}
+%     case {'ncsu_direct'}
+%     case {'moga','soga'}
+%     case {'nl2sol','nlssol_sqp','optpp_g_newton'}
+    case {'nond_sampling'}
+        vsets_write(fidi,dvar,'nuv','csv');
+    case {'nond_local_reliability'}
+        vsets_write(fidi,dvar,'nuv','csv');
+%     case {'dace','fsu_quasi_mc','fsu_cvt'}
+%     case {'vector_parameter_study','list_parameter_study',...
+%             'centered parameter_study','multidim_parameter_study'}
+end
+
+fprintf(fidi,'\n');
+
+end
+
+%%  function to write variable sets
+
+function []=vsets_write(fidi,dvar,varargin)
+
+for i=1:length(varargin)
+    switch(varargin{i})
+        case 'cdv'
+            vstring='continuous_design';
+        case 'nuv'
+            vstring='normal_uncertain';
+        case 'csv'
+            vstring='continuous_state';
+        otherwise
+            warning('vsets_write:unrec_var',...
+                'Unrecognized variable ''%s''.',varargin{i});
+    end
+
+    if isfield(dvar,varargin{i})
+        vlist_write(fidi,vstring,varargin{i},dvar.(varargin{i}));
+    end
+end
+
+end
+
+%%  function to write variable list
+
+function []=vlist_write(fidi,vstring,vstring2,dvar)
+
+%  put variables into lists for writing
+
+vinitpt=dvar_initpt(dvar);
+vlower =dvar_lower (dvar);
+vupper =dvar_upper (dvar);
+vmean  =dvar_mean  (dvar);
+vstddev=dvar_stddev(dvar);
+vinitst=dvar_initst(dvar);
+vdesc  =dvar_desc  (dvar);
+
+%  write variables
+%  (using Dakota 4.1 syntax for backward compatability)
+
+disp(sprintf('  Writing %d %s variables.',length(dvar),class(dvar)));
+
+fprintf(fidi,'\t%s = %d\n',vstring,length(dvar));
+if ~isempty(vinitpt)
+    fprintf(fidi,'\t  %s_initial_point =\n',vstring2);
+    vector_write(fidi,sprintf('\t    '),vinitpt,6,76);
+end
+if ~isempty(vlower)
+    fprintf(fidi,'\t  %s_lower_bounds =\n',vstring2);
+    vector_write(fidi,sprintf('\t    '),vlower ,6,76);
+end
+if ~isempty(vupper)
+    fprintf(fidi,'\t  %s_upper_bounds =\n',vstring2);
+    vector_write(fidi,sprintf('\t    '),vupper ,6,76);
+end
+if ~isempty(vmean)
+    fprintf(fidi,'\t  %s_means =\n',vstring2);
+    vector_write(fidi,sprintf('\t    '),vmean  ,6,76);
+end
+if ~isempty(vstddev)
+    fprintf(fidi,'\t  %s_std_deviations =\n',vstring2);
+    vector_write(fidi,sprintf('\t    '),vstddev,6,76);
+end
+if ~isempty(vinitst)
+    fprintf(fidi,'\t  %s_initial_state =\n',vstring2);
+    vector_write(fidi,sprintf('\t    '),vinitst,6,76);
+end
+if ~isempty(vdesc)
+    fprintf(fidi,'\t  %s_descriptors =\n',vstring2);
+    vector_write(fidi,sprintf('\t    '),vdesc  ,6,76);
+end
+
+end
+
+%%  function to write the interface section of the file
+
+function []=interface_write(fidi,params)
+
+display('Writing interface section of Dakota input file.');
+
+fprintf(fidi,'interface,\n');
+
+if strcmpi(params.analysis_driver,'matlab')
+%  Error: asynchronous capability not yet supported in direct interfaces.
+    fprintf(fidi,'\tdirect\n');
+    param_write(fidi,'\t  ','analysis_driver','     = ''','''\n',params);
+    [pathstr,name,ext,versn] = fileparts(params.analysis_components);
+    if isempty(ext)
+        ext='.m';
+    end
+    params.analysis_components=fullfile(pathstr,[name ext versn]);
+    param_write(fidi,'\t  ','analysis_components',' = ''','''\n',params);
+else
+    param_write(fidi,'\t','asynchronous','','\n',params);
+    param_write(fidi,'\t  ','evaluation_concurrency',' = ','\n',params);
+    fprintf(fidi,'\tfork\n');
+    param_write(fidi,'\t  ','analysis_driver',' = ''','''\n',params);
+    param_write(fidi,'\t  ','parameters_file',' = ''','''\n',params);
+    param_write(fidi,'\t  ','results_file','    = ''','''\n',params);
+    param_write(fidi,'\t  ','file_tag', '','\n',params);
+    param_write(fidi,'\t  ','file_save','','\n',params);
+end
+fprintf(fidi,'\n');
+
+end
+
+%%  function to write the responses section of the file
+
+function []=responses_write(fidi,method,dresp,params)
+
+display('Writing responses section of Dakota input file.');
+
+fprintf(fidi,'responses,\n');
+
+%  functions, gradients, and hessians vary by method
+
+switch method
+%     case {'dot_bfgs','dot_frcg','dot_mmfd','dot_slp','dot_sqp'}
+%     case {'npsol_sqp'}
+    case {'conmin_frcg','conmin_mfd'}
+        rsets_write(fidi,dresp,'of','nic','nec');
+        ghspec_write(fidi,params,'grad');
+%     case {'optpp_cg','optpp_q_newton','optpp_fd_newton',...
+%             'optpp_newton','optpp_pds'}
+%     case {'asynch_pattern_search'}
+%     case {'coliny_cobyla','coliny_direct','coliny_ea',...
+%             'coliny_pattern_search','coliny_solis_wets'}
+%     case {'ncsu_direct'}
+%     case {'moga','soga'}
+%     case {'nl2sol','nlssol_sqp','optpp_g_newton'}
+    case {'nond_sampling'}
+        rsets_write(fidi,dresp,'rf');
+        ghspec_write(fidi,params);
+    case {'nond_local_reliability'}
+        rsets_write(fidi,dresp,'rf');
+        ghspec_write(fidi,params,'grad');
+%     case {'dace','fsu_quasi_mc','fsu_cvt'}
+%     case {'vector_parameter_study','list_parameter_study',...
+%             'centered parameter_study','multidim_parameter_study'}
+end
+
+fprintf(fidi,'\n');
+
+end
+
+%%  function to write response sets
+
+function []=rsets_write(fidi,dresp,varargin)
+
+rdesc={};
+
+for i=1:length(varargin)
+    switch(varargin{i})
+        case 'of'
+            rstring ='objective_functions';
+            rstring2='objective_function';
+        case 'lst'
+            rstring ='least_squares_terms';
+            rstring2='least_squares_term';
+        case 'nic'
+            rstring ='nonlinear_inequality_constraints';
+            rstring2='nonlinear_inequality';
+        case 'nec'
+            rstring ='nonlinear_equality_constraints';
+            rstring2='nonlinear_equality';
+        case 'rf'
+            rstring ='response_functions';
+            rstring2='response_function';
+        otherwise
+            warning('rsets_write:unrec_resp',...
+                'Unrecognized response ''%s''.',varargin{i});
+    end
+    
+    if isfield(dresp,varargin{i})
+        [rdesc]=rlist_write(fidi,rstring,rstring2,dresp.(varargin{i}),rdesc);
+    end
+end
+
+%  write response descriptors
+
+if ~isempty(rdesc)
+    fprintf(fidi,'\tresponse_descriptors =\n');
+    vector_write(fidi,sprintf('\t  '),rdesc,6,76);
+end
+
+end
+
+%%  function to write response list
+
+function [rdesc]=rlist_write(fidi,rstring,rstring2,dresp,rdesc)
+
+%  put responses into lists for writing
+
+rstype =dresp_stype (dresp);
+rscale =dresp_scale (dresp);
+rweight=dresp_weight(dresp);
+rlower =dresp_lower (dresp);
+rupper =dresp_upper (dresp);
+rtarget=dresp_target(dresp);
+
+%  accumulate descriptors into list for subsequent writing
+
+rdesc(end+1:end+numel(dresp))=dresp_desc  (dresp);
+
+%  write responses
+
+disp(sprintf('  Writing %d %s responses.',length(dresp),class(dresp)));
+
+fprintf(fidi,'\tnum_%s = %d\n',rstring,length(dresp));
+if ~isempty(rstype)
+    fprintf(fidi,'\t  %s_scale_types =\n',rstring2);
+    vector_write(fidi,sprintf('\t    '),rstype ,6,76);
+end
+if ~isempty(rscale)
+    fprintf(fidi,'\t  %s_scales =\n',rstring2);
+    vector_write(fidi,sprintf('\t    '),rscale ,6,76);
+end
+if ~isempty(rweight)
+    switch rstring2
+        case 'objective_function'
+            wtype='multi_objective';
+        case 'least_squares_term'
+            wtype='least_squares';
+    end
+    fprintf(fidi,'\t  %s_weights =\n',wtype);
+    vector_write(fidi,sprintf('\t    '),rweight,6,76);
+end
+if ~isempty(rlower)
+    fprintf(fidi,'\t  %s_lower_bounds =\n',rstring2);
+    vector_write(fidi,sprintf('\t    '),rlower ,6,76);
+end
+if ~isempty(rupper)
+    fprintf(fidi,'\t  %s_upper_bounds =\n',rstring2);
+    vector_write(fidi,sprintf('\t    '),rupper ,6,76);
+end
+if ~isempty(rtarget)
+    fprintf(fidi,'\t  %s_targets =\n',rstring2);
+    vector_write(fidi,sprintf('\t    '),rtarget,6,76);
+end
+
+end
+
+%%  function to write gradient and hessian specifications
+
+function []=ghspec_write(fidi,params,varargin)
+
+%  gradients
+
+if findstring(varargin,'grad')
+    if     params.numerical_gradients
+        param_write(fidi,'\t','numerical_gradients','','\n',params);
+        param_write(fidi,'\t  ','method_source',' ','\n',params);
+        param_write(fidi,'\t  ','interval_type',' ','\n',params);
+        param_write(fidi,'\t  ','fd_gradient_step_size',' = ','\n',params);
+    elseif params.analytic_gradients
+        param_write(fidi,'\t','analytic_gradients','','\n',params);
+%     elseif params.mixed_gradients
+    end
+else
+    fprintf(fidi,'\tno_gradients\n');
+end
+
+%  hessians (no implemented methods use them yet)
+
+if findstring(varargin,'hess')
+    error('Hessians needed by method but not provided.');
+else
+    fprintf(fidi,'\tno_hessians\n');
+end
+
+end
+
+%%  function to find a string in a cell array
+
+function [ifound]=findstring(cells,str)
+
+ifound=false;
+
+for i=1:length(cells)
+    if ischar(cells{i}) && strcmp(cells{i},str)
+        ifound=i;
+        return
+    end
+end
+
+end
+
+%%  function to write a parameter
+
+function []=param_write(fidi,sbeg,pname,smid,send,params)
+
+if ~isfield(params,pname)
+    warning('param_write:param_not_found',...
+        'Parameter ''%s'' not found in structure.',pname);
+    return
+end
+
+if islogical(params.(pname)) && ~params.(pname)
+    return
+end
+
+if     islogical(params.(pname))
+    fprintf(fidi,[sbeg '%s' send],pname);
+elseif ischar   (params.(pname))
+    fprintf(fidi,[sbeg '%s' smid '%s' send],pname,params.(pname));
+elseif isnumeric(params.(pname))
+    fprintf(fidi,[sbeg '%s' smid '%g' send],pname,params.(pname));
+end
+
+end
+%%  function to write a vector on multiple lines
+
+function []=vector_write(fidi,sbeg,vec,nmax,cmax)
+
+if ~exist('nmax','var') || isempty(nmax)
+    nmax=Inf;
+end
+if ~exist('cmax','var') || isempty(cmax)
+    cmax=Inf;
+end
+
+%  set up first iteration
+
+svec =[];
+nitem=nmax;
+lsvec=cmax;
+
+%  assemble each line, flushing when necessary
+
+for i=1:length(vec)
+    if isnumeric(vec(i))
+        sitem=sprintf('%g'    ,vec(i));
+    else
+        sitem=sprintf('''%s''',char(vec(i)));
+    end
+    nitem=nitem+1;
+    lsvec=lsvec+1+length(sitem);
+    
+    if (nitem <= nmax) && (lsvec <= cmax)
+        svec=[svec ' ' sitem];
+    else
+        if ~isempty(svec)
+            fprintf(fidi,'%s\n',svec);
+        end
+        svec=[sbeg sitem];
+        nitem=1;
+        lsvec=length(svec);
+    end
+end
+
+%  flush buffer at end, if necessary
+
+if ~isempty(svec)
+    fprintf(fidi,'%s\n',svec);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/dakota_m_write.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_m_write.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/dakota_m_write.m	(revision 1)
@@ -0,0 +1,261 @@
+%
+%  write a Dakota .m file for the Matlab direct or external
+%  driver.
+%
+%  []=dakota_m_write(md,method,dvar,dresp,filem,params,package)
+%
+function []=dakota_m_write(md,method,dvar,dresp,filem,params,package)
+
+if ~nargin
+    help dakota_m_write
+    return
+end
+
+%  process the input parameters
+
+if ~exist('params','var')
+    params=[];
+end
+if ~isfield(params,'npart')
+    params.npart=10;
+end
+
+if ~exist('filem' ,'var') || isempty(filem)
+    filem=input('Matlab m-file to write?  ','s');
+end
+[pathstr,name,ext,versn] = fileparts(filem);
+if isempty(ext)
+    ext='.m';
+end
+filem2=fullfile(pathstr,[name ext versn]);
+
+display(sprintf('Opening Matlab m-file ''%s''.',filem2));
+fidm=fopen(sprintf('%s',filem2),'w');
+if (fidm < 0)
+    error('''%s'' could not be opened.',filem2);
+end
+
+%  write beginning of the Matlab m-file
+
+begin_write(fidm,name,params);
+
+%  write variables into the Matlab m-file
+
+variables_write(md,fidm,method,dvar);
+
+%  write solution into the Matlab m-file
+
+solution_write(fidm,package);
+
+%  write responses into the Matlab m-file
+
+responses_write(fidm,method,params,dresp);
+
+%  write end of the Matlab m-file
+
+end_write(fidm,name);
+
+fclose(fidm);
+display('End of file successfully written.');
+
+end
+
+%%  function to write beginning of the Matlab m-file
+
+function []=begin_write(fidm,name,params)
+
+display('Writing beginning of Matlab m-file.');
+
+fprintf(fidm,'%%\n');
+if strcmpi(params.analysis_driver,'matlab')
+    fprintf(fidm,'%%  Run the specified input variables and return the output responses.\n');
+    fprintf(fidm,'%%\n');
+    fprintf(fidm,'function Dakota=%s(Dakota)\n\n',name);
+    fprintf(fidm,'\tclk=clock;\n');
+    fprintf(fidm,'\tcpu=cputime;\n\n');
+    fprintf(fidm,'%%\tDakota\n\n');
+    fprintf(fidm,'\tinfile=''%s'';\n','Qmu.model');
+else
+    fprintf(fidm,'%%  Run the specified input file and return the output file.\n');
+    fprintf(fidm,'%%\n');
+    fprintf(fidm,'function %s(infile,outfile)\n\n',name);
+    fprintf(fidm,'\tclk=clock;\n');
+    fprintf(fidm,'\tcpu=cputime;\n\n');
+end
+fprintf(fidm,'\tloadmodel(infile);\n\n');
+fprintf(fidm,'\tmd=qmuname(md);\n\n');
+
+end
+
+%%  function to write design variables into the Matlab m-file
+
+function []=variables_write(md,fidm,method,dvar)
+
+display('Writing variables for Matlab m-file.');
+
+fprintf(fidm,'%%  Apply the design variables.\n\n');
+ixc=0;
+
+%  variables vary by method
+
+switch method
+%     case {'dot_bfgs','dot_frcg','dot_mmfd','dot_slp','dot_sqp'}
+%     case {'npsol_sqp'}
+    case {'conmin_frcg','conmin_mfd'}
+        ixc=vsets_write(md,fidm,ixc,dvar,'cdv','csv');
+%     case {'optpp_cg','optpp_q_newton','optpp_fd_newton',...
+%             'optpp_newton','optpp_pds'}
+%     case {'asynch_pattern_search'}
+%     case {'coliny_cobyla','coliny_direct','coliny_ea',...
+%             'coliny_pattern_search','coliny_solis_wets'}
+%     case {'ncsu_direct'}
+%     case {'moga','soga'}
+%     case {'nl2sol','nlssol_sqp','optpp_g_newton'}
+    case {'nond_sampling'}
+        ixc=vsets_write(md,fidm,ixc,dvar,'nuv','csv');
+    case {'nond_local_reliability'}
+        ixc=vsets_write(md,fidm,ixc,dvar,'nuv','csv');
+%     case {'dace','fsu_quasi_mc','fsu_cvt'}
+%     case {'vector_parameter_study','list_parameter_study',...
+%             'centered parameter_study','multidim_parameter_study'}
+end
+
+end
+
+%%  function to write variable sets into the Matlab m-file
+
+function [ixc]=vsets_write(md,fidm,ixc,dvar,varargin)
+
+for i=1:length(varargin)
+    if isfield(dvar,varargin{i})
+        ixc=vlist_write(md,fidm,ixc,varargin{i},dvar.(varargin{i}));
+    end
+end
+
+end
+
+%%  function to write variable list into the Matlab m-file
+
+function [ixc]=vlist_write(md,fidm,ixc,vtype,dvar)
+
+disp(sprintf('  Writing %d %s variables.',length(dvar),class(dvar)));
+
+for i=1:length(dvar)
+
+	%first find descriptor, without sample number on it.
+	descriptor=discardnum(dvar(i).descriptor);
+
+	%is there a lock on this variable? We don't want to update the variable twice!
+	if exist([descriptor '_lock'],'var'),
+		%lock is in place, do not update! continue;
+		continue;
+	else
+		%first things first, put lock in place
+		eval([descriptor '_lock=1;']);
+
+		%now, we need a string to put in the matlab file, which will update all the design variables 
+		%for  this descriptor.
+		[string,ixc]=QmuUpdateFunctions(md,ixc,descriptor,dvar,i);
+
+		%dump this string in the matlab file.
+        fprintf(fidm,'%s',string);
+	end
+end
+
+end
+
+%%  function to write solution into the Matlab m-file
+
+function []=solution_write(fidm,package)
+
+display('Writing solution for Matlab m-file.');
+fprintf(fidm,'%%  Run the solution.\n\n');
+
+fprintf(fidm,['\tmd=solve(md,''diagnostic'',''' package ''');\n\n']);
+
+end
+
+%%  function to write responses into the Matlab m-file
+
+function []=responses_write(fidm,method,params,dresp)
+
+display('Writing responses for Matlab m-file.');
+
+fprintf(fidm,'%%  Calculate the response functions.\n\n');
+ifnvals=0;
+
+if ~strcmpi(params.analysis_driver,'matlab')
+    fprintf(fidm,'\tfid=fopen(outfile,''w'');\n\n');
+end
+
+%  responses vary by method
+
+switch method
+%     case {'dot_bfgs','dot_frcg','dot_mmfd','dot_slp','dot_sqp'}
+%     case {'npsol_sqp'}
+    case {'conmin_frcg','conmin_mfd'}
+        ifnvals=rsets_write(fidm,ifnvals,params,dresp,'of','nic','nec');
+%     case {'optpp_cg','optpp_q_newton','optpp_fd_newton',...
+%             'optpp_newton','optpp_pds'}
+%     case {'asynch_pattern_search'}
+%     case {'coliny_cobyla','coliny_direct','coliny_ea',...
+%             'coliny_pattern_search','coliny_solis_wets'}
+%     case {'ncsu_direct'}
+%     case {'moga','soga'}
+%     case {'nl2sol','nlssol_sqp','optpp_g_newton'}
+    case {'nond_sampling'}
+        ifnvals=rsets_write(fidm,ifnvals,params,dresp,'rf');
+    case {'nond_local_reliability'}
+        ifnvals=rsets_write(fidm,ifnvals,params,dresp,'rf');
+%     case {'dace','fsu_quasi_mc','fsu_cvt'}
+%     case {'vector_parameter_study','list_parameter_study',...
+%             'centered parameter_study','multidim_parameter_study'}
+end
+
+fprintf(fidm,'\n');
+if ~strcmpi(params.analysis_driver,'matlab')
+    fprintf(fidm,'\tstatus=fclose(fid);\n\n');
+end
+
+end
+
+%%  function to write response sets into the Matlab m-file
+
+function [ifnvals]=rsets_write(fidm,ifnvals,params,dresp,varargin)
+
+for i=1:length(varargin)
+    if isfield(dresp,varargin{i})
+        ifnvals=rlist_write(fidm,ifnvals,params,varargin{i},dresp.(varargin{i}));
+    end
+end
+
+end
+
+%%  function to write response list into the Matlab m-file
+
+function [ifnvals]=rlist_write(fidm,ifnvals,params,rtype,dresp)
+
+disp(sprintf('  Writing %d %s responses.',length(dresp),class(dresp)));
+
+for i=1:length(dresp)
+    ifnvals=ifnvals+1;
+    if strcmpi(params.analysis_driver,'matlab')
+        fprintf(fidm,'\tDakota.fnVals(%d)=QmuResponseValue(md,''%s'');\n',ifnvals,dresp(i).descriptor);
+    else
+        fprintf(fidm,'\tfprintf(fid,''%%f\\n'',QmuResponseValue(md,''%s''));\n',dresp(i).descriptor);
+    end
+end
+
+end
+
+%%  function to write end of the Matlab m-file
+
+function []=end_write(fidm,name)
+
+display('Writing end of Matlab m-file.');
+
+fprintf(fidm,'\tdisp(sprintf(''%s -- %%f CPU seconds; %%f clock seconds\\n'',...\n',name);
+fprintf(fidm,'\t    cputime-cpu,etime(clock,clk)))\n\n');
+fprintf(fidm,'end\n\n');
+
+end
Index: /issm/trunk/src/m/solutions/dakota/dakota_out_parse.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_out_parse.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/dakota_out_parse.m	(revision 1)
@@ -0,0 +1,755 @@
+%
+%  read a Dakota .out file and parse it.
+%
+%  [method,dresp,scm,pcm,srcm,prcm]=dakota_out_parse(filei)
+%
+function [method,dresp,scm,pcm,srcm,prcm]=dakota_out_parse(filei)
+
+if ~nargin
+    help dakota_out_parse
+    return
+end
+
+if ~exist('filei' ,'var') || isempty(filei)
+    filei=input('Input file?  ','s');
+end
+fidi=fopen(sprintf('%s',filei),'r');
+if (fidi < 0)
+    error('%s could not be opened.',filei);
+end
+
+%%  check the first line for the Dakota tabular output file
+
+method=[];
+fline=fgetl(fidi);
+if ~ischar(fline)
+    ieof=1;
+    error('File %s is empty.',filei);
+end
+
+if strncmpi(fline,'%eval_id',8)
+    method='unknown';
+    [dresp]=dak_tab_out(fidi,fline);
+    return
+else
+    fseek(fidi,0,'bof');
+end
+
+%%  loop through the file to find the Dakota method name
+
+[fline]=findline(fidi,'methodName = ');
+if ~ischar(fline)
+    return
+end
+
+[ntokens,tokens]=fltokens(fline);
+method=tokens{1}{3};
+display(sprintf('Dakota method=%s.',method));
+
+scm =[];
+pcm =[];
+srcm=[];
+prcm=[];
+
+%%  switch according to the Dakota method
+
+switch lower(method)
+%     case {'dot_bfgs','dot_frcg','dot_mmfd','dot_slp','dot_sqp'}
+%     case {'npsol_sqp'}
+    case {'conmin_frcg','conmin_mfd'}
+        [dresp]=opt_any(fidi);
+%     case {'optpp_cg','optpp_q_newton','optpp_fd_newton',...
+%             'optpp_newton','optpp_pds'}
+%     case {'asynch_pattern_search'}
+%     case {'coliny_cobyla','coliny_direct','coliny_ea',...
+%             'coliny_pattern_search','coliny_solis_wets'}
+%     case {'ncsu_direct'}
+%     case {'moga','soga'}
+%     case {'nl2sol','nlssol_sqp','optpp_g_newton'}
+    case {'nond_sampling'}
+        [dresp,scm,pcm,srcm,prcm]=nond_samp(fidi);
+    case {'nond_local_reliability'}
+        [dresp]=nond_locrel(fidi);
+%     case {'dace','fsu_quasi_mc','fsu_cvt'}
+%     case {'vector_parameter_study','list_parameter_study',...
+%             'centered parameter_study','multidim_parameter_study'}
+    otherwise
+        error('Unrecognized  method ''%s'' in file %s.',...
+            method,filei);
+end
+
+%%  loop through the file to verify the end
+
+% [fline]=findline(fidi,'<<<<< Single Method Strategy completed');
+% if ~ischar(fline)
+%     return
+% end
+display('End of file successfully reached.');
+fclose(fidi);
+
+end
+
+%%  function to parse the dakota tabular output file
+
+function [dresp]=dak_tab_out(fidi,fline)
+
+display('Reading Dakota tabular output file.');
+
+%  process column headings of matrix (skipping eval_id)
+
+[ntokens,tokens]=fltokens(fline);
+desc=cell (1,ntokens-1);
+data=zeros(1,ntokens-1);
+
+for i=1:ntokens-1
+    desc(1,i)=cellstr(tokens{1}{i+1});
+end
+display(sprintf('Number of columns (Dakota V+R)=%d.',ntokens-1));
+    
+%  process rows of matrix
+
+nrow=0;
+while 1
+    fline=fgetl(fidi);
+    if ~ischar(fline) || isempty(fline)
+        break;
+    end
+    [ntokens,tokens]=fltokens(fline);
+
+%  add row values to matrix (skipping eval_id)
+
+    nrow=nrow+1;
+    for i=1:ntokens-1
+        data(nrow,i)=tokens{1}{i+1};
+    end
+end
+display(sprintf('Number of rows (Dakota func evals)=%d.',nrow));
+
+%  calculate statistics
+
+%dmean  =mean   (data);
+%dstddev=std    (data,0);
+[dmean,dstddev,dmeanci,dstddevci]=...
+    normfit(data,0.05);
+
+dmin   =min    (data);
+dquart1=prctile(data,25);
+dmedian=median (data);
+dquart3=prctile(data,75);
+dmax   =max    (data);
+
+%  same as Dakota scm, Excel correl
+dcorrel=corrcoef(data);
+
+%  divide the data into structures for consistency
+
+for i=1:length(desc)
+    dresp(i).descriptor=char(desc(i));
+    dresp(i).sample    =data(:,i);
+    dresp(i).mean      =dmean(i);
+    dresp(i).stddev    =dstddev(i);
+    dresp(i).meanci    =dmeanci(:,i);
+    dresp(i).stddevci  =dstddevci(:,i);
+    dresp(i).min       =dmin(i);
+    dresp(i).quart1    =dquart1(i);
+    dresp(i).median    =dmedian(i);
+    dresp(i).quart3    =dquart3(i);
+    dresp(i).max       =dmax(i);
+end
+
+%  draw box plot
+
+figure
+subplot(2,1,1)
+plot_boxplot(dresp);
+
+%  draw normal probability plot
+
+subplot(2,1,2)
+plot_normplot(dresp);
+
+end
+
+%%  function to parse the nond_sampling output file
+
+function [dresp,scm,pcm,srcm,prcm]=nond_samp(fidi)
+
+ieof=0;
+
+%%  loop through the file to find the Dakota statistics
+
+[fline]=findline(fidi,'Statistics based on ');
+if ~ischar(fline)
+    return
+end
+
+[ntokens,tokens]=fltokens(fline);
+nsamp=tokens{1}{4};
+display(sprintf('Dakota samples=%d.',nsamp));
+
+%%  loop through the file to find the moments
+
+[fline]=findline(fidi,'Moments for each response function');
+if ~ischar(fline)
+    return
+end
+
+display('Reading moments for each response function:');
+ndresp=0;
+
+while ~ieof
+    fline=fgetl(fidi);
+    if ~ischar(fline)
+        ieof=1;
+        break;
+    end
+    if isempty(fline)
+        break;
+    end
+    
+%  add new response function and moments
+
+    ndresp=ndresp+1;
+    [ntokens,tokens]=fltokens(fline);
+    dresp(ndresp).descriptor=tokens{1}{ 1};
+    display(sprintf('    %s',dresp(ndresp).descriptor));
+    dresp(ndresp).mean      =tokens{1}{ 4};
+    dresp(ndresp).stddev    =tokens{1}{ 8};
+    dresp(ndresp).coefvar   =tokens{1}{13};
+end
+
+display(sprintf('Number of Dakota response functions=%d.',ndresp));
+
+%%  loop through the file to find the confidence intervals
+
+[fline]=findline(fidi,...
+    '95% confidence intervals for each response function');
+if ~ischar(fline)
+    return
+end
+
+display('Reading 95% confidence intervals for each response function.');
+
+while ~ieof
+    fline=fgetl(fidi);
+    if ~ischar(fline)
+        ieof=1;
+        break;
+    end
+    if isempty(fline)
+        break;
+    end
+    
+%  add confidence intervals to response functions
+
+    [ntokens,tokens]=fltokens(fline);
+    for i=1:ndresp
+        if strcmpi(tokens{1}{ 1},dresp(i).descriptor)
+            dresp(i).meanci  (1,1)=tokens{1}{ 5};
+            dresp(i).meanci  (2,1)=tokens{1}{ 6};
+            dresp(i).stddevci(1,1)=tokens{1}{12};
+            dresp(i).stddevci(2,1)=tokens{1}{13};
+            break;
+        end
+    end
+end
+
+%%  loop through the file to find the probabilities
+
+[fline]=findline(fidi,'Probabilities for each response function');
+if ~ischar(fline)
+    return
+end
+
+display('Reading CDF''s for each response function.');
+
+while ~ieof && ~isempty(fline)
+    fline=fgetl(fidi);
+    if ~ischar(fline)
+        ieof=1;
+        break;
+    end
+
+%  process header line of cdf
+
+    while ~isempty(fline)
+        [ntokens,tokens]=fltokens(fline);
+
+%  find response function associated with cdf
+
+        idresp=0;
+        for i=1:ndresp
+            if strcmpi(tokens{1}{ 6},dresp(i).descriptor)
+                idresp=i;
+                break;
+            end
+        end
+    
+%  skip column headings of cdf
+
+        fline=fgetl(fidi);
+        fline=fgetl(fidi);
+
+%  read and add cdf table to response function
+
+        fline=fgetl(fidi);
+        icdf=0;
+        while ~isempty(fline) && ...
+                ~strncmpi(fline,'Cumulative Distribution Function',32)
+            [ntokens,tokens]=fltokens(fline);
+            icdf=icdf+1;
+            dresp(idresp).cdf(icdf,1)=tokens{1}{ 1};
+            dresp(idresp).cdf(icdf,2)=tokens{1}{ 2};
+            if (ntokens == 4)
+                dresp(idresp).cdf(icdf,3)=tokens{1}{ 3};
+                dresp(idresp).cdf(icdf,4)=tokens{1}{ 4};
+            else
+                dresp(idresp).cdf(icdf,3)=NaN;
+                dresp(idresp).cdf(icdf,4)=NaN;
+            end
+            fline=fgetl(fidi);
+        end
+    end
+end
+
+%%  loop through the file to find the scm
+
+[fline]=findline(fidi,'Simple Correlation Matrix');
+if ~ischar(fline)
+    scm=[];
+    return
+end
+
+display('Reading simple correlation matrix.');
+scm=corrmat(fidi,fline);
+
+%%  loop through the file to find the pcm
+
+[fline]=findline(fidi,'Partial Correlation Matrix');
+if ~ischar(fline)
+    pcm=[];
+    return
+end
+
+display('Reading partial correlation matrix.');
+pcm=corrmat(fidi,fline);
+
+%%  loop through the file to find the srcm
+
+[fline]=findline(fidi,'Simple Rank Correlation Matrix');
+if ~ischar(fline)
+    srcm=[];
+    return
+end
+
+display('Reading simple rank correlation matrix.');
+srcm=corrmat(fidi,fline);
+
+%%  loop through the file to find the prcm
+
+[fline]=findline(fidi,'Partial Rank Correlation Matrix');
+if ~ischar(fline)
+    prcm=[];
+    return
+end
+
+display('Reading partial rank correlation matrix.');
+prcm=corrmat(fidi,fline);
+
+end
+
+%%  function to read a correlation matrix at current file position
+
+function [cmat]=corrmat(fidi,fline)
+
+ieof=0;
+cmat.title=fline;
+
+while ~ieof && ~isempty(fline)
+    fline=fgetl(fidi);
+    if ~ischar(fline)
+        ieof=1;
+        break;
+    end
+
+%  process column headings of matrix
+
+    [ntokens,tokens]=fltokens(fline);
+    cmat.column=cell(1,ntokens);
+    cmat.row   =cell(1,1);
+    cmat.matrix=zeros(1,ntokens);
+    
+    for i=1:ntokens
+        cmat.column(1,i)=cellstr(tokens{1}{i});
+    end
+    
+%  process rows of matrix
+
+    nrow=0;
+    while ~ieof
+        fline=fgetl(fidi);
+        if isempty(fline)
+            break;
+        end
+        [ntokens,tokens]=fltokens(fline);
+
+%  add row heading to matrix
+
+        nrow=nrow+1;
+        cmat.row   (nrow,1)=cellstr(tokens{1}{1});
+
+%  add row values to matrix
+
+        for i=2:ntokens
+            cmat.matrix(nrow,i-1)=tokens{1}{i};
+        end
+    end
+end
+
+end
+
+%%  function to parse the nond_local_reliability output file
+
+function [dresp]=nond_locrel(fidi)
+
+ieof=0;
+
+%%  loop through the file to find the Dakota statistics
+
+[fline]=findline(fidi,'<<<<< Function evaluation summary');
+if ~ischar(fline)
+    return
+end
+
+[ntokens,tokens]=fltokens(fline);
+nfunc=tokens{1}{5};
+display(sprintf('Dakota function evaluations=%d.',nfunc));
+
+%%  loop through the file to find the statistics
+
+[fline]=findline(fidi,'MV Statistics for ');
+if ~ischar(fline)
+    return
+end
+
+display('Reading MV statistics for each response function:');
+ndresp=0;
+
+while ~ieof && ~isempty(fline) && ...
+        strncmpi(fline,'MV Statistics for ',18)
+
+%  add new response function and moments
+
+    ndresp=ndresp+1;
+    [ntokens,tokens]=fltokens(fline);
+    dresp(ndresp).descriptor=tokens{1}{4};
+    display(sprintf('    %s',dresp(ndresp).descriptor));
+    fline=fgetl(fidi);
+    [ntokens,tokens]=fltokens(fline);
+    dresp(ndresp).mean      =tokens{1}{5};
+    fline=fgetl(fidi);
+    [ntokens,tokens]=fltokens(fline);
+    dresp(ndresp).stddev    =tokens{1}{7};
+
+%  read and add importance factors to response function
+
+	idvar=0;
+    fline=fgetl(fidi);
+    if ~ischar(fline)
+        ieof=1;
+        break;
+    end
+
+    while ~ieof && ~isempty(fline) && ...
+            strncmpi(fline,'  Importance Factor for variable ',33)
+        [ntokens,tokens]=fltokens(fline);
+        idvar=idvar+1;
+        dresp(ndresp).desvar(idvar,1)=cellstr(tokens{1}{5});
+        dresp(ndresp).impfac(idvar,1)=        tokens{1}{7};
+
+        fline=fgetl(fidi);
+        if ~ischar(fline)
+            ieof=1;
+            break;
+        end
+    end
+
+%  if importance factors missing, skip to cdf
+
+    if ~idvar
+        display('      Importance Factors not available.');
+        dresp(ndresp).desvar={};
+        dresp(ndresp).impfac=[];
+        while ~ieof && ...
+                ~strncmpi(fline,'Cumulative Distribution Function',32) && ...
+                ~strncmpi(fline,'MV Statistics for ',18) && ...
+                ~strncmp (fline,'-',1)
+            fline=fgetl(fidi);
+            if ~ischar(fline)
+                ieof=1;
+                break;
+            end
+        end
+    end
+
+%  process header line of cdf
+
+    icdf=0;
+
+    while ~ieof && ~isempty(fline) && ...
+            strncmpi(fline,'Cumulative Distribution Function',32)
+        [ntokens,tokens]=fltokens(fline);
+
+%  find response function associated with cdf
+
+        idresp=0;
+        for i=1:ndresp
+            if strcmpi(tokens{1}{6},dresp(i).descriptor)
+                idresp=i;
+                break;
+            end
+        end
+    
+%  skip column headings of cdf
+
+        fline=fgetl(fidi);
+        fline=fgetl(fidi);
+
+%  read and add cdf table to response function
+
+        fline=fgetl(fidi);
+        while ~isempty(fline) && ...
+                ~strncmpi(fline,'MV Statistics for ',18) && ...
+                ~strncmp (fline,'-',1)
+            [ntokens,tokens]=fltokens(fline);
+            icdf=icdf+1;
+            dresp(idresp).cdf(icdf,1)=tokens{1}{1};
+            dresp(idresp).cdf(icdf,2)=tokens{1}{2};
+            if (ntokens == 4)
+                dresp(idresp).cdf(icdf,3)=tokens{1}{3};
+                dresp(idresp).cdf(icdf,4)=tokens{1}{4};
+            else
+                dresp(idresp).cdf(icdf,3)=NaN;
+                dresp(idresp).cdf(icdf,4)=NaN;
+            end
+            fline=fgetl(fidi);
+        end
+    end
+
+%  if cdf missing, skip to end of response function
+
+    if ~icdf
+        display('      Cumulative Distribution Function not available.');
+        dresp(ndresp).cdf=[];
+        while ~ieof && ...
+                ~strncmpi(fline,'MV Statistics for ',18) && ...
+                ~strncmp (fline,'-',1)
+            fline=fgetl(fidi);
+            if ~ischar(fline)
+                ieof=1;
+                break;
+            end
+        end
+    end
+
+end
+
+display(sprintf('Number of Dakota response functions=%d.',ndresp));
+
+end
+
+%%  function to parse any optimization output file
+
+function [dresp]=opt_any(fidi)
+
+%%  search through the file to find the Dakota output data
+
+[fline]=findline(fidi,'<<<<< Iterator');
+if ~ischar(fline)
+    return
+end
+display(['  ' deblank(fline)]);
+
+[fline]=findline(fidi,'<<<<< Function evaluation summary');
+if ~ischar(fline)
+    return
+end
+display(['  ' deblank(fline)]);
+
+[ntokens,tokens]=fltokens(fline);
+nfunc=tokens{1}{5};
+% display(sprintf('Dakota function evaluations=%d.',nfunc));
+
+%%  loop through the file to find the best evaluation
+
+[fline]=findline(fidi,'<<<<< Best ');
+if ~ischar(fline)
+    return
+end
+dresp.best=[];
+
+display('Reading values for best function evaluation:');
+
+while ischar(fline) && ~isempty(fline) && ...
+        strncmpi(fline,'<<<<< Best ',11)
+    [ntokens,tokens]=fltokens(fline);
+
+%  read and add best parameter(s)
+
+    if     strncmpi(cellstr(tokens{1}{3}),'parameter', 9)
+        display(['  ' deblank(fline)]);
+
+        fline=fgetl(fidi);
+	    dresp.best.param     =[];
+        dresp.best.descriptor={};
+
+        while ischar(fline) && ~isempty(fline) && ...
+                ~strncmpi(fline,'<<<<< Best ',11)
+            [ntokens,tokens]=fltokens(fline);
+            dresp.best.param     (end+1,1)=        tokens{1}{1};
+            dresp.best.descriptor(end+1,1)=cellstr(tokens{1}{2});
+            fline=fgetl(fidi);
+        end
+
+%  read and add best objective function(s)
+
+    elseif strncmpi(cellstr(tokens{1}{3}),'objective', 9) && ...
+           strncmpi(cellstr(tokens{1}{4}),'function' , 8)
+        display(['  ' deblank(fline)]);
+
+        fline=fgetl(fidi);
+	    dresp.best.of=[];
+
+        while ischar(fline) && ~isempty(fline) && ...
+                ~strncmpi(fline,'<<<<< Best ',11)
+            [ntokens,tokens]=fltokens(fline);
+            dresp.best.of(end+1,1)=        tokens{1}{1};
+            fline=fgetl(fidi);
+        end
+
+%  read and add best residual term(s)
+
+    elseif strncmpi(cellstr(tokens{1}{3}),'residual', 8) && ...
+           strncmpi(cellstr(tokens{1}{4}),'term'    , 4)
+        display(['  ' deblank(fline)]);
+
+        fline=fgetl(fidi);
+	    dresp.best.res=[];
+
+        while ischar(fline) && ~isempty(fline) && ...
+                ~strncmpi(fline,'<<<<< Best ',11)
+            [ntokens,tokens]=fltokens(fline);
+            dresp.best.res(end+1,1)=        tokens{1}{1};
+            fline=fgetl(fidi);
+        end
+
+%  read and add best constraint value(s)
+
+    elseif strncmpi(cellstr(tokens{1}{3}),'constraint',10) && ...
+           strncmpi(cellstr(tokens{1}{4}),'value'     , 5)
+        display(['  ' deblank(fline)]);
+
+        fline=fgetl(fidi);
+	    dresp.best.nc=[];
+
+        while ischar(fline) && ~isempty(fline) && ...
+                ~strncmpi(fline,'<<<<< Best ',11)
+            [ntokens,tokens]=fltokens(fline);
+            dresp.best.nc(end+1,1)=        tokens{1}{1};
+            fline=fgetl(fidi);
+        end
+
+%  read and add best data captured
+
+    elseif strncmpi(cellstr(tokens{1}{3}),'data'    , 4) && ...
+           strncmpi(cellstr(tokens{1}{4}),'captured', 8)
+        display(['  ' deblank(fline)]);
+        [ntokens,tokens]=fltokens(fline);
+        dresp.best.eval=        tokens{1}{8};
+
+        fline=fgetl(fidi);
+
+        while ischar(fline) && ~strncmpi(fline,'<<<<< Best ',11)
+            fline=fgetl(fidi);
+        end
+
+%  read until next best or end
+
+    else
+        display(['  ' deblank(fline) '  (not processed)']);
+
+        fline=fgetl(fidi);
+
+        while ischar(fline) && ~strncmpi(fline,'<<<<< Best ',11)
+            fline=fgetl(fidi);
+        end
+    end
+end
+
+end
+
+%%  function to find a file line starting with a specified string
+
+function [fline]=findline(fidi,string)
+
+ipos=ftell(fidi);
+
+while 1
+    fline=fgetl(fidi);
+    if ~ischar(fline)
+        break;
+    else
+        if (strncmpi(fline,string,length(string)))
+            return;
+        end
+    end
+end
+
+%  issue warning and reset file position
+
+warning('findline:str_not_found',...
+    'String ''%s'' not found in file.',string);
+fseek(fidi,ipos,'bof');
+
+end
+
+%%  function to parse a file line into tokens
+
+function [ntokens,tokens]=fltokens(fline)
+
+if ~ischar(fline)
+    ntokens=-1;
+    tokens={};
+    return;
+end
+if isempty(fline)
+    ntokens=0;
+    tokens={};
+    return;
+end
+
+strings=textscan(fline,'%s','delimiter',' :');
+%for i=1:length(strings{1})
+%    display(sprintf('i=%d; strings{1}{%d}=%s',i,i,strings{1}{i}))
+%end
+ntokens=0;
+tokens{1}{length(strings)}='';
+
+for i=1:length(strings{1})
+    if isempty(strings{1}{i})
+        continue
+    end
+    ntokens=ntokens+1;
+    inum=sscanf(strings{1}{i},'%f');
+    if isempty(inum)
+        tokens{1}{ntokens}=strings{1}{i};
+%        display(sprintf('i=%d; tokens{1}{%d}=%s',...
+%            i,ntokens,tokens{1}{ntokens}))
+    else
+        tokens{1}{ntokens}=inum;
+%        display(sprintf('i=%d; tokens{1}{%d}=%f',...
+%            i,ntokens,tokens{1}{ntokens}))
+    end
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/plot_boxplot.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_boxplot.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/plot_boxplot.m	(revision 1)
@@ -0,0 +1,39 @@
+%
+%  plot a box plot of the response functions.
+%
+%  []=plot_boxplot(rfunc)
+%
+function []=plot_boxplot(rfunc)
+
+if ~nargin
+    help plot_boxplot
+    return
+end
+
+%%  assemble the data into a matrix
+
+desc=cell (1,length(rfunc));
+for i=1:length(rfunc)
+    ldata(i)=length(rfunc(i).sample);
+end
+data=zeros(max(ldata),length(rfunc));
+
+for i=1:length(rfunc)
+    desc(i)=cellstr(rfunc(i).descriptor);
+    data(1:ldata(i),i)=rfunc(i).sample;
+end
+
+%%  draw the plot
+
+%  draw box plot
+
+boxplot(data,'labels',desc,'notch','on')
+ax1=gca;
+
+%  add the annotation
+
+title('Box Plot of Design Variables and/or Response Functions')
+xlabel('Design Variable or Response Function')
+ylabel('Value')
+
+end
Index: /issm/trunk/src/m/solutions/dakota/plot_hist_norm.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_hist_norm.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/plot_hist_norm.m	(revision 1)
@@ -0,0 +1,208 @@
+%
+%  plot a relative histogram along with the normal distribution.
+%
+%  []=plot_hist_norm(rfunc1   ,rfunc2  ,hmin,hmax,hnint)
+%  []=plot_hist_norm(data,desc,mu,sigma,hmin,hmax,hnint)
+%
+function []=plot_hist_norm(varargin)
+
+if ~nargin
+    help plot_hist_norm
+    return
+end
+
+%%  process input data and assemble into matrices as needed
+
+ivar=1;
+if isstruct(varargin{ivar})
+    rfunc1=varargin{ivar};
+    ivar=ivar+1;
+    
+    desc=cell (1,length(rfunc1));
+    ldata=zeros(1,length(rfunc1));
+    for i=1:length(rfunc1)
+        ldata(i)=length(rfunc1(i).sample);
+    end
+    data=zeros(max(ldata),length(rfunc1));
+    data(:,:)=NaN;
+
+    for i=1:length(rfunc1)
+        desc(i)=cellstr(rfunc1(i).descriptor);
+        data(1:ldata(i),i)=rfunc1(i).sample;
+    end
+else
+    data=varargin{ivar};
+    ivar=ivar+1;
+    
+    ldata(1:size(data,2))=size(data,1);
+
+    if ivar <= nargin && iscell(varargin{ivar})
+        desc=varargin{ivar};
+        ivar=ivar+1;
+    else
+        desc={};
+    end 
+end
+
+if     ivar <= nargin && isstruct(varargin{ivar})
+    rfunc2=varargin{ivar};
+    ivar=ivar+1;
+
+    mu   =zeros(1,length(rfunc2));
+    sigma=zeros(1,length(rfunc2));
+
+    for i=1:length(rfunc2)
+        mu   (i)=rfunc2(i).mean;
+        sigma(i)=rfunc2(i).stddev;
+    end
+elseif ivar+1 <= nargin
+    if isnumeric(varargin{ivar})
+        if ~isempty(varargin{ivar})
+            mu   =varargin{ivar};
+        else
+            mu   =mean(data);
+            display('Using calculated means.')
+        end
+    end
+    ivar=ivar+1;
+    if isnumeric(varargin{ivar})
+        if ~isempty(varargin{ivar})
+            sigma=varargin{ivar};
+        else
+            sigma=std(data);
+            display('Using calculated standard deviations.')
+        end
+    end
+    ivar=ivar+1;
+end
+
+%%  generate the intervals
+
+if ivar <= nargin && ~isempty(varargin{ivar})
+    hmin=varargin{ivar};
+else
+    hmin=min(min(data));
+end
+ivar=ivar+1;
+if ivar <= nargin && ~isempty(varargin{ivar})
+    hmax=varargin{ivar};
+else
+    hmax=max(max(data));
+end
+ivar=ivar+1;
+if ivar <= nargin && ~isempty(varargin{ivar})
+    hnint=varargin{ivar};
+else
+    hnint=50;
+end
+ivar=ivar+1;
+edges=hmin:(hmax-hmin)/hnint:hmax;
+
+%%  generate the histogram counts and make them relative
+
+%  note that for the histc function:
+%  n(k) counts the value x(i) if edges(k) <= x(i) < edges(k+1).
+%  The last bin counts any values of x that match edges(end).
+%  Values outside the values in edges are not counted.
+%  Use -inf and inf in edges to include all non-NaN values.
+
+dhistc=histc(data,edges);
+for i=1:size(data,2)
+    dbelow(i)  =length(find(data(:,i)<edges(  1)))/ldata(i);
+    dhistc(:,i)=dhistc(:,i)                       /ldata(i);
+    dabove(i)  =length(find(data(:,i)>edges(end)))/ldata(i);
+end
+
+if exist('mu','var') && exist('sigma','var')
+    ncol=size(data,2);
+    for i=1:ncol
+        dbelow(ncol+i)=normcdf(edges(  1),mu(i),sigma(i));
+        dhistc(1:size(dhistc,1)-1,ncol+i)=...
+            normcdf(edges(2:end  ),mu(i),sigma(i))-...
+            normcdf(edges(1:end-1),mu(i),sigma(i));
+        dabove(ncol+i)=norminv(edges(end),mu(i),sigma(i));
+        if exist('desc','var')
+            desc(ncol+i)={[desc{i} ' norm']};
+        end
+    end
+end
+
+%  draw the bar plot
+
+hl1=bar(edges(1:end-1),dhistc(1:end-1,:));
+ax1=gca;
+
+%  add the annotation
+
+title('Relative Frequency Histogram')
+xlabel('Interval Edge Value')
+ylabel('Relative Frequency')
+
+if exist('desc','var')
+    hleg1=legend(ax1,desc,'Location','NorthWest',...
+                 'Interpreter','none');
+else
+    hleg1=legend(ax1);
+end
+
+%%  generate the cumulative distribution functions
+
+% cdf=zeros(size(dhistc));
+% cdf(1,:)=dhistc(1,:);
+% for i=2:size(dhistc,1)
+%     cdf(i,:)=cdf(i-1,:)+dhistc(i,:);
+% end
+cdf=cumsum(dhistc);
+for i=1:size(dhistc,2)
+    cdf(:,i)=dbelow(i)+cdf(:,i);
+end
+if exist('desc','var')
+    ncol=length(desc);
+    for i=1:ncol
+        cdesc(i)={[desc{i} ' cdf']};
+    end
+end
+
+%  draw the line plot
+
+%  (see "Using Multiple X- and Y-Axes" and "Overlaying Other
+%  Plots on Bar Graphs", or search on "YAxisLocation right")
+
+%hold all
+%hold on
+%plot(edges,cdf)
+%plotyy([],[],edges,cdf)
+
+%  ticks from the bar plot will show through, so make ticks
+%  from the line plot match
+
+nytick=length(get(ax1,'YTick'));
+ytmax =ceil(max(max(cdf))/0.1-0.1)*0.1;
+ytinc =ytmax/(nytick-1-1);
+
+ax2=axes('Position',get(ax1,'Position'),...
+         'XLim',get(ax1,'XLim'),...
+         'YLim',[0 ytinc*(nytick-1)],...
+         'YTick',[0:ytinc:ytinc*(nytick-1)],...
+         'XAxisLocation','bottom','YAxisLocation','right',...
+         'Color','none','Layer','top');
+hl2=line(edges(1:end-1),cdf(1:end-1,:),'Parent',ax2);
+       
+%  add the annotation
+
+ylabel('Cumulative Percent')
+
+% legend doesn't combine with bar chart above
+if exist('cdesc','var')
+    hleg2=legend(ax2,cdesc,'Location','NorthEast',...
+                 'Interpreter','none');
+    set(hleg2,'Color','white')
+else
+    hleg2=legend(ax2);
+    set(hleg2,'Color','white')
+end
+
+set(gcf,'PaperPositionMode','auto')
+%hold off
+
+end
Index: /issm/trunk/src/m/solutions/dakota/plot_if_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_if_bars.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/plot_if_bars.m	(revision 1)
@@ -0,0 +1,120 @@
+%
+%  plot a stacked bar chart of the importance factors.
+%
+%  []=plot_if_bars(rfunc,ifmin,isort)
+%
+function []=plot_if_bars(rfunc,ifmin,isort)
+
+if ~nargin
+    help plot_if_bars
+    return
+end
+
+if ~exist('ifmin','var') || isempty(ifmin)
+    ifmin=0;
+end
+
+if ~exist('isort','var') || isempty(isort)
+    isort=0;
+end
+
+%%  assemble the data into a matrix
+
+desc=cell (1,length(rfunc));
+for i=1:length(rfunc)
+    ldata(i)=length(rfunc(i).impfac);
+end
+data=zeros(length(rfunc),max(ldata));
+dvar=rfunc(find(ldata == max(ldata),1,'first')).desvar;
+
+for i=1:length(rfunc)
+    desc(i)=cellstr(rfunc(i).descriptor);
+    data(i,1:ldata(i))=rfunc(i).impfac;
+end
+
+%%  sort the data, if necessary
+
+if (isort)
+    ipmax=max(data,[],1);
+    if (isort > 0)
+        [ipmax,index]=sort(ipmax,'descend');
+    else
+        [ipmax,index]=sort(ipmax,'ascend' );
+    end
+    clear ipmax
+    
+    dvar=dvar(index);
+    data=data(:,index);
+end
+
+%%  filter the data, if necessary
+
+if (ifmin > 0)
+    nif=length(dvar);
+    dvar(nif+1,1)=cellstr(sprintf('others < %f',ifmin));
+    data(:,nif+1)=0.;
+    
+    nif2=0;
+    dvar2=cell (size(dvar));
+    data2=zeros(size(data));
+    
+%  sum filtered rows and copy unfiltered rows
+
+    for i=1:nif
+        if (max(data(:,i)) < ifmin)
+            data(:,nif+1)=data(:,nif+1)+data(:,i);
+        else
+            nif2=nif2+1;
+            dvar2(nif2)  =dvar(i);
+            data2(:,nif2)=data(:,i);
+        end
+    end
+    
+%  copy sums
+
+    dvar2(nif2+1)  =dvar(nif+1);
+    data2(:,nif2+1)=data(:,nif+1);
+    
+%  copy back and truncate filtered rows
+
+    clear dvar data
+    if (isort >= 0)
+        dvar(1:nif2+1)  =dvar2(1:nif2+1);
+        data(:,1:nif2+1)=data2(:,1:nif2+1);
+    else
+        dvar(1       )  =dvar2(  nif2+1);
+        dvar(2:nif2+1)  =dvar2(1:nif2  );
+        data(:,1       )=data2(:,  nif2+1);
+        data(:,2:nif2+1)=data2(:,1:nif2  );
+    end
+    clear nif nif2 dvar2 data2
+end
+
+%%  draw the stacked bar plot
+
+%  if there's only one row, Matlab 7.5 interprets it as a column,
+%  so add an extra row, then reduce xlim
+
+if length(rfunc) == 1
+    data=[data; data];
+end
+
+hl1=bar(data,'stacked');
+
+ax1=gca;
+set(ax1,'ylim',[0 1.2])
+if length(rfunc) == 1
+    set(ax1,'xlim',[0.5 1.5])
+end
+set(ax1,'xticklabel',desc)
+
+%  add the annotation
+
+title('Importance Factors')
+xlabel('Response Function')
+ylabel('Importance Factor Value')
+
+hleg1=legend(ax1,dvar,'Location','EastOutside',...
+             'Orientation','vertical','Interpreter','none');
+
+end
Index: /issm/trunk/src/m/solutions/dakota/plot_normdist_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_normdist_bars.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/plot_normdist_bars.m	(revision 1)
@@ -0,0 +1,77 @@
+%
+%  plot a stacked bar chart of the sample distributions.
+%
+%  []=plot_normdist_bars(rfunc,plev)
+%
+function []=plot_normdist_bars(rfunc,plev)
+
+if ~nargin
+    help plot_normdist_bars
+    return
+end
+
+if ~exist('plev','var') || isempty(plev)
+    plev=[0.01 0.25 0.50 0.75 0.99];
+end
+
+%%  assemble the data into a matrix and calculate the increments
+
+desc=cell (1,length(rfunc));
+data=zeros(length(rfunc),5);
+
+if ~isfield(rfunc,'mean') || ~isfield(rfunc,'stddev')
+    for i=1:length(rfunc)
+        [rfunc(i).mean,rfunc(i).stddev,...
+            rfunc(i).meanci,rfunc(i).stddevci]=...
+            normfit(rfunc(i).sample,0.05);
+    end
+end
+
+for i=1:length(rfunc)
+    desc(i)=cellstr(rfunc(i).descriptor);
+    data(i,:)=norminv(plev,rfunc(i).mean,rfunc(i).stddev);
+end
+
+for j=length(plev):-1:2
+    data(:,j)=data(:,j)-data(:,j-1);
+end
+
+%%  draw the stacked bar plot
+
+%  if there's only one row, Matlab 7.5 interprets it as a column,
+%  so add an extra row, then reduce xlim
+
+if length(rfunc) == 1
+    data=[data; data];
+end
+
+hl1=bar(data,'stacked');
+%  set barseries properties for lowest value
+whitebg('white')
+set(hl1(1),'FaceColor','white')
+set(hl1(1),'Visible','off')
+
+ax1=gca;
+if length(rfunc) == 1
+    set(ax1,'xlim',[0.5 1.5])
+end
+set(ax1,'xtick',1:1:max(length(rfunc),2));
+set(ax1,'xticklabel',desc)
+
+%  add the annotation
+
+title('Normal Distributions of Design Variables and/or Response Functions')
+xlabel('Design Variable or Response Function')
+ylabel('Value')
+
+if ~exist('lstr','var') || isempty(lstr)
+    lstr=cell(1,length(plev));
+    for i=1:length(plev)
+        lstr(i)=cellstr(sprintf('%g%%',100*plev(i)));
+    end
+end
+
+hleg1=legend(ax1,lstr,'Location','EastOutside',...
+             'Orientation','vertical','Interpreter','none');
+
+end
Index: /issm/trunk/src/m/solutions/dakota/plot_normplot.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_normplot.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/plot_normplot.m	(revision 1)
@@ -0,0 +1,42 @@
+%
+%  plot a normal probability plot of the response functions.
+%
+%  []=plot_normplot(rfunc)
+%
+function []=plot_normplot(rfunc)
+
+if ~nargin
+    help plot_normplot
+    return
+end
+
+%%  assemble the data into a matrix
+
+desc=cell (1,length(rfunc));
+for i=1:length(rfunc)
+    ldata(i)=length(rfunc(i).sample);
+end
+data=zeros(max(ldata),length(rfunc));
+
+for i=1:length(rfunc)
+    desc(i)=cellstr(rfunc(i).descriptor);
+    data(1:ldata(i),i)=rfunc(i).sample;
+end
+
+%%  draw the plot
+
+%  draw normal probability plot
+
+normplot(data)
+ax1=gca;
+
+%  add the annotation
+
+title('Normal Probability Plot of Design Variables and/or Response Functions')
+xlabel('Value')
+ylabel('Probability')
+
+hleg1=legend(ax1,desc,'Location','EastOutside',...
+             'Orientation','vertical','Interpreter','none');
+
+end
Index: /issm/trunk/src/m/solutions/dakota/plot_prob_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_prob_bars.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/plot_prob_bars.m	(revision 1)
@@ -0,0 +1,81 @@
+%
+%  plot a stacked bar chart of the probabilities.
+%
+%  []=plot_prob_bars(rfunc,lstr)
+%
+function []=plot_prob_bars(rfunc,lstr)
+
+if ~nargin
+    help plot_prob_bars
+    return
+end
+
+%%  assemble the data into a matrix and calculate the increments
+
+desc=cell (1,length(rfunc));
+for i=1:length(rfunc)
+    ldata(i)=size(rfunc(i).cdf,1);
+end
+data=zeros(length(rfunc),max(ldata));
+
+for i=1:length(rfunc)
+    desc(i)=cellstr(rfunc(i).descriptor);
+    if ~isempty(rfunc(i).cdf)
+    data(i,1)=rfunc(i).cdf(1,2);
+        for j=2:size(rfunc(i).cdf,1)
+            if (rfunc(i).cdf(j,2) > rfunc(i).cdf(j-1,2))
+                data(i,j)=rfunc(i).cdf(j,2)-rfunc(i).cdf(j-1,2);
+            end
+        end
+    end
+end
+
+%  convert to percentage
+
+data=data*100.;
+
+%%  draw the stacked bar plot
+
+%  if there's only one row, Matlab 7.5 interprets it as a column,
+%  so add an extra row, then reduce xlim
+
+if length(rfunc) == 1
+    data=[data; data];
+end
+
+hl1=bar(data,'stacked');
+% set(hl1(1),'FaceColor','green')
+% set(hl1(2),'FaceColor','blue')
+% set(hl1(3),'FaceColor','yellow')
+% set(hl1(4),'FaceColor','cyan')
+% set(hl1(5),'FaceColor','magenta')
+% set(hl1(6),'FaceColor','red')
+
+ax1=gca;
+set(ax1,'ylim',[0 120])
+if length(rfunc) == 1
+    set(ax1,'xlim',[0.5 1.5])
+end
+set(ax1,'xticklabel',desc)
+
+%  add the annotation
+
+title('Probabilities for Specified Response Levels')
+xlabel('Response Function')
+ylabel('Percent Below Level')
+
+if ~exist('lstr','var') || isempty(lstr)
+    lstr=cell(1,max(ldata));
+    for i=1:max(ldata)
+        lstr(i)=cellstr(sprintf('%g',...
+            rfunc(find(ldata == max(ldata),1,'first')).cdf(i,1)));
+    end
+    if ~isempty(find(ldata < max(ldata)))
+        warning('Variable number of levels for response functions.');
+    end
+end
+
+hleg1=legend(ax1,lstr,'Location','EastOutside',...
+             'Orientation','vertical','Interpreter','none');
+
+end
Index: /issm/trunk/src/m/solutions/dakota/plot_rlev_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_rlev_bars.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/plot_rlev_bars.m	(revision 1)
@@ -0,0 +1,74 @@
+%
+%  plot a stacked bar chart of the response levels.
+%
+%  []=plot_rlev_bars(rfunc,lstr)
+%
+function []=plot_rlev_bars(rfunc,lstr)
+
+if ~nargin
+    help plot_rlev_bars
+    return
+end
+
+%%  assemble the data into a matrix and calculate the increments
+
+desc=cell (1,length(rfunc));
+for i=1:length(rfunc)
+    ldata(i)=size(rfunc(i).cdf,1);
+end
+data=zeros(length(rfunc),max(ldata));
+
+for i=1:length(rfunc)
+    desc(i)=cellstr(rfunc(i).descriptor);
+    if ~isempty(rfunc(i).cdf)
+        data(i,1)=rfunc(i).cdf(1,1);
+        for j=2:size(rfunc(i).cdf,1)
+            if (rfunc(i).cdf(j,1) > rfunc(i).cdf(j-1,1))
+                data(i,j)=rfunc(i).cdf(j,1)-rfunc(i).cdf(j-1,1);
+            end
+        end
+    end
+end
+
+%%  draw the stacked bar plot
+
+%  if there's only one row, Matlab 7.5 interprets it as a column,
+%  so add an extra row, then reduce xlim
+
+if length(rfunc) == 1
+    data=[data; data];
+end
+
+hl1=bar(data,'stacked');
+%  set barseries properties for lowest value
+whitebg('white')
+set(hl1(1),'FaceColor','white')
+set(hl1(1),'Visible','off')
+
+ax1=gca;
+if length(rfunc) == 1
+    set(ax1,'xlim',[0.5 1.5])
+end
+set(ax1,'xticklabel',desc)
+
+%  add the annotation
+
+title('Response Levels for Specified Probabilities')
+xlabel('Response Function')
+ylabel('Response Level')
+
+if ~exist('lstr','var') || isempty(lstr)
+    lstr=cell(1,max(ldata));
+    for i=1:max(ldata)
+        lstr(i)=cellstr(sprintf('%g%%',...
+            100*rfunc(find(ldata == max(ldata),1,'first')).cdf(i,2)));
+    end
+    if ~isempty(find(ldata < max(ldata)))
+        warning('Variable number of probabilities for response functions.');
+    end
+end
+
+hleg1=legend(ax1,lstr,'Location','EastOutside',...
+             'Orientation','vertical','Interpreter','none');
+
+end
Index: /issm/trunk/src/m/solutions/dakota/plot_sampdist_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_sampdist_bars.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/plot_sampdist_bars.m	(revision 1)
@@ -0,0 +1,74 @@
+%
+%  plot a stacked bar chart of the sample distributions.
+%
+%  []=plot_sampdist_bars(rfunc)
+%
+function []=plot_sampdist_bars(rfunc)
+
+if ~nargin
+    help plot_sampdist_bars
+    return
+end
+
+%%  assemble the data into a matrix and calculate the increments
+
+desc=cell (1,length(rfunc));
+data=zeros(length(rfunc),5);
+
+if ~isfield(rfunc,'min')    || ~isfield(rfunc,'quart1') || ...
+   ~isfield(rfunc,'median') || ~isfield(rfunc,'quart3') || ...
+   ~isfield(rfunc,'max')
+    for i=1:length(rfunc)
+        rfunc(i).min   =min    (rfunc(i).sample);
+        rfunc(i).quart1=prctile(rfunc(i).sample,25);
+        rfunc(i).median=median (rfunc(i).sample);
+        rfunc(i).quart3=prctile(rfunc(i).sample,75);
+        rfunc(i).max   =max    (rfunc(i).sample);
+    end
+end
+
+for i=1:length(rfunc)
+    desc(i)=cellstr(rfunc(i).descriptor);
+    data(i,1)=rfunc(i).min;
+    data(i,2)=rfunc(i).quart1-rfunc(i).min;
+    data(i,3)=rfunc(i).median-rfunc(i).quart1;
+    data(i,4)=rfunc(i).quart3-rfunc(i).median;
+    data(i,5)=rfunc(i).max   -rfunc(i).quart3;
+end
+
+%%  draw the stacked bar plot
+
+%  if there's only one row, Matlab 7.5 interprets it as a column,
+%  so add an extra row, then reduce xlim
+
+if length(rfunc) == 1
+    data=[data; data];
+end
+
+hl1=bar(data,'stacked');
+%  set barseries properties for lowest value
+whitebg('white')
+set(hl1(1),'FaceColor','white')
+set(hl1(1),'Visible','off')
+
+ax1=gca;
+if length(rfunc) == 1
+    set(ax1,'xlim',[0.5 1.5])
+end
+set(ax1,'xtick',1:1:max(length(rfunc),2));
+set(ax1,'xticklabel',desc)
+
+%  add the annotation
+
+title('Sample Distributions of Design Variables and/or Response Functions')
+xlabel('Design Variable or Response Function')
+ylabel('Value')
+
+if ~exist('lstr','var') || isempty(lstr)
+    lstr={'minimum' 'quartile 1' 'median' 'quartile 3' 'maximum'};
+end
+
+hleg1=legend(ax1,lstr,'Location','EastOutside',...
+             'Orientation','vertical','Interpreter','none');
+
+end
Index: /issm/trunk/src/m/solutions/dakota/qmu.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/qmu.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/qmu.m	(revision 1)
@@ -0,0 +1,50 @@
+function md=qmu(md,package)
+%INPUT function md=qmu(md,package)
+%Deal with coupled ISSM or Cielo/ Dakota runs, to do sensitivity analyses.
+
+%first create temporary directory in which we will work
+% qmudir=['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
+qmudir='qmu';
+if exist(qmudir,'dir')
+    overwrite=input('Overwrite existing ''qmu'' directory? Y/N [N]: ', 's');
+    if strncmpi(overwrite,'y',1)
+        system(['rm -rf ' qmudir]);
+    else
+        error('Existing ''qmu'' directory not overwritten');
+    end
+end
+mkdir(qmudir)
+cd(qmudir)
+system('cp $ISSM_DIR/startup.m .');
+
+%save our model in qmu so that it can be repeatedly used by Dakota.
+save Qmu.model md
+
+%create m and in files for dakota
+dakota_in_data(md,'qmu',package);
+
+%call dakota
+system('dakota -i qmu.in -o qmu.out -e qmu.err');
+
+%parse inputs and results from dakota
+[method,dvar,dresp_in]=dakota_in_parse('qmu.in');
+md.dakotaresults.method   =method;
+md.dakotaresults.dvar     =dvar;
+md.dakotaresults.dresp_in =dresp_in;
+[method,dresp_out,scm,pcm,srcm,prcm]=dakota_out_parse('qmu.out');
+md.dakotaresults.dresp_out=dresp_out;
+[method,dresp_dat                  ]=dakota_out_parse('dakota_tabular.dat');
+md.dakotaresults.dresp_dat=dresp_dat;
+md.dakotaresults.scm      =scm;
+md.dakotaresults.pcm      =pcm;
+md.dakotaresults.srcm     =srcm;
+md.dakotaresults.prcm     =prcm;
+
+%save input and output files into model
+md.dakotain =readfile('qmu.in');
+md.dakotaout=readfile('qmu.out');
+md.dakotadat=readfile('dakota_tabular.dat');
+	
+%get out of local directory and erase
+cd ../
+% system(['rm -rf ' qmudir]);
Index: /issm/trunk/src/m/solutions/dakota/qmuname.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/qmuname.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/qmuname.m	(revision 1)
@@ -0,0 +1,11 @@
+function md=qmuname(md)
+%INPUT function md=qmuname(md)
+%Pick up the number file, read it and get the run number. Then modify the name of this 
+%model to reflect this new number.
+
+fid=fopen('number','r');
+number=fscanf(fid,'%i',1)
+fclose(fid);
+
+%modify model name by appending number to the name
+md.name=[md.name num2str(number)];
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxAbsVx.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxAbsVx.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxAbsVx.m	(revision 1)
@@ -0,0 +1,3 @@
+function value=MaxAbsVx(md)
+
+value=max(abs(md.vx));
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxAbsVy.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxAbsVy.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxAbsVy.m	(revision 1)
@@ -0,0 +1,2 @@
+function value=MaxAbsVy(md)
+value=max(abs(md.vy));
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxVel.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxVel.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxVel.m	(revision 1)
@@ -0,0 +1,2 @@
+function value=MaxVel(md)
+value=max(md.vel);
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxVx.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxVx.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxVx.m	(revision 1)
@@ -0,0 +1,3 @@
+function value=MaxVx(md)
+
+value=max(md.vx);
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxVy.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxVy.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/MaxVy.m	(revision 1)
@@ -0,0 +1,2 @@
+function value=MaxVy(md)
+value=max(md.vy);
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/MinVel.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/MinVel.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/MinVel.m	(revision 1)
@@ -0,0 +1,2 @@
+function value=MinVel(md)
+value=min(md.vel);
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/MinVx.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/MinVx.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/MinVx.m	(revision 1)
@@ -0,0 +1,4 @@
+function value=MinVx(md)
+
+value=min(md.vx);
+
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/MinVy.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/MinVy.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/MinVy.m	(revision 1)
@@ -0,0 +1,2 @@
+function value=MinVy(md)
+value=min(md.vy);
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/QmuResponseValue.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/QmuResponseValue.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/QmuResponseValue.m	(revision 1)
@@ -0,0 +1,24 @@
+function value=QmuResponseValue(md,descriptor);
+%INPUT function value=QmuResponseValue(md,descriptor);
+
+switch descriptor
+	case {'min_vx'}
+		value=MinVx(md);
+	case {'max_vx'}
+		value=MaxVx(md);
+	case {'max_abs_vx'}
+		value=MaxAbsVx(md);
+	case {'min_vy'}
+		value=MinVy(md);
+	case {'max_vy'}
+		value=MaxVy(md);
+	case {'max_abs_vy'}
+		value=MaxAbsVy(md);
+	case {'min_vel'}
+		value=MinVel(md);
+	case {'max_vel'}
+		value=MaxVel(md);
+	otherwise
+		warning('dresp_write:unrec_dresp','Unrecognized response: %s',descriptor)
+end
+
Index: /issm/trunk/src/m/solutions/dakota/setupdesign/QmuSetupDesign.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/setupdesign/QmuSetupDesign.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/setupdesign/QmuSetupDesign.m	(revision 1)
@@ -0,0 +1,27 @@
+function dvar=QmuSetupDesign(md,dvar,variables)
+
+%get descriptor
+descriptor=variables.descriptor;
+
+%loop on descriptor
+if strcmpi(descriptor,'rho_ice')
+
+	dvar=setuprhoice(md,dvar,variables);
+
+elseif strcmpi(descriptor,'thickness')
+
+	dvar=setupthickness(md,dvar,variables);
+
+elseif strcmpi(descriptor,'drag')
+
+	dvar=setupdrag(md,dvar,variables);
+
+elseif strcmpi(descriptor,'riftsfriction')
+
+	dvar=setupriftsfriction(md,dvar,variables);
+
+else
+	error(['QmuSetupDesign warning message: could not find ' descriptor ' setup design function']);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/setupdesign/setupdrag.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/setupdesign/setupdrag.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/setupdesign/setupdrag.m	(revision 1)
@@ -0,0 +1,11 @@
+function dvar=setupdrag(md,dvar,variables)
+
+%ok, dealing with semi-discrete distributed variable. Distribute according to how many 
+%partitions we want
+
+for j=1:md.npart
+	dvar(end+1)           =variables;
+	dvar(end  ).descriptor=sprintf('%s%d',variables.descriptor,j);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/setupdesign/setuprhoice.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/setupdesign/setuprhoice.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/setupdesign/setuprhoice.m	(revision 1)
@@ -0,0 +1,5 @@
+function dvar=setuprhoice(md,dvar,variables)
+
+dvar(end+1)=variables;
+
+end
Index: /issm/trunk/src/m/solutions/dakota/setupdesign/setupriftsfriction.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/setupdesign/setupriftsfriction.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/setupdesign/setupriftsfriction.m	(revision 1)
@@ -0,0 +1,10 @@
+function dvar=setupriftsfriction(md,dvar,variables)
+
+%we have several rifts.
+
+for j=1:md.numrifts
+	dvar(end+1)           =variables;
+	dvar(end  ).descriptor=sprintf('%s%d',variables.descriptor,j);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/setupdesign/setupthickness.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/setupdesign/setupthickness.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/setupdesign/setupthickness.m	(revision 1)
@@ -0,0 +1,11 @@
+function dvar=setupthickness(md,dvar,variables)
+
+%ok, dealing with semi-discrete distributed variable. Distribute according to how many 
+%partitions we want
+
+for j=1:md.npart
+	dvar(end+1)           =variables;
+	dvar(end  ).descriptor=sprintf('%s%d',variables.descriptor,j);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/updatefunctions/QmuUpdateFunctions.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/updatefunctions/QmuUpdateFunctions.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/updatefunctions/QmuUpdateFunctions.m	(revision 1)
@@ -0,0 +1,29 @@
+function [string,ixc]=QmuUpdateFunctions(md,ixc,descriptor,dvar,i)
+
+if strcmpi(descriptor,'rho_ice')
+	[string,ixc]=updaterho_ice(md,ixc,dvar,i);
+
+elseif strcmpi(descriptor,'rho_water')
+	[string,ixc]=updaterho_water(md,ixc,dvar,i);
+
+elseif strcmpi(descriptor,'heatcapacity')
+	[string,ixc]=updateheatcapacity(md,ixc,dvar,i);
+
+elseif strcmpi(descriptor,'thermalconductivity')
+	[string,ixc]=updatethermalconductivity(md,ixc,dvar,i);
+
+elseif strcmpi(descriptor,'gravity')
+	[string,ixc]=updategravity(md,ixc,dvar,i);
+
+elseif strcmpi(descriptor,'thickness')
+	[string,ixc]=updatethickness(md,ixc,dvar);
+
+elseif strcmpi(descriptor,'drag')
+	[string,ixc]=updatedrag(md,ixc,dvar);
+
+elseif strcmpi(descriptor,'riftsfriction')
+	[string,ixc]=updateriftsfriction(md,ixc,dvar);
+
+else
+	warning('QmuUpdateFunctions warning message: ','Unrecognized design variable: %s',descriptor)
+end
Index: /issm/trunk/src/m/solutions/dakota/updatefunctions/updatedrag.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/updatefunctions/updatedrag.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/updatefunctions/updatedrag.m	(revision 1)
@@ -0,0 +1,21 @@
+function [string,ixc]=updatedrag(md,ixc,dvar)
+
+string=sprintf('\n\t[epart,npart]=MeshPartition(md,%d);\n\n',md.npart);
+string=[string sprintf('\n')];
+for j=1:length(dvar)
+	if strncmp(dvar(j).descriptor,'drag',4)
+        ixc=ixc+1;
+		idrag =sscanf(dvar(j).descriptor(5:end),'%d');
+        if strcmpi(md.analysis_driver,'matlab')
+            string=[string sprintf('\tdragi(%d,1)=Dakota.xC(%d);\n',idrag,ixc)];
+        else
+            string=[string sprintf('\tdragi(%d,1)={%s};\n',idrag,dvar(j).descriptor)];
+        end
+	end
+end
+string=[string sprintf('\tmd.drag      =md.drag      .*dragi(npart);\n')];
+string=[string sprintf('\tclear dragi\n')];
+string=[string sprintf('\tclear npart epart\n')];
+string=[string sprintf('\n')];
+
+end
Index: /issm/trunk/src/m/solutions/dakota/updatefunctions/updategravity.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/updatefunctions/updategravity.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/updatefunctions/updategravity.m	(revision 1)
@@ -0,0 +1,10 @@
+function [string,ixc]=updategravity(md,ixc,dvar,i)
+	
+ixc=ixc+1;
+if strcmpi(md.analysis_driver,'matlab')
+    string=sprintf('\tmd.g=Dakota.xC(%d);\n',ixc);
+else
+    string=sprintf('\tmd.g={%s};\n',dvar(i).descriptor);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/updatefunctions/updateheatcapacity.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/updatefunctions/updateheatcapacity.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/updatefunctions/updateheatcapacity.m	(revision 1)
@@ -0,0 +1,10 @@
+function [string,ixc]=updateheatcapacity(md,ixc,dvar,i)
+
+ixc=ixc+1;
+if strcmpi(md.analysis_driver,'matlab')
+    string=sprintf('\tmd.heatcapacity=Dakota.xC(%d);\n',ixc);
+else
+    string=sprintf('\tmd.heatcapacity={%s};\n',dvar(i).descriptor);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/updatefunctions/updaterho_ice.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/updatefunctions/updaterho_ice.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/updatefunctions/updaterho_ice.m	(revision 1)
@@ -0,0 +1,10 @@
+function [string,ixc]=updaterho_ice(md,ixc,dvar,i)
+
+ixc=ixc+1;
+if strcmpi(md.analysis_driver,'matlab')
+    string=sprintf('\tmd.rho_ice=Dakota.xC(%d);\n',ixc);
+else
+    string=sprintf('\tmd.rho_ice={%s};\n',dvar(i).descriptor);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/updatefunctions/updaterho_water.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/updatefunctions/updaterho_water.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/updatefunctions/updaterho_water.m	(revision 1)
@@ -0,0 +1,10 @@
+function [string,ixc]=updaterho_water(md,ixc,dvar,i)
+
+ixc=ixc+1;
+if strcmpi(md.analysis_driver,'matlab')
+    string=sprintf('\tmd.rho_water=Dakota.xC(%d);\n',ixc);
+else
+    string=sprintf('\tmd.rho_water={%s};\n',dvar(i).descriptor);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/updatefunctions/updateriftsfriction.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/updatefunctions/updateriftsfriction.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/updatefunctions/updateriftsfriction.m	(revision 1)
@@ -0,0 +1,17 @@
+function [string,ixc]=updateriftsfriction(md,ixc,dvar)
+
+string=sprintf('\n');
+for j=1:length(dvar)
+	if strncmpi(dvar(j).descriptor,'riftsfriction',13)
+        ixc=ixc+1;
+		irift=sscanf(dvar(j).descriptor(14:end),'%d');
+        if strcmpi(md.analysis_driver,'matlab')
+            string=[string sprintf('\tmd.rifts(%d).friction=Dakota.xC(%d);\n',irift,ixc)];
+        else
+            string=[string sprintf('\tmd.rifts(%d).friction={%s};\n',irift,dvar(j).descriptor)];
+        end
+	end
+end
+string=[string sprintf('\n')];
+
+end
Index: /issm/trunk/src/m/solutions/dakota/updatefunctions/updatethermalconductivity.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/updatefunctions/updatethermalconductivity.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/updatefunctions/updatethermalconductivity.m	(revision 1)
@@ -0,0 +1,10 @@
+function [string,ixc]=updatethermalconductivity(md,ixc,dvar,i)
+
+ixc=ixc+1;
+if strcmpi(md.analysis_driver,'matlab')
+    string=sprintf('\tmd.thermalconductivity=Dakota.xC(%d);\n',ixc);
+else
+    string=sprintf('\tmd.thermalconductivity={%s};\n',dvar(i).descriptor);
+end
+
+end
Index: /issm/trunk/src/m/solutions/dakota/updatefunctions/updatethickness.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/updatefunctions/updatethickness.m	(revision 1)
+++ /issm/trunk/src/m/solutions/dakota/updatefunctions/updatethickness.m	(revision 1)
@@ -0,0 +1,22 @@
+function [string,ixc]=updatethickness(md,ixc,dvar)
+
+string=sprintf('\n\t[epart,npart]=MeshPartition(md,%d);\n',md.npart);
+string=[string sprintf('\n')];
+for j=1:length(dvar)
+	if strncmpi(dvar(j).descriptor,'thickness',9)
+        ixc=ixc+1;
+		ithick=sscanf(dvar(j).descriptor(10:end),'%d');
+        if strcmpi(md.analysis_driver,'matlab')
+            string=[string sprintf('\tthicki(%d,1)=Dakota.xC(%d);\n',ithick,ixc)];
+        else
+            string=[string sprintf('\tthicki(%d,1)={%s};\n',ithick,dvar(j).descriptor)];
+        end
+	end
+end
+string=[string sprintf('\tmd.thickness =md.thickness .*thicki(npart);\n')];
+string=[string sprintf('\tclear thicki\n')];
+string=[string sprintf('\tmd.surface   =md.bed+md.thickness;\n')];
+string=[string sprintf('\tclear npart epart\n')];
+string=[string sprintf('\n')];
+
+end
Index: /issm/trunk/src/m/solutions/ice/BuildGridSets.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/BuildGridSets.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/BuildGridSets.m	(revision 1)
@@ -0,0 +1,128 @@
+function BuildGridSets(grids,constraints)
+%BUILDGRIDSETS - build the different grid sets
+%
+%   Several grid sets are needed to solve the finite element problem
+%   o the gset table of degrees of freedom contains 
+%     all the degrees of freedom for each grid (6)
+%   o the sset table of degrees of freedom contains 
+%     all the degrees of freedom that are spcd
+%   o the fset table of degrees of freedom contains 
+%     all the degrees of freedom that are free (gset-sset)
+%   o the fset table of degrees of freedom contains 
+%     all the degrees of freedom that linked (2d-3d junction for example)
+%
+%   Usage:
+%      BuildGridSets(grids,constraints)
+
+global cluster
+global gridset
+
+mset=zeros(getdofcount(grids),1);
+nset=zeros(getdofcount(grids),1);
+sset=zeros(getdofcount(grids),1);
+fset=zeros(getdofcount(grids),1);
+
+%First build mutually exclusive m and n sets
+%see NastranRgbDoc documentation in theoryguide directory.
+nset(:)=1; %everyone is in the n set, except if it is the leading dof of an rgb.
+for i=1:length(constraints)
+	constraint=constraints(i).constraint;
+	if strcmpi(constraint.type,'rgb'),
+		grid1=constraint.grid1;
+		grid2=constraint.grid2;
+		dof=constraint.dof;
+		dof1=grids(grid1).grid.doflist(dof);
+		dof2=grids(grid2).grid.doflist(dof);
+		if (mset(dof1)==1),
+			%this dof is already in the mset!
+			if mset(dof2)==1,
+				%ok, we have identical rgbs, do nothing
+			else
+				mset(dof2)=1;
+				nset(dof2)=0;
+			end
+		else
+			mset(dof1)=1;
+			nset(dof1)=0;
+		end
+	end
+end
+
+%Build gridset table of degrees of freedom -> s degrees (the ones that are constrained with an spc -> s for spc)
+%the f degrees of freedom (the rest, called f set -> f for free)
+for i=1:length(grids),
+	grid=grids(i).grid;
+
+	if isempty(grid),continue;end;
+
+	if ~cluster,
+		%if dof 1 is spc'ed, put it in the sset, otherwise, in the fset
+		if ~isempty(findstr(grid.gridset,'1')), sset(grid.doflist(1))=1; else fset(grid.doflist(1))=1; end
+		if ~isempty(findstr(grid.gridset,'2')), sset(grid.doflist(2))=1; else fset(grid.doflist(2))=1; end
+		if ~isempty(findstr(grid.gridset,'3')), sset(grid.doflist(3))=1; else fset(grid.doflist(3))=1; end
+		if ~isempty(findstr(grid.gridset,'4')), sset(grid.doflist(4))=1; else fset(grid.doflist(4))=1; end
+		if ~isempty(findstr(grid.gridset,'5')), sset(grid.doflist(5))=1; else fset(grid.doflist(5))=1; end
+		if ~isempty(findstr(grid.gridset,'6')), sset(grid.doflist(6))=1; else fset(grid.doflist(6))=1; end
+	else
+		%same thing, except that if the grid is a border grid, we only carry out the inclusion on lab 1
+		if grid.border==1,
+			if labindex==1,
+				if ~isempty(findstr(grid.gridset,'1')), sset(grid.doflist(1))=1; else fset(grid.doflist(1))=1; end
+				if ~isempty(findstr(grid.gridset,'2')), sset(grid.doflist(2))=1; else fset(grid.doflist(2))=1; end
+				if ~isempty(findstr(grid.gridset,'3')), sset(grid.doflist(3))=1; else fset(grid.doflist(3))=1; end
+				if ~isempty(findstr(grid.gridset,'4')), sset(grid.doflist(4))=1; else fset(grid.doflist(4))=1; end
+				if ~isempty(findstr(grid.gridset,'5')), sset(grid.doflist(5))=1; else fset(grid.doflist(5))=1; end
+				if ~isempty(findstr(grid.gridset,'6')), sset(grid.doflist(6))=1; else fset(grid.doflist(6))=1; end
+			end
+		else
+			if ~isempty(findstr(grid.gridset,'1')), sset(grid.doflist(1))=1; else fset(grid.doflist(1))=1; end
+			if ~isempty(findstr(grid.gridset,'2')), sset(grid.doflist(2))=1; else fset(grid.doflist(2))=1; end
+			if ~isempty(findstr(grid.gridset,'3')), sset(grid.doflist(3))=1; else fset(grid.doflist(3))=1; end
+			if ~isempty(findstr(grid.gridset,'4')), sset(grid.doflist(4))=1; else fset(grid.doflist(4))=1; end
+			if ~isempty(findstr(grid.gridset,'5')), sset(grid.doflist(5))=1; else fset(grid.doflist(5))=1; end
+			if ~isempty(findstr(grid.gridset,'6')), sset(grid.doflist(6))=1; else fset(grid.doflist(6))=1; end
+		end
+	end
+end
+
+
+if cluster,
+	error('Not cool, broke it!');
+	sset=gplus(sset);
+	fset=gplus(fset);
+end
+
+%First build mset vector
+
+%m and n set are mutually exclusive! For now, we assume no spc is on an mpc!
+pos=find(mset);
+fset(pos)=0;
+sset(pos)=0;
+nset(pos)=0;
+
+gridset.pv_m=pos; 
+gridset.msize=length(pos);
+
+pos=find(nset);
+gridset.pv_n=pos;
+gridset.nsize=length(pos);
+
+
+%now, n set splits into s and f set
+n_sset=sset(gridset.pv_n);
+n_fset=fset(gridset.pv_n);
+
+pos=find(n_sset);
+gridset.pv_s=pos;
+gridset.ssize=length(pos);
+
+pos=find(n_fset);
+gridset.pv_f=pos; 
+gridset.fsize=length(pos);
+
+
+gridset.gsize=gridset.msize+gridset.nsize; %no need for flags, as all dofs belong to the g set
+
+
+
+end
Index: /issm/trunk/src/m/solutions/ice/CreateFemModel.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/CreateFemModel.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/CreateFemModel.m	(revision 1)
@@ -0,0 +1,48 @@
+function  m=CreateFemModel(md,solutiontype)
+%CREATEFEMMODEL - create a finite element model structure
+%
+%   returns a structure that holds the elements, the grids, the loads, the contraints
+%   and other parameters needed to build the stiffness matrix and load vector
+%
+%   Usage:
+%      m=CreateFemModel(md,solutiontype)
+
+global gridset
+
+disp(['   creating fem model for solution ' solutiontype]);
+
+%First, build elements,grids,loads, etc ... for horizontal model
+[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessor(md,solutiontype);
+	
+%generate degrees of freedom
+grids=Dof(grids); 
+	
+%add constraints to grids. Create yg vector of constraint values for the entire g set.
+[grids yg]=SpcGrids(grids,constraints);
+
+%build Rmg for multi point constraints
+Rmg=MpcGrids(grids,constraints);
+
+%generate grid sets and reduce yg to ys from g-set to s-set.
+BuildGridSets(grids,constraints); ys=Reducevector_g(yg);
+	
+Gmn = IceNormalizeconstraints(Rmg);
+
+%recover dof number
+dof=gridset.fsize;
+
+%setup some parameters to be passed to the core solution
+params=SetupParams(md);
+
+m.elements=elements;
+m.grids=grids;
+m.loads=loads;
+m.constraints=constraints;
+m.materials=materials;
+m.part=part;
+m.tpart=tpart;
+m.ys=ys;
+m.gridset=gridset;
+m.dof=dof;
+m.params=params;
+m.Gmn=Gmn;
Index: /issm/trunk/src/m/solutions/ice/DeviatoricStressCompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/DeviatoricStressCompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/DeviatoricStressCompute.m	(revision 1)
@@ -0,0 +1,104 @@
+function deviatoricstress=DeviatoricStressCompute(m,inputs,type);
+%DEVIATORICSTRESSCOMPUTE - compute the deviatoric stress components
+%
+%   Usage:
+%      deviatoricstress=DeviatoricStressCompute(m,inputs,type)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+gridset=m.gridset;
+
+%figure out active elements that will take part in the stiffness and load generation
+[n1,n2]=GetNumberOfActiveElements(elements);
+
+if strcmpi(type,'2d')
+	%initialize vectors
+	deviatoricstress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[]);
+	deviatoricstress1=zeros((n2-n1)+1,3);
+	A1=zeros((n2-n1)+1,1); Vx1=zeros((n2-n1)+1,1); Vy1=zeros((n2-n1)+1,1); 
+	A2=zeros((n2-n1)+1,1); Vx2=zeros((n2-n1)+1,1); Vy2=zeros((n2-n1)+1,1);
+
+	%Go through all elements and call the deviatoricstress routine, then compute eigen values and vector
+	for n=n1:n2,
+		if ~isempty(elements(n).element),
+			deviatoricstressvector=DeviatoricStress(elements(n).element,grids,materials,inputs)';
+
+			deviatoricstressmatrix=[deviatoricstressvector(1) deviatoricstressvector(3)
+					      deviatoricstressvector(3)  deviatoricstressvector(2)]; 
+
+			%eigen values and vectors
+			[directions,value]=eig(deviatoricstressmatrix);
+
+                        %Plug into global vectors
+			deviatoricstress1(n,:)=deviatoricstressvector;
+                        A1(n,1)=value(1,1); A2(n,1)=value(2,2);
+                        Vx1(n,1)=directions(1,1); Vx2(n,1)=directions(1,2);
+                        Vy1(n,1)=directions(2,1); Vy2(n,1)=directions(2,2);
+		end
+	end
+
+	%plug results into outputs
+	%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+	deviatoricstress.xx=deviatoricstress1(:,1);
+	deviatoricstress.yy=deviatoricstress1(:,2);
+	deviatoricstress.xy=deviatoricstress1(:,3);
+	deviatoricstress.principalvalue2=A1;
+	deviatoricstress.principalaxis2=[Vx1 Vy1];
+	deviatoricstress.principalvalue1=A2;
+	deviatoricstress.principalaxis1=[Vx2 Vy2];
+	%norm or effective value
+	deviatoricstress.effectivevalue=1/sqrt(2)*sqrt(deviatoricstress.xx.^2+deviatoricstress.yy.^2+2*deviatoricstress.xy.^2);
+else
+	%initialize vectors
+	deviatoricstress=struct('xx',[],'yy',[],'zz',[],'xy',[],'xz',[],'yz',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'principalvalue3',[],'principalaxis3',[]);
+	deviatoricstress1=zeros((n2-n1)+1,6);
+	A1=zeros((n2-n1)+1,1); Vx1=zeros((n2-n1)+1,1); Vy1=zeros((n2-n1)+1,1); Vz1=zeros((n2-n1)+1,1);
+	A2=zeros((n2-n1)+1,1); Vx2=zeros((n2-n1)+1,1); Vy2=zeros((n2-n1)+1,1); Vz2=zeros((n2-n1)+1,1);
+	A3=zeros((n2-n1)+1,1); Vx3=zeros((n2-n1)+1,1); Vy3=zeros((n2-n1)+1,1); Vz3=zeros((n2-n1)+1,1);
+
+	%Go through all elements and call the deviatoricstress routine, then compute eigen values and vector
+	for n=n1:n2,
+		if ~isempty(elements(n).element),
+			deviatoricstressvector=DeviatoricStress(elements(n).element,grids,materials,inputs)';
+
+			deviatoricstressmatrix=[deviatoricstressvector(1) deviatoricstressvector(4) deviatoricstressvector(5)
+				      deviatoricstressvector(4)  deviatoricstressvector(2)  deviatoricstressvector(6)
+				      deviatoricstressvector(5)  deviatoricstressvector(6)  deviatoricstressvector(3)];
+
+			%eigen values and vectors
+			[directions,value]=eig(deviatoricstressmatrix);
+
+                        %Plug into global vectors
+			deviatoricstress1(n,:)=deviatoricstressvector;
+                        A1(n,1)=value(1,1); A2(n,1)=value(2,2); A3(n,1)=value(3,3);
+                        Vx1(n,1)=directions(1,1); Vx2(n,1)=directions(1,2); Vx3(n,1)=directions(1,3);
+                        Vy1(n,1)=directions(2,1); Vy2(n,1)=directions(2,2); Vy3(n,1)=directions(2,3);
+                        Vz1(n,1)=directions(3,1); Vz2(n,1)=directions(3,2); Vz3(n,1)=directions(3,3);
+		end
+	end
+
+	%plug results into outputs
+	%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+	%components
+	deviatoricstress.xx=deviatoricstress1(:,1);
+	deviatoricstress.yy=deviatoricstress1(:,2);
+	deviatoricstress.zz=deviatoricstress1(:,3);
+	deviatoricstress.xy=deviatoricstress1(:,4);
+	deviatoricstress.xz=deviatoricstress1(:,5);
+	deviatoricstress.yz=deviatoricstress1(:,6);
+	%principal axis
+	deviatoricstress.principalvalue3=A1;
+	deviatoricstress.principalaxis3=[Vx1 Vy1 Vz1];
+	deviatoricstress.principalvalue2=A2;
+	deviatoricstress.principalaxis2=[Vx2 Vy2 Vz2];
+	deviatoricstress.principalvalue1=A3;
+	deviatoricstress.principalaxis1=[Vx3 Vy3 Vz3];
+	%norm or effective value
+	deviatoricstress.effectivevalue=1/sqrt(2)*sqrt(deviatoricstress.xx.^2+deviatoricstress.yy.^2+deviatoricstress.zz.^2+2*deviatoricstress.xy.^2+2*deviatoricstress.xz.^2+2*deviatoricstress.yz.^2);
+end
Index: /issm/trunk/src/m/solutions/ice/DiagnosticSolutionType.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/DiagnosticSolutionType.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/DiagnosticSolutionType.m	(revision 1)
@@ -0,0 +1,15 @@
+function [ishutter,ismacayealpattyn,isstokes]=DiagnosticSolutionType(elements_type)
+%DIAGNOSTICSOLUTIONTYPE - figure out which element are present
+%
+%   This routine goes through the types of element and check if there is any
+%   Hutter, MacAyeal, Pattyn or Stokes element, and return a list of flag
+%
+%   Usage:
+%      [ishutter,ismacayealpattyn,isstokes]=DiagnosticSolutionType(elements_type)
+%
+%   See also: SETELEMENTSTYPE
+
+ishutter=any(elements_type(:,1)==hutterenum());
+ismacayealpattyn=any(elements_type(:,1)==macayealenum() | elements_type(:,1)==pattynenum() );
+isstokes=any(elements_type(:,2));
+
Index: /issm/trunk/src/m/solutions/ice/Dof.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/Dof.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/Dof.m	(revision 1)
@@ -0,0 +1,60 @@
+function grids=Dof(grids)
+%DOF - assign the degrees of freedom to each grid
+%
+%   Establish the degrees of freedom that exist on each grid. For each grid, 
+%   we default to 6 degrees of freedom, 3 in translation and 3 in rotation (Nastran convention)
+%   When running serially, the dofs (degrees of freedom) are setup incrementaly,  6 for each grid. 
+%   In parallel, things are a bit more complex. We want grids belonging to the same partition to 
+%   be side by side in the global system matrices, to improve the sparsity pattern.  We also want 
+%   the border grids, grids that belong to several partitions, to be lumped at the end of the dof list. 
+%
+%   Usage:
+%      grids=Dof(grids)
+
+global cluster
+
+dofcount=length(grids)*6;
+
+if ~cluster,
+	dof=1;
+	for i=1:length(grids),
+		grids(i).grid.doflist=dof:1:(dof+5);
+		dof=dof+6;
+	end
+else
+	borderdof=1;
+	dof=1;
+	for i=1:length(grids),
+		if ~isempty(grids(i).grid),
+			if ~grids(i).grid.border,
+				grids(i).grid.doflist=dof:1:(dof+5);
+				dof=dof+6;
+			else
+				grids(i).grid.doflist=borderdof:1:(borderdof+5);
+				borderdof=borderdof+6;
+			end
+		end
+	end
+	localdofcount=dof-1;
+	localborderdofcount=borderdof-1;
+
+	%Now, offset the border dofs so that they are lumped at the end of the dof list.
+	for i=1:length(grids),
+		if (~isempty(grids(i).grid) & grids(i).grid.border),
+			grids(i).grid.doflist=grids(i).grid.doflist+dofcount-localborderdofcount;
+		end
+	end
+
+	%Now, update the regular local grid dofs to account for other cpu grids.
+	alldofcounts=gcat(localdofcount); %this array holds the dof count for all cpus.
+	
+	%Determine offset for all grid dofs
+	dofoffset=sum(alldofcounts(1:labindex-1));
+	
+	%offset all grid dofs.
+	for i=1:length(grids),
+		if (~isempty(grids(i).grid) & ~grids(i).grid.border),
+			grids(i).grid.doflist=grids(i).grid.doflist+dofoffset;
+		end
+	end
+end
Index: /issm/trunk/src/m/solutions/ice/GetNumberOfActiveElements.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/GetNumberOfActiveElements.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/GetNumberOfActiveElements.m	(revision 1)
@@ -0,0 +1,22 @@
+function [n1,n2]=GetNumberOfActiveElements(elements)
+%GETNUMBEROFACTIVEELEMENTS - get the number of active elements
+%
+%   Go through all elements, and if we find one with special characteristics, 
+%   like the MacAyeal's accelerated element, then we need to updat nel. 
+%
+%   Usage:
+%      [n1,n2]=GetNumberOfActiveElements(elements)
+
+for n=length(elements):-1:1, %start from the end, where we usually put the special elements.
+
+	if strcmp(elements(n).element.type,'acceleratedtriaelem'),
+		%we have an accelerated triaelem, stop the loop, and return  n1 n2
+		n1=n; 
+		n2=n;
+		return;
+	end
+end
+
+%If we are here, no special elements, return n1=1, n2=length(elements)
+n1=1;
+n2=length(elements);
Index: /issm/trunk/src/m/solutions/ice/HorizontalVelocityDepthAverage.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/HorizontalVelocityDepthAverage.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/HorizontalVelocityDepthAverage.m	(revision 1)
@@ -0,0 +1,19 @@
+function velocity_average_g=HorizontalVelocityDepthAverage(md,velocity_g);
+%HORIZONTALVELOCITYDEPTHAVERAGE - compute the depth averaged horizontal velocity
+%
+%   Usage:
+%      velocity_average_g=HorizontalVelocityDepthAverage(md,velocity_g)
+
+global gridset
+
+vx_average2d=DepthAverage(md,velocity_g(1:6:gridset.gsize));
+vy_average2d=DepthAverage(md,velocity_g(2:6:gridset.gsize));
+
+%project onto layer 1 of 3d mesh
+vx_average=project3d(md,vx_average2d,'node',1);
+vy_average=project3d(md,vy_average2d,'node',1);
+
+%output on g-set
+velocity_average_g=zeros(gridset.gsize,1);velocity_average_g(1:6:gridset.gsize)=vx_average;velocity_average_g(2:6:gridset.gsize)=vy_average;
+
+
Index: /issm/trunk/src/m/solutions/ice/IceNormalizeconstraints.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/IceNormalizeconstraints.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/IceNormalizeconstraints.m	(revision 1)
@@ -0,0 +1,20 @@
+function G_mn=NormalizeConstraints(R_mg)
+%NORMALIZECONSTRAINTS - create G_mn
+%
+%   see NastranRgbDoc documentation in theoryguide directory.
+%
+%   Usage:
+%      G_mn=NormalizeConstraints(R_mg)
+
+global gridset
+
+if(gridset.msize>0)
+
+	R_mm = R_mg(:, gridset.pv_m);
+	R_mn = R_mg(:, gridset.pv_n);
+
+	G_mn= - inv(R_mm) * R_mn;
+
+else
+	G_mn= [];
+end
Index: /issm/trunk/src/m/solutions/ice/IcePenaltyConstraints.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/IcePenaltyConstraints.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/IcePenaltyConstraints.m	(revision 1)
@@ -0,0 +1,25 @@
+function [loads,converged]=IcePenaltyConstraints(loads,grids,materials,params,inputs)
+%ICEPENALTYCONSTRAINTS - test if the thermal solution has converged
+%
+%   This routine check if each element have converged in term of penalty activation
+%   once all the penalties remain the same between 2 iterations, return converged=1
+%
+%   Usage:
+%      [loads,converged]=IcePenaltyConstraints(loads,grids,materials,params,inputs)
+
+min_thermal_constraints=params.min_thermal_constraints;
+unstable_count=0;
+
+%Go through constraints and set active flags
+for n=1:length(loads), 
+	[loads(n).load unstable]=PenaltyConstrain(loads(n).load,grids,materials,inputs);
+	unstable_count=unstable_count+unstable;
+end
+
+disp(sprintf('%s %g','      number of unstable melting constraints: ',unstable_count));
+
+if unstable_count<=min_thermal_constraints,
+	converged=1;
+else
+	converged=0;
+end
Index: /issm/trunk/src/m/solutions/ice/IceReducematrix.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/IceReducematrix.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/IceReducematrix.m	(revision 1)
@@ -0,0 +1,22 @@
+function Knn= IceReducematrix( Kgg, Gmn, pv_m,pv_n,msize,flag)
+%ICEREDUCEMATRIX - reduce stiffness matrix from g to n
+%
+%   Usage:
+%      Knn= IceReducematrix( Kgg, Gmn, pv_m,pv_n,msize,flag)
+
+if msize>0,
+	Kmm=Kgg(pv_m,pv_m);
+	Kmn=Kgg(pv_m,pv_n);
+	Knm=Kgg(pv_n,pv_m);
+	Knn=Kgg(pv_n,pv_n);
+
+	Knn= Knn + Knm * Gmn;
+
+	if flag~=1,
+		Kmn = Kmn + Kmm * Gmn;
+		Knn = Knn + Gmn' * Kmn;
+	end
+
+else
+	Knn=Kgg;
+end
Index: /issm/trunk/src/m/solutions/ice/IceReducematrixfromgtof.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/IceReducematrixfromgtof.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/IceReducematrixfromgtof.m	(revision 1)
@@ -0,0 +1,20 @@
+function [Kff Kfs]=IceReducematrixfromgtof(Kgg,Gmn)
+%ICEREDUCEMATRIXFROMGTOF - reduce stiffness matrix from gset to fset
+%
+%   Usage:
+%      [Kff Kfs]=IceReducematrixfromgtof(Kgg,Gmn)
+
+global gridset
+
+%Reduce matrix from g-size to n-size
+Knn= IceReducematrix( Kgg, Gmn, gridset.pv_m, gridset.pv_n, gridset.msize, 2 );
+
+%Reduce matrix from n-size to f-size
+
+if  gridset.ssize>0  
+	Kff= Knn(gridset.pv_f, gridset.pv_f);
+	Kfs= Knn(gridset.pv_f,gridset.pv_s);
+else
+	Kff= Knn;
+	Kfs=[];
+end
Index: /issm/trunk/src/m/solutions/ice/IceReducerightside.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/IceReducerightside.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/IceReducerightside.m	(revision 1)
@@ -0,0 +1,32 @@
+function p_f= IceReducerightside( p_g, G_mn, K_fs, y_s)
+%ICEREDUCERIGHTSIDE - reduce load vector from g to f
+%
+%   Usage:
+%      p_f= IceReducerightside( p_g, G_mn, K_fs, y_s)
+
+global gridset
+	
+% Reduce p_g to p_f 
+% Reduce p_g to p_n
+if ( gridset.msize > 0 )
+	p_n = p_g( gridset.pv_n, :);
+	p_m = p_g( gridset.pv_m, :);
+	p_n = p_n + G_mn' * p_m;
+else
+	p_n  = p_g;
+end
+
+% Reduce p_n to p_f
+if ( gridset.ssize > 0 )
+	p_f = p_n( gridset.pv_f, :);
+else
+	p_f = p_n;
+end
+		
+% for nonzero boundary conditions, subtract coupling forces,
+% this operation is only executed if flag_y_s > 0,
+% the flag is set in the calling script for linear analysis
+% and the first iteration step in nonlinear analysis
+if ~isempty(y_s)
+	p_f = p_f - K_fs * y_s;
+end
Index: /issm/trunk/src/m/solutions/ice/Loadresults.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/Loadresults.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/Loadresults.m	(revision 1)
@@ -0,0 +1,50 @@
+function md=Loadresults(md,fem,u_g);
+%LOADRESULTS - load results onto model
+%
+%   The solution (vel,pressure,...) are on the g-set,
+%   use index to get the value on each node
+%
+%   Usage:
+%      md=Loadresults(md,fem,u_g)
+
+if strcmpi(md.type,'2d')
+	if fem.ismacayealpattyn,
+		m_dh=fem.m_dh;
+		indx=1:6:m_dh.gridset.gsize;
+		indy=2:6:m_dh.gridset.gsize;
+		indp=4:6:m_dh.gridset.gsize;
+		indx=indx(m_dh.tpart);
+		indy=indy(m_dh.tpart);
+		indp=indp(m_dh.tpart);
+	else
+		m_dhu=fem.m_dhu;
+		indx=1:6:m_dhu.gridset.gsize;
+		indy=2:6:m_dhu.gridset.gsize;
+		indp=4:6:m_dhu.gridset.gsize;
+		indx=indx(m_dhu.tpart);
+		indy=indy(m_dhu.tpart);
+		indp=indp(m_dhu.tpart);
+	end
+
+	md.vx=u_g(indx)*md.yts;
+	md.vy=u_g(indy)*md.yts;
+	md.vel=sqrt(md.vx.^2+md.vy.^2);
+	md.pressure=u_g(indp);
+
+else
+	m_dv=fem.m_dv;
+	indx=1:6:m_dv.gridset.gsize;
+	indy=2:6:m_dv.gridset.gsize;
+	indz=3:6:m_dv.gridset.gsize;
+	indp=4:6:m_dv.gridset.gsize;
+	indx=indx(m_dv.tpart);
+	indy=indy(m_dv.tpart);
+	indz=indz(m_dv.tpart);
+	indp=indp(m_dv.tpart);
+
+	md.vx=u_g(indx)*md.yts;
+	md.vy=u_g(indy)*md.yts;
+	md.vz=u_g(indz)*md.yts;
+	md.vel=sqrt(md.vx.^2+md.vy.^2+md.vz.^2);
+	md.pressure=u_g(indp);
+end
Index: /issm/trunk/src/m/solutions/ice/Mergesolution_g.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/Mergesolution_g.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/Mergesolution_g.m	(revision 1)
@@ -0,0 +1,27 @@
+function u_g= Mergesolution_g(u_f,G_mn,y_s);
+%MERGESOLUTION_G - plug spcs in the solution
+%
+%   Usage:
+%      u_g= Mergesolution_g(u_f,G_mn,y_s)
+
+global gridset
+
+
+%	Merge f_set and s_set to n_set
+
+u_n= sparse([],[],[],gridset.nsize,1);
+u_n(gridset.pv_f,:)= u_f;
+
+% Note: we assume u_f and y_s have the same no.of columns
+if ~isempty(y_s)
+	u_n(gridset.pv_s,:)= y_s;
+end
+
+%   Merge n_set and m_set to g_set
+u_g = sparse([],[],[],gridset.gsize,1);
+u_g(gridset.pv_n,:)= u_n;
+
+if (gridset.msize>0)
+	u_m = G_mn * u_n;
+	u_g(gridset.pv_m,:)= u_m;
+end
Index: /issm/trunk/src/m/solutions/ice/ModelProcessor.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessor.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessor.m	(revision 1)
@@ -0,0 +1,35 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessor(md,solutiontype),
+%MODELPROCESSOR - process model for a given solution sequence
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessor(md,solutiontype)
+
+global cluster
+if strcmpi(solutiontype,'diagnostic_horiz'),
+	[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticHoriz(md);
+elseif strcmpi(solutiontype,'diagnostic_vert'),
+	[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticVert(md);
+elseif strcmpi(solutiontype,'diagnostic_hutter'),
+	[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticHutter(md);
+elseif strcmpi(solutiontype,'diagnostic_basevert'),
+	[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticBaseVert(md);
+elseif strcmpi(solutiontype,'thermalsteady')| strcmpi(solutiontype,'thermaltransient'),
+	[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorThermal(md,solutiontype);
+elseif strcmpi(solutiontype,'meltingsteady')| strcmpi(solutiontype,'meltingtransient'),
+	[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorMelting(md,solutiontype);
+elseif strcmpi(solutiontype,'prognostic'),
+	[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorPrognostic(md);
+elseif strcmpi(solutiontype,'diagnostic_stokes'),
+	[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticStokes(md);
+elseif strcmpi(solutiontype,'bed_slope_compute') | strcmpi(solutiontype, 'surface_slope_compute'),
+	[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorSlopeCompute(md,solutiontype);
+
+else 
+	error('ModelProcessor error message: solution type not supported yet');
+end
Index: /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticBaseVert.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticBaseVert.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticBaseVert.m	(revision 1)
@@ -0,0 +1,130 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticBaseVert(md);
+%MODELPROCESSORDIAGNOSTICBASEVERT - process the model for a DiagmosticBaseVert solution
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticBaseVert(md);
+
+global cluster
+
+if cluster,
+	%We are running in parallel, we need to partition the elements 
+	element_partitioning=MeshPartition(md,numlabs);
+else
+	%We are running in serial, all elements belong to the same partition.
+	element_partitioning=ones(md.numberofelements,1);
+	labindex=1; %older versions of matlab do not include the parallel toolbox labindex variable.
+end
+
+%Allocate grids and elements
+elements=struct('element',cell(md.numberofelements,1));
+materials=struct('material',cell(md.numberofelements+1,1));
+mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+
+%Build elements
+if strcmpi(md.type,'2d'),
+	error('ModelProcessorDiagnosticBaseVert error message: 2d mesh not supported yet!');
+end
+
+pos=find(element_partitioning==labindex);
+[elements(pos).element]=deal(pentaelem);
+
+elements(pos)=SetStructureField(elements(pos),'element','type','pentaelem');
+elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(pos,1:6));
+elements(pos)=SetStructureField(elements(pos),'element','h',md.thickness(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','shelf',md.elementoniceshelf(pos));
+elements(pos)=SetStructureField(elements(pos),'element','onbed',md.elementonbed(pos));
+elements(pos)=SetStructureField(elements(pos),'element','onsurface',md.elementonsurface(pos));
+elements(pos)=SetStructureField(elements(pos),'element','acceleration',0);%acceleration 0 since no acceleration is posssible
+elements(pos)=SetStructureField(elements(pos),'element','collapse',1);
+elements(pos)=SetStructureField(elements(pos),'element','matid',pos);
+elements(pos)=SetStructureField(elements(pos),'element','melting',full(md.melting(md.elements(pos,1:6))/md.yts));
+elements(pos)=SetStructureField(elements(pos),'element','accumulation',md.accumulation(md.elements(pos,1:6))/md.yts);
+
+[materials(pos).material]=deal(matice);
+
+materials(pos)=SetStructureField(materials(pos),'material','id',pos);
+
+%Add physical constants in materials
+[materials(end).constants]=deal(matpar);
+materials(end)=SetStructureField(materials(end),'constants','g',md.g);
+materials(end)=SetStructureField(materials(end),'constants','viscosity_overshoot',md.viscosity_overshoot);
+materials(end)=SetStructureField(materials(end),'constants','rho_ice',md.rho_ice);
+materials(end)=SetStructureField(materials(end),'constants','rho_water',md.rho_water);
+materials(end)=SetStructureField(materials(end),'constants','thermalconductivity',md.thermalconductivity);
+materials(end)=SetStructureField(materials(end),'constants','heatcapacity',md.heatcapacity);
+materials(end)=SetStructureField(materials(end),'constants','latentheat',md.latentheat);
+materials(end)=SetStructureField(materials(end),'constants','beta',md.beta);
+materials(end)=SetStructureField(materials(end),'constants','meltingpoint',md.meltingpoint);
+materials(end)=SetStructureField(materials(end),'constants','mixed_layer_capacity',md.mixed_layer_capacity);
+materials(end)=SetStructureField(materials(end),'constants','thermal_exchange_velocity',md.thermal_exchange_velocity);
+
+
+if cluster, 
+	%For elements, the corresponding grids belong to this cpu. Keep track of it. 
+	mygrids(md.elements(el3pos,:))=1;
+	mygrids(md.elements(el6pos,:))=1;
+	
+	%Figure out which grids from the partitioning belong to different element partitions. We'll 
+	%call them 'border' grids.
+	bordergrids=double(gplus(mygrids)>1);
+else
+	bordergrids=zeros(md.numberofgrids,1); %no partitioning serially.
+end
+
+%Get the grids set up:
+grids=struct('grid',cell(md.numberofgrids,1));
+
+pos=[1:md.numberofgrids]';
+[grids(pos).grid]=deal(node);
+grids(pos)=SetStructureField(grids(pos),'grid','id',pos);
+grids(pos)=SetStructureField(grids(pos),'grid','x',md.x(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','y',md.y(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','z',md.z(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','onbed',md.gridonbed(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','border',bordergrids(pos));
+
+%spc degrees of freedom:
+%	 for each grid, 6 degrees of freedom are allowed. These dofs are numbered from 1 to 6. The first 3
+%    deal with the (x,y,z) velocities, or deformations. The last 3 deal with the (x,y,z) rotations.
+%    If a certain degree of freedom i (1<=i<=6) is constrained to the value 0, the number i should be added to the
+%    gridset field of a grid.
+%    The gridset field holds all the numbers corresponding to the dofs that have been constrained to 0 value. Because
+%    we do not know firshand how many dofs have been constrained for a certain grid, we need a flexible way
+%    of keeping track of these constraints. Hence gridset is a string array, of no given size, with no given
+%    numerical order.
+%    Ex: if a grid has 0 values for the x and z deformations, and 0 values for the y rotation, we could add any of the
+%    following strings to the gridset: '135', '153', '315', etc ...
+
+%Here, block all dof for every grid
+grids(pos)=SetStructureField(grids(pos),'grid','gridset','123456');
+
+%for bed elements, free up the 3'rd dof for the first 3 grids 
+for n=1:length(elements),
+	%all dofs associated to this element are frozen, except if the element is on the bed, and acts as a 'fake' pentaelem, 
+	%and a true 'macayeal' tria element.
+	if elements(n).element.onbed,
+		for j=1:3,
+			grids(elements(n).element.g(j)).grid.gridset='12456';
+		end
+	end
+end
+
+%Boundary conditions: no penalties applied here
+loads=struct('load',cell([0,1]));
+
+%Single point constraints: none;
+constraints=struct('constraint',cell(0,0));
+
+%Last thing, return a partitioning vector, and its transpose.
+[part,tpart]=PartitioningVector(md,grids);
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticHoriz.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticHoriz.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticHoriz.m	(revision 1)
@@ -0,0 +1,336 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticHoriz(md);
+%MODELPROCESSORDIAGNOSTICHORIZ - process model for an horizontal diagnostic solution
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticHoriz(md)
+
+global cluster
+
+if cluster,
+	%We are running in parallel, we need to partition the elements 
+	element_partitioning=MeshPartition(md,numlabs);
+else
+	%We are running in serial, all elements belong to the same partition.
+	element_partitioning=ones(md.numberofelements,1);
+	labindex=1; %older versions of matlab do not include the parallel toolbox labindex variable.
+end
+
+%Allocate grids and elements
+if strcmpi(md.type,'2d'),
+	numberofelements_horiz=length(find(md.elements_type(:,1)==macayealenum()));
+else
+	numberofelements_horiz=length(find(md.elements_type(:,1)==macayealenum() | md.elements_type(:,1)==pattynenum()));
+end
+elements=struct('element',cell(numberofelements_horiz,1));
+materials=struct('material',cell(numberofelements_horiz+1,1));
+mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+
+%Deal with 2d elements
+if strcmpi(md.type,'2d'),
+	el3pos=find((md.elements_type(:,1)==macayealenum()) & (element_partitioning==labindex));
+	if ~isempty(el3pos),
+		pos=[1:length(el3pos)]';
+		[elements(pos).element]=deal(triaelem);
+
+		elements(pos)=SetStructureField(elements(pos),'element','type','triaelem');
+		elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+		elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(el3pos,:));
+		elements(pos)=SetStructureField(elements(pos),'element','h',md.thickness(md.elements(el3pos,1:3)));
+		elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(el3pos,1:3)));
+		elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(el3pos,1:3)));
+		elements(pos)=SetStructureField(elements(pos),'element','friction_type',md.drag_type);
+		elements(pos)=SetStructureField(elements(pos),'element','k',md.drag(md.elements(el3pos,1:3)));
+		elements(pos)=SetStructureField(elements(pos),'element','p',md.p(el3pos));
+		elements(pos)=SetStructureField(elements(pos),'element','q',md.q(el3pos));
+		elements(pos)=SetStructureField(elements(pos),'element','shelf',md.elementoniceshelf(el3pos));
+		elements(pos)=SetStructureField(elements(pos),'element','meanvel',md.meanvel);
+		elements(pos)=SetStructureField(elements(pos),'element','epsvel',md.epsvel);
+		elements(pos)=SetStructureField(elements(pos),'element','acceleration',md.acceleration);
+		elements(pos)=SetStructureField(elements(pos),'element','matid',pos);
+
+
+		[materials(pos).material]=deal(matice);
+
+		materials(pos)=SetStructureField(materials(pos),'material','id',pos);
+		materials(pos)=SetStructureField(materials(pos),'material','B',md.B(md.elements(el3pos,1:3))*[1;1;1]/3);
+		materials(pos)=SetStructureField(materials(pos),'material','n',md.n(el3pos));
+	end
+else
+
+	%3d elements
+	%First create penta elements (ie non hutter)
+	el6pos=find((md.elements_type(:,1)==macayealenum() | md.elements_type(:,1)==pattynenum()) & (element_partitioning==labindex));
+
+	if ~isempty(el6pos),
+		pos=[1:length(el6pos)]'; %Renumber the elements
+		[elements(pos).element]=deal(pentaelem);
+
+		elements(pos)=SetStructureField(elements(pos),'element','type','pentaelem');
+		elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+		elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(el6pos,1:6));
+		elements(pos)=SetStructureField(elements(pos),'element','h',md.thickness(md.elements(el6pos,1:6)));
+		elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(el6pos,1:6)));
+		elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(el6pos,1:6)));
+		elements(pos)=SetStructureField(elements(pos),'element','friction_type',md.drag_type);
+		elements(pos)=SetStructureField(elements(pos),'element','k',md.drag(md.elements(el6pos,1:6)));
+		elements(pos)=SetStructureField(elements(pos),'element','p',md.p(el6pos));
+		elements(pos)=SetStructureField(elements(pos),'element','q',md.q(el6pos));
+		elements(pos)=SetStructureField(elements(pos),'element','shelf',md.elementoniceshelf(el6pos));
+		elements(pos)=SetStructureField(elements(pos),'element','onbed',md.elementonbed(el6pos));
+		elements(pos)=SetStructureField(elements(pos),'element','onsurface',md.elementonsurface(el6pos));
+		elements(pos)=SetStructureField(elements(pos),'element','meanvel',md.meanvel);
+		elements(pos)=SetStructureField(elements(pos),'element','epsvel',md.epsvel);
+		elements(pos)=SetStructureField(elements(pos),'element','acceleration',0);%acceleration 0 since no acceleration is posssible
+		elements(pos)=SetStructureField(elements(pos),'element','collapse',0);
+		elements(pos)=SetStructureField(elements(pos),'element','matid',pos);
+
+		[materials(pos).material]=deal(matice);
+
+		materials(pos)=SetStructureField(materials(pos),'material','id',pos);
+		materials(pos)=SetStructureField(materials(pos),'material','B',md.B(md.elements(el6pos,1:6))*[1;1;1;1;1;1]/6);
+		materials(pos)=SetStructureField(materials(pos),'material','n',md.n(el6pos));
+
+		%For penta elements where we want to implement MacAyeal's element, we need to collapse 
+		%the formulation into trias: 
+		pos=find(ismember(el6pos,find(md.elements_type(:,1)==macayealenum())));
+		elements(pos)=SetStructureField(elements(pos),'element','collapse',ones(length(pos),1));
+
+	end
+
+end
+
+
+%Add physical constants in materials
+[materials(end).constants]=deal(matpar);
+materials(end)=SetStructureField(materials(end),'constants','g',md.g);
+materials(end)=SetStructureField(materials(end),'constants','viscosity_overshoot',md.viscosity_overshoot);
+materials(end)=SetStructureField(materials(end),'constants','rho_ice',md.rho_ice);
+materials(end)=SetStructureField(materials(end),'constants','rho_water',md.rho_water);
+materials(end)=SetStructureField(materials(end),'constants','thermalconductivity',md.thermalconductivity);
+materials(end)=SetStructureField(materials(end),'constants','heatcapacity',md.heatcapacity);
+materials(end)=SetStructureField(materials(end),'constants','latentheat',md.latentheat);
+materials(end)=SetStructureField(materials(end),'constants','beta',md.beta);
+materials(end)=SetStructureField(materials(end),'constants','meltingpoint',md.meltingpoint);
+materials(end)=SetStructureField(materials(end),'constants','mixed_layer_capacity',md.mixed_layer_capacity);
+materials(end)=SetStructureField(materials(end),'constants','thermal_exchange_velocity',md.thermal_exchange_velocity);
+
+if cluster, 
+	%For elements, the corresponding grids belong to this cpu. Keep track of it. 
+	mygrids(md.elements(el3pos,:))=1;
+	mygrids(md.elements(el6pos,:))=1;
+end
+
+%Deal with acceleration MacAyeal's element. 
+if md.acceleration & strcmpi(md.type,'2d'), 
+	%build accelerated element.
+	elements(end+1).element=acceleratedtriaelem;
+	elements(end).element.type='acceleratedtriaelem';
+	elements(end).element.x=md.x;
+	elements(end).element.y=md.y;
+	elements(end).element.index=md.elements;
+	elements(end).element.nods=md.numberofgrids;
+	elements(end).element.nel=md.numberofelements;
+	elements(end).element.thickness=md.thickness;
+	elements(end).element.surface=md.surface;
+	elements(end).element.bed=md.bed;
+	elements(end).element.thickness_el=(md.thickness(md.elements))*[1;1;1]/3;
+	elements(end).element.B_bar=(md.B(md.elements))*[1;1;1]/3;
+	elements(end).element.glen_coeff=md.n;
+	elements(end).element.friction_type=md.drag_type;
+	elements(end).element.drag=md.drag;
+	elements(end).element.p=md.p;
+	elements(end).element.q=md.q;
+	elements(end).element.meanvel=md.meanvel;
+	elements(end).element.epsvel=md.epsvel;
+	if isempty(md.segmentonneumann_diag),
+		elements(end).element.index_icefront=[];	
+	else
+		elements(end).element.index_icefront=md.segmentonneumann_diag(:,1:2);
+	end
+	elements(end).element.gridoniceshelf=md.gridoniceshelf;
+	elements(end).element.elementonicesheet=md.elementonicesheet;
+	elements(end).element.matid=1; %point to first matid element.
+end
+
+if cluster, 
+	%Figure out which grids from the partitioning belong to different element partitions. We'll 
+	%call them 'border' grids.
+	bordergrids=double(gplus(mygrids)>1);
+else
+	bordergrids=zeros(md.numberofgrids,1); %no partitioning serially.
+end
+
+%Get the grids set up:
+grids=struct('grid',cell(md.numberofgrids,1));
+
+pos=[1:md.numberofgrids]';
+[grids(pos).grid]=deal(node);
+grids(pos)=SetStructureField(grids(pos),'grid','id',pos);
+grids(pos)=SetStructureField(grids(pos),'grid','x',md.x(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','y',md.y(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','z',md.z(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','onbed',md.gridonbed(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','border',bordergrids(pos));
+
+%spc degrees of freedom:
+%	 for each grid, 6 degrees of freedom are allowed. These dofs are numbered from 1 to 6. The first 3
+%    deal with the (x,y,z) velocities, or deformations. The last 3 deal with the (x,y,z) rotations.
+%    If a certain degree of freedom i (1<=i<=6) is constrained to the value 0, the number i should be added to the
+%    gridset field of a grid.
+%    The gridset field holds all the numbers corresponding to the dofs that have been constrained to 0 value. Because
+%    we do not know firshand how many dofs have been constrained for a certain grid, we need a flexible way
+%    of keeping track of these constraints. Hence gridset is a string array, of no given size, with no given
+%    numerical order.
+%    Ex: if a grid has 0 values for the x and z deformations, and 0 values for the y rotation, we could add any of the
+%    following strings to the gridset: '135', '153', '315', etc ...
+if strcmpi(md.type,'3d')
+	grids(pos)=SetStructureField(grids(pos),'grid','gridset','123456');
+else
+	grids(pos)=SetStructureField(grids(pos),'grid','gridset','3456');
+end
+
+%spc macayeal type grids  in 3d meshes
+if strcmpi(md.type,'3d'),
+	for n=1:length(elements),
+		if md.elements_type(el6pos(n),1)==macayealenum(),
+			%all dofs associated to this element are frozen, except if the element is on the bed, and acts as a 'fake' pentaelem, 
+			%and a true 'macayeal' tria element.
+			if elements(n).element.onbed,
+				for j=1:3,
+					grids(elements(n).element.g(j)).grid.gridset='3456';
+				end
+			end
+		else
+			for j=1:length(elements(n).element.g),
+				grids(elements(n).element.g(j)).grid.gridset='3456';
+			end
+		end
+	end
+end
+
+%Boundary conditions:
+
+%icefront
+loads=struct('load',cell(length(md.segmentonneumann_diag),1));
+
+for i=1:size(md.segmentonneumann_diag,1),
+
+	if (element_partitioning(md.segmentonneumann_diag(i,end))~=labindex), %this load does not belong to this cpu element partition.
+		continue;
+	end
+
+	if strcmpi(md.type,'3d'),
+		if md.elements_type(md.segmentonneumann_diag(i,end))==macayealenum(),
+			loads(i).load=icefront;
+			loads(i).load.eid=find(el6pos==md.segmentonneumann_diag(i,end));
+			loads(i).load.g(1)=md.segmentonneumann_diag(i,1);
+			loads(i).load.g(2)=md.segmentonneumann_diag(i,2);
+			loads(i).load.rho_water=md.rho_water;
+			loads(i).load.type='segment';
+
+		elseif md.elements_type(md.segmentonneumann_diag(i,end))==pattynenum(),
+			%build a quad ice front for the penta element
+			loads(i).load=icefront;
+			loads(i).load.eid=find(el6pos==md.segmentonneumann_diag(i,end));
+			loads(i).load.g(1)=md.segmentonneumann_diag(i,1);
+			loads(i).load.g(2)=md.segmentonneumann_diag(i,2);
+			loads(i).load.g(3)=md.segmentonneumann_diag(i,3);
+			loads(i).load.g(4)=md.segmentonneumann_diag(i,4);
+			loads(i).load.type='quad';
+
+		else
+			if ~(md.elements_type(md.segmentonneumann_diag(i,end))==hutterenum()),
+				error('diagnostic error message: unsupported  element type');
+			end
+		end
+	else
+		if md.elements_type(md.segmentonneumann_diag(i,end))==macayealenum(),
+			loads(i).load=icefront;
+			loads(i).load.eid=find(el3pos==md.segmentonneumann_diag(i,end));
+			loads(i).load.g(1)=md.segmentonneumann_diag(i,1);
+			loads(i).load.g(2)=md.segmentonneumann_diag(i,2);
+			loads(i).load.rho_water=md.rho_water;
+			loads(i).load.type='segment';
+
+		else
+			if ~(md.elements_type(md.segmentonneumann_diag(i,end))==hutterenum()),
+				error('diagnostic error message: unsupported  element type');
+			end
+		end
+	
+	end
+
+end
+
+%Initialize constraints structure
+constraints=struct('constraint',cell(2*length(find(md.gridondirichlet_diag)),1));
+
+count=1;
+for i=1:md.numberofgrids,
+	%deal with spcs
+	if md.gridonhutter(i),
+
+		%constrain first dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=1;
+		constraints(count).constraint.value=0; %this will be change to vx in the solution sequences
+		count=count+1;
+
+		%constrain second dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=2;
+		constraints(count).constraint.value=0; %this will be change to vy in the solution sequences
+		count=count+1;
+
+	elseif (md.gridonmacayeal(i) | md.gridonpattyn(i)) &  md.gridondirichlet_diag(i),
+
+		%constrain first dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=1;
+		constraints(count).constraint.value=md.dirichletvalues_diag(i,1)/md.yts; %in m/s
+		count=count+1;
+
+		%constrain second dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=2;
+		constraints(count).constraint.value=md.dirichletvalues_diag(i,2)/md.yts; %in m/s
+		count=count+1;
+	end
+end
+
+%deal with mpcs
+if ~isempty(md.penalties) & ~isnan(md.penalties),
+	for i=1:size(md.penalties,1),
+		for j=1:(md.numlayers-1),
+
+			%constrain first dof
+			constraints(count).constraint=rgb;
+			constraints(count).constraint.grid1=md.penalties(i,1);
+			constraints(count).constraint.grid2=md.penalties(i,j+1);
+			constraints(count).constraint.dof=1;
+			count=count+1;
+			
+			%constrain second dof
+			constraints(count).constraint=rgb;
+			constraints(count).constraint.grid1=md.penalties(i,1);
+			constraints(count).constraint.grid2=md.penalties(i,j+1);
+			constraints(count).constraint.dof=2;
+			count=count+1;
+		end
+	end
+end
+
+%Last thing, return a partitioning vector, and its transpose.
+[part,tpart]=PartitioningVector(md,grids);
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticHutter.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticHutter.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticHutter.m	(revision 1)
@@ -0,0 +1,178 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticHutter(md);
+%MODELPROCESSORDIAGNOSTICHUTTER - process model for a Hutter diagnostic solution
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticHutter(md);
+
+global cluster
+
+if cluster,
+	%We are running in parallel, we need to partition the elements 
+	element_partitioning=MeshPartition(md,numlabs);
+else
+	%We are running in serial, all elements belong to the same partition.
+	element_partitioning=ones(md.numberofelements,1);
+	labindex=1; %older versions of matlab do not include the parallel toolbox labindex variable.
+end
+
+%Allocate grids and elements
+if strcmpi(md.type,'2d'),
+	pos=find(md.gridonhutter);
+	count=[1:length(pos)]';
+
+	elements=struct('element',cell(length(pos),1));
+	materials=struct('material',cell(length(pos)+1,1));
+	mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+	[elements(count).element]=deal(singelem);
+
+	elements(count)=SetStructureField(elements(count),'element','type','singelem');
+	elements(count)=SetStructureField(elements(count),'element','id',count);
+	elements(count)=SetStructureField(elements(count),'element','g',pos);
+	elements(count)=SetStructureField(elements(count),'element','h',md.thickness(pos));
+	elements(count)=SetStructureField(elements(count),'element','k',md.drag(pos));
+	elements(count)=SetStructureField(elements(count),'element','matid',count);
+
+	[materials(count).material]=deal(matice);
+	materials(count)=SetStructureField(materials(count),'material','id',count);
+	materials(count)=SetStructureField(materials(count),'material','B',md.B(pos));
+	materials(count)=SetStructureField(materials(count),'material','n',3); %TO BE CHANGED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+else
+	pos=find(1-md.gridonsurface);
+	grids_el=[pos md.uppergrids(pos)];
+	count=1:length(pos);
+
+	elements=struct('element',cell(length(pos),1));
+	materials=struct('material',cell(length(pos)+1,1));
+	mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+	[elements(count).element]=deal(beamelem);
+
+	elements(count)=SetStructureField(elements(count),'element','type','beamelem');
+	elements(count)=SetStructureField(elements(count),'element','id',count');
+	elements(count)=SetStructureField(elements(count),'element','g',grids_el(count,1:2));
+	elements(count)=SetStructureField(elements(count),'element','h',md.thickness(grids_el));
+	elements(count)=SetStructureField(elements(count),'element','s',md.surface(grids_el));
+	elements(count)=SetStructureField(elements(count),'element','b',md.bed(grids_el));
+	elements(count)=SetStructureField(elements(count),'element','k',md.drag(grids_el));
+	elements(count)=SetStructureField(elements(count),'element','onbed',md.gridonbed(grids_el(:,1)));
+	elements(count)=SetStructureField(elements(count),'element','onsurface',md.gridonsurface(grids_el(:,2)));
+	elements(count)=SetStructureField(elements(count),'element','matid',count');
+
+	[materials(count).material]=deal(matice);
+	materials(count)=SetStructureField(materials(count),'material','id',count');
+	materials(count)=SetStructureField(materials(count),'material','B',md.B(grids_el)*[1;1]/2);
+	materials(count)=SetStructureField(materials(count),'material','n',3); %TO BE CHANGED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+end
+
+%Add physical constants in materials
+[materials(end).constants]=deal(matpar);
+materials(end)=SetStructureField(materials(end),'constants','g',md.g);
+materials(end)=SetStructureField(materials(end),'constants','rho_ice',md.rho_ice);
+materials(end)=SetStructureField(materials(end),'constants','beta',md.beta);
+materials(end)=SetStructureField(materials(end),'constants','meltingpoint',md.meltingpoint);
+
+if cluster, 
+	%For elements, the corresponding grids belong to this cpu. Keep track of it. 
+	mygrids(md.elements(el3pos,:))=1;
+	mygrids(md.elements(el6pos,:))=1;
+end
+
+if cluster, 
+	%Figure out which grids from the partitioning belong to different element partitions. We'll 
+	%call them 'border' grids.
+	bordergrids=double(gplus(mygrids)>1);
+else
+	bordergrids=zeros(md.numberofgrids,1); %no partitioning serially.
+end
+
+%Get the grids set up:
+grids=struct('grid',cell(md.numberofgrids,1));
+
+pos=[1:md.numberofgrids]';
+[grids(pos).grid]=deal(node);
+grids(pos)=SetStructureField(grids(pos),'grid','id',pos);
+grids(pos)=SetStructureField(grids(pos),'grid','x',md.x(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','y',md.y(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','z',md.z(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','onbed',md.gridonbed(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','border',bordergrids(pos));
+
+%spc degrees of freedom:
+%	 for each grid, 6 degrees of freedom are allowed. These dofs are numbered from 1 to 6. The first 3
+%    deal with the (x,y,z) velocities, or deformations. The last 3 deal with the (x,y,z) rotations.
+%    If a certain degree of freedom i (1<=i<=6) is constrained to the value 0, the number i should be added to the
+%    gridset field of a grid.
+%    The gridset field holds all the numbers corresponding to the dofs that have been constrained to 0 value. Because
+%    we do not know firshand how many dofs have been constrained for a certain grid, we need a flexible way
+%    of keeping track of these constraints. Hence gridset is a string array, of no given size, with no given
+%    numerical order.
+%    Ex: if a grid has 0 values for the x and z deformations, and 0 values for the y rotation, we could add any of the
+%    following strings to the gridset: '135', '153', '315', etc ...
+grids(pos)=SetStructureField(grids(pos),'grid','gridset','3456');
+
+%Boundary conditions:
+
+loads=struct('load',cell(0,0));
+
+%deal with mpcs for 2d-3d mesh transitions
+if strcmpi(md.type,'3d'),
+	if ~isempty(md.penalties) & ~isnan(md.penalties),
+		for i=1:size(md.penalties,1),
+			for j=1:(md.numlayers-1),
+
+				%constrain first dof
+				constraints(count).constraint=rgb;
+				constraints(count).constraint.grid1=md.penalties(i,1);
+				constraints(count).constraint.grid2=md.penalties(i,j+1);
+				constraints(count).constraint.dof=1;
+				count=count+1;
+				
+				%constrain second dof
+				constraints(count).constraint=rgb;
+				constraints(count).constraint.grid1=md.penalties(i,1);
+				constraints(count).constraint.grid2=md.penalties(i,j+1);
+				constraints(count).constraint.dof=2;
+				count=count+1;
+			end
+		end
+	end
+end
+
+
+%Single point constraints:
+spcs=find(~md.gridonhutter);
+constraints=struct('constraint',cell(2*length(spcs),1));
+
+count=1;
+for i=1:md.numberofgrids,
+	if ~md.gridonhutter(i),
+
+		%constrain first dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=1;
+		constraints(count).constraint.value=0; %this will be change to vx in the solution sequences
+		count=count+1;
+
+		%constrain second dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=2;
+		constraints(count).constraint.value=0; %this will be change to vy in the solution sequences
+		count=count+1;
+
+	end
+
+end
+
+
+%Last thing, return a partitioning vector, and its transpose.
+[part,tpart]=PartitioningVector(md,grids);
+end %end function
Index: /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticStokes.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticStokes.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticStokes.m	(revision 1)
@@ -0,0 +1,208 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticHoriz(md);
+%MODELPROCESSORDIAGNOSTICHORIZ - process model for an horizontal diagnostic solution
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticHoriz(md)
+
+global cluster
+
+if cluster,
+	%We are running in parallel, we need to partition the elements 
+	element_partitioning=MeshPartition(md,numlabs);
+else
+	%We are running in serial, all elements belong to the same partition.
+	element_partitioning=ones(md.numberofelements,1);
+	labindex=1; %older versions of matlab do not include the parallel toolbox labindex variable.
+end
+
+%Allocate grids and elements
+numberofstokeselements=size(find(md.elements_type(:,2)==stokesenum()),1);
+elements=struct('element',cell(numberofstokeselements,1));
+materials=struct('material',cell(numberofstokeselements+1,1));
+mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+
+%3d elements
+%pos=find(element_partitioning==labindex);
+pos=find(md.elements_type(:,2)==stokesenum());
+stokesnewnumber=[1:numberofstokeselements]';
+[elements(stokesnewnumber).element]=deal(pentaelem);
+
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','type','pentaelem');
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','id',stokesnewnumber);
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','g',md.elements(pos,1:6));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','h',md.thickness(md.elements(pos,1:6)));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','s',md.surface(md.elements(pos,1:6)));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','b',md.bed(md.elements(pos,1:6)));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','friction_type',md.drag_type);
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','k',md.drag(md.elements(pos,1:6)));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','p',md.p(pos));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','q',md.q(pos));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','shelf',md.elementoniceshelf(pos));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','onbed',md.elementonbed(pos));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','onsurface',md.elementonsurface(pos));
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','meanvel',md.meanvel);
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','epsvel',md.epsvel);
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','acceleration',0);%acceleration 0 since no acceleration is posssible
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','collapse',0);
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','matid',stokesnewnumber);
+elements(stokesnewnumber)=SetStructureField(elements(stokesnewnumber),'element','reconditioning_number',md.stokesreconditioning);
+
+[materials(stokesnewnumber).material]=deal(matice);
+
+materials(stokesnewnumber)=SetStructureField(materials(stokesnewnumber),'material','id',stokesnewnumber);
+materials(stokesnewnumber)=SetStructureField(materials(stokesnewnumber),'material','B',md.B(md.elements(pos,1:6))*[1;1;1;1;1;1]/6);
+materials(stokesnewnumber)=SetStructureField(materials(stokesnewnumber),'material','n',md.n(pos));
+
+
+%Add physical constants in materials
+[materials(end).constants]=deal(matpar);
+materials(end)=SetStructureField(materials(end),'constants','g',md.g);
+materials(end)=SetStructureField(materials(end),'constants','viscosity_overshoot',md.viscosity_overshoot);
+materials(end)=SetStructureField(materials(end),'constants','rho_ice',md.rho_ice);
+materials(end)=SetStructureField(materials(end),'constants','rho_water',md.rho_water);
+materials(end)=SetStructureField(materials(end),'constants','thermalconductivity',md.thermalconductivity);
+materials(end)=SetStructureField(materials(end),'constants','heatcapacity',md.heatcapacity);
+materials(end)=SetStructureField(materials(end),'constants','latentheat',md.latentheat);
+materials(end)=SetStructureField(materials(end),'constants','beta',md.beta);
+materials(end)=SetStructureField(materials(end),'constants','meltingpoint',md.meltingpoint);
+materials(end)=SetStructureField(materials(end),'constants','mixed_layer_capacity',md.mixed_layer_capacity);
+materials(end)=SetStructureField(materials(end),'constants','thermal_exchange_velocity',md.thermal_exchange_velocity);
+
+
+if cluster, 
+	%For elements, the corresponding grids belong to this cpu. Keep track of it. 
+	mygrids(md.elements(pos,:))=1;
+end
+
+if cluster, 
+	%Figure out which grids from the partitioning belong to different element partitions. We'll 
+	%call them 'border' grids.
+	bordergrids=double(gplus(mygrids)>1);
+else
+	bordergrids=zeros(md.numberofgrids,1); %no partitioning serially.
+end
+
+%Get the grids set up:
+grids=struct('grid',cell(md.numberofgrids,1));
+
+pos=[1:md.numberofgrids]';
+[grids(pos).grid]=deal(node);
+grids(pos)=SetStructureField(grids(pos),'grid','id',pos);
+grids(pos)=SetStructureField(grids(pos),'grid','x',md.x(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','y',md.y(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','z',md.z(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','onbed',md.gridonbed(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','border',bordergrids(pos));
+
+%spc degrees of freedom:
+%	 for each grid, 6 degrees of freedom are allowed. These dofs are numbered from 1 to 6. The first 3
+%    deal with the (x,y,z) velocities, or deformations. The last 3 deal with the (x,y,z) rotations.
+%    If a certain degree of freedom i (1<=i<=6) is constrained to the value 0, the number i should be added to the
+%    gridset field of a grid.
+%    The gridset field holds all the numbers corresponding to the dofs that have been constrained to 0 value. Because
+%    we do not know firshand how many dofs have been constrained for a certain grid, we need a flexible way
+%    of keeping track of these constraints. Hence gridset is a string array, of no given size, with no given
+%    numerical order.
+%    Ex: if a grid has 0 values for the x and z deformations, and 0 values for the y rotation, we could add any of the
+%    following strings to the gridset: '135', '153', '315', etc ...
+grids(pos)=SetStructureField(grids(pos),'grid','gridset','56');
+
+%Build grids on the border of stokes
+%Get border grids
+stokes_elements=find(md.elements_type(:,2)==stokesenum()); %find the elements on the stokes domain
+borderflags=zeros(md.numberofgrids,1); 
+borderflags(md.elements(stokes_elements,:))=1; %find all the grids of the elements on stokes domain, ie stokes grids and borderstokes
+borderstokes=borderflags-md.gridonstokes; %remove stokes grids from this list
+
+%spc the non stokes grids to 0 for all the dof
+for n=1:md.numberofgrids,
+	if md.gridonstokes(n)==0, %the grids does not belong to the stokes part of the mesh
+		grids(n).grid.gridset='123456'; %the six dofs are frozen
+	end
+	if borderstokes(n),
+		grids(n).grid.gridset='12356';
+	end
+end
+
+%Boundary conditions:
+
+%icefront
+segmentonneumann_diag_stokes=md.segmentonneumann_diag(find(md.elements_type(md.segmentonneumann_diag(:,end),2)),:);
+length_segmentonneumann_diag_stokes= size(segmentonneumann_diag_stokes,1);
+loads=struct('load',cell(length_segmentonneumann_diag_stokes,1));
+
+for i=1:length_segmentonneumann_diag_stokes,
+
+	if (element_partitioning(segmentonneumann_diag_stokes(i,end))~=labindex), %this load does not belong to this cpu element partition.
+		continue;
+	end
+	
+	%build a quad ice front for the penta element
+	loads(i).load=icefront;
+	loads(i).load.eid=find(segmentonneumann_diag_stokes(i,end)==find(md.elements_type(:,2)==stokesenum())); %elements contain only stokes elements, so we have to renumbered
+	loads(i).load.g(1)=segmentonneumann_diag_stokes(i,1);
+	loads(i).load.g(2)=segmentonneumann_diag_stokes(i,2);
+	loads(i).load.g(3)=segmentonneumann_diag_stokes(i,3);
+	loads(i).load.g(4)=segmentonneumann_diag_stokes(i,4);
+	loads(i).load.rho_water=md.rho_water;
+	loads(i).load.type='quad';
+end
+
+%create penalties for grids on the base of icesheet. We must have wb=ub*db/dx+vb*db/dy
+count=length(loads)+1;
+for i=1:md.numberofgrids,
+	if grids(i).grid.onbed & md.gridonicesheet(i)  & md.gridonstokes(i),
+		pengridobject=pengrid;
+		pengridobject.id=count;
+		pengridobject.dof=1;
+		pengridobject.grid=i;
+		pengridobject.penalty_offset=md.penalty_offset;
+
+		loads(count).load=pengridobject;
+		count=count+1;
+	end
+end
+
+%Single point constraints:
+spcs=find(md.gridondirichlet_diag);
+constraints=struct('constraint',cell(3*length(spcs),1));
+
+count=1;
+for i=1:md.numberofgrids,
+	if ~md.gridonstokes(i),
+
+		%constrain first dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=1;
+		constraints(count).constraint.value=0; %this will be change to vx in the solution sequences
+		count=count+1;
+
+		%constrain second dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=2;
+		constraints(count).constraint.value=0; %this will be change to vy in the solution sequences
+		count=count+1;
+
+		%constrain third dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=3;
+		constraints(count).constraint.value=0; %this will be change to vz in the solution sequences
+		count=count+1;
+	end
+end
+
+
+%Last thing, return a partitioning vector, and its transpose.
+[part,tpart]=PartitioningVector(md,grids);
+
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticVert.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticVert.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticVert.m	(revision 1)
@@ -0,0 +1,131 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticVert(md);
+%MODELPROCESSORDIAGNOSTICVERT - process model for a vertical diagnostic solution
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorDiagnosticVert(md);
+
+global cluster
+
+if cluster,
+	%We are running in parallel, we need to partition the elements 
+	element_partitioning=MeshPartition(md,numlabs);
+else
+	%We are running in serial, all elements belong to the same partition.
+	element_partitioning=ones(md.numberofelements,1);
+	labindex=1; %older versions of matlab do not include the parallel toolbox labindex variable.
+end
+
+%Allocate grids and elements
+elements=struct('element',cell(md.numberofelements,1));
+materials=struct('material',cell(md.numberofelements+1,1));
+mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+
+%3d elements
+pos=find(element_partitioning==labindex);
+[elements(pos).element]=deal(pentaelem);
+
+elements(pos)=SetStructureField(elements(pos),'element','type','pentaelem');
+elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(pos,1:6));
+elements(pos)=SetStructureField(elements(pos),'element','h',md.thickness(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','friction_type',md.drag_type);
+elements(pos)=SetStructureField(elements(pos),'element','k',md.drag(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','p',md.p(pos));
+elements(pos)=SetStructureField(elements(pos),'element','q',md.q(pos));
+elements(pos)=SetStructureField(elements(pos),'element','shelf',md.elementoniceshelf(pos));
+elements(pos)=SetStructureField(elements(pos),'element','onbed',md.elementonbed(pos));
+elements(pos)=SetStructureField(elements(pos),'element','onsurface',md.elementonsurface(pos));
+elements(pos)=SetStructureField(elements(pos),'element','meanvel',md.meanvel);
+elements(pos)=SetStructureField(elements(pos),'element','epsvel',md.epsvel);
+elements(pos)=SetStructureField(elements(pos),'element','acceleration',0);%acceleration 0 since no acceleration is posssible
+elements(pos)=SetStructureField(elements(pos),'element','collapse',0);
+elements(pos)=SetStructureField(elements(pos),'element','matid',pos);
+elements(pos)=SetStructureField(elements(pos),'element','collapse',zeros(length(pos),1)); %no collapsed formulation
+
+[materials(pos).material]=deal(matice);
+
+materials(pos)=SetStructureField(materials(pos),'material','id',pos);
+materials(pos)=SetStructureField(materials(pos),'material','B',md.B(md.elements(pos,1:6))*[1;1;1;1;1;1]/6);
+materials(pos)=SetStructureField(materials(pos),'material','n',md.n(pos));
+
+%Add physical constants in materials
+[materials(end).constants]=deal(matpar);
+materials(end)=SetStructureField(materials(end),'constants','g',md.g);
+materials(end)=SetStructureField(materials(end),'constants','viscosity_overshoot',md.viscosity_overshoot);
+materials(end)=SetStructureField(materials(end),'constants','rho_ice',md.rho_ice);
+materials(end)=SetStructureField(materials(end),'constants','rho_water',md.rho_water);
+materials(end)=SetStructureField(materials(end),'constants','thermalconductivity',md.thermalconductivity);
+materials(end)=SetStructureField(materials(end),'constants','heatcapacity',md.heatcapacity);
+materials(end)=SetStructureField(materials(end),'constants','latentheat',md.latentheat);
+materials(end)=SetStructureField(materials(end),'constants','beta',md.beta);
+materials(end)=SetStructureField(materials(end),'constants','meltingpoint',md.meltingpoint);
+materials(end)=SetStructureField(materials(end),'constants','mixed_layer_capacity',md.mixed_layer_capacity);
+materials(end)=SetStructureField(materials(end),'constants','thermal_exchange_velocity',md.thermal_exchange_velocity);
+
+if cluster, 
+	%Figure out which grids from the partitioning belong to different element partitions. We'll 
+	%call them 'border' grids.
+	bordergrids=double(gplus(mygrids)>1);
+else
+	bordergrids=zeros(md.numberofgrids,1); %no partitioning serially.
+end
+
+%Get the grids set up:
+grids=struct('grid',cell(md.numberofgrids,1));
+
+pos=[1:md.numberofgrids]';
+[grids(pos).grid]=deal(node);
+grids(pos)=SetStructureField(grids(pos),'grid','id',pos);
+grids(pos)=SetStructureField(grids(pos),'grid','x',md.x(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','y',md.y(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','z',md.z(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','onbed',md.gridonbed(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','border',bordergrids(pos));
+
+%spc degrees of freedom:
+%	 for each grid, 6 degrees of freedom are allowed. These dofs are numbered from 1 to 6. The first 3
+%    deal with the (x,y,z) velocities, or deformations. The last 3 deal with the (x,y,z) rotations.
+%    If a certain degree of freedom i (1<=i<=6) is constrained to the value 0, the number i should be added to the
+%    gridset field of a grid.
+%    The gridset field holds all the numbers corresponding to the dofs that have been constrained to 0 value. Because
+%    we do not know firshand how many dofs have been constrained for a certain grid, we need a flexible way
+%    of keeping track of these constraints. Hence gridset is a string array, of no given size, with no given
+%    numerical order.
+%    Ex: if a grid has 0 values for the x and z deformations, and 0 values for the y rotation, we could add any of the
+%    following strings to the gridset: '135', '153', '315', etc ...
+grids(pos)=SetStructureField(grids(pos),'grid','gridset','12456');
+
+%Boundary conditions:
+
+%penalties: not applied here
+loads=struct('load',cell([0,1]));
+
+%Single point constraints:
+spcs=find(md.gridonbed);
+constraints=struct('constraint',cell(length(spcs),1));
+
+count=1;
+for i=1:md.numberofgrids,
+	if md.gridonbed(i),
+
+		%constrain first dof
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=3;
+		constraints(count).constraint.value=0; %this will be change to vz in the solution sequences.
+		count=count+1;
+	end
+end
+
+%Last thing, return a partitioning vector, and its transpose.
+[part,tpart]=PartitioningVector(md,grids);
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/ModelProcessorMelting.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessorMelting.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessorMelting.m	(revision 1)
@@ -0,0 +1,145 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorMelting(md,solutiontype);
+%MODELPROCESSORMELTING - process model for a melting solution
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorMelting(md,solutiontype)
+
+global cluster
+
+if cluster,
+	%We are running in parallel, we need to partition the elements 
+	element_partitioning=MeshPartition(md,numlabs);
+else
+	%We are running in serial, all elements belong to the same partition.
+	element_partitioning=ones(md.numberofelements,1);
+	labindex=1; %older versions of matlab do not include the parallel toolbox labindex variable.
+end
+
+%Allocate grids and elements
+elements=struct('element',cell(md.numberofelements,1));
+materials=struct('material',cell(md.numberofelements+1,1));
+mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+
+%Build elements
+if strcmpi(md.type,'2d'),
+	error('ModelProcessorDiagnosticBaseVert error message: 2d mesh not supported yet!');
+end
+
+pos=find(element_partitioning==labindex);
+[elements(pos).element]=deal(pentaelem);
+
+elements(pos)=SetStructureField(elements(pos),'element','type','pentaelem');
+elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(pos,1:6));
+elements(pos)=SetStructureField(elements(pos),'element','h',md.thickness(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','shelf',md.elementoniceshelf(pos));
+elements(pos)=SetStructureField(elements(pos),'element','onbed',md.elementonbed(pos));
+elements(pos)=SetStructureField(elements(pos),'element','onsurface',md.elementonsurface(pos));
+elements(pos)=SetStructureField(elements(pos),'element','acceleration',0);%acceleration 0 since no acceleration is posssible
+elements(pos)=SetStructureField(elements(pos),'element','collapse',1);
+elements(pos)=SetStructureField(elements(pos),'element','matid',pos);
+elements(pos)=SetStructureField(elements(pos),'element','melting',md.melting(md.elements(pos,1:6))/md.yts);
+elements(pos)=SetStructureField(elements(pos),'element','accumulation',md.accumulation(md.elements(pos,1:6))/md.yts);
+
+[materials(pos).material]=deal(matice);
+materials(pos)=SetStructureField(materials(pos),'material','id',pos);
+
+%Add physical constants in materials
+[materials(end).constants]=deal(matpar);
+materials(end)=SetStructureField(materials(end),'constants','g',md.g);
+materials(end)=SetStructureField(materials(end),'constants','rho_ice',md.rho_ice);
+materials(end)=SetStructureField(materials(end),'constants','rho_water',md.rho_water);
+materials(end)=SetStructureField(materials(end),'constants','thermalconductivity',md.thermalconductivity);
+materials(end)=SetStructureField(materials(end),'constants','heatcapacity',md.heatcapacity);
+materials(end)=SetStructureField(materials(end),'constants','latentheat',md.latentheat);
+materials(end)=SetStructureField(materials(end),'constants','beta',md.beta);
+materials(end)=SetStructureField(materials(end),'constants','meltingpoint',md.meltingpoint);
+materials(end)=SetStructureField(materials(end),'constants','mixed_layer_capacity',md.mixed_layer_capacity);
+materials(end)=SetStructureField(materials(end),'constants','thermal_exchange_velocity',md.thermal_exchange_velocity);
+
+if cluster, 
+	%For elements, the corresponding grids belong to this cpu. Keep track of it. 
+	mygrids(md.elements(el3pos,:))=1;
+	mygrids(md.elements(el6pos,:))=1;
+	
+	%Figure out which grids from the partitioning belong to different element partitions. We'll 
+	%call them 'border' grids.
+	bordergrids=double(gplus(mygrids)>1);
+else
+	bordergrids=zeros(md.numberofgrids,1); %no partitioning serially.
+end
+
+%Get the grids set up:
+grids=struct('grid',cell(md.numberofgrids,1));
+
+pos=[1:md.numberofgrids]';
+[grids(pos).grid]=deal(node);
+grids(pos)=SetStructureField(grids(pos),'grid','id',pos);
+grids(pos)=SetStructureField(grids(pos),'grid','x',md.x(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','y',md.y(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','z',md.z(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','onbed',md.gridonbed(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','border',bordergrids(pos));
+
+%spc degrees of freedom:
+%	 for each grid, 6 degrees of freedom are allowed. These dofs are numbered from 1 to 6. The first 3
+%    deal with the (x,y,z) velocities, or deformations. The last 3 deal with the (x,y,z) rotations.
+%    If a certain degree of freedom i (1<=i<=6) is constrained to the value 0, the number i should be added to the
+%    gridset field of a grid.
+%    The gridset field holds all the numbers corresponding to the dofs that have been constrained to 0 value. Because
+%    we do not know firshand how many dofs have been constrained for a certain grid, we need a flexible way
+%    of keeping track of these constraints. Hence gridset is a string array, of no given size, with no given
+%    numerical order.
+%    Ex: if a grid has 0 values for the x and z deformations, and 0 values for the y rotation, we could add any of the
+%    following strings to the gridset: '135', '153', '315', etc ...
+grids(pos)=SetStructureField(grids(pos),'grid','gridset','123456');
+
+%for bed elements, free up the 3'rd dof for the first 3 grids 
+for n=1:length(elements),
+	%all dofs associated to this element are frozen, except if the element is on the bed, and acts as a 'fake' pentaelem, 
+	%and a true 'macayeal' tria element.
+	if elements(n).element.onbed,
+		for j=1:3,
+			grids(elements(n).element.g(j)).grid.gridset='23456';
+		end
+	end
+end
+
+loads=struct('load',cell([0,1]));
+
+%create melting  penalties for every grid. The right hand side is computed using penalties
+count=1;
+for i=1:md.numberofgrids,
+	if grids(i).grid.onbed,
+		pengridobject=pengrid;
+		pengridobject.id=count;
+		pengridobject.dof=1;
+		pengridobject.grid=i;
+		if strcmpi(solutiontype,'meltingsteady'),
+			pengridobject.thermal_steadystate=1;
+		else
+			pengridobject.thermal_steadystate=0;
+		end
+		pengridobject.penalty_offset=md.penalty_offset;
+
+		loads(count).load=pengridobject;
+		count=count+1;
+	end
+end
+
+
+%Single point constraints: none;
+constraints=struct('constraint',cell(0,0));
+
+%Last thing, return a partitioning vector, and its transpose.
+[part,tpart]=PartitioningVector(md,grids);
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/ModelProcessorPrognostic.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessorPrognostic.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessorPrognostic.m	(revision 1)
@@ -0,0 +1,124 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorPrognostic(md);
+%MODELPROCESSORPROGNOSTIC - process model for a prognostic solution
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorPrognostic(md)
+
+global cluster
+
+if cluster,
+	%We are running in parallel, we need to partition the elements 
+	element_partitioning=MeshPartition(md,numlabs);
+else
+	%We are running in serial, all elements belong to the same partition.
+	element_partitioning=ones(md.numberofelements,1);
+	labindex=1; %older versions of matlab do not include the parallel toolbox labindex variable.
+end
+
+%Allocate grids and elements
+elements=struct('element',cell(md.numberofelements,1));
+materials=struct('material',cell(0,0));
+mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+
+%Build elements
+if strcmpi(md.type,'2d'),
+	pos=find(element_partitioning==labindex);
+	[elements(pos).element]=deal(triaelem);
+
+	elements(pos)=SetStructureField(elements(pos),'element','type','triaelem');
+	elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+	elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(pos,:));
+	elements(pos)=SetStructureField(elements(pos),'element','h',md.thickness(md.elements(pos,1:3)));
+	elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(pos,1:3)));
+	elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(pos,1:3)));
+	elements(pos)=SetStructureField(elements(pos),'element','shelf',md.elementoniceshelf(pos));
+	elements(pos)=SetStructureField(elements(pos),'element','artificial_diffusivity',md.artificial_diffusivity);
+
+else
+	pos=find(element_partitioning==labindex);
+	[elements(pos).element]=deal(pentaelem);
+
+	elements(pos)=SetStructureField(elements(pos),'element','type','pentaelem');
+	elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+	elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(pos,1:6));
+	elements(pos)=SetStructureField(elements(pos),'element','h',md.thickness(md.elements(pos,1:6)));
+	elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(pos,1:6)));
+	elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(pos,1:6)));
+	elements(pos)=SetStructureField(elements(pos),'element','shelf',md.elementoniceshelf(pos));
+	elements(pos)=SetStructureField(elements(pos),'element','onbed',md.elementonbed(pos));
+	elements(pos)=SetStructureField(elements(pos),'element','onsurface',md.elementonsurface(pos));
+	elements(pos)=SetStructureField(elements(pos),'element','collapse',1);
+	elements(pos)=SetStructureField(elements(pos),'element','artificial_diffusivity',md.artificial_diffusivity);
+end
+
+if cluster, 
+	%For elements, the corresponding grids belong to this cpu. Keep track of it. 
+	mygrids(md.elements(el3pos,:))=1;
+	mygrids(md.elements(el6pos,:))=1;
+	
+	%Figure out which grids from the partitioning belong to different element partitions. We'll 
+	%call them 'border' grids.
+	bordergrids=double(gplus(mygrids)>1);
+else
+	bordergrids=zeros(md.numberofgrids,1); %no partitioning serially.
+end
+
+%Get the grids set up:
+grids=struct('grid',cell(md.numberofgrids,1));
+
+pos=[1:md.numberofgrids]';
+[grids(pos).grid]=deal(node);
+grids(pos)=SetStructureField(grids(pos),'grid','id',pos);
+grids(pos)=SetStructureField(grids(pos),'grid','x',md.x(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','y',md.y(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','z',md.z(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','onbed',md.gridonbed(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','border',bordergrids(pos));
+
+%spc degrees of freedom:
+%	 for each grid, 6 degrees of freedom are allowed. These dofs are numbered from 1 to 6. The first 3
+%    deal with the (x,y,z) velocities, or deformations. The last 3 deal with the (x,y,z) rotations.
+%    If a certain degree of freedom i (1<=i<=6) is constrained to the value 0, the number i should be added to the
+%    gridset field of a grid.
+%    The gridset field holds all the numbers corresponding to the dofs that have been constrained to 0 value. Because
+%    we do not know firshand how many dofs have been constrained for a certain grid, we need a flexible way
+%    of keeping track of these constraints. Hence gridset is a string array, of no given size, with no given
+%    numerical order.
+%    Ex: if a grid has 0 values for the x and z deformations, and 0 values for the y rotation, we could add any of the
+%    following strings to the gridset: '135', '153', '315', etc ...
+if strcmpi(md.type,'3d')
+		%Here, block all dof for every grid
+	grids(pos)=SetStructureField(grids(pos),'grid','gridset','123456');
+else
+	grids(pos)=SetStructureField(grids(pos),'grid','gridset','23456');
+end
+
+if strcmpi(md.type,'3d'),
+	%for bed elements, free up the 1'st dof for the first 3 grids 
+	for n=1:length(elements),
+		%all dofs associated to this element are frozen, except if the element is on the bed, and acts as a 'fake' pentaelem, 
+		%and a true 'macayeal' tria element.
+		if elements(n).element.onbed,
+			for j=1:3,
+				grids(elements(n).element.g(j)).grid.gridset='23456';
+			end
+		end
+	end
+end
+
+%Boundary conditions: penalties between two 3d meshes
+loads=struct('load',cell([0,1]));
+
+%Single point constraints: none;
+constraints=struct('constraint',cell(0,0));
+
+%Last thing, return a partitioning vector, and its transpose.
+[part,tpart]=PartitioningVector(md,grids);
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/ModelProcessorSlopeCompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessorSlopeCompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessorSlopeCompute.m	(revision 1)
@@ -0,0 +1,134 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorSlopeCompute(md,solutiontype);
+%MODELPROCESSORSLOPECOMPUTE - process model for a slope finite element computation
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorSlopeCompute(md,solutiontype)
+
+global cluster
+
+if cluster,
+	%We are running in parallel, we need to partition the elements 
+	element_partitioning=MeshPartition(md,numlabs);
+else
+	%We are running in serial, all elements belong to the same partition.
+	element_partitioning=ones(md.numberofelements,1);
+	labindex=1; %older versions of matlab do not include the parallel toolbox labindex variable.
+end
+
+%Allocate grids and elements
+elements=struct('element',cell(md.numberofelements,1));
+materials=struct('material',cell(0));
+mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+
+%Build elements
+if strcmpi(md.type,'2d'),
+	pos=find(element_partitioning==labindex);
+	[elements(pos).element]=deal(triaelem);
+
+	elements(pos)=SetStructureField(elements(pos),'element','type','triaelem');
+	elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+	elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(pos,:));
+	elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(pos,1:3)));
+	elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(pos,1:3)));
+
+else
+	pos=find(element_partitioning==labindex);
+	[elements(pos).element]=deal(pentaelem);
+
+	elements(pos)=SetStructureField(elements(pos),'element','type','pentaelem');
+	elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+	elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(pos,1:6));
+	elements(pos)=SetStructureField(elements(pos),'element','h',md.thickness(md.elements(pos,1:6)));
+	elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(pos,1:6)));
+	elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(pos,1:6)));
+	elements(pos)=SetStructureField(elements(pos),'element','shelf',md.elementoniceshelf(pos));
+	elements(pos)=SetStructureField(elements(pos),'element','onbed',md.elementonbed(pos));
+	elements(pos)=SetStructureField(elements(pos),'element','onsurface',md.elementonsurface(pos));
+	elements(pos)=SetStructureField(elements(pos),'element','acceleration',0);%acceleration 0 since no acceleration is posssible
+	elements(pos)=SetStructureField(elements(pos),'element','collapse',1);
+	elements(pos)=SetStructureField(elements(pos),'element','matid',pos);
+	elements(pos)=SetStructureField(elements(pos),'element','melting',md.melting(md.elements(pos,1:6))/md.yts);
+	elements(pos)=SetStructureField(elements(pos),'element','accumulation',md.accumulation(md.elements(pos,1:6))/md.yts);
+
+end
+
+if cluster, 
+	%For elements, the corresponding grids belong to this cpu. Keep track of it. 
+	mygrids(md.elements(el3pos,:))=1;
+	mygrids(md.elements(el6pos,:))=1;
+	
+	%Figure out which grids from the partitioning belong to different element partitions. We'll 
+	%call them 'border' grids.
+	bordergrids=double(gplus(mygrids)>1);
+else
+	bordergrids=zeros(md.numberofgrids,1); %no partitioning serially.
+end
+
+%Get the grids set up:
+grids=struct('grid',cell(md.numberofgrids,1));
+
+pos=[1:md.numberofgrids]';
+[grids(pos).grid]=deal(node);
+grids(pos)=SetStructureField(grids(pos),'grid','id',pos);
+grids(pos)=SetStructureField(grids(pos),'grid','x',md.x(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','y',md.y(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','z',md.z(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','onbed',md.gridonbed(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','border',bordergrids(pos));
+
+%spc degrees of freedom:
+%	 for each grid, 6 degrees of freedom are allowed. These dofs are numbered from 1 to 6. The first 3
+%    deal with the (x,y,z) velocities, or deformations. The last 3 deal with the (x,y,z) rotations.
+%    If a certain degree of freedom i (1<=i<=6) is constrained to the value 0, the number i should be added to the
+%    gridset field of a grid.
+%    The gridset field holds all the numbers corresponding to the dofs that have been constrained to 0 value. Because
+%    we do not know firshand how many dofs have been constrained for a certain grid, we need a flexible way
+%    of keeping track of these constraints. Hence gridset is a string array, of no given size, with no given
+%    numerical order.
+%    Ex: if a grid has 0 values for the x and z deformations, and 0 values for the y rotation, we could add any of the
+%    following strings to the gridset: '135', '153', '315', etc ...
+grids(pos)=SetStructureField(grids(pos),'grid','gridset','123456');
+
+%for bed elements, free up the 3'rd dof for the first 3 grids 
+if strcmpi(md.type,'3d'),
+	for n=1:length(elements),
+		%all dofs associated to this element are frozen, except if the element is on the bed, and acts as a 'fake' pentaelem, 
+		%and a true 'macayeal' tria element.
+		if strcmpi(solutiontype,'bed_slope_compute'),
+			if elements(n).element.onbed,
+				for j=1:3,
+					grids(elements(n).element.g(j)).grid.gridset='23456';
+				end
+			end
+		elseif strcmpi(solutiontype,'surface_slope_compute'),
+			if elements(n).element.onsurface,
+				for j=4:6,
+					grids(elements(n).element.g(j)).grid.gridset='23456';
+				end
+			end
+		end
+	end
+else
+	for n=1:md.numberofgrids,
+		grids(n).grid.gridset='23456';
+	end
+end
+			
+
+%Boundary conditions: no penalties to apply here
+	
+loads=struct('load',cell([0,1]));
+
+%Single point constraints: none;
+constraints=struct('constraint',cell(0,0));
+
+%Last thing, return a partitioning vector, and its transpose.
+[part,tpart]=PartitioningVector(md,grids);
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/ModelProcessorThermal.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ModelProcessorThermal.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ModelProcessorThermal.m	(revision 1)
@@ -0,0 +1,162 @@
+function [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorThermal(md,solutiontype);
+%MODELPROCESSORTHERMAL - process model for a thermal solution
+%
+%   This routine uses all the informations in the model md and put them
+%   into different structures (grids, elements, loads, constrained,materials)
+%   that will be used to create the stiffness matrix and load vector.
+%   After this routine, the model md should not be called until the end of the
+%   solution sequence.
+%
+%   Usage:
+%      [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessorThermal(md,solutiontype)
+
+global cluster
+
+if cluster,
+	%We are running in parallel, we need to partition the elements 
+	element_partitioning=MeshPartition(md,numlabs);
+else
+	%We are running in serial, all elements belong to the same partition.
+	element_partitioning=ones(md.numberofelements,1);
+	labindex=1; %older versions of matlab do not include the parallel toolbox labindex variable.
+end
+
+%Allocate grids and elements
+elements=struct('element',cell(md.numberofelements,1));
+materials=struct('material',cell(md.numberofelements+1,1));
+mygrids=zeros(md.numberofgrids,1); %this array determines grid partitioning.
+
+%Build 3d elements
+pos=find(element_partitioning==labindex);
+[elements(pos).element]=deal(pentaelem);
+
+elements(pos)=SetStructureField(elements(pos),'element','type','pentaelem');
+elements(pos)=SetStructureField(elements(pos),'element','id',pos);
+elements(pos)=SetStructureField(elements(pos),'element','g',md.elements(pos,1:6));
+elements(pos)=SetStructureField(elements(pos),'element','h',md.thickness(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','s',md.surface(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','b',md.bed(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','friction_type',md.drag_type);
+elements(pos)=SetStructureField(elements(pos),'element','k',md.drag(md.elements(pos,1:6)));
+elements(pos)=SetStructureField(elements(pos),'element','p',md.p(pos));
+elements(pos)=SetStructureField(elements(pos),'element','q',md.q(pos));
+elements(pos)=SetStructureField(elements(pos),'element','shelf',md.elementoniceshelf(pos));
+elements(pos)=SetStructureField(elements(pos),'element','onbed',md.elementonbed(pos));
+elements(pos)=SetStructureField(elements(pos),'element','onsurface',md.elementonsurface(pos));
+elements(pos)=SetStructureField(elements(pos),'element','meanvel',md.meanvel);
+elements(pos)=SetStructureField(elements(pos),'element','epsvel',md.epsvel);
+elements(pos)=SetStructureField(elements(pos),'element','acceleration',0);%acceleration 0 since no acceleration is posssible
+elements(pos)=SetStructureField(elements(pos),'element','collapse',0);
+elements(pos)=SetStructureField(elements(pos),'element','matid',pos);
+elements(pos)=SetStructureField(elements(pos),'element','geothermalflux',md.geothermalflux(md.elements(pos,1:6)));
+if strcmpi(solutiontype,'thermalsteady'),
+	elements(pos)=SetStructureField(elements(pos),'element','thermal_steadystate',1);
+else
+	elements(pos)=SetStructureField(elements(pos),'element','thermal_steadystate',0);
+end
+
+[materials(pos).material]=deal(matice);
+
+materials(pos)=SetStructureField(materials(pos),'material','id',pos);
+materials(pos)=SetStructureField(materials(pos),'material','B',md.B(md.elements(pos,1:6))*[1;1;1;1;1;1]/6);
+materials(pos)=SetStructureField(materials(pos),'material','n',md.n(pos));
+
+%Add physical constants in materials
+[materials(end).constants]=deal(matpar);
+materials(end)=SetStructureField(materials(end),'constants','g',md.g);
+materials(end)=SetStructureField(materials(end),'constants','rho_ice',md.rho_ice);
+materials(end)=SetStructureField(materials(end),'constants','rho_water',md.rho_water);
+materials(end)=SetStructureField(materials(end),'constants','thermalconductivity',md.thermalconductivity);
+materials(end)=SetStructureField(materials(end),'constants','heatcapacity',md.heatcapacity);
+materials(end)=SetStructureField(materials(end),'constants','latentheat',md.latentheat);
+materials(end)=SetStructureField(materials(end),'constants','beta',md.beta);
+materials(end)=SetStructureField(materials(end),'constants','meltingpoint',md.meltingpoint);
+materials(end)=SetStructureField(materials(end),'constants','mixed_layer_capacity',md.mixed_layer_capacity);
+materials(end)=SetStructureField(materials(end),'constants','thermal_exchange_velocity',md.thermal_exchange_velocity);
+
+if cluster, 
+	%For elements, the corresponding grids belong to this cpu. Keep track of it. 
+	mygrids(md.elements(el3pos,:))=1;
+	mygrids(md.elements(el6pos,:))=1;
+end
+
+if cluster, 
+	%Figure out which grids from the partitioning belong to different element partitions. We'll 
+	%call them 'border' grids.
+	bordergrids=double(gplus(mygrids)>1);
+else
+	bordergrids=zeros(md.numberofgrids,1); %no partitioning serially.
+end
+
+%Get the grids set up:
+grids=struct('grid',cell(md.numberofgrids,1));
+
+pos=[1:md.numberofgrids]';
+[grids(pos).grid]=deal(node);
+grids(pos)=SetStructureField(grids(pos),'grid','id',pos);
+grids(pos)=SetStructureField(grids(pos),'grid','x',md.x(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','y',md.y(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','z',md.z(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','onbed',md.gridonbed(pos));
+grids(pos)=SetStructureField(grids(pos),'grid','border',bordergrids(pos));
+
+%spc degrees of freedom:
+%	 for each grid, 6 degrees of freedom are allowed. These dofs are numbered from 1 to 6. The first 3
+%    deal with the (x,y,z) velocities, or deformations. The last 3 deal with the (x,y,z) rotations.
+%    If a certain degree of freedom i (1<=i<=6) is constrained to the value 0, the number i should be added to the
+%    gridset field of a grid.
+%    The gridset field holds all the numbers corresponding to the dofs that have been constrained to 0 value. Because
+%    we do not know firshand how many dofs have been constrained for a certain grid, we need a flexible way
+%    of keeping track of these constraints. Hence gridset is a string array, of no given size, with no given
+%    numerical order.
+%    Ex: if a grid has 0 values for the x and z deformations, and 0 values for the y rotation, we could add any of the
+%    following strings to the gridset: '135', '153', '315', etc ...
+grids(pos)=SetStructureField(grids(pos),'grid','gridset','23456');
+
+%Boundary conditions:
+
+%penalties
+loads=struct('load',cell(0,1));
+
+%create thermal penalties for every grid. Temperatures can never go over the melting point. 
+count=1;
+for i=1:md.numberofgrids,
+	if ~md.gridondirichlet_thermal(i),  %No penalty applied on spc grids!
+		pengridobject=pengrid;
+		pengridobject.id=count;
+		pengridobject.dof=1;
+		pengridobject.grid=i;
+		pengridobject.active=0;
+		if strcmpi(solutiontype,'thermalsteady'),
+			pengridobject.thermal_steadystate=1;
+		else
+			pengridobject.thermal_steadystate=0;
+		end
+		pengridobject.penalty_offset=md.penalty_offset;
+
+		loads(count).load=pengridobject;
+		count=count+1;
+	end
+end
+
+%Single point constraints:
+spcs=find(md.gridondirichlet_thermal);
+constraints=struct('constraint',cell(length(spcs),1));
+
+count=1;
+for i=1:md.numberofgrids,
+	if md.gridondirichlet_thermal(i),
+		constraints(count).constraint=spc;
+		constraints(count).constraint.grid=i;
+		constraints(count).constraint.dof=1;
+		constraints(count).constraint.value=md.dirichletvalues_thermal(i,1);
+		count=count+1;
+	end
+end
+
+
+%Last thing, return a partitioning vector, and its transpose.
+[part,tpart]=PartitioningVector(md,grids);
+
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/MpcGrids.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/MpcGrids.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/MpcGrids.m	(revision 1)
@@ -0,0 +1,35 @@
+function R_mg=MpcGrids(grids,constraints)
+%MPCGRIDS - build the matrix R_mg
+%
+%   see NastranRgbDoc documentation in theoryguide directory
+%
+%   Usage:
+%      R_mg=MpcGrids(grids,constraints)
+
+%compute number of equations described by our rgbs
+num_eq=0;
+gsize=getdofcount(grids);
+
+for i=1:length(constraints),
+	if strcmpi(constraints(i).constraint.type,'rgb'),
+		num_eq=num_eq+1;
+	end
+end
+
+%allocate R_mg (num_eq,gsize)
+R_mg=sparse(num_eq,gsize);
+
+count=0;
+for i=1:length(constraints),
+	if strcmpi(constraints(i).constraint.type,'rgb'),
+		%recover rgb constraint
+		rgbconstraint=constraints(i).constraint;
+		count=count+1;
+		%figure out whith degrees of freedom this RGB is supposed to connect
+		dof1=grids(rgbconstraint.grid1).grid.doflist(rgbconstraint.dof);
+		dof2=grids(rgbconstraint.grid2).grid.doflist(rgbconstraint.dof);
+		%plug rcb coefficients into R_mg
+		R_mg(count,dof1)=1;
+		R_mg(count,dof2)=-1; %basically, we want dof1 and dof2 to be equal, for grids 1 and 2
+	end
+end
Index: /issm/trunk/src/m/solutions/ice/PartitioningVector.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/PartitioningVector.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/PartitioningVector.m	(revision 1)
@@ -0,0 +1,63 @@
+function [part tpart]=PartitioningVector(md,grids);
+%PARTITIONINGVECTOR - build the partitioning vector
+%
+%   Return a partitioning vector, and its transpose. The partitioning vector
+%   part shows how each dof is distributed. tpart allows from a partitioned dof to go back
+%   to its original position on the grid list.
+%
+%   Usage:
+%      [part tpart]=PartitioningVector(md,grids)
+
+global cluster
+
+if ~cluster,
+    part=1:1:md.numberofgrids;
+    tpart=1:1:md.numberofgrids;
+else
+    part=zeros(md.numberofgrids,1);
+    %First deal with non border grids.
+
+    %How many grids for each lab?
+    count=0;
+    for i=1:md.numberofgrids,
+        if ((~isempty(grids(i).grid)) & (grids(i).grid.border==0)),
+            count=count+1;
+        end
+    end
+
+    %broacast
+	labcounts=gcat(count);
+
+	%create offset into partition vector
+	offset=0;
+	for i=1:(labindex-1),
+		offset=offset+labcounts(i);
+	end
+
+	%create partition vector
+	for i=1:md.numberofgrids,
+		if ((~isempty(grids(i).grid)) & (grids(i).grid.border==0)),
+			offset=offset+1;
+			part(offset)=i;
+		end
+	end
+
+	part=gplus(part);
+
+	%deal with border grids
+	count=gplus(count);
+	for i=1:md.numberofgrids,
+		if ((~isempty(grids(i).grid)) & (grids(i).grid.border==1)),
+			count=count+1;
+			part(count)=i;
+		end
+	end
+
+	%Build tpart:
+	tpart=zeros(md.numberofgrids,1);
+	for i=1:md.numberofgrids,
+		tpart(part(i))=i;
+	end
+end
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/PenaltySystemMatrices.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/PenaltySystemMatrices.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/PenaltySystemMatrices.m	(revision 1)
@@ -0,0 +1,42 @@
+function [Kgg,Pg,kmax]=PenaltySystemMatrices(grids,loads,materials,kflag,pflag, sparsity,inputs,analysis_type,Kgg,Pg);
+%PENALTYSYSTEMMATRICES - add penalties to the stiffness matrix and load vector
+%
+%   Usage:
+%      [Kgg,Pg,kmax]=PenaltySystemMatrices(grids,loads,materials,kflag,pflag, sparsity,inputs,analysis_type,Kgg,Pg)
+
+%Get stiffness matrix maximum magnitude
+kmax=max(max(abs(Kgg)));
+
+if kflag, 
+	
+	%Go through loads capable of generating stiffnesses (penalties)
+	for l=1:length(loads),
+		
+		if ~isempty(loads(l).load),
+			%call load system matrix generation.
+			Kpenalty=PenaltyCreateKMatrix(loads(l).load,grids,materials,inputs,analysis_type,kmax);
+			
+			%plug element system matrix into global system matrix.
+			Kgg=AddElemMatrix(Kpenalty,Kgg);
+		end
+	end
+
+else
+	Kgg={};
+end
+
+if pflag, 
+
+	%Go through loads created by penlties
+	for l=1:length(loads),
+		if ~isempty(loads(l).load),
+			%Call vector matrix generation
+			Ppenalty=PenaltyCreatePVector(loads(l).load,grids,materials,inputs,analysis_type,kmax);
+			
+			%plug load contribution into load vector
+			Pg=AddElemVector(Ppenalty,Pg);
+		end
+	end
+else 
+	Pg={};
+end
Index: /issm/trunk/src/m/solutions/ice/PressureElemCompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/PressureElemCompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/PressureElemCompute.m	(revision 1)
@@ -0,0 +1,39 @@
+function pressure=PressureElemCompute(m,inputs,type);
+%PRESSUREELEMCOMPUTE - compute the pressure over each element
+%
+%   return a vector of size (numberofelements,1), holding the pressure for 
+%   every element
+%
+%   Usage:
+%      pressure=PressureElemCompute(m,inputs,type)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+gridset=m.gridset;
+
+%figure out active elements that will take part in the stiffness and load generation
+[n1,n2]=GetNumberOfActiveElements(elements);
+
+%initialization
+pressure=zeros((n2-n1)+1,1);
+
+%Check 3d
+if strcmpi(type,'2d')
+	disp('pressure not computed for 2d meshes')
+	return
+end	
+
+%Go through elements and build pressure defined as P=-1/3*tr(stress)
+for n=n1:n2,
+	if ~isempty(elements(n).element),
+		stress_tensor=Stress(elements(n).element,grids,materials,inputs);	
+		trace=stress_tensor(1)+stress_tensor(2)+stress_tensor(3);
+		pressure(n)=-1/3*trace;
+	end
+end
Index: /issm/trunk/src/m/solutions/ice/Reducevector_g.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/Reducevector_g.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/Reducevector_g.m	(revision 1)
@@ -0,0 +1,10 @@
+function y_s=Reducevector_g(y_g)
+%REDUCEVECTOR_G - reduce y_g from g-set to s-set
+%
+%   Usage:
+%      y_s=Reducevector_g(y_g)
+
+global gridset
+
+y_n=y_g(gridset.pv_n);
+y_s=y_n(gridset.pv_s);
Index: /issm/trunk/src/m/solutions/ice/SetStructureField.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/SetStructureField.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/SetStructureField.m	(revision 1)
@@ -0,0 +1,26 @@
+function array=SetStructureField(array,name,field,value);
+%SETSTRUCTUREFIELD - set structure field
+%
+%   Go through the elements of an array and a a given value
+%   for a given field
+%
+%   Usage:
+%      array=SetStructureField(array,name,field,value)
+%
+%   See Also: MODELPROCESSOR
+
+if (ischar(value)  | isscalar(value)),
+	for n=1:length(array), 
+		structure=getfield(array(n),name);
+		structure=setfield(structure,field,value);
+		array(n)=setfield(array(n),name,structure);
+		%array(n).element=SetField(array(n).element,field,value);
+	end
+else
+	for n=1:length(array), 
+		structure=getfield(array(n),name);
+		structure=setfield(structure,field,value(n,:)');
+		array(n)=setfield(array(n),name,structure);
+		%array(n).element=SetField(array(n).element,field,value(n,:));
+	end
+end
Index: /issm/trunk/src/m/solutions/ice/SetupParams.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/SetupParams.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/SetupParams.m	(revision 1)
@@ -0,0 +1,19 @@
+function params=SetupParams(md)
+%SETUPPARAMS - setup the solution parameters
+%
+%   setup some parameters to be passed to the core solution
+%
+%   Usage:
+%      params=SetupParams(md)
+
+params.sparsity=md.sparsity;
+params.solver_type=md.solver_type;
+params.yts=md.yts;
+params.eps_rel=md.eps_rel;
+params.eps_abs=md.eps_abs;
+params.viscosity_overshoot=md.viscosity_overshoot;
+params.debug=md.debug;
+params.min_thermal_constraints=md.min_thermal_constraints;
+params.element_debug=md.element_debug;
+params.element_debugid=md.element_debugid;
+
Index: /issm/trunk/src/m/solutions/ice/ShiftLayers.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ShiftLayers.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ShiftLayers.m	(revision 1)
@@ -0,0 +1,11 @@
+function outvector=ShiftLayers(md,vector,initial_layer,final_layer)
+%SHIFTLAYERS - shift the value of a 3d field from ina layer to another
+%
+%   Usage:
+%      outvector=ShiftLayers(md,vector,initial_layer,final_layer)
+
+%Project initial_layer of vector onto 2d mesh
+vector2d=project2d(md,vector,initial_layer);
+
+%Extrude vector2d onto 3d vector, where vector2d is in the final layer of the mesh
+outvector=project3d(md,vector2d,'node',final_layer);
Index: /issm/trunk/src/m/solutions/ice/SpcGrids.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/SpcGrids.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/SpcGrids.m	(revision 1)
@@ -0,0 +1,58 @@
+function [grids,y_g]=SpcGrids(grids,constraints)
+%SPCGRIDS - spc the grids
+%
+%   Go through the grids and figure out which are spcd
+%
+%   Usage:
+%      [grids,y_g]=SpcGrids(grids,constraints)
+
+global cluster
+
+%initialize y_g, vector of constraint values in the g-set:
+y_g=sparse(getdofcount(grids),1);
+
+if cluster,
+	y_g_border=sparse(getdofcount(grids),1);
+end
+
+%Go through constraints and add constraint on gridset list of corresponding grid
+for i=1:length(constraints),
+
+	constraint=constraints(i).constraint;
+	if strcmpi(constraint.type,'spc'),
+		constraint_grid=grids(constraint.grid).grid;
+		
+		%On the cluster, grids are partitioned across cpus, but constraints are replicated across cpus.  So 
+		%grids pointed to by certain constraints might not exist on the local cpu. In this case, skip the 
+		%constraint operations.
+		if cluster & isempty(constraint_grid),
+			continue;
+		end
+
+		%for the constrained grid, add the correct degree of freedom in the gridset list 
+		constraint_grid.gridset=[constraint_grid.gridset num2str(constraint.dof)]; %concatenate two strings
+
+		%plug modified grid back into grids dataset.
+		grids(constraint.grid).grid=constraint_grid;
+
+		%plug value of constraint in corresponding constraint vector y_g
+		dof=constraint_grid.doflist(constraint.dof);
+		if ~cluster,
+			y_g(dof)=constraint.value;
+		else
+			%for cluster, we add to y_g only if grid does not belong to border (we don't want to add constraint.value several times for each cpu).
+			if constraint_grid.border~=1,
+				y_g(dof)=constraint.value;
+			else
+				y_g_border(dof)=constraint.value;
+			end
+		end
+	end
+end 
+
+if cluster,
+	%Add all the y_g from all the cpus
+	y_g=gplus(y_g);
+	%y_g_border is the same on all cpus, plug it into y_g
+	y_g=y_g+y_g_border;
+end
Index: /issm/trunk/src/m/solutions/ice/StrainRateCompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/StrainRateCompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/StrainRateCompute.m	(revision 1)
@@ -0,0 +1,109 @@
+function strainrate=StrainRateCompute(m,inputs,type);
+%STRAINRATECOMPUTE - compute the strain rate
+%
+%   return a vector of size (numberofelements,1), holding the strain rate for 
+%   every element
+%
+%   Usage:
+%      strainrate=StrainRateCompute(m,inputs,type)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+gridset=m.gridset;
+
+%figure out active elements that will take part in the stiffness and load generation
+[n1,n2]=GetNumberOfActiveElements(elements);
+
+if strcmpi(type,'2d')
+	%initialize vectors
+	strainrate=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[]);
+	strainrate1=zeros((n2-n1)+1,3);
+	A1=zeros((n2-n1)+1,1); Vx1=zeros((n2-n1)+1,1); Vy1=zeros((n2-n1)+1,1);
+	A2=zeros((n2-n1)+1,1); Vx2=zeros((n2-n1)+1,1); Vy2=zeros((n2-n1)+1,1);
+
+	%Go through all elements and call the strainrate routine, then compute eigen values and vector
+	for n=n1:n2,
+		if ~isempty(elements(n).element),
+			strainratevector=StrainRate(elements(n).element,grids,materials,inputs)';
+
+			strainratematrix=[strainratevector(1) strainratevector(3) 
+				      strainratevector(3)  strainratevector(2)];
+
+			%eigen values and vectors
+			[directions,value]=eig(strainratematrix);
+
+			%Plug into global vectors
+			strainrate1(n,:)=strainratevector;
+                        A1(n,1)=value(1,1); A2(n,1)=value(2,2);
+                        Vx1(n,1)=directions(1,1); Vx2(n,1)=directions(1,2);
+                        Vy1(n,1)=directions(2,1); Vy2(n,1)=directions(2,2);
+		end
+	end
+
+	%plug results into outputs
+	%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+	%Components
+	strainrate.xx=strainrate1(:,1)*(365.25*24*3600);  %strain rate in 1/a instead of 1/s
+	strainrate.yy=strainrate1(:,2)*(365.25*24*3600);
+	strainrate.xy=strainrate1(:,3)*(365.25*24*3600);
+	%principal axis and values
+	strainrate.principalvalue2=A1;
+	strainrate.principalaxis2=[Vx1 Vy1];
+	strainrate.principalvalue1=A2;
+	strainrate.principalaxis1=[Vx2 Vy2];
+	%Norm or effective value
+	straintare.effectivevalue=1/sqrt(2)*sqrt(strainrate.xx.^2+strainrate.yy.^2+2*strainrate.xy.^2);
+else
+	%initialize vectors
+	strainrate=struct('xx',[],'yy',[],'zz',[],'xy',[],'xz',[],'yz',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'principalvalue3',[],'principalaxis3',[]);
+	strainrate1=zeros((n2-n1)+1,6);
+	A1=zeros((n2-n1)+1,1); Vx1=zeros((n2-n1)+1,1); Vy1=zeros((n2-n1)+1,1); Vz1=zeros((n2-n1)+1,1);
+	A2=zeros((n2-n1)+1,1); Vx2=zeros((n2-n1)+1,1); Vy2=zeros((n2-n1)+1,1); Vz2=zeros((n2-n1)+1,1);
+	A3=zeros((n2-n1)+1,1); Vx3=zeros((n2-n1)+1,1); Vy3=zeros((n2-n1)+1,1); Vz3=zeros((n2-n1)+1,1);
+
+	%Go through all elements and call the strainrate routine, then compute eigen values and vector
+	for n=n1:n2,
+		if ~isempty(elements(n).element),
+			strainratevector=StrainRate(elements(n).element,grids,materials,inputs)';
+
+			strainratematrix=[strainratevector(1) strainratevector(4) strainratevector(5)
+				      strainratevector(4)  strainratevector(2)  strainratevector(6)
+				      strainratevector(5)  strainratevector(6)  strainratevector(3)];
+
+			%eigen values and vectors
+			[directions,value]=eig(strainratematrix);
+
+                        %Plug into global vectors
+			strainrate1(n,:)=strainratevector;
+                        A1(n,1)=value(1,1); A2(n,1)=value(2,2); A3(n,1)=value(3,3);
+                        Vx1(n,1)=directions(1,1); Vx2(n,1)=directions(1,2); Vx3(n,1)=directions(1,3);
+                        Vy1(n,1)=directions(2,1); Vy2(n,1)=directions(2,2); Vy3(n,1)=directions(2,3);
+                        Vz1(n,1)=directions(3,1); Vz2(n,1)=directions(3,2); Vz3(n,1)=directions(3,3);
+		end
+	end
+
+	%plug results into outputs
+	%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+	%Components
+	strainrate.xx=strainrate1(:,1)*(365.25*24*3600);  %strain rate in 1/a instead of 1/s
+	strainrate.yy=strainrate1(:,2)*(365.25*24*3600);
+	strainrate.zz=strainrate1(:,3)*(365.25*24*3600);
+	strainrate.xy=strainrate1(:,4)*(365.25*24*3600);
+	strainrate.xz=strainrate1(:,5)*(365.25*24*3600);
+	strainrate.yz=strainrate1(:,6)*(365.25*24*3600);
+	%principal axis and values
+	strainrate.principalvalue3=A1;
+	strainrate.principalaxis3=[Vx1 Vy1 Vz1];
+	strainrate.principalvalue2=A2;
+	strainrate.principalaxis2=[Vx2 Vy2 Vz2];
+	strainrate.principalvalue1=A3;
+	strainrate.principalaxis1=[Vx3 Vy3 Vz3];
+	%Norm or effective value
+	straintare.effectivevalue=1/sqrt(2)*sqrt(strainrate.xx.^2+strainrate.yy.^2+strainrate.zz.^2+2*strainrate.xy.^2+2*strainrate.xz.^2+2*strainrate.yz.^2);
+end
Index: /issm/trunk/src/m/solutions/ice/StressBedCompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/StressBedCompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/StressBedCompute.m	(revision 1)
@@ -0,0 +1,101 @@
+function stress_bed=StressBedCompute(m,inputs,type);
+%STRESSBEDCOMPUTE - compute the stress on the basal boundary condition
+%
+%   return a vector of size (numberofelements,1), holding the stress for 
+%   every element on bed
+%
+%   Usage:
+%      stress_bed=StressBedCompute(m,inputs,type)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+gridset=m.gridset;
+
+%figure out active elements that will take part in the stiffness and load generation
+[n1,n2]=GetNumberOfActiveElements(elements);
+
+%initialization
+stress_bed=zeros((n2-n1)+1,1);
+
+if strcmpi(type,'2d')
+	disp('stress_bed not computed for 2d meshes')
+	return
+end
+
+%initialize vectors
+stress_bed=struct('xx',[],'yy',[],'zz',[],'xy',[],'xz',[],'yz',[],'stress_n','stress_nn','normal_x',[],'normal_y',[],'normal_z',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'principalvalue3',[],'principalaxis3',[],'effectivevalue',[]);
+stress_bed1=zeros((n2-n1)+1,6);
+normal1=zeros((n2-n1)+1,3);
+stress_n1=zeros((n2-n1)+1,3);
+stress_nn1=zeros((n2-n1)+1,1);
+A1=zeros((n2-n1)+1,1); Vx1=zeros((n2-n1)+1,1); Vy1=zeros((n2-n1)+1,1); Vz1=zeros((n2-n1)+1,1);
+A2=zeros((n2-n1)+1,1); Vx2=zeros((n2-n1)+1,1); Vy2=zeros((n2-n1)+1,1); Vz2=zeros((n2-n1)+1,1);
+A3=zeros((n2-n1)+1,1); Vx3=zeros((n2-n1)+1,1); Vy3=zeros((n2-n1)+1,1); Vz3=zeros((n2-n1)+1,1);
+
+%Go through all elements and call the stress_bed routine, then compute eigen values and vector
+for n=n1:n2,
+	if ~isempty(elements(n).element),
+		[stress_vector,normal]=StressBed(elements(n).element,grids,materials,inputs);
+
+		if ~isnan(stress_vector)
+			stress_matrix=[stress_vector(1) stress_vector(4) stress_vector(5)
+				      stress_vector(4)  stress_vector(2)  stress_vector(6)
+				      stress_vector(5)  stress_vector(6)  stress_vector(3)];
+			stress_n=stress_matrix*normal;
+			stress_nn=normal'*stress_matrix*normal;
+
+			%eigen values and vectors
+			[directions,value]=eig(stress_matrix);
+
+			%Plug into global vectors
+			stress_bed1(n,:)=stress_vector;
+			stress_n1(n,:)=stress_n;
+			stress_nn1(n)=stress_nn;
+			normal1(n,:)=normal';
+			A1(n,1)=value(1,1); A2(n,1)=value(2,2); A3(n,1)=value(3,3);
+			Vx1(n,1)=directions(1,1); Vx2(n,1)=directions(1,2); Vx3(n,1)=directions(1,3);
+			Vy1(n,1)=directions(2,1); Vy2(n,1)=directions(2,2); Vy3(n,1)=directions(2,3);
+			Vz1(n,1)=directions(3,1); Vz2(n,1)=directions(3,2); Vz3(n,1)=directions(3,3);
+		else
+			stress_bed1(n,:)=NaN*ones(1,6);
+			stress_n1(n,:)=NaN*ones(1,3);
+			stress_nn1(n)=NaN;
+			normal1(n,:)=NaN*ones(1,3);
+			A1(n,1)=NaN; A2(n,1)=NaN; A3(n,1)=NaN;
+			Vx1(n,1)=NaN; Vx2(n,1)=NaN; Vx3(n,1)=NaN;
+			Vy1(n,1)=NaN; Vy2(n,1)=NaN; Vy3(n,1)=NaN;
+			Vz1(n,1)=NaN; Vz2(n,1)=NaN; Vz3(n,1)=NaN;
+		end
+	end
+end
+
+%plug results into outputs
+%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+%components
+stress_bed.xx=stress_bed1(:,1);
+stress_bed.yy=stress_bed1(:,2);
+stress_bed.zz=stress_bed1(:,3);
+stress_bed.xy=stress_bed1(:,4);
+stress_bed.xz=stress_bed1(:,5);
+stress_bed.yz=stress_bed1(:,6);
+%principal axis
+stress_bed.principalvalue3=A1;
+stress_bed.principalaxis3=[Vx1 Vy1 Vz1];
+stress_bed.principalvalue2=A2;
+stress_bed.principalaxis2=[Vx2 Vy2 Vz2];
+stress_bed.principalvalue1=A3;
+stress_bed.principalaxis1=[Vx3 Vy3 Vz3];
+%norm or effective value
+stress_bed.effectivevalue=1/sqrt(2)*sqrt(stress_bed.xx.^2+stress_bed.yy.^2+stress_bed.zz.^2+2*stress_bed.xy.^2+2*stress_bed.xz.^2+2*stress_bed.yz.^2);
+%force
+stress_bed.normal_x=normal1(:,1);
+stress_bed.normal_y=normal1(:,2);
+stress_bed.normal_z=normal1(:,3);
+stress_bed.stress_n=stress_n1;
+stress_bed.stress_nn=stress_nn1;
Index: /issm/trunk/src/m/solutions/ice/StressCompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/StressCompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/StressCompute.m	(revision 1)
@@ -0,0 +1,110 @@
+function stress=StressCompute(m,inputs,type);
+%STRESSCOMPUTE - compute the stress field
+%
+%   return a vector of size (numberofelements,1), holding the stress for 
+%   every element.
+%
+%   Usage:
+%      stress=StressCompute(m,inputs,type)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+gridset=m.gridset;
+
+%figure out active elements that will take part in the stiffness and load generation
+[n1,n2]=GetNumberOfActiveElements(elements);
+if strcmpi(type,'2d')
+
+	%initialize vectors
+	stress=struct('xx',[],'yy',[],'xy',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[]);
+	stress1=zeros((n2-n1)+1,3);
+	A1=zeros((n2-n1)+1,1); Vx1=zeros((n2-n1)+1,1); Vy1=zeros((n2-n1)+1,1); Vz1=zeros((n2-n1)+1,1);
+	A2=zeros((n2-n1)+1,1); Vx2=zeros((n2-n1)+1,1); Vy2=zeros((n2-n1)+1,1); Vz2=zeros((n2-n1)+1,1);
+
+	%Go through all elements and call the stress routine, then compute eigen values and vector
+	for n=n1:n2,
+		if ~isempty(elements(n).element),
+			stressvector=Stress(elements(n).element,grids,materials,inputs)';
+
+			stressmatrix=[stressvector(1) stressvector(3)
+				      stressvector(3)  stressvector(2)];
+
+			%eigen values and vectors
+			[directions,value]=eig(stressmatrix);
+
+                        %Plug into global vectors
+			stress1(n,:)=stressvector;
+                        A1(n,1)=value(1,1); A2(n,1)=value(2,2);
+                        Vx1(n,1)=directions(1,1); Vx2(n,1)=directions(1,2);
+                        Vy1(n,1)=directions(2,1); Vy2(n,1)=directions(2,2);
+		end
+	end
+
+	%plug results into outputs
+	%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+	%components
+	stress.xx=stress1(:,1);
+	stress.yy=stress1(:,2);
+	stress.xy=stress1(:,3);
+	%principal axis
+	stress.principalvalue2=A1;
+	stress.principalaxis2=[Vx1 Vy1];
+	stress.principalvalue1=A2;
+	stress.principalaxis1=[Vx2 Vy2];
+	%norm or effective value
+	stress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
+
+else
+	%initialize vectors
+	stress=struct('xx',[],'yy',[],'zz',[],'xy',[],'xz',[],'yz',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'principalvalue3',[],'principalaxis3',[]);
+	stress1=zeros((n2-n1)+1,6);
+	A1=zeros((n2-n1)+1,1); Vx1=zeros((n2-n1)+1,1); Vy1=zeros((n2-n1)+1,1); Vz1=zeros((n2-n1)+1,1);
+	A2=zeros((n2-n1)+1,1); Vx2=zeros((n2-n1)+1,1); Vy2=zeros((n2-n1)+1,1); Vz2=zeros((n2-n1)+1,1);
+	A3=zeros((n2-n1)+1,1); Vx3=zeros((n2-n1)+1,1); Vy3=zeros((n2-n1)+1,1); Vz3=zeros((n2-n1)+1,1);
+
+	%Go through all elements and call the stress routine, then compute eigen values and vector
+	for n=n1:n2,
+		if ~isempty(elements(n).element),
+			stressvector=Stress(elements(n).element,grids,materials,inputs)';
+
+			stressmatrix=[stressvector(1) stressvector(4) stressvector(5)
+				      stressvector(4)  stressvector(2)  stressvector(6)
+				      stressvector(5)  stressvector(6)  stressvector(3)];
+
+			%eigen values and vectors
+			[directions,value]=eig(stressmatrix);
+
+                        %Plug into global vectors
+			stress1(n,:)=stressvector;
+                        A1(n,1)=value(1,1); A2(n,1)=value(2,2); A3(n,1)=value(3,3);
+                        Vx1(n,1)=directions(1,1); Vx2(n,1)=directions(1,2); Vx3(n,1)=directions(1,3);
+                        Vy1(n,1)=directions(2,1); Vy2(n,1)=directions(2,2); Vy3(n,1)=directions(2,3);
+                        Vz1(n,1)=directions(3,1); Vz2(n,1)=directions(3,2); Vz3(n,1)=directions(3,3);
+		end
+	end
+
+	%plug results into outputs
+	%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+	%components
+	stress.xx=stress1(:,1);
+	stress.yy=stress1(:,2);
+	stress.zz=stress1(:,3);
+	stress.xy=stress1(:,4);
+	stress.xz=stress1(:,5);
+	stress.yz=stress1(:,6);
+	%principal axis
+	stress.principalvalue3=A1;
+	stress.principalaxis3=[Vx1 Vy1 Vz1];
+	stress.principalvalue2=A2;
+	stress.principalaxis2=[Vx2 Vy2 Vz2];
+	stress.principalvalue1=A3;
+	stress.principalaxis1=[Vx3 Vy3 Vz3];
+	%norm or effective value
+	stress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+stress.zz.^2+2*stress.xy.^2+2*stress.xz.^2+2*stress.yz.^2);
+end
Index: /issm/trunk/src/m/solutions/ice/StressSurfaceCompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/StressSurfaceCompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/StressSurfaceCompute.m	(revision 1)
@@ -0,0 +1,101 @@
+function stress_surface=StressSurfaceCompute(m,inputs,type);
+%STRESSSURFACECOMPUTE - compute the stress at the upper boundary condition
+%
+%   return a vector of size (numberofelements,1), holding the stress for 
+%   every element on surface
+%
+%   Usage:
+%      stress_surface=StressSurfaceCompute(m,inputs,type)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+gridset=m.gridset;
+
+%figure out active elements that will take part in the stiffness and load generation
+[n1,n2]=GetNumberOfActiveElements(elements);
+
+%initialization
+stress_surface=zeros((n2-n1)+1,1);
+
+if strcmpi(type,'2d')
+	disp('stress_surface not computed for 2d meshes')
+	return
+end
+
+%initialize vectors
+stress_surface=struct('xx',[],'yy',[],'zz',[],'xy',[],'xz',[],'yz',[],'stress_n','stress_nn','normal_x',[],'normal_y',[],'normal_z',[],'principalvalue1',[],'principalaxis1',[],'principalvalue2',[],'principalaxis2',[],'principalvalue3',[],'principalaxis3',[],'effectivevalue',[]);
+stress_surface1=zeros((n2-n1)+1,6);
+normal1=zeros((n2-n1)+1,3);
+stress_n1=zeros((n2-n1)+1,3);
+stress_nn1=zeros((n2-n1)+1,1);
+A1=zeros((n2-n1)+1,1); Vx1=zeros((n2-n1)+1,1); Vy1=zeros((n2-n1)+1,1); Vz1=zeros((n2-n1)+1,1);
+A2=zeros((n2-n1)+1,1); Vx2=zeros((n2-n1)+1,1); Vy2=zeros((n2-n1)+1,1); Vz2=zeros((n2-n1)+1,1);
+A3=zeros((n2-n1)+1,1); Vx3=zeros((n2-n1)+1,1); Vy3=zeros((n2-n1)+1,1); Vz3=zeros((n2-n1)+1,1);
+
+%Go through all elements and call the stress_surface routine, then compute eigen values and vector
+for n=n1:n2,
+	if ~isempty(elements(n).element),
+		[stress_vector,normal]=StressSurface(elements(n).element,grids,materials,inputs);
+
+		if ~isnan(stress_vector)
+			stress_matrix=[stress_vector(1) stress_vector(4) stress_vector(5)
+				      stress_vector(4)  stress_vector(2)  stress_vector(6)
+				      stress_vector(5)  stress_vector(6)  stress_vector(3)];
+			stress_n=stress_matrix*normal;
+			stress_nn=normal'*stress_matrix*normal;
+
+			%eigen values and vectors
+			[directions,value]=eig(stress_matrix);
+
+			%Plug into global vectors
+			stress_surface1(n,:)=stress_vector;
+			stress_n1(n,:)=stress_n;
+			stress_nn1(n)=stress_nn;
+			normal1(n,:)=normal';
+			A1(n,1)=value(1,1); A2(n,1)=value(2,2); A3(n,1)=value(3,3);
+			Vx1(n,1)=directions(1,1); Vx2(n,1)=directions(1,2); Vx3(n,1)=directions(1,3);
+			Vy1(n,1)=directions(2,1); Vy2(n,1)=directions(2,2); Vy3(n,1)=directions(2,3);
+			Vz1(n,1)=directions(3,1); Vz2(n,1)=directions(3,2); Vz3(n,1)=directions(3,3);
+		else
+			stress_surface1(n,:)=NaN*ones(1,6);
+			stress_n1(n,:)=NaN*ones(1,3);
+			stress_nn1(n)=NaN;
+			normal1(n,:)=NaN*ones(1,3);
+			A1(n,1)=NaN; A2(n,1)=NaN; A3(n,1)=NaN;
+			Vx1(n,1)=NaN; Vx2(n,1)=NaN; Vx3(n,1)=NaN;
+			Vy1(n,1)=NaN; Vy2(n,1)=NaN; Vy3(n,1)=NaN;
+			Vz1(n,1)=NaN; Vz2(n,1)=NaN; Vz3(n,1)=NaN;
+		end
+	end
+end
+
+%plug results into outputs
+%NB: Matlab sorts the eigen value in increasing order, we want the reverse
+%components
+stress_surface.xx=stress_surface1(:,1);
+stress_surface.yy=stress_surface1(:,2);
+stress_surface.zz=stress_surface1(:,3);
+stress_surface.xy=stress_surface1(:,4);
+stress_surface.xz=stress_surface1(:,5);
+stress_surface.yz=stress_surface1(:,6);
+%principal axis
+stress_surface.principalvalue3=A1;
+stress_surface.principalaxis3=[Vx1 Vy1 Vz1];
+stress_surface.principalvalue2=A2;
+stress_surface.principalaxis2=[Vx2 Vy2 Vz2];
+stress_surface.principalvalue1=A3;
+stress_surface.principalaxis1=[Vx3 Vy3 Vz3];
+%norm or effective value
+stress_surface.effectivevalue=1/sqrt(2)*sqrt(stress_surface.xx.^2+stress_surface.yy.^2+stress_surface.zz.^2+2*stress_surface.xy.^2+2*stress_surface.xz.^2+2*stress_surface.yz.^2);
+%force
+stress_surface.normal_x=normal1(:,1);
+stress_surface.normal_y=normal1(:,2);
+stress_surface.normal_z=normal1(:,3);
+stress_surface.stress_n=stress_n1;
+stress_surface.stress_nn=stress_nn1;
Index: /issm/trunk/src/m/solutions/ice/SystemMatrices.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/SystemMatrices.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/SystemMatrices.m	(revision 1)
@@ -0,0 +1,68 @@
+function [Kgg,pg]=SystemMatrices(elements,grids,loads,materials,kflag,pflag, sparsity,inputs,analysis_type);
+%SYSTEMMATRICES - create the stiffness matrix and load vector
+%
+%   Create system matrices (stiffness matrix and load vector), from element
+%   formulations
+%
+%   Usage:
+%      [Kgg,pg]=SystemMatrices(elements,grids,loads,materials,kflag,pflag, sparsity,inputs,analysis_type)
+
+%initialize system matrices
+dofcount=getdofcount(grids);
+Kgg={};
+pg={};
+
+%figure out active elements that will take part in the stiffness and load generation
+[n1,n2]=GetNumberOfActiveElements(elements);
+
+if kflag, 
+	
+	%allocate 
+	Kgg=spalloc(dofcount,dofcount,floor(dofcount*dofcount*sparsity)); 
+
+	%Go through elements and build stiffness matrix 
+	for n=n1:n2,
+
+		if ~isempty(elements(n).element),
+			%call element system matrix generation.
+			Ke=CreateKMatrix(elements(n).element,grids,materials,inputs,analysis_type);
+			
+			%plug element system matrix into global system matrix.
+			Kgg=AddElemMatrix(Ke,Kgg);
+		end
+
+	end
+	
+else
+	Kgg={};
+end
+
+if pflag, 
+	pg=spalloc(dofcount,1,floor(dofcount*sparsity));
+
+	%Go through elements and build loads
+	for n=n1:n2,
+		
+		if ~isempty(elements(n).element),
+			%call element load generation
+			pe=CreatePVector(elements(n).element,grids,materials,inputs,analysis_type);
+		
+			%plug element load vector into global vector
+			pg=AddElemVector(pe,pg);
+
+		end
+	end
+
+	%Go through loads created by presence of boundary conditions.
+	for l=1:length(loads),
+		if ~isempty(loads(l).load),
+			%Call vector matrix generation
+			pe=CreatePVector(loads(l).load,elements,grids,materials,inputs,analysis_type);
+			
+			%plug load contribution into load vector
+			pg=AddElemVector(pe,pg);
+		end
+	end
+else 
+	pg={};
+end
Index: /issm/trunk/src/m/solutions/ice/TimeStepping.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/TimeStepping.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/TimeStepping.m	(revision 1)
@@ -0,0 +1,63 @@
+function [back,dt,time]=TimeStepping(md,solution,dt,time)
+%TIMESTEPPING - ...
+%
+%   Usage:
+%      
+
+if md.timestepping,
+	
+	time0=time-dt; %previous time. we might have to go back in time.
+
+	back=0; %default is to not touch the time step.
+
+	%Is thickness decreasing or increasing too fast? 
+	dh=solution(end).thickness-solution(end-1).thickness;
+
+	maxdeltah=max(abs(dh));
+	if maxdeltah>md.DeltaH,
+		disp(sprintf('%s%g','      thickness varying too fast: ',maxdeltah));
+		disp(sprintf('%s%g%s%g%s','         decreasing time step from ',dt/md.yts,'(yr) to ',dt*md.timedec/md.yts,'(yr)'));
+		back=1;
+		dt=dt*md.timedec;
+		time=time0+dt; %new time is previous time plus reduced time step
+		return;
+	end
+
+	%Too slow?
+	if maxdeltah<md.deltaH,
+		disp(sprintf('%s%g','      thickness varying too slow: ',maxdeltah));
+		disp(sprintf('%s%g%s%g%s','         increasing time step from ',dt/md.yts,'(yr) to ',dt*md.timeacc/md.yts,'(yr)'));
+		back=0;
+		dt=dt*md.timeacc;
+		return;
+	end
+	
+	
+	%Is temperature decreasing or increasing too fast? 
+	dT=solution(end).t_g-solution(end-1).t_g;
+
+	maxdeltaT=max(abs(dT));
+	if maxdeltaT>md.DeltaT,
+		disp(sprintf('%s%g','      temperature varying too fast: ',maxdeltaT));
+		disp(sprintf('%s%g%s%g%s','         decreasing time step from ',dt/md.yts,'(yr) to ',dt*md.timedec/md.yts,'(yr)'));
+		back=1;
+		dt=dt*md.timedec;
+		time=time0+dt;
+		return;
+	end
+
+	%Too slow?
+	if maxdeltaT<md.deltaT,
+		disp(sprintf('%s%g','      temperature varying too slow: ',maxdeltaT));
+		disp(sprintf('%s%g%s%g%s','         increasing time step from ',dt/md.yts,'(yr) to ',dt*md.timeacc/md.yts,'(yr)'));
+		back=0;
+		dt=dt*md.timeacc;
+		return;
+	end
+
+else
+	%time stepping not activated.
+	back=0;
+	return;
+end
+	
Index: /issm/trunk/src/m/solutions/ice/UpdateGeometry.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/UpdateGeometry.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/UpdateGeometry.m	(revision 1)
@@ -0,0 +1,27 @@
+function [new_bed,new_surface,new_thickness]=UpdateGeometry(md,new_thickness,bed,surface)
+%UPDATEGEOMETRY - update the geometry during after a time step
+%
+%   Update geometry once given a new thickness, in the transient solutions
+%
+%   Usage:
+%      [new_bed,new_surface,new_thickness]=UpdateGeometry(md,new_thickness,bed,surface)
+
+%initialize bed
+new_bed=zeros(md.numberofgrids,1);
+new_surface=zeros(md.numberofgrids,1);
+
+%First, check that thickness is >0
+pos=find(new_thickness<0);
+new_thickness(pos)=10; %minimum thickness
+
+%For grids on ice sheet, the new bed remains the same, the new surface becomes bed+new_thickness. 
+pos=find(md.gridonicesheet);
+new_bed(pos)=bed(pos);
+new_surface(pos)=bed(pos)+new_thickness(pos);
+
+%For grids on ice shelt, we have hydrostatic equilibrium (for now)
+pos=find(md.gridoniceshelf);
+new_bed(pos)=-md.rho_ice/md.rho_water*new_thickness(pos);
+new_surface(pos)=(1-md.rho_ice/md.rho_water)*new_thickness(pos);
+
+%Deal with grounding line migration: later on.
Index: /issm/trunk/src/m/solutions/ice/UpdateGridPosition.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/UpdateGridPosition.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/UpdateGridPosition.m	(revision 1)
@@ -0,0 +1,17 @@
+function grids=UpdateGridPosition(md,grids,bed,thickness);
+%UPDATEGRIDPOSITION - update the position of the nodes after a time step
+%
+%   Update grid z field, using new bed and new thickness, and using
+%   md.numlayers of extrusion.
+%
+%   Usage:
+%      grids=UpdateGridPosition(md,grids,bed,thickness)
+
+count2d=[1:md.numberofgrids2d]';
+
+for i=1:md.numlayers,
+	count=count2d+(i-1)*md.numberofgrids2d;
+	for j=1:size(count,1),
+		grids(count(j)).grid.z=bed(count(j))+(i-1)/(md.numlayers-1)*(thickness(count(j)));
+	end
+end
Index: /issm/trunk/src/m/solutions/ice/UpdateMesh.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/UpdateMesh.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/UpdateMesh.m	(revision 1)
@@ -0,0 +1,47 @@
+function     [new_mesh new_velocity_g new_temperature_g new_pressure_g]=UpdateMesh(md,grids,old_mesh,old_velocity_g,old_temperature_g,old_pressure_g,bed,thickness);
+%UPDATEMESH - update the mesh after a time step
+%
+%   This routine interpolates results onto new mesh
+%
+%   Usage:
+%      [new_mesh new_velocity_g new_temperature_g new_pressure_g]=UpdateMesh(md,grids,old_mesh,old_velocity_g,old_temperature_g,old_pressure_g,bed,thickness)
+
+%grids old vertical coordinate
+old_z=old_mesh.grids(:,3);
+
+%initialization
+new_z             =old_z;
+new_velocity_g    =old_velocity_g;
+new_temperature_g =old_temperature_g;
+new_pressure_g    =old_pressure_g;
+
+for i=1:md.numberofgrids2d
+        for j=1:md.numlayers
+                count=(j-1)*md.numberofgrids2d+i;
+                new_z(count)=bed(count)+(j-1)/(md.numlayers-1)*(thickness(count));     
+
+		%Linearly interpolate results
+		if new_z(count)>old_z(count), %The grid is upper
+			if ~isnan(md.uppergrids(count)) %check that this grid is not already at the top (otherwise: same value)
+				old_upper_z=old_z(md.uppergrids(count));
+				coeff=(new_z(count)-old_z(count))/(old_upper_z-old_z(count));
+				new_velocity_g(grids(count).grid.doflist)=old_velocity_g(grids(count).grid.doflist)+coeff*(old_velocity_g(grids(count).grid.doflist)-old_velocity_g(grids(md.uppergrids(count)).grid.doflist));
+				new_temperature_g(grids(count).grid.doflist)=old_temperature_g(grids(count).grid.doflist)+coeff*(old_temperature_g(grids(count).grid.doflist)-old_temperature_g(grids(md.uppergrids(count)).grid.doflist));
+				new_pressure_g(grids(count).grid.doflist)=old_pressure_g(grids(count).grid.doflist)+coeff*(old_pressure_g(grids(count).grid.doflist)-old_pressure_g(grids(md.uppergrids(count)).grid.doflist));
+			end
+		else                          %The grid is lower
+			if ~isnan(md.lowergrids(count)) %check that this grid is not already at the bottom (otherwise: same value)
+				old_lower_z=old_z(md.lowergrids(count));
+				coeff=(new_z(count)-old_z(count))/(old_lower_z-old_z(count));
+				new_velocity_g(grids(count).grid.doflist)=old_velocity_g(grids(count).grid.doflist)+coeff*(old_velocity_g(grids(count).grid.doflist)-old_velocity_g(grids(md.lowergrids(count)).grid.doflist));
+				new_temperature_g(grids(count).grid.doflist)=old_temperature_g(grids(count).grid.doflist)+coeff*(old_temperature_g(grids(count).grid.doflist)-old_temperature_g(grids(md.lowergrids(count)).grid.doflist));
+				new_pressure_g(grids(count).grid.doflist)=old_pressure_g(grids(count).grid.doflist)+coeff*(old_pressure_g(grids(count).grid.doflist)-old_pressure_g(grids(md.lowergrids(count)).grid.doflist));
+			end
+		end
+        end
+end
+
+%Build new mesh
+new_mesh.elements=old_mesh.elements;
+new_mesh.grids=old_mesh.grids;
+new_mesh.grids(:,3)=new_z;
Index: /issm/trunk/src/m/solutions/ice/VelocityExtrude.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/VelocityExtrude.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/VelocityExtrude.m	(revision 1)
@@ -0,0 +1,35 @@
+function u_g=VelocityExtrude(md,u_g);
+%VELOCITYEXTRUDE - extrude the velocity
+%
+%   Extrude collapsed horizontal velocities present in MacAyeal elements
+%
+%   Usage:
+%      u_g=VelocityExtrude(md,u_g)
+
+if strcmpi(md.type,'2d'),
+	%do nothing, we don't have a 3d mesh anyway.
+else
+
+	%Find list of 2d grids that belong to the collapsed macayeal elements.
+	%And remove grids on the border.
+	%These grids are on macayeal but not on pattyn nor hutter nor dirichlet
+	grids2d=md.gridonmacayeal(1:md.numberofgrids2d) & ~(md.gridonhutter(1:md.numberofgrids2d) | md.gridonpattyn(1:md.numberofgrids2d) | md.gridondirichlet_diag(1:md.numberofgrids2d));
+	
+	vx2d=u_g(1:6:6*md.numberofgrids2d).*grids2d;
+	vy2d=u_g(2:6:6*md.numberofgrids2d).*grids2d;
+
+	%Extrude across the 3d mesh
+	vx3d=project3d(md,vx2d,'node');
+	vy3d=project3d(md,vy2d,'node');
+
+	%Remove velocity of the first layer
+	vx3d(1:md.numberofgrids2d)=0;
+	vy3d(1:md.numberofgrids2d)=0;
+
+	%Plug back into u_g
+	u_g(1:6:end)=u_g(1:6:end)+vx3d;
+	u_g(2:6:end)=u_g(2:6:end)+vy3d;
+
+end
+
+end %end function
Index: /issm/trunk/src/m/solutions/ice/ViscousHeatingCompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/ViscousHeatingCompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/ViscousHeatingCompute.m	(revision 1)
@@ -0,0 +1,33 @@
+function viscousheating=ViscousHeatingCompute(m,inputs,type);
+%VISCOUSHEATINGCOMPUTE - compute viscous heating
+%
+%   return a vector of size (numberofelements,1), holding the viscous heating for 
+%   every element
+%
+%   Usage:
+%      viscousheating=ViscousHeatingCompute(m,inputs,type)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+gridset=m.gridset;
+
+%figure out active elements that will take part in the stiffness and load generation
+[n1,n2]=GetNumberOfActiveElements(elements);
+
+%initialize vector
+viscousheating=zeros((n2-n1)+1,1);
+
+%Go through all elements and call the vicous heating routine.
+for n=n1:n2,
+		
+	if ~isempty(elements(n).element),
+		viscousheating(n)=ViscousHeating(elements(n).element,grids,materials,inputs);
+	end
+
+end
Index: /issm/trunk/src/m/solutions/ice/debug.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/debug.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/debug.m	(revision 1)
@@ -0,0 +1,144 @@
+%DEBUG - comparison of CIELO and ICE solutions
+%
+%   This script is used to debug Cielo and Ice by comparing
+%   the results of both solutions
+
+%first get this into the cielo code, at the core solution level
+%PetscSynchronizedPrintf(MPI_COMM_WORLD,"Messing up here\n");
+%PetscSynchronizedFlush(MPI_COMM_WORLD);
+%BatchDebug(K_gg,p_g,femmodel,"Debug.bin");
+%PetscFinalize(); abort();
+
+
+%then watch out for the try, catch statements. Try without them, so see if solve goes through 
+%nicely, if not correct. When everything works, reinstate the try catch.
+
+%an alter is used to modify the core solution in Ice, to stop right after Emg. But for cielo, 
+%we don't have an alter, just use the first 5 lines of this file and put them in the batch 
+%solution.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',200000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,3,2);
+md.eps_rel=.1;
+md.eps_abs=NaN;
+md=setelementstype(md,'pattyn','Pattyn.exp','fill','macayeal');
+%md=setelementstype(md,'fill','macayeal');
+md.viscosity_overshoot=0;
+md.vx=NaN; md.vy=NaN; md.vz=NaN;
+
+%first alter solution 
+!cp /home/larour/Ice/ice1/Solver/Ice/solutions/icediagnostic_core_nonlinear.m ./
+!/home/larour/Ice/ice1/Solver/Ice/solutions/DiagnosticAlter.pl
+!mv icediagnostic_core_nonlinear.alt.m icediagnostic_core_nonlinear.m
+
+!rm  -rf systemmatrices_ice.mat
+
+%Compute solution with Ice model. Catch error triggered to get our of core function
+try,
+	md=solve(md,'diagnostic','ice');
+catch
+end
+
+%recover pg and Kgg
+results=load('systemmatrices_ice');
+Kgg_ice=results.K_gg;
+pg_ice=results.p_g;
+
+%erase alter
+%!rm icediagnostic_core_nonlinear.m 
+ls
+
+%Now for cielo
+md.vx=NaN; md.vy=NaN; md.vz=NaN; md.vel=NaN;
+
+md.cluster='wilkes';
+md.np=3;
+md.batch=1;
+md.time=10;
+md=solve(md,'diagnostic_horiz','cielo');
+
+cielo_rc_location=which('cielo.rc'); [codepath,executionpath]=ProcessBatchParametersFromCieloRc(md.cluster,cielo_rc_location);
+
+pause(5);
+results=parseresultsfromdisk([executionpath '/Debug.bin']);
+
+
+%recover pg and Kgg
+tpart=results{1};
+Kgg_cielo=results{2};
+pg_cielo=results{3};
+
+%apply partitioning to Kgg and pg:
+gsize=md.numberofgrids*6;
+indx=1:6:gsize; indx=indx(tpart);
+indy=2:6:gsize; indy=indy(tpart);
+indz=3:6:gsize; indz=indz(tpart);
+indu=4:6:gsize; indu=indu(tpart);
+indv=5:6:gsize; indv=indv(tpart);
+indw=6:6:gsize; indw=indw(tpart);
+
+
+ind=zeros(gsize,1); 
+ind(1:6:gsize)=indx;
+ind(2:6:gsize)=indy;
+ind(3:6:gsize)=indz;
+ind(4:6:gsize)=indu;
+ind(5:6:gsize)=indv;
+ind(6:6:gsize)=indw;
+
+Kgg_cielo=Kgg_cielo(ind,ind);
+pg_cielo=pg_cielo(ind);
+
+disp('Trying to see if stiffness is identical');
+
+%display some information
+disp(sprintf('%s%g%s%g','norm(Kgg_ice): ',norm(Kgg_ice,inf),' norm(Kgg_cielo): ',norm(Kgg_cielo,inf)));
+
+%find some values that are different
+kdiff=(Kgg_ice-Kgg_cielo)./Kgg_ice;
+pos=find(isnan(kdiff));kdiff(pos)=0;
+pos=find(isinf(kdiff));kdiff(pos)=0;
+
+pos=find(abs(Kgg_cielo)/norm(Kgg_cielo)>10^-7);
+pos2=find(abs(Kgg_cielo(pos))==max(abs(Kgg_cielo(pos))));
+pos3=pos(pos2(1));
+[i0,j0]=ind2sub(size(Kgg_cielo),pos3);
+
+disp(['Kgg_ice(' num2str(i0) ',' num2str(j0) ')=' num2str(Kgg_ice(i0,j0)) ' Kgg_cielo(' num2str(i0) ',' num2str(j0) ')=' num2str(Kgg_cielo(i0,j0))]);
+
+
+%figure out grids for these dofs.
+grid1=floor((i0-mod(i0,6))/6)+1;
+grid2=floor((j0-mod(j0,6))/6)+1;
+
+%now find elements with grid1 and grid2 in them
+[elements1,grids1]=find(md.elements==grid1); 
+[pos2,grids2]=find(md.elements(elements1,:)==grid2); 
+elements=elements1(pos2);
+
+disp(['Elements ' num2str(elements') ' Grids ' num2str(grid1) ' ' num2str(grid2) ' Dofs ' num2str(mod(i0,6)) ' ' num2str(mod(j0,6))]);
+
+
+
+disp('Trying to see if loads are identical');
+disp(sprintf('%s%g%s%g','norm(pg_ice): ',norm(pg_ice),' norm(pg_cielo): ',norm(pg_cielo)));
+
+pdiff=(pg_ice-pg_cielo)./pg_ice;
+pos=find(isnan(pdiff));pdiff(pos)=0;
+pos=find(isinf(pdiff));pdiff(pos)=0;
+
+pos=find(abs(pg_cielo)/norm(pg_cielo)>10^-7);
+pos2=find(abs(pdiff(pos))==max(abs(pdiff(pos))));
+i0=pos(pos2(1));
+disp(['pg_ice(' num2str(i0) ')=' num2str(pg_ice(i0)) ' pg_cielo(' num2str(i0) ')=' num2str(pg_cielo(i0))]);
+
+%figure out grid for this dofs.
+grid1=floor((i0-mod(i0,6))/6)+1;
+
+%now find elements with grid1 
+[elements1,grids1]=find(md.elements==grid1); 
+
+disp(['Elements [' num2str(elements1') '] Grid [' num2str(grid1) '] Dof [' num2str(mod(i0,6)) ']' ]);
Index: /issm/trunk/src/m/solutions/ice/debug2.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/debug2.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/debug2.m	(revision 1)
@@ -0,0 +1,28 @@
+%DEBUG2 - comparison of CIELO and ICE solutions
+%
+%   This script is used to debug Cielo and Ice by comparing
+%   the results of both solutions
+
+clear @pentaelem/CreateKMatrix
+clear @pentaelem/CreatePVector
+clear @triaelem/CreateKMatrix
+clear @triaelem/CreatePVector
+clear @triaelem/CreateKMatrixHoriz
+clear @triaelem/CreatePVectorHoriz
+clear @icefront/CreatePVector
+
+md.element_debug=1;
+md.element_debugid=41;
+
+%first run ice
+md.vx=NaN; md.vy=NaN; md.vz=NaN; md.vel=NaN;
+md.cluster='none';md.batch=0;
+
+try,
+	md=solve(md,'diagnostic','ice');
+catch,
+end
+
+%now run cielo
+md.cluster='wilkes';md.batch=1;
+md=solve(md,'diagnostic_horiz','cielo');
Index: /issm/trunk/src/m/solutions/ice/diagnostic.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/diagnostic.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/diagnostic.m	(revision 1)
@@ -0,0 +1,89 @@
+function md=icediagnostic(md);
+%ICEDIAGNOSTIC - compute the velocity field of a model
+%
+%   this routine is a Matlab drivn solution
+%   
+%   Usage:
+%      u_g=icediagnostic_core_linear(m,analysis_type,varargin);
+%
+%   See also: ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR ICEDIAGNOSTIC_CORE_LINEAR
+
+%define global variables
+iceglobal
+
+%determine if run is parallel
+if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
+
+%for now, only serial support is in
+if cluster,
+	error('icediagnostic error message: parallel support not implemented yet');
+end
+
+%Create fem structure (input of icediagnostic3d)
+fem=struct();
+%Figure out which type of elements are present
+[fem.ishutter,fem.ismacayealpattyn,fem.isstokes]=DiagnosticSolutionType(md.elements_type);
+
+if strcmpi(md.type,'2d'),
+
+	%First, build elements,grids,loads, etc ... for horizontal model
+	if fem.ishutter,
+		fem.m_ss=CreateFemModel(md,'surface_slope_compute');
+		fem.m_dhu=CreateFemModel(md,'diagnostic_hutter');
+	end
+	if fem.ismacayealpattyn,
+		fem.m_dh=CreateFemModel(md,'diagnostic_horiz');
+	end
+
+	%plug inputs in fem (existing velocity)
+	if ~isnan(md.vx) & ~isnan(md.vy) & fem.ismacayealpattyn,
+		%an input velocity is present in the model, use it to bootstrap the diagnostic core nonlinear solution.
+		m_dh=fem.m_dh;
+		fem.inputs.velocity=zeros(m_dh.gridset.gsize,1);
+		fem.inputs.velocity(1:6:m_dh.gridset.gsize)=md.vx/md.yts;
+		fem.inputs.velocity(2:6:m_dh.gridset.gsize)=md.vy/md.yts;
+	else
+		fem.inputs=struct();
+	end
+
+	%compute solution
+	u_g=icediagnostic2d(md,fem);
+
+	%Load results onto model
+	md=Loadresults(md,fem,u_g);
+
+else
+
+	%First, build elements,grids,loads, etc ... for horizontal, base vertical and vertical model
+	fem.m_dbv=CreateFemModel(md,'diagnostic_basevert');
+	fem.m_dv=CreateFemModel(md,'diagnostic_vert');
+
+	if fem.ismacayealpattyn,
+		fem.m_dh=CreateFemModel(md,'diagnostic_horiz');
+	end
+	if fem.ishutter,
+		fem.m_ss=CreateFemModel(md,'surface_slope_compute');
+		fem.m_dhu=CreateFemModel(md,'diagnostic_hutter');
+	end
+	if fem.isstokes,
+		fem.m_bs=CreateFemModel(md,'bed_slope_compute');
+		fem.m_ds=CreateFemModel(md,'diagnostic_stokes');
+	end
+
+	%plug inputs in fem (existing velocity)
+	if ~isnan(md.vx) & ~isnan(md.vy) & fem.ismacayealpattyn,
+		%an input velocity is present in the model, use it to bootstrap the diagnostic core nonlinear solution.
+		m_dh=fem.m_dh;
+		fem.inputs.velocity=zeros(m_dh.gridset.gsize,1);
+		fem.inputs.velocity(1:6:m_dh.gridset.gsize)=md.vx/md.yts;
+		fem.inputs.velocity(2:6:m_dh.gridset.gsize)=md.vy/md.yts;
+	else
+		fem.inputs=struct();
+	end
+
+	%compute solution
+	u_g=icediagnostic3d(md,fem);
+
+	%Load results onto model
+	md=Loadresults(md,fem,u_g);
+end
Index: /issm/trunk/src/m/solutions/ice/diagnostic_wrapper.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/diagnostic_wrapper.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/diagnostic_wrapper.m	(revision 1)
@@ -0,0 +1,36 @@
+function md=icediagnostic_wrapper(md);
+%ICEDIAGNOSTIC_WRAPPER - wrapper of diagnostic solution
+%
+%   diagnostic wrapper for diagnostic matlab driven solution. 
+%   we need a wrapper so that we can launch the diagnostic solution using Matlab parallel, 
+%
+%   Usage:
+%      md=icediagnostic_wrapper(md)
+%
+%   See also: ICEDIAGNOSTIC, ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR ICEDIAGNOSTIC_CORE_LINEAR
+
+%start timing
+t1=clock;
+
+%If running in parallel, launch core diagnostic routine within a parallel job.
+if strcmpi(md.cluster,'yes'),
+	sched = findResource('scheduler', 'configuration', md.scheduler_configuration);
+	pjob = createParallelJob(sched);
+	set(pjob, 'FileDependencies', {'icediagnostic.m'});
+	set(pjob, 'MaximumNumberOfWorkers', md.np); set(pjob, 'MinimumNumberOfWorkers', md.np);
+	t = createTask(pjob, @icediagnostic, 1, {md});
+	set(t, 'CaptureCommandWindowOutput', true)
+	disp('   Submitting job to cluster');
+	submit(pjob);
+	waitForState(pjob);
+	get(t, 'CommandWindowOutput')
+	get(t,'ErrorMessage')
+	disp('   Done running on cluster');
+else
+	md=icediagnostic(md);
+end
+
+%stop timing
+t2=clock;
+
+disp(sprintf('\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']));
Index: /issm/trunk/src/m/solutions/ice/getdofcount.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/getdofcount.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/getdofcount.m	(revision 1)
@@ -0,0 +1,8 @@
+function dofcount=getdofcount(grids)
+%GETDOFCOUNT - get number of degrees of freedom of the system
+%
+%   Usage:
+%      dofcount=getdofcount(grids)
+
+%Easy for now, as there are 6 dofs per grid
+dofcount=length(grids)*6;
Index: /issm/trunk/src/m/solutions/ice/huttercompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/huttercompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/huttercompute.m	(revision 1)
@@ -0,0 +1,51 @@
+function md=huttercompute(md);
+%HUTTERCOMPUTE - compute the velocity field of the model using Hutter's model
+%
+%   Usage:
+%      md=huttercompute(md)
+
+%define global variables
+iceglobal
+
+%determine if run is parallel
+if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
+
+%for now, only serial support is in
+if cluster,
+	error('icediagnostic error message: parallel support not implemented yet');
+end
+
+%setup some parameters to be passed to the core solution
+params.sparsity=md.sparsity;
+params.solver_type=md.solver_type;
+params.eps_abs=md.eps_abs;
+params.eps_rel=md.eps_rel;
+params.debug=md.debug;
+
+%First, build elements,grids,loads, etc ... for horizontal, base vertical and vertical model
+disp('   processing model');
+[elements,grids,loads,constraints,materials,part,tpart]=ModelProcessor(md,'diagnostic_hutter');
+
+%generate degrees of freedom
+disp('   generating degrees of freedom');
+grids=Dof(grids); 
+
+%add constraints to grids. Create y_g vector of constraint values for the entire g set.
+disp('   generating constraint vector');
+[grids y_g]=SpcGrids(grids,constraints);
+
+%generate grid sets and reduce y_g to ys from g-set to s-set.
+disp('   generating grid sets');
+BuildGridSets(grids);gridset=gridset; ys=Reducevector_g(y_g);
+
+%Compute velocity, in 3d
+gridset=gridset;
+slopesurface=zeros(gridset.gsize,1);
+slopesurface(1:6:gridset.gsize,1)=md.surface_slopex;
+slopesurface(2:6:gridset.gsize,1)=md.surface_slopey;
+disp(sprintf('\n%s',['computing Hutter''s velocities...']));
+u_g=icediagnostic_core_linear(elements,grids,materials,loads,params,ys,'diagnostic_hutter',struct('slopesurface',slopesurface));
+	
+md.vx=u_g(1:6:end)*md.yts;
+md.vy=u_g(2:6:end)*md.yts;
+md.vel=sqrt(md.vx.^2+md.vy.^2);
Index: /issm/trunk/src/m/solutions/ice/icediagnostic2d.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icediagnostic2d.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icediagnostic2d.m	(revision 1)
@@ -0,0 +1,55 @@
+function u_g=icediagnostic2d(md,fem),
+%ICEDIAGNOSTIC2D - diagnostic of a 2d model
+%
+%   this routine computes the velocity field of a glacier in 2d 
+%
+%   Usage:
+%      u_g=icediagnostic2d(md,fem)
+%
+%   See also: ICEDIAGNOSTIC, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR
+
+%recover inputs
+inputs=fem.inputs;
+
+%Compute surface slope if there are hutter elements
+if fem.ishutter,
+
+	%Get field of fem
+	m_ss=fem.m_ss;
+	m_dhu=fem.m_dhu;
+
+	%Compute slope of the surface
+	if fem.m_dhu.params.debug
+		disp(sprintf('\n%s',['computing surface slope (x and y derivatives)...']));
+	end
+	slopex=icediagnostic_core_linear(m_ss,'surface_slope_compute_x',inputs);
+	slopey=icediagnostic_core_linear(m_ss,'surface_slope_compute_y',inputs);
+	
+	%initialize slope surface input for hutter solution sequence
+	slopesurface=zeros(m_ss.gridset.gsize,1);
+	slopesurface(1:6:m_ss.gridset.gsize,1)=slopex(1:6:end);
+	slopesurface(2:6:m_ss.gridset.gsize,1)=slopey(1:6:end);
+
+	%Compute Hutter solution
+	disp(sprintf('\n%s',['computing hutter velocities...']));
+	inputs.slopesurface=slopesurface;
+	u_g=icediagnostic_core_linear(m_dhu,'diagnostic_hutter',inputs);
+
+	%Computation of depth averaged pressure with MacAyeal's assumptions (P_bar=1/2*rho_ice*g*H in Pa)
+	u_g(4:6:m_dhu.gridset.gsize)=1/2*md.rho_ice*md.g*md.thickness;
+end
+
+if fem.ismacayealpattyn,
+
+	%Get field of fem
+	m_dh=fem.m_dh;
+
+	%Compute horizontal solution. 
+	disp(sprintf('\n%s',['computing horizontal velocities...']));
+
+	%Run core solution
+	u_g=icediagnostic_core_nonlinear(m_dh,'diagnostic_horiz',inputs);
+
+	%Computation of depth averaged pressure with MacAyeal's assumptions (P_bar=1/2*rho_ice*g*H in Pa)
+	u_g(4:6:m_dh.gridset.gsize)=1/2*md.rho_ice*md.g*md.thickness;
+end
Index: /issm/trunk/src/m/solutions/ice/icediagnostic3d.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icediagnostic3d.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icediagnostic3d.m	(revision 1)
@@ -0,0 +1,110 @@
+function u_g=icediagnostic3d(md,fem),
+%ICEDIAGNOSTIC3D - diagnostic of a 3d model
+%
+%   this routine computes the velocity field of a glacier in 3d
+%
+%   Usage:
+%      u_g=icediagnostic3d(md,fem)
+%
+%   See also: ICEDIAGNOSTIC, ICEDIAGNOSTIC2D, ICEDIAGNOSTIC_CORE_NONLINEAR ICEDIAGNOSTIC_CORE_LINEAR
+
+global gridset
+
+%recover inputs
+inputs=fem.inputs;
+
+%Compute surface slope if there are hutter elements
+if fem.ishutter,
+	m_ss=fem.m_ss;
+	m_dhu=fem.m_dhu;
+
+	%Compute slope of the surface
+	if m_ss.params.debug
+		disp(sprintf('\n%s',['computing surface slope (x and y derivatives)...']));
+	end
+	slopex=icediagnostic_core_linear(m_ss,'surface_slope_compute_x',inputs);
+	slopey=icediagnostic_core_linear(m_ss,'surface_slope_compute_y',inputs);
+
+	%Project slopes computed at surface, onto the 3d volume
+	slopex=project3d(md,project2d(md,slopex(1:6:end),md.numlayers),'node');
+	slopey=project3d(md,project2d(md,slopey(1:6:end),md.numlayers),'node');
+
+	%Feed hutter solution with the slope input
+	slopesurface=zeros(m_ss.gridset.gsize,1);
+	slopesurface(1:6:m_ss.gridset.gsize,1)=slopex;
+	slopesurface(2:6:m_ss.gridset.gsize,1)=slopey;
+	inputs.slopesurface=slopesurface;
+
+	%Compute Hutter solution
+	disp(sprintf('\n%s',['computing hutter velocities...']));
+	u_g=icediagnostic_core_linear(m_dhu,'diagnostic_hutter',inputs);
+end
+
+if fem.ismacayealpattyn,
+	m_dh=fem.m_dh;
+
+	%Compute horizontal solution. 
+	disp(sprintf('\n%s',['computing horizontal velocities...']));
+
+	%Run core solution
+	u_g=icediagnostic_core_nonlinear(m_dh,'diagnostic_horiz',inputs);
+end
+
+%Extrude velocities for collapsed penta elements
+u_g=VelocityExtrude(md,u_g);
+
+%Compute depth averaged velocity and add it to inputs
+gridset=fem.m_dv.gridset;
+velocity_average=HorizontalVelocityDepthAverage(md,u_g);
+inputs.velocity=u_g;
+inputs.velocity_average=velocity_average;
+
+%Compute basal vertical velocity, in 3d
+disp(sprintf('\n%s',['computing basal vertical velocity...']));
+u_g_basevert=icediagnostic_core_linear(fem.m_dbv,'diagnostic_basevert',inputs);
+
+%update dirichlet boundary conditions with these new base vertical velocities
+m_dv=fem.m_dv;
+gridset=m_dv.gridset;
+m_dv.y_g=u_g_basevert; m_dv.ys=Reducevector_g(m_dv.y_g);
+
+%compute vertical velocities
+disp(sprintf('\n%s',['computing vertical velocity...']));
+u_g_vert=icediagnostic_core_linear(m_dv,'diagnostic_vert',inputs);
+
+%add contribution to vertical velocity
+u_g=u_g+u_g_vert;
+
+%Computation of pressure with Pattyn's assumptions (P=rho_ice*g*(s-z) in Pa)
+u_g(4:6:m_dv.gridset.gsize)=md.rho_ice*md.g*(md.surface-md.z)/md.stokesreconditioning;
+
+if fem.isstokes,
+	m_bs=fem.m_bs;
+	m_ds=fem.m_ds;
+
+	%Compute slope of the bed
+	if m_bs.params.debug
+		disp(sprintf('\n%s',['computing bed slope (x and y derivatives)...']));
+	end
+	slopex=icediagnostic_core_linear(m_bs,'bed_slope_compute_x',inputs);
+	slopey=icediagnostic_core_linear(m_bs,'bed_slope_compute_y',inputs);
+
+	slopex=project3d(md,project2d(md,slopex(1:6:end),1),'node');
+	slopey=project3d(md,project2d(md,slopey(1:6:end),1),'node');
+
+	slopebed(1:6:m_bs.gridset.gsize,1)=slopex;
+	slopebed(2:6:m_bs.gridset.gsize,1)=slopey;
+	inputs.slopebed=slopebed;
+	inputs.velocity=u_g;
+
+	%update dirichlet boundary conditions with the velocities computed previously
+	gridset=m_ds.gridset;
+	m_ds.y_g=u_g; m_ds.ys=Reducevector_g(m_ds.y_g);
+
+	%compute stokes velocities and pressure
+	disp(sprintf('\n%s',['computing stokes velocities and pressure ...']));
+	u_g=icediagnostic_core_nonlinear(m_ds,'diagnostic_stokes',inputs);
+end
+
+%Reconditioning of the pressure
+u_g(4:6:m_dv.gridset.gsize)=u_g(4:6:m_dv.gridset.gsize)*md.stokesreconditioning;
Index: /issm/trunk/src/m/solutions/ice/icediagnostic_core_linear.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icediagnostic_core_linear.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icediagnostic_core_linear.m	(revision 1)
@@ -0,0 +1,66 @@
+function u_g=icediagnostic_core_linear(m,analysis_type,varargin);
+%ICEDIAGNOSTIC_CORE_LINEAR - core solution of linear problems
+%
+%   Core of the vertical diagnostic solution. No need for a non-linear iteration.
+%   Otherwise similar to ICEDIAGNOSTIC_CORE_NONLINEAR
+%
+%   Usage:
+%      u_g=icediagnostic_core_linear(m,analysis_type,varargin);
+%
+%   See also: ICEDIAGNOSTIC, ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR
+
+%global variables
+global cluster gridset
+
+if nargin==3,
+	inputs=varargin{1};
+else
+	inputs=struct();
+end
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+ys=m.ys;
+gridset=m.gridset;
+G_mn=m.Gmn;
+params=m.params;
+
+
+%recover parameters
+sparsity=params.sparsity;
+solver_type=params.solver_type;
+debug=params.debug;
+
+disp(sprintf('%s','   solving'));
+
+% Generate system matrices (stiffness and load)
+kflag=1; pflag=1;
+
+%generate stiffness and loads
+[K_gg,p_g]=SystemMatrices(elements,grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type);
+[K_gg,p_g]=PenaltySystemMatrices(grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type,K_gg,p_g);
+
+if cluster, 
+	K_gg=distributed(gplus(K_gg),'convert');
+	p_g=gplus(p_g);
+end
+
+% Reduce stiffness matrix from g set to f set (effectively rooting out the single point constraints), 
+% and compute modifications to loads from single point constraints.
+[K_ff K_fs]=IceReducematrixfromgtof(K_gg,G_mn); 
+
+% Reduce load from g set to f set
+p_f=IceReducerightside(p_g,G_mn,K_fs,ys);
+
+% Solve
+uf=Solver(K_ff,p_f,solver_type);
+if debug,
+	disp(sprintf('%s%g','      condition number of stiffness matrix: ',condest(K_ff)));
+end
+   
+
+% Add single point constraints back, ie increase f-set by s-set into the global g-set.
+u_g= full(Mergesolution_g(uf,G_mn,ys));
Index: /issm/trunk/src/m/solutions/ice/icediagnostic_core_nonlinear.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icediagnostic_core_nonlinear.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icediagnostic_core_nonlinear.m	(revision 1)
@@ -0,0 +1,161 @@
+function [u_g varargout]=icediagnostic_core_nonlinear(m,analysis_type, varargin);
+%ICEDIAGNOSTIC_CORE_NONLINEAR - core solution of non linear problems
+%
+%   Core of the diagnostic solution, deals with the Direct Shooting Method
+%   to linearize the non-linear material equations.
+%   varargin is for extra inputs to solution sequence.
+%   
+%   Usage:
+%      [u_g varargout]=icediagnostic_core_nonlinear(m,analysis_type,varargin);
+%
+%   See also: ICEDIAGNOSTIC, ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_LINEAR
+
+%global variables
+global cluster gridset element_debug element_debugid
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+ys=m.ys;
+gridset=m.gridset;
+params=m.params;
+G_mn=m.Gmn;
+
+%recover parameters
+sparsity=params.sparsity;
+solver_type=params.solver_type;
+eps_abs=params.eps_abs;
+eps_rel=params.eps_rel;
+yts=params.yts;
+debug=params.debug;
+element_debug=params.element_debug;
+element_debugid=params.element_debugid;
+
+%recover existing velocity if given in input and initialize solution
+if nargin==3,
+	inputs=varargin{1};
+
+	[velocity_param velocity_is_present]=recover_input(inputs,'velocity');
+	if velocity_is_present
+		soln(1).u_g=velocity_param;
+		soln(1).u_g(4:6:gridset.gsize)=0; %no pressure in the velocity
+		soln(2).u_g=velocity_param;
+		soln(2).u_g(4:6:gridset.gsize)=0; %no pressure in the velocity
+	else	
+		soln(1).u_g={};
+		soln(2).u_g={};
+	end
+else
+	velocity_is_present=0;
+	inputs=struct();
+	soln(1).u_g={};
+	soln(2).u_g={};
+end
+
+
+%Initialization
+count=2;
+converged=0;
+	
+if debug,
+	disp(sprintf('%s','   starting direct shooting method'));
+end
+
+while(~converged),
+
+	% Generate system matrices (stiffness and load)
+	%compute stiffness matrix flag
+	kflag=1;
+	%compute loads ? 
+	if strcmp(analysis_type, 'diagnostic_stokes'),
+		pflag=1;
+	else
+		if count==2, pflag=1; else pflag=0; end
+	end
+
+	%add velocity to inputs
+	inputs.velocity=soln(count).u_g;
+	inputs.oldvelocity=soln(count-1).u_g;
+	
+	%generate stiffness and loads
+	[K_gg,p_g]=SystemMatrices(elements,grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type);
+	[K_gg,p_g]=PenaltySystemMatrices(grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type,K_gg,p_g);
+
+	%Save loads 
+	if count==2, 
+		p_g_old=p_g;
+	else
+		p_g=p_g_old;
+	end
+	
+	if cluster, 
+		K_gg=distributed(gplus(K_gg),'convert');
+		p_g=gplus(p_g);
+	end
+	
+	% Reduce stiffness matrix from g set to f set (effectively rooting out the single point constraints), 
+	% and compute modifications to loads from single point constraints.
+	
+	[K_ff K_fs]=IceReducematrixfromgtof(K_gg,G_mn); 
+
+	% Reduce load from g set to f set
+	p_f=IceReducerightside(p_g,G_mn,K_fs,ys);
+
+	% Solve
+	u_f=Solver(K_ff,p_f,solver_type);
+	if debug,
+		disp(sprintf('%s%g','      condition number of stiffness matrix: ',condest(K_ff)));
+	end
+   
+	%increment index 
+	count=count+1;
+
+	% Add single point constraints back, ie increase f-set by s-set into the global g-set.
+	soln(count).u_g= full(Mergesolution_g(u_f,G_mn, ys)); %make solution full
+
+	%Figure out if convergence is reached.
+	if((count>=4)| velocity_is_present), %make sure we already iterated at least once.
+
+		%compute relative velocity difference for this step.
+		relative_change=norm(soln(count).u_g-soln(count-1).u_g,2)/norm(soln(count-1).u_g,2);
+
+		if relative_change<eps_rel, 
+			if debug, disp(sprintf('%s %g %s %g','      convergence criterion: norm(du)/norm(u)=',relative_change,' < ',eps_rel)); end
+			converged=1;
+		else
+			if debug, disp(sprintf('%s %g %s %g','      convergence criterion: norm(du)/norm(u)=',relative_change,' > ',eps_rel)); end
+			converged=0;
+		end
+
+		if ~isnan(eps_abs)
+			%compute velocity difference for this step.
+			change=max(abs(soln(count).u_g-soln(count-1).u_g))*yts;
+
+			if change<eps_abs, 
+				if debug, disp(sprintf('%s %g %s %g %s','      convergence criterion: max(du)=',change,' < ',eps_abs,'m/yr')); end
+			else
+				if debug, disp(sprintf('%s %g %s %g %s','      convergence criterion: max(du)=',change,' > ',eps_abs,'m/yr')); end
+				converged=0;
+			end
+		end
+	end
+end
+
+%prepare output 
+u_g=soln(end).u_g;
+
+%more output might be needed, for ex when running in cielocontrol.m
+nout=max(nargout,1)-1;
+if nout==2,
+	%K_ff and K_fs are requested, for the case where we have no loads (ie basal drag)
+	inputs.drag=zeros(gridset.gsize,1); kflag=1;pflag=1; 
+	inputs.velocity=soln(count).u_g;
+
+	[K_gg,p_g]=SystemMatrices(elements,grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type);
+	[K_gg,p_g]=PenaltySystemMatrices(grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type,K_gg,p_g);
+	[K_ff K_fs]=IceReducematrixfromgtof(K_gg,G_mn); 
+	varargout(1)={K_ff};
+	varargout(2)={K_fs};
+end
Index: /issm/trunk/src/m/solutions/ice/iceglobal.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/iceglobal.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/iceglobal.m	(revision 1)
@@ -0,0 +1,9 @@
+%ICEGLOBAL - generate global variable
+%
+%   this routine creates some global variables needed by the solution sequence
+
+global gridset %structure holding grid sets
+global cluster %is a parallel computation requested?
+global sqrt3 %used in Jacobian computations.
+
+sqrt3=sqrt(3.0);
Index: /issm/trunk/src/m/solutions/ice/icemelting_core.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icemelting_core.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icemelting_core.m	(revision 1)
@@ -0,0 +1,55 @@
+function melting_g=icemelting_core(m,analysis_type,varargin);
+%ICEMELTING_CORE - core solution of melting computation
+%
+%   Usage:
+%      melting_g=icemelting_core(m,analysis_type,varargin)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+ys=m.ys;
+gridset=m.gridset;
+G_mn=m.Gmn;
+params=m.params;
+
+%recover parameters
+sparsity=params.sparsity;
+solver_type=params.solver_type;
+
+%recover extra inputs and initialize solution
+if nargin==3,
+	inputs=varargin{1};
+else	
+	inputs=struct();
+end
+
+%initialize solution vector
+melting_g=[];
+
+disp(sprintf('%s','   solving'));
+
+% Generate system matrices (stiffness and load)
+%stiffness is computed at each step, not the loads.
+kflag=1;pflag=1;
+
+%generate stiffness and loads
+[K_gg,p_g]=SystemMatrices(elements,grids,loads,materials,kflag, pflag, params.sparsity,inputs,'melting');
+[K_gg,p_g]=PenaltySystemMatrices(grids,loads,materials,kflag, pflag, params.sparsity,inputs,'melting',K_gg,p_g);
+
+% Reduce stiffness matrix from g set to f set (effectively rooting out the single point constraints),
+% and compute modifications to loads from single point constraints.
+[K_ff K_fs]=IceReducematrixfromgtof(K_gg,G_mn); 
+
+% Reduce load from g set to f set
+p_f=IceReducerightside(p_g,G_mn,K_fs,ys);
+
+% Solve
+melting_f=Solver(K_ff,p_f,params.solver_type);
+
+% Add single point constraints back, ie increase f-set by s-set into the global g-set.
+melting_g= Mergesolution_g(melting_f,G_mn,ys); 
Index: /issm/trunk/src/m/solutions/ice/iceparameters.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/iceparameters.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/iceparameters.m	(revision 1)
@@ -0,0 +1,104 @@
+function md=iceparameters(md);
+%ICEPARAMETERS - compute parameters
+%
+%   This routine is caled by the solver to compute the parameters
+%   that are given in md.outputparameters (stress, strain rate,...)
+%
+%   Usage:
+%      md=iceparameters(md)
+
+%define global variables
+iceglobal
+
+%determine if run is parallel
+if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
+
+%for now, only serial support is in
+if cluster,
+	error('iceparameters error message: parallel support not implemented yet');
+end
+
+if strcmpi(md.type,'2d'),
+	%First, build elements,grids,loads, etc ... for thermal and melting 
+	m_dh=CreateFemModel(md,'diagnostic_horiz');
+
+	%Are any more computations requested? 
+	if ~isempty(md.parameteroutput),
+		disp(sprintf('\n%s',['computing outputs...']));
+		%velocity field
+		u_g=zeros(gridset.gsize,1); 
+		u_g(1:6:gridset.gsize)=md.vx/md.yts; %from m/a to m/s
+		u_g(2:6:gridset.gsize)=md.vy/md.yts;
+
+		%Go through fields of parameteroutput and compute
+		for i=1:length(md.parameteroutput),
+			if strcmpi(md.parameteroutput{i},'viscousheating'),
+				disp(sprintf('%s',['   viscousheating']));
+				md.viscousheating=ViscousHeatingCompute(m_dh,struct('velocity',u_g),md.type);
+			elseif strcmpi(md.parameteroutput{i},'pressure_elem'),
+				disp(sprintf('%s',['   pressure_elem']));
+				md.pressure_elem=PressureElemCompute(m_dh,struct('velocity',u_g,'elementonstokes',md.elements_type(:,2)),md.type);
+			elseif strcmpi(md.parameteroutput{i},'strainrate'),
+				disp(sprintf('%s',['   strainrate']));
+				md.strainrate=StrainRateCompute(m_dh,struct('velocity',u_g),md.type);
+			elseif strcmpi(md.parameteroutput{i},'stress'),
+				disp(sprintf('%s',['   stress']));
+				md.stress=StressCompute(m_dh,struct('velocity',u_g,'elementonstokes',md.elements_type(:,2)),md.type);
+			elseif strcmpi(md.parameteroutput{i},'stress_bed'),
+				disp(sprintf('%s',['   stress_bed']));
+				md.stress_bed=StressBedCompute(m_dh,struct('velocity',u_g,'elementonstokes',md.elements_type(:,2)),md.type);
+			elseif strcmpi(md.parameteroutput{i},'stress_surface'),
+				disp(sprintf('%s',['   stress_surface']));
+				md.stress_surface=StressSurfaceCompute(m_dh,struct('velocity',u_g,'elementonstokes',md.elements_type(:,2)),md.type);
+			elseif strcmpi(md.parameteroutput{i},'deviatoricstress'),
+				disp(sprintf('%s',['   deviatoricstress']));
+				md.deviatoricstress=DeviatoricStressCompute(m_dh,struct('velocity',u_g),md.type);
+			end
+		end
+	end
+
+else
+
+	%First, build elements,grids,loads, etc ... for horizontal, base vertical and vertical model
+	m_dv=CreateFemModel(md,'diagnostic_vert');
+
+	%Are any more computations requested? 
+	if ~isempty(md.parameteroutput),
+		disp(sprintf('\n%s',['computing outputs...']));
+		%velocity field
+		u_g=zeros(gridset.gsize,1); 
+		u_g(1:6:gridset.gsize)=md.vx/md.yts; %from m/a to m/s
+		u_g(2:6:gridset.gsize)=md.vy/md.yts;
+		u_g(3:6:gridset.gsize)=md.vz/md.yts;
+		if ~isnan(md.pressure),
+			u_g(4:6:gridset.gsize)=md.pressure;
+		end
+
+		%Go through fields of parameteroutput and compute
+		for i=1:length(md.parameteroutput),
+			if strcmpi(md.parameteroutput{i},'viscousheating'),
+				disp(sprintf('%s',['   viscousheating']));
+				md.viscousheating=ViscousHeatingCompute(m_dv,struct('velocity',u_g),md.type);
+			elseif strcmpi(md.parameteroutput{i},'pressure_elem'),
+				disp(sprintf('%s',['   pressure_elem']));
+				md.pressure_elem=PressureElemCompute(m_dv,struct('velocity',u_g,'elementonstokes',md.elements_type(:,2)),md.type);
+			elseif strcmpi(md.parameteroutput{i},'strainrate'),
+				disp(sprintf('%s',['   strainrate']));
+				md.strainrate=StrainRateCompute(m_dv,struct('velocity',u_g),md.type);
+			elseif strcmpi(md.parameteroutput{i},'stress'),
+				disp(sprintf('%s',['   stress']));
+				md.stress=StressCompute(m_dv,struct('velocity',u_g,'elementonstokes',md.elements_type(:,2)),md.type);
+			elseif strcmpi(md.parameteroutput{i},'stress_bed'),
+				disp(sprintf('%s',['   stress_bed']));
+				md.stress_bed=StressBedCompute(m_dv,struct('velocity',u_g,'elementonstokes',md.elements_type(:,2)),md.type);
+			elseif strcmpi(md.parameteroutput{i},'stress_surface'),
+				disp(sprintf('%s',['   stress_surface']));
+				md.stress_surface=StressSurfaceCompute(m_dv,struct('velocity',u_g,'elementonstokes',md.elements_type(:,2)),md.type);
+			elseif strcmpi(md.parameteroutput{i},'deviatoricstress'),
+				disp(sprintf('%s',['   deviatoricstress']));
+				md.deviatoricstress=DeviatoricStressCompute(m_dv,struct('velocity',u_g),md.type);
+			end
+		end
+	end
+
+end
Index: /issm/trunk/src/m/solutions/ice/iceparameters_wrapper.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/iceparameters_wrapper.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/iceparameters_wrapper.m	(revision 1)
@@ -0,0 +1,34 @@
+function md=iceparameters_wrapper(md);
+%ICEPARAMETERS_WRAPPER - wrapper of the parameters solution sequence
+%
+%   parameters wrapper for parameters matlab driven solution. 
+%   we need a wrapper so that we can launch the parameters solution using Matlab parallel, 
+%
+%   Usage:
+%      md=iceparameters_wrapper(md)
+
+%start timing
+t1=clock;
+
+%If running in parallel, launch core parameters routine within a parallel job.
+if strcmpi(md.cluster,'yes'),
+	sched = findResource('scheduler', 'configuration', md.scheduler_configuration);
+	pjob = createParallelJob(sched);
+	set(pjob, 'FileDependencies', {'iceparameters.m'});
+	set(pjob, 'MaximumNumberOfWorkers', md.np); set(pjob, 'MinimumNumberOfWorkers', md.np);
+	t = createTask(pjob, @iceparameters, 1, {md});
+	set(t, 'CaptureCommandWindowOutput', true)
+	disp('   Submitting job to cluster');
+	submit(pjob);
+	waitForState(pjob);
+	get(t, 'CommandWindowOutput')
+	get(t,'ErrorMessage')
+	disp('   Done running on cluster');
+else
+	md=iceparameters(md);
+end
+
+%stop timing
+t2=clock;
+
+disp(sprintf('\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']));
Index: /issm/trunk/src/m/solutions/ice/iceprognostic.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/iceprognostic.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/iceprognostic.m	(revision 1)
@@ -0,0 +1,70 @@
+function md=iceprognostic(md)
+%ICEPROGNOSTIC - prognostic solution
+%
+%   This routine is used to compute the evolution of the geometry
+%   of a model
+%
+%   Usage:
+%      md=iceprognostic(md)
+
+%define global variables
+iceglobal
+
+%determine if run is parallel
+if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
+
+%for now, only serial support is in
+if cluster,
+	error('iceprognostic error message: parallel support not implemented yet');
+end
+
+%setup some parameters to be passed to the core solution
+params.sparsity=md.sparsity;
+params.solver_type=md.solver_type;
+params.eps_rel=md.eps_rel;
+params.eps_abs=md.eps_abs;
+params.debug=md.debug;
+
+%First, build elements,grids,loads, etc ... for prognostic
+m=CreateFemModel(md,'prognostic');
+
+%compute depth averaged horizontal velocity
+u_g=zeros(gridset.gsize,1);
+u_g(1:6:end)=md.vx/md.yts; %from m/yr to m/s
+u_g(2:6:end)=md.vy/md.yts; %from m/yr to m/s
+u_g(3:6:end)=md.vz/md.yts; %from m/yr to m/s
+
+if strcmpi(md.type,'3d'),
+	velocity_average=HorizontalVelocityDepthAverage(md,u_g);
+else
+	%the velocity is already depthaverdged
+	velocity_average=u_g;
+end
+
+%move surface and bed velocities to first lower layer. This will be needed by the prognostic model
+melting=zeros(gridset.gsize,1);
+accumulation=zeros(gridset.gsize,1);
+if strcmpi(md.type,'3d'),
+	melting(1:6:end)=ShiftLayers(md,md.melting,1,1);
+	accumulation(1:6:end)=ShiftLayers(md,md.accumulation,md.numlayers,1);
+else
+	melting(1:6:end)=md.melting/md.yts;           %from m/yr to m/s
+	accumulation(1:6:end)=md.accumulation/md.yts; %from m/yr to m/s
+end
+
+%prepare inputs
+thickness=zeros(gridset.gsize,1);thickness(1:6:end)=md.thickness;
+%inputs=struct('thickness',thickness,'melting',melting,'accumulation',accumulation,...
+%'surface_vertical_velocity',ws,'basal_vertical_velocity',wb,'dt',md.dt,'velocity_average',velocity_average);
+inputs=struct('thickness',thickness,'melting',melting,'accumulation',accumulation,'dt',md.dt,'velocity_average',velocity_average);
+
+%Run core solution
+h_g=iceprognostic_core(m,'prognostic',inputs);
+
+%project collapsed thickness onto 3d mesh
+indx=1:6:m.gridset.gsize; indx=indx(m.tpart);
+if strcmpi(md.type,'3d'),
+	md.new_thickness=project3d(md,project2d(md,h_g(indx),1),'node');
+else
+	md.new_thickness=h_g(indx);
+end
Index: /issm/trunk/src/m/solutions/ice/iceprognostic_core.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/iceprognostic_core.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/iceprognostic_core.m	(revision 1)
@@ -0,0 +1,58 @@
+function h_g=iceprognostic_core(m,analysis_type,varargin)
+%ICEPROGNOSTIC_CORE - core of prognostic solution
+%
+%   This routine is used to compute the new thickness of a model after a time step ∆t
+%   
+%   Usage:
+%      h_g=iceprognostic_core(m,analysis_type,varargin)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+ys=m.ys;
+gridset=m.gridset;
+G_mn=m.Gmn;
+params=m.params;
+
+%recover parameters
+sparsity=params.sparsity;
+solver_type=params.solver_type;
+
+%recover extra inputs and initialize solution
+if nargin==3,
+	inputs=varargin{1};
+else	
+	inputs=struct();
+end
+
+disp(sprintf('%s','   solving'));
+
+% Generate system matrices (stiffness and load)
+kflag=1; pflag=1;
+
+%generate stiffness and loads
+[K_gg,p_g]=SystemMatrices(elements,grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type);
+[K_gg,p_g]=PenaltySystemMatrices(grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type,K_gg,p_g);
+
+if cluster, 
+	K_gg=distributed(gplus(K_gg),'convert');
+	p_g=gplus(p_g);
+end
+
+% Reduce stiffness matrix from g set to f set (effectively rooting out the single point constraints), 
+% and compute modifications to loads from single point constraints.
+[K_ff K_fs]=IceReducematrixfromgtof(K_gg,G_mn); 
+
+% Reduce load from g set to f set
+p_f=IceReducerightside(p_g,G_mn,K_fs,ys);
+
+% Solve
+uf=Solver(K_ff,p_f,solver_type);
+
+% Add single point constraints back, ie increase f-set by s-set into the global g-set.
+h_g= full(Mergesolution_g(uf,G_mn,ys));
Index: /issm/trunk/src/m/solutions/ice/iceprognostic_wrapper.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/iceprognostic_wrapper.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/iceprognostic_wrapper.m	(revision 1)
@@ -0,0 +1,34 @@
+function md=iceprognostic_wrapper(md);
+%ICEPROGNOSTIC_WRAPPER - wrapper of the prognostic solution
+%
+%   prognostic wrapper for prognostic matlab driven solution. 
+%   we need a wrapper so that we can launch the prognostic solution using Matlab parallel, 
+%
+%   Usage:
+%      md=iceprognostic_wrapper(md);
+
+%start timing
+t1=clock;
+
+%If running in parallel, launch core prognostic routine within a parallel job.
+if strcmpi(md.cluster,'yes'),
+	sched = findResource('scheduler', 'configuration', md.scheduler_configuration);
+	pjob = createParallelJob(sched);
+	set(pjob, 'FileDependencies', {'iceprognostic.m'});
+	set(pjob, 'MaximumNumberOfWorkers', md.np); set(pjob, 'MinimumNumberOfWorkers', md.np);
+	t = createTask(pjob, @iceprognostic, 1, {md});
+	set(t, 'CaptureCommandWindowOutput', true)
+	disp('   Submitting job to cluster');
+	submit(pjob);
+	waitForState(pjob);
+	get(t, 'CommandWindowOutput')
+	get(t,'ErrorMessage')
+	disp('   Done running on cluster');
+else
+	md=iceprognostic(md);
+end
+
+%stop timing
+t2=clock;
+
+disp(sprintf('\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']));
Index: /issm/trunk/src/m/solutions/ice/icethermal.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icethermal.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icethermal.m	(revision 1)
@@ -0,0 +1,97 @@
+function md=icethermal(md,analysis_type)
+%ICETHERMAL - thermal matlab driven solution
+%
+%   Usage:
+%      md=icethermal(md,analysis_type)
+
+%define global variables
+iceglobal
+
+%determine if run is parallel
+if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
+
+%for now, only serial support is in
+if cluster,
+	error('icethermal error message: parallel support not implemented yet');
+end
+
+%First, build elements,grids,loads, etc ... for thermal and melting 
+m_t=CreateFemModel(md,analysis_type);
+if strcmpi(analysis_type,'thermalsteady'),
+	m_m=CreateFemModel(md,'meltingsteady');
+else
+	m_m=CreateFemModel(md,'meltingtransient');
+end
+%initialize velocity,pressure and material properties
+velocity=zeros(m_t.gridset.gsize,1);
+velocity(1:6:m_t.gridset.gsize)=md.vx(m_t.part)/md.yts;
+velocity(2:6:m_t.gridset.gsize)=md.vy(m_t.part)/md.yts;
+velocity(3:6:m_t.gridset.gsize)=md.vz(m_t.part)/md.yts;
+
+pressure=zeros(m_t.gridset.gsize,1);
+pressure(1:6:m_t.gridset.gsize)=md.pressure;
+
+if strcmpi(analysis_type,'thermalsteady'),
+
+	%Call core thermal computation
+	disp('   computing temperature...');
+	gridset=m_t.gridset;
+	inputs=struct('pressure',pressure,'velocity',velocity,'dt',md.dt);
+	[t_g loads_t melting_offset]=icethermal_core(m_t,analysis_type,inputs);
+	
+	%Call core melting computation
+	disp('   computing melting...');
+	gridset=m_m.gridset;
+	inputs=struct('pressure',pressure,'temperature',t_g,'melting_offset',melting_offset);
+	melting_g=icemelting_core(m_m,analysis_type,inputs);
+	
+	%Wrap up
+	indx=1:6:gridset.gsize;
+	indx=indx(m_t.tpart);
+	md.temperature=t_g(indx);
+	md.melting=melting_g(indx)*md.yts; %from m/s to m/a
+else
+
+	nsteps=md.ndt/md.dt;
+
+	%initialize temperature and melting
+	temperature=zeros(gridset.gsize,1);
+	melting=zeros(gridset.gsize,1);
+	temperature(1:6:gridset.gsize)=md.temperature;
+	melting(1:6:gridset.gsize)=md.melting/md.yts; %in m/s
+	soln.t_g=temperature;
+	soln.melting_g=melting;
+	soln.time=0;
+
+
+	for n=1:nsteps, 
+
+		soln(n+1).time=(n)*md.dt;
+		disp(sprintf('\n%s%i/%i\n','time step: ',n,md.ndt/md.dt));
+
+		%Call core thermal computation
+		disp('   computing temperature...');
+		gridset=m_t.gridset;
+		inputs=struct('pressure',pressure,'temperature',soln(n).t_g,'velocity',velocity,'dt',md.dt);
+		[soln(n+1).t_g loads_t  melting_offset]=icethermal_core(m_t,analysis_type,inputs);
+
+		%Call core melting computation
+		disp('   computing melting...');
+		gridset=m_m.gridset;
+		inputs=struct('pressure',pressure,'temperature',soln(n).t_g,'melting_offset',melting_offset,'dt',md.dt);
+		soln(n+1).melting_g=icemelting_core(m_m,analysis_type,inputs);
+		
+	end
+	
+	%Wrap up
+	indx=1:6:m_t.gridset.gsize;
+	indx=indx(m_t.tpart);
+ 	solution=struct('time',{},'temperature',{},'melting',{});
+
+	for n=1:nsteps+1,
+		solution(n).temperature=soln(n).t_g(indx);
+		solution(n).melting=soln(n).melting_g(indx)*md.yts; %in m/a
+		solution(n).time=soln(n).time/md.yts; %in year
+	end
+	md.thermaltransient_results=solution;
+end
Index: /issm/trunk/src/m/solutions/ice/icethermal_core.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icethermal_core.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icethermal_core.m	(revision 1)
@@ -0,0 +1,73 @@
+function [t_g loads melting_offset]=icethermal_core(m,analysis_type,varargin);
+%ICETHERMAL_CORE - core of the thermal solution
+%
+%   Usage:
+%      [t_g loads melting_offset]=icethermal_core(m,analysis_type,varargin)
+
+%global variables
+global cluster gridset
+
+%recover fem model fields
+elements=m.elements;
+grids=m.grids;
+materials=m.materials;
+loads=m.loads;
+ys=m.ys;
+gridset=m.gridset;
+G_mn=m.Gmn;
+params=m.params;
+
+%recover parameters
+sparsity=params.sparsity;
+solver_type=params.solver_type;
+
+%recover extra inputs and initialize solution
+if nargin==3,
+	inputs=varargin{1};
+else	
+	inputs=struct();
+end
+
+%initialize solution vector
+t_g=[];
+
+converged=0;
+firstiteration=1;
+
+disp(sprintf('%s','   starting direct shooting method'));
+
+dt=inputs.dt;
+
+%Recover pressure from inputs
+pressure=inputs.pressure;
+
+while(~converged),
+ 
+	% Generate system matrices (stiffness and load)
+    
+	%loads and stiffness are computed only once, not the penalties
+	kflag=1;pflag=1;
+
+	%generate stiffness and loads
+	if firstiteration
+		[K_gg,p_g]=SystemMatrices(elements,grids,loads,materials,kflag, pflag, params.sparsity,inputs,analysis_type);
+		firstiteration=0;
+	end
+	[K_gg_penalized,p_g_penalized melting_offset]=PenaltySystemMatrices(grids,loads,materials,kflag, pflag, params.sparsity,inputs,analysis_type,K_gg,p_g);
+
+	% Reduce stiffness matrix from g set to f set (effectively rooting out the single point constraints),
+	% and compute modifications to loads from single point constraints.
+	[K_ff K_fs]=IceReducematrixfromgtof(K_gg_penalized,G_mn); 
+
+	% Reduce load from g set to f set
+	p_f=IceReducerightside(p_g_penalized,G_mn,K_fs,ys);
+	
+	% Solve
+	t_f=Solver(K_ff,p_f,params.solver_type);
+ 
+	% Add single point constraints back, ie increase f-set by s-set into the global g-set.
+	t_g= Mergesolution_g(t_f,G_mn,ys); 
+
+	[loads,converged]=IcePenaltyConstraints(loads,grids,materials,params,struct('pressure',pressure, 'dt',dt, 'temperature',t_g));
+
+end
Index: /issm/trunk/src/m/solutions/ice/icethermal_wrapper.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icethermal_wrapper.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icethermal_wrapper.m	(revision 1)
@@ -0,0 +1,34 @@
+function md=icethermal_wrapper(md,analysis_type);
+%ICETHERMAL_WRAPPER - wrapper of the thermal solution
+%
+%   thermal wrapper for thermal matlab driven solution. 
+%   we need a wrapper so that we can launch the thermal solution using Matlab parallel, 
+%
+%   Usage:
+%      md=icethermal_wrapper(md,analysis_type);
+
+%start timing
+t1=clock;
+
+%If running in parallel, launch core thermal routine within a parallel job.
+if strcmpi(md.cluster,'yes'),
+	sched = findResource('scheduler', 'configuration', md.scheduler_configuration);
+	pjob = createParallelJob(sched);
+	set(pjob, 'FileDependencies', {'icethermal.m'});
+	set(pjob, 'MaximumNumberOfWorkers', md.np); set(pjob, 'MinimumNumberOfWorkers', md.np);
+	t = createTask(pjob, @icethermal, 1, {md});
+	set(t, 'CaptureCommandWindowOutput', true)
+	disp('   Submitting job to cluster');
+	submit(pjob);
+	waitForState(pjob);
+	get(t, 'CommandWindowOutput')
+	get(t,'ErrorMessage')
+	disp('   Done running on cluster');
+else
+	md=icethermal(md,analysis_type);
+end
+
+%stop timing
+t2=clock;
+
+disp(sprintf('\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']));
Index: /issm/trunk/src/m/solutions/ice/icetransient.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icetransient.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icetransient.m	(revision 1)
@@ -0,0 +1,22 @@
+function md=icetransient(md);
+%ICETRANSIENT - transient solution
+%
+%   Usage:
+%      md=icetransient(md)
+
+%define global variables
+iceglobal
+
+%determine if run is parallel
+if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
+
+%for now, only serial support is in
+if cluster,
+	error('icetransient error message: parallel support not implemented yet');
+end
+
+if strcmpi(md.type,'2d'),
+	md=icetransient2d(md);
+else
+	md=icetransient3d(md);
+end
Index: /issm/trunk/src/m/solutions/ice/icetransient2d.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icetransient2d.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icetransient2d.m	(revision 1)
@@ -0,0 +1,111 @@
+function md=icetransient2d(md);
+%ICETRANSIENT2D - transient solution of 2d models
+%
+%   Usage:
+%      md=icetransient2d(md)
+
+global gridset
+
+%Create fem structure (input of icediagnostic2d)
+fem=struct();
+
+%Figure out which type of elements are present
+[fem.ishutter,fem.ismacayealpattyn,fem.isstokes]=DiagnosticSolutionType(md.elements_type);
+
+%First, build elements,grids,loads, etc ... for horizontal model
+if fem.ishutter,
+	fem.m_ss=CreateFemModel(md,'surface_slope_compute');
+	fem.m_dhu=CreateFemModel(md,'diagnostic_hutter');
+end
+if fem.ismacayealpattyn,
+	fem.m_dh=CreateFemModel(md,'diagnostic_horiz');
+end
+m_p=CreateFemModel(md,'prognostic');
+
+%initialize (velocity,pressure)
+solution.u_g=zeros(m_p.gridset.gsize,1);
+if ~isnan(md.vx), solution.u_g(1:6:m_p.gridset.gsize)=md.vx/md.yts; end
+if ~isnan(md.vy), solution.u_g(2:6:m_p.gridset.gsize)=md.vy/md.yts; end
+
+%initialize geometry and time
+solution.thickness=zeros(m_p.gridset.gsize,1);solution.thickness(1:6:m_p.gridset.gsize)=md.thickness;
+solution.surface=zeros(m_p.gridset.gsize,1);solution.surface(1:6:m_p.gridset.gsize)=md.surface;
+solution.bed=zeros(m_p.gridset.gsize,1);solution.bed(1:6:m_p.gridset.gsize)=md.bed;
+solution.time=0;
+
+%melting and accumulation are taken constant for all iterations
+melting=zeros(m_p.gridset.gsize,1);
+accumulation=zeros(m_p.gridset.gsize,1);
+melting(1:6:end)=md.melting/md.yts;           %from m/yr to m/s
+accumulation(1:6:end)=md.accumulation/md.yts; %from m/yr to m/s
+
+%build constant inputs
+fem.inputs=struct();
+fem.inputs.accumulation=accumulation;
+fem.inputs.melting=melting;
+fem.inputs.dt=md.dt;
+
+%first time step is given by model. 
+dt=md.dt;
+finaltime=md.ndt;
+time=dt;
+n=1; %counter
+
+while  time<finaltime+dt, %make sure we run up to finaltime.
+
+	disp(sprintf('\n%s%g%s%g%s%g\n','time [yr]: ',time/md.yts,'    iteration number: ',n,'/',floor(finaltime/dt)));
+	
+	solution(n+1).time=time;
+
+	%update inputs
+	fem.inputs.velocity=solution(n).u_g;
+	fem.inputs.thickness=solution(n).thickness;
+	fem.inputs.bed=solution(n).bed;
+	fem.inputs.surface=solution(n).surface;
+
+	%Deal with velocities.
+
+	%Get horizontal solution. 
+	solution(n+1).u_g=icediagnostic2d(md,fem);
+
+	%compute new thickness
+	disp(sprintf('%s','   computing new thickness...'));
+	fem.inputs.velocity_average=solution(n+1).u_g;
+	new_thickness=iceprognostic_core(m_p,'prognostic',fem.inputs);
+
+	%update surface and bed using the new thickness
+	disp(sprintf('%s','   updating geometry...'));
+	indx=1:6:m_p.gridset.gsize; indx=indx(m_p.tpart);
+	[new_bed,new_surface,new_thickness]=UpdateGeometry(md,new_thickness(indx),solution(n).bed(indx),solution(n).surface(indx));
+	
+	%Record bed surface and thickness in the solution
+	solution(n+1).thickness=zeros(m_p.gridset.gsize,1);solution(n+1).thickness(1:6:m_p.gridset.gsize)=new_thickness;
+	solution(n+1).bed=zeros(m_p.gridset.gsize,1);solution(n+1).bed(1:6:m_p.gridset.gsize)=new_bed;
+	solution(n+1).surface=zeros(m_p.gridset.gsize,1);solution(n+1).surface(1:6:m_p.gridset.gsize)=new_surface;
+
+	%figure out if time stepping is good
+	disp(sprintf('%s','   checking time stepping...'));
+	[back,dt,time]=TimeStepping(md,solution,dt,time);
+	if back,
+		continue;
+	end
+
+	%update time and counter
+	time=time+dt;
+	n=n+1;
+
+end
+
+%load results onto model
+indx=1:6:m_p.gridset.gsize; indx=indx(m_p.tpart);
+indy=2:6:m_p.gridset.gsize; indy=indy(m_p.tpart);
+for i=1:length(solution),
+	solution2(i).vx=solution(i).u_g(indx)*md.yts;
+	solution2(i).vy=solution(i).u_g(indy)*md.yts;
+	solution2(i).vel=sqrt(solution2(i).vx.^2+solution2(i).vy.^2);
+	solution2(i).thickness=solution(i).thickness(indx);
+	solution2(i).surface=solution(i).surface(indx);
+	solution2(i).bed=solution(i).bed(indx);
+	solution2(i).time=solution(i).time/md.yts;
+end
+md.transient_results=solution2;
Index: /issm/trunk/src/m/solutions/ice/icetransient3d.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icetransient3d.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icetransient3d.m	(revision 1)
@@ -0,0 +1,166 @@
+function md=icetransient3d(md);
+%ICETRANSIENT3D - transient solution of 3d models
+%
+%   Usage:
+%      md=icetransient3d(md)
+
+global gridset
+
+%Create fem structure
+fem=struct();
+
+%Figure out which type of elements are present
+[fem.ishutter,fem.ismacayealpattyn,fem.isstokes]=DiagnosticSolutionType(md.elements_type);
+
+%First, build elements,grids,loads, etc ... for horizontal, base vertical and vertical model
+if fem.ismacayealpattyn,
+	fem.m_dh=CreateFemModel(md,'diagnostic_horiz');
+end
+if fem.ishutter,
+	fem.m_ss=CreateFemModel(md,'surface_slope_compute');
+	fem.m_dhu=CreateFemModel(md,'diagnostic_hutter');
+end
+if fem.isstokes,
+	fem.m_bs=CreateFemModel(md,'bed_slope_compute');
+	fem.m_ds=CreateFemModel(md,'diagnostic_stokes');
+end
+fem.m_dbv=CreateFemModel(md,'diagnostic_basevert');
+fem.m_dv=CreateFemModel(md,'diagnostic_vert');
+
+%Second, build elements,grids,loads, etc ... for thermal and prognostic model
+fem.m_t=CreateFemModel(md,'thermaltransient');
+fem.m_m=CreateFemModel(md,'meltingtransient');
+fem.m_p=CreateFemModel(md,'prognostic');
+
+%initialize (velocity,pressure,...)
+solution.u_g=zeros(fem.m_dhu.gridset.gsize,1);
+if ~isnan(md.vx), solution.u_g(1:6:fem.m_dhu.gridset.gsize)=md.vx/md.yts; end
+if ~isnan(md.vy), solution.u_g(2:6:fem.m_dhu.gridset.gsize)=md.vy/md.yts; end
+if ~isnan(md.vz), solution.u_g(3:6:fem.m_dhu.gridset.gsize)=md.vz/md.yts; end
+solution.pressure=zeros(fem.m_dhu.gridset.gsize,1); solution.pressure(1:6:fem.m_dhu.gridset.gsize)=md.rho_ice*md.g*(md.surface-md.z); %lithostatic pressure to spin up
+solution.t_g=zeros(fem.m_t.gridset.gsize,1);
+if ~isempty(md.temperature), 
+	solution.t_g(1:6:fem.m_t.gridset.gsize)=md.temperature;
+else
+	solution.t_g(1:6:fem.m_t.gridset.gsize)=md.meltingpoint;
+end
+pos=find(isnan(solution.t_g));
+solution.t_g(pos)=md.meltingpoint;
+if ~isempty(md.melting), solution.melting_g(1:6:fem.m_m.gridset.gsize)=md.melting;end;
+
+%initialize geometry and time
+solution.mesh=struct('elements',md.elements,'grids',[md.x md.y md.z]);
+solution.thickness=zeros(fem.m_dhu.gridset.gsize,1);solution.thickness(1:6:fem.m_dhu.gridset.gsize)=md.thickness;
+solution.surface=zeros(fem.m_dhu.gridset.gsize,1);solution.surface(1:6:fem.m_dhu.gridset.gsize)=md.surface;
+solution.bed=zeros(fem.m_dhu.gridset.gsize,1);solution.bed(1:6:fem.m_dhu.gridset.gsize)=md.bed;
+solution.time=0;
+
+%build constant inputs
+fem.inputs=struct();
+
+fem.inputs.melting=zeros(fem.m_m.gridset.gsize,1); melting=ShiftLayers(md,md.melting,1,1); fem.inputs.melting(1:6:fem.m_m.gridset.gsize)=melting;
+fem.inputs.accumulation=zeros(fem.m_m.gridset.gsize,1); accumulation=ShiftLayers(md,md.accumulation,md.numlayers,1); fem.inputs.accumulation(1:6:fem.m_m.gridset.gsize)=accumulation;
+fem.inputs.dt=md.dt;
+
+%first time step is given by model. 
+dt=md.dt;
+finaltime=md.ndt;
+time=dt;
+n=1; %counter
+
+while  time<finaltime+dt, %make sure we run up to finaltime.
+
+	disp(sprintf('\n%s%g%s%g%s%g\n','time [yr]: ',time/md.yts,'    iteration number: ',n,'/',floor(finaltime/dt)));
+	
+	solution(n+1).time=time;
+
+	%update inputs
+	fem.inputs.velocity=solution(n).u_g;
+	fem.inputs.pressure=solution(n).pressure;
+	fem.inputs.temperature=full(solution(n).t_g);
+	fem.inputs.thickness=solution(n).thickness;
+	fem.inputs.bed=solution(n).bed;
+	fem.inputs.surface=solution(n).surface;
+
+	%%Deal with temperature first 
+	%disp('   computing temperature...');
+	%[solution(n+1).t_g loads_t melting_offset]=icethermal_core(fem.m_t,'thermaltransient',fem.inputs);
+	solution(n+1).t_g=solution(1).t_g;
+	%disp('   computing melting...');
+	%fem.inputs.temperature=full(solution(n+1).t_g);
+	%fem.inputs.melting_offset=melting_offset;
+	%solution(n+1).melting_g=icemelting_core(fem.m_m,'thermaltransient',fem.inputs);
+	solution(n+1).melting_g=solution(1).melting_g;
+
+	%Compute depth averaged temperature for 2d type elements.
+	%temperature_average2d=DepthAverage(md,solution(n+1).t_g(1:6:fem.m_t.gridset.gsize));
+	%temperature_average=project3d(md,temperature_average2d,'node');
+	%temperature_average_g=zeros(fem.m_t.gridset.gsize,1);temperature_average_g(1:6:fem.m_t.gridset.gsize)=temperature_average;
+	%fem.inputs.temperature_average=temperature_average_g;
+	
+	%Deal with velocities.
+	disp(sprintf('%s','   computing velocities...'));
+	solution(n+1).u_g=icediagnostic3d(md,fem);
+	solution(n+1).pressure=zeros(fem.m_dv.gridset.gsize,1); solution(n+1).pressure(1:6:end)=solution(n+1).u_g(4:6:end);
+
+	%compute new thickness
+	disp(sprintf('\n%s','   computing new thickness...'));
+	%compute depth averaged horizontal velocity
+	velocity_average=HorizontalVelocityDepthAverage(md,solution(n+1).u_g);
+	fem.inputs.velocity_average=velocity_average;
+	new_thickness=iceprognostic_core(fem.m_p,'prognostic',fem.inputs);
+
+	%project collapsed thickness onto 3d mesh
+	indx=1:6:fem.m_p.gridset.gsize; indx=indx(fem.m_p.tpart);
+	new_thickness=project3d(md,project2d(md,new_thickness(indx),1),'node');
+
+	%update surface and bed using the new thickness
+	disp(sprintf('%s','   updating geometry...'));
+	[new_bed,new_surface,new_thickness]=UpdateGeometry(md,new_thickness,solution(n).bed(indx),solution(n).surface(indx));
+
+	%project onto 3d mesh
+	[solution(n+1).mesh solution(n+1).u_g solution(n+1).t_g solution(n+1).pressure]=UpdateMesh(md,fem.m_dv.grids,solution(n).mesh,solution(n+1).u_g,solution(n+1).t_g,solution(n+1).pressure,new_bed,new_thickness);
+	solution(n+1).thickness=zeros(fem.m_p.gridset.gsize,1);solution(n+1).thickness(1:6:fem.m_p.gridset.gsize)=new_thickness;
+	solution(n+1).bed=zeros(fem.m_p.gridset.gsize,1);solution(n+1).bed(1:6:fem.m_p.gridset.gsize)=new_bed;
+	solution(n+1).surface=zeros(fem.m_p.gridset.gsize,1);solution(n+1).surface(1:6:fem.m_p.gridset.gsize)=new_surface;
+
+	%figure out if time stepping is good
+	disp(sprintf('%s','   checking time stepping...'));
+	[back,dt,time]=TimeStepping(md,solution,dt,time);
+	if back,
+		continue;
+	end
+
+	%update grids
+	disp(sprintf('%s','   updating grid positions...'));
+	grids_t=UpdateGridPosition(md,fem.m_t.grids,new_bed,new_thickness);
+	grids_dhu=UpdateGridPosition(md,fem.m_dhu.grids,new_bed,new_thickness);
+	grids_dbv=UpdateGridPosition(md,fem.m_dbv.grids,new_bed,new_thickness);
+	grids_dv=UpdateGridPosition(md,fem.m_dv.grids,new_bed,new_thickness);
+	grids_p=UpdateGridPosition(md,fem.m_p.grids,new_bed,new_thickness);
+
+	%update time and counter
+	time=time+dt;
+	n=n+1;
+
+end
+
+%load results onto model
+indx=1:6:fem.m_dv.gridset.gsize; indx=indx(fem.m_dv.tpart);
+indy=2:6:fem.m_dv.gridset.gsize; indy=indy(fem.m_dv.tpart);
+indz=3:6:fem.m_dv.gridset.gsize; indz=indz(fem.m_dv.tpart);
+for i=1:length(solution),
+	solution2(i).vx=solution(i).u_g(indx)*md.yts;
+	solution2(i).vy=solution(i).u_g(indy)*md.yts;
+	solution2(i).vz=solution(i).u_g(indz)*md.yts;
+	solution2(i).vel=sqrt(solution2(i).vx.^2+solution2(i).vy.^2+solution2(i).vz.^2);
+	solution2(i).pressure=solution(i).pressure(indx)/10^5;
+	solution2(i).temperature=solution(i).t_g(indx);
+	solution2(i).melting=solution(i).melting_g(indx);
+	solution2(i).thickness=solution(i).thickness(indx);
+	solution2(i).surface=solution(i).surface(indx);
+	solution2(i).bed=solution(i).bed(indx);
+	solution2(i).time=solution(i).time/md.yts;
+end
+
+md.transient_results=solution2;
Index: /issm/trunk/src/m/solutions/ice/icetransient_wrapper.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/icetransient_wrapper.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/icetransient_wrapper.m	(revision 1)
@@ -0,0 +1,34 @@
+function md=icetransient_wrapper(md);
+%ICETRANSIENT_WRAPPER - wrapper of the transient solution sequence
+%
+%   wrapper for transient solution
+%   we need a wrapper so that we can launch the transient solution using Matlab parallel, 
+%
+%   Usage:
+%      md=icetransient_wrapper(md)
+
+%start timing
+t1=clock;
+
+%If running in parallel, launch core transient routine within a parallel job.
+if strcmpi(md.cluster,'yes'),
+	sched = findResource('scheduler', 'configuration', md.scheduler_configuration);
+	pjob = createParallelJob(sched);
+	set(pjob, 'FileDependencies', {'icetransient.m'});
+	set(pjob, 'MaximumNumberOfWorkers', md.np); set(pjob, 'MinimumNumberOfWorkers', md.np);
+	t = createTask(pjob, @icetransient, 1, {md});
+	set(t, 'CaptureCommandWindowOutput', true)
+	disp('   Submitting job to cluster');
+	submit(pjob);
+	waitForState(pjob);
+	get(t, 'CommandWindowOutput')
+	get(t,'ErrorMessage')
+	disp('   Done running on cluster');
+else
+	md=icetransient(md);
+end
+
+%stop timing
+t2=clock;
+
+disp(sprintf('\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']));
Index: /issm/trunk/src/m/solutions/ice/slopecompute.m
===================================================================
--- /issm/trunk/src/m/solutions/ice/slopecompute.m	(revision 1)
+++ /issm/trunk/src/m/solutions/ice/slopecompute.m	(revision 1)
@@ -0,0 +1,60 @@
+function md=slopecompute(md,field)
+%SLOPECOMPUTE - compute the slope of the bed or the surface on the grids
+%
+%   Usage:
+%      md=slopecompute(md,field)
+
+% Define global variables
+iceglobal
+global gridset
+
+if ~strcmpi(field, 'bed') & ~strcmpi(field, 'surface')
+	error('slope compute error message: bed and surface computing only ');
+end
+
+%determine if run is parallel
+if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
+
+%for now, only serial support is in
+if cluster,
+	error('slopecompute error message: parallel support not implemented yet');
+end
+
+%First, build elements,grids,loads, etc ... for horizontal, base vertical and vertical model
+if strcmpi(field, 'bed'),
+	m_bs=CreateFemModel(md,'bed_slope_compute');
+elseif strcmpi(field, 'surface'),
+	m_ss=CreateFemModel(md,'surface_slope_compute');
+end
+
+if strcmpi(field, 'bed'),
+	slopex=icediagnostic_core_linear(m_bs,'bed_slope_compute_x');
+	slopey=icediagnostic_core_linear(m_bs,'bed_slope_compute_y');
+	
+	slopex=slopex(1:6:end);
+	slopey=slopey(1:6:end);
+
+	if strcmpi(md.type,'3d'),
+		slopex=project3d(md,project2d(md,slopex,1),'node');
+		slopey=project3d(md,project2d(md,slopey,1),'node');
+	end
+
+	md.bed_slopex=slopex;
+	md.bed_slopey=slopey;
+	
+elseif strcmpi(field, 'surface'),
+	slopex=icediagnostic_core_linear(m_ss,'surface_slope_compute_x');
+	slopey=icediagnostic_core_linear(m_ss,'surface_slope_compute_y');
+		
+	slopex=slopex(1:6:end);
+	slopey=slopey(1:6:end);
+
+	if strcmpi(md.type,'3d'),
+		slopex=project3d(md,project2d(md,slopex,md.numlayers),'node');
+		slopey=project3d(md,project2d(md,slopey,md.numlayers),'node');
+	end
+
+	md.surface_slopex=slopex;
+	md.surface_slopey=slopey;
+end
+	
Index: /issm/trunk/src/m/solutions/macayeal/bar_maker.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/bar_maker.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/bar_maker.m	(revision 1)
@@ -0,0 +1,33 @@
+function [matrix_bar, matrix_xbar, matrix_ybar]=...
+   bar_maker(nel,nods,index,alpha,beta)
+%BAR_MAKER - builds some useful matrices
+%
+%   matrix bar is used to evaluate the mean value of a parameter 
+%   over the elements as follows:
+%   o Pelements=matrix_bar*Pnodes
+%   The two other matrices matrix xbar and matrix ybar are used 
+%   to evaluate a parameter derivative over the elements with respect
+%   to x or y exactly as above
+%
+%   Usage:
+%      [matrix_bar, matrix_xbar, matrix_ybar]=bar_maker(nel,nods,index,alpha,beta)
+
+row=zeros(nel*3,1);
+col=zeros(nel*3,1);
+value=zeros(nel*3,1);
+valuex=zeros(nel*3,1);
+valuey=zeros(nel*3,1);
+count=-nel+1;		 
+for m=1:3
+    count=count+nel;
+    row(count:count+nel-1)=[1:nel]';
+    col(count:count+nel-1)=index(:,m);
+
+    value(count:count+nel-1)=1/3 ;
+    valuex(count:count+nel-1)=alpha(:,m);
+    valuey(count:count+nel-1)=beta(:,m) ;
+end
+
+matrix_bar=sparse(row,col,value,nel,nods);
+matrix_xbar=sparse(row,col,valuex,nel,nods);
+matrix_ybar=sparse(row,col,valuey,nel,nods);
Index: /issm/trunk/src/m/solutions/macayeal/buildicefrontnormal.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/buildicefrontnormal.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/buildicefrontnormal.m	(revision 1)
@@ -0,0 +1,24 @@
+function [length_icefront,normal_icefront]=buildicefrontnormals(x,y,index_icefront);
+%BUILDICEFRONTNORMALS - compute normals of the ice front
+%
+%   this routine builds the normal of the segments located on the ice front and calculates
+%   the length of these segments.
+%
+%   Usage:
+%      [length_icefront,normal_icefront]=buildicefrontnormals(index_icefront);
+
+length_icefront=zeros(length(index_icefront),1);
+normal_icefront=zeros(length(index_icefront),2);
+
+length_icefront=sqrt( (x(index_icefront(:,1))-x(index_icefront(:,2))).^2 ...
+	+ (y(index_icefront(:,1))-y(index_icefront(:,2))).^2 );
+
+normal_icefront(:,1)=cos( ...
+atan2( (x(index_icefront(:,1))-x(index_icefront(:,2))) , ...
+		(y(index_icefront(:,2))-y(index_icefront(:,1))) ) ...
+);
+
+normal_icefront(:,2)=sin( ...
+atan2( (x(index_icefront(:,1))-x(index_icefront(:,2))) , ...
+		(y(index_icefront(:,2))-y(index_icefront(:,1))) ) ...
+);
Index: /issm/trunk/src/m/solutions/macayeal/c_velfinder.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/c_velfinder.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/c_velfinder.m	(revision 1)
@@ -0,0 +1,218 @@
+%C_VELFINDER - compute a velocity field
+%
+%   This routine is used by macayealcontrol, it calculates the velocity field of with
+%   MacAyeal's model and computes the value of some matrices used by macayealcontrol
+
+summer=[1;1;1];
+
+rowD=zeros(nel,9);
+colD=zeros(nel,9);
+rowDshort=zeros(nel,6);
+colDshort=zeros(nel,6);
+
+valueuu=zeros(nel,6);
+valueuv=zeros(nel,9);
+valuevv=zeros(nel,6);
+
+
+nu_bar_uu=[nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar];
+nu_bar_vv=[nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar];
+nu_bar_uv=[nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar];
+
+
+count=0;
+for m=1:3
+	for k=1:3
+	  count=count+1;
+	  rowD(:,count)=index(:,m);
+     colD(:,count)=index(:,k);
+   end
+end
+
+count=0;
+for m=1:3
+	for k=m:3
+	  count=count+1;
+	  rowDshort(:,count)=index(:,m);
+     colDshort(:,count)=index(:,k);
+   end
+end
+
+valuex=zeros(nel,27);
+valuey=zeros(nel,27);
+row=zeros(nel,27);
+
+count=0;
+
+for m=1:3
+   for k=1:3
+	   for l=1:3
+		   count=count+1;
+		   row(:,count)=index(:,m);
+		   
+		   if ( (m==k) + (m==l) + (l==k) )==3
+			   fac=1/10;
+		   elseif ( (m==k) + (m==l) + (l==k) )==1
+			   fac=1/30;
+		   else
+			   fac=1/60;
+		   end
+		   
+         valuex(:,count) = -fac*area(:) ...
+	  						.*z_thick(index(:,l)).* ...
+	                       z_surf_xbar(:);
+         valuey(:,count) = -fac*area(:) ...
+	  					   .*z_thick(index(:,l)).* ...
+	                  z_surf_ybar(:);
+      end
+   end
+end
+
+
+Rhs=rho_ice*g*[sparse(row,ones(size(row)),valuex,nods,1)
+sparse(row,ones(size(row)),valuey,nods,1)];
+Rhs=full(Rhs);
+Rhs_a_nofront=Rhs;
+
+
+
+for k=1:2 %for each of a segment's  two nodes
+	for l=1:2
+		for j=1:2
+%x-direction			
+				Rhs(index_icefront(:,k))=Rhs(index_icefront(:,k)) + ...
+(rho_ice*g/2*z_thick(index_icefront(:,l)).*z_thick(index_icefront(:,j)) ...
+- rho_water*g/2*z_bed(index_icefront(:,l)).*z_bed(index_icefront(:,j))) ...
+.*normal_icefront(:,1).*length_icefront(:) ...
+/(4*(l==k & j==k) + 12*(l~=k | j~=k) );
+
+%y-direction
+				Rhs(index_icefront(:,k)+nods)=Rhs(index_icefront(:,k)+nods) + ...
+(rho_ice*g/2*z_thick(index_icefront(:,l)).*z_thick(index_icefront(:,j)) ...
+- rho_water*g/2*z_bed(index_icefront(:,l)).*z_bed(index_icefront(:,j))) ...
+.*normal_icefront(:,2).*length_icefront(:) ...
+/(4*(l==k & j==k) + 12*(l~=k | j~=k) );
+
+		end
+	end
+end
+
+Rhs_a_front=Rhs-Rhs_a_nofront;
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%create P matrix%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+num_specified= 2*sum(nodes_on_dirichlet);
+row=zeros(2*nods-num_specified,1);
+col=zeros(2*nods-num_specified,1);
+value=zeros(2*nods-num_specified,1);
+count=0;
+for n=1:nods
+   if(~(nodes_on_dirichlet(n)))
+   		 count=count+1;
+		row(count)=count;
+		col(count)=n;
+		value(count)=1;
+	end
+end
+for n=1:nods
+   if (~(nodes_on_dirichlet(n)))
+         count=count+1;
+		row(count)=count;
+		col(count)=nods+n;
+		value(count)=1;
+	end
+end
+
+P=sparse(row,col,value,2*nods-num_specified,2*nods);
+
+
+specified_velocity=zeros(2*nods,1);
+pos=find(nodes_on_dirichlet);
+
+specified_velocity(pos)=vx_obs(pos);
+specified_velocity(nods+pos)=vy_obs(pos);
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%create P0 matrix%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+num_specified= 2*sum(nodes_on_boundary);
+row=zeros(2*nods-num_specified,1);
+col=zeros(2*nods-num_specified,1);
+value=zeros(2*nods-num_specified,1);
+count=0;
+for n=1:nods
+   if(~(nodes_on_boundary(n)))
+   		 count=count+1;
+		row(count)=count;
+		col(count)=n;
+		value(count)=1;
+	end
+end
+for n=1:nods
+   if (~(nodes_on_boundary(n)))
+         count=count+1;
+		row(count)=count;
+		col(count)=nods+n;
+		value(count)=1;
+	end
+end
+
+P0=sparse(row,col,value,2*nods-num_specified,2*nods);
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+count=0;
+   for m=1:3
+		for k=m:3
+         count=count+1;
+         valueuu(:,count)=area(:).*z_thick_bar.* ...
+            ((2*alpha(:,m).* ...
+            alpha(:,k)+1/2*beta(:,m).* ...
+            beta(:,k)));  
+
+
+         valuevv(:,count)=area(:).*z_thick_bar.* ...
+            ((2*beta(:,m).* ...
+            beta(:,k)+1/2*alpha(:,m).* ...
+            alpha(:,k)));
+    end
+end
+
+count=0;
+   for m=1:3
+		for k=1:3
+         count=count+1;
+         valueuv(:,count)=area(:).*z_thick_bar.* ...
+            (1/2*beta(:,m).* ...
+            alpha(:,k)+alpha(:,m).* ...
+            beta(:,k));
+      end
+   end
+
+Duu=sparse(rowDshort,colDshort,nu_bar_uu.*valueuu,nods,nods);
+Duu=Duu+triu(Duu,1)';
+
+Dvv=sparse(rowDshort,colDshort,nu_bar_vv.*valuevv,nods,nods);
+Dvv=Dvv+triu(Dvv,1)';
+
+F=[Duu sparse(rowD,colD,nu_bar_uv.*valueuv,nods,nods)
+   sparse(colD,rowD,nu_bar_uv.*valueuv,nods,nods) Dvv]; 
+
+
+Rhs_parsed=P*(Rhs - F*specified_velocity);
+Fprime=P*F*P';
+
+
+solution=Fprime\Rhs_parsed;
+solution=P'*solution + specified_velocity;
+u=solution(1:nods);
+v=solution(nods+1:2*nods);
+
Index: /issm/trunk/src/m/solutions/macayeal/create_el2nod_matrices.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/create_el2nod_matrices.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/create_el2nod_matrices.m	(revision 1)
@@ -0,0 +1,28 @@
+%CREATE_EL2NOD_MATRICES - build some useful matrices
+%
+%   this script builds two matrices: el2nod and el2nodRhs. The first one is used to
+%   evaluate the value of a parameter over a grid when it is defined over the elements.
+%   The second matrix is used for the same purpose but with derivated parameters 
+%   (constant over the elements).
+
+row_location=zeros(nel*3*3,1);
+col_location=zeros(nel*3*3,1);
+value=zeros(nel*3*3,1);
+right_hand_side=zeros(nel*3*3,1);
+col_elements=zeros(nel*3*3,1);
+epsilon=1;
+count=-nel+1;
+for j=1:3
+	for i=1:3
+			count=count+nel;
+			row_location(count:count+nel-1)=index(:,i);
+			col_location(count:count+nel-1)=index(:,j);
+			col_elements(count:count+nel-1)=[1:nel]';
+			value(count:count+nel-1)=area.*(alpha(:,i).*alpha(:,j)*epsilon ...
+			+ beta(:,i).*beta(:,j)*epsilon ... 
+			+( (i==j)/6 + (i~=j)/12 ) );
+			right_hand_side(count:count+nel-1)=area/9;
+	end
+end
+el2nod=sparse(row_location,col_location,value,nods,nods);
+el2nodRhs=sparse(row_location,col_elements,right_hand_side,nods,nel);
Index: /issm/trunk/src/m/solutions/macayeal/flowlaw.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/flowlaw.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/flowlaw.m	(revision 1)
@@ -0,0 +1,10 @@
+function B_bar=flowlaw(nel)
+%FLOWLAW - compute initail viscosity parameter B
+%
+%   Compute B for the first non-linear iteration
+%
+%   Usage:
+%      B_bar=flowlaw(nel)
+
+overall_value=2.1e8;
+B_bar=overall_value*ones(nel,1);
Index: /issm/trunk/src/m/solutions/macayeal/grad_J_flow.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/grad_J_flow.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/grad_J_flow.m	(revision 1)
@@ -0,0 +1,67 @@
+function [u,v,adjointu,adjointv,direction]= ...
+    grad_J(Rhs,S,F,P,P0,area,specified_velocity,nods,vx_obs,vy_obs,...
+      index,x,y,nel,rho_ice,g,weighting,alpha,beta,z_thick_bar,B_bar);
+%GRAD_J - compute the gradient of the misfit with respect to the inversed parameter
+%
+%   this routine is calculates the difference between the calculated and the given velocity
+%   field (cost function), then calculates the adjoint state and uses it to determine the gradient of the
+%   cost function to update the spatial distribution of viscosity.
+%
+%   Usage:
+%      [u,v,adjointu,adjointv,direction]=grad_J(Rhs,S,F,P,P0,area,specified_velocity,nods,vx_obs,vy_obs,index,x,y,nel,rho_ice,g,weighting,alpha,beta,z_thick_bar,B_bar);
+
+      
+disp(['      Recalculating model velocity with last iteration from velfinder']);
+Rhs_parsed=P*(Rhs - F*specified_velocity);
+Fprime=P*F*P';
+
+solution=Fprime\Rhs_parsed;
+solution=P'*solution + specified_velocity;
+u=solution(1:nods);
+v=solution(nods+1:2*nods);
+disp('      Done');
+
+
+disp(['      Calculating adjoints.']);
+Du=[(u-vx_obs).*weighting.*weighting
+   (v-vy_obs).*weighting.*weighting];
+
+[nu2,nu3]=visc_grad(index,nel,alpha,beta,u,v,B_bar);
+%G_calc;
+ARhs_aprime=-P*(S*Du);
+%ADprime=P0*(F-G_bar)*P0';
+ADprime=P*F*P';
+
+templambda=P'*(ADprime\ARhs_aprime);
+adjointu=templambda(1:nods);
+adjointv=templambda((nods+1):(nods*2));
+disp('      Done');
+
+disp('      Building the gradJ');
+value=zeros(nel,27);
+row=zeros(nel,27);
+count=0;
+for m=1:3
+   for k=1:3
+
+	   for l=1:3
+         
+		   count=count+1;
+		  	row(:,count)=index(:,m);
+
+     		
+			value(:,count)=-area/3.*z_thick_bar.*nu3.*(...
+              (  2.*alpha(:,k).*u(index(:,k))  +beta(:,k).*v(index(:,k))  )  .*2.*alpha(:,l).*adjointu(index(:,l))+...
+           (  beta(:,k).*u(index(:,k)) + alpha(:,k).*v(index(:,k))  )  .*( beta(:,l).*adjointu(index(:,l)) +alpha(:,l).*adjointv(index(:,l)) )+...
+           (  2*beta(:,k).*v(index(:,k))  +  alpha(:,k).*u(index(:,k))  ).*2.*  beta(:,l).*adjointv(index(:,l))...
+           );
+      	
+
+      end
+   end
+end
+
+
+direction=sparse(row,ones(size(row)),value,nods,1);
+direction=full(direction);
+disp('      Done');
Index: /issm/trunk/src/m/solutions/macayeal/macayealcontrol.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/macayealcontrol.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/macayealcontrol.m	(revision 1)
@@ -0,0 +1,341 @@
+function md=macayealcontrol(md)
+%MACAYEALCONTROL - launch a control method using MacAyeal solution
+%
+%   the routine is used for a control method. It determines the most adapted viscosity
+%   field so that the calculated velocity field is as close as possible to an observed velocity field
+%
+%   Usage:
+%      md=macayealcontrol(md)
+
+%First check we do have the correct argument number
+if ((nargin~=1) || (nargout~=1)),
+	velfinderusage();
+	error('macayealcontrol error message: incorrect number of input and output arguments');
+end
+
+if ~isa(md,'model'),
+	macayealcontrolusage();
+	error('macayealcontrol error message: input argument is not a @model object');
+end
+
+%Check that control is done on flow law, and not drag (not supported yet):
+if ~strcmp(md.control_type,'B')
+	error('macayealcontrol error message: only ''flow'' law inversion supported yet');
+end
+
+%Transfer model fields into matlab variables
+x=md.x;
+y=md.y;
+index=md.elements;
+index=sort(index,2); %necessary 
+nods=md.numberofgrids;
+nel=md.numberofelements;
+z_thick=md.thickness;
+z_surf=md.surface;
+z_bed=md.bed;
+z_thick_bar=(z_thick(index(:,1))+z_thick(index(:,2))+z_thick(index(:,3)))/3;
+rho_ice=md.rho_ice;
+rho_water=md.rho_water;
+g=md.g;
+index_icefront=md.segmentonneumann_diag; index_icefront=index_icefront(:,1:2); %we strip the last column, which holds the element number for the boundary segment
+nodes_on_boundary=md.gridonboundary;
+nodes_on_dirichlet=md.gridondirichlet_diag;
+nodes_on_icefront=zeros(nods,1); nodes_on_icefront(index_icefront)=1;
+nodes_on_iceshelf=md.gridoniceshelf;
+
+criterion=md.eps_rel;
+yts=md.yts;
+tolx=md.tolx; 
+maxiter=md.maxiter(1);
+B_ini=md.B;
+drag_coeff_ini=md.drag;
+glen_coeff=md.n;
+vx_obs=md.vx_obs/md.yts; %From m/a to m/s
+vy_obs=md.vy_obs/md.yts;
+nsteps=md.nsteps;
+B_to_p=10^-3*yts^(-1/3);
+
+%Build length_icefront and normal_icefront:
+[length_icefront,normal_icefront]=buildicefrontnormal(x,y,index_icefront);
+
+%Building shape functions and derivative operators
+[alpha, beta, gamma, area]=shape(index,x,y,nel,nods);
+
+[matrix_bar, matrix_xbar, matrix_ybar]=...
+   bar_maker(nel,nods,index,alpha,beta);
+
+%initialize some data
+create_el2nod_matrices
+old_direction=zeros(nods,1);
+
+
+%setup some fake distributions.
+z_thick_bar=matrix_bar*z_thick;
+z_surf_bar=matrix_bar*z_surf;
+z_surf_xbar=matrix_xbar*z_surf;
+z_surf_ybar=matrix_ybar*z_surf;
+z_surf_x=el2nod\(el2nodRhs*z_surf_xbar);
+z_surf_y=el2nod\(el2nodRhs*z_surf_ybar);
+z_bed_bar=matrix_bar*z_bed;
+z_bed_xbar=matrix_xbar*z_bed;
+z_bed_ybar=matrix_ybar*z_bed;
+
+
+%data_elements and data_nodes are the elements and nodes where 
+%we have observations
+data_elements=[1:nel]';
+data_nodes=ones(nods,1);
+
+%initialize misfit between model velocity and observed velocity
+J=zeros(nsteps,1);
+
+%Weighting: one areas where we don't want the control method to optimize 
+%the misfit, we can set weighting to 0.
+weighting=ones(nods,1);
+
+%optimization parameters for the matlab functoin fminbnd
+options=optimset('fminbnd');
+options=optimset(options,'Display','iter');
+options=optimset(options,'MaxFunEvals',maxiter);
+options=optimset(options,'MaxIter',100);
+options=optimset(options,'TolX',tolx);
+
+%build useful matrices.
+setup_control
+
+%setup initial flow law paramter distribution to startup the optimization.
+B_bar_ini=(B_ini(index(:,1))+B_ini(index(:,2))+B_ini(index(:,3)))/3; 
+B=B_ini;  %variables used in optimziation are B and B_bar. 
+B_bar=B_bar_ini;
+
+%setup initial drag paramter distribution to startup the optimization.
+drag_type=md.drag_type;
+qcoeff=md.q;
+pcoeff=md.p;
+if strcmp(md.control_type,'basal') & (drag_type~=2), error('md.drag_type must be 2 for control methods'); end
+drag_coeff_bar_ini=(drag_coeff_ini(index(:,1))+drag_coeff_ini(index(:,2))+drag_coeff_ini(index(:,3)))/3; 
+drag_coeff=drag_coeff_ini;  %variables used in optimziation are drag_coeff and drag_coeff_bar. 
+drag_coeff_bar=drag_coeff_bar_ini;
+
+%check that the model is not a pure ice shelf (no friction on ice shelves)
+if strcmp(md.control_type,'basal') & (length(find(drag_coeff))==0),
+    disp(sprintf('\n      No drag pure for ice shelves => STOP'))
+    return
+end
+
+%nu_bar=10^14*ones(nel,1);  %initial element viscosity distribution.
+nu_bar=viscosity(index,nel,alpha,beta,vx_obs,vy_obs,B_bar,glen_coeff);
+
+%%%AK velfinder;    %forward model that determines first velocity field used 
+%to start optimization.
+disp('calculating the velocity with the initial parameters')
+c_velfinder;
+
+if strcmp(md.control_type{1},'B'),
+    for niteration=1:nsteps,
+
+       disp(['   Step #' num2str(niteration) ' on ' num2str(nsteps)]);
+
+       % Compute search direction -
+       [u,v,adjointu,adjointv,direction]= ...      
+          grad_J_flow(Rhs,S,F,P,P0,area,specified_velocity,nods,vx_obs,vy_obs,...
+          index,x,y,nel,rho_ice,g,weighting,alpha,beta,z_thick_bar,B_bar);
+
+      if niteration==1
+          scrsz = get(0,'ScreenSize');
+          figure('Position',[scrsz(3)/3 scrsz(4)*1.8/3 scrsz(3)/3 scrsz(4)/3])
+      end
+        plotmodel(md,'data',sqrt(u.^2+v.^2)*yts,'title','Modeled velocity',...
+		'data',sqrt(adjointu.^2+adjointv.^2)*yts,'title','Adjoint vectors','colorbar#all', 'on',...
+		'data',sqrt(vx_obs.^2+vy_obs.^2)*yts,'title','Observed velocity',...
+		'data',100*abs(sqrt(vx_obs.^2+vy_obs.^2)-sqrt(u.^2+v.^2))./sqrt(vx_obs.^2+vy_obs.^2),'title','Relative misfit','caxis#4',[0 100],'figure',1);pause(1);
+
+       %Keep track of u and v to use in objectivefunction_C: 
+       u_objective=u;
+       v_objective=v;
+
+       %Orthogonalize direction
+       direction=real(direction);
+       direction=direction/sqrt(direction'*direction);
+
+
+       % rough orthagonalization
+       direction=direction-(direction'*old_direction)*old_direction; 
+       old_direction=direction;
+
+       %visualize direction 
+       if niteration==1
+           scrsz = get(0,'ScreenSize');
+           figure('Position',[10 scrsz(4)*1/3 scrsz(3)/3 scrsz(4)/3])
+       end              
+       plotmodel(md,'data',direction,'title','Orthogonal direction','figure',2);pause(1);
+
+
+       % normalize direction to 10^7, so that when variations on B are computed
+       %they will be significant. 
+       if abs(max(direction))>abs(min(direction))
+          direction=10^7*direction/abs(max(direction));
+       else
+          direction=10^7*direction/abs(min(direction));
+       end
+
+       %during optimization, bounds on B variations can vary. Here, they are less
+       %strict in the first iteration. 
+       if niteration<=2,
+          upperbound=20;
+          lowerbound=0;
+       else
+          upperbound=10;
+          lowerbound=0;
+       end
+
+       %search the multiplicative constant to the direction, that will 
+       %be used to modify B.
+
+       search_constant=fminbnd('objectivefunction_C_flow',lowerbound,upperbound, ...
+          options,B,glen_coeff,direction,Rhs,S,F,P,specified_velocity,nods,nel,vx_obs, ...
+          vy_obs,u_objective, v_objective, index,alpha, beta, area,weighting,rowD,colD,rowDshort,colDshort,valueuu,valuevv,valueuv,matrix_bar,criterion);
+
+
+        %update value of B
+        B_old=B;
+        B_new=B+search_constant*direction;
+        B=B_new;
+        pos=find(B<0);B(pos)=-B(pos);
+
+       %Average B over elements: 
+       B_bar=(B(index(:,1))+B(index(:,2))+B(index(:,3)))/3;
+
+       %visualize new distribution. 
+       if niteration==1
+           scrsz = get(0,'ScreenSize');
+           figure('Position',[scrsz(3)*1.97/3 scrsz(4)*1/3 scrsz(3)/3 scrsz(4)/3])
+       end
+       plotmodel(md,'data',B*B_to_p,'title',['B at iteration ' num2str(niteration)],'caxis',[200 900],'colorbar','on','figure',3);pause(1);
+
+       %evaluate new misfit. 
+       %@@@AK load F_file   %this file was created in objectivefunction_C, and is reloaded
+       %here to win some computation time.
+       load F_file
+
+       J(niteration)=objectivefunction_C_flow(0,B,glen_coeff,direction,Rhs,S,F,P,specified_velocity,nods,nel,vx_obs, ...
+          vy_obs,u_objective, v_objective, index,alpha, beta, area,weighting,rowD,colD,rowDshort,colDshort,valueuu,valuevv,valueuv,matrix_bar,criterion);
+      disp(J(niteration));
+
+      %do a backup every 5 iterations
+      if(mod(niteration,5)==0),
+          save temporary_control_results_flow B B_bar u v J direction
+      end
+    end
+
+    %Load results onto md:
+    md.cont_J=J;
+    md.cont_parameters=B;
+
+elseif strcmp(md.control_type,'basal'),
+    for niteration=1:nsteps,
+
+        disp(['   Step #' num2str(niteration) ' on ' num2str(nsteps)]);
+
+        % Compute search direction -
+        [u,v,adjointu,adjointv,direction]= ...
+            grad_J_drag(Rhs,S,F,P,P0,area,specified_velocity,nods,vx_obs,vx_obs,...
+            index,x,y,nel,rho_ice,g,weighting,alpha,beta,z_thick_bar,drag_coeff,drag_coeff_bar);
+
+      if niteration==1
+          scrsz = get(0,'ScreenSize');
+          figure('Position',[scrsz(3)/3 scrsz(4)*1.8/3 scrsz(3)/3 scrsz(4)/3])
+      end
+        plotmodel(md,'data',sqrt(u.^2+v.^2),'title','Modeled velocity',...
+		'data',sqrt(adjointu.^2+adjointv.^2),'title','Adjoint vectors','colorbar', 'all',...
+		'data',sqrt(vx_obs.^2+vy_obs.^2),'title','Observed velocity',...
+		'data',100*abs(sqrt(vx_obs.^2+vy_obs.^2)-sqrt(u.^2+v.^2))./sqrt(vx_obs.^2+vy_obs.^2),'title','Relative misfit','caxis#3',[0 100],'figure',1);pause(1);
+
+        %Keep track of u and v to use in objectivefunction_C:
+        u_objective=u;
+        v_objective=v;
+
+        %Orthogonalize direction
+       direction=real(direction);
+       direction=direction/sqrt(direction'*direction);
+       pos=find(nodes_on_iceshelf);
+       direction(pos)=0;
+
+
+       % rough orthagonalization
+       direction=direction-(direction'*old_direction)*old_direction; 
+       old_direction=direction;
+
+       %visualize direction 
+       if niteration==1
+           scrsz = get(0,'ScreenSize');
+           figure('Position',[10 scrsz(4)*1/3 scrsz(3)/3 scrsz(4)/3])
+       end 
+       plotmodel(md,'data',direction,'title','Orthogonal direction','figure',2);pause(1);
+
+
+       % normalize direction to 10^4, so that when variations on drag are computed
+       %they will be significant. 
+       if abs(max(direction))>abs(min(direction))
+          direction=10^4*direction/abs(max(direction));
+       else
+          direction=10^4*direction/abs(min(direction));
+       end
+
+       %during optimization, bounds on drag variations can vary. Here, they are less
+       %strict in the first iteration. 
+       if niteration<=2,
+          upperbound=2;
+          lowerbound=-2;
+       else
+          upperbound=1;
+          lowerbound=-1;
+       end
+
+       %search the multiplicative constant to the direction, that will 
+       %be used to modify drag.
+
+       search_constant=fminbnd('objectivefunction_C_drag',lowerbound,upperbound, ...
+          options,B,glen_coeff,drag_coeff,direction,Rhs,S,F,P,specified_velocity,nods,nel,vx_obs, ...
+          vy_obs,u_objective, v_objective, index,alpha, beta, area,weighting,rowD,colD,rowDshort,colDshort,valueuu,valuevv,valueuv,matrix_bar,criterion);
+
+
+        %update value of drag
+        drag_coeff_old=drag_coeff;
+        drag_coeff_new=drag_coeff+search_constant*direction;
+        drag_coeff=drag_coeff_new;
+    
+        if length(find(drag_coeff<0))~=0,
+            disp(sprintf('\n      Some basal drag coefficient negative => STOP'))
+            break
+        end
+
+       %Average drag over elements: 
+       if niteration==1
+           scrsz = get(0,'ScreenSize');
+           figure('Position',[scrsz(3)*1.97/3 scrsz(4)*1/3 scrsz(3)/3 scrsz(4)/3])
+       end
+       drag_coeff_bar=(drag_coeff(index(:,1))+drag_coeff(index(:,2))+drag_coeff(index(:,3)))/3;
+
+       %visualize new distribution. 
+       plotmodel(md,'data',drag_coeff,'title',['Drag at iteration ' num2str(niteration)],'caxis',[0 1000],'colorbar','on','figure',3);pause(1);
+
+       %evaluate new misfit. 
+       %@@@AK load F_file   %this file was created in objectivefunction_C, and is reloaded
+       %here to win some computation time.
+       load F_file
+
+       J(niteration)=objectivefunction_C_drag(0,B,glen_coeff,drag_coeff,direction,Rhs,S,F,P,specified_velocity,nods,nel,vx_obs, ...
+          vy_obs,u_objective, v_objective, index,alpha, beta, area,weighting,rowD,colD,rowDshort,colDshort,valueuu,valuevv,valueuv,matrix_bar,criterion);
+       disp(J(niteration));
+       
+       %do a backup every 5 iterations
+       if(mod(niteration,5)==0),
+           save temporary_control_results_drag drag_coeff drag_coeff_bar u v J direction
+       end
+    end
+end
+
+function macayealcontrolusage();
+disp('md=macayealcontrol(md)');
+disp('   where md is a structure of class @model');
Index: /issm/trunk/src/m/solutions/macayeal/macayealdiagnostic.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/macayealdiagnostic.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/macayealdiagnostic.m	(revision 1)
@@ -0,0 +1,500 @@
+function md=macayealdiagnostic(md)
+%MACAYEALDIAGNOSTIC - compute the velocity field of a 2d model using MacAyeal solution
+%
+%   this routine solves the problem using MacAyeal's model. It calculates the velocity
+%   field corresponding to the parameters and the geometry given by the model md
+%
+%   Usage:
+%      md=macayealdiagnostic(md)
+
+%First check we do have the correct argument number
+if ((nargin~=1) || (nargout~=1)),
+	macayealdiagnosticusage();
+	error('macayealdiagnostic error message: incorrect number of input and output arguments');
+end
+
+if ~isa(md,'model'),
+	macayealdiagnosticusage();
+	error('macayealdiagnostic error message: input argument is not a @model object');
+end
+
+%start timing
+t1=clock;
+
+%Transfer model fields into matlab variables
+x=md.x;
+y=md.y;
+
+index=md.elements;index=sort(index,2); %necessary 
+nods=md.numberofgrids;
+nel=md.numberofelements;
+z_thick=md.thickness;
+z_surf=md.surface;
+z_bed=md.bed;
+z_thick_bar=(z_thick(index(:,1))+z_thick(index(:,2))+z_thick(index(:,3)))/3;
+rho_ice=md.rho_ice;
+rho_water=md.rho_water;
+g=md.g;
+viscosity_overshoot=md.viscosity_overshoot;
+index_icefront=md.segmentonneumann_diag; index_icefront=index_icefront(:,1:2); %we strip the last column, which holds the element number for the boundary segment
+nodes_on_boundary=md.gridonboundary;
+nodes_on_icefront=zeros(nods,1); nodes_on_icefront(index_icefront)=1;
+node_on_dirichlet=md.gridondirichlet_diag;
+nodes_on_icesheet=md.gridonicesheet;
+element_on_icesheet=md.elementonicesheet;
+qcoeff=md.q;
+pcoeff=md.p;
+drag_type=md.drag_type;
+drag=md.drag;
+
+criterion_rel=md.eps_rel;
+criterion_abs=md.eps_abs;
+yts=md.yts;
+B=md.B; B_bar=(B(index(:,1))+B(index(:,2))+B(index(:,3)))/3;
+glen_coeff=md.n;
+
+%average of p and q over the grids (size nel->nods)
+pcoeff_grid=zeros(nods,1);
+qcoeff_grid=zeros(nods,1);
+for i=1:nods
+    %1: find the elements that contain the grid i
+    neighbors_gridi=[];
+    for j=1:3
+        neighbors_gridi=[neighbors_gridi find(index(:,j)==i)'];
+    end
+    numberofneighbors_gridi=length(neighbors_gridi);
+    %2 retrieve the value of p and q over each of these elements. The average is
+    %plugged into dbx_grid
+    qcoeff_grid(i)=sum(qcoeff(neighbors_gridi))/numberofneighbors_gridi;
+    pcoeff_grid(i)=sum(pcoeff(neighbors_gridi))/numberofneighbors_gridi;
+end
+
+%Build length_icefront and normal_icefront:
+[length_icefront,normal_icefront]=buildicefrontnormal(x,y,index_icefront);
+
+%Start building areas
+aire=zeros(md.numberofelements,1);
+
+for n=1:nel
+	aire(n)=1/2 * det([1 1 1;x(index(n,:))';y(index(n,:))']);
+end
+
+aire=abs(aire); % if index is sorted from its original value, then aire could be negative
+
+alpha=zeros(nel,3);
+beta=zeros(nel,3);
+gamma=zeros(nel,3);
+
+for n=1:nel
+	X=inv([x(index(n,:)) y(index(n,:)) ones(3,1)]);
+	alpha(n,:)=X(1,:);
+	beta(n,:)=X(2,:);
+	gamma(n,:)=X(3,:);
+end
+
+clear X
+
+%Initialize viscosity
+nu_bar=viscosity(index,nel,alpha,beta,{},{},B_bar,glen_coeff);
+
+
+ %  Do once and for all the initial computation of matrix-locations:
+
+row_location=zeros(nel*3*3,1);
+col_location=zeros(nel*3*3,1);
+row_location_AD=zeros(nel*6,1);
+col_location_AD=zeros(nel*6,1);
+
+count=-nel+1;
+
+for i=1:3
+	for j=1:3
+			count=count+nel;
+			row_location(count:count+nel-1)=index(:,i);
+			col_location(count:count+nel-1)=index(:,j);
+	end
+end
+
+
+count=-nel+1;
+
+for i=1:3
+	for j=i:3
+			count=count+nel;
+			row_location_AD(count:count+nel-1)=index(:,i);
+			col_location_AD(count:count+nel-1)=index(:,j);
+	end
+end
+
+
+
+permanent_pieces_of_A=zeros(nel*6,1);
+permanent_pieces_of_B=zeros(nel*3*3,1);
+permanent_pieces_of_C=zeros(nel*3*3,1);
+permanent_pieces_of_D=zeros(nel*6,1);
+
+count=-nel+1;
+
+for i=1:3
+	for j=i:3
+			count=count+nel;
+			permanent_pieces_of_A(count:count+nel-1)= z_thick_bar .* aire ...
+				.*(2*alpha(:,i).*alpha(:,j) + 1/2*beta(:,i).*beta(:,j));				
+				% This loop structure works only when index is sorted
+			permanent_pieces_of_D(count:count+nel-1)= z_thick_bar .* aire ...
+				.*(2*beta(:,i).*beta(:,j) + 1/2*alpha(:,i).*alpha(:,j));
+
+	end
+end
+
+count=-nel+1;
+
+for i=1:3
+	for j=1:3
+			count=count+nel;
+
+			permanent_pieces_of_B(count:count+nel-1)= z_thick_bar .* aire ...
+			.*(alpha(:,j).*beta(:,i) + 1/2*beta(:,j).*alpha(:,i));
+
+			permanent_pieces_of_C(count:count+nel-1)= z_thick_bar .* aire ...
+			.*(beta(:,j).*alpha(:,i) + 1/2*alpha(:,j).*beta(:,i));
+
+
+	end
+end
+
+% Step 3 -- Set up right-hand side of the problem. 
+
+% (Note to myself: to avoid vector dependency problem, yet still vectorize,
+% I treat the Rhs vector as a sparse2 matrix
+
+Rhs_x=zeros(nel*27,1);
+Rhs_y=zeros(nel*27,1);
+Rhs_y=ones(nel*27,1);
+row_rhs=zeros(nel*27,1);
+
+
+count=-nel+1;
+for i=1:3
+	for n=1:3
+		for m=1:3
+			count=count+nel;
+
+			Rhs_x(count:count+nel-1)= -rho_ice * g  * ...
+			 z_thick(index(:,n)).*z_surf(index(:,m)) ...
+			.* aire(:) .* alpha(:,m) * ( (n==i)/6 + (n~=i)/12 );
+
+			Rhs_y(count:count+nel-1)= -rho_ice * g  * ...
+			 z_thick(index(:,n)).*z_surf(index(:,m)) ...
+			.* aire(:) .* beta(:,m) .* ( (n==i)/6 + (n~=i)/12 );
+
+			row_rhs(count:count+nel-1)=index(:,i);
+
+		end
+	end
+end
+
+Rhs=full([sparse2(row_rhs,ones(nel*27,1),Rhs_x,nods,1)
+   sparse2(row_rhs,ones(nel*27,1),Rhs_y,nods,1)]);
+
+for k=1:2
+	for l=1:2
+		for j=1:2
+				Rhs(index_icefront(:,k))=Rhs(index_icefront(:,k)) + ...
+(rho_ice*g/2*z_thick(index_icefront(:,l)).*z_thick(index_icefront(:,j)) ...
++ rho_water*g/2*(md.gridoniceshelf(index_icefront(:,k))) ...
+.*(-min(0,z_bed(index_icefront(:,l))).*min(0,z_bed(index_icefront(:,j))) ...
++min(0,z_thick(index_icefront(:,l))+z_bed(index_icefront(:,l)))...
+.*min(0,z_thick(index_icefront(:,j))+z_bed(index_icefront(:,j)))))...
+.*normal_icefront(:,1).*length_icefront(:) ...
+/(4*(l==k & j==k) + 12*(l~=k | j~=k) );
+
+				Rhs(index_icefront(:,k)+nods)=Rhs(index_icefront(:,k)+nods) + ...
+(rho_ice*g/2*z_thick(index_icefront(:,l)).*z_thick(index_icefront(:,j)) ...
++ rho_water*g/2*(md.gridoniceshelf(index_icefront(:,k))) ...
+.*(-min(0,z_bed(index_icefront(:,l))).*min(0,z_bed(index_icefront(:,j))) ...
++min(0,z_thick(index_icefront(:,l))+z_bed(index_icefront(:,l)))...
+.*min(0,z_thick(index_icefront(:,j))+z_bed(index_icefront(:,j)))))...
+.*normal_icefront(:,2).*length_icefront(:) ...
+/(4*(l==k & j==k) + 12*(l~=k | j~=k) );
+
+		end
+	end
+end
+
+clear Rhs_x Rhs_y row_rhs
+
+% Step 4 -- Create the parsing matrix to "wring out"
+%           the known boundary conditions
+
+% kinematic condition (u,v=0) specified at non-ice-front boundaries;
+num_specified= 2*sum(node_on_dirichlet);
+row=zeros(2*nods-num_specified,1);
+col=zeros(2*nods-num_specified,1);
+value=zeros(2*nods-num_specified,1);
+count=0;
+for n=1:nods
+   if(~node_on_dirichlet(n))
+   		count=count+1;
+		row(count)=count;
+		col(count)=n;
+		value(count)=1;
+	end
+end
+for n=1:nods
+   if (~node_on_dirichlet(n))
+         count=count+1;
+		row(count)=count;
+		col(count)=nods+n;
+		value(count)=1;
+	end
+end
+
+P=sparse2(row,col,value,2*nods-num_specified,2*nods);
+
+
+specified_velocity=zeros(2*nods,1);
+pos=find(node_on_dirichlet);
+specified_velocity(pos)=md.dirichletvalues_diag(pos,1)/md.yts;
+specified_velocity(nods+pos)=md.dirichletvalues_diag(pos,2)/md.yts;
+
+
+% ######## an attention grabbing break ########
+%      Iterate on flow law till converged
+
+converged_yet=0;
+loop=0;
+
+u_old=zeros(nods,1);
+v_old=zeros(nods,1);
+convergence_count=1;
+
+while (~converged_yet)
+
+	if (loop>(100))
+		warning('Maximum Viscosity Iterations  Reached.')
+		break;
+	end;
+	loop=loop+1;
+
+	nu_bar_oldvalue=nu_bar;
+
+	% Step 4 -- Set up stress-balance matrix  (whos solution is the velocity
+	% field):
+
+	matrix_value_A=zeros(nel*6,1);
+	matrix_value_B=zeros(nel*3*3,1);
+	matrix_value_C=zeros(nel*3*3,1);
+	matrix_value_D=zeros(nel*6,1);
+
+	count=-nel+1;
+
+	for i=1:3
+		for j=i:3
+				count=count+nel;
+
+				matrix_value_A(count:count+nel-1)=nu_bar .* ...
+				  permanent_pieces_of_A(count:count+nel-1);
+
+				matrix_value_D(count:count+nel-1)=nu_bar .* ...
+				  permanent_pieces_of_D(count:count+nel-1);
+
+
+		end
+	end
+
+	count=-nel+1;
+
+	for i=1:3
+		for j=1:3
+				count=count+nel;
+
+				matrix_value_B(count:count+nel-1)=nu_bar .* ...
+				  permanent_pieces_of_B(count:count+nel-1);
+
+				matrix_value_C(count:count+nel-1)=nu_bar .* ...
+				  permanent_pieces_of_C(count:count+nel-1);
+
+
+		end
+	end
+
+
+
+	A=sparse2(row_location_AD,col_location_AD,matrix_value_A,nods,nods);
+	A=A+triu(A,1)';
+	B=sparse2(row_location,col_location,matrix_value_B,nods,nods);
+	C=sparse2(row_location,col_location,matrix_value_C,nods,nods);
+	D=sparse2(row_location_AD,col_location_AD,matrix_value_D,nods,nods);
+	D=D+triu(D,1)';
+
+
+	F=[A C
+	B D];
+
+	%Now, take care of the basal friction if there is any: to make things easier, we translate u = k *Neff^(-q)* sigma^p into 
+	% sigma= drag^2 * Neff ^(r) * u^s with r=q/p and s=1/p : */
+	 
+	if  (drag_type==2), 
+		%compute coeffs: 
+		rcoeff=qcoeff_grid./pcoeff_grid;
+		scoeff=1./pcoeff_grid;
+		
+		%initialization of basal drag stiffness
+		Dragoperator=spalloc(2*nods,2*nods,0);
+
+		if loop~=1,
+			
+			%retrieve the velocity magnitude
+			velocity_mag=sqrt(solution(1:nods).^2+solution(nods+1:2*nods).^2);
+		
+			%Computation of the effective pressure
+			Neff=g*(rho_ice*z_thick+rho_water*z_bed);
+
+			%If effective pressure becomes negative, sliding becomes unstable (Paterson 4th edition p 148). This is because 
+			%the water pressure is so high, the ice sheet elevates over its ice bumps and slides. But the limit behaviour 
+			%for this should be an ice shelf sliding (no basal drag). Therefore, for any effective pressure Neff < 0, we should 
+			%replace it by Neff=0 (ie, equival it to an ice shelf)*/
+			pos=find(Neff<0);
+			Neff(pos)=0;
+			
+			%Basal drag coefficient: Tau_x=-alpha^2 u, Tau_y=-alpha^2 v (See
+			%MacAyeal)
+			alpha2=(drag.^2).*(Neff.^rcoeff).*(velocity_mag.^(scoeff-1));
+
+			%stiffness due to basal drag 
+			%initialization
+			count=0;
+			value=zeros(nel,27);
+			row=zeros(nel,27);
+			col=zeros(nel,27);
+
+			for m=1:3
+				for k=1:3
+				for l=1:3
+					if ( (m==k) + (m==l) + (l==k) )==3
+					fac=1/10;
+					elseif ( (m==k) + (m==l) + (l==k) )==1
+					fac=1/30;
+					else
+					fac=1/60;
+					end
+
+					count=count+1;
+					row(:,count)=index(:,m);
+					col(:,count)=index(:,k);
+					value(:,count)=fac*aire(:).* ...
+					(alpha2(index(:,l)));%.*element_on_icesheet(index(:,l));
+
+				end
+				end
+			end
+
+			Dragoperator=[sparse2(row,col,value,nods,nods) spalloc(nods,nods,0)
+				spalloc(nods,nods,0) sparse2(row,col,value,nods,nods)];
+			end
+
+		F=F+Dragoperator;  %plug into the global stiffness matrix
+		
+	end
+
+
+	Rhs_parsed=P*(Rhs - F*specified_velocity);
+	F=P*F*P';
+
+
+	% Step 5 -- Solve the problem:
+
+	% Digression: if need be clear up some memory:
+
+	clear   matrix_value_A ...
+	matrix_value_B matrix_value_C matrix_value_D A B C D 
+
+	% We can use either the LU or the Cholesky decomposition, but the
+	% Cholesky decomposition is twice as efficient as LU for symmetric
+	% definite positive matrix
+
+		if strcmpi(md.solver_type,'lu'),
+			% Solve by LU decomposition. 
+			[L,U] = lu(F);
+			solution= U\(L\Rhs_parsed);
+		elseif strcmpi(md.solver_type,'cholesky'),
+			% Solve by Choleski decomposition.
+			L = chol(F);
+			solution= L\(L'\Rhs_parsed);
+		else
+			% use matlab's generic solver
+			solution = F\Rhs_parsed;
+		end
+	   
+
+
+	%Add spcs to the calculated solution
+	solution=P'*solution + specified_velocity;
+
+	%Recover solution vector
+	u=solution(1:nods);
+	v=solution(nods+1:2*nods);
+
+	%Compute viscosity 
+	nu_bar=viscosity(index,nel,alpha,beta,u,v,B_bar,glen_coeff);
+	change=1 - nu_bar_oldvalue./nu_bar; 
+
+	%Update viscosity
+	nu_bar=nu_bar.*(1+viscosity_overshoot*change);
+	location=find(nu_bar<=0);
+	nu_bar(location)=-nu_bar(location);
+
+	%Test for direct shooting convergence
+	if convergence_count>1,
+
+		ug=[u_old;v_old];
+		nug=norm(ug,2);
+		dug=[u; v]-[u_old; v_old];
+		ndug=norm(dug,2);
+		relative_change=ndug/nug;
+
+
+		%Figure out if viscosity converged
+		if relative_change<criterion_rel,
+			disp(sprintf('%s %g %s %g %s','   Convergence criterion: norm(du)/norm(u)=',relative_change,' < ',criterion_rel,' m/yr'));
+			converged_yet=1;
+		else
+			disp(sprintf('%s %g %s %g %s','   Convergence criterion: norm(du)/norm(u)=',relative_change,' > ',criterion_rel,' m/yr'));
+			converged_yet=0;
+		end
+
+		if ~isnan(criterion_abs),
+			change=max(abs(dug))*yts;
+			if change<criterion_abs
+				disp(sprintf('%s %g %s %g %s','   Convergence criterion: max(du)=',change,' < ',criterion_abs,' m/yr'));
+				converged_yet=1;
+			else
+				disp(sprintf('%s %g %s %g %s','   Convergence criterion: max(du)=',change,' > ',criterion_abs,' m/yr'));
+				converged_yet=0;
+			end
+		end
+	else 
+		converged_yet=0;
+	end
+
+	u_old=u;
+	v_old=v;
+
+	convergence_count=convergence_count+1;
+		
+end % This end statement terminates the "while" command way above
+
+%Load results onto md:
+md.vx=u*yts;
+md.vy=v*yts;
+md.vel=sqrt(md.vx.^2+md.vy.^2);
+
+%stop timing
+t2=clock;
+
+disp(sprintf('\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']));
+
+function macayealdiagnosticusage();
+disp('md=macayealdiagnostic(md)');
+disp('   where md is a structure of class @model');
Index: /issm/trunk/src/m/solutions/macayeal/objectivefunction_C_flow.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/objectivefunction_C_flow.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/objectivefunction_C_flow.m	(revision 1)
@@ -0,0 +1,97 @@
+function [J,u,v]=objectivefunction_C(search_scalar,B,glen_coeff,direction,Rhs,S,F,P,specified_velocity,...
+   nods,nel,vx_obs,vy_obs,u_objective,v_objective,index,alpha, beta, area,weighting,rowD,colD,rowDshort,colDshort,valueuu,valuevv,...
+   valueuv,matrix_bar,criterion)
+%OBJECTIVEFUNCTION_C - compute the misfit of a model
+%
+%   this routine updates the value of the spatial distribution of viscosity, calculates the
+%   new velocity field and compares it to the observed velocity field (J)
+%
+%   Usage:
+%      [J,u,v]=objectivefunction_C(search_scalar,B,glen_coeff,direction,Rhs,S,F,P,specified_velocity,nods,nel,vx_obs,vy_obs,u_objective,v_objective,index,alpha, beta, area,weighting,rowD,colD,rowDshort,colDshort,valueuu,valuevv,valueuv,matrix_bar,criterion)
+
+B_new=B+search_scalar*direction;
+%@@@ B_bar=matrix_bar*B_new;
+
+B_bar=(B_new(index(:,1))+B_new(index(:,2))+B_new(index(:,3)))/3;
+%### nu_bar=10^14*ones(nel,1);
+
+%###AK
+nu_bar=viscosity(index,nel,alpha,beta,u_objective,v_objective,B_bar,glen_coeff);
+%###
+
+converged_yet=0;
+convergence_count=1;
+loop=0;
+
+
+while (~converged_yet)
+   clear u v
+   
+   
+   nu_bar_uu=[nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar];
+   nu_bar_vv=[nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar];
+   nu_bar_uv=[nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar nu_bar];
+   
+   if (loop>100)
+		u=u_old; v=v_old;
+      break;
+   end;
+   nu_bar_oldvalue=nu_bar;
+   loop=loop+1;
+   
+   Duu=sparse(rowDshort,colDshort,nu_bar_uu.*valueuu,nods,nods);
+   Duu=Duu+triu(Duu,1)';
+   
+   Dvv=sparse(rowDshort,colDshort,nu_bar_vv.*valuevv,nods,nods);
+   Dvv=Dvv+triu(Dvv,1)';
+   
+   F=[Duu sparse(rowD,colD,nu_bar_uv.*valueuv,nods,nods)
+      sparse(colD,rowD,nu_bar_uv.*valueuv,nods,nods) Dvv]; 
+   
+   
+   Rhs_parsed=P*(Rhs - F*specified_velocity);
+   Fprime=P*F*P';
+   
+   
+   solution=Fprime\Rhs_parsed;
+   solution=P'*solution + specified_velocity;
+   u=solution(1:nods);
+   v=solution(nods+1:2*nods);
+   nu_bar=viscosity(index,nel,alpha,beta, u,v,B_bar,glen_coeff);
+   
+   %Test for direct shooting convergence
+   if convergence_count>1,
+
+       dug=[u; v]-[u_old; v_old];
+       ndug=norm(dug,2);
+       ug=[u_old;v_old];
+       nug=norm(ug,2);
+
+       change=ndug/nug;
+
+       %Figure out if viscosity converged
+       if change>criterion,
+           converged_yet=0;
+       else
+           converged_yet=1;
+       end
+   else
+       converged_yet=0;
+   end
+
+   u_old=u;
+   v_old=v;
+
+convergence_count=convergence_count+1;
+ 
+end 
+%disp(['# of elements over criterion: ' num2str(sum(test))]);
+
+%@@@AK save F_file F
+save F_file F 
+
+Du=[(u-vx_obs).*weighting
+   (v-vy_obs).*weighting];
+
+
+J=Du'*S*Du;
Index: /issm/trunk/src/m/solutions/macayeal/setup_control.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/setup_control.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/setup_control.m	(revision 1)
@@ -0,0 +1,45 @@
+%SETUP_CONTROL - compute the viscosity derivative with respect to the velocity 
+%
+%   This script is used in control methods it builds the mass matrix of the system
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%we want the number of non zero elements in the connectivity matrix.
+row=zeros(nel*9,1);
+col=zeros(nel*9,1);
+value=zeros(nel*9,1);
+count=-nel+1;
+for l=1:3
+   for m=1:3 
+      count=count+nel;
+      col(count:count+nel-1)=index(:,l);
+      row(count:count+nel-1)=index(:,m);
+      value(count:count+nel-1)=1 ;
+   end
+end
+Connect=sparse(row,col,value,nods,nods);
+numnz=nnz(Connect);
+clear row col value Connect
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+Zeros=spalloc(nods,nods,0);
+
+Elint=zeros(3,3);
+row=zeros(3,1);
+col=zeros(3,1);
+
+S=spalloc(nods,nods,numnz);
+for n=1:nel
+   row=[index(n,1) index(n,2) index(n,3)]';
+   col=[index(n,1) index(n,2) index(n,3)]';
+   Elint=area(n)*[2 1 1
+      1 2 1
+      1 1 2]/12;
+   S(row,col)=S(row,col)+Elint;
+   
+end
+
+S=[S Zeros
+   Zeros S];
Index: /issm/trunk/src/m/solutions/macayeal/shape.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/shape.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/shape.m	(revision 1)
@@ -0,0 +1,21 @@
+function [alpha,beta,gamma,area]=shape(index,x,y,nel,nods)
+%SHAPE - compute nodal functions coefficients and triangle area
+%
+%   this routine calculates the coefficients of all the nodal functions and the area of each
+%   element with:
+%   o N(x,y)=alpha*x+beta*y+gama
+%
+%   Usage:
+%      [alpha,beta,gamma,area]=shape(index,x,y,nel,nods)
+
+alpha=zeros(nel,3); beta=zeros(nel,3); 
+gamma=zeros(nel,3); area=zeros(nel,1);
+for n=1:nel
+	X=inv([x(index(n,:)) y(index(n,:)) ones(3,1)]);
+	alpha(n,:)=X(1,:);
+	beta(n,:)=X(2,:);
+	gamma(n,:)=X(3,:);
+	area(n)=1/2 * det([1 1 1;x(index(n,:))';y(index(n,:))']);
+end
+clear X;
+area=abs(area);
Index: /issm/trunk/src/m/solutions/macayeal/shear.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/shear.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/shear.m	(revision 1)
@@ -0,0 +1,14 @@
+function [ux,uy,vx,vy]=shear(index,alpha,beta,u,v)
+%SHEAR - compute strain rate components
+%
+%   this routine calculates quantities used by visc grad and
+%   viscosity2 to compute the viscosity
+%
+%   Usage:
+%      [ux,uy,vx,vy]=shear(index,alpha,beta,u,v)
+
+summation=[1;1;1];
+ux=(u(index).*alpha)*summation;
+uy=(u(index).*beta)*summation;
+vx=(v(index).*alpha)*summation;
+vy=(v(index).*beta)*summation;						
Index: /issm/trunk/src/m/solutions/macayeal/stress.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/stress.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/stress.m	(revision 1)
@@ -0,0 +1,13 @@
+function [tau_xx, tau_yy,tau_xy]=stress(u,v)
+%STRESS - compute the stress components
+%
+%   this routine calculates the components of the stress tensor in 2D
+%
+%   Usage:
+%      [tau_xx, tau_yy,tau_xy]=stress(u,v)
+
+nu_bar=viscosity(u,v);
+[ux,uy,vx,vy]=shear(u,v);
+tau_xx=2*nu_bar.*ux;
+tau_yy=2*nu_bar.*vy;
+tau_xy=nu_bar.*(uy+vx);
Index: /issm/trunk/src/m/solutions/macayeal/visc_grad.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/visc_grad.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/visc_grad.m	(revision 1)
@@ -0,0 +1,18 @@
+function [nu2,nu3]=visc_grad(index,nel,alpha,beta,u,v,B_bar)
+%VISC_GRAD - computes the derivative of the viscosity with respect to the velocity
+%
+%   Usage:
+%      [nu2,nu3]=visc_grad(index,nel,alpha,beta,u,v,B_bar)
+
+nu2=zeros(nel,1);
+nu3=zeros(nel,1);
+
+[ux ,uy ,vx, vy]=shear(index,alpha,beta,u,v);
+
+second_inv=(ux.^2 + vy.^2 + ((uy+vx).^2)/4 + ux.*vy);
+location=find(second_inv~=0);
+nu2(location)=B_bar(location).*(second_inv(location).^(-4/3))/2;
+nu3(location)=second_inv(location).^(-1/3)/2;
+location=find(second_inv==0);
+nu2(location)=10^30; 
+nu3(location)=10^30;
Index: /issm/trunk/src/m/solutions/macayeal/viscosity.m
===================================================================
--- /issm/trunk/src/m/solutions/macayeal/viscosity.m	(revision 1)
+++ /issm/trunk/src/m/solutions/macayeal/viscosity.m	(revision 1)
@@ -0,0 +1,28 @@
+function nu_bar=viscosity(index,nel,alpha,beta,u,v,B_bar,glen_coeff)
+%VISCOSITY - compute the viscosity
+%
+%   This routine calculates the averaged viscosity over each 
+%   element using Glen's flow law.
+%
+%   Usage:
+%      nu_bar=viscosity(index,nel,alpha,beta,u,v,B_bar,glen_coeff)
+
+
+if (isempty(u) & isempty(v)),
+	nu_bar=10^14*ones(nel,1);
+else
+	nu_bar=zeros(nel,1);
+
+	power=(glen_coeff-1)./(2*glen_coeff);
+	[ux ,uy ,vx, vy]=shear(index,alpha,beta,u,v);
+	second_inv=(ux.^2 + vy.^2 + ((uy+vx).^2)/4 + ux.*vy);
+
+	location=find(second_inv~=0);
+	nu_bar(location)=B_bar(location)./(second_inv(location).^power(location));
+
+	location=find(second_inv==0 & power~=0);
+	nu_bar(location)=10^18; 	%arbitrary maximum viscosity to apply where there is no effective shear
+							
+	location=find(second_inv==0 & power==0);
+	nu_bar(location)=B_bar(location);
+end
Index: /issm/trunk/src/m/utils/Antarctica/README
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/README	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/README	(revision 1)
@@ -0,0 +1,1 @@
+Matlab utilities used for Antarctica only.
Index: /issm/trunk/src/m/utils/Antarctica/antcreatewrappedmap.m
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/antcreatewrappedmap.m	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/antcreatewrappedmap.m	(revision 1)
@@ -0,0 +1,19 @@
+function map=antcreatewrappedmap(mapormapname,levels);
+%ANTCREATEWRAPPEDMAP - ???
+% 
+%   Usage:
+%      map=antcreatewrappedmap(mapormapname,levels)
+
+if ischar(mapormapname),
+	a=colormap(mapormapname);
+else
+	a=mapormapname;
+end
+
+map=a;
+for i=1:levels-1,
+	map=[map ; a];
+end
+
+end
+
Index: /issm/trunk/src/m/utils/Antarctica/antimread.m
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/antimread.m	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/antimread.m	(revision 1)
@@ -0,0 +1,31 @@
+function [im,x_m,y_m]=antimread(filename,format);
+%ANTINREAD - ???
+%
+%   Usage:
+%      [im,x_m,y_m]=antimread(filename,format)
+
+%Get radical of filename
+[pathstr,name,ext,versn] = fileparts(filename);
+
+%Build box filename
+boxfilename=[pathstr '/' name '_box.exp'];
+
+%Read box coordinates;
+box=expread(boxfilename,1);
+
+x0=min(box.x);
+x1=max(box.x);
+y0=min(box.y);
+y1=max(box.y);
+
+%read image
+im=flipud(imread(filename,format));
+
+%build x_m and y_m
+s=size(im);
+sx=s(2);
+sy=s(1);
+
+
+x_m=(x0+(x1-x0)/(sx-1)*(1:sx))';
+y_m=(y0+(y1-y0)/(sy-1)*(1:sy))';
Index: /issm/trunk/src/m/utils/Antarctica/antlatlonoverlay.m
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/antlatlonoverlay.m	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/antlatlonoverlay.m	(revision 1)
@@ -0,0 +1,234 @@
+function [handle_structure]=antlatlonoverlay(latstep,lonstep,color,resolution,gap)
+%ANTLATLONOVERLAY - ???
+%
+%   latstep,lonstep: step, in latitude and longitude degreees, between two latitudinal, longitudinal profiles.
+%   color: [1 1 1] for ex
+%   resolution: profile resolution ( in lat,lon degrees) 
+%   gap: gap (in meters) to plug lat,lon degree numbers;
+%  
+%   Usage:
+%      [handle_structure]=antlatlonoverlay(latstep,lonstep,color,resolution,gap)
+
+if ((nargin==0) || (nargin~=5) || (nargout~=1)),
+	help antlatlonoverlay;
+	return;
+end
+handle_structure(1).text='';
+
+step=min(latstep,lonstep);
+
+%Find lat and lon that fit within the bounds of our image.
+lat=-90:step:0;
+lon=0:step:360;
+
+xlimits=xlim;
+ylimits=ylim;
+
+found=0;
+for i=1:length(lon),
+	latitudes=lat;
+	longitude=lon(i);
+	[x,y]=ll2xy(lat,lon(i));
+	if length(find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2))),
+		found=1;
+		break;
+	end
+end
+
+if found==0,
+	handle_structure=antlatlonoverlay(latstep/2,lonstep/2,color,resolution,gap);
+end
+
+pos= find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2));
+thislat=latitudes(pos(1));
+thislon=longitude;
+%build profiles from this center outwards. 
+latprofile.x=0;
+latprofile.y=0;
+lonprofile.x=0;
+lonprofile.y=0;
+
+longitude=(0:(resolution*4):360)';
+for i=0:(90/latstep),
+	[x,y]=ll2xy((thislat+i*latstep)*ones(length(longitude),1),longitude);
+	if ~length(find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2))),
+		break;
+	else
+		pos= find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2));
+		latprofile(end+1).x=x(pos);
+		latprofile(end).y=y(pos);
+		latprofile(end).lat=thislat+i*latstep;
+	end
+end
+
+for i=0:(90/latstep),
+	[x,y]=ll2xy((thislat-i*latstep)*ones(length(longitude),1),longitude);
+	if ~length(find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2))),
+		break;
+	else
+		pos= find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2));
+		latprofile(end+1).x=x(pos);
+		latprofile(end).y=y(pos);
+		latprofile(end).lat=thislat-i*latstep;
+	end
+end
+
+latitude=(-90:resolution:0)';
+for i=0:(180/lonstep),
+	[x,y]=ll2xy(latitude,(thislon+i*lonstep)*ones(length(latitude),1));
+	if ~length(find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2))),
+		break;
+	else
+		pos= find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2));
+		lonprofile(end+1).x=x(pos);
+		lonprofile(end).y=y(pos);
+		lonprofile(end).lon=thislon+i*lonstep;
+	end
+end
+for i=0:(180/lonstep),
+	[x,y]=ll2xy(latitude,(thislon-i*lonstep)*ones(length(latitude),1));
+	if ~length(find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2))),
+		break;
+	else
+		pos= find(x>xlimits(1) & x<xlimits(2) & y>ylimits(1) & y<ylimits(2));
+		lonprofile(end+1).x=x(pos);
+		lonprofile(end).y=y(pos);
+		lonprofile(end).lon=thislon-i*lonstep;
+	end
+end
+
+
+latprofile=latprofile(2:end);
+lonprofile=lonprofile(2:end);
+
+
+%Verify we don't have duplicate profiles, and root out profiles that have less than 10 points.
+prof=latprofile(1);
+for i=2:length(latprofile),
+	found=0;
+	for j=1:length(prof),
+		if (prof(j).lat==latprofile(i).lat),
+			found=1;
+		end
+	end
+	if length(latprofile(i).x)<10,
+		found=1; %reject this profile
+	end
+	if found==0,
+		prof(end+1)=latprofile(i);
+	end
+end
+latprofile=prof;
+
+prof=lonprofile(1);
+for i=2:length(lonprofile),
+	found=0;
+	for j=1:length(prof),
+		if (prof(j).lon==lonprofile(i).lon),
+			found=1;
+		end
+	end
+	if length(lonprofile(i).x)<10,
+		found=1; %reject this profile
+	end
+	if found==0,
+		prof(end+1)=lonprofile(i);
+	end
+end
+lonprofile=prof;
+
+hold on;
+for i=1:length(latprofile),
+	l=line(latprofile(i).x,latprofile(i).y,'Color',color);
+	disp(['Specifiy where to put number for latitude ' num2str(latprofile(i).lat)])
+	[xcorner,ycorner]=ginput(1);
+
+	%Find nearest point on this profile corresponding to (xcorner,ycorner):
+	ind=find_point(latprofile(i).x,latprofile(i).y,xcorner,ycorner);
+	xcorner=latprofile(i).x(ind);
+	ycorner=latprofile(i).y(ind);
+	
+	if length(latprofile(i).x(1:ind))>10,
+		xcorner2=latprofile(i).x(ind-10);
+		ycorner2=latprofile(i).y(ind-10);
+	else
+		xcorner2=latprofile(i).x(ind-1);
+		ycorner2=latprofile(i).y(ind-1);
+	end
+
+
+	angle=180/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner));
+
+	if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
+		handle_structure(end+1).text=text(xcorner,ycorner,[num2str(latprofile(i).lat) '^{\circ}']);set(handle_structure(end).text,'Color',color,'Rotation',angle,'FontSize',14,'HorizontalAlignment','center','VerticalAlignment','middle');
+
+		%erase line and redraw it in two parts, to leave space for latitude number
+		delete(l);
+		dl=sqrt((latprofile(i).x(1)-latprofile(i).x(10))^2+(latprofile(i).y(1)-latprofile(i).y(10))^2);
+		indoffset=floor(10*gap/dl);
+		handle_structure(end+1).line=line(latprofile(i).x(1:(ind-indoffset)),latprofile(i).y(1:(ind-indoffset)),'Color',color);hold on;
+		handle_structure(end+1).line=line(latprofile(i).x((ind+indoffset):length(latprofile(i).y)),latprofile(i).y((ind+indoffset):length(latprofile(i).y)),'Color',color);
+	end
+	latprofile(i).linehandle=l;
+end
+
+for i=1:length(lonprofile),
+	l=line(lonprofile(i).x,lonprofile(i).y,'Color',color);
+	if lonprofile(i).lon<180,
+		disp(['Specifiy where to put number for longitude ' num2str(lonprofile(i).lon)])
+		[xcorner,ycorner]=ginput(1);
+		%Find nearest point on this profile corresponding to (xcorner,ycorner):
+		ind=find_point(lonprofile(i).x,lonprofile(i).y,xcorner,ycorner);
+		xcorner=lonprofile(i).x(ind);
+		ycorner=lonprofile(i).y(ind);
+		if length(lonprofile(i).x(1:ind))>10,
+			xcorner2=lonprofile(i).x(ind-10);
+			ycorner2=lonprofile(i).y(ind-10);
+		else
+			xcorner2=lonprofile(i).x(ind-1);
+			ycorner2=lonprofile(i).y(ind-1);
+		end
+
+		angle=180/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner));
+
+
+		if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
+			handle_structure(end+1).text=text(xcorner,ycorner,[num2str(lonprofile(i).lon) '^{\circ}']);set(handle_structure(end).text,'Color',color,'Rotation',angle,'FontSize',14,'HorizontalAlignment','center','VerticalAlignment','middle');
+			%erase line and redraw it in two parts, to leave space for longitude number
+			delete(l);
+			dl=sqrt((lonprofile(i).x(1)-lonprofile(i).x(10))^2+(lonprofile(i).y(1)-lonprofile(i).y(10))^2);
+			indoffset=floor(10*gap/dl);
+			handle_structure(end+1).line=line(lonprofile(i).x(1:(ind-indoffset)),lonprofile(i).y(1:(ind-indoffset)),'Color',color);hold on;
+			handle_structure(end+1).line=line(lonprofile(i).x((ind+indoffset):length(lonprofile(i).y)),lonprofile(i).y((ind+indoffset):length(lonprofile(i).y)),'Color',color);
+		end
+	else
+		disp(['Specifiy where to put number for longitude ' num2str(360-lonprofile(i).lon)])
+		[xcorner,ycorner]=ginput(1);
+		%Find nearest point on this profile corresponding to (xcorner,ycorner):
+		ind=find_point(lonprofile(i).x,lonprofile(i).y,xcorner,ycorner);
+		xcorner=lonprofile(i).x(ind);
+		ycorner=lonprofile(i).y(ind);
+		if length(lonprofile(i).x(1:ind))>10,
+			xcorner2=lonprofile(i).x(ind-10);
+			ycorner2=lonprofile(i).y(ind-10);
+		else
+			xcorner2=lonprofile(i).x(ind-1);
+			ycorner2=lonprofile(i).y(ind-1);
+		end
+		angle=180/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner));
+
+		if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
+			handle_structure(end+1).text=text(xcorner,ycorner,[num2str(360-lonprofile(i).lon) '^{\circ}']);set(handle_structure(end).text,'Color',color,'Rotation',angle,'FontSize',14,'HorizontalAlignment','center','VerticalAlignment','middle');
+			%erase line and redraw it in two parts, to leave space for longitude number
+			delete(l);
+			dl=sqrt((lonprofile(i).x(1)-lonprofile(i).x(10))^2+(lonprofile(i).y(1)-lonprofile(i).y(10))^2);
+			indoffset=floor(10*gap/dl);
+			handle_structure(end+1).line=line(lonprofile(i).x(1:(ind-indoffset)),lonprofile(i).y(1:(ind-indoffset)),'Color',color);hold on;
+			handle_structure(end+1).line=line(lonprofile(i).x((ind+indoffset):length(lonprofile(i).y)),lonprofile(i).y((ind+indoffset):length(lonprofile(i).y)),'Color',color);
+		end
+	end
+	lonprofile(i).linehandle=l;
+end
+
+%return effective handle_structure: 
+handle_structure=handle_structure(2:length(handle_structure));
Index: /issm/trunk/src/m/utils/Antarctica/antmovie.m
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/antmovie.m	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/antmovie.m	(revision 1)
@@ -0,0 +1,6 @@
+%ANTMOVIE - ???
+
+for i=1:10,
+	view([-30+18*i],80);
+	im(i)=getframe;
+end
Index: /issm/trunk/src/m/utils/Antarctica/antoutline.m
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/antoutline.m	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/antoutline.m	(revision 1)
@@ -0,0 +1,38 @@
+%ANTOUTLINE - script that read in outline of antarctica and display. 
+
+xbounds=xlim;
+ybounds=xlim;
+
+x0=xbounds(1);x1=xbounds(2);
+y0=ybounds(1);y1=ybounds(2);
+
+
+%figure out where we want to put the outline.
+disp('Select south-west corner of outline image');
+[x,y]=ginput(1)
+
+position_axes=get(gca,'Position')
+position_outline=[position_axes(1)+(x-x0)/(x1-x0),position_axes(2)+(y-y0)/(y1-y0),.15,.15]
+load /proj/tpfimos/larour/Glaciology/Model_Data/Mosaic_Tiff/antarctica_outline
+outline_axes=axes('Position',position_outline);
+imagesc(outlinex,outliney,outline);set(outline_axes,'YDir','normal');
+set(outline_axes,'XTick',[]); set(outline_axes,'YTick',[]);
+set(outline_axes,'XTickLabel',[]); set(outline_axes,'YTickLabel',[]);
+
+hold on;
+
+%build box inside the continent
+for i=1:50,
+	plot(x0:500:x1,(y0+500*i)*ones(length(x0:500:x1),1),'r');
+	plot(x0:500:x1,(y1-500*i)*ones(length(x0:500:x1),1),'r');
+	plot((x0+500*i)*ones(length(y0:500:y1),1),y0:500:y1,'r');
+	plot((x1-500*i)*ones(length(y0:500:y1),1),y0:500:y1,'r');
+end
+%make border
+for i=1:50,
+	plot(min(outlinex):500:max(outlinex),(min(outliney)+500*i)*ones(length(min(outlinex):500:max(outlinex)),1),'w');
+	plot(min(outlinex):500:max(outlinex),(max(outliney)-500*i)*ones(length(min(outlinex):500:max(outlinex)),1),'w');
+	plot((min(outlinex)+500*i)*ones(length(min(outliney):500:max(outliney)),1),min(outliney):500:max(outliney),'w');
+	plot((max(outlinex)-500*i)*ones(length(min(outliney):500:max(outliney)),1),min(outliney):500:max(outliney),'w');
+end
+
Index: /issm/trunk/src/m/utils/Antarctica/antoverlay.m
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/antoverlay.m	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/antoverlay.m	(revision 1)
@@ -0,0 +1,191 @@
+function antoverlay(fig1,fig2,alpha,colorbartitle,colmap,wrappingnumber,outlineflag,colorbarflag);
+%ANTOVERLAY - overlay a figure with image of Antarctica
+%
+%   Overlay figure1 image with Antarctica Power Image, and display on figure 2.
+%   
+%   Usage:
+%      antoverlay(fig1,fig2,alpha,colorbartitle,colmap,wrappingnumber,outlineflag,colorbarflag)
+
+if ((nargin==0) || (nargin~=8)),
+	help antoverlay;
+	return;
+end
+
+%Capture image on figure fig1:
+figure(fig1)
+
+%Capture title
+t=get(gca,'Title');
+ti=get(t,'String');
+
+%First remove tick marks
+fig1xticks=get(gca,'XTick');
+fig1yticks=get(gca,'YTick');
+set(gca,'XTick',[]);
+set(gca,'YTick',[]);
+
+%Capture
+im=frame2im(getframe);
+
+%Capture max and min values
+maxminvalues=caxis;
+c1=maxminvalues(1);
+c2=maxminvalues(2);
+
+%flip image and rescale it.
+red=im(:,:,1);
+green=im(:,:,2);
+blue=im(:,:,3);
+im(:,:,1)=flipud(red);
+im(:,:,2)=flipud(green);
+im(:,:,3)=flipud(blue);
+
+%Get Size of image
+s=size(im);
+s1=s(1);
+s2=s(2);
+
+%Get coordinates of image
+xbound=xlim;
+ybound=ylim;
+x0=xbound(1);
+x1=xbound(2);
+y0=ybound(1);
+y1=ybound(2);
+
+
+%Create new image coordinates
+x_m=x0:(x1-x0)/(s2-1):x1;
+y_m=y0:(y1-y0)/(s1-1):y1;
+
+%Now that image on figure fig1 is correctly setup, go fetch 
+%the radar power image. 
+path_gdal='/home/larour/gdal2/bin/';
+%the geotiff image is either 200m or 1km accuracy. We take the 1km accuracy if the domain 
+%of fig1  is more than 1000 km. 
+geotiff_name='/proj/tpfimos/larour/Glaciology/Model_Data/Mosaic_Tiff/amm125m_v2_200m.tif';
+if (max((x1-x0),(y1-y0))>1000000),
+	geotiff_name='/proj/tpfimos/larour/Glaciology/Model_Data/Mosaic_Tiff/amm125m_v2_1km.tif';
+end
+inputname='./temp.tif';
+
+command=['system(''' path_gdal 'gdal_translate -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ''');'];
+eval(command);
+
+%Read in temp.tif:
+radar=imread('temp.tif','TIFF');
+%make sure radar image is square
+r=size(radar);
+r1=r(1);
+r2=r(2);
+x_r=x0:(x1-x0)/(r2-1):x1;
+y_r=y0:(y1-y0)/(r1-1):y1;
+
+%Display radar image first
+figure(fig2)
+figure_position=[1604 4 1594 1123];
+set(fig2,'Position',figure_position);
+%Build square axes
+%size_axes=.8;
+%position_axes=[(1-size_axes*figure_position(4)/figure_position(3))/2 (1-size_axes)/2 size_axes*figure_position(4)/figure_position(3)  size_axes];
+%axes('Position',position_axes);
+rim=imagesc(x_r,y_r,flipud(radar));colormap('gray');
+xlim([x0 x1]);
+ylim([y0 y1]);
+set(gca,'YDir','normal');
+
+%Display captured image 
+hold on
+iim=image(x_m,y_m,im);
+xlim([x0 x1]);
+ylim([y0 y1]);
+set(gca,'YDir','normal');
+position_axes=get(gca,'Position');
+
+%Take out ticks.
+set(gca,'XTick',[]); set(gca,'YTick',[]);
+set(gca,'XTickLabel',[]); set(gca,'YTickLabel',[]);
+
+
+%Set transparency of data image
+set(iim,'AlphaData',alpha);
+
+%Set title identical to the one from fig1
+title(ti,'Fontsize',18);
+
+for i=1:5,
+	plot(x_m,y_m(i)*ones(length(x_m),1),'k');
+	plot(x_m,y_m(length(y_m)-i+1)*ones(length(x_m),1),'k');
+	plot(x_m(i)*ones(length(y_m),1),y_m,'k');
+	plot(x_m(length(x_m)-i+1)*ones(length(y_m),1),y_m,'k');
+end
+
+
+if(outlineflag),
+	%Read in outline of antarctica and display. 
+	load /proj/tpfimos/larour/Glaciology/Model_Data/Mosaic_Tiff/antarctica_outline
+	disp('Select lower-left corner of outline image');
+	[xcorner,ycorner]=ginput(1);
+	disp('Select upper_right corner of outline image');
+	[xcorner2,ycorner2]=ginput(1);
+	%make sure ratio is conserved
+	xcorner2=xcorner+(ycorner2-ycorner)*(length(outlinex)/length(outliney));
+
+	position_outline=[position_axes(1)+position_axes(3)*(xcorner-x0)/(x1-x0),position_axes(2)+position_axes(4)*(ycorner-y0)/(y1-y0),(xcorner2-xcorner)/(x1-x0)*position_axes(3),(ycorner2-ycorner)/(y1-y0)*position_axes(4)];
+	outline_axes=axes('Position',position_outline); 
+	imagesc(outlinex,outliney,outline);set(outline_axes,'YDir','normal');
+	save temp outlinex outliney outline
+	set(outline_axes,'XTick',[]); set(outline_axes,'YTick',[]);
+	set(outline_axes,'XTickLabel',[]); set(outline_axes,'YTickLabel',[]);
+	hold on;
+	%build box inside the continent
+	for i=1:50,
+		plot(x0:500:x1,(y0+500*i)*ones(length(x0:500:x1),1),'r');
+		plot(x0:500:x1,(y1-500*i)*ones(length(x0:500:x1),1),'r');
+		plot((x0+500*i)*ones(length(y0:500:y1),1),y0:500:y1,'r');
+		plot((x1-500*i)*ones(length(y0:500:y1),1),y0:500:y1,'r');
+	end
+	%make border
+	for i=1:50,
+		plot(min(outlinex):500:max(outlinex),(min(outliney)+500*i)*ones(length(min(outlinex):500:max(outlinex)),1),'w');
+		plot(min(outlinex):500:max(outlinex),(max(outliney)-500*i)*ones(length(min(outlinex):500:max(outlinex)),1),'w');
+		plot((min(outlinex)+500*i)*ones(length(min(outliney):500:max(outliney)),1),min(outliney):500:max(outliney),'w');
+		plot((max(outlinex)-500*i)*ones(length(min(outliney):500:max(outliney)),1),min(outliney):500:max(outliney),'w');
+	end
+end
+
+%Build colorbar
+if(colorbarflag),
+	disp('Select lower-left corner of colorbar');
+	[xcorner,ycorner]=ginput(1);
+	disp('Select upper-right corner of colorbar');
+	[xcorner2,ycorner2]=ginput(1);
+	position_colorbar=[position_axes(1)+position_axes(3)*(xcorner-x0)/(x1-x0),position_axes(2)+position_axes(4)*(ycorner-y0)/(y1-y0),(xcorner2-xcorner)/(x1-x0)*position_axes(3),(ycorner2-ycorner)/(y1-y0)*position_axes(4)];
+else
+	position_colorbar=[.7,.05,.1,.02];
+end
+colim=zeros(1,length(colmap),3);
+colim(1,:,1)=colmap(:,1);
+colim(1,:,2)=colmap(:,2);
+colim(1,:,3)=colmap(:,3);
+colaxes=axes('Position',position_colorbar);
+image(colim);set(colaxes,'YDir','normal');
+set(colaxes,'XTick',[]);
+set(colaxes,'YTick',[]);
+%t=text(length(colmap)/2,2,[num2str(c2/wrappingnumber) ' ' colorbartitle]);
+t=text(0,0,num2str(c1));
+set(t,'FontSize',16,'HorizontalAlignment','left');
+t=text(length(colmap)/2,0,colorbartitle);
+set(t,'FontSize',16,'HorizontalAlignment','center');
+t=text(length(colmap),0,num2str(c2));
+set(t,'FontSize',16,'HorizontalAlignment','right');
+
+%We are done, reeastablish figure fig1 settings
+figure(fig1);
+set(gca,'XTick',fig1xticks);
+set(gca,'YTick',fig1yticks);
+
+%Make handle back for figure fig2
+figure(fig2);
+
+
Index: /issm/trunk/src/m/utils/Antarctica/antoverlay2.m
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/antoverlay2.m	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/antoverlay2.m	(revision 1)
@@ -0,0 +1,151 @@
+function antoverlay2(fig1,fig2,alpha,colorbartitle,colmap,wrappingnumber);
+%ANTOVERLAY2 - overlay a figure with image of Antarctica
+%
+%   Overlay figure1 image with Antarctica Power Image, and display on figure 2.
+%   
+%   Usage:
+%      antoverlay2(fig1,fig2,alpha,colorbartitle,colmap,wrappingnumber,outlineflag,colorbarflag)
+
+if ((nargin==0) || (nargin~=6)),
+	help antoverlay;
+	return;
+end
+
+%Capture image on figure fig1:
+figure(fig1)
+
+%Capture title
+t=get(gca,'Title');
+ti=get(t,'String');
+
+%First remove tick marks
+fig1xticks=get(gca,'XTick');
+fig1yticks=get(gca,'YTick');
+set(gca,'XTick',[]);
+set(gca,'YTick',[]);
+
+%Capture
+im=frame2im(getframe);
+
+%Capture max and min values
+maxminvalues=caxis;
+c1=maxminvalues(1);
+c2=maxminvalues(2);
+
+%flip image and rescale it.
+red=im(:,:,1);
+green=im(:,:,2);
+blue=im(:,:,3);
+im(:,:,1)=flipud(red);
+im(:,:,2)=flipud(green);
+im(:,:,3)=flipud(blue);
+
+%Get Size of image
+s=size(im);
+s1=s(1);
+s2=s(2);
+
+%Get coordinates of image
+xbound=xlim;
+ybound=ylim;
+x0=xbound(1);
+x1=xbound(2);
+y0=ybound(1);
+y1=ybound(2);
+
+
+%Create new image coordinates
+x_m=x0:(x1-x0)/(s2-1):x1;
+y_m=y0:(y1-y0)/(s1-1):y1;
+
+%Now that image on figure fig1 is correctly setup, go fetch 
+%the radar power image. 
+path_gdal='/home/larour/gdal2/bin/';
+%the geotiff image is either 200m or 1km accuracy. We take the 1km accuracy if the domain 
+%of fig1  is more than 1000 km. 
+geotiff_name='/proj/tpfimos/larour/Glaciology/Model_Data/Mosaic_Tiff/amm125m_v2_200m.tif';
+if (max((x1-x0),(y1-y0))>1000000),
+	geotiff_name='/proj/tpfimos/larour/Glaciology/Model_Data/Mosaic_Tiff/amm125m_v2_1km.tif';
+end
+inputname='./temp.tif';
+
+command=['system(''' path_gdal 'gdal_translate -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ''');'];
+eval(command);
+
+%Read in temp.tif:
+radar=imread('temp.tif','TIFF');
+save temp radar
+r=size(radar);
+r1=r(1);
+r2=r(2);
+x_r=x0:(x1-x0)/(r2-1):x1;
+y_r=y0:(y1-y0)/(r1-1):y1;
+
+%Display radar image first
+figure(fig2)
+set(fig2,'Position',[1604 4 1594 1123]);
+rim=imagesc(x_r,y_r,flipud(radar));colormap('gray');
+save temp x_r y_r
+set(gca,'YDir','normal');
+
+%Display captured image 
+hold on
+iim=image(x_m,y_m,im);
+set(gca,'YDir','normal');
+
+%Set transparency of data image
+set(iim,'AlphaData',alpha);
+
+%Set title identical to the one from fig1
+title(ti,'Fontsize',18);
+
+%x and y axis
+xlabel('X (m)','FontSize',18);
+ylabel('Y (m)','FontSize',18);
+
+%Read in outline of antarctica and display. 
+load /proj/tpfimos/larour/Glaciology/Model_Data/Mosaic_Tiff/antarctica_outline
+outline_axes=axes('Position',[.15,.75,.15,.15]); 
+imagesc(outlinex,outliney,outline);set(outline_axes,'YDir','normal');
+set(outline_axes,'XTick',[]); set(outline_axes,'YTick',[]);
+set(outline_axes,'XTickLabel',[]); set(outline_axes,'YTickLabel',[]);
+hold on;
+%build box inside the continent
+for i=1:50,
+	plot(x0:500:x1,(y0+500*i)*ones(length(x0:500:x1),1),'r');
+	plot(x0:500:x1,(y1-500*i)*ones(length(x0:500:x1),1),'r');
+	plot((x0+500*i)*ones(length(y0:500:y1),1),y0:500:y1,'r');
+	plot((x1-500*i)*ones(length(y0:500:y1),1),y0:500:y1,'r');
+end
+%make border
+for i=1:50,
+	plot(min(outlinex):500:max(outlinex),(min(outliney)+500*i)*ones(length(min(outlinex):500:max(outlinex)),1),'w');
+	plot(min(outlinex):500:max(outlinex),(max(outliney)-500*i)*ones(length(min(outlinex):500:max(outlinex)),1),'w');
+	plot((min(outlinex)+500*i)*ones(length(min(outliney):500:max(outliney)),1),min(outliney):500:max(outliney),'w');
+	plot((max(outlinex)-500*i)*ones(length(min(outliney):500:max(outliney)),1),min(outliney):500:max(outliney),'w');
+end
+
+%Build colorbar
+colim=zeros(1,length(colmap),3);
+colim(1,:,1)=colmap(:,1);
+colim(1,:,2)=colmap(:,2);
+colim(1,:,3)=colmap(:,3);
+colaxes=axes('Position',[.7,.05,.1,.02]);
+image(colim);
+set(colaxes,'XTick',[]);
+set(colaxes,'YTick',[]);
+%t=text(length(colmap)/2,2,[num2str(c2/wrappingnumber) ' ' colorbartitle]);
+t=text(0,0,num2str(c1));
+set(t,'FontSize',16);
+t=text(length(colmap),0,num2str(c2));
+set(t,'FontSize',16);
+t=text(length(colmap)/2,2,colorbartitle);
+set(t,'HorizontalAlignment','center');
+set(t,'FontSize',18);
+
+
+%We are done, reeastablish figure fig1 settings
+figure(fig1);
+set(gca,'XTick',fig1xticks);
+set(gca,'YTick',fig1yticks);
+
Index: /issm/trunk/src/m/utils/Antarctica/antscale.m
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/antscale.m	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/antscale.m	(revision 1)
@@ -0,0 +1,42 @@
+function [handle_struct]=antscale(length,fontsize);
+%ANTSCALE - ???
+%
+%   Usage:
+%      [handle_struct]=antscale(length,fontsize)
+
+if ((nargin~=2) | (nargout~=1)),
+	help antscale;
+	return;
+end
+
+disp('Position of scale');
+[x,y]=ginput(1);
+
+A=[x-length/2 y+length/10];
+B=[x-length/2 y];
+C=[x-length/4 y];
+D=[x-length/4 y+length/10/4];
+E=[x y];
+F=[x y+length/10/2];
+G=[x+length/4 y]; 
+H=[x+length/4 y+length/10/4];
+I=[x+length/2 y];
+J=[x+length/2 y+length/10];
+
+lines=[A;B;C;D;C;E;F;E;G;H;G;I;J];
+
+h=line(lines(:,1),lines(:,2));
+set(h,'Color','k','LineWidth',1.5);
+
+t1=text(x-length/2,y+1.5*length/10,'0');
+set(t1,'FontSize',fontsize,'HorizontalAlignment','center')
+t2=text(x,y+1.5*length/10,num2str(length/1000/2));
+set(t2,'FontSize',fontsize,'HorizontalAlignment','center')
+t3=text(x+length/2,y+1.5*length/10,[num2str(length/1000) ' km']);
+set(t3,'FontSize',fontsize,'HorizontalAlignment','center')
+
+handle_struct(1).h=h;
+handle_struct(2).h=t1;
+handle_struct(3).h=t2;
+handle_struct(4).h=t3;
+
Index: /issm/trunk/src/m/utils/Antarctica/antzoom.m
===================================================================
--- /issm/trunk/src/m/utils/Antarctica/antzoom.m	(revision 1)
+++ /issm/trunk/src/m/utils/Antarctica/antzoom.m	(revision 1)
@@ -0,0 +1,122 @@
+function varargout=antzoom(region)
+%ANTZOOM - zoom on a region of Antarctica
+%
+%   This function zooms on an existing figure describing Antarctica. 
+%   The zooming depends on the region name provided as input. 
+%
+%   Usage:
+%      varargout=antzoom(region)
+
+
+%Initialize regions
+available_regions=InitializeRegionInfo();
+
+%Check arguments
+if nargin==0,
+	help antzoom;
+	disp('   Available regions include:');
+	for i=1:length(available_regions),
+		disp(['     ' available_regions(i).name]);
+	end
+	return;
+end
+
+
+found=0;
+for i=1:length(available_regions),
+	if strcmp(available_regions(i).name,region),
+		%Make sure the region is a square, enlarge it otherwise, except for Antarctica. 
+		x0=available_regions(i).x0;
+		x1=available_regions(i).x1;
+		y0=available_regions(i).y0;
+		y1=available_regions(i).y1;
+		if ~strcmp(region,'antarctica'),
+			dx=x1-x0;
+			dy=y1-y0;
+			if dy>dx,
+				delta=dy-dx;
+				x0=x0-delta/2;
+				x1=x1+delta/2;
+			elseif dy<dx,
+				delta=dx-dy;
+				y0=y0-delta/2;
+				y1=y1+delta/2;
+			else
+				%do nothing;
+			end
+		end
+
+		%if output arguments are present, return the limits, 
+		%otherwise, set them on the current graphic. 
+		if nargout==2,
+			found=1;
+			varargout{1}=[x0 x1];
+			varargout{2}=[y0 y1];
+		else
+			xlim([x0 x1]);
+			ylim([y0 y1]);
+			found=1;
+			daspect([1;1;1]);
+		end
+	else
+		continue;
+	end
+end
+
+if found==0,
+	disp(['Unknow region: ',region]);
+	disp('Available regions include:');
+	for i=1:length(available_regions),
+		disp(['   ' available_regions(i).name]);
+	end
+end
+
+end
+
+function incrementedregions=AddAvailableRegion(regions,name,x0,x1,y0,y1);
+
+	if isempty(regions),
+		incrementedregions(1).name=name;
+	else
+		incrementedregions=regions;
+		incrementedregions(end+1).name=name;
+	end
+	incrementedregions(end).x0=x0;
+	incrementedregions(end).x1=x1;
+	incrementedregions(end).y0=y0;
+	incrementedregions(end).y1=y1;
+end
+
+function regions=InitializeRegionInfo()
+	regions=AddAvailableRegion([],'antarctica',-2507187,2743299,-2143434,2241152);
+	regions=AddAvailableRegion(regions,'adelieland',2.699*10^4,2.4636*10^6,-2.1848*10^6,-5.2865*10^5);
+	regions=AddAvailableRegion(regions,'ameryiceshelf',1.5945*10^6,2.2807*10^6,5.1372*10^5,9.0186*10^5);
+	regions=AddAvailableRegion(regions,'amundsencoast',-2.8*10^5,-1*10^5,-5.8*10^5,-4.6*10^5);
+	regions=AddAvailableRegion(regions,'amundsensea',-2.1*10^6,-1.45*10^6,-7.5*10^5,-2.5*10^5);
+	regions=AddAvailableRegion(regions,'banzarecoast',1.6*10^6,2.3*10^6,-1.9*10^6,-1.2*10^6);
+	regions=AddAvailableRegion(regions,'borchgrevinkcoast',3*10^5,7*10^5,-2.05*10^6,-1.6*10^6);
+	regions=AddAvailableRegion(regions,'buddcoast',2.1*10^6,2.7*10^6,-1.3*10^6,-.7*10^6);
+	regions=AddAvailableRegion(regions,'byrdglacier',2.5*10^5,4.5*10^5,-10.8*10^5,-9.2*10^5);
+	regions=AddAvailableRegion(regions,'dufekcoast',-1.6*10^5,0*10^5,-6.2*10^5,-5.5*10^5);
+	regions=AddAvailableRegion(regions,'edouardpeninsula',-7.5*10^5,-4*10^5,-1.4*10^6,-1.05*10^6);
+	regions=AddAvailableRegion(regions,'filchnericeshelf',-9.3781*10^5,-3.6671*10^5,.7389*10^6,1.0360*10^6);
+	regions=AddAvailableRegion(regions,'fordranges',-8.5*10^5,-5.7*10^5,-1.33*10^6,-1.12*10^6);
+	regions=AddAvailableRegion(regions,'georgevcoast',.9*10^6,1.7*10^6,-2.4*10^6,-1.7*10^6);
+	regions=AddAvailableRegion(regions,'getziceshelf',-1.7*10^6,-1.15*10^6,-1.23*10^6,-.5*10^6);
+	regions=AddAvailableRegion(regions,'hillarycoast',2.6*10^5,4.4*10^5,-1.24*10^6,-1.06*10^6);
+	regions=AddAvailableRegion(regions,'larseniceshelf',-2.3855*10^6,-1.9649*10^6,0.9498*10^6,1.2996*10^6);
+	regions=AddAvailableRegion(regions,'nimrodglacier',1*10^5,3.8*10^5,-9*10^5,-7*10^5);
+	regions=AddAvailableRegion(regions,'oatescoast',5.3*10^5,8.5*10^5,-2.15*10^6,-1.9*10^6);
+	regions=AddAvailableRegion(regions,'pennelcoast',3*10^5,6*10^5,-2.1*10^6,-1.85*10^6); 
+	regions=AddAvailableRegion(regions,'pineislandglacier',-1.72*10^6,-1.45*10^6,-4.3*10^5,-1.4*10^5);
+	regions=AddAvailableRegion(regions,'ronneiceshelf',-1.5*10^6,-.7*10^6,1*10^5,9.3*10^5);
+	regions=AddAvailableRegion(regions,'rossiceshelf',-8*10^5,4.5*10^5,-13.8*10^5,-5*10^5);
+	regions=AddAvailableRegion(regions,'ruppertcoast',-11*10^5,-8.5*10^5,-1.34*10^6,-1.14*10^6);
+	regions=AddAvailableRegion(regions,'scottcoast',2.5*10^5,6*10^5,-1.6*10^6,-1.2*10^6);
+	regions=AddAvailableRegion(regions,'shackletoncoast',2*10^5,3.8*10^5,-9.8*10^5,-8.4*10^5);
+	regions=AddAvailableRegion(regions,'shackletoniceshelf',2.4*10^6,2.8*10^6,-7*10^5,-1*10^5);
+	regions=AddAvailableRegion(regions,'shirasecoast',-6*10^5,-4.4*10^5,-10.9*10^5,-8.2*10^5);
+	regions=AddAvailableRegion(regions,'siplecoast',-4.3*10^5,-1.5*10^5,-9*10^5,-6.5*10^5);
+	regions=AddAvailableRegion(regions,'westiceshelf',2.2*10^6,2.7*10^6,0,5*10^5);
+	regions=AddAvailableRegion(regions,'icestreamE',2.2*10^6,2.7*10^6,0,5*10^5);
+end
Index: /issm/trunk/src/m/utils/Cluster/clusterreq.m
===================================================================
--- /issm/trunk/src/m/utils/Cluster/clusterreq.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cluster/clusterreq.m	(revision 1)
@@ -0,0 +1,21 @@
+function clusterreq(nel),
+%CLUSTERREQ - display memory requisites for cluster
+%
+%   Usage:
+%      clusterreq(nel)
+
+elements=[120000;440000;1700000;5000000];
+memory  =[6898;8825;17130;45013];
+
+
+%from elements,memory, figure out the entire memory needed for nel elements.
+fittedmodel=fit(elements,memory,'linearinterp');
+mem=fittedmodel(nel)
+
+%display memory requisites for several cluster ring sizes: 
+
+disp('Cluster size, Memory per CPU');
+
+for i=1:5:256,
+	disp(sprintf('%i        %f',i,mem/i));
+end
Index: /issm/trunk/src/m/utils/Computation/runtime.m
===================================================================
--- /issm/trunk/src/m/utils/Computation/runtime.m	(revision 1)
+++ /issm/trunk/src/m/utils/Computation/runtime.m	(revision 1)
@@ -0,0 +1,7 @@
+%RUNTIME - ???
+
+num_procs=256;
+nel=5000000;
+timeperelement=40/1000; %40 second pour 1000 elements
+
+rt=12*nel/num_procs*timeperelement/60; %12 calls to Emg, in minutes
Index: /issm/trunk/src/m/utils/Computation/sparsity_compute.m
===================================================================
--- /issm/trunk/src/m/utils/Computation/sparsity_compute.m	(revision 1)
+++ /issm/trunk/src/m/utils/Computation/sparsity_compute.m	(revision 1)
@@ -0,0 +1,10 @@
+%SPARSITY_COMPUTE - ???
+
+num_procs=20;
+num_grids=5000000;
+sparsity=1/num_grids;
+
+memory=(num_grids*6)^2*8*sparsity/num_procs;
+
+disp(['Memory per processor: ' num2str(memory/1000000) ' Mb']);
+
Index: /issm/trunk/src/m/utils/Cracks/contour_icefront.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/contour_icefront.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/contour_icefront.m	(revision 1)
@@ -0,0 +1,73 @@
+function ind=contour_icefront(index,x,y,node_on_icefront,element_on_boundary);
+%CONTOUR_ICEFRONT - ???
+%
+%   This program takes element_on_boundary and node_on_boundary 
+%   x and  y and index and makes an ordered boundary with it,
+%   turning counter clockwise.
+%
+%   Usage:
+%      ind=contour_icefront(index,x,y,node_on_icefront,element_on_boundary);
+
+pos=find(node_on_icefront);
+pos2=find(x(pos)==max(x(pos)));
+xa=x(pos(pos2))
+ya=y(pos(pos2))
+
+temp=node_on_icefront;
+temp(pos(pos2))=0;
+pos=find(temp);
+pos2=find(x(pos)==max(x(pos)));
+xb=x(pos(pos2));
+yb=y(pos(pos2));
+
+
+
+   
+n00=find(x==xa & y==ya)
+n10=find(x==xb & y==yb)
+n1=n10;
+n0=n00;
+cont=[n0 n1];
+
+   
+while (n1~=n00),
+   
+   els=find(index(:,1)==n1 | index(:,2)==n1 | index(:,3)==n1);
+   possible_nodes=zeros(2*length(els),1);
+   for n=1:length(els),
+   other_pos=find(index(els(n),:)~=n1);
+   possible_nodes(2*n-1,:)= index(els(n),other_pos(1));
+   possible_nodes(2*n,:)=index(els(n),other_pos(2));
+	end
+potential_node=possible_nodes(1);
+
+n0n1=[x(n1)-x(n0)
+   y(n1)-y(n0)];
+n0n1_unit=n0n1/norm(n0n1);
+ny=flipud(n0n1_unit);
+ny(1)=-ny(1);
+possible_angles=zeros(length(possible_nodes),1);
+
+for n=1:length(possible_nodes),
+   if (possible_nodes(n)~=n0),
+	    u=[x(possible_nodes(n))-x(n1)
+  	    y(possible_nodes(n))-y(n1)];
+  	    ux=sum(u.*n0n1_unit);
+  	    uy=sum((u-ux*n0n1_unit).*ny);
+         possible_angles(n)=atan2(uy,ux);
+      else
+         possible_angles(n)=NaN;
+   end
+end
+pos=find(possible_angles==min(possible_angles));
+potential_node=possible_nodes(pos(1));
+
+cont=[cont
+   [n1 potential_node]];
+n0=n1;
+n1=potential_node;
+end
+
+ind=cont(2:length(cont),1);
+
+
Index: /issm/trunk/src/m/utils/Cracks/contour_maker.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/contour_maker.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/contour_maker.m	(revision 1)
@@ -0,0 +1,69 @@
+function ind=contour_maker(index,x,y,node_on_boundary,element_on_boundary);
+%CONTOUR_MAKER - ???
+%
+%   This program takes element_on_boundary and node_on_boundary 
+%   x and  y and index and makes an ordered boundary with it,
+%   turning counter clockwise.
+%
+%   Usage:
+%      ind=contour_maker(index,x,y,node_on_boundary,element_on_boundary);
+
+pos=find(node_on_boundary);
+boundary_chaos=[x(pos) y(pos)];
+ind=convhull(boundary_chaos(:,1),boundary_chaos(:,2));
+
+xa=boundary_chaos(ind(1),1);
+xb=boundary_chaos(ind(2),1);
+ya=boundary_chaos(ind(1),2);
+yb=boundary_chaos(ind(2),2);
+
+
+   
+n00=find(x==xa & y==ya);
+n10=find(x==xb & y==yb);
+n1=n10;
+n0=n00;
+cont=[n0 n1];
+
+   
+while (n1~=n00),
+   
+   els=find(index(:,1)==n1 | index(:,2)==n1 | index(:,3)==n1);
+   possible_nodes=zeros(2*length(els),1);
+   for n=1:length(els),
+   other_pos=find(index(els(n),:)~=n1);
+   possible_nodes(2*n-1,:)= index(els(n),other_pos(1));
+   possible_nodes(2*n,:)=index(els(n),other_pos(2));
+	end
+potential_node=possible_nodes(1);
+
+n0n1=[x(n1)-x(n0)
+   y(n1)-y(n0)];
+n0n1_unit=n0n1/norm(n0n1);
+ny=flipud(n0n1_unit);
+ny(1)=-ny(1);
+possible_angles=zeros(length(possible_nodes),1);
+
+for n=1:length(possible_nodes),
+   if (possible_nodes(n)~=n0),
+	    u=[x(possible_nodes(n))-x(n1)
+  	    y(possible_nodes(n))-y(n1)];
+  	    ux=sum(u.*n0n1_unit);
+  	    uy=sum((u-ux*n0n1_unit).*ny);
+         possible_angles(n)=atan2(uy,ux);
+      else
+         possible_angles(n)=NaN;
+   end
+end
+pos=find(possible_angles==min(possible_angles));
+potential_node=possible_nodes(pos(1));
+
+cont=[cont
+   [n1 potential_node]];
+n0=n1;
+n1=potential_node;
+end
+
+ind=cont(2:length(cont),1);
+
+
Index: /issm/trunk/src/m/utils/Cracks/exist_by_names.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/exist_by_names.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/exist_by_names.m	(revision 1)
@@ -0,0 +1,12 @@
+function f=exist_by_names(str);
+%EXIST_BY_NAMES - ????
+%
+%   Usage:
+%      f=exist_by_names(str);
+
+fid=fopen(str,'r');
+if fid==-1,
+   f=0;
+else
+   f=1;
+end
Index: /issm/trunk/src/m/utils/Cracks/find_around.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/find_around.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/find_around.m	(revision 1)
@@ -0,0 +1,10 @@
+function f=find_around(tabx,taby,pointx,pointy,d)
+%FIND_AROUND - ????
+%
+%   Input tableaux,tableauy,pointx,pointy,distance
+%
+%   Usage:
+%      f=find_around(tabx,taby,pointx,pointy,d)
+
+distance=sqrt((tabx-pointx).^2+(taby-pointy).^2);
+f=find(distance<=d);
Index: /issm/trunk/src/m/utils/Cracks/find_coord.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/find_coord.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/find_coord.m	(revision 1)
@@ -0,0 +1,13 @@
+function [posx,posy]=find_coord(tabx,taby,x,y)
+%FIND_COORD -  ???
+%
+%   Usage:
+%      [posx,posy]=find_coord(tabx,taby,x,y)
+
+distancex=(tabx-x).^2;
+distancey=(taby-y).^2;
+
+pos=find(distancex==min(distancex));
+posy=pos(1);
+pos=find(distancey==min(distancey));
+posx=pos(1);
Index: /issm/trunk/src/m/utils/Cracks/find_coord_matrix.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/find_coord_matrix.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/find_coord_matrix.m	(revision 1)
@@ -0,0 +1,13 @@
+function [posx,posy]=find_coord_matrix(tabx,taby,x,y)
+%FIND_COORD_MATRIX - ??? 
+%
+%   Usage:
+%      [posx,posy]=find_coord_matrix(tabx,taby,x,y)
+
+distancex=(tabx(1,:)-x).^2;
+distancey=(taby(:,1)-y).^2;
+
+pos=find(distancex==min(distancex));
+posy=pos(1);
+pos=find(distancey==min(distancey));
+posx=pos(1);
Index: /issm/trunk/src/m/utils/Cracks/find_line.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/find_line.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/find_line.m	(revision 1)
@@ -0,0 +1,11 @@
+function f=find_line(index,line)
+%FIND_LINE - ???
+%
+%   this function returns the elements to which the line in the mesh belongs.
+%
+%   Usage:
+%      f=find_line(index,line)
+
+pos=find(index(:,1)==line(1) | index(:,2)==line(1) | index(:,3)==line(1));
+pos2=find(index(pos,1)==line(2) | index(pos,2)==line(2) | index(pos,3)==line(2));
+f=pos(pos2);
Index: /issm/trunk/src/m/utils/Cracks/icefront_maker.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/icefront_maker.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/icefront_maker.m	(revision 1)
@@ -0,0 +1,77 @@
+function ind=icefront_maker(index,x,y,node_on_icefront,element_on_boundary);
+%ICEFRONT_MAKER - ???
+%
+%   This program takes element_on_boundary and node_on_icefront 
+%   x and  y and index and makes an ordered icefront with it,
+%   turning counter clockwise.
+%
+%   Usage:
+%      ind=icefront_maker(index,x,y,node_on_icefront,element_on_boundary);
+
+pos=find(node_on_icefront);
+pos2=find(x(pos)==max(x(pos)));
+xa=x(pos(pos2));
+ya=y(pos(pos2));
+
+temp=node_on_icefront;
+temp(pos(pos2))=0;
+
+pos=find(temp);
+pos2=find(x(pos)==max(x(pos)));
+xb=x(pos(pos2));
+yb=y(pos(pos2));
+
+
+
+plot(xa,ya,'r*')
+plot(xb,yb,'r*')
+
+
+n00=find(x==xa & y==ya);
+n10=find(x==xb & y==yb);
+n1=n10;
+n0=n00;
+cont=[n0 n1];
+
+   
+while (n1~=n00),
+   
+   els=find(index(:,1)==n1 | index(:,2)==n1 | index(:,3)==n1);
+   possible_nodes=zeros(2*length(els),1);
+   for n=1:length(els),
+   other_pos=find(index(els(n),:)~=n1);
+   possible_nodes(2*n-1,:)= index(els(n),other_pos(1));
+   possible_nodes(2*n,:)=index(els(n),other_pos(2));
+	end
+potential_node=possible_nodes(1);
+
+n0n1=[x(n1)-x(n0)
+   y(n1)-y(n0)];
+n0n1_unit=n0n1/norm(n0n1);
+ny=flipud(n0n1_unit);
+ny(1)=-ny(1);
+possible_angles=zeros(length(possible_nodes),1);
+
+for n=1:length(possible_nodes),
+   if (possible_nodes(n)~=n0),
+	    u=[x(possible_nodes(n))-x(n1)
+  	    y(possible_nodes(n))-y(n1)];
+  	    ux=sum(u.*n0n1_unit);
+  	    uy=sum((u-ux*n0n1_unit).*ny);
+         possible_angles(n)=atan2(uy,ux);
+      else
+         possible_angles(n)=NaN;
+   end
+end
+pos=find(possible_angles==min(possible_angles));
+potential_node=possible_nodes(pos(1));
+
+cont=[cont
+   [n1 potential_node]];
+n0=n1;
+n1=potential_node;
+end
+
+ind=cont(2:length(cont),1);
+
+
Index: /issm/trunk/src/m/utils/Cracks/index_builder.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/index_builder.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/index_builder.m	(revision 1)
@@ -0,0 +1,156 @@
+function f=index_builder(index,node_on_icefront,element_on_icefront)
+%INDEX_BUILDER - ????
+%
+%   Usage:
+%      f=index_builder(index,node_on_icefront,element_on_icefront)
+
+index_icefront=[];
+nel=length(index);
+problematic_elements=[];
+for n=1:nel
+	
+   if element_on_icefront(n)
+      if (node_on_icefront(index(n,1)) & node_on_icefront(index(n,2)) & node_on_icefront(index(n,3))),
+         problematic_elements=[problematic_elements
+            n];
+       else,
+      
+		if (node_on_icefront(index(n,1)) & node_on_icefront(index(n,2)))
+			index_icefront=[index_icefront
+            index(n,1) index(n,2)];
+		end
+
+		if (node_on_icefront(index(n,2)) & node_on_icefront(index(n,3)))
+		   index_icefront=[index_icefront
+            index(n,2) index(n,3)];
+		end
+		if (node_on_icefront(index(n,3)) & node_on_icefront(index(n,1)) & ...
+							(1-node_on_icefront(index(n,2))))
+		   index_icefront=[index_icefront
+            index(n,3) index(n,1)];
+		end
+   	end
+	end
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+%we deal with the problematic elements
+type_prob_elem=zeros(length(problematic_elements),1);
+position=zeros(length(problematic_elements),3);
+for i=1:length(problematic_elements),
+   for n=1:3,
+      a=length(find(index_icefront == index(problematic_elements(i),n)));
+      if a>=1, position(i,n)=1;
+      else position(i,n)=0;
+      end
+      
+   end
+   	a=length(find(position(i,:)));
+      type_prob_elem(i)=a(1);
+end
+
+%we begin with the type_prob_elem =2
+index_front_spec=[];
+pos=find(type_prob_elem ==2);
+for j=1:length(pos),
+   el=problematic_elements(pos(j));
+   pos2=find(position(pos(j),:)==0);
+   switch pos2,
+   case 1,
+      index_front_spec=[index_front_spec
+         index(el,1) index(el,2)
+      index(el,3) index(el,1)];
+   case 2,
+      index_front_spec=[index_front_spec
+         index(el,2) index(el,3)
+      index(el,1) index(el,2)];
+   case 3,
+      index_front_spec=[index_front_spec
+         index(el,3) index(el,1)
+      index(el,2) index(el,3)];
+   end   
+end
+
+%now the type_prob_elem=1
+pos=find(type_prob_elem==1);
+for n=1:length(pos),
+el=problematic_elements(pos(n));
+
+pos2=find(position(pos(n),:)==0);
+for m=1:length(pos2),
+   a=length(find(index_front_spec==index(el,pos2(m))));
+   if a>=1,
+      position(pos(n),pos2(m))=1;
+   end
+end
+
+pos2=find(position(pos(n),:)==0);
+switch pos2,
+   case 1,
+      index_front_spec=[index_front_spec
+         index(el,1) index(el,2)
+      index(el,3) index(el,1)];
+   case 2,
+      index_front_spec=[index_front_spec
+         index(el,2) index(el,3)
+      index(el,1) index(el,2)];
+   case 3,
+      index_front_spec=[index_front_spec
+         index(el,3) index(el,1)
+      index(el,2) index(el,3)];
+end   
+end
+   
+   
+%now the type_prob_elem=0
+pos=find(type_prob_elem==0);
+for n=1:length(pos),
+el=problematic_elements(pos(n));
+
+pos2=find(position(pos(n),:)==0);
+for m=1:length(pos2),
+   a=length(find(index_front_spec==index(el,pos2(m))));
+   if a>=1,
+      position(pos(n),pos2(m))=1;
+   end
+end
+
+pos2=find(position(pos(n),:)==0);
+switch pos2,
+   case 1,
+      index_front_spec=[index_front_spec
+         index(el,1) index(el,2)
+      index(el,3) index(el,1)];
+   case 2,
+      index_front_spec=[index_front_spec
+         index(el,2) index(el,3)
+      index(el,1) index(el,2)];
+   case 3,
+      index_front_spec=[index_front_spec
+         index(el,3) index(el,1)
+      index(el,2) index(el,3)];
+end   
+end
+
+%now we have to eliminate the lines that appear in the index_front_spec and that are inner lines to the mesh
+flag_elim=zeros(length(index_front_spec),1);
+for n=1:length(index_front_spec),
+   a=length(find_line(index,index_front_spec(n,:)));
+   if a>=2,
+      flag_elim(n)=1;
+   end
+end
+index_front_spec=erase_lines(index_front_spec,flag_elim);
+   
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+
+   
+   index_icefront=[index_icefront
+      index_front_spec];
+   
+f=index_icefront;
+   
+   
+   
Index: /issm/trunk/src/m/utils/Cracks/index_builder2.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/index_builder2.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/index_builder2.m	(revision 1)
@@ -0,0 +1,155 @@
+function f=index_builder(index,node_on_icefront,element_on_icefront)
+%INDEX_BUILDER - ???
+%
+%   Usage:
+%      f=index_builder(index,node_on_icefront,element_on_icefront)
+
+index_icefront=[];
+nel=length(index);
+problematic_elements=[];
+for n=1:nel
+	
+   if element_on_icefront(n)
+      if (node_on_icefront(index(n,1)) & node_on_icefront(index(n,2)) & node_on_icefront(index(n,3))),
+         problematic_elements=[problematic_elements
+            n];
+       else,
+      
+		if (node_on_icefront(index(n,1)) & node_on_icefront(index(n,2)))
+			index_icefront=[index_icefront
+            index(n,1) index(n,2)];
+		end
+
+		if (node_on_icefront(index(n,2)) & node_on_icefront(index(n,3)))
+		   index_icefront=[index_icefront
+            index(n,2) index(n,3)];
+		end
+		if (node_on_icefront(index(n,3)) & node_on_icefront(index(n,1)) & ...
+							(1-node_on_icefront(index(n,2))))
+		   index_icefront=[index_icefront
+            index(n,3) index(n,1)];
+		end
+   	end
+	end
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+%we deal with the problematic elements
+type_prob_elem=zeros(length(problematic_elements),1);
+position=zeros(length(problematic_elements),3);
+for i=1:length(problematic_elements),
+   for n=1:3,
+      a=length(find(index_icefront == index(problematic_elements(i),n)));
+      if a>=1, position(i,n)=1;
+      else position(i,n)=0;
+      end
+      
+   end
+   	a=length(find(position(i,:)));
+      type_prob_elem(i)=a(1);
+end
+
+%we begin with the type_prob_elem =2
+index_front_spec=[];
+pos=find(type_prob_elem ==2);
+for j=1:length(pos),
+   el=problematic_elements(pos(j));
+   pos2=find(position(pos(j),:)==0);
+   switch pos2,
+   case 1,
+      index_front_spec=[index_front_spec
+         index(el,1) index(el,2)
+      index(el,3) index(el,1)];
+   case 2,
+      index_front_spec=[index_front_spec
+         index(el,2) index(el,3)
+      index(el,1) index(el,2)];
+   case 3,
+      index_front_spec=[index_front_spec
+         index(el,3) index(el,1)
+      index(el,2) index(el,3)];
+   end   
+end
+
+%now the type_prob_elem=1
+pos=find(type_prob_elem==1);
+for n=1:length(pos),
+el=problematic_elements(pos(n));
+
+pos2=find(position(pos(n),:)==0);
+for m=1:length(pos2),
+   a=length(find(index_front_spec==index(el,pos2(m))));
+   if a>=1,
+      position(pos(n),pos2(m))=1;
+   end
+end
+
+pos2=find(position(pos(n),:)==0);
+switch pos2,
+   case 1,
+      index_front_spec=[index_front_spec
+         index(el,1) index(el,2)
+      index(el,3) index(el,1)];
+   case 2,
+      index_front_spec=[index_front_spec
+         index(el,2) index(el,3)
+      index(el,1) index(el,2)];
+   case 3,
+      index_front_spec=[index_front_spec
+         index(el,3) index(el,1)
+      index(el,2) index(el,3)];
+end   
+end
+   
+   
+%now the type_prob_elem=0
+pos=find(type_prob_elem==0);
+for n=1:length(pos),
+el=problematic_elements(pos(n));
+
+pos2=find(position(pos(n),:)==0);
+for m=1:length(pos2),
+   a=length(find(index_front_spec==index(el,pos2(m))));
+   if a>=1,
+      position(pos(n),pos2(m))=1;
+   end
+end
+
+pos2=find(position(pos(n),:)==0);
+switch pos2,
+   case 1,
+      index_front_spec=[index_front_spec
+         index(el,1) index(el,2)
+      index(el,3) index(el,1)];
+   case 2,
+      index_front_spec=[index_front_spec
+         index(el,2) index(el,3)
+      index(el,1) index(el,2)];
+   case 3,
+      index_front_spec=[index_front_spec
+         index(el,3) index(el,1)
+      index(el,2) index(el,3)];
+end   
+end
+
+%now we have to eliminate the lines that appear in the index_front_spec and that are inner lines to the mesh
+flag_elim=zeros(length(index_front_spec),1);
+for n=1:length(index_front_spec),
+   a=length(find_line(index,index_front_spec(n,:)));
+   if a>=2,
+      flag_elim(n)=1;
+   end
+end
+index_front_spec=erase_lines(index_front_spec,flag_elim);
+   
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+
+   
+   index_icefront=[index_icefront
+      index_front_spec];
+   
+f=index_icefront;
+   
+   
+   
Index: /issm/trunk/src/m/utils/Cracks/locate.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/locate.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/locate.m	(revision 1)
@@ -0,0 +1,7 @@
+function f=locate(tableau,valeur)
+%LOCATE - ??? 
+%
+%   Usage:
+%      f=locate(tableau,valeur)
+
+f=find(abs(tableau-valeur) == min(abs(tableau-valeur)));
Index: /issm/trunk/src/m/utils/Cracks/margin_locator.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/margin_locator.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/margin_locator.m	(revision 1)
@@ -0,0 +1,18 @@
+function flags=margin_locator(file_name,xo,yo)
+%MARGIN_LOCATOR -  ???
+%
+%   Usage:
+%      flags=margin_locator(file_name,xo,yo)
+
+load ../data/matlab/commondata/names
+load ../data/matlab/commondata/num
+
+struct=read_file([file_name '.exp'],0);
+
+flags=zeros(length(xo),1);
+for n=1:length(struct),
+   temp_flags=isinpoly(xo,yo,struct(n).x,struct(n).y);
+   pos=find(temp_flags == .5);
+   temp_flags(pos)=1;
+   flags=flags|temp_flags;
+end
Index: /issm/trunk/src/m/utils/Cracks/mesh_creator_2d.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/mesh_creator_2d.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/mesh_creator_2d.m	(revision 1)
@@ -0,0 +1,145 @@
+function [indic ,info ,index,x,y,node_on_boundary,element_on_boundary]=mesh_creator_2d(domain,nel_initial);
+%MESH_CREATOR_2D - ???
+%
+%   This program creates a mesh from a contour,
+%   INPUT domain nel_initial
+%   OUTPUT index x y node_on_boundary element_on_boundary
+%
+%   Usage:
+%      [indic ,info ,index,x,y,node_on_boundary,element_on_boundary]=mesh_creator_2d(domain,nel_initial);
+
+nods=length(domain.x);
+
+%%%%%%%%%%%%%create the region file
+fid2=fopen(['D:/programmation/utils/mesh.rg2'],'wt');
+fprintf(fid2,'%i\n',nods);
+
+for i=1:nods,
+      A=[domain.x(i) domain.y(i) 2];
+      fprintf(fid2,'%f %f %i\n',A);
+end
+
+
+newline(fid2);
+fprintf(fid2,'%i\n',0);
+newline(fid2);
+
+fprintf(fid2,'%i\n',1);
+newline(fid2);
+
+fprintf(fid2,'%i %i %i\n',[nods 1 0]);
+A='';
+for i=1:nods-1,
+   A=[A '%i '];
+end
+A=[A '%i\n'];
+
+B=1:1:nods;
+
+C=zeros(1,nods);
+for i=1:nods,
+   C(i)=20*i+2;
+end
+
+fprintf(fid2,A,B);
+fprintf(fid2,A,C);
+
+fclose(fid2);
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%create curves files
+fid2=fopen(['D:/programmation/utils/mesh.cs2'],'wt');
+fprintf(fid2,'%i\n',nods);
+newline(fid2);
+
+for i=1:nods-1,
+   fprintf(fid2,'%i %i\n',[1 0]);
+   fprintf(fid2,'%i %i\n',[i i+1]);
+   newline(fid2);
+end
+fprintf(fid2,'%i %i\n',[1 0]);
+fprintf(fid2,'%i %i\n',[nods 1]);
+newline(fid2);
+
+fclose(fid2);
+
+
+
+
+
+
+
+fid=fopen(['D:/programmation/utils/mesh2d.in'],'wt');
+fprintf(fid,'%i %i %i %i %i %i %i\n',[202 1 1 0 0 0 1]);
+fprintf(fid,'%s',['D:/programmation/utils/mesh.rg2']);
+newline(fid);
+fprintf(fid,'%s',['D:/programmation/utils/mesh.cs2']);
+newline(fid);
+fprintf(fid,'%s',['D:/programmation/utils/mesh2d.exp']);
+fprintf(fid,'\n%12.12f %i %i',[1.0e-10 0 0]);
+fprintf(fid,'\n%i %i %f %f %f %f %f %f %f %i %i %i %i %f %i %i %f',[4 0 45.0 0.04 0.2 30.0 20.0 1 0.4 10 nel_initial +3 4 0.1 2 2 0.3]);
+fclose(fid);
+
+dos(['D:/programmation/utils/zgp0203 D:/programmation/utils/mesh2d.in D:/programmation/utils/mesh2d.out']);
+%eval(['delete D:/programmation/utils/mesh.rg2']);
+%eval(['delete D:/programmation/utils/mesh.cs2']);
+%eval(['delete D:/programmation/utils/mesh2d.in']);
+%eval(['delete D:/programmation/utils/mesh2d.out']);
+
+
+fid=fopen('D:/programmation/utils/mesh2d.exp','r');
+
+[A,bytecount]=fscanf(fid,'%f',[1]);
+nods=A(1);
+x=zeros(nods,1);
+y=zeros(nods,1);
+indic=zeros(nods,1);
+
+for n=1:nods,
+   [A,bytecount]=fscanf(fid,'%f %f %i',[1,3]);
+   x(n)=A(1);
+   y(n)=A(2);
+   indic(n)=A(3);
+end
+
+[A,bytecount]=fscanf(fid,'%i',[1]);
+n=A(1);
+for i=1:n,
+   fscanf(fid,'%i %i %f',[1,3]);
+end
+
+[A,bytecount]=fscanf(fid,'%i %i',[1,2]);
+
+nel=A(2);
+index=zeros(nel,3);
+
+for n=1:nel,
+   [A,bytecount]=fscanf(fid,'%i %i %i ',[1,3]);
+   index(n,1)=A(1);
+	index(n,2)=A(2);
+   index(n,3)=A(3);
+end
+
+info=zeros(nel,3);
+for n=1:nel,
+   [A,bytecount]=fscanf(fid,'%i %i %i %i',[1,4]);
+   info(n,1)=A(2);
+   info(n,2)=A(3);
+   info(n,3)=A(4);
+
+end
+fclose(fid);
+
+pos=find(info(:,1)>20 | info(:,2)>20 | info(:,3)>20);
+element_on_boundary=zeros(nel,1);
+element_on_boundary(pos)=1;
+
+
+node_on_boundary=zeros(nods,1);
+pos=find(info~=5);
+node_on_boundary(index(pos))=1;
+break
+eval(['delete D:/programmation/utils/mesh2d.exp']);
+
+
+
+
Index: /issm/trunk/src/m/utils/Cracks/meshdensitygen.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/meshdensitygen.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/meshdensitygen.m	(revision 1)
@@ -0,0 +1,25 @@
+function density=meshdensitygen(infile,nel);
+%MESHDENSITYGEN -  ???
+%
+%   Usage:
+%      struct=meshdensitygen(infile,nel);
+
+density=expread(infile,1);
+
+for i=1:length(density), 
+	
+	%Find density by figuring out largest distance between 
+	%two points of the density profile, and divide by the number 
+	%of elements desired for this profile.
+	maxdist=maxdistprofile(density(i).x,density(i).y);
+	density(i).density=round(maxdist/sqrt(nel));
+end
+
+
+function maxdist=maxdistprofile(x,y);
+
+for i=1:length(x),
+dist=sqrt((x-x(i)).^2+(y-y(i)).^2);
+pos=find(dist==max(dist));
+maxdist=dist(pos);
+end
Index: /issm/trunk/src/m/utils/Cracks/names_function.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/names_function.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/names_function.m	(revision 1)
@@ -0,0 +1,21 @@
+function names_function(num,series)
+%NAMES_FUNCTION -???
+%
+%   Usage:
+%      names_function(num,series)
+
+location=find(pwd=='\');
+location=location(length(location));
+present_directory=pwd;
+present_directory=present_directory(location+1:length(present_directory));
+
+root=['..\data\' present_directory '\'];
+
+directory=['RONNE_w' num2str(series)];
+rad_maillage='RONNE_w';
+rad_results='w';
+
+maillage=[rad_maillage num2str(num) '_mesh'];
+results=[rad_results num2str(num)];
+
+save ../data/matlab/commondata/names.mat maillage results directory root
Index: /issm/trunk/src/m/utils/Cracks/perim_curve.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/perim_curve.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/perim_curve.m	(revision 1)
@@ -0,0 +1,12 @@
+function l=perim_curve(x,y)
+%PERIM_CURVE - 
+%
+%   This function returns the length of a curve described by x and y.
+%
+%   Usage:
+%      l=perim_curve(x,y)
+
+l=0;
+for n=1:length(x)-1,
+   l=l+sqrt( (x(n)-x(n+1))^2+(y(n)-y(n+1))^2 );
+end
Index: /issm/trunk/src/m/utils/Cracks/void_fill.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/void_fill.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/void_fill.m	(revision 1)
@@ -0,0 +1,15 @@
+function f=void_fill(v,x,y);
+%VOID_FILL - ???
+%
+%   Usage:
+%      f=void_fill(v,x,y);
+
+f=v;
+pos1=find(isnan(f));
+pos2=find(~isnan(f));
+for n=1:length(pos1),
+   distance=sqrt((x(pos1(n))-x(pos2)).^2+(y(pos1(n))-y(pos2)).^2);
+[junk,i]=min(distance);
+f(pos1(n))=f(pos2(i));
+end
+
Index: /issm/trunk/src/m/utils/Cracks/void_fill1d.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/void_fill1d.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/void_fill1d.m	(revision 1)
@@ -0,0 +1,14 @@
+function f=void_fill1d(v,x);
+%VOID_FILL1D - ????
+%
+%   Usage:
+%      f=void_fill1d(v,x);
+
+f=v;
+pos1=find(isnan(f));
+pos2=find(~isnan(f));
+for n=1:length(pos1),
+   distance=sqrt((x(pos1(n))-x(pos2)).^2);
+[junk,i]=min(distance);
+f(pos1(n))=f(pos2(i));
+end
Index: /issm/trunk/src/m/utils/Cracks/void_fill_noxy.m
===================================================================
--- /issm/trunk/src/m/utils/Cracks/void_fill_noxy.m	(revision 1)
+++ /issm/trunk/src/m/utils/Cracks/void_fill_noxy.m	(revision 1)
@@ -0,0 +1,20 @@
+function f=void_fill_noxy(v);
+%VOID_FILL_NOXY - ???
+%
+%   Usage:
+%      f=void_fill_noxy(v);
+
+f=v;
+pos1=find(isnan(f));
+pos2=find(~isnan(f));
+[i1,j1]=ind2sub(size(f),pos1);
+[i2,j2]=ind2sub(size(f),pos2);
+for n=1:length(pos1),
+   if (mod(n,10)==0),
+      disp(n/length(pos1)*100);
+   end
+   distance=sqrt((i1(n)-i2).^2+(j1(n)-j2)).^2;
+[junk,i]=min(distance);
+f(pos1(n))=f(pos2(i));
+end
+
Index: /issm/trunk/src/m/utils/Err/erfn.m
===================================================================
--- /issm/trunk/src/m/utils/Err/erfn.m	(revision 1)
+++ /issm/trunk/src/m/utils/Err/erfn.m	(revision 1)
@@ -0,0 +1,27 @@
+function res=erfn(z)
+%ERFN - ???
+%
+%   Usage:
+%      res=erfn(z)
+
+for n=1:length(z),
+   res(n)=quad('exn',0,z(n));
+end
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /issm/trunk/src/m/utils/Err/erfp.m
===================================================================
--- /issm/trunk/src/m/utils/Err/erfp.m	(revision 1)
+++ /issm/trunk/src/m/utils/Err/erfp.m	(revision 1)
@@ -0,0 +1,27 @@
+function res=erfp(z)
+%ERFP - ???
+%
+%   Usage:
+%      res=erfp(z)
+
+for n=1:length(z),
+   res(n)=quad('exp',0,z(n));
+end
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /issm/trunk/src/m/utils/Exp/expboxgen.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expboxgen.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expboxgen.m	(revision 1)
@@ -0,0 +1,99 @@
+function expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
+%EXPBOXGEN -  creates a domain outline box for a tiff image
+%
+%   This function creates a domain outline box for a .tif image for the 
+%   mosaic tiff. 
+%   x0,y0 and x1,y1 are the cropping coordinates (upper left and lower right 
+%   corners in the larger tiff image).
+%   paramter_filename is the parameter file name for the mosaic tiff image.
+%   box_filename is self explanatory.
+%
+%   Usage:
+%      expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)
+%
+%   See also EXPMASTER, EXPDOC
+
+%initialize
+nrows=-1;
+ncols=-1;
+X0=-1;
+Y0=-1;
+posting=-1;
+
+%first recover necessary information from the paramter_filename.
+fid=fopen(parameter_filename,'r');
+count=1;
+while(1),
+tline=fgetl(fid);
+if ~isstr(tline), break; end;
+
+ind=findstr('ant125m',tline);
+if ~isempty(ind),
+a=strsplit(tline,' ');
+a=a(2); a=char(a); a=a(1:length(a)-1);
+posting=str2num(a);
+end
+
+
+ind=findstr('no. of rows   :',tline);
+if ~isempty(ind),
+a=strsplit(tline,' ');
+nrows=str2num(char(a(length(a))));
+end
+
+ind=findstr('no. of columns:',tline);
+if ~isempty(ind),
+a=strsplit(tline,' ');
+ncols=str2num(char(a(length(a))));
+end
+
+ind=findstr('Upper Left X:',tline);
+if ~isempty(ind),
+a=strsplit(tline,' ');
+X0=str2num(char(a(length(a))));
+end
+
+ind=findstr('Upper Left Y:',tline);
+if ~isempty(ind),
+a=strsplit(tline,' ');
+Y0=str2num(char(a(length(a))));
+end
+
+
+end %while(1),
+
+
+fclose(fid);
+
+if (X0==-1 | Y0==-1 | nrows==-1  | ncols==-1 | posting==-1),
+disp(' ');
+disp(['Could not recover all parameters from ' parameter_filename]);
+disp('Here are the paramters recovered thus far: ');
+disp(['no. of rows: ' num2str(nrows)]);
+disp(['no. of columns: ' num2str(ncols)]);
+disp(['Upper Left X: ' num2str(X0)]);
+disp(['Upper Left Y: ' num2str(Y0)]);
+disp(['Posting: ' num2str(posting)]);
+end
+
+disp(' ');
+disp(['Recovered the following parameters from ' parameter_filename]);
+disp(['no. of rows: ' num2str(nrows)]);
+disp(['no. of columns: ' num2str(ncols)]);
+disp(['Upper Left X: ' num2str(X0)]);
+disp(['Upper Left Y: ' num2str(Y0)]);
+disp(['Posting: ' num2str(posting)]);
+
+%Create X,Y, arrays of coordinates:
+X(1)=X0+x0*posting
+Y(1)=Y0-y0*posting
+X(2)=X(1);
+Y(2)=Y(1)-ny*posting;
+X(3)=X(1)+nx*posting;
+Y(3)=Y(2);
+Y(4)=Y(1);
+X(4)=X(3);
+plot(X,Y,'r*');
+
+%Create box exp file using X and Y. Loop it.
+expgen(box_filename,X,Y,1);
Index: /issm/trunk/src/m/utils/Exp/expconcatenate.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expconcatenate.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expconcatenate.m	(revision 1)
@@ -0,0 +1,56 @@
+function expconcatenate(newfile,oldfile)
+%EXPCONCATENATE - modify several profiles to concatenate them
+% 
+%   this routine reads the profiles of oldfile and enables the user to concatenate
+%   the profiles by clicking on the tips he/she wants to link
+%
+%   Usage:
+%      expconcatenate(newfile,oldfile)
+%
+%   See also EXPMASTER, EXPDOC
+ 
+%Some checks
+if nargin~=2 | nargout
+	error('expconcatenate usage: expconcatenate(newfile,oldfile)')
+elseif ~exist(oldfile)
+	error(['expconcatenate error message: the file ' oldfile  'does not exist'])
+elseif exist(newfile),
+	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
+	if ~strcmpi(choice,'y'),
+		error('no modification done ... exiting');
+	end
+end
+
+%Get exp oldfile
+[path root ext ver]=fileparts(oldfile);
+A=expread(oldfile,1);
+numprofiles=size(A,2);
+
+%Figure out how nany plots have been done so far 
+g=get(gca,'children'); 
+prevplot=length(g);
+
+%plot existing profile
+hold on
+numpoints=0;
+closed=zeros(numprofiles,1);
+for i=1:numprofiles
+	plot(A(i).x,A(i).y,'-r','MarkerSize',10);
+
+	%update numpoints
+	numpoints=numpoints+size(A(i).x,1);
+
+	%figure out if the profile is closed or not
+	if (A(i).x(1)==A(i).x(end) & A(i).y(1)==A(i).y(end))
+		closed(i)=1;
+	end
+end
+
+%call merge profile routine
+[A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root);
+
+hold off
+
+%write contour using expwrite
+title('New file written, exiting','FontSize',14);
+expwrite(A,newfile);
Index: /issm/trunk/src/m/utils/Exp/expcreatecircle.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expcreatecircle.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expcreatecircle.m	(revision 1)
@@ -0,0 +1,30 @@
+function expcreatecircle(filename,x0,y0,radius,numberofgrids)
+%EXPCREATECIRCLE - create a circular contour corresponding to given parameters
+%
+%   Creates a closed argus contour centered on x,y of radius size.
+%   The contour is made of numberofgrids
+%
+%   Usage:
+%      expcreatecircle(filename,x0,y0,radius,numberofgrids)
+%
+%   See also EXPMASTER, EXPDOC
+
+%Calculate the cartesians coordinates of the points
+x_list=ones(numberofgrids,1);
+y_list=ones(numberofgrids,1);
+
+theta=(0:2*pi/numberofgrids:2*pi*(1-1/numberofgrids))';
+
+x_list=radius*x_list.*cos(theta);
+y_list=radius*y_list.*sin(theta);
+
+%offset x_list and y_list by x0 and y0:
+x_list=x_list+x0;
+y_list=y_list+y0;
+
+contour.x=x_list;
+contour.y=y_list;
+contour.density=1;
+contour.name='circle';
+
+expwrite(contour,filename);
Index: /issm/trunk/src/m/utils/Exp/expcreatecontour.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expcreatecontour.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expcreatecontour.m	(revision 1)
@@ -0,0 +1,36 @@
+function expcreatecontour(filename);
+%EXPCREATECONTOUR - create a contour from a list of points
+%
+%   expcreatecontour: from a list of (x,y) points (retrieve using ginput on an undetermined
+%   number of points: used RETURN key to end input), create an Argus .exp 
+%   file holding the corresponding closed contour.
+%    
+%   Usage:
+%      expcreatecontour(filename)
+%
+%   See also EXPMASTER, EXPDOC
+
+%Get root of filename
+[path root ext ver]=fileparts(filename);
+
+%Get contour
+disp('Click on contour points you desire. Type RETURN to end input of points');
+[x,y]=ginputquick;
+
+%close contour
+x=[x;x(1)];
+y=[y;y(1);];
+
+%plot contour
+hold on;
+plot(x,y,'r-');
+
+%create structure for expwrite routine
+a.x=x;
+a.y=y;
+a.name=root;
+a.density=1;
+
+%write contour using expwrite
+expwrite(a,filename);
+
Index: /issm/trunk/src/m/utils/Exp/expcreateprofile.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expcreateprofile.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expcreateprofile.m	(revision 1)
@@ -0,0 +1,31 @@
+function expcreateprofile(filename);
+%EXPCREATEPROFILE - create an Argus file from a list of points
+%
+%   expcreateprofile: from a list of (x,y) points (retrieve using ginput on an undetermined
+%   number of points: used RETURN key to end input), create an Argus .exp 
+%   file holding the corresponding open profile.
+%    
+%   Usage:
+%      expcreateprofile(filename)
+%
+%   See also EXPMASTER, EXPDOC
+
+%Get root of filename
+[path root ext ver]=fileparts(filename);
+
+%Get profile
+disp('Click on profile points you desire. Type RETURN to end input of points');
+[x,y]=ginputquick;
+
+%plot contour
+hold on;
+plot(x,y,'r-');
+
+%create structure for expwrite routine
+a.x=x;
+a.y=y;
+a.name=root;
+a.density=1;
+
+%write profile using expwrite
+expwrite(a,filename);
Index: /issm/trunk/src/m/utils/Exp/expcut.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expcut.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expcut.m	(revision 1)
@@ -0,0 +1,56 @@
+function expcut(newfile,oldfile)
+%EXPCUT - cut a part of a profile
+%
+%   this routine reads the profiles of oldfile and enables the user to cut
+%   the profiles by clicking on the tips he/she wants to link
+%
+%   Usage:
+%      expcut(newfile,oldfile)
+%
+%   See also EXPMASTER, EXPDOC
+ 
+%Some checks
+if nargin~=2 | nargout
+	error('expcut usage: expcut(newfile,oldfile)')
+elseif ~exist(oldfile)
+	error(['expcut error message: the file ' oldfile  'does not exist'])
+elseif exist(newfile),
+	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
+	if ~strcmpi(choice,'y'),
+		error('no modification done ... exiting');
+	end
+end
+
+%Get exp oldfile
+[path root ext ver]=fileparts(oldfile);
+A=expread(oldfile,1);
+numprofiles=size(A,2);
+
+%Figure out how nany plots have been done so far 
+g=get(gca,'children'); 
+prevplot=length(g);
+
+%plot existing profile
+hold on
+numpoints=0;
+closed=zeros(numprofiles,1);
+for i=1:numprofiles
+	plot(A(i).x,A(i).y,'-r','MarkerSize',10);
+
+	%update numpoints
+	numpoints=numpoints+size(A(i).x,1);
+
+	%figure out if the profile is closed or not
+	if (A(i).x(1)==A(i).x(end) & A(i).y(1)==A(i).y(end))
+		closed(i)=1;
+	end
+end
+
+%call merge profile routine
+[A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root);
+
+hold off
+
+%write contour using expwrite
+title('New file written, exiting','FontSize',14);
+expwrite(A,newfile);
Index: /issm/trunk/src/m/utils/Exp/expdisp.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expdisp.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expdisp.m	(revision 1)
@@ -0,0 +1,31 @@
+function expdisp(domainoutline,varargin)
+%EXPDISP - plot the contours of a domain outline file
+%
+%   This routine reads in a domain outline file (Argus format) and plots all the contours 
+%
+%   Usage:
+%      expdisp(domainoutline,varargin)
+%
+%   See also EXPMASTER, EXPDOC
+
+if nargin==1,
+	figurenumber=1;
+	linestyle='r-';
+end
+
+if nargin==2,
+	figurenumber=varargin{1};
+	linestyle='r-';
+end
+
+if nargin==3,
+	figurenumber=varargin{1};
+	linestyle=varargin{2};
+end
+
+domain=expread(domainoutline,1);
+
+figure(figurenumber),hold on
+for i=1:length(domain),
+	plot(domain(i).x,domain(i).y,linestyle);
+end
Index: /issm/trunk/src/m/utils/Exp/expdoc.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expdoc.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expdoc.m	(revision 1)
@@ -0,0 +1,38 @@
+function expdoc()
+%EXPDOC - create a doc for EXP routines
+%
+%   Usage:
+%      expdoc()
+
+disp(' ');
+disp('   Utilities dedicated to ARGUS Files (''.exp'' extension)'); 
+disp('     expboxgen: creates a domain outline box for a .tif image for the mosaic tiff');
+disp('            usage: expboxgen(x0,y0,nx,ny,parameter_filename,box_filename)');
+disp('            x0,y0 and nx,ny are the cropping coordinates (upper left and lower right corners in the larger tiff image)');
+disp('            paramter_filename is the parameter file name for the mosaic tiff image. box_filename is self explanatory.');
+disp('     expconcatenate: display all the profiles present in an Argus file and merge them accordingly to the tips selected by the user')
+disp('            usage:  expconcatenate(newfile,oldfile)')
+disp('     expcreatecircle: creates a closed Argus contour centered on (x,y), of radius radius_length. The contour is made of N points');
+disp('            usage: expcreatecircle(filename,x0,y0,radius_length,N)');
+disp('     expcreatecontour: creates a closed Argus contour delimited by the ''clicks'' of the user');
+disp('            usage: expcreatecontour(filename)');
+disp('     expcreateprofile: creates an Argus profile delimited by the ''clicks'' of the user');
+disp('            usage: expcreateprofile(filename)');
+disp('     expcut: display the contents of an Argus file and allow the user cut the profiles');
+disp('            usage: expcut(newfilename,oldfilename)');
+disp('     expdisp: display the contents of an Argus file');
+disp('            usage:  expdisp(filename,[figure number],[line style])');
+disp('     expgen: creates an Argus file from a contour (x,y) and a flag indicating if the contour must be closed or open');
+disp('            usage:  expgen(filename,contours,close_flag)');
+disp('     explink: takes a domain outline made of various segments, and links them together in one domain outline. Use expview to see end result');
+disp('            usage: explink(domainoutline,minthreshold,step)');
+disp('     expmaster: allows the user to create, close, merge, remove,... Argus files and save the result in newfile');
+disp('            usage: expmaster(newfile,[oldfile1],[oldfile2],[oldfile3],[...]');
+disp('     expread: reads an Argus file and build a structure that holds all the information of the file');
+disp('            usage: expread(file,close_flag)');
+disp('     expselect: display all the profiles of oldfile, the user clicks on the contour he/she wants to remove. Results saved in newfile');
+disp('            usage: expselect(newfile,oldfile)');
+disp('     expwriteasvertices: writes an Argus file from a structure given in input???');
+disp('            usage: expwriteasvertices(structure,filename)');
+disp('     expwrite: writes an Argus file from a structure given in input???');
+disp('            usage: expwrite(structure,filename)');
Index: /issm/trunk/src/m/utils/Exp/expgen.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expgen.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expgen.m	(revision 1)
@@ -0,0 +1,47 @@
+function expgen(file_name,contours,close_flag);
+%EXPGEN - create an Argus file from x and y arrays
+%
+%   Create .exp domain outline type out of x,y  coordinates. 
+%   The contour defined by arrays x and y should not be closed. 
+%   Generated domain outline will not be closed, except if close_flag is set to 1.
+%
+%   Usage:
+%      expgen(file_name,contours,close_flag)
+%
+%   See also EXPMASTER, EXPDOC
+
+%Check on inputs
+if((close_flag~=0) & (close_flag~=1)),
+error('close flag must be 0 of 1');
+end
+fid=fopen(file_name,'wt');
+
+for i=1:length(contours),
+	if(length(contours(i).x)~=length(contours(i).y)),
+	error('contours x and y coordinates must be of identical size');
+	end
+
+	%get density for this profile.
+	if isfield(contours,'density'),
+		density=contours(i).density;
+	end
+
+	fprintf(fid,'%s\n','## Name:');
+	fprintf(fid,'%s\n','## Icon:0');
+	fprintf(fid,'%s\n','# Points Count Value');
+	if(close_flag==0),
+	fprintf(fid,'%i %i\n',length(contours(i).x),density);
+	else
+	fprintf(fid,'%i %i\n',length(contours(i).x)+1,density);
+	end
+	fprintf(fid,'%s\n','# X pos Y pos');
+	for j=1:length(contours(i).x),
+	 fprintf(fid,'%f %f\n',contours(i).x(j),contours(i).y(j));
+	end  
+
+	if(close_flag==1),
+	fprintf(fid,'%f %f\n',contours(i).x(1),contours(i).y(1));
+	end
+	fprintf(fid,'%s\n','');
+end
+fclose(fid);
Index: /issm/trunk/src/m/utils/Exp/explink.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/explink.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/explink.m	(revision 1)
@@ -0,0 +1,29 @@
+function explink(domainoutline,minthreshold,step)
+%EXPLINK - allow to link several segments of domain outline together
+%
+%   Takes a domain outline made of various segments, and links them together in one 
+%   domain outline. Use expview to see end result.
+%
+%   Usage:
+%      explink(domainoutline,minthreshold,step)
+%
+%   See also EXPMASTER, EXPDOC
+
+notdone=1;
+
+while notdone,
+
+	for i=1:1000,
+		status=expconcatenate(domainoutline,minthreshold+(i-1)*step);
+		if status==0,
+			return;
+		end
+		if status==1,
+			break;
+		end
+		if status==-1,
+			continue;
+		end
+	end
+end
+
Index: /issm/trunk/src/m/utils/Exp/expmaster.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expmaster.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expmaster.m	(revision 1)
@@ -0,0 +1,296 @@
+function expmaster(newfile,varargin)
+%EXPMASTER - allow to create, modify, add, cut, .. segments of domain outline together
+%
+%   this routine is used to create, modify, cut,... an Argus file (.exp)
+%
+%   expmaster(newprofile)
+%      creation of an argus file newprofile
+%
+%   expmaster(newprofile,oldprofile)
+%      the modification of the file oldprofile will be saved in newprofile
+%
+%   expmaster(newprofile,oldprofile1,oldprofile2,...)
+%      the modification of the files oldprofile* will be saved in newprofile
+%
+%   Usage:
+%      expmaster(newfile,varargin)
+%
+%   See also EXPDOC
+
+%Some checks
+if ~nargin | nargout
+	error('expmaster usage: expmaster(newfile,varargin)')
+elseif exist(newfile),
+	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
+	if ~strcmpi(choice,'y'),
+		error('no modification done ... exiting');
+	end
+end
+
+%put all the argus profiles given in input in one structure A
+A=struct([]);
+numprofiles=0;
+numpoints=0;
+closed=[];
+if nargin>1,
+	isexist=1;
+	for i=1:nargin-1
+		filename=varargin{i};
+		if ~exist(filename),
+			error(['expmaster error message:, ' filename ' does not exist. Exiting...']);
+		else
+			%read file
+			B=expread(filename,1);
+			%go through all profiles of B
+			for i=1:size(B,2)
+				%plug profile in A
+				if numprofiles
+					A(numprofiles+1)=B(i);
+				else
+					A=B(i);
+				end
+				%update numprofiles and numpoints
+				numpoints=numpoints+length(B(i).x);
+				numprofiles=numprofiles+1;
+				%figure out if the profile is closed or not
+				if (B(i).x(1)==B(i).x(end) & B(i).y(1)==B(i).y(end))
+					closed(numprofiles)=1;
+				else
+					closed(numprofiles)=0;
+				end
+			end
+		end
+	end
+else
+	isexist=0;
+end
+
+%Get root of newfile
+[path root ext ver]=fileparts(newfile);
+
+%Figure out how nany plots have been done so far 
+g=get(gca,'children'); 
+prevplot=length(g);
+prevplot2=prevplot;
+
+%plot existing profile if any
+hold on
+if numprofiles
+	for i=1:numprofiles
+		plot(A(i).x,A(i).y,'-r','MarkerSize',10);
+		prevplot2=prevplot2+1;
+	end
+end
+
+%Build backup structre for do and redo
+backup=cell(1,3);
+backup{1,1}=A;
+backup{1,2}=numprofiles;
+backup{1,3}=numpoints;
+backup{1,4}=closed;
+
+loop=1;
+counter=1;
+while loop
+
+	%is there a profile in A?
+	if isexist
+
+		%Go through A and rule out the empty profiles
+		list=[];
+		for i=1:size(A,2);
+			if length(A(i).x)==0
+				list(end+1)=i;
+				numprofiles=numprofiles-1;
+			end
+		end
+		A(list)=[];
+		closed(list)=[];
+
+		%display menu
+		title('Main Menu','FontSize',14);
+		button=menu('Menu','add a profile',...  %1
+		'remove a profile',...                  %2
+		'modify the position of a point',...    %3
+		'add points inside a profile',...       %4
+		'add points at the end of a profile',...%5
+		'remove points',...                     %6
+		'remove several points',...             %7
+		'cut a segment',...                     %8
+		'cut a large area',...                  %9
+		'merge profiles',...                    %10
+		'close profile',...                     %11
+		'undo',...                              %12
+		'redo',...                              %13
+		'quit');                                %14
+
+
+		%UNDO??
+		if button==12;
+			if counter==1
+				disp('Already at oldest change');
+			else
+				counter=counter-1;
+				A=backup{counter,1};
+				numprofiles=backup{counter,2};
+				numpoints=backup{counter,3};
+				closed=backup{counter,4};
+			end
+		end
+
+		%REDO??
+		if button==13
+			if counter==size(backup,1)
+				disp('Already at newest change');
+			else
+				counter=counter+1;
+				A=backup{counter,1};
+				numprofiles=backup{counter,2};
+				numpoints=backup{counter,3};
+				closed=backup{counter,4};
+			end
+		end
+
+		switch button
+
+		case 1
+
+			[A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot2,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		case 2
+
+			[A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot2,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		case 3
+
+			[A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		case 4
+
+			[A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		case 5
+
+			[A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot2,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		case 6
+
+			[A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		case 7
+
+			[A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		case 8
+
+			[A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		case 9
+
+			[A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		case 10
+
+			[A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+
+		case 11
+
+			[A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root);
+			counter=counter+1;
+			backup{counter,1}=A;
+			backup{counter,2}=numprofiles;
+			backup{counter,3}=numpoints;
+			backup{counter,4}=closed;
+
+		%QUIT
+		case 14
+
+			loop=0;
+
+		otherwise
+
+			%do nothing
+
+		end
+
+    %no argus file has been given in input, go to addcontour directly
+	else
+		[A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot2,root);
+		counter=counter+1;
+		backup{counter,1}=A;
+		backup{counter,2}=numprofiles;
+		backup{counter,3}=numpoints;
+		backup{counter,4}=closed;
+		isexist=1;
+	 end
+
+	 %Now erase all that have been done and plot the new structure A as it is
+	 undoplots(prevplot);
+	if numprofiles
+		for i=1:numprofiles
+			plot(A(i).x,A(i).y,'-r','MarkerSize',10);
+			prevplot2=prevplot2+1;
+		end
+	end
+end
+
+hold off
+
+%write contour using expwrite
+title('New file written, exiting','FontSize',14);
+if isempty(A)
+	disp('Profile empty, no file written')
+else
+	expwrite(A,newfile);
+end
Index: /issm/trunk/src/m/utils/Exp/expselect.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/expselect.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/expselect.m	(revision 1)
@@ -0,0 +1,61 @@
+function expselect(newfile,oldfile)
+%EXPSELECT - allow to select some profiles
+%
+%   this routine reads the profiles of oldfile
+%   and enables the user to select the profiles 
+%   that he/she wants to keep in newfile
+%
+%   Usage:
+%      expselect(newfile,oldfile)
+%
+%   See also EXPMASTER, EXPDOC
+ 
+%Some checks
+if nargin~=2 | nargout
+	error('expselect usage: expselect(newfile,oldfile)')
+elseif ~exist(oldfile)
+	error(['expselect error message: the file ' oldfile  'does not exist'])
+elseif exist(newfile),
+	choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
+	if ~strcmpi(choice,'y'),
+		error('no modification done ... exiting');
+	end
+end
+
+%Get exp oldfile
+[path root ext ver]=fileparts(oldfile);
+A=expread(oldfile,1);
+numprofiles=size(A,2);
+
+%Figure out how nany plots have been done so far 
+g=get(gca,'children'); 
+prevplot=length(g);
+
+%plot existing profile
+hold on
+numpoints=0;
+closed=zeros(numprofiles,1);
+for i=1:numprofiles
+	plot(A(i).x,A(i).y,'-r','MarkerSize',10);
+
+	%update numpoints
+	numpoints=numpoints+size(A(i).x,1);
+
+	%figure out if the profile is closed or not
+	if (A(i).x(1)==A(i).x(end) & A(i).y(1)==A(i).y(end))
+		closed(i)=1;
+	end
+end
+
+%call merge profile routine
+[A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root);
+
+hold off
+
+%write contour using expwrite
+title('New file written, exiting','FontSize',14);
+if isempty(A)
+	disp('Profile empty, no file written')
+else
+	expwrite(A,newfile);
+end
Index: /issm/trunk/src/m/utils/Exp/ginputquick.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/ginputquick.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/ginputquick.m	(revision 1)
@@ -0,0 +1,221 @@
+function [out1,out2,out3] = ginput(arg1)
+%GINPUT - Graphical input from mouse.
+%
+%   [X,Y] = GINPUT(N) gets N points from the current axes and returns 
+%   the X- and Y-coordinates in length N vectors X and Y.  The cursor
+%   can be positioned using a mouse (or by using the Arrow Keys on some 
+%   systems).  Data points are entered by pressing a mouse button
+%   or any key on the keyboard except carriage return, which terminates
+%   the input before N points are entered.
+%
+%   [X,Y] = GINPUT gathers an unlimited number of points until the
+%   return key is pressed.
+% 
+%   [X,Y,BUTTON] = GINPUT(N) returns a third result, BUTTON, that 
+%   contains a vector of integers specifying which mouse button was
+%   used (1,2,3 from left) or ASCII numbers if a key on the keyboard
+%   was used.
+%
+%   Usage:
+%      [out1,out2,out3] = ginput(arg1)
+
+%   Copyright 1984-2005 The MathWorks, Inc.
+%   $Revision: 1.2 $  $Date: 2009/03/27 00:44:53 $
+
+out1 = []; out2 = []; out3 = []; y = [];
+c = computer;
+if ~strcmp(c(1:2),'PC') 
+   tp = get(0,'TerminalProtocol');
+else
+   tp = 'micro';
+end
+
+if ~strcmp(tp,'none') && ~strcmp(tp,'x') && ~strcmp(tp,'micro'),
+   if nargout == 1,
+      if nargin == 1,
+         out1 = trmginput(arg1);
+      else
+         out1 = trmginput;
+      end
+   elseif nargout == 2 || nargout == 0,
+      if nargin == 1,
+         [out1,out2] = trmginput(arg1);
+      else
+         [out1,out2] = trmginput;
+      end
+      if  nargout == 0
+         out1 = [ out1 out2 ];
+      end
+   elseif nargout == 3,
+      if nargin == 1,
+         [out1,out2,out3] = trmginput(arg1);
+      else
+         [out1,out2,out3] = trmginput;
+      end
+   end
+else
+   
+   fig = gcf;
+   figure(gcf);
+   
+   if nargin == 0
+      how_many = -1;
+      b = [];
+   else
+      how_many = arg1;
+      b = [];
+      if  ischar(how_many) ...
+            || size(how_many,1) ~= 1 || size(how_many,2) ~= 1 ...
+            || ~(fix(how_many) == how_many) ...
+            || how_many < 0
+         error('MATLAB:ginput:NeedPositiveInt', 'Requires a positive integer.')
+      end
+      if how_many == 0
+         ptr_fig = 0;
+         while(ptr_fig ~= fig)
+            ptr_fig = get(0,'PointerWindow');
+         end
+         scrn_pt = get(0,'PointerLocation');
+         loc = get(fig,'Position');
+         pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+         out1 = pt(1); y = pt(2);
+      elseif how_many < 0
+         error('MATLAB:ginput:InvalidArgument', 'Argument must be a positive integer.')
+      end
+   end
+   
+   % Suspend figure functions
+   state = uisuspend(fig);
+   
+   toolbar = findobj(allchild(fig),'flat','Type','uitoolbar');
+   if ~isempty(toolbar)
+        ptButtons = [uigettool(toolbar,'Plottools.PlottoolsOff'), ...
+                     uigettool(toolbar,'Plottools.PlottoolsOn')];
+        ptState = get (ptButtons,'Enable');
+        set (ptButtons,'Enable','off');
+   end
+
+   set(fig,'pointer','fullcrosshair');
+   fig_units = get(fig,'units');
+   char = 0;
+
+   % We need to pump the event queue on unix
+   % before calling WAITFORBUTTONPRESS 
+   drawnow
+   
+   while how_many ~= 0
+      % Use no-side effect WAITFORBUTTONPRESS
+      waserr = 0;
+      try
+	keydown = wfbp;
+      catch
+	waserr = 1;
+      end
+      if(waserr == 1)
+         if(ishandle(fig))
+            set(fig,'units',fig_units);
+	    uirestore(state);
+            error('MATLAB:ginput:Interrupted', 'Interrupted');
+         else
+            error('MATLAB:ginput:FigureDeletionPause', 'Interrupted by figure deletion');
+         end
+      end
+      
+      ptr_fig = get(0,'CurrentFigure');
+      if(ptr_fig == fig)
+         if keydown
+            char = get(fig, 'CurrentCharacter');
+            button = abs(get(fig, 'CurrentCharacter'));
+            scrn_pt = get(0, 'PointerLocation');
+            set(fig,'units','pixels')
+            loc = get(fig, 'Position');
+            pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+            set(fig,'CurrentPoint',pt);
+         else
+            button = get(fig, 'SelectionType');
+            if strcmp(button,'open') 
+               button = 1;
+            elseif strcmp(button,'normal') 
+               button = 1;
+            elseif strcmp(button,'extend')
+               button = 2;
+            elseif strcmp(button,'alt') 
+               button = 3;
+            else
+               error('MATLAB:ginput:InvalidSelection', 'Invalid mouse selection.')
+            end
+         end
+         pt = get(gca, 'CurrentPoint');
+         
+         how_many = how_many - 1;
+         
+         if(char == 13) % & how_many ~= 0)
+            % if the return key was pressed, char will == 13,
+            % and that's our signal to break out of here whether
+            % or not we have collected all the requested data
+            % points.  
+            % If this was an early breakout, don't include
+            % the <Return> key info in the return arrays.
+            % We will no longer count it if it's the last input.
+            break;
+         end
+
+         out1 = [out1;pt(1,1)];
+         y = [y;pt(1,2)];
+         b = [b;button];
+      end
+   end
+   
+   uirestore(state);
+   if ~isempty(toolbar) && ~isempty(ptButtons)
+        set (ptButtons(1),'Enable',ptState{1});
+        set (ptButtons(2),'Enable',ptState{2});
+   end
+   set(fig,'units',fig_units);
+   
+   if nargout > 1
+      out2 = y;
+      if nargout > 2
+         out3 = b;
+      end
+   else
+      out1 = [out1 y];
+   end
+
+   line(out1,y);
+   line([out1(length(out1)) out1(1)],[y(length(y)) y(1)]);
+   
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function key = wfbp
+%WFBP   Replacement for WAITFORBUTTONPRESS that has no side effects.
+
+fig = gcf;
+current_char = [];
+
+% Now wait for that buttonpress, and check for error conditions
+waserr = 0;
+try
+  h=findall(fig,'type','uimenu','accel','C');   % Disabling ^C for edit menu so the only ^C is for
+  set(h,'accel','');                            % interrupting the function.
+  keydown = waitforbuttonpress;
+  current_char = double(get(fig,'CurrentCharacter')); % Capturing the character.
+  if~isempty(current_char) && (keydown == 1)           % If the character was generated by the 
+	  if(current_char == 3)                       % current keypress AND is ^C, set 'waserr'to 1
+		  waserr = 1;                             % so that it errors out. 
+	  end
+  end
+  
+  set(h,'accel','C');                                 % Set back the accelerator for edit menu.
+catch
+  waserr = 1;
+end
+drawnow;
+if(waserr == 1)
+   set(h,'accel','C');                                % Set back the accelerator if it errored out.
+   error('MATLAB:ginput:Interrupted', 'Interrupted');
+end
+
+if nargout>0, key = keydown; end
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Index: /issm/trunk/src/m/utils/Exp/manipulation/addendprofile.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/addendprofile.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/addendprofile.m	(revision 1)
@@ -0,0 +1,92 @@
+function [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root);
+%ADDENDPROFILE - add point at the end of a n existing profile
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot,root)
+		
+	%some checks
+	if numprofiles==0
+		disp('no profile present')
+		return
+	end	   
+	if ~any(~closed)
+		disp('all profiles are closed')
+		return
+	end	   
+	%select a profile first
+	if numprofiles>1
+		%first step, select a profile
+		isclosed=1;
+		title('click on a profile, RETURN to exit','FontSize',14)
+		while isclosed
+			[xi,yi] = ginput(1);
+			if ~isempty(xi)
+				%get the closest point 
+				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+				if closed(profsel)
+					disp('selected profile is closed, make another selection')
+				else
+					isclosed=0;
+				end
+
+			else
+				%RETURN -> out
+				return
+			end
+		end
+	else
+		profsel=1;
+	end
+
+	%initialize x and y
+	x=A(profsel).x;
+	y=A(profsel).y;
+
+	%plot the selected profile
+	hold on
+	if length(x)
+		plot(x,y,'-rs','MarkerSize',10);
+	end
+	plot(x,y,'rs','MarkerSize',10);
+	plot(x(end),y(end),'rs','MarkerSize',14);
+
+
+	loop=1;
+
+	while loop
+
+		%first step, select a profile
+		title('click to add point to the selected profile, RETURN to exit','FontSize',14)
+		[xi,yi] = ginput(1);
+
+		if ~isempty(xi)
+			x(end+1,1)=xi;
+			y(end+1,1)=yi;
+
+			%plot everything
+			undoplots(prevplot);
+			if length(x)
+				plot(x,y,'-rs','MarkerSize',10);
+			end
+			plot(x,y,'rs','MarkerSize',10);
+			plot(x(end),y(end),'rs','MarkerSize',14);
+
+		else
+
+			%check that the profile is not empty
+			if ~isempty(x)
+				A(profsel).x=x; 
+				A(profsel).y=y; 
+				A(profsel).name=root; 
+				A(profsel).density=1; 
+				numpoints=numpoints+length(x);
+			end
+
+			%get out
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/addinsideprofile.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/addinsideprofile.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/addinsideprofile.m	(revision 1)
@@ -0,0 +1,75 @@
+function [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root);
+%ADDINSIDEPROFILE - add apoint inside a profile
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root)
+		
+	%some checks
+	if numprofiles==0
+		disp('no profile present')
+		return
+	end	   
+	if numpoints<2
+		disp('at least two points are required')
+		return
+	end	   
+	hold on
+	loop=1;
+
+	%plot squares
+	for i=1:numprofiles
+		plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+	end
+
+	while loop
+
+		%first step, select a segment
+		title('click on a segment, RETURN to exit','FontSize',14)
+		[xi,yi] = ginput(1);
+
+		%first click
+		if ~isempty(xi)
+
+			%get the closest segment
+			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
+
+			%check that at least one segment exists
+			if indsel==0
+				disp('at least two points in one profile are required')
+				return
+			end
+
+			%highlight selected segment
+			plot([A(profsel).x(indsel) A(profsel).x(indsel+1)],[A(profsel).y(indsel) A(profsel).y(indsel+1)],'b-','MarkerSize',10);
+
+			%next click
+			title('click on the new point''s location, RETURN to exit','FontSize',14)
+			[xi,yi,but] = ginput(1);
+
+			%second click
+			if ~isempty(xi)
+
+				%add point to A
+				A(profsel).x=[A(profsel).x(1:indsel,1); xi; A(profsel).x(indsel+1:end,1)];
+				A(profsel).y=[A(profsel).y(1:indsel,1); yi; A(profsel).y(indsel+1:end,1)];
+				numpoints=numpoints+1;
+
+				%plot new profile
+				undoplots(prevplot);
+				for i=1:numprofiles
+					plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+				end
+
+			else
+				%RETURN->exit
+				return
+			end
+		else
+			%RETURN-> exit
+			return
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/addprofile.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/addprofile.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/addprofile.m	(revision 1)
@@ -0,0 +1,50 @@
+function [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root);
+%ADDPROFILE - add a profile
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root)
+		   
+	title('click to add a point to the new profile, RETURN to exit','FontSize',14)
+	hold on
+
+	loop=1;
+	x=[];
+	y=[];
+
+	while loop
+
+		[xi,yi] = ginput(1);
+					  
+		if ~isempty(xi)
+			x(end+1,1)=xi;
+			y(end+1,1)=yi;
+
+			%plot everything
+			undoplots(prevplot);
+			if length(x)
+				plot(x,y,'-rs','MarkerSize',10);
+			end
+			plot(x,y,'rs','MarkerSize',10);
+			plot(x(end),y(end),'rs','MarkerSize',14);
+
+		else
+
+			%check that the profile is not empty
+			if ~isempty(x)
+				A(end+1).x=x; 
+				A(end).y=y; 
+				A(end).name=root; 
+				A(end).density=1; 
+				numprofiles=numprofiles+1;
+				numpoints=numpoints+length(x);
+				closed(end+1)=0;
+			end
+
+			%get out
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/closeprofile.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/closeprofile.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/closeprofile.m	(revision 1)
@@ -0,0 +1,57 @@
+function [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root);
+%CLOSEPROFILE - close one or several profile
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root)
+
+	%some checks
+	if numprofiles==0
+		disp('no profile to be closed')
+		return
+	end
+		   
+	title('click on the profiles to be closed, RETURN to exit','FontSize',14)
+	hold on
+
+	loop=1;
+	selection=[];
+
+	while loop
+
+		[xi,yi] = ginput(1);
+					  
+		if ~isempty(xi)
+
+			%get closest profile
+			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+
+			if ismember(profsel,selection)
+				%profile was in selection, close it
+				selection(find(selection==profsel))=[];
+				%back to red
+				plot(A(profsel).x,A(profsel).y,'-r','MarkerSize',10);
+			else
+				%add the profile to the list to be closed
+				selection(end+1)=profsel;
+				%in blue
+				plot(A(profsel).x,A(profsel).y,'-b','MarkerSize',10);
+			end
+		else
+			%close the profiles
+			for i=1:length(selection),
+				if (A(selection(i)).x(end)~=A(selection(i)).x(1) | A(selection(i)).y(end)~=A(selection(i)).y(1))
+					A(selection(i)).x(end+1)=A(selection(i)).x(1);
+					A(selection(i)).y(end+1)=A(selection(i)).y(1);
+					numpoints=numpoints+1;
+					closed(selection(i))=1;
+				else
+					disp('one profile is already closed')
+				end
+			end
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/closestpoint.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/closestpoint.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/closestpoint.m	(revision 1)
@@ -0,0 +1,21 @@
+function [profsel indsel]=closestpoint(A,numprofiles,xi,yi)
+%CLOSESTPOINT - find the closest point of a profile
+%
+%   This routine find the point of the profile A that is the closest
+%   to (xi,yi) and return the number of the profile and the number of
+%   the point
+%
+%   Usage:
+%     [profsel indsel]=closestpoint(A,numprofiles,xi,yi) 
+
+	%loop over the points of each profile, find the closest to (xi,yi)
+	for i=1:numprofiles,
+		distance=(xi-A(i).x).^2+(yi-A(i).y).^2;
+		[newdistance p]=min(distance);
+		if ((i==1) | (newdistance<olddistance)),
+			indsel=p;
+			profsel=i;
+			olddistance=newdistance;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/closestsegment.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/closestsegment.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/closestsegment.m	(revision 1)
@@ -0,0 +1,28 @@
+function [profsel indsel]=closestsegment(A,numprofiles,xi,yi)
+%CLOSESTSEGMENT - find the closest segment of a profile
+%
+%   This routine find the segment of the profile A that is the closest
+%   to (xi,yi) and return the number of the profile and the number of
+%   the first point belonging to this closest segment
+%
+%   Usage:
+%     [profsel indsel]=closestsegment(A,numprofiles,xi,yi) 
+
+	%loop over the middles of each profile, find the closest to (xi,yi)
+	profsel=0;
+	indsel=0;
+	first=1;
+	for i=1:numprofiles,
+		if length(A(i).x)>1
+			middles=[(A(i).x(1:end-1)+A(i).x(2:end))/2 (A(i).y(1:end-1)+A(i).y(2:end))/2];
+			distance=(xi-middles(:,1)).^2+(yi-middles(:,2)).^2;
+			[newdistance p]=min(distance);
+			if (first | (newdistance<olddistance)),
+				first=0;
+				indsel=p;
+				profsel=i;
+				olddistance=newdistance;
+			end
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/cutarea.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/cutarea.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/cutarea.m	(revision 1)
@@ -0,0 +1,147 @@
+function [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root);
+%CUTAREA - cut several point of a profile
+%
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile. The user must click 3 times to select the
+%   area to be removed. Twice to select the tips and one to select
+%   the part of the profile to be removed
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root)
+		
+	hold on
+	loop=1;
+
+	%plot squares
+	for i=1:numprofiles
+		plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+	end
+
+	points=[];
+
+	%loop (at least 3 clicks needed)
+	while loop
+
+		%some checks
+		if numprofiles==0
+			disp('no profile present')
+			return
+		end	   
+		if numpoints<3
+			disp('at least two points are needed')
+			return
+		end	   
+
+		%select a point
+		if isempty(points)
+			title('click on the first tip, RETURN to exit','FontSize',14)
+		elseif length(points)==1
+			title('click on the second tip, RETURN to exit','FontSize',14)
+		else
+			title('click in the middle of the area to be cut, RETURN to exit','FontSize',14)
+		end
+
+		[xi,yi] = ginput(1);
+
+		if ~isempty(xi)
+			%get the closest point
+			%first time, look at all profiles
+			if isempty(points)
+				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
+					disp('the selected profile has less than 3 points, make another selection');
+				else
+					selection=profsel;
+					points(end+1)=indsel;
+					plot(A(selection).x,A(selection).y,'-b','MarkerSize',10);
+					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
+				end
+			else
+				%get the 2d or 3d point for the given contou
+				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
+				if ismember(indsel,points)
+					disp('the selected points must be distinct')
+				else
+					%second click?
+					if length(points)==1,
+						points(end+1)=indsel;
+						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
+					%third click?
+					else
+						p1=points(1); p2=points(2); p3=indsel;
+						x=A(selection).x; y=A(selection).y;
+						if p1<p2
+							if p3>p1 & p3<p2
+								if closed(selection)
+									%open the profile
+									n=length(A(selection).x);
+									A(selection).x=[A(selection).x(p2:end-1,1);A(selection).x(1:p1,1)];
+									A(selection).y=[A(selection).y(p2:end-1,1);A(selection).y(1:p1,1)];
+									numpoints=numpoints-(n-length(A(selection).x));
+									closed(selection)=0;
+								else
+									%cut in 2 profiles
+									A(selection).x=x(1:p1);
+									A(selection).y=y(1:p1);
+									A(end+1).x=x(p2:end);
+									A(end).y=y(p2:end);
+									A(end).density=A(selection).density;
+									A(end).name=A(selection).name;
+									numprofiles=numprofiles+1;
+									numpoints=numpoints-(p2-p1-1);
+								end
+							else
+								%only point removal
+								n=length(A(selection).x);
+								A(selection).x=x(p1:p2);
+								A(selection).y=y(p1:p2);
+								numpoints=numpoints-(n-length(A(selection).x));
+								closed(selection)=0;
+							end
+						else
+							if p3>p2 & p3<p1
+								if closed(selection)
+									%open the profile
+									n=length(A(selection).x);
+									A(selection).x=[A(selection).x(p1:end-1,1);A(selection).x(1:p2,1)];
+									A(selection).y=[A(selection).y(p1:end-1,1);A(selection).y(1:p2,1)];
+									numpoints=numpoints-(n-length(A(selection).x));
+									closed(selection)=0;
+								else
+									%cut in 2 profiles
+									A(selection).x=x(1:p2);
+									A(selection).y=y(1:p2);
+									A(end+1).x=x(p1:end);
+									A(end).y=y(p1:end);
+									A(end).density=A(selection).density;
+									A(end).name=A(selection).name;
+									numprofiles=numprofiles+1;
+									numpoints=numpoints-(p1-p2-1);
+								end
+							else
+								%only point removal
+								n=length(A(selection).x);
+								x(1:p2-1)=[];x(p1-p2+2:end)=[];%it should have been x(p2+1:end)
+								y(1:p2-1)=[];y(p1-p2+2:end)=[];
+								A(selection).x=x;
+								A(selection).y=y;
+								numpoints=numpoints-(n-length(A(selection).x));
+								closed(selection)=0;
+							end
+						end
+						%plot new profile
+						undoplots(prevplot);
+						for i=1:numprofiles
+							plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+						end
+						points=[];
+					end
+				end
+			end
+		else
+			%RETRUN-> quit
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/cutprofile.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/cutprofile.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/cutprofile.m	(revision 1)
@@ -0,0 +1,77 @@
+function [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root);
+%CUTPROFILE - cut a profile
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root)
+		
+	%some checks
+	if numprofiles==0
+		disp('no profile present')
+		return
+	end	   
+	if numpoints<2
+		disp('at least two points are needed')
+		return
+	end	   
+	hold on
+	loop=1;
+
+	%plot squares
+	for i=1:numprofiles
+		plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+	end
+
+	while loop
+
+		%select a segment
+		title('click the segment to cut, RETURN to exit','FontSize',14)
+		[xi,yi] = ginput(1);
+
+		if ~isempty(xi)
+
+			%get the closest segment
+			[profsel indsel]=closestsegment(A,numprofiles,xi,yi);
+
+			%check that at least one segment exists
+			if indsel==0
+				disp('at least 2 points are required');
+				return,
+			end
+
+			if ((closed(profsel) & length(A(profsel).x)<3) | (~closed(profsel) & length(A(profsel).x)<2))
+				disp('at least 2 points are required, make another selection');
+			else
+				%cut A
+				if closed(profsel)
+					%open the contour
+					A(profsel).x=[A(profsel).x(indsel+1:end-1,1);A(profsel).x(1:indsel,1)];
+					A(profsel).y=[A(profsel).y(indsel+1:end-1,1);A(profsel).y(1:indsel,1)];
+					numpoints=numpoints-1;
+					closed(profsel)=0;
+				else
+					%cut the contour in 2 profiles
+					A(end+1).x=A(profsel).x(indsel+1:end,1);
+					A(end).y=A(profsel).y(indsel+1:end,1);
+					A(end).name=root; 
+					A(end).density=1; 
+					A(profsel).x=A(profsel).x(1:indsel,1);
+					A(profsel).y=A(profsel).y(1:indsel,1);
+					numprofiles=numprofiles+1;
+					closed(end+1)=0;
+				end
+
+				%plot new profile
+				undoplots(prevplot);
+				for i=1:numprofiles
+					plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+				end
+			end
+		else
+			%RETURN->exit
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/mergeprofiles.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/mergeprofiles.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/mergeprofiles.m	(revision 1)
@@ -0,0 +1,141 @@
+function [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root);
+%MERGEPROFILES - morge profiles
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile. The user must select the two tips that
+%   he/she wants to merge
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root)
+
+	hold on
+	loop=1;
+
+	%Take all the tips coordinates
+	tips=zeros(2*numprofiles,4);
+	for i=1:numprofiles
+		%x and y coord, profile number, 1 if beginning, 2 and if end
+		tips(2*i-1,:)=[A(i).x(1)   A(i).y(1)   i  1];
+		tips(2*i,:) = [A(i).x(end) A(i).y(end) i  2];
+	end
+	%remove the closed profiles fron the list
+	tips([2*find(closed)-1;2*find(closed)],:)=[];
+
+	if size(tips,1)<2
+		disp('at least one unclosed profiles are required')
+		return
+	end
+
+	%plot the tips
+	plot(tips(:,1),tips(:,2),'rs','Markersize',10);
+	firsttip=1;
+
+	%loop (at least 2 clicks needed)
+	while loop
+	
+		%some checks
+		if size(tips,1)<2
+			disp('at least one unclosed profiles are required')
+			return
+		end
+
+		%select a point
+		if firsttip
+			title('click on the first tip, RETURN to exit','FontSize',14)
+		else
+			title('click on the second tip, RETURN to exit','FontSize',14)
+		end
+
+		[xi,yi] = ginput(1);
+
+		if ~isempty(xi)
+
+			if firsttip
+				%find the selected tip
+				distance=(xi-tips(:,1)).^2+(yi-tips(:,2)).^2;
+				[dmin tip1]=min(distance);
+				numprofile1=tips(tip1,3);
+				firsttip=0;
+
+				%remove tip1 grom tips list
+				newtips=tips;
+				newtips(tip1,:)=[];
+
+				%plot selected tip
+				plot(tips(tip1,1),tips(tip1,2),'bs','MarkerSize',10);
+				plot(A(numprofile1).x,A(numprofile1).y,'-g');
+
+			%second selection
+			else
+				distance=(xi-newtips(:,1)).^2+(yi-newtips(:,2)).^2;
+				[dmin tip2]=min(distance);
+				numprofile2=newtips(tip2,3);
+
+				%reverse if necessary
+				if numprofile2<numprofile1
+					fakeprofile=numprofile2;
+					numprofile2=numprofile1;
+					numprofile1=fakeprofile;
+				end
+
+				if numprofile1==numprofile2
+					%close the profile
+					A(numprofile1).x(end+1)=A(numprofile1).x(1);
+					A(numprofile1).y(end+1)=A(numprofile1).y(1);
+					numpoints=numpoints+1;
+					closed(numprofile1)=1;
+
+				else
+
+					if tips(tip1,4)==1 & newtips(tip2,4)==1,
+						A(numprofile1).x=[flipud(A(numprofile2).x); A(numprofile1).x];
+						A(numprofile1).y=[flipud(A(numprofile2).y); A(numprofile1).y];
+						numprofiles=numprofiles-1;
+						closed(numprofile1)=1;
+
+					elseif tips(tip1,4)==1 & newtips(tip2,4)==2,
+						A(numprofile1).x=[A(numprofile2).x; A(numprofile1).x];
+						A(numprofile1).y=[A(numprofile2).y; A(numprofile1).y];
+						numprofiles=numprofiles-1;
+						closed(numprofile1)=1;
+
+					elseif tips(tip1,4)==2 & newtips(tip2,4)==1,
+						A(numprofile1).x=[A(numprofile1).x; A(numprofile2).x];
+						A(numprofile1).y=[A(numprofile1).y; A(numprofile2).y];
+						numprofiles=numprofiles-1;
+						closed(numprofile1)=1;
+
+					elseif tips(tip1,4)==2 & newtips(tip2,4)==2,
+						A(numprofile1).x=[A(numprofile1).x; flipud(A(numprofile2).x)];
+						A(numprofile1).y=[A(numprofile1).y; flipud(A(numprofile2).y)];
+						numprofiles=numprofiles-1;
+						closed(numprofile1)=1;
+					end
+
+					%delete profile2
+					A(numprofile2)=[];
+					closed(numprofile2)=[];
+
+				end
+
+				%update tips
+				tips=newtips;
+				tips(tip2,:)=[];
+				tips(find(tips(:,3)==numprofile2),3)=numprofile1;
+
+				%plot new profile
+				undoplots(prevplot);
+				for i=1:numprofiles
+					plot(A(i).x,A(i).y,'-r','MarkerSize',10);
+				end
+				plot(tips(:,1),tips(:,2),'rs','Markersize',10);
+
+				%back to beginning
+				firsttip=1;
+			end
+		else
+			%RETRUN-> quit
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/modifyposition.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/modifyposition.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/modifyposition.m	(revision 1)
@@ -0,0 +1,73 @@
+function [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root);
+%MODIFYPOSITION - modify the prosition of a point of a profile
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root)
+		
+	%some checks
+	if numprofiles==0
+		disp('no profile present')
+		return
+	end
+
+	hold on
+	loop=1;
+
+	%plot squares
+	for i=1:numprofiles
+		plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+	end
+
+	while loop
+
+		%select a point to be modified 
+		title('click on the point to be modified, RETURN to exit','FontSize',14)
+		[xi,yi] = ginput(1);
+
+		if ~isempty(xi)
+
+			%get the closest point
+			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+
+			%plot the point in blue
+			plot(A(profsel).x(indsel),A(profsel).y(indsel),'bs','MarkerSize',10);
+
+			%select new location
+			title('click on the new location, RETURN to exit','FontSize',14)
+			[xi,yi] = ginput(1);
+
+			if ~isempty(xi)
+
+				%modification of its coordinates
+				A(profsel).x(indsel)=xi;
+				A(profsel).y(indsel)=yi;
+
+				%modify the last point if the profile is closed and indsel=end or 1
+				if closed(profsel)
+					if indsel==1 
+						A(profsel).x(end)=xi;
+						A(profsel).y(end)=yi;
+					elseif indsel==length(A(profsel).x)
+						A(profsel).x(1)=xi;
+						A(profsel).y(1)=yi;
+					end
+				end
+
+				%plot new profile
+				undoplots(prevplot);
+				for i=1:numprofiles
+					plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+				end
+			else
+				%RETURN-> exit
+				loop=0;
+			end
+		else
+			%RETURN-> exit
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/removepoints.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/removepoints.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/removepoints.m	(revision 1)
@@ -0,0 +1,78 @@
+function [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root);
+%REMOVEPOINTS - remove a point from a profile
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root)
+		
+	%some checks
+	if numprofiles==0
+		disp('no profile present')
+		return
+	end
+
+	hold on
+	loop=1;
+
+	%plot squares
+	for i=1:numprofiles
+		plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+	end
+
+	while loop
+
+		%check that at least one point is present
+		if numpoints==0
+			disp('at least one point are needed')
+			return
+		end	   
+
+		%select a point to be deleted
+		title('click on the point to be removed, RETURN to exit','FontSize',14)
+		[xi,yi] = ginput(1);
+
+		if ~isempty(xi)
+
+			%get the closest point
+			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+
+			%remove point of A
+			A(profsel).x(indsel)=[];
+			A(profsel).y(indsel)=[];
+
+			%unclose the domain if only 2 points remaining
+			if closed(profsel)
+				if length(A(profsel).x)==3
+					A(profsel).x(end)=[];
+					A(profsel).y(end)=[];
+					numpoints=numpoints-1;
+					closed(profsel)=0;
+				end
+			end
+
+			%remove the last point if the profile is closed and indsel=end or 1
+			if closed(profsel)
+				if indsel==1 
+					A(profsel).x(end)=A(profsel).x(1);
+					A(profsel).y(end)=A(profsel).y(1);
+				elseif indsel==length(A(profsel).x)
+					A(profsel).x(1)=A(profsel).x(end);
+					A(profsel).y(1)=A(profsel).y(end);
+				end
+			end
+			numpoints=numpoints-1;
+
+			%plot new profile
+			undoplots(prevplot);
+			for i=1:numprofiles
+				plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+			end
+
+		else
+			%RETURN-> exit
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/removeprofile.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/removeprofile.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/removeprofile.m	(revision 1)
@@ -0,0 +1,54 @@
+function [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root);
+%REMOVEPROFILE - delete a profile
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root)
+
+	title('click on the profiles to be removed, RETURN to exit','FontSize',14)
+	hold on
+
+	loop=1;
+	selection=[];
+
+	while loop
+
+		%some checks
+		if numprofiles==0
+			disp('no profile to be removed')
+			return
+		end
+		   
+		[xi,yi] = ginput(1);
+					  
+		if ~isempty(xi)
+
+			%get closest profile
+			[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+
+			if ismember(profsel,selection)
+				%profile was in selection, remove it
+				selection(find(selection==profsel))=[];
+				%back to red
+				plot(A(profsel).x,A(profsel).y,'-r','MarkerSize',10);
+			else
+				%add the profile to the list to be removed
+				selection(end+1)=profsel;
+				%in blue
+				plot(A(profsel).x,A(profsel).y,'-b','MarkerSize',10);
+			end
+		else
+			%remove the profiles
+			selection=sort(selection);
+			for i=1:length(selection),
+				numprofiles=numprofiles-1;
+				numpoints=numpoints-length(A(selection(i)-(i-1)).x);
+				A(selection(i)-(i-1))=[];
+				closed(selection(i)-(i-1))=[];
+			end
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/removeseveralpoints.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/removeseveralpoints.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/removeseveralpoints.m	(revision 1)
@@ -0,0 +1,115 @@
+function [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root);
+%REMOVESEVERALPOINTS - remove several point
+%
+%   this script is used by expmaster as an elementary operation
+%   on an ARGUS profile
+%
+%   Usage:
+%      [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root)
+		
+	%some checks
+	if numprofiles==0
+		disp('no profile present')
+		return
+	end	   
+	if numpoints<3
+		disp('at least two points are needed')
+		return
+	end	   
+	hold on
+	loop=1;
+
+	%plot squares
+	for i=1:numprofiles
+		plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
+	end
+
+	points=[];
+
+	%loop (at least 3 clicks needed)
+	while loop
+
+		%select a point
+		if isempty(points)
+			title('click on the first tip, RETURN to exit','FontSize',14)
+		elseif length(points)==1
+			title('click on the second tip, RETURN to exit','FontSize',14)
+		else
+			title('click in the middle of the area to be removed, RETURN to exit','FontSize',14)
+		end
+
+		[xi,yi] = ginput(1);
+
+		if ~isempty(xi)
+			%get the closest point
+			%first time, look at all profiles
+			if isempty(points)
+				[profsel indsel]=closestpoint(A,numprofiles,xi,yi);
+				if ((closed(profsel) & length(A(profsel).x)<4) |  (~closed(profsel) & length(A(profsel).x)<3)),
+					disp('the selected profile has less than 3 points, make another selection');
+				else
+					selection=profsel;
+					points(end+1)=indsel;
+					plot(A(selection).x,A(selection).y,'-b','MarkerSize',10);
+					text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
+				end
+			else
+				%get the 2d or 3d point for the given contou
+				[profsel indsel]=closestpoint(A(selection),1,xi,yi);
+				if ismember(indsel,points)
+					disp('the selected points must be distinct')
+				else
+					%second click?
+					if length(points)==1,
+						points(end+1)=indsel;
+						text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
+					%third click?
+					else
+						p1=points(1); p2=points(2); p3=indsel;
+						if p1<p2
+							if p3>p1 & p3<p2
+								A(selection).x(p1+1:p2-1)=[];
+								A(selection).y(p1+1:p2-1)=[];
+								numpoints=numpoints-(p2-p1-1);
+								loop=0;
+							else
+								A(selection).x=A(selection).x(p1:p2);
+								A(selection).y=A(selection).y(p1:p2);
+								numpoints=numpoints-(numpoints-1-p2)-(p1-1);
+								if closed(selection)
+									%reattach the tips
+									A(selection).x(end+1)=A(selection).x(1);
+									A(selection).y(end+1)=A(selection).y(1);
+									numpoints=numpoints+1;
+								end
+								loop=0;
+							end
+						else
+							if p3>p2 & p3<p1
+								A(selection).x(p2+1:p1-1)=[];
+								A(selection).y(p2+1:p1-1)=[];
+								numpoints=numpoints-(p1-p2-1);
+								loop=0;
+
+							else
+								A(selection).x=A(selection).x(p2:p1);
+								A(selection).y=A(selection).y(p2:p1);
+								numpoints=numpoints-(numpoints-1-p1)-(p2-1);
+								if closed(selection)
+									%reattach the tips
+									A(selection).x(end+1)=A(selection).x(1);
+									A(selection).y(end+1)=A(selection).y(1);
+									numpoints=numpoints+1;
+								end
+								loop=0;
+							end
+						end
+					end
+				end
+			end
+		else
+			%RETRUN-> quit
+			loop=0;
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/manipulation/undoplots.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/manipulation/undoplots.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/manipulation/undoplots.m	(revision 1)
@@ -0,0 +1,12 @@
+function  undoplots(prevplot)
+%UNDOPLOTS - undo plots
+%
+%   Usage:undoplots(prevplot)
+
+	%erase all previous plots
+	g=get(gca,'children');
+	L=length(g);
+	for i=1:L-prevplot
+		delete(g(i));
+	end
+end
Index: /issm/trunk/src/m/utils/Exp/readwrite/expread.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/expread.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/readwrite/expread.m	(revision 1)
@@ -0,0 +1,58 @@
+function struct=expread(name,whole);
+%EXPREAD - read a file exp and build a structure
+%
+%   This routine reads a file .exp and build a structure containing the 
+%   fields x and y corresponding to the coordinates, one for the name of
+%   the exp file, for the density, for the nodes, and a field closed to 
+%   indicate if the domain is closed. 
+%   The first argument is the .exp file to be read and the second one 
+%   indicate if the last point shall be read (1 to read it, 0 not to).
+%
+%   Usage:
+%      struct=expread(name,whole)
+%  
+%   Example:
+%      struct=expread('domainoutline.exp',1)
+%
+%   See also EXPDOC, EXPWRITEASVERTICES
+
+try,
+fid=fopen(name,'r');
+i=0;
+while (~feof(fid)),
+   i=i+1;
+   %firt line contains the name
+   A=readline(fid,2);
+   if length(A)>8, 
+       struct(i).name=A(9:length(A));
+   end
+
+   A=readline(fid,2);
+   A=readline(fid,4);
+
+   [A,bytecount]=fscanf(fid,'%f %f',[1 2]);
+   if whole==1,
+       struct(i).nods=A(1);
+   else
+       struct(i).nods=A(1)-1;
+   end
+   struct(i).density=A(2);
+   A=readline(fid,5);
+
+   struct(i).x=zeros(struct(i).nods,1);
+   struct(i).y=zeros(struct(i).nods,1);
+   struct(i).closed=0;
+
+   for n=1:struct(i).nods,
+       [A,bytecount]=fscanf(fid,'%f %f',[1 2]);
+       struct(i).x(n)=A(1);
+       struct(i).y(n)=A(2);
+   end
+   if whole==0,
+       fscanf(fid,'%f %f',[1 2]);
+   end
+
+end
+catch,
+end
+fclose(fid);
Index: /issm/trunk/src/m/utils/Exp/readwrite/expwrite.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/expwrite.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/readwrite/expwrite.m	(revision 1)
@@ -0,0 +1,37 @@
+function expwrite(a,filename);
+%EXPWRITE - write an Argus file from a structure given in input
+%
+%   This routine write an Argus file form a structure containing the fields:
+%   x and y of the coordinates of the points.
+%   The first argument is the structure containing the points coordinates 
+%   and the second one the file to be write.
+%
+%   Usage:
+%      expwrite(a,filename)
+% 
+%   Example:
+%      expwrite(coordstruct,'domainoutline.exp')
+%
+%   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
+
+fid=fopen(filename,'w');
+for n=1:length(a),
+   
+   if ~isempty(a(n).name),
+	   fprintf(fid,'%s%s\n','## Name:',a(n).name);
+   else
+	   fprintf(fid,'%s\n','## Name:');
+   end
+   
+   fprintf(fid,'%s\n','## Icon:0');
+   fprintf(fid,'%s\n','# Points Count  Value');
+   fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
+   fprintf(fid,'%s\n','# X pos Y pos');
+
+   for i=1:length(a(n).x),
+         fprintf(fid,'%f %f\n',[a(n).x(i) a(n).y(i)]);
+   end  
+   fprintf(fid,'\n','');
+   
+end
+fclose(fid);
Index: /issm/trunk/src/m/utils/Exp/readwrite/expwriteasvertices.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/expwriteasvertices.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/readwrite/expwriteasvertices.m	(revision 1)
@@ -0,0 +1,28 @@
+function expwriteasvertices(a,filename);
+%EXPWRITEASVERTIVES - write an Argus file from a structure given in input
+%
+%   This routine write an Argus file form a structure containing the fields:
+%   x and y of the coordinates of the points.
+%   The first argument is the structure containing the points coordinates 
+%   and the second one the file to be write.
+%
+%   Usage:
+%      expwriteasvertices(a,filename)
+% 
+%   Example:
+%      expwriteasvertices(coordstruct,'domainoutline.exp')
+%
+%   See also EXPDOC, EXPREAD, EXPWRITE
+
+fid=fopen(filename,'w');
+for n=1:length(a.x),
+   
+	fprintf(fid,'%s\n','## Name:');
+	fprintf(fid,'%s\n','## Icon:0');
+	fprintf(fid,'%s\n','# Points Count  Value');
+	fprintf(fid,'1 1.\n');
+	fprintf(fid,'%s\n','# X pos Y pos');
+	fprintf(fid,'%f %f\n\n',[a.x(n) a.y(n)]);
+
+end
+fclose(fid);
Index: /issm/trunk/src/m/utils/Exp/readwrite/newline.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/newline.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/readwrite/newline.m	(revision 1)
@@ -0,0 +1,8 @@
+function new_line(fid)
+%NEW_LINE - add a new line in a a file
+%
+%   Used by exp generators and readers. 
+%   DO NOT USE
+
+A='';
+fprintf(fid,'\n',A);
Index: /issm/trunk/src/m/utils/Exp/readwrite/put_file.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/put_file.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/readwrite/put_file.m	(revision 1)
@@ -0,0 +1,31 @@
+function put_file(a,file_name);
+%PUT_FILE - ???
+%
+%   Usage:
+%      put_file(a,file_name)
+
+fid=fopen(file_name,'wt');
+for n=1:length(a),
+   
+   newline(fid);
+   fprintf(fid,'%s %s\n','## Name:');
+   newline(fid);
+   fprintf(fid,'%s %s\n','## Icon:0');
+   newline(fid);
+   fprintf(fid,'%s %s %s %s\n','# Points Count Value');
+   newline(fid);
+   fprintf(fid,'%i %f\n',[length(a(n).x)+1 1]);
+   fprintf(fid,'%s %s %s %s %s\n','# X pos Y pos');
+   newline(fid);
+
+	for i=1:length(a(n).x),
+         fprintf(fid,'%f %f\n',[a(n).x(i) a(n).y(i)]);
+   end  
+   if n==length(a),
+      fprintf(fid,'%f %f',[a(n).x(1) a(n).y(1)]);
+   else
+      fprintf(fid,'%f %f\n',[a(n).x(1) a(n).y(1)]);
+   end
+
+end
+fclose(fid);
Index: /issm/trunk/src/m/utils/Exp/readwrite/read_file.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/read_file.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/readwrite/read_file.m	(revision 1)
@@ -0,0 +1,42 @@
+function struct=read_file(name,whole);
+%READ_FILE - ???
+%
+%   Usage:
+%      struct=read_file(name,whole)
+
+fid=fopen(name,'r');
+i=0;
+while (~feof(fid)),
+   i=i+1;
+   A=readline(fid,2);
+A=readline(fid,2);
+A=readline(fid,4);
+[A,bytecount]=fscanf(fid,'%i %f',[1 2]);
+if whole==1,
+   struct(i).nods=A(1);
+else
+   struct(i).nods=A(1)-1;
+end
+A=readline(fid,5);
+
+struct(i).x=zeros(struct(i).nods,1);
+struct(i).y=zeros(struct(i).nods,1);
+
+for n=1:struct(i).nods,
+   [A,bytecount]=fscanf(fid,'%f %f',[1 2]);
+   struct(i).x(n)=A(1);
+   struct(i).y(n)=A(2);
+end
+if whole==0,
+   fscanf(fid,'%f %f',[1 2]);
+end
+
+end
+fclose(fid);
+
+
+
+
+
+
+
Index: /issm/trunk/src/m/utils/Exp/readwrite/readfile.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/readfile.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/readwrite/readfile.m	(revision 1)
@@ -0,0 +1,14 @@
+function string=readfile(filename)
+%READFILE - ???
+%
+%   Usage:
+%      string=readfile(filename)
+
+string='';
+fid=fopen(filename);
+while(1),
+	tline=fgets(fid);
+	if ~ischar(tline), break, end
+	string=[string  tline];
+end
+fclose(fid);
Index: /issm/trunk/src/m/utils/Exp/readwrite/readline.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/readline.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/readwrite/readline.m	(revision 1)
@@ -0,0 +1,12 @@
+function B=readline(fid,n)
+%READLINE - ???
+%
+%   Usage:
+%      B=readline(fid,n)
+
+[B,bytecount]=fscanf(fid,'%s',[1]);
+for i=2:n,
+   [A,bytecount]=fscanf(fid,'%s',[1]);
+   B=[B ' ' A];
+ end
+
Index: /issm/trunk/src/m/utils/Exp/readwrite/writefile.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/writefile.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/readwrite/writefile.m	(revision 1)
@@ -0,0 +1,14 @@
+function writefile(filename,string)
+%WRITEFILE - write a file from a string
+%
+%   useful to recovert an exp file from md.domainoutline
+%
+%   Usage:
+%      writefile(filename,string)
+%
+%   Example:
+%      writefile('DomainOutline.exp',md.domainoutline)
+
+fid = fopen(filename,'wt');
+fprintf(fid,string);
+fclose(fid);
Index: /issm/trunk/src/m/utils/Exp/zinput.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/zinput.m	(revision 1)
+++ /issm/trunk/src/m/utils/Exp/zinput.m	(revision 1)
@@ -0,0 +1,211 @@
+function  [out_regs] = zinput(arg1)
+% ZINPUT - Graphical input from mouse with zoom
+%   
+%   [OUT_REGS] = ZINPUT(N) gets N points or regions from the
+%   current axes and returns the X- and Y-ranges in a length Nx4
+%   matrix OUT_REGS. 
+%   The cursor can be positioned using a mouse. Data points are entered by
+%   pressing the right mouse button, the region of the current axis
+%   are selected with the middle button, left button is for
+%   zooming,  single cklick zooms in, click-and drag zooms to
+%   region (and doubble-click should zoom out - feature pending).
+%   Any key on the keyboard except carriage return zooms out to the
+%   orignal axis except carriage return, which terminates the input
+%   before N points are entered.
+%   
+%   [OUT_REGS] = ZINPUT gathers an unlimited number of points until the
+%   return key is pressed.
+%   
+%   Usage:
+%      [out_regs] = zinput(arg1)
+%
+%   See also GINPUT
+
+% Copyright Bjorn Gustavsson 20050314
+
+ax0 = axis;
+out_regs = [];
+c = computer;
+if ~strcmp(c(1:2),'PC') 
+  tp = get(0,'TerminalProtocol');
+else
+  tp = 'micro';
+end
+
+if ~strcmp(tp,'none') & ~strcmp(tp,'x') & ~strcmp(tp,'micro') & 0,
+  % I dont know about this so better make short-cut and blindly try
+  % what works for X in all environments - sorry about that.
+else
+  
+  fig = gcf;
+  figure(gcf);
+  
+  if nargin == 0
+    how_many = inf;
+    b = [];
+  else
+    how_many = arg1;
+    b = [];
+    if  isstr(how_many) ...
+          | size(how_many,1) ~= 1 | size(how_many,2) ~= 1 ...
+          | ~(fix(how_many) == how_many) ...
+          | how_many < 0
+      error('Requires a positive integer.');
+    end
+    if how_many == 0
+      ptr_fig = 0;
+      while(ptr_fig ~= fig)
+        ptr_fig = get(0,'PointerWindow');
+      end
+      scrn_pt = get(0,'PointerLocation');
+      loc = get(fig,'Position');
+      pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+      out1 = pt(1); y = pt(2);
+    elseif how_many < 0
+      error('Argument must be a positive integer.');
+    end
+  end
+  
+  % Remove figure button functions
+  state = uisuspend(fig);
+  pointer = get(gcf,'pointer');
+  set(gcf,'pointer','fullcrosshair');
+  
+  fig_units = get(fig,'units');
+  char = 0;
+  while  size(out_regs,1) < how_many
+    % Use no-side effect WAITFORBUTTONPRESS
+    waserr = 0;
+    try
+      keydown = wfbp;
+    catch
+      waserr = 1;
+    end
+    if(waserr == 1)
+      if(ishandle(fig))
+        set(fig,'units',fig_units);
+        uirestore(state);
+        error('Interrupted');
+      else
+        error('Interrupted by figure deletion');
+      end
+    end
+    
+    ptr_fig = get(0,'CurrentFigure');
+    if(ptr_fig == fig)
+      if keydown
+        axis(ax0);
+        char = get(fig, 'CurrentCharacter');
+      else
+        char = get(fig, 'CurrentCharacter');
+        button = abs(get(fig, 'CurrentCharacter'));
+        
+        pnt = get(gcf,'currentpoint');
+        xy1 = get(gca,'currentpoint');
+        rbbox([pnt 0 0],pnt)
+        xy2 = get(gca,'currentpoint');
+        selection_type = get(gcf,'selectiontype');
+        
+        if all(xy1==xy2)
+          ax1 = axis;
+          
+          dx = abs(ax1(2)-ax1(1));
+          dy = abs(ax1(4)-ax1(3));
+          
+          xmin = max(ax1(1),xy1(1)-dx/4);
+          xmax = min(ax1(2),xy1(1)+dx/4);
+          ymin = max(ax1(3),xy1(1,2)-dy/4);
+          ymax = min(ax1(4),xy1(1,2)+dy/4);
+          zoom2ax = [xmin xmax ymin ymax];
+        else
+          %%% zoom to selected rectangle
+          zoom2ax = [sort([xy1(1,1) xy2(1,1)]) sort([xy1(1,2) xy2(1,2)])];
+        end
+        
+        switch selection_type
+         case 'normal'
+          axis(zoom2ax)
+          reg = [];
+         case 'alt'
+          reg = axis;
+          axis(ax0)
+         case 'extend'
+          reg = xy1(1,[1 1 2 2]);
+          axis(ax0)
+         otherwise %%% open (doubleclick in linux)
+          axis(ax0);
+          reg = [];
+        end
+      end
+      pt = get(gca, 'CurrentPoint');
+      
+      if (char == 'r')
+        rmi = size(out_regs,1);
+        if rmi > 0
+          out_regs(rmi,:) = [];
+        end
+        set(fig, 'CurrentCharacter','q')
+        char = 'q';
+        reg = [];
+      end
+      if(char == 13) % & how_many ~= 0)
+                     % if the return key was pressed, char will == 13,
+                     % and that's our signal to break out of here whether
+                     % or not we have collected all the requested data
+                     % points.  
+                     % If this was an early breakout, don't include
+                     % the <Return> key info in the return arrays.
+                     % We will no longer count it if it's the last input.
+        break;
+      end
+      
+      if ~isempty(reg)
+        out_regs = [out_regs;reg];
+      end
+    end
+    %[size(out_regs,1), how_many, size(out_regs,1) < how_many]
+  end
+  
+  uirestore(state);
+  set(gcf,'pointer','arrow');
+  set(fig,'units',fig_units);
+  set(fig, 'CurrentCharacter','q');
+  
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function key = wfbp
+%WFBP   Replacement for WAITFORBUTTONPRESS that has no side effects.
+
+fig = gcf;
+current_char = [];
+
+% Now wait for that buttonpress, and check for error conditions
+waserr = 0;
+try
+  h=findall(fig,'type','uimenu','accel','C');   % Disabling ^C for edit menu so the only ^C is for
+  set(h,'accel','');                            % interrupting the function.
+  keydown = waitforbuttonpress;
+  current_char = double(get(fig,'CurrentCharacter')); % Capturing the character.
+  if~isempty(current_char) & (keydown == 1)           % If the character was generated by the 
+    if(current_char == 3)                       % current keypress AND is ^C, set 'waserr'to 1
+      waserr = 1;                             % so that it errors out. 
+    end
+  end
+  
+  set(h,'accel','C');                                 % Set back the accelerator for edit menu.
+catch
+  waserr = 1;
+end
+drawnow;
+if(waserr == 1)
+  set(h,'accel','C');                                % Set back the accelerator if it errored out.
+  error('Interrupted');
+end
+
+selection_type = get(gcf,'selectiontype');
+if strcmp(selection_type,'open')
+  axis(ax0)
+end
+if nargout>0, key = keydown; end
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Index: /issm/trunk/src/m/utils/Find/locate.m
===================================================================
--- /issm/trunk/src/m/utils/Find/locate.m	(revision 1)
+++ /issm/trunk/src/m/utils/Find/locate.m	(revision 1)
@@ -0,0 +1,80 @@
+function locations = locate(varargin)
+%LOCATE Locate one or more files in the search path.
+%
+%   LOCATE FILEGLOB prints a list of all MATLAB files on the path that match
+%   FILEGLOB. Private subdirectories are also searched.
+%
+%   LIST = LOCATE(FILEGLOB) returns a list (cell array) of the files.  The list
+%   is not displayed.
+%
+%   Multiple filegobs may be given, e.g., LOCATE('*.m', '*.dll').
+%
+%   Note that the globbing is done by MATLAB and not by the operating system.
+%
+%   Examples:
+%
+%     locate *plot.m    - Find all files ending with 'plot.m'.
+%     locate im*        - Find all files starting with 'im'.
+%
+%   See also DIR, SYSGLOB.
+
+%   Author:      Peter J. Acklam
+%   Time-stamp:  2003-10-13 13:06:17 +0200
+%   E-mail:      pjacklam@online.no
+%   URL:         http://home.online.no/~pjacklam
+
+   % check number of input arguments
+   nargsin = nargin;
+   error(nargchk(1, Inf, nargsin));
+
+   dirs = path2cell;            % convert path to list
+   startdir = cd;               % get starting directory
+
+   display = 1;
+   if nargout                   % if there are output arguments
+      locations = {};           %   initialize output list
+      display = 0;              %   and don't display results
+   end
+
+   while length(dirs)           % while there are unprocessed dirs...
+
+      directory = dirs{1};      % get first directory
+      dirs = dirs(2:end);       %   and remove it from the list
+
+      % fprintf('%s\n', directory);
+      cd(directory);            % chdir to the directory
+
+      % get the list of file names that match the glob(s)
+      found = {};
+      for i = 1:nargsin
+         % dirinfo = dir(fullfile(directory,varargin{i}));
+         dirinfo = dir(varargin{i});
+         found = { found{:} dirinfo.name };
+      end
+
+      cd(startdir);             % chdir back to starting directory
+
+      % Append list of files found in this directory to the main list or
+      % display the files if no output is wanted.
+      if ~isempty(found)
+         % get unique list of files
+         found = unique(found);
+
+         % prepend directory name
+         for i = 1:length(found)
+            found{i} = fullfile(directory, found{i});
+         end
+         if nargout
+            locations = [ locations(:) ; found(:) ];
+         else
+            fprintf('%s\n', found{:});
+         end
+      end
+
+      % If this directory has a private subdirectory, look there too.
+      subdirectory = fullfile(directory, 'private');
+      if exist(subdirectory, 'dir')
+         dirs = { subdirectory , dirs{:} }';
+      end
+
+   end
Index: /issm/trunk/src/m/utils/Geometry/SegIntersect.m
===================================================================
--- /issm/trunk/src/m/utils/Geometry/SegIntersect.m	(revision 1)
+++ /issm/trunk/src/m/utils/Geometry/SegIntersect.m	(revision 1)
@@ -0,0 +1,80 @@
+function bool=SegIntersect(seg1,seg2)
+%SEGINTERSECT - test of segments intersection
+%
+%   return 1 if the two segments intersect
+%   seg1=[x1 y1; x2 y2]
+%
+%   Usage:
+%      bool=SegIntersect(seg1,seg2)
+
+bool=1;
+
+xA=seg1(1,1); yA=seg1(1,2);
+xB=seg1(2,1); yB=seg1(2,2);
+xC=seg2(1,1); yC=seg2(1,2);
+xD=seg2(2,1); yD=seg2(2,2);
+
+O2A=[xA;yA]-[xD/2+xC/2;yD/2+yC/2];
+O2B=[xB;yB]-[xD/2+xC/2;yD/2+yC/2];
+O1C=[xC;yC]-[xA/2+xB/2;yB/2+yA/2];
+O1D=[xD;yD]-[xA/2+xB/2;yB/2+yA/2];
+
+n1=[yA-yB;xB-xA]; %normal vector to segA
+n2=[yC-yD;xD-xC]; %normal vectot to segB
+
+test1=n2'*O2A;
+test2=n2'*O2B;
+
+if test1*test2>0
+	bool=0;
+	return;
+end
+
+test3=n1'*O1C;
+test4=n1'*O1D;
+
+if test3*test4>0
+	bool=0;
+	return;
+end
+
+%if colinear
+if test1*test2==0 & test3*test4==0 & det([n1 n2])==0
+
+	%projection on the axis O1O2
+	O2O1=[xA/2+xB/2;yB/2+yA/2]-[xD/2+xC/2;yD/2+yC/2];
+	O1A=O2O1'*(O2A-O2O1);
+	O1B=O2O1'*(O2B-O2O1);
+	O1C=O2O1'*O1C;
+	O1D=O2O1'*O1D;
+	
+	%test if one point is included in the other segment (->bool=1)
+	if (O1C-O1A)*(O1D-O1A)<0
+		bool=1;
+		return;
+	end
+	if (O1C-O1B)*(O1D-O1B)<0
+		bool=1;
+		return;
+	end
+	if (O1A-O1C)*(O1B-O1C)<0
+		bool=1;
+		return;
+	end
+	if (O1A-O1D)*(O1B-O1D)<0
+		bool=1;
+		return;
+	end
+
+	 %test if the 2 segments have the same middle (->bool=1)
+	if O2O1==0
+		bool=1;
+		return;
+	end
+
+	%else
+	bool=0;
+	return;
+
+end
+
Index: /issm/trunk/src/m/utils/Geometry/find_point.m
===================================================================
--- /issm/trunk/src/m/utils/Geometry/find_point.m	(revision 1)
+++ /issm/trunk/src/m/utils/Geometry/find_point.m	(revision 1)
@@ -0,0 +1,11 @@
+function f=find_point(tabx,taby,pointx,pointy)
+%FIND_POINT - find closest point
+%
+%   find which point of the list (tabx,taby) is
+%   the closest to (poinx,pointy)
+%
+%   Usage:
+%      f=find_point(tabx,taby,pointx,pointy)
+
+distance=sqrt((tabx-pointx).^2+(taby-pointy).^2);
+f=find(distance==min(min(distance)));
Index: /issm/trunk/src/m/utils/Hulls/inhull.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/inhull.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/inhull.m	(revision 1)
@@ -0,0 +1,173 @@
+function in = inhull(testpts,xyz,tess,tol)
+%INHULL - tests if a set of points are inside a convecx hull
+%
+% inhull: tests if a set of points are inside a convex hull
+% usage: in = inhull(testpts,xyz)
+% usage: in = inhull(testpts,xyz,tess)
+% usage: in = inhull(testpts,xyz,tess,tol)
+%
+% arguments: (input)
+%  testpts - nxp array to test, n data points, in p dimensions
+%       If you have many points to test, it is most efficient to
+%       call this function once with the entire set.
+%
+%  xyz - mxp array of vertices of the convex hull, as used by
+%       convhulln.
+%
+%  tess - tessellation (or triangulation) generated by convhulln
+%       If tess is left empty or not supplied, then it will be
+%       generated.
+%
+%  tol - (OPTIONAL) tolerance on the tests for inclusion in the
+%       convex hull. You can think of tol as the distance a point
+%       may possibly lie outside the hull, and still be perceived
+%       as on the surface of the hull. Because of numerical slop
+%       nothing can ever be done exactly here. I might guess a
+%       semi-intelligent value of tol to be
+%
+%         tol = 1.e-13*mean(abs(xyz(:)))
+%
+%       In higher dimensions, the numerical issues of floating
+%       point arithmetic will probably suggest a larger value
+%       of tol.
+%
+%       DEFAULT: tol = 0
+%
+% arguments: (output)
+%  in  - nx1 logical vector
+%        in(i) == 1 --> the i'th point was inside the convex hull.
+%  
+% Example usage: The first point should be inside, the second out
+%
+%  xy = randn(20,2)
+%  tess = convhull(xy(:,1),xy(:,2));
+%  testpoints = [ 0 0; 10 10];
+%  in = inhull(testpts,xyz,tess)
+%
+% in = 
+%      1
+%      0
+%
+% A non-zero count of the number of degenerate simplexes in the hull
+% will generate a warning (in 4 or more dimensions.) This warning
+% may be disabled off with the command:
+%
+%   warning('off','inhull:degeneracy')
+%
+% See also: convhull, convhulln, delaunay, delaunayn, tsearch, tsearchn
+%
+% Author: John D'Errico
+% e-mail: woodchips@rochester.rr.com
+% Release: 3.0
+% Release date: 10/26/06
+
+% get array sizes
+% m points, p dimensions
+p = size(xyz,2);
+[n,c] = size(testpts);
+if p ~= c
+  error 'testpts and xyz must have the same number of columns'
+end
+if p < 2
+  error 'Points must lie in at least a 2-d space.'
+end
+
+% was the convex hull supplied?
+if (nargin<3) || isempty(tess)
+  tess = convhulln(xyz);
+end
+[nt,c] = size(tess);
+if c ~= p
+  error 'tess array is incompatible with a dimension p space'
+end
+
+% was tol supplied?
+if (nargin<4) || isempty(tol)
+  tol = 0;
+end
+
+% build normal vectors
+switch p
+  case 2
+    % really simple for 2-d
+    nrmls = (xyz(tess(:,1),:) - xyz(tess(:,2),:)) * [0 1;-1 0];
+    
+    % Any degenerate edges?
+    del = sqrt(sum(nrmls.^2,2));
+    degenflag = (del<(max(del)*10*eps));
+    if sum(degenflag)>0
+      warning('inhull:degeneracy',[num2str(sum(degenflag)), ...
+        ' degenerate edges identified in the convex hull'])
+      
+      % we need to delete those degenerate normal vectors
+      nrmls(degenflag,:) = [];
+      nt = size(nrmls,1);
+    end
+  case 3
+    % use vectorized cross product for 3-d
+    ab = xyz(tess(:,1),:) - xyz(tess(:,2),:);
+    ac = xyz(tess(:,1),:) - xyz(tess(:,3),:);
+    nrmls = cross(ab,ac,2);
+    degenflag = repmat(false,nt,1);
+  otherwise
+    % slightly more work in higher dimensions, 
+    nrmls = zeros(nt,p);
+    degenflag = repmat(false,nt,1);
+    for i = 1:nt
+      % just in case of a degeneracy
+      nullsp = null(xyz(tess(i,2:end),:) - repmat(xyz(tess(i,1),:),p-1,1))';
+      if size(nullsp,1)>1
+        degenflag(i) = true;
+        nrmls(i,:) = NaN;
+      else
+        nrmls(i,:) = nullsp;
+      end
+    end
+    if sum(degenflag)>0
+      warning('inhull:degeneracy',[num2str(sum(degenflag)), ...
+        ' degenerate simplexes identified in the convex hull'])
+      
+      % we need to delete those degenerate normal vectors
+      nrmls(degenflag,:) = [];
+      nt = size(nrmls,1);
+    end
+end
+
+% scale normal vectors to unit length
+nrmllen = sqrt(sum(nrmls.^2,2));
+nrmls = nrmls.*repmat(1./nrmllen,1,p);
+
+% center point in the hull
+center = mean(xyz,1);
+
+% any point in the plane of each simplex in the convex hull
+a = xyz(tess(~degenflag,1),:);
+
+% ensure the normals are pointing inwards
+dp = sum((repmat(center,nt,1) - a).*nrmls,2);
+k = dp<0;
+nrmls(k,:) = -nrmls(k,:);
+
+% We want to test if:  dot((x - a),N) >= 0
+% If so for all faces of the hull, then x is inside
+% the hull. Change this to dot(x,N) >= dot(a,N)
+aN = sum(nrmls.*a,2);
+
+% test, be careful in case there are many points
+in = repmat(false,n,1);
+
+% if n is too large, we need to worry about the
+% dot product grabbing huge chunks of memory.
+memblock = 1e6;
+blocks = max(1,floor(n/(memblock/nt)));
+aNr = repmat(aN,1,length(1:blocks:n));
+for i = 1:blocks
+   j = i:blocks:n;
+   if size(aNr,2) ~= length(j),
+      aNr = repmat(aN,1,length(j));
+   end
+   in(j) = all((nrmls*testpts(j,:)' - aNr) >= -tol,1)';
+end
+
+
+
Index: /issm/trunk/src/m/utils/Hulls/insidehull.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/insidehull.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/insidehull.m	(revision 1)
@@ -0,0 +1,18 @@
+function bool=insidehull(X,Y,target);
+%INSIDEHULL - return wheter target belongs to the convex hull of X,Y or not.
+%
+%   Usage:
+%      bool=insidehull(X,Y,target)
+
+%INPUT X,Y, target
+X_exp=[X;target(1)];
+Y_exp=[Y;target(2)];
+
+K=convhull(X,Y);
+K_exp=convhull(X_exp,Y_exp);
+K_area=polyarea(X(K),Y(K));
+K_exp_area=polyarea(X_exp(K_exp),Y_exp(K_exp));
+
+bool=(K_exp_area<=K_area);
+
+
Index: /issm/trunk/src/m/utils/Hulls/interval.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/interval.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/interval.m	(revision 1)
@@ -0,0 +1,37 @@
+function [is,in,un] = interval(x1,x2)
+%INTERVAL - compute intersection and union of interval
+%
+% Intersection and union of 2 intervals.
+%	[IS,IN,UN] = INTERVAL(X1,X2) calculates pair-wise
+%	intersection IN and union UN of N pairs of
+%	intervals with coordinates X1 and X2 (both are
+%	2 by N vectors). Returns 1 by N boolean vector IS
+%	equal to 1 if intervals have non-empty intersection
+%	and 0 if they don't.
+%
+%  Copyright (c) 1995 by Kirill K. Pankratov,
+%       kirill@plume.mit.edu.
+%       08/24/95
+
+ % Handle input ...........................
+if nargin==0, help interval, return, end
+if nargin==1
+  un = x1;
+else
+  un = [x1; x2];
+end
+
+[in,un] = sort(un);     % Sort both intervals together
+un = un(1:2,:)-1;
+is = sum(floor(un/2));  % Check for [0 0 1 1] or [1 1 0 0]
+is = (is==1);
+ii = find(in(2,:)==in(3,:));
+is(ii) = .5*ones(size(ii));
+
+ % Extract intersection and union from sorted coordinates
+if nargout>1
+  un = in([1 4],:);
+  in = in(2:3,:);
+  in(:,~is) = flipud(in(:,~is));
+end
+
Index: /issm/trunk/src/m/utils/Hulls/intsecl.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/intsecl.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/intsecl.m	(revision 1)
@@ -0,0 +1,166 @@
+function [xo,yo] = intsecl(x1,y1,x2,y2,tol)
+%INTSECL - Intersection coordinates of two line segments.
+%
+%       [XI,YI] = INTSECL(X1,Y1,X2,Y2) where all 4
+%	arguments are 2 by N matrices with coordinates
+%	of ends of N pairs of line segments (so that 
+%       the command such as PLOT(X1,Y1,X2,Y2) will plot 
+%       these pairs of lines).
+%       Returns 1 by N vectors XI and YI consisting of 
+%       coordinates of intersection points of each of N
+%	pairs of lines.
+%
+%	Special cases:
+%	When a line segment is degenerate into a point
+%	and does not lie on line through the other segment
+%	of a pair returns XI=NaN while YI has the following
+%	values: 1 - when the first segment in a pair is
+%	degenerate, 2 - second segment, 0 - both segments
+%	are degenerate.
+%	When a pair of line segments is parallel, returns
+%	XI = Inf while YI is 1 for coincident lines,
+%	0 - for parallel non-coincident ones.
+%	INTSECL(X1,Y1,X2,Y2,TOL) also specifies tolerance
+%	in detecting coincident points in different line
+%	segments.
+%
+%  Copyright (c) 1995 by Kirill K. Pankratov
+%       kirill@plume.mit.edu
+%       04/15/94, 08/14/94, 05/10/95, 08/23/95
+ 
+
+ % Defaults and parameters .........................
+tol_dflt = 0; % Tolerance for coincident points
+is_chk = 1;   % Check input arguments
+
+ % Handle input ....................................
+if nargin==0, help intsecl, return, end
+if nargin<4           % Check if all 4 entered
+  error('  Not enough input arguments')
+end
+if nargin<5, tol = tol_dflt; end
+if tol < 0, is_chk = 0; tol = 0; end
+
+ % Check the format of arguments .......
+if is_chk
+  [x1,y1,x2,y2] = linechk(x1,y1,x2,y2);
+end
+
+
+ % Auxillary
+o2 = ones(2,1);
+i_pt1 = []; i_pt2 = []; i_pt12 = [];
+
+ % Make first points origins ...........
+xo = x1(1,:);
+yo = y1(1,:);
+x2 = x2-xo(o2,:);
+y2 = y2-yo(o2,:);
+
+ % Differences of first segments .......
+a = x1(2,:)-x1(1,:);
+b = y1(2,:)-y1(1,:);
+s = sqrt(a.^2+b.^2);  % Lengths of first segments
+i_pt1 = find(~s);
+s(i_pt1) = ones(size(i_pt1));
+rr = rand(size(i_pt1));
+a(i_pt1) = cos(rr);
+b(i_pt1) = sin(rr);
+
+ % Normalize by length .................
+a = a./s; b = b./s;
+
+ % Rotate coordinates of the second segment
+tmp = x2.*a(o2,:)+y2.*b(o2,:);
+y2 = -x2.*b(o2,:)+y2.*a(o2,:);
+x2 = tmp;
+
+ % Calculate differences in second segments
+s = x2(2,:)-x2(1,:);
+tmp = y2(2,:)-y2(1,:);
+cc = tmp(i_pt1);
+
+ % Find some degenerate cases .......................
+
+ % Find zeros in differences
+izy2 = find(~tmp);
+tmp(izy2) = ones(size(izy2));
+
+ % Find degenerate and parallel segments
+bool = ~s(izy2);
+i_par = izy2(~bool);
+i_pt2 = izy2(bool);
+
+bool = abs(y2(1,i_pt2))<=tol;
+i_pt2_off = i_pt2(~bool);
+i_pt2_on = i_pt2(bool);
+
+if ~isempty(i_par)
+  bool = abs(y2(1,i_par))<=tol;
+  i_par_off = i_par(~bool);
+  i_par_on = i_par(bool);
+end
+
+ % Calculate intercept with rotated x-axis ..........
+tmp = s./tmp;   % Slope
+tmp = x2(1,:)-y2(1,:).*tmp;
+
+
+ % Rotate and translate back to original coordinates
+xo = tmp.*a+xo;
+yo = tmp.*b+yo;
+
+ % Mark special cases ...................................
+ % First segments are degenerate to points
+if ~isempty(i_pt1)
+  bool = ~s(i_pt1) & ~cc;
+  i_pt12 = i_pt1(bool);
+  i_pt1 = i_pt1(~bool);
+
+  bool = abs(tmp(i_pt1))<=tol;
+  i_pt1_on = i_pt1(bool);
+  i_pt1_off = i_pt1(~bool);
+
+  xo(i_pt1_on) = x1(1,i_pt1_on);
+  yo(i_pt1_on) = y1(1,i_pt1_on);
+
+  oo = ones(size(i_pt1_off));
+  xo(i_pt1_off) = nan*oo;
+  yo(i_pt1_off) = oo;
+end
+
+ % Second segments are degenerate to points ...
+if ~isempty(i_pt2)
+  oo = ones(size(i_pt2_off));
+  xo(i_pt2_off) = nan*oo;
+  yo(i_pt2_off) = 2*oo;
+end
+
+ % Both segments are degenerate ...............
+if ~isempty(i_pt12)
+  bool = x1(i_pt12)==xo(i_pt12);
+  i_pt12_on = i_pt12(bool);
+  i_pt12_off = i_pt12(~bool);
+
+  xo(i_pt12_on) = x1(1,i_pt12_on);
+  yo(i_pt12_on) = y1(1,i_pt12_on);
+
+  oo = ones(size(i_pt12_off));
+  xo(i_pt12_off) = nan*oo;
+  yo(i_pt12_off) = 0*oo;
+end
+
+ % Parallel segments .........................
+if ~isempty(i_par)
+  oo = ones(size(i_par_on));
+  xo(i_par_on) = inf*oo;
+  yo(i_par_on) = oo;
+
+  oo = ones(size(i_par_off));
+  xo(i_par_off) = inf*oo;
+  yo(i_par_off) = 0*oo;
+end
+
+
+
+
Index: /issm/trunk/src/m/utils/Hulls/intsecpl.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/intsecpl.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/intsecpl.m	(revision 1)
@@ -0,0 +1,173 @@
+function  [xo,yo] = intsecpl(xv,yv,xl,yl,trace)
+%INTSECPL - Intersection of a polygon and a line.
+%
+%	[XI,YI] = INTSECPL(XV,YV,XL,YL) calculates
+%	intersections XI, YI of a polygon with vertices XV,
+%	YV and a line specified by pairs of end coordinates
+%	XL = [XL0 XL1], YL = [YL0 YL1]. Line is assumed to
+%	continue beyond the range of end points.
+%	INTSECPL(XV,YV,[A B]) uses another specification for
+%	a line: Y = A*X+B.
+%
+%	If a line does not intersect polygon, returns empty
+%	XI, YI.
+%	For convex polygon maximum number of intersections is
+%	2, for non-convex polygons multiple intersections are 
+%	possible.
+%
+%	INTSECPL(XV,YV,XL,YL)  by itself or
+%	[XI,YI] = INTSECPL(XV,YV,XL,YL,1) plots polygon,
+%	a line segment and intersection segment(s) 
+%	(part(s) of the same line inside the polygon).
+%
+%  Copyright (c) 1995 by Kirill K. Pankratov,
+%       kirill@plume.mit.edu.
+%       06/25/95, 08/27/95, 09/27/95
+%
+%  Calls ISCROSS, INTSECL programs.
+
+
+ % Defaults and parameters .................................
+tol = 1e-14;  % Tolerance
+marg = tol;   % Margins for polygon frame
+is_ab = 0;    % Default A*X+B  mode
+
+ % Handle input ............................................
+if nargin==0, help intsecpl, return, end
+if nargin < 3
+  error(' Not enough input arguments')
+end
+if nargin<5, trace = 0; end
+if nargin==4  % Check if 4-th arg is trace
+  if max(size(yl))==1, trace = yl;  is_ab = 1; end
+end
+if nargin==3, is_ab = 1; end
+trace = trace | nargin<2;
+if length(xv)~=length(yv)
+  error(' Vectors X, Y must have the same size')
+end
+
+ % Auxillary ...........
+xv = [xv(:); xv(1)];
+yv = [yv(:); yv(1)];
+ii = find(abs(diff(xv))<tol & abs(diff(yv))<tol);
+xv(ii) = []; yv(ii) = [];
+nv = length(xv);
+ov = ones(nv-1,1);
+
+
+  % Polygon frame
+lim = [min(xv)-marg max(xv)+marg min(yv)-marg max(yv)+marg];
+ % Estimate for diameter
+d = sqrt((lim(2)-lim(1)).^2+(lim(4)-lim(3)).^2);
+
+
+ % Form line segment depending on how line is specified 
+if is_ab       % A*X+B  mode ...................
+
+  xl = xl(:);
+  if length(xl)<2
+    error(' Line is specified by at least two parameters')
+  end
+
+  a = xl(1); b = xl(2);
+  xl = [lim(1)-1 lim(2)+1];
+  yl = a*xl+b;
+
+else          % [X1 X2],[Y1 Y2]  mode ..........
+
+  x0 = (xl(1)+xl(2))/2;
+  y0 = (yl(1)+yl(2))/2;
+  dx = xl(2)-x0;
+  dy = yl(2)-y0;
+  dl = max(abs([lim(1:2)-x0 lim(3:4)-y0]));
+  d = max(d,dl);
+  dl = sqrt(dx.^2+dy.^2);
+  dl = max(d,d/dl);
+  dx = dx*dl; dy = dy*dl;
+  xl = [x0-dx x0+dx];
+  yl = [y0-dy y0+dy];
+
+end
+
+
+ % Find intersecting segments ..............................
+is = iscross([xv(1:nv-1) xv(2:nv)]',[yv(1:nv-1) yv(2:nv)]',...
+             xl(ov,:)',yl(ov,:)',0);
+
+
+ % Quick exit if no intersections .........................
+if ~any(is)
+  if trace
+    % Intersection with polygon frame
+    [xl,yl] = intsecpl(lim([1 2 2 1]),lim([3 3 4 4]),xl,yl);
+    plot(xv,yv,xl,yl) % Plotting itself
+  end
+  xo = []; yo = []; 
+  return
+end
+
+
+ % For segments touching the line (is==.5) find whether pairs of
+ % successive segments are on the same side
+ii = find(is==.5)';
+if ~isempty(ii)
+  xo = [ii-1 ii+1];
+  xo = xo+(nv-1)*(xo<1);
+  yo = iscross([xv(xo(:,1)) xv(xo(:,2))]',[yv(xo(:,1)) yv(xo(:,2))]',...
+       xl,yl,tol);
+  ii = ii(find(yo==1));
+  is(ii) = zeros(size(ii));
+end
+
+
+ % Calculate intersection coordinates ......................
+ii = find(is);
+oi = ones(size(ii));
+[xo,yo] = intsecl([xv(ii) xv(ii+1)]',[yv(ii) yv(ii+1)]',...
+                  xl(oi,:)',yl(oi,:)');
+
+dx = find(~finite(xo));
+xo(dx) = []; yo(dx) = [];
+ii(dx) = []; oi(dx) = [];
+
+
+ % Sort intersections along the line ..........
+xo = xo(:); yo = yo(:);
+if any(diff(xo))
+  [xo,ii] = sort(xo);
+  yo = yo(ii);
+
+else
+
+  [yo,ii] = sort(yo);
+  xo = xo(ii);
+end
+
+ % Exclude repeated points (degenerate cases)
+ % ///////// It seems that this is not needed, figure this
+ % later ///////////////////
+if length(ii)>1 & 0  % Do not execute
+  xx = [xo yo];
+  yy = diff(xx)';
+  ii = [1 find(any(abs(yy)>tol))+1];
+  xo = xx(ii,1); yo = xx(ii,2);
+  oi = ones(size(xo));
+end
+
+
+ % Plotting ................................................
+if trace
+  oi(3:2:length(oi)) = oi(3:2:length(oi))+1;
+  oi = cumsum(oi);
+  len = max(oi);
+  xp = nan*ones(len,1); yp = xp;
+  xp(oi) = xo;
+  yp(oi) = yo;
+
+  % Intersection with polygon frame
+  [xl,yl] = intsecpl(lim([1 2 2 1]),lim([3 3 4 4]),xl,yl);
+
+  plot(xv,yv,xl,yl,xp,yp) % Plotting itself
+end
+
Index: /issm/trunk/src/m/utils/Hulls/iscross.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/iscross.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/iscross.m	(revision 1)
@@ -0,0 +1,114 @@
+function [is,S] = iscross(x1,y1,x2,y2,tol)
+%ISCROSS - Finds whether pairs of lines cross each other
+%
+%	[IS,S] = ISCROSS(X1,Y1,X2,Y2) where arguments X1, Y1,
+%	X2, Y2 are all 2 by N matrices are coordinates of
+%	ends of the pairs of line segments.
+%	Returns vector  IS (1 by N)  consisting of ones if 
+%	corresponding pairs cross each other, zeros if they 
+%	don't and .5 if an end of one line segment lies on
+%	another segment.
+%	Also returns a matrix  S (4 by N) with each row 
+%	consisting of cross products (double areas of 
+%	corresponding triangles) built on the following points:
+%	(X2(1,:),Y2(1,:)),(X1(1,:),Y1(1,:)),(X2(2,:),Y2(2,:)),
+%	(X2(1,:),Y2(1,:)),(X1(2,:),Y1(2,:)),(X2(2,:),Y2(2,:))
+%	(X1(1,:),Y1(1,:)),(X2(1,:),Y2(1,:)),(X1(2,:),Y1(2,:))
+%	(X1(1,:),Y1(1,:)),(X2(2,:),Y2(2,:)),(X1(2,:),Y1(2,:))
+%	The signs of these 4 areas can be used to determine
+%	whether these lines and their continuations cross each
+%	other.
+%	[IS,S] = ISCROSS(X1,Y1,X2,Y2,TOL) uses tolerance TOL
+%	for detecting the crossings (default is 0).
+%
+%  Copyright (c) 1995 by Kirill K. Pankratov
+%       kirill@plume.mit.edu
+%       08/14/94, 05/18/95, 08/25/95
+
+ % Defaults and parameters .......................
+tol_dflt = 0; % Tolerance for area calculation
+is_chk = 1;   % Check input arguments
+
+ % Handle input ..................................
+if nargin==0, help iscross, return, end
+if nargin<4           % Check if all 4 entered
+  error('  Not enough input arguments')
+end
+if nargin<5, tol = tol_dflt; end
+if tol < 0, is_chk = 0; tol = 0; end
+
+ % Check the format of arguments .................
+if is_chk
+  [x1,y1,x2,y2] = linechk(x1,y1,x2,y2);
+end
+
+len = size(x1,2);
+o2 = ones(2,1);
+
+ % Find if the ranges of pairs of segments intersect
+[isx,S,A] = interval(x1,x2);
+scx = diff(A);
+[isy,S,A] = interval(y1,y2);
+scy = diff(A);
+is = isx & isy;
+
+ % If S values are not needed, extract only those pairs
+ % which have intersecting ranges ..............
+if nargout < 2
+  isx = find(is);  % Indices of pairs to be checked
+                   % further
+  x1 = x1(:,isx);
+  x2 = x2(:,isx);
+  y1 = y1(:,isx);
+  y2 = y2(:,isx);
+  is = is(isx);
+  if isempty(is), is = zeros(1,len); return, end
+  scx = scx(isx);
+  scy = scy(isx);
+end
+
+ % Rescale by ranges ...........................
+x1 = x1.*scx(o2,:);
+x2 = x2.*scx(o2,:);
+y1 = y1.*scy(o2,:);
+y2 = y2.*scy(o2,:);
+
+
+ % Calculate areas .............................
+S = zeros(4,length(scx));
+S(1,:) = (x2(1,:)-x1(1,:)).*(y2(2,:)-y1(1,:));
+S(1,:) = S(1,:)-(x2(2,:)-x1(1,:)).*(y2(1,:)-y1(1,:));
+
+S(2,:) = (x2(1,:)-x1(2,:)).*(y2(2,:)-y1(2,:));
+S(2,:) = S(2,:)-(x2(2,:)-x1(2,:)).*(y2(1,:)-y1(2,:));
+
+S(3,:) = (x1(1,:)-x2(1,:)).*(y1(2,:)-y2(1,:));
+S(3,:) = S(3,:)-(x1(2,:)-x2(1,:)).*(y1(1,:)-y2(1,:));
+
+S(4,:) = (x1(1,:)-x2(2,:)).*(y1(2,:)-y2(2,:));
+S(4,:) = S(4,:)-(x1(2,:)-x2(2,:)).*(y1(1,:)-y2(2,:));
+
+
+ % Find if they cross each other ...............
+is = (S(1,:).*S(2,:)<=0)&(S(3,:).*S(4,:)<=0);
+
+
+ % Find very close to intersection
+isy = min(abs(S));
+ii = find(isy<=tol & is);
+is(ii) = .5*ones(size(ii));
+
+ % Output
+if nargout < 2
+  isy = zeros(1,len);
+  isy(isx) = is;
+  is = isy;
+
+else
+  isy = scx.*scy;
+  ii = find(~isy);
+  isy(ii) = ones(size(ii));
+  S = S./isy(ones(4,1),:);
+
+end
+
Index: /issm/trunk/src/m/utils/Hulls/isinpoly.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/isinpoly.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/isinpoly.m	(revision 1)
@@ -0,0 +1,46 @@
+function  isin = isinpoly(x,y,xp,yp)
+%ISIN - indicate if points are inside or outside a polygon
+%
+% ISIN = ISINPOLY(X,Y,XP,YP)   Finds whether points with
+%           coordinates X and Y are inside or outside of
+%           a polygon with vertices XP, YP.
+%           Returns matrix ISIN of the same size as X and Y
+%           with 0 for points outside a polygon, 1 for
+%           inside points and  0.5 for points belonging
+%           to a polygon XP, YP itself.
+
+%  Copyright (c) 1995  by Kirill K. Pankratov
+%	kirill@plume.mit.edu
+%	4/10/94, 8/26/94.
+
+ % Handle input ::::::::::::::::::::::::::::::::
+if nargin<4
+  fprintf('\n  Error: not enough input arguments.\n\n')
+  return
+end
+
+ % Make the contour closed and get the sizes
+xp = [xp(:); xp(1)];
+yp = [yp(:); yp(1)];
+sz = size(x);
+x = x(:); y = y(:);
+
+lp = length(xp); l = length(x);
+ep = ones(1,lp); e = ones(1,l);
+
+ % Calculate cumulative change in azimuth from points x,y
+ % to all vertices
+A = diff(atan2(yp(:,e)-y(:,ep)',xp(:,e)-x(:,ep)'))/pi;
+A = A+2*((A<-1)-(A>1));
+isin = any(A==1)-any(A==-1);
+isin = (abs(sum(A))-isin)/2;
+
+ % Check for boundary points
+A = (yp(:,e)==y(:,ep)')&(xp(:,e)==x(:,ep)');
+fnd = find(any(A));
+isin(fnd) = .5*ones(size(fnd));
+isin = round(isin*2)/2;
+
+ % Reshape output to the input size
+isin = reshape(isin,sz(1),sz(2));
+
Index: /issm/trunk/src/m/utils/Hulls/isinpolylarge.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/isinpolylarge.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/isinpolylarge.m	(revision 1)
@@ -0,0 +1,18 @@
+function  isin = isinpolylarge(x,y,xp,yp)
+%ISINPOLYLARGE - indicate if points are inside a polygon
+%
+%   Usage:
+%      isin = isinpolylarge(x,y,xp,yp)
+%
+%   See also ISINPLOY
+
+size=10000;
+num=floor(length(x)/size);
+isin=zeros(length(x),1);
+
+for i=1:num,
+	disp(i);
+	isin((i-1)*size+1:i*size)=isinpoly(x((i-1)*size+1:i*size),y((i-1)*size+1:i*size),xp,yp);
+end
+isin(num*size+1:length(x))=isinpoly(x(num*size+1:length(x)),x(num*size+1:length(x)),xp,yp);
+
Index: /issm/trunk/src/m/utils/Hulls/ispolygon.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/ispolygon.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/ispolygon.m	(revision 1)
@@ -0,0 +1,37 @@
+function bool=ispolygon(x,y);
+%ISPOLYGON - indicate if an outline is a polygon or not
+%
+%   Usage:
+%      bool=ispolygon(x,y)
+
+bool=0;
+pairs_x=zeros(length(x),2);
+pairs_y=zeros(length(x),2);
+
+for i=1:length(x)-1,
+   pairs_x(i,:)=[x(i) x(i+1)];
+   pairs_y(i,:)=[y(i) y(i+1)];
+end
+pairs_x(length(x),:)=[x(length(x)) x(1)];
+pairs_y(length(x),:)=[y(length(x)) y(1)];
+
+for n=1:length(pairs_x)-1,
+
+	pair_nx=zeros(length(x)-n,2);
+   pair_ny=zeros(length(x)-n,2);
+   for j=n:length(x)-1,
+      pair_nx(j-n+1,:)=pairs_x(n,:);
+      pair_ny(j-n+1,:)=pairs_y(n,:);
+   end
+   test_x=pairs_x(n+1:length(x),:);
+   test_y=pairs_y(n+1:length(x),:);
+[IS,S]=iscross(pair_nx',pair_ny',test_x',test_y');
+bool=bool+length(find(IS==1));
+end
+if bool>=1,
+   bool=1;
+end
+
+bool=-bool;
+
+disp('Attention, ispolygon a ete modifie, retourne 1 si oui, 0 si non');
Index: /issm/trunk/src/m/utils/Hulls/linechk.m
===================================================================
--- /issm/trunk/src/m/utils/Hulls/linechk.m	(revision 1)
+++ /issm/trunk/src/m/utils/Hulls/linechk.m	(revision 1)
@@ -0,0 +1,49 @@
+function [x1,y1,x2,y2] = linechk(x1,y1,x2,y2)
+% LINECHK - input checking for line segments
+%
+%  Copyright (c) 1995 by Kirill K. Pankratov
+%       kirill@plume.mit.edu
+%       08/22/95,
+
+ % String for transposing
+str = ['x1=x1'';'; 'y1=y1'';'; 'x2=x2'';'; 'y2=y2'';'];
+
+ % Sizes
+sz = [size(x1); size(y1); size(x2); size(y2)]';
+psz = prod(sz);
+
+ % Check x1, y1
+if psz(1)~=psz(2)
+  error('  Arguments  x1 and y1 must have the same size')
+end
+
+ % Check x2, y2
+if psz(3)~=psz(3)
+  error('  Arguments  x2 and y2 must have the same size')
+end
+
+ % Check if any arguments are less than 2 by 1
+if any(max(sz)<2)
+  error('  Arguments  x1, y1, x2, y2 must be at least 2 by 1 vectors')
+end
+
+ % Check if no size is equal to 2
+if any(all(sz~=2))
+  error('  Arguments  x1, y1, x2, y2 must be 2 by 1 vectors')
+end
+
+ % Find aruments to be transposed .............................
+ii = find(sz(1,:)~=2);
+for jj = 1:length(ii)
+  eval(str(ii(jj),:)); % Transpose if neccessary
+end
+sz(:,ii) = flipud(sz(:,ii));
+
+ % If vectors, extend to 2 by n matrices ......................
+n = max(sz(2,:));
+on = ones(1,n);
+if sz(2,1)<n, x1 = x1(:,on); end
+if sz(2,2)<n, y1 = y1(:,on); end
+if sz(2,3)<n, x2 = x2(:,on); end
+if sz(2,4)<n, y2 = y2(:,on); end
+
Index: /issm/trunk/src/m/utils/ImageProcessing/gradient_perso.m
===================================================================
--- /issm/trunk/src/m/utils/ImageProcessing/gradient_perso.m	(revision 1)
+++ /issm/trunk/src/m/utils/ImageProcessing/gradient_perso.m	(revision 1)
@@ -0,0 +1,91 @@
+function [ax,ay ]=gradient_perso(a,dx,dy,n);
+%GRADIENT_PERSO - gradient computation
+%
+%   INPUT a,dx,dy,n where a is the scalar value, dx and dy the spacing of one pixel
+%   in a and n is the width wanted in the gradient computation, in pixels.
+%
+%   Usage:
+%      [ax,ay ]=gradient_perso(a,dx,dy,n)
+
+s=size(a);
+ax=zeros(s(1),s(2));
+ay=zeros(s(1),s(2));
+
+for k=n+1:s(1)-n,
+   if mod(k,10)==0,
+      disp(k/s(1)*100);
+   end
+   
+   for j=n+1:s(2)-n,
+      if isnan(a(k,j)),
+         ax(k,j)=NaN;
+         ay(k,j)=NaN;
+      else
+         temp=a(k,j);
+         temp2=a(k,j);
+         
+         count=1;
+         while ~isnan(a(k,j+count)),
+            temp=[temp a(k,j+count)];
+            count=count+1;
+            if count>n,
+               count=count-1;
+               break;
+            end
+            
+         end
+         count=1;
+         while ~isnan(a(k,j-count)),
+            temp=[a(k,j-count) temp];
+            count=count+1;
+            if count>n,
+               count=count-1;
+               break;
+            end
+            
+         end
+         
+         count=1;
+         while ~isnan(a(k+count,j)),
+            temp2=[temp2 a(k+count,j)];
+            count=count+1;
+               if count>n,
+               count=count-1;
+               break;
+            end
+         
+         end
+         count=1;
+         while ~isnan(a(k-count,j)),
+            temp2=[a(k-count,j) temp2];
+            count=count+1;
+               if count>n,
+               count=count-1;
+               break;
+            end
+         
+         end
+    	   
+         if length(temp)==1,
+            ax(k,j)=NaN;
+         else
+            ax(k,j)=(temp(length(temp))-temp(1))/(length(temp)-1)/dx;
+         end
+         
+         if length(temp2)==1,
+            ay(k,j)=NaN;
+         else
+            ay(k,j)=(temp2(length(temp2))-temp2(1))/(length(temp2)-1)/dy;
+         end
+         
+      end
+   end
+end
+
+         
+          
+          
+          
+          
+          
+      
Index: /issm/trunk/src/m/utils/ImageProcessing/im_resize.m
===================================================================
--- /issm/trunk/src/m/utils/ImageProcessing/im_resize.m	(revision 1)
+++ /issm/trunk/src/m/utils/ImageProcessing/im_resize.m	(revision 1)
@@ -0,0 +1,16 @@
+function newimg = im_resize(img,nw,nh)
+%IM_RESIZE - resize an image using bicubic interpolation
+%
+%   NEWIMG = IM_RESIZE(IMG,NW,NH) Given input image IMG,
+%   returns a new image NEWIMG of size NWxNH.
+%
+% Matthew Dailey 2000
+
+  if nargin ~= 3
+    error('usage: im_resize(image,new_wid,new_ht)');
+  end;
+  
+  ht_scale = size(img,1) / nh;
+  wid_scale = size(img,2) / nw;
+  
+  newimg = interp2(img,(1:nw)*wid_scale,(1:nh)'*ht_scale,'cubic');
Index: /issm/trunk/src/m/utils/ImageProcessing/mean_congrid.m
===================================================================
--- /issm/trunk/src/m/utils/ImageProcessing/mean_congrid.m	(revision 1)
+++ /issm/trunk/src/m/utils/ImageProcessing/mean_congrid.m	(revision 1)
@@ -0,0 +1,59 @@
+function res=mean_congrid(a,n,choice);
+%MEAN_CONGRID - average the values around a pixel
+%
+%   INPUT a,n,choice, where a is the matrix, and n the size of the area averaged around
+%   one pixel, odd number. choice=1 if the NaN values remain NaN values.
+%
+%   Usage:
+%      res=mean_congrid(a,n,choice)
+
+s=size(a);
+aa=a;
+pos=find(isnan(aa));
+aa(pos)=0;
+
+if (mod(n,2)==0),
+   disp('Cannot rebin, the dimensions of the matrix and n are not compatible');
+   break
+end
+mm=(n-1)/2;
+
+res=zeros(s(1),s(2));
+
+for m=mm+1:s(1)-mm,
+   if mod(m,10)==0,
+      disp(m/s(1)*100);
+   end
+   
+   for l=mm+1:s(2)-mm,
+      
+      
+      if sum(sum(~isnan(a(m-mm:m+mm,l-mm:l+mm))))~=0,
+      res(m,l)=sum(...
+                   sum(...
+                   ~isnan(...
+                          a(m-mm:m+mm,l-mm:l+mm)...
+                          ).*...
+                          aa(m-mm:m+mm,l-mm:l+mm)...
+                       )...
+                   )...
+                   /sum(sum(~isnan(a(m-mm:m+mm,l-mm:l+mm))));
+             else
+                res(m,l)=NaN;
+             end
+             
+   end
+end
+
+if choice==1,
+   pos=find(isnan(a));
+   res(pos)=NaN;
+end
+
+   
+
+
+
+
+
+
Index: /issm/trunk/src/m/utils/ImageProcessing/rebin.m
===================================================================
--- /issm/trunk/src/m/utils/ImageProcessing/rebin.m	(revision 1)
+++ /issm/trunk/src/m/utils/ImageProcessing/rebin.m	(revision 1)
@@ -0,0 +1,44 @@
+function res=rebin(a,n);
+%REBIN - average values of a matrix by bloc
+%
+%   INPUT a,n, where a is the matrix, and n the size of the area averaged around
+%   one pixel
+%
+%   Usage:
+%      res=rebin(a,n)
+
+s=size(a);
+
+if (mod(s(1)/n,2)~=0 | mod(s(2)/n,2)~=0),
+   disp('Cannot rebin, the dimensions of the matrix and n are not compatible');
+   break
+end
+
+res=zeros(s(1)/n,s(2)/n);
+
+for m=1:s(1)/n,
+   for l=1:s(2)/n,
+      if sum(sum(~isnan(a((m-1)*n+1:m*n,(l-1)*n+1:l*n))))~=0,
+      res(m,l)=sum(...
+                   sum(...
+                       ~isnan(...
+                              a((m-1)*n+1:m*n,(l-1)*n+1:l*n)...
+                              ).*...
+                       a((m-1)*n+1:m*n,(l-1)*n+1:l*n)...
+                       )...
+                   )...
+                   /sum(sum(~isnan(a((m-1)*n+1:m*n,(l-1)*n+1:l*n))));
+             else
+                res(m,l)=NaN;
+             end
+             
+   end
+end
+
+   
+
+
+
+
+
+
Index: /issm/trunk/src/m/utils/Interp/griddata_grid_to_mesh.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_grid_to_mesh.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_grid_to_mesh.m	(revision 1)
@@ -0,0 +1,95 @@
+function zp=griddata_grid_to_mesh(x_m,y_m,u,index,x,y);
+%GRIDDATA_GRID_TO_MESH - interpolates data from a grid to a mesh   
+%
+%   Usage:
+%      zp=griddata_grid_to_mesh(x_m,y_m,u,index,x,y)
+
+pos=find(isnan(u));
+for n=1:10,
+   pos=find(isnan(u));
+   u(pos)=u(pos+1);
+end
+
+zp=zeros(length(x),1);
+for n=1:length(x),
+   if mod(n,100)==0,
+      disp(['Count is ' num2str(n/length(x)*100)]);
+   end
+   
+   pos1=find((x_m-x(n))<0);
+   pos2=find((x_m-x(n))>0);
+   pos3=find((y_m-y(n))<0);
+   pos4=find((y_m-y(n))>0);
+   
+   if (isempty(pos1) | isempty(pos2) | isempty(pos3) | isempty(pos4)),
+      out_of_bounds=1;
+   else
+      out_of_bounds=0;
+   end
+   
+   if out_of_bounds==0,   
+   %first find where (x(n),y(n)) lies.
+   pos1=find((x_m-x(n))<0);
+   pos2=find((x_m-x(n))>0);
+   x_bound=[pos1(length(pos1)) pos2(1)];   
+   
+   pos1=find((y_m-y(n))<0);
+   pos2=find((y_m-y(n))>0);
+   y_bound=[pos1(length(pos1)) pos2(1)];
+  
+   
+   
+   %we look for a linear interpolation, therefore have to decide 
+   % in which triangle our point lies.
+   A=[x_m(x_bound(1)) y_m(y_bound(1))]';
+   u_A=u(x_bound(1),y_bound(1));
+   B=[x_m(x_bound(2)) y_m(y_bound(1))]';
+   u_B=u(x_bound(2),y_bound(1));
+   C=[x_m(x_bound(2)) y_m(y_bound(2))]';
+   u_C=u(x_bound(2),y_bound(2));
+   D=[x_m(x_bound(1)) y_m(y_bound(2))]';
+   u_D=u(x_bound(1),y_bound(2));
+   
+   
+   
+   res=(D(2)-B(2))*x(n)+(B(1)-D(1))*y(n)+D(1)*B(2)-D(2)*B(1);
+   if res>0,
+      xx=[B(1) C(1) D(1)];
+      yy=[B(2) C(2) D(2)];
+      uu=[u_B u_C u_D];
+      ind=[1 2 3];
+   else
+      xx=[A(1) B(1) D(1)];
+      yy=[A(2) B(2) D(2)];
+      uu=[u_A u_B u_D];
+      ind=[1 2 3];
+   end
+   
+   
+	alpha=zeros(1,3);
+	beta=zeros(1,3);
+	gamma=zeros(1,3);
+	X=inv([xx(ind(1,:))' yy(ind(1,:))' ones(3,1)]);
+	alpha(1,:)=X(1,:);
+	beta(1,:)=X(2,:);
+	gamma(1,:)=X(3,:);
+   
+   if length(find(isnan(uu)))==0,
+      zp(n)=sum(uu.*(alpha.*x(n)+beta.*y(n)+gamma));
+   else
+      if length(find(~isnan(uu)))==0,
+         zp(n)=NaN;
+         else
+         pos=find(~isnan(uu));
+         zp(n)=uu(pos(1));
+      end
+   end
+   
+   else
+   zp(n)=NaN;
+end
+
+   
+end
+%disp('Filling final gaps');
+%zp=void_fill(zp,x,y);
Index: /issm/trunk/src/m/utils/Interp/griddata_grid_to_mesh_completer.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_grid_to_mesh_completer.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_grid_to_mesh_completer.m	(revision 1)
@@ -0,0 +1,98 @@
+function zp=griddata_grid_to_mesh_completer(x_m,y_m,u,index,x,y,zp);
+%GRIDDATA_GRID_TO_MESH_COMPLETER - interpolates data from a grid to a mesh   
+%
+%   Usage:
+%      zp=griddata_grid_to_mesh_completer(x_m,y_m,u,index,x,y,zp)
+
+pos=find(isnan(u));
+for n=1:100,
+   pos=find(isnan(u));
+   u(pos)=u(pos+1);
+end
+
+imagesc(u)
+break
+
+zp=zeros(length(x),1);
+for n=1:length(x),
+   if mod(n,100)==0,
+      disp(['Count is ' num2str(n/length(x)*100)]);
+   end
+   
+   pos1=find((x_m-x(n))<0);
+   pos2=find((x_m-x(n))>0);
+   pos3=find((y_m-y(n))<0);
+   pos4=find((y_m-y(n))>0);
+   
+   if (isempty(pos1) | isempty(pos2) | isempty(pos3) | isempty(pos4)),
+      out_of_bounds=1;
+   else
+      out_of_bounds=0;
+   end
+   
+   if out_of_bounds==0,   
+   %first find where (x(n),y(n)) lies.
+   pos1=find((x_m-x(n))<0);
+   pos2=find((x_m-x(n))>0);
+   x_bound=[pos1(length(pos1)) pos2(1)];   
+   
+   pos1=find((y_m-y(n))<0);
+   pos2=find((y_m-y(n))>0);
+   y_bound=[pos1(length(pos1)) pos2(1)];   
+   
+   
+   %we look for a linear interpolation, therefore have to decide 
+   % in which triangle our point lies.
+   
+   A=[x_m(x_bound(1)) y_m(y_bound(1))]';
+   u_A=u(x_bound(1),y_bound(1));
+   B=[x_m(x_bound(2)) y_m(y_bound(1))]';
+   u_B=u(x_bound(2),y_bound(1));
+   C=[x_m(x_bound(2)) y_m(y_bound(2))]';
+   u_C=u(x_bound(2),y_bound(2));
+   D=[x_m(x_bound(1)) y_m(y_bound(2))]';
+   u_D=u(x_bound(1),y_bound(2));
+   
+   
+   
+   res=(D(2)-B(2))*x(n)+(B(1)-D(1))*y(n)+D(1)*B(2)-D(2)*B(1);
+   if res>0,
+      xx=[B(1) C(1) D(1)];
+      yy=[B(2) C(2) D(2)];
+      uu=[u_B u_C u_D];
+      ind=[1 2 3];
+   else
+      xx=[A(1) B(1) D(1)];
+      yy=[A(2) B(2) D(2)];
+      uu=[u_A u_B u_D];
+      ind=[1 2 3];
+   end
+   
+   
+	alpha=zeros(1,3);
+	beta=zeros(1,3);
+	gamma=zeros(1,3);
+	X=inv([xx(ind(1,:))' yy(ind(1,:))' ones(3,1)]);
+	alpha(1,:)=X(1,:);
+	beta(1,:)=X(2,:);
+	gamma(1,:)=X(3,:);
+   
+   if length(find(isnan(uu)))==0,
+      zp(n)=sum(uu.*(alpha.*x(n)+beta.*y(n)+gamma));
+   else
+      if length(find(~isnan(uu)))==0,
+         zp(n)=NaN;
+         else
+         pos=find(~isnan(uu));
+         zp(n)=uu(pos(1));
+      end
+   end
+   
+   else
+   zp(n)=NaN;
+end
+
+   
+end
+%disp('Filling final gaps');
+%zp=void_fill(zp,x,y);
Index: /issm/trunk/src/m/utils/Interp/griddata_grid_to_mesh_nan.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_grid_to_mesh_nan.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_grid_to_mesh_nan.m	(revision 1)
@@ -0,0 +1,90 @@
+function zp=griddata_grid_to_mesh_nan(x_m,y_m,u,index,x,y);
+%GRIDDATA_GRID_TO_MESH_NAN - interpolates data from a grid to a mesh   
+%
+%   Usage:
+%      zp=griddata_grid_to_mesh_nan(x_m,y_m,u,index,x,y)
+
+zp=zeros(length(x),1);
+for n=1:length(x),
+   if mod(n,100)==0,
+      disp(['Count is ' num2str(n/length(x)*100)]);
+   end
+   
+   pos1=find((x_m-x(n))<0);
+   pos2=find((x_m-x(n))>0);
+   pos3=find((y_m-y(n))<0);
+   pos4=find((y_m-y(n))>0);
+   
+   if (isempty(pos1) | isempty(pos2) | isempty(pos3) | isempty(pos4)),
+      out_of_bounds=1;
+   else
+      out_of_bounds=0;
+   end
+   
+   if out_of_bounds==0,   
+   %first find where (x(n),y(n)) lies.
+   pos1=find((x_m-x(n))<0);
+   pos2=find((x_m-x(n))>0);
+   x_bound=[pos1(length(pos1)) pos2(1)];   
+   
+   pos1=find((y_m-y(n))<0);
+   pos2=find((y_m-y(n))>0);
+   y_bound=[pos1(length(pos1)) pos2(1)];   
+   
+   
+   %we look for a linear interpolation, therefore have to decide 
+   % in which triangle our point lies.
+   
+   A=[x_m(x_bound(1)) y_m(y_bound(1))]';
+   u_A=u(x_bound(1),y_bound(1));
+   B=[x_m(x_bound(2)) y_m(y_bound(1))]';
+   u_B=u(x_bound(2),y_bound(1));
+   C=[x_m(x_bound(2)) y_m(y_bound(2))]';
+   u_C=u(x_bound(2),y_bound(2));
+   D=[x_m(x_bound(1)) y_m(y_bound(2))]';
+   u_D=u(x_bound(1),y_bound(2));
+   
+   
+   
+   res=(D(2)-B(2))*x(n)+(B(1)-D(1))*y(n)+D(1)*B(2)-D(2)*B(1);
+   if res>0,
+      xx=[B(1) C(1) D(1)];
+      yy=[B(2) C(2) D(2)];
+      uu=[u_B u_C u_D];
+      ind=[1 2 3];
+   else
+      xx=[A(1) B(1) D(1)];
+      yy=[A(2) B(2) D(2)];
+      uu=[u_A u_B u_D];
+      ind=[1 2 3];
+   end
+   
+   
+	alpha=zeros(1,3);
+	beta=zeros(1,3);
+	gamma=zeros(1,3);
+	X=inv([xx(ind(1,:))' yy(ind(1,:))' ones(3,1)]);
+	alpha(1,:)=X(1,:);
+	beta(1,:)=X(2,:);
+	gamma(1,:)=X(3,:);
+   
+   if length(find(isnan(uu)))==0,
+      zp(n)=sum(uu.*(alpha.*x(n)+beta.*y(n)+gamma));
+   else
+      if length(find(~isnan(uu)))==0,
+         zp(n)=NaN;
+         else
+         pos=find(~isnan(uu));
+         zp(n)=uu(pos(1));
+      end
+   end
+   
+   else
+   zp(n)=NaN;
+
+end
+
+   
+end
+%disp('Filling final gaps');
+%zp=void_fill(zp,x,y);
Index: /issm/trunk/src/m/utils/Interp/griddata_mesh_to_grid.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_mesh_to_grid.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_mesh_to_grid.m	(revision 1)
@@ -0,0 +1,49 @@
+function grid_data=griddata_mesh_to_grid(x_m,y_m,grid_data,x,y,mesh_data,varargin)
+%GRIDDATA_MESH_TO_GRID - interpolates data from a mesh to a grid
+%
+%   This routine takes a mesh (x,y) and values for every grid of the mesh (mesh_data),
+%   and interpolates it (using nearest interpolation) onto the gridded data (grid_data). 
+%   x_m and y_m (vectors of coordinates) are used to find interpolation locations onto grids.
+%
+%   Usage:
+%      grid_data=griddata_mesh_to_grid(x_m,y_m,grid_data,x,y,mesh_data,varargin)
+
+if nargin==7,
+	roundup=varargin{1};
+else
+	roundup=0;
+end
+
+s=size(grid_data);
+if length(x_m) ~= (s(2)+1),
+	error('x_m should be wider than grid_data by 1');
+end
+
+if length(y_m) ~= (s(1)+1),
+	error('y_m should be larger than grid_data by 1');
+end
+
+x_m0=x_m(1:end-1);
+x_m1=x_m(2:end);
+y_m0=y_m(1:end-1);
+y_m1=y_m(2:end);
+
+for i=1:length(x),
+	if mod(i,100000)==0,
+		disp(['   progress ' num2str(i/length(x)*100) '%']);
+	end
+	posx=find( (x(i)-x_m1)<=0 & (x(i)-x_m0)>0 );
+	posy=find( (y(i)-y_m1)<=0 & (y(i)-y_m0)>0 );
+	
+	y0=posy-roundup;
+	y1=posy+roundup;
+	if y0<=0, y0=1; end
+	if y1>s(1), y1=s(1);end
+
+	x0=posx-roundup;
+	x1=posx+roundup;
+	if x0<=0, x0=1; end
+	if x1>s(2), x1=s(2);end
+
+	grid_data(y0:y1,x0:x1)=mesh_data(i);
+end
Index: /issm/trunk/src/m/utils/Interp/griddata_mesh_to_mesh.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_mesh_to_mesh.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_mesh_to_mesh.m	(revision 1)
@@ -0,0 +1,93 @@
+function data_prime=griddata_mesh_to_mesh(index,x,y,data,x_prime,y_prime,varargin);
+%GRIDDATA_MESH_TO_MESH - interpolates data from a  2d mesh to a 2d mesh
+%
+%   griddata_mesh_to_mesh: interpolate data (from mesh with triangulation index,x,y)
+%   into mesh with triangulation (x_prime,y_prime).
+%
+%   Usage:
+%      data_prime=griddata_mesh_to_mesh(index,x,y,data,x_prime,y_prime,varargin)
+
+	global client_server_mode IMDataCounter uset
+
+	%restrict mesh_prime grids to the ones which are inside the mesh hull 
+	in=inhull([x_prime y_prime],[x y]);
+	pos_hull=find(in);
+
+	%keep only mesh_prime grids inside the hull
+	x_prime_hull=x_prime(pos_hull);
+	y_prime_hull=y_prime(pos_hull);
+
+	%call griddata_mesh_to_mesh_hulled on this new sub mesh from mesh 2
+	if strcmpi(client_server_mode,'yes'),
+		r_data_prime_hull=GriddataMeshToMeshHulled_client(index,x,y,data,x_prime_hull,y_prime_hull);
+		data_prime_hull=IMdb('select matrix from r_data_prime_hull');
+		IMdb('drop r_data_prime_hull');
+	else
+		data_prime_hull=griddata_mesh_to_mesh_hulled(index,x,y,data,x_prime_hull,y_prime_hull,varargin);
+	end
+
+	%return output
+	data_prime=zeros(length(x_prime),1); data_prime(:)=NaN;
+	data_prime(pos_hull)=data_prime_hull;
+end
+
+function data_prime=griddata_mesh_to_mesh_hulled(index,x,y,data,x_prime,y_prime,varargin);
+
+	%Analyse data: is it given per node or per element?
+	if isempty(varargin{1})
+		element_data=(length(data)==size(index,1));%data is given for a given element
+		grid_data=(length(data)==length(x));       %data is given for a given grid
+		if element_data==0 & grid_data==0, error('griddata_mesh_to_mesh_hulled error message: unknown size of data, specify element or node'), end
+	else
+		if strcmpi(varargin{1},'node')
+			element_data=0;
+			grid_data=1;
+		elseif strcmpi(varargin{1},'element')
+			element_data=1;
+			grid_data=0;
+		else
+			error('griddata_mesh_to_mesh_hulled error message: wrong input argument. Must be ''node'' or ''element''')
+		end
+	end
+
+	%Some parameters and initialization of data_prime
+	nel=length(index);
+	data_prime=zeros(length(x_prime),1); data_prime(:)=NaN;
+
+	%compute some quantities that will speed up the process
+	x3x1=x(index(:,1))-x(index(:,3));
+	y3y1=y(index(:,1))-y(index(:,3));
+	x3x2=x(index(:,2))-x(index(:,3));
+	y3y2=y(index(:,2))-y(index(:,3));
+	x3=x(index(:,3));
+	y3=y(index(:,3));
+
+	%triangles jacobian determinant (2*area)
+	delta=x(index(:,2)).*y(index(:,3))-y(index(:,2)).*x(index(:,3))-x(index(:,1)).*y(index(:,3))+y(index(:,1)).*x(index(:,3))+x(index(:,1)).*y(index(:,2))-y(index(:,1)).*x(index(:,2));
+
+	%Get area coordinates:
+	for n=1:nel,
+		if mod(n,10000)==0,
+			disp(sprintf('\r%s%.2f%s','      interpolation progress:  ',n/nel*100,' %'));
+		end
+		%first area coordinate
+		area_1=(y3y2(n)*(x_prime-x3(n))-x3x2(n)*(y_prime-y3(n)))/delta(n);
+		%second area coordinate
+		area_2=(x3x1(n)*(y_prime-y3(n))-y3y1(n)*(x_prime-x3(n)))/delta(n);
+		%third area coordinate
+		area_3=1-area_1-area_2;
+		%get grids in mesh 2 that have all area coordinates positive (meaning they belong to mesh 1 triangle n:
+		pos=find((area_1>=0) & (area_2>=0) & (area_3>=0));
+		if ~isempty(pos),
+			if grid_data
+				%mesh 2 grids in pos belong to mesh 1 element n. interpolate value linearly.
+				data_prime(pos)=area_1(pos)*data(index(n,1))+area_2(pos)*data(index(n,2))+area_3(pos)*data(index(n,3));
+			elseif element_data
+				data_prime(pos)=data(n);
+			end
+		end
+	end
+	if nel>10000,
+		disp(sprintf('\r%s%.2f%s','      interpolation progress:  ',100,' %'));
+	end
+end
Index: /issm/trunk/src/m/utils/Interp/griddata_mesh_to_mesh_3d.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_mesh_to_mesh_3d.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_mesh_to_mesh_3d.m	(revision 1)
@@ -0,0 +1,107 @@
+function data_prime=griddata_mesh_to_mesh_3d(index,x,y,z,data,x_prime,y_prime,z_prime,varargin);
+%GRIDDATA_MESH_TO_MESH_3D - interpolates data from a 3d mesh to a 3d mesh
+%
+%   griddata_mesh_to_mesh: interpolate data (from mesh with triangulation index,x,y,z)
+%   into mesh with triangulation (x_prime,y_prime,z_prime).
+%
+%   Usage:
+%      data_prime=griddata_mesh_to_mesh_3d(index,x,y,z,data,x_prime,y_prime,z_prime,varargin)
+
+	global client_server_mode IMDataCounter uset
+
+	%restrict mesh_prime grids to the ones which are inside the mesh hull 
+	in=inhull([x_prime y_prime z_prime],[x y z]);
+	pos_hull=find(in);
+
+	%keep only mesh_prime grids inside the hull
+	x_prime_hull=x_prime(pos_hull);
+	y_prime_hull=y_prime(pos_hull);
+	z_prime_hull=z_prime(pos_hull);
+
+	%call griddata_mesh_to_mesh_hulled on this new sub mesh from mesh 2
+	if strcmpi(client_server_mode,'yes'),
+		r_data_prime_hull=GriddataMeshToMeshHulled_client(index,x,y,data,x_prime_hull,y_prime_hull);
+		data_prime_hull=IMdb('select matrix from r_data_prime_hull');
+		IMdb('drop r_data_prime_hull');
+	else
+		data_prime_hull=griddata_mesh_to_mesh_hulled(index,x,y,z,data,x_prime_hull,y_prime_hull,z_prime_hull,varargin);
+	end
+
+	%return output
+	data_prime=zeros(length(x_prime),1); data_prime(:)=NaN;
+	data_prime(pos_hull)=data_prime_hull;
+end
+
+function data_prime=griddata_mesh_to_mesh_hulled(index,x,y,z,data,x_prime,y_prime,z_prime,varargin);
+
+	%Analyse data: is it given per node or per element?
+	if isempty(varargin{1})
+		element_data=(length(data)==size(index,1));%data is given for a given element
+		grid_data=(length(data)==length(x));       %data is given for a given grid
+		if element_data==0 & grid_data==0, error('griddata_mesh_to_mesh_hulled error message: unknown size of data, specify element or node'), end
+	else
+		if strcmpi(varargin{1},'node')
+			element_data=0;
+			grid_data=1;
+		elseif strcmpi(varargin{1},'element')
+			element_data=1;
+			grid_data=0;
+		else
+			error('griddata_mesh_to_mesh_hulled error message: wrong input argument. Must be ''node'' or ''element''')
+		end
+	end
+
+	%Some parameters and initialization of data_prime
+	nel=length(index);
+	data_prime=zeros(length(x_prime),1); data_prime(:)=NaN;
+
+	%compute some quantities that will speed up the process
+	x3x1=x(index(:,1))-x(index(:,3));
+	y3y1=y(index(:,1))-y(index(:,3));
+	x3x2=x(index(:,2))-x(index(:,3));
+	y3y2=y(index(:,2))-y(index(:,3));
+	x3=x(index(:,3));
+	y3=y(index(:,3));
+
+	%triangles jacobian determinant (2*area)
+	delta=x(index(:,2)).*y(index(:,3))-y(index(:,2)).*x(index(:,3))-x(index(:,1)).*y(index(:,3))+y(index(:,1)).*x(index(:,3))+x(index(:,1)).*y(index(:,2))-y(index(:,1)).*x(index(:,2));
+
+	%Get area coordinates:
+	for n=1:nel,
+		if mod(n,10000)==0,
+			disp(sprintf('\r%s%.2f%s','      interpolation progress:  ',n/nel*100,' %'));
+		end
+		%first area coordinate
+		area_1=(y3y2(n)*(x_prime-x3(n))-x3x2(n)*(y_prime-y3(n)))/delta(n);
+		%second area coordinate
+		area_2=(x3x1(n)*(y_prime-y3(n))-y3y1(n)*(x_prime-x3(n)))/delta(n);
+		%third area coordinate
+		area_3=1-area_1-area_2;
+
+		%get grids in mesh prime that have all area coordinates positive (meaning they are on the same extruded column):
+		pos_horiz=find((area_1>=0) & (area_2>=0) & (area_3>=0));
+		if ~isempty(pos_horiz),
+
+			%Figure out in which extruded penta it is located
+			lower=area_1(pos_horiz)*z(index(n,1))+area_2(pos_horiz)*z(index(n,2))+area_3(pos_horiz)*z(index(n,3));
+			upper=area_1(pos_horiz)*z(index(n,4))+area_2(pos_horiz)*z(index(n,5))+area_3(pos_horiz)*z(index(n,6));
+			xi=2*(z_prime(pos_horiz)-lower)./(upper-lower)-1;
+			pos=find(z_prime(pos_horiz)>=lower & z_prime(pos_horiz)<=upper);
+			pos_vert=pos_horiz(pos);
+			xi=xi(pos);
+
+			if ~isempty(pos_vert)
+				if grid_data
+					%mesh 2 grids in pos belong to mesh 1 element n. interpolate value linearly.
+					data_prime(pos_vert)=area_1(pos_vert).*(1-xi)/2*data(index(n,1))+area_2(pos_vert).*(1-xi)/2*data(index(n,2))+area_3(pos_vert).*(1-xi)/2*data(index(n,3))...
+							+area_1(pos_vert).*(1+xi)/2*data(index(n,4))+area_2(pos_vert).*(1+xi)/2*data(index(n,5))+area_3(pos_vert).*(1+xi)/2*data(index(n,6));
+				elseif element_data
+					data_prime(pos_vert)=data(n);
+				end
+			end
+		end
+	end
+	if nel>10000,
+		disp(sprintf('\r%s%.2f%s','      interpolation progress:  ',100,' %'));
+	end
+end
Index: /issm/trunk/src/m/utils/Interp/griddata_nearest.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_nearest.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_nearest.m	(revision 1)
@@ -0,0 +1,24 @@
+function [u]=griddata_nearest(x_m,y_m,u_m,x,y)
+%GRIDDATA_NEAREST - returns interpolated u_m function of x_m and y_m  on a grid
+%
+%   This function returns interpolated u_m function of x_m and y_m,
+%   on the grid defined by x and y.
+%   See griddata_nearest_matrix for the case where x_m,y_m and u_m are matrices 
+%   and x,y are vectores.
+%   See griddata_perso for a user defined version of griddata ( with fuzz coeff).
+%
+%   Usage:
+%      [u]=griddata_nearest(x_m,y_m,u_m,x,y)
+
+u=zeros(length(x),1);
+count=0;
+for n=1:length(x),
+   
+   if n>length(x)/10*count,
+      disp(n/length(x)*100);
+      count=count+1;
+   end
+   
+   [posx,posy]=find_coord(x_m,y_m,x(n),y(n));
+   u(n)=u_m(posx,posy);
+end
Index: /issm/trunk/src/m/utils/Interp/griddata_nearest_matrix.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_nearest_matrix.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_nearest_matrix.m	(revision 1)
@@ -0,0 +1,25 @@
+function [u]=griddata_nearest_matrix(x_m,y_m,u_m,x,y)
+%GRIDDATA_NEAREST_MATRIX - interpolate a function on a grid
+%
+%   This function returns interpolated u_m function of x_m and y_m,
+%   on the grid defined by x and y.
+%   INPUT x_m,y_m,u_M, x,y where x_m,y_m and u_m are 2d matrices, 
+%   and x,y are one dimensional vectors,
+%   See griddata_nearest_matrix for the case where x_m,y_m and u_m are matrices 
+%   and x,y are vectores.
+%   See griddata_perso for a user defined version of griddata ( with fuzz coeff).
+%
+%   Usage:
+%      [u]=griddata_nearest_matrix(x_m,y_m,u_m,x,y)
+
+u=zeros(length(x),1);
+count=0;
+for n=1:length(x),
+    if n>length(x)/10*count,
+      disp(n/length(x)*100);
+      count=count+1;
+   end
+
+   [posx,posy]=find_coord_matrix(x_m,y_m,x(n),y(n));
+   u(n)=u_m(posx,posy);
+end
Index: /issm/trunk/src/m/utils/Interp/griddata_nearest_nan.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_nearest_nan.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_nearest_nan.m	(revision 1)
@@ -0,0 +1,21 @@
+function [u]=griddata_nearest_nan(x_m,y_m,u_m,x,y)
+%GRIDDATA_NEAREST_NAN - interpolates a function on a grid
+%
+%   This function returns interpolated u_m function of x_m and y_m,
+%   on the grid defined by x and y.
+%   INPUT x_m,y_m,u_M, x,y where x_m,y_m, u_m, x,y are all one dimensional vectors,
+%   See griddata_nearest_matrix for the case where x_m,y_m and u_m are matrices 
+%   and x,y are vectores.
+%   See griddata_perso for a user defined version of griddata ( with fuzz coeff).
+%
+%   Usage:
+%      [u]=griddata_nearest_nan(x_m,y_m,u_m,x,y)
+
+u=zeros(length(x),1);
+
+pos=find(~isnan(u_m));
+
+for n=1:length(x),
+   [posx,posy]=find_coord(x_m,y_m,x(n),y(n));
+   u(n)=u_m(posx,posy);
+end
Index: /issm/trunk/src/m/utils/Interp/griddata_nearest_vector.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_nearest_vector.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_nearest_vector.m	(revision 1)
@@ -0,0 +1,28 @@
+function [u]=griddata_nearest_vector(x_m,y_m,u_m,x,y)
+%GRIDDATA_NEAREST_VECTOR - interpolates a function on a grid
+%
+%   This function returns interpolated u_m function of x_m and y_m,
+%   on the grid defined by x and y.
+%   INPUT x_m,y_m,u_M, x,y where x_m,y_m, u_m, x,y are all one dimensional vectors,
+%   See griddata_nearest_matrix for the case where x_m,y_m and u_m are matrices 
+%   and x,y are vectores.
+%   See griddata_perso for a user defined version of griddata ( with fuzz coeff).
+%
+%   Usage:
+%      [u]=griddata_nearest_vector(x_m,y_m,u_m,x,y)
+
+u=zeros(length(x),1);
+for n=1:length(x),
+   if mod(n,length(x)/10)==0,
+      disp(n/length(x)*100);
+   end
+   
+   dist=sqrt((x(n)-x_m).^2+(y(n)-y_m).^2);
+   pos=find(dist==min(dist));
+   if isnan(u_m(pos)),
+      pos
+   end
+   
+   u(n)=u_m(pos);
+   
+end
Index: /issm/trunk/src/m/utils/Interp/griddata_perso.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/griddata_perso.m	(revision 1)
+++ /issm/trunk/src/m/utils/Interp/griddata_perso.m	(revision 1)
@@ -0,0 +1,26 @@
+function zp=griddata_perso(index,x,y,u,xp,yp,alpha,beta,gamma);
+%GRIDDATA_PERSO - interpolates linearly a profile on a mesh
+%
+%   Usage:
+%      zp=griddata_perso(index,x,y,u,xp,yp,alpha,beta,gamma)
+
+zp=zeros(length(xp),1);
+for n=1:length(xp),
+   P=[xp(n) yp(n)];
+   dist=sqrt((x-P(1)).^2+(y-P(2)).^2);
+   posQ=find(dist==min(dist));
+   if min(dist)==0,
+      zp(n)=u(n);
+   else
+   	posQ=posQ(1);
+      elems=find(index(:,1)==posQ | index(:,2)==posQ | index(:,3)==posQ);
+   	for i=1:length(elems),
+         el=elems(i);
+         if isinpoly(P(1),P(2),x(index(el,:)),y(index(el,:)))==1,
+            zp(n)=sum((alpha(el,:)).*u(index(el,:))')*P(1)+...
+            sum((beta(el,:)).*u(index(el,:))')*P(2)+...
+            sum((gamma(el,:)).*u(index(el,:))');
+			end
+      end
+   end
+end
Index: /issm/trunk/src/m/utils/LatLong/ll2xy.m
===================================================================
--- /issm/trunk/src/m/utils/LatLong/ll2xy.m	(revision 1)
+++ /issm/trunk/src/m/utils/LatLong/ll2xy.m	(revision 1)
@@ -0,0 +1,30 @@
+function [x,y]=ll2xy(lat,lon);
+%LL2XY - convert latitude and longitude coordinates to x and y
+%
+%   Usage:
+%      [x,y]=ll2xy(lat,lon)
+%
+%   See also MAPLL, MAPXY
+
+lon=lon+360; % to have 0<lon<360
+
+re = 6378137.0; 	% WGS84
+e2 = 0.00669437999015;  % WGS84
+sn=-1.0; 	% because it's southern hemisphere
+
+a=re;
+e=sqrt(e2);
+
+phi  = sn*lat*pi/180;
+lambda  = lon*pi/180; 
+
+qp = 1 - (1-e2)/2/e*log((1-e)/(1+e));
+%m=cos(phi)/sqrt(1-e2.*sin(phi)*sin(phi));
+q=(1-e2)*(sin(phi)./(1-e2*sin(phi).^2)-0.5/e*log((1-e*sin(phi))./(1+e*sin(phi))));
+rho = a*sqrt(qp-q);
+x = rho.*sin(lambda);
+y = - sn*rho.*cos(lambda);
+
+
+%lon=lon-360; % to recover the initial longitude
+
Index: /issm/trunk/src/m/utils/LatLong/mapll.m
===================================================================
--- /issm/trunk/src/m/utils/LatLong/mapll.m	(revision 1)
+++ /issm/trunk/src/m/utils/LatLong/mapll.m	(revision 1)
@@ -0,0 +1,46 @@
+function  [x,y]=mapll(alat,alon,hem);
+%MAPLL - convert latitude and longitude into x and y
+%
+%   latitude and longitude are in degrees.
+%   Hemisphere must be 1 for north and 0 for south
+%
+%   Usage:
+%      [x,y]=mapll(latitude,longitude,hemisphere)
+%
+%   See also MAPXY, LL2XY
+
+re=6378137.0; 
+e2= 0.00669437999015;
+
+e=sqrt(e2);
+
+%Standard parallel - latitude with no distortion = -71.
+slat=71;
+sn=-1.0;
+xlam=0;
+
+if hem==1,
+   xlam=45;
+	sn=1;
+	slat=70;
+end
+
+alat=sn*alat;
+alon=sn*alon;
+alat=alat/180*pi;
+alon=alon/180*pi;
+
+rlat=alat;
+slat=slat/180*pi;
+xlam=xlam/180*pi;
+
+t1=tan(pi/4.-rlat/2.)./((1.0-e*sin(rlat))./...
+(1.0+e*sin(rlat))).^(e/2.);
+
+t2=tan(pi/4.-slat/2.)./((1.0-e*sin(slat))./...
+(1.0+e*sin(slat))).^(e/2.);
+
+cm=cos(slat)./sqrt(1.0-e2*(sin(slat).^2));
+rho=re*cm.*t1./t2;
+x= rho*sn.*sin((alon+xlam));
+y=-rho*sn.*cos((alon+xlam));
Index: /issm/trunk/src/m/utils/LatLong/mapxy.m
===================================================================
--- /issm/trunk/src/m/utils/LatLong/mapxy.m	(revision 1)
+++ /issm/trunk/src/m/utils/LatLong/mapxy.m	(revision 1)
@@ -0,0 +1,55 @@
+function [alat,alon]=mapxy(x,y,hem);
+%MAPXY - compute latitude and longitude from x and y
+%
+%   hemisphere must be 1 for north and 0 for south
+%
+%   Usage:
+%      [latitude,longitude]=mapxy(x,y,hemisphere)
+%
+%   See also MAPLL, LL2XY
+
+re = 6378137;
+e2 = 0.00669437999015;
+
+e=sqrt(e2);
+
+%Standard parallel = latitude with no distortion
+slat=71;
+sn=-1.0;
+xlam=0;
+
+if hem ==1,
+   slat=70;
+	sn=1;
+	xlam=45;
+end
+
+slat=slat/180*pi;
+
+rho=sqrt(x.^2+y.^2);
+cm=cos(slat)./sqrt(1.0-e2*(sin(slat).^2));
+t=tan((pi/4)-(slat/2.))./((1.0-e*sin(slat))./(1.0+e*sin(slat))).^(e/2.);
+
+t=rho.*t./(re*cm);
+
+chi=(pi/2.)-2.*atan(t);
+
+alat=chi+((e2/2.)+(5.0*e2^2/24.)+(e2^3/12.))*sin(2*chi)+...
+((7.0*e2^2/48.)+(29.*e2^3/240.))*sin(4.0*chi)+...
+(7.0*e2^3/120.)*sin(6.0*chi);
+
+alat=(sn*alat/pi*180);
+xpr=sn*x;
+ypr=sn*y;
+alon=atan2(xpr,-ypr)/pi*180-sn*xlam;
+alon=sn*alon;
+
+indice=find(alon<0);
+if length(indice)>0,
+   alon(indice)=alon(indice)+360;
+end
+
+indice=find(alon>360);
+if length(indice)>0,
+   alon(indice)=alon(indice)-360;
+end
Index: /issm/trunk/src/m/utils/LatLong/xyscale_south.m
===================================================================
--- /issm/trunk/src/m/utils/LatLong/xyscale_south.m	(revision 1)
+++ /issm/trunk/src/m/utils/LatLong/xyscale_south.m	(revision 1)
@@ -0,0 +1,17 @@
+function res=xyscale_south(lat);
+%XYSCALE_SOUTH - calculate scaling factor
+%
+%   latitude is <0 in degrees.
+%
+%   Usage:
+%      res=xyscale_south(latatitude)
+lat=-lat/180*pi;
+
+m71_t71=1.9390295644;
+e2=.00669437999015;
+e=sqrt(e2);
+
+m=cos(lat)./sqrt(1-e2*sin(lat).^2);
+t=tan(pi/4-lat/2)./((1-e*sin(lat))./(1+e*sin(lat))).^(e/2);
+k=m71_t71*t./m;
+res=(1./k./k);
Index: /issm/trunk/src/m/utils/Math/fixdec.m
===================================================================
--- /issm/trunk/src/m/utils/Math/fixdec.m	(revision 1)
+++ /issm/trunk/src/m/utils/Math/fixdec.m	(revision 1)
@@ -0,0 +1,41 @@
+function y = fixdec(x, n)
+%FIXDEC -  Round towards zero with a specified number of decimals.
+%
+%   This routine rounds the elements of X to N decimals.
+%
+%   Usage:
+%      y = fixdec(x, n)
+%
+%   Example:
+%      fixdec(10*sqrt(2) + i*pi/10, 4) returns 14.1421 + 0.3141i
+%
+%   See also: FIX, FLOOR, CEIL, ROUND, FIXDIG, ROUNDDEC, ROUNDDIG.
+
+%   Author:      Peter J. Acklam
+%   Time-stamp:  2004-09-22 20:08:10 +0200
+%   E-mail:      pjacklam@online.no
+%   URL:         http://home.online.no/~pjacklam
+
+   % Check number of input arguments.
+   error(nargchk(2, 2, nargin));
+
+   % Quick exit if either argument is empty.
+   if (isempty(x) |isempty(n))
+      y = [];
+      return
+   end
+
+   % Get size of input arguments.
+   size_x   = size(x);
+   size_n   = size(n);
+   scalar_x = all(size_x == 1);           % True if x is a scalar.
+   scalar_n = all(size_n == 1);           % True if n is a scalar.
+
+   % Check size of input arguments.
+   if ~scalar_x & ~scalar_n & ~isequal(size_x, size_n)
+      error(['When both arguments are non-scalars they must have' ...
+             ' the same size']);
+   end
+
+   f = 10.^n;
+   y = fix(x .* f) ./ f;
Index: /issm/trunk/src/m/utils/Meca/effective_value.m
===================================================================
--- /issm/trunk/src/m/utils/Meca/effective_value.m	(revision 1)
+++ /issm/trunk/src/m/utils/Meca/effective_value.m	(revision 1)
@@ -0,0 +1,18 @@
+function effective_value=effective_value(A)
+%EFFECTIVE_VALUE - compute the effective value of any matrix
+%
+%   effective(A)= 1/sqrt(2)*sqrt(sum(Aij^2))
+%
+%   Usage:
+%      effective_value=effective_value(A)
+
+[row,col]=size(A);
+
+SUM=0;
+for i=1:row
+    for j=1:col
+        SUM=SUM+A(i,j)^2;
+    end
+end
+
+effective_value=1/sqrt(2)*sqrt(SUM);
Index: /issm/trunk/src/m/utils/Meca/glen_coefficients.m
===================================================================
--- /issm/trunk/src/m/utils/Meca/glen_coefficients.m	(revision 1)
+++ /issm/trunk/src/m/utils/Meca/glen_coefficients.m	(revision 1)
@@ -0,0 +1,26 @@
+function [A ,B]=glen_coefficients(Ao,T);
+%GLEN_COEFFICIENTS - compute A and B, given the temperature and Ao
+%
+%   Ao,T according to patterson,Ao in s-1kPa-3.
+%   values range between 3.9 and 5.3*10^-16;
+%   Return: A in s-1kPa-3. B in Pa.a1/3
+%
+%   Usage:
+%      [A ,B]=glen_coefficients(Ao,T)
+
+To=263;
+R=8.314;
+E1=139000;
+E2=60000;
+
+%For T>263,
+Ac1=Ao*exp(E1/R/To);
+%For T<263,
+Ac2=Ao*exp(E2/R/To);
+
+A=Ac1*exp(-E1/R./T);
+pos=find(T<263);
+A(pos)=Ac2*exp(-E2/R./T(pos));
+
+B=(A*365*24*3600).^(-1/3);
+
Index: /issm/trunk/src/m/utils/Meca/lithostaticpressure.m
===================================================================
--- /issm/trunk/src/m/utils/Meca/lithostaticpressure.m	(revision 1)
+++ /issm/trunk/src/m/utils/Meca/lithostaticpressure.m	(revision 1)
@@ -0,0 +1,7 @@
+function pressure=lithostaticpressure(rho_ice,g,s,z);
+%LITHOSTATICPRESSURE - compute the lithostatic pressure
+%
+%   Usage:
+%      pressure=lithostacticpressure(rho_ice,g,surface,z)
+
+pressure=rho_ice*g*(s-z);
Index: /issm/trunk/src/m/utils/Meca/paterson.m
===================================================================
--- /issm/trunk/src/m/utils/Meca/paterson.m	(revision 1)
+++ /issm/trunk/src/m/utils/Meca/paterson.m	(revision 1)
@@ -0,0 +1,36 @@
+function rigidity=paterson(temperature)
+%PATERSON - figure out the rigidity of ice for a given temperature
+%
+%   rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). 
+%   temperature is in Celsius degrees
+%
+%   Usage:
+%      rigidity=paterson(temperature)
+
+T=temperature-273;
+
+%The routine below is equivalent to:
+
+% n=3; T=temperature-273;
+% %From paterson,
+% Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
+% A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
+% 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
+% %Convert into rigidity B
+% B=A.^(-1/n)*10^3; %s^(1/3)Pa
+% %Now, do a cubic fit between Temp and B: 
+% fittedmodel=fit(Temp,B,'cubicspline');
+% rigidity=fittedmodel(temperature);
+
+rigidity=zeros(length(T),1);
+pos1=find(T<=-45);           rigidity(pos1)=10^8*(-0.000292866376675*(T(pos1)+50).^3+ 0.011672640664130*(T(pos1)+50).^2  -0.325004442485481*(T(pos1)+50)+  6.524779401948101);
+pos2=find(-45<=T & T<-40);   rigidity(pos2)=10^8*(-0.000292866376675*(T(pos2)+45).^3+ 0.007279645014004*(T(pos2)+45).^2  -0.230243014094813*(T(pos2)+45)+  5.154964909039554);
+pos3=find(-40<=T & T<-35);   rigidity(pos3)=10^8*(0.000072737147457*(T(pos3)+40).^3+  0.002886649363879*(T(pos3)+40).^2  -0.179411542205399*(T(pos3)+40)+  4.149132666831214);
+pos4=find(-35<=T & T<-30);   rigidity(pos4)=10^8*(-0.000086144770023*(T(pos4)+35).^3+ 0.003977706575736*(T(pos4)+35).^2  -0.145089762507325*(T(pos4)+35)+  3.333333333333331);
+pos5=find(-30<=T & T<-25);   rigidity(pos5)=10^8*(-0.000043984685769*(T(pos5)+30).^3+ 0.002685535025386*(T(pos5)+30).^2  -0.111773554501713*(T(pos5)+30)+  2.696559088937191);
+pos6=find(-25<=T & T<-20);   rigidity(pos6)=10^8*(-0.000029799523463*(T(pos6)+25).^3+ 0.002025764738854*(T(pos6)+25).^2  -0.088217055680511*(T(pos6)+25)+  2.199331606342181);
+pos7=find(-20<=T & T<-15);   rigidity(pos7)=10^8*(0.000136920904777*(T(pos7)+20).^3+  0.001578771886910*(T(pos7)+20).^2  -0.070194372551690*(T(pos7)+20)+  1.805165505978111);
+pos8=find(-15<=T & T<-10);   rigidity(pos8)=10^8*(-0.000899763781026*(T(pos8)+15).^3+ 0.003632585458564*(T(pos8)+15).^2  -0.044137585824322*(T(pos8)+15)+  1.510778053489523);
+pos9=find(-10<=T & T<-5);    rigidity(pos9)=10^8*(0.001676964325070*(T(pos9)+10).^3-  0.009863871256831*(T(pos9)+10).^2  -0.075294014815659*(T(pos9)+10)+  1.268434288203714);
+pos10=find(-5<=T & T<-2);    rigidity(pos10)=10^8*(-0.003748937622487*(T(pos10)+5).^3+0.015290593619213*(T(pos10)+5).^2  -0.048160403003748*(T(pos10)+5)+  0.854987973338348);
+pos11=find(-2<=T);           rigidity(pos11)=10^8*(-0.003748937622488*(T(pos11)+2).^3-0.018449844983174*(T(pos11)+2).^2  -0.057638157095631*(T(pos11)+2)+  0.746900791092860);
Index: /issm/trunk/src/m/utils/Meca/tau_principal.m
===================================================================
--- /issm/trunk/src/m/utils/Meca/tau_principal.m	(revision 1)
+++ /issm/trunk/src/m/utils/Meca/tau_principal.m	(revision 1)
@@ -0,0 +1,37 @@
+function [f,g,h,i]=tau_principal(tau_xx,tau_yy,tau_xy)
+%TAU_PRINCIPAL - compute principal component of stress tensor
+%
+%   Usage:
+%      [f,g,h,i]=tau_principal(tau_xx,tau_yy,tau_xy)
+
+nel=length(tau_xx);
+tau_xx=tau_xx/(10^5);
+tau_yy=tau_yy/(10^5);
+tau_xy=tau_xy/(10^5);
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%determination of principal components of stress tensor%%%%%%%%%%%%
+teta1=zeros(nel,1);
+teta2=zeros(nel,1);
+ind=find((tau_xx-tau_yy)~=0);
+teta1(ind)=1/2*atan(tau_xy(ind)./(tau_xx(ind)-tau_yy(ind)));
+ind=find((tau_xx-tau_yy)==0);
+teta1(ind)=pi/2;
+teta2=teta1+pi/2;
+
+tmp1=tau_xx.*cos(teta1).^2+tau_yy.*sin(teta1).^2+2*tau_xy.*sin(teta1).*cos(teta1);
+tmp2=tau_xx.*cos(teta2).^2+tau_yy.*sin(teta2).^2+2*tau_xy.*sin(teta2).*cos(teta2);
+
+a=tmp1<=tmp2;
+b=tmp1>=tmp2;
+tau_1=tmp1.*b+a.*tmp2;
+tau_2=tmp1.*a+b.*tmp2;
+
+teta1_pp=teta1.*b+a.*teta2;
+teta2_pp=teta1.*a+b.*teta2;
+%teta1_pp=mod(teta1_pp,2*pi);
+%teta2_pp=mod(teta2_pp,2*pi);
+f=tau_1;
+g=tau_2;
+h=teta1_pp;
+i=teta2_pp;
+
Index: /issm/trunk/src/m/utils/Mesh/BuildAdaptedMesh.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/BuildAdaptedMesh.m	(revision 1)
+++ /issm/trunk/src/m/utils/Mesh/BuildAdaptedMesh.m	(revision 1)
@@ -0,0 +1,64 @@
+function md=BuildAdaptedMesh
+%BUILDADAPTEDMESH - Build model of Antarctica by refining according to observed velocity error estimator
+%
+%   Usage:
+%      md=BuildAdaptedMesh
+
+nsteps=1;
+resolution=50000;
+scaling=1.2;
+epsilon=.5;
+
+velpath='/proj/ice/larour/Glaciology/Model_Data/RignotAntarcticaVel1km/RignotAntVel';
+%velpath='/proj/ice/larour/Glaciology/Model_Data/BamberAntarcticaVel1km/velocity';
+%velpath='/proj/ice/larour/Glaciology/Model_Data/mosaicAnt1km_ramp_ers_alos/RignotAntVel';
+
+domainoutline='DomainOutline.exp';
+groundingline='GroundingLine.exp';
+icestreams='Icestream.exp';
+parameterfile='Basins.par';
+
+%clear data
+clear md
+
+%build new model
+md=model;
+
+%mesh with initial resolution
+md=mesh(md,domainoutline,resolution);
+disp(['First mesh, number of elements: ' num2str(md.numberofelements)]);
+
+%load velocities 
+eval(['load ' velpath]);
+
+%start mesh adaptation
+for i=1:nsteps,
+	disp(['Iteration #' num2str(i) '/' num2str(nsteps)]);
+
+	%interpolate velocities onto mesh
+	disp('   interpolating velocities');
+	md.vx_obs=DataInterp(x_m,y_m,vx*md.yts,md.x,md.y);
+	md.vy_obs=DataInterp(x_m,y_m,vy*md.yts,md.x,md.y);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+
+	%adapt according to velocities
+	disp('   adapting');
+	md=meshadaptation(md,md.vel_obs,scaling,epsilon);
+end
+	
+disp(['Final mesh, number of elements: ' num2str(md.numberofelements)]);
+
+md.vx_obs=DataInterp(x_m,y_m,vx*md.yts,md.x,md.y);
+md.vy_obs=DataInterp(x_m,y_m,vy*md.yts,md.x,md.y);
+md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+return;
+
+%parameterize model
+disp('Parameterizing');
+md=geography(md,groundingline,icestreams);
+md=parameterize(md,parameterfile);
+
+%md.vx_obs=DataInterp(x_m,y_m,vx*md.yts,md.x,md.y);
+%md.vy_obs=DataInterp(x_m,y_m,vy*md.yts,md.x,md.y);
+%md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+%return;
Index: /issm/trunk/src/m/utils/Miscellaneous/create_region.m
===================================================================
--- /issm/trunk/src/m/utils/Miscellaneous/create_region.m	(revision 1)
+++ /issm/trunk/src/m/utils/Miscellaneous/create_region.m	(revision 1)
@@ -0,0 +1,15 @@
+function create_region(name)
+%CREATE_REGION - create region  ????
+%
+%   very temporary function.
+%   
+%   Usage: 
+%      create_region(name)
+
+eval(['mkdir ' name]);
+eval(['cd ' name ]);
+!mkdir Delivery Exp_Par Results
+cd Exp_Par
+!cp ../../RonneShelf/Exp_Par/* ./
+!rm -rf Hole*
+eval(['!mv Ronne.par ' name '.par']);
Index: /issm/trunk/src/m/utils/Miscellaneous/findarg.m
===================================================================
--- /issm/trunk/src/m/utils/Miscellaneous/findarg.m	(revision 1)
+++ /issm/trunk/src/m/utils/Miscellaneous/findarg.m	(revision 1)
@@ -0,0 +1,52 @@
+function  vals=findarg(arglist,field)
+%FINDARG - find argument associated to a field in a list
+%
+%   This function parses through an argument list (typically varargin in a routine)
+%   looking for a character array equal to field. Once this is found, we return the 
+%   next value in the varargin (if possible). 
+%   Because field might appear several times in the argument list, we return a structure 
+%   holding all these values. 
+%   Note that all comparisons to field value are case independent.
+%
+%   Usage:
+%      vals=findarg(arglist,field)
+%
+%   Example:
+%      routine foobar calls vals=findarg('Data',varargin)
+%      with varargin='Data',1,'Data','foo','Plot','velocity','Arrow',4
+%      findarg would return the following structure: vals(1).value=1, vals(2).value='foo'; 
+
+%some argument checking: 
+if ((nargin==0) | (nargout==0)),
+	help findarg;
+	error('findarg error message');
+end
+
+if ~ischar(field),
+	error('findarg error message: field should be a string');
+end
+
+if ~iscell(arglist),
+	error('findarg error message: argument list should be a cell array.');
+end
+
+%Recover data to plot
+founddata=0;
+
+for i=1:(length(arglist)-1), %data in arglist comes in pairs, hence the -1.
+	if ischar(arglist{i}),
+		if (strcmpi(arglist{i},field)),
+			founddata=founddata+1;
+			if founddata==1,
+				vals.value=arglist{i+1};
+			else
+				vals(end+1).value=arglist{i+1};
+			end
+			i=i+1;
+		end
+	end
+end
+
+if founddata==0,
+	vals=[];
+end
Index: /issm/trunk/src/m/utils/Miscellaneous/round_ice.m
===================================================================
--- /issm/trunk/src/m/utils/Miscellaneous/round_ice.m	(revision 1)
+++ /issm/trunk/src/m/utils/Miscellaneous/round_ice.m	(revision 1)
@@ -0,0 +1,38 @@
+function new_x=round_ice(x,numnonzeros)
+%ROUND_ICE - rounds up x so that it has only numnonzeros non zero digits
+%
+%   numnonzeros must be an integer larger or equal to 1
+%
+%   Usage:
+%      new_x=round_ice(x,numnonzeros)
+
+%some checks
+if (nargin ~=2 | nargout>1),
+	error('round_ice usage: new_x=round_ice(x,numonzeros)');
+end
+if ~isnumeric(x)
+	error('round_ice error message: x must be a number and numzeros an integer');
+end
+if round(numnonzeros)~=numnonzeros
+	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
+end
+if any(numnonzeros<1)
+	error('round_ice error message: numnonzeros must be an integer larger or equal to 1')
+end
+if (length(numnonzeros)~=1 & size(numnonzeros)~=size(x))
+	error('round_ice error message: numnonzeros must be an integer larger or equal to 1 or a list of integers of length length(x)')
+end
+
+%figure out how long x is
+lengthx=ceil(log10(abs(x)));
+
+%if x contains 0, lengthx=-Inf
+lengthx(isinf(lengthx))=1;
+
+%get its sign
+si=sign(x);
+
+%rule out zeros
+new_x=si.*round(abs(x).*10.^(-lengthx+numnonzeros)).*10.^(lengthx-numnonzeros);
+
+
Index: /issm/trunk/src/m/utils/Model/ProcessParallelParametersFromCieloRc.m
===================================================================
--- /issm/trunk/src/m/utils/Model/ProcessParallelParametersFromCieloRc.m	(revision 1)
+++ /issm/trunk/src/m/utils/Model/ProcessParallelParametersFromCieloRc.m	(revision 1)
@@ -0,0 +1,99 @@
+function [server_codepath server_executionpath]=ProcessParallelParametersFromCieloRc(server_name,cielo_rc_location)
+%PROCESSPARALLELPARAMETERSFROMCIELORC - process parallel parameters from cielo
+%
+%   This function reads through the cielo_rc_location for server settings (name, ip, port and 
+%   tunneling) used to run parallel solution sequences
+%
+%   Usage:
+%      [server_codepath server_executionpath]=ProcessParallelParametersFromCieloRc(server_name,cielo_rc_location)
+
+lines_per_server=5;
+%open cielo.rc file
+fid=fopen(cielo_rc_location);
+if fid==-1,
+	error('Could not find cielo.rc file in delivery directory');
+end
+
+found=0;
+
+%Read first line and check it starts with begin. 
+line=fgetl(fid);
+if ~strcmp(line,'begin'),
+	error('cielo.rc file in delivery directory should always start with the begin statement');
+end
+
+%Read until we find the end statement. 
+while 1
+	line=fgetl(fid);
+	
+	%Check for 'end' statement
+	if strcmp(line,'end'),
+		break;
+	end 
+	%Check for end of file
+	if ~ischar(line),
+		error('cielo.rc file in delivery directory should end with an end statement');
+	end
+	%Ignore empty lines
+	if length(line)==0,
+		continue;
+	end
+	%Ignore comments
+	if strcmp(line(1),'#'),
+		continue
+	end
+
+	%Handle server name: 
+	if length(line)>11,
+		if strcmp(line(1:11),'server_name'),
+			%ok, the next 4 lines deal with one server settings.
+			%check if this is the server we are looking for.
+			splittedstring=strsplit(line,'=');
+			this_server_name=splittedstring{2};
+			if strcmp(this_server_name,server_name),
+
+				%Skip next 3 lines
+				line=fgetl(fid);
+				line=fgetl(fid);
+				line=fgetl(fid);
+
+				%Get next line for server code path
+				line=fgetl(fid);
+				splittedstring=strsplit(line,'=');
+				descriptor=splittedstring{1};
+				value=splittedstring{2};
+				if ~strcmp(descriptor,'server_codepath'),
+					error('server settings in cielo.rc don''t follow the correct syntax');
+				end
+				server_codepath=value;
+				found=1;
+				
+				
+				%Get next line for server execution path
+				line=fgetl(fid);
+				splittedstring=strsplit(line,'=');
+				descriptor=splittedstring{1};
+				value=splittedstring{2};
+				if ~strcmp(descriptor,'server_executionpath'),
+					error('server settings in cielo.rc don''t follow the correct syntax');
+				end
+				server_executionpath=value;
+
+			else
+				%Wrong server name, skip next lines_per_server lines and continue;
+				for i=1:lines_per_server,
+					line=fgetl(fid);
+				end
+				continue;
+			end
+		end
+	end
+end
+
+fclose(fid);
+
+if found==0,
+	error(['ProcessParallelParametersFromCieloRc error message: could not find setting for cluster ' server_name 'in cielo.rc file']);
+end
+
+end %close of function
Index: /issm/trunk/src/m/utils/Model/loadmodel.m
===================================================================
--- /issm/trunk/src/m/utils/Model/loadmodel.m	(revision 1)
+++ /issm/trunk/src/m/utils/Model/loadmodel.m	(revision 1)
@@ -0,0 +1,24 @@
+function loadmodel(varargin)
+%LOADMODEL - load a model using built-in load module
+%
+%   check that model prototype has not changed. if so, adapt to new model prototype.
+%
+%   Usage:
+%      loadmodel(varargin)
+
+path=varargin{1};
+try,
+	s=load(path,'-mat');
+	%get name of model variable
+	fieldname=char(fieldnames(s));
+	md=eval(['s.' fieldname]);
+	if ~strcmpi(class(md),'model'),
+		md2=model;
+		md2=structtomodel(md2,md);
+		md=md2;
+		clear md2;
+	end
+	assignin('caller',fieldname,md);
+catch
+	error(['could not load model' path]);
+end
Index: /issm/trunk/src/m/utils/Nightly/nightlyrun.m
===================================================================
--- /issm/trunk/src/m/utils/Nightly/nightlyrun.m	(revision 1)
+++ /issm/trunk/src/m/utils/Nightly/nightlyrun.m	(revision 1)
@@ -0,0 +1,20 @@
+%NIGHTLYRUN - run the nighlty tests on 'tests/Verification'
+%
+%   This script goes to each directory of 'tests/Verifications' and
+%   launch the nightly tests.
+
+%Go to Test directory
+eval(['cd ' ISSM_DIR '/tests/']);
+
+%Run all verification tests
+cd Verification
+
+%Get a list of the test decks
+[status,list]=system('ls -l | grep -v CVS | grep -v cielo | awk ''{printf("%s|",$9);}'' '); %only works on *nix systems.
+list=strsplit(list,'|');
+%Go through list of decks, and run the deck runme.m files.
+for i=2:length(list)-1,
+	eval(['cd ' list{i}]);
+	runme;
+	cd ..
+end
Index: /issm/trunk/src/m/utils/Nightly/nightlyruncielo.m
===================================================================
--- /issm/trunk/src/m/utils/Nightly/nightlyruncielo.m	(revision 1)
+++ /issm/trunk/src/m/utils/Nightly/nightlyruncielo.m	(revision 1)
@@ -0,0 +1,22 @@
+%NIGHTLYRUNCIELO - run nightly test of Cielo on Ice
+%
+%   This script goes to each directory of 'tests/Verification' and 
+%   launch the nighlty tests for cielo if they exist.
+
+%Go to Test directory
+eval(['cd ' ISSM_DIR '/tests/']);
+
+%Run all verification tests
+cd Verification
+
+%Get a list of the test decks
+[status,list]=system('ls -l | grep -v CVS | awk ''{printf("%s|",$9);}'' '); %only works on *nix systems.
+list=strsplit(list,'|');
+%Go through list of decks, and run the deck runme.m files.
+for i=2:length(list)-1,
+	cd([ list{i}]);
+	if exist('runmecielo.m','file')==2,
+		runmecielo;
+	end
+	cd ..
+end
Index: /issm/trunk/src/m/utils/Plot/squarezoom.m
===================================================================
--- /issm/trunk/src/m/utils/Plot/squarezoom.m	(revision 1)
+++ /issm/trunk/src/m/utils/Plot/squarezoom.m	(revision 1)
@@ -0,0 +1,20 @@
+function squarezoom()
+%SQUAREZOOM - zoom on a part of a figure
+%
+%   Usage:
+%      squarezoom()
+
+disp('Click twice to define a square where you want to zoom. First click for upper left corner, second for lower right corner');
+[x,y]=ginput(2);
+dx=x(2)-x(1);
+dy=y(1)-y(2);
+
+if dx>dy,
+	delta=dx-dy;
+	xlim([x(1) x(2)]);
+	ylim([y(2)-delta/2 y(1)+delta/2]);
+else
+	delta=dy-dx;
+	xlim([x(1)-delta/2 x(2)+delta/2]);
+	ylim([y(2) y(1)]);
+end
Index: /issm/trunk/src/m/utils/Shell/issmdir.m
===================================================================
--- /issm/trunk/src/m/utils/Shell/issmdir.m	(revision 1)
+++ /issm/trunk/src/m/utils/Shell/issmdir.m	(revision 1)
@@ -0,0 +1,17 @@
+function ISSM_DIR=issmdir()
+%ISSMDIR - Get ISSM_DIR environment variable contents.
+%
+%   Usage:
+%      ISSM_DIR=issmdir()
+
+[status,ISSM_DIR]=system('echo $ISSM_DIR');
+if status~=0,
+	error('issmdir error message: problem when running ''echo $ISSM_DIR'' shell command');
+end
+
+if (isempty(ISSM_DIR)) | (length(ISSM_DIR)==1),
+	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
+end
+
+%get rid of return carriage
+ISSM_DIR=ISSM_DIR(1:end-1);
Index: /issm/trunk/src/m/utils/Sound/beep_ice.m
===================================================================
--- /issm/trunk/src/m/utils/Sound/beep_ice.m	(revision 1)
+++ /issm/trunk/src/m/utils/Sound/beep_ice.m	(revision 1)
@@ -0,0 +1,9 @@
+function beep_ice(n);
+%BEEP_ICE - emit a beep for length n
+%
+%   Usage:
+%      beep_ice(n);
+
+for i=1:n,
+   sound(1,10000);
+end
Index: /issm/trunk/src/m/utils/String/discardnum.m
===================================================================
--- /issm/trunk/src/m/utils/String/discardnum.m	(revision 1)
+++ /issm/trunk/src/m/utils/String/discardnum.m	(revision 1)
@@ -0,0 +1,14 @@
+function string2=discardnum(string)
+%DISCARDNUM -  ??????
+%
+%   Usage:
+%      string2=discardnum(string)
+
+string2=string;
+
+for i=1:length(string),
+	if (((string(i)-0) <=57) & ((string(i)-0) >=48)),
+		string2=string(1:i-1);
+		break;
+	end
+end
Index: /issm/trunk/src/m/utils/String/logoutput.m
===================================================================
--- /issm/trunk/src/m/utils/String/logoutput.m	(revision 1)
+++ /issm/trunk/src/m/utils/String/logoutput.m	(revision 1)
@@ -0,0 +1,7 @@
+function logoutput(logstring,message)
+%LOGOUTPUT - embed a log string into an error message, used in the nightly runs.
+%
+%   Usage:
+%      logoutput(logstring,message)
+
+disp(sprintf('%s%s',logstring,message));
Index: /issm/trunk/src/m/utils/String/strsplit.m
===================================================================
--- /issm/trunk/src/m/utils/String/strsplit.m	(revision 1)
+++ /issm/trunk/src/m/utils/String/strsplit.m	(revision 1)
@@ -0,0 +1,91 @@
+function splittedstring = strsplit(inpstr,delimiter)
+%STRSPLIT - split a tring of delimiter separated values
+%
+%   This function should be used to split a string of delimiter separated
+%   values.  If all values are numerical values the returned matrix is a
+%   double array but if there is one non numerical value a cell array is
+%   returned.  You can check this with the iscell() function.
+%   inpstr: string containing delimiter separatede numerical values, eg
+%           3498,48869,23908,34.67
+%   Output: An x by 1 matrix containing the splitted values
+%   Delimiter: optional, if omitted the delimiter is , (comma)
+%
+%   Usage:
+%      output = strsplit(inpstr[,delimiter])
+%
+
+%   mailto:    gie.spaepen@ua.ac.be
+
+
+
+%Check input arguments
+if(nargin < 1)
+    error('There is no argument defined');
+else
+    if(nargin == 1)
+        strdelim = ',';
+        %Verbose off!! disp 'Delimiter set to ,';
+    else
+        strdelim = delimiter;
+    end
+end
+
+%deblank string
+deblank(inpstr);
+
+%Get number of substrings
+idx  = findstr(inpstr,strdelim);
+if size(idx) == 0
+    disp 'No delimiter in string, inputString is returned';
+    splittedstring = inpstr;
+else
+    %Define size of the indices
+    sz = size(idx,2);
+    %Define splittedstring
+    tempsplit = {};
+    %Loop through string and itinerate from delimiter to delimiter
+    for i = 1:sz
+        %Define standard start and stop positions for the start position,
+        %choose 1 as startup position because otherwise you get an array
+        %overflow, for the endposition you can detemine it from the
+        %delimiter position
+        strtpos = 1;
+        endpos = idx(i)-1;
+        %If i is not the beginning of the string get it from the delimiter
+        %position
+        if i ~= 1
+            strtpos = idx(i-1)+1;
+        end
+        %If i is equal to the number of delimiters get the last element
+        %first by determining the lengt of the string and then replace the
+        %endpos back to a standard position
+        if i == sz
+            endpos = size(inpstr,2); 
+            tempsplit(i+1) = {inpstr(idx(i)+1 : endpos)};
+            endpos = idx(i)-1;
+        end
+        %Add substring to output: splittedstring a cell array
+        tempsplit(i) = {inpstr(strtpos : endpos)};   
+    end
+    %Flag 
+    isallnums = 1;
+    %Check is there are NaN values if matrix elements are converted to
+    %doubles
+    for i = 1:size(tempsplit,2)
+        tempdouble = str2double(tempsplit(i));
+        if(isnan(tempdouble))
+            isallnums = 0;
+        end
+    end
+    %If isallnums = 1 then return a double array otherwise return a cell
+    %array
+    if(isallnums == 1)
+        for i = 1:size(tempsplit,2)
+            splittedstring(i) = str2double(tempsplit(i));
+        end
+    else
+        splittedstring = tempsplit;
+    end
+    
+        
+end
Index: /issm/trunk/src/m/utils/UpdateArchive/updatearchive.m
===================================================================
--- /issm/trunk/src/m/utils/UpdateArchive/updatearchive.m	(revision 1)
+++ /issm/trunk/src/m/utils/UpdateArchive/updatearchive.m	(revision 1)
@@ -0,0 +1,21 @@
+%UPDATEARCHIVE - update the tests archives in 'tests/Verification'
+%
+%   This script updates all the archive files of the Verification directory on Ice.
+%   All the archive files are saved in the appropriate directory but no one is commited.
+%   If you want to do so, just commit the updated files.
+
+%Go to Test directory
+eval(['cd ' ISSM_DIR '/Tests/']);
+
+%Run all verification tests
+cd Verification
+
+%Get a list of the test decks
+[status,list]=system('ls -l | grep -v CVS | awk ''{printf("%s|",$9);}'' '); %only works on *nix systems.
+list=strsplit(list,'|');
+%Go through list of decks, and run the deck runme.m files.
+for i=2:length(list)-1,
+	eval(['cd ' list{i}]);
+	updatearchive;
+	cd ..
+end
Index: /issm/trunk/src/m/utils/Visu/plot_results.m
===================================================================
--- /issm/trunk/src/m/utils/Visu/plot_results.m	(revision 1)
+++ /issm/trunk/src/m/utils/Visu/plot_results.m	(revision 1)
@@ -0,0 +1,2289 @@
+function plot_results(Action,varargin)
+%PLOT_RESULTS - plot results
+%
+%   This routine seems to be obsolete... move to Trash?
+%
+%   Usage:
+%      plot_results(Action,varargin)
+
+global index x y u v vel
+
+if nargin==0,
+   Action='initialize';
+   series=1;
+end
+
+if nargin==1,
+   if length(Action)==1,
+         series=Action;
+         Action='initialize';
+   end
+end
+
+      
+
+if nargin==2,
+   series=varargin{1};
+end
+
+switch Action
+
+   %---Initialize the demonstration
+case 'initialize'
+   LocalOpenFig(series);
+case 'ToggleButton'    
+         
+ 
+   value=findobj(gcf,'Tag','Choice');
+   value=popupstr(value);
+   
+   
+      year=findobj(gcf,'Tag','Version');
+   	year_value=popupstr(year);
+   
+  		zoom=findobj(gcf,'Tag','Zoom');
+   	zoom_value=popupstr(zoom);
+   
+  		ser=findobj(gcf,'Tag','Series');
+      series=popupstr(ser);
+      series=str2num(series);
+      
+      diff=findobj(gcf,'Tag','Diff');
+      diff_value=popupstr(diff);
+      
+      diff_choice=findobj(gcf,'Tag','Diff_choice');
+      diff_choice=popupstr(diff_choice);
+      
+      range_choice=findobj(gcf,'Tag','Range_choice');
+      range_choice=popupstr(range_choice);
+      if strcmp(range_choice,'auto'),
+         range_choice=0;
+      else
+         range_choice=1;
+      end
+      
+      range=findobj(gcf,'Tag','Range');
+      range=deblank(get(range,'String'));
+
+      
+
+
+
+      switch zoom_value,
+   	case 'RONNE'
+      zo=0;
+   	case 'HIR'
+         zo=1;
+      case 'LASSITER'
+         zo=2;
+         case 'MIDDLE'
+         zo=3;
+
+   	end
+   
+   
+   	switch	value
+   	case 'obs_ronne'
+         plot_obs_ronne(year_value,zo,series,range_choice,range);
+      case 'obs_hir_vx'
+         plot_obs_hir_vx(year_value,zo,series,range_choice,range);
+      case 'obs_hir_vy'
+         plot_obs_hir_vy(year_value,zo,series,range_choice,range);
+      case 'obs_hir_vel'
+         plot_obs_hir_vel(year_value,zo,series,range_choice,range);
+ 		case 'u'
+          plot_u(year_value,zo,series,range_choice,range);
+      case 'diff_u_hir'
+          plot_diff_u_hir(year_value,zo,series,range_choice,range);
+   	case 'v'
+         plot_v(year_value,zo,series,range_choice,range);
+      case 'v_prism'
+         plot_v_prism(year_value,zo,series,range_choice,range);
+      case 'diff_v_hir'
+          plot_diff_v_hir(year_value,zo,series,range_choice,range);
+   	case 'vel'
+         plot_vel(year_value,zo,series,range_choice,range);
+		case 'vel_prism'
+         plot_vel_prism(year_value,zo,series,range_choice,range);
+      case 'diff_vel_ronne'
+         plot_diff_vel_ronne(year_value,zo,series,range_choice,range);
+      case 'diff_vel_hir'
+         plot_diff_vel_hir(year_value,zo,series,range_choice,range);
+      case 'rotation_hir'
+         plot_rotation_hir(year_value,zo,series,range_choice,range);
+		case 'rotation_model'
+         plot_rotation_model(year_value,zo,series,range_choice,range);
+		case 'diff_rotation'
+         plot_diff_rotation(year_value,zo,series,range_choice,range);
+		case 'quiver_hir'
+         plot_quiver_hir(year_value,zo,series,range_choice,range);
+      case 'quiver_las'
+         plot_quiver_las(year_value,zo,series,range_choice,range);
+		case 'quiver_model'
+         plot_quiver_model(year_value,zo,series,range_choice,range);
+		case 'mesh'
+         plot_mesh(year_value,zo,series,range_choice,range);
+      case 'obs_LAS_vx'
+         plot_obs_LAS_vx(year_value,zo,series,range_choice,range);
+      case 'obs_LAS_vy'
+         plot_obs_LAS_vy(year_value,zo,series,range_choice,range);
+      case 'obs_LAS_vel'
+         plot_obs_LAS_vel(year_value,zo,series,range_choice,range);
+      case 'diff_u_LAS'
+         plot_diff_u_LAS(year_value,zo,series,range_choice,range);
+      case 'diff_v_LAS'
+         plot_diff_v_LAS(year_value,zo,series,range_choice,range);
+      case 'diff_vel_LAS'
+         plot_diff_vel_LAS(year_value,zo,series,range_choice,range);
+         
+         
+
+
+
+
+
+   	case 'tau1'
+      	plot_tau1(year_value,zo,series,range_choice,range);
+   	case 'tau2'
+      	plot_tau2(year_value,zo,series,range_choice,range);
+		case 'teta1'
+   	   plot_teta1(year_value,zo,series,range_choice,range);
+   	case 'teta2'
+         plot_teta2(year_value,zo,series,range_choice,range);
+
+
+      case 'thick'
+         plot_thick(year_value,zo,series,range_choice,range);
+		case 'thickbar'
+         plot_thickbar(year_value,zo,series,range_choice,range);
+
+   
+	   otherwise
+   	   plot_results('Refresh');
+      end
+      
+      
+      
+case   'Refresh'
+   year=findobj(gcf,'Tag','Version');
+   year_value=popupstr(year);
+   quantity=findobj(gcf,'Tag','Choice');
+   quantity_value=popupstr(quantity);
+   zoom=findobj(gcf,'Tag','Zoom');
+   zoom_value=popupstr(zoom);
+   ser=findobj(gcf,'Tag','Series');
+   series=popupstr(ser);
+   diff=findobj(gcf,'Tag','Diff');
+   diff_value=popupstr(diff);
+      range_choice=findobj(gcf,'Tag','Range_choice');
+      range_choice=popupstr(range_choice);
+      if strcmp(range_choice,'auto'),
+         range_choice=0;
+      else
+         range_choice=1;
+      end
+      
+      range=findobj(gcf,'Tag','Range');
+      range=deblank(get(range,'String'));
+
+  
+
+   switch zoom_value,
+   case 'RONNE'
+      zo=0;
+   case 'HIR'
+      zo=1;
+   case 'LASSITER'
+      zo=2;
+   case 'MIDDLE'
+      zo=3;
+   end
+
+   eval(['plot_' quantity_value '(' year_value ',' num2str(zo) ',' series  ',' range_choice ',' range ' )']);
+
+   
+end
+
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function LocalOpenFig(series);
+StdUnit = 'point';
+StdColor = get(0,'DefaultUIcontrolBackgroundColor');
+PointsPerPixel = 72/get(0,'ScreenPixelsPerInch');
+
+a = figure('Color',[0.8 0.8 0.8], ...
+   'Position',[25 45 560 420], ...
+   'IntegerHandle','on', ...
+   'Number','off',...  
+   'Name','Results',...
+   'Tag','Results Visualisation');
+
+b = axes('Parent',a, ...
+   'Units',StdUnit, ...
+   'Box','on', ...
+   'Color',[1 1 1], ...
+   'Position',PointsPerPixel*[40 45 360 330], ...
+   'Units','Normalized',...
+   'XColor',[0 0 0], ...
+   'XGrid','off', ...
+   'XTick',[],...
+   'YColor',[0 0 0], ...
+   'YGrid','off', ...
+   'YTick',[], ...
+   'ZColor',[0 0 0], ...
+   'ZGrid','off', ...
+   'ZTick',[]);
+
+set(get(b,'XLabel'),'visible','off');
+set(get(b,'YLabel'),'visible','off');
+set(get(b,'ZLabel'),'visible','off');
+
+
+b = axes('Parent',a,'Units',StdUnit,'Color',[1 1 1],'Position',...
+   PointsPerPixel*[40 45 360 330],'Units','Normalized',   'Tag','ActiveAxes','Box','on','XColor',[0 0 0], ...
+   'XGrid','off', ...
+   'YColor',[0 0 0], ...
+   'YGrid','off');
+names_function(1,series);
+load ../data/matlab/commondata/names.mat
+eval(['load ' root directory '\data']);
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+
+u=u*yts;
+v=v*yts;
+
+
+
+%---Add the 3D plot as the default
+trisurf(index,x/1e3,y/1e3,u),shading interp,view(2);
+caxis([-500 100]);
+colorbar
+set(gca,'Tag','ActiveAxes');
+
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'Position',PointsPerPixel*[425 295 100 50], ...
+   'Units','Normalized',...
+   'Style','frame');
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'HorizontalAlignment','left', ...
+   'Position',PointsPerPixel*[430 320 80 20], ...
+   'Units','Normalized',...
+   'String','Series', ...
+   'Style','text');
+
+
+str='';
+i=1;
+while   exist([root 'RONNE_w' num2str(i)],'file')==7,
+   str=[str num2str(i) '|'];
+      i=i+1;
+end
+str=str(1:length(str)-1);
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Style','popup', ...
+   'Position',PointsPerPixel*[430 300  90 20], ...
+   'Units','Normalized',...
+   'String',str, ...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Tag','Series',...
+	'Value',series);
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%5555
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'Position',PointsPerPixel*[425 245 100 50], ...
+   'Units','Normalized',...
+   'Style','frame');
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'HorizontalAlignment','left', ...
+   'Position',PointsPerPixel*[430 270 80 20], ...
+   'Units','Normalized',...
+   'String','Version', ...
+   'Style','text');
+
+
+
+str='';
+i=1;
+names_function(1,series);
+load ../data/matlab/commondata/names.mat
+while   exist_by_names([root directory '\' results '_results.mat']),
+   str=[str num2str(i) '|'];
+   i=i+1;
+   names_function(i,series);
+   load ../data/matlab/commondata/names.mat
+end
+str=str(1:length(str)-1);
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Style','popup', ...
+   'Position',PointsPerPixel*[430 250  90 20], ...
+   'Units','Normalized',...
+   'String',str, ...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Tag','Version');
+
+%%%%%%%%%%%%%%%%%%%55
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'Position',PointsPerPixel*[425 195 100 50], ...
+   'Units','Normalized',...
+   'Style','frame');
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit,'BackgroundColor',StdColor, ...
+   'HorizontalAlignment','left', ...
+   'Position',PointsPerPixel*[430 220 80 20], ...
+   'Units','Normalized',...
+   'String','Quantity to view', ...
+   'Style','text');
+
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Style','popup', ...
+   'Position',PointsPerPixel*[430 200  90 20], ...
+   'Units','Normalized',...
+   'String','u|v|v_prism|vel|vel_prism|obs_hir_vx|obs_hir_vy|obs_hir_vel|diff_u_hir|diff_v_hir|diff_vel_hir|obs_ronne|diff_vel_ronne|obs_LAS_vx|obs_LAS_vy|obs_LAS_vel|diff_u_LAS|diff_v_LAS|diff_vel_LAS|rotation_model|rotation_hir|diff_rotation|quiver_hir|quiver_las|quiver_model|tau1|tau2|teta1|teta2|thick|thickbar|mesh', ...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Tag','Choice');
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'Position',PointsPerPixel*[425 145 100 50], ...
+   'Units','Normalized',...
+   'Style','frame');
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'HorizontalAlignment','left', ...
+   'Position',PointsPerPixel*[430 170 80 20], ...
+   'Units','Normalized',...
+   'String','Zoom', ...
+   'Style','text');
+
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Style','popup', ...
+   'Position',PointsPerPixel*[430 150  90 20], ...
+   'Units','Normalized',...
+   'String','RONNE|HIR|LASSITER|MIDDLE', ...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Tag','Zoom');
+
+
+
+set(a,'visible','on','HandleVisibility','callback');
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'Position',PointsPerPixel*[425 115 50 30], ...
+   'Units','Normalized',...
+   'Style','frame');
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'HorizontalAlignment','left', ...
+   'Position',PointsPerPixel*[430 130 40 10], ...
+   'Units','Normalized',...
+   'String','Diff Version', ...
+   'Style','text');
+
+
+
+str='';
+i=1;
+names_function(1,series);
+load ../data/matlab/commondata/names.mat
+while   exist_by_names([root directory '\' results '_results.mat']),
+   str=[str num2str(i) '|'];
+   i=i+1;
+   names_function(i,series);
+   load ../data/matlab/commondata/names.mat
+end
+str=str(1:length(str)-1);
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Style','popup', ...
+   'Position',PointsPerPixel*[430 120  40 10], ...
+   'Units','Normalized',...
+   'String',str, ...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Tag','Diff');
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'Position',PointsPerPixel*[475 115 50 30], ...
+   'Units','Normalized',...
+   'Style','frame');
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'HorizontalAlignment','left', ...
+   'Position',PointsPerPixel*[480 130 40 10], ...
+   'Units','Normalized',...
+   'String','Diff mesh', ...
+   'Style','text');
+
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Style','popup', ...
+   'Position',PointsPerPixel*[480 120  40 10], ...
+   'Units','Normalized',...
+   'String','Version|Diff_version', ...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Tag','Mesh_choice');
+
+
+
+set(a,'visible','on','HandleVisibility','callback');
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'Position',PointsPerPixel*[425 85 50 30], ...
+   'Units','Normalized',...
+   'Style','frame');
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'HorizontalAlignment','left', ...
+   'Position',PointsPerPixel*[430 100 40 10], ...
+   'Units','Normalized',...
+   'String','Plot differentials', ...
+   'Style','text');
+
+
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Style','popup', ...
+   'Position',PointsPerPixel*[430 90  40 10], ...
+   'Units','Normalized',...
+   'String','no|yes', ...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Tag','Diff_choice');
+
+
+
+set(a,'visible','on','HandleVisibility','callback');
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'Position',PointsPerPixel*[475 85 50 30], ...
+   'Units','Normalized',...
+   'Style','frame');
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'HorizontalAlignment','left', ...
+   'Position',PointsPerPixel*[485 105 30 5], ...
+   'Units','Normalized',...
+   'String','Color Range', ...
+   'Style','text');
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Position',PointsPerPixel*[480 95 40 10], ...
+   'Units','Normalized',...
+   'String','[  ,  ]',...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Style','edit',...
+   'Tag','Range');
+
+       
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Style','popup', ...
+   'Position',PointsPerPixel*[480 90 40 5], ...
+   'Units','Normalized',...
+   'String','auto|manual', ...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Tag','Range_choice');
+
+
+
+set(a,'visible','on','HandleVisibility','callback');
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'Position',PointsPerPixel*[475 55 50 30], ...
+   'Units','Normalized',...
+   'Style','frame');
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',StdColor, ...
+   'HorizontalAlignment','left', ...
+   'Position',PointsPerPixel*[485 70 30 10], ...
+   'Units','Normalized',...
+   'String','Quiver sparsity', ...
+   'Style','text');
+
+b = uicontrol('Parent',a, ...
+   'Unit',StdUnit, ...
+   'BackgroundColor',[1 1 1], ...
+   'Position',PointsPerPixel*[480 60 40 10], ...
+   'Units','Normalized',...
+   'String','3',...
+   'callback','plot_results(''ToggleButton'');', ...
+   'Style','edit',...
+   'Tag','Quiver_Sparsity');
+
+       
+set(a,'visible','on','HandleVisibility','callback');
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function plot_obs_ronne(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+if exist_by_names([root directory '\' maillage '_observations_Ian.mat']),
+   eval(['load ' root directory '/' maillage '_observations_Ian'])
+   v_input=sqrt(u_RONNE.^2+v_RONNE.^2)*yts;
+end
+
+
+
+trisurf(index,x/1e3,y/1e3,v_input),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed velocity magnitude (m.a^(-1)). BAS data.'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+colormap(jet)
+caxis([0 1500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function plot_obs_hir_vx(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+
+
+trisurf(index,x/1e3,y/1e3,u_HIR),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed velocity Vx (m.a^(-1)) around HIR. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+
+zoom_choice(zo);
+colormap(jet)
+caxis([-500 100]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function plot_obs_hir_vy(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+
+trisurf(index,x/1e3,y/1e3,v_HIR),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed velocity Vy (m.a^(-1)) around HIR. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+colormap(jet)
+caxis([0 1500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function plot_obs_hir_vel(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+
+vel_HIR=sqrt(u_HIR.^2+v_HIR.^2);
+
+trisurf(index,x/1e3,y/1e3,vel_HIR),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed velocity magnitude (m.a^(-1)) around HIR. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+
+colormap(jet)
+caxis([0 1500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_u(num,zo,series,range_choice,range);
+diff_choice=findobj(gcf,'Tag','Diff_choice');
+diff_choice=popupstr(diff_choice);
+if strcmp(diff_choice,'no')==1,
+
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+u=u*yts;
+v=v*yts;
+trisurf(index,x/1e3,y/1e3,u),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Computed Vx (m.a^(-1)) around HIR.'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+
+zoom_choice(zo);
+colormap(jet)
+if range_choice==0,
+   caxis([-500 500]);
+else
+   eval(['caxis(' range ');']);
+end
+
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+else
+      diff=findobj(gcf,'Tag','Diff');
+      diff_value=popupstr(diff);
+      
+      mesh=findobj(gcf,'Tag','Mesh_choice');
+      mesh=popupstr(mesh)
+      if strcmp(mesh,'Version')==1,
+         mesh=1;
+      else
+         mesh=0;
+      end
+      
+      
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+vel1=u*yts;
+
+x1=x;
+y1=y;
+index1=index;
+end
+names_function(diff_value,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+vel2=u*yts;
+x2=x;
+y2=y;
+index2=index;
+end
+
+if mesh==1,
+   vel2=griddata(x2,y2,vel2,x1,y1);
+   trisurf(index1,x1/1e3,y1/1e3,vel1-vel2),shading interp,view(2);
+   title(texlabel(['Difference vx model #' num2str(num) '- vx model #' num2str(diff_value) ' on mesh ' num2str(num)]),'fontname','arial','fontsize',18);
+   
+else
+   vel1=griddata(x1,y1,vel1,x2,y2);
+   trisurf(index2,x2/1e3,y2/1e3,vel1-vel2),shading interp,view(2);
+   title(texlabel(['Difference vx model #' num2str(num) '- vx model #' num2str(diff_value) ' on mesh ' num2str(diff_value)]),'fontname','arial','fontsize',18);
+end
+
+if range_choice==0,
+else
+   eval(['caxis(' range ');']);
+end
+
+
+colorbar;
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+set(gca,'Tag','ActiveAxes')
+
+
+
+
+
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_diff_u_hir(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+
+u=u*yts;
+
+trisurf(index,x/1e3,y/1e3,u-u_HIR),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Vx-Vxobs (m.a^(-1)) around HIR.'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+colormap(jet)
+%caxis([-200 200]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+function plot_v(num,zo,series,range_choice,range);
+diff_choice=findobj(gcf,'Tag','Diff_choice');
+diff_choice=popupstr(diff_choice);
+if strcmp(diff_choice,'no')==1,
+
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+u=u*yts;
+v=v*yts;
+trisurf(index,x/1e3,y/1e3,v),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Computed Vy (m.a^(-1)) around HIR.'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+
+colormap(jet)
+if range_choice==0,
+caxis([0 1500]);
+else
+   eval(['caxis(' range ');']);
+end
+
+
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+else
+   diff=findobj(gcf,'Tag','Diff');
+   diff_value=popupstr(diff);
+    
+      mesh=findobj(gcf,'Tag','Mesh_choice');
+      mesh=popupstr(mesh)
+      if strcmp(mesh,'Version')==1,
+         mesh=1;
+      else
+         mesh=0;
+      end
+      
+
+      
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+vel1=v*yts;
+
+x1=x;
+y1=y;
+index1=index;
+end
+names_function(diff_value,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+vel2=v*yts;
+x2=x;
+y2=y;
+index2=index;
+end
+
+if mesh==1,
+   vel2=griddata(x2,y2,vel2,x1,y1);
+   trisurf(index1,x1/1e3,y1/1e3,vel1-vel2),shading interp,view(2);
+   title(texlabel(['Difference vy model #' num2str(num) '- vx model #' num2str(diff_value) ' on mesh ' num2str(num)]),'fontname','arial','fontsize',18);
+   
+else
+   vel1=griddata(x1,y1,vel1,x2,y2);
+   trisurf(index2,x2/1e3,y2/1e3,vel1-vel2),shading interp,view(2);
+   title(texlabel(['Difference vy model #' num2str(num) '- vx model #' num2str(diff_value) ' on mesh ' num2str(diff_value)]),'fontname','arial','fontsize',18);
+end
+
+if range_choice==0,
+else
+   eval(['caxis(' range ');']);
+end
+
+
+colorbar;
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+set(gca,'Tag','ActiveAxes')
+
+
+
+
+
+
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+function plot_v_prism(num,zo,series,range_choice,range);
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+v=v*yts;
+
+trisurf(index,x/1e3,y/1e3,v),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Computed velocity magnitude (m.a^(-1)).'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+zoom_choice(zo);
+cycle=100;
+caxis([0 1600]);
+colormap(prism(6*cycle))
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function plot_diff_v_hir(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+
+v=v*yts;
+
+trisurf(index,x/1e3,y/1e3,v-v_HIR),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Vy-Vyobs (m.a^(-1)) around HIR.'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+
+colormap(jet)
+caxis([-500 500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+function plot_vel(num,zo,series,range_choice,range);
+
+diff_choice=findobj(gcf,'Tag','Diff_choice');
+diff_choice=popupstr(diff_choice);
+if strcmp(diff_choice,'no')==1,
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+u=u*yts;
+v=v*yts;
+vel=sqrt(u.^2+v.^2);
+trisurf(index,x/1e3,y/1e3,vel),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Computed velocity magnitude (m.a^(-1)).'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+zoom_choice(zo);
+cycle=30;
+
+if range_choice==0,
+   caxis([0 1500]);
+
+else
+   eval(['caxis(' range ');']);
+end
+
+colormap(jet)
+colorbar
+set(gca,'Tag','ActiveAxes')
+
+end
+
+
+else
+
+      diff=findobj(gcf,'Tag','Diff');
+      diff_value=popupstr(diff);
+      
+       
+      mesh=findobj(gcf,'Tag','Mesh_choice');
+      mesh=popupstr(mesh)
+      if strcmp(mesh,'Version')==1,
+         mesh=1;
+      else
+         mesh=0;
+      end
+      
+
+      
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+vel1=sqrt(u.^2+v.^2)*yts;
+
+x1=x;
+y1=y;
+index1=index;
+end
+names_function(diff_value,series)
+load ../data/matlab/commondata/names.mat
+
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+vel2=sqrt(u.^2+v.^2)*yts;
+x2=x;
+y2=y;
+index2=index;
+end
+
+
+if mesh==1,
+   vel2=griddata(x2,y2,vel2,x1,y1);
+   trisurf(index1,x1/1e3,y1/1e3,vel1-vel2),shading interp,view(2);
+   title(texlabel(['Difference vel model #' num2str(num) '- vx model #' num2str(diff_value) ' on mesh ' num2str(num)]),'fontname','arial','fontsize',18);
+   
+else
+   vel1=griddata(x1,y1,vel1,x2,y2);
+   trisurf(index2,x2/1e3,y2/1e3,vel1-vel2),shading interp,view(2);
+   title(texlabel(['Difference vel model #' num2str(num) '- vx model #' num2str(diff_value) ' on mesh ' num2str(diff_value)]),'fontname','arial','fontsize',18);
+end
+
+
+if range_choice==0,
+else
+   eval(['caxis(' range ');']);
+end
+
+colorbar;
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+set(gca,'Tag','ActiveAxes')
+
+
+
+
+
+
+   
+   
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+function plot_vel_prism(num,zo,series,range_choice,range);
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+u=u*yts;
+v=v*yts;
+vel=sqrt(u.^2+v.^2);
+
+trisurf(index,x/1e3,y/1e3,vel),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Computed velocity magnitude (m.a^(-1)).'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+zoom_choice(zo);
+cycle=32;
+caxis([0 1600]);
+colormap(prism(6*cycle))
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+function plot_diff_vel_hir(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+
+v=v*yts;
+u=u*yts;
+vel=sqrt(u.^2+v.^2);
+vel_HIR=sqrt(u_HIR.^2+v_HIR.^2);
+
+xmin=-1.09*10^6;
+xmax=-960000;
+ymin=8.1*10^5;
+ymax=9.4*10^5;
+diff=vel-vel_HIR;
+diff2=abs(vel-vel_HIR);
+pos=find(diff2<=50);
+diff(pos)=NaN;
+trisurf(index,x/1e3,y/1e3,diff),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('V-Vobs (m.a^(-1)) around HIR.'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+colormap(jet)
+caxis([-500 500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+function plot_diff_vel_ronne(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+
+if exist_by_names([root directory '\' maillage '_observations_Ian.mat']),
+   eval(['load ' root directory '/' maillage '_observations_Ian'])
+   v_input=sqrt(u_RONNE.^2+v_RONNE.^2)*yts;
+end
+
+
+v=v*yts;
+u=u*yts;
+vel=sqrt(u.^2+v.^2);
+
+trisurf(index,x/1e3,y/1e3,vel-v_input),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('V-Vobs (m.a^(-1)).'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+
+colormap(jet)
+caxis([-500 500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+function plot_obs_LAS_vx(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations_LAS'];
+eval(aa)
+
+
+trisurf(index,x/1e3,y/1e3,u_LAS),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed vx (m.a^(-1)) around LAS. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+
+colormap(jet)
+%caxis([0 1500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+function plot_obs_LAS_vy(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations_LAS'];
+eval(aa)
+
+
+trisurf(index,x/1e3,y/1e3,v_LAS),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed vy around LASSITER (m.a^(-1)) around LAS. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+
+colormap(jet)
+%caxis([0 1500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+function plot_obs_LAS_vel(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations_LAS'];
+eval(aa)
+vel_LAS=sqrt(u_LAS.^2+v_LAS.^2);
+
+trisurf(index,x/1e3,y/1e3,vel_LAS),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed vel_LAS (m.a^(-1)) around LAS. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+
+colormap(jet)
+%caxis([0 1500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_diff_u_LAS(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations_LAS'];
+eval(aa)
+
+u=u*yts;
+pos=find(u_LAS==0);
+u_LAS(pos)=NaN;
+xmin=-1.09*10^6;
+xmax=-960000;
+ymin=8.1*10^5;
+ymax=9.4*10^5;
+diff=u-u_LAS;
+trisurf(index,x/1e3,y/1e3,diff),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('u-u_LAS (m.a^(-1)) around LASSITER.'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+colormap(jet)
+caxis([-500 500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_diff_v_LAS(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations_LAS'];
+eval(aa)
+
+v=v*yts;
+pos=find(v_LAS==0);
+v_LAS(pos)=NaN;
+xmin=-1.09*10^6;
+xmax=-960000;
+ymin=8.1*10^5;
+ymax=9.4*10^5;
+diff=v-v_LAS;
+trisurf(index,x/1e3,y/1e3,diff),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('v-v_LAS (m.a^(-1)) around LASSITER.'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+colormap(jet)
+caxis([-500 500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+function plot_diff_vel_LAS(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations_LAS'];
+eval(aa)
+
+u=u*yts;
+v=v*yts;
+vel=sqrt(u.^2+v.^2);
+vel_LAS=sqrt(u_LAS.^2+v_LAS.^2);
+%pos=find(vel_LAS==0);
+%vel_LAS(pos)=NaN;
+
+
+diff2=abs(vel-vel_LAS);
+pos=find(diff2<=50);
+
+xmin=-1.09*10^6;
+xmax=-960000;
+ymin=8.1*10^5;
+ymax=9.4*10^5;
+diff=vel-vel_LAS;
+diff(pos)=NaN;
+trisurf(index,x/1e3,y/1e3,diff),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('vel-vel_LAS (m.a^(-1)) around LASSITER.'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+colormap(jet)
+caxis([-500 500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+
+
+
+function plot_tau1(num,zo,series,range_choice,range);
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+if exist==1,
+
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+[tau_1 tau_2 teta1 teta2]=tau_principal(tau_xx,tau_yy,tau_xy);
+summer=[1;1;1];
+colormap(jet)
+cla
+patch(x(index)'/1e3,y(index)'/1e3,[1; 1; 1]*tau_1'),shading interp,view(2)
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('First component of stress (10^5 Pa.s).'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+caxis([-6 6]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+
+
+
+function plot_tau2(num,zo,series,range_choice,range);
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+[tau_1 tau_2 teta1 teta2]=tau_principal(tau_xx,tau_yy,tau_xy);
+colormap(jet)
+cla
+patch(x(index)'/1e3,y(index)'/1e3,[1; 1; 1]*tau_2'),shading interp,view(2)
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Second component of stress (10^5 Pa.s).'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+caxis([-6 6]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+
+
+
+function plot_teta1(num,zo,series,range_choice,range);
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+[tau_1 tau_2 teta1 teta2]=tau_principal(tau_xx,tau_yy,tau_xy);
+colormap(jet)
+cla
+patch(x(index)'/1e3,y(index)'/1e3,[1; 1; 1]*teta1'),shading interp,view(2)
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Angle of first component of stress (Pa.s).'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+caxis([-pi pi])
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
+
+
+
+function plot_teta2(num,zo,series,range_choice,range);
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+[tau_1 tau_2 teta1 teta2]=tau_principal(tau_xx,tau_yy,tau_xy);
+colormap(jet)
+cla
+patch(x(index)'/1e3,y(index)'/1e3,[1; 1; 1]*teta2'),shading interp,view(2)
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Angle of second component of stress (Pa.s).'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+caxis([-pi pi])
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+
+function plot_thickbar(num,zo,series,range_choice,range);
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+colormap(jet)
+cla
+patch(x(index)',y(index)',[1; 1; 1]*z_thick_bar'),shading interp,view(2)
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Thickness interpolated on the elements (m).'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+if range_choice==0,
+caxis([0 500]);
+else
+   eval(['caxis(' range ');']);
+end
+
+
+
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+
+function plot_thick(num,zo,series,range_choice,range);
+
+diff_choice=findobj(gcf,'Tag','Diff_choice');
+diff_choice=popupstr(diff_choice);
+if strcmp(diff_choice,'no')==1,
+
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+
+xmin=-1.09*10^6;
+xmax=-960000;
+ymin=8.1*10^5;
+ymax=9.4*10^5;
+trisurf(index,x/1e3,y/1e3,z_thick),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Thickness (m)'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+colormap(jet)
+if range_choice==0,
+caxis([0 500]);
+else
+   eval(['caxis(' range ');']);
+end
+
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+else
+
+      diff=findobj(gcf,'Tag','Diff');
+
+      diff_value=popupstr(diff);
+      
+       
+      mesh=findobj(gcf,'Tag','Mesh_choice');
+      mesh=popupstr(mesh)
+      if strcmp(mesh,'Version')==1,
+         mesh=1;
+      else
+         mesh=0;
+      end
+      
+
+      
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+z_thick1=z_thick;
+x1=x;
+y1=y;
+index1=index;
+end
+names_function(diff_value,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+z_thick2=z_thick;
+x2=x;
+y2=y;
+index2=index;
+end
+
+
+if mesh==1,
+   z_thick2=griddata(x2,y2,z_thick2,x1,y1);
+   trisurf(index1,x1/1e3,y1/1e3,z_thick1-z_thick2),shading interp,view(2);
+   title(texlabel(['Difference z_thick model #' num2str(num) '- z_thick model #' num2str(diff_value) ' on mesh ' num2str(num)]),'fontname','arial','fontsize',18);
+   
+else
+   z_thick1=griddata(x1,y1,z_thick1,x2,y2);
+   trisurf(index2,x2/1e3,y2/1e3,z_thick1-z_thick2),shading interp,view(2);
+   title(texlabel(['Difference z_thick model #' num2str(num) '- z_thick model #' num2str(diff_value) ' on mesh ' num2str(diff_value)]),'fontname','arial','fontsize',18);
+end
+
+
+if range_choice==0,
+else
+   eval(['caxis(' range ');']);
+end
+
+colorbar;
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+set(gca,'fontname','arial','fontsize',16)
+
+zoom_choice(zo);
+set(gca,'Tag','ActiveAxes')
+
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_rotation_hir(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+angle=atan2(v_HIR,u_HIR)/pi*180;
+trisurf(index,x/1e3,y/1e3,angle),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed velocity Vx (m.a^(-1)) around HIR. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+
+zoom_choice(zo);
+
+colormap(jet)
+%caxis([-500 500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_quiver_hir(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+
+delta=findobj(gcf,'Tag','Quiver_Sparsity');
+delta=str2num(deblank(get(delta,'String')));
+
+
+flag=1:delta:nods;
+quiver(x(flag)/1e3,y(flag)/1e3,u_HIR(flag),v_HIR(flag));
+
+
+
+
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed velocity Vx (m.a^(-1)) around HIR. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+zoom_choice(zo);
+colormap(jet)
+set(gca,'Tag','ActiveAxes')
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_quiver_las(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+eval(['load ' root directory '/' maillage '_observations_LAS']);
+
+
+
+
+delta=findobj(gcf,'Tag','Quiver_Sparsity');
+delta=str2num(deblank(get(delta,'String')));
+
+
+flag=1:delta:nods;
+quiver(x(flag)/1e3,y(flag)/1e3,u_LAS(flag),v_LAS(flag));
+
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed velocity Vx (m.a^(-1)) around LASSITER. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+
+zoom_choice(zo);
+colormap(jet)
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_quiver_model(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+
+
+
+delta=findobj(gcf,'Tag','Quiver_Sparsity');
+delta=str2num(deblank(get(delta,'String')));
+
+
+flag=1:delta:nods;
+quiver(x(flag)/1e3,y(flag)/1e3,u(flag),v(flag));
+
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed velocity Vx (m.a^(-1)) around HIR. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+
+zoom_choice(zo);
+colormap(jet)
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_rotation_model(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+angle=atan2(v,u)/pi*180;
+trisurf(index,x/1e3,y/1e3,angle),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Observed velocity Vx (m.a^(-1)) around HIR. From RSAT1'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+
+zoom_choice(zo);
+colormap(jet)
+%caxis([-500 500]);
+colorbar
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_diff_rotation(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+angle_model=atan2(v,u)/pi*180;
+angle_obs=atan2(v_HIR,u_HIR)/pi*180;
+trisurf(index,x/1e3,y/1e3,angle_model-angle_obs),shading interp,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Rotation angle differential. alpha_model-alpha_obs'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+
+zoom_choice(zo);
+colormap(jet)
+caxis([-50 50]);
+colorbar
+
+set(gca,'Tag','ActiveAxes')
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+function plot_mesh(num,zo,series,range_choice,range);
+
+names_function(num,series)
+load ../data/matlab/commondata/names.mat
+load ../data/matlab/commondata/data
+exist=exist_by_names([root directory '\' results '_results.mat']);
+
+if exist==1,
+
+aa=['load ' root directory '/' results '_results'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_datamesh'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_fem_parameters'];
+eval(aa)
+aa=['load ' root directory '/' maillage '_observations'];
+eval(aa)
+u=zeros(nods,1);
+
+trisurf(index,x/1e3,y/1e3,u),shading faceted,view(2);
+xlabel('X (km)','fontname','arial','fontsize',16)
+ylabel('Y (km)','fontname','arial','fontsize',16)
+title(texlabel('Mesh'),'fontname','arial','fontsize',18);
+set(gca,'fontname','arial','fontsize',16)
+
+
+zoom_choice(zo);
+set(gca,'Tag','ActiveAxes')
+end
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function names_function(num,series,range_choice,range)
+location=find(pwd=='\');
+location=location(length(location));
+present_directory=pwd;
+present_directory=present_directory(location+1:length(present_directory));
+
+root=['..\data\' present_directory '\'];
+
+directory=['RONNE_w' num2str(series)];
+rad_maillage='RONNE_w';
+rad_results='w';
+
+maillage=[rad_maillage num2str(num) '_mesh'];
+results=[rad_results num2str(num)];
+
+save ../data/matlab/commondata/names.mat maillage results directory root
+
+function f=exist_by_names(str);
+fid=fopen(str,'r');
+if fid==-1,
+   f=0;
+else
+   f=1;
+end
+
+
+
+function zoom_choice(zo);
+xmin=-1.09*10^6;
+xmax=-960000;
+
+ymin=8.1*10^5;
+ymax=9.4*10^5;
+switch zo,
+   case 0,
+   xmin=-1.5*10^6;
+	xmax=-.5*10^6;
+	ymin=1*10^5;
+	ymax=11*10^5;
+   xlim([xmin/1e3 xmax/1e3]);
+   ylim([ymin/1e3 ymax/1e3]);
+	case 1,
+   xmin=-1.09*10^6;
+	xmax=-960000;
+	ymin=8.1*10^5;
+	ymax=9.4*10^5;
+   xlim([xmin/1e3 xmax/1e3]);
+   ylim([ymin/1e3 ymax/1e3]);
+	case 2,
+   xmin=-1.46*10^6;
+	xmax=-1.32*10^6;
+	ymin=5.5*10^5;
+	ymax=8.42*10^5;
+   xlim([xmin/1e3 xmax/1e3]);
+
+   ylim([ymin/1e3 ymax/1e3]);
+	case 3,
+   xmin=-1.26*10^6;
+	xmax=-9.7*10^5;
+	ymin=8.20*10^5;
+	ymax=9.40*10^5;
+   xlim([xmin/1e3 xmax/1e3]);
+   ylim([ymin/1e3 ymax/1e3]);
+
+
+end
Index: /issm/trunk/src/m/utils/Visu/twofig.m
===================================================================
--- /issm/trunk/src/m/utils/Visu/twofig.m	(revision 1)
+++ /issm/trunk/src/m/utils/Visu/twofig.m	(revision 1)
@@ -0,0 +1,25 @@
+ function twofig(varargin);
+ %TWOFIG - create two figures
+ %
+ %   Ths routine seems to be obsolete... move to Trash?
+ %
+ %   Usage:
+ %      twofig(varargin)
+
+ if nargin==1,
+	 counter=varargin{1};
+ else
+	 counter=0;
+  end
+ figure(1);
+ set(1,'Position',[1604+1594/2  4 1594/2 1099/2]);
+ figure(2);
+ set(2,'Position',[1604+1594/2  4 1594/2 1099/2]);
+
+ set(1,'Position',[1604 683+1099 1594/2 1099/2]);
+
+ if (counter==0),
+	 twofig(1);
+ else
+	 return;
+ end
Index: /issm/trunk/src/m/utils/Visu/vi.m
===================================================================
--- /issm/trunk/src/m/utils/Visu/vi.m	(revision 1)
+++ /issm/trunk/src/m/utils/Visu/vi.m	(revision 1)
@@ -0,0 +1,38 @@
+function vi(index,x,y,varargin)
+%VI - plot a field
+%
+%   This function plots a field of values mapped on a triangulation.
+%   Input: index,x,y,field,#of the window   
+%   This routine seems to be obsolete... move to Trash?
+%
+%   Usage:
+%      vi(index,x,y,varargin)
+
+num=varargin{nargin-3};
+figure(num),clf
+
+test=zeros(nargin-4,1);
+for n=1:nargin-4,
+   test(n)=length(varargin{n});
+end
+
+m=ceil(sqrt(length(find(test~=2))))
+count=1;
+for n=1:nargin-4,
+   if test(n)==2,
+      caxis(varargin{n}),colorbar;
+   else
+      subplot(m,m,count)
+      if length(varargin{n})==length(x),
+         trisurf(index,x,y,varargin{n}),shading interp, view(2),colorbar
+      else
+         patch(x(index)',y(index)',[1; 1; 1]*varargin{n}'),shading interp,view(2),colorbar
+      end
+      
+   xlim([min(x) max(x)]);
+   ylim([min(y) max(y)]);
+   hold on
+   title(inputname(3+n))
+   count=count+1;
+   end
+end
Index: /issm/trunk/src/m/utils/Visu/vic.m
===================================================================
--- /issm/trunk/src/m/utils/Visu/vic.m	(revision 1)
+++ /issm/trunk/src/m/utils/Visu/vic.m	(revision 1)
@@ -0,0 +1,25 @@
+function vic(index,x,y,v1,v2,col,num)
+%VIC - plot velocities
+%
+%   This function plots a field of values mapped on a triangulation.
+%   Input: index,x,y,field,#of the window   
+%   This routine seems to be obsolete... move to Trash?
+%
+%   Usage:
+%      vic(index,x,y,v1,v2,col,num)
+
+figure(num),clf
+subplot(2,2,1)
+trisurf(index,x,y,v1),shading interp, view(2),colorbar
+hold on,a=caxis;
+title(inputname(4))
+subplot(2,2,2)
+trisurf(index,x,y,v2),shading interp, view(2),caxis(a),colorbar
+title(inputname(5))
+
+hold on
+subplot(2,2,3)
+trisurf(index,x,y,v2-v1),shading interp, view(2),caxis(col),colorbar
+hold on
+a=[inputname(5) ' - ' inputname(4)];
+title(a)
Index: /issm/trunk/src/m/utils/Visu/vii.m
===================================================================
--- /issm/trunk/src/m/utils/Visu/vii.m	(revision 1)
+++ /issm/trunk/src/m/utils/Visu/vii.m	(revision 1)
@@ -0,0 +1,20 @@
+function vii(index,x,y,varargin)
+%VII - plot a field on a triangulation
+%
+%   This function plots a field of values mapped on a triangulation.
+%   Input: index,x,y,field,#of the window   
+%   This routine seems to be obsolete... move to Trash?
+%
+%   Usage:
+%      vii(index,x,y,varargin)
+
+num=varargin{nargin-3};
+figure(num),clf
+m=ceil(sqrt(nargin-4))
+
+for n=1:nargin-4,
+   subplot(m,m,n)
+   trisurf(index,x,y,varargin{n}),shading interp, view(2),colorbar
+   hold on
+   title(inputname(3+n))
+end
Index: /issm/trunk/src/m/utils/Visu/vim.m
===================================================================
--- /issm/trunk/src/m/utils/Visu/vim.m	(revision 1)
+++ /issm/trunk/src/m/utils/Visu/vim.m	(revision 1)
@@ -0,0 +1,9 @@
+function vim(index,x,y,fig_name)
+%VIM - visualize something   
+%   This routine seems to be obsolete... move to Trash?
+%
+%   Usage:
+%      vim(index,x,y,fig_name)
+
+o=ones(length(x),1);
+vi(index,x,y,o,fig_name),shading faceted
Index: /issm/trunk/src/m/utils/Visu/vim3.m
===================================================================
--- /issm/trunk/src/m/utils/Visu/vim3.m	(revision 1)
+++ /issm/trunk/src/m/utils/Visu/vim3.m	(revision 1)
@@ -0,0 +1,17 @@
+function vim3(index,x,y,z,fig);
+%VIM3 - visualize a 3d mesh  
+%
+%   This routine seems to be obsolete... move to Trash?
+%
+%   Usage:
+%      vim3(index,x,y,z,fig)
+
+figure(fig),clf,hold on
+perm1=[1 2 3 1 2 3];
+perm2=[2 3 1 4 4 4]
+for n=1:length(index),
+   for j=1:6,
+      m=perm1(j);p=perm2(j);
+      plot3([x(index(n,m)) x(index(n,p))]',[y(index(n,m)) y(index(n,p))]',[z(index(n,m)) z(index(n,p))]','r-*');
+   end
+end
Index: /issm/trunk/src/m/utils/genpath_ice.m
===================================================================
--- /issm/trunk/src/m/utils/genpath_ice.m	(revision 1)
+++ /issm/trunk/src/m/utils/genpath_ice.m	(revision 1)
@@ -0,0 +1,38 @@
+function p = genpath_ice(d)
+%GENPATH_ICE - generate paths in a directory
+%
+%   this routine is equivalent to Matlab's genpath except that it skips CVS and .svn directories
+%
+%   Usage:
+%      p = genpath_ice(d)
+
+%initialize path to be returned
+p = '';
+sep=pathsep;  %directory separator
+
+% Generate path based on given root directory
+files=dir(d);
+if isempty(files)
+	return
+end
+
+% Add d to the path even if it is empty.
+p = [p d sep];
+
+% set logical vector for subdirectory entries in d
+isdir = logical(cat(1,files.isdir));
+
+% Recursively goes through the subdirectories of d
+dirs=files(isdir); % select only directory entries from the current listing
+for i=1:length(dirs)
+	dirname=dirs(i).name;
+	if  ~strcmp(dirname,'.')  & ...
+		~strcmp(dirname,'..')   & ...
+		~strcmp(dirname,'.svn') &...
+		~strcmp(dirname,'CVS') & ...
+		~strncmp(dirname,'@',1)& ... %Method directories not allowed in MATLAB path
+		~strcmp(dirname,'private')        %private directories not allowed in MATLAB path
+
+	p = [p genpath_ice(fullfile(d,dirname))];
+	end
+end
Index: /issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.cpp
===================================================================
--- /issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.cpp	(revision 1)
+++ /issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.cpp	(revision 1)
@@ -0,0 +1,47 @@
+/*\file BuildNodeSets.c
+ *\brief: build degrees of freedom sets for every node
+ */
+
+#include "./BuildNodeSets.h"
+
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet*     nodes=NULL;
+
+	/* output datasets: */
+	NodeSets*    nodesets=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&BuildNodeSetsUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
+	
+	/*!Generate internal degree of freedom numbers: */
+	BuildNodeSetsx(&nodesets, nodes);
+
+	/*write output datasets: */
+	WriteNodeSets(NODESETS,nodesets); 
+
+	/*Free ressources: */
+	delete nodes;
+	delete nodesets;
+
+	/*end module: */
+	MODULEEND();
+}
+
+void BuildNodeSetsUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [m.nodesets]=%s(m.nodes);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.h
===================================================================
--- /issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.h	(revision 1)
+++ /issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.h	(revision 1)
@@ -0,0 +1,33 @@
+
+/*
+	BuildNodeSets.h
+*/
+
+
+#ifndef _BUILDNODESETS_H
+#define _BUILDNODESETS_H
+
+/* local prototypes: */
+void BuildNodeSetsUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "BuildNodeSets"
+
+    
+/* serial input macros: */
+#define NODES (mxArray*)prhs[0]
+
+/* serial output macros: */
+#define NODESETS (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  1
+
+
+#endif  /* _BUILDNODESETS_H */
+
Index: /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.cpp
===================================================================
--- /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.cpp	(revision 1)
+++ /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.cpp	(revision 1)
@@ -0,0 +1,54 @@
+/*\file ConfigureObjects.c
+ *\brief: configure objects (elements, loads for example), that need linking with nodes
+ */
+
+#include "./ConfigureObjects.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* elements=NULL;
+	DataSet* loads=NULL;
+	DataSet* nodes=NULL;
+	DataSet* materials=NULL;
+
+	/* output datasets: elements and loads*/
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ConfigureObjectsUsage);
+	
+	/*Input datasets: */
+	FetchData((void**)&elements,NULL,NULL,ELEMENTSIN,"DataSet",NULL);
+	FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL);
+	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
+	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+
+	/*!Configure objects:*/
+	ConfigureObjectsx(elements, loads, nodes, materials);
+
+	/*write output datasets: */
+	WriteData(ELEMENTS,elements,0,0,"DataSet",NULL);
+	WriteData(LOADS,loads,0,0,"DataSet",NULL);
+
+	/*Free ressources: */
+	delete elements;
+	delete loads;
+	delete nodes;
+	delete materials;
+
+	/*end module: */
+	MODULEEND();
+}
+
+void ConfigureObjectsUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [elements,loads] = %s(elements,loads,nodes, materials);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.h
===================================================================
--- /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.h	(revision 1)
+++ /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.h	(revision 1)
@@ -0,0 +1,36 @@
+
+/*
+	ConfigureObjects.h
+*/
+
+
+#ifndef _CONFIGUREOBJECTS_H
+#define _CONFIGUREOBJECTS_H
+
+/* local prototypes: */
+void ConfigureObjectsUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "ConfigureObjects"
+
+/* serial input macros: */
+#define ELEMENTSIN (mxArray*)prhs[0]
+#define LOADSIN (mxArray*)prhs[1]
+#define NODES (mxArray*)prhs[2]
+#define MATERIALS (mxArray*)prhs[3]
+
+/* serial output macros: */
+#define ELEMENTS (mxArray**)&plhs[0]
+#define LOADS (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS  4
+
+
+#endif  /* _CONFIGUREOBJECTS_H */
+
Index: /issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp
===================================================================
--- /issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp	(revision 1)
+++ /issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp	(revision 1)
@@ -0,0 +1,131 @@
+/*! \file  ContourtoMesh
+    \brief: takes an  contour file, and figures out which nodes or elements from the mesh  
+    are inside this contour. 
+	usage:
+	[in_nod,in_elem]=ContourToMesh(index,x,y,contours,interptype,edgevalue);
+	
+	where:
+
+	input:
+
+		index,x,y: delaunay triangulation.
+		
+		contours: structure holding sets of vertices making open contours. 
+		
+		interptype: string definining type of interpolation ('element', or 'node', or 'element and node');
+
+		edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons
+
+	output:
+		in_nod: vector of flags (0 or 1), of size nods if interptype is set to 'node' or 'element and node', 
+				or of size 0 otherwise.
+		in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node', 
+				or of size 0 otherwise.
+*/
+	
+#include "./ContourToMesh.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
+
+	int i,j;
+
+	/* required input: */
+	double* index=NULL;
+	double* x=NULL;
+	double* y=NULL;
+	int     edgevalue;
+	char*   interptype=NULL;
+
+	/* output: */
+	Vec  in_nod=NULL;
+	int  nods;
+	Vec  in_elem=NULL;
+	int  nel;
+
+	//contours
+	int numcontours;
+	Contour** contours=NULL;
+	Contour*  contouri=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	//CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ContourToMeshUsage); Cant' use it here, as we have variable  outputs.
+	if((nlhs==0) && (nrhs=0)){
+		ContourToMeshUsage();
+		throw ErrorException(__FUNCT__," usage. See above");
+	}
+
+	/*Fetch inputs: */
+	FetchData((void**)&index,&nel,NULL,INDEXHANDLE,"Matrix","Mat");
+	FetchData((void**)&x,&nods,NULL,XHANDLE,"Matrix","Mat");
+	FetchData((void**)&y,NULL,NULL,YHANDLE,"Matrix","Mat");
+	FetchData((void**)&edgevalue,NULL,NULL,EDGEVALUEHANDLE,"Integer",NULL);
+
+	/*Recover list of contours from the 'contours' structure: */
+	//number of contours;
+	numcontours=mxGetNumberOfElements(CONTOURSHANDLE);
+	//allocate array:
+	contours=(Contour**)xmalloc(numcontours*sizeof(Contour*));
+
+	//go through contours, and populate xcontours and ycontours accordingly.
+	for(i=0;i<numcontours;i++){
+		//allocate
+		contouri=(Contour*)xmalloc(sizeof(Contour));
+		//retrieve dimension of this contour.
+		contouri->nods=(int)mxGetScalar(mxGetField(CONTOURSHANDLE,i,"nods"));
+		//set pointers.
+		contouri->x=mxGetPr(mxGetField(CONTOURSHANDLE,i,"x"));
+		contouri->y=mxGetPr(mxGetField(CONTOURSHANDLE,i,"y"));
+		*(contours+i)=contouri;
+	}
+
+	#ifdef _DEBUG_
+		printf("Contour echo: number of contours  %i \n",numcontours);
+		contouri=*(contours+numcontours-1);
+		printf("Number of grids %i\n",contouri->nods);
+		for (i=0;i<contouri->nods;i++){
+			printf("%lf %lf\n",*(contouri->x+i),*(contouri->y+i));
+		}
+	#endif
+
+	/*Recover  interptype: */
+	FetchData((void**)&interptype,NULL,NULL,INTERPTYPEHANDLE,"String",NULL);
+
+	/*Run interpolation routine: */
+	ContourToMeshx( &in_nod,&in_elem,index,x,y,contours,numcontours,interptype,nel,nods,edgevalue);
+
+	/* output: */
+	if (strcmp(interptype,"node")==0){
+		WriteData(PLHS0,in_nod,0,0,"Vector",NULL);
+	}
+	else if (strcmp(interptype,"element")==0){
+		WriteData(PLHS0,in_elem,0,0,"Vector",NULL);
+	}
+	else if (strcmp(interptype,"element and node")==0){
+		WriteData(PLHS0,in_nod,0,0,"Vector",NULL);
+		WriteData(PLHS1,in_elem,0,0,"Vector",NULL);
+	}
+	else throw ErrorException(__FUNCT__," wrong interpolation type");
+
+	/*end module: */
+	MODULEEND();
+	
+}
+
+void ContourToMeshUsage(void)
+{
+	printf("   usage:\n");
+	printf("   [in_nod,in_elem]=ContourToMesh(index,x,y,contours,interptype,edgevalue);\n\n");
+	printf("   where:\n");
+	printf("      index,x,y: delaunay triangulation.\n");
+	printf("      contours: structure holding sets of vertices making open contours.\n");
+	printf("      interptype: string definining type of interpolation ('element', or 'node').\n");
+	printf("      edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.\n");
+	printf("      in_nod: vector of flags (0 or 1), of size nods if interptype is set to 'node' or 'element and node', \n");
+	printf("              or of size 0 otherwise.\n");
+	printf("      in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node', \n");
+	printf("               or of size 0 otherwise.\n");
+	printf("\n");
+}
Index: /issm/trunk/src/mex/ContourToMesh/ContourToMesh.h
===================================================================
--- /issm/trunk/src/mex/ContourToMesh/ContourToMesh.h	(revision 1)
+++ /issm/trunk/src/mex/ContourToMesh/ContourToMesh.h	(revision 1)
@@ -0,0 +1,43 @@
+
+/*
+	ContourToMesh.h
+*/
+
+
+#ifndef _CONTOURTOMESH_H
+#define _CONTOURTOMESH_H
+
+/* local prototypes: */
+void ContourToMeshUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__
+#define __FUNCT__ "ContourToMesh"
+
+
+#ifndef ALL
+#define ALL 0
+#endif
+
+/* input macros: */
+#define INDEXHANDLE prhs[0]
+#define XHANDLE prhs[1]
+#define YHANDLE prhs[2]
+#define CONTOURSHANDLE prhs[3]
+#define INTERPTYPEHANDLE prhs[4]
+#define EDGEVALUEHANDLE prhs[5]
+
+/* serial output macros: */
+#define PLHS0 (mxArray**)&plhs[0]
+#define PLHS1 (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS 6
+
+
+#endif  /* _CONTOURTOMESH_H */
+
Index: /issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp
===================================================================
--- /issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp	(revision 1)
+++ /issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp	(revision 1)
@@ -0,0 +1,49 @@
+/*\file ControlConstrain.c
+ *\brief: constrain updated parameters during inverse control run
+ */
+
+#include "./ControlConstrain.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	double*  p_g=NULL;
+	double   mincontrolconstraint;
+	double   maxcontrolconstraint;
+	char*    control_type=NULL;
+	int      gsize;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ControlConstrainUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&p_g,&gsize,NULL,PG,"Vector","Vec");
+	FetchData((void**)&mincontrolconstraint,NULL,NULL,mxGetField(PARAMETERS,0,"mincontrolconstraint"),"Scalar",NULL);
+	FetchData((void**)&maxcontrolconstraint,NULL,NULL,mxGetField(PARAMETERS,0,"maxcontrolconstraint"),"Scalar",NULL);
+	FetchData((void**)&control_type,NULL,NULL,mxGetField(PARAMETERS,0,"control_type"),"String",NULL);
+
+	/*!Call core code: */
+	ControlConstrainx(p_g,gsize,mincontrolconstraint,maxcontrolconstraint,control_type);
+
+	/*write output : */
+	WriteData(PGOUT,p_g,gsize,1,"Vector","Vec");
+
+	/*Free ressources: */
+	xfree((void**)&control_type);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void ControlConstrainUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [p_g] = %s(p_g,parameters);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/ControlConstrain/ControlConstrain.h
===================================================================
--- /issm/trunk/src/mex/ControlConstrain/ControlConstrain.h	(revision 1)
+++ /issm/trunk/src/mex/ControlConstrain/ControlConstrain.h	(revision 1)
@@ -0,0 +1,34 @@
+/*
+	ControlConstrain.h
+*/
+
+
+#ifndef _CONTROLCONSTRAIN_H
+#define _CONTROLCONSTRAIN_H
+
+/* local prototypes: */
+void ControlConstrainUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "ControlConstrain"
+
+/* serial input macros: */
+#define PG (mxArray*)prhs[0]
+#define PARAMETERS (mxArray*)prhs[1]
+
+/* serial output macros: */
+#define PGOUT (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  2
+
+
+#endif  /* _CONTROLCONSTRAIN_H */
+
+
+
Index: /issm/trunk/src/mex/DataInterp/DataInterp.cpp
===================================================================
--- /issm/trunk/src/mex/DataInterp/DataInterp.cpp	(revision 1)
+++ /issm/trunk/src/mex/DataInterp/DataInterp.cpp	(revision 1)
@@ -0,0 +1,79 @@
+/*!\file DataInterp.c
+ * \brief: data interpolation from a list of (x,y,values) into mesh grids
+ 
+	DataInterp.c
+
+	usage:
+	data_mesh=DataInterp(x,y,data,x_mesh,y_mesh);
+	
+	where:
+
+		input:
+		x,y: coordinates of matrix data
+		data - matrix holding the data to be interpolated onto the mesh.
+		x_mesh,y_mesh: coordinates of the mesh grids onto which we interpolate.
+		
+		output: 
+		data_mesh:  vector of mesh interpolated data.
+
+*/
+	
+#include "./DataInterp.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
+
+	int i,j;
+
+	/*input: */
+	double* x=NULL;
+	int     x_rows;
+	
+	double* y=NULL;
+	int     y_rows;
+
+	double* data=NULL; 
+	int     data_rows,data_cols;
+
+	double* x_mesh=NULL;
+	double* y_mesh=NULL;
+	
+	int     x_mesh_rows;
+	int     y_mesh_rows;
+
+	/* output: */
+	Vec  data_mesh=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&DataInterpUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&x,&x_rows,NULL,XHANDLE,"Matrix","Mat");
+	FetchData((void**)&y,&y_rows,NULL,YHANDLE,"Matrix","Mat");
+	FetchData((void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");
+	FetchData((void**)&x_mesh,&x_mesh_rows,NULL,XMESHHANDLE,"Matrix","Mat");
+	FetchData((void**)&y_mesh,&y_mesh_rows,NULL,YMESHHANDLE,"Matrix","Mat");
+
+	/* Run core computations: */
+	DataInterpx( &data_mesh, x, x_rows,  y, y_rows, data, data_rows,data_cols, x_mesh, y_mesh, x_mesh_rows);
+
+	/*Write data: */
+	WriteData(DATAMESH,data_mesh,0,0,"Vector",NULL);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void DataInterpUsage(void)
+{
+	_printf_("   usage:\n");
+	_printf_("   data_mesh=DataInterp(x,y,data,x_mesh,y_mesh);\n\n");
+	_printf_("   where:\n");
+	_printf_("      x,y: coordinates of matrix data\n");
+	_printf_("      data - matrix holding the data to be interpolated onto the mesh.\n");
+	_printf_("      x_mesh,y_mesh: coordinates of the mesh grids onto which we interpolate.\n");
+	_printf_("      data_mesh:  vector of mesh interpolated data.\n");
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/DataInterp/DataInterp.h
===================================================================
--- /issm/trunk/src/mex/DataInterp/DataInterp.h	(revision 1)
+++ /issm/trunk/src/mex/DataInterp/DataInterp.h	(revision 1)
@@ -0,0 +1,37 @@
+/*!\file DataInterp.h
+ * \brief: prototype for Data Interpolation mex module.
+ */
+
+#ifndef _DATAINTERP_H
+#define _DATAINTERP_H
+
+/* local prototypes: */
+void DataInterpUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "DataInterp"
+
+#undef CLEANUP
+#define CLEANUP DataInterpLocalCleanup();
+
+
+/* serial input macros: */
+#define XHANDLE prhs[0]
+#define YHANDLE prhs[1]
+#define DATAHANDLE prhs[2]
+#define XMESHHANDLE prhs[3]
+#define YMESHHANDLE prhs[4]
+
+/* serial output macros: */
+#define DATAMESH (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  5
+
+#endif  /* _DATAINTERP_H */
+
Index: /issm/trunk/src/mex/Dof/Dof.cpp
===================================================================
--- /issm/trunk/src/mex/Dof/Dof.cpp	(revision 1)
+++ /issm/trunk/src/mex/Dof/Dof.cpp	(revision 1)
@@ -0,0 +1,60 @@
+/*\file Dof.c
+ *\brief: build degrees of freedom for every grid.
+ */
+
+#include "./Dof.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* nodes=NULL;
+	DataSet* elements=NULL;
+	DataSet* params=NULL;
+
+	/* output datasets: */
+	Vec partition=NULL;
+	Vec tpartition=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&DofUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
+	FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
+	FetchData((void**)&params,NULL,NULL,PARAMS,"DataSet",NULL);
+
+	/*!Generate internal degree of freedom numbers: */
+	Dofx(&partition, &tpartition,elements,nodes,params); 
+
+	/*partition and tpartition should be incremented by 1: */
+	VecShift(partition,1.0); //matlab indexing starts at 1.
+	VecShift(tpartition,1.0);
+
+	/*write output datasets: */
+	WriteData(NODES,nodes,0,0,"DataSet",NULL);
+	WriteData(PARTITION,partition,0,0,"Vector",NULL);
+	WriteData(TPARTITION,tpartition,0,0,"Vector",NULL);
+
+	/*Free ressources: */
+	delete nodes;
+	delete elements;
+	delete params;
+	VecFree(&partition);
+	VecFree(&tpartition);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void DofUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [nodes,part,tpart] = %s(elements, nodes,params);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Dof/Dof.h
===================================================================
--- /issm/trunk/src/mex/Dof/Dof.h	(revision 1)
+++ /issm/trunk/src/mex/Dof/Dof.h	(revision 1)
@@ -0,0 +1,36 @@
+
+/*
+	Dof.h
+*/
+
+
+#ifndef _DOF_H
+#define _DOF_H
+
+/* local prototypes: */
+void DofUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Dof"
+
+/* serial input macros: */
+#define ELEMENTS (mxArray*)prhs[0]
+#define NODESIN (mxArray*)prhs[1]
+#define PARAMS (mxArray*)prhs[2]
+
+/* serial output macros: */
+#define NODES (mxArray**)&plhs[0]
+#define PARTITION (mxArray**)&plhs[1]
+#define TPARTITION (mxArray**)&plhs[2]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  3
+#undef NRHS
+#define NRHS  3
+
+
+#endif  /* _DOF_H */
+
Index: /issm/trunk/src/mex/Du/Du.cpp
===================================================================
--- /issm/trunk/src/mex/Du/Du.cpp	(revision 1)
+++ /issm/trunk/src/mex/Du/Du.cpp	(revision 1)
@@ -0,0 +1,69 @@
+/*\file Du.c
+ *\brief: compute diff between observed and modeled velocity
+ */
+
+#include "./Du.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* elements=NULL;
+	DataSet* nodes=NULL;
+	DataSet* loads=NULL;
+	DataSet* materials=NULL;
+	int      analysis_type;
+	double*  u_g=NULL;
+	double*  u_g_obs=NULL;
+	ParameterInputs* inputs=NULL;
+
+	/* output datasets: */
+	Vec du_g=NULL;
+
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&DuUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
+	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
+	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
+	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	FetchData((void**)&analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"analysis_type"),"Integer",NULL);
+	FetchData((void**)&u_g,NULL,NULL,UG,"Vector","Vec");
+	FetchData((void**)&u_g_obs,NULL,NULL,UGOBS,"Vector","Vec");
+
+	/*Fetch inputs: */
+	ParameterInputsInit(&inputs,INPUTS);
+
+	/*!Call core code: */
+	Dux(&du_g, elements,nodes,loads,materials,u_g,u_g_obs,inputs,analysis_type);
+
+	/*write output : */
+	WriteData(DUG,du_g,0,0,"Vector",NULL);
+
+	/*Free ressources: */
+	delete elements;
+	delete nodes;
+	delete loads;
+	delete materials;
+	xfree((void**)&u_g);
+	xfree((void**)&u_g_obs);
+	VecFree(&du_g);
+	DeleteParameterInputs(&inputs);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void DuUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [du_g] = %s(elements, nodes,loads, materials, parameters, u_g, u_g_obs,inputs);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Du/Du.h
===================================================================
--- /issm/trunk/src/mex/Du/Du.h	(revision 1)
+++ /issm/trunk/src/mex/Du/Du.h	(revision 1)
@@ -0,0 +1,38 @@
+
+/*
+	Du.h
+*/
+
+
+#ifndef _DU_H
+#define _DU_H
+
+/* local prototypes: */
+void DuUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Du"
+
+/* serial input macros: */
+#define ELEMENTS (mxArray*)prhs[0]
+#define NODES (mxArray*)prhs[1]
+#define LOADS (mxArray*)prhs[2]
+#define MATERIALS (mxArray*)prhs[3]
+#define PARAMETERS (mxArray*)prhs[4]
+#define UG (mxArray*)prhs[5]
+#define UGOBS (mxArray*)prhs[6]
+#define INPUTS (mxArray*)prhs[7]
+
+/* serial output macros: */
+#define DUG (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  8
+
+
+#endif  /* _DU_H */
Index: /issm/trunk/src/mex/Echo/Echo.cpp
===================================================================
--- /issm/trunk/src/mex/Echo/Echo.cpp	(revision 1)
+++ /issm/trunk/src/mex/Echo/Echo.cpp	(revision 1)
@@ -0,0 +1,36 @@
+/*\file Echo.c
+ *\brief:  echo a dataset from a matlab workspace handle.
+ */
+
+#include "./Echo.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* dataset=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&EchoUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&dataset,NULL,NULL,DATASET,"DataSet",NULL);
+
+	/*Echo dataset: */
+	dataset->Echo();
+	
+	/*end module: */
+	MODULEEND();
+}
+
+void EchoUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: %s(m.dataset);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Echo/Echo.h
===================================================================
--- /issm/trunk/src/mex/Echo/Echo.h	(revision 1)
+++ /issm/trunk/src/mex/Echo/Echo.h	(revision 1)
@@ -0,0 +1,25 @@
+/*!\file:  Echo.h
+ * \brief header file for Echo module.
+ */ 
+
+#ifndef _ECHO_H
+#define _ECHO_H
+
+/* local prototypes: */
+void EchoUsage(void);
+
+#include "../../c/issm.h"
+    
+/* serial input macros: */
+#define DATASET (mxArray*)prhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  0
+#undef NRHS
+#define NRHS  1
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Echo"
+
+#endif  /* _ECHO_H */
Index: /issm/trunk/src/mex/Gradj/Gradj.cpp
===================================================================
--- /issm/trunk/src/mex/Gradj/Gradj.cpp	(revision 1)
+++ /issm/trunk/src/mex/Gradj/Gradj.cpp	(revision 1)
@@ -0,0 +1,72 @@
+/*\file Gradj.c
+ *\brief: compute gradients for inverse control method
+ */
+
+#include "./Gradj.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* elements=NULL;
+	DataSet* nodes=NULL;
+	DataSet* loads=NULL;
+	DataSet* materials=NULL;
+	int      analysis_type;
+	char*    control_type=NULL;
+	double*  u_g=NULL;
+	double*  lambda_g=NULL;
+	ParameterInputs* inputs=NULL;
+
+	/* output datasets: */
+	Vec grad_g=NULL;
+
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&GradjUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
+	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
+	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
+	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	FetchData((void**)&analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"analysis_type"),"Integer",NULL);
+	FetchData((void**)&control_type,NULL,NULL,mxGetField(PARAMETERS,0,"control_type"),"String",NULL);
+	FetchData((void**)&u_g,NULL,NULL,UG,"Vector","Vec");
+	FetchData((void**)&lambda_g,NULL,NULL,LAMBDAG,"Vector","Vec");
+
+	/*Fetch inputs: */
+	ParameterInputsInit(&inputs,INPUTS);
+
+	/*!Call core code: */
+	Gradjx(&grad_g, elements,nodes,loads,materials,u_g,lambda_g,inputs,analysis_type,control_type);
+
+	/*write output : */
+	WriteData(GRADG,grad_g,0,0,"Vector",NULL);
+
+	/*Free ressources: */
+	delete elements;
+	delete nodes;
+	delete loads;
+	delete materials;
+	xfree((void**)&u_g);
+	xfree((void**)&lambda_g);
+	xfree((void**)&control_type);
+	DeleteParameterInputs(&inputs);
+	VecFree(&grad_g);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void GradjUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [grad_g] = %s(elements, nodes,loads, materials, parameters, u_g, lambda_g,inputs);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Gradj/Gradj.h
===================================================================
--- /issm/trunk/src/mex/Gradj/Gradj.h	(revision 1)
+++ /issm/trunk/src/mex/Gradj/Gradj.h	(revision 1)
@@ -0,0 +1,41 @@
+
+/*
+	Gradj.h
+*/
+
+
+#ifndef _GRADJ_H
+#define _GRADJ_H
+
+/* local prototypes: */
+void GradjUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Gradj"
+
+/* serial input macros: */
+#define ELEMENTS (mxArray*)prhs[0]
+#define NODES (mxArray*)prhs[1]
+#define LOADS (mxArray*)prhs[2]
+#define MATERIALS (mxArray*)prhs[3]
+#define PARAMETERS (mxArray*)prhs[4]
+#define UG (mxArray*)prhs[5]
+#define LAMBDAG (mxArray*)prhs[6]
+#define INPUTS (mxArray*)prhs[7]
+
+/* serial output macros: */
+#define GRADG (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  8
+
+
+#endif  /* _GRADJ_H */
+
+
+
Index: /issm/trunk/src/mex/HoleFiller/HoleFiller.cpp
===================================================================
--- /issm/trunk/src/mex/HoleFiller/HoleFiller.cpp	(revision 1)
+++ /issm/trunk/src/mex/HoleFiller/HoleFiller.cpp	(revision 1)
@@ -0,0 +1,69 @@
+/*!\file:  HoleFiller.cpp
+ * \brief fill holes in matlab velocity array
+	this matlab module is an adaptation of a routine written by Robber 
+	Crippen.  The original routine was designed for the SRTM mission at JPL, 
+	and can be found in the current directory, under the name 
+	HoleFillerCrippen.  It fills void holes in an image, using an interpolation 
+	algorithm, and optionnally a smoothing algorithm. 
+	This matlab module extends the Crippen routine to be used in Matlab, 
+	using double arrays found in the workspace, and loaded directly into memory.
+*/
+
+
+#include "./HoleFiller.h"
+
+void mexFunction( int nlhs, mxArray* plhs[],
+				  int nrhs, const mxArray* prhs[])
+{
+
+	int i,j,noerr;
+
+	/* required input: */
+	double* imagein=NULL;
+	int     imagein_rows,imagein_cols;
+	int     smooth_flag;
+	int     smooth;
+
+
+	/* output: */
+	mxArray* pfield=NULL;
+	double* imageout=NULL;
+	int     imageout_rows,imageout_cols;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&HoleFillerUsage);
+
+	/*Fetch data: */
+	FetchData((void**)&imagein,&imagein_rows,&imagein_cols,IMAGEIN,"Matrix","Mat");
+	FetchData((void**)&smooth_flag,NULL,NULL,SMOOTH,"Integer",NULL);
+	
+	/*Get smooth flag setup: */
+	if (smooth_flag==0)
+		smooth=1;
+	else
+		smooth=0;
+
+	/*Run core hole filler routine: */
+	HoleFillerx( &imageout,imagein,imagein_rows,imagein_cols,smooth);
+
+	/* output: */
+	WriteData(IMAGEOUT,imageout,imagein_cols,imagein_rows,"Matrix","Mat");
+	
+	/*end module: */
+	MODULEEND();
+}
+
+
+void HoleFillerUsage(void)
+{
+	printf("   HoleFiller usage:\n");
+	printf("   [image_out]=HoleFiller(image_in,smooth);\n\n");
+	printf("   where:\n");
+	printf("      image_in in double format\n");
+	printf("      smooth: 1 to smooth with a box filer, 0 to leave data raw\n");
+	printf("      image_out in double format\n");
+	printf("\n");
+}
Index: /issm/trunk/src/mex/HoleFiller/HoleFiller.h
===================================================================
--- /issm/trunk/src/mex/HoleFiller/HoleFiller.h	(revision 1)
+++ /issm/trunk/src/mex/HoleFiller/HoleFiller.h	(revision 1)
@@ -0,0 +1,32 @@
+
+/*
+	HoleFiller.h
+*/
+
+
+#ifndef _HOLEFILLER_H
+#define _HOLEFILLER_H
+
+/* local prototypes: */
+void HoleFillerUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "HoleFiller"
+
+
+/* serial input macros: */
+#define IMAGEIN prhs[0]
+#define SMOOTH prhs[1]
+
+/* serial output macros: */
+#define IMAGEOUT &plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  2
+
+#endif  /* _HOLEFILLER_H */
Index: /issm/trunk/src/mex/Makefile.am
===================================================================
--- /issm/trunk/src/mex/Makefile.am	(revision 1)
+++ /issm/trunk/src/mex/Makefile.am	(revision 1)
@@ -0,0 +1,163 @@
+INCLUDES = @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@
+EXEEXT=$(MEXEXT)
+
+if NOSERIAL
+bin_PROGRAMS = 
+else
+bin_PROGRAMS =  BuildNodeSets\
+				ConfigureObjects \
+				ContourToMesh \
+				ControlConstrain \
+				DataInterp \
+				Dof\
+				Du\
+				Echo\
+				Gradj\
+				HoleFiller \
+				Mergesolutionfromftog\
+				MeshPartition\
+				Misfit \
+				ModelProcessor \
+				MpcNodes\
+				NormalizeConstraints\
+				Orth\
+				ParamsToWorkspace\
+				PenaltyConstraints\
+				PenaltySystemMatrices\
+				ProcessParams\
+				Reduceloadfromgtof\
+				Reducematrixfromgtof\
+				Reducevectorgtos\
+				SetStructureField\
+				Solver\
+				SpcNodes\
+				SystemMatrices\
+				Test\
+				TriMesh\
+				TriMeshProcessRifts\
+				TriMeshRefine\
+				UpdateFromInputs
+
+endif
+
+LDADD =  $(MEXLIB) $(TRIANGLELIB)  $(PETSCLIB) ../c/libISSM.a $(METISLIB)
+
+AM_LDFLAGS = $(MEXLINK)
+
+#Matlab
+AM_CFLAGS=  -DMATLAB -fPIC -fno-omit-frame-pointer -std=c99 -D_GNU_SOURCE -pthread -fexceptions
+AM_CXXFLAGS=  -DMATLAB  -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread 
+
+#Triangle library
+AM_CXXFLAGS+=  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
+AM_CFLAGS+=   -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER 
+
+
+#64 vs 32 bits
+if LARGEARRAYS
+AM_CFLAGS += -D__GCC4BUILD__  -D_SERIAL_
+AM_CXXFLAGS += -D__GCC4BUILD__ -D_SERIAL_ 
+else
+AM_CFLAGS += -DMX_COMPAT_32 -D_SERIAL_
+AM_CXXFLAGS += -DMX_COMPAT_32 -D_SERIAL_
+endif
+
+BuildNodeSets_SOURCES = BuildNodeSets/BuildNodeSets.cpp\
+			  BuildNodeSets/BuildNodeSets.h
+
+ConfigureObjects_SOURCES = ConfigureObjects/ConfigureObjects.cpp\
+			  ConfigureObjects/ConfigureObjects.h
+
+ContourToMesh_SOURCES = ContourToMesh/ContourToMesh.cpp\
+			  ContourToMesh/ContourToMesh.h
+
+ControlConstrain_SOURCES = ControlConstrain/ControlConstrain.cpp\
+			  ControlConstrain/ControlConstrain.h
+
+DataInterp_SOURCES = DataInterp/DataInterp.cpp\
+			  DataInterp/DataInterp.h
+
+Dof_SOURCES = Dof/Dof.cpp\
+			  Dof/Dof.h
+
+Du_SOURCES = Du/Du.cpp\
+			  Du/Du.h
+
+Echo_SOURCES = Echo/Echo.cpp\
+			  Echo/Echo.h
+
+Gradj_SOURCES = Gradj/Gradj.cpp\
+			  Gradj/Gradj.h
+
+Test_SOURCES = Test/Test.cpp\
+			  Test/Test.h
+
+HoleFiller_SOURCES = HoleFiller/HoleFiller.cpp\
+			  HoleFiller/HoleFiller.h
+
+Mergesolutionfromftog_SOURCES = Mergesolutionfromftog/Mergesolutionfromftog.cpp\
+			  Mergesolutionfromftog/Mergesolutionfromftog.h
+
+MeshPartition_SOURCES = MeshPartition/MeshPartition.cpp\
+			  MeshPartition/MeshPartition.h
+
+ModelProcessor_SOURCES =  ModelProcessor/ModelProcessor.cpp \
+						  ModelProcessor/ModelProcessor.h
+
+Misfit_SOURCES =  Misfit/Misfit.cpp \
+				  Misfit/Misfit.h
+
+MpcNodes_SOURCES = MpcNodes/MpcNodes.cpp\
+			  MpcNodes/MpcNodes.h
+
+NormalizeConstraints_SOURCES = NormalizeConstraints/NormalizeConstraints.cpp\
+			  NormalizeConstraints/NormalizeConstraints.h
+
+Orth_SOURCES = Orth/Orth.cpp\
+			  Orth/Orth.h
+
+ParamsToWorkspace_SOURCES = ParamsToWorkspace/ParamsToWorkspace.cpp\
+			  ParamsToWorkspace/ParamsToWorkspace.h
+
+PenaltyConstraints_SOURCES = PenaltyConstraints/PenaltyConstraints.cpp\
+			  PenaltyConstraints/PenaltyConstraints.h
+
+ProcessParams_SOURCES = ProcessParams/ProcessParams.cpp\
+			  ProcessParams/ProcessParams.h
+
+PenaltySystemMatrices_SOURCES = PenaltySystemMatrices/PenaltySystemMatrices.cpp\
+			  PenaltySystemMatrices/PenaltySystemMatrices.h
+
+Reducematrixfromgtof_SOURCES = Reducematrixfromgtof/Reducematrixfromgtof.cpp\
+			  Reducematrixfromgtof/Reducematrixfromgtof.h
+
+Reduceloadfromgtof_SOURCES = Reduceloadfromgtof/Reduceloadfromgtof.cpp\
+			  Reduceloadfromgtof/Reduceloadfromgtof.h
+
+Reducevectorgtos_SOURCES = Reducevectorgtos/Reducevectorgtos.cpp\
+			  Reducevectorgtos/Reducevectorgtos.h
+
+SetStructureField_SOURCES = SetStructureField/SetStructureField.cpp\
+			  SetStructureField/SetStructureField.h
+
+Solver_SOURCES = Solver/Solver.cpp\
+			  Solver/Solver.h
+
+SpcNodes_SOURCES = SpcNodes/SpcNodes.cpp\
+			  SpcNodes/SpcNodes.h
+
+SystemMatrices_SOURCES = SystemMatrices/SystemMatrices.cpp\
+			  SystemMatrices/SystemMatrices.h
+
+TriMesh_SOURCES = TriMesh/TriMesh.cpp\
+			  TriMesh/TriMesh.h
+
+TriMeshProcessRifts_SOURCES = TriMeshProcessRifts/TriMeshProcessRifts.cpp\
+			  TriMeshProcessRifts/TriMeshProcessRifts.h
+
+TriMeshRefine_SOURCES = TriMeshRefine/TriMeshRefine.cpp\
+			  TriMeshRefine/TriMeshRefine.h
+
+UpdateFromInputs_SOURCES = UpdateFromInputs/UpdateFromInputs.cpp\
+			  UpdateFromInputs/UpdateFromInputs.h
+
Index: /issm/trunk/src/mex/Makefile.in
===================================================================
--- /issm/trunk/src/mex/Makefile.in	(revision 1)
+++ /issm/trunk/src/mex/Makefile.in	(revision 1)
@@ -0,0 +1,1408 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@NOSERIAL_FALSE@bin_PROGRAMS = BuildNodeSets$(EXEEXT) \
+@NOSERIAL_FALSE@	ConfigureObjects$(EXEEXT) \
+@NOSERIAL_FALSE@	ContourToMesh$(EXEEXT) \
+@NOSERIAL_FALSE@	ControlConstrain$(EXEEXT) DataInterp$(EXEEXT) \
+@NOSERIAL_FALSE@	Dof$(EXEEXT) Du$(EXEEXT) Echo$(EXEEXT) \
+@NOSERIAL_FALSE@	Gradj$(EXEEXT) HoleFiller$(EXEEXT) \
+@NOSERIAL_FALSE@	Mergesolutionfromftog$(EXEEXT) \
+@NOSERIAL_FALSE@	MeshPartition$(EXEEXT) Misfit$(EXEEXT) \
+@NOSERIAL_FALSE@	ModelProcessor$(EXEEXT) MpcNodes$(EXEEXT) \
+@NOSERIAL_FALSE@	NormalizeConstraints$(EXEEXT) Orth$(EXEEXT) \
+@NOSERIAL_FALSE@	ParamsToWorkspace$(EXEEXT) \
+@NOSERIAL_FALSE@	PenaltyConstraints$(EXEEXT) \
+@NOSERIAL_FALSE@	PenaltySystemMatrices$(EXEEXT) \
+@NOSERIAL_FALSE@	ProcessParams$(EXEEXT) \
+@NOSERIAL_FALSE@	Reduceloadfromgtof$(EXEEXT) \
+@NOSERIAL_FALSE@	Reducematrixfromgtof$(EXEEXT) \
+@NOSERIAL_FALSE@	Reducevectorgtos$(EXEEXT) \
+@NOSERIAL_FALSE@	SetStructureField$(EXEEXT) Solver$(EXEEXT) \
+@NOSERIAL_FALSE@	SpcNodes$(EXEEXT) SystemMatrices$(EXEEXT) \
+@NOSERIAL_FALSE@	Test$(EXEEXT) TriMesh$(EXEEXT) \
+@NOSERIAL_FALSE@	TriMeshProcessRifts$(EXEEXT) \
+@NOSERIAL_FALSE@	TriMeshRefine$(EXEEXT) \
+@NOSERIAL_FALSE@	UpdateFromInputs$(EXEEXT)
+
+#64 vs 32 bits
+@LARGEARRAYS_TRUE@am__append_1 = -D__GCC4BUILD__  -D_SERIAL_
+@LARGEARRAYS_TRUE@am__append_2 = -D__GCC4BUILD__ -D_SERIAL_ 
+@LARGEARRAYS_FALSE@am__append_3 = -DMX_COMPAT_32 -D_SERIAL_
+@LARGEARRAYS_FALSE@am__append_4 = -DMX_COMPAT_32 -D_SERIAL_
+subdir = src/mex
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/issm_options.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_BuildNodeSets_OBJECTS = BuildNodeSets.$(OBJEXT)
+BuildNodeSets_OBJECTS = $(am_BuildNodeSets_OBJECTS)
+BuildNodeSets_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+BuildNodeSets_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_ConfigureObjects_OBJECTS = ConfigureObjects.$(OBJEXT)
+ConfigureObjects_OBJECTS = $(am_ConfigureObjects_OBJECTS)
+ConfigureObjects_LDADD = $(LDADD)
+ConfigureObjects_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_ContourToMesh_OBJECTS = ContourToMesh.$(OBJEXT)
+ContourToMesh_OBJECTS = $(am_ContourToMesh_OBJECTS)
+ContourToMesh_LDADD = $(LDADD)
+ContourToMesh_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_ControlConstrain_OBJECTS = ControlConstrain.$(OBJEXT)
+ControlConstrain_OBJECTS = $(am_ControlConstrain_OBJECTS)
+ControlConstrain_LDADD = $(LDADD)
+ControlConstrain_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_DataInterp_OBJECTS = DataInterp.$(OBJEXT)
+DataInterp_OBJECTS = $(am_DataInterp_OBJECTS)
+DataInterp_LDADD = $(LDADD)
+DataInterp_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_Dof_OBJECTS = Dof.$(OBJEXT)
+Dof_OBJECTS = $(am_Dof_OBJECTS)
+Dof_LDADD = $(LDADD)
+Dof_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_Du_OBJECTS = Du.$(OBJEXT)
+Du_OBJECTS = $(am_Du_OBJECTS)
+Du_LDADD = $(LDADD)
+Du_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_Echo_OBJECTS = Echo.$(OBJEXT)
+Echo_OBJECTS = $(am_Echo_OBJECTS)
+Echo_LDADD = $(LDADD)
+Echo_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_Gradj_OBJECTS = Gradj.$(OBJEXT)
+Gradj_OBJECTS = $(am_Gradj_OBJECTS)
+Gradj_LDADD = $(LDADD)
+Gradj_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_HoleFiller_OBJECTS = HoleFiller.$(OBJEXT)
+HoleFiller_OBJECTS = $(am_HoleFiller_OBJECTS)
+HoleFiller_LDADD = $(LDADD)
+HoleFiller_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_Mergesolutionfromftog_OBJECTS = Mergesolutionfromftog.$(OBJEXT)
+Mergesolutionfromftog_OBJECTS = $(am_Mergesolutionfromftog_OBJECTS)
+Mergesolutionfromftog_LDADD = $(LDADD)
+Mergesolutionfromftog_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_MeshPartition_OBJECTS = MeshPartition.$(OBJEXT)
+MeshPartition_OBJECTS = $(am_MeshPartition_OBJECTS)
+MeshPartition_LDADD = $(LDADD)
+MeshPartition_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_Misfit_OBJECTS = Misfit.$(OBJEXT)
+Misfit_OBJECTS = $(am_Misfit_OBJECTS)
+Misfit_LDADD = $(LDADD)
+Misfit_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_ModelProcessor_OBJECTS = ModelProcessor.$(OBJEXT)
+ModelProcessor_OBJECTS = $(am_ModelProcessor_OBJECTS)
+ModelProcessor_LDADD = $(LDADD)
+ModelProcessor_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_MpcNodes_OBJECTS = MpcNodes.$(OBJEXT)
+MpcNodes_OBJECTS = $(am_MpcNodes_OBJECTS)
+MpcNodes_LDADD = $(LDADD)
+MpcNodes_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_NormalizeConstraints_OBJECTS = NormalizeConstraints.$(OBJEXT)
+NormalizeConstraints_OBJECTS = $(am_NormalizeConstraints_OBJECTS)
+NormalizeConstraints_LDADD = $(LDADD)
+NormalizeConstraints_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_Orth_OBJECTS = Orth.$(OBJEXT)
+Orth_OBJECTS = $(am_Orth_OBJECTS)
+Orth_LDADD = $(LDADD)
+Orth_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_ParamsToWorkspace_OBJECTS = ParamsToWorkspace.$(OBJEXT)
+ParamsToWorkspace_OBJECTS = $(am_ParamsToWorkspace_OBJECTS)
+ParamsToWorkspace_LDADD = $(LDADD)
+ParamsToWorkspace_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_PenaltyConstraints_OBJECTS = PenaltyConstraints.$(OBJEXT)
+PenaltyConstraints_OBJECTS = $(am_PenaltyConstraints_OBJECTS)
+PenaltyConstraints_LDADD = $(LDADD)
+PenaltyConstraints_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_PenaltySystemMatrices_OBJECTS = PenaltySystemMatrices.$(OBJEXT)
+PenaltySystemMatrices_OBJECTS = $(am_PenaltySystemMatrices_OBJECTS)
+PenaltySystemMatrices_LDADD = $(LDADD)
+PenaltySystemMatrices_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_ProcessParams_OBJECTS = ProcessParams.$(OBJEXT)
+ProcessParams_OBJECTS = $(am_ProcessParams_OBJECTS)
+ProcessParams_LDADD = $(LDADD)
+ProcessParams_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_Reduceloadfromgtof_OBJECTS = Reduceloadfromgtof.$(OBJEXT)
+Reduceloadfromgtof_OBJECTS = $(am_Reduceloadfromgtof_OBJECTS)
+Reduceloadfromgtof_LDADD = $(LDADD)
+Reduceloadfromgtof_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_Reducematrixfromgtof_OBJECTS = Reducematrixfromgtof.$(OBJEXT)
+Reducematrixfromgtof_OBJECTS = $(am_Reducematrixfromgtof_OBJECTS)
+Reducematrixfromgtof_LDADD = $(LDADD)
+Reducematrixfromgtof_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_Reducevectorgtos_OBJECTS = Reducevectorgtos.$(OBJEXT)
+Reducevectorgtos_OBJECTS = $(am_Reducevectorgtos_OBJECTS)
+Reducevectorgtos_LDADD = $(LDADD)
+Reducevectorgtos_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_SetStructureField_OBJECTS = SetStructureField.$(OBJEXT)
+SetStructureField_OBJECTS = $(am_SetStructureField_OBJECTS)
+SetStructureField_LDADD = $(LDADD)
+SetStructureField_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_Solver_OBJECTS = Solver.$(OBJEXT)
+Solver_OBJECTS = $(am_Solver_OBJECTS)
+Solver_LDADD = $(LDADD)
+Solver_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_SpcNodes_OBJECTS = SpcNodes.$(OBJEXT)
+SpcNodes_OBJECTS = $(am_SpcNodes_OBJECTS)
+SpcNodes_LDADD = $(LDADD)
+SpcNodes_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_SystemMatrices_OBJECTS = SystemMatrices.$(OBJEXT)
+SystemMatrices_OBJECTS = $(am_SystemMatrices_OBJECTS)
+SystemMatrices_LDADD = $(LDADD)
+SystemMatrices_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_Test_OBJECTS = Test.$(OBJEXT)
+Test_OBJECTS = $(am_Test_OBJECTS)
+Test_LDADD = $(LDADD)
+Test_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_TriMesh_OBJECTS = TriMesh.$(OBJEXT)
+TriMesh_OBJECTS = $(am_TriMesh_OBJECTS)
+TriMesh_LDADD = $(LDADD)
+TriMesh_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) ../c/libISSM.a $(am__DEPENDENCIES_1)
+am_TriMeshProcessRifts_OBJECTS = TriMeshProcessRifts.$(OBJEXT)
+TriMeshProcessRifts_OBJECTS = $(am_TriMeshProcessRifts_OBJECTS)
+TriMeshProcessRifts_LDADD = $(LDADD)
+TriMeshProcessRifts_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_TriMeshRefine_OBJECTS = TriMeshRefine.$(OBJEXT)
+TriMeshRefine_OBJECTS = $(am_TriMeshRefine_OBJECTS)
+TriMeshRefine_LDADD = $(LDADD)
+TriMeshRefine_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+am_UpdateFromInputs_OBJECTS = UpdateFromInputs.$(OBJEXT)
+UpdateFromInputs_OBJECTS = $(am_UpdateFromInputs_OBJECTS)
+UpdateFromInputs_LDADD = $(LDADD)
+UpdateFromInputs_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ../c/libISSM.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(BuildNodeSets_SOURCES) $(ConfigureObjects_SOURCES) \
+	$(ContourToMesh_SOURCES) $(ControlConstrain_SOURCES) \
+	$(DataInterp_SOURCES) $(Dof_SOURCES) $(Du_SOURCES) \
+	$(Echo_SOURCES) $(Gradj_SOURCES) $(HoleFiller_SOURCES) \
+	$(Mergesolutionfromftog_SOURCES) $(MeshPartition_SOURCES) \
+	$(Misfit_SOURCES) $(ModelProcessor_SOURCES) \
+	$(MpcNodes_SOURCES) $(NormalizeConstraints_SOURCES) \
+	$(Orth_SOURCES) $(ParamsToWorkspace_SOURCES) \
+	$(PenaltyConstraints_SOURCES) $(PenaltySystemMatrices_SOURCES) \
+	$(ProcessParams_SOURCES) $(Reduceloadfromgtof_SOURCES) \
+	$(Reducematrixfromgtof_SOURCES) $(Reducevectorgtos_SOURCES) \
+	$(SetStructureField_SOURCES) $(Solver_SOURCES) \
+	$(SpcNodes_SOURCES) $(SystemMatrices_SOURCES) $(Test_SOURCES) \
+	$(TriMesh_SOURCES) $(TriMeshProcessRifts_SOURCES) \
+	$(TriMeshRefine_SOURCES) $(UpdateFromInputs_SOURCES)
+DIST_SOURCES = $(BuildNodeSets_SOURCES) $(ConfigureObjects_SOURCES) \
+	$(ContourToMesh_SOURCES) $(ControlConstrain_SOURCES) \
+	$(DataInterp_SOURCES) $(Dof_SOURCES) $(Du_SOURCES) \
+	$(Echo_SOURCES) $(Gradj_SOURCES) $(HoleFiller_SOURCES) \
+	$(Mergesolutionfromftog_SOURCES) $(MeshPartition_SOURCES) \
+	$(Misfit_SOURCES) $(ModelProcessor_SOURCES) \
+	$(MpcNodes_SOURCES) $(NormalizeConstraints_SOURCES) \
+	$(Orth_SOURCES) $(ParamsToWorkspace_SOURCES) \
+	$(PenaltyConstraints_SOURCES) $(PenaltySystemMatrices_SOURCES) \
+	$(ProcessParams_SOURCES) $(Reduceloadfromgtof_SOURCES) \
+	$(Reducematrixfromgtof_SOURCES) $(Reducevectorgtos_SOURCES) \
+	$(SetStructureField_SOURCES) $(Solver_SOURCES) \
+	$(SpcNodes_SOURCES) $(SystemMatrices_SOURCES) $(Test_SOURCES) \
+	$(TriMesh_SOURCES) $(TriMeshProcessRifts_SOURCES) \
+	$(TriMeshRefine_SOURCES) $(UpdateFromInputs_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLACSINCL = @BLACSINCL@
+BLACSLIB = @BLACSLIB@
+BLASLAPACKINCL = @BLASLAPACKINCL@
+BLASLAPACKLIB = @BLASLAPACKLIB@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = $(MEXEXT)
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLIBS = @FLIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MATLAB = @MATLAB@
+MATLABINCL = @MATLABINCL@
+MATLAB_MAJOR = @MATLAB_MAJOR@
+MATLAB_MINOR = @MATLAB_MINOR@
+MATLAB_VERSION = @MATLAB_VERSION@
+METISINCL = @METISINCL@
+METISLIB = @METISLIB@
+MEX = @MEX@
+MEXEXT = @MEXEXT@
+MEXLIB = @MEXLIB@
+MEXLINK = @MEXLINK@
+MKDIR_P = @MKDIR_P@
+MPIINCL = @MPIINCL@
+MPILIB = @MPILIB@
+MUMPSINCL = @MUMPSINCL@
+MUMPSLIB = @MUMPSLIB@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PETSCINCL = @PETSCINCL@
+PETSCLIB = @PETSCLIB@
+PLAPACKINCL = @PLAPACKINCL@
+PLAPACKLIB = @PLAPACKLIB@
+RANLIB = @RANLIB@
+SCALAPACKLIB = @SCALAPACKLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEPCINCL = @SLEPCINCL@
+SLEPCLIB = @SLEPCLIB@
+STRIP = @STRIP@
+TRIANGLEINCL = @TRIANGLEINCL@
+TRIANGLELIB = @TRIANGLELIB@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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@
+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@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@
+LDADD = $(MEXLIB) $(TRIANGLELIB)  $(PETSCLIB) ../c/libISSM.a $(METISLIB)
+AM_LDFLAGS = $(MEXLINK)
+
+#Matlab
+AM_CFLAGS = -DMATLAB -fPIC -fno-omit-frame-pointer -std=c99 \
+	-D_GNU_SOURCE -pthread -fexceptions -DTRILIBRARY \
+	-DANSI_DECLARATORS -DNO_TIMER $(am__append_1) $(am__append_3)
+
+#Triangle library
+AM_CXXFLAGS = -DMATLAB -ansi -D_GNU_SOURCE -fPIC \
+	-fno-omit-frame-pointer -pthread -DTRILIBRARY \
+	-DANSI_DECLARATORS -DNO_TIMER $(am__append_2) $(am__append_4)
+BuildNodeSets_SOURCES = BuildNodeSets/BuildNodeSets.cpp\
+			  BuildNodeSets/BuildNodeSets.h
+
+ConfigureObjects_SOURCES = ConfigureObjects/ConfigureObjects.cpp\
+			  ConfigureObjects/ConfigureObjects.h
+
+ContourToMesh_SOURCES = ContourToMesh/ContourToMesh.cpp\
+			  ContourToMesh/ContourToMesh.h
+
+ControlConstrain_SOURCES = ControlConstrain/ControlConstrain.cpp\
+			  ControlConstrain/ControlConstrain.h
+
+DataInterp_SOURCES = DataInterp/DataInterp.cpp\
+			  DataInterp/DataInterp.h
+
+Dof_SOURCES = Dof/Dof.cpp\
+			  Dof/Dof.h
+
+Du_SOURCES = Du/Du.cpp\
+			  Du/Du.h
+
+Echo_SOURCES = Echo/Echo.cpp\
+			  Echo/Echo.h
+
+Gradj_SOURCES = Gradj/Gradj.cpp\
+			  Gradj/Gradj.h
+
+Test_SOURCES = Test/Test.cpp\
+			  Test/Test.h
+
+HoleFiller_SOURCES = HoleFiller/HoleFiller.cpp\
+			  HoleFiller/HoleFiller.h
+
+Mergesolutionfromftog_SOURCES = Mergesolutionfromftog/Mergesolutionfromftog.cpp\
+			  Mergesolutionfromftog/Mergesolutionfromftog.h
+
+MeshPartition_SOURCES = MeshPartition/MeshPartition.cpp\
+			  MeshPartition/MeshPartition.h
+
+ModelProcessor_SOURCES = ModelProcessor/ModelProcessor.cpp \
+						  ModelProcessor/ModelProcessor.h
+
+Misfit_SOURCES = Misfit/Misfit.cpp \
+				  Misfit/Misfit.h
+
+MpcNodes_SOURCES = MpcNodes/MpcNodes.cpp\
+			  MpcNodes/MpcNodes.h
+
+NormalizeConstraints_SOURCES = NormalizeConstraints/NormalizeConstraints.cpp\
+			  NormalizeConstraints/NormalizeConstraints.h
+
+Orth_SOURCES = Orth/Orth.cpp\
+			  Orth/Orth.h
+
+ParamsToWorkspace_SOURCES = ParamsToWorkspace/ParamsToWorkspace.cpp\
+			  ParamsToWorkspace/ParamsToWorkspace.h
+
+PenaltyConstraints_SOURCES = PenaltyConstraints/PenaltyConstraints.cpp\
+			  PenaltyConstraints/PenaltyConstraints.h
+
+ProcessParams_SOURCES = ProcessParams/ProcessParams.cpp\
+			  ProcessParams/ProcessParams.h
+
+PenaltySystemMatrices_SOURCES = PenaltySystemMatrices/PenaltySystemMatrices.cpp\
+			  PenaltySystemMatrices/PenaltySystemMatrices.h
+
+Reducematrixfromgtof_SOURCES = Reducematrixfromgtof/Reducematrixfromgtof.cpp\
+			  Reducematrixfromgtof/Reducematrixfromgtof.h
+
+Reduceloadfromgtof_SOURCES = Reduceloadfromgtof/Reduceloadfromgtof.cpp\
+			  Reduceloadfromgtof/Reduceloadfromgtof.h
+
+Reducevectorgtos_SOURCES = Reducevectorgtos/Reducevectorgtos.cpp\
+			  Reducevectorgtos/Reducevectorgtos.h
+
+SetStructureField_SOURCES = SetStructureField/SetStructureField.cpp\
+			  SetStructureField/SetStructureField.h
+
+Solver_SOURCES = Solver/Solver.cpp\
+			  Solver/Solver.h
+
+SpcNodes_SOURCES = SpcNodes/SpcNodes.cpp\
+			  SpcNodes/SpcNodes.h
+
+SystemMatrices_SOURCES = SystemMatrices/SystemMatrices.cpp\
+			  SystemMatrices/SystemMatrices.h
+
+TriMesh_SOURCES = TriMesh/TriMesh.cpp\
+			  TriMesh/TriMesh.h
+
+TriMeshProcessRifts_SOURCES = TriMeshProcessRifts/TriMeshProcessRifts.cpp\
+			  TriMeshProcessRifts/TriMeshProcessRifts.h
+
+TriMeshRefine_SOURCES = TriMeshRefine/TriMeshRefine.cpp\
+			  TriMeshRefine/TriMeshRefine.h
+
+UpdateFromInputs_SOURCES = UpdateFromInputs/UpdateFromInputs.cpp\
+			  UpdateFromInputs/UpdateFromInputs.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/mex/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  src/mex/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+BuildNodeSets$(EXEEXT): $(BuildNodeSets_OBJECTS) $(BuildNodeSets_DEPENDENCIES) 
+	@rm -f BuildNodeSets$(EXEEXT)
+	$(CXXLINK) $(BuildNodeSets_OBJECTS) $(BuildNodeSets_LDADD) $(LIBS)
+ConfigureObjects$(EXEEXT): $(ConfigureObjects_OBJECTS) $(ConfigureObjects_DEPENDENCIES) 
+	@rm -f ConfigureObjects$(EXEEXT)
+	$(CXXLINK) $(ConfigureObjects_OBJECTS) $(ConfigureObjects_LDADD) $(LIBS)
+ContourToMesh$(EXEEXT): $(ContourToMesh_OBJECTS) $(ContourToMesh_DEPENDENCIES) 
+	@rm -f ContourToMesh$(EXEEXT)
+	$(CXXLINK) $(ContourToMesh_OBJECTS) $(ContourToMesh_LDADD) $(LIBS)
+ControlConstrain$(EXEEXT): $(ControlConstrain_OBJECTS) $(ControlConstrain_DEPENDENCIES) 
+	@rm -f ControlConstrain$(EXEEXT)
+	$(CXXLINK) $(ControlConstrain_OBJECTS) $(ControlConstrain_LDADD) $(LIBS)
+DataInterp$(EXEEXT): $(DataInterp_OBJECTS) $(DataInterp_DEPENDENCIES) 
+	@rm -f DataInterp$(EXEEXT)
+	$(CXXLINK) $(DataInterp_OBJECTS) $(DataInterp_LDADD) $(LIBS)
+Dof$(EXEEXT): $(Dof_OBJECTS) $(Dof_DEPENDENCIES) 
+	@rm -f Dof$(EXEEXT)
+	$(CXXLINK) $(Dof_OBJECTS) $(Dof_LDADD) $(LIBS)
+Du$(EXEEXT): $(Du_OBJECTS) $(Du_DEPENDENCIES) 
+	@rm -f Du$(EXEEXT)
+	$(CXXLINK) $(Du_OBJECTS) $(Du_LDADD) $(LIBS)
+Echo$(EXEEXT): $(Echo_OBJECTS) $(Echo_DEPENDENCIES) 
+	@rm -f Echo$(EXEEXT)
+	$(CXXLINK) $(Echo_OBJECTS) $(Echo_LDADD) $(LIBS)
+Gradj$(EXEEXT): $(Gradj_OBJECTS) $(Gradj_DEPENDENCIES) 
+	@rm -f Gradj$(EXEEXT)
+	$(CXXLINK) $(Gradj_OBJECTS) $(Gradj_LDADD) $(LIBS)
+HoleFiller$(EXEEXT): $(HoleFiller_OBJECTS) $(HoleFiller_DEPENDENCIES) 
+	@rm -f HoleFiller$(EXEEXT)
+	$(CXXLINK) $(HoleFiller_OBJECTS) $(HoleFiller_LDADD) $(LIBS)
+Mergesolutionfromftog$(EXEEXT): $(Mergesolutionfromftog_OBJECTS) $(Mergesolutionfromftog_DEPENDENCIES) 
+	@rm -f Mergesolutionfromftog$(EXEEXT)
+	$(CXXLINK) $(Mergesolutionfromftog_OBJECTS) $(Mergesolutionfromftog_LDADD) $(LIBS)
+MeshPartition$(EXEEXT): $(MeshPartition_OBJECTS) $(MeshPartition_DEPENDENCIES) 
+	@rm -f MeshPartition$(EXEEXT)
+	$(CXXLINK) $(MeshPartition_OBJECTS) $(MeshPartition_LDADD) $(LIBS)
+Misfit$(EXEEXT): $(Misfit_OBJECTS) $(Misfit_DEPENDENCIES) 
+	@rm -f Misfit$(EXEEXT)
+	$(CXXLINK) $(Misfit_OBJECTS) $(Misfit_LDADD) $(LIBS)
+ModelProcessor$(EXEEXT): $(ModelProcessor_OBJECTS) $(ModelProcessor_DEPENDENCIES) 
+	@rm -f ModelProcessor$(EXEEXT)
+	$(CXXLINK) $(ModelProcessor_OBJECTS) $(ModelProcessor_LDADD) $(LIBS)
+MpcNodes$(EXEEXT): $(MpcNodes_OBJECTS) $(MpcNodes_DEPENDENCIES) 
+	@rm -f MpcNodes$(EXEEXT)
+	$(CXXLINK) $(MpcNodes_OBJECTS) $(MpcNodes_LDADD) $(LIBS)
+NormalizeConstraints$(EXEEXT): $(NormalizeConstraints_OBJECTS) $(NormalizeConstraints_DEPENDENCIES) 
+	@rm -f NormalizeConstraints$(EXEEXT)
+	$(CXXLINK) $(NormalizeConstraints_OBJECTS) $(NormalizeConstraints_LDADD) $(LIBS)
+Orth$(EXEEXT): $(Orth_OBJECTS) $(Orth_DEPENDENCIES) 
+	@rm -f Orth$(EXEEXT)
+	$(CXXLINK) $(Orth_OBJECTS) $(Orth_LDADD) $(LIBS)
+ParamsToWorkspace$(EXEEXT): $(ParamsToWorkspace_OBJECTS) $(ParamsToWorkspace_DEPENDENCIES) 
+	@rm -f ParamsToWorkspace$(EXEEXT)
+	$(CXXLINK) $(ParamsToWorkspace_OBJECTS) $(ParamsToWorkspace_LDADD) $(LIBS)
+PenaltyConstraints$(EXEEXT): $(PenaltyConstraints_OBJECTS) $(PenaltyConstraints_DEPENDENCIES) 
+	@rm -f PenaltyConstraints$(EXEEXT)
+	$(CXXLINK) $(PenaltyConstraints_OBJECTS) $(PenaltyConstraints_LDADD) $(LIBS)
+PenaltySystemMatrices$(EXEEXT): $(PenaltySystemMatrices_OBJECTS) $(PenaltySystemMatrices_DEPENDENCIES) 
+	@rm -f PenaltySystemMatrices$(EXEEXT)
+	$(CXXLINK) $(PenaltySystemMatrices_OBJECTS) $(PenaltySystemMatrices_LDADD) $(LIBS)
+ProcessParams$(EXEEXT): $(ProcessParams_OBJECTS) $(ProcessParams_DEPENDENCIES) 
+	@rm -f ProcessParams$(EXEEXT)
+	$(CXXLINK) $(ProcessParams_OBJECTS) $(ProcessParams_LDADD) $(LIBS)
+Reduceloadfromgtof$(EXEEXT): $(Reduceloadfromgtof_OBJECTS) $(Reduceloadfromgtof_DEPENDENCIES) 
+	@rm -f Reduceloadfromgtof$(EXEEXT)
+	$(CXXLINK) $(Reduceloadfromgtof_OBJECTS) $(Reduceloadfromgtof_LDADD) $(LIBS)
+Reducematrixfromgtof$(EXEEXT): $(Reducematrixfromgtof_OBJECTS) $(Reducematrixfromgtof_DEPENDENCIES) 
+	@rm -f Reducematrixfromgtof$(EXEEXT)
+	$(CXXLINK) $(Reducematrixfromgtof_OBJECTS) $(Reducematrixfromgtof_LDADD) $(LIBS)
+Reducevectorgtos$(EXEEXT): $(Reducevectorgtos_OBJECTS) $(Reducevectorgtos_DEPENDENCIES) 
+	@rm -f Reducevectorgtos$(EXEEXT)
+	$(CXXLINK) $(Reducevectorgtos_OBJECTS) $(Reducevectorgtos_LDADD) $(LIBS)
+SetStructureField$(EXEEXT): $(SetStructureField_OBJECTS) $(SetStructureField_DEPENDENCIES) 
+	@rm -f SetStructureField$(EXEEXT)
+	$(CXXLINK) $(SetStructureField_OBJECTS) $(SetStructureField_LDADD) $(LIBS)
+Solver$(EXEEXT): $(Solver_OBJECTS) $(Solver_DEPENDENCIES) 
+	@rm -f Solver$(EXEEXT)
+	$(CXXLINK) $(Solver_OBJECTS) $(Solver_LDADD) $(LIBS)
+SpcNodes$(EXEEXT): $(SpcNodes_OBJECTS) $(SpcNodes_DEPENDENCIES) 
+	@rm -f SpcNodes$(EXEEXT)
+	$(CXXLINK) $(SpcNodes_OBJECTS) $(SpcNodes_LDADD) $(LIBS)
+SystemMatrices$(EXEEXT): $(SystemMatrices_OBJECTS) $(SystemMatrices_DEPENDENCIES) 
+	@rm -f SystemMatrices$(EXEEXT)
+	$(CXXLINK) $(SystemMatrices_OBJECTS) $(SystemMatrices_LDADD) $(LIBS)
+Test$(EXEEXT): $(Test_OBJECTS) $(Test_DEPENDENCIES) 
+	@rm -f Test$(EXEEXT)
+	$(CXXLINK) $(Test_OBJECTS) $(Test_LDADD) $(LIBS)
+TriMesh$(EXEEXT): $(TriMesh_OBJECTS) $(TriMesh_DEPENDENCIES) 
+	@rm -f TriMesh$(EXEEXT)
+	$(CXXLINK) $(TriMesh_OBJECTS) $(TriMesh_LDADD) $(LIBS)
+TriMeshProcessRifts$(EXEEXT): $(TriMeshProcessRifts_OBJECTS) $(TriMeshProcessRifts_DEPENDENCIES) 
+	@rm -f TriMeshProcessRifts$(EXEEXT)
+	$(CXXLINK) $(TriMeshProcessRifts_OBJECTS) $(TriMeshProcessRifts_LDADD) $(LIBS)
+TriMeshRefine$(EXEEXT): $(TriMeshRefine_OBJECTS) $(TriMeshRefine_DEPENDENCIES) 
+	@rm -f TriMeshRefine$(EXEEXT)
+	$(CXXLINK) $(TriMeshRefine_OBJECTS) $(TriMeshRefine_LDADD) $(LIBS)
+UpdateFromInputs$(EXEEXT): $(UpdateFromInputs_OBJECTS) $(UpdateFromInputs_DEPENDENCIES) 
+	@rm -f UpdateFromInputs$(EXEEXT)
+	$(CXXLINK) $(UpdateFromInputs_OBJECTS) $(UpdateFromInputs_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BuildNodeSets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfigureObjects.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ContourToMesh.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ControlConstrain.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DataInterp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dof.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Du.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Echo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gradj.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HoleFiller.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mergesolutionfromftog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MeshPartition.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Misfit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModelProcessor.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MpcNodes.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NormalizeConstraints.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Orth.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ParamsToWorkspace.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PenaltyConstraints.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PenaltySystemMatrices.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ProcessParams.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Reduceloadfromgtof.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Reducematrixfromgtof.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Reducevectorgtos.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SetStructureField.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Solver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SpcNodes.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SystemMatrices.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TriMesh.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TriMeshProcessRifts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TriMeshRefine.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UpdateFromInputs.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+BuildNodeSets.o: BuildNodeSets/BuildNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT BuildNodeSets.o -MD -MP -MF $(DEPDIR)/BuildNodeSets.Tpo -c -o BuildNodeSets.o `test -f 'BuildNodeSets/BuildNodeSets.cpp' || echo '$(srcdir)/'`BuildNodeSets/BuildNodeSets.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/BuildNodeSets.Tpo $(DEPDIR)/BuildNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='BuildNodeSets/BuildNodeSets.cpp' object='BuildNodeSets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o BuildNodeSets.o `test -f 'BuildNodeSets/BuildNodeSets.cpp' || echo '$(srcdir)/'`BuildNodeSets/BuildNodeSets.cpp
+
+BuildNodeSets.obj: BuildNodeSets/BuildNodeSets.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT BuildNodeSets.obj -MD -MP -MF $(DEPDIR)/BuildNodeSets.Tpo -c -o BuildNodeSets.obj `if test -f 'BuildNodeSets/BuildNodeSets.cpp'; then $(CYGPATH_W) 'BuildNodeSets/BuildNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/BuildNodeSets/BuildNodeSets.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/BuildNodeSets.Tpo $(DEPDIR)/BuildNodeSets.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='BuildNodeSets/BuildNodeSets.cpp' object='BuildNodeSets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o BuildNodeSets.obj `if test -f 'BuildNodeSets/BuildNodeSets.cpp'; then $(CYGPATH_W) 'BuildNodeSets/BuildNodeSets.cpp'; else $(CYGPATH_W) '$(srcdir)/BuildNodeSets/BuildNodeSets.cpp'; fi`
+
+ConfigureObjects.o: ConfigureObjects/ConfigureObjects.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ConfigureObjects.o -MD -MP -MF $(DEPDIR)/ConfigureObjects.Tpo -c -o ConfigureObjects.o `test -f 'ConfigureObjects/ConfigureObjects.cpp' || echo '$(srcdir)/'`ConfigureObjects/ConfigureObjects.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ConfigureObjects.Tpo $(DEPDIR)/ConfigureObjects.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ConfigureObjects/ConfigureObjects.cpp' object='ConfigureObjects.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ConfigureObjects.o `test -f 'ConfigureObjects/ConfigureObjects.cpp' || echo '$(srcdir)/'`ConfigureObjects/ConfigureObjects.cpp
+
+ConfigureObjects.obj: ConfigureObjects/ConfigureObjects.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ConfigureObjects.obj -MD -MP -MF $(DEPDIR)/ConfigureObjects.Tpo -c -o ConfigureObjects.obj `if test -f 'ConfigureObjects/ConfigureObjects.cpp'; then $(CYGPATH_W) 'ConfigureObjects/ConfigureObjects.cpp'; else $(CYGPATH_W) '$(srcdir)/ConfigureObjects/ConfigureObjects.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ConfigureObjects.Tpo $(DEPDIR)/ConfigureObjects.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ConfigureObjects/ConfigureObjects.cpp' object='ConfigureObjects.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ConfigureObjects.obj `if test -f 'ConfigureObjects/ConfigureObjects.cpp'; then $(CYGPATH_W) 'ConfigureObjects/ConfigureObjects.cpp'; else $(CYGPATH_W) '$(srcdir)/ConfigureObjects/ConfigureObjects.cpp'; fi`
+
+ContourToMesh.o: ContourToMesh/ContourToMesh.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ContourToMesh.o -MD -MP -MF $(DEPDIR)/ContourToMesh.Tpo -c -o ContourToMesh.o `test -f 'ContourToMesh/ContourToMesh.cpp' || echo '$(srcdir)/'`ContourToMesh/ContourToMesh.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ContourToMesh.Tpo $(DEPDIR)/ContourToMesh.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ContourToMesh/ContourToMesh.cpp' object='ContourToMesh.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ContourToMesh.o `test -f 'ContourToMesh/ContourToMesh.cpp' || echo '$(srcdir)/'`ContourToMesh/ContourToMesh.cpp
+
+ContourToMesh.obj: ContourToMesh/ContourToMesh.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ContourToMesh.obj -MD -MP -MF $(DEPDIR)/ContourToMesh.Tpo -c -o ContourToMesh.obj `if test -f 'ContourToMesh/ContourToMesh.cpp'; then $(CYGPATH_W) 'ContourToMesh/ContourToMesh.cpp'; else $(CYGPATH_W) '$(srcdir)/ContourToMesh/ContourToMesh.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ContourToMesh.Tpo $(DEPDIR)/ContourToMesh.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ContourToMesh/ContourToMesh.cpp' object='ContourToMesh.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ContourToMesh.obj `if test -f 'ContourToMesh/ContourToMesh.cpp'; then $(CYGPATH_W) 'ContourToMesh/ContourToMesh.cpp'; else $(CYGPATH_W) '$(srcdir)/ContourToMesh/ContourToMesh.cpp'; fi`
+
+ControlConstrain.o: ControlConstrain/ControlConstrain.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ControlConstrain.o -MD -MP -MF $(DEPDIR)/ControlConstrain.Tpo -c -o ControlConstrain.o `test -f 'ControlConstrain/ControlConstrain.cpp' || echo '$(srcdir)/'`ControlConstrain/ControlConstrain.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ControlConstrain.Tpo $(DEPDIR)/ControlConstrain.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ControlConstrain/ControlConstrain.cpp' object='ControlConstrain.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ControlConstrain.o `test -f 'ControlConstrain/ControlConstrain.cpp' || echo '$(srcdir)/'`ControlConstrain/ControlConstrain.cpp
+
+ControlConstrain.obj: ControlConstrain/ControlConstrain.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ControlConstrain.obj -MD -MP -MF $(DEPDIR)/ControlConstrain.Tpo -c -o ControlConstrain.obj `if test -f 'ControlConstrain/ControlConstrain.cpp'; then $(CYGPATH_W) 'ControlConstrain/ControlConstrain.cpp'; else $(CYGPATH_W) '$(srcdir)/ControlConstrain/ControlConstrain.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ControlConstrain.Tpo $(DEPDIR)/ControlConstrain.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ControlConstrain/ControlConstrain.cpp' object='ControlConstrain.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ControlConstrain.obj `if test -f 'ControlConstrain/ControlConstrain.cpp'; then $(CYGPATH_W) 'ControlConstrain/ControlConstrain.cpp'; else $(CYGPATH_W) '$(srcdir)/ControlConstrain/ControlConstrain.cpp'; fi`
+
+DataInterp.o: DataInterp/DataInterp.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DataInterp.o -MD -MP -MF $(DEPDIR)/DataInterp.Tpo -c -o DataInterp.o `test -f 'DataInterp/DataInterp.cpp' || echo '$(srcdir)/'`DataInterp/DataInterp.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/DataInterp.Tpo $(DEPDIR)/DataInterp.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='DataInterp/DataInterp.cpp' object='DataInterp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DataInterp.o `test -f 'DataInterp/DataInterp.cpp' || echo '$(srcdir)/'`DataInterp/DataInterp.cpp
+
+DataInterp.obj: DataInterp/DataInterp.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DataInterp.obj -MD -MP -MF $(DEPDIR)/DataInterp.Tpo -c -o DataInterp.obj `if test -f 'DataInterp/DataInterp.cpp'; then $(CYGPATH_W) 'DataInterp/DataInterp.cpp'; else $(CYGPATH_W) '$(srcdir)/DataInterp/DataInterp.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/DataInterp.Tpo $(DEPDIR)/DataInterp.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='DataInterp/DataInterp.cpp' object='DataInterp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DataInterp.obj `if test -f 'DataInterp/DataInterp.cpp'; then $(CYGPATH_W) 'DataInterp/DataInterp.cpp'; else $(CYGPATH_W) '$(srcdir)/DataInterp/DataInterp.cpp'; fi`
+
+Dof.o: Dof/Dof.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Dof.o -MD -MP -MF $(DEPDIR)/Dof.Tpo -c -o Dof.o `test -f 'Dof/Dof.cpp' || echo '$(srcdir)/'`Dof/Dof.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Dof.Tpo $(DEPDIR)/Dof.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Dof/Dof.cpp' object='Dof.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Dof.o `test -f 'Dof/Dof.cpp' || echo '$(srcdir)/'`Dof/Dof.cpp
+
+Dof.obj: Dof/Dof.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Dof.obj -MD -MP -MF $(DEPDIR)/Dof.Tpo -c -o Dof.obj `if test -f 'Dof/Dof.cpp'; then $(CYGPATH_W) 'Dof/Dof.cpp'; else $(CYGPATH_W) '$(srcdir)/Dof/Dof.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Dof.Tpo $(DEPDIR)/Dof.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Dof/Dof.cpp' object='Dof.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Dof.obj `if test -f 'Dof/Dof.cpp'; then $(CYGPATH_W) 'Dof/Dof.cpp'; else $(CYGPATH_W) '$(srcdir)/Dof/Dof.cpp'; fi`
+
+Du.o: Du/Du.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Du.o -MD -MP -MF $(DEPDIR)/Du.Tpo -c -o Du.o `test -f 'Du/Du.cpp' || echo '$(srcdir)/'`Du/Du.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Du.Tpo $(DEPDIR)/Du.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Du/Du.cpp' object='Du.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Du.o `test -f 'Du/Du.cpp' || echo '$(srcdir)/'`Du/Du.cpp
+
+Du.obj: Du/Du.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Du.obj -MD -MP -MF $(DEPDIR)/Du.Tpo -c -o Du.obj `if test -f 'Du/Du.cpp'; then $(CYGPATH_W) 'Du/Du.cpp'; else $(CYGPATH_W) '$(srcdir)/Du/Du.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Du.Tpo $(DEPDIR)/Du.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Du/Du.cpp' object='Du.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Du.obj `if test -f 'Du/Du.cpp'; then $(CYGPATH_W) 'Du/Du.cpp'; else $(CYGPATH_W) '$(srcdir)/Du/Du.cpp'; fi`
+
+Echo.o: Echo/Echo.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Echo.o -MD -MP -MF $(DEPDIR)/Echo.Tpo -c -o Echo.o `test -f 'Echo/Echo.cpp' || echo '$(srcdir)/'`Echo/Echo.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Echo.Tpo $(DEPDIR)/Echo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Echo/Echo.cpp' object='Echo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Echo.o `test -f 'Echo/Echo.cpp' || echo '$(srcdir)/'`Echo/Echo.cpp
+
+Echo.obj: Echo/Echo.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Echo.obj -MD -MP -MF $(DEPDIR)/Echo.Tpo -c -o Echo.obj `if test -f 'Echo/Echo.cpp'; then $(CYGPATH_W) 'Echo/Echo.cpp'; else $(CYGPATH_W) '$(srcdir)/Echo/Echo.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Echo.Tpo $(DEPDIR)/Echo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Echo/Echo.cpp' object='Echo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Echo.obj `if test -f 'Echo/Echo.cpp'; then $(CYGPATH_W) 'Echo/Echo.cpp'; else $(CYGPATH_W) '$(srcdir)/Echo/Echo.cpp'; fi`
+
+Gradj.o: Gradj/Gradj.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Gradj.o -MD -MP -MF $(DEPDIR)/Gradj.Tpo -c -o Gradj.o `test -f 'Gradj/Gradj.cpp' || echo '$(srcdir)/'`Gradj/Gradj.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Gradj.Tpo $(DEPDIR)/Gradj.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Gradj/Gradj.cpp' object='Gradj.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Gradj.o `test -f 'Gradj/Gradj.cpp' || echo '$(srcdir)/'`Gradj/Gradj.cpp
+
+Gradj.obj: Gradj/Gradj.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Gradj.obj -MD -MP -MF $(DEPDIR)/Gradj.Tpo -c -o Gradj.obj `if test -f 'Gradj/Gradj.cpp'; then $(CYGPATH_W) 'Gradj/Gradj.cpp'; else $(CYGPATH_W) '$(srcdir)/Gradj/Gradj.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Gradj.Tpo $(DEPDIR)/Gradj.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Gradj/Gradj.cpp' object='Gradj.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Gradj.obj `if test -f 'Gradj/Gradj.cpp'; then $(CYGPATH_W) 'Gradj/Gradj.cpp'; else $(CYGPATH_W) '$(srcdir)/Gradj/Gradj.cpp'; fi`
+
+HoleFiller.o: HoleFiller/HoleFiller.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT HoleFiller.o -MD -MP -MF $(DEPDIR)/HoleFiller.Tpo -c -o HoleFiller.o `test -f 'HoleFiller/HoleFiller.cpp' || echo '$(srcdir)/'`HoleFiller/HoleFiller.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/HoleFiller.Tpo $(DEPDIR)/HoleFiller.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='HoleFiller/HoleFiller.cpp' object='HoleFiller.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o HoleFiller.o `test -f 'HoleFiller/HoleFiller.cpp' || echo '$(srcdir)/'`HoleFiller/HoleFiller.cpp
+
+HoleFiller.obj: HoleFiller/HoleFiller.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT HoleFiller.obj -MD -MP -MF $(DEPDIR)/HoleFiller.Tpo -c -o HoleFiller.obj `if test -f 'HoleFiller/HoleFiller.cpp'; then $(CYGPATH_W) 'HoleFiller/HoleFiller.cpp'; else $(CYGPATH_W) '$(srcdir)/HoleFiller/HoleFiller.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/HoleFiller.Tpo $(DEPDIR)/HoleFiller.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='HoleFiller/HoleFiller.cpp' object='HoleFiller.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o HoleFiller.obj `if test -f 'HoleFiller/HoleFiller.cpp'; then $(CYGPATH_W) 'HoleFiller/HoleFiller.cpp'; else $(CYGPATH_W) '$(srcdir)/HoleFiller/HoleFiller.cpp'; fi`
+
+Mergesolutionfromftog.o: Mergesolutionfromftog/Mergesolutionfromftog.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mergesolutionfromftog.o -MD -MP -MF $(DEPDIR)/Mergesolutionfromftog.Tpo -c -o Mergesolutionfromftog.o `test -f 'Mergesolutionfromftog/Mergesolutionfromftog.cpp' || echo '$(srcdir)/'`Mergesolutionfromftog/Mergesolutionfromftog.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Mergesolutionfromftog.Tpo $(DEPDIR)/Mergesolutionfromftog.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Mergesolutionfromftog/Mergesolutionfromftog.cpp' object='Mergesolutionfromftog.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mergesolutionfromftog.o `test -f 'Mergesolutionfromftog/Mergesolutionfromftog.cpp' || echo '$(srcdir)/'`Mergesolutionfromftog/Mergesolutionfromftog.cpp
+
+Mergesolutionfromftog.obj: Mergesolutionfromftog/Mergesolutionfromftog.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mergesolutionfromftog.obj -MD -MP -MF $(DEPDIR)/Mergesolutionfromftog.Tpo -c -o Mergesolutionfromftog.obj `if test -f 'Mergesolutionfromftog/Mergesolutionfromftog.cpp'; then $(CYGPATH_W) 'Mergesolutionfromftog/Mergesolutionfromftog.cpp'; else $(CYGPATH_W) '$(srcdir)/Mergesolutionfromftog/Mergesolutionfromftog.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Mergesolutionfromftog.Tpo $(DEPDIR)/Mergesolutionfromftog.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Mergesolutionfromftog/Mergesolutionfromftog.cpp' object='Mergesolutionfromftog.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mergesolutionfromftog.obj `if test -f 'Mergesolutionfromftog/Mergesolutionfromftog.cpp'; then $(CYGPATH_W) 'Mergesolutionfromftog/Mergesolutionfromftog.cpp'; else $(CYGPATH_W) '$(srcdir)/Mergesolutionfromftog/Mergesolutionfromftog.cpp'; fi`
+
+MeshPartition.o: MeshPartition/MeshPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshPartition.o -MD -MP -MF $(DEPDIR)/MeshPartition.Tpo -c -o MeshPartition.o `test -f 'MeshPartition/MeshPartition.cpp' || echo '$(srcdir)/'`MeshPartition/MeshPartition.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/MeshPartition.Tpo $(DEPDIR)/MeshPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='MeshPartition/MeshPartition.cpp' object='MeshPartition.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshPartition.o `test -f 'MeshPartition/MeshPartition.cpp' || echo '$(srcdir)/'`MeshPartition/MeshPartition.cpp
+
+MeshPartition.obj: MeshPartition/MeshPartition.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshPartition.obj -MD -MP -MF $(DEPDIR)/MeshPartition.Tpo -c -o MeshPartition.obj `if test -f 'MeshPartition/MeshPartition.cpp'; then $(CYGPATH_W) 'MeshPartition/MeshPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/MeshPartition/MeshPartition.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/MeshPartition.Tpo $(DEPDIR)/MeshPartition.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='MeshPartition/MeshPartition.cpp' object='MeshPartition.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshPartition.obj `if test -f 'MeshPartition/MeshPartition.cpp'; then $(CYGPATH_W) 'MeshPartition/MeshPartition.cpp'; else $(CYGPATH_W) '$(srcdir)/MeshPartition/MeshPartition.cpp'; fi`
+
+Misfit.o: Misfit/Misfit.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Misfit.o -MD -MP -MF $(DEPDIR)/Misfit.Tpo -c -o Misfit.o `test -f 'Misfit/Misfit.cpp' || echo '$(srcdir)/'`Misfit/Misfit.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Misfit.Tpo $(DEPDIR)/Misfit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Misfit/Misfit.cpp' object='Misfit.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Misfit.o `test -f 'Misfit/Misfit.cpp' || echo '$(srcdir)/'`Misfit/Misfit.cpp
+
+Misfit.obj: Misfit/Misfit.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Misfit.obj -MD -MP -MF $(DEPDIR)/Misfit.Tpo -c -o Misfit.obj `if test -f 'Misfit/Misfit.cpp'; then $(CYGPATH_W) 'Misfit/Misfit.cpp'; else $(CYGPATH_W) '$(srcdir)/Misfit/Misfit.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Misfit.Tpo $(DEPDIR)/Misfit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Misfit/Misfit.cpp' object='Misfit.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Misfit.obj `if test -f 'Misfit/Misfit.cpp'; then $(CYGPATH_W) 'Misfit/Misfit.cpp'; else $(CYGPATH_W) '$(srcdir)/Misfit/Misfit.cpp'; fi`
+
+ModelProcessor.o: ModelProcessor/ModelProcessor.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ModelProcessor.o -MD -MP -MF $(DEPDIR)/ModelProcessor.Tpo -c -o ModelProcessor.o `test -f 'ModelProcessor/ModelProcessor.cpp' || echo '$(srcdir)/'`ModelProcessor/ModelProcessor.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ModelProcessor.Tpo $(DEPDIR)/ModelProcessor.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ModelProcessor/ModelProcessor.cpp' object='ModelProcessor.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ModelProcessor.o `test -f 'ModelProcessor/ModelProcessor.cpp' || echo '$(srcdir)/'`ModelProcessor/ModelProcessor.cpp
+
+ModelProcessor.obj: ModelProcessor/ModelProcessor.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ModelProcessor.obj -MD -MP -MF $(DEPDIR)/ModelProcessor.Tpo -c -o ModelProcessor.obj `if test -f 'ModelProcessor/ModelProcessor.cpp'; then $(CYGPATH_W) 'ModelProcessor/ModelProcessor.cpp'; else $(CYGPATH_W) '$(srcdir)/ModelProcessor/ModelProcessor.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ModelProcessor.Tpo $(DEPDIR)/ModelProcessor.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ModelProcessor/ModelProcessor.cpp' object='ModelProcessor.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ModelProcessor.obj `if test -f 'ModelProcessor/ModelProcessor.cpp'; then $(CYGPATH_W) 'ModelProcessor/ModelProcessor.cpp'; else $(CYGPATH_W) '$(srcdir)/ModelProcessor/ModelProcessor.cpp'; fi`
+
+MpcNodes.o: MpcNodes/MpcNodes.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MpcNodes.o -MD -MP -MF $(DEPDIR)/MpcNodes.Tpo -c -o MpcNodes.o `test -f 'MpcNodes/MpcNodes.cpp' || echo '$(srcdir)/'`MpcNodes/MpcNodes.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/MpcNodes.Tpo $(DEPDIR)/MpcNodes.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='MpcNodes/MpcNodes.cpp' object='MpcNodes.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MpcNodes.o `test -f 'MpcNodes/MpcNodes.cpp' || echo '$(srcdir)/'`MpcNodes/MpcNodes.cpp
+
+MpcNodes.obj: MpcNodes/MpcNodes.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MpcNodes.obj -MD -MP -MF $(DEPDIR)/MpcNodes.Tpo -c -o MpcNodes.obj `if test -f 'MpcNodes/MpcNodes.cpp'; then $(CYGPATH_W) 'MpcNodes/MpcNodes.cpp'; else $(CYGPATH_W) '$(srcdir)/MpcNodes/MpcNodes.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/MpcNodes.Tpo $(DEPDIR)/MpcNodes.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='MpcNodes/MpcNodes.cpp' object='MpcNodes.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MpcNodes.obj `if test -f 'MpcNodes/MpcNodes.cpp'; then $(CYGPATH_W) 'MpcNodes/MpcNodes.cpp'; else $(CYGPATH_W) '$(srcdir)/MpcNodes/MpcNodes.cpp'; fi`
+
+NormalizeConstraints.o: NormalizeConstraints/NormalizeConstraints.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NormalizeConstraints.o -MD -MP -MF $(DEPDIR)/NormalizeConstraints.Tpo -c -o NormalizeConstraints.o `test -f 'NormalizeConstraints/NormalizeConstraints.cpp' || echo '$(srcdir)/'`NormalizeConstraints/NormalizeConstraints.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/NormalizeConstraints.Tpo $(DEPDIR)/NormalizeConstraints.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='NormalizeConstraints/NormalizeConstraints.cpp' object='NormalizeConstraints.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NormalizeConstraints.o `test -f 'NormalizeConstraints/NormalizeConstraints.cpp' || echo '$(srcdir)/'`NormalizeConstraints/NormalizeConstraints.cpp
+
+NormalizeConstraints.obj: NormalizeConstraints/NormalizeConstraints.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NormalizeConstraints.obj -MD -MP -MF $(DEPDIR)/NormalizeConstraints.Tpo -c -o NormalizeConstraints.obj `if test -f 'NormalizeConstraints/NormalizeConstraints.cpp'; then $(CYGPATH_W) 'NormalizeConstraints/NormalizeConstraints.cpp'; else $(CYGPATH_W) '$(srcdir)/NormalizeConstraints/NormalizeConstraints.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/NormalizeConstraints.Tpo $(DEPDIR)/NormalizeConstraints.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='NormalizeConstraints/NormalizeConstraints.cpp' object='NormalizeConstraints.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NormalizeConstraints.obj `if test -f 'NormalizeConstraints/NormalizeConstraints.cpp'; then $(CYGPATH_W) 'NormalizeConstraints/NormalizeConstraints.cpp'; else $(CYGPATH_W) '$(srcdir)/NormalizeConstraints/NormalizeConstraints.cpp'; fi`
+
+Orth.o: Orth/Orth.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Orth.o -MD -MP -MF $(DEPDIR)/Orth.Tpo -c -o Orth.o `test -f 'Orth/Orth.cpp' || echo '$(srcdir)/'`Orth/Orth.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Orth.Tpo $(DEPDIR)/Orth.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Orth/Orth.cpp' object='Orth.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Orth.o `test -f 'Orth/Orth.cpp' || echo '$(srcdir)/'`Orth/Orth.cpp
+
+Orth.obj: Orth/Orth.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Orth.obj -MD -MP -MF $(DEPDIR)/Orth.Tpo -c -o Orth.obj `if test -f 'Orth/Orth.cpp'; then $(CYGPATH_W) 'Orth/Orth.cpp'; else $(CYGPATH_W) '$(srcdir)/Orth/Orth.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Orth.Tpo $(DEPDIR)/Orth.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Orth/Orth.cpp' object='Orth.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Orth.obj `if test -f 'Orth/Orth.cpp'; then $(CYGPATH_W) 'Orth/Orth.cpp'; else $(CYGPATH_W) '$(srcdir)/Orth/Orth.cpp'; fi`
+
+ParamsToWorkspace.o: ParamsToWorkspace/ParamsToWorkspace.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ParamsToWorkspace.o -MD -MP -MF $(DEPDIR)/ParamsToWorkspace.Tpo -c -o ParamsToWorkspace.o `test -f 'ParamsToWorkspace/ParamsToWorkspace.cpp' || echo '$(srcdir)/'`ParamsToWorkspace/ParamsToWorkspace.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ParamsToWorkspace.Tpo $(DEPDIR)/ParamsToWorkspace.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ParamsToWorkspace/ParamsToWorkspace.cpp' object='ParamsToWorkspace.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ParamsToWorkspace.o `test -f 'ParamsToWorkspace/ParamsToWorkspace.cpp' || echo '$(srcdir)/'`ParamsToWorkspace/ParamsToWorkspace.cpp
+
+ParamsToWorkspace.obj: ParamsToWorkspace/ParamsToWorkspace.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ParamsToWorkspace.obj -MD -MP -MF $(DEPDIR)/ParamsToWorkspace.Tpo -c -o ParamsToWorkspace.obj `if test -f 'ParamsToWorkspace/ParamsToWorkspace.cpp'; then $(CYGPATH_W) 'ParamsToWorkspace/ParamsToWorkspace.cpp'; else $(CYGPATH_W) '$(srcdir)/ParamsToWorkspace/ParamsToWorkspace.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ParamsToWorkspace.Tpo $(DEPDIR)/ParamsToWorkspace.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ParamsToWorkspace/ParamsToWorkspace.cpp' object='ParamsToWorkspace.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ParamsToWorkspace.obj `if test -f 'ParamsToWorkspace/ParamsToWorkspace.cpp'; then $(CYGPATH_W) 'ParamsToWorkspace/ParamsToWorkspace.cpp'; else $(CYGPATH_W) '$(srcdir)/ParamsToWorkspace/ParamsToWorkspace.cpp'; fi`
+
+PenaltyConstraints.o: PenaltyConstraints/PenaltyConstraints.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PenaltyConstraints.o -MD -MP -MF $(DEPDIR)/PenaltyConstraints.Tpo -c -o PenaltyConstraints.o `test -f 'PenaltyConstraints/PenaltyConstraints.cpp' || echo '$(srcdir)/'`PenaltyConstraints/PenaltyConstraints.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/PenaltyConstraints.Tpo $(DEPDIR)/PenaltyConstraints.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='PenaltyConstraints/PenaltyConstraints.cpp' object='PenaltyConstraints.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PenaltyConstraints.o `test -f 'PenaltyConstraints/PenaltyConstraints.cpp' || echo '$(srcdir)/'`PenaltyConstraints/PenaltyConstraints.cpp
+
+PenaltyConstraints.obj: PenaltyConstraints/PenaltyConstraints.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PenaltyConstraints.obj -MD -MP -MF $(DEPDIR)/PenaltyConstraints.Tpo -c -o PenaltyConstraints.obj `if test -f 'PenaltyConstraints/PenaltyConstraints.cpp'; then $(CYGPATH_W) 'PenaltyConstraints/PenaltyConstraints.cpp'; else $(CYGPATH_W) '$(srcdir)/PenaltyConstraints/PenaltyConstraints.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/PenaltyConstraints.Tpo $(DEPDIR)/PenaltyConstraints.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='PenaltyConstraints/PenaltyConstraints.cpp' object='PenaltyConstraints.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PenaltyConstraints.obj `if test -f 'PenaltyConstraints/PenaltyConstraints.cpp'; then $(CYGPATH_W) 'PenaltyConstraints/PenaltyConstraints.cpp'; else $(CYGPATH_W) '$(srcdir)/PenaltyConstraints/PenaltyConstraints.cpp'; fi`
+
+PenaltySystemMatrices.o: PenaltySystemMatrices/PenaltySystemMatrices.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PenaltySystemMatrices.o -MD -MP -MF $(DEPDIR)/PenaltySystemMatrices.Tpo -c -o PenaltySystemMatrices.o `test -f 'PenaltySystemMatrices/PenaltySystemMatrices.cpp' || echo '$(srcdir)/'`PenaltySystemMatrices/PenaltySystemMatrices.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/PenaltySystemMatrices.Tpo $(DEPDIR)/PenaltySystemMatrices.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='PenaltySystemMatrices/PenaltySystemMatrices.cpp' object='PenaltySystemMatrices.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PenaltySystemMatrices.o `test -f 'PenaltySystemMatrices/PenaltySystemMatrices.cpp' || echo '$(srcdir)/'`PenaltySystemMatrices/PenaltySystemMatrices.cpp
+
+PenaltySystemMatrices.obj: PenaltySystemMatrices/PenaltySystemMatrices.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PenaltySystemMatrices.obj -MD -MP -MF $(DEPDIR)/PenaltySystemMatrices.Tpo -c -o PenaltySystemMatrices.obj `if test -f 'PenaltySystemMatrices/PenaltySystemMatrices.cpp'; then $(CYGPATH_W) 'PenaltySystemMatrices/PenaltySystemMatrices.cpp'; else $(CYGPATH_W) '$(srcdir)/PenaltySystemMatrices/PenaltySystemMatrices.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/PenaltySystemMatrices.Tpo $(DEPDIR)/PenaltySystemMatrices.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='PenaltySystemMatrices/PenaltySystemMatrices.cpp' object='PenaltySystemMatrices.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PenaltySystemMatrices.obj `if test -f 'PenaltySystemMatrices/PenaltySystemMatrices.cpp'; then $(CYGPATH_W) 'PenaltySystemMatrices/PenaltySystemMatrices.cpp'; else $(CYGPATH_W) '$(srcdir)/PenaltySystemMatrices/PenaltySystemMatrices.cpp'; fi`
+
+ProcessParams.o: ProcessParams/ProcessParams.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ProcessParams.o -MD -MP -MF $(DEPDIR)/ProcessParams.Tpo -c -o ProcessParams.o `test -f 'ProcessParams/ProcessParams.cpp' || echo '$(srcdir)/'`ProcessParams/ProcessParams.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ProcessParams.Tpo $(DEPDIR)/ProcessParams.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ProcessParams/ProcessParams.cpp' object='ProcessParams.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ProcessParams.o `test -f 'ProcessParams/ProcessParams.cpp' || echo '$(srcdir)/'`ProcessParams/ProcessParams.cpp
+
+ProcessParams.obj: ProcessParams/ProcessParams.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ProcessParams.obj -MD -MP -MF $(DEPDIR)/ProcessParams.Tpo -c -o ProcessParams.obj `if test -f 'ProcessParams/ProcessParams.cpp'; then $(CYGPATH_W) 'ProcessParams/ProcessParams.cpp'; else $(CYGPATH_W) '$(srcdir)/ProcessParams/ProcessParams.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/ProcessParams.Tpo $(DEPDIR)/ProcessParams.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='ProcessParams/ProcessParams.cpp' object='ProcessParams.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ProcessParams.obj `if test -f 'ProcessParams/ProcessParams.cpp'; then $(CYGPATH_W) 'ProcessParams/ProcessParams.cpp'; else $(CYGPATH_W) '$(srcdir)/ProcessParams/ProcessParams.cpp'; fi`
+
+Reduceloadfromgtof.o: Reduceloadfromgtof/Reduceloadfromgtof.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Reduceloadfromgtof.o -MD -MP -MF $(DEPDIR)/Reduceloadfromgtof.Tpo -c -o Reduceloadfromgtof.o `test -f 'Reduceloadfromgtof/Reduceloadfromgtof.cpp' || echo '$(srcdir)/'`Reduceloadfromgtof/Reduceloadfromgtof.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Reduceloadfromgtof.Tpo $(DEPDIR)/Reduceloadfromgtof.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Reduceloadfromgtof/Reduceloadfromgtof.cpp' object='Reduceloadfromgtof.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Reduceloadfromgtof.o `test -f 'Reduceloadfromgtof/Reduceloadfromgtof.cpp' || echo '$(srcdir)/'`Reduceloadfromgtof/Reduceloadfromgtof.cpp
+
+Reduceloadfromgtof.obj: Reduceloadfromgtof/Reduceloadfromgtof.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Reduceloadfromgtof.obj -MD -MP -MF $(DEPDIR)/Reduceloadfromgtof.Tpo -c -o Reduceloadfromgtof.obj `if test -f 'Reduceloadfromgtof/Reduceloadfromgtof.cpp'; then $(CYGPATH_W) 'Reduceloadfromgtof/Reduceloadfromgtof.cpp'; else $(CYGPATH_W) '$(srcdir)/Reduceloadfromgtof/Reduceloadfromgtof.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Reduceloadfromgtof.Tpo $(DEPDIR)/Reduceloadfromgtof.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Reduceloadfromgtof/Reduceloadfromgtof.cpp' object='Reduceloadfromgtof.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Reduceloadfromgtof.obj `if test -f 'Reduceloadfromgtof/Reduceloadfromgtof.cpp'; then $(CYGPATH_W) 'Reduceloadfromgtof/Reduceloadfromgtof.cpp'; else $(CYGPATH_W) '$(srcdir)/Reduceloadfromgtof/Reduceloadfromgtof.cpp'; fi`
+
+Reducematrixfromgtof.o: Reducematrixfromgtof/Reducematrixfromgtof.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Reducematrixfromgtof.o -MD -MP -MF $(DEPDIR)/Reducematrixfromgtof.Tpo -c -o Reducematrixfromgtof.o `test -f 'Reducematrixfromgtof/Reducematrixfromgtof.cpp' || echo '$(srcdir)/'`Reducematrixfromgtof/Reducematrixfromgtof.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Reducematrixfromgtof.Tpo $(DEPDIR)/Reducematrixfromgtof.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Reducematrixfromgtof/Reducematrixfromgtof.cpp' object='Reducematrixfromgtof.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Reducematrixfromgtof.o `test -f 'Reducematrixfromgtof/Reducematrixfromgtof.cpp' || echo '$(srcdir)/'`Reducematrixfromgtof/Reducematrixfromgtof.cpp
+
+Reducematrixfromgtof.obj: Reducematrixfromgtof/Reducematrixfromgtof.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Reducematrixfromgtof.obj -MD -MP -MF $(DEPDIR)/Reducematrixfromgtof.Tpo -c -o Reducematrixfromgtof.obj `if test -f 'Reducematrixfromgtof/Reducematrixfromgtof.cpp'; then $(CYGPATH_W) 'Reducematrixfromgtof/Reducematrixfromgtof.cpp'; else $(CYGPATH_W) '$(srcdir)/Reducematrixfromgtof/Reducematrixfromgtof.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Reducematrixfromgtof.Tpo $(DEPDIR)/Reducematrixfromgtof.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Reducematrixfromgtof/Reducematrixfromgtof.cpp' object='Reducematrixfromgtof.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Reducematrixfromgtof.obj `if test -f 'Reducematrixfromgtof/Reducematrixfromgtof.cpp'; then $(CYGPATH_W) 'Reducematrixfromgtof/Reducematrixfromgtof.cpp'; else $(CYGPATH_W) '$(srcdir)/Reducematrixfromgtof/Reducematrixfromgtof.cpp'; fi`
+
+Reducevectorgtos.o: Reducevectorgtos/Reducevectorgtos.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Reducevectorgtos.o -MD -MP -MF $(DEPDIR)/Reducevectorgtos.Tpo -c -o Reducevectorgtos.o `test -f 'Reducevectorgtos/Reducevectorgtos.cpp' || echo '$(srcdir)/'`Reducevectorgtos/Reducevectorgtos.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Reducevectorgtos.Tpo $(DEPDIR)/Reducevectorgtos.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Reducevectorgtos/Reducevectorgtos.cpp' object='Reducevectorgtos.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Reducevectorgtos.o `test -f 'Reducevectorgtos/Reducevectorgtos.cpp' || echo '$(srcdir)/'`Reducevectorgtos/Reducevectorgtos.cpp
+
+Reducevectorgtos.obj: Reducevectorgtos/Reducevectorgtos.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Reducevectorgtos.obj -MD -MP -MF $(DEPDIR)/Reducevectorgtos.Tpo -c -o Reducevectorgtos.obj `if test -f 'Reducevectorgtos/Reducevectorgtos.cpp'; then $(CYGPATH_W) 'Reducevectorgtos/Reducevectorgtos.cpp'; else $(CYGPATH_W) '$(srcdir)/Reducevectorgtos/Reducevectorgtos.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Reducevectorgtos.Tpo $(DEPDIR)/Reducevectorgtos.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Reducevectorgtos/Reducevectorgtos.cpp' object='Reducevectorgtos.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Reducevectorgtos.obj `if test -f 'Reducevectorgtos/Reducevectorgtos.cpp'; then $(CYGPATH_W) 'Reducevectorgtos/Reducevectorgtos.cpp'; else $(CYGPATH_W) '$(srcdir)/Reducevectorgtos/Reducevectorgtos.cpp'; fi`
+
+SetStructureField.o: SetStructureField/SetStructureField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SetStructureField.o -MD -MP -MF $(DEPDIR)/SetStructureField.Tpo -c -o SetStructureField.o `test -f 'SetStructureField/SetStructureField.cpp' || echo '$(srcdir)/'`SetStructureField/SetStructureField.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/SetStructureField.Tpo $(DEPDIR)/SetStructureField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='SetStructureField/SetStructureField.cpp' object='SetStructureField.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SetStructureField.o `test -f 'SetStructureField/SetStructureField.cpp' || echo '$(srcdir)/'`SetStructureField/SetStructureField.cpp
+
+SetStructureField.obj: SetStructureField/SetStructureField.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SetStructureField.obj -MD -MP -MF $(DEPDIR)/SetStructureField.Tpo -c -o SetStructureField.obj `if test -f 'SetStructureField/SetStructureField.cpp'; then $(CYGPATH_W) 'SetStructureField/SetStructureField.cpp'; else $(CYGPATH_W) '$(srcdir)/SetStructureField/SetStructureField.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/SetStructureField.Tpo $(DEPDIR)/SetStructureField.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='SetStructureField/SetStructureField.cpp' object='SetStructureField.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SetStructureField.obj `if test -f 'SetStructureField/SetStructureField.cpp'; then $(CYGPATH_W) 'SetStructureField/SetStructureField.cpp'; else $(CYGPATH_W) '$(srcdir)/SetStructureField/SetStructureField.cpp'; fi`
+
+Solver.o: Solver/Solver.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Solver.o -MD -MP -MF $(DEPDIR)/Solver.Tpo -c -o Solver.o `test -f 'Solver/Solver.cpp' || echo '$(srcdir)/'`Solver/Solver.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Solver.Tpo $(DEPDIR)/Solver.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Solver/Solver.cpp' object='Solver.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Solver.o `test -f 'Solver/Solver.cpp' || echo '$(srcdir)/'`Solver/Solver.cpp
+
+Solver.obj: Solver/Solver.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Solver.obj -MD -MP -MF $(DEPDIR)/Solver.Tpo -c -o Solver.obj `if test -f 'Solver/Solver.cpp'; then $(CYGPATH_W) 'Solver/Solver.cpp'; else $(CYGPATH_W) '$(srcdir)/Solver/Solver.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Solver.Tpo $(DEPDIR)/Solver.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Solver/Solver.cpp' object='Solver.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Solver.obj `if test -f 'Solver/Solver.cpp'; then $(CYGPATH_W) 'Solver/Solver.cpp'; else $(CYGPATH_W) '$(srcdir)/Solver/Solver.cpp'; fi`
+
+SpcNodes.o: SpcNodes/SpcNodes.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SpcNodes.o -MD -MP -MF $(DEPDIR)/SpcNodes.Tpo -c -o SpcNodes.o `test -f 'SpcNodes/SpcNodes.cpp' || echo '$(srcdir)/'`SpcNodes/SpcNodes.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/SpcNodes.Tpo $(DEPDIR)/SpcNodes.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='SpcNodes/SpcNodes.cpp' object='SpcNodes.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SpcNodes.o `test -f 'SpcNodes/SpcNodes.cpp' || echo '$(srcdir)/'`SpcNodes/SpcNodes.cpp
+
+SpcNodes.obj: SpcNodes/SpcNodes.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SpcNodes.obj -MD -MP -MF $(DEPDIR)/SpcNodes.Tpo -c -o SpcNodes.obj `if test -f 'SpcNodes/SpcNodes.cpp'; then $(CYGPATH_W) 'SpcNodes/SpcNodes.cpp'; else $(CYGPATH_W) '$(srcdir)/SpcNodes/SpcNodes.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/SpcNodes.Tpo $(DEPDIR)/SpcNodes.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='SpcNodes/SpcNodes.cpp' object='SpcNodes.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SpcNodes.obj `if test -f 'SpcNodes/SpcNodes.cpp'; then $(CYGPATH_W) 'SpcNodes/SpcNodes.cpp'; else $(CYGPATH_W) '$(srcdir)/SpcNodes/SpcNodes.cpp'; fi`
+
+SystemMatrices.o: SystemMatrices/SystemMatrices.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SystemMatrices.o -MD -MP -MF $(DEPDIR)/SystemMatrices.Tpo -c -o SystemMatrices.o `test -f 'SystemMatrices/SystemMatrices.cpp' || echo '$(srcdir)/'`SystemMatrices/SystemMatrices.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/SystemMatrices.Tpo $(DEPDIR)/SystemMatrices.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='SystemMatrices/SystemMatrices.cpp' object='SystemMatrices.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SystemMatrices.o `test -f 'SystemMatrices/SystemMatrices.cpp' || echo '$(srcdir)/'`SystemMatrices/SystemMatrices.cpp
+
+SystemMatrices.obj: SystemMatrices/SystemMatrices.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SystemMatrices.obj -MD -MP -MF $(DEPDIR)/SystemMatrices.Tpo -c -o SystemMatrices.obj `if test -f 'SystemMatrices/SystemMatrices.cpp'; then $(CYGPATH_W) 'SystemMatrices/SystemMatrices.cpp'; else $(CYGPATH_W) '$(srcdir)/SystemMatrices/SystemMatrices.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/SystemMatrices.Tpo $(DEPDIR)/SystemMatrices.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='SystemMatrices/SystemMatrices.cpp' object='SystemMatrices.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SystemMatrices.obj `if test -f 'SystemMatrices/SystemMatrices.cpp'; then $(CYGPATH_W) 'SystemMatrices/SystemMatrices.cpp'; else $(CYGPATH_W) '$(srcdir)/SystemMatrices/SystemMatrices.cpp'; fi`
+
+Test.o: Test/Test.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Test.o -MD -MP -MF $(DEPDIR)/Test.Tpo -c -o Test.o `test -f 'Test/Test.cpp' || echo '$(srcdir)/'`Test/Test.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Test.Tpo $(DEPDIR)/Test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Test/Test.cpp' object='Test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Test.o `test -f 'Test/Test.cpp' || echo '$(srcdir)/'`Test/Test.cpp
+
+Test.obj: Test/Test.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Test.obj -MD -MP -MF $(DEPDIR)/Test.Tpo -c -o Test.obj `if test -f 'Test/Test.cpp'; then $(CYGPATH_W) 'Test/Test.cpp'; else $(CYGPATH_W) '$(srcdir)/Test/Test.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/Test.Tpo $(DEPDIR)/Test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='Test/Test.cpp' object='Test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Test.obj `if test -f 'Test/Test.cpp'; then $(CYGPATH_W) 'Test/Test.cpp'; else $(CYGPATH_W) '$(srcdir)/Test/Test.cpp'; fi`
+
+TriMesh.o: TriMesh/TriMesh.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TriMesh.o -MD -MP -MF $(DEPDIR)/TriMesh.Tpo -c -o TriMesh.o `test -f 'TriMesh/TriMesh.cpp' || echo '$(srcdir)/'`TriMesh/TriMesh.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/TriMesh.Tpo $(DEPDIR)/TriMesh.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='TriMesh/TriMesh.cpp' object='TriMesh.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TriMesh.o `test -f 'TriMesh/TriMesh.cpp' || echo '$(srcdir)/'`TriMesh/TriMesh.cpp
+
+TriMesh.obj: TriMesh/TriMesh.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TriMesh.obj -MD -MP -MF $(DEPDIR)/TriMesh.Tpo -c -o TriMesh.obj `if test -f 'TriMesh/TriMesh.cpp'; then $(CYGPATH_W) 'TriMesh/TriMesh.cpp'; else $(CYGPATH_W) '$(srcdir)/TriMesh/TriMesh.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/TriMesh.Tpo $(DEPDIR)/TriMesh.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='TriMesh/TriMesh.cpp' object='TriMesh.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TriMesh.obj `if test -f 'TriMesh/TriMesh.cpp'; then $(CYGPATH_W) 'TriMesh/TriMesh.cpp'; else $(CYGPATH_W) '$(srcdir)/TriMesh/TriMesh.cpp'; fi`
+
+TriMeshProcessRifts.o: TriMeshProcessRifts/TriMeshProcessRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TriMeshProcessRifts.o -MD -MP -MF $(DEPDIR)/TriMeshProcessRifts.Tpo -c -o TriMeshProcessRifts.o `test -f 'TriMeshProcessRifts/TriMeshProcessRifts.cpp' || echo '$(srcdir)/'`TriMeshProcessRifts/TriMeshProcessRifts.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/TriMeshProcessRifts.Tpo $(DEPDIR)/TriMeshProcessRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='TriMeshProcessRifts/TriMeshProcessRifts.cpp' object='TriMeshProcessRifts.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TriMeshProcessRifts.o `test -f 'TriMeshProcessRifts/TriMeshProcessRifts.cpp' || echo '$(srcdir)/'`TriMeshProcessRifts/TriMeshProcessRifts.cpp
+
+TriMeshProcessRifts.obj: TriMeshProcessRifts/TriMeshProcessRifts.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TriMeshProcessRifts.obj -MD -MP -MF $(DEPDIR)/TriMeshProcessRifts.Tpo -c -o TriMeshProcessRifts.obj `if test -f 'TriMeshProcessRifts/TriMeshProcessRifts.cpp'; then $(CYGPATH_W) 'TriMeshProcessRifts/TriMeshProcessRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/TriMeshProcessRifts/TriMeshProcessRifts.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/TriMeshProcessRifts.Tpo $(DEPDIR)/TriMeshProcessRifts.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='TriMeshProcessRifts/TriMeshProcessRifts.cpp' object='TriMeshProcessRifts.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TriMeshProcessRifts.obj `if test -f 'TriMeshProcessRifts/TriMeshProcessRifts.cpp'; then $(CYGPATH_W) 'TriMeshProcessRifts/TriMeshProcessRifts.cpp'; else $(CYGPATH_W) '$(srcdir)/TriMeshProcessRifts/TriMeshProcessRifts.cpp'; fi`
+
+TriMeshRefine.o: TriMeshRefine/TriMeshRefine.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TriMeshRefine.o -MD -MP -MF $(DEPDIR)/TriMeshRefine.Tpo -c -o TriMeshRefine.o `test -f 'TriMeshRefine/TriMeshRefine.cpp' || echo '$(srcdir)/'`TriMeshRefine/TriMeshRefine.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/TriMeshRefine.Tpo $(DEPDIR)/TriMeshRefine.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='TriMeshRefine/TriMeshRefine.cpp' object='TriMeshRefine.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TriMeshRefine.o `test -f 'TriMeshRefine/TriMeshRefine.cpp' || echo '$(srcdir)/'`TriMeshRefine/TriMeshRefine.cpp
+
+TriMeshRefine.obj: TriMeshRefine/TriMeshRefine.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TriMeshRefine.obj -MD -MP -MF $(DEPDIR)/TriMeshRefine.Tpo -c -o TriMeshRefine.obj `if test -f 'TriMeshRefine/TriMeshRefine.cpp'; then $(CYGPATH_W) 'TriMeshRefine/TriMeshRefine.cpp'; else $(CYGPATH_W) '$(srcdir)/TriMeshRefine/TriMeshRefine.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/TriMeshRefine.Tpo $(DEPDIR)/TriMeshRefine.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='TriMeshRefine/TriMeshRefine.cpp' object='TriMeshRefine.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TriMeshRefine.obj `if test -f 'TriMeshRefine/TriMeshRefine.cpp'; then $(CYGPATH_W) 'TriMeshRefine/TriMeshRefine.cpp'; else $(CYGPATH_W) '$(srcdir)/TriMeshRefine/TriMeshRefine.cpp'; fi`
+
+UpdateFromInputs.o: UpdateFromInputs/UpdateFromInputs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT UpdateFromInputs.o -MD -MP -MF $(DEPDIR)/UpdateFromInputs.Tpo -c -o UpdateFromInputs.o `test -f 'UpdateFromInputs/UpdateFromInputs.cpp' || echo '$(srcdir)/'`UpdateFromInputs/UpdateFromInputs.cpp
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/UpdateFromInputs.Tpo $(DEPDIR)/UpdateFromInputs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='UpdateFromInputs/UpdateFromInputs.cpp' object='UpdateFromInputs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o UpdateFromInputs.o `test -f 'UpdateFromInputs/UpdateFromInputs.cpp' || echo '$(srcdir)/'`UpdateFromInputs/UpdateFromInputs.cpp
+
+UpdateFromInputs.obj: UpdateFromInputs/UpdateFromInputs.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT UpdateFromInputs.obj -MD -MP -MF $(DEPDIR)/UpdateFromInputs.Tpo -c -o UpdateFromInputs.obj `if test -f 'UpdateFromInputs/UpdateFromInputs.cpp'; then $(CYGPATH_W) 'UpdateFromInputs/UpdateFromInputs.cpp'; else $(CYGPATH_W) '$(srcdir)/UpdateFromInputs/UpdateFromInputs.cpp'; fi`
+@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/UpdateFromInputs.Tpo $(DEPDIR)/UpdateFromInputs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='UpdateFromInputs/UpdateFromInputs.cpp' object='UpdateFromInputs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o UpdateFromInputs.obj `if test -f 'UpdateFromInputs/UpdateFromInputs.cpp'; then $(CYGPATH_W) 'UpdateFromInputs/UpdateFromInputs.cpp'; else $(CYGPATH_W) '$(srcdir)/UpdateFromInputs/UpdateFromInputs.cpp'; fi`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic ctags distclean distclean-compile \
+	distclean-generic 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 \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-binPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp
===================================================================
--- /issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp	(revision 1)
+++ /issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp	(revision 1)
@@ -0,0 +1,55 @@
+/*\file Mergesolutionfromftog.c
+ *\brief: merge solution back from f set into g set
+ */
+
+#include "./Mergesolutionfromftog.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	Vec uf=NULL;
+	Mat Gmn=NULL;
+	Vec ys=NULL;
+	NodeSets* nodesets=NULL;
+
+	/* output datasets: */
+	Vec ug=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&MergesolutionfromftogUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&uf,NULL,NULL,UF,"Vector",NULL);
+	FetchData((void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);
+	FetchData((void**)&ys,NULL,NULL,YS,"Vector",NULL);
+	FetchNodeSets(&nodesets,NODESETS);
+
+	/*!Reduce vector: */
+	Mergesolutionfromftogx(&ug, uf,Gmn,ys,nodesets);
+
+	/*write output datasets: */
+	WriteData(UG,ug,0,0,"Vector",NULL);
+
+	/*Free ressources: */
+	VecFree(&uf);
+	MatFree(&Gmn);
+	VecFree(&ys);
+	delete nodesets;
+	VecFree(&ug);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void MergesolutionfromftogUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [ug] = %s(uf,Gmn,ys,nodesets);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.h
===================================================================
--- /issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.h	(revision 1)
+++ /issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.h	(revision 1)
@@ -0,0 +1,34 @@
+
+/*
+	Mergesolutionfromftog.h
+*/
+
+
+#ifndef _MERGESOLUTIONFROMFTOG_H
+#define _MERGESOLUTIONFROMFTOG_H
+
+/* local prototypes: */
+void MergesolutionfromftogUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Mergesolutionfromftog"
+
+/* serial input macros: */
+#define UF (mxArray*)prhs[0]
+#define GMN (mxArray*)prhs[1]
+#define YS (mxArray*)prhs[2]
+#define NODESETS (mxArray*)prhs[3]
+
+/* serial output macros: */
+#define UG (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  4
+
+#endif  /* _MERGESOLUTIONFROMFTOG_H */
+
Index: /issm/trunk/src/mex/MeshPartition/;
===================================================================
--- /issm/trunk/src/mex/MeshPartition/;	(revision 1)
+++ /issm/trunk/src/mex/MeshPartition/;	(revision 1)
@@ -0,0 +1,147 @@
+/*!\file:  MeshPartition.cpp
+ * \brief: partition mesh according to number of areas, using Metis library.
+
+	usage:
+	[element_partitioning,node_partitioning]=MeshPartition(model,num_areas)
+	
+	%Info needed from model are the following: 
+	%mesh info: 
+	numberofelements,numberofgrids,elements,elements_width
+	%Non-extruded 2d mesh info
+	nel2d,nods2d,elements2d,
+	%Extruded 2d mesh info
+	nel2d_ext,nods2d_ext,elements2d_ext,
+	%Diverse
+	numlayers,meshtype)
+
+	output:
+	vector of partitioning area numbers, for every element.
+	vector of partitioning area numbers, for every node.
+*/
+	
+#include "./MeshPartition.h"
+
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
+
+
+	/*Indexing: */
+	int i,j;
+
+	/* required input: */
+	char* meshtype=NULL;
+
+	int numberofelements, numberofgrids, elements_width;
+	double* elements=NULL;
+
+	int nel2d, nods2d;
+	double* elements2d=NULL;
+
+	int nel2d_ext, nods2d_ext;
+	double* elements2d_ext=NULL;
+	int numlayers;
+	int num_areas=1;
+
+	/* output: */
+	int*    int_element_partitioning=NULL;
+	int*    int_node_partitioning   =NULL;
+	double* element_partitioning    =NULL;
+	double* node_partitioning       =NULL;
+
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&MeshPartitionUsage);
+
+	/*Fetch data: */
+	FetchData((void**)&meshtype,NULL,NULL,mxGetField(MODEL,0,"type"),"String",NULL);
+	FetchData((void**)&numberofelements,NULL,NULL,mxGetField(MODEL,0,"numberofelements"),"Integer",NULL);
+	FetchData((void**)&numberofgrids,NULL,NULL,mxGetField(MODEL,0,"numberofgrids"),"Integer",NULL);
+	FetchData((void**)&elements,NULL,NULL,mxGetField(MODEL,0,"elements"),"Matrix","Mat");
+
+	
+	int MeshPartition(int** pepart, int numberofelements,int numberofgrids,double* elements,
+		        int numberofelements2d,int numberofgrids2d,double* elements2d,int numlayers,int elements_width, char* meshtype,int num_procs){
+
+	if (strcmp(meshtype,"3d")==0){
+	
+		FetchData((void**)&numberofelements2d,NULL,NULL,mxGetField(MODEL,0,"numberofelements2d"),"Integer",NULL);
+		FetchData((void**)&numberofgrids2d,NULL,NULL,mxGetField(MODEL,0,"numberofgrids2d"),"Integer",NULL);
+
+	}
+
+	/*Number of extrusion layers: */
+	pfield=mxGetField(prhs[0],0,"numlayers");
+	numlayers= (int)(*(double*)mxGetPr(pfield));
+
+	#ifdef _DEBUG_
+	printf("meshtype: %s\n",meshtype);
+	printf("numberofelements %i numberofgrids %i elements_width %i \n",numberofelements,numberofgrids,elements_width);
+	for (i=0;i<numberofelements;i++){
+		for(j=0;j<elements_width;j++){
+			printf(" %i ",(int)*(elements+elements_width*i+j));
+		}
+		printf("\n");
+	}
+	if (strcmp(meshtype,"3d")==0){
+		printf("numberofelements 2d %i numberofgrids 2d %i\n",nel2d,nods2d);
+		for (i=0;i<nel2d;i++){
+			for(j=0;j<3;j++){
+				printf(" %i ",(int)*(elements2d+3*i+j));
+			}
+			printf("\n");
+		}
+		
+		printf("numberofelements 2d_ext %i numberofgrids 2d_ext %i\n",nel2d_ext,nods2d_ext);
+		for (i=0;i<nel2d_ext;i++){
+			for(j=0;j<3;j++){
+				printf(" %i ",(int)*(elements2d_ext+3*i+j));
+			}
+			printf("\n");
+		}
+	}
+	printf("Number of extrusion layers: %i\n",numlayers);
+	#endif
+
+
+
+	/*Fetch number of processors: */
+	num_areas= (int)(*(double*)mxGetPr(prhs[1]));
+	#ifdef _DEBUG_
+		printf("num_areas: %i\n",num_areas);
+	#endif
+
+	/*Run partitioning algorithm based on a "clever" use of the Metis partitioner: */
+	MeshPartitionx(&int_element_partitioning,&int_node_partitioning,numberofelements,numberofgrids,elements,
+		nel2d,nods2d,elements2d,nel2d_ext,nods2d_ext,elements2d_ext, numlayers,elements_width,meshtype,num_areas);
+
+	/* output: */
+	element_partitioning=mxMalloc(numberofelements*sizeof(double));
+	for (i=0;i<numberofelements;i++){
+		element_partitioning[i]=(double)int_element_partitioning[i]+1; //Metis indexing from 0, matlab from 1.
+	}
+	plhs[0]=mxCreateDoubleMatrix(numberofelements,1,mxREAL);
+	mxSetPr(plhs[0],element_partitioning);
+
+	node_partitioning=mxMalloc(numberofgrids*sizeof(double));
+	for (i=0;i<numberofgrids;i++){
+		node_partitioning[i]=(double)int_node_partitioning[i]+1; //Metis indexing from 0, matlab from 1.
+	}
+	plhs[1]=mxCreateDoubleMatrix(numberofgrids,1,mxREAL);
+	mxSetPr(plhs[1],node_partitioning);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void MeshPartitionUsage(void){
+	printf("   usage:\n");
+	printf("   [element_partitioning,node_partitioning]=MeshPartition(model,num_areas)");
+	printf("   where:\n");
+	printf("      model is a @model class object instance,num_areas is the number of processors on which partitioning will occur.\n");
+	printf("      element_partitioning is a vector of partitioning area numbers, for every element.\n");
+	printf("      node_partitioning is a vector of partitioning area numbers, for every node.\n");
+	printf("\n");
+}
Index: /issm/trunk/src/mex/MeshPartition/MeshPartition.cpp
===================================================================
--- /issm/trunk/src/mex/MeshPartition/MeshPartition.cpp	(revision 1)
+++ /issm/trunk/src/mex/MeshPartition/MeshPartition.cpp	(revision 1)
@@ -0,0 +1,111 @@
+/*!\file:  MeshPartition.cpp
+ * \brief: partition mesh according to number of areas, using Metis library.
+
+	usage:
+	[element_partitioning,node_partitioning]=MeshPartition(model,numareas)
+	
+	%Info needed from model are the following: 
+	%mesh info: 
+	numberofelements,numberofgrids,elements,elements_width
+	%Non-extruded 2d mesh info
+	nel2d,nods2d,elements2d,
+	%Extruded 2d mesh info
+	nel2d_ext,nods2d_ext,elements2d_ext,
+	%Diverse
+	numlayers,meshtype)
+
+	output:
+	vector of partitioning area numbers, for every element.
+	vector of partitioning area numbers, for every node.
+*/
+	
+#include "./MeshPartition.h"
+
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
+
+
+	/*Indexing: */
+	int i,j;
+
+	/* required input: */
+	char* meshtype=NULL;
+	int numberofelements;
+	int numberofgrids;
+	double* elements=NULL;
+	int     elements_width;
+
+	int numberofelements2d;
+	int numberofgrids2d;
+	double* elements2d=NULL;
+
+	int numlayers;
+	int numareas=1;
+
+	/* output: */
+	int*    int_element_partitioning=NULL;
+	int*    int_node_partitioning   =NULL;
+	double* element_partitioning    =NULL;
+	double* node_partitioning       =NULL;
+
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&MeshPartitionUsage);
+
+	/*Fetch data: */
+	FetchData((void**)&meshtype,NULL,NULL,mxGetField(MODEL,0,"type"),"String",NULL);
+	FetchData((void**)&numberofelements,NULL,NULL,mxGetField(MODEL,0,"numberofelements"),"Integer",NULL);
+	FetchData((void**)&numberofgrids,NULL,NULL,mxGetField(MODEL,0,"numberofgrids"),"Integer",NULL);
+	FetchData((void**)&elements,NULL,&elements_width,mxGetField(MODEL,0,"elements"),"Matrix","Mat");
+
+	
+	
+	if (strcmp(meshtype,"3d")==0){
+	
+		FetchData((void**)&numberofelements2d,NULL,NULL,mxGetField(MODEL,0,"numberofelements2d"),"Integer",NULL);
+		FetchData((void**)&numberofgrids2d,NULL,NULL,mxGetField(MODEL,0,"numberofgrids2d"),"Integer",NULL);
+		FetchData((void**)&elements2d,NULL,NULL,mxGetField(MODEL,0,"elements2d"),"Matrix","Mat");
+
+	}
+	FetchData((void**)&numlayers,NULL,NULL,mxGetField(MODEL,0,"numlayers"),"Integer",NULL);
+	FetchData((void**)&numareas,NULL,NULL,NUMAREAS,"Integer",NULL);
+
+	/*Run partitioning algorithm based on a "clever" use of the Metis partitioner: */
+	MeshPartitionx(&int_element_partitioning,&int_node_partitioning,numberofelements,numberofgrids,elements,
+		numberofelements2d,numberofgrids2d,elements2d,numlayers,elements_width,meshtype,numareas);
+
+	/*Post process node_partitioning and element_partitioning to be in double format. Metis needed them in int* format: */
+	element_partitioning=(double*)xmalloc(numberofelements*sizeof(double));
+	for (i=0;i<numberofelements;i++){
+		element_partitioning[i]=(double)int_element_partitioning[i]+1; //Metis indexing from 0, matlab from 1.
+	}
+	
+	node_partitioning=(double*)xmalloc(numberofgrids*sizeof(double));
+	for (i=0;i<numberofgrids;i++){
+		node_partitioning[i]=(double)int_node_partitioning[i]+1; //Metis indexing from 0, matlab from 1.
+	}
+
+	/*Write data:*/
+	WriteData(ELEMENTPARTITIONING,element_partitioning,numberofelements,1,"Matrix","Mat");
+	WriteData(NODEPARTITIONING,node_partitioning,numberofgrids,1,"Matrix","Mat");
+	
+	/*Free ressources:*/
+	//don't! let matlab do it.
+
+
+	/*end module: */
+	MODULEEND();
+}
+
+void MeshPartitionUsage(void){
+	printf("   usage:\n");
+	printf("   [element_partitioning,node_partitioning]=MeshPartition(model,numareas)");
+	printf("   where:\n");
+	printf("      model is a @model class object instance,numareas is the number of processors on which partitioning will occur.\n");
+	printf("      element_partitioning is a vector of partitioning area numbers, for every element.\n");
+	printf("      node_partitioning is a vector of partitioning area numbers, for every node.\n");
+	printf("\n");
+}
Index: /issm/trunk/src/mex/MeshPartition/MeshPartition.h
===================================================================
--- /issm/trunk/src/mex/MeshPartition/MeshPartition.h	(revision 1)
+++ /issm/trunk/src/mex/MeshPartition/MeshPartition.h	(revision 1)
@@ -0,0 +1,37 @@
+
+/*
+	MeshPartition.h
+*/
+
+
+#ifndef _MESHPARTITION_H
+#define _MESHPARTITION_H
+
+/* local prototypes: */
+void MeshPartitionUsage(void);
+
+#include "../../c/issm.h"
+
+#undef CLEANUP
+#define CLEANUP MeshPartitionLocalCleanup();
+
+#undef __FUNCT__ 
+#define __FUNCT__  "MeshPartition"
+
+/* serial input macros: */
+#define MODEL (mxArray*)prhs[0]
+#define NUMAREAS (mxArray*)prhs[1]
+
+/* serial output macros: */
+#define ELEMENTPARTITIONING (mxArray**)&plhs[0]
+#define NODEPARTITIONING (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS  2
+
+
+#endif  /* _MESHPARTITION_H */
+
Index: /issm/trunk/src/mex/Misfit/Misfit.cpp
===================================================================
--- /issm/trunk/src/mex/Misfit/Misfit.cpp	(revision 1)
+++ /issm/trunk/src/mex/Misfit/Misfit.cpp	(revision 1)
@@ -0,0 +1,67 @@
+/*\file Misfit.c
+ *\brief: compute misfit between modeled velocity and observed velocity
+ */
+
+#include "./Misfit.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* elements=NULL;
+	DataSet* nodes=NULL;
+	DataSet* loads=NULL;
+	DataSet* materials=NULL;
+	int      analysis_type;
+	double*  u_g=NULL;
+	double*  u_g_obs=NULL;
+	ParameterInputs* inputs=NULL;
+
+	/* output datasets: */
+	double J;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&MisfitUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
+	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
+	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
+	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	FetchData((void**)&analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"analysis_type"),"Integer",NULL);
+	FetchData((void**)&u_g,NULL,NULL,UG,"Vector","Vec");
+	FetchData((void**)&u_g_obs,NULL,NULL,UGOBS,"Vector","Vec");
+
+	/*Fetch inputs: */
+	ParameterInputsInit(&inputs,INPUTS);
+
+	/*!Call core code: */
+	Misfitx(&J, elements,nodes,loads,materials,u_g,u_g_obs,inputs,analysis_type);
+
+	/*write output : */
+	WriteData(MISFIT,&J,0,0,"Scalar",NULL);
+
+	/*Free ressources: */
+	delete elements;
+	delete nodes;
+	delete loads;
+	delete materials;
+	xfree((void**)&u_g);
+	xfree((void**)&u_g_obs);
+	DeleteParameterInputs(&inputs);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void MisfitUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [J] = %s(elements, nodes,loads, materials, parameters, u_g, u_g_obs,inputs);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Misfit/Misfit.h
===================================================================
--- /issm/trunk/src/mex/Misfit/Misfit.h	(revision 1)
+++ /issm/trunk/src/mex/Misfit/Misfit.h	(revision 1)
@@ -0,0 +1,41 @@
+
+/*
+	Misfit.h
+*/
+
+
+#ifndef _MISFIT_H
+#define _MISFIT_H
+
+/* local prototypes: */
+void MisfitUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Misfit"
+
+/* serial input macros: */
+#define ELEMENTS (mxArray*)prhs[0]
+#define NODES (mxArray*)prhs[1]
+#define LOADS (mxArray*)prhs[2]
+#define MATERIALS (mxArray*)prhs[3]
+#define PARAMETERS (mxArray*)prhs[4]
+#define UG (mxArray*)prhs[5]
+#define UGOBS (mxArray*)prhs[6]
+#define INPUTS (mxArray*)prhs[7]
+
+/* serial output macros: */
+#define MISFIT (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  8
+
+
+#endif  /* _MISFIT_H */
+
+
+
Index: /issm/trunk/src/mex/ModelProcessor/ModelProcessor.cpp
===================================================================
--- /issm/trunk/src/mex/ModelProcessor/ModelProcessor.cpp	(revision 1)
+++ /issm/trunk/src/mex/ModelProcessor/ModelProcessor.cpp	(revision 1)
@@ -0,0 +1,71 @@
+/*\file ModelProcessor.c
+ *\brief: processes model inputs from the matlab workspace, and transforms them into datasets or vectors 
+ *        that will be used throughout the matlab solution sequences.
+ */
+
+#include "./ModelProcessor.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){ 
+
+	/*diverse: */
+	int   noerr=1;
+
+	/* output datasets: */
+	DataSet* elements=NULL;
+	DataSet* nodes=NULL;
+	DataSet* constraints=NULL;
+	DataSet* loads=NULL;
+	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
+
+	/*input model: */
+	Model* model=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ModelProcessorUsage);
+
+	/*Fill model with matlab workspace data: */
+	ModelInit(&model,MODEL); //this routine goes through the entire MODEL matlab class, and starts filling the corresponding "c" code model object.
+
+	/*Create elements, nodes and materials: */
+	ModelCreateElementsNodesAndMaterials(&elements,&nodes,&materials,model,MODEL);
+
+	/*Create constraints: */
+	ModelCreateConstraints(&constraints,model,MODEL);
+	
+	/*Create loads: */
+	ModelCreateLoads(&loads,model,MODEL);
+	
+	/*Create parameters: */
+	ModelCreateParameters(&parameters,model,MODEL);
+
+	/*Write output data: */
+	WriteData(ELEMENTS,elements,0,0,"DataSet",NULL);
+	WriteData(NODES,nodes,0,0,"DataSet",NULL);
+	WriteData(CONSTRAINTS,constraints,0,0,"DataSet",NULL);
+	WriteData(LOADS,loads,0,0,"DataSet",NULL);
+	WriteData(MATERIALS,materials,0,0,"DataSet",NULL);
+	WriteData(PARAMETERS,parameters,0,0,"DataSet",NULL);
+
+	/*Free ressources: */
+	DeleteModel(&model);
+	delete elements;
+	delete nodes;
+	delete constraints;
+	delete loads;
+	delete materials;
+	delete parameters;
+
+	/*end module: */
+	MODULEEND();
+}
+	
+void ModelProcessorUsage(void) {
+	_printf_("\n");
+	_printf_("   usage: [elements,grids,constraints,loads,materials,parameters,part,tpart]=ModelProcessor(model)\n");
+	_printf_("   where: model is an instance of the matlab @model class.\n");
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/ModelProcessor/ModelProcessor.h
===================================================================
--- /issm/trunk/src/mex/ModelProcessor/ModelProcessor.h	(revision 1)
+++ /issm/trunk/src/mex/ModelProcessor/ModelProcessor.h	(revision 1)
@@ -0,0 +1,40 @@
+/*\file ModelProcessor.h
+ * \brief: ModelProcessor module include
+ */
+
+#ifndef _MEXMODELPROCESSOR_H_
+#define _MEXMODELPROCESSOR_H_
+
+/* local prototypes: */
+void ModelProcessorUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "ModelProcessor"
+
+#undef CLEANUP
+#define CLEANUP ModelProcessorLocalCleanup();
+
+#undef ALL
+#define ALL 0
+
+/* serial input macros: */
+#define MODEL (mxArray*)prhs[0]
+
+/* serial output macros: */
+#define ELEMENTS (mxArray**)&plhs[0]
+#define NODES (mxArray**)&plhs[1]
+#define CONSTRAINTS (mxArray**)&plhs[2]
+#define LOADS (mxArray**)&plhs[3]
+#define MATERIALS (mxArray**)&plhs[4]
+#define PARAMETERS (mxArray**)&plhs[5]
+		
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  6
+#undef NRHS
+#define NRHS  1
+
+#endif  /* _MEXMODELPROCESSOR_H */
+
Index: /issm/trunk/src/mex/MpcNodes/MpcNodes.cpp
===================================================================
--- /issm/trunk/src/mex/MpcNodes/MpcNodes.cpp	(revision 1)
+++ /issm/trunk/src/mex/MpcNodes/MpcNodes.cpp	(revision 1)
@@ -0,0 +1,51 @@
+/*\file MpcNodes.c
+ *\brief:  handle rigid body modes.
+ */
+
+#include "./MpcNodes.h"
+
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* nodes=NULL;
+	DataSet* constraints=NULL;
+
+	/* output datasets: */
+	Mat         Rmg=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&MpcNodesUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
+	FetchData((void**)&constraints,NULL,NULL,CONSTRAINTS,"DataSet",NULL);
+
+	/*!Generate internal degree of freedom numbers: */
+	MpcNodesx( &Rmg, nodes,constraints); 
+	
+	/*write output datasets: */
+	WriteData(RMG,Rmg,0,0,"Matrix",NULL);
+	WriteData(NODES,nodes,0,0,"DataSet",NULL);
+
+	/*Free ressources: */
+	delete nodes;
+	delete constraints;
+	MatFree(&Rmg);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void MpcNodesUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: m.Rmg=%s(m.nodes,m.constraints);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/MpcNodes/MpcNodes.h
===================================================================
--- /issm/trunk/src/mex/MpcNodes/MpcNodes.h	(revision 1)
+++ /issm/trunk/src/mex/MpcNodes/MpcNodes.h	(revision 1)
@@ -0,0 +1,33 @@
+
+/*
+	MpcNodes.h
+*/
+
+
+#ifndef _MPCNODES_H
+#define _MPCNODES_H
+
+/* local prototypes: */
+void MpcNodesUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "MpcNodes"
+
+/* serial input macros: */
+#define NODESIN (mxArray*)prhs[0]
+#define CONSTRAINTS (mxArray*)prhs[1]
+
+/* serial output macros: */
+#define RMG (mxArray**)&plhs[0]
+#define NODES (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS  2
+
+
+#endif  /* _MPCNODES_H */
Index: /issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.cpp
===================================================================
--- /issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.cpp	(revision 1)
+++ /issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.cpp	(revision 1)
@@ -0,0 +1,49 @@
+/*\file NormalizeConstraints.c
+ *\brief: normalize constraints matrix for rigid body modes
+ */
+
+#include "./NormalizeConstraints.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	Mat       Rmg=NULL;
+	NodeSets* nodesets=NULL;
+
+	/* output datasets: */
+	Mat Gmn=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&NormalizeConstraintsUsage);
+
+	/*Input datasets: */
+	FetchNodeSets(&nodesets,NODESETS);
+	FetchData((void**)&Rmg,NULL,NULL,RMG,"Matrix",NULL);
+
+	/*!Generate internal degree of freedom numbers: */
+	NormalizeConstraintsx(&Gmn, Rmg,nodesets);
+
+	/*write output datasets: */
+	WriteData(GMN,Gmn,0,0,"Matrix",NULL);
+
+	/*Free ressources: */
+	delete nodesets;
+	MatFree(&Rmg);
+	MatFree(&Gmn);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void NormalizeConstraintsUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [Gmn] = %s(Rmg,nodesets);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.h
===================================================================
--- /issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.h	(revision 1)
+++ /issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.h	(revision 1)
@@ -0,0 +1,31 @@
+/*!\file:  NormalizeConstraints.h
+ * \brief  header file for NormalizeConstraints module
+ */ 
+
+#ifndef _NORMALIZE_CONSTRAINTS_H
+#define _NORMALIZE_CONSTRAINTS_H
+
+/* local prototypes: */
+void NormalizeConstraintsUsage(void);
+
+#include "../../c/issm.h"
+
+/* serial input macros: */
+#define RMG (mxArray*)prhs[0]
+#define NODESETS (mxArray*)prhs[1]
+
+/* serial output macros: */
+#define GMN (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  2
+
+#undef __FUNCT__ 
+#define __FUNCT__  "NormalizeConstraints"
+
+
+#endif  /* _NORMALIZE_CONSTRAINTS_H */
+
Index: /issm/trunk/src/mex/Orth/Orth.cpp
===================================================================
--- /issm/trunk/src/mex/Orth/Orth.cpp	(revision 1)
+++ /issm/trunk/src/mex/Orth/Orth.cpp	(revision 1)
@@ -0,0 +1,49 @@
+/*\file Orth.c
+ *\brief: orthogonalize searching directions for inverse control methods.
+ */
+
+#include "./Orth.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	Vec gradj=NULL;
+	Vec oldgradj=NULL;
+
+	/* output datasets: */
+	Vec newgradj=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&OrthUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&gradj,NULL,NULL,GRADJ,"Vector",NULL);
+	FetchData((void**)&oldgradj,NULL,NULL,OLDGRADJ,"Vector",NULL);
+
+	/*!Reduce load from g to f size: */
+	Orthx(&newgradj, gradj,oldgradj);
+
+	/*write output datasets: */
+	WriteData(NEWGRADJ,newgradj,0,0,"Vector",NULL);
+
+	/*Free ressources: */
+	VecFree(&gradj);
+	VecFree(&oldgradj);
+	VecFree(&newgradj);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void OrthUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [newgradj] = %s(gradj,oldgradj);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Orth/Orth.h
===================================================================
--- /issm/trunk/src/mex/Orth/Orth.h	(revision 1)
+++ /issm/trunk/src/mex/Orth/Orth.h	(revision 1)
@@ -0,0 +1,33 @@
+
+/*
+	Orth.h
+*/
+
+
+#ifndef _ORTH_H
+#define _ORTH_H
+
+/* local prototypes: */
+void OrthUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Orth"
+
+/* serial input macros: */
+#define GRADJ (mxArray*)prhs[0]
+#define OLDGRADJ (mxArray*)prhs[1]
+
+/* serial output macros: */
+#define NEWGRADJ (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  2
+
+
+#endif  /* _ORTH_H */
+
Index: /issm/trunk/src/mex/ParamsToWorkspace/ParamsToWorkspace.cpp
===================================================================
--- /issm/trunk/src/mex/ParamsToWorkspace/ParamsToWorkspace.cpp	(revision 1)
+++ /issm/trunk/src/mex/ParamsToWorkspace/ParamsToWorkspace.cpp	(revision 1)
@@ -0,0 +1,41 @@
+/*\file ParamsToWorkspace.c
+ *\brief: output parameters to params structure in matlab workspace
+ */
+
+#include "./ParamsToWorkspace.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* parameters=NULL;
+
+	/* output datasets: */
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ParamsToWorkspaceUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&parameters,NULL,NULL,PARAMETERSIN,"DataSet",NULL);
+
+	/*Write parameters into a matlab structure in the matlab workspace: */
+	WriteParams(PARAMETERSOUT,parameters);
+
+	/*Free ressources: */
+	delete parameters;
+
+	/*end module: */
+	MODULEEND();
+}
+
+void ParamsToWorkspaceUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [m.params] = %s(parameters);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/ParamsToWorkspace/ParamsToWorkspace.h
===================================================================
--- /issm/trunk/src/mex/ParamsToWorkspace/ParamsToWorkspace.h	(revision 1)
+++ /issm/trunk/src/mex/ParamsToWorkspace/ParamsToWorkspace.h	(revision 1)
@@ -0,0 +1,32 @@
+
+/*
+	ParamsToWorkspace.h
+*/
+
+
+#ifndef _PARAMS_TO_WORKSPACE_H
+#define _PARAMS_TO_WORKSPACE_H
+
+/* local prototypes: */
+void ParamsToWorkspaceUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "ParamsToWorkspace"
+
+/* serial input macros: */
+#define PARAMETERSIN (mxArray*)prhs[0]
+
+/* serial output macros: */
+#define PARAMETERSOUT (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  1
+
+
+#endif  /* _PARAMS_TO_WORKSPACE_H */
+
Index: /issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp
===================================================================
--- /issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp	(revision 1)
+++ /issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp	(revision 1)
@@ -0,0 +1,67 @@
+/*\file PenaltyConstraints.c
+ *\brief: set up penalty constraints
+ */
+
+#include "./PenaltyConstraints.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* elements=NULL;
+	DataSet* nodes=NULL;
+	DataSet* loads=NULL;
+	DataSet* materials=NULL;
+	ParameterInputs* inputs=NULL;
+	int               analysis_type;
+
+	/*output: */
+	int converged;
+	int num_unstable_constraints;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&PenaltyConstraintsUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
+	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
+	FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL);
+	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	
+	/*parameters: */
+	FetchData((void**)&analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"analysis_type"),"Integer",NULL);
+
+	/*Fetch inputs: */
+	ParameterInputsInit(&inputs,INPUTS);
+
+	/*!Generate internal degree of freedom numbers: */
+	PenaltyConstraintsx(&converged, &num_unstable_constraints, elements,nodes,loads,materials,inputs,analysis_type); 
+
+	/*write output datasets: */
+	WriteData(LOADS,loads,0,0,"DataSet",NULL); 
+	WriteData(CONVERGED,(void*)&converged,0,0,"Integer",NULL); 
+	WriteData(NUMUNSTABLECONSTRAINTS,(void*)&num_unstable_constraints,0,0,"Integer",NULL); 
+	
+	
+	/*Free ressources: */
+	delete elements;
+	delete nodes;
+	delete loads;
+	delete materials;
+	DeleteParameterInputs(&inputs);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void PenaltyConstraintsUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [loads, constraints_converged, num_unstable_constraints] = %s(elements,nodes,loads,materials,params,inputs);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.h
===================================================================
--- /issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.h	(revision 1)
+++ /issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.h	(revision 1)
@@ -0,0 +1,37 @@
+
+/*
+	PenaltyConstraints.h
+*/
+
+
+#ifndef _PENALTYCONSTRAINTS_H
+#define _PENALTYCONSTRAINTS_H
+
+/* local prototypes: */
+void PenaltyConstraintsUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "PenaltyConstraints"
+
+/* serial input macros: */
+#define ELEMENTS (mxArray*)prhs[0]
+#define NODES (mxArray*)prhs[1]
+#define LOADSIN (mxArray*)prhs[2]
+#define MATERIALS (mxArray*)prhs[3]
+#define PARAMETERS (mxArray*)prhs[4]
+#define INPUTS (mxArray*)prhs[5]
+
+/* serial output macros: */
+#define LOADS (mxArray**)&plhs[0]
+#define CONVERGED (mxArray**)&plhs[1]
+#define NUMUNSTABLECONSTRAINTS (mxArray**)&plhs[2]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  3
+#undef NRHS
+#define NRHS  6
+
+#endif  /* _PENALTYCONSTRAINTS_H */
Index: /issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp
===================================================================
--- /issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp	(revision 1)
+++ /issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp	(revision 1)
@@ -0,0 +1,69 @@
+/*\file PenaltySystemMatrices.c
+ *\brief: build penalty matrices
+ */
+
+#include "./PenaltySystemMatrices.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	Mat      Kgg=NULL;
+	Vec      pg=NULL;
+	DataSet* elements=NULL;
+	DataSet* nodes=NULL;
+	DataSet* loads=NULL;
+	DataSet* materials=NULL;
+	int         kflag,pflag;
+	ParameterInputs* inputs=NULL;
+	int               analysis_type;
+	
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&PenaltySystemMatricesUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&Kgg,NULL,NULL,KGGIN,"Matrix",NULL);
+	FetchData((void**)&pg,NULL,NULL,PGIN,"Vector",NULL);
+	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
+	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
+	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
+	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	/*parameters: */
+	FetchData((void**)&kflag,NULL,NULL,mxGetField(PARAMETERS,0,"kflag"),"Integer",NULL);
+	FetchData((void**)&pflag,NULL,NULL,mxGetField(PARAMETERS,0,"pflag"),"Integer",NULL);
+	FetchData((void**)&analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"analysis_type"),"Integer",NULL);
+
+	/*Fetch inputs: */
+	ParameterInputsInit(&inputs,INPUTS);
+
+	/*!Generate stiffnesses from penalties: */
+	PenaltySystemMatricesx(Kgg, pg,elements,nodes,loads,materials,kflag,pflag,inputs,analysis_type); 
+
+	/*write output datasets: */
+	WriteData(KGG,Kgg,0,0,"Matrix",NULL); 
+	WriteData(PG,pg,0,0,"Vector",NULL); 
+	
+	/*Free ressources: */
+	delete elements;
+	delete nodes;
+	delete loads;
+	delete materials;
+	DeleteParameterInputs(&inputs);
+	MatFree(&Kgg);
+	VecFree(&pg);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void PenaltySystemMatricesUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [Kgg,pg] = %s(Kggin,pgin,eleemnts,nodes,loads,materials,params,inputs);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.h
===================================================================
--- /issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.h	(revision 1)
+++ /issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.h	(revision 1)
@@ -0,0 +1,39 @@
+
+/*
+	PenaltySystemMatrices.h
+*/
+
+
+#ifndef _PENALTYSYSTEMMATRICES_H
+#define _PENALTYSYSTEMMATRICES_H
+
+/* local prototypes: */
+void PenaltySystemMatricesUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "PenaltySystemMatrices"
+
+/* serial input macros: */
+#define KGGIN (mxArray*)prhs[0]
+#define PGIN (mxArray*)prhs[1]
+#define ELEMENTS (mxArray*)prhs[2]
+#define NODES (mxArray*)prhs[3]
+#define LOADS (mxArray*)prhs[4]
+#define MATERIALS (mxArray*)prhs[5]
+#define PARAMETERS (mxArray*)prhs[6]
+#define INPUTS (mxArray*)prhs[7]
+
+/* serial output macros: */
+#define KGG (mxArray**)&plhs[0]
+#define PG (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS  8
+
+
+#endif  /* _PENALTYSYSTEMMATRICES_H */
Index: /issm/trunk/src/mex/ProcessParams/ProcessParams.cpp
===================================================================
--- /issm/trunk/src/mex/ProcessParams/ProcessParams.cpp	(revision 1)
+++ /issm/trunk/src/mex/ProcessParams/ProcessParams.cpp	(revision 1)
@@ -0,0 +1,45 @@
+/*\file ProcessParams.c
+ *\brief: process parameters using partition vector
+ */
+
+#include "./ProcessParams.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* parameters=NULL;
+	Vec partition=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ProcessParamsUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&parameters,NULL,NULL,PARAMETERSIN,"DataSet",NULL);
+	FetchData((void**)&partition,NULL,NULL,PARTITION,"Vector",NULL);
+
+	/*!Generate internal degree of freedom numbers: */
+	ProcessParamsx(parameters,partition);
+
+	/*write output datasets: */
+	WriteData(PARAMETERSOUT,parameters,0,0,"DataSet",NULL);
+
+	/*Free ressources: */
+	delete parameters;
+	VecFree(&partition);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void ProcessParamsUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [parameters] = %s(parameters,partition);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/ProcessParams/ProcessParams.h
===================================================================
--- /issm/trunk/src/mex/ProcessParams/ProcessParams.h	(revision 1)
+++ /issm/trunk/src/mex/ProcessParams/ProcessParams.h	(revision 1)
@@ -0,0 +1,33 @@
+
+/*
+	ProcessParams.h
+*/
+
+
+#ifndef _PROCESSPARAMS_H
+#define _PROCESSPARAMS_H
+
+/* local prototypes: */
+void ProcessParamsUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "ProcessParams"
+
+/* serial input macros: */
+#define PARAMETERSIN (mxArray*)prhs[0]
+#define PARTITION (mxArray*)prhs[1]
+
+/* serial output macros: */
+#define PARAMETERSOUT (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  2
+
+
+#endif  /* _PROCESSPARAMS_H */
+
Index: /issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.cpp
===================================================================
--- /issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.cpp	(revision 1)
+++ /issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.cpp	(revision 1)
@@ -0,0 +1,57 @@
+/*\file Reduceloadfromgtof.c
+ *\brief: reduce load from g set to f set
+ */
+
+#include "./Reduceloadfromgtof.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	Vec pg=NULL;
+	Mat Gmn=NULL;
+	Mat Kfs=NULL;
+	Vec ys=NULL;
+	NodeSets* nodesets=NULL;
+
+	/* output datasets: */
+	Vec pf=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ReduceloadfromgtofUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&pg,NULL,NULL,PG,"Vector",NULL);
+	FetchData((void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);
+	FetchData((void**)&Kfs,NULL,NULL,KFS,"Matrix",NULL);
+	FetchData((void**)&ys,NULL,NULL,YS,"Vector",NULL);
+	FetchNodeSets(&nodesets,NODESETS);
+
+	/*!Reduce load from g to f size: */
+	Reduceloadfromgtofx(&pf, pg, Gmn, Kfs, ys, nodesets);
+
+	/*write output datasets: */
+	WriteData(PF,pf,0,0,"Vector",NULL);
+
+	/*Free ressources: */
+	VecFree(&pg);
+	MatFree(&Gmn);
+	MatFree(&Kfs);
+	VecFree(&ys);
+	delete nodesets;
+
+	/*end module: */
+	MODULEEND();
+}
+
+void ReduceloadfromgtofUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [pf] = %s(pg,Gmn,Kfs,ys,nodesets);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.h
===================================================================
--- /issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.h	(revision 1)
+++ /issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.h	(revision 1)
@@ -0,0 +1,36 @@
+
+/*
+	Reduceloadfromgtof.h
+*/
+
+
+#ifndef _REDUCELOADFROMGTOF_H
+#define _REDUCELOADFROMGTOF_H
+
+/* local prototypes: */
+void ReduceloadfromgtofUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Reduceloadfromgtof"
+
+/* serial input macros: */
+#define PG (mxArray*)prhs[0]
+#define GMN (mxArray*)prhs[1]
+#define KFS (mxArray*)prhs[2]
+#define YS (mxArray*)prhs[3]
+#define NODESETS (mxArray*)prhs[4]
+
+/* serial output macros: */
+#define PF (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  5
+
+
+#endif  /* _REDUCELOADFROMGTOF_H */
+
Index: /issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.cpp
===================================================================
--- /issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.cpp	(revision 1)
+++ /issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.cpp	(revision 1)
@@ -0,0 +1,55 @@
+/*\file Reducematrixfromgtof.c
+ *\brief: reduce matrix from g set to f set.
+ */
+
+#include "./Reducematrixfromgtof.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	Mat Kgg=NULL;
+	Mat Gmn=NULL;
+	NodeSets* nodesets=NULL;
+
+	/* output datasets: */
+	Mat Kff=NULL;
+	Mat Kfs=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ReducematrixfromgtofUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&Kgg,NULL,NULL,KGG,"Matrix",NULL);
+	FetchData((void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);
+	FetchNodeSets(&nodesets,NODESETS);
+
+	/*!Reduce matrix from g to f size:*/
+	Reducematrixfromgtofx(&Kff,&Kfs,Kgg,Gmn,nodesets);
+
+	/*write output datasets: */
+	WriteData(KFF,Kff,0,0,"Matrix",NULL);
+	WriteData(KFS,Kfs,0,0,"Matrix",NULL);
+
+	/*Free ressources: */
+	delete nodesets;
+	MatFree(&Kgg);
+	MatFree(&Gmn);
+	MatFree(&Kff);
+	MatFree(&Kfs);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void ReducematrixfromgtofUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [Kff,Kfs] = %s(Kgg,Gmn,nodeses);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.h
===================================================================
--- /issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.h	(revision 1)
+++ /issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.h	(revision 1)
@@ -0,0 +1,35 @@
+
+/*
+	Reducematrixfromgtof.h
+*/
+
+
+#ifndef _REDUCEMATRIXFROMGTOF_H
+#define _REDUCEMATRIXFROMGTOF_H
+
+/* local prototypes: */
+void ReducematrixfromgtofUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Reducematrixfromgtof"
+
+/* serial input macros: */
+#define KGG (mxArray*)prhs[0]
+#define GMN (mxArray*)prhs[1]
+#define NODESETS (mxArray*)prhs[2]
+
+/* serial output macros: */
+#define KFF (mxArray**)&plhs[0]
+#define KFS (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS  3
+
+
+#endif  /* _REDUCEMATRIXFROMGTOF_H */
+
Index: /issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.cpp
===================================================================
--- /issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.cpp	(revision 1)
+++ /issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.cpp	(revision 1)
@@ -0,0 +1,52 @@
+/*\file Reducevectorgtos.c
+ *\brief: reduce g set vector to s set vector (set of single point constraints)
+ */
+
+#include "./Reducevectorgtos.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	Vec yg=NULL;
+	NodeSets* nodesets=NULL;
+
+	/* output datasets: */
+	Vec ys=NULL;
+	Vec ys0=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ReducevectorgtosUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&yg,NULL,NULL,YG,"Vector",NULL);
+	FetchNodeSets(&nodesets,NODESETS);
+
+	/*!Reduce vector: */
+	Reducevectorgtosx(&ys,&ys0, yg,nodesets);
+
+	/*write output datasets: */
+	WriteData(YS,ys,0,0,"Vector",NULL);
+	WriteData(YS0,ys0,0,0,"Vector",NULL);
+
+	/*Free ressources: */
+	delete nodesets;
+	VecFree(&yg);
+	VecFree(&ys);
+	VecFree(&ys0);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void ReducevectorgtosUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [ys,ys0] = %s(yg,nodesets);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.h
===================================================================
--- /issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.h	(revision 1)
+++ /issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.h	(revision 1)
@@ -0,0 +1,34 @@
+
+/*
+	Reducevectorgtos.h
+*/
+
+
+#ifndef _REDUCEVECTORGTOS_H
+#define _REDUCEVECTORGTOS_H
+
+/* local prototypes: */
+void ReducevectorgtosUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Reducevectorgtos"
+
+/* serial input macros: */
+#define YG (mxArray*)prhs[0]
+#define NODESETS (mxArray*)prhs[1]
+
+/* serial output macros: */
+#define YS (mxArray**)&plhs[0]
+#define YS0 (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS  2
+
+
+#endif  /* _REDUCEVECTORGTOS_H */
+
Index: /issm/trunk/src/mex/SetStructureField/SetStructureField.cpp
===================================================================
--- /issm/trunk/src/mex/SetStructureField/SetStructureField.cpp	(revision 1)
+++ /issm/trunk/src/mex/SetStructureField/SetStructureField.cpp	(revision 1)
@@ -0,0 +1,149 @@
+/*!\file:  SetStructureField.cpp
+	usage:
+	array=SetStructureField(array,name,field,value);
+	
+	where:
+
+	input:
+
+		array: structure array
+		name: field name of structure array (ie: array.name)
+		field: field of array.name structure
+		value: value of array.name (ie: array.name.field=value;
+		
+	output:
+		array: output structure array
+*/
+	
+
+#include "./SetStructureField.h" 
+
+
+void mexFunction( int nlhs, mxArray* plhs[],
+				  int nrhs, const mxArray* prhs[])
+{
+	/*indexing: */
+	int i,j,n;
+	
+	
+	/*Output: */
+	mxArray* output=NULL;
+
+	/*Input: */
+	int      array_size;
+	char*    name          = NULL;
+	char*    field         = NULL;
+	char*    string        = NULL;
+
+	double*  pvalue        = NULL;
+	int      M,N;
+	double*  valuen        = NULL;
+	mxArray* pvaluen       = NULL;
+
+	
+	/*Matlab array manipulation: */
+	mxArray*       element=NULL;
+	mxArray* pfield        =NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&SetStructureFieldUsage);
+
+	/*Fetch data: */
+	array_size=mxGetM(ARRAYHANDLE);
+
+	/*Duplicate input array, so that it can be returned as output. Matlab won't allow modifying an input mxArray!: */
+	output=mxDuplicateArray(ARRAYHANDLE);
+
+	/*Get name in array.name: */
+	FetchData((void**)&name,NULL,NULL,NAMEHANDLE,"String",NULL);
+
+	/*Get field in array.field: */
+	FetchData((void**)&field,NULL,NULL,FIELDHANDLE,"String",NULL);
+
+	/*Branch out on type of value: */
+	if (mxIsChar(VALUEHANDLE)){
+
+		/*Get string store in the value mxArray: */
+		FetchData((void**)&string,NULL,NULL,VALUEHANDLE,"String",NULL);
+
+		/*Start looping on output array: */
+		for (n=0;n<array_size;n++){
+
+			/*Get pointer to array(n).name: */
+			element=mxGetField(output,n,name);
+
+			/*Set array(n).name.field=value: */
+			mxSetField(element,0,field,mxCreateString(string));
+		}
+	}
+	else{
+
+		/*Get value pointer: */
+		pvalue=mxGetPr(VALUEHANDLE);
+		M=mxGetM(VALUEHANDLE);
+		N=mxGetN(VALUEHANDLE);
+		
+		if(M==1){
+
+			/*Start looping on output array: */
+			for (n=0;n<array_size;n++){
+
+				/*Get pointer to array(n).name: */
+				element=mxGetField(output,n,name);
+
+				/*Set array(n).name.field=value: */
+				mxSetField(element,0,field,mxCreateDoubleScalar(*pvalue));
+			}
+		}
+		else{
+			/*Value is a multidimensional array: */
+
+			/*Start looping on output array: */
+			for (n=0;n<array_size;n++){
+
+				/*For level n, recover value(n,:): */
+				valuen=(double*)xmalloc(N*sizeof(double));
+				for(i=0;i<N;i++){
+					valuen[i]=*(pvalue+M*i+n);
+				}
+
+				/*Set array(n).name.field=value(n,:): */
+				pvaluen=mxCreateDoubleMatrix(N,1,mxREAL);
+				mxSetPr(pvaluen,valuen);
+			
+				element=mxGetField(output,n,name);
+				mxSetField(element,0,field,pvaluen);
+
+			}
+		}
+	}
+	
+	/*Assign output array: */
+	OUTPUTHANDLE=output;
+	
+	/*end module: */
+	MODULEEND();
+}
+
+void SetStructureFieldUsage(void)
+{
+	printf("   SetStructureField.c\n");
+	printf("   usage:\n");
+	printf("   array=SetStructureField(array,name,field,value);\n");
+	printf("   \n");
+	printf("   where:\n");
+	printf("   \n");
+	printf("   input:\n");
+	printf("   \n");
+	printf("   	array: structure array\n");
+	printf("   	name: field name of structure array (ie: array.name)\n");
+	printf("   	field: field of array.name structure\n");
+	printf("   	value: value of array.name (ie: array.name.field=value;\n");
+	printf("   	\n");
+	printf("    output:\n");
+	printf("   	array: output structure array\n");
+	printf("\n");
+}
Index: /issm/trunk/src/mex/SetStructureField/SetStructureField.h
===================================================================
--- /issm/trunk/src/mex/SetStructureField/SetStructureField.h	(revision 1)
+++ /issm/trunk/src/mex/SetStructureField/SetStructureField.h	(revision 1)
@@ -0,0 +1,26 @@
+/*!\file:  SetStructureField.h
+ * \brief header file for SetStructureField routine
+ */ 
+
+#ifndef _SETSTRUCTUREFIELD_H
+#define _SETSTRUCTUREFIELD_H
+
+#define ARRAYHANDLE prhs[0]
+#define NAMEHANDLE prhs[1]
+#define FIELDHANDLE prhs[2]
+#define VALUEHANDLE prhs[3]
+
+#define OUTPUTHANDLE plhs[0]
+
+#include "../../c/issm.h"
+
+/* local prototypes: */
+void SetStructureFieldUsage(void);
+
+#define NRHS 4
+#define NLHS 1
+
+#undef __FUNCT__ 
+#define __FUNCT__ "SetStructureField"
+
+#endif /* _SETSTRUCTUREFIELD_H */
Index: /issm/trunk/src/mex/Solver/Solver.cpp
===================================================================
--- /issm/trunk/src/mex/Solver/Solver.cpp	(revision 1)
+++ /issm/trunk/src/mex/Solver/Solver.cpp	(revision 1)
@@ -0,0 +1,55 @@
+/*\file Solver.c
+ *\brief: solver
+ */
+
+#include "./Solver.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	Mat Kff=NULL;
+	Vec pf=NULL;
+	Vec uf0=NULL;
+	char* solver_string=NULL;
+
+	/* output datasets: */
+	Vec uf=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&SolverUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&Kff,NULL,NULL,KFF,"Matrix",NULL); 
+	FetchData((void**)&pf,NULL,NULL,PF,"Vector",NULL);
+	FetchData((void**)&uf0,NULL,NULL,UF0,"Vector",NULL);
+	FetchData((void**)&solver_string,NULL,NULL,mxGetField(PARAMS,0,"solverstring"),"String",NULL);
+
+	/*!Reduce vector: */
+	Solverx(&uf, Kff, pf, uf0, solver_string);
+
+	/*write output datasets: */
+	WriteData(UF,uf,0,0,"Vector",NULL);
+
+	/*Free ressources: */
+	MatFree(&Kff);
+	VecFree(&pf);
+	VecFree(&uf0);
+	VecFree(&uf);
+	xfree((void**)&solver_string);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void SolverUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [uf] = %s(Kff,pf,uf0,solver_string);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Solver/Solver.h
===================================================================
--- /issm/trunk/src/mex/Solver/Solver.h	(revision 1)
+++ /issm/trunk/src/mex/Solver/Solver.h	(revision 1)
@@ -0,0 +1,35 @@
+
+/*
+	Solver.h
+*/
+
+
+#ifndef _SOLVER_H
+#define _SOLVER_H
+
+/* local prototypes: */
+void SolverUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Solver"
+
+/* serial input macros: */
+#define KFF (mxArray*)prhs[0]
+#define PF (mxArray*)prhs[1]
+#define UF0 (mxArray*)prhs[2]
+#define PARAMS (mxArray*)prhs[3]
+
+/* serial output macros: */
+#define UF (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  4
+
+
+#endif  /* _SOLVER_H */
+
Index: /issm/trunk/src/mex/SpcNodes/SpcNodes.cpp
===================================================================
--- /issm/trunk/src/mex/SpcNodes/SpcNodes.cpp	(revision 1)
+++ /issm/trunk/src/mex/SpcNodes/SpcNodes.cpp	(revision 1)
@@ -0,0 +1,51 @@
+/*\file SpcNodes.c
+ *\brief: build degrees of freedom for every node.
+ */
+
+#include "./SpcNodes.h"
+
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* nodes=NULL;
+	DataSet* constraints=NULL;
+
+	/* output datasets: */
+	Vec         yg=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&SpcNodesUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
+	FetchData((void**)&constraints,NULL,NULL,CONSTRAINTS,"DataSet",NULL);
+	
+	/*!Generate internal degree of freedom numbers: */
+	SpcNodesx( &yg, nodes,constraints); 
+
+	/*write output datasets: */
+	WriteData(NODES,nodes,0,0,"DataSet",NULL);
+	WriteData(YG,yg,0,0,"Vector",NULL);
+
+	/*Free ressources: */
+	delete nodes;
+	delete constraints;
+	VecFree(&yg);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void SpcNodesUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [m.node,m.yg]=%s(m.nodes,m.constraints);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/SpcNodes/SpcNodes.h
===================================================================
--- /issm/trunk/src/mex/SpcNodes/SpcNodes.h	(revision 1)
+++ /issm/trunk/src/mex/SpcNodes/SpcNodes.h	(revision 1)
@@ -0,0 +1,34 @@
+
+/*
+	SpcNodes.h
+*/
+
+
+#ifndef _SPCNODES_H
+#define _SPCNODES_H
+
+/* local prototypes: */
+void SpcNodesUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "SpcNodes"
+
+/* serial input macros: */
+#define NODESIN (mxArray*)prhs[0]
+#define CONSTRAINTS (mxArray*)prhs[1]
+
+/* serial output macros: */
+#define NODES (mxArray**)&plhs[0]
+#define YG (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS  2
+
+
+#endif  /* _SPCNODES_H */
+
Index: /issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp
===================================================================
--- /issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp	(revision 1)
+++ /issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp	(revision 1)
@@ -0,0 +1,74 @@
+/*\file SystemMatrices.c
+ *\brief: build system matrices (stiffness matrix, loads vector)
+ */
+
+#include "./SystemMatrices.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* elements=NULL;
+	DataSet* nodes=NULL;
+	DataSet* loads=NULL;
+	DataSet* materials=NULL;
+	int         kflag,pflag;
+	int         connectivity;
+	int         numberofdofspernode;
+	ParameterInputs* inputs=NULL;
+	int               analysis_type;
+	
+	/* output datasets: */
+	Mat Kgg=NULL;
+	Vec pg=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&SystemMatricesUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
+	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
+	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
+	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	/*parameters: */
+	FetchData((void**)&kflag,NULL,NULL,mxGetField(PARAMETERS,0,"kflag"),"Integer",NULL);
+	FetchData((void**)&pflag,NULL,NULL,mxGetField(PARAMETERS,0,"pflag"),"Integer",NULL);
+	FetchData((void**)&connectivity,NULL,NULL,mxGetField(PARAMETERS,0,"connectivity"),"Integer",NULL);
+	FetchData((void**)&numberofdofspernode,NULL,NULL,mxGetField(PARAMETERS,0,"numberofdofspernode"),"Integer",NULL);
+	FetchData((void**)&analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"analysis_type"),"Integer",NULL);
+
+	/*Fetch inputs: */
+	ParameterInputsInit(&inputs,INPUTS);
+
+	/*!Generate internal degree of freedom numbers: */
+	SystemMatricesx(&Kgg, &pg,elements,nodes,loads,materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type); 
+
+	/*write output datasets: */
+	WriteData(KGG,Kgg,0,0,"Matrix",NULL); 
+	WriteData(PG,pg,0,0,"Vector",NULL); 
+	
+	
+	/*Free ressources: */
+	delete elements;
+	delete nodes;
+	delete loads;
+	delete materials;
+	DeleteParameterInputs(&inputs);
+	MatFree(&Kgg);
+	VecFree(&pg);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void SystemMatricesUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [Kgg,pg] = %s(eleemnts,nodes,loads,materials,params,inputs);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/SystemMatrices/SystemMatrices.h
===================================================================
--- /issm/trunk/src/mex/SystemMatrices/SystemMatrices.h	(revision 1)
+++ /issm/trunk/src/mex/SystemMatrices/SystemMatrices.h	(revision 1)
@@ -0,0 +1,37 @@
+
+/*
+	SystemMatrices.h
+*/
+
+
+#ifndef _SYSTEMMATRICES_H
+#define _SYSTEMMATRICES_H
+
+/* local prototypes: */
+void SystemMatricesUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "SystemMatrices"
+
+/* serial input macros: */
+#define ELEMENTS (mxArray*)prhs[0]
+#define NODES (mxArray*)prhs[1]
+#define LOADS (mxArray*)prhs[2]
+#define MATERIALS (mxArray*)prhs[3]
+#define PARAMETERS (mxArray*)prhs[4]
+#define INPUTS (mxArray*)prhs[5]
+
+/* serial output macros: */
+#define KGG (mxArray**)&plhs[0]
+#define PG (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS  6
+
+
+#endif  /* _SYSTEMMATRICES_H */
Index: /issm/trunk/src/mex/Test/Test.cpp
===================================================================
--- /issm/trunk/src/mex/Test/Test.cpp	(revision 1)
+++ /issm/trunk/src/mex/Test/Test.cpp	(revision 1)
@@ -0,0 +1,46 @@
+/*\file Test.c
+ *\brief:  test module. do whatever you want in here
+ */
+
+#include "./Test.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&TestUsage);
+
+	double* pr=mxGetPr(prhs[0]);
+	int M=mxGetM(prhs[0]);
+	int N=mxGetM(prhs[0]);
+	mwIndex* ir=mxGetIr(prhs[0]);
+	mwIndex* jc=mxGetJc(prhs[0]);
+	int     nzmax=(int)mxGetNzmax(prhs[0]);
+
+	int i;
+	printf("nzmax %i\n",nzmax);
+	printf("jc:\n");
+	for(i=0;i<N+1;i++){
+		printf("%i\n",jc[i]);
+	}
+	printf("ir vale:\n");
+	for(i=0;i<nzmax;i++){
+		printf("%i %g\n",ir[i],pr[i]);
+	}	
+
+
+	/*end module: */
+	MODULEEND();
+}
+
+void TestUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: %s(whatever in here);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/Test/Test.h
===================================================================
--- /issm/trunk/src/mex/Test/Test.h	(revision 1)
+++ /issm/trunk/src/mex/Test/Test.h	(revision 1)
@@ -0,0 +1,25 @@
+/*!\file:  Test.h
+ * \brief header file for Test module.
+ */ 
+
+#ifndef _TEST_H
+#define _TEST_H
+
+/* local prototypes: */
+void TestUsage(void);
+
+#include "../../c/issm.h"
+    
+/* serial input macros: */
+#define DATASET (mxArray*)prhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  0
+#undef NRHS
+#define NRHS  1
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Test"
+
+#endif  /* _TEST_H */
Index: /issm/trunk/src/mex/TriMesh/TriMesh.cpp
===================================================================
--- /issm/trunk/src/mex/TriMesh/TriMesh.cpp	(revision 1)
+++ /issm/trunk/src/mex/TriMesh/TriMesh.cpp	(revision 1)
@@ -0,0 +1,366 @@
+/*
+ * TriMesh: out of a domain outline file ( Argus format ), 
+ * use the Triangle package to create a triangular mesh 
+ *
+ */
+
+#include "./TriMesh.h"
+
+
+void mexFunction(	int nlhs, mxArray* plhs[],
+					int nrhs, const mxArray* prhs[] )
+{
+
+
+	/*Matlab arrays: */
+	mxArray* pmxa_array=NULL;
+	int i,j;
+	int counter,counter2,backcounter;
+	int prhs_counter;
+	
+	/* returned quantities: */
+
+	double* index=NULL;
+	double* x=NULL;
+	double* y=NULL;
+	double* segments=NULL;
+	double*    segmentmarkerlist=NULL;
+
+	/* input: */
+	char*  domainname=NULL;
+	char*  riftname=NULL;
+	double area;
+	char*  order=NULL;
+	
+	/*Domain outline variables: */
+	int      nprof;
+	int*     profngrids=NULL;
+	double** pprofx=NULL;
+	double** pprofy=NULL;
+	double*  xprof=NULL;
+	double*  yprof=NULL;
+	int      numberofpoints;
+
+	/*Rift outline variables: */
+	int      numrifts;
+	int*     riftsnumgrids=NULL;
+	double** riftsgridsx=NULL;
+	double** riftsgridsy=NULL;
+
+	/* error handling: */
+	int		noerr=1;	
+  
+	/* Triangle structures: */
+	struct triangulateio in,out;
+	char   options[256];
+
+	/* verify correct usage: */
+	if (nlhs==0 && nrhs==0) {
+		/* special case: */
+		TriMeshUsage();
+		return;
+	}
+
+	if (!(  (nlhs==5) ||(nrhs==2) || (nrhs==3)  || (nrhs==4) )){
+		mexPrintf("   %s format error.\n", __FUNCT__);
+		TriMeshUsage();
+		printf("   ");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Fetch data needed by Triangle: */
+
+	prhs_counter=0;
+	/*First recover the domain outline file name: */
+	if (!mxIsChar(prhs[prhs_counter])){
+		mexPrintf("%s%s\n",__FUNCT__," error message; first argument should be the domain outline file name!");
+		mexErrMsgTxt(" ");
+	}
+	domainname = (char *) mxMalloc((mxGetN(prhs[prhs_counter])+1)*sizeof(char));
+	mxGetString(prhs[prhs_counter],domainname,mxGetN(prhs[prhs_counter])+1);
+
+	/*Look for optional rifts file name: */
+	prhs_counter++;
+	if (mxIsChar(prhs[prhs_counter])){
+		riftname = (char *) mxMalloc((mxGetN(prhs[prhs_counter])+1)*sizeof(char));
+		mxGetString(prhs[prhs_counter],riftname,mxGetN(prhs[prhs_counter])+1);
+		prhs_counter++;
+	}
+
+	/*Recover the mesh density desired:*/
+	area=mxGetScalar(prhs[prhs_counter]);
+
+	/*Optionaly, recover desired order: */
+	prhs_counter++;
+	if (mxIsChar(prhs[prhs_counter])){
+		order = (char *) mxMalloc((mxGetN(prhs[prhs_counter])+1)*sizeof(char));
+		mxGetString(prhs[prhs_counter],order,mxGetN(prhs[prhs_counter])+1);
+	}
+	
+	#ifdef _DEBUG_
+	printf("Domain name: %s\n",domainname);
+	printf("Rift name: %s\n",riftname);
+	printf("Maximum area: %16.16lf\n",area);
+	printf("Order: %s\n",order);
+	#endif
+	
+	
+	/*Start reading the domain outline file: */
+	noerr=DomainOutlineRead(&nprof,&profngrids,&pprofx,&pprofy,domainname);
+	if(!noerr){
+		printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname);
+		mexErrMsgTxt(" ");
+	}
+
+	/*Read rifts file if present: */
+	if(riftname){
+		noerr=DomainOutlineRead(&numrifts,&riftsnumgrids,&riftsgridsx,&riftsgridsy,riftname);
+		if(!noerr){
+			printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname);
+			mexErrMsgTxt(" ");
+		}
+	}
+
+	#ifdef _DEBUG_
+	printf("# points in domain outline: %i\n",nprof); 
+	#endif
+	#ifdef _DEBUG2_
+	for (i=0;i<nprof;i++){
+		printf("Profile #%i\n",i);
+		x=pprofx[i];
+		y=pprofy[i];
+		for (j=0;j<profngrids[i];j++){
+			printf("   %lf %lf\n",x[j],y[j]);
+		}
+	}
+	#endif
+
+
+	#ifdef _DEBUG_
+	printf("# points in rift outline: %i\n",numrifts); 
+	#endif
+	#ifdef _DEBUG2_
+	for (i=0;i<numrifts;i++){
+		printf("Profile #%i\n",i);
+		x=riftsgridsx[i];
+		y=riftsgridsy[i];
+		for (j=0;j<riftsnumgrids[i];j++){
+			printf("   %lf %lf\n",x[j],y[j]);
+		}
+	}
+	#endif
+
+	/*Create initial triangulation to call triangulate():*/
+	numberofpoints=0;
+	for (i=0;i<nprof;i++){
+		numberofpoints+=profngrids[i];
+	}
+	if (riftname){
+		for (i=0;i<numrifts;i++){
+			numberofpoints+=riftsnumgrids[i];
+		}
+	}
+	in.numberofpoints=numberofpoints;
+
+	in.numberofpointattributes=1;
+	in.pointlist = (REAL *) mxMalloc(in.numberofpoints * 2 * sizeof(REAL));
+
+	counter=0;
+	for (i=0;i<nprof;i++){
+		xprof=pprofx[i];
+		yprof=pprofy[i];
+		for (j=0;j<profngrids[i];j++){
+			in.pointlist[2*counter+0]=xprof[j];
+			in.pointlist[2*counter+1]=yprof[j];
+			counter++;
+		}
+	}
+	if(riftname){
+		for (i=0;i<numrifts;i++){
+			xprof=riftsgridsx[i];
+			yprof=riftsgridsy[i];
+			for (j=0;j<riftsnumgrids[i];j++){
+				in.pointlist[2*counter+0]=xprof[j];
+				in.pointlist[2*counter+1]=yprof[j];
+				counter++;
+			}
+		}
+	}
+	
+	in.pointattributelist = (REAL *) mxMalloc(in.numberofpoints *
+										  in.numberofpointattributes *
+										  sizeof(REAL));
+	for (i=0;i<in.numberofpoints;i++){
+		in.pointattributelist[i] = 0.0;
+	}
+	in.pointmarkerlist = (int *) mxMalloc(in.numberofpoints * sizeof(int));
+	for(i=0;i<in.numberofpoints;i++){
+		in.pointmarkerlist[i] = 0;
+	}
+	
+
+	/*Build segments: */
+	/*Figure out number of segments: holes and closed outlines have as many segments as grids, 
+	 *for rifts, we have one less segment as we have grids*/
+	in.numberofsegments=0;
+	for (i=0;i<nprof;i++){
+		in.numberofsegments+=profngrids[i];
+	}
+	if (riftname){
+		for (i=0;i<numrifts;i++){
+			in.numberofsegments+=riftsnumgrids[i]-1;
+		}
+	}
+	
+	in.segmentlist = (int *) mxMalloc(in.numberofsegments * 2 * sizeof(int));
+	in.segmentmarkerlist = (int *) mxCalloc(in.numberofsegments,sizeof(int));
+	counter=0;
+	backcounter=0;
+	for (i=0;i<nprof;i++){
+		for (j=0;j<(profngrids[i]-1);j++){
+			in.segmentlist[2*counter+0]=counter;
+			in.segmentlist[2*counter+1]=counter+1;
+			in.segmentmarkerlist[counter]=0;
+			counter++;
+		}
+		/*Close this profile: */
+		 in.segmentlist[2*counter+0]=counter;
+		 in.segmentlist[2*counter+1]=backcounter;
+		 in.segmentmarkerlist[counter]=0;
+		 counter++;
+		 backcounter=counter;
+	}
+	counter2=counter;
+	if(riftname){
+		for (i=0;i<numrifts;i++){
+			for (j=0;j<(riftsnumgrids[i]-1);j++){
+				in.segmentlist[2*counter2+0]=counter;
+				in.segmentlist[2*counter2+1]=counter+1;
+				in.segmentmarkerlist[counter2]=2+i;
+				counter2++;
+				counter++;
+			}
+			counter++;
+		}
+	}
+
+	
+	/*Build regions: */
+	in.numberofregions = 0;
+
+	/*Build holes: */
+	in.numberofholes = nprof-1; /*everything is a hole, but for the first profile.*/
+	in.holelist = (REAL *) mxMalloc(in.numberofholes * 2 * sizeof(REAL));
+	for (i=0;i<nprof-1;i++){
+		/*We are looking for a grid that lies inside the hole: */
+		GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],profngrids[i+1],pprofx[i+1],pprofy[i+1]);
+	}
+
+	/* Make necessary initializations so that Triangle can return a */
+	/*   triangulation in `out': */
+
+	out.pointlist = (REAL *) NULL;            
+	out.pointattributelist = (REAL *) NULL;
+	out.pointmarkerlist = (int *) NULL; 
+	out.trianglelist = (int *) NULL;          
+	out.triangleattributelist = (REAL *) NULL;
+	out.neighborlist = (int *) NULL;         
+	out.segmentlist = (int *) NULL;
+	out.segmentmarkerlist = (int *) NULL;
+	out.edgelist = (int *) NULL;             
+	out.edgemarkerlist = (int *) NULL;   
+
+	/* Triangulate the points:.  Switches are chosen to read and write a  */
+	/*   PSLG (p), preserve the convex hull (c), number everything from  */
+	/*   zero (z), assign a regional attribute to each element (A), and  */
+	/*   produce an edge list (e), a Voronoi diagram (v), and a triangle */
+	/*   neighbor list (n).                                              */
+
+	sprintf(options,"%s%lf","pQzDq34ia",area); /*replace V by Q to quiet down the logging*/
+  
+	triangulate(options, &in, &out, NULL);
+	/*report(&out, 0, 1, 1, 1, 1, 0);*/
+
+	/*Allocate index, x and y: */
+	index=(double*)mxMalloc(3*out.numberoftriangles*sizeof(double));
+	x=(double*)mxMalloc(out.numberofpoints*sizeof(double));
+	y=(double*)mxMalloc(out.numberofpoints*sizeof(double));
+	segments=(double*)mxMalloc(3*out.numberofsegments*sizeof(double));
+	segmentmarkerlist=(double*)mxMalloc(out.numberofsegments*sizeof(double));
+
+	for (i = 0; i < out.numberoftriangles; i++) {
+		for (j = 0; j < out.numberofcorners; j++) {
+			*(index+3*i+j)=(double)out.trianglelist[i * out.numberofcorners + j]+1;
+		}
+	}
+	for (i = 0; i < out.numberofpoints; i++) {
+		x[i]=out.pointlist[i * 2 + 0];
+		y[i]=out.pointlist[i * 2 + 1];
+	}
+	
+	for (i = 0; i < out.numberofsegments; i++) {
+		segments[3*i+0]=(double)out.segmentlist[i*2+0]+1;
+		segments[3*i+1]=(double)out.segmentlist[i*2+1]+1;
+		segmentmarkerlist[i]=(double)out.segmentmarkerlist[i];
+	}
+
+	/*Associate elements with segments: */
+	noerr=AssociateSegmentToElement(&segments,out.numberofsegments,index,out.numberoftriangles);
+
+	/*Order segments so that their normals point outside the domain: */
+	if(!strcmp(order,"yes")){
+		OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
+	}
+
+	/*Output : */
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,3);
+	mxSetN(pmxa_array,out.numberoftriangles);
+	mxSetPr(pmxa_array,index);
+	mexCallMATLAB( 1, &plhs[0], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,1);
+	mxSetN(pmxa_array,out.numberofpoints);
+	mxSetPr(pmxa_array,x);
+	mexCallMATLAB( 1, &plhs[1], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,1);
+	mxSetN(pmxa_array,out.numberofpoints);
+	mxSetPr(pmxa_array,y);
+	mexCallMATLAB( 1, &plhs[2], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,3);
+	mxSetN(pmxa_array,out.numberofsegments);
+	mxSetPr(pmxa_array,segments);
+	mexCallMATLAB( 1, &plhs[3], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,1);
+	mxSetN(pmxa_array,out.numberofsegments);
+	mxSetPr(pmxa_array,segmentmarkerlist);
+	mexCallMATLAB( 1, &plhs[4], 1, &pmxa_array, "'");
+	
+	return;
+}
+
+void TriMeshUsage(void)
+{
+	printf("\n");
+	printf("   usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,riftsoutlinename,area,ordered) \n");
+	printf("      where: index,x,y defines a triangulation, segments is an array made \n");
+	printf("      of exterior segments to the mesh domain outline, segmentmarkers is an array flagging each segment \n");
+	printf("      (if rifts are present, markers >=2 flag them ), outlinefilename an Argus domain outline file.\n");
+	printf("      riftsoutlinename is an Argus domain file, defining rifts (ie: open profiles), \n");
+	printf("      area is the maximum area desired for any element of the resulting mesh. \n");
+	printf("      and ordered is a string ('yes' or 'no') that determines whether segments are output in the \n");
+	printf("      order they are made by Triangle (ie none), or ordered counter clockwise around the domain outline.\n");
+	printf("      riftsoutlinename and ordered are optional arguments.\n");
+	printf("\n");
+}
+
+
+
+
Index: /issm/trunk/src/mex/TriMesh/TriMesh.h
===================================================================
--- /issm/trunk/src/mex/TriMesh/TriMesh.h	(revision 1)
+++ /issm/trunk/src/mex/TriMesh/TriMesh.h	(revision 1)
@@ -0,0 +1,19 @@
+/*!\file:  TriMesh.h
+ * \brief header prototype
+ */ 
+
+#ifndef _TRIMESH_H_
+#define _TRIMESH_H_
+
+#include "mex.h"
+#include "triangle.h"
+#include "string.h"
+
+#include "../../c/issm.h"
+
+void TriMeshUsage(void);
+
+#undef __FUNCT__ 
+#define __FUNCT__ "TriMesh"
+
+#endif
Index: /issm/trunk/src/mex/TriMeshProcessRifts/TriMeshProcessRifts.cpp
===================================================================
--- /issm/trunk/src/mex/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 1)
+++ /issm/trunk/src/mex/TriMeshProcessRifts/TriMeshProcessRifts.cpp	(revision 1)
@@ -0,0 +1,315 @@
+/*!\file:  TriMeshProcessRifts.cpp
+ * \brief split a mesh where a rift (or fault) is present
+ */ 
+
+#include "./TriMeshProcessRifts.h"
+
+void mexFunction(	int nlhs, mxArray* plhs[],
+					int nrhs, const mxArray* prhs[] ) {
+
+
+	/*Matlab arrays: */
+	mxArray* pmxa_array=NULL;
+	mxArray* pmxa_array2=NULL;
+	mxArray* pmxa_array3=NULL;
+	int i,j,k,counter;
+	
+	/* returned quantities: */
+	int      out_numrifts;
+	int*     out_riftsnumsegments=NULL;
+	double** out_riftssegments=NULL; 
+	int*     out_riftsnumpairs=NULL;
+	double** out_riftspairs=NULL;
+	double*  out_riftstips=NULL;
+	double** out_riftspenaltypairs=NULL;
+	int*     out_riftsnumpenaltypairs=NULL;
+
+	/*empty rifts structure: */
+	double* pNaN=NULL;
+	const	char*	fnames[7];
+	mwSize     ndim=2;
+	mwSize		dimensions[2] = {1,1};
+	double* pair=NULL;
+
+	
+	/* input: */
+	double* tindex_in=NULL;
+	double* index_in=NULL;
+	int     nel;
+	double* x_inm=NULL; //matlab vector
+	double* x_in=NULL; //copy of matlab vector
+	int     nods;
+	double* y_inm=NULL;//matlab vector
+	double* y_in=NULL;//copy of matlab vector
+	double* tsegments_in=NULL;
+	double* segments_in=NULL;
+	double* tsegmentmarkers_in=NULL;
+	double* segmentmarkers_in=NULL;
+
+	int     num_seg;
+
+	/*rifts: */
+	int     riftflag;
+	int     numrifts;
+
+	/* error handling: */
+	int		noerr=1;	
+  
+	/* verify correct usage: */
+	if (nlhs==0 && nrhs==0) {
+		/* special case: */
+		TriMeshProcessRiftsUsage();
+		return;
+	}
+	
+	if (!(  (nlhs==6) || (nrhs==5))){
+		mexPrintf("   %s format error.\n", __FUNCT__);
+		TriMeshProcessRiftsUsage();
+		printf("   ");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Fetch index_in: */
+	if(mxIsDouble(prhs[0])){
+		nel=mxGetM(prhs[0]);
+		tindex_in=mxGetPr(prhs[0]);
+		index_in=(double*)xmalloc(nel*3*sizeof(double));
+		for (i=0;i<nel;i++){
+			for (j=0;j<3;j++){
+				*(index_in+3*i+j)=*(tindex_in+nel*j+i);
+			}
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: first argument should be the element list!");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Fetch x_in: */
+	if(mxIsDouble(prhs[1])){
+		nods=mxGetM(prhs[1]);
+		x_inm=mxGetPr(prhs[1]);
+		x_in=(double*)xmalloc(nods*sizeof(double));
+		for (i=0;i<nods;i++){
+			x_in[i]=x_inm[i];
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: second argument should be the x corrdinate list!");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Fetch y_in: */
+	if(mxIsDouble(prhs[2])){
+		y_inm=mxGetPr(prhs[2]);
+		y_in=(double*)xmalloc(nods*sizeof(double));
+		for (i=0;i<nods;i++){
+			y_in[i]=y_inm[i];
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: third argument should be the y corrdinate list!");
+		mexErrMsgTxt(" ");
+	}	
+
+	/*Fetch segments_in: */
+	if(mxIsDouble(prhs[3])){
+		num_seg=mxGetM(prhs[3]);
+		tsegments_in=mxGetPr(prhs[3]);
+		segments_in=(double*)xmalloc(num_seg*3*sizeof(double));
+		for (i=0;i<num_seg;i++){
+			for (j=0;j<3;j++){
+				*(segments_in+3*i+j)=*(tsegments_in+num_seg*j+i);
+			}
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: fourth argument should be the segments list!");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Fetch segment markers: */
+	if(mxIsDouble(prhs[4])){
+		tsegmentmarkers_in=mxGetPr(prhs[4]);
+		segmentmarkers_in=(double*)xmalloc(num_seg*sizeof(double));
+		for (i=0;i<num_seg;i++){
+			segmentmarkers_in[i]=tsegmentmarkers_in[i];
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: fourth argument should be the segmentmarkers list!");
+		mexErrMsgTxt(" ");
+	}
+
+	#ifdef _DEBUG_
+	printf("Index: \n");
+	for (i=0;i<nel;i++){
+		for(j=0;j<3;j++){
+			printf("%lf ",*(index_in+3*i+j));
+		}
+		printf("\n");
+	}
+	printf("x,y: \n");
+	for (i=0;i<nods;i++){
+		printf("%16.16lf %16.16lf\n",x_in[i],y_in[i]);
+	}
+	printf("segments:\n");
+	for (i=0;i<num_seg;i++){
+		for(j=0;j<3;j++){
+			printf("%lf ",*(segments_in+3*i+j));
+		}
+		printf("%lf ",segmentmarkers_in[i]);
+		printf("\n");
+	}
+	#endif
+
+	/*First, do some fixing on the existing mesh: we do not want any element belonging entirely to the segment list (ie: 
+	 *all the grids of this element belong to the segments (tends to happen when there are corners: */
+	RemoveCornersFromRifts(&index_in,&nel,&x_in,&y_in,&nods,segments_in,segmentmarkers_in,num_seg);
+
+	/*Figure out if we have rifts, and how many: */
+	IsRiftPresent(&riftflag,&numrifts,segmentmarkers_in,num_seg);
+	
+	if(riftflag){	
+		SplitMeshForRifts(&nel,&index_in,&nods,&x_in,&y_in,&num_seg,&segments_in,&segmentmarkers_in);
+	}
+
+	/*Order segments so that their normals point outside the domain: */
+	noerr=OrderSegments(&segments_in,num_seg, index_in,nel);
+
+	
+	if(riftflag){
+		
+		/*We do not want to output segments mixed with rift segments: wring out the rifts from the segments, using the 
+		 *segmentmarkerlist:*/
+		SplitRiftSegments(&segments_in,&segmentmarkers_in,&num_seg,&out_numrifts,&out_riftsnumsegments,&out_riftssegments,numrifts);
+
+		/*Using rift segments, associate rift faces in pairs, each pair face representing opposite flanks of the rifts facing one another directly: */
+		PairRiftElements(&out_riftsnumpairs,&out_riftspairs,out_numrifts,out_riftsnumsegments,out_riftssegments,x_in,y_in);
+		
+		/*Order rifts so that they start from one tip, go to the other tip, and back: */
+		OrderRifts(&out_riftstips, out_riftssegments,out_riftspairs,numrifts,out_riftsnumsegments,x_in,y_in);
+
+		/*Create penalty pairs, used by Imp: */
+		PenaltyPairs(&out_riftspenaltypairs,&out_riftsnumpenaltypairs,numrifts,out_riftssegments,out_riftsnumsegments,out_riftspairs,out_riftstips,x_in,y_in);
+	}
+
+
+	/*Output : */
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,3);
+	mxSetN(pmxa_array,nel);
+	mxSetPr(pmxa_array,index_in);
+	mexCallMATLAB( 1, &plhs[0], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,1);
+	mxSetN(pmxa_array,nods);
+	mxSetPr(pmxa_array,x_in);
+	mexCallMATLAB( 1, &plhs[1], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,1);
+	mxSetN(pmxa_array,nods);
+	mxSetPr(pmxa_array,y_in);
+	mexCallMATLAB( 1, &plhs[2], 1, &pmxa_array, "'");
+
+	
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,3);
+	mxSetN(pmxa_array,num_seg);
+	mxSetPr(pmxa_array,segments_in);
+	mexCallMATLAB( 1, &plhs[3], 1, &pmxa_array, "'");
+	
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,1);
+	mxSetN(pmxa_array,num_seg);
+	mxSetPr(pmxa_array,segmentmarkers_in);
+	mexCallMATLAB( 1, &plhs[4], 1, &pmxa_array, "'");
+
+	if(riftflag){
+		/*Create a structure rifts where if i is a rift number, we have the following fields rifts(i).segments and rifts(i).numsegs: */
+
+		fnames[0] = "numsegs";
+		fnames[1] = "segments";
+		fnames[2] = "pairs";
+		fnames[3] = "tips";
+		fnames[4] = "penaltypairs";
+		fnames[5] = "fill";
+		fnames[6] = "friction";
+
+		dimensions[0]=out_numrifts;
+
+		pmxa_array=mxCreateStructArray( ndim,dimensions,7,fnames);
+		
+		for (i=0;i<out_numrifts;i++){
+			/*Segments: */
+			pmxa_array2= mxCreateDoubleMatrix(0,0,mxREAL);
+			mxSetM(pmxa_array2,3);
+			mxSetN(pmxa_array2,out_riftsnumsegments[i]);
+			mxSetPr(pmxa_array2,out_riftssegments[i]);
+			mexCallMATLAB( 1, &pmxa_array3, 1, &pmxa_array2, "'");
+			
+			mxSetField(pmxa_array,i,"segments",pmxa_array3);
+			mxSetField(pmxa_array,i,"numsegs",mxCreateScalarDouble((double)out_riftsnumsegments[i]));
+
+			/*Element pairs: */
+			pmxa_array2= mxCreateDoubleMatrix(0,0,mxREAL);
+			mxSetM(pmxa_array2,2);
+			mxSetN(pmxa_array2,out_riftsnumpairs[i]);
+			mxSetPr(pmxa_array2,out_riftspairs[i]);
+			mexCallMATLAB( 1, &pmxa_array3, 1, &pmxa_array2, "'");
+			
+			mxSetField(pmxa_array,i,"pairs",pmxa_array3);
+
+			/*Tips: */
+			pmxa_array2= mxCreateDoubleMatrix(0,0,mxREAL);
+			mxSetM(pmxa_array2,1);
+			pair=(double*)xmalloc(2*sizeof(double));
+			pair[0]=*(out_riftstips+2*i+0);
+			pair[1]=*(out_riftstips+2*i+1);
+			mxSetN(pmxa_array2,2);
+			mxSetPr(pmxa_array2,pair);
+			mxSetField(pmxa_array,i,"tips",pmxa_array2);
+
+			/*Penalty pairs: */
+			pmxa_array2= mxCreateDoubleMatrix(0,0,mxREAL);
+			mxSetM(pmxa_array2,7);
+			mxSetN(pmxa_array2,out_riftsnumpenaltypairs[i]);
+			mxSetPr(pmxa_array2,out_riftspenaltypairs[i]);
+			mexCallMATLAB( 1, &pmxa_array3, 1, &pmxa_array2, "'");
+			
+			mxSetField(pmxa_array,i,"penaltypairs",pmxa_array3);
+
+			/*Friction and fill: set to 0 both */
+			mxSetField(pmxa_array,i,"friction",mxCreateDoubleScalar(0));
+			mxSetField(pmxa_array,i,"fill",mxCreateDoubleScalar(1)); //default is water
+
+
+
+		}
+	}
+	else{
+		/*output NaN :*/
+		pNaN=(double*)xmalloc(sizeof(double));
+		*pNaN=0.0/0.0;
+		pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+		mxSetM(pmxa_array,1);
+		mxSetN(pmxa_array,1);
+		mxSetPr(pmxa_array,pNaN);
+		
+	}
+	plhs[5]=pmxa_array;
+
+	return;
+}
+
+
+void TriMeshProcessRiftsUsage(void)
+{
+	printf("\n");
+	printf("   usage: [index2,x2,y2,segments2,segmentmarkers2,rifts2]=TriMeshProcessrifts(index1,x1,y1,segments1,segmentmarkers1) \n");
+	printf("      where: (index1,x1,y1,segments1,segmentmarkers1) is an initial triangulation.\n");
+	printf("      index2,x2,y2,segments2,segmentmarkers2,rifts2 is the resulting triangulation where rifts have been processed.\n");
+}
Index: /issm/trunk/src/mex/TriMeshProcessRifts/TriMeshProcessRifts.h
===================================================================
--- /issm/trunk/src/mex/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 1)
+++ /issm/trunk/src/mex/TriMeshProcessRifts/TriMeshProcessRifts.h	(revision 1)
@@ -0,0 +1,18 @@
+/*!\file:  TriMeshProcessRifts.h
+ * \brief header prototype
+ */ 
+
+#ifndef _TRIMESH_PROCESSRIFTS_H_
+#define _TRIMESH_PROCESSRIFTS_H_
+
+#include "mex.h"
+#include "triangle.h"
+#include "string.h"
+
+#include "../../c/issm.h"
+
+void TriMeshProcessRiftsUsage(void);
+#undef __FUNCT__ 
+#define __FUNCT__ "TriMeshProcessRifts"
+
+#endif
Index: /issm/trunk/src/mex/TriMeshRefine/TriMeshRefine.cpp
===================================================================
--- /issm/trunk/src/mex/TriMeshRefine/TriMeshRefine.cpp	(revision 1)
+++ /issm/trunk/src/mex/TriMeshRefine/TriMeshRefine.cpp	(revision 1)
@@ -0,0 +1,333 @@
+/*!\file:  TriMeshRefine
+ * \brief refine a mesh output by TriMesh:
+ */ 
+
+#include "./TriMeshRefine.h"
+
+
+void mexFunction(	int nlhs, mxArray* plhs[],
+					int nrhs, const mxArray* prhs[] )
+{
+
+
+	/*Matlab arrays: */
+	mxArray* pmxa_array=NULL;
+	mxArray* pmxa_array2=NULL;
+	mxArray* pmxa_array3=NULL;
+	int i,j,k,counter;
+	
+	/* returned quantities: */
+
+	double* index=NULL;
+	double* x=NULL;
+	double* y=NULL;
+	double* segments=NULL;
+	double* segmentmarkerlist=NULL;
+	
+	/* input: */
+	double* area=NULL;
+	double* tindex_in=NULL;
+	double*    index_in=NULL;
+	int     nel;
+	double* x_inm=NULL; //matlab vector
+	double* x_in=NULL; //copy of matlab vector
+	int     nods;
+	double* y_inm=NULL;//matlab vector
+	double* y_in=NULL;//copy of matlab vector
+	double* tsegments_in=NULL;
+	double* segments_in=NULL;
+	double* tsegmentmarkers_in=NULL;
+	double* segmentmarkers_in=NULL;
+
+	int     num_seg;
+	char*   order=NULL;
+
+	/* error handling: */
+	int		noerr=1;	
+  
+	/* Triangle structures: */
+	struct triangulateio in,out;
+	char   options[256];
+
+	/* verify correct usage: */
+	if (nlhs==0 && nrhs==0) {
+		/* special case: */
+		TriMeshRefineUsage();
+		return;
+	}
+
+	if (!(  (nlhs==5) || (nrhs==6) || (nrhs==7)  )){
+		mexPrintf("   %s format error.\n", __FUNCT__);
+		TriMeshRefineUsage();
+		printf("   ");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Fetch index_in: */
+	if(mxIsDouble(prhs[0])){
+		nel=mxGetM(prhs[0]);
+		tindex_in=mxGetPr(prhs[0]);
+		index_in=(double*)xmalloc(nel*3*sizeof(double));
+		for (i=0;i<nel;i++){
+			for (j=0;j<3;j++){
+				*(index_in+3*i+j)=*(tindex_in+nel*j+i)-1;
+			}
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: first argument should be the element list!");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Fetch x_in: */
+	if(mxIsDouble(prhs[1])){
+		nods=mxGetM(prhs[1]);
+		x_inm=mxGetPr(prhs[1]);
+		x_in=(double*)xmalloc(nods*sizeof(double));
+		for (i=0;i<nods;i++){
+			x_in[i]=x_inm[i];
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: second argument should be the x corrdinate list!");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Fetch y_in: */
+	if(mxIsDouble(prhs[2])){
+		y_inm=mxGetPr(prhs[2]);
+		y_in=(double*)xmalloc(nods*sizeof(double));
+		for (i=0;i<nods;i++){
+			y_in[i]=y_inm[i];
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: third argument should be the y corrdinate list!");
+		mexErrMsgTxt(" ");
+	}	
+
+	/*Fetch segments_in: */
+	if(mxIsDouble(prhs[3])){
+		num_seg=mxGetM(prhs[3]);
+		tsegments_in=mxGetPr(prhs[3]);
+		segments_in=(double*)xmalloc(num_seg*3*sizeof(double));
+		for (i=0;i<num_seg;i++){
+			for (j=0;j<3;j++){
+				*(segments_in+3*i+j)=*(tsegments_in+num_seg*j+i)-1;
+			}
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: fourth argument should be the segments list!");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Fetch segment markers: */
+	if(mxIsDouble(prhs[4])){
+		tsegmentmarkers_in=mxGetPr(prhs[4]);
+		segmentmarkers_in=(double*)xmalloc(num_seg*sizeof(double));
+		for (i=0;i<num_seg;i++){
+			segmentmarkers_in[i]=tsegmentmarkers_in[i];
+		}
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: fourth argument should be the segmentmarkers list!");
+		mexErrMsgTxt(" ");
+	}
+	
+	/*Fetch area: */
+	if(mxIsDouble(prhs[5])){
+		if (mxGetM(prhs[5])!=nel){
+			printf("%s%s\n",__FUNCT__," error message: area vector should be of the same size as index\n");
+			mexErrMsgTxt(" ");
+		}
+		area=mxGetPr(prhs[5]);
+	}
+	else{
+		printf("%s%s\n",__FUNCT__," error message: fifth argument should be the area list!");
+		mexErrMsgTxt(" ");
+	}
+
+	/*Optionaly, recover desired order: */
+	if(nrhs==7){
+		if (!mxIsChar(prhs[6])){
+			mexPrintf("%s%s\n",__FUNCT__," error message; sixth argument should be a string ('yes' or 'no')!");
+			mexErrMsgTxt(" ");
+		}
+		order = (char *) xmalloc((mxGetN(prhs[6])+1)*sizeof(char));
+		mxGetString(prhs[6],order,mxGetN(prhs[6])+1);
+	}
+
+
+	#ifdef _DEBUG_
+	/*printf("Index: \n");
+	for (i=0;i<nel;i++){
+		for(j=0;j<3;j++){
+			printf("%lf ",*(index_in+3*i+j));
+		}
+		printf("\n");
+	}*/
+	/*printf("x,y: \n");
+	for (i=0;i<nods;i++){
+		printf("%16.16lf %16.16lf\n",x_in[i],y_in[i]);
+	}*/
+	/*printf("segments:\n");
+	for (i=0;i<num_seg;i++){
+		for(j=0;j<3;j++){
+			printf("%lf ",*(segments_in+3*i+j));
+		}
+		printf("%lf ",segmentmarkers_in[i]);
+		printf("\n");
+	}*/
+	/*printf("area: \n");
+	for (i=0;i<nel;i++){
+		printf("%16.16lf \n",area[i]);
+	}*/
+	//if(nrhs==6)printf("Order: %s\n",order);
+	#endif
+
+	/*Create initial triangulation to call triangulate():*/
+	in.numberoftriangles=nel;
+	in.numberoftriangleattributes=1;
+	in.numberofcorners=3;
+	
+	in.trianglelist = (int *) xmalloc(3*in.numberoftriangles * sizeof(int));
+	for(i=0;i<in.numberoftriangles;i++){
+		for(j=0;j<3;j++){
+			in.trianglelist[3*i+j]=(int)index_in[3*i+j];
+		}
+	}
+	in.triangleattributelist = (REAL *) xmalloc(in.numberoftriangles * in.numberoftriangleattributes * sizeof(REAL));
+	for(i=0;i<in.numberoftriangles;i++){
+		in.triangleattributelist[i]=0.0;
+	}
+	in.trianglearealist = (REAL *) xmalloc(in.numberoftriangles * sizeof(REAL));
+	for(i=0;i<in.numberoftriangles;i++){
+		in.trianglearealist[i]=area[i];
+	}
+
+	in.numberofpoints=nods;
+	in.numberofpointattributes=1;
+	in.pointlist = (REAL *) xmalloc(in.numberofpoints * 2 * sizeof(REAL));
+	for (i=0;i<nods;i++){
+		in.pointlist[2*i+0]=x_in[i];
+		in.pointlist[2*i+1]=y_in[i];
+	}
+	in.pointattributelist = (REAL *) xmalloc(in.numberofpoints * in.numberofpointattributes * sizeof(REAL));
+	for (i=0;i<nods;i++){
+		in.pointattributelist[i] = 0.0;
+	}	
+
+	in.numberofsegments = num_seg;
+	in.segmentlist = (int *) xmalloc(in.numberofsegments * 2 * sizeof(REAL));
+	in.segmentmarkerlist = (int *) mxCalloc(in.numberofsegments,sizeof(int));
+	for (i=0;i<num_seg;i++){
+		in.segmentlist[2*i+0]=(int)segments_in[3*i+0];
+		in.segmentlist[2*i+1]=(int)segments_in[3*i+1];
+		in.segmentmarkerlist[i]=(int)segmentmarkers_in[i];
+	}
+	
+	in.numberofholes = 0;
+
+	/* Make necessary initializations so that Triangle can return a */
+	/*   triangulation in `out'.  */
+
+	out.pointlist = (REAL *) NULL;            
+	out.pointattributelist = (REAL *) NULL;
+	out.pointmarkerlist = (int *) NULL; 
+	out.trianglelist = (int *) NULL;          
+	out.triangleattributelist = (REAL *) NULL;
+	out.neighborlist = (int *) NULL;         
+	out.segmentlist = (int *) NULL;
+	out.segmentmarkerlist = (int *) NULL;
+	out.edgelist = (int *) NULL;             
+	out.edgemarkerlist = (int *) NULL;   
+
+	/* Triangulate the points:.  Switches are chosen to read and write a  */
+	/*   PSLG (p), preserve the convex hull (c), number everything from  */
+	/*   zero (z), assign a regional attribute to each element (A), and  */
+	/*   produce an edge list (e), a Voronoi diagram (v), and a triangle */
+	/*   neighbor list (n).                                              */
+
+	sprintf(options,"%s%lf","QzDq30iarp",area); //replace V by Q to quiet down the logging
+
+
+	triangulate(options, &in, &out, NULL);
+	
+	/*Allocate index, x and y: */
+	index=(double*)xmalloc(3*out.numberoftriangles*sizeof(double));
+	x=(double*)xmalloc(out.numberofpoints*sizeof(double));
+	y=(double*)xmalloc(out.numberofpoints*sizeof(double));
+	segments=(double*)xmalloc(3*out.numberofsegments*sizeof(double));
+	segmentmarkerlist=(double*)xmalloc(out.numberofsegments*sizeof(double));
+
+	for (i = 0; i < out.numberoftriangles; i++) {
+		for (j = 0; j < out.numberofcorners; j++) {
+			*(index+3*i+j)=(double)out.trianglelist[i * out.numberofcorners + j]+1;
+		}
+	}
+	for (i = 0; i < out.numberofpoints; i++) {
+		x[i]=out.pointlist[i * 2 + 0];
+		y[i]=out.pointlist[i * 2 + 1];
+	}
+	
+	for (i = 0; i < out.numberofsegments; i++) {
+		segments[3*i+0]=(double)out.segmentlist[i*2+0]+1;
+		segments[3*i+1]=(double)out.segmentlist[i*2+1]+1;
+		segmentmarkerlist[i]=(double)out.segmentmarkerlist[i];
+	}
+
+	/*Associate elements with segments: */
+	noerr=AssociateSegmentToElement(&segments,out.numberofsegments,index,out.numberoftriangles);
+
+	/*Order segments so that their normals point outside the domain: */
+	if(!strcmp(order,"yes")){
+		noerr=OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
+	}
+	
+	/*Output : */
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,3);
+	mxSetN(pmxa_array,out.numberoftriangles);
+	mxSetPr(pmxa_array,index);
+	mexCallMATLAB( 1, &plhs[0], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,1);
+	mxSetN(pmxa_array,out.numberofpoints);
+	mxSetPr(pmxa_array,x);
+	mexCallMATLAB( 1, &plhs[1], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,1);
+	mxSetN(pmxa_array,out.numberofpoints);
+	mxSetPr(pmxa_array,y);
+	mexCallMATLAB( 1, &plhs[2], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,3);
+	mxSetN(pmxa_array,out.numberofsegments);
+	mxSetPr(pmxa_array,segments);
+	mexCallMATLAB( 1, &plhs[3], 1, &pmxa_array, "'");
+
+	pmxa_array= mxCreateDoubleMatrix(0,0,mxREAL);
+	mxSetM(pmxa_array,1);
+	mxSetN(pmxa_array,out.numberofsegments);
+	mxSetPr(pmxa_array,segmentmarkerlist);
+	mexCallMATLAB( 1, &plhs[4], 1, &pmxa_array, "'");
+
+	return;
+}
+
+
+void TriMeshRefineUsage(void)
+{
+	printf("\n");
+	printf("   usage: [index2,x2,y2,segments2,segmentmarkers2]=TriMeshRefine(index1,x1,y1,segments1,segmentmarkers1,area,order) \n");
+	printf("      where: (index1,x1,y1,segments1,segmentmarkers1) is an initial triangulation (segment1 does not need to be ordered).\n");
+	printf("      area is a vector of element areas determining which elements will be refined.\n");
+	printf("      order is an optional argument that determines whether segments are output in the \n");
+	printf("      order they are made by Triangle (ie none), or ordered counter clockwise around the domain outline.\n");
+	printf("      (index2,x2,y2,segments2,segmentmarkers2) is the resulting refined triangulation.\n");
+	printf("   note: order is an optional arguments\n");
+}
Index: /issm/trunk/src/mex/TriMeshRefine/TriMeshRefine.h
===================================================================
--- /issm/trunk/src/mex/TriMeshRefine/TriMeshRefine.h	(revision 1)
+++ /issm/trunk/src/mex/TriMeshRefine/TriMeshRefine.h	(revision 1)
@@ -0,0 +1,18 @@
+/*!\file:  TriMeshRefine.h
+ * \brief header prototype
+ */ 
+
+#ifndef _TRIMESH_REFINE_H_
+#define _TRIMESH_REFINE_H_
+
+#include "mex.h"
+#include "triangle.h"
+#include "string.h"
+
+#include "../../c/issm.h"
+
+void TriMeshRefineUsage(void);
+#undef __FUNCT__ 
+#define __FUNCT__ "TriMeshRefine"
+
+#endif
Index: /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.cpp
===================================================================
--- /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.cpp	(revision 1)
+++ /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.cpp	(revision 1)
@@ -0,0 +1,59 @@
+/*\file UpdateFromInputs.c
+ *\brief: update datasets with new parameter inputs
+ */
+
+#include "./UpdateFromInputs.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* elements=NULL;
+	DataSet* nodes=NULL;
+	DataSet* loads=NULL;
+	DataSet* materials=NULL;
+	ParameterInputs* inputs=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&UpdateFromInputsUsage);
+
+	/*Input datasets: */
+	FetchData((void**)&elements,NULL,NULL,ELEMENTSIN,"DataSet",NULL);
+	FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
+	FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL);
+	FetchData((void**)&materials,NULL,NULL,MATERIALSIN,"DataSet",NULL);
+
+	/*Fetch inputs: */
+	ParameterInputsInit(&inputs,INPUTS);
+
+	/*!Generate internal degree of freedom numbers: */
+	UpdateFromInputsx(elements,nodes,loads, materials,inputs);
+
+	/*write output datasets: */
+	WriteData(ELEMENTS,elements,0,0,"DataSet",NULL);
+	WriteData(NODES,nodes,0,0,"DataSet",NULL);
+	WriteData(LOADS,loads,0,0,"DataSet",NULL);
+	WriteData(MATERIALS,materials,0,0,"DataSet",NULL);
+
+	/*Free ressources: */
+	delete elements;
+	delete nodes;
+	delete loads;
+	delete materials;
+	DeleteParameterInputs(&inputs);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void UpdateFromInputsUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [elements,nodes,loads, materials] = %s(elements,nodes,loads, materials,inputs);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.h
===================================================================
--- /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.h	(revision 1)
+++ /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.h	(revision 1)
@@ -0,0 +1,39 @@
+
+/*
+	UpdateFromInputs.h
+*/
+
+
+#ifndef _UPDATEFROMINPUTS_H
+#define _UPDATEFROMINPUTS_H
+
+/* local prototypes: */
+void UpdateFromInputsUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "UpdateFromInputs"
+
+/* serial input macros: */
+#define ELEMENTSIN (mxArray*)prhs[0]
+#define NODESIN (mxArray*)prhs[1]
+#define LOADSIN (mxArray*)prhs[2]
+#define MATERIALSIN (mxArray*)prhs[3]
+#define INPUTS (mxArray*)prhs[4]
+
+/* serial output macros: */
+#define ELEMENTS (mxArray**)&plhs[0]
+#define NODES (mxArray**)&plhs[1]
+#define LOADS (mxArray**)&plhs[2]
+#define MATERIALS (mxArray**)&plhs[3]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  4
+#undef NRHS
+#define NRHS  5
+
+
+#endif  /* _UPDATEFROMINPUTS_H */
+
Index: /issm/trunk/src/perl/DiagnosticAlter.pl
===================================================================
--- /issm/trunk/src/perl/DiagnosticAlter.pl	(revision 1)
+++ /issm/trunk/src/perl/DiagnosticAlter.pl	(revision 1)
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+# alter file perl script
+
+open(INFILE,  "icediagnostic_core_nonlinear.m");
+open(OUTFILE, ">icediagnostic_core_nonlinear.alt.m");
+
+
+while (<INFILE>) {
+	if(/\[K_gg,p_g\]=SystemMatrices\(elements,grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type\);/){
+		print OUTFILE "    [K_gg,p_g]=SystemMatrices(elements,grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type);\n    save systemmatrices_ice K_gg p_g; error\('debug'\);\n"
+	}
+	else{
+		print OUTFILE "$_";
+	}
+}
+
+close INFILE;
+close OUTFILE;
Index: /issm/trunk/src/perl/rsp_formatter.pl
===================================================================
--- /issm/trunk/src/perl/rsp_formatter.pl	(revision 1)
+++ /issm/trunk/src/perl/rsp_formatter.pl	(revision 1)
@@ -0,0 +1,55 @@
+#!/usr/bin/perl
+#
+#
+# write a list of object filenames to an .rsp file,
+# formatted according to tlib's input requirements
+#
+# usage:  rsp_formatter infile.rsp
+# where:  infile.rsp is a one line file consisting of
+#         object filenames
+# output: is the tlib-formatted infile.rsp
+# note:   multiple input files can be specified, e.g.
+#         rsp_formatter infile1.rsp infile2.rsp -etc.-
+
+use Fatal qw/ open /;
+use File::Basename;
+use Text::ParseWords;
+
+
+foreach (@ARGV) {
+
+#	loop (re)initialisation:
+	@words = ();
+	@new_words =();
+
+	($name,$path,$suffix) = fileparse($_,"\.rsp");
+	print "formatting $name$suffix for input to tlib...\n";
+
+#	open, read explicitly so we can treat one ARGV at a time:
+	open INFILE, "$_";
+	$line=<INFILE>;
+	close INFILE;
+	chomp($line);
+
+	@words = &parse_line('\s+', 0, $line);
+
+	$i=0;
+	foreach(@words) {
+		if ($i < $#words) {
+			push( @new_words, "+$_ &");
+		}
+		else {
+			push( @new_words, "+$_,$name");
+		}
+		$i++;
+	}
+
+	open(OUTFILE, ">$_");
+	foreach(@new_words) {
+		print OUTFILE "$_\n";
+	}
+	close(OUTFILE); 
+
+	print "...done\n";
+}
+
Index: /issm/trunk/src/pro/bytscl.m
===================================================================
--- /issm/trunk/src/pro/bytscl.m	(revision 1)
+++ /issm/trunk/src/pro/bytscl.m	(revision 1)
@@ -0,0 +1,9 @@
+function value=bytscl(value)
+%INPUT function value=bytscl(value)
+%Equivalent of the bytscl idl routine.
+
+Min=min(min(value));
+Max=max(max(value));
+Top=255;
+
+value=(Top + 0.9999)*(value - Min)/(Max - Min);
Index: /issm/trunk/src/pro/plot_cielo.pro
===================================================================
--- /issm/trunk/src/pro/plot_cielo.pro	(revision 1)
+++ /issm/trunk/src/pro/plot_cielo.pro	(revision 1)
@@ -0,0 +1,146 @@
+print,'Cielo ..'
+openr,1,'Antarctica_CIELO_1km.bin'
+vel=fltarr(5601,5601)
+readu,1,vel & close,1
+
+print,'Read MOA ..'
+read_jpeg,'moa1000_r1_hp1.bamber_white_edit.jpg',im0,order=1
+
+vel=abs(vel)<3000.
+
+val=float(im0)/max(im0)
+indzero=where(vel EQ 0)
+ind=where(vel EQ 0) & ind0=where(vel LT 1.5) & vel(ind0)=1.5
+h=bytscl(alog(vel))/255.*360. & h(ind)=0. & vel(ind)=0.
+s=(0.5+vel/125)/1.5 & s=s<1 & s(ind)=0.
+
+color_convert,h,s,val,r,g,b,/hsv_rgb
+
+a=bytarr(3,5601,5601)
+a(0,*,*)=r
+a(1,*,*)=g
+a(2,*,*)=b
+ss=size(a) & six=ss(2) & siy=ss(3)
+
+re0=bytarr(5601,5601) & re0(*,*)=a(0,*,*)
+gr0=bytarr(5601,5601) & gr0(*,*)=a(1,*,*)
+bl0=bytarr(5601,5601) & bl0(*,*)=a(2,*,*)
+
+write_jpeg,'Antarctic_CIELO_1km_no_label'+'.jpg',a,true=1,order=1
+
+titi=bytarr(5601,5601)
+
+name=['/u/adelie1/eric/FOUND10196/Foundation_basin_index.save',$
+'/u/adelie1/eric/FOUND10196/Mollereisstrom_basin_index.save',$
+'/u/adelie1/eric/FOUND10196/Institute_basin_index.save',$
+'/u/adelie0/eric/Antarctic_GIS/Ian/IceStreamAW_basin_index.save',$
+'/u/adelie0/eric/Antarctic_GIS/Ian/IceStreamC_basin_index.save',$
+'/u/adelie0/eric/Antarctic_GIS/Ian/IceStreamD_basin_index.save',$
+'/u/adelie0/eric/Antarctic_GIS/Ian/IceStreamE_basin_index.save',$
+'/u/adelie0/eric/Antarctic_GIS/Ian/IceStreamF_basin_index.save',$
+'/u/adelie2/eric/RSAT9822-10165SLE/Slessor_basin_index.save',$
+'/u/adelie2/eric/RSAT9822-10165SLE/Bailey_basin_index.save',$
+'/u/adelie7/eric/Jutulstraumen94/Jutul_basin_index.save',$
+'/u/pib3b/eric/Getz/basin_getz_index.save',$
+'/u/adelie7/eric/Land_237/Land_basin_index.save',$
+'/u/adelie10/eric/Getz_437/basin_Hull_index.save',$
+'/u/pib3b/eric/Georges_1994/Track_009/basin_George9_index.save',$  ;Rym
+'/u/adelie9b/eric/RSAT9852-10195REC/rec_basin_index_ext_new.save',$
+'/u/pib1/eric/RSAT9806-10149Byrd/byrd_basin_index.save',$
+'/u/enderby3/eric/Nimrod_1997/basin_nimrod_index.save',$
+'/u/adelie7/eric/PIG22625/THW_basin_index.save',$
+'/u/adelie7/eric/PIG22625/PIG_basin_index.save',$
+'/u/adelie7/eric/PIG22625/KOH_SMI_POP_basin_index.save',$
+'/u/adelie7/eric/PIG22625/ISR_basin_index.save',$
+'/u/adelie7/eric/PIG22625/HAY_basin_index.save',$
+'/u/adelie45/adelie4/eric/Evans96_94/Evans_basin_index.save',$
+'/u/adelie45/adelie4/eric/Rutford96_t65/RUT_basin_index.save',$
+'/u/adelie45/adelie4/eric/Rutford96_t65/CAR_basin_index.save',$
+'/u/adelie45/adelie4/eric/Lambert_318/lambert_basin_index.save',$
+'/u/adelie13c/eric/ScottDenman/basin_DenmanScott_index.save',$
+'/u/adelie13b/eric/Totten24868/Totten_basin_index.save',$
+'/u/adelie45/eric/David23763-24765/david_basin_indexbis.save',$
+'/u/enderby2/eric/Mertz/Mertz_basin_index.save',$
+'/u/enderby2/eric/Mertz/Ninnis_basin_index.save',$
+;'/u/pib1/eric/Stancomb_450/stancomb_basin_index.save',$
+'/u/pib1/eric/Shirase_229/shirase_basin_index.save',$
+'/u/adelie10/eric/Cook/basin_Cook_index.save.new',$
+'/u/adelie9b/eric/RSAT25731_Rayner2000/Rayner_basin_index.save',$
+'/u/adelie1/eric/RSAT9806-10149MUL/Mulock_basin_index.save',$
+'/u/adelie13b/eric/Sabrina_431/Moscow_basin_index.save',$
+;'/u/pib3a/eric/RL_450/Vest_basin_index.save',$
+'/u/adelie1/eric/RSAT9805_10148BEARD/Beardmore_basin_index.save',$
+'/u/adelie2/eric/Frost_402/frost_basin_index_new.save',$
+'/u/adelie13b/eric/Dibble/Dibble_basin_index.save',$
+'/u/enderby2/eric/Phil/basin_Phil_new_index.save',$
+'/u/adelie1/eric/VenableIS/Venable_basin_index.save',$
+'/u/enderby0/eric/Track_482/basin_Abbot92_10_index.save',$
+'/u/enderby0/eric/Track_482/basin_Abbot92_24_index.save',$
+'/u/enderby0/eric/Track_482/basin_Eights_index.save',$
+'/u/adelie2/eric/Eltanin92/Eltanin_basin_index.save',$
+'/u/adelie1/eric/FOUND10196/SUF_basin_index.save',$
+'/u/pib3b/eric/Ragnhild/basin_Ragnhild_index.save',$
+'/u/pib3b/eric/Ragnhild/basin_Astrid_index.save',$
+'/u/enderby2/eric/Scylla25569/basin_american_index.save',$
+'/u/enderby2/eric/Scylla25569/basin_scylla_index.save',$
+'/u/pib3b/eric/Budd_231/basin_Buddetal_index.save',$
+'/u/enderby2/eric/Scylla25269/Part0/basin_robert_index.save',$
+'/u/amundsen1/eric/GeorgeVI_1996_66/basin_lidke_index.save',$
+'/u/amundsen1/eric/GeorgeVI_1996_66/basin_berg_index.save',$
+'/u/enderby3/eric/RL/basin_Ekstrom_index.save',$
+'/u/enderby3/eric/RL/basin_Jelbart_index.save',$
+'/u/enderby3/eric/RL/basin_Riiser_index.save',$
+'/u/enderby3/eric/RL/basin_Stancomb_index.save',$
+'/u/enderby3/eric/RL/basin_Veststraumen_index.save',$
+'/u/enderby3/eric/RL/basin_Coats_index.save',$
+;'/u/adelie12c/eric/Scylla/basin_track166_index.save',$
+'/u/enderby2/eric/Track166/basin_Eng_index.save',$ ;Eng
+'/u/enderby3/eric/RSAT25469-25812-26155Rennick_2000/basin_index_Rennick.save',$
+'/u/enderby3/eric/RSAT25362-25705-26048Ronne_2000/basin_index_Lassiter.save',$
+'/u/pib3b/eric/Georges_1994/Track_019/basin_SmithEwing_index.save',$
+'/u/enderby3/eric/Sulzberger_424/basin_Sulzberger_index.save']
+
+xmin_bamber=-560*5e03
+ymax_bamber=+560*5e03
+for i=0,n_elements(name)-1 do begin
+restore,name(i)
+xmin=xmin0 & ymax=ymax0
+pix=(xfill*1e3+xmin-xmin_bamber)/1000. & lin=(ymax_bamber-(ymax-yfill*1e3))/1000.
+for k=-1,1 do begin
+for l=-1,1 do begin
+titi(pix+k,lin+l)=255
+endfor
+endfor
+endfor
+
+xmin0=-560.*5e3 & ymax0=+560*5e3
+
+namebis=['/u/adelie7/eric/Wordie_381/basin_index_fleming.save',$
+'/u/adelie9b/eric/AP_018/basin_index_Crane.save',$
+'/u/adelie9b/eric/AP_018/basin_index_Jorum.save',$
+'/u/adelie9b/eric/AP_061/basin_index_flask.save',$
+'/u/adelie9b/eric/AP_061/basin_index_leppard.save',$
+;'/u/adelie9b/eric/AP_233/basin_index_mobil.new.save',$
+'/u/adelie9b/eric/AP_476/basin_index_drygalski.save',$
+'/u/adelie9b/eric/AP_476/basin_index_evans.save']
+for i=0,n_elements(namebis)-1 do begin
+restore,namebis(i)
+pix=(xfill*1e2+xmin-xmin0)/1000. & lin=(ymax0-(ymax-yfill*1e2))/1000.
+for k=-1,1 do begin
+for l=-1,1 do begin
+titi(pix+k,lin+l)=255
+endfor
+endfor
+endfor
+
+ind=where(titi ne 0)
+
+help,re0,gr0,bl0,a
+
+re0(ind)=0 & gr0(ind)=0 & bl0(ind)=0
+
+a(0,*,*)=re0 & a(1,*,*)=gr0 & a(2,*,*)=bl0
+
+write_jpeg,'Antarctic_CIELO_1km'+'.jpg',a,true=1,order=1
+
+end
Index: /issm/trunk/startup.m
===================================================================
--- /issm/trunk/startup.m	(revision 1)
+++ /issm/trunk/startup.m	(revision 1)
@@ -0,0 +1,51 @@
+%STARTUP - Matlab startup script
+%
+%   startup.m is a script run by matlab at the beginning of a session, just before 
+%   handing over the prompt to the user. This delivery startup.m script has been customized here for 
+%   the ISSM code. This startup script should be run by users before trying to use ISSM. The best way 
+%   to do that is to put the startup file in the location where Matlab starts and established its root
+%   directory.
+%
+%   Copyright Jet Propulsion Laboratory. 
+
+global ISSM_DIR 
+lastwarn(''); % clear the last warning to focus on the warnings of the ISSM path
+
+%Recover ISSM_DIR 
+[status,ISSM_DIR]=system('echo $ISSM_DIR');
+if status~=0,
+	error('issmdir error message: problem when running ''echo $ISSM_DIR'' shell command');
+end
+if (isempty(ISSM_DIR)) | (length(ISSM_DIR)==1),
+	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
+end
+%get rid of return carriage
+ISSM_DIR=ISSM_DIR(1:end-1);
+
+%Now add all ice code paths necessary to run ice smoothly. 
+%We capture the error output, so that we can warn the user to update 
+%the variable ISSM_DIR in this file, in case it is not correctly setup. 
+
+%ISSM path
+addpath([ISSM_DIR '/src/m/utils/']); %loads genpath_ice
+addpath([ISSM_DIR '/etc']);
+addpath([ISSM_DIR '/doc']);
+addpath(genpath_ice([ISSM_DIR '/src/m']));
+
+%Suite sparse and m2html
+addpath(genpath_ice([ISSM_DIR '/packages/suitesparse/install/CHOLMOD/MATLAB/']));
+addpath(genpath_ice([ISSM_DIR '/packages/m2html/install']));
+
+%last one, to pick up binaries first!
+addpath([ISSM_DIR '/bin']);
+
+%Check on any warning messages that might indicate that the paths were not correct. 
+if ~isempty(lastwarn),
+	disp(' ');
+	disp('  Error trying to setup ''ISSM'' code paths. Try and update the ISSM_DIR variable in the startup.m file');
+	disp('  ''ISSM'' will not  work at all until this is resolved');
+else
+	disp(' ');
+	disp('  To get started with ISSM, type issmdoc at the command prompt.');
+	disp(' ');
+end
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Front.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Pattyn.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Pattyn.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Pattyn.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-10 -10
+1000010 -10
+1000010 1000010
+-10 1000010
+-10 -10
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Shelf.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Shelf.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Shelf.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:iceshelf
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1 -1
+1000001 -1
+1000001 1000001
+-1 1000001
+-1 -1
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Square.par
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/Square.par	(revision 1)
@@ -0,0 +1,122 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness+10;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/runme.m
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test1_iceshelf/runme.m	(revision 1)
@@ -0,0 +1,60 @@
+% This file can be run to compare MacAyeal and Pattyn's model ie a 2d and a 3d model.
+% This test deals with a  mesh includind an iceshelf ans an icesheet. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'Shelf.exp','');
+md=parameterize(md,'Square.par');
+md=setelementstype(md,'Macayeal','all');
+
+%Compute solution for a 2d model
+md=solve(md,'diagnostic','ice');
+vel_2d=md.vel;
+
+%Compute solution for a 3d model
+md=extrude(md,5,3);
+md=setelementstype(md,'Pattyn','Pattyn.exp','fill','Macayeal');
+md=solve(md,'diagnostic','ice');
+
+%Calculate the average velocity on each grid
+vel_3d=zeros(md.numberofgrids2d,1);
+grid_vel=0;
+
+for i=1:md.numberofgrids2d
+	for j=1:(md.numlayers-1)
+		grid_vel=grid_vel+1/(2*(md.numlayers-1))*(md.vel(i+j*md.numberofgrids2d,1)+md.vel(i+(j-1)*md.numberofgrids2d,1));
+	end
+	vel_3d(i,1)=grid_vel;
+	grid_vel=0;
+end
+
+vel_diff=(vel_2d-vel_3d)./vel_2d;
+vel_diff(find(vel_2d==vel_3d))=0;
+
+%Plot of the velocity from the macayeal and pattyn model 
+figure(1)
+subplot(2,2,1)
+p1=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_2d,'FaceColor','interp','EdgeColor','none');
+title('MacAyeal model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+   
+subplot(2,2,2)
+p2=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_3d,'FaceColor','interp','EdgeColor','none');
+title('Pattyn model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+
+subplot(2,2,3)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_diff*100,'FaceColor','interp','EdgeColor','none');
+title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+colorbar;
+
+subplot(2,2,4)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_2d-vel_3d,'FaceColor','interp','EdgeColor','none');
+title('Absolute misfit [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar;
+
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/Front.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/Pattyn.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/Pattyn.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/Pattyn.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-10 -10
+1000010 -10
+1000010 1000010
+-10 1000010
+-10 -10
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/Square.par
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/Square.par	(revision 1)
@@ -0,0 +1,122 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness+10;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=10*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/runme.m
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test2_icesheet/runme.m	(revision 1)
@@ -0,0 +1,60 @@
+% This file can be run to compare MacAyeal and Pattyn's model ie a 2d and a 3d model.
+% This test deals with a  mesh includind an iceshelf ans an icesheet. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+
+%Compute solution for a 2d model
+md=setelementstype(md,'Macayeal','all');
+md=solve(md,'diagnostic','ice');
+vel_2d=md.vel;
+
+%Compute solution for a 3d model
+md=extrude(md,5,3);
+md=setelementstype(md,'Pattyn','all');
+md=solve(md,'diagnostic','ice');
+
+%Calculate the average velocity on each grid
+vel_3d=zeros(md.numberofgrids2d,1);
+grid_vel=0;
+
+for i=1:md.numberofgrids2d
+	for j=1:(md.numlayers-1)
+		grid_vel=grid_vel+1/(2*(md.numlayers-1))*(md.vel(i+j*md.numberofgrids2d,1)+md.vel(i+(j-1)*md.numberofgrids2d,1));
+	end
+	vel_3d(i,1)=grid_vel;
+	grid_vel=0;
+end
+
+vel_diff=(vel_2d-vel_3d)./vel_2d;
+vel_diff(find(vel_2d==vel_3d))=0;
+
+%Plot of the velocity from the macayeal and pattyn model 
+figure(1)
+subplot(2,2,1)
+p1=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_2d,'FaceColor','interp','EdgeColor','none');
+title('MacAyeal model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+   
+subplot(2,2,2)
+p2=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_3d,'FaceColor','interp','EdgeColor','none');
+title('Pattyn model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+
+subplot(2,2,3)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_diff*100,'FaceColor','interp','EdgeColor','none');
+title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+colorbar;
+
+subplot(2,2,4)
+p4=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_2d-vel_3d,'FaceColor','interp','EdgeColor','none');
+title('Absolute misfit [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar;
+
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Front.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 500000
+-1000 1100000
+1100000 1100000
+1100000 500000
+-1000 500000
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Pattyn.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Pattyn.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Pattyn.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-10 -10
+1000010 -10
+1000010 1000010
+-10 1000010
+-10 -10
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Shelf.exp
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Shelf.exp	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Shelf.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:iceshelf
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1 600001
+1000001 600001
+1000001 1000001
+-1 1000001
+-1 600001
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Square.par
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/Square.par	(revision 1)
@@ -0,0 +1,122 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness+10;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/runme.m
===================================================================
--- /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/MacAyealVsPattyn/test3_icesheet_iceshelf/runme.m	(revision 1)
@@ -0,0 +1,61 @@
+% This file can be run to compare MacAyeal and Pattyn's model ie a 2d and a 3d model.
+% This test deals with a  mesh includind an iceshelf ans an icesheet. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'Shelf.exp','');
+md=parameterize(md,'Square.par');
+
+%Compute solution for a 2d model
+md=setelementstype(md,'Macayeal','all');
+md=solve(md,'diagnostic','ice');
+vel_2d=md.vel;
+
+%Compute solution for a 3d model
+md=extrude(md,5,3);
+md=setelementstype(md,'Pattyn','all');
+md=solve(md,'diagnostic','ice');
+
+%Calculate the average velocity on each grid
+vel_3d=zeros(md.numberofgrids2d,1);
+grid_vel=0;
+
+for i=1:md.numberofgrids2d
+	for j=1:(md.numlayers-1)
+		grid_vel=grid_vel+1/(2*(md.numlayers-1))*(md.vel(i+j*md.numberofgrids2d,1)+md.vel(i+(j-1)*md.numberofgrids2d,1));
+	end
+	vel_3d(i,1)=grid_vel;
+	grid_vel=0;
+end
+
+vel_diff=(vel_2d-vel_3d)./vel_2d;
+vel_diff(find(vel_2d==vel_3d))=0;
+vel_diff(find(vel_2d==0))=0;
+
+%Plot of the velocity from the macayeal and pattyn model 
+figure(1)
+subplot(2,2,1)
+p1=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_2d,'FaceColor','interp','EdgeColor','none');
+title('MacAyeal model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+   
+subplot(2,2,2)
+p2=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_3d,'FaceColor','interp','EdgeColor','none');
+title('Pattyn model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+
+subplot(2,2,3)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+abs(vel_diff)*100,'FaceColor','interp','EdgeColor','none');
+title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+colorbar;
+
+subplot(2,2,4)
+p4=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_2d-vel_3d,'FaceColor','interp','EdgeColor','none');
+title('Absolute misfit [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar;
+
Index: /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/Front.exp
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/Shelf.exp
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/Shelf.exp	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/Shelf.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:iceshelf
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1 -1
+1000001 -1
+1000001 1000001
+-1 1000001
+-1 -1
Index: /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/Square.par
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/Square.par	(revision 1)
@@ -0,0 +1,122 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/runme.m
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test1_iceshelf/runme.m	(revision 1)
@@ -0,0 +1,85 @@
+% This file can be run to compare MacAyeal and Pattyn's model ie a 2d and a 3d model.
+% This test deals with a  mesh includind an iceshelf ans an icesheet. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+%Compute solution for a Pattyn model
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'Shelf.exp','');
+md=parameterize(md,'Square.par');
+md=extrude(md,5,3);
+md=setelementstype(md,'Pattyn','all');
+
+md=solve(md,'diagnostic','ice');
+vel_pattyn=md.vel;
+vx_pattyn=md.vx;
+vy_pattyn=md.vy;
+vz_pattyn=md.vz;
+pressure_pattyn=md.pressure;
+
+mdpattyn=md;
+save modelpattyn mdpattyn;
+
+%Compute solution for a Stokes model
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'Shelf.exp','');
+md=parameterize(md,'Square.par');
+md=extrude(md,5,3);
+md=setelementstype(md,'Stokes','all','Pattyn','all');
+
+md=solve(md,'diagnostic','ice');
+vel_stokes=md.vel;
+vx_stokes=md.vx;
+vy_stokes=md.vy;
+vz_stokes=md.vz;
+pressure_stokes=md.pressure;
+
+mdstokes=md;
+save modelstokes mdstokes;
+
+error('debug')
+
+
+
+%Calculate the average velocity on each grid
+vel_3d=zeros(md.numberofgrids2d,1);
+grid_vel=0;
+
+for i=1:md.numberofgrids2d
+	for j=1:(md.numlayers-1)
+		grid_vel=grid_vel+1/(2*(md.numlayers-1))*(md.vel(i+j*md.numberofgrids2d,1)+md.vel(i+(j-1)*md.numberofgrids2d,1));
+	end
+	vel_3d(i,1)=grid_vel;
+	grid_vel=0;
+end
+
+vel_diff=(vel_2d-vel_3d)./vel_2d;
+vel_diff(find(vel_2d==vel_3d))=0;
+
+%Plot of the velocity from the stokes and pattyn model 
+figure(1)
+subplot(2,2,1)
+p1=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_pattyn,'FaceColor','interp','EdgeColor','none');
+title('MacAyeal model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+   
+subplot(2,2,2)
+p2=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_stokes,'FaceColor','interp','EdgeColor','none');
+title('Pattyn model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+
+subplot(2,2,3)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+(vel_pattyn-vel_stokes),'FaceColor','interp','EdgeColor','none');
+title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+colorbar;
+
+subplot(2,2,4)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+(vel_pattyn-vel_stokes)*100,'FaceColor','interp','EdgeColor','none');
+title('Absolute misfit [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar;
+
Index: /issm/trunk/test/Validation/PattynStokes/test2_icesheet/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test2_icesheet/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test2_icesheet/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/PattynStokes/test2_icesheet/Front.exp
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test2_icesheet/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test2_icesheet/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Validation/PattynStokes/test2_icesheet/Square.par
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test2_icesheet/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test2_icesheet/Square.par	(revision 1)
@@ -0,0 +1,121 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps=10;
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness+10;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/PattynStokes/test2_icesheet/runme.m
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test2_icesheet/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test2_icesheet/runme.m	(revision 1)
@@ -0,0 +1,85 @@
+% This file can be run to compare MacAyeal and Pattyn's model ie a 2d and a 3d model.
+% This test deals with a  mesh includind an iceshelf ans an icesheet. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+%Compute solution for a Pattyn model
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,5,3);
+md=extrude(md,'Pattyn','all');
+
+md=solve(md,'diagnostic','ice');
+vel_pattyn=md.vel;
+vx_pattyn=md.vx;
+vy_pattyn=md.vy;
+vz_pattyn=md.vz;
+pressure_pattyn=md.pressure;
+
+mdpattyn=md;
+save modelpattyn mdpattyn;
+
+%Compute solution for a Stokes model
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,5,3);
+md=extrude(md,'Pattyn','all','Stokes','all');
+
+md=solve(md,'diagnostic','ice');
+vel_stokes=md.vel;
+vx_stokes=md.vx;
+vy_stokes=md.vy;
+vz_stokes=md.vz;
+pressure_stokes=md.pressure;
+
+mdstokes=md;
+save modelstokes mdstokes;
+
+error('debug')
+
+
+
+%Calculate the average velocity on each grid
+vel_3d=zeros(md.numberofgrids2d,1);
+grid_vel=0;
+
+for i=1:md.numberofgrids2d
+	for j=1:(md.numlayers-1)
+		grid_vel=grid_vel+1/(2*(md.numlayers-1))*(md.vel(i+j*md.numberofgrids2d,1)+md.vel(i+(j-1)*md.numberofgrids2d,1));
+	end
+	vel_3d(i,1)=grid_vel;
+	grid_vel=0;
+end
+
+vel_diff=(vel_2d-vel_3d)./vel_2d;
+vel_diff(find(vel_2d==vel_3d))=0;
+
+%Plot of the velocity from the stokes and pattyn model 
+figure(1)
+subplot(2,2,1)
+p1=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_pattyn,'FaceColor','interp','EdgeColor','none');
+title('MacAyeal model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+   
+subplot(2,2,2)
+p2=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_stokes,'FaceColor','interp','EdgeColor','none');
+title('Pattyn model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+
+subplot(2,2,3)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+(vel_pattyn-vel_stokes),'FaceColor','interp','EdgeColor','none');
+title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+colorbar;
+
+subplot(2,2,4)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+(vel_pattyn-vel_stokes)*100,'FaceColor','interp','EdgeColor','none');
+title('Absolute misfit [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar;
+
Index: /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/Front.exp
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/Shelf.exp
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/Shelf.exp	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/Shelf.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:iceshelf
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1 600001
+1000001 600001
+1000001 1000001
+-1 1000001
+-1 600001
Index: /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/Square.par
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/Square.par	(revision 1)
@@ -0,0 +1,122 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness-2*10^(-4)*min(0,md.y-600000);
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/runme.m
===================================================================
--- /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/PattynStokes/test3_icesheet_iceshelf/runme.m	(revision 1)
@@ -0,0 +1,85 @@
+% This file can be run to compare MacAyeal and Pattyn's model ie a 2d and a 3d model.
+% This test deals with a  mesh includind an iceshelf ans an icesheet. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+%Compute solution for a Pattyn model
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'Shelf.exp','');
+md=parameterize(md,'Square.par');
+md=extrude(md,5,3);
+md=extrude(md,'Pattyn','all');
+
+md=solve(md,'diagnostic','ice');
+vel_pattyn=md.vel;
+vx_pattyn=md.vx;
+vy_pattyn=md.vy;
+vz_pattyn=md.vz;
+pressure_pattyn=md.pressure;
+
+mdpattyn=md;
+save modelpattyn mdpattyn;
+
+%Compute solution for a Stokes model
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'Shelf.exp','');
+md=parameterize(md,'Square.par');
+md=extrude(md,5,3);
+md=extrude(md,'Pattyn','all','Stokes','all');
+
+md=solve(md,'diagnostic','ice');
+vel_stokes=md.vel;
+vx_stokes=md.vx;
+vy_stokes=md.vy;
+vz_stokes=md.vz;
+pressure_stokes=md.pressure;
+
+mdstokes=md;
+save modelstokes mdstokes;
+
+error('debug')
+
+
+
+%Calculate the average velocity on each grid
+vel_3d=zeros(md.numberofgrids2d,1);
+grid_vel=0;
+
+for i=1:md.numberofgrids2d
+	for j=1:(md.numlayers-1)
+		grid_vel=grid_vel+1/(2*(md.numlayers-1))*(md.vel(i+j*md.numberofgrids2d,1)+md.vel(i+(j-1)*md.numberofgrids2d,1));
+	end
+	vel_3d(i,1)=grid_vel;
+	grid_vel=0;
+end
+
+vel_diff=(vel_2d-vel_3d)./vel_2d;
+vel_diff(find(vel_2d==vel_3d))=0;
+
+%Plot of the velocity from the stokes and pattyn model 
+figure(1)
+subplot(2,2,1)
+p1=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_pattyn,'FaceColor','interp','EdgeColor','none');
+title('MacAyeal model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+   
+subplot(2,2,2)
+p2=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_stokes,'FaceColor','interp','EdgeColor','none');
+title('Pattyn model [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar; 
+
+subplot(2,2,3)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+(vel_pattyn-vel_stokes),'FaceColor','interp','EdgeColor','none');
+title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+colorbar;
+
+subplot(2,2,4)
+p3=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+(vel_pattyn-vel_stokes)*100,'FaceColor','interp','EdgeColor','none');
+title('Absolute misfit [m/yr]','FontSize',14,'FontWeight','bold')
+colorbar;
+
Index: /issm/trunk/test/Validation/RoundIceSheet/Circ.par
===================================================================
--- /issm/trunk/test/Validation/RoundIceSheet/Circ.par	(revision 1)
+++ /issm/trunk/test/Validation/RoundIceSheet/Circ.par	(revision 1)
@@ -0,0 +1,129 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.81;
+	md.rho_ice=910;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	client_server_mode='no';
+	md.cluster='cosmos';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3.5;
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+	disp('      creating thickness');
+	hmin=0.01;
+	hmax=2756.7;
+	radius=(sqrt((md.x).^2+(md.y).^2));
+	radiusmax=max(radius);
+	md.thickness=hmin*ones(size(md.x,1),1)+hmax*(4*((1/2)^(4/3)*ones(size(md.x,1),1)-((radius)./(2*radiusmax)).^(4/3))).^(3/8);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=0*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=10^20*ones(md.numberofgrids,1); %q=1. %no drag is specified in the analytical solution
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperatures');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=6.81*10^(7)*ones(md.numberofgrids,1); %to have the same B as the analytical solution 
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=0.3*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	disp('      creating velocities');
+	constant=0.3;
+	md.vx_obs=constant/2*md.x.*(md.thickness).^-1;
+	md.vy_obs=constant/2*md.y.*(md.thickness).^-1;
+
+	%md.vx_obs=zeros(md.numberofgrids,1);
+	%md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=(sqrt((md.vx_obs).^2+(md.vy_obs).^2));
+	
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node');
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+	
+	radius=sqrt((md.x).*md.x+(md.y).*md.y);
+	pos=find(radius==min(radius));md.gridondirichlet_diag(pos)=1;
+	md.x(pos)=0; md.y(pos)=0; %the closest node to the center is changed to be exactly at the center
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.melting=zeros(md.numberofgrids,1);
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperatures
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);
+	%md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/RoundIceSheet/CreateDomainOutline.m
===================================================================
--- /issm/trunk/test/Validation/RoundIceSheet/CreateDomainOutline.m	(revision 1)
+++ /issm/trunk/test/Validation/RoundIceSheet/CreateDomainOutline.m	(revision 1)
@@ -0,0 +1,27 @@
+function contour=CreateDomainOutline(numberofpoints,radius)
+%This funtion returns the coordinates of points on a circular domain. There is numberofpoints points
+%The radius of the circle is by default 1 but can change it.
+%Radius is the radius of the circular domain you wish to create
+
+if ((floor(numberofpoints)-numberofpoints)~=0)
+	error('domainoutline argument must be a positive integer')
+end
+
+if ((radius-abs(radius))~=0)
+	error('radius must be a positive number')
+end
+
+%Calculate the cartesians coordinates of the points
+x_list=ones(numberofpoints,1);
+y_list=ones(numberofpoints,1);
+
+theta=(0:2*pi/numberofpoints:2*pi*(1-1/numberofpoints))';
+
+x_list=radius*x_list.*cos(theta);
+y_list=radius*y_list.*sin(theta);
+
+contour.x=x_list;
+contour.y=y_list;
+contour.density=1;
+
+end
Index: /issm/trunk/test/Validation/RoundIceSheet/README
===================================================================
--- /issm/trunk/test/Validation/RoundIceSheet/README	(revision 1)
+++ /issm/trunk/test/Validation/RoundIceSheet/README	(revision 1)
@@ -0,0 +1,9 @@
+The aim of the directory is to compare the solution calculated with the model Ice and an analytic solution.
+
+The test deals with a round icesheet (circular domain) and an azimuthal symmetry.
+
+To launch the test, you have to run the file Comparison in Matlab.
+
+You can choose the precision of the domainoutline and of the mesh. To do that, open the file Comparison and change numberofgrids for the prcision of the domainoutline (it indicates the numberofgrids on the circular domain) and change the density (it refines the mech).
+
+
Index: /issm/trunk/test/Validation/RoundIceSheet/runme.m
===================================================================
--- /issm/trunk/test/Validation/RoundIceSheet/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/RoundIceSheet/runme.m	(revision 1)
@@ -0,0 +1,92 @@
+%The aim of this program is to compare a model with an analytical solution given in MacAyeal EISMINT : Lessons in Ice-Sheet Modeling
+%The constants used in the file circ.par are the ones used in the analytical solution.
+%This solution is valid for a circular contour
+
+%You can adjust the parameters numberofpoints and density to refine the mesh and check the precision of your solution. You can change the number of layers of the domain with the parameter layernumber.
+
+%To begin with the numerical model
+md=model;
+
+numberofgrids=20;
+density=190000;
+layernumber=4;
+
+%First we have to create the domain outline 
+contour=CreateDomainOutline(numberofgrids,750000);
+
+expgen('DomainOutline.exp',contour,1);
+md=mesh(md,'DomainOutline.exp',density)
+
+%move the closest node to the center
+[mini pos]=min(md.x.^2+md.y.^2);
+md.x(pos)=0;
+md.y(pos)=0;
+
+%Then we have to create the geography and the parameters of the mesh
+md=geography(md,'',''); %We can not test iceshelves nor ice rises with this analytical solution
+
+%We now create a file Front.exp needed to parameterize but the analytical solution can't support an icefront so this file is empty
+front=CreateDomainOutline(numberofgrids,1000000);
+
+expgen('Front.exp',front,1);
+
+md=parameterize(md,'Circ.par');
+
+%Calculation of the analytical 2d velocity field
+constant=0.3;
+vx_obs=constant/2*md.x.*(md.thickness).^-1;
+vy_obs=constant/2*md.y.*(md.thickness).^-1;
+vel_obs=(sqrt((md.vx_obs).^2+(md.vy_obs).^2));
+
+%We extrude the model to have a 3d model
+md=extrude(md,'Front.exp','',layernumber,3);
+
+%Now we can solve the problem 
+md=solve(md,'diagnostic','ice');
+
+%Calculate the depth averaged velocity field (2d):
+vel=zeros(md.numberofgrids2d,1);
+
+grid_vel=0;
+for i=1:md.numberofgrids2d
+	for j=1:(md.numlayers-1)
+		grid_vel=grid_vel+1/(2*(md.numlayers-1))*(sqrt(md.vx(i+j*md.numberofgrids2d,1).^2+md.vy(i+j*md.numberofgrids2d,1).^2)+sqrt(md.vx(i+(j-1)*md.numberofgrids2d,1).^2+md.vy(i+(j-1)*md.numberofgrids2d,1).^2));
+	end
+	vel(i,1)=grid_vel;
+	grid_vel=0;
+end
+
+%Plot of the velocity from the exact and calculated solutions
+figure(1)
+subplot(2,2,1)
+p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel,'FaceColor','interp','EdgeColor','none');
+title('Modelled velocity','FontSize',14,'FontWeight','bold')
+colorbar; 
+caxis([0 200]);
+   
+subplot(2,2,2)
+p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+vel_obs,'FaceColor','interp','EdgeColor','none');
+title('Analytical velocity','FontSize',14,'FontWeight','bold')
+colorbar; 
+caxis([0 200]);
+
+subplot(2,2,3)
+hold on;
+plot(sqrt((md.x(1:md.numberofgrids2d)).^2+(md.y(1:md.numberofgrids2d)).^2),vel,'r.');
+plot(sqrt((md.x2d).^2+(md.y2d).^2),vel_obs,'b.');
+title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold');
+xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold');
+ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold');
+legend('calculated velocity','exact velocity');
+axis([0 750000 0 200]);
+hold off;
+
+subplot(2,2,4)
+p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none');
+title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+colorbar;
+caxis([0 100]);
+
Index: /issm/trunk/test/Validation/ThermalTests/Melting/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Melting/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Melting/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/ThermalTests/Melting/Front.exp
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Melting/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Melting/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Validation/ThermalTests/Melting/Square.par
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Melting/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Melting/Square.par	(revision 1)
@@ -0,0 +1,129 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=5;
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmax=1000;
+	md.thickness=hmax*ones(md.numberofgrids,1)
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.surface=zeros(md.numberofgrids,1);
+	md.bed=-md.thickness;
+
+%	hmin=700;
+%	hmax=1000;
+%	ymin=min(md.y);
+%	ymax=max(md.y);
+%	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+%	md.firn_layer=10*ones(md.numberofgrids,1);
+%	md.surface=zeros(md.numberofgrids,1);
+%	md.bed=-md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperatures');
+	md.observed_temperature=(273.15)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=1*10^-3; %1 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/ThermalTests/Melting/runme.m
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Melting/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Melting/runme.m	(revision 1)
@@ -0,0 +1,29 @@
+
+% This file can be run to check that the melting in simple conduction is correctly modeled.
+% There is no velocity (no advection) the only thermal boundary conditions are an imposed temperature
+% at upper surface and an impose flux at its base. The result must be a linear temperature from the upper to the lower
+% surface with an imposed slope (Geothermal flux). if it is not the case, something is thermal modeling has been changed...
+% Just run this file in Matlab, with a properly setup Ice code. 
+
+% Create model;
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,2,1);
+md=setelementstype(md,'Pattyn','all');
+thermalboundarycondition;
+
+%analytical results
+%melting heat = geothermal flux
+%Mb*L*rho=G   => Mb=G/L*rho
+melting=md.geothermalflux/(md.rho_ice*md.latentheat)*md.yts;
+
+%modeled  results
+md=solve(md,'thermalsteady');
+
+%plot results
+relative=abs((md.melting-melting)./melting)*100;
+relative(find(md.melting==melting))=0;
+plotmodel(md,'data','melting','title','modeled melting','data',melting,'title','analytical melting','data',md.melting-melting,'title','absolute error','data',relative,'title','relative error [%]','layer#all',1)
Index: /issm/trunk/test/Validation/ThermalTests/Melting/thermalboundarycondition.m
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Melting/thermalboundarycondition.m	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Melting/thermalboundarycondition.m	(revision 1)
@@ -0,0 +1,13 @@
+
+%Ok, start defining model BC 
+disp('      boundary conditions for thermal model ');
+if strcmp(md.type,'3d')
+%	pos2=find(md.elementonsurface); md.gridondirichlet_thermal(md.elements(pos2,4:6))=1; md.dirichletvalues_thermal(md.elements(pos2,4:6))=0;
+	md.vx=zeros(md.numberofgrids,1);
+	md.vy=zeros(md.numberofgrids,1);
+	md.vz=zeros(md.numberofgrids,1);
+	md.vel=zeros(md.numberofgrids,1);
+	md.pressure=zeros(md.numberofgrids,1);
+else
+	error('model must be 3d to be thermaly parameterized')
+end
Index: /issm/trunk/test/Validation/ThermalTests/Simpleadvection/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleadvection/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleadvection/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/ThermalTests/Simpleadvection/Front.exp
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleadvection/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleadvection/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Validation/ThermalTests/Simpleadvection/Square.par
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleadvection/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleadvection/Square.par	(revision 1)
@@ -0,0 +1,121 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	%md.penalty_horiz=10^25; %penalty parameters for rifts
+	%md.penalty_vert=10^15; %penalty parameters for rifts
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmax=1000;
+	md.thickness=hmax*ones(md.numberofgrids,1);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.surface=zeros(md.numberofgrids,1);
+	md.bed=-md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperatures');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=0.1; %1 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/ThermalTests/Simpleadvection/runme.m
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleadvection/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleadvection/runme.m	(revision 1)
@@ -0,0 +1,30 @@
+
+% This file can be run to check that the advection-diffusion  is correctly modeled.
+% There is u=v=0 and w=cst everywhere the only thermal boundary conditions are an imposed temperature
+% at upper surface and an impose flux at its base.
+% Just run this file in Matlab, with a properly setup Ice code. 
+
+% Create model;
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,20,1);   %NB: the more one extrudes, the better (10-> relative~0.35%, 20->0.1%, 30->0.05%)
+md=setelementstype(md,'Pattyn','all'); 
+thermalboundarycondition;
+
+%analytical results
+%d2T/dz2-w*rho_ice*c/k*dT/dz=0   T(surface)=0  T(bed)=10   => T=A exp(alpha z)+B
+alpha=0.1/md.yts*md.rho_ice*md.heatcapacity/md.thermalconductivity;   %alpha=w rho_ice c /k  and w=0.1m/an
+A=10/(exp(alpha*(-1000))-1);    %A=T(bed)/(exp(alpha*bed)-1)  with bed=-1000 T(bed)=10
+B=-A;
+md.observed_temperature=A*exp(alpha*md.z)+B;
+
+%modeled  results
+md=solve(md,'thermalsteady');
+
+%plot results
+relative=abs((md.temperature-md.observed_temperature)./md.observed_temperature)*100;
+relative(find(md.temperature==md.observed_temperature))=0;
+plotmodel(md,'data','temperature','title','modeled temperature','data','observed_temperature','view',3,'title','analytical temperature','view',3,'data',md.temperature-md.observed_temperature,'title','absolute error','view',3,'data',relative,'title','relative error [%]','view',3)
Index: /issm/trunk/test/Validation/ThermalTests/Simpleadvection/thermalboundarycondition.m
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleadvection/thermalboundarycondition.m	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleadvection/thermalboundarycondition.m	(revision 1)
@@ -0,0 +1,14 @@
+
+%Ok, start defining model BC 
+disp('      boundary conditions for thermal model ');
+if strcmp(md.type,'3d')
+	pos1=find(md.elementonbed);     md.gridondirichlet_thermal(md.elements(pos1,1:3))=1; md.dirichletvalues_thermal(md.elements(pos1,1:3))=10;
+	pos2=find(md.elementonsurface); md.gridondirichlet_thermal(md.elements(pos2,4:6))=1; md.dirichletvalues_thermal(md.elements(pos2,4:6))=0;
+	md.vx=zeros(md.numberofgrids,1);
+	md.vy=zeros(md.numberofgrids,1);
+	md.vz=0.1*ones(md.numberofgrids,1);
+	md.vel=sqrt( md.vx.^2+ md.vy.^2+ md.vz.^2);
+	md.pressure=zeros(md.numberofgrids,1);
+else
+	error('model must be 3d to be thermaly parameterized')
+end
Index: /issm/trunk/test/Validation/ThermalTests/Simpleconduction/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleconduction/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleconduction/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/ThermalTests/Simpleconduction/Front.exp
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleconduction/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleconduction/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Validation/ThermalTests/Simpleconduction/Shelf.exp
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleconduction/Shelf.exp	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleconduction/Shelf.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:iceshelf
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1 -1
+1000001 -1
+1000001 1000001
+-1 1000001
+-1 -1
Index: /issm/trunk/test/Validation/ThermalTests/Simpleconduction/Square.par
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleconduction/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleconduction/Square.par	(revision 1)
@@ -0,0 +1,121 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	%md.penalty_horiz=10^25; %penalty parameters for rifts
+	%md.penalty_vert=10^15; %penalty parameters for rifts
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	h=1000;
+	md.thickness=h*ones(md.numberofgrids,1);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=zeros(md.numberofgrids,1);
+	md.surface=md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperatures');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/ThermalTests/Simpleconduction/runme.m
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleconduction/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleconduction/runme.m	(revision 1)
@@ -0,0 +1,32 @@
+
+% This file can be run to check that the conduction is correctly modeled.
+% There is no velocity (no advection) the only thermal boundary conditions are an imposed temperature
+% at the lower and upper surface. The result must be a linear temperature from the upper to the lower
+% surface. if it is not the case, something is thermal modeling has been changed...
+% Just run this file in Matlab, with a properly setup Ice code. 
+
+% Create model;
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'Shelf.exp','');
+md=parameterize(md,'Square.par');
+md=extrude(md,11,1);
+md=setelementstype(md,'Pattyn','all');
+thermalboundarycondition;
+
+%analytical results
+%d2T/dz2=0 T(bed)=10 T(surface)=0  => T=10/thickness*z-10*surface/thickness
+%each layer of the 3d mesh must have a constant value
+Tlayer=10:-1:0;
+for layer=1:md.numlayers
+	md.observed_temperature((layer-1)*md.numberofgrids2d+1:layer*md.numberofgrids2d)=Tlayer(layer);
+end
+
+%modeled  results
+md=solve(md,'thermalsteady');
+
+%plot results
+relative=abs((md.temperature-md.observed_temperature)./md.observed_temperature)*100;
+relative(find(md.temperature==md.observed_temperature))=0;
+plotmodel(md,'data','temperature','title','modeled temperature','data','observed_temperature','view',3,'title','analytical temperature','view',3,'data',md.temperature-md.observed_temperature,'title','absolute error','view',3,'data',relative,'title','relative error [%]','view',3)
Index: /issm/trunk/test/Validation/ThermalTests/Simpleconduction/thermalboundarycondition.m
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simpleconduction/thermalboundarycondition.m	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simpleconduction/thermalboundarycondition.m	(revision 1)
@@ -0,0 +1,14 @@
+
+%Ok, start defining model BC 
+disp('      boundary conditions for thermal model ');
+if strcmp(md.type,'3d')
+	pos1=find(md.elementonbed);     md.gridondirichlet_thermal(md.elements(pos1,1:3))=1; md.dirichletvalues_thermal(md.elements(pos1,1:3))=10;
+	pos2=find(md.elementonsurface); md.gridondirichlet_thermal(md.elements(pos2,4:6))=1; md.dirichletvalues_thermal(md.elements(pos2,4:6))=0;
+	md.vx=zeros(md.numberofgrids,1);
+	md.vy=zeros(md.numberofgrids,1);
+	md.vz=zeros(md.numberofgrids,1);
+	md.vel=zeros(md.numberofgrids,1);
+	md.pressure=zeros(md.numberofgrids,1);
+else
+	error('model must be 3d to be thermaly parameterized')
+end
Index: /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/Front.exp
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/Front.exp	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/Square.par
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/Square.par	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/Square.par	(revision 1)
@@ -0,0 +1,130 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	%md.penalty_horiz=10^25; %penalty parameters for rifts
+	%md.penalty_vert=10^15; %penalty parameters for rifts
+	md.lowmem=1;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmax=1000;
+	md.thickness=hmax*ones(md.numberofgrids,1)
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.surface=zeros(md.numberofgrids,1);
+	md.bed=-md.thickness;
+
+%	hmin=700;
+%	hmax=1000;
+%	ymin=min(md.y);
+%	ymax=max(md.y);
+%	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+%	md.firn_layer=10*ones(md.numberofgrids,1);
+%	md.surface=zeros(md.numberofgrids,1);
+%	md.bed=-md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperatures');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=0.1; %1 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/runme.m
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/runme.m	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/runme.m	(revision 1)
@@ -0,0 +1,29 @@
+
+% This file can be run to check that the geothermal flux in simple conduction is correctly modeled.
+% There is no velocity (no advection) the only thermal boundary conditions are an imposed temperature
+% at upper surface and an impose flux at its base. The result must be a linear temperature from the upper to the lower
+% surface with an imposed slope (Geothermal flux). if it is not the case, something is thermal modeling has been changed...
+% Just run this file in Matlab, with a properly setup Ice code. 
+
+% Create model;
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,11,1);
+md=setelementstype(md,'Pattyn','all');
+thermalboundarycondition;
+
+%analytical results
+%the result is linear with depth and is equal to 0 on the upper surface (See BC)
+%d2T/dz2=0  -k*dT/dz(bed)=G  T(surface)=0  => T=-G/k*(z-surface)
+md.observed_temperature=-0.1/md.thermalconductivity*md.z; %G=0.1 W/m2
+
+%modeled  results
+md=solve(md,'thermalsteady');
+
+%plot results
+relative=abs((md.temperature-md.observed_temperature)./md.observed_temperature)*100;
+relative(find(md.temperature==md.observed_temperature))=0;
+plotmodel(md,'data','temperature','title','modeled temperature','data','observed_temperature','view',3,'title','analytical temperature','view',3,'data',md.temperature-md.observed_temperature,'title','absolute error','view',3,'data',relative,'title','relative error [%]','view',3)
Index: /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/thermalboundarycondition.m
===================================================================
--- /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/thermalboundarycondition.m	(revision 1)
+++ /issm/trunk/test/Validation/ThermalTests/Simplegeothermalflux/thermalboundarycondition.m	(revision 1)
@@ -0,0 +1,13 @@
+
+%Ok, start defining model BC 
+disp('      boundary conditions for thermal model ');
+if strcmp(md.type,'3d')
+	pos2=find(md.elementonsurface); md.gridondirichlet_thermal(md.elements(pos2,4:6))=1; md.dirichletvalues_thermal(md.elements(pos2,4:6))=0;
+	md.vx=zeros(md.numberofgrids,1);
+	md.vy=zeros(md.numberofgrids,1);
+	md.vz=zeros(md.numberofgrids,1);
+	md.vel=zeros(md.numberofgrids,1);
+	md.pressure=zeros(md.numberofgrids,1);
+else
+	error('model must be 3d to be thermaly parameterized')
+end
Index: /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/Square.par
===================================================================
--- /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/runme.m
===================================================================
--- /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/runme.m	(revision 1)
@@ -0,0 +1,75 @@
+% This file can be run to check that the current version of Pattyn model is giving 
+% coherent results. This test deals with an iceshelf with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test10_iceshelf_icefront_stokes: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all','stokes','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+vel_stokes=md.vel;
+
+%Load old velocities and compare with the new model
+load archive_stokes
+pos=find(archive_stokes-vel_stokes);
+error_vel=abs(norm((archive_stokes(pos)-vel_stokes(pos))./archive_stokes(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Stokes model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Stokes model are comform with the archive version'));
+end
+
+
+
+%Compute solution with Ice model
+md=solve(md,'thermalsteady','ice');
+temp_stokes=md.temperature;
+melting_stokes=md.melting;
+
+%Load old velocities and compare with the new model
+load archive_temperature
+post=find(archive_temperature-temp_stokes);
+error_temp=abs(norm((archive_temperature(post)-temp_stokes(post))./archive_temperature(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+
+if (error_temp>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from thermal model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from thermal model are comform with the archive version'));
+end
+
+%Load old velocities and compare with the new model
+load archive_melting
+post=find(archive_melting-melting_stokes);
+error_melting=abs(norm((archive_melting(post)-melting_stokes(post))./archive_melting(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+
+if (error_melting>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting model are comform with the archive version'));
+end
Index: /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/updatearchive.m	(revision 1)
@@ -0,0 +1,29 @@
+% This file can be run to update the velocity archives  of the test10.
+% This test deals with an iceshelf with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all','stokes','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+archive_stokes=md.vel;
+
+%Save the solution in the directory
+save archive_stokes archive_stokes
+
+%Compute solution with Ice model
+md=solve(md,'thermalsteady','ice');
+archive_temperature=md.temperature;
+archive_melting=md.melting;
+
+%Save the solution in the directory
+save archive_temperature archive_temperature
+save archive_melting archive_melting
Index: /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Pattyn.exp
===================================================================
--- /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Pattyn.exp	(revision 1)
+++ /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Pattyn.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+500001 0
+500001 1000001
+0 1000001
+0 0
Index: /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Square.par
===================================================================
--- /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Square.par	(revision 1)
@@ -0,0 +1,125 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.viscosity_overshoot=0;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Stokes.exp
===================================================================
--- /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Stokes.exp	(revision 1)
+++ /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/Stokes.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+250000 500000
+750001 500000
+750001 1000001
+250000 1000001
+250000 500000
Index: /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/runme.m
===================================================================
--- /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/runme.m	(revision 1)
@@ -0,0 +1,74 @@
+% This file can be run to check that the current version of Pattyn model is giving 
+% coherent results. This test deals with an iceshelf with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test11_penalties_iceshelf_allmodels: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','Pattyn.exp','fill','macayeal','stokes','Stokes.exp');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+velocity=md.vel;
+
+%Load old velocities and compare with the new model
+load archive_velocity 
+pos=find(archive_velocity-velocity);
+error_vel=abs(norm((archive_velocity(pos)-velocity(pos))./archive_velocity(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from diagnostic model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from diagnostic model are comform with the archive version'));
+end
+
+
+
+%Compute solution with Ice model
+md=solve(md,'thermalsteady','ice');
+temperature=md.temperature;
+melting_stokes=md.melting;
+
+%Load old temperatures and compare with the new model
+load archive_temperature
+post=find(archive_temperature-temperature);
+error_temp=abs(norm((archive_temperature(post)-temperature(post))./archive_temperature(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+if (error_temp>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from thermal model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from thermal model are comform with the archive version'));
+end
+
+
+%Load old melting and compare with the new model
+load archive_melting
+post=find(archive_melting-melting_stokes);
+error_melting=abs(norm((archive_melting(post)-melting_stokes(post))./archive_melting(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+
+if (error_melting>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting model are comform with the archive version'));
+end
Index: /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test11_penalties_iceshelf_allmodels/updatearchive.m	(revision 1)
@@ -0,0 +1,29 @@
+% This file can be run to update the velocity archives  of the test11.
+% This test deals with an iceshelf with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','Pattyn.exp','fill','macayeal','stokes','Stokes.exp');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+archive_velocity=md.vel;
+
+%Save the solution in the directory
+save archive_velocity  archive_velocity 
+
+%Compute solution with Ice model
+md=solve(md,'thermalsteady','ice');
+archive_temperature=md.temperature;
+archive_melting=md.melting;
+
+%Save the solution in the directory
+save archive_temperature archive_temperature
+save archive_melting archive_melting
Index: /issm/trunk/test/Verification/test1_icesheet_noicefront/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test1_icesheet_noicefront/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test1_icesheet_noicefront/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test1_icesheet_noicefront/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test1_icesheet_noicefront/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test1_icesheet_noicefront/Front.exp	(revision 1)
@@ -0,0 +1,7 @@
+## Name:noicefront
+## Icon:0
+# Points Count  Value
+1 1.
+# X pos Y pos
+0 0
+
Index: /issm/trunk/test/Verification/test1_icesheet_noicefront/Square.lock
===================================================================
--- /issm/trunk/test/Verification/test1_icesheet_noicefront/Square.lock	(revision 1)
+++ /issm/trunk/test/Verification/test1_icesheet_noicefront/Square.lock	(revision 1)
@@ -0,0 +1,1 @@
+1
Index: /issm/trunk/test/Verification/test1_icesheet_noicefront/Square.par
===================================================================
--- /issm/trunk/test/Verification/test1_icesheet_noicefront/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test1_icesheet_noicefront/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_abs=10;
+	md.eps_rel=0.01;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20*ones(md.nsteps,1);
+	md.optscal=10*ones(md.nsteps,1);
+	md.fit=2*ones(md.nsteps,1);
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test1_icesheet_noicefront/Square.queue
===================================================================
--- /issm/trunk/test/Verification/test1_icesheet_noicefront/Square.queue	(revision 1)
+++ /issm/trunk/test/Verification/test1_icesheet_noicefront/Square.queue	(revision 1)
@@ -0,0 +1,3 @@
+#!/bin/sh
+rm -rf /home/larour/Testing/Execution/Square.lock
+mpirun -np 3 /home/larour/Ice/ice1/bin/cielodiagnostic.exe /home/larour/Testing/Execution Square.bin Square.outbin Square.lock 2> Square.errlog >Square.outlog & 
Index: /issm/trunk/test/Verification/test1_icesheet_noicefront/runme.m
===================================================================
--- /issm/trunk/test/Verification/test1_icesheet_noicefront/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test1_icesheet_noicefront/runme.m	(revision 1)
@@ -0,0 +1,101 @@
+
+% This file can be run to check that the current version of macayeal and ice models are giving 
+% coherent results. This test deals with an icesheet without icefront for a 2d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test1_icesheet_noicefront: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=setelementstype(md,'macayeal','all');
+error('debug');
+
+%Compute solution with MacAyeal's model
+md=solve(md,'diagnostic','macayeal');
+vel_macayeal=md.vel;
+
+%Compute solution with Ice model
+md.acceleration=0;
+md=solve(md,'diagnostic','ice');
+vel_ice=md.vel;
+
+%Compute solution with accelerated Ice model
+md.acceleration=1;
+md=solve(md,'diagnostic','ice');
+vel_acc=md.vel;
+
+%Compute solution with Hutter elements in Ice model
+md=setelementstype(md,'hutter','all');
+md=solve(md,'diagnostic','ice');
+vel_hutter=md.vel;
+
+
+%Load old velocities and compare with the new model
+
+%Macayeal
+load archive_macayeal
+pos=find(archive_macayeal-vel_macayeal);
+error_vel=abs(norm((archive_macayeal(pos)-vel_macayeal(pos))./archive_macayeal(pos),2));
+
+disp(sprintf('numerical difference between old and new version of MacAyeal is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR.  Results from MacAyeal model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from MacAyeal model are comform with the archive version'));
+end
+
+%Ice
+load archive_ice
+pos=find(archive_ice-vel_ice);
+error_vel=abs(norm((archive_ice(pos)-vel_ice(pos))./archive_ice(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Ice model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Ice model are comform with the archive version'));
+end
+
+%Accelerated Ice
+load archive_acc
+pos=find(archive_acc-vel_acc);
+error_vel=abs(norm((archive_acc(pos)-vel_acc(pos))./archive_ice(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Accelerated Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Accelerated Ice model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Accelerated Ice model are comform with the archive version'));
+end
+
+%Ice with Hutter elements
+load archive_hutter
+pos=find(archive_hutter-vel_hutter);
+error_vel=abs(norm((archive_hutter(pos)-vel_hutter(pos))./archive_ice(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Ice model with Hutter elements differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Ice model with Hutter elements are comform with the archive version'));
+end
+
Index: /issm/trunk/test/Verification/test1_icesheet_noicefront/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test1_icesheet_noicefront/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test1_icesheet_noicefront/updatearchive.m	(revision 1)
@@ -0,0 +1,44 @@
+% This file can be run to update the velocity archives  of the test1.
+% This test deals with an icesheet without icefront for a 2d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=setelementstype(md,'macayeal','all');
+
+%Compute solution with MacAyeal's model
+md=solve(md,'diagnostic','macayeal');
+archive_macayeal=md.vel;
+
+%Save the solution in the directory
+save archive_macayeal archive_macayeal
+
+%Compute solution with Ice model
+md.acceleration=0;
+md=solve(md,'diagnostic','ice');
+archive_ice=md.vel;
+
+%Save the solution in the directory
+save archive_ice archive_ice
+
+%Compute solution with accelerated Ice model
+md.acceleration=1;
+md=solve(md,'diagnostic','ice');
+archive_acc=md.vel;
+
+%Save the solution in the directory
+save archive_acc archive_acc
+
+%Compute solution with Hutter elements in Ice model
+md=setelementstype(md,'hutter','all');
+md=solve(md,'diagnostic','ice');
+archive_hutter=md.vel;
+
+%Save the solution in the directory
+save archive_hutter archive_hutter
+
Index: /issm/trunk/test/Verification/test2_icesheet_icefront/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test2_icesheet_icefront/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test2_icesheet_icefront/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test2_icesheet_icefront/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test2_icesheet_icefront/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test2_icesheet_icefront/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test2_icesheet_icefront/Hutter.exp
===================================================================
--- /issm/trunk/test/Verification/test2_icesheet_icefront/Hutter.exp	(revision 1)
+++ /issm/trunk/test/Verification/test2_icesheet_icefront/Hutter.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 500001
+0 500001
+0 0
Index: /issm/trunk/test/Verification/test2_icesheet_icefront/Square.par
===================================================================
--- /issm/trunk/test/Verification/test2_icesheet_icefront/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test2_icesheet_icefront/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test2_icesheet_icefront/runme.m
===================================================================
--- /issm/trunk/test/Verification/test2_icesheet_icefront/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test2_icesheet_icefront/runme.m	(revision 1)
@@ -0,0 +1,115 @@
+% This file can be run to check that the current version of macayeal and ice models are giving 
+% coherent results. This test deals with an icesheet with icefront for a 2d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test2_icesheet_icefront: '; 
+
+% Create model;
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=setelementstype(md,'macayeal','all');
+
+%Compute solution with MacAyeal's model
+md=solve(md,'diagnostic','macayeal');
+vel_macayeal=md.vel;
+
+%Compute solution with Ice model
+md.acceleration=0;
+md=solve(md,'diagnostic','ice');
+vel_ice=md.vel;
+
+%Compute solution with accelerated Ice model
+md.acceleration=1;
+md=solve(md,'diagnostic','ice');
+vel_acc=md.vel;
+
+%Compute prognostic with Ice model
+md=solve(md,'prognostic','ice');
+thickness=md.new_thickness;
+
+%Compute solution with Hutter and MacAyeal elements in Ice model
+md=setelementstype(md,'fill','macayeal','Hutter','Hutter.exp');
+md=solve(md,'diagnostic','ice');
+vel_hutter=md.vel;
+
+
+
+%Load old velocities and compare with the new model
+
+%Macayeal
+load archive_macayeal
+pos=find(archive_macayeal-vel_macayeal);
+error_vel=abs(norm((archive_macayeal(pos)-vel_macayeal(pos))./archive_macayeal(pos),2));
+
+disp(sprintf('numerical difference between old and new version of MacAyeal is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR.  Results from MacAyeal model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from MacAyeal model are comform with the archive version'));
+end
+
+%Ice
+load archive_ice
+pos=find(archive_ice-vel_ice);
+error_vel=abs(norm((archive_ice(pos)-vel_ice(pos))./archive_ice(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Ice model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Ice model are comform with the archive version'));
+end
+
+%Accelerated Ice
+load archive_acc
+pos=find(archive_acc-vel_acc);
+error_vel=abs(norm((archive_acc(pos)-vel_acc(pos))./archive_ice(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Accelerated Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Accelerated Ice model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Accelerated Ice model are comform with the archive version'));
+end
+
+%Ice prognostic
+load archive_thickness
+pos=find(archive_thickness-thickness);
+error_thickness=abs(norm((archive_thickness(pos)-thickness(pos))./archive_thickness(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_thickness));
+
+if (error_thickness>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from prognostic model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from prognostic model are comform with the archive version'));
+end
+
+%Ice with MacAyeal and Hutter elements
+load archive_hutter
+pos=find(archive_hutter-vel_hutter);
+error_vel=abs(norm((archive_hutter(pos)-vel_hutter(pos))./archive_ice(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Ice model with MacAyeal and Hutter elements differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Ice model with MacAyeal and Hutter elements are comform with the archive version'));
+end
Index: /issm/trunk/test/Verification/test2_icesheet_icefront/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test2_icesheet_icefront/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test2_icesheet_icefront/updatearchive.m	(revision 1)
@@ -0,0 +1,50 @@
+% This file can be run to update the velocity archives  of the test1.
+% This test deals with an icesheet with icefront for a 2d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=setelementstype(md,'macayeal','all');
+
+%Compute solution with MacAyeal's model
+md=solve(md,'diagnostic','macayeal');
+archive_macayeal=md.vel;
+
+%Save the solution in the directory
+save archive_macayeal archive_macayeal
+
+%Compute solution with Ice model
+md.acceleration=0;
+md=solve(md,'diagnostic','ice');
+archive_ice=md.vel;
+
+%Save the solution in the directory
+save archive_ice archive_ice
+
+%Compute solution with accelerated Ice model
+md.acceleration=1;
+md=solve(md,'diagnostic','ice');
+archive_acc=md.vel;
+
+%Save the solution in the directory
+save archive_acc archive_acc
+
+%Compute prognostic with Ice model
+md=solve(md,'prognostic','ice');
+archive_thickness=md.new_thickness;
+
+%Save the new thickness in the directory
+save archive_thickness archive_thickness
+
+%Compute solution with MacAyeal and Hutter elements in Ice model
+md=setelementstype(md,'fill','macayeal','Hutter','Hutter.exp');
+md=solve(md,'diagnostic','ice');
+archive_hutter=md.vel;
+
+%Save the solution in the directory
+save archive_hutter archive_hutter
Index: /issm/trunk/test/Verification/test3_iceshelf_icefront/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test3_iceshelf_icefront/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test3_iceshelf_icefront/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test3_iceshelf_icefront/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test3_iceshelf_icefront/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test3_iceshelf_icefront/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test3_iceshelf_icefront/Square.par
===================================================================
--- /issm/trunk/test/Verification/test3_iceshelf_icefront/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test3_iceshelf_icefront/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=10*ones(md.numberofgrids,1); %10m/a
+	md.melting=0*ones(md.numberofgrids,1); %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test3_iceshelf_icefront/runme.m
===================================================================
--- /issm/trunk/test/Verification/test3_iceshelf_icefront/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test3_iceshelf_icefront/runme.m	(revision 1)
@@ -0,0 +1,100 @@
+% This file can be run to check that the current version of macayeal and ice models are giving 
+% coherent results. This test deals with an iceshelf with icefront for a 2d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test3_iceshelf_icefront: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=setelementstype(md,'macayeal','all');
+
+%Compute solution with MacAyeal's model
+md=solve(md,'diagnostic','macayeal');
+vel_macayeal=md.vel;
+
+%Compute solution with Ice model
+md.acceleration=0;
+md=solve(md,'diagnostic','ice');
+vel_ice=md.vel;
+
+%Compute solution with accelerated Ice model
+md.acceleration=1;
+md=solve(md,'diagnostic','ice');
+vel_acc=md.vel;
+
+%Compute prognostic with Ice model
+md=solve(md,'prognostic','ice');
+thickness=md.new_thickness;
+
+
+
+%Load old velocities and compare with the new model
+
+%Macayeal
+load archive_macayeal
+pos=find(archive_macayeal-vel_macayeal);
+error_vel=abs(norm((archive_macayeal(pos)-vel_macayeal(pos))./archive_macayeal(pos),2));
+
+disp(sprintf('numerical difference between old and new version of MacAyeal is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR.  Results from MacAyeal model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from MacAyeal model are comform with the archive version'));
+end
+
+%Ice
+load archive_ice
+pos=find(archive_ice-vel_ice);
+error_vel=abs(norm((archive_ice(pos)-vel_ice(pos))./archive_ice(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Ice model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Ice model are comform with the archive version'));
+end
+
+%Accelerated Ice
+load archive_acc
+pos=find(archive_acc-vel_acc);
+error_vel=abs(norm((archive_acc(pos)-vel_acc(pos))./archive_ice(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Accelerated Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Accelerated Ice model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Accelerated Ice model are comform with the archive version'));
+end
+
+%Ice prognostic
+load archive_thickness
+pos=find(archive_thickness-thickness);
+error_thickness=abs(norm((archive_thickness(pos)-thickness(pos))./archive_thickness(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_thickness));
+
+if (error_thickness>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from prognostic model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from prognostic model are comform with the archive version'));
+end
+
+
Index: /issm/trunk/test/Verification/test3_iceshelf_icefront/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test3_iceshelf_icefront/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test3_iceshelf_icefront/updatearchive.m	(revision 1)
@@ -0,0 +1,44 @@
+% This file can be run to update the velocity archives  of the test3.
+% This test deals with an iceshelf with icefront for a 2d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',50000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=setelementstype(md,'macayeal','all');
+
+%Compute solution with MacAyeal's model
+md=solve(md,'diagnostic','macayeal');
+archive_macayeal=md.vel;
+
+%Save the solution in the directory
+save archive_macayeal archive_macayeal
+
+%Compute solution with Ice model
+md.acceleration=0;
+md=solve(md,'diagnostic','ice');
+archive_ice=md.vel;
+
+%Save the solution in the directory
+save archive_ice archive_ice
+
+%Compute solution with accelerated Ice model
+md.acceleration=1;
+md=solve(md,'diagnostic','ice');
+archive_acc=md.vel;
+
+%Save the solution in the directory
+save archive_acc archive_acc
+
+%Compute prognostic with Ice model
+md=solve(md,'prognostic','ice');
+archive_thickness=md.new_thickness;
+
+%Save the new thickness in the directory
+save archive_thickness archive_thickness
+
+
Index: /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/Front.exp	(revision 1)
@@ -0,0 +1,7 @@
+## Name:noicefront
+## Icon:0
+# Points Count  Value
+1 1.
+# X pos Y pos
+0 0
+
Index: /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/Square.par
===================================================================
--- /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/runme.m
===================================================================
--- /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/runme.m	(revision 1)
@@ -0,0 +1,94 @@
+% This file can be run to check that the current version of pattyn model is giving 
+% coherent results. This test deals with an icesheet without icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test4_icesheet_noicefront_3d: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+vel_pattyn=md.vel;
+
+%Load old velocities and compare with the new model
+load archive_pattyn
+pos=find(archive_pattyn-vel_pattyn);
+error_vel=abs(norm((archive_pattyn(pos)-vel_pattyn(pos))./archive_pattyn(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Pattyn model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Pattyn model are comform with the archive version'));
+end
+
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+temp_pattyn=md.temperature;
+melting_pattyn=md.melting;
+
+%Load old temperatures and compare with the new model
+load archive_temperature
+post=find(archive_temperature-temp_pattyn);
+error_temp=abs(norm((archive_temperature(post)-temp_pattyn(post))./archive_temperature(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+
+if (error_temp>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from thermal model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from thermal model are comform with the archive version'));
+end
+
+%Load old meltings and compare with the new model
+load archive_melting
+post=find(archive_melting-melting_pattyn);
+error_melting=abs(norm((archive_melting(post)-melting_pattyn(post))./archive_melting(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+
+if (error_melting>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting model are comform with the archive version'));
+end
+
+%Compute solution for Hutter elements only
+md=setelementstype(md,'hutter','all');
+md=solve(md,'diagnostic','ice');
+vel_hutter=md.vel;
+
+%Load old velocities for hutter and compare with the new model
+load archive_hutter
+pos=find(archive_hutter-vel_hutter);
+error_vel=abs(norm((archive_hutter(pos)-vel_hutter(pos))./archive_hutter(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Hutter model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Hutter model are comform with the archive version'));
+end
+
+
Index: /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test4_icesheet_noicefront_3d/updatearchive.m	(revision 1)
@@ -0,0 +1,38 @@
+% This file can be run to update the velocity archives  of the test4.
+% This test deals with an icesheet without icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+archive_pattyn=md.vel;
+
+%Save the solution in the directory
+save archive_pattyn archive_pattyn
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+archive_temperature=md.temperature;
+archive_melting=md.melting;
+
+%Save the solution in the directory
+save archive_temperature archive_temperature
+save archive_melting archive_melting
+
+%Compute solution with Ice model
+md=setelementstype(md,'hutter','all');
+md=solve(md,'diagnostic','ice');
+archive_hutter=md.vel;
+
+%Save the solution in the directory
+save archive_hutter archive_hutter
+
Index: /issm/trunk/test/Verification/test5_icesheet_icefront_3d/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test5_icesheet_icefront_3d/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test5_icesheet_icefront_3d/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test5_icesheet_icefront_3d/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test5_icesheet_icefront_3d/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test5_icesheet_icefront_3d/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test5_icesheet_icefront_3d/Square.par
===================================================================
--- /issm/trunk/test/Verification/test5_icesheet_icefront_3d/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test5_icesheet_icefront_3d/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*1; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness+10;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test5_icesheet_icefront_3d/runme.m
===================================================================
--- /issm/trunk/test/Verification/test5_icesheet_icefront_3d/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test5_icesheet_icefront_3d/runme.m	(revision 1)
@@ -0,0 +1,124 @@
+% This file can be run to check that the current version of pattyn model is giving 
+% coherent results. This test deals with an icesheet with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test5_icesheet_icefront_3d: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+vel_pattyn=md.vel;
+
+
+
+%Load old velocities and compare with the new model
+load archive_pattyn
+pos=find(archive_pattyn-vel_pattyn);
+error_vel=abs(norm((archive_pattyn(pos)-vel_pattyn(pos))./archive_pattyn(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR.  Results from Pattyn model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Pattyn model are comform with the archive version'));
+end
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+temp_pattyn=md.temperature;
+melting_pattyn=md.melting;
+
+%Load old temperature and compare with the new model
+load archive_temperature
+post=find(archive_temperature-temp_pattyn);
+error_temp=abs(norm((archive_temperature(post)-temp_pattyn(post))./archive_temperature(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+
+if (error_temp>tolerance);
+        logoutput(logstring,sprintf('%s\n','    ERROR. Results from Thermal model differ from the archive version'));
+else
+        logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Thermal model are comform with the archive version'));
+end
+
+%Load old melting and compare with the new model
+load archive_melting
+post=find(archive_melting-melting_pattyn);
+error_melting=abs(norm((archive_melting(post)-melting_pattyn(post))./archive_melting(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+
+if (error_melting>tolerance);
+        logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting model differ from the archive version'));
+else
+        logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting model are comform with the archive version'));
+end
+
+%Compute temperature transient with Ice model
+md=solve(md,'thermaltransient','ice');
+temptrans_pattyn=md.thermaltransient_results(2).temperature;
+meltingtrans_pattyn=md.thermaltransient_results(2).melting;
+
+%Load old temperature transient and compare with the new model
+load archive_temperature_transient
+post2=find(archive_temperature_transient);
+error_temp=abs(norm((archive_temperature_transient(post2)-temptrans_pattyn(post2))./archive_temperature_transient(post2),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+
+if (error_temp>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from thermal transient model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from thermal transient model are comform with the archive version'));
+end
+
+%Load old melting transient and compare with the new model
+load archive_melting_transient
+post2=find(archive_melting_transient);
+error_melting_transient=abs(norm((archive_melting_transient(post2)-meltingtrans_pattyn(post2))./archive_melting_transient(post2),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+
+if (error_melting_transient>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting transient model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting transient model are comform with the archive version'));
+end
+
+%Compute prognostic with Ice model
+md=solve(md,'prognostic','ice');
+thickness=md.new_thickness;
+
+%Load old temperature transient and compare with the new model
+load archive_thickness
+posth=find(archive_thickness);
+error_thickness=abs(norm((archive_thickness(posth)-thickness(posth))./archive_thickness(posth),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_thickness));
+
+if (error_thickness>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from prognostic model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from prognostic model are comform with the archive version'));
+end
+
Index: /issm/trunk/test/Verification/test5_icesheet_icefront_3d/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test5_icesheet_icefront_3d/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test5_icesheet_icefront_3d/updatearchive.m	(revision 1)
@@ -0,0 +1,46 @@
+% This file can be run to update the velocity archives  of the test5.
+% This test deals with an icesheet with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+archive_pattyn=md.vel;
+
+%Save the solution in the directory
+save archive_pattyn archive_pattyn
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+archive_temperature=md.temperature;
+archive_melting=md.melting;
+
+%Save the temperature and melting in the directory
+save archive_temperature archive_temperature
+save archive_melting archive_melting
+
+%Compute temperature transient with Ice model
+md=solve(md,'thermaltransient','ice');
+archive_temperature_transient=md.thermaltransient_results(2).temperature;
+archive_melting_transient=md.thermaltransient_results(2).melting;
+
+%Save the temperature and melting transient in the directory
+save archive_temperature_transient archive_temperature_transient
+save archive_melting_transient archive_melting_transient
+
+%Compute prognostic with Ice model
+md=solve(md,'prognostic','ice');
+archive_thickness=md.new_thickness;
+
+%Save the new thickness in the directory
+save archive_thickness archive_thickness
+
Index: /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/Square.par
===================================================================
--- /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*1; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/runme.m
===================================================================
--- /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/runme.m	(revision 1)
@@ -0,0 +1,124 @@
+% This file can be run to check that the current version of Pattyn model is giving 
+% coherent results. This test deals with an iceshelf with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test6_iceshelf_icefront_3d: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+vel_pattyn=md.vel;
+
+%Load old velocities and compare with the new model
+load archive_pattyn
+pos=find(archive_pattyn);
+error_vel=abs(norm((archive_pattyn(pos)-vel_pattyn(pos))./archive_pattyn(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Pattyn model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Pattyn model are comform with the archive version'));
+end
+
+
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+temp_pattyn=md.temperature;
+melting_pattyn=md.melting;
+
+%Load old temperature and compare with the new model
+load archive_temperature
+post=find(archive_temperature);
+error_temp=abs(norm((archive_temperature(post)-temp_pattyn(post))./archive_temperature(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+
+if (error_temp>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from thermal model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from thermal model are comform with the archive version'));
+end
+
+%Load old melting and compare with the new model
+load archive_melting
+post=find(archive_melting);
+error_melting=abs(norm((archive_melting(post)-melting_pattyn(post))./archive_melting(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+
+if (error_melting>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting model are comform with the archive version'));
+end
+
+%Compute temperature transient with Ice model
+md=solve(md,'thermaltransient','ice');
+temptrans_pattyn=md.thermaltransient_results(2).temperature;
+meltingtrans_pattyn=md.thermaltransient_results(2).melting;
+
+%Load old temperature transient and compare with the new model
+load archive_temperature_transient
+post2=find(archive_temperature_transient);
+error_temp=abs(norm((archive_temperature_transient(post2)-temptrans_pattyn(post2))./archive_temperature_transient(post2),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+
+if (error_temp>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from thermal transient model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from thermal transient model are comform with the archive version'));
+end
+
+%Load old melting transient and compare with the new model
+load archive_melting_transient
+post2=find(archive_melting_transient);
+error_melting_transient=abs(norm((archive_melting_transient(post2)-meltingtrans_pattyn(post2))./archive_melting_transient(post2),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+
+if (error_melting_transient>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting transient model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting transient model are comform with the archive version'));
+end
+
+%Compute prognostic with Ice model
+md=solve(md,'prognostic','ice');
+thickness=md.new_thickness;
+
+%Load old temperature transient and compare with the new model
+load archive_thickness
+posth=find(archive_thickness);
+error_thickness=abs(norm((archive_thickness(posth)-thickness(posth))./archive_thickness(posth),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_thickness));
+
+if (error_thickness>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from prognostic model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from prognostic model are comform with the archive version'));
+end
+
Index: /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test6_iceshelf_icefront_3d/updatearchive.m	(revision 1)
@@ -0,0 +1,45 @@
+% This test deals with an iceshelf with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+archive_pattyn=md.vel;
+
+%Save the solution in the directory
+save archive_pattyn archive_pattyn
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+archive_temperature=md.temperature;
+archive_melting=md.melting;
+
+%Save the temperature and melting in the directory
+save archive_temperature archive_temperature
+save archive_melting archive_melting
+
+%Compute temperature transient with Ice model
+md=solve(md,'thermaltransient','ice');
+archive_temperature_transient=md.thermaltransient_results(2).temperature;
+archive_melting_transient=md.thermaltransient_results(2).melting;
+
+%Save the temperature and melting transient in the directory
+save archive_temperature_transient archive_temperature_transient
+save archive_melting_transient archive_melting_transient
+
+%Compute prognostic with Ice model
+md=solve(md,'prognostic','ice');
+archive_thickness=md.new_thickness;
+
+%Save the new thickness in the directory
+save archive_thickness archive_thickness
+
Index: /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/Pattyn.exp
===================================================================
--- /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/Pattyn.exp	(revision 1)
+++ /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/Pattyn.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+500001 0
+500001 1000001
+0 1000001
+0 0
Index: /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/Square.par
===================================================================
--- /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/iceshelf.exp
===================================================================
--- /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/iceshelf.exp	(revision 1)
+++ /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/iceshelf.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:iceshelf
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1 -1
+1000001 -1
+1000001 1000001
+-1 1000001
+-1 -1
Index: /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/runme.m
===================================================================
--- /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/runme.m	(revision 1)
@@ -0,0 +1,72 @@
+% This file can be run to check that the current version of Pattyn model is giving 
+% coherent results. This test deals with an iceshelf with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test7_penalties_iceshelf_3d: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','Pattyn.exp','fill','macayeal');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+velocity=md.vel;
+
+%Load old velocities and compare with the new model
+load archive_velocity 
+pos=find(archive_velocity-velocity);
+error_vel=abs(norm((archive_velocity(pos)-velocity(pos))./archive_velocity(pos),2));
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from diagnostic model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from diagnostic model are comform with the archive version'));
+end
+
+
+
+%Compute solution with Ice model
+md=solve(md,'thermalsteady','ice');
+temperature=md.temperature;
+melting=md.melting;
+
+%Load old velocities and compare with the new model
+load archive_temperature
+post=find(archive_temperature-temperature);
+error_temp=abs(norm((archive_temperature(post)-temperature(post))./archive_temperature(post),2));
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+if (error_temp>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from thermal model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from thermal model are comform with the archive version'));
+end
+
+%Load old velocities and compare with the new model
+load archive_melting
+post=find(archive_melting-melting);
+error_melting=abs(norm((archive_melting(post)-melting(post))./archive_melting(post),2));
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+if (error_melting>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting model are comform with the archive version'));
+end
+
+
+
Index: /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test7_penalties_iceshelf_3d/updatearchive.m	(revision 1)
@@ -0,0 +1,29 @@
+% This file can be run to update the velocity archives  of the test7.
+% This test deals with an iceshelf with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','Pattyn.exp','fill','macayeal');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+archive_velocity=md.vel;
+
+%Save the solution in the directory
+save archive_velocity  archive_velocity 
+
+%Compute solution with Ice model
+md=solve(md,'thermalsteady','ice');
+archive_temperature=md.temperature;
+archive_melting=md.melting;
+
+%Save the solution in the directory
+save archive_temperature archive_temperature
+save archive_melting archive_melting
Index: /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/Front.exp	(revision 1)
@@ -0,0 +1,7 @@
+## Name:noicefront
+## Icon:0
+# Points Count  Value
+1 1.
+# X pos Y pos
+0 0
+
Index: /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/Square.par
===================================================================
--- /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness+10;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/runme.m
===================================================================
--- /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/runme.m	(revision 1)
@@ -0,0 +1,75 @@
+% This file can be run to check that the current version of pattyn model is giving 
+% coherent results. This test deals with an icesheet without icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test8_icesheet_noicefront_stokes: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'macayeal','all','stokes','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+vel_stokes=md.vel;
+
+
+%Load old velocities and compare with the new model
+load archive_stokes
+pos=find(archive_stokes-vel_stokes);
+error_vel=abs(norm((archive_stokes(pos)-vel_stokes(pos))./archive_stokes(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from Stokes model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Stokes model are comform with the archive version'));
+end
+
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+temp_stokes=md.temperature;
+melting_stokes=md.melting;
+
+%Load old temperatures and compare with the new model
+load archive_temperature
+post=find(archive_temperature-temp_stokes);
+error_temp=abs(norm((archive_temperature(post)-temp_stokes(post))./archive_temperature(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+
+if (error_temp>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from thermal model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from thermal model are comform with the archive version'));
+end
+
+%Load old melting and compare with the new model
+load archive_melting
+post=find(archive_melting-melting_stokes);
+error_melting=abs(norm((archive_melting(post)-melting_stokes(post))./archive_melting(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+
+if (error_melting>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting model are comform with the archive version'));
+end
Index: /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test8_icesheet_noicefront_stokes/updatearchive.m	(revision 1)
@@ -0,0 +1,29 @@
+% This file can be run to update the velocity archives  of the test8.
+% This test deals with an icesheet without icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'macayeal','all','stokes','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+archive_stokes=md.vel;
+
+%Save the solution in the directory
+save archive_stokes archive_stokes
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+archive_temperature=md.temperature;
+archive_melting=md.melting;
+
+%Save the solution in the directory
+save archive_melting archive_melting
+save archive_temperature archive_temperature
Index: /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/Square.par
===================================================================
--- /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/Square.par	(revision 1)
@@ -0,0 +1,124 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=2;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=10;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=5;
+	md.tolx=10^-4;
+	md.maxiter=20;
+	md.optscal=10;
+	md.fit='logarithmic'; %'absolute','relative','logarithmic'
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness+10;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/runme.m
===================================================================
--- /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/runme.m	(revision 1)
@@ -0,0 +1,75 @@
+% This file can be run to check that the current version of pattyn model is giving 
+% coherent results. This test deals with an icesheet with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%Initialize log message for nightly runs.
+logstring='Verification/test9_icesheet_icefront_stokes: ';
+
+% Create model;
+
+tolerance=10^-13;
+
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all','stokes','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+vel_stokes=md.vel;
+
+
+
+%Load old velocities and compare with the new model
+load archive_stokes
+pos=find(archive_stokes-vel_stokes);
+error_vel=abs(norm((archive_stokes(pos)-vel_stokes(pos))./archive_stokes(pos),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
+
+if (error_vel>tolerance);
+	logoutput(logstring,sprintf('%s\n','    ERROR.  Results from Stokes model differ from the archive version'));
+else
+	logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Stokes model are comform with the archive version'));
+end
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+temp_stokes=md.temperature;
+melting_stokes=md.melting;
+
+%Load old temperature velocities and compare with the new model
+load archive_temperature
+post=find(archive_temperature-temp_stokes);
+error_temp=abs(norm((archive_temperature(post)-temp_stokes(post))./archive_temperature(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
+
+if (error_temp>tolerance);
+        logoutput(logstring,sprintf('%s\n','    ERROR. Results from Thermal model differ from the archive version'));
+else
+        logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from Thermal model are comform with the archive version'));
+end
+
+%Load old melting velocities and compare with the new model
+load archive_melting
+post=find(archive_melting-melting_stokes);
+error_melting=abs(norm((archive_melting(post)-melting_stokes(post))./archive_melting(post),2));
+
+disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
+
+if (error_melting>tolerance);
+        logoutput(logstring,sprintf('%s\n','    ERROR. Results from melting model differ from the archive version'));
+else
+        logoutput(logstring,sprintf('%s\n','    SUCCESS. Results from melting model are comform with the archive version'));
+end
Index: /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/updatearchive.m	(revision 1)
+++ /issm/trunk/test/Verification/test9_icesheet_icefront_stokes/updatearchive.m	(revision 1)
@@ -0,0 +1,29 @@
+% This file can be run to update the velocity archives  of the test9.
+% This test deals with an icesheet with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all','stokes','all');
+
+%Compute solution with Ice model
+md=solve(md,'diagnostic','ice');
+archive_stokes=md.vel;
+
+%Save the solution in the directory
+save archive_stokes archive_stokes
+
+%Compute temperature with Ice model
+md=solve(md,'thermalsteady','ice');
+archive_temperature=md.temperature;
+archive_melting=md.melting;
+
+%Save the solution in the directory
+save archive_temperature archive_temperature
+save archive_melting archive_melting
Index: /issm/trunk/test/Verification/test_cielo/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test_cielo/DomainOutline.exp	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/DomainOutline.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test_cielo/DomainOutlineRifts.exp
===================================================================
--- /issm/trunk/test/Verification/test_cielo/DomainOutlineRifts.exp	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/DomainOutlineRifts.exp	(revision 1)
@@ -0,0 +1,13 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+8 1.
+# X pos Y pos
+0 0
+450000 0
+500000 300000
+550000 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/test_cielo/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test_cielo/Front.exp	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/Front.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test_cielo/IceShelf.exp
===================================================================
--- /issm/trunk/test/Verification/test_cielo/IceShelf.exp	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/IceShelf.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:iceshelf
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1 -1
+1000001 -1
+1000001 1000001
+-1 1000001
+-1 -1
Index: /issm/trunk/test/Verification/test_cielo/Pattyn.exp
===================================================================
--- /issm/trunk/test/Verification/test_cielo/Pattyn.exp	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/Pattyn.exp	(revision 1)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+500001 0
+500001 1000001
+0 1000001
+0 0
Index: /issm/trunk/test/Verification/test_cielo/Rifts.exp
===================================================================
--- /issm/trunk/test/Verification/test_cielo/Rifts.exp	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/Rifts.exp	(revision 1)
@@ -0,0 +1,23 @@
+## Name:Rifts2
+## Icon:0
+# Points Count  Value
+2 1.000000
+# X pos Y pos
+500000 320000
+500000 700000
+
+## Name:Rifts3
+## Icon:0
+# Points Count  Value
+2 1.000000
+# X pos Y pos
+400000 300000
+200000 600000
+
+## Name:Rifts4
+## Icon:0
+# Points Count  Value
+2 1.000000
+# X pos Y pos
+600000 300000
+800000 600000
Index: /issm/trunk/test/Verification/test_cielo/Square.lock
===================================================================
--- /issm/trunk/test/Verification/test_cielo/Square.lock	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/Square.lock	(revision 1)
@@ -0,0 +1,1 @@
+1
Index: /issm/trunk/test/Verification/test_cielo/Square.par
===================================================================
--- /issm/trunk/test/Verification/test_cielo/Square.par	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/Square.par	(revision 1)
@@ -0,0 +1,125 @@
+
+%Ok, start defining model parameters here
+
+%material parameters
+	md.g=9.8;
+	md.rho_ice=917;
+	md.rho_water=1023;
+	di=md.rho_ice/md.rho_water;
+	md.yts=365*24*3600;
+	md.heatcapacity=2009;
+	md.thermalconductivity=2.2; %W/mK
+	md.beta=9.8*10^-8;
+
+%Solution parameters
+	%parallelization 
+	md.cluster='none';
+	md.np=3;
+	md.time=1;
+	md.exclusive=0;
+
+	%statics
+	md.lowmem=1;
+	md.eps_rel=0.01;
+	md.eps_abs=NaN;
+	md.penalty_offset=3;
+	md.penalty_melting=10^7;
+	if md.numberofgrids<1000000,
+	md.sparsity=.001;
+	else
+	md.sparsity=.0001;
+	end
+	md.solverstring=' -mat_type aijmumps -ksp_type preonly -pc_type lu -mat_mumps_icntl_14 40 ';
+
+	%dynamics
+	md.dt=1*md.yts; %1 year
+	md.ndt=md.dt*10; 
+	md.artificial_diffusivity=1;
+
+	%control
+	md.control_type={'drag'}; %'drag', 'B'
+	md.nsteps=2;
+	md.tolx=10^-4;
+	md.maxiter=10*ones(md.nsteps,1);
+	md.optscal=10*ones(md.nsteps,1);
+	md.fit=2*ones(md.nsteps,1);
+	md.meanvel=1000/md.yts; %1000 meters/year
+	md.epsvel=eps;
+
+
+	disp('      creating thickness');
+	hmin=300;
+	hmax=1000;
+	ymin=min(md.y);
+	ymax=max(md.y);
+	md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+	md.firn_layer=10*ones(md.numberofgrids,1);
+	md.bed=-di*md.thickness;
+	md.surface=md.bed+md.thickness;
+
+	disp('      creating velocities');
+	md.vx_obs=zeros(md.numberofgrids,1);
+	md.vy_obs=zeros(md.numberofgrids,1);
+	md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
+	
+	disp('      creating drag');
+	md.drag_type=2; %0 none 1 plastic 2 viscous
+	md.drag=200*ones(md.numberofgrids,1); %q=1.
+	%Take care of iceshelves: no basal drag
+	pos=find(md.elementoniceshelf);
+	md.drag(md.elements(pos,:))=0;
+	md.p=ones(md.numberofelements,1);
+	md.q=ones(md.numberofelements,1);
+
+	disp('      creating temperature');
+	md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+	disp('      creating flow law paramter');
+	md.B=paterson(md.observed_temperature);
+	md.n=3*ones(md.numberofelements,1);
+
+	disp('      creating accumulation rates');
+	md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
+	md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
+
+	%Deal with boundary conditions:
+	
+	disp('      boundary conditions for diagnostic model: ');
+	%Build gridonicefront, array of boundary grids belonging to the icefront:
+	gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
+	gridonicefront=double(md.gridonboundary & gridinsideicefront);
+
+	md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+	pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
+	md.dirichletvalues_diag=zeros(md.numberofgrids,2);
+
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_diag=md.segments(pos,:);
+	md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
+
+	disp('      boundary conditions for prognostic model: ');
+	md.gridondirichlet_prog=zeros(md.numberofgrids,1);
+	md.dirichletvalues_prog=zeros(md.numberofgrids,1);
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog=md.segments(pos,:);
+	md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
+	md.neumannvalues_prog(:)=NaN; %free radiation
+	
+	pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
+	md.segmentonneumann_prog2=md.segments(pos,:);
+	md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
+	md.neumannvalues_prog2(:)=NaN; %free radiation
+	
+	disp('      boundary conditions for thermal model: ');
+	md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+	md.dirichletvalues_thermal=md.observed_temperature;
+	md.geothermalflux=zeros(md.numberofgrids,1); 
+	pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
+
+
+	
+
+% Some Cielo code, ignore.
+if strcmp(md.cluster,'yes')
+	ServerDisconnect;
+end   
Index: /issm/trunk/test/Verification/test_cielo/Square.queue
===================================================================
--- /issm/trunk/test/Verification/test_cielo/Square.queue	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/Square.queue	(revision 1)
@@ -0,0 +1,3 @@
+#!/bin/sh
+rm -rf /home/larour/Testing/Execution/Square.lock
+mpirun -np 3 /home/larour/Ice/ice1/bin/cielodiagnostic.exe /home/larour/Testing/Execution Square.bin Square.outbin Square.lock 2> Square.errlog >Square.outlog & 
Index: /issm/trunk/test/Verification/test_cielo/runme.m
===================================================================
--- /issm/trunk/test/Verification/test_cielo/runme.m	(revision 1)
+++ /issm/trunk/test/Verification/test_cielo/runme.m	(revision 1)
@@ -0,0 +1,172 @@
+% Create model;
+
+update_archive=0;
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+
+%First test macayeal: 
+md=setelementstype(md,'macayeal','all');
+error;
+
+md.cluster='wilkes';
+
+md=solve(md,'diagnostic_horiz','cielo'); pause(10);
+md=loadresultsfromcluster(md,'diagnostic_horiz');
+vel_cielo=md.vel;
+
+if update_archive,
+	vel_nightly=vel_cielo;
+	save diagnostic_horiz_macayeal  vel_nightly
+end
+
+load diagnostic_horiz_macayeal 
+
+plotmodel(md,'data',vel_nightly,'title','diagnostic_horiz_macayeal','data',vel_cielo,'data',vel_nightly-vel_cielo,'data',(vel_nightly-vel_cielo)./vel_nightly*100,'figure',1);
+
+
+%Then test full pattyn
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,3,3);
+
+md=setelementstype(md,'pattyn','all');
+
+md.cluster='wilkes';
+
+md=solve(md,'diagnostic_horiz','cielo'); pause(10);
+md=loadresultsfromcluster(md,'diagnostic_horiz');
+vel_cielo=md.vel;
+
+if update_archive,
+	vel_nightly=vel_cielo;
+	save diagnostic_horiz_pattyn  vel_nightly
+end
+
+load diagnostic_horiz_pattyn
+
+plotmodel(md,'data',vel_nightly,'title','diagnostic_horiz_pattyn','data',vel_cielo,'data',vel_nightly-vel_cielo,'data',(vel_nightly-vel_cielo)./vel_nightly*100,'figure',2);
+
+%Then test mixed macayeal pattyn
+
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=extrude(md,3,3);
+
+md=setelementstype(md,'pattyn','Pattyn.exp','fill','macayeal');
+
+md.cluster='wilkes';
+
+md=solve(md,'diagnostic_horiz','cielo'); pause(10);
+md=loadresultsfromcluster(md,'diagnostic_horiz');
+vel_cielo=md.vel;
+
+if update_archive,
+	vel_nightly=vel_cielo;
+	save diagnostic_horiz_mixed  vel_nightly
+end
+
+load diagnostic_horiz_mixed
+
+plotmodel(md,'data',vel_nightly,'title','diagnostic_horiz_mixed','data',vel_cielo,'data',vel_nightly-vel_cielo,'data',(vel_nightly-vel_cielo)./vel_nightly*100,'figure',3,'layer#all',1);
+
+%Now test macayeal with rifts
+md=model;
+md=mesh(md,'DomainOutlineRifts.exp','Rifts.exp',50000);
+md=rifttipsrefine(md,5000,80000);
+md=meshprocessrifts(md);
+
+md=geography(md,'all','');
+md=parameterize(md,'Square.par');
+md=setelementstype(md,'macayeal','all');
+
+
+md.cluster='wilkes';
+
+md=solve(md,'diagnostic_horiz','cielo'); pause(10);
+md=loadresultsfromcluster(md,'diagnostic_horiz');
+vel_cielo=md.vel;
+
+
+if update_archive,
+	vel_nightly=vel_cielo;
+	save diagnostic_horiz_rifts  vel_nightly
+end
+
+load diagnostic_horiz_rifts
+
+s=shearnorm2d(md);
+plotmodel(md,'data','vel','title','diagnostic_horiz_rifts','data',log10(s),'data','riftpenetration','data','riftvel','figure',4);
+plotmodel(md,'data',vel_nightly,'data',vel_cielo,'data',vel_nightly-vel_cielo,'data',(vel_nightly-vel_cielo)./vel_nightly*100,'figure',5);
+
+%Now test thermal
+md=model;
+md=mesh(md,'DomainOutline.exp',100000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,10,3);
+md=setelementstype(md,'pattyn','all');
+
+md.cluster='wilkes';
+
+md.vx=zeros(md.numberofgrids,1);
+md.vy=zeros(md.numberofgrids,1);
+md.vz=zeros(md.numberofgrids,1);
+md.pressure=lithostaticpressure(md.rho_ice,md.g,md.surface,md.thickness);
+
+md=solve(md,'thermalsteady','cielo');pause(10);
+md=loadresultsfromcluster(md,'thermalsteady');
+temperature_cielo=md.temperature;
+
+if update_archive,
+	temperature_nightly=temperature_cielo;
+	save thermalsteady  temperature_nightly
+end
+
+load thermalsteady
+
+plotmodel(md,'data',temperature_nightly,'title','thermalsteady','data',temperature_cielo,'data',temperature_nightly-temperature_cielo,'data',(temperature_nightly-temperature_cielo)./temperature_nightly*100,'figure',6);
+
+
+
+% run control method
+
+update_archive=1;
+
+md=model;
+md=mesh(md,'DomainOutline.exp',30000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=setelementstype(md,'macayeal','all');
+
+md.cluster='wilkes';
+md.np=8;
+md.debug=0;
+
+md.drag(:)=500;
+pos=find(md.y<200000);
+md.drag(pos)=0;
+
+md=solve(md,'diagnostic_horiz','cielo'); pause(10);
+md=loadresultsfromcluster(md,'diagnostic_horiz');
+md.vx_obs=md.vx;
+md.vy_obs=md.vy;
+
+md=solve(md,'control','cielo');pause(60);
+md=loadresultsfromcluster(md,'control');
+Jfit=md.cont_J;
+
+if update_archive
+	save control Jfit
+end
+load  control
+figure(7),plot(md.cont_J,Jfit);
+
+return;
Index: /issm/trunk/todo
===================================================================
--- /issm/trunk/todo	(revision 1)
+++ /issm/trunk/todo	(revision 1)
@@ -0,0 +1,5 @@
+Create sorting routine for ids.
+Update all inputs. Look at that in more details, ie with respect to control methods. When do we do update of inputs?
+J=0 always in control method.
+
+
